@inneranimalmedia/agentsam-sdk 2.6.5 → 2.6.8
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 +29 -0
- package/README.md +37 -0
- package/apps/README.md +5 -0
- package/apps/cad-creator/README.md +4 -4
- package/apps/cad-creator/shared/cad/package.json +1 -1
- package/apps/client-cms-editor/AGENTS.md +12 -7
- package/apps/client-cms-editor/README.md +76 -48
- package/apps/client-cms-editor/agentsam.app.json +26 -9
- package/apps/client-cms-editor/backend/package.json +20 -3
- package/apps/client-cms-editor/backend/src/api/client.ts +134 -101
- package/apps/client-cms-editor/backend/src/index.ts +1 -1
- package/apps/client-cms-editor/backend/src/model.ts +11 -115
- package/apps/client-cms-editor/backend/src/preview/bridge.ts +1 -1
- package/apps/client-cms-editor/backend/tsconfig.json +6 -1
- package/apps/client-cms-editor/bin/agentsam-cms.js +262 -0
- package/apps/client-cms-editor/bin/agentsam-cms.mjs +2 -228
- package/apps/client-cms-editor/frontend/package.json +16 -7
- package/apps/client-cms-editor/frontend/src/AgentSamDrawer.tsx +9 -41
- package/apps/client-cms-editor/frontend/src/CmsAgentSurface.tsx +19 -174
- package/apps/client-cms-editor/frontend/src/adapters/heuristic.ts +29 -0
- package/apps/client-cms-editor/frontend/src/adapters/http.ts +628 -0
- package/apps/client-cms-editor/frontend/src/adapters/memory.ts +510 -0
- package/apps/client-cms-editor/frontend/src/editor/CmsEditor.tsx +213 -0
- package/apps/client-cms-editor/frontend/src/editor/CmsEditorProvider.tsx +20 -0
- package/apps/client-cms-editor/frontend/src/editor/canvas/PreviewCanvas.tsx +53 -0
- package/apps/client-cms-editor/frontend/src/{CmsEditor.tsx → editor/legacy/CmsEditorPrototype.tsx} +52 -23
- package/apps/client-cms-editor/frontend/src/editor/useCmsEditorController.ts +218 -0
- package/apps/client-cms-editor/frontend/src/index.ts +19 -5
- package/apps/client-cms-editor/frontend/src/lib/agent-host.ts +24 -0
- package/apps/client-cms-editor/frontend/src/main.tsx +82 -8
- package/apps/client-cms-editor/frontend/src/mount.tsx +92 -30
- package/apps/client-cms-editor/frontend/src/styles/agentsam-drawer.css +1 -1
- package/apps/client-cms-editor/frontend/src/styles/cmsShell.css +8 -8
- package/apps/client-cms-editor/frontend/src/styles/studio.css +55 -3
- package/apps/client-cms-editor/frontend/tsconfig.json +12 -1
- package/apps/client-cms-editor/frontend/vite.config.ts +12 -0
- package/apps/client-cms-editor/package-lock.json +973 -134
- package/apps/client-cms-editor/package.json +118 -6
- package/apps/client-cms-editor/reference/harvest/HARVEST_RECEIPT.json +201 -0
- package/apps/client-cms-editor/reference/harvest/PROVENANCE_HISTORY.txt +10 -0
- package/apps/client-cms-editor/reference/harvest/README.md +8 -0
- package/apps/client-cms-editor/reference/harvest/plans/ARCHIVE-INTAKE.md +135 -0
- package/apps/client-cms-editor/reference/harvest/plans/CHATGPT-IDENTITY-HARVEST.md +83 -0
- package/apps/client-cms-editor/reference/harvest/plans/CMS-EDITOR-HARVEST.md +166 -0
- package/apps/client-cms-editor/reference/harvest/plans/HARVEST-INDEX.md +196 -0
- package/apps/client-cms-editor/reference/harvest/plans/INNERANIMALS-CONTENT-001.md +137 -0
- package/apps/client-cms-editor/reference/harvest/plans/NO-IMPLICIT-SIDE-EFFECTS.md +87 -0
- package/apps/client-cms-editor/reference/harvest/plans/STOREFRONT-SURFACE-MAP.md +140 -0
- package/apps/client-cms-editor/reference/harvest/plans/THEME-INNERANIMALS-HARVEST.md +137 -0
- package/apps/client-cms-editor/reference/harvest/plans/TOOLING-LAB.md +63 -0
- package/apps/client-cms-editor/reference/harvest/plans/harvest-manifest.json +97 -0
- package/apps/client-cms-editor/reference/harvest/plans/local-cms-harvest-schema.sql +328 -0
- package/apps/client-cms-editor/shared/cms/package.json +17 -7
- package/apps/client-cms-editor/shared/cms/src/adapter.ts +204 -0
- package/apps/client-cms-editor/shared/cms/src/agent-context.ts +7 -5
- package/apps/client-cms-editor/shared/cms/src/editor-types.ts +32 -0
- package/apps/client-cms-editor/shared/cms/src/host.ts +82 -0
- package/apps/client-cms-editor/shared/cms/src/index.ts +4 -0
- package/apps/client-cms-editor/shared/cms/src/map.ts +115 -0
- package/apps/client-cms-editor/shared/cms/src/starter-pack.ts +158 -0
- package/contracts/source-types.v1.json +353 -0
- package/docs/CMS_CONTEXTUAL_COMPOSER.md +1 -1
- package/docs/PRODUCT_LIFECYCLE.md +566 -0
- package/docs/REPO_FILE_MAP.txt +132 -0
- package/docs/THEME_REFINERY.md +2 -2
- package/docs/architecture/AGENTSAM_RUNTIME_PROTOCOL.md +40 -20
- package/docs/content-studio/REVISION_GATE_2026-09-27.md +1 -1
- package/docs/plans/LOCAL_STUDIO_DESKTOP_RELEASE_2026-09-29.md +150 -0
- package/migrations/d1/0017_identity_native_oauth.sql +21 -0
- package/migrations/d1/0018_goap_control_plane_remaster.sql +40 -0
- package/migrations/d1/0019_agentsam_agent_run_plan_todo.sql +14 -0
- package/migrations/d1/README_PORTABLE_CONTROL_PLANE.md +20 -9
- package/migrations/runtime/0002_goap_blackboard_v1.sql +15 -0
- package/migrations/runtime/0004_agent_run_plan_linkage.sql +8 -0
- package/native/agentsam-machine/Cargo.lock +426 -0
- package/native/agentsam-machine/Cargo.toml +9 -0
- package/native/agentsam-machine/cli/Cargo.toml +21 -0
- package/native/agentsam-machine/cli/README.md +21 -0
- package/native/agentsam-machine/cli/src/main.rs +77 -0
- package/native/agentsam-machine/core/Cargo.toml +22 -0
- package/native/agentsam-machine/core/README.md +14 -0
- package/native/agentsam-machine/core/build.rs +33 -0
- package/native/agentsam-machine/core/contracts/source-types.v1.json +353 -0
- package/native/agentsam-machine/core/src/assets.rs +790 -0
- package/native/agentsam-machine/core/src/bound.rs +298 -0
- package/native/agentsam-machine/core/src/enrich.rs +706 -0
- package/native/agentsam-machine/core/src/frontend.rs +442 -0
- package/native/agentsam-machine/core/src/lib.rs +1092 -0
- package/native/agentsam-machine/core/src/liquid.rs +528 -0
- package/native/agentsam-machine/core/src/source_types.rs +78 -0
- package/package.json +64 -24
- package/packages/agentsam-brand/README.md +1 -1
- package/packages/agentsam-brand/package.json +4 -4
- package/packages/agentsam-brand/src/index.js +1 -1
- package/packages/agentsam-contracts/package.json +13 -3
- package/packages/agentsam-contracts/src/tools.ts +22 -0
- package/packages/agentsam-errors/package.json +13 -3
- package/packages/agentsam-errors/src/index.js +1 -0
- package/packages/agentsam-errors/src/tool.js +56 -0
- package/packages/agentsam-errors/test/tool.test.mjs +58 -0
- package/packages/agentsam-goap/README.md +52 -0
- package/packages/agentsam-goap/package.json +37 -0
- package/packages/agentsam-goap/src/adapters/d1-sqlite.js +570 -0
- package/packages/agentsam-goap/src/adapters/memory.js +199 -0
- package/packages/agentsam-goap/src/contracts.js +226 -0
- package/packages/agentsam-goap/src/control-plane.js +112 -0
- package/packages/agentsam-goap/src/errors.js +157 -0
- package/packages/agentsam-goap/src/index.js +5 -0
- package/packages/agentsam-goap/src/world.js +202 -0
- package/packages/agentsam-goap/test/goap-control-plane.test.mjs +245 -0
- package/packages/agentsam-goap/test/world.test.mjs +79 -0
- package/packages/agentsam-knowledge/package.json +18 -4
- package/packages/agentsam-knowledge/src/autorag/index.js +10 -3
- package/packages/agentsam-knowledge/src/backends/index.js +33 -1
- package/packages/agentsam-knowledge/test/autorag.test.mjs +60 -1
- package/packages/agentsam-nav/dist/browser.global.js +21 -18
- package/packages/agentsam-nav/dist/browser.js +6807 -130
- package/packages/agentsam-nav/dist/index.js +6799 -122
- package/packages/agentsam-nav/package.json +24 -6
- package/packages/agentsam-queue-control/README.md +1 -1
- package/packages/agentsam-queue-control/package.json +7 -2
- package/packages/agentsam-rapid-rust/src/main.rs +1 -1
- package/packages/agentsam-repository/package.json +13 -3
- package/packages/agentsam-repository/src/goap.js +13 -14
- package/packages/agentsam-repository/src/source-types.js +8 -0
- package/packages/agentsam-repository/src/tickets.js +15 -22
- package/packages/agentsam-repository/test/goap-tickets-workspace-state.test.mjs +19 -8
- package/packages/agentsam-vault/package.json +14 -4
- package/packages/agentsam-workbench/package.json +15 -4
- package/packages/agentsam-workbench/src/agent/ToolPermissionRequest.tsx +94 -0
- package/packages/agentsam-workbench/src/agent/index.ts +2 -0
- package/packages/agentsam-workbench/src/agent/tool-permission.css +134 -0
- package/packages/connectors/cloudflare/package.json +15 -3
- package/packages/connectors/cloudflare/src/api-client.js +3 -2
- package/packages/connectors/cloudflare/src/families/vectorize.js +127 -0
- package/packages/connectors/cloudflare/src/index.js +1 -0
- package/packages/heuristic-theme/README.md +2 -2
- package/packages/heuristic-theme/package.json +8 -3
- package/packages/heuristic-theme/src/registry.js +2 -2
- package/packages/heuristic-theme/src/theme.js +1 -1
- package/packages/heuristic-theme/test/theme.test.mjs +1 -1
- package/packages/identity/.agentsam/features/oauth-login-portal/agentsam.feature.json +1 -1
- package/packages/identity/.agentsam/features/oauth-login-portal/providers.json +27 -7
- package/packages/identity/README.md +2 -2
- package/packages/identity/migrations/D1_SCHEMA_MAPPING.md +18 -15
- package/packages/identity/migrations/apply-portable.js +109 -0
- package/packages/identity/migrations/sqlite/004_identity_oauth_consent_catalog.sql +1 -1
- package/packages/identity/migrations/sqlite/005_identity_company_native.sql +52 -0
- package/packages/identity/package.json +27 -6
- package/packages/identity/schema/agentsam.identity/manifest.json +101 -0
- package/packages/identity/scripts/local-identity-bridge.mjs +13 -7
- package/packages/identity/scripts/preview-auth-portal.mjs +6 -6
- package/packages/identity/src/adapters/cloudflare-d1/index.js +8 -401
- package/packages/identity/src/adapters/iam-compat/index.js +540 -0
- package/packages/identity/src/adapters/portable-d1/index.js +18 -0
- package/packages/identity/src/adapters/portable-store.js +479 -0
- package/packages/identity/src/adapters/sqlite/index.js +13 -312
- package/packages/identity/src/contracts/auth-config.js +0 -1
- package/packages/identity/src/contracts/identity-store.js +56 -5
- package/packages/identity/src/contracts/provider.js +1 -0
- package/packages/identity/src/contracts/sign-in-options.js +104 -0
- package/packages/identity/src/core/constants.js +1 -1
- package/packages/identity/src/core/session-policy.js +31 -0
- package/packages/identity/src/frontend/auth-portal/pages/login.html +6 -6
- package/packages/identity/src/frontend/auth-portal/pages/reset.html +5 -5
- package/packages/identity/src/frontend/auth-portal/pages/signup.html +5 -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 +6 -37
- package/packages/identity/src/index.js +28 -1
- package/packages/identity/src/migrations/README.md +23 -23
- package/packages/identity/src/oauth/README.md +1 -1
- package/packages/identity/src/oauth/credentials.js +10 -11
- package/packages/identity/src/oauth/google-desktop-exchange.js +195 -27
- package/packages/identity/src/oauth/iam-platform.js +21 -9
- package/packages/identity/src/oauth/native-handoff.js +136 -0
- package/packages/identity/src/providers/chatgpt/headers.js +65 -0
- package/packages/identity/src/providers/chatgpt/index.js +86 -0
- package/packages/identity/src/providers/chatgpt/mapper.js +43 -0
- package/packages/identity/src/providers/chatgpt/paths.js +45 -0
- package/packages/identity/src/providers/github/oauth.js +1 -2
- package/packages/identity/src/providers/github/profile.js +16 -2
- package/packages/identity/src/providers/index.js +11 -3
- package/packages/identity/src/server/identity-service.js +2 -1
- package/packages/identity/src/server/worker-router.js +71 -18
- package/packages/identity/tests/chatgpt-provider.test.mjs +75 -0
- package/packages/identity/tests/google-desktop-identity-login.test.mjs +210 -0
- package/packages/identity/tests/identity-init-scaffold.test.mjs +15 -4
- package/packages/identity/tests/lane1-identity-store-parity.test.mjs +527 -0
- package/packages/identity/tests/lane1-packed-consumer.test.mjs +175 -0
- package/packages/identity/tests/native-oauth-handoff.test.mjs +292 -0
- package/packages/identity/tests/oauth-credentials.test.mjs +4 -4
- package/packages/identity/tests/preview-auth-portal.test.mjs +4 -2
- package/packages/identity/tests/session-routes-policy.test.mjs +13 -1
- package/packages/identity/tests/worker-runtime-boundary.test.mjs +11 -0
- package/packages/providers/completeful/package.json +7 -2
- package/packages/theme-church-site/package.json +17 -6
- package/packages/theme-church-site/src/harvest.json +4 -2
- package/packages/theme-church-site/src/index.js +7 -3
- package/packages/theme-church-site/test/theme.test.mjs +4 -2
- package/packages/theme-companions-site/package.json +17 -6
- package/packages/theme-companions-site/src/harvest.json +4 -2
- package/packages/theme-companions-site/src/index.js +7 -3
- package/packages/theme-companions-site/test/theme.test.mjs +4 -2
- package/packages/theme-floors-site/package.json +17 -6
- package/packages/theme-floors-site/src/harvest.json +4 -2
- package/packages/theme-floors-site/src/index.js +7 -3
- package/packages/theme-floors-site/test/theme.test.mjs +4 -2
- package/packages/theme-fuelnfree-site/package.json +17 -6
- package/packages/theme-fuelnfree-site/src/harvest.json +4 -2
- package/packages/theme-fuelnfree-site/src/index.js +7 -3
- package/packages/theme-fuelnfree-site/test/theme.test.mjs +4 -2
- package/packages/theme-handyman-site/package.json +17 -6
- package/packages/theme-handyman-site/src/harvest.json +4 -2
- package/packages/theme-handyman-site/src/index.js +7 -3
- package/packages/theme-handyman-site/test/theme.test.mjs +4 -2
- package/packages/theme-insurance-site/package.json +17 -6
- package/packages/theme-insurance-site/src/harvest.json +4 -2
- package/packages/theme-insurance-site/src/index.js +7 -3
- package/packages/theme-insurance-site/test/theme.test.mjs +4 -2
- package/packages/theme-scenes/README.md +1 -1
- package/packages/theme-scenes/package.json +4 -3
- package/packages/theme-scenes/src/registry.js +187 -0
- package/packages/theme-shinshu-site/package.json +17 -6
- package/packages/theme-shinshu-site/src/harvest.json +4 -2
- package/packages/theme-shinshu-site/src/index.js +7 -3
- package/packages/theme-shinshu-site/test/theme.test.mjs +4 -2
- package/packages/work-graph/package.json +14 -4
- package/protocol/FILEMETA_V1.md +2 -2
- package/protocol/capabilities/manifest.json +1 -1
- package/protocol/database/agentsam.schema-pack.v1.schema.json +72 -0
- package/protocol/presets/catalog.json +2 -2
- package/protocol/theme-refinery/lineage-registry.json +105 -0
- package/protocol/theme-refinery/product-metadata.schema.json +21 -1
- package/python/agentsam_sdk/repository/intelligence/discovery.py +27 -2
- package/python/agentsam_sdk/repository/intelligence/git.py +4 -0
- package/python/tests/test_repository_intelligence.py +30 -0
- package/src/cli/command-catalog.js +48 -5
- package/src/cli/dispatch.js +1 -0
- package/src/cli.js +20 -1
- package/src/cloudflare/runtime-status.js +2 -1
- package/src/commands/autorag.js +67 -13
- package/src/commands/cheat-sheet.js +29 -4
- package/src/commands/codebaseindex.js +45 -2
- package/src/commands/goap-world.js +134 -0
- package/src/commands/goap.js +11 -4
- package/src/commands/knowledge.js +59 -2
- package/src/commands/machine-binary.js +109 -0
- package/src/commands/machine-runtime.js +266 -0
- package/src/commands/machine.js +208 -0
- package/src/commands/package.js +530 -0
- package/src/commands/plan-ledger.js +370 -0
- package/src/commands/plan.js +183 -0
- package/src/commands/security.js +67 -4
- package/src/commands/setup.js +33 -16
- package/src/commands/skill.js +78 -17
- package/src/commands/status.js +8 -1
- package/src/features/resolve.js +1 -0
- package/src/knowledge/engine.js +21 -2
- package/src/knowledge/runtime-discovery.js +127 -0
- package/src/knowledge/source.js +1 -1
- package/src/lib/identity-scaffold.js +53 -13
- package/src/lib/setup/recipes.js +1 -1
- package/src/lib/slash-commands.js +1 -1
- package/src/local/runtime-store.js +24 -2
- package/src/local/sqlite.js +17 -0
- package/src/models/discovery.js +40 -22
- package/src/models/inventory-core.d.ts +105 -0
- package/src/models/inventory-core.js +54 -6
- package/src/sam/operations/package-audit.js +41 -0
- package/src/sam/seed.js +2 -0
- package/src/security/logs.js +3 -0
- package/src/ui/cli/help.js +41 -0
- package/apps/client-cms-editor/backend/src/demo-bootstrap.ts +0 -145
- package/test/account-session.test.mjs +0 -101
- package/test/agent-capabilities.test.mjs +0 -67
- package/test/app-authority-context.test.mjs +0 -32
- package/test/app-building-skills.test.mjs +0 -61
- package/test/apps-scaffold-contract.test.mjs +0 -114
- package/test/blender-cad.test.mjs +0 -146
- package/test/cad-docker.test.mjs +0 -96
- package/test/capabilities.test.mjs +0 -133
- package/test/cli/api-key-env-whoami.test.mjs +0 -129
- package/test/cli/codebaseindex-plan-ux.test.mjs +0 -37
- package/test/cli/eval-live.test.mjs +0 -219
- package/test/cli/go.test.mjs +0 -128
- package/test/cli/local-vault-and-provider-setup.test.mjs +0 -268
- package/test/cli/mcp-client.test.mjs +0 -256
- package/test/cli/preferences-runtime.test.mjs +0 -11
- package/test/cli/runtime-persist.test.mjs +0 -56
- package/test/cli/runtime-ui.test.mjs +0 -141
- package/test/cli/rust-command.test.mjs +0 -21
- package/test/cli/skill-npm-and-env.test.mjs +0 -52
- package/test/cli/status-actions.test.mjs +0 -88
- package/test/cli/wireframes-go-registry.test.mjs +0 -139
- package/test/cli-preferences.test.mjs +0 -46
- package/test/cloudflare-connector.test.mjs +0 -93
- package/test/cloudflare-runtime.test.mjs +0 -82
- package/test/context.test.mjs +0 -159
- package/test/credentials-audit.test.mjs +0 -113
- package/test/deploy-health-scan.test.mjs +0 -95
- package/test/deploy-receipt.test.mjs +0 -91
- package/test/dockerize.test.mjs +0 -93
- package/test/error-diagnostics.test.mjs +0 -124
- package/test/eval-context.test.mjs +0 -37
- package/test/execution-approvals.test.mjs +0 -27
- package/test/fixtures/cad/courtyard-house.json +0 -208
- package/test/fixtures/knowledge-rpc-worker.mjs +0 -16
- package/test/gcloud-auth.test.mjs +0 -111
- package/test/go/build-source-identity.test.mjs +0 -31
- package/test/go/cloudflare-probe.test.mjs +0 -317
- package/test/go/distribution.test.mjs +0 -28
- package/test/google-cloud-connection.test.mjs +0 -83
- package/test/google-cloud-inventory.test.mjs +0 -64
- package/test/indexing-provider.test.mjs +0 -29
- package/test/init-options.test.mjs +0 -35
- package/test/integration/ai-access-onboarding.test.mjs +0 -47
- package/test/integration/app-command.test.mjs +0 -85
- package/test/integration/cad-discovery.test.mjs +0 -158
- package/test/integration/cad-docker-executor.test.mjs +0 -249
- package/test/integration/cad-execution.test.mjs +0 -184
- package/test/integration/cad-project-app.test.mjs +0 -31
- package/test/integration/cad-project-d1.test.mjs +0 -25
- package/test/integration/cad-project-native.test.mjs +0 -24
- package/test/integration/cad-project-workflow.test.mjs +0 -9
- package/test/integration/cad-project.test.mjs +0 -85
- package/test/integration/cli-help.test.mjs +0 -41
- package/test/integration/cms-app-scaffold.test.mjs +0 -71
- package/test/integration/cms-site-tenancy-contract.test.mjs +0 -257
- package/test/integration/codebaseindex-ingest.test.mjs +0 -214
- package/test/integration/core-client.integration.test.mjs +0 -55
- package/test/integration/error-runtime-rpc.test.mjs +0 -71
- package/test/integration/features-resolve.test.mjs +0 -147
- package/test/integration/icon-registry.test.mjs +0 -67
- package/test/integration/ingest-discover-models.test.mjs +0 -30
- package/test/integration/inspect-path-cli.test.mjs +0 -46
- package/test/integration/install-script.test.mjs +0 -110
- package/test/integration/inventory-core.test.mjs +0 -53
- package/test/integration/inventory-evidence.test.mjs +0 -125
- package/test/integration/knowledge-rpc.test.mjs +0 -112
- package/test/integration/local-fs.test.mjs +0 -113
- package/test/integration/merkle-cli.test.mjs +0 -61
- package/test/integration/merkle-persistence-identity.test.mjs +0 -48
- package/test/integration/plugins-cloudflare.integration.test.mjs +0 -28
- package/test/integration/provider-env-cli.test.mjs +0 -50
- package/test/integration/provider-factory.test.mjs +0 -197
- package/test/integration/repository-company-graph.test.mjs +0 -90
- package/test/integration/runtime-migrations.test.mjs +0 -87
- package/test/integration/runtime-status.integration.test.mjs +0 -212
- package/test/integration/sam-activity-recovery.test.mjs +0 -147
- package/test/integration/sam-decision.test.mjs +0 -584
- package/test/integration/sam-kernel.test.mjs +0 -99
- package/test/integration/sam-planning-astar.test.mjs +0 -279
- package/test/integration/scaffold-cloudflare.test.mjs +0 -46
- package/test/integration/skill-runtime.test.mjs +0 -240
- package/test/integration/storage-architecture.test.mjs +0 -154
- package/test/integration/store-discovery.test.mjs +0 -44
- package/test/integration/studio-fs-pty-e2e.test.mjs +0 -294
- package/test/integration/terminal-exec.integration.test.mjs +0 -86
- package/test/integration/tool-runtime.test.mjs +0 -124
- package/test/integration/tool-schema.test.mjs +0 -59
- package/test/jr-dev-skill.test.mjs +0 -26
- package/test/knowledge-context-pack.test.mjs +0 -19
- package/test/knowledge-postgres.test.mjs +0 -40
- package/test/knowledge-service.test.mjs +0 -110
- package/test/knowledge.test.mjs +0 -206
- package/test/live/terminal-transport.live.test.mjs +0 -24
- package/test/local-sessions.test.mjs +0 -57
- package/test/local-studio-deploy.test.mjs +0 -83
- package/test/loopback-oauth.test.mjs +0 -53
- package/test/merkle-render.test.mjs +0 -31
- package/test/mini.test.mjs +0 -140
- package/test/model-catalog.test.mjs +0 -70
- package/test/models.test.mjs +0 -309
- package/test/npm10-lock.test.mjs +0 -29
- package/test/ollama.test.mjs +0 -137
- package/test/open-url.test.mjs +0 -64
- package/test/openai-responses.test.mjs +0 -155
- package/test/portable-context.test.mjs +0 -94
- package/test/project-config.test.mjs +0 -81
- package/test/project-rules.test.mjs +0 -44
- package/test/provider-credentials.test.mjs +0 -106
- package/test/rehydrate.test.mjs +0 -25
- package/test/release-hygiene.test.mjs +0 -42
- package/test/repository-snapshot-view.test.mjs +0 -112
- package/test/responses-runner.test.mjs +0 -465
- package/test/runtime-activity.test.mjs +0 -98
- package/test/sdk-worker-contract.test.mjs +0 -72
- package/test/security.test.mjs +0 -252
- package/test/setup-planner.test.mjs +0 -74
- package/test/setup-runtime.test.mjs +0 -51
- package/test/shell.test.mjs +0 -281
- package/test/skills.test.mjs +0 -22
- package/test/smoke.mjs +0 -122
- package/test/telemetry.test.mjs +0 -79
- package/test/terminal/local-pty.mock.test.mjs +0 -153
- package/test/terminal-machine-identity.test.mjs +0 -88
- package/test/theme-portability.test.mjs +0 -14
- package/test/tools-search.test.mjs +0 -73
- package/test/unit/website-assets-bindings.test.mjs +0 -60
- package/test/whoami-resume.test.mjs +0 -157
package/test/shell.test.mjs
DELETED
|
@@ -1,281 +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 { spawnSync } from 'node:child_process';
|
|
6
|
-
import test from 'node:test';
|
|
7
|
-
import { dispatchShellLine, installPasteCollapse, renderCollapsedPaste, renderShellCatalog, renderShellPrompt, shouldCollapsePaste, tokenizeShellLine } from '../src/commands/shell.js';
|
|
8
|
-
import { readCliPreferences, writeCliPreferences } from '../src/lib/cli-preferences.js';
|
|
9
|
-
|
|
10
|
-
const repoRoot = path.resolve(new URL('..', import.meta.url).pathname);
|
|
11
|
-
|
|
12
|
-
test('shell tokenizer preserves Windows paths and quoted arguments', () => {
|
|
13
|
-
assert.deepEqual(tokenizeShellLine('/cd C:\\Users\\conno\\fuelnreetime'), ['/cd', 'C:\\Users\\conno\\fuelnreetime']);
|
|
14
|
-
assert.deepEqual(tokenizeShellLine('/cd "C:\\Users\\Connor Smith\\repo"'), ['/cd', 'C:\\Users\\Connor Smith\\repo']);
|
|
15
|
-
assert.deepEqual(tokenizeShellLine('/agent "inspect this repo"'), ['/agent', 'inspect this repo']);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test('interactive prompt derives username and cwd instead of hardcoding Agent Sam identity', () => {
|
|
19
|
-
const env = { USER: 'alice', HOME: '/Users/alice' };
|
|
20
|
-
assert.equal(renderShellPrompt('/Users/alice/code/demo', env), 'alice ~/code/demo > ');
|
|
21
|
-
assert.equal(renderShellPrompt('/Users/alice', env), 'alice ~ > ');
|
|
22
|
-
assert.equal(renderShellPrompt('/tmp/demo', env), 'alice /tmp/demo > ');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test('shell startup stays quiet and points to the picker', () => {
|
|
26
|
-
const catalog = renderShellCatalog();
|
|
27
|
-
for (const command of ['/model', '/usage', '/help', '/exit']) {
|
|
28
|
-
assert.match(catalog, new RegExp(command.replace('/', '\\/')));
|
|
29
|
-
}
|
|
30
|
-
assert.match(catalog, /command picker/);
|
|
31
|
-
assert.match(catalog, /Type normally to work with the selected model/);
|
|
32
|
-
assert.doesNotMatch(catalog, /Slash commands \(/);
|
|
33
|
-
assert.doesNotMatch(catalog, /\/reasoning\s+Set reasoning/);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
test('dispatch handles help, menu fallback, pwd, cd, and exit without falling through to host shell', async () => {
|
|
37
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-shell-'));
|
|
38
|
-
const child = path.join(root, 'child folder');
|
|
39
|
-
fs.mkdirSync(child);
|
|
40
|
-
let output = '';
|
|
41
|
-
const state = { cwd: root, write: (text) => { output += text; }, interactive: false };
|
|
42
|
-
let result = await dispatchShellLine('/help', state);
|
|
43
|
-
assert.equal(result.handled, true);
|
|
44
|
-
assert.match(output, /SAM = Systematic Autonomous Machinery/);
|
|
45
|
-
assert.match(output, /agentsam help <topic>/);
|
|
46
|
-
output = '';
|
|
47
|
-
await dispatchShellLine('/', state);
|
|
48
|
-
assert.match(output, /command picker/);
|
|
49
|
-
output = '';
|
|
50
|
-
await dispatchShellLine('/pwd', state);
|
|
51
|
-
assert.equal(output.trim(), root);
|
|
52
|
-
output = '';
|
|
53
|
-
await dispatchShellLine('/cd "child folder"', state);
|
|
54
|
-
assert.equal(state.cwd, child);
|
|
55
|
-
assert.equal(output.trim(), child);
|
|
56
|
-
result = await dispatchShellLine('/exit', state);
|
|
57
|
-
assert.equal(result.exit, true);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const stripAnsi = (text) => String(text || '').replace(/\x1B\[[0-9;]*[a-zA-Z]/g, '');
|
|
61
|
-
|
|
62
|
-
test('/usage renders the current session receipt without ending the session', async () => {
|
|
63
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-shell-usage-'));
|
|
64
|
-
let output = '';
|
|
65
|
-
const state = {
|
|
66
|
-
cwd: root, interactive: false, write: (text) => { output += text; },
|
|
67
|
-
session: {
|
|
68
|
-
id: 'asess_00000000-0000-4000-8000-000000000001', title: 'Usage test', model_key: 'openai:gpt-6-astra',
|
|
69
|
-
cumulative_usage: { input_tokens: 21_244, cached_input_tokens: 60_544, output_tokens: 219 },
|
|
70
|
-
total_cost_usd: 0.42, cost_breakdown_usd: { input: 0.2, cached_input: 0.02, output: 0.2 },
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
const result = await dispatchShellLine('/usage', state);
|
|
74
|
-
assert.equal(result.exit, false);
|
|
75
|
-
const clean = stripAnsi(output);
|
|
76
|
-
assert.match(clean, /AgentSam · Usage/);
|
|
77
|
-
assert.match(clean, /input\s+21\.2k/);
|
|
78
|
-
assert.match(clean, /output\s+219/);
|
|
79
|
-
assert.match(clean, /cached\s+60\.5k/);
|
|
80
|
-
assert.match(clean, /cost\s+\$0\.420/);
|
|
81
|
-
assert.match(clean, /agentsam resume asess_00000000-0000-4000-8000-000000000001/);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test('/logout signs out locally and emits the same resumable usage receipt', async () => {
|
|
85
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-shell-logout-'));
|
|
86
|
-
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-shell-home-'));
|
|
87
|
-
let output = '';
|
|
88
|
-
const state = {
|
|
89
|
-
cwd: root, home, interactive: false, write: (text) => { output += text; },
|
|
90
|
-
session: {
|
|
91
|
-
id: 'asess_00000000-0000-4000-8000-000000000002', title: 'Logout test', model_key: 'openai:gpt-6-astra',
|
|
92
|
-
cumulative_usage: { input_tokens: 100, cached_input_tokens: 50, output_tokens: 25 },
|
|
93
|
-
total_cost_usd: 0.0125, cost_breakdown_usd: { input: 0.005, cached_input: 0.0025, output: 0.005 },
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
const result = await dispatchShellLine('/logout', state);
|
|
97
|
-
assert.equal(result.exit, false);
|
|
98
|
-
assert.match(output, /No local Agent Sam IAM session was stored/);
|
|
99
|
-
assert.match(output, /Token usage: total=125 input=100 \(\+ 50 cached\) output=25/);
|
|
100
|
-
assert.match(output, /Spent: \$0\.0125/);
|
|
101
|
-
assert.match(output, /agentsam resume asess_00000000-0000-4000-8000-000000000002/);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
test('reasoning and service-tier commands persist only supported controls for an exact model', async () => {
|
|
105
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-shell-model-'));
|
|
106
|
-
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({ name: 'model-demo' }));
|
|
107
|
-
writeCliPreferences(root, { trustedDirectory: true, modelPreference: 'openai:gpt-6-astra', reasoningEffort: 'low', serviceTier: 'default' });
|
|
108
|
-
let output = '';
|
|
109
|
-
const state = { cwd: root, write: (text) => { output += text; }, interactive: false };
|
|
110
|
-
await dispatchShellLine('/reasoning high', state);
|
|
111
|
-
assert.equal(readCliPreferences(root).reasoningEffort, 'high');
|
|
112
|
-
await dispatchShellLine('/fast', state);
|
|
113
|
-
assert.equal(readCliPreferences(root).serviceTier, 'fast');
|
|
114
|
-
await dispatchShellLine('/flex', state);
|
|
115
|
-
assert.equal(readCliPreferences(root).serviceTier, 'flex');
|
|
116
|
-
await dispatchShellLine('/standard', state);
|
|
117
|
-
assert.equal(readCliPreferences(root).serviceTier, 'default');
|
|
118
|
-
assert.match(output, /reasoning → high/);
|
|
119
|
-
assert.match(output, /Fast is a paid latency choice/);
|
|
120
|
-
assert.match(output, /Flex trades latency/);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
test('stale provider snapshots hydrate GPT-6 reasoning controls from the current catalog', async () => {
|
|
124
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-shell-stale-model-'));
|
|
125
|
-
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({ name: 'stale-model-demo' }));
|
|
126
|
-
writeCliPreferences(root, {
|
|
127
|
-
trustedDirectory: true,
|
|
128
|
-
modelPreference: 'openai:gpt-6-luna',
|
|
129
|
-
reasoningEffort: 'auto',
|
|
130
|
-
serviceTier: 'default',
|
|
131
|
-
modelSnapshot: {
|
|
132
|
-
model_key: 'openai:gpt-6-luna',
|
|
133
|
-
provider: 'openai',
|
|
134
|
-
provider_model_id: 'gpt-6-luna',
|
|
135
|
-
label: 'gpt-6-luna',
|
|
136
|
-
availability: 'available',
|
|
137
|
-
availability_source: 'provider_api',
|
|
138
|
-
context_window: null,
|
|
139
|
-
context_window_source: 'unknown',
|
|
140
|
-
max_output_tokens: null,
|
|
141
|
-
max_output_tokens_source: 'unknown',
|
|
142
|
-
reasoning_efforts: ['auto'],
|
|
143
|
-
service_tiers: ['default'],
|
|
144
|
-
capabilities: { responses: true },
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
let output = '';
|
|
149
|
-
const state = { cwd: root, write: (text) => { output += text; }, interactive: false };
|
|
150
|
-
await dispatchShellLine('/reasoning', state);
|
|
151
|
-
assert.match(output, /auto \| none \| low \| medium \| high \| xhigh \| max/);
|
|
152
|
-
assert.match(output, /provider default: medium/);
|
|
153
|
-
|
|
154
|
-
output = '';
|
|
155
|
-
await dispatchShellLine('/reasoning high', state);
|
|
156
|
-
assert.equal(readCliPreferences(root).reasoningEffort, 'high');
|
|
157
|
-
assert.match(output, /reasoning → high/);
|
|
158
|
-
|
|
159
|
-
output = '';
|
|
160
|
-
await dispatchShellLine('/context', state);
|
|
161
|
-
assert.match(output, /1,050,000/);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
test('bare /context shows truthful economics without inventing active token usage', async () => {
|
|
165
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-shell-context-'));
|
|
166
|
-
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({ name: 'context-demo' }));
|
|
167
|
-
writeCliPreferences(root, { trustedDirectory: true, modelPreference: 'openai:gpt-6-astra', reasoningEffort: 'medium', serviceTier: 'default' });
|
|
168
|
-
let output = '';
|
|
169
|
-
await dispatchShellLine('/context', { cwd: root, write: (text) => { output += text; }, interactive: false });
|
|
170
|
-
assert.match(output, /1,050,000/);
|
|
171
|
-
assert.match(output, /272,000/);
|
|
172
|
-
assert.match(output, /180,000/);
|
|
173
|
-
assert.match(output, /unavailable · no provider\/local usage snapshot yet/);
|
|
174
|
-
assert.match(output, /Batch is a separate asynchronous execution lane/);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
test('CLI supports a deterministic one-shot slash command for regression tests', () => {
|
|
178
|
-
const result = spawnSync(process.execPath, ['src/cli.js', 'shell', '--command', '/help'], { cwd: repoRoot, encoding: 'utf8' });
|
|
179
|
-
assert.equal(result.status, 0, result.stderr);
|
|
180
|
-
assert.match(result.stdout, /SAM = Systematic Autonomous Machinery/);
|
|
181
|
-
assert.match(result.stdout, /agentsam help <topic>/);
|
|
182
|
-
assert.match(result.stdout, /command picker/);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
test('large pastes collapse into a single confirmation line', () => {
|
|
186
|
-
const pasted = ['one', 'two', 'three', 'four', 'five', 'six'].join('\n');
|
|
187
|
-
assert.equal(shouldCollapsePaste('short'), false);
|
|
188
|
-
assert.equal(shouldCollapsePaste(pasted), true);
|
|
189
|
-
assert.equal(shouldCollapsePaste('x'.repeat(301)), true);
|
|
190
|
-
assert.equal(renderCollapsedPaste(pasted), '[Pasted 6 lines — Enter to run, Backspace to clear]');
|
|
191
|
-
|
|
192
|
-
const writes = [];
|
|
193
|
-
const rl = {
|
|
194
|
-
terminal: true,
|
|
195
|
-
line: '',
|
|
196
|
-
cursor: 0,
|
|
197
|
-
_refreshLine() { writes.push(this.line); },
|
|
198
|
-
_ttyWrite(s) { this.line += s || ''; this.cursor = this.line.length; },
|
|
199
|
-
};
|
|
200
|
-
const restore = installPasteCollapse(rl);
|
|
201
|
-
rl._ttyWrite(pasted);
|
|
202
|
-
assert.equal(rl.line, '[Pasted 6 lines — Enter to run, Backspace to clear]');
|
|
203
|
-
rl._ttyWrite('', { name: 'backspace' });
|
|
204
|
-
assert.equal(rl.line, '');
|
|
205
|
-
restore();
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
test('dispatchShellLine accepts "agentsam <cmd>" and bare common verbs without slash prefix', async () => {
|
|
209
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-shell-verb-'));
|
|
210
|
-
let output = '';
|
|
211
|
-
const state = { cwd: root, write: (text) => { output += text; }, interactive: false };
|
|
212
|
-
|
|
213
|
-
const r1 = await dispatchShellLine('agentsam help', state);
|
|
214
|
-
assert.equal(r1.handled, true);
|
|
215
|
-
assert.match(output, /SAM = Systematic Autonomous Machinery/);
|
|
216
|
-
|
|
217
|
-
output = '';
|
|
218
|
-
const r2 = await dispatchShellLine('help', state);
|
|
219
|
-
assert.equal(r2.handled, true);
|
|
220
|
-
assert.match(output, /SAM = Systematic Autonomous Machinery/);
|
|
221
|
-
|
|
222
|
-
const r3 = await dispatchShellLine('exit', state);
|
|
223
|
-
assert.equal(r3.exit, true);
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
test('/compact is discoverable, invokes native compaction, persists exact continuation and usage across resume', async () => {
|
|
227
|
-
const { SLASH_COMMANDS } = await import('../src/lib/slash-commands.js');
|
|
228
|
-
const { createLocalSession, loadLocalSession, loadSessionContinuation } = await import('../src/lib/local-sessions.js');
|
|
229
|
-
const { runResponsesAgent } = await import('../src/agent/responses-runner.js');
|
|
230
|
-
const { createOpenAIResponsesAdapter } = await import('../src/providers/openai-responses.js');
|
|
231
|
-
assert.ok(SLASH_COMMANDS.some(row => row.cmd === '/compact'));
|
|
232
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-compact-'));
|
|
233
|
-
fs.writeFileSync(path.join(root, 'package.json'), '{"name":"compact-test"}');
|
|
234
|
-
writeCliPreferences(root, { modelPreference: 'openai:gpt-6-astra', reasoningEffort: 'low', serviceTier: 'default' });
|
|
235
|
-
const session = createLocalSession({ cwd: root, project_root: root, model_key: 'openai:gpt-6-astra', reasoning_effort: 'low', requested_service_tier: 'default', provider_state: { provider: 'openai', previous_response_id: 'resp_prior' }, cumulative_usage: { input_tokens: 10 } });
|
|
236
|
-
const output = [{ type: 'message', role: 'user', content: [{ type: 'input_text', text: 'Keep the selected architecture' }] }, { type: 'compaction', id: 'cmp_item', encrypted_content: 'opaque+/==exact' }];
|
|
237
|
-
const oldKey = process.env.OPENAI_API_KEY;
|
|
238
|
-
process.env.OPENAI_API_KEY = 'fixture-key';
|
|
239
|
-
let rendered = '', calls = 0;
|
|
240
|
-
const state = { cwd: root, projectRoot: root, interactive: false, session, write: text => { rendered += text; }, providerFetchImpl: async (url, init) => {
|
|
241
|
-
calls++;
|
|
242
|
-
assert.match(url, /responses\/compact$/);
|
|
243
|
-
assert.equal(JSON.parse(init.body).previous_response_id, 'resp_prior');
|
|
244
|
-
return { ok: true, status: 200, json: async () => ({ id: 'cmp_test', output, usage: { input_tokens: 1000, output_tokens: 100, input_tokens_details: { cached_tokens: 100 } } }) };
|
|
245
|
-
} };
|
|
246
|
-
try { await dispatchShellLine('/compact', state); }
|
|
247
|
-
finally { if (oldKey === undefined) delete process.env.OPENAI_API_KEY; else process.env.OPENAI_API_KEY = oldKey; }
|
|
248
|
-
assert.equal(calls, 1);
|
|
249
|
-
assert.match(rendered, /continuation saved/);
|
|
250
|
-
const resumed = loadLocalSession(session.id, { projectRoot: root });
|
|
251
|
-
assert.equal(resumed.cumulative_usage.input_tokens, 1010);
|
|
252
|
-
assert.equal(resumed.cumulative_usage.cached_input_tokens, 100);
|
|
253
|
-
assert.ok(resumed.total_cost_usd > 0);
|
|
254
|
-
assert.equal(resumed.latest_compaction.compaction_id, 'cmp_test');
|
|
255
|
-
const continuation = loadSessionContinuation(resumed);
|
|
256
|
-
assert.deepEqual(continuation.compacted_input, output);
|
|
257
|
-
assert.equal(resumed.provider_state.previous_response_id, undefined);
|
|
258
|
-
const adapter = createOpenAIResponsesAdapter({ apiKey: 'test', fetchImpl: async (_, init) => {
|
|
259
|
-
const body = JSON.parse(init.body);
|
|
260
|
-
assert.deepEqual(body.input.slice(0, output.length), output);
|
|
261
|
-
assert.equal(body.previous_response_id, undefined);
|
|
262
|
-
return { ok: true, status: 200, json: async () => ({ id: 'resp_next', output_text: 'done', output: [], usage: { input_tokens: 120, output_tokens: 10 } }) };
|
|
263
|
-
} });
|
|
264
|
-
await runResponsesAgent({ provider: adapter, capabilityAdapter: { toolDescriptors: () => [] }, model: 'gpt-6-astra', prompt: 'continue', cwd: root, instructions: '', previousProviderState: continuation, previousUsageSnapshot: resumed.usage_snapshot });
|
|
265
|
-
rendered = '';
|
|
266
|
-
await dispatchShellLine('/compact status', state);
|
|
267
|
-
assert.match(rendered, /180000/);
|
|
268
|
-
assert.match(rendered, /cmp_test/);
|
|
269
|
-
await dispatchShellLine('/session', state);
|
|
270
|
-
assert.match(rendered, /Latest compaction: cmp_test/);
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
test('/compact fails closed for unsupported provider without an HTTP request', async () => {
|
|
274
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-compact-unsupported-'));
|
|
275
|
-
fs.writeFileSync(path.join(root, 'package.json'), '{"name":"unsupported"}');
|
|
276
|
-
writeCliPreferences(root, { modelPreference: 'gemini:test', modelSnapshot: { provider: 'gemini', model_key: 'gemini:test', provider_model_id: 'test', context_window: 128000, capabilities: {} } });
|
|
277
|
-
let rendered = '', calls = 0;
|
|
278
|
-
await dispatchShellLine('/compact', { cwd: root, interactive: false, write: text => { rendered += text; }, providerFetchImpl: async () => { calls++; } });
|
|
279
|
-
assert.equal(calls, 0);
|
|
280
|
-
assert.match(rendered, /native_compaction_unavailable:gemini/);
|
|
281
|
-
});
|
package/test/skills.test.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { getSkill, listSkills, loadSkill } from '../src/skills/index.js';
|
|
4
|
-
|
|
5
|
-
test('portable skill registry exposes AgentSam Jr Dev by id and alias', () => {
|
|
6
|
-
const listed = listSkills();
|
|
7
|
-
assert.ok(listed.some((skill) => skill.id === 'agentsam-jr-dev'));
|
|
8
|
-
|
|
9
|
-
assert.equal(getSkill('agentsam_jr_dev')?.id, 'agentsam-jr-dev');
|
|
10
|
-
assert.equal(getSkill('jr-dev')?.id, 'agentsam-jr-dev');
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
test('AgentSam Jr Dev loads compact instructions and references on demand', () => {
|
|
14
|
-
const compact = loadSkill('agentsam-jr-dev');
|
|
15
|
-
assert.match(compact.instructions, /# AgentSam Jr Dev/);
|
|
16
|
-
assert.equal('references' in compact, false);
|
|
17
|
-
|
|
18
|
-
const full = loadSkill('agentsam_jr_dev', { references: true });
|
|
19
|
-
assert.equal(full.references.length, 2);
|
|
20
|
-
assert.match(full.references[0].content, /## HTTP/);
|
|
21
|
-
assert.match(full.references[1].content, /# Real Application Logic/);
|
|
22
|
-
});
|
package/test/smoke.mjs
DELETED
|
@@ -1,122 +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 { fileURLToPath } from 'node:url';
|
|
6
|
-
import { AgentSam, routeIntent, getToolCatalog } from '../src/index.js';
|
|
7
|
-
import { buildLocalScaffoldMeta, sdkDependencySpec } from '../src/lib/local-scaffold.js';
|
|
8
|
-
import { writeScaffoldFiles } from '../src/lib/write-files.js';
|
|
9
|
-
import { initializeLocalSqlite, createLocalSqliteDatabase } from '../src/local/sqlite.js';
|
|
10
|
-
import { printContextSummary, missingForInit } from '../src/lib/detect-context.js';
|
|
11
|
-
|
|
12
|
-
const app = new AgentSam({ project: 'smoke', lane: 'cms', agent: 'cms' });
|
|
13
|
-
let res = await app.handle(new Request('https://example.com/api/health'));
|
|
14
|
-
assert.equal(res.status, 200);
|
|
15
|
-
assert.equal((await res.json()).ok, true);
|
|
16
|
-
|
|
17
|
-
res = await app.handle(new Request('https://example.com/api/agentsam/info'));
|
|
18
|
-
const info = await res.json();
|
|
19
|
-
assert.equal(info.agent, 'cms');
|
|
20
|
-
assert.ok(info.capabilities.includes('page'));
|
|
21
|
-
|
|
22
|
-
res = await app.handle(new Request('https://example.com/api/agentsam/message', {
|
|
23
|
-
method: 'POST',
|
|
24
|
-
body: JSON.stringify({ message: 'create an analytics page in the cms' }),
|
|
25
|
-
}));
|
|
26
|
-
const message = await res.json();
|
|
27
|
-
assert.equal(message.agent, 'cms');
|
|
28
|
-
assert.equal(message.intent, 'cms_build');
|
|
29
|
-
|
|
30
|
-
assert.equal(routeIntent({ message: 'drop table users' }).requires_approval, true);
|
|
31
|
-
assert.ok(getToolCatalog('Data Solutions').some((tool) => tool.name === 'query'));
|
|
32
|
-
|
|
33
|
-
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-sdk-test-'));
|
|
34
|
-
const dir = writeScaffoldFiles(path.join(tmp, 'demo-project'), [
|
|
35
|
-
{ path: 'src/agent.js', content: 'export function createAgent() {}\n' },
|
|
36
|
-
{ path: 'db/schema.sql', content: 'CREATE TABLE cms_pages (id TEXT PRIMARY KEY);\n' },
|
|
37
|
-
{ path: '.env.example', content: 'AGENTSAM_DB=.agentsam/data/agentsam.sqlite\n' },
|
|
38
|
-
]);
|
|
39
|
-
assert.ok(fs.existsSync(path.join(dir, 'src/agent.js')));
|
|
40
|
-
assert.ok(fs.readFileSync(path.join(dir, 'db/schema.sql'), 'utf8').includes('cms_pages'));
|
|
41
|
-
assert.ok(fs.readFileSync(path.join(dir, '.env.example'), 'utf8').includes('AGENTSAM_DB'));
|
|
42
|
-
|
|
43
|
-
import { SLASH_COMMANDS, listSlashCommands } from '../src/lib/slash-commands.js';
|
|
44
|
-
import { createIdentityClient, AUTH_COOKIE_NAME } from '../src/index.js';
|
|
45
|
-
import { finalizeInboundOAuth } from '../packages/identity/src/oauth/callback.js';
|
|
46
|
-
assert.equal(AUTH_COOKIE_NAME, 'session');
|
|
47
|
-
assert.equal(createIdentityClient().providers.google()?.id, 'google');
|
|
48
|
-
const { GoogleProvider } = await import('@inneranimalmedia/agentsam-sdk/identity/providers/google');
|
|
49
|
-
assert.equal(GoogleProvider.id, 'google');
|
|
50
|
-
const { handleIdentityWorkerRequest } = await import('@inneranimalmedia/agentsam-sdk/identity/server/worker-router');
|
|
51
|
-
assert.equal(typeof handleIdentityWorkerRequest, 'function');
|
|
52
|
-
const { buildIdentityAppScaffold } = await import('../src/lib/identity-scaffold.js');
|
|
53
|
-
assert.ok(buildIdentityAppScaffold({ projectName: 'x' })['backend/src/index.js']);
|
|
54
|
-
await assert.rejects(() => finalizeInboundOAuth({}, new Request('https://x'), {}), /adapter/);
|
|
55
|
-
assert.ok(SLASH_COMMANDS.some((c) => c.cmd === '/deploy'));
|
|
56
|
-
assert.ok(SLASH_COMMANDS.some((c) => c.cmd === '/db'));
|
|
57
|
-
assert.ok(SLASH_COMMANDS.some((c) => c.cmd === '/agent'));
|
|
58
|
-
assert.ok(SLASH_COMMANDS.some((c) => c.cmd === '/model'));
|
|
59
|
-
assert.ok(SLASH_COMMANDS.some((c) => c.cmd === '/providers'));
|
|
60
|
-
assert.ok(SLASH_COMMANDS.some((c) => c.cmd === '/reasoning'));
|
|
61
|
-
assert.ok(SLASH_COMMANDS.some((c) => c.cmd === '/fast'));
|
|
62
|
-
assert.deepEqual(
|
|
63
|
-
listSlashCommands({ lane: 'deploy' }).map(({ cmd }) => cmd),
|
|
64
|
-
['/settings', '/deploy', '/help', '/exit'],
|
|
65
|
-
'deploy lane keeps global shell controls and excludes commands from other lanes',
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
printContextSummary({
|
|
69
|
-
iam: { ready: true, source: 'api_key', detail: 'AGENTSAM_API_KEY' },
|
|
70
|
-
gcp: { source: 'vm-metadata', email: 'execos@project.iam.gserviceaccount.com' },
|
|
71
|
-
gcp_vm: true,
|
|
72
|
-
github: { source: 'gh-cli', account: 'user@example.com' },
|
|
73
|
-
cloudflare: { source: 'wrangler', account: 'user@cloudflare.test' },
|
|
74
|
-
});
|
|
75
|
-
assert.deepEqual(missingForInit({ iam: { ready: false } }, '', { runTarget: 'local' }), []);
|
|
76
|
-
assert.deepEqual(missingForInit({ iam: { ready: false } }, '', { runTarget: 'cloudflare' }), ['iam']);
|
|
77
|
-
|
|
78
|
-
assert.equal(sdkDependencySpec('2.0.0-alpha.identity.12'), '2.0.0-alpha.identity.12');
|
|
79
|
-
assert.equal(sdkDependencySpec('2.1.3'), '^2.1.3');
|
|
80
|
-
const prereleaseMeta = buildLocalScaffoldMeta(
|
|
81
|
-
{ projectName: 'alpha-demo', lane: 'fullstack', runTarget: 'local' },
|
|
82
|
-
'2.0.0-alpha.identity.12',
|
|
83
|
-
);
|
|
84
|
-
const prereleasePackage = JSON.parse(prereleaseMeta.files.find((f) => f.path === 'package.json').content);
|
|
85
|
-
assert.equal(
|
|
86
|
-
prereleasePackage.dependencies['@inneranimalmedia/agentsam-sdk'],
|
|
87
|
-
'2.0.0-alpha.identity.12',
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
const localMeta = buildLocalScaffoldMeta({ projectName: 'demo', lane: 'cms', runTarget: 'local' });
|
|
91
|
-
assert.equal(localMeta.laneKey, 'cms');
|
|
92
|
-
assert.ok(localMeta.files.some((f) => f.path === '.agentsam/start-local.md'));
|
|
93
|
-
assert.ok(localMeta.files.some((f) => f.path === 'db/schema.sql'));
|
|
94
|
-
assert.ok(localMeta.files.some((f) => f.path === '.env'));
|
|
95
|
-
assert.ok(localMeta.files.some((f) => f.path === '.env.example'));
|
|
96
|
-
assert.ok(localMeta.files.some((f) => f.path === 'src/agent.js'));
|
|
97
|
-
assert.ok(!localMeta.files.some((f) => f.path === 'wrangler.toml'));
|
|
98
|
-
assert.ok(!localMeta.files.some((f) => f.path.startsWith('gorilla/')));
|
|
99
|
-
assert.ok(!localMeta.files.some((f) => f.path.includes('execos')));
|
|
100
|
-
|
|
101
|
-
const localDir = path.join(tmp, 'local-project');
|
|
102
|
-
writeScaffoldFiles(localDir, localMeta.files);
|
|
103
|
-
const localDb = await initializeLocalSqlite({
|
|
104
|
-
dbPath: path.join(localDir, '.agentsam', 'data', 'agentsam.sqlite'),
|
|
105
|
-
schemaPath: path.join(localDir, 'db', 'schema.sql'),
|
|
106
|
-
});
|
|
107
|
-
assert.ok(localDb.tables.includes('agent_sessions'));
|
|
108
|
-
const d1Like = await createLocalSqliteDatabase(localDb.dbPath);
|
|
109
|
-
await d1Like.prepare('INSERT INTO agent_sessions (id, agent, lane, status) VALUES (?, ?, ?, ?)').bind(
|
|
110
|
-
'sess_test', 'cms', 'cms', 'created',
|
|
111
|
-
).run();
|
|
112
|
-
const persisted = await d1Like.prepare('SELECT id FROM agent_sessions WHERE id = ?').bind('sess_test').first();
|
|
113
|
-
assert.equal(persisted.id, 'sess_test');
|
|
114
|
-
d1Like.close();
|
|
115
|
-
|
|
116
|
-
const tunnelPath = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'src', 'commands', 'tunnel.js');
|
|
117
|
-
const tunnelSrc = fs.readFileSync(tunnelPath, 'utf8');
|
|
118
|
-
assert.ok(tunnelSrc.includes('parseWranglerTunnelList'));
|
|
119
|
-
assert.ok(tunnelSrc.includes('wrangler'));
|
|
120
|
-
assert.ok(fs.existsSync(tunnelPath));
|
|
121
|
-
|
|
122
|
-
console.log('SDK smoke tests passed');
|
package/test/telemetry.test.mjs
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { createAgentEvent, createUsageSnapshot } from '../src/telemetry/index.js';
|
|
4
|
-
|
|
5
|
-
test('AgentEvent is compact serializable provider-neutral telemetry', () => {
|
|
6
|
-
const event = createAgentEvent('context.compaction.completed', { before: 181_000, after: 72_000 }, {
|
|
7
|
-
runId: 'run_test', sequence: 4, timestamp: '2026-09-12T00:00:00.000Z',
|
|
8
|
-
});
|
|
9
|
-
assert.equal(event.type, 'context.compaction.completed');
|
|
10
|
-
assert.equal(event.run_id, 'run_test');
|
|
11
|
-
assert.doesNotThrow(() => JSON.stringify(event));
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
test('current active context and cumulative run usage are different metrics', () => {
|
|
15
|
-
const usage = createUsageSnapshot({
|
|
16
|
-
current_context: { input_tokens: 48_000, window_tokens: 1_050_000 },
|
|
17
|
-
cumulative: { input_tokens: 310_000, output_tokens: 22_000, cached_input_tokens: 120_000, cache_write_tokens: 12_000, reasoning_tokens: 8_000 },
|
|
18
|
-
estimate_kind: 'provider',
|
|
19
|
-
});
|
|
20
|
-
assert.equal(usage.current_context.input_tokens, 48_000);
|
|
21
|
-
assert.equal(usage.cumulative.input_tokens, 310_000);
|
|
22
|
-
assert.equal(usage.provider_authoritative, true);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
createRunReceipt,
|
|
27
|
-
createUsageReceipt,
|
|
28
|
-
createApprovalReceipt,
|
|
29
|
-
createTerminalJobReceipt,
|
|
30
|
-
} from '../src/telemetry/index.js';
|
|
31
|
-
|
|
32
|
-
test('runtime receipts are account-owned and emit no tenant/workspace/user ownership aliases', () => {
|
|
33
|
-
const run = createRunReceipt({
|
|
34
|
-
id: 'arun_1', account_id: 'au_1', mode: 'agent', status: 'running',
|
|
35
|
-
source_client: 'cli', surface: 'cli', reasoning_effort: 'high', requested_service_tier: 'fast',
|
|
36
|
-
});
|
|
37
|
-
assert.equal(run.account_id, 'au_1');
|
|
38
|
-
assert.equal(run.source_client, 'cli');
|
|
39
|
-
assert.equal(run.requested_service_tier, 'fast');
|
|
40
|
-
assert.equal('user_id' in run, false);
|
|
41
|
-
assert.equal('tenant_id' in run, false);
|
|
42
|
-
assert.equal('workspace_id' in run, false);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test('usage receipt models exactly one provider call and keeps cache/reasoning economics', () => {
|
|
46
|
-
const usage = createUsageReceipt({
|
|
47
|
-
id: 'ue_1', account_id: 'au_1', agent_run_id: 'arun_1', provider: 'openai', model_key: 'gpt-6-astra',
|
|
48
|
-
model_call_index: 2, provider_request_id: 'resp_1', input_tokens: 1000, cached_input_tokens: 600,
|
|
49
|
-
cache_write_tokens: 20, output_tokens: 100, reasoning_tokens: 40, cost_usd: 0.12, cost_basis: 'provider',
|
|
50
|
-
});
|
|
51
|
-
assert.equal(usage.total_tokens, 1100);
|
|
52
|
-
assert.equal(usage.cached_input_tokens, 600);
|
|
53
|
-
assert.equal(usage.reasoning_tokens, 40);
|
|
54
|
-
assert.equal(usage.model_call_index, 2);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
test('approval and terminal receipts preserve lineage without turning D1 into transcript storage', () => {
|
|
58
|
-
const approval = createApprovalReceipt({
|
|
59
|
-
id: 'appr_1', account_id: 'au_1', agent_run_id: 'arun_1', tool_call_id: 'call_1', terminal_job_id: 'tjob_1',
|
|
60
|
-
action_summary: 'Deploy worker', sanitizedInput: { worker: 'api' }, risk_level: 'high',
|
|
61
|
-
});
|
|
62
|
-
assert.equal(approval.terminal_job_id, 'tjob_1');
|
|
63
|
-
assert.match(approval.sanitized_input_json, /worker/);
|
|
64
|
-
|
|
65
|
-
const job = createTerminalJobReceipt({
|
|
66
|
-
id: 'tjob_1', account_id: 'au_1', instance_id: 'tinst_1', connection_id: 'conn_1',
|
|
67
|
-
execos_run_id: 'xrun_1', status: 'running', idempotency_key: 'idem_1', max_attempts: 1,
|
|
68
|
-
});
|
|
69
|
-
assert.equal(job.execos_run_id, 'xrun_1');
|
|
70
|
-
assert.equal(job.max_attempts, 1);
|
|
71
|
-
assert.equal('stdout' in job, false);
|
|
72
|
-
assert.equal('stderr' in job, false);
|
|
73
|
-
assert.equal('command' in job, false);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test('runtime receipts refuse model-invented account identity', () => {
|
|
77
|
-
assert.throws(() => createRunReceipt({ id: 'arun_1' }), /account_id is required/);
|
|
78
|
-
assert.throws(() => createUsageReceipt({ id: 'ue_1', provider: 'openai', model_key: 'gpt-6-astra' }), /account_id is required/);
|
|
79
|
-
});
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import { EventEmitter } from 'node:events';
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
import test from 'node:test';
|
|
7
|
-
import { pathToFileURL } from 'node:url';
|
|
8
|
-
import {
|
|
9
|
-
attachLocalPtySession,
|
|
10
|
-
ensureNodePtySpawnHelperExecutable,
|
|
11
|
-
startLocalPtyServer,
|
|
12
|
-
} from '../../src/local-pty/server.js';
|
|
13
|
-
|
|
14
|
-
function fakeTransports() {
|
|
15
|
-
const writes = [];
|
|
16
|
-
const resizes = [];
|
|
17
|
-
let killed = 0;
|
|
18
|
-
let dataHandler = null;
|
|
19
|
-
let exitHandler = null;
|
|
20
|
-
|
|
21
|
-
const pty = {
|
|
22
|
-
spawn(shell, args, options) {
|
|
23
|
-
assert.equal(Array.isArray(args), true);
|
|
24
|
-
assert.equal(options.env.AGENTSAM_LOCAL_PTY, '1');
|
|
25
|
-
return {
|
|
26
|
-
write(value) { writes.push(value); },
|
|
27
|
-
resize(cols, rows) { resizes.push([cols, rows]); },
|
|
28
|
-
kill() { killed += 1; },
|
|
29
|
-
onData(fn) { dataHandler = fn; },
|
|
30
|
-
onExit(fn) { exitHandler = fn; },
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
class FakeWs extends EventEmitter {
|
|
36
|
-
OPEN = 1;
|
|
37
|
-
readyState = 1;
|
|
38
|
-
sent = [];
|
|
39
|
-
send(value) { this.sent.push(String(value)); }
|
|
40
|
-
close() {
|
|
41
|
-
if (this.readyState !== this.OPEN) return;
|
|
42
|
-
this.readyState = 3;
|
|
43
|
-
this.emit('close');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const ws = new FakeWs();
|
|
48
|
-
return {
|
|
49
|
-
pty,
|
|
50
|
-
ws,
|
|
51
|
-
writes,
|
|
52
|
-
resizes,
|
|
53
|
-
killed: () => killed,
|
|
54
|
-
emitData(value) { dataHandler?.(value); },
|
|
55
|
-
emitExit() { exitHandler?.(); },
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
test('macOS node-pty helper is made executable before runtime import', (t) => {
|
|
60
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-node-pty-helper-'));
|
|
61
|
-
t.after(() => fs.rmSync(root, { recursive: true, force: true }));
|
|
62
|
-
const libDir = path.join(root, 'lib');
|
|
63
|
-
const helperDir = path.join(root, 'prebuilds', 'darwin-arm64');
|
|
64
|
-
fs.mkdirSync(libDir, { recursive: true });
|
|
65
|
-
fs.mkdirSync(helperDir, { recursive: true });
|
|
66
|
-
fs.writeFileSync(path.join(libDir, 'index.js'), '');
|
|
67
|
-
const helper = path.join(helperDir, 'spawn-helper');
|
|
68
|
-
fs.writeFileSync(helper, 'fake');
|
|
69
|
-
fs.chmodSync(helper, 0o644);
|
|
70
|
-
|
|
71
|
-
const result = ensureNodePtySpawnHelperExecutable({
|
|
72
|
-
platform: 'darwin',
|
|
73
|
-
arch: 'arm64',
|
|
74
|
-
resolveModule: () => pathToFileURL(path.join(libDir, 'index.js')).href,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
assert.equal(result.checked, true);
|
|
78
|
-
assert.equal(result.changed, true);
|
|
79
|
-
assert.equal(result.path, helper);
|
|
80
|
-
assert.notEqual(fs.statSync(helper).mode & 0o111, 0);
|
|
81
|
-
|
|
82
|
-
const second = ensureNodePtySpawnHelperExecutable({
|
|
83
|
-
platform: 'darwin',
|
|
84
|
-
arch: 'arm64',
|
|
85
|
-
resolveModule: () => pathToFileURL(path.join(libDir, 'index.js')).href,
|
|
86
|
-
});
|
|
87
|
-
assert.equal(second.changed, false);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
test('local PTY wire protocol is release-testable entirely in memory', () => {
|
|
91
|
-
const transport = fakeTransports();
|
|
92
|
-
const session = attachLocalPtySession({
|
|
93
|
-
ws: transport.ws,
|
|
94
|
-
pty: transport.pty,
|
|
95
|
-
shell: '/bin/test-shell',
|
|
96
|
-
cwd: '/tmp/test-project',
|
|
97
|
-
cols: 80,
|
|
98
|
-
rows: 24,
|
|
99
|
-
env: {},
|
|
100
|
-
sessionId: 'local_test',
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
assert.equal(session.session_id, 'local_test');
|
|
104
|
-
assert.deepEqual(JSON.parse(transport.ws.sent[0]), {
|
|
105
|
-
type: 'session_id',
|
|
106
|
-
session_id: 'local_test',
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
transport.ws.emit('message', Buffer.from(JSON.stringify({ type: 'resize', cols: 120, rows: 40 })));
|
|
110
|
-
transport.ws.emit('message', Buffer.from(JSON.stringify({ type: 'slash', line: '/pwd' })));
|
|
111
|
-
transport.ws.emit('message', Buffer.from('raw input'));
|
|
112
|
-
|
|
113
|
-
assert.deepEqual(transport.resizes, [[120, 40]]);
|
|
114
|
-
assert.deepEqual(transport.writes, ['/pwd\r', 'raw input']);
|
|
115
|
-
|
|
116
|
-
transport.emitData('terminal output');
|
|
117
|
-
assert.equal(transport.ws.sent.at(-1), 'terminal output');
|
|
118
|
-
|
|
119
|
-
transport.ws.close();
|
|
120
|
-
assert.equal(transport.killed(), 1);
|
|
121
|
-
|
|
122
|
-
// Cleanup is idempotent even when transport error/close paths race.
|
|
123
|
-
transport.ws.emit('error', new Error('synthetic transport close'));
|
|
124
|
-
session.cleanup();
|
|
125
|
-
assert.equal(transport.killed(), 1);
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
test('local PTY server health check uses an ephemeral local port and no ExecOS tunnel', async () => {
|
|
129
|
-
const transport = fakeTransports();
|
|
130
|
-
const server = await startLocalPtyServer({
|
|
131
|
-
cwd: process.cwd(),
|
|
132
|
-
host: '127.0.0.1',
|
|
133
|
-
port: 0,
|
|
134
|
-
pty: transport.pty,
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
try {
|
|
138
|
-
const health = await fetch(server.healthUrl);
|
|
139
|
-
assert.equal(health.status, 200);
|
|
140
|
-
const body = await health.json();
|
|
141
|
-
assert.equal(body.ok, true);
|
|
142
|
-
assert.equal(body.service, 'agentsam.local.runtime');
|
|
143
|
-
assert.equal(body.plane, 'local');
|
|
144
|
-
assert.equal(body.service_legacy, 'agentsam-local-pty');
|
|
145
|
-
assert.equal(body.port, server.port);
|
|
146
|
-
assert.equal(server.port > 0, true);
|
|
147
|
-
} finally {
|
|
148
|
-
await server.close();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// No WebSocket session was opened, so the PTY process was never spawned.
|
|
152
|
-
assert.equal(transport.killed(), 0);
|
|
153
|
-
});
|