@inneranimalmedia/agentsam-sdk 2.6.2 → 2.6.3
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 +45 -1
- package/README.md +80 -0
- package/apps/README.md +34 -0
- package/apps/cad-creator/README.md +728 -0
- package/apps/cad-creator/shared/cad/package.json +19 -0
- package/apps/cad-creator/shared/cad/src/domain/operations.ts +7 -0
- package/apps/cad-creator/shared/cad/src/domain/project-contract.d.ts +3 -0
- package/apps/cad-creator/shared/cad/src/domain/project-contract.js +75 -0
- package/apps/cad-creator/shared/cad/src/domain/project-tools.d.ts +1 -0
- package/apps/cad-creator/shared/cad/src/domain/project-tools.js +24 -0
- package/apps/cad-creator/shared/cad/src/domain/validation.ts +191 -0
- package/apps/cad-creator/shared/cad/src/index.ts +4 -0
- package/apps/cad-creator/shared/cad/src/robotics/types.ts +232 -0
- package/apps/cad-creator/shared/cad/src/types.ts +507 -0
- package/apps/cad-creator/shared/cad/tsconfig.json +14 -0
- package/docs/AUTORAG.md +58 -0
- package/docs/BRAND_INTELLIGENCE.md +30 -0
- package/docs/CLI_SHELL.md +4 -2
- package/docs/CMS_CONTEXTUAL_COMPOSER.md +38 -0
- package/docs/MERKLE.md +4 -0
- package/docs/PROJECT_CONFIG.md +3 -0
- package/docs/REPOSITORY_KNOWLEDGE.md +2 -0
- package/docs/THEME_REFINERY.md +120 -0
- package/docs/architecture/PROVIDER-TOOLS-AND-COMPACTION.md +60 -0
- package/docs/architecture/STORAGE.md +87 -0
- package/docs/cad-project-tools.md +69 -0
- package/docs/cms-scaffolding-pattern-reference.md +73 -0
- package/docs/plans/AGENTSAM-INTERACTIVE-UI-REQUIREMENTS-codex-tui-20260919.md +113 -0
- package/docs/plans/AGENTSAM-INTERACTIVE-UI-REQUIREMENTS.md +85 -0
- package/docs/plans/AGENTSAM-MCP-CLIENT-2026-09-19.md +181 -0
- package/docs/plans/ASBD-PORTABLE-WORKGRAPH-UI-DEFERRED.md +34 -0
- package/docs/plans/ASTRA-BRIEF-2026-09-18.md +258 -0
- package/docs/plans/MULTI-AGENT-SPRINTS-2026-09-19.md +373 -0
- package/docs/plans/NEXT-AGENT-HANDOFF.md +167 -0
- package/docs/plans/RECONCILIATION-2026-09-19.md +178 -0
- package/docs/plugins.md +43 -0
- package/docs/tools/README.md +57 -0
- package/docs/tools/agent-and-orchestration.md +49 -0
- package/docs/tools/browser-and-research.md +46 -0
- package/docs/tools/cloudflare-platform.md +32 -0
- package/docs/tools/cms.md +25 -0
- package/docs/tools/communications.md +41 -0
- package/docs/tools/database-and-storage.md +62 -0
- package/docs/tools/design-and-media.md +64 -0
- package/docs/tools/filesystem-and-code.md +55 -0
- package/docs/tools/github.md +56 -0
- package/docs/tools/integrations-and-misc.md +16 -0
- package/docs/tools/memory.md +21 -0
- package/docs/tools/terminal-and-execution.md +29 -0
- package/docs/tools/tickets-and-platform.md +30 -0
- package/migrations/d1/0001_agentsam_plugin_runtime.sql +177 -0
- package/migrations/d1/0002_agentsam_ticket_ownership.sql +8 -0
- package/migrations/d1/0002_dynamic_model_policies.sql +23 -0
- package/migrations/d1/0003_expand_tool_handler_families.sql +18 -0
- package/migrations/d1/0004_project_aware_retrieval_lanes.sql +24 -0
- package/migrations/d1/0005_portable_knowledge_identity.sql +104 -0
- package/migrations/d1/0006_repair_ops_trail_account_scope.sql +14 -0
- package/migrations/d1/0007_repair_ops_trail_agent_run_account.sql +13 -0
- package/migrations/d1/0008_backfill_knowledge_run_legacy_tenant.sql +14 -0
- package/migrations/d1/0009_normalize_cloudflare_plugin_installations.sql +137 -0
- package/migrations/runtime/0001_cli_runtime.sql +67 -0
- package/migrations/runtime/0002_project_sessions.sql +15 -0
- package/migrations/runtime/0003_provider_continuations.sql +8 -0
- package/package.json +92 -12
- package/packages/agentsam-brand/README.md +21 -0
- package/packages/agentsam-brand/package.json +22 -0
- package/packages/agentsam-brand/src/contract.js +59 -0
- package/packages/agentsam-brand/src/extract.js +126 -0
- package/packages/agentsam-brand/src/goap-actions.js +73 -0
- package/packages/agentsam-brand/src/index.js +48 -0
- package/packages/agentsam-brand/src/plan.js +115 -0
- package/packages/agentsam-brand/src/resolve.js +139 -0
- package/packages/agentsam-brand/src/scan.js +250 -0
- package/packages/agentsam-brand/test/brand-scan.test.mjs +106 -0
- package/packages/agentsam-contracts/README.md +23 -0
- package/packages/agentsam-contracts/package.json +32 -0
- package/packages/agentsam-contracts/src/adapter.ts +25 -0
- package/packages/agentsam-contracts/src/agent.ts +35 -0
- package/packages/agentsam-contracts/src/artifacts.ts +33 -0
- package/packages/agentsam-contracts/src/authority.ts +29 -0
- package/packages/agentsam-contracts/src/context.ts +16 -0
- package/packages/agentsam-contracts/src/errors.ts +46 -0
- package/packages/agentsam-contracts/src/events.ts +47 -0
- package/packages/agentsam-contracts/src/execution.ts +50 -0
- package/packages/agentsam-contracts/src/hooks.ts +40 -0
- package/packages/agentsam-contracts/src/identity.ts +16 -0
- package/packages/agentsam-contracts/src/index.ts +14 -0
- package/packages/agentsam-contracts/src/models.ts +9 -0
- package/packages/agentsam-contracts/src/providers.ts +33 -0
- package/packages/agentsam-contracts/src/repository.ts +64 -0
- package/packages/agentsam-contracts/src/tools.ts +98 -0
- package/packages/agentsam-contracts/test/contracts.test.mjs +16 -0
- package/packages/agentsam-contracts/test/errors-catalog.test.mjs +25 -0
- package/packages/agentsam-contracts/test/repository.test.mjs +18 -0
- package/packages/agentsam-contracts/tsconfig.json +12 -0
- package/packages/agentsam-errors/package.json +17 -0
- package/packages/agentsam-errors/src/adapters/anthropic.js +15 -0
- package/packages/agentsam-errors/src/adapters/cad.js +109 -0
- package/packages/agentsam-errors/src/adapters/cloudflare.js +21 -0
- package/packages/agentsam-errors/src/adapters/cursor.js +4 -0
- package/packages/agentsam-errors/src/adapters/device.js +38 -0
- package/packages/agentsam-errors/src/adapters/docker.js +28 -0
- package/packages/agentsam-errors/src/adapters/gcp.js +14 -0
- package/packages/agentsam-errors/src/adapters/github.js +22 -0
- package/packages/agentsam-errors/src/adapters/google.js +17 -0
- package/packages/agentsam-errors/src/adapters/index.js +55 -0
- package/packages/agentsam-errors/src/adapters/internal.js +40 -0
- package/packages/agentsam-errors/src/adapters/oauth.js +24 -0
- package/packages/agentsam-errors/src/adapters/openai.js +17 -0
- package/packages/agentsam-errors/src/adapters/process.js +35 -0
- package/packages/agentsam-errors/src/adapters/provider.js +114 -0
- package/packages/agentsam-errors/src/envelope.js +186 -0
- package/packages/agentsam-errors/src/error.js +24 -0
- package/packages/agentsam-errors/src/fingerprint.js +35 -0
- package/packages/agentsam-errors/src/index.js +10 -0
- package/packages/agentsam-errors/src/normalize.js +30 -0
- package/packages/agentsam-errors/src/redaction.js +52 -0
- package/packages/agentsam-errors/src/render.js +16 -0
- package/packages/agentsam-errors/src/retry.js +10 -0
- package/packages/agentsam-errors/src/transport.js +52 -0
- package/packages/agentsam-errors/src/vocabulary.js +320 -0
- package/packages/agentsam-errors/test/envelope.test.mjs +70 -0
- package/packages/agentsam-errors/test/providers.test.mjs +99 -0
- package/packages/agentsam-errors/test/redaction.test.mjs +21 -0
- package/packages/agentsam-errors/test/runtime-cad-device.test.mjs +76 -0
- package/packages/agentsam-errors/test/transport.test.mjs +46 -0
- package/packages/agentsam-knowledge/package.json +15 -0
- package/packages/agentsam-knowledge/src/autorag/index.js +64 -0
- package/packages/agentsam-knowledge/src/backends/index.js +26 -0
- package/packages/agentsam-knowledge/src/index.js +3 -0
- package/packages/agentsam-knowledge/src/providers/index.js +95 -0
- package/packages/agentsam-knowledge/test/autorag.test.mjs +42 -0
- package/packages/agentsam-nav/README.md +40 -0
- package/packages/agentsam-nav/dist/Nav.d.ts +43 -0
- package/packages/agentsam-nav/dist/NavCollapsible.d.ts +10 -0
- package/packages/agentsam-nav/dist/NavContent.d.ts +2 -0
- package/packages/agentsam-nav/dist/NavFooter.d.ts +2 -0
- package/packages/agentsam-nav/dist/NavGroup.d.ts +3 -0
- package/packages/agentsam-nav/dist/NavHeader.d.ts +2 -0
- package/packages/agentsam-nav/dist/NavMenu.d.ts +22 -0
- package/packages/agentsam-nav/dist/NavProvider.d.ts +35 -0
- package/packages/agentsam-nav/dist/NavTrigger.d.ts +2 -0
- package/packages/agentsam-nav/dist/Surfaces.d.ts +41 -0
- package/packages/agentsam-nav/dist/browser.d.ts +11 -0
- package/packages/agentsam-nav/dist/browser.global.js +132 -0
- package/packages/agentsam-nav/dist/browser.js +613 -0
- package/packages/agentsam-nav/dist/contracts.d.ts +76 -0
- package/packages/agentsam-nav/dist/index.d.ts +11 -0
- package/packages/agentsam-nav/dist/index.js +614 -0
- package/packages/agentsam-nav/dist/legacy.css +83 -0
- package/packages/agentsam-nav/dist/shell.css +113 -0
- package/packages/agentsam-nav/dist/theme.css +113 -0
- package/packages/agentsam-nav/dist/utils.d.ts +1 -0
- package/packages/agentsam-nav/package.json +43 -0
- package/packages/agentsam-queue-control/README.md +107 -0
- package/packages/agentsam-queue-control/package.json +31 -0
- package/packages/agentsam-queue-control/schemas/job-envelope.schema.json +56 -0
- package/packages/agentsam-queue-control/src/adapters/cloudflare.js +152 -0
- package/packages/agentsam-queue-control/src/adapters/memory.js +38 -0
- package/packages/agentsam-queue-control/src/contracts.js +130 -0
- package/packages/agentsam-queue-control/src/control-plane.js +141 -0
- package/packages/agentsam-queue-control/src/dispatch.js +43 -0
- package/packages/agentsam-queue-control/src/index.js +7 -0
- package/packages/agentsam-queue-control/src/policy.js +88 -0
- package/packages/agentsam-queue-control/src/topology.js +66 -0
- package/packages/agentsam-queue-control/test/queue-control.test.mjs +100 -0
- package/packages/agentsam-repository/src/goap.js +718 -0
- package/packages/agentsam-repository/src/goap.js.bak-20260922011251 +670 -0
- package/packages/agentsam-repository/src/index.js +5 -0
- package/packages/agentsam-repository/src/merkle/cloudflare-persistence.js +2 -2
- package/packages/agentsam-repository/src/tickets.js +184 -0
- package/packages/agentsam-repository/src/work-tracking.js +199 -0
- package/packages/agentsam-repository/src/workspace-state.js +176 -0
- package/packages/agentsam-repository/test/goap-tickets-workspace-state.test.mjs +152 -0
- package/packages/connectors/cloudflare/src/index.js +297 -15
- package/packages/connectors/cloudflare/src/owner.js +43 -40
- package/packages/connectors/cloudflare/src/routes.js +167 -26
- package/packages/connectors/cloudflare/tests/connector.test.mjs +112 -2
- package/packages/heuristic-theme/README.md +11 -0
- package/packages/heuristic-theme/package.json +25 -0
- package/packages/heuristic-theme/src/index.js +2 -0
- package/packages/heuristic-theme/src/registry.js +36 -0
- package/packages/heuristic-theme/src/theme.js +41 -0
- package/packages/heuristic-theme/test/theme.test.mjs +26 -0
- package/packages/identity/.agentsam/features/oauth-login-portal/agentsam.feature.json +64 -0
- package/packages/identity/.agentsam/features/oauth-login-portal/providers.json +96 -0
- package/packages/identity/.agentsam/features/oauth-login-portal/resources.json +47 -0
- package/packages/identity/.agentsam/features/oauth-login-portal/routes.json +74 -0
- package/packages/identity/.agentsam/features/oauth-login-portal/ui.json +35 -0
- package/packages/identity/package.json +3 -2
- package/packages/identity/src/adapters/cloudflare-d1/ids.js +4 -0
- package/packages/identity/src/adapters/cloudflare-d1/index.js +39 -1
- package/packages/identity/src/contracts/provider.js +3 -2
- package/packages/identity/src/frontend/auth-portal/pages/login.html +7 -0
- package/packages/identity/src/index.js +2 -0
- package/packages/identity/src/oauth/credentials.js +13 -0
- package/packages/identity/src/oauth/iam-platform.js +5 -5
- package/packages/identity/src/providers/cloudflare/index.js +19 -0
- package/packages/identity/src/providers/cloudflare/mapper.js +21 -0
- package/packages/identity/src/providers/cloudflare/oauth.js +48 -0
- package/packages/identity/src/providers/cloudflare/profile.js +28 -0
- package/packages/identity/src/providers/index.js +18 -2
- package/packages/identity/src/server/identity-service.js +13 -3
- package/packages/identity/src/server/worker-router.js +63 -8
- package/packages/identity/tests/identity-service.test.mjs +15 -0
- package/packages/providers/completeful/README.md +38 -0
- package/packages/providers/completeful/package.json +29 -0
- package/packages/providers/completeful/src/client.js +162 -0
- package/packages/providers/completeful/src/events.js +49 -0
- package/packages/providers/completeful/src/index.js +22 -0
- package/packages/providers/completeful/src/tools.js +579 -0
- package/packages/providers/completeful/src/webhooks.js +55 -0
- package/packages/providers/completeful/test/provider.test.mjs +196 -0
- package/packages/theme-church-site/README.md +10 -0
- package/packages/theme-church-site/package.json +30 -0
- package/packages/theme-church-site/src/harvest.json +14 -0
- package/packages/theme-church-site/src/index.js +84 -0
- package/packages/theme-church-site/test/theme.test.mjs +19 -0
- package/packages/theme-companions-site/README.md +10 -0
- package/packages/theme-companions-site/package.json +30 -0
- package/packages/theme-companions-site/src/harvest.json +12 -0
- package/packages/theme-companions-site/src/index.js +82 -0
- package/packages/theme-companions-site/test/theme.test.mjs +19 -0
- package/packages/theme-floors-site/README.md +10 -0
- package/packages/theme-floors-site/package.json +30 -0
- package/packages/theme-floors-site/src/harvest.json +14 -0
- package/packages/theme-floors-site/src/index.js +82 -0
- package/packages/theme-floors-site/test/theme.test.mjs +19 -0
- package/packages/theme-fuelnfree-site/README.md +10 -0
- package/packages/theme-fuelnfree-site/package.json +30 -0
- package/packages/theme-fuelnfree-site/src/harvest.json +13 -0
- package/packages/theme-fuelnfree-site/src/index.js +81 -0
- package/packages/theme-fuelnfree-site/test/theme.test.mjs +19 -0
- package/packages/theme-handyman-site/README.md +10 -0
- package/packages/theme-handyman-site/package.json +30 -0
- package/packages/theme-handyman-site/src/harvest.json +10 -0
- package/packages/theme-handyman-site/src/index.js +83 -0
- package/packages/theme-handyman-site/test/theme.test.mjs +19 -0
- package/packages/theme-insurance-site/README.md +10 -0
- package/packages/theme-insurance-site/package.json +30 -0
- package/packages/theme-insurance-site/src/harvest.json +10 -0
- package/packages/theme-insurance-site/src/index.js +83 -0
- package/packages/theme-insurance-site/test/theme.test.mjs +19 -0
- package/packages/theme-shinshu-site/README.md +10 -0
- package/packages/theme-shinshu-site/package.json +30 -0
- package/packages/theme-shinshu-site/src/harvest.json +12 -0
- package/packages/theme-shinshu-site/src/index.js +83 -0
- package/packages/theme-shinshu-site/test/theme.test.mjs +19 -0
- package/packages/work-graph/README.md +49 -0
- package/packages/work-graph/package.json +19 -0
- package/packages/work-graph/prototype/README.md +32 -0
- package/packages/work-graph/prototype/data/demo-workgraph.js +47 -0
- package/packages/work-graph/prototype/renderers/timeline-model.js +21 -0
- package/packages/work-graph/prototype/renderers/workgraph-runtime.js +38 -0
- package/packages/work-graph/prototype-gnantt.html +655 -0
- package/packages/work-graph/src/adapters/business/projects.js +23 -0
- package/packages/work-graph/src/adapters/engineering/git.js +22 -0
- package/packages/work-graph/src/adapters/engineering/mcp.js +22 -0
- package/packages/work-graph/src/index.js +76 -0
- package/packages/work-graph/src/renderers/gantt-model.js +11 -0
- package/packages/work-graph/src/renderers/timeline.js +16 -0
- package/packages/work-graph/test/work-graph.test.mjs +37 -0
- package/protocol/README.md +12 -0
- package/protocol/capabilities/cloudflare-cpu-audit-input.schema.json +30 -6
- package/protocol/capabilities/cloudflare-cpu-profile-input.schema.json +18 -4
- package/protocol/capabilities/cloudflare-wrangler-native-input.schema.json +59 -10
- package/protocol/capabilities/knowledge-search-input.schema.json +35 -0
- package/protocol/capabilities/manifest.json +163 -1
- package/protocol/capabilities/repository-audit-input.schema.json +39 -6
- package/protocol/capabilities/repository-snapshot-input.schema.json +15 -3
- package/protocol/capabilities/terminal-exec-input.schema.json +55 -0
- package/protocol/commerce/catalog.v1.json +50 -0
- package/protocol/errors/error-catalog.json +164 -0
- package/protocol/errors/error-envelope.schema.json +544 -0
- package/protocol/features/README.md +57 -0
- package/protocol/features/agentsam.feature.v1.schema.json +290 -0
- package/protocol/features/catalog.json +65 -0
- package/protocol/features/examples/provider-resend.feature.json +17 -0
- package/protocol/go/agentsam-go-runtime.v1.json +17 -0
- package/protocol/knowledge/LIFECYCLE.md +140 -0
- package/protocol/knowledge/README.md +4 -0
- package/protocol/presets/catalog.json +128 -19
- package/protocol/rpc/v1/errors.proto +24 -0
- package/protocol/theme-refinery/d1-reconciliation.md +48 -0
- package/protocol/theme-refinery/product-metadata.schema.json +27 -0
- package/protocol/theme-refinery/receipts/products-registry-batch-20260924.json +318 -0
- package/protocol/theme-refinery/receipts/theme-harvest-20260924.json +472 -0
- package/protocol/theme-refinery/reconciliation-receipt.schema.json +83 -0
- package/services/cad/server.py +249 -2
- package/src/agent/capability-adapter.js +15 -5
- package/src/agent/index.js +2 -1
- package/src/agent/model-turn.js +51 -0
- package/src/agent/responses-runner.js +304 -38
- package/src/capabilities/index.js +1 -0
- package/src/capabilities/terminal-exec.js +78 -0
- package/src/cli.js +117 -9
- package/src/cloudflare/index.js +6 -0
- package/src/cloudflare/runtime-status.js +393 -0
- package/src/cloudflare/wrangler.js +17 -1
- package/src/commands/app.js +106 -0
- package/src/commands/autorag.js +77 -0
- package/src/commands/brand.js +293 -0
- package/src/commands/cad.js +1 -0
- package/src/commands/connections.js +126 -29
- package/src/commands/context-economics.js +8 -0
- package/src/commands/db.js +7 -0
- package/src/commands/env.js +5 -4
- package/src/commands/eval.js +209 -14
- package/src/commands/go.js +365 -0
- package/src/commands/goap.js +176 -0
- package/src/commands/identity-init.js +27 -3
- package/src/commands/identity-protocol.js +195 -0
- package/src/commands/knowledge.js +64 -5
- package/src/commands/mcp.js +341 -0
- package/src/commands/merkle-persist.js +3 -1
- package/src/commands/merkle.js +18 -3
- package/src/commands/models.js +109 -23
- package/src/commands/plugins.js +175 -0
- package/src/commands/preferences.js +28 -8
- package/src/commands/product.js +53 -10
- package/src/commands/providers.js +118 -37
- package/src/commands/resume.js +9 -5
- package/src/commands/runtime-status.js +154 -0
- package/src/commands/shell.js +466 -55
- package/src/commands/status.js +82 -7
- package/src/commands/tunnel.js +228 -195
- package/src/commands/whoami.js +78 -6
- package/src/context/budget.js +6 -0
- package/src/context/index.js +2 -1
- package/src/context/project-card.js +75 -0
- package/src/errors/contract.js +34 -211
- package/src/errors/diagnostic.js +95 -51
- package/src/errors/index.js +6 -13
- package/src/eval/index.js +6 -0
- package/src/eval/live.js +439 -0
- package/src/features/resolve.js +242 -0
- package/src/go/build.js +108 -0
- package/src/go/cloudflare.js +207 -0
- package/src/go/contract.js +139 -0
- package/src/go/discover.js +96 -0
- package/src/go/index.js +13 -0
- package/src/go/receipts.js +77 -0
- package/src/go/registry.js +223 -0
- package/src/go/verify.js +31 -0
- package/src/index.js +100 -1
- package/src/knowledge/config.js +13 -5
- package/src/knowledge/engine.js +23 -8
- package/src/knowledge/index.js +1 -0
- package/src/knowledge/lane-registry.js +46 -0
- package/src/knowledge/providers/gemini.js +48 -8
- package/src/knowledge/service/client.js +13 -1
- package/src/knowledge/service/grpc-codec.js +156 -53
- package/src/knowledge/service/job-engine.js +133 -11
- package/src/knowledge/service/job-worker.js +34 -5
- package/src/knowledge/service/server.js +10 -1
- package/src/knowledge/store-discovery.js +77 -0
- package/src/lib/account-session.js +8 -2
- package/src/lib/agent-instructions.js +3 -0
- package/src/lib/auth.js +7 -3
- package/src/lib/cad/blender.js +42 -3
- package/src/lib/cad/d1-project-store.js +43 -0
- package/src/lib/cad/discovery.js +616 -0
- package/src/lib/cad/docker-executor.js +352 -0
- package/src/lib/cad/freecad.js +253 -0
- package/src/lib/cad/index.js +40 -0
- package/src/lib/cad/openscad.js +198 -0
- package/src/lib/cad/project-cli.d.ts +2 -0
- package/src/lib/cad/project-cli.js +21 -0
- package/src/lib/cad/project-contract.d.ts +3 -0
- package/src/lib/cad/project-contract.js +1 -0
- package/src/lib/cad/project-recipe.js +30 -0
- package/src/lib/cad/project-runtime.d.ts +2 -0
- package/src/lib/cad/project-runtime.js +53 -0
- package/src/lib/cad/project-store.js +25 -0
- package/src/lib/cad/project-workflows.js +31 -0
- package/src/lib/cad-docker.js +21 -2
- package/src/lib/cli-preferences.js +17 -2
- package/src/lib/core-client.js +37 -18
- package/src/lib/deploy/local-studio.js +6 -5
- package/src/lib/dockerize.js +3 -0
- package/src/lib/execution-approvals.js +1 -0
- package/src/lib/identity-scaffold.js +4 -1
- package/src/lib/knowledge-docker.js +9 -1
- package/src/lib/local-sessions.js +124 -34
- package/src/lib/local-status.js +35 -14
- package/src/lib/project-config.js +9 -0
- package/src/lib/provider-credentials.js +73 -11
- package/src/lib/scaffold/resolve-cloudflare-account.js +37 -0
- package/src/lib/scaffold/wizards/cms.js +2 -8
- package/src/lib/scaffold/wizards/worker-api.js +2 -8
- package/src/lib/slash-commands.js +9 -2
- package/src/local/migrations.js +109 -1
- package/src/local/runtime-store.js +31 -5
- package/src/local/sqlite.js +36 -1
- package/src/mcp/authority.js +348 -0
- package/src/mcp/client-adapters.js +431 -0
- package/src/mcp/client.js +172 -0
- package/src/mcp/index.js +47 -0
- package/src/mcp/telemetry.js +103 -0
- package/src/models/catalog.js +329 -51
- package/src/models/discovery.js +24 -4
- package/src/models/index.js +2 -0
- package/src/models/inventory-core.js +182 -0
- package/src/models/policy.js +20 -0
- package/src/plugins/cloudflare.js +103 -0
- package/src/plugins/completeful.js +69 -0
- package/src/plugins/contracts.js +86 -0
- package/src/plugins/index.js +11 -0
- package/src/plugins/registry.js +207 -0
- package/src/plugins/resource-scope.js +45 -0
- package/src/plugins/runtime.js +118 -0
- package/src/plugins/vectorize.js +31 -0
- package/src/progression/engine.js +171 -0
- package/src/progression/index.js +1 -0
- package/src/providers/cloudflare-chat.js +1 -1
- package/src/providers/gemini-generate-content.js +2 -1
- package/src/providers/openai-responses.js +45 -16
- package/src/providers/tool-schema.js +85 -0
- package/src/repository/index.js +29 -0
- package/src/rpc/generated/errors_pb.js +961 -1
- package/src/security/local-vault.js +415 -0
- package/src/security/process.js +20 -4
- package/src/status/actions.js +192 -0
- package/src/tools/hydrate.js +5 -1
- package/src/tools/index.js +7 -0
- package/src/tools/redact.js +64 -0
- package/src/tools/registry.js +83 -0
- package/src/tools/runtime.js +257 -0
- package/src/tools/search.js +21 -8
- package/src/ui/ansi.js +117 -3
- package/src/ui/cli/activity.js +76 -7
- package/src/ui/cli/footer.js +110 -9
- package/src/ui/cli/help.js +11 -4
- package/src/ui/wireframes.js +166 -0
- package/test/account-session.test.mjs +28 -0
- package/test/apps-scaffold-contract.test.mjs +16 -1
- package/test/capabilities.test.mjs +1 -1
- package/test/cli/eval-live.test.mjs +219 -0
- package/test/cli/go.test.mjs +71 -0
- package/test/cli/local-vault-and-provider-setup.test.mjs +268 -0
- package/test/cli/mcp-client.test.mjs +245 -0
- package/test/cli/runtime-ui.test.mjs +69 -2
- package/test/cli/status-actions.test.mjs +88 -0
- package/test/cli/wireframes-go-registry.test.mjs +54 -0
- package/test/cloudflare-connector.test.mjs +3 -6
- package/test/cloudflare-runtime.test.mjs +8 -1
- package/test/context.test.mjs +15 -0
- package/test/error-diagnostics.test.mjs +9 -0
- package/test/fixtures/cad/courtyard-house.json +208 -0
- package/test/go/cloudflare-probe.test.mjs +53 -0
- package/test/integration/app-command.test.mjs +55 -0
- package/test/integration/cad-discovery.test.mjs +158 -0
- package/test/integration/cad-docker-executor.test.mjs +249 -0
- package/test/integration/cad-execution.test.mjs +184 -0
- package/test/integration/cad-project-app.test.mjs +31 -0
- package/test/integration/cad-project-d1.test.mjs +25 -0
- package/test/integration/cad-project-native.test.mjs +24 -0
- package/test/integration/cad-project-workflow.test.mjs +9 -0
- package/test/integration/cad-project.test.mjs +82 -0
- package/test/integration/cli-help.test.mjs +4 -0
- package/test/integration/cms-site-tenancy-contract.test.mjs +256 -0
- package/test/integration/core-client.integration.test.mjs +55 -0
- package/test/integration/error-runtime-rpc.test.mjs +71 -0
- package/test/integration/features-resolve.test.mjs +128 -0
- package/test/integration/install-script.test.mjs +107 -0
- package/test/integration/inventory-core.test.mjs +53 -0
- package/test/integration/plugins-cloudflare.integration.test.mjs +28 -0
- package/test/integration/provider-env-cli.test.mjs +1 -1
- package/test/integration/runtime-migrations.test.mjs +6 -1
- package/test/integration/runtime-status.integration.test.mjs +211 -0
- package/test/integration/scaffold-cloudflare.test.mjs +46 -0
- package/test/integration/storage-architecture.test.mjs +154 -0
- package/test/integration/store-discovery.test.mjs +44 -0
- package/test/integration/terminal-exec.integration.test.mjs +86 -0
- package/test/integration/tool-runtime.test.mjs +124 -0
- package/test/integration/tool-schema.test.mjs +59 -0
- package/test/knowledge-service.test.mjs +4 -0
- package/test/local-sessions.test.mjs +11 -2
- package/test/local-studio-deploy.test.mjs +1 -1
- package/test/model-catalog.test.mjs +28 -1
- package/test/models.test.mjs +159 -5
- package/test/openai-responses.test.mjs +60 -0
- package/test/provider-credentials.test.mjs +15 -5
- package/test/responses-runner.test.mjs +321 -6
- package/test/shell.test.mjs +149 -4
- package/test/smoke.mjs +2 -2
- package/test/tools-search.test.mjs +33 -0
- package/test/unit/website-assets-bindings.test.mjs +60 -0
- package/test/whoami-resume.test.mjs +82 -3
- package/examples/gorilla-shell/README.md +0 -15
- package/src/lib/gorilla-template.js +0 -54
- package/templates/gorilla-shell/App.tsx +0 -639
- package/templates/gorilla-shell/README.md +0 -34
- package/templates/gorilla-shell/index.html +0 -15
- package/templates/gorilla-shell/main.jsx +0 -9
- package/templates/gorilla-shell/package.json +0 -19
- package/templates/gorilla-shell/vite.config.js +0 -21
|
@@ -1,639 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useRef, useMemo, useCallback } from "react";
|
|
2
|
-
|
|
3
|
-
const PS = 5;
|
|
4
|
-
const PAL = ['transparent','#060e1a','#0f2040','#1a3568','#6a6a90','#9898b8','#2a1006','#8a5830','#ff1a1a','#ffd88a','#0e0400','#ffffff','#ffd700','#ffaa00','#ff6600','#ff2200','#9B6E14','#6B4808','#3a2604','#c09030','#ffee44','#cc8800','#44ff88','#ff4444'];
|
|
5
|
-
|
|
6
|
-
const GORILLA = [
|
|
7
|
-
[0,0,0,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0],
|
|
8
|
-
[0,0,2,3,3,3,3,3,3,3,3,3,3,2,2,0,0,0],
|
|
9
|
-
[0,2,2,3,3,3,3,3,3,3,3,3,3,3,2,2,0,0],
|
|
10
|
-
[0,2,3,3,7,7,3,3,3,7,7,3,3,3,2,0,0,0],
|
|
11
|
-
[2,2,3,7,7,8,7,3,3,7,8,7,7,3,3,2,2,0],
|
|
12
|
-
[2,2,3,7,7,7,7,7,7,7,7,7,7,3,3,2,2,0],
|
|
13
|
-
[2,3,3,7,6,10,6,7,7,6,10,6,7,3,3,3,2,0],
|
|
14
|
-
[2,3,3,7,7,7,9,9,9,9,7,7,7,3,3,3,2,0],
|
|
15
|
-
[0,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,0],
|
|
16
|
-
[0,2,2,3,4,4,4,4,4,4,4,4,4,3,2,2,0,0],
|
|
17
|
-
[2,2,2,3,4,5,5,5,5,5,5,5,4,3,3,2,2,2],
|
|
18
|
-
[2,3,2,3,4,5,5,5,5,5,5,5,4,3,2,3,2,2],
|
|
19
|
-
[2,3,3,3,3,4,4,5,5,4,4,3,3,3,3,3,2,0],
|
|
20
|
-
[0,2,3,3,3,3,3,3,3,3,3,3,3,3,2,2,0,0],
|
|
21
|
-
[0,0,2,3,3,3,3,3,3,3,3,3,3,2,2,0,0,0],
|
|
22
|
-
[0,0,2,2,3,3,3,3,3,3,3,3,2,2,0,0,0,0],
|
|
23
|
-
[0,0,0,2,2,3,3,0,0,3,3,2,2,0,0,0,0,0],
|
|
24
|
-
[0,0,0,2,2,2,2,0,0,2,2,2,2,0,0,0,0,0],
|
|
25
|
-
[0,0,0,0,2,2,2,0,0,2,2,2,0,0,0,0,0,0],
|
|
26
|
-
[0,0,0,0,2,3,2,0,0,2,3,2,0,0,0,0,0,0],
|
|
27
|
-
];
|
|
28
|
-
const GORILLA_PUMP = GORILLA.map((r,i) => {
|
|
29
|
-
if (i===8) return [2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,0];
|
|
30
|
-
if (i===9) return [2,2,3,4,5,5,5,5,5,5,5,5,5,4,3,2,2,0];
|
|
31
|
-
if (i===10) return [0,2,3,4,5,5,5,5,5,5,5,5,5,4,3,2,0,0];
|
|
32
|
-
if (i===11) return [0,2,3,3,4,5,5,5,5,5,5,5,4,3,3,2,0,0];
|
|
33
|
-
return r;
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const COIN = [[0,12,12,12,12,12,0],[12,20,20,20,20,20,12],[12,20,12,20,12,20,12],[12,20,20,20,20,20,12],[0,12,12,12,12,12,0],[0,0,21,21,0,0,0]];
|
|
37
|
-
const FLAME_FRAMES = [
|
|
38
|
-
[[0,0,14,0,0],[0,14,15,14,0],[14,15,13,14,0],[14,13,20,14,0],[0,14,13,14,0],[0,13,14,13,0]],
|
|
39
|
-
[[0,14,0,14,0],[14,15,14,0,0],[14,13,15,14,0],[0,14,13,14,0],[0,13,14,0,0],[0,14,13,0,0]],
|
|
40
|
-
[[0,14,14,0,0],[0,14,15,14,0],[14,15,13,15,0],[14,13,14,13,0],[0,14,13,14,0],[0,0,14,13,0]],
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
const THEMES = {
|
|
44
|
-
NIGHT: { bg:'#030a14', panel:'rgba(4,12,26,.97)', accent:'#00e5ff', dim:'#00e5ff22', glow:'0 0 14px #00e5ff55', border:'#00e5ff33' },
|
|
45
|
-
DAY: { bg:'#071a0a', panel:'rgba(6,20,10,.97)', accent:'#44ff88', dim:'#44ff8822', glow:'0 0 14px #44ff8855', border:'#44ff8833' },
|
|
46
|
-
LAVA: { bg:'#0e0003', panel:'rgba(18,2,4,.97)', accent:'#ff4400', dim:'#ff440022', glow:'0 0 14px #ff440055', border:'#ff440033' },
|
|
47
|
-
VOID: { bg:'#06001a', panel:'rgba(8,2,28,.97)', accent:'#aa44ff', dim:'#aa44ff22', glow:'0 0 14px #aa44ff55', border:'#aa44ff33' },
|
|
48
|
-
};
|
|
49
|
-
const TKEYS = Object.keys(THEMES);
|
|
50
|
-
|
|
51
|
-
// ── Line colors ───────────────────────────────────────────────────────────────
|
|
52
|
-
const LC = {
|
|
53
|
-
cmd: '#00e5ff',
|
|
54
|
-
success: '#44ff88',
|
|
55
|
-
error: '#ff4444',
|
|
56
|
-
warn: '#ffcc00',
|
|
57
|
-
info: '#88bbff',
|
|
58
|
-
muted: 'rgba(255,255,255,.45)',
|
|
59
|
-
dim: 'rgba(255,255,255,.18)',
|
|
60
|
-
white: 'rgba(255,255,255,.9)',
|
|
61
|
-
sam: '#cc88ff',
|
|
62
|
-
table: '#ffdd88',
|
|
63
|
-
pass: '#44ff88',
|
|
64
|
-
fail: '#ff4444',
|
|
65
|
-
accent: '#00e5ff',
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
// ── Scenario Builders ─────────────────────────────────────────────────────────
|
|
69
|
-
const BENCH_TESTS = [
|
|
70
|
-
['health_check',13],['auth_superadmin',8],['auth_regular',9],['d1_query_basic',45],
|
|
71
|
-
['d1_query_join',67],['d1_write_record',38],['mcp_tool_routing',23],['mcp_auth_bearer',11],
|
|
72
|
-
['mcp_audit_log',19],['agent_context_load',88],['r2_upload_asset',54],['r2_fetch_asset',31],
|
|
73
|
-
['kv_read_hit',7],['kv_write_ttl',14],['queue_publish',28],['worker_ai_t0',112],
|
|
74
|
-
['gemini_flash_lite',189],['haiku_route',145],['sonnet_route',234],['budget_check',6],
|
|
75
|
-
['cicd_sandbox_gate',17],['cicd_benchmark_gate',22],['deploy_record_insert',33],
|
|
76
|
-
['workspace_switch',12],['terminal_session_resume',19],['rag_cosine_query',78],
|
|
77
|
-
['tool_intent_match',15],['client_workflow_run',44],['project_context_load',29],
|
|
78
|
-
['skill_lookup',11],['cicd_pipeline_e2e',156],
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
function buildDeploy() {
|
|
82
|
-
let d = 0; const L = (text, color, gap=120) => { d+=gap; return {text,color,delay:d}; };
|
|
83
|
-
return [
|
|
84
|
-
L('gorilla@{{PROJECT_NAME}} ~ % /deploy sandbox','cmd',0),
|
|
85
|
-
L('','dim',60),
|
|
86
|
-
L(' ./scripts/with-cloudflare-env.sh npx wrangler deploy','muted',80),
|
|
87
|
-
L(' –config wrangler.sandbox.toml','muted',40),
|
|
88
|
-
L('','dim',80),
|
|
89
|
-
L(' Bundling worker…','muted',300),
|
|
90
|
-
L(' esbuild: scanning 847 modules…','muted',500),
|
|
91
|
-
L(' Tree-shaking complete: 284kb','muted',400),
|
|
92
|
-
L(' Build time: 1.24s','muted',200),
|
|
93
|
-
L('','dim',80),
|
|
94
|
-
L(' Uploading script…','muted',350),
|
|
95
|
-
L('','dim',60),
|
|
96
|
-
L(' Worker {{WORKER_NAME}}','info',200),
|
|
97
|
-
L(' Compat date 2026-04-08','info',60),
|
|
98
|
-
L(' D1 binding {{D1_DATABASE_NAME}} [{{D1_DATABASE_ID}}]','info',60),
|
|
99
|
-
L(' R2 binding {{R2_BUCKET_BINDING}}','info',60),
|
|
100
|
-
L(' KV binding {{KV_BINDING}}, RATE_LIMIT_KV','info',60),
|
|
101
|
-
L(' Queues DEPLOY_QUEUE, AGENT_QUEUE','info',60),
|
|
102
|
-
L('','dim',80),
|
|
103
|
-
L(' Routing table:','muted',200),
|
|
104
|
-
L(' {{DASHBOARD_HOST}} /* -> {{WORKER_NAME}}','dim',60),
|
|
105
|
-
L('','dim',80),
|
|
106
|
-
L(' [OK] Deployed successfully 3.41s','success',400),
|
|
107
|
-
L(' >> https://{{WORKER_NAME}}.workers.dev','accent',80),
|
|
108
|
-
L('','dim',100),
|
|
109
|
-
L(' Next: run /benchmark to proceed to prod','warn',200),
|
|
110
|
-
];
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function buildBenchmark() {
|
|
114
|
-
let d = 0; const L = (text, color, gap=80) => { d+=gap; return {text,color,delay:d}; };
|
|
115
|
-
const lines = [
|
|
116
|
-
L('gorilla@{{PROJECT_NAME}} ~ % /benchmark','cmd',0),
|
|
117
|
-
L('','dim',60),
|
|
118
|
-
L(' Running 31 tests against {{WORKER_NAME}}…','muted',200),
|
|
119
|
-
L('','dim',60),
|
|
120
|
-
];
|
|
121
|
-
BENCH_TESTS.forEach(([name, ms], i) => {
|
|
122
|
-
const num = String(i+1).padStart(2,'0');
|
|
123
|
-
const dots = '.'.repeat(Math.max(2, 36 - name.length));
|
|
124
|
-
lines.push(L(` [${num}/31] ${name} ${dots} PASS ${ms}ms`,'pass',75));
|
|
125
|
-
});
|
|
126
|
-
lines.push(L('','dim',100));
|
|
127
|
-
lines.push(L(' '+'-'.repeat(52),'dim',100));
|
|
128
|
-
lines.push(L(' RESULTS 31 / 31 PASSED avg 47ms total 1.46s','success',200));
|
|
129
|
-
lines.push(L(' '+'-'.repeat(52),'dim',60));
|
|
130
|
-
lines.push(L('','dim',80));
|
|
131
|
-
lines.push(L(' [GATE PASSED] Cleared for production promote','success',300));
|
|
132
|
-
return lines;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function buildD1() {
|
|
136
|
-
let d = 0; const L = (text, color, gap=100) => { d+=gap; return {text,color,delay:d}; };
|
|
137
|
-
const SEP = ' +—————————+———+———————+';
|
|
138
|
-
const rows = [
|
|
139
|
-
['{{WORKER_NAME}}','success','2026-04-07 23:10:56'],
|
|
140
|
-
['{{DASHBOARD_WORKER}}','success','2026-04-07 22:55:15'],
|
|
141
|
-
['{{DASHBOARD_WORKER}}','success','2026-04-07 22:06:28'],
|
|
142
|
-
['{{WORKER_NAME}}','success','2026-04-06 18:32:11'],
|
|
143
|
-
['{{DASHBOARD_WORKER}}','error','2026-04-06 17:44:03'],
|
|
144
|
-
];
|
|
145
|
-
return [
|
|
146
|
-
L('gorilla@{{PROJECT_NAME}} ~ % /d1 SELECT name, status, created_at FROM deployments ORDER BY created_at DESC LIMIT 5','cmd',0),
|
|
147
|
-
L('','dim',60),
|
|
148
|
-
L(' DB: {{D1_DATABASE_NAME}}','muted',150),
|
|
149
|
-
L(' ID: {{D1_DATABASE_ID}}','dim',60),
|
|
150
|
-
L('','dim',100),
|
|
151
|
-
L(SEP,'table',200),
|
|
152
|
-
L(' | name | status | created_at |','table',60),
|
|
153
|
-
L(SEP,'table',60),
|
|
154
|
-
...rows.map(([n,s,t]) => L(
|
|
155
|
-
` | ${n.padEnd(25)} | ${s.padEnd(7)} | ${t} |`,
|
|
156
|
-
s==='error'?'error':'white', 90
|
|
157
|
-
)),
|
|
158
|
-
L(SEP,'table',90),
|
|
159
|
-
L(' 5 rows | 2ms','dim',100),
|
|
160
|
-
];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function buildTail() {
|
|
164
|
-
let d = 0; const L = (text, color, gap=280) => { d+=gap; return {text,color,delay:d}; };
|
|
165
|
-
const reqs = [
|
|
166
|
-
['GET ','/ ','200','14ms',''],
|
|
167
|
-
['POST','/api/agent/chat ','200','234ms',''],
|
|
168
|
-
['GET ','/api/workspace/status ','200','8ms',''],
|
|
169
|
-
['POST','/mcp ','200','45ms','[MCP]'],
|
|
170
|
-
['GET ','/api/deployments ','200','12ms',''],
|
|
171
|
-
['POST','/api/agent/chat ','200','891ms','[LLM]'],
|
|
172
|
-
['GET ','/health ','200','2ms',''],
|
|
173
|
-
['POST','/api/d1/query ','200','34ms',''],
|
|
174
|
-
['GET ','/api/workspace/list ','200','18ms',''],
|
|
175
|
-
['POST','/api/agent/chat ','500','12ms','[ERR]'],
|
|
176
|
-
];
|
|
177
|
-
const delays = [0,320,180,260,400,350,220,310,280,450];
|
|
178
|
-
return [
|
|
179
|
-
L('gorilla@{{PROJECT_NAME}} ~ % /tail {{WORKER_NAME}}','cmd',0),
|
|
180
|
-
L('','dim',60),
|
|
181
|
-
L(' npx wrangler tail {{WORKER_NAME}} –format pretty','muted',100),
|
|
182
|
-
L(' Streaming live logs… (CTRL+C to stop)','dim',300),
|
|
183
|
-
L('','dim',100),
|
|
184
|
-
...reqs.map(([m,p,s,t,tag],i) => L(
|
|
185
|
-
` [10:23:${41+i}] ${m} ${p.padEnd(30)}${s} ${t.padEnd(8)}${tag}`,
|
|
186
|
-
s==='500'?'error': tag==='[LLM]'?'warn': tag==='[MCP]'?'info': 'muted',
|
|
187
|
-
delays[i] || 300
|
|
188
|
-
)),
|
|
189
|
-
L('','dim',200),
|
|
190
|
-
L(' 1 error detected – POST /api/agent/chat returned 500','error',200),
|
|
191
|
-
L(' Tip: run /samiam to diagnose','warn',200),
|
|
192
|
-
];
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function buildSamIAm() {
|
|
196
|
-
let d = 0; const L = (text, color, gap=80) => { d+=gap; return {text,color,delay:d}; };
|
|
197
|
-
return [
|
|
198
|
-
L('gorilla@{{PROJECT_NAME}} ~ % /samiam how is our terminal setup','cmd',0),
|
|
199
|
-
L('','dim',60),
|
|
200
|
-
L(' >> AGENT SAM ACTIVATED','sam',200),
|
|
201
|
-
L(' >> Workspace: {{WORKSPACE_ID}}','sam',100),
|
|
202
|
-
L(' >> PTY context: injecting last 30 lines','sam',100),
|
|
203
|
-
L(' >> Routing: claude-sonnet-4-6 (T2)','sam',100),
|
|
204
|
-
L('','dim',200),
|
|
205
|
-
L(' [SAM] Terminal PTY is running clean. Your xterm.js','sam',400),
|
|
206
|
-
L(' bridge is connected to local-pty via WebSocket.','sam',150),
|
|
207
|
-
L(' gorilla-mode shell is rendering on top of it.','sam',150),
|
|
208
|
-
L('','dim',80),
|
|
209
|
-
L(' [SAM] One issue flagging: 50 open errors in status','sam',300),
|
|
210
|
-
L(' bar – traced to mcp_services table having 30','sam',150),
|
|
211
|
-
L(' rows all pointing to same endpoint, NULL last_used.','sam',150),
|
|
212
|
-
L(' Table is never read by Worker – safe to truncate.','sam',150),
|
|
213
|
-
L('','dim',80),
|
|
214
|
-
L(' [SAM] Also: terminal_sessions user_id backfill is','sam',300),
|
|
215
|
-
L(' still needed in register INSERT (use session identity).','sam',150),
|
|
216
|
-
L('','dim',80),
|
|
217
|
-
L(' [1] Show me the mcp_services cleanup query','white',300),
|
|
218
|
-
L(' [2] Run /d1 truncate mcp_services directly','white',80),
|
|
219
|
-
L(' [3] Open the terminal_sessions bug in Cursor','white',80),
|
|
220
|
-
L(' [esc] Skip for now','dim',80),
|
|
221
|
-
];
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function buildWrangler() {
|
|
225
|
-
let d = 0; const L = (text, color, gap=100) => { d+=gap; return {text,color,delay:d}; };
|
|
226
|
-
return [
|
|
227
|
-
L('gorilla@{{PROJECT_NAME}} ~ % /wrangler tail {{WORKER_NAME}}','cmd',0),
|
|
228
|
-
L('','dim',60),
|
|
229
|
-
L(' [GATE] About to run:','warn',150),
|
|
230
|
-
L(' ./scripts/with-cloudflare-env.sh npx wrangler tail {{WORKER_NAME}}','white',80),
|
|
231
|
-
L('','dim',80),
|
|
232
|
-
L(' PROCEED? [1] YES [esc] NO','warn',200),
|
|
233
|
-
L('','dim',100),
|
|
234
|
-
L(' >> 1','cmd',600),
|
|
235
|
-
L('','dim',60),
|
|
236
|
-
L(' Connecting to worker: {{WORKER_NAME}}','muted',200),
|
|
237
|
-
L(' Account: {{CF_ACCOUNT_NAME}}','muted',80),
|
|
238
|
-
L(' Zone: {{ZONE_HOST}}','muted',80),
|
|
239
|
-
L('','dim',100),
|
|
240
|
-
L(' [STREAM] Listening for events…','success',300),
|
|
241
|
-
L('','dim',80),
|
|
242
|
-
L(' 10:31:04 GET / 200 11ms','dim',400),
|
|
243
|
-
L(' 10:31:06 POST /api/agent/chat 200 445ms','dim',350),
|
|
244
|
-
L(' 10:31:07 GET /api/status 200 6ms','dim',250),
|
|
245
|
-
L(' 10:31:09 POST /mcp 200 88ms [MCP]','info',380),
|
|
246
|
-
L(' 10:31:11 POST /api/agent/chat 200 1201ms [LLM]','warn',620),
|
|
247
|
-
L('','dim',200),
|
|
248
|
-
L(' LLM call latency spike: 1201ms – check Sonnet routing','warn',200),
|
|
249
|
-
];
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
const SCENARIOS = [
|
|
253
|
-
{ key:'deploy', label:'/deploy', fn:buildDeploy, status:'DEPLOYING', coins:6, pump:true, errAt:null },
|
|
254
|
-
{ key:'benchmark', label:'/benchmark', fn:buildBenchmark, status:'BENCHMARKING',coins:12, pump:true, errAt:null },
|
|
255
|
-
{ key:'d1', label:'/d1 query', fn:buildD1, status:'QUERYING D1',coins:3, pump:false, errAt:null },
|
|
256
|
-
{ key:'tail', label:'/tail', fn:buildTail, status:'TAILING', coins:0, pump:false, errAt:9 },
|
|
257
|
-
{ key:'samiam', label:'/samiam', fn:buildSamIAm, status:'SAM ACTIVE', coins:4, pump:true, errAt:null },
|
|
258
|
-
{ key:'wrangler', label:'/wrangler', fn:buildWrangler, status:'CF GATE', coins:2, pump:false, errAt:null },
|
|
259
|
-
];
|
|
260
|
-
|
|
261
|
-
// ── Sprite Renderer ───────────────────────────────────────────────────────────
|
|
262
|
-
function Sprite({ data, scale=1 }) {
|
|
263
|
-
const ps = PS * scale;
|
|
264
|
-
return (
|
|
265
|
-
<svg width={data[0].length*ps} height={data.length*ps} style={{imageRendering:'pixelated',display:'block'}}>
|
|
266
|
-
{data.flatMap((row,y) => row.map((c,x) =>
|
|
267
|
-
c ? <rect key={`${x},${y}`} x={x*ps} y={y*ps} width={ps} height={ps} fill={PAL[c]}/> : null
|
|
268
|
-
))}
|
|
269
|
-
</svg>
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// ── Bar ───────────────────────────────────────────────────────────────────────
|
|
274
|
-
function Bar({ pct, color, label, val }) {
|
|
275
|
-
return (
|
|
276
|
-
<div style={{marginBottom:10}}>
|
|
277
|
-
<div style={{display:'flex',justifyContent:'space-between',fontSize:9,letterSpacing:2,color:'rgba(255,255,255,.4)',marginBottom:3}}>
|
|
278
|
-
<span>{label}</span><span style={{color}}>{val}</span>
|
|
279
|
-
</div>
|
|
280
|
-
<div style={{height:6,background:'rgba(255,255,255,.07)',position:'relative'}}>
|
|
281
|
-
<div style={{position:'absolute',top:0,left:0,height:'100%',width:`${pct}%`,background:color,transition:'width .4s ease',boxShadow:`0 0 6px ${color}`}}/>
|
|
282
|
-
</div>
|
|
283
|
-
</div>
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// ── Main ──────────────────────────────────────────────────────────────────────
|
|
288
|
-
const PROJECT = import.meta.env.VITE_PROJECT_NAME || '{{PROJECT_NAME}}';
|
|
289
|
-
const LANE = import.meta.env.VITE_LANE_KEY || '{{LANE_KEY}}';
|
|
290
|
-
const AGENT = import.meta.env.VITE_AGENT || '{{AGENT}}';
|
|
291
|
-
|
|
292
|
-
export default function GorillaMode() {
|
|
293
|
-
const [themeIdx, setThemeIdx] = useState(0);
|
|
294
|
-
const [lines, setLines] = useState([{text:`gorilla@${PROJECT} ~ % Gorilla Mode ready — type /help or pick a demo.`, color:'dim', delay:0}]);
|
|
295
|
-
const [running, setRunning] = useState(false);
|
|
296
|
-
const [status, setStatus] = useState('READY');
|
|
297
|
-
const [progress, setProgress] = useState(0);
|
|
298
|
-
const [pump, setPump] = useState(false);
|
|
299
|
-
const [errorFlash, setError] = useState(false);
|
|
300
|
-
const [coinCount, setCoinCount] = useState(0);
|
|
301
|
-
const [floatCoins, setFloat] = useState([]);
|
|
302
|
-
const [flameTick, setFlameTick] = useState(0);
|
|
303
|
-
const [booted, setBooted] = useState(false);
|
|
304
|
-
const [bootLine, setBootLine] = useState('');
|
|
305
|
-
const [activeScenario, setActive] = useState(null);
|
|
306
|
-
const [inputLine, setInputLine] = useState('');
|
|
307
|
-
const [apiOnline, setApiOnline] = useState(false);
|
|
308
|
-
const termRef = useRef(null);
|
|
309
|
-
const timerRefs = useRef([]);
|
|
310
|
-
const inputRef = useRef(null);
|
|
311
|
-
|
|
312
|
-
const appendLine = useCallback((text, color = 'white') => {
|
|
313
|
-
setLines((prev) => [...prev, { text, color, delay: 0 }]);
|
|
314
|
-
}, []);
|
|
315
|
-
|
|
316
|
-
const runLiveSam = useCallback(async (message) => {
|
|
317
|
-
const msg = String(message || '').trim();
|
|
318
|
-
if (!msg) return;
|
|
319
|
-
setRunning(true);
|
|
320
|
-
setStatus('SAM ACTIVE');
|
|
321
|
-
setPump(true);
|
|
322
|
-
appendLine(' >> AGENT SAM (local Worker API)', 'sam');
|
|
323
|
-
try {
|
|
324
|
-
const res = await fetch('/api/agentsam/message', {
|
|
325
|
-
method: 'POST',
|
|
326
|
-
headers: { 'Content-Type': 'application/json' },
|
|
327
|
-
body: JSON.stringify({ message: msg, lane: LANE, agent: AGENT }),
|
|
328
|
-
});
|
|
329
|
-
const data = await res.json().catch(() => ({}));
|
|
330
|
-
if (!res.ok || !data.ok) {
|
|
331
|
-
appendLine(` [ERR] ${data.error || res.status}`, 'error');
|
|
332
|
-
} else {
|
|
333
|
-
appendLine(` [intent] ${data.intent} · agent ${data.agent} · lane ${data.lane}`, 'sam');
|
|
334
|
-
(data.next_steps || []).forEach((step) => appendLine(` → ${step}`, 'white'));
|
|
335
|
-
if (data.requires_approval) appendLine(' ⚠ requires approval before destructive action', 'warn');
|
|
336
|
-
}
|
|
337
|
-
} catch (e) {
|
|
338
|
-
appendLine(` [ERR] ${e?.message || 'API unreachable — is npm run dev:worker running?'}`, 'error');
|
|
339
|
-
} finally {
|
|
340
|
-
setRunning(false);
|
|
341
|
-
setPump(false);
|
|
342
|
-
setStatus(apiOnline ? 'READY' : 'API OFFLINE');
|
|
343
|
-
}
|
|
344
|
-
}, [appendLine, apiOnline]);
|
|
345
|
-
|
|
346
|
-
const T = THEMES[TKEYS[themeIdx]];
|
|
347
|
-
|
|
348
|
-
// Boot
|
|
349
|
-
useEffect(() => {
|
|
350
|
-
const BOOT = [`GORILLA MODE v1.5`,`>> PROJECT: ${PROJECT}`,`>> LANE: ${LANE}`,`>> AGENT: ${AGENT}`,`>> PROBING LOCAL API…`];
|
|
351
|
-
let i = 0;
|
|
352
|
-
const t = setInterval(() => { if(i<BOOT.length){setBootLine(BOOT[i]);i++;}else{clearInterval(t);setTimeout(async ()=>{
|
|
353
|
-
try {
|
|
354
|
-
const res = await fetch('/api/health');
|
|
355
|
-
setApiOnline(res.ok);
|
|
356
|
-
if (res.ok) setBootLine('>> AGENT SAM: ONLINE (local)');
|
|
357
|
-
else setBootLine('>> AGENT SAM: waiting for worker…');
|
|
358
|
-
} catch {
|
|
359
|
-
setApiOnline(false);
|
|
360
|
-
setBootLine('>> AGENT SAM: start npm run dev');
|
|
361
|
-
}
|
|
362
|
-
setTimeout(()=>setBooted(true),400);
|
|
363
|
-
},200);}}, 340);
|
|
364
|
-
return () => clearInterval(t);
|
|
365
|
-
}, []);
|
|
366
|
-
|
|
367
|
-
// Flame tick
|
|
368
|
-
useEffect(() => {
|
|
369
|
-
const t = setInterval(() => setFlameTick(n => (n+1)%3), 190);
|
|
370
|
-
return () => clearInterval(t);
|
|
371
|
-
}, []);
|
|
372
|
-
|
|
373
|
-
// Auto-scroll terminal
|
|
374
|
-
useEffect(() => {
|
|
375
|
-
if (termRef.current) termRef.current.scrollTop = termRef.current.scrollHeight;
|
|
376
|
-
}, [lines]);
|
|
377
|
-
|
|
378
|
-
const stars = useMemo(() =>
|
|
379
|
-
Array.from({length:40},(_,i) => ({id:i,x:Math.random()*100,y:Math.random()*45,s:Math.random()<.2?2:1,d:Math.random()*4}))
|
|
380
|
-
,[]);
|
|
381
|
-
|
|
382
|
-
const spawnCoins = useCallback((n) => {
|
|
383
|
-
if (!n) return;
|
|
384
|
-
const batch = Array.from({length:n},(_,i) => ({id:Date.now()+i,x:15+Math.random()*30,y:40+Math.random()*15,dx:(Math.random()-.5)*50}));
|
|
385
|
-
setFloat(p=>[...p,...batch]);
|
|
386
|
-
setCoinCount(c=>c+n);
|
|
387
|
-
setTimeout(()=>setFloat(p=>p.filter(c=>!batch.find(b=>b.id===c.id))),1400);
|
|
388
|
-
},[]);
|
|
389
|
-
|
|
390
|
-
const runScenario = useCallback((s) => {
|
|
391
|
-
if (running) return;
|
|
392
|
-
timerRefs.current.forEach(clearTimeout);
|
|
393
|
-
timerRefs.current = [];
|
|
394
|
-
const scenario = SCENARIOS.find(x=>x.key===s);
|
|
395
|
-
if (!scenario) return;
|
|
396
|
-
const sceneLines = scenario.fn();
|
|
397
|
-
const maxDelay = Math.max(...sceneLines.map(l=>l.delay));
|
|
398
|
-
setLines([]);
|
|
399
|
-
setRunning(true);
|
|
400
|
-
setStatus(scenario.status);
|
|
401
|
-
setProgress(0);
|
|
402
|
-
setActive(s);
|
|
403
|
-
|
|
404
|
-
sceneLines.forEach((line,i) => {
|
|
405
|
-
const t = setTimeout(() => {
|
|
406
|
-
setLines(p=>[...p,line]);
|
|
407
|
-
setProgress(Math.round(((i+1)/sceneLines.length)*100));
|
|
408
|
-
if (line.color==='error'||line.color==='fail') {
|
|
409
|
-
setError(true); setTimeout(()=>setError(false),600);
|
|
410
|
-
}
|
|
411
|
-
}, line.delay);
|
|
412
|
-
timerRefs.current.push(t);
|
|
413
|
-
});
|
|
414
|
-
|
|
415
|
-
const done = setTimeout(() => {
|
|
416
|
-
setRunning(false);
|
|
417
|
-
setStatus('READY');
|
|
418
|
-
setProgress(100);
|
|
419
|
-
if (scenario.pump) { setPump(true); setTimeout(()=>setPump(false),700); }
|
|
420
|
-
spawnCoins(scenario.coins);
|
|
421
|
-
}, maxDelay + 400);
|
|
422
|
-
timerRefs.current.push(done);
|
|
423
|
-
|
|
424
|
-
}, [running, spawnCoins]);
|
|
425
|
-
|
|
426
|
-
const runCommand = useCallback(async (raw) => {
|
|
427
|
-
const cmd = String(raw || '').trim();
|
|
428
|
-
if (!cmd || running) return;
|
|
429
|
-
appendLine(`gorilla@${PROJECT} ~ % ${cmd}`, 'cmd');
|
|
430
|
-
setInputLine('');
|
|
431
|
-
if (cmd === '/help') {
|
|
432
|
-
appendLine(' /health · /info · /samiam <msg> · demo: /deploy /benchmark /d1 /tail /wrangler', 'info');
|
|
433
|
-
appendLine(' Or type any goal — hits local POST /api/agentsam/message', 'muted');
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
if (cmd === '/health') {
|
|
437
|
-
try {
|
|
438
|
-
const res = await fetch('/api/health');
|
|
439
|
-
appendLine(` ${await res.text()}`, res.ok ? 'success' : 'error');
|
|
440
|
-
setApiOnline(res.ok);
|
|
441
|
-
} catch (e) {
|
|
442
|
-
appendLine(` ${e?.message || 'offline'}`, 'error');
|
|
443
|
-
setApiOnline(false);
|
|
444
|
-
}
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
if (cmd === '/info') {
|
|
448
|
-
try {
|
|
449
|
-
const res = await fetch('/api/agentsam/info');
|
|
450
|
-
appendLine(` ${await res.text()}`, res.ok ? 'info' : 'error');
|
|
451
|
-
} catch (e) {
|
|
452
|
-
appendLine(` ${e?.message || 'offline'}`, 'error');
|
|
453
|
-
}
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
if (cmd.startsWith('/samiam ')) {
|
|
457
|
-
await runLiveSam(cmd.slice(8));
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
const demoKey = cmd.startsWith('/') ? cmd.slice(1).split(/\s+/)[0] : '';
|
|
461
|
-
if (demoKey && SCENARIOS.find((s) => s.key === demoKey)) {
|
|
462
|
-
runScenario(demoKey);
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
|
-
if (cmd.startsWith('/')) {
|
|
466
|
-
appendLine(` Unknown command. Try /help`, 'warn');
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
await runLiveSam(cmd);
|
|
470
|
-
}, [appendLine, runLiveSam, running, runScenario]);
|
|
471
|
-
|
|
472
|
-
const CSS = `@keyframes idle {0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)}} @keyframes pump {0%{transform:scale(1)} 30%{transform:scale(1.12) translateY(-7px)} 70%{transform:scale(.97)} 100%{transform:scale(1)}} @keyframes shake {0%,100%{transform:translateX(0)} 20%{transform:translateX(-4px)} 40%{transform:translateX(4px)} 60%{transform:translateX(-3px)} 80%{transform:translateX(3px)}} @keyframes rise {0%{transform:translateY(0) scale(1);opacity:1} 100%{transform:translateY(-80px) scale(.3);opacity:0}} @keyframes blink {0%,100%{opacity:1} 50%{opacity:0}} @keyframes twinkle {0%,100%{opacity:.7} 50%{opacity:.1}} @keyframes flicker {0%,100%{transform:scaleY(1)} 50%{transform:scaleY(1.12) scaleX(.9)}} @keyframes scan {0%{opacity:.02} 50%{opacity:.05} 100%{opacity:.02}} @keyframes fadein {from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none}} @keyframes errflash{0%,100%{box-shadow:none} 50%{box-shadow:0 0 30px #ff444488 inset}} .scen-btn{cursor:pointer;transition:all .12s;font-family:"Courier New",monospace;} .scen-btn:hover{transform:translateY(-1px);} .scen-btn:disabled{opacity:.35;cursor:not-allowed;transform:none;}`;
|
|
473
|
-
|
|
474
|
-
if (!booted) return (
|
|
475
|
-
<div style={{width:'100%',height:'100vh',background:'#030a14',display:'flex',flexDirection:'column',alignItems:'center',justifyContent:'center',fontFamily:'"Courier New",monospace',color:'#00e5ff'}}>
|
|
476
|
-
<style>{CSS}</style>
|
|
477
|
-
<div style={{fontSize:10,letterSpacing:6,opacity:.35,marginBottom:14}}>INNERANIMAL MEDIA</div>
|
|
478
|
-
<div style={{fontSize:15,letterSpacing:2,textShadow:'0 0 10px #00e5ff'}}>
|
|
479
|
-
{bootLine}<span style={{animation:'blink .7s infinite'}}>_</span>
|
|
480
|
-
</div>
|
|
481
|
-
</div>
|
|
482
|
-
);
|
|
483
|
-
|
|
484
|
-
return (
|
|
485
|
-
<div style={{width:'100%',minHeight:'100vh',background:`linear-gradient(160deg,${T.bg} 0%,#030a14 100%)`,fontFamily:'"Courier New",monospace',position:'relative',overflow:'hidden'}}>
|
|
486
|
-
<style>{CSS}</style>
|
|
487
|
-
|
|
488
|
-
{/* Scanlines */}
|
|
489
|
-
<div style={{position:'absolute',inset:0,pointerEvents:'none',zIndex:99,
|
|
490
|
-
backgroundImage:`repeating-linear-gradient(0deg,${T.dim.replace('22','06')} 0,${T.dim.replace('22','06')} 1px,transparent 1px,transparent 3px)`,
|
|
491
|
-
animation:'scan 5s infinite'}}/>
|
|
492
|
-
|
|
493
|
-
{/* Stars */}
|
|
494
|
-
{stars.map(s=>(
|
|
495
|
-
<div key={s.id} style={{position:'absolute',left:`${s.x}%`,top:`${s.y}%`,width:s.s,height:s.s,background:'#fff',
|
|
496
|
-
animation:`twinkle ${2+s.d}s infinite`,animationDelay:`${s.d}s`,pointerEvents:'none'}}/>
|
|
497
|
-
))}
|
|
498
|
-
|
|
499
|
-
{/* Floating coins */}
|
|
500
|
-
{floatCoins.map(c=>(
|
|
501
|
-
<div key={c.id} style={{position:'absolute',left:`${c.x}%`,top:`${c.y}%`,
|
|
502
|
-
animation:'rise 1.3s ease-out forwards',transform:`translateX(${c.dx}px)`,pointerEvents:'none',zIndex:60}}>
|
|
503
|
-
<Sprite data={COIN} scale={.9}/>
|
|
504
|
-
</div>
|
|
505
|
-
))}
|
|
506
|
-
|
|
507
|
-
{/* Top bar */}
|
|
508
|
-
<div style={{display:'flex',alignItems:'center',justifyContent:'space-between',
|
|
509
|
-
padding:'10px 18px 8px',borderBottom:`1px solid ${T.border}`,background:T.panel}}>
|
|
510
|
-
<div>
|
|
511
|
-
<span style={{fontSize:9,letterSpacing:5,color:T.accent,opacity:.6}}>INNERANIMAL MEDIA // </span>
|
|
512
|
-
<span style={{fontSize:12,fontWeight:900,letterSpacing:4,color:'#fff',textShadow:T.glow}}>GORILLA MODE</span>
|
|
513
|
-
</div>
|
|
514
|
-
<div style={{display:'flex',alignItems:'center',gap:16}}>
|
|
515
|
-
<div style={{display:'flex',alignItems:'center',gap:6,background:'rgba(0,0,0,.5)',border:`1px solid ${T.accent}`,padding:'3px 10px'}}>
|
|
516
|
-
<Sprite data={COIN} scale={.45}/>
|
|
517
|
-
<span style={{color:T.accent,fontSize:11,letterSpacing:2}}>x {coinCount}</span>
|
|
518
|
-
</div>
|
|
519
|
-
<button className="scen-btn" onClick={()=>setThemeIdx(i=>(i+1)%TKEYS.length)}
|
|
520
|
-
style={{padding:'4px 10px',background:'transparent',border:`1px solid ${T.border}`,color:T.accent,fontSize:9,letterSpacing:2}}>
|
|
521
|
-
{TKEYS[themeIdx]}
|
|
522
|
-
</button>
|
|
523
|
-
</div>
|
|
524
|
-
</div>
|
|
525
|
-
|
|
526
|
-
{/* Main split */}
|
|
527
|
-
<div style={{display:'flex',height:'calc(100vh - 130px)',minHeight:400}}>
|
|
528
|
-
|
|
529
|
-
{/* LEFT: Gorilla + HUD */}
|
|
530
|
-
<div style={{width:200,minWidth:180,borderRight:`1px solid ${T.border}`,background:T.panel,
|
|
531
|
-
display:'flex',flexDirection:'column',alignItems:'center',padding:'16px 14px',gap:0,flexShrink:0}}>
|
|
532
|
-
|
|
533
|
-
{/* Gorilla */}
|
|
534
|
-
<div style={{
|
|
535
|
-
animation: errorFlash ? 'shake .5s ease' : pump ? 'pump .6s ease' : 'idle 2.8s ease-in-out infinite',
|
|
536
|
-
filter: errorFlash ? 'brightness(1.5) saturate(2) hue-rotate(-20deg)' : 'none',
|
|
537
|
-
marginBottom:8,
|
|
538
|
-
}}>
|
|
539
|
-
<Sprite data={pump ? GORILLA_PUMP : GORILLA} scale={1.05}/>
|
|
540
|
-
</div>
|
|
541
|
-
|
|
542
|
-
{/* Flames */}
|
|
543
|
-
<div style={{display:'flex',justifyContent:'center',gap:60,marginTop:-4}}>
|
|
544
|
-
{[0,1].map(i=>(
|
|
545
|
-
<div key={i} style={{animation:'flicker .45s infinite',animationDelay:`${i*.2}s`}}>
|
|
546
|
-
<Sprite data={FLAME_FRAMES[flameTick]} scale={.9}/>
|
|
547
|
-
</div>
|
|
548
|
-
))}
|
|
549
|
-
</div>
|
|
550
|
-
|
|
551
|
-
{/* Status */}
|
|
552
|
-
<div style={{width:'100%',marginTop:14,paddingTop:12,borderTop:`1px solid ${T.border}`}}>
|
|
553
|
-
<div style={{fontSize:9,letterSpacing:3,color:T.accent,marginBottom:10,textAlign:'center',textShadow:T.glow}}>
|
|
554
|
-
{status}
|
|
555
|
-
{running && <span style={{animation:'blink .7s infinite',marginLeft:4}}>_</span>}
|
|
556
|
-
</div>
|
|
557
|
-
|
|
558
|
-
<Bar pct={progress} color={T.accent} label="PROGRESS" val={`${progress}%`}/>
|
|
559
|
-
<Bar pct={Math.max(0,100-progress)} color="#ff4444" label="ERRORS" val="50"/>
|
|
560
|
-
<Bar pct={running?65:100} color="#44ff88" label="AGENT" val={running?'BUSY':'READY'}/>
|
|
561
|
-
|
|
562
|
-
<div style={{marginTop:12,paddingTop:10,borderTop:`1px solid ${T.border}`,fontSize:9,color:'rgba(255,255,255,.3)',letterSpacing:1,lineHeight:1.8}}>
|
|
563
|
-
<div>{PROJECT}</div>
|
|
564
|
-
<div>lane: {LANE} · {AGENT}</div>
|
|
565
|
-
<div>api: {apiOnline ? 'local :8787' : 'offline'}</div>
|
|
566
|
-
<div style={{color:activeScenario?T.accent:'inherit'}}>
|
|
567
|
-
{activeScenario ? `> ${activeScenario}` : '> idle'}
|
|
568
|
-
</div>
|
|
569
|
-
</div>
|
|
570
|
-
</div>
|
|
571
|
-
</div>
|
|
572
|
-
|
|
573
|
-
{/* RIGHT: Terminal */}
|
|
574
|
-
<div style={{flex:1,display:'flex',flexDirection:'column',overflow:'hidden'}}>
|
|
575
|
-
|
|
576
|
-
{/* Terminal header */}
|
|
577
|
-
<div style={{padding:'7px 16px',borderBottom:`1px solid ${T.border}`,background:'rgba(0,0,0,.4)',
|
|
578
|
-
display:'flex',alignItems:'center',gap:8}}>
|
|
579
|
-
<div style={{width:8,height:8,borderRadius:'50%',background:running?T.accent:'#ffffff22',boxShadow:running?T.glow:'none',transition:'all .3s'}}/>
|
|
580
|
-
<span style={{fontSize:9,letterSpacing:2,color:'rgba(255,255,255,.3)'}}>TERMINAL OUTPUT</span>
|
|
581
|
-
<span style={{marginLeft:'auto',fontSize:9,color:'rgba(255,255,255,.2)',letterSpacing:1}}>{lines.length} lines</span>
|
|
582
|
-
</div>
|
|
583
|
-
|
|
584
|
-
{/* Output */}
|
|
585
|
-
<div ref={termRef} style={{flex:1,overflowY:'auto',padding:'14px 18px',
|
|
586
|
-
animation: errorFlash ? 'errflash .5s ease' : 'none',
|
|
587
|
-
scrollbarWidth:'thin',scrollbarColor:`${T.accent}33 transparent`}}>
|
|
588
|
-
{lines.map((line, i) => (
|
|
589
|
-
<div key={i} style={{
|
|
590
|
-
fontFamily:'"Courier New",monospace',fontSize:12,lineHeight:1.65,
|
|
591
|
-
whiteSpace:'pre',color: LC[line.color] || LC.white,
|
|
592
|
-
animation: i===lines.length-1 ? 'fadein .15s ease' : 'none',
|
|
593
|
-
}}>
|
|
594
|
-
{line.text || '\u00A0'}
|
|
595
|
-
</div>
|
|
596
|
-
))}
|
|
597
|
-
{running && (
|
|
598
|
-
<div style={{color:T.accent,fontSize:12,animation:'blink .7s infinite',marginTop:2}}>_</div>
|
|
599
|
-
)}
|
|
600
|
-
</div>
|
|
601
|
-
|
|
602
|
-
{/* Input line */}
|
|
603
|
-
<div style={{padding:'8px 16px',borderTop:`1px solid ${T.border}`,background:'rgba(0,0,0,.5)',
|
|
604
|
-
display:'flex',alignItems:'center',gap:8}}>
|
|
605
|
-
<span style={{color:T.accent,fontSize:12,whiteSpace:'nowrap'}}>gorilla@{PROJECT} ~ %</span>
|
|
606
|
-
<input
|
|
607
|
-
ref={inputRef}
|
|
608
|
-
value={inputLine}
|
|
609
|
-
disabled={running}
|
|
610
|
-
onChange={(e) => setInputLine(e.target.value)}
|
|
611
|
-
onKeyDown={(e) => { if (e.key === 'Enter') void runCommand(inputLine); }}
|
|
612
|
-
placeholder={running ? 'running…' : '/help · /health · /samiam …'}
|
|
613
|
-
style={{
|
|
614
|
-
flex:1, fontSize:12, letterSpacing:.5, color:'rgba(255,255,255,.85)',
|
|
615
|
-
background:'transparent', border:'none', outline:'none', fontFamily:'"Courier New",monospace',
|
|
616
|
-
}}
|
|
617
|
-
/>
|
|
618
|
-
</div>
|
|
619
|
-
</div>
|
|
620
|
-
</div>
|
|
621
|
-
|
|
622
|
-
{/* Scenario buttons */}
|
|
623
|
-
<div style={{borderTop:`1px solid ${T.border}`,background:T.panel,
|
|
624
|
-
display:'flex',flexWrap:'wrap',gap:0}}>
|
|
625
|
-
{SCENARIOS.map(s=>(
|
|
626
|
-
<button key={s.key} className="scen-btn" disabled={running}
|
|
627
|
-
onClick={()=>runScenario(s.key)}
|
|
628
|
-
style={{flex:'1 1 0',padding:'10px 8px',minWidth:100,
|
|
629
|
-
background: activeScenario===s.key ? T.dim : 'transparent',
|
|
630
|
-
border:'none',borderRight:`1px solid ${T.border}`,
|
|
631
|
-
color: activeScenario===s.key ? T.accent : 'rgba(255,255,255,.5)',
|
|
632
|
-
fontSize:11,letterSpacing:1.5,textShadow: activeScenario===s.key ? T.glow : 'none'}}>
|
|
633
|
-
{s.label}
|
|
634
|
-
</button>
|
|
635
|
-
))}
|
|
636
|
-
</div>
|
|
637
|
-
</div>
|
|
638
|
-
);
|
|
639
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Gorilla Shell (Phase 0)
|
|
2
|
-
|
|
3
|
-
Game-feel terminal UI prototype — consolidated from [InnerAnimal/gorilla-mode](https://github.com/InnerAnimal/gorilla-mode) into **Agent Sam SDK**.
|
|
4
|
-
|
|
5
|
-
This is the **canonical** install-experience scaffold (pixel HUD, themed moods,
|
|
6
|
-
slash-command demos). Phase 1 connects real PTY via ExecOS.
|
|
7
|
-
|
|
8
|
-
`examples/gorilla-shell/` is a pointer only — use this `templates/` tree.
|
|
9
|
-
|
|
10
|
-
## Run locally
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
cd templates/gorilla-shell
|
|
14
|
-
npm install
|
|
15
|
-
npm run dev
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Placeholders
|
|
19
|
-
|
|
20
|
-
Demo scenario strings use template tokens (not live IAM infra):
|
|
21
|
-
|
|
22
|
-
- `{{PROJECT_NAME}}`, `{{LANE_KEY}}`, `{{AGENT}}` (also via `VITE_*` env)
|
|
23
|
-
- `{{WORKER_NAME}}`, `{{DASHBOARD_HOST}}`, `{{ZONE_HOST}}`
|
|
24
|
-
- `{{D1_DATABASE_NAME}}`, `{{D1_DATABASE_ID}}`
|
|
25
|
-
- `{{WORKSPACE_ID}}`, `{{CF_ACCOUNT_NAME}}`
|
|
26
|
-
|
|
27
|
-
## What you see
|
|
28
|
-
|
|
29
|
-
- Gorilla launch screen + sprite reactions
|
|
30
|
-
- Themes: NIGHT, DAY, LAVA, VOID
|
|
31
|
-
- Six demo scenarios (deploy, benchmark, D1, tail, samiam, wrangler)
|
|
32
|
-
- Live `/samiam` against local Worker API when `npm run dev` is up
|
|
33
|
-
|
|
34
|
-
Full architecture: [docs/CLI_SHELL.md](../../docs/CLI_SHELL.md)
|