mindforge-cc 11.3.0 → 11.3.1
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/.agent/forge/help.md +11 -0
- package/.agent/forge/init-project.md +36 -0
- package/.agent/forge/plan-phase.md +34 -0
- package/.agent/mindforge/add-backlog.md +32 -0
- package/.agent/mindforge/agent-deploy.md +34 -0
- package/.agent/mindforge/agent-design.md +31 -0
- package/.agent/mindforge/agent-eval.md +27 -0
- package/.agent/mindforge/agent-memory.md +27 -0
- package/.agent/mindforge/agent.md +31 -0
- package/.agent/mindforge/ai-cost.md +31 -0
- package/.agent/mindforge/ai-safety.md +37 -0
- package/.agent/mindforge/analytics.md +28 -0
- package/.agent/mindforge/approve.md +22 -0
- package/.agent/mindforge/audit.md +34 -0
- package/.agent/mindforge/auth-flow.md +76 -0
- package/.agent/mindforge/auto.md +26 -0
- package/.agent/mindforge/benchmark.md +37 -0
- package/.agent/mindforge/brd.md +90 -0
- package/.agent/mindforge/browse.md +30 -0
- package/.agent/mindforge/build-opt.md +31 -0
- package/.agent/mindforge/build-vs-buy.md +29 -0
- package/.agent/mindforge/cache.md +30 -0
- package/.agent/mindforge/causal.md +31 -0
- package/.agent/mindforge/cdn.md +34 -0
- package/.agent/mindforge/change.md +37 -0
- package/.agent/mindforge/cli.md +30 -0
- package/.agent/mindforge/cluster-instincts.md +35 -0
- package/.agent/mindforge/code-tour.md +85 -0
- package/.agent/mindforge/communicate.md +37 -0
- package/.agent/mindforge/complete-milestone.md +22 -0
- package/.agent/mindforge/compliance.md +31 -0
- package/.agent/mindforge/consult.md +37 -0
- package/.agent/mindforge/context-budget.md +70 -0
- package/.agent/mindforge/contract-test.md +30 -0
- package/.agent/mindforge/cost-report.md +44 -0
- package/.agent/mindforge/costs.md +15 -0
- package/.agent/mindforge/council.md +35 -0
- package/.agent/mindforge/create-skill.md +34 -0
- package/.agent/mindforge/cross-review.md +21 -0
- package/.agent/mindforge/dashboard.md +102 -0
- package/.agent/mindforge/data-mesh.md +31 -0
- package/.agent/mindforge/data-model.md +75 -0
- package/.agent/mindforge/data-pipeline.md +34 -0
- package/.agent/mindforge/de-slop.md +33 -0
- package/.agent/mindforge/debug.md +133 -0
- package/.agent/mindforge/degrade.md +31 -0
- package/.agent/mindforge/delegate.md +37 -0
- package/.agent/mindforge/deploy.md +32 -0
- package/.agent/mindforge/design-tokens.md +80 -0
- package/.agent/mindforge/discuss-phase.md +142 -0
- package/.agent/mindforge/dmux.md +32 -0
- package/.agent/mindforge/do.md +31 -0
- package/.agent/mindforge/ecommerce.md +31 -0
- package/.agent/mindforge/edge.md +34 -0
- package/.agent/mindforge/edtech.md +31 -0
- package/.agent/mindforge/embeddings.md +37 -0
- package/.agent/mindforge/environments.md +31 -0
- package/.agent/mindforge/eval.md +33 -0
- package/.agent/mindforge/events.md +30 -0
- package/.agent/mindforge/evolve-skills.md +49 -0
- package/.agent/mindforge/execute-phase.md +200 -0
- package/.agent/mindforge/experiment.md +28 -0
- package/.agent/mindforge/feature-flags.md +30 -0
- package/.agent/mindforge/feature-store.md +31 -0
- package/.agent/mindforge/finops.md +31 -0
- package/.agent/mindforge/fintech.md +31 -0
- package/.agent/mindforge/flutter.md +37 -0
- package/.agent/mindforge/gaming.md +31 -0
- package/.agent/mindforge/graphql.md +31 -0
- package/.agent/mindforge/health.md +31 -0
- package/.agent/mindforge/healthcare.md +31 -0
- package/.agent/mindforge/help.md +33 -0
- package/.agent/mindforge/hire.md +37 -0
- package/.agent/mindforge/hitl.md +27 -0
- package/.agent/mindforge/i18n.md +31 -0
- package/.agent/mindforge/idempotent.md +31 -0
- package/.agent/mindforge/init-org.md +135 -0
- package/.agent/mindforge/init-project.md +170 -0
- package/.agent/mindforge/install-skill.md +28 -0
- package/.agent/mindforge/introspect.md +46 -0
- package/.agent/mindforge/iot.md +31 -0
- package/.agent/mindforge/knowledge-graph.md +37 -0
- package/.agent/mindforge/lakehouse.md +31 -0
- package/.agent/mindforge/lead.md +31 -0
- package/.agent/mindforge/learn-instinct.md +58 -0
- package/.agent/mindforge/learn.md +147 -0
- package/.agent/mindforge/learning.md +20 -0
- package/.agent/mindforge/llm-route.md +37 -0
- package/.agent/mindforge/load-test.md +30 -0
- package/.agent/mindforge/logistics.md +31 -0
- package/.agent/mindforge/map-codebase.md +302 -0
- package/.agent/mindforge/market-research.md +94 -0
- package/.agent/mindforge/marketplace.md +124 -0
- package/.agent/mindforge/mcp-server.md +88 -0
- package/.agent/mindforge/meeting-design.md +37 -0
- package/.agent/mindforge/metrics.md +26 -0
- package/.agent/mindforge/microservices.md +64 -0
- package/.agent/mindforge/migrate.md +44 -0
- package/.agent/mindforge/migration-mgmt.md +31 -0
- package/.agent/mindforge/milestone.md +16 -0
- package/.agent/mindforge/mobile.md +37 -0
- package/.agent/mindforge/monorepo.md +30 -0
- package/.agent/mindforge/multi-tenant.md +31 -0
- package/.agent/mindforge/multimodal.md +37 -0
- package/.agent/mindforge/new-runtime.md +23 -0
- package/.agent/mindforge/next.md +109 -0
- package/.agent/mindforge/note.md +35 -0
- package/.agent/mindforge/observability-platform.md +31 -0
- package/.agent/mindforge/observability.md +75 -0
- package/.agent/mindforge/offline.md +37 -0
- package/.agent/mindforge/onboard.md +37 -0
- package/.agent/mindforge/orchestrate.md +74 -0
- package/.agent/mindforge/payments.md +28 -0
- package/.agent/mindforge/pipeline.md +84 -0
- package/.agent/mindforge/plan-phase.md +131 -0
- package/.agent/mindforge/plan-write.md +95 -0
- package/.agent/mindforge/plant-seed.md +31 -0
- package/.agent/mindforge/platform.md +31 -0
- package/.agent/mindforge/plugins.md +44 -0
- package/.agent/mindforge/pr-review.md +45 -0
- package/.agent/mindforge/privacy-eng.md +31 -0
- package/.agent/mindforge/product-spec.md +90 -0
- package/.agent/mindforge/profile-team.md +27 -0
- package/.agent/mindforge/prompt.md +78 -0
- package/.agent/mindforge/proofread.md +87 -0
- package/.agent/mindforge/publish-skill.md +23 -0
- package/.agent/mindforge/push-notify.md +37 -0
- package/.agent/mindforge/pwa.md +37 -0
- package/.agent/mindforge/qa.md +20 -0
- package/.agent/mindforge/quality-audit.md +34 -0
- package/.agent/mindforge/queue.md +31 -0
- package/.agent/mindforge/quick.md +139 -0
- package/.agent/mindforge/rag.md +30 -0
- package/.agent/mindforge/rate-limit.md +31 -0
- package/.agent/mindforge/react-native.md +37 -0
- package/.agent/mindforge/realtime-analytics.md +31 -0
- package/.agent/mindforge/record-learning.md +22 -0
- package/.agent/mindforge/release.md +14 -0
- package/.agent/mindforge/remember.md +30 -0
- package/.agent/mindforge/research.md +16 -0
- package/.agent/mindforge/retro.md +28 -0
- package/.agent/mindforge/retrospective.md +31 -0
- package/.agent/mindforge/review-backlog.md +34 -0
- package/.agent/mindforge/review-guide.md +63 -0
- package/.agent/mindforge/review.md +161 -0
- package/.agent/mindforge/rfc.md +34 -0
- package/.agent/mindforge/santa.md +33 -0
- package/.agent/mindforge/secrets-mgmt.md +31 -0
- package/.agent/mindforge/secrets.md +31 -0
- package/.agent/mindforge/security-scan.md +242 -0
- package/.agent/mindforge/serverless.md +34 -0
- package/.agent/mindforge/session-report.md +39 -0
- package/.agent/mindforge/ship.md +111 -0
- package/.agent/mindforge/skills.md +145 -0
- package/.agent/mindforge/status.md +113 -0
- package/.agent/mindforge/steer.md +17 -0
- package/.agent/mindforge/stream.md +31 -0
- package/.agent/mindforge/sync-confluence.md +15 -0
- package/.agent/mindforge/sync-jira.md +16 -0
- package/.agent/mindforge/system-design.md +87 -0
- package/.agent/mindforge/team-topology.md +27 -0
- package/.agent/mindforge/tech-debt.md +31 -0
- package/.agent/mindforge/tech-radar.md +28 -0
- package/.agent/mindforge/threat-model.md +48 -0
- package/.agent/mindforge/tokens.md +12 -0
- package/.agent/mindforge/ui-phase.md +34 -0
- package/.agent/mindforge/ui-review.md +36 -0
- package/.agent/mindforge/update.md +46 -0
- package/.agent/mindforge/validate-phase.md +31 -0
- package/.agent/mindforge/verify-loop.md +45 -0
- package/.agent/mindforge/verify-phase.md +66 -0
- package/.agent/mindforge/vibe-check.md +37 -0
- package/.agent/mindforge/workspace.md +33 -0
- package/.agent/mindforge/workstreams.md +35 -0
- package/.agent/mindforge/worktrees.md +86 -0
- package/.agent/mindforge/write-rfc.md +64 -0
- package/.agent/mindforge/zero-trust.md +34 -0
- package/.agent/skills/mindforge-add-backlog/SKILL.md +72 -0
- package/.agent/skills/mindforge-add-phase/SKILL.md +39 -0
- package/.agent/skills/mindforge-add-tests/SKILL.md +28 -0
- package/.agent/skills/mindforge-add-todo/SKILL.md +42 -0
- package/.agent/skills/mindforge-audit-milestone/SKILL.md +29 -0
- package/.agent/skills/mindforge-audit-uat/SKILL.md +20 -0
- package/.agent/skills/mindforge-autonomous/SKILL.md +33 -0
- package/.agent/skills/mindforge-brainstorming/SKILL.md +164 -0
- package/.agent/skills/mindforge-brainstorming/scripts/frame-template.html +214 -0
- package/.agent/skills/mindforge-brainstorming/scripts/helper.js +90 -0
- package/.agent/skills/mindforge-brainstorming/scripts/server.cjs +354 -0
- package/.agent/skills/mindforge-brainstorming/scripts/start-server.sh +148 -0
- package/.agent/skills/mindforge-brainstorming/scripts/stop-server.sh +56 -0
- package/.agent/skills/mindforge-brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/.agent/skills/mindforge-brainstorming/visual-companion.md +287 -0
- package/.agent/skills/mindforge-check-todos/SKILL.md +40 -0
- package/.agent/skills/mindforge-cleanup/SKILL.md +19 -0
- package/.agent/skills/mindforge-complete-milestone/SKILL.md +131 -0
- package/.agent/skills/mindforge-debug/SKILL.md +163 -0
- package/.agent/skills/mindforge-debug_extended/CREATION-LOG.md +119 -0
- package/.agent/skills/mindforge-debug_extended/SKILL.md +296 -0
- package/.agent/skills/mindforge-debug_extended/condition-based-waiting-example.ts +158 -0
- package/.agent/skills/mindforge-debug_extended/condition-based-waiting.md +115 -0
- package/.agent/skills/mindforge-debug_extended/defense-in-depth.md +122 -0
- package/.agent/skills/mindforge-debug_extended/find-polluter.sh +63 -0
- package/.agent/skills/mindforge-debug_extended/root-cause-tracing.md +169 -0
- package/.agent/skills/mindforge-debug_extended/test-academic.md +14 -0
- package/.agent/skills/mindforge-debug_extended/test-pressure-1.md +58 -0
- package/.agent/skills/mindforge-debug_extended/test-pressure-2.md +68 -0
- package/.agent/skills/mindforge-debug_extended/test-pressure-3.md +69 -0
- package/.agent/skills/mindforge-discuss-phase/SKILL.md +54 -0
- package/.agent/skills/mindforge-do/SKILL.md +26 -0
- package/.agent/skills/mindforge-execute-phase/SKILL.md +49 -0
- package/.agent/skills/mindforge-execute-phase_extended/SKILL.md +70 -0
- package/.agent/skills/mindforge-fast/SKILL.md +23 -0
- package/.agent/skills/mindforge-forensics/SKILL.md +49 -0
- package/.agent/skills/mindforge-health/SKILL.md +17 -0
- package/.agent/skills/mindforge-help/SKILL.md +23 -0
- package/.agent/skills/mindforge-insert-phase/SKILL.md +28 -0
- package/.agent/skills/mindforge-join-discord/SKILL.md +19 -0
- package/.agent/skills/mindforge-list-phase-assumptions/SKILL.md +41 -0
- package/.agent/skills/mindforge-list-workspaces/SKILL.md +17 -0
- package/.agent/skills/mindforge-manager/SKILL.md +32 -0
- package/.agent/skills/mindforge-map-codebase/SKILL.md +64 -0
- package/.agent/skills/mindforge-milestone-summary/SKILL.md +44 -0
- package/.agent/skills/mindforge-neural-orchestrator/SKILL.md +115 -0
- package/.agent/skills/mindforge-neural-orchestrator/references/codex-tools.md +100 -0
- package/.agent/skills/mindforge-neural-orchestrator/references/gemini-tools.md +33 -0
- package/.agent/skills/mindforge-new-milestone/SKILL.md +38 -0
- package/.agent/skills/mindforge-new-project/SKILL.md +36 -0
- package/.agent/skills/mindforge-new-workspace/SKILL.md +39 -0
- package/.agent/skills/mindforge-next/SKILL.md +19 -0
- package/.agent/skills/mindforge-note/SKILL.md +29 -0
- package/.agent/skills/mindforge-parallel-mesh_extended/SKILL.md +182 -0
- package/.agent/skills/mindforge-pause-work/SKILL.md +35 -0
- package/.agent/skills/mindforge-plan-milestone-gaps/SKILL.md +28 -0
- package/.agent/skills/mindforge-plan-phase/SKILL.md +38 -0
- package/.agent/skills/mindforge-plan-phase_extended/SKILL.md +152 -0
- package/.agent/skills/mindforge-plan-phase_extended/plan-document-reviewer-prompt.md +49 -0
- package/.agent/skills/mindforge-plant-seed/SKILL.md +22 -0
- package/.agent/skills/mindforge-pr-branch/SKILL.md +21 -0
- package/.agent/skills/mindforge-profile-user/SKILL.md +38 -0
- package/.agent/skills/mindforge-progress/SKILL.md +19 -0
- package/.agent/skills/mindforge-quick/SKILL.md +38 -0
- package/.agent/skills/mindforge-reapply-patches/SKILL.md +124 -0
- package/.agent/skills/mindforge-remove-phase/SKILL.md +26 -0
- package/.agent/skills/mindforge-remove-workspace/SKILL.md +22 -0
- package/.agent/skills/mindforge-research-phase/SKILL.md +186 -0
- package/.agent/skills/mindforge-resume-work/SKILL.md +35 -0
- package/.agent/skills/mindforge-review/SKILL.md +31 -0
- package/.agent/skills/mindforge-review-backlog/SKILL.md +58 -0
- package/.agent/skills/mindforge-review-inbound/SKILL.md +213 -0
- package/.agent/skills/mindforge-review-request/SKILL.md +105 -0
- package/.agent/skills/mindforge-review-request/code-reviewer.md +146 -0
- package/.agent/skills/mindforge-session-report/SKILL.md +16 -0
- package/.agent/skills/mindforge-set-profile/SKILL.md +9 -0
- package/.agent/skills/mindforge-settings/SKILL.md +32 -0
- package/.agent/skills/mindforge-ship/SKILL.md +16 -0
- package/.agent/skills/mindforge-ship_extended/SKILL.md +200 -0
- package/.agent/skills/mindforge-skill-creation/SKILL.md +655 -0
- package/.agent/skills/mindforge-skill-creation/anthropic-best-practices.md +1150 -0
- package/.agent/skills/mindforge-skill-creation/examples/CLAUDE_MD_TESTING.md +189 -0
- package/.agent/skills/mindforge-skill-creation/graphviz-conventions.dot +172 -0
- package/.agent/skills/mindforge-skill-creation/persuasion-principles.md +187 -0
- package/.agent/skills/mindforge-skill-creation/render-graphs.js +168 -0
- package/.agent/skills/mindforge-skill-creation/testing-skills-with-subagents.md +384 -0
- package/.agent/skills/mindforge-stats/SKILL.md +16 -0
- package/.agent/skills/mindforge-swarm-execution/SKILL.md +277 -0
- package/.agent/skills/mindforge-swarm-execution/code-quality-reviewer-prompt.md +26 -0
- package/.agent/skills/mindforge-swarm-execution/implementer-prompt.md +113 -0
- package/.agent/skills/mindforge-swarm-execution/spec-reviewer-prompt.md +61 -0
- package/.agent/skills/mindforge-system-architecture/SKILL.md +136 -0
- package/.agent/skills/mindforge-system-architecture/examples.md +120 -0
- package/.agent/skills/mindforge-system-architecture/scaling-checklist.md +76 -0
- package/.agent/skills/mindforge-tdd/SKILL.md +112 -0
- package/.agent/skills/mindforge-tdd/deep-modules.md +21 -0
- package/.agent/skills/mindforge-tdd/interface-design.md +22 -0
- package/.agent/skills/mindforge-tdd/mocking.md +24 -0
- package/.agent/skills/mindforge-tdd/refactoring.md +21 -0
- package/.agent/skills/mindforge-tdd/tests.md +28 -0
- package/.agent/skills/mindforge-tdd_extended/SKILL.md +371 -0
- package/.agent/skills/mindforge-tdd_extended/testing-anti-patterns.md +299 -0
- package/.agent/skills/mindforge-thread/SKILL.md +123 -0
- package/.agent/skills/mindforge-ui-phase/SKILL.md +24 -0
- package/.agent/skills/mindforge-ui-review/SKILL.md +24 -0
- package/.agent/skills/mindforge-update/SKILL.md +35 -0
- package/.agent/skills/mindforge-validate-phase/SKILL.md +26 -0
- package/.agent/skills/mindforge-verify-work/SKILL.md +30 -0
- package/.agent/skills/mindforge-verify-work_extended/SKILL.md +139 -0
- package/.agent/skills/mindforge-workspace-isolated/SKILL.md +218 -0
- package/.agent/skills/mindforge-workstreams/SKILL.md +65 -0
- package/.claude/CLAUDE.md +102 -0
- package/.claude/commands/forge/help.md +7 -0
- package/.claude/commands/forge/init-project.md +32 -0
- package/.claude/commands/forge/plan-phase.md +30 -0
- package/.claude/commands/mindforge/add-backlog.md +32 -0
- package/.claude/commands/mindforge/agent-deploy.md +34 -0
- package/.claude/commands/mindforge/agent-design.md +31 -0
- package/.claude/commands/mindforge/agent-eval.md +27 -0
- package/.claude/commands/mindforge/agent-memory.md +27 -0
- package/.claude/commands/mindforge/agent.md +31 -0
- package/.claude/commands/mindforge/ai-cost.md +31 -0
- package/.claude/commands/mindforge/ai-safety.md +37 -0
- package/.claude/commands/mindforge/analytics.md +28 -0
- package/.claude/commands/mindforge/approve.md +22 -0
- package/.claude/commands/mindforge/audit.md +34 -0
- package/.claude/commands/mindforge/auth-flow.md +76 -0
- package/.claude/commands/mindforge/auto.md +26 -0
- package/.claude/commands/mindforge/benchmark.md +37 -0
- package/.claude/commands/mindforge/brd.md +90 -0
- package/.claude/commands/mindforge/browse.md +30 -0
- package/.claude/commands/mindforge/build-opt.md +31 -0
- package/.claude/commands/mindforge/build-vs-buy.md +29 -0
- package/.claude/commands/mindforge/cache.md +30 -0
- package/.claude/commands/mindforge/causal.md +31 -0
- package/.claude/commands/mindforge/cdn.md +34 -0
- package/.claude/commands/mindforge/change.md +37 -0
- package/.claude/commands/mindforge/cli.md +30 -0
- package/.claude/commands/mindforge/cluster-instincts.md +35 -0
- package/.claude/commands/mindforge/code-tour.md +85 -0
- package/.claude/commands/mindforge/communicate.md +37 -0
- package/.claude/commands/mindforge/complete-milestone.md +22 -0
- package/.claude/commands/mindforge/compliance.md +31 -0
- package/.claude/commands/mindforge/consult.md +37 -0
- package/.claude/commands/mindforge/context-budget.md +70 -0
- package/.claude/commands/mindforge/contract-test.md +30 -0
- package/.claude/commands/mindforge/cost-report.md +44 -0
- package/.claude/commands/mindforge/costs.md +15 -0
- package/.claude/commands/mindforge/council.md +83 -0
- package/.claude/commands/mindforge/create-skill.md +34 -0
- package/.claude/commands/mindforge/cross-review.md +21 -0
- package/.claude/commands/mindforge/dashboard.md +102 -0
- package/.claude/commands/mindforge/data-mesh.md +31 -0
- package/.claude/commands/mindforge/data-model.md +75 -0
- package/.claude/commands/mindforge/data-pipeline.md +34 -0
- package/.claude/commands/mindforge/de-slop.md +33 -0
- package/.claude/commands/mindforge/debug.md +133 -0
- package/.claude/commands/mindforge/degrade.md +31 -0
- package/.claude/commands/mindforge/delegate.md +37 -0
- package/.claude/commands/mindforge/deploy.md +32 -0
- package/.claude/commands/mindforge/design-tokens.md +80 -0
- package/.claude/commands/mindforge/discuss-phase.md +142 -0
- package/.claude/commands/mindforge/dmux.md +32 -0
- package/.claude/commands/mindforge/do.md +31 -0
- package/.claude/commands/mindforge/ecommerce.md +31 -0
- package/.claude/commands/mindforge/edge.md +34 -0
- package/.claude/commands/mindforge/edtech.md +31 -0
- package/.claude/commands/mindforge/embeddings.md +37 -0
- package/.claude/commands/mindforge/environments.md +31 -0
- package/.claude/commands/mindforge/eval.md +33 -0
- package/.claude/commands/mindforge/events.md +30 -0
- package/.claude/commands/mindforge/evolve-skills.md +49 -0
- package/.claude/commands/mindforge/execute-phase.md +200 -0
- package/.claude/commands/mindforge/experiment.md +28 -0
- package/.claude/commands/mindforge/feature-flags.md +30 -0
- package/.claude/commands/mindforge/feature-store.md +31 -0
- package/.claude/commands/mindforge/finops.md +31 -0
- package/.claude/commands/mindforge/fintech.md +31 -0
- package/.claude/commands/mindforge/flutter.md +37 -0
- package/.claude/commands/mindforge/gaming.md +31 -0
- package/.claude/commands/mindforge/graphql.md +31 -0
- package/.claude/commands/mindforge/health.md +31 -0
- package/.claude/commands/mindforge/healthcare.md +31 -0
- package/.claude/commands/mindforge/help.md +33 -0
- package/.claude/commands/mindforge/hire.md +37 -0
- package/.claude/commands/mindforge/hitl.md +27 -0
- package/.claude/commands/mindforge/i18n.md +31 -0
- package/.claude/commands/mindforge/idempotent.md +31 -0
- package/.claude/commands/mindforge/init-org.md +135 -0
- package/.claude/commands/mindforge/init-project.md +170 -0
- package/.claude/commands/mindforge/install-skill.md +28 -0
- package/.claude/commands/mindforge/introspect.md +46 -0
- package/.claude/commands/mindforge/iot.md +31 -0
- package/.claude/commands/mindforge/knowledge-graph.md +37 -0
- package/.claude/commands/mindforge/lakehouse.md +31 -0
- package/.claude/commands/mindforge/lead.md +31 -0
- package/.claude/commands/mindforge/learn-instinct.md +58 -0
- package/.claude/commands/mindforge/learn.md +147 -0
- package/.claude/commands/mindforge/learning.md +20 -0
- package/.claude/commands/mindforge/llm-route.md +37 -0
- package/.claude/commands/mindforge/load-test.md +30 -0
- package/.claude/commands/mindforge/logistics.md +31 -0
- package/.claude/commands/mindforge/map-codebase.md +302 -0
- package/.claude/commands/mindforge/market-research.md +94 -0
- package/.claude/commands/mindforge/marketplace.md +124 -0
- package/.claude/commands/mindforge/mcp-server.md +88 -0
- package/.claude/commands/mindforge/meeting-design.md +37 -0
- package/.claude/commands/mindforge/metrics.md +26 -0
- package/.claude/commands/mindforge/microservices.md +64 -0
- package/.claude/commands/mindforge/migrate.md +44 -0
- package/.claude/commands/mindforge/migration-mgmt.md +31 -0
- package/.claude/commands/mindforge/milestone.md +16 -0
- package/.claude/commands/mindforge/mobile.md +37 -0
- package/.claude/commands/mindforge/monorepo.md +30 -0
- package/.claude/commands/mindforge/multi-tenant.md +31 -0
- package/.claude/commands/mindforge/multimodal.md +37 -0
- package/.claude/commands/mindforge/new-runtime.md +23 -0
- package/.claude/commands/mindforge/next.md +109 -0
- package/.claude/commands/mindforge/note.md +35 -0
- package/.claude/commands/mindforge/observability-platform.md +31 -0
- package/.claude/commands/mindforge/observability.md +75 -0
- package/.claude/commands/mindforge/offline.md +37 -0
- package/.claude/commands/mindforge/onboard.md +37 -0
- package/.claude/commands/mindforge/orchestrate.md +74 -0
- package/.claude/commands/mindforge/payments.md +28 -0
- package/.claude/commands/mindforge/pipeline.md +84 -0
- package/.claude/commands/mindforge/plan-phase.md +131 -0
- package/.claude/commands/mindforge/plan-write.md +95 -0
- package/.claude/commands/mindforge/plant-seed.md +31 -0
- package/.claude/commands/mindforge/platform.md +31 -0
- package/.claude/commands/mindforge/plugins.md +44 -0
- package/.claude/commands/mindforge/pr-review.md +45 -0
- package/.claude/commands/mindforge/privacy-eng.md +31 -0
- package/.claude/commands/mindforge/product-spec.md +90 -0
- package/.claude/commands/mindforge/profile-team.md +27 -0
- package/.claude/commands/mindforge/prompt.md +78 -0
- package/.claude/commands/mindforge/proofread.md +87 -0
- package/.claude/commands/mindforge/publish-skill.md +23 -0
- package/.claude/commands/mindforge/push-notify.md +37 -0
- package/.claude/commands/mindforge/pwa.md +37 -0
- package/.claude/commands/mindforge/qa.md +20 -0
- package/.claude/commands/mindforge/quality-audit.md +34 -0
- package/.claude/commands/mindforge/queue.md +31 -0
- package/.claude/commands/mindforge/quick.md +139 -0
- package/.claude/commands/mindforge/rag.md +30 -0
- package/.claude/commands/mindforge/rate-limit.md +31 -0
- package/.claude/commands/mindforge/react-native.md +37 -0
- package/.claude/commands/mindforge/realtime-analytics.md +31 -0
- package/.claude/commands/mindforge/record-learning.md +22 -0
- package/.claude/commands/mindforge/release.md +14 -0
- package/.claude/commands/mindforge/remember.md +30 -0
- package/.claude/commands/mindforge/research.md +16 -0
- package/.claude/commands/mindforge/retro.md +28 -0
- package/.claude/commands/mindforge/retrospective.md +31 -0
- package/.claude/commands/mindforge/review-backlog.md +34 -0
- package/.claude/commands/mindforge/review-guide.md +63 -0
- package/.claude/commands/mindforge/review.md +161 -0
- package/.claude/commands/mindforge/rfc.md +34 -0
- package/.claude/commands/mindforge/santa.md +33 -0
- package/.claude/commands/mindforge/secrets-mgmt.md +31 -0
- package/.claude/commands/mindforge/secrets.md +31 -0
- package/.claude/commands/mindforge/security-scan.md +242 -0
- package/.claude/commands/mindforge/serverless.md +34 -0
- package/.claude/commands/mindforge/session-report.md +39 -0
- package/.claude/commands/mindforge/ship.md +111 -0
- package/.claude/commands/mindforge/skills.md +145 -0
- package/.claude/commands/mindforge/status.md +113 -0
- package/.claude/commands/mindforge/steer.md +17 -0
- package/.claude/commands/mindforge/stream.md +31 -0
- package/.claude/commands/mindforge/sync-confluence.md +15 -0
- package/.claude/commands/mindforge/sync-jira.md +16 -0
- package/.claude/commands/mindforge/system-design.md +87 -0
- package/.claude/commands/mindforge/team-topology.md +27 -0
- package/.claude/commands/mindforge/tech-debt.md +31 -0
- package/.claude/commands/mindforge/tech-radar.md +28 -0
- package/.claude/commands/mindforge/threat-model.md +48 -0
- package/.claude/commands/mindforge/tokens.md +12 -0
- package/.claude/commands/mindforge/ui-phase.md +34 -0
- package/.claude/commands/mindforge/ui-review.md +36 -0
- package/.claude/commands/mindforge/update.md +46 -0
- package/.claude/commands/mindforge/validate-phase.md +31 -0
- package/.claude/commands/mindforge/verify-loop.md +45 -0
- package/.claude/commands/mindforge/verify-phase.md +66 -0
- package/.claude/commands/mindforge/vibe-check.md +37 -0
- package/.claude/commands/mindforge/workspace.md +33 -0
- package/.claude/commands/mindforge/workstreams.md +35 -0
- package/.claude/commands/mindforge/worktrees.md +86 -0
- package/.claude/commands/mindforge/write-rfc.md +64 -0
- package/.claude/commands/mindforge/zero-trust.md +34 -0
- package/.mindforge/config.json +2 -2
- package/.mindforge/governance/GOVERNANCE-CONFIG.md +17 -0
- package/.mindforge/governance/approval-workflow.md +37 -0
- package/.mindforge/governance/change-classifier.md +63 -0
- package/.mindforge/governance/compliance-gates.md +31 -0
- package/.mindforge/governance/policies/sovereign-default.json +16 -0
- package/.mindforge/integrations/confluence.md +27 -0
- package/.mindforge/integrations/connection-manager.md +163 -0
- package/.mindforge/integrations/github.md +25 -0
- package/.mindforge/integrations/gitlab.md +13 -0
- package/.mindforge/integrations/jira.md +102 -0
- package/.mindforge/integrations/slack.md +41 -0
- package/.mindforge/intelligence/antipattern-detector.md +75 -0
- package/.mindforge/intelligence/difficulty-scorer.md +55 -0
- package/.mindforge/intelligence/health-engine.md +208 -0
- package/.mindforge/intelligence/skill-gap-analyser.md +40 -0
- package/.mindforge/intelligence/smart-compaction.md +71 -0
- package/.mindforge/memory/MEMORY-SCHEMA.md +155 -0
- package/.mindforge/memory/engine/capture-protocol.md +36 -0
- package/.mindforge/memory/engine/global-sync-spec.md +42 -0
- package/.mindforge/memory/engine/retrieval-spec.md +44 -0
- package/.mindforge/memory/sync-manifest.json +6 -0
- package/.mindforge/metrics/METRICS-SCHEMA.md +42 -0
- package/.mindforge/metrics/quality-tracker.md +32 -0
- package/.mindforge/models/model-registry.md +48 -0
- package/.mindforge/models/model-router.md +30 -0
- package/.mindforge/org/CONVENTIONS.md +62 -0
- package/.mindforge/org/ORG.md +51 -0
- package/.mindforge/org/SECURITY.md +50 -0
- package/.mindforge/org/TOOLS.md +53 -0
- package/.mindforge/org/integrations/INTEGRATIONS-CONFIG.md +58 -0
- package/.mindforge/org/skills/MANIFEST.md +255 -0
- package/.mindforge/plugins/PLUGINS-MANIFEST.md +23 -0
- package/.mindforge/plugins/plugin-loader.md +93 -0
- package/.mindforge/plugins/plugin-registry.md +44 -0
- package/.mindforge/plugins/plugin-schema.md +68 -0
- package/.mindforge/team/TEAM-PROFILE.md +42 -0
- package/.mindforge/team/multi-handoff.md +23 -0
- package/.mindforge/team/profiles/README.md +13 -0
- package/.mindforge/team/session-merger.md +18 -0
- package/CHANGELOG.md +37 -0
- package/MINDFORGE.md +3 -3
- package/bin/installer-core.js +17 -11
- package/docs/References/audit-events.md +59 -0
- package/docs/References/checkpoints.md +778 -0
- package/docs/References/commands.md +107 -0
- package/docs/References/config-reference.md +122 -0
- package/docs/References/continuation-format.md +249 -0
- package/docs/References/decimal-phase-calculation.md +64 -0
- package/docs/References/git-integration.md +295 -0
- package/docs/References/git-planning-commit.md +38 -0
- package/docs/References/model-profile-resolution.md +36 -0
- package/docs/References/model-profiles.md +139 -0
- package/docs/References/phase-argument-parsing.md +61 -0
- package/docs/References/planning-config.md +202 -0
- package/docs/References/questioning.md +162 -0
- package/docs/References/sdk-api.md +53 -0
- package/docs/References/skills-api.md +57 -0
- package/docs/References/tdd.md +263 -0
- package/docs/References/ui-brand.md +160 -0
- package/docs/References/user-profiling.md +681 -0
- package/docs/References/verification-patterns.md +612 -0
- package/docs/References/workstream-flag.md +58 -0
- package/docs/Templates/Agents/CLAUDE-MD.md +122 -0
- package/docs/Templates/Agents/COPILOT-INSTRUCTIONS.md +7 -0
- package/docs/Templates/Agents/DEBUGGER-PROMPT.md +91 -0
- package/docs/Templates/Agents/PLANNER-PROMPT.md +117 -0
- package/docs/Templates/Codebase/architecture.md +255 -0
- package/docs/Templates/Codebase/concerns.md +310 -0
- package/docs/Templates/Codebase/conventions.md +307 -0
- package/docs/Templates/Codebase/integrations.md +280 -0
- package/docs/Templates/Codebase/stack.md +186 -0
- package/docs/Templates/Codebase/structure.md +285 -0
- package/docs/Templates/Codebase/testing.md +480 -0
- package/docs/Templates/Execution/CONTINUE-HERE.md +78 -0
- package/docs/Templates/Execution/DISCUSSION-LOG.md +63 -0
- package/docs/Templates/Execution/PHASE-PROMPT.md +610 -0
- package/docs/Templates/Execution/STATE.md +176 -0
- package/docs/Templates/Execution/SUMMARY-COMPLEX.md +59 -0
- package/docs/Templates/Execution/SUMMARY-MINIMAL.md +41 -0
- package/docs/Templates/Execution/SUMMARY-STANDARD.md +48 -0
- package/docs/Templates/Execution/SUMMARY.md +248 -0
- package/docs/Templates/Profile/DEV-PREFERENCES.md +21 -0
- package/docs/Templates/Profile/USER-PROFILE.md +146 -0
- package/docs/Templates/Profile/USER-SETUP.md +311 -0
- package/docs/Templates/Project/AGENTS_LEARNING.md +88 -0
- package/docs/Templates/Project/DISCOVERY.md +146 -0
- package/docs/Templates/Project/MILESTONE-ARCHIVE.md +123 -0
- package/docs/Templates/Project/MILESTONE.md +115 -0
- package/docs/Templates/Project/PROJECT.md +206 -0
- package/docs/Templates/Project/REQUIREMENTS.md +231 -0
- package/docs/Templates/Project/RETROSPECTIVE.md +54 -0
- package/docs/Templates/Project/ROADMAP.md +202 -0
- package/docs/Templates/Quality/DEBUG.md +164 -0
- package/docs/Templates/Quality/UAT.md +280 -0
- package/docs/Templates/Quality/UI-SPEC.md +100 -0
- package/docs/Templates/Quality/VALIDATION.md +76 -0
- package/docs/Templates/Quality/VERIFICATION-REPORT.md +322 -0
- package/docs/Templates/Research/ARCHITECTURE.md +204 -0
- package/docs/Templates/Research/FEATURES.md +147 -0
- package/docs/Templates/Research/PITFALLS.md +200 -0
- package/docs/Templates/Research/STACK.md +120 -0
- package/docs/Templates/Research/SUMMARY.md +170 -0
- package/docs/Templates/System/CONFIG.json +43 -0
- package/docs/Templates/System/CONTEXT.md +352 -0
- package/examples/starter-project/.planning/ARCHITECTURE.md +23 -0
- package/examples/starter-project/.planning/RELEASE-CHECKLIST.md +22 -0
- package/examples/starter-project/.planning/REQUIREMENTS.md +31 -0
- package/examples/starter-project/.planning/ROADMAP.md +28 -0
- package/package.json +22 -3
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>MindForge Brainstorming</title>
|
|
6
|
+
<style>
|
|
7
|
+
/*
|
|
8
|
+
* BRAINSTORM COMPANION FRAME TEMPLATE
|
|
9
|
+
*
|
|
10
|
+
* This template provides a consistent frame with:
|
|
11
|
+
* - OS-aware light/dark theming
|
|
12
|
+
* - Fixed header and selection indicator bar
|
|
13
|
+
* - Scrollable main content area
|
|
14
|
+
* - CSS helpers for common UI patterns
|
|
15
|
+
*
|
|
16
|
+
* Content is injected via placeholder comment in #claude-content.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
20
|
+
html, body { height: 100%; overflow: hidden; }
|
|
21
|
+
|
|
22
|
+
/* ===== THEME VARIABLES ===== */
|
|
23
|
+
:root {
|
|
24
|
+
--bg-primary: #f5f5f7;
|
|
25
|
+
--bg-secondary: #ffffff;
|
|
26
|
+
--bg-tertiary: #e5e5e7;
|
|
27
|
+
--border: #d1d1d6;
|
|
28
|
+
--text-primary: #1d1d1f;
|
|
29
|
+
--text-secondary: #86868b;
|
|
30
|
+
--text-tertiary: #aeaeb2;
|
|
31
|
+
--accent: #0071e3;
|
|
32
|
+
--accent-hover: #0077ed;
|
|
33
|
+
--success: #34c759;
|
|
34
|
+
--warning: #ff9f0a;
|
|
35
|
+
--error: #ff3b30;
|
|
36
|
+
--selected-bg: #e8f4fd;
|
|
37
|
+
--selected-border: #0071e3;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@media (prefers-color-scheme: dark) {
|
|
41
|
+
:root {
|
|
42
|
+
--bg-primary: #1d1d1f;
|
|
43
|
+
--bg-secondary: #2d2d2f;
|
|
44
|
+
--bg-tertiary: #3d3d3f;
|
|
45
|
+
--border: #424245;
|
|
46
|
+
--text-primary: #f5f5f7;
|
|
47
|
+
--text-secondary: #86868b;
|
|
48
|
+
--text-tertiary: #636366;
|
|
49
|
+
--accent: #0a84ff;
|
|
50
|
+
--accent-hover: #409cff;
|
|
51
|
+
--selected-bg: rgba(10, 132, 255, 0.15);
|
|
52
|
+
--selected-border: #0a84ff;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
body {
|
|
57
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
58
|
+
background: var(--bg-primary);
|
|
59
|
+
color: var(--text-primary);
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
line-height: 1.5;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ===== FRAME STRUCTURE ===== */
|
|
66
|
+
.header {
|
|
67
|
+
background: var(--bg-secondary);
|
|
68
|
+
padding: 0.5rem 1.5rem;
|
|
69
|
+
display: flex;
|
|
70
|
+
justify-content: space-between;
|
|
71
|
+
align-items: center;
|
|
72
|
+
border-bottom: 1px solid var(--border);
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
}
|
|
75
|
+
.header h1 { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
|
|
76
|
+
.header .status { font-size: 0.7rem; color: var(--success); display: flex; align-items: center; gap: 0.4rem; }
|
|
77
|
+
.header .status::before { content: ''; width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
|
|
78
|
+
|
|
79
|
+
.main { flex: 1; overflow-y: auto; }
|
|
80
|
+
#claude-content { padding: 2rem; min-height: 100%; }
|
|
81
|
+
|
|
82
|
+
.indicator-bar {
|
|
83
|
+
background: var(--bg-secondary);
|
|
84
|
+
border-top: 1px solid var(--border);
|
|
85
|
+
padding: 0.5rem 1.5rem;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
text-align: center;
|
|
88
|
+
}
|
|
89
|
+
.indicator-bar span {
|
|
90
|
+
font-size: 0.75rem;
|
|
91
|
+
color: var(--text-secondary);
|
|
92
|
+
}
|
|
93
|
+
.indicator-bar .selected-text {
|
|
94
|
+
color: var(--accent);
|
|
95
|
+
font-weight: 500;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ===== TYPOGRAPHY ===== */
|
|
99
|
+
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
|
|
100
|
+
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
|
|
101
|
+
.subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }
|
|
102
|
+
.section { margin-bottom: 2rem; }
|
|
103
|
+
.label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
|
|
104
|
+
|
|
105
|
+
/* ===== OPTIONS (for A/B/C choices) ===== */
|
|
106
|
+
.options { display: flex; flex-direction: column; gap: 0.75rem; }
|
|
107
|
+
.option {
|
|
108
|
+
background: var(--bg-secondary);
|
|
109
|
+
border: 2px solid var(--border);
|
|
110
|
+
border-radius: 12px;
|
|
111
|
+
padding: 1rem 1.25rem;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
transition: all 0.15s ease;
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: flex-start;
|
|
116
|
+
gap: 1rem;
|
|
117
|
+
}
|
|
118
|
+
.option:hover { border-color: var(--accent); }
|
|
119
|
+
.option.selected { background: var(--selected-bg); border-color: var(--selected-border); }
|
|
120
|
+
.option .letter {
|
|
121
|
+
background: var(--bg-tertiary);
|
|
122
|
+
color: var(--text-secondary);
|
|
123
|
+
width: 1.75rem; height: 1.75rem;
|
|
124
|
+
border-radius: 6px;
|
|
125
|
+
display: flex; align-items: center; justify-content: center;
|
|
126
|
+
font-weight: 600; font-size: 0.85rem; flex-shrink: 0;
|
|
127
|
+
}
|
|
128
|
+
.option.selected .letter { background: var(--accent); color: white; }
|
|
129
|
+
.option .content { flex: 1; }
|
|
130
|
+
.option .content h3 { font-size: 0.95rem; margin-bottom: 0.15rem; }
|
|
131
|
+
.option .content p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }
|
|
132
|
+
|
|
133
|
+
/* ===== CARDS (for showing designs/mockups) ===== */
|
|
134
|
+
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
|
|
135
|
+
.card {
|
|
136
|
+
background: var(--bg-secondary);
|
|
137
|
+
border: 1px solid var(--border);
|
|
138
|
+
border-radius: 12px;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
transition: all 0.15s ease;
|
|
142
|
+
}
|
|
143
|
+
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
|
|
144
|
+
.card.selected { border-color: var(--selected-border); border-width: 2px; }
|
|
145
|
+
.card-image { background: var(--bg-tertiary); aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; }
|
|
146
|
+
.card-body { padding: 1rem; }
|
|
147
|
+
.card-body h3 { margin-bottom: 0.25rem; }
|
|
148
|
+
.card-body p { color: var(--text-secondary); font-size: 0.85rem; }
|
|
149
|
+
|
|
150
|
+
/* ===== MOCKUP CONTAINER ===== */
|
|
151
|
+
.mockup {
|
|
152
|
+
background: var(--bg-secondary);
|
|
153
|
+
border: 1px solid var(--border);
|
|
154
|
+
border-radius: 12px;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
margin-bottom: 1.5rem;
|
|
157
|
+
}
|
|
158
|
+
.mockup-header {
|
|
159
|
+
background: var(--bg-tertiary);
|
|
160
|
+
padding: 0.5rem 1rem;
|
|
161
|
+
font-size: 0.75rem;
|
|
162
|
+
color: var(--text-secondary);
|
|
163
|
+
border-bottom: 1px solid var(--border);
|
|
164
|
+
}
|
|
165
|
+
.mockup-body { padding: 1.5rem; }
|
|
166
|
+
|
|
167
|
+
/* ===== SPLIT VIEW (side-by-side comparison) ===== */
|
|
168
|
+
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
|
|
169
|
+
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } }
|
|
170
|
+
|
|
171
|
+
/* ===== PROS/CONS ===== */
|
|
172
|
+
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
|
|
173
|
+
.pros, .cons { background: var(--bg-secondary); border-radius: 8px; padding: 1rem; }
|
|
174
|
+
.pros h4 { color: var(--success); font-size: 0.85rem; margin-bottom: 0.5rem; }
|
|
175
|
+
.cons h4 { color: var(--error); font-size: 0.85rem; margin-bottom: 0.5rem; }
|
|
176
|
+
.pros ul, .cons ul { margin-left: 1.25rem; font-size: 0.85rem; color: var(--text-secondary); }
|
|
177
|
+
.pros li, .cons li { margin-bottom: 0.25rem; }
|
|
178
|
+
|
|
179
|
+
/* ===== PLACEHOLDER (for mockup areas) ===== */
|
|
180
|
+
.placeholder {
|
|
181
|
+
background: var(--bg-tertiary);
|
|
182
|
+
border: 2px dashed var(--border);
|
|
183
|
+
border-radius: 8px;
|
|
184
|
+
padding: 2rem;
|
|
185
|
+
text-align: center;
|
|
186
|
+
color: var(--text-tertiary);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* ===== INLINE MOCKUP ELEMENTS ===== */
|
|
190
|
+
.mock-nav { background: var(--accent); color: white; padding: 0.75rem 1rem; display: flex; gap: 1.5rem; font-size: 0.9rem; }
|
|
191
|
+
.mock-sidebar { background: var(--bg-tertiary); padding: 1rem; min-width: 180px; }
|
|
192
|
+
.mock-content { padding: 1.5rem; flex: 1; }
|
|
193
|
+
.mock-button { background: var(--accent); color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.85rem; }
|
|
194
|
+
.mock-input { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; width: 100%; }
|
|
195
|
+
</style>
|
|
196
|
+
</head>
|
|
197
|
+
<body>
|
|
198
|
+
<div class="header">
|
|
199
|
+
<h1><a href="https://github.com/obra/MindForge" style="color: inherit; text-decoration: none;">MindForge Brainstorming</a></h1>
|
|
200
|
+
<div class="status">Connected</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div class="main">
|
|
204
|
+
<div id="claude-content">
|
|
205
|
+
<!-- CONTENT -->
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
<div class="indicator-bar">
|
|
210
|
+
<span id="indicator-text">Click an option above, then return to the terminal</span>
|
|
211
|
+
</div>
|
|
212
|
+
|
|
213
|
+
</body>
|
|
214
|
+
</html>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* This script is served to and executed in the browser (brainstorming dashboard client). */
|
|
2
|
+
/* global window, document */
|
|
3
|
+
(function() {
|
|
4
|
+
const WS_URL = 'ws://' + window.location.host;
|
|
5
|
+
let ws = null;
|
|
6
|
+
let eventQueue = [];
|
|
7
|
+
|
|
8
|
+
function connect() {
|
|
9
|
+
ws = new WebSocket(WS_URL);
|
|
10
|
+
|
|
11
|
+
ws.onopen = () => {
|
|
12
|
+
eventQueue.forEach(e => ws.send(JSON.stringify(e)));
|
|
13
|
+
eventQueue = [];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
ws.onmessage = (msg) => {
|
|
17
|
+
const data = JSON.parse(msg.data);
|
|
18
|
+
if (data.type === 'reload') {
|
|
19
|
+
window.location.reload();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
ws.onclose = () => {
|
|
24
|
+
setTimeout(connect, 1000);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function sendEvent(event) {
|
|
29
|
+
event.timestamp = Date.now();
|
|
30
|
+
if (ws && ws.readyState === WebSocket.OPEN) {
|
|
31
|
+
ws.send(JSON.stringify(event));
|
|
32
|
+
} else {
|
|
33
|
+
eventQueue.push(event);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Capture clicks on choice elements
|
|
38
|
+
document.addEventListener('click', (e) => {
|
|
39
|
+
const target = e.target.closest('[data-choice]');
|
|
40
|
+
if (!target) return;
|
|
41
|
+
|
|
42
|
+
sendEvent({
|
|
43
|
+
type: 'click',
|
|
44
|
+
text: target.textContent.trim(),
|
|
45
|
+
choice: target.dataset.choice,
|
|
46
|
+
id: target.id || null
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Update indicator bar (defer so toggleSelect runs first)
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
const indicator = document.getElementById('indicator-text');
|
|
52
|
+
if (!indicator) return;
|
|
53
|
+
const container = target.closest('.options') || target.closest('.cards');
|
|
54
|
+
const selected = container ? container.querySelectorAll('.selected') : [];
|
|
55
|
+
if (selected.length === 0) {
|
|
56
|
+
indicator.textContent = 'Click an option above, then return to the terminal';
|
|
57
|
+
} else if (selected.length === 1) {
|
|
58
|
+
const label = selected[0].querySelector('h3, .content h3, .card-body h3')?.textContent?.trim() || selected[0].dataset.choice;
|
|
59
|
+
indicator.innerHTML = '<span class="selected-text">' + label + ' selected</span> — return to terminal to continue';
|
|
60
|
+
} else {
|
|
61
|
+
indicator.innerHTML = '<span class="selected-text">' + selected.length + ' selected</span> — return to terminal to continue';
|
|
62
|
+
}
|
|
63
|
+
}, 0);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Frame UI: selection tracking
|
|
67
|
+
window.selectedChoice = null;
|
|
68
|
+
|
|
69
|
+
window.toggleSelect = function(el) {
|
|
70
|
+
const container = el.closest('.options') || el.closest('.cards');
|
|
71
|
+
const multi = container && container.dataset.multiselect !== undefined;
|
|
72
|
+
if (container && !multi) {
|
|
73
|
+
container.querySelectorAll('.option, .card').forEach(o => o.classList.remove('selected'));
|
|
74
|
+
}
|
|
75
|
+
if (multi) {
|
|
76
|
+
el.classList.toggle('selected');
|
|
77
|
+
} else {
|
|
78
|
+
el.classList.add('selected');
|
|
79
|
+
}
|
|
80
|
+
window.selectedChoice = el.dataset.choice;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// Expose API for explicit use
|
|
84
|
+
window.brainstorm = {
|
|
85
|
+
send: sendEvent,
|
|
86
|
+
choice: (value, metadata = {}) => sendEvent({ type: 'choice', value, ...metadata })
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
connect();
|
|
90
|
+
})();
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
const crypto = require('crypto');
|
|
2
|
+
const http = require('http');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// ========== WebSocket Protocol (RFC 6455) ==========
|
|
7
|
+
|
|
8
|
+
const OPCODES = { TEXT: 0x01, CLOSE: 0x08, PING: 0x09, PONG: 0x0A };
|
|
9
|
+
const WS_MAGIC = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';
|
|
10
|
+
|
|
11
|
+
function computeAcceptKey(clientKey) {
|
|
12
|
+
return crypto.createHash('sha1').update(clientKey + WS_MAGIC).digest('base64');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function encodeFrame(opcode, payload) {
|
|
16
|
+
const fin = 0x80;
|
|
17
|
+
const len = payload.length;
|
|
18
|
+
let header;
|
|
19
|
+
|
|
20
|
+
if (len < 126) {
|
|
21
|
+
header = Buffer.alloc(2);
|
|
22
|
+
header[0] = fin | opcode;
|
|
23
|
+
header[1] = len;
|
|
24
|
+
} else if (len < 65536) {
|
|
25
|
+
header = Buffer.alloc(4);
|
|
26
|
+
header[0] = fin | opcode;
|
|
27
|
+
header[1] = 126;
|
|
28
|
+
header.writeUInt16BE(len, 2);
|
|
29
|
+
} else {
|
|
30
|
+
header = Buffer.alloc(10);
|
|
31
|
+
header[0] = fin | opcode;
|
|
32
|
+
header[1] = 127;
|
|
33
|
+
header.writeBigUInt64BE(BigInt(len), 2);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return Buffer.concat([header, payload]);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function decodeFrame(buffer) {
|
|
40
|
+
if (buffer.length < 2) return null;
|
|
41
|
+
|
|
42
|
+
const secondByte = buffer[1];
|
|
43
|
+
const opcode = buffer[0] & 0x0F;
|
|
44
|
+
const masked = (secondByte & 0x80) !== 0;
|
|
45
|
+
let payloadLen = secondByte & 0x7F;
|
|
46
|
+
let offset = 2;
|
|
47
|
+
|
|
48
|
+
if (!masked) throw new Error('Client frames must be masked');
|
|
49
|
+
|
|
50
|
+
if (payloadLen === 126) {
|
|
51
|
+
if (buffer.length < 4) return null;
|
|
52
|
+
payloadLen = buffer.readUInt16BE(2);
|
|
53
|
+
offset = 4;
|
|
54
|
+
} else if (payloadLen === 127) {
|
|
55
|
+
if (buffer.length < 10) return null;
|
|
56
|
+
payloadLen = Number(buffer.readBigUInt64BE(2));
|
|
57
|
+
offset = 10;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const maskOffset = offset;
|
|
61
|
+
const dataOffset = offset + 4;
|
|
62
|
+
const totalLen = dataOffset + payloadLen;
|
|
63
|
+
if (buffer.length < totalLen) return null;
|
|
64
|
+
|
|
65
|
+
const mask = buffer.slice(maskOffset, dataOffset);
|
|
66
|
+
const data = Buffer.alloc(payloadLen);
|
|
67
|
+
for (let i = 0; i < payloadLen; i++) {
|
|
68
|
+
data[i] = buffer[dataOffset + i] ^ mask[i % 4];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return { opcode, payload: data, bytesConsumed: totalLen };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ========== Configuration ==========
|
|
75
|
+
|
|
76
|
+
const PORT = process.env.BRAINSTORM_PORT || (49152 + Math.floor(Math.random() * 16383));
|
|
77
|
+
const HOST = process.env.BRAINSTORM_HOST || '127.0.0.1';
|
|
78
|
+
const URL_HOST = process.env.BRAINSTORM_URL_HOST || (HOST === '127.0.0.1' ? 'localhost' : HOST);
|
|
79
|
+
const SESSION_DIR = process.env.BRAINSTORM_DIR || '/tmp/brainstorm';
|
|
80
|
+
const CONTENT_DIR = path.join(SESSION_DIR, 'content');
|
|
81
|
+
const STATE_DIR = path.join(SESSION_DIR, 'state');
|
|
82
|
+
let ownerPid = process.env.BRAINSTORM_OWNER_PID ? Number(process.env.BRAINSTORM_OWNER_PID) : null;
|
|
83
|
+
|
|
84
|
+
const MIME_TYPES = {
|
|
85
|
+
'.html': 'text/html', '.css': 'text/css', '.js': 'application/javascript',
|
|
86
|
+
'.json': 'application/json', '.png': 'image/png', '.jpg': 'image/jpeg',
|
|
87
|
+
'.jpeg': 'image/jpeg', '.gif': 'image/gif', '.svg': 'image/svg+xml'
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// ========== Templates and Constants ==========
|
|
91
|
+
|
|
92
|
+
const WAITING_PAGE = `<!DOCTYPE html>
|
|
93
|
+
<html>
|
|
94
|
+
<head><meta charset="utf-8"><title>Brainstorm Companion</title>
|
|
95
|
+
<style>body { font-family: system-ui, sans-serif; padding: 2rem; max-width: 800px; margin: 0 auto; }
|
|
96
|
+
h1 { color: #333; } p { color: #666; }</style>
|
|
97
|
+
</head>
|
|
98
|
+
<body><h1>Brainstorm Companion</h1>
|
|
99
|
+
<p>Waiting for the agent to push a screen...</p></body></html>`;
|
|
100
|
+
|
|
101
|
+
const frameTemplate = fs.readFileSync(path.join(__dirname, 'frame-template.html'), 'utf-8');
|
|
102
|
+
const helperScript = fs.readFileSync(path.join(__dirname, 'helper.js'), 'utf-8');
|
|
103
|
+
const helperInjection = '<script>\n' + helperScript + '\n</script>';
|
|
104
|
+
|
|
105
|
+
// ========== Helper Functions ==========
|
|
106
|
+
|
|
107
|
+
function isFullDocument(html) {
|
|
108
|
+
const trimmed = html.trimStart().toLowerCase();
|
|
109
|
+
return trimmed.startsWith('<!doctype') || trimmed.startsWith('<html');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function wrapInFrame(content) {
|
|
113
|
+
return frameTemplate.replace('<!-- CONTENT -->', content);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function getNewestScreen() {
|
|
117
|
+
const files = fs.readdirSync(CONTENT_DIR)
|
|
118
|
+
.filter(f => f.endsWith('.html'))
|
|
119
|
+
.map(f => {
|
|
120
|
+
const fp = path.join(CONTENT_DIR, f);
|
|
121
|
+
return { path: fp, mtime: fs.statSync(fp).mtime.getTime() };
|
|
122
|
+
})
|
|
123
|
+
.sort((a, b) => b.mtime - a.mtime);
|
|
124
|
+
return files.length > 0 ? files[0].path : null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ========== HTTP Request Handler ==========
|
|
128
|
+
|
|
129
|
+
function handleRequest(req, res) {
|
|
130
|
+
touchActivity();
|
|
131
|
+
if (req.method === 'GET' && req.url === '/') {
|
|
132
|
+
const screenFile = getNewestScreen();
|
|
133
|
+
let html = screenFile
|
|
134
|
+
? (raw => isFullDocument(raw) ? raw : wrapInFrame(raw))(fs.readFileSync(screenFile, 'utf-8'))
|
|
135
|
+
: WAITING_PAGE;
|
|
136
|
+
|
|
137
|
+
if (html.includes('</body>')) {
|
|
138
|
+
html = html.replace('</body>', helperInjection + '\n</body>');
|
|
139
|
+
} else {
|
|
140
|
+
html += helperInjection;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
144
|
+
res.end(html);
|
|
145
|
+
} else if (req.method === 'GET' && req.url.startsWith('/files/')) {
|
|
146
|
+
const fileName = req.url.slice(7);
|
|
147
|
+
const filePath = path.join(CONTENT_DIR, path.basename(fileName));
|
|
148
|
+
if (!fs.existsSync(filePath)) {
|
|
149
|
+
res.writeHead(404);
|
|
150
|
+
res.end('Not found');
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
154
|
+
const contentType = MIME_TYPES[ext] || 'application/octet-stream';
|
|
155
|
+
res.writeHead(200, { 'Content-Type': contentType });
|
|
156
|
+
res.end(fs.readFileSync(filePath));
|
|
157
|
+
} else {
|
|
158
|
+
res.writeHead(404);
|
|
159
|
+
res.end('Not found');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// ========== WebSocket Connection Handling ==========
|
|
164
|
+
|
|
165
|
+
const clients = new Set();
|
|
166
|
+
|
|
167
|
+
function handleUpgrade(req, socket) {
|
|
168
|
+
const key = req.headers['sec-websocket-key'];
|
|
169
|
+
if (!key) { socket.destroy(); return; }
|
|
170
|
+
|
|
171
|
+
const accept = computeAcceptKey(key);
|
|
172
|
+
socket.write(
|
|
173
|
+
'HTTP/1.1 101 Switching Protocols\r\n' +
|
|
174
|
+
'Upgrade: websocket\r\n' +
|
|
175
|
+
'Connection: Upgrade\r\n' +
|
|
176
|
+
'Sec-WebSocket-Accept: ' + accept + '\r\n\r\n'
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
let buffer = Buffer.alloc(0);
|
|
180
|
+
clients.add(socket);
|
|
181
|
+
|
|
182
|
+
socket.on('data', (chunk) => {
|
|
183
|
+
buffer = Buffer.concat([buffer, chunk]);
|
|
184
|
+
while (buffer.length > 0) {
|
|
185
|
+
let result;
|
|
186
|
+
try {
|
|
187
|
+
result = decodeFrame(buffer);
|
|
188
|
+
} catch (e) {
|
|
189
|
+
socket.end(encodeFrame(OPCODES.CLOSE, Buffer.alloc(0)));
|
|
190
|
+
clients.delete(socket);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (!result) break;
|
|
194
|
+
buffer = buffer.slice(result.bytesConsumed);
|
|
195
|
+
|
|
196
|
+
switch (result.opcode) {
|
|
197
|
+
case OPCODES.TEXT:
|
|
198
|
+
handleMessage(result.payload.toString());
|
|
199
|
+
break;
|
|
200
|
+
case OPCODES.CLOSE:
|
|
201
|
+
socket.end(encodeFrame(OPCODES.CLOSE, Buffer.alloc(0)));
|
|
202
|
+
clients.delete(socket);
|
|
203
|
+
return;
|
|
204
|
+
case OPCODES.PING:
|
|
205
|
+
socket.write(encodeFrame(OPCODES.PONG, result.payload));
|
|
206
|
+
break;
|
|
207
|
+
case OPCODES.PONG:
|
|
208
|
+
break;
|
|
209
|
+
default: {
|
|
210
|
+
const closeBuf = Buffer.alloc(2);
|
|
211
|
+
closeBuf.writeUInt16BE(1003);
|
|
212
|
+
socket.end(encodeFrame(OPCODES.CLOSE, closeBuf));
|
|
213
|
+
clients.delete(socket);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
socket.on('close', () => clients.delete(socket));
|
|
221
|
+
socket.on('error', () => clients.delete(socket));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function handleMessage(text) {
|
|
225
|
+
let event;
|
|
226
|
+
try {
|
|
227
|
+
event = JSON.parse(text);
|
|
228
|
+
} catch (e) {
|
|
229
|
+
console.error('Failed to parse WebSocket message:', e.message);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
touchActivity();
|
|
233
|
+
console.log(JSON.stringify({ source: 'user-event', ...event }));
|
|
234
|
+
if (event.choice) {
|
|
235
|
+
const eventsFile = path.join(STATE_DIR, 'events');
|
|
236
|
+
fs.appendFileSync(eventsFile, JSON.stringify(event) + '\n');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function broadcast(msg) {
|
|
241
|
+
const frame = encodeFrame(OPCODES.TEXT, Buffer.from(JSON.stringify(msg)));
|
|
242
|
+
for (const socket of clients) {
|
|
243
|
+
try { socket.write(frame); } catch (e) { clients.delete(socket); }
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// ========== Activity Tracking ==========
|
|
248
|
+
|
|
249
|
+
const IDLE_TIMEOUT_MS = 30 * 60 * 1000; // 30 minutes
|
|
250
|
+
let lastActivity = Date.now();
|
|
251
|
+
|
|
252
|
+
function touchActivity() {
|
|
253
|
+
lastActivity = Date.now();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// ========== File Watching ==========
|
|
257
|
+
|
|
258
|
+
const debounceTimers = new Map();
|
|
259
|
+
|
|
260
|
+
// ========== Server Startup ==========
|
|
261
|
+
|
|
262
|
+
function startServer() {
|
|
263
|
+
if (!fs.existsSync(CONTENT_DIR)) fs.mkdirSync(CONTENT_DIR, { recursive: true });
|
|
264
|
+
if (!fs.existsSync(STATE_DIR)) fs.mkdirSync(STATE_DIR, { recursive: true });
|
|
265
|
+
|
|
266
|
+
// Track known files to distinguish new screens from updates.
|
|
267
|
+
// macOS fs.watch reports 'rename' for both new files and overwrites,
|
|
268
|
+
// so we can't rely on eventType alone.
|
|
269
|
+
const knownFiles = new Set(
|
|
270
|
+
fs.readdirSync(CONTENT_DIR).filter(f => f.endsWith('.html'))
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
const server = http.createServer(handleRequest);
|
|
274
|
+
server.on('upgrade', handleUpgrade);
|
|
275
|
+
|
|
276
|
+
const watcher = fs.watch(CONTENT_DIR, (eventType, filename) => {
|
|
277
|
+
if (!filename || !filename.endsWith('.html')) return;
|
|
278
|
+
|
|
279
|
+
if (debounceTimers.has(filename)) clearTimeout(debounceTimers.get(filename));
|
|
280
|
+
debounceTimers.set(filename, setTimeout(() => {
|
|
281
|
+
debounceTimers.delete(filename);
|
|
282
|
+
const filePath = path.join(CONTENT_DIR, filename);
|
|
283
|
+
|
|
284
|
+
if (!fs.existsSync(filePath)) return; // file was deleted
|
|
285
|
+
touchActivity();
|
|
286
|
+
|
|
287
|
+
if (!knownFiles.has(filename)) {
|
|
288
|
+
knownFiles.add(filename);
|
|
289
|
+
const eventsFile = path.join(STATE_DIR, 'events');
|
|
290
|
+
if (fs.existsSync(eventsFile)) fs.unlinkSync(eventsFile);
|
|
291
|
+
console.log(JSON.stringify({ type: 'screen-added', file: filePath }));
|
|
292
|
+
} else {
|
|
293
|
+
console.log(JSON.stringify({ type: 'screen-updated', file: filePath }));
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
broadcast({ type: 'reload' });
|
|
297
|
+
}, 100));
|
|
298
|
+
});
|
|
299
|
+
watcher.on('error', (err) => console.error('fs.watch error:', err.message));
|
|
300
|
+
|
|
301
|
+
function shutdown(reason) {
|
|
302
|
+
console.log(JSON.stringify({ type: 'server-stopped', reason }));
|
|
303
|
+
const infoFile = path.join(STATE_DIR, 'server-info');
|
|
304
|
+
if (fs.existsSync(infoFile)) fs.unlinkSync(infoFile);
|
|
305
|
+
fs.writeFileSync(
|
|
306
|
+
path.join(STATE_DIR, 'server-stopped'),
|
|
307
|
+
JSON.stringify({ reason, timestamp: Date.now() }) + '\n'
|
|
308
|
+
);
|
|
309
|
+
watcher.close();
|
|
310
|
+
clearInterval(lifecycleCheck);
|
|
311
|
+
server.close(() => process.exit(0));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function ownerAlive() {
|
|
315
|
+
if (!ownerPid) return true;
|
|
316
|
+
try { process.kill(ownerPid, 0); return true; } catch (e) { return e.code === 'EPERM'; }
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// Check every 60s: exit if owner process died or idle for 30 minutes
|
|
320
|
+
const lifecycleCheck = setInterval(() => {
|
|
321
|
+
if (!ownerAlive()) shutdown('owner process exited');
|
|
322
|
+
else if (Date.now() - lastActivity > IDLE_TIMEOUT_MS) shutdown('idle timeout');
|
|
323
|
+
}, 60 * 1000);
|
|
324
|
+
lifecycleCheck.unref();
|
|
325
|
+
|
|
326
|
+
// Validate owner PID at startup. If it's already dead, the PID resolution
|
|
327
|
+
// was wrong (common on WSL, Tailscale SSH, and cross-user scenarios).
|
|
328
|
+
// Disable monitoring and rely on the idle timeout instead.
|
|
329
|
+
if (ownerPid) {
|
|
330
|
+
try { process.kill(ownerPid, 0); }
|
|
331
|
+
catch (e) {
|
|
332
|
+
if (e.code !== 'EPERM') {
|
|
333
|
+
console.log(JSON.stringify({ type: 'owner-pid-invalid', pid: ownerPid, reason: 'dead at startup' }));
|
|
334
|
+
ownerPid = null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
server.listen(PORT, HOST, () => {
|
|
340
|
+
const info = JSON.stringify({
|
|
341
|
+
type: 'server-started', port: Number(PORT), host: HOST,
|
|
342
|
+
url_host: URL_HOST, url: 'http://' + URL_HOST + ':' + PORT,
|
|
343
|
+
screen_dir: CONTENT_DIR, state_dir: STATE_DIR
|
|
344
|
+
});
|
|
345
|
+
console.log(info);
|
|
346
|
+
fs.writeFileSync(path.join(STATE_DIR, 'server-info'), info + '\n');
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (require.main === module) {
|
|
351
|
+
startServer();
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
module.exports = { computeAcceptKey, encodeFrame, decodeFrame, OPCODES };
|