oneie 3.5.0 โ 3.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/agent-director.md +902 -22
- package/.claude/agents/agent-onboard-example-output.md +600 -0
- package/.claude/agents/agent-onboard.md +576 -0
- package/.claude/commands/ONBOARDING_ENHANCEMENT_SUMMARY.md +266 -0
- package/.claude/commands/deploy.md +77 -150
- package/.claude/commands/one.md +375 -5
- package/.claude/commands/release.md +64 -3
- package/.mcp.json +57 -0
- package/CLAUDE.md +55 -69
- package/CREATE-WEBSITE.md +442 -0
- package/SECURITY.md +31 -0
- package/TESTING-ONBOARDING.md +185 -0
- package/dist/commands/create-website.d.ts +19 -0
- package/dist/commands/create-website.d.ts.map +1 -0
- package/dist/commands/create-website.js +231 -0
- package/dist/commands/create-website.js.map +1 -0
- package/dist/commands/init.d.ts +5 -6
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +213 -103
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/utils/installation-setup.d.ts +24 -1
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +85 -1
- package/dist/utils/installation-setup.js.map +1 -1
- package/dist/utils/launch-claude.d.ts +6 -0
- package/dist/utils/launch-claude.d.ts.map +1 -0
- package/dist/utils/launch-claude.js +51 -0
- package/dist/utils/launch-claude.js.map +1 -0
- package/dist/utils/validation.d.ts +48 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +73 -0
- package/dist/utils/validation.js.map +1 -0
- package/folders.yaml +1 -1
- package/one/.obsidian/core-plugins.json +33 -0
- package/one/.obsidian/workspace.json +20 -20
- package/one/connections/workflow-onboarding.md +683 -0
- package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +354 -0
- package/one/events/CRITICAL-FIXES-COMPLETE.md +504 -0
- package/one/events/DEPLOYMENT.md +178 -0
- package/one/events/ECOMMERCE-DEMO-PLAN.md +225 -0
- package/one/events/ECOMMERCE-LIVE-DEMO.md +363 -0
- package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +735 -0
- package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +923 -0
- package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +223 -0
- package/one/events/HANDOFF.md +313 -0
- package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +503 -0
- package/one/events/IMPLEMENTATION_SUMMARY.md +529 -0
- package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +666 -0
- package/one/events/LANDING-PAGE-IMPLEMENTATION.md +642 -0
- package/one/events/LANDING-PAGE-QUICKSTART.md +407 -0
- package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +1627 -0
- package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +573 -0
- package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +398 -0
- package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +525 -0
- package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +455 -0
- package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +486 -0
- package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +203 -0
- package/one/events/SECURITY-AUDIT-FIXES.md +376 -0
- package/one/events/SECURITY-SCAN-COMPLETE.md +281 -0
- package/one/events/SHOP-BUILD-STATUS.md +114 -0
- package/one/events/SHOP-PREMIUM-UPDATE.md +149 -0
- package/one/events/SITE-WIDE-GRADIENT-FIX.md +299 -0
- package/one/events/STORE-PRODUCTION-READY-STATUS.md +359 -0
- package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +429 -0
- package/one/events/agent-director-enhancement-summary.md +386 -0
- package/one/events/agent-onboard-implementation-summary.md +457 -0
- package/one/events/clean-agent-ontology-cleanup-report.md +353 -0
- package/one/events/landing-page-generator.md +458 -0
- package/one/events/onboarding-implementation-complete.md +505 -0
- package/one/events/release.md +254 -0
- package/one/events/separate-implementation-status.md +537 -0
- package/one/knowledge/100-inference-quick-reference.md +431 -0
- package/one/knowledge/agent-onboard-usage.md +612 -0
- package/one/knowledge/cli-claude-handoff.md +718 -0
- package/one/knowledge/ontology-blog.yaml +31 -0
- package/one/knowledge/ontology-cheatsheet.md +591 -0
- package/one/knowledge/ontology-community.yaml +42 -0
- package/one/knowledge/ontology-core-universal.md +722 -0
- package/one/knowledge/ontology-core.yaml +50 -0
- package/one/knowledge/ontology-courses.yaml +53 -0
- package/one/knowledge/ontology-creator.md +376 -0
- package/one/knowledge/ontology-developer-guide.md +789 -0
- package/one/knowledge/ontology-education.md +920 -0
- package/one/knowledge/ontology-index.md +354 -0
- package/one/knowledge/ontology-migration-guide.md +811 -0
- package/one/knowledge/ontology-minimal.yaml +1 -1
- package/one/knowledge/ontology-portfolio.yaml +31 -0
- package/one/knowledge/ontology-quickstart.md +576 -0
- package/one/knowledge/ontology-shop.yaml +121 -0
- package/one/knowledge/ontology-tokens.yaml +32 -0
- package/one/knowledge/ontology-tutorial.md +434 -0
- package/one/knowledge/ontology-video-script.md +890 -0
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +467 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +408 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +369 -0
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +396 -0
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +468 -0
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +582 -0
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +449 -0
- package/one/things/docs/ecommerce/QUICK-START.md +368 -0
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +498 -0
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +237 -0
- package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +171 -0
- package/one/things/docs/ecommerce/demo.astro +309 -0
- package/one/things/plans/agent-director-100-inference-plans.md +410 -0
- package/one/things/plans/dual-website-strategy.md +612 -0
- package/one/things/plans/feature-based-sites.md +821 -0
- package/one/things/plans/multi-ontology-architecture.md +836 -0
- package/one/things/plans/onboarding.md +32 -0
- package/one/things/plans/separate.md +15 -17
- package/one/things/plans/start-new.md +738 -0
- package/package.json +7 -2
- package/one/things/claude/hooks/agent-hook-manager.js +0 -525
- package/one/things/claude/hooks/agent-load-balancer.js +0 -271
- package/one/things/claude/hooks/agent-request-interceptor.js +0 -70
- package/one/things/claude/hooks/cascade-feedback.js +0 -297
- package/one/things/claude/hooks/cascade-integration-hooks.js +0 -648
- package/one/things/claude/hooks/continuous-improvement-monitor.js +0 -510
- package/one/things/claude/hooks/file-organization-engine.js +0 -427
- package/one/things/claude/hooks/file-organization-monitor.js +0 -269
- package/one/things/claude/hooks/hook-config-manager.js +0 -202
- package/one/things/claude/hooks/hook-orchestrator.js +0 -662
- package/one/things/claude/hooks/hook-performance-report.js +0 -120
- package/one/things/claude/hooks/mcp-cascade-integration.js +0 -816
- package/one/things/claude/hooks/memory-optimizer.js +0 -510
- package/one/things/claude/hooks/ontology-compliance.js +0 -394
- package/one/things/claude/hooks/ontology-hook-manager.js +0 -316
- package/one/things/claude/hooks/ontology-validation-engine.js +0 -317
- package/one/things/claude/hooks/performance-monitoring-hook.js +0 -422
- package/one/things/claude/hooks/quality-scoring-engine.js +0 -834
- package/one/things/claude/hooks/simple-load-balancer.js +0 -238
- package/one/things/claude/hooks/startup-optimizer.js +0 -625
- package/one/things/claude/hooks/story-scoring-system.js +0 -445
- package/one/things/claude/hooks/story-validation-engine.js +0 -473
- package/one/things/claude/hooks/structure-synchronizer.js +0 -194
- package/one/things/claude/hooks/sub-agent-output-validator.js +0 -647
- package/one/things/claude/hooks/sub-agent-validation-hook.js +0 -343
- package/one/things/claude/hooks/trinity-validation-system.js +0 -392
- package/one/things/plans/organizations-to-groups.md +0 -705
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple Agent Load Balancer
|
|
3
|
-
* Detects high agent usage and suggests alternatives
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import fs from 'fs';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import yaml from 'js-yaml';
|
|
9
|
-
|
|
10
|
-
class SimpleLoadBalancer {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.configPath = path.join(process.cwd(), 'one/config/agent-routing.yaml');
|
|
13
|
-
this.agentUsage = new Map(); // Track agent usage
|
|
14
|
-
this.config = this.loadConfig();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
loadConfig() {
|
|
18
|
-
try {
|
|
19
|
-
const configFile = fs.readFileSync(this.configPath, 'utf8');
|
|
20
|
-
return yaml.load(configFile);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.log('โ ๏ธ No agent routing config found, using defaults');
|
|
23
|
-
return this.getDefaultConfig();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
getDefaultConfig() {
|
|
28
|
-
return {
|
|
29
|
-
routing_config: {
|
|
30
|
-
enabled: true,
|
|
31
|
-
load_threshold: 70
|
|
32
|
-
},
|
|
33
|
-
agent_alternatives: {},
|
|
34
|
-
load_balancing_rules: {
|
|
35
|
-
auto_suggest_threshold: 70,
|
|
36
|
-
max_queue_time_minutes: 10
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Check if agent is busy and return routing suggestions
|
|
43
|
-
*/
|
|
44
|
-
checkAgentLoad(agentName) {
|
|
45
|
-
if (!this.config.routing_config.enabled) {
|
|
46
|
-
return { busy: false, suggestions: [] };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const usage = this.getAgentUsage(agentName);
|
|
50
|
-
const threshold = this.config.routing_config.load_threshold;
|
|
51
|
-
|
|
52
|
-
if (usage >= threshold) {
|
|
53
|
-
return {
|
|
54
|
-
busy: true,
|
|
55
|
-
usage: usage,
|
|
56
|
-
waitTime: this.estimateWaitTime(agentName),
|
|
57
|
-
suggestions: this.getAlternatives(agentName)
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return { busy: false, suggestions: [] };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Get current agent usage (simplified simulation)
|
|
66
|
-
*/
|
|
67
|
-
getAgentUsage(agentName) {
|
|
68
|
-
const currentTime = Date.now();
|
|
69
|
-
const usage = this.agentUsage.get(agentName) || { requests: 0, lastRequest: 0 };
|
|
70
|
-
|
|
71
|
-
// Simulate load based on recent requests
|
|
72
|
-
const timeSinceLastRequest = currentTime - usage.lastRequest;
|
|
73
|
-
const minutesSinceLastRequest = timeSinceLastRequest / (1000 * 60);
|
|
74
|
-
|
|
75
|
-
// High-demand agents get higher simulated load
|
|
76
|
-
const isHighDemand = this.config.usage_patterns?.high_demand_agents?.includes(agentName);
|
|
77
|
-
const baseLoad = isHighDemand ? 60 : 20;
|
|
78
|
-
|
|
79
|
-
// Decay usage over time
|
|
80
|
-
const decayedLoad = Math.max(0, baseLoad - (minutesSinceLastRequest * 10));
|
|
81
|
-
|
|
82
|
-
// Add some randomization for realism
|
|
83
|
-
const randomFactor = Math.random() * 20;
|
|
84
|
-
|
|
85
|
-
return Math.min(100, decayedLoad + randomFactor);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Record agent usage
|
|
90
|
-
*/
|
|
91
|
-
recordAgentUsage(agentName) {
|
|
92
|
-
const currentTime = Date.now();
|
|
93
|
-
const usage = this.agentUsage.get(agentName) || { requests: 0, lastRequest: 0 };
|
|
94
|
-
|
|
95
|
-
this.agentUsage.set(agentName, {
|
|
96
|
-
requests: usage.requests + 1,
|
|
97
|
-
lastRequest: currentTime
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Estimate wait time for busy agent
|
|
103
|
-
*/
|
|
104
|
-
estimateWaitTime(agentName) {
|
|
105
|
-
const usage = this.getAgentUsage(agentName);
|
|
106
|
-
const maxWaitTime = this.config.load_balancing_rules.max_queue_time_minutes || 10;
|
|
107
|
-
|
|
108
|
-
// Simple estimation: higher usage = longer wait
|
|
109
|
-
const waitTimeMinutes = Math.round((usage / 100) * maxWaitTime);
|
|
110
|
-
return Math.max(1, waitTimeMinutes);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Get alternative agents for the given agent
|
|
115
|
-
*/
|
|
116
|
-
getAlternatives(agentName) {
|
|
117
|
-
const agentConfig = this.config.agent_alternatives[agentName];
|
|
118
|
-
if (!agentConfig) {
|
|
119
|
-
return [];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return agentConfig.alternatives.map(alt => ({
|
|
123
|
-
agent: alt.agent,
|
|
124
|
-
description: alt.description,
|
|
125
|
-
capabilityMatch: alt.capability_match,
|
|
126
|
-
waitTimeReduction: alt.wait_time_reduction,
|
|
127
|
-
available: this.getAgentUsage(alt.agent) < 50 // Available if under 50% load
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Format routing suggestion message
|
|
133
|
-
*/
|
|
134
|
-
formatRoutingMessage(agentName, loadInfo) {
|
|
135
|
-
if (!loadInfo.busy) {
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const template = this.config.routing_messages?.busy_primary ||
|
|
140
|
-
"๐ {agent} is busy (current wait: {wait_time}min). Try these alternatives:";
|
|
141
|
-
|
|
142
|
-
let message = template
|
|
143
|
-
.replace('{agent}', agentName)
|
|
144
|
-
.replace('{wait_time}', loadInfo.waitTime);
|
|
145
|
-
|
|
146
|
-
if (loadInfo.suggestions.length > 0) {
|
|
147
|
-
message += '\n';
|
|
148
|
-
loadInfo.suggestions.forEach((suggestion, index) => {
|
|
149
|
-
const availableIndicator = suggestion.available ? '๐ข' : '๐ก';
|
|
150
|
-
message += `\n${index + 1}. ${availableIndicator} **${suggestion.agent}** - ${suggestion.description} (${suggestion.capabilityMatch}% match)`;
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
message += '\n\n๐ก *Alternatives can reduce your wait time by up to 75%*';
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return message;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Get routing recommendation for user
|
|
161
|
-
*/
|
|
162
|
-
getRoutingRecommendation(requestedAgent) {
|
|
163
|
-
// Record usage
|
|
164
|
-
this.recordAgentUsage(requestedAgent);
|
|
165
|
-
|
|
166
|
-
// Check load
|
|
167
|
-
const loadInfo = this.checkAgentLoad(requestedAgent);
|
|
168
|
-
|
|
169
|
-
if (!loadInfo.busy) {
|
|
170
|
-
return {
|
|
171
|
-
status: 'available',
|
|
172
|
-
agent: requestedAgent,
|
|
173
|
-
message: `โ
${requestedAgent} is available now!`
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return {
|
|
178
|
-
status: 'busy',
|
|
179
|
-
agent: requestedAgent,
|
|
180
|
-
waitTime: loadInfo.waitTime,
|
|
181
|
-
alternatives: loadInfo.suggestions,
|
|
182
|
-
message: this.formatRoutingMessage(requestedAgent, loadInfo)
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Get best alternative for a busy agent
|
|
188
|
-
*/
|
|
189
|
-
getBestAlternative(requestedAgent) {
|
|
190
|
-
const alternatives = this.getAlternatives(requestedAgent);
|
|
191
|
-
if (alternatives.length === 0) {
|
|
192
|
-
return null;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// Sort by availability first, then capability match
|
|
196
|
-
const sortedAlternatives = alternatives.sort((a, b) => {
|
|
197
|
-
if (a.available && !b.available) return -1;
|
|
198
|
-
if (!a.available && b.available) return 1;
|
|
199
|
-
return b.capabilityMatch - a.capabilityMatch;
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
return sortedAlternatives[0];
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// Export singleton instance
|
|
207
|
-
export const loadBalancer = new SimpleLoadBalancer();
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Hook function called when agent is requested
|
|
211
|
-
*/
|
|
212
|
-
export function checkAgentAvailability(agentName) {
|
|
213
|
-
return loadBalancer.getRoutingRecommendation(agentName);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Hook function to get routing suggestions
|
|
218
|
-
*/
|
|
219
|
-
export function getRoutingSuggestions(agentName) {
|
|
220
|
-
const loadInfo = loadBalancer.checkAgentLoad(agentName);
|
|
221
|
-
if (loadInfo.busy && loadInfo.suggestions.length > 0) {
|
|
222
|
-
return {
|
|
223
|
-
primary: agentName,
|
|
224
|
-
waitTime: loadInfo.waitTime,
|
|
225
|
-
alternatives: loadInfo.suggestions.filter(s => s.available)
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// CLI interface for testing
|
|
232
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
233
|
-
const testAgent = process.argv[2] || 'marketing-director';
|
|
234
|
-
console.log('๐งช Testing load balancer for:', testAgent);
|
|
235
|
-
|
|
236
|
-
const recommendation = loadBalancer.getRoutingRecommendation(testAgent);
|
|
237
|
-
console.log('\n๐ Result:', recommendation);
|
|
238
|
-
}
|