mindforge-cc 10.0.3 → 11.0.0
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/.mindforge/MINDFORGE-V2-SCHEMA.json +43 -10
- package/.mindforge/config.json +30 -2
- package/.mindforge/engine/cross-model-eval.md +74 -0
- package/.mindforge/engine/proactive/signal-detector.md +60 -0
- package/.mindforge/engine/proactive/suggestion-engine.md +100 -0
- package/.mindforge/personas/agent-architect.md +57 -0
- package/.mindforge/personas/agent-evaluator.md +162 -0
- package/.mindforge/personas/agent-memory-designer.md +157 -0
- package/.mindforge/personas/agent-ops-engineer.md +120 -0
- package/.mindforge/personas/agent-orchestrator.md +112 -0
- package/.mindforge/personas/ai-economist.md +57 -0
- package/.mindforge/personas/ai-safety-engineer.md +57 -0
- package/.mindforge/personas/analytics-engineer.md +57 -0
- package/.mindforge/personas/anti-pattern-hunter.md +61 -0
- package/.mindforge/personas/api-gateway-designer.md +132 -0
- package/.mindforge/personas/auth-engineer.md +112 -0
- package/.mindforge/personas/build-engineer.md +57 -0
- package/.mindforge/personas/business-analyst.md +56 -0
- package/.mindforge/personas/cache-architect.md +100 -0
- package/.mindforge/personas/causal-scientist.md +57 -0
- package/.mindforge/personas/cdn-architect.md +118 -0
- package/.mindforge/personas/change-agent.md +104 -0
- package/.mindforge/personas/code-narrator.md +52 -0
- package/.mindforge/personas/codegen-specialist.md +68 -0
- package/.mindforge/personas/communication-architect.md +102 -0
- package/.mindforge/personas/compliance-engineer.md +96 -0
- package/.mindforge/personas/consensus-engineer.md +116 -0
- package/.mindforge/personas/contract-tester.md +60 -192
- package/.mindforge/personas/data-architect.md +108 -0
- package/.mindforge/personas/data-mesh-architect.md +57 -0
- package/.mindforge/personas/data-pipeline-architect.md +120 -0
- package/.mindforge/personas/de-sloppifier.md +60 -0
- package/.mindforge/personas/debt-manager.md +66 -0
- package/.mindforge/personas/decision-architect.md +82 -51
- package/.mindforge/personas/deployment-captain.md +74 -0
- package/.mindforge/personas/design-system-lead.md +112 -0
- package/.mindforge/personas/dmux-orchestrator.md +75 -0
- package/.mindforge/personas/dx-engineer.md +96 -0
- package/.mindforge/personas/ecommerce-engineer.md +57 -0
- package/.mindforge/personas/edge-engineer.md +94 -0
- package/.mindforge/personas/edtech-architect.md +106 -0
- package/.mindforge/personas/embedding-architect.md +57 -0
- package/.mindforge/personas/environment-engineer.md +57 -0
- package/.mindforge/personas/eval-judge.md +55 -0
- package/.mindforge/personas/event-architect.md +102 -0
- package/.mindforge/personas/experiment-designer.md +138 -0
- package/.mindforge/personas/feature-store-engineer.md +57 -0
- package/.mindforge/personas/finops-analyst.md +66 -0
- package/.mindforge/personas/fintech-architect.md +57 -0
- package/.mindforge/personas/flutter-engineer.md +104 -0
- package/.mindforge/personas/gaming-engineer.md +57 -0
- package/.mindforge/personas/graphql-designer.md +73 -0
- package/.mindforge/personas/healthcare-engineer.md +57 -0
- package/.mindforge/personas/hiring-strategist.md +105 -0
- package/.mindforge/personas/hitl-architect.md +165 -0
- package/.mindforge/personas/i18n-architect.md +69 -0
- package/.mindforge/personas/iot-architect.md +105 -0
- package/.mindforge/personas/knowledge-curator.md +139 -0
- package/.mindforge/personas/knowledge-engineer.md +57 -0
- package/.mindforge/personas/lakehouse-architect.md +57 -0
- package/.mindforge/personas/llm-orchestrator.md +57 -0
- package/.mindforge/personas/logistics-architect.md +106 -0
- package/.mindforge/personas/market-analyst.md +53 -0
- package/.mindforge/personas/marketplace-engineer.md +105 -0
- package/.mindforge/personas/mcp-designer.md +54 -0
- package/.mindforge/personas/meeting-designer.md +104 -0
- package/.mindforge/personas/mentorship-lead.md +106 -0
- package/.mindforge/personas/migration-architect.md +57 -0
- package/.mindforge/personas/ml-ops-engineer.md +101 -0
- package/.mindforge/personas/mobile-architect.md +105 -0
- package/.mindforge/personas/mobile-security-engineer.md +106 -0
- package/.mindforge/personas/multi-tenancy-architect.md +71 -0
- package/.mindforge/personas/multimodal-engineer.md +57 -0
- package/.mindforge/personas/offline-specialist.md +105 -0
- package/.mindforge/personas/onboarding-navigator.md +63 -0
- package/.mindforge/personas/payments-engineer.md +135 -0
- package/.mindforge/personas/pipeline-engineer.md +115 -0
- package/.mindforge/personas/platform-engineer.md +97 -0
- package/.mindforge/personas/platform-lead.md +57 -0
- package/.mindforge/personas/privacy-engineer.md +57 -0
- package/.mindforge/personas/product-owner.md +56 -0
- package/.mindforge/personas/productivity-analyst.md +57 -0
- package/.mindforge/personas/prompt-architect.md +101 -0
- package/.mindforge/personas/proofreader.md +53 -0
- package/.mindforge/personas/pwa-architect.md +105 -0
- package/.mindforge/personas/quality-scorer.md +63 -0
- package/.mindforge/personas/react-native-engineer.md +106 -0
- package/.mindforge/personas/resilience-engineer.md +69 -0
- package/.mindforge/personas/rfc-architect.md +64 -0
- package/.mindforge/personas/saga-orchestrator.md +80 -0
- package/.mindforge/personas/secrets-engineer.md +57 -0
- package/.mindforge/personas/skill-smith.md +79 -0
- package/.mindforge/personas/sre-lead.md +107 -0
- package/.mindforge/personas/stream-engineer.md +57 -0
- package/.mindforge/personas/streaming-engineer.md +64 -0
- package/.mindforge/personas/swarm-templates.json +674 -44
- package/.mindforge/personas/system-designer.md +57 -0
- package/.mindforge/personas/team-coach.md +120 -0
- package/.mindforge/personas/tech-lead-coach.md +103 -0
- package/.mindforge/personas/technical-writer-lead.md +111 -0
- package/.mindforge/personas/vibe-checker.md +75 -0
- package/.mindforge/personas/worktree-manager.md +56 -0
- package/.mindforge/personas/zero-trust-engineer.md +113 -0
- package/.mindforge/skills/a11y-testing/SKILL.md +143 -0
- package/.mindforge/skills/agent-evaluation-framework/SKILL.md +227 -0
- package/.mindforge/skills/agent-memory-design/SKILL.md +199 -0
- package/.mindforge/skills/agent-orchestration-patterns/SKILL.md +129 -0
- package/.mindforge/skills/agent-tool-selection/SKILL.md +204 -0
- package/.mindforge/skills/ai-agent-deployment/SKILL.md +176 -0
- package/.mindforge/skills/ai-cost-management/SKILL.md +57 -0
- package/.mindforge/skills/ai-safety-alignment/SKILL.md +53 -0
- package/.mindforge/skills/analytics-instrumentation/SKILL.md +172 -0
- package/.mindforge/skills/api-gateway-patterns/SKILL.md +177 -0
- package/.mindforge/skills/api-marketplace/SKILL.md +56 -0
- package/.mindforge/skills/api-versioning/SKILL.md +100 -0
- package/.mindforge/skills/app-store-deployment/SKILL.md +44 -0
- package/.mindforge/skills/architecture-tradeoff-analysis/SKILL.md +97 -0
- package/.mindforge/skills/audit-logging/SKILL.md +140 -0
- package/.mindforge/skills/auth-patterns/SKILL.md +148 -0
- package/.mindforge/skills/autonomous-agent-harness/SKILL.md +218 -0
- package/.mindforge/skills/autonomous-agents/SKILL.md +59 -0
- package/.mindforge/skills/build-system-optimization/SKILL.md +54 -0
- package/.mindforge/skills/build-vs-buy/SKILL.md +80 -0
- package/.mindforge/skills/bundle-optimization/SKILL.md +174 -0
- package/.mindforge/skills/business-analyst/SKILL.md +82 -0
- package/.mindforge/skills/caching-strategies/SKILL.md +132 -0
- package/.mindforge/skills/capacity-planning/SKILL.md +96 -0
- package/.mindforge/skills/causal-inference/SKILL.md +42 -0
- package/.mindforge/skills/cdn-optimization/SKILL.md +212 -0
- package/.mindforge/skills/change-management/SKILL.md +106 -0
- package/.mindforge/skills/chaos-engineering/SKILL.md +99 -0
- package/.mindforge/skills/ci-cd-pipeline/SKILL.md +118 -0
- package/.mindforge/skills/cli-design/SKILL.md +118 -0
- package/.mindforge/skills/code-generation-patterns/SKILL.md +92 -0
- package/.mindforge/skills/code-review-methodology/SKILL.md +180 -0
- package/.mindforge/skills/code-tour/SKILL.md +145 -0
- package/.mindforge/skills/codebase-onboarding/SKILL.md +95 -0
- package/.mindforge/skills/compliance-as-code/SKILL.md +195 -0
- package/.mindforge/skills/conflict-resolution/SKILL.md +87 -0
- package/.mindforge/skills/connection-pooling/SKILL.md +151 -0
- package/.mindforge/skills/container-security/SKILL.md +151 -0
- package/.mindforge/skills/context-engineering/SKILL.md +114 -0
- package/.mindforge/skills/contract-testing/SKILL.md +85 -0
- package/.mindforge/skills/cost-estimation/SKILL.md +82 -0
- package/.mindforge/skills/cqrs-event-sourcing/SKILL.md +95 -0
- package/.mindforge/skills/cross-platform-testing/SKILL.md +43 -0
- package/.mindforge/skills/data-governance/SKILL.md +42 -0
- package/.mindforge/skills/data-lakehouse/SKILL.md +42 -0
- package/.mindforge/skills/data-mesh/SKILL.md +42 -0
- package/.mindforge/skills/data-modeling/SKILL.md +107 -0
- package/.mindforge/skills/data-pipeline-design/SKILL.md +171 -0
- package/.mindforge/skills/data-privacy-engineering/SKILL.md +42 -0
- package/.mindforge/skills/database-performance/SKILL.md +174 -0
- package/.mindforge/skills/database-sharding-advanced/SKILL.md +206 -0
- package/.mindforge/skills/de-sloppify/SKILL.md +120 -0
- package/.mindforge/skills/defense-in-depth/SKILL.md +84 -0
- package/.mindforge/skills/delegation-patterns/SKILL.md +123 -0
- package/.mindforge/skills/dependency-management/SKILL.md +94 -0
- package/.mindforge/skills/deployment-workflow/SKILL.md +135 -0
- package/.mindforge/skills/design-system/SKILL.md +113 -0
- package/.mindforge/skills/developer-onboarding/SKILL.md +99 -0
- package/.mindforge/skills/developer-productivity-metrics/SKILL.md +59 -0
- package/.mindforge/skills/distributed-consensus/SKILL.md +141 -0
- package/.mindforge/skills/dmux-workflows/SKILL.md +141 -0
- package/.mindforge/skills/dns-architecture/SKILL.md +167 -0
- package/.mindforge/skills/ecommerce-architecture/SKILL.md +41 -0
- package/.mindforge/skills/edge-computing/SKILL.md +91 -0
- package/.mindforge/skills/edtech-platform/SKILL.md +41 -0
- package/.mindforge/skills/email-deliverability/SKILL.md +177 -0
- package/.mindforge/skills/embedding-systems/SKILL.md +55 -0
- package/.mindforge/skills/environment-management/SKILL.md +54 -0
- package/.mindforge/skills/error-handling-architecture/SKILL.md +118 -0
- package/.mindforge/skills/estimation-techniques/SKILL.md +113 -0
- package/.mindforge/skills/eval-harness/SKILL.md +180 -0
- package/.mindforge/skills/event-driven-architecture/SKILL.md +162 -0
- package/.mindforge/skills/experiment-design/SKILL.md +139 -0
- package/.mindforge/skills/experiment-platform/SKILL.md +43 -0
- package/.mindforge/skills/feature-engineering/SKILL.md +42 -0
- package/.mindforge/skills/feature-flag-management/SKILL.md +183 -0
- package/.mindforge/skills/fine-tuning-workflow/SKILL.md +189 -0
- package/.mindforge/skills/fintech-patterns/SKILL.md +41 -0
- package/.mindforge/skills/flutter-architecture/SKILL.md +42 -0
- package/.mindforge/skills/gaming-backend/SKILL.md +41 -0
- package/.mindforge/skills/git-workflow-design/SKILL.md +129 -0
- package/.mindforge/skills/graceful-degradation/SKILL.md +95 -0
- package/.mindforge/skills/graphql-patterns/SKILL.md +243 -0
- package/.mindforge/skills/guardrails-and-safety/SKILL.md +137 -0
- package/.mindforge/skills/healthcare-systems/SKILL.md +40 -0
- package/.mindforge/skills/hiring-engineering/SKILL.md +119 -0
- package/.mindforge/skills/human-in-the-loop-design/SKILL.md +234 -0
- package/.mindforge/skills/i18n-architecture/SKILL.md +147 -0
- package/.mindforge/skills/idempotency-patterns/SKILL.md +84 -0
- package/.mindforge/skills/incident-communication/SKILL.md +96 -0
- package/.mindforge/skills/incident-management/SKILL.md +97 -0
- package/.mindforge/skills/infrastructure-as-code/SKILL.md +98 -0
- package/.mindforge/skills/instinct-clustering/SKILL.md +190 -0
- package/.mindforge/skills/internal-developer-platform/SKILL.md +51 -0
- package/.mindforge/skills/iot-platform/SKILL.md +41 -0
- package/.mindforge/skills/k8s-deployment/SKILL.md +358 -0
- package/.mindforge/skills/knowledge-graphs/SKILL.md +56 -0
- package/.mindforge/skills/knowledge-sharing-systems/SKILL.md +112 -0
- package/.mindforge/skills/llm-cost-optimization/SKILL.md +198 -0
- package/.mindforge/skills/llm-orchestration/SKILL.md +56 -0
- package/.mindforge/skills/load-testing/SKILL.md +84 -0
- package/.mindforge/skills/logistics-optimization/SKILL.md +40 -0
- package/.mindforge/skills/market-researcher/SKILL.md +99 -0
- package/.mindforge/skills/marketplace-trust/SKILL.md +40 -0
- package/.mindforge/skills/mcp-server-patterns/SKILL.md +264 -0
- package/.mindforge/skills/media-streaming/SKILL.md +41 -0
- package/.mindforge/skills/meeting-architecture/SKILL.md +146 -0
- package/.mindforge/skills/mentoring-patterns/SKILL.md +77 -0
- package/.mindforge/skills/microservices-patterns/SKILL.md +83 -0
- package/.mindforge/skills/migration-platform/SKILL.md +61 -0
- package/.mindforge/skills/migration-strategies/SKILL.md +129 -0
- package/.mindforge/skills/ml-feature-store/SKILL.md +56 -0
- package/.mindforge/skills/ml-monitoring/SKILL.md +42 -0
- package/.mindforge/skills/mobile-performance/SKILL.md +44 -0
- package/.mindforge/skills/mobile-security/SKILL.md +45 -0
- package/.mindforge/skills/model-evaluation/SKILL.md +53 -0
- package/.mindforge/skills/monorepo-management/SKILL.md +100 -0
- package/.mindforge/skills/multi-tenancy-patterns/SKILL.md +145 -0
- package/.mindforge/skills/multi-turn-conversation-design/SKILL.md +206 -0
- package/.mindforge/skills/multimodal-ai/SKILL.md +51 -0
- package/.mindforge/skills/mutation-testing/SKILL.md +97 -0
- package/.mindforge/skills/notification-system-design/SKILL.md +168 -0
- package/.mindforge/skills/observability-stack/SKILL.md +136 -0
- package/.mindforge/skills/offline-first-design/SKILL.md +43 -0
- package/.mindforge/skills/on-call-design/SKILL.md +111 -0
- package/.mindforge/skills/pagination-patterns/SKILL.md +230 -0
- package/.mindforge/skills/payment-integration/SKILL.md +176 -0
- package/.mindforge/skills/performance-reviews/SKILL.md +140 -0
- package/.mindforge/skills/platform-observability/SKILL.md +58 -0
- package/.mindforge/skills/platform-reliability/SKILL.md +52 -0
- package/.mindforge/skills/post-incident-learning/SKILL.md +96 -0
- package/.mindforge/skills/product-manager/SKILL.md +104 -0
- package/.mindforge/skills/progressive-web-app/SKILL.md +44 -0
- package/.mindforge/skills/prompt-engineering/SKILL.md +94 -0
- package/.mindforge/skills/proofreader/SKILL.md +158 -0
- package/.mindforge/skills/push-notification-architecture/SKILL.md +45 -0
- package/.mindforge/skills/python-performance/SKILL.md +183 -0
- package/.mindforge/skills/quality-audit/SKILL.md +171 -0
- package/.mindforge/skills/queue-design/SKILL.md +85 -0
- package/.mindforge/skills/rag-architecture/SKILL.md +176 -0
- package/.mindforge/skills/rate-limiting-design/SKILL.md +94 -0
- package/.mindforge/skills/react-native-patterns/SKILL.md +42 -0
- package/.mindforge/skills/react-performance/SKILL.md +229 -0
- package/.mindforge/skills/real-time-analytics/SKILL.md +42 -0
- package/.mindforge/skills/real-time-sync/SKILL.md +83 -0
- package/.mindforge/skills/responsive-native/SKILL.md +44 -0
- package/.mindforge/skills/responsive-patterns/SKILL.md +141 -0
- package/.mindforge/skills/rfc-pipeline/SKILL.md +114 -0
- package/.mindforge/skills/saas-multi-tenant/SKILL.md +41 -0
- package/.mindforge/skills/santa-method/SKILL.md +134 -0
- package/.mindforge/skills/search-implementation/SKILL.md +98 -0
- package/.mindforge/skills/secrets-platform/SKILL.md +56 -0
- package/.mindforge/skills/secrets-rotation/SKILL.md +173 -0
- package/.mindforge/skills/self-serve-infrastructure/SKILL.md +51 -0
- package/.mindforge/skills/serverless-patterns/SKILL.md +119 -0
- package/.mindforge/skills/skill-creator-meta/SKILL.md +146 -0
- package/.mindforge/skills/sprint-retrospective-facilitation/SKILL.md +112 -0
- package/.mindforge/skills/stakeholder-communication/SKILL.md +85 -0
- package/.mindforge/skills/state-management/SKILL.md +104 -0
- package/.mindforge/skills/stream-processing/SKILL.md +43 -0
- package/.mindforge/skills/streaming-architecture/SKILL.md +81 -0
- package/.mindforge/skills/supply-chain-security/SKILL.md +145 -0
- package/.mindforge/skills/synthetic-data-generation/SKILL.md +52 -0
- package/.mindforge/skills/system-design/SKILL.md +88 -0
- package/.mindforge/skills/team-topology-design/SKILL.md +107 -0
- package/.mindforge/skills/technical-debt-management/SKILL.md +86 -0
- package/.mindforge/skills/technical-interview-design/SKILL.md +98 -0
- package/.mindforge/skills/technical-leadership/SKILL.md +75 -0
- package/.mindforge/skills/technical-writing/SKILL.md +237 -0
- package/.mindforge/skills/technology-radar/SKILL.md +88 -0
- package/.mindforge/skills/testing-anti-patterns/SKILL.md +288 -0
- package/.mindforge/skills/tool-design/SKILL.md +138 -0
- package/.mindforge/skills/typescript-advanced/SKILL.md +198 -0
- package/.mindforge/skills/using-git-worktrees/SKILL.md +139 -0
- package/.mindforge/skills/verification-loop/SKILL.md +13 -1
- package/.mindforge/skills/vibe-security/SKILL.md +165 -0
- package/.mindforge/skills/visual-regression-testing/SKILL.md +97 -0
- package/.mindforge/skills/websocket-patterns/SKILL.md +203 -0
- package/.mindforge/skills/writing-plans/SKILL.md +170 -0
- package/.mindforge/skills/writing-skills/SKILL.md +216 -0
- package/.mindforge/skills/zero-trust-architecture/SKILL.md +166 -0
- package/CHANGELOG.md +240 -0
- package/MINDFORGE.md +4 -4
- package/README.md +49 -4
- package/RELEASENOTES.md +80 -0
- package/SECURITY.md +20 -8
- package/bin/autonomous/audit-writer.js +13 -0
- package/bin/autonomous/auto-runner.js +74 -16
- package/bin/autonomous/context-refactorer.js +26 -11
- package/bin/autonomous/state-manager.js +62 -6
- package/bin/autonomous/stuck-monitor.js +46 -7
- package/bin/autonomous/wave-executor.js +66 -25
- package/bin/dashboard/api-router.js +43 -0
- package/bin/dashboard/metrics-aggregator.js +28 -1
- package/bin/dashboard/server.js +67 -4
- package/bin/dashboard/sse-bridge.js +4 -4
- package/bin/engine/feedback-loop.js +8 -0
- package/bin/engine/intelligence-interlock.js +32 -15
- package/bin/engine/logic-drift-detector.js +2 -1
- package/bin/engine/nexus-tracer.js +3 -2
- package/bin/engine/remediation-engine.js +155 -32
- package/bin/engine/self-corrective-synthesizer.js +84 -10
- package/bin/engine/sre-manager.js +12 -4
- package/bin/engine/temporal-hub.js +131 -34
- package/bin/governance/approve.js +41 -5
- package/bin/governance/impact-analyzer.js +28 -0
- package/bin/governance/policy-engine.js +10 -3
- package/bin/governance/quantum-crypto.js +32 -19
- package/bin/governance/rbac-manager.js +74 -2
- package/bin/governance/ztai-manager.js +49 -7
- package/bin/hindsight-injector.js +3 -3
- package/bin/memory/eis-client.js +71 -34
- package/bin/memory/embedding-engine.js +61 -0
- package/bin/memory/knowledge-graph.js +58 -5
- package/bin/memory/knowledge-indexer.js +53 -6
- package/bin/memory/knowledge-store.js +22 -0
- package/bin/migrations/10.7.0-to-11.0.0.js +110 -0
- package/bin/migrations/schema-versions.js +13 -0
- package/bin/models/anthropic-provider.js +45 -0
- package/bin/models/cloud-broker.js +68 -20
- package/bin/models/gemini-provider.js +51 -0
- package/bin/models/model-client.js +20 -0
- package/bin/models/model-router.js +28 -8
- package/bin/models/openai-provider.js +44 -0
- package/bin/utils/file-io.js +63 -1
- package/bin/utils/index.js +58 -0
- package/docs/getting-started.md +1 -1
- package/docs/user-guide.md +2 -2
- package/package.json +2 -2
- package/.mindforge/personas/data-privacy-engineer.md +0 -187
|
@@ -71,6 +71,19 @@ const SCHEMA_HISTORY = [
|
|
|
71
71
|
'Plugin API version upgraded to 2.0.0',
|
|
72
72
|
],
|
|
73
73
|
},
|
|
74
|
+
{
|
|
75
|
+
version: '11.0.0',
|
|
76
|
+
date: '2026-05-28',
|
|
77
|
+
description: 'v11.0.0 - Persona Expansion: temporal config, rate limiting, wave execution, audit archival',
|
|
78
|
+
handoff_fields_added: [],
|
|
79
|
+
handoff_fields_removed: [],
|
|
80
|
+
audit_fields_added: [],
|
|
81
|
+
breaking: [
|
|
82
|
+
'config.json gains temporal, rate_limiting, session, wave_execution sections',
|
|
83
|
+
'AUDIT.jsonl auto-archived if exceeding 5000 lines',
|
|
84
|
+
'MINDFORGE.md VERSION format drops suffix (was X.Y.Z-SUFFIX, now X.Y.Z)',
|
|
85
|
+
],
|
|
86
|
+
},
|
|
74
87
|
];
|
|
75
88
|
|
|
76
89
|
module.exports = { SCHEMA_HISTORY };
|
|
@@ -72,6 +72,51 @@ class AnthropicProvider {
|
|
|
72
72
|
req.end();
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
async streamComplete(messages, options = {}) {
|
|
77
|
+
const model = options.model || 'claude-sonnet-4-6';
|
|
78
|
+
const maxTokens = options.maxTokens || 4096;
|
|
79
|
+
|
|
80
|
+
const data = JSON.stringify({
|
|
81
|
+
model,
|
|
82
|
+
messages,
|
|
83
|
+
max_tokens: maxTokens,
|
|
84
|
+
stream: true,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return new Promise((resolve, reject) => {
|
|
88
|
+
const req = https.request({
|
|
89
|
+
hostname: 'api.anthropic.com',
|
|
90
|
+
path: '/v1/messages',
|
|
91
|
+
method: 'POST',
|
|
92
|
+
headers: {
|
|
93
|
+
'Content-Type': 'application/json',
|
|
94
|
+
'x-api-key': this.apiKey,
|
|
95
|
+
'anthropic-version': '2023-06-01',
|
|
96
|
+
'Content-Length': Buffer.byteLength(data),
|
|
97
|
+
},
|
|
98
|
+
timeout: 300_000,
|
|
99
|
+
}, res => {
|
|
100
|
+
if (res.statusCode !== 200) {
|
|
101
|
+
let body = '';
|
|
102
|
+
res.on('data', chunk => body += chunk);
|
|
103
|
+
res.on('end', () => {
|
|
104
|
+
reject(new Error(`Anthropic streaming failed: ${res.statusCode}`));
|
|
105
|
+
});
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
resolve(res);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
req.on('error', reject);
|
|
112
|
+
req.on('timeout', () => {
|
|
113
|
+
req.destroy();
|
|
114
|
+
reject(new Error('Anthropic stream timeout'));
|
|
115
|
+
});
|
|
116
|
+
req.write(data);
|
|
117
|
+
req.end();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
75
120
|
}
|
|
76
121
|
|
|
77
122
|
module.exports = AnthropicProvider;
|
|
@@ -7,17 +7,37 @@
|
|
|
7
7
|
const fs = require('fs');
|
|
8
8
|
const path = require('path');
|
|
9
9
|
|
|
10
|
+
// Per-provider latency ring buffer (last 10 calls)
|
|
11
|
+
const latencyHistory = new Map();
|
|
12
|
+
|
|
13
|
+
function recordLatency(provider, durationMs) {
|
|
14
|
+
if (!latencyHistory.has(provider)) {
|
|
15
|
+
latencyHistory.set(provider, []);
|
|
16
|
+
}
|
|
17
|
+
const history = latencyHistory.get(provider);
|
|
18
|
+
history.push(durationMs);
|
|
19
|
+
if (history.length > 10) history.shift();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getP95Latency(provider) {
|
|
23
|
+
const history = latencyHistory.get(provider);
|
|
24
|
+
if (!history || history.length === 0) return 500;
|
|
25
|
+
const sorted = [...history].sort((a, b) => a - b);
|
|
26
|
+
const idx = Math.ceil(sorted.length * 0.95) - 1;
|
|
27
|
+
return sorted[Math.min(idx, sorted.length - 1)];
|
|
28
|
+
}
|
|
29
|
+
|
|
10
30
|
class CloudBroker {
|
|
11
31
|
constructor(config = {}) {
|
|
12
32
|
this.providers = config.providers || ['anthropic', 'google', 'aws', 'azure'];
|
|
13
33
|
this.statsPath = config.statsPath || path.join(__dirname, 'performance-stats.json');
|
|
14
|
-
this.blacklist = new Map();
|
|
15
|
-
this.failureWindow = new Map();
|
|
34
|
+
this.blacklist = new Map();
|
|
35
|
+
this.failureWindow = new Map();
|
|
16
36
|
this.state = {
|
|
17
|
-
'anthropic': {
|
|
18
|
-
'google': {
|
|
19
|
-
'aws': {
|
|
20
|
-
'azure': {
|
|
37
|
+
'anthropic': { costMultiplier: 1.0, healthy: true },
|
|
38
|
+
'google': { costMultiplier: 0.85, healthy: true },
|
|
39
|
+
'aws': { costMultiplier: 0.95, healthy: true },
|
|
40
|
+
'azure': { costMultiplier: 1.1, healthy: true }
|
|
21
41
|
};
|
|
22
42
|
this.reloadStats();
|
|
23
43
|
}
|
|
@@ -71,21 +91,20 @@ class CloudBroker {
|
|
|
71
91
|
return true;
|
|
72
92
|
})
|
|
73
93
|
.map(([id, data]) => {
|
|
74
|
-
// Calculate Success Probability for this task
|
|
75
94
|
const stats = this.performanceStats[id]?.[taskType] || { success: 1, failure: 0 };
|
|
76
95
|
const totalTasks = stats.success + stats.failure;
|
|
77
96
|
const successProb = totalTasks > 0 ? (stats.success / totalTasks) : 0.5;
|
|
78
97
|
|
|
79
|
-
// Score Calculation (The "Affinity" Algorithm)
|
|
80
98
|
const latencyWeight = 0.2;
|
|
81
99
|
const costWeight = 0.3;
|
|
82
|
-
const affinityWeight = 0.5;
|
|
100
|
+
const affinityWeight = 0.5;
|
|
83
101
|
|
|
84
|
-
const
|
|
85
|
-
|
|
102
|
+
const providerLatency = getP95Latency(id);
|
|
103
|
+
const score = (providerLatency * latencyWeight) +
|
|
104
|
+
(data.costMultiplier * 1000 * costWeight) +
|
|
86
105
|
((1.0 - successProb) * 2000 * affinityWeight);
|
|
87
106
|
|
|
88
|
-
return { id, score, successProb: successProb.toFixed(2) };
|
|
107
|
+
return { id, score, successProb: successProb.toFixed(2), p95: providerLatency };
|
|
89
108
|
});
|
|
90
109
|
|
|
91
110
|
scored.sort((a, b) => a.score - b.score);
|
|
@@ -110,7 +129,7 @@ class CloudBroker {
|
|
|
110
129
|
|
|
111
130
|
const fallback = Object.entries(this.state)
|
|
112
131
|
.filter(([id, data]) => id !== failedProvider && data.healthy)
|
|
113
|
-
.sort((a, b) => a[
|
|
132
|
+
.sort((a, b) => getP95Latency(a[0]) - getP95Latency(b[0]))[0];
|
|
114
133
|
|
|
115
134
|
return fallback ? fallback[0] : 'google'; // Default fallback
|
|
116
135
|
}
|
|
@@ -130,33 +149,62 @@ class CloudBroker {
|
|
|
130
149
|
return mappings[provider]?.[modelGroup] || mappings[provider]?.['sonnet'];
|
|
131
150
|
}
|
|
132
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Removes failure entries whose sliding window (5 min) has expired.
|
|
154
|
+
*/
|
|
155
|
+
_pruneStaleFailures() {
|
|
156
|
+
const now = Date.now();
|
|
157
|
+
const WINDOW_MS = 5 * 60 * 1000;
|
|
158
|
+
|
|
159
|
+
for (const [key, entry] of this.failureWindow.entries()) {
|
|
160
|
+
if (now - entry.firstFailureAt > WINDOW_MS) {
|
|
161
|
+
this.failureWindow.delete(key);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
133
166
|
/**
|
|
134
167
|
* Records a task failure and manages the circuit breaker.
|
|
135
168
|
*/
|
|
136
169
|
recordFailure(provider, taskType = 'default') {
|
|
137
|
-
|
|
138
|
-
const failures = (this.failureWindow.get(key) || 0) + 1;
|
|
139
|
-
this.failureWindow.set(key, failures);
|
|
170
|
+
this._pruneStaleFailures();
|
|
140
171
|
|
|
141
|
-
|
|
142
|
-
|
|
172
|
+
const key = `${provider}:${taskType}`;
|
|
173
|
+
const existing = this.failureWindow.get(key);
|
|
174
|
+
const entry = existing
|
|
175
|
+
? { count: existing.count + 1, firstFailureAt: existing.firstFailureAt }
|
|
176
|
+
: { count: 1, firstFailureAt: Date.now() };
|
|
177
|
+
this.failureWindow.set(key, entry);
|
|
178
|
+
|
|
179
|
+
if (entry.count >= 3) {
|
|
180
|
+
const expiry = new Date(Date.now() + 10 * 60 * 1000);
|
|
143
181
|
this.blacklist.set(provider, expiry);
|
|
144
182
|
console.warn(`[MCA-CIRCUIT-OPEN] Provider '${provider}' blacklisted for 10 min due to consecutive failures on '${taskType}'.`);
|
|
145
|
-
this.failureWindow.
|
|
183
|
+
this.failureWindow.delete(key);
|
|
146
184
|
}
|
|
147
185
|
}
|
|
148
186
|
|
|
149
187
|
/**
|
|
150
188
|
* Hardening: Simulate provider failures to verify Fallback Protocol.
|
|
151
189
|
*/
|
|
190
|
+
recordLatency(provider, durationMs) {
|
|
191
|
+
recordLatency(provider, durationMs);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
getP95Latency(provider) {
|
|
195
|
+
return getP95Latency(provider);
|
|
196
|
+
}
|
|
197
|
+
|
|
152
198
|
startChaosMode() {
|
|
153
199
|
console.log('[ENTERPRISE-RESILIENCE] CloudBroker Chaos Mode ACTIVE. Simulating jitter and provider dropouts...');
|
|
154
200
|
setInterval(() => {
|
|
155
201
|
const providers = Object.keys(this.state);
|
|
156
202
|
const randomProvider = providers[Math.floor(Math.random() * providers.length)];
|
|
157
|
-
|
|
203
|
+
recordLatency(randomProvider, Math.random() > 0.7 ? 5000 : 100);
|
|
158
204
|
}, 10000);
|
|
159
205
|
}
|
|
160
206
|
}
|
|
161
207
|
|
|
162
208
|
module.exports = CloudBroker;
|
|
209
|
+
module.exports.recordLatency = recordLatency;
|
|
210
|
+
module.exports.getP95Latency = getP95Latency;
|
|
@@ -74,6 +74,57 @@ class GeminiProvider {
|
|
|
74
74
|
req.end();
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
async streamComplete(messages, options = {}) {
|
|
79
|
+
const model = options.model || 'gemini-2.5-pro';
|
|
80
|
+
const maxTokens = options.maxTokens || 8192;
|
|
81
|
+
|
|
82
|
+
const contents = messages.map(msg => ({
|
|
83
|
+
role: msg.role === 'assistant' ? 'model' : 'user',
|
|
84
|
+
parts: [{ text: msg.content }],
|
|
85
|
+
}));
|
|
86
|
+
|
|
87
|
+
const data = JSON.stringify({
|
|
88
|
+
contents,
|
|
89
|
+
generationConfig: {
|
|
90
|
+
maxOutputTokens: maxTokens,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const modelId = model.startsWith('models/') ? model : `models/${model}`;
|
|
95
|
+
|
|
96
|
+
return new Promise((resolve, reject) => {
|
|
97
|
+
const req = https.request({
|
|
98
|
+
hostname: 'generativelanguage.googleapis.com',
|
|
99
|
+
path: `/v1beta/${modelId}:streamGenerateContent?alt=sse`,
|
|
100
|
+
method: 'POST',
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': 'application/json',
|
|
103
|
+
'x-goog-api-key': this.apiKey,
|
|
104
|
+
'Content-Length': Buffer.byteLength(data),
|
|
105
|
+
},
|
|
106
|
+
timeout: 300_000,
|
|
107
|
+
}, res => {
|
|
108
|
+
if (res.statusCode !== 200) {
|
|
109
|
+
let body = '';
|
|
110
|
+
res.on('data', chunk => body += chunk);
|
|
111
|
+
res.on('end', () => {
|
|
112
|
+
reject(new Error(`Gemini streaming failed: ${res.statusCode}`));
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
resolve(res);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
req.on('error', reject);
|
|
120
|
+
req.on('timeout', () => {
|
|
121
|
+
req.destroy();
|
|
122
|
+
reject(new Error('Gemini stream timeout'));
|
|
123
|
+
});
|
|
124
|
+
req.write(data);
|
|
125
|
+
req.end();
|
|
126
|
+
});
|
|
127
|
+
}
|
|
77
128
|
}
|
|
78
129
|
|
|
79
130
|
module.exports = GeminiProvider;
|
|
@@ -82,6 +82,26 @@ class ModelClient {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
static async streamComplete(params) {
|
|
86
|
+
const {
|
|
87
|
+
persona = 'developer',
|
|
88
|
+
tier = 1,
|
|
89
|
+
messages,
|
|
90
|
+
maxTokens,
|
|
91
|
+
taskName = 'unknown',
|
|
92
|
+
} = params;
|
|
93
|
+
|
|
94
|
+
const routing = Router.route(persona, tier);
|
|
95
|
+
const modelId = routing.model;
|
|
96
|
+
const provider = this._getProvider(modelId);
|
|
97
|
+
|
|
98
|
+
if (!provider || !provider.streamComplete) {
|
|
99
|
+
throw new Error(`Streaming not supported for model: ${modelId}`);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return provider.streamComplete(messages, { ...params, model: modelId });
|
|
103
|
+
}
|
|
104
|
+
|
|
85
105
|
static _getProvider(modelId) {
|
|
86
106
|
if (modelId.startsWith('claude') || modelId.startsWith('anthropic.claude')) {
|
|
87
107
|
if (!process.env.ANTHROPIC_API_KEY) return null;
|
|
@@ -36,15 +36,13 @@ const PERSONA_MAP = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
let _settingsCache = null;
|
|
39
|
+
let _settingsMtime = 0;
|
|
40
|
+
const CACHE_CHECK_INTERVAL_MS = 60000;
|
|
41
|
+
let _lastCacheCheck = 0;
|
|
39
42
|
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
const configPath = path.join(process.cwd(), 'MINDFORGE.md');
|
|
43
|
-
if (!fs.existsSync(configPath)) return DEFAULTS;
|
|
44
|
-
|
|
45
|
-
const content = fs.readFileSync(configPath, 'utf8');
|
|
43
|
+
function parseSettings(filePath) {
|
|
44
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
46
45
|
const settings = { ...DEFAULTS };
|
|
47
|
-
|
|
48
46
|
const lines = content.split('\n');
|
|
49
47
|
for (const line of lines) {
|
|
50
48
|
const match = line.match(/^([A-Z0-9_]+)=(.*)$/);
|
|
@@ -52,10 +50,30 @@ function readMindforgeSettings() {
|
|
|
52
50
|
settings[match[1]] = match[2].trim();
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
|
-
_settingsCache = settings;
|
|
56
53
|
return settings;
|
|
57
54
|
}
|
|
58
55
|
|
|
56
|
+
function readMindforgeSettings() {
|
|
57
|
+
const now = Date.now();
|
|
58
|
+
if (now - _lastCacheCheck < CACHE_CHECK_INTERVAL_MS && _settingsCache) {
|
|
59
|
+
return _settingsCache;
|
|
60
|
+
}
|
|
61
|
+
_lastCacheCheck = now;
|
|
62
|
+
|
|
63
|
+
const configPath = path.join(process.cwd(), 'MINDFORGE.md');
|
|
64
|
+
try {
|
|
65
|
+
const stat = fs.statSync(configPath);
|
|
66
|
+
if (stat.mtimeMs !== _settingsMtime) {
|
|
67
|
+
_settingsMtime = stat.mtimeMs;
|
|
68
|
+
_settingsCache = parseSettings(configPath);
|
|
69
|
+
}
|
|
70
|
+
} catch {
|
|
71
|
+
if (!_settingsCache) _settingsCache = { ...DEFAULTS };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return _settingsCache;
|
|
75
|
+
}
|
|
76
|
+
|
|
59
77
|
function route(persona = 'developer', tier = 1) {
|
|
60
78
|
const settings = readMindforgeSettings();
|
|
61
79
|
|
|
@@ -105,6 +123,8 @@ function getModel(settingKey) {
|
|
|
105
123
|
|
|
106
124
|
function clearCache() {
|
|
107
125
|
_settingsCache = null;
|
|
126
|
+
_settingsMtime = 0;
|
|
127
|
+
_lastCacheCheck = 0;
|
|
108
128
|
}
|
|
109
129
|
|
|
110
130
|
function getAllSettings() {
|
|
@@ -73,6 +73,50 @@ class OpenAIProvider {
|
|
|
73
73
|
req.end();
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
+
|
|
77
|
+
async streamComplete(messages, options = {}) {
|
|
78
|
+
const model = options.model || 'gpt-4o';
|
|
79
|
+
const maxTokens = options.maxTokens || 4096;
|
|
80
|
+
|
|
81
|
+
const data = JSON.stringify({
|
|
82
|
+
model,
|
|
83
|
+
messages,
|
|
84
|
+
max_tokens: maxTokens,
|
|
85
|
+
stream: true,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
return new Promise((resolve, reject) => {
|
|
89
|
+
const req = https.request({
|
|
90
|
+
hostname: 'api.openai.com',
|
|
91
|
+
path: '/v1/chat/completions',
|
|
92
|
+
method: 'POST',
|
|
93
|
+
headers: {
|
|
94
|
+
'Content-Type': 'application/json',
|
|
95
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
96
|
+
'Content-Length': Buffer.byteLength(data),
|
|
97
|
+
},
|
|
98
|
+
timeout: 300_000,
|
|
99
|
+
}, res => {
|
|
100
|
+
if (res.statusCode !== 200) {
|
|
101
|
+
let body = '';
|
|
102
|
+
res.on('data', chunk => body += chunk);
|
|
103
|
+
res.on('end', () => {
|
|
104
|
+
reject(new Error(`OpenAI streaming failed: ${res.statusCode}`));
|
|
105
|
+
});
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
resolve(res);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
req.on('error', reject);
|
|
112
|
+
req.on('timeout', () => {
|
|
113
|
+
req.destroy();
|
|
114
|
+
reject(new Error('OpenAI stream timeout'));
|
|
115
|
+
});
|
|
116
|
+
req.write(data);
|
|
117
|
+
req.end();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
76
120
|
}
|
|
77
121
|
|
|
78
122
|
module.exports = OpenAIProvider;
|
package/bin/utils/file-io.js
CHANGED
|
@@ -4,6 +4,7 @@ const fs = require('fs');
|
|
|
4
4
|
const fsp = require('fs/promises');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const crypto = require('crypto');
|
|
7
|
+
const zlib = require('zlib');
|
|
7
8
|
|
|
8
9
|
class AuditWriter {
|
|
9
10
|
constructor(filePath) {
|
|
@@ -99,4 +100,65 @@ function readJSONSync(filePath) {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
|
|
103
|
+
function atomicWriteJSON(filePath, data) {
|
|
104
|
+
const tmpPath = filePath + '.tmp.' + process.pid;
|
|
105
|
+
const content = JSON.stringify(data, null, 2) + '\n';
|
|
106
|
+
const fd = fs.openSync(tmpPath, 'w');
|
|
107
|
+
fs.writeSync(fd, content);
|
|
108
|
+
fs.fsyncSync(fd);
|
|
109
|
+
fs.closeSync(fd);
|
|
110
|
+
fs.renameSync(tmpPath, filePath);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async function atomicWriteJSONAsync(filePath, data) {
|
|
114
|
+
const tmpPath = filePath + '.tmp.' + process.pid;
|
|
115
|
+
const content = JSON.stringify(data, null, 2) + '\n';
|
|
116
|
+
const fh = await fsp.open(tmpPath, 'w');
|
|
117
|
+
await fh.write(content);
|
|
118
|
+
await fh.sync();
|
|
119
|
+
await fh.close();
|
|
120
|
+
await fsp.rename(tmpPath, filePath);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
class AuditRotator {
|
|
124
|
+
constructor(options = {}) {
|
|
125
|
+
this.maxLines = options.maxLines || 5000;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
shouldRotate(filePath) {
|
|
129
|
+
if (!fs.existsSync(filePath)) return false;
|
|
130
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
131
|
+
const lineCount = content.split('\n').filter(l => l.trim()).length;
|
|
132
|
+
return lineCount >= this.maxLines;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
rotate(filePath, archiveDir) {
|
|
136
|
+
const dir = archiveDir || path.join(path.dirname(filePath), '..', 'audit-archive');
|
|
137
|
+
if (!fs.existsSync(dir)) {
|
|
138
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
142
|
+
const baseName = path.basename(filePath, path.extname(filePath));
|
|
143
|
+
const archiveName = `${baseName}-${timestamp}.jsonl.gz`;
|
|
144
|
+
const archivePath = path.join(dir, archiveName);
|
|
145
|
+
|
|
146
|
+
// Crash-safe: write archive FIRST, then truncate source
|
|
147
|
+
const content = fs.readFileSync(filePath);
|
|
148
|
+
const compressed = zlib.gzipSync(content);
|
|
149
|
+
fs.writeFileSync(archivePath, compressed);
|
|
150
|
+
|
|
151
|
+
const lines = content.toString('utf8').split('\n').filter(l => l.trim());
|
|
152
|
+
const carryover = lines.slice(-100).join('\n') + '\n';
|
|
153
|
+
const tmpPath = filePath + '.tmp.' + process.pid;
|
|
154
|
+
const fd = fs.openSync(tmpPath, 'w');
|
|
155
|
+
fs.writeSync(fd, carryover);
|
|
156
|
+
fs.fsyncSync(fd);
|
|
157
|
+
fs.closeSync(fd);
|
|
158
|
+
fs.renameSync(tmpPath, filePath);
|
|
159
|
+
|
|
160
|
+
return archivePath;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
module.exports = { AuditWriter, AuditRotator, readJSON, writeJSON, readJSONL, readJSONSync, atomicWriteJSON, atomicWriteJSONAsync };
|
package/bin/utils/index.js
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
|
|
3
|
+
class LRUMap {
|
|
4
|
+
constructor(maxSize, options = {}) {
|
|
5
|
+
this._max = maxSize;
|
|
6
|
+
this._onEvict = options.onEvict || null;
|
|
7
|
+
this._map = new Map();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
get(key) {
|
|
11
|
+
if (!this._map.has(key)) return undefined;
|
|
12
|
+
const value = this._map.get(key);
|
|
13
|
+
this._map.delete(key);
|
|
14
|
+
this._map.set(key, value);
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
set(key, value) {
|
|
19
|
+
if (this._map.has(key)) {
|
|
20
|
+
this._map.delete(key);
|
|
21
|
+
} else if (this._map.size >= this._max) {
|
|
22
|
+
const oldest = this._map.keys().next().value;
|
|
23
|
+
const oldestValue = this._map.get(oldest);
|
|
24
|
+
this._map.delete(oldest);
|
|
25
|
+
if (this._onEvict) this._onEvict(oldest, oldestValue);
|
|
26
|
+
}
|
|
27
|
+
this._map.set(key, value);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
has(key) {
|
|
31
|
+
return this._map.has(key);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
delete(key) {
|
|
35
|
+
return this._map.delete(key);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
clear() {
|
|
39
|
+
this._map.clear();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get size() {
|
|
43
|
+
return this._map.size;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
keys() {
|
|
47
|
+
return this._map.keys();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
values() {
|
|
51
|
+
return this._map.values();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
entries() {
|
|
55
|
+
return this._map.entries();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
2
59
|
module.exports = {
|
|
60
|
+
LRUMap,
|
|
3
61
|
...require('./paths'),
|
|
4
62
|
...require('./file-io'),
|
|
5
63
|
...require('./errors')
|
package/docs/getting-started.md
CHANGED
package/docs/user-guide.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# MindForge User Guide (
|
|
1
|
+
# MindForge User Guide (v11.0.0)
|
|
2
2
|
|
|
3
3
|
This guide gets you from install to productive, with the minimum needed to run MindForge in a real project.
|
|
4
4
|
|
|
@@ -136,7 +136,7 @@ Observe your agent waves, token spend, and milestone progress in real-time.
|
|
|
136
136
|
|
|
137
137
|
The dashboard provides a premium web interface at `http://localhost:7339`.
|
|
138
138
|
|
|
139
|
-
> **Authentication (
|
|
139
|
+
> **Authentication (v11.0.0+):** The dashboard now requires a bearer token for access. The token is printed to the console at startup. Pass it in the `Authorization` header or use the login prompt in the browser UI.
|
|
140
140
|
|
|
141
141
|
---
|
|
142
142
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mindforge-cc",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "MindForge
|
|
3
|
+
"version": "11.0.0",
|
|
4
|
+
"description": "MindForge \u2014 Sovereign Agentic Intelligence Framework. Sovereign Stability: Production-Hardened Agentic Intelligence (v11)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mindforge-cc": "bin/install.js",
|
|
7
7
|
"mindforge": "bin/mindforge-cli.js"
|