ideaco 1.1.5

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.
Files changed (159) hide show
  1. package/.dockerignore +33 -0
  2. package/.nvmrc +1 -0
  3. package/ARCHITECTURE.md +394 -0
  4. package/Dockerfile +50 -0
  5. package/LICENSE +29 -0
  6. package/README.md +206 -0
  7. package/bin/i18n.js +46 -0
  8. package/bin/ideaco.js +494 -0
  9. package/deploy.sh +15 -0
  10. package/docker-compose.yml +30 -0
  11. package/electron/main.cjs +986 -0
  12. package/electron/preload.cjs +14 -0
  13. package/electron/web-backends.cjs +854 -0
  14. package/jsconfig.json +8 -0
  15. package/next.config.mjs +34 -0
  16. package/package.json +134 -0
  17. package/postcss.config.mjs +6 -0
  18. package/public/demo/dashboard.png +0 -0
  19. package/public/demo/employee.png +0 -0
  20. package/public/demo/messages.png +0 -0
  21. package/public/demo/office.png +0 -0
  22. package/public/demo/requirement.png +0 -0
  23. package/public/logo.jpeg +0 -0
  24. package/public/logo.png +0 -0
  25. package/scripts/prepare-electron.js +67 -0
  26. package/scripts/release.js +76 -0
  27. package/src/app/api/agents/[agentId]/chat/route.js +70 -0
  28. package/src/app/api/agents/[agentId]/conversations/route.js +35 -0
  29. package/src/app/api/agents/[agentId]/route.js +106 -0
  30. package/src/app/api/avatar/route.js +104 -0
  31. package/src/app/api/browse-dir/route.js +44 -0
  32. package/src/app/api/chat/route.js +265 -0
  33. package/src/app/api/company/factory-reset/route.js +43 -0
  34. package/src/app/api/company/route.js +82 -0
  35. package/src/app/api/departments/[deptId]/agents/[agentId]/dismiss/route.js +19 -0
  36. package/src/app/api/departments/route.js +92 -0
  37. package/src/app/api/group-chat-loop/events/route.js +70 -0
  38. package/src/app/api/group-chat-loop/route.js +94 -0
  39. package/src/app/api/mailbox/route.js +100 -0
  40. package/src/app/api/messages/route.js +14 -0
  41. package/src/app/api/providers/[id]/configure/route.js +21 -0
  42. package/src/app/api/providers/[id]/refresh-cookie/route.js +38 -0
  43. package/src/app/api/providers/[id]/test-cookie/route.js +28 -0
  44. package/src/app/api/providers/route.js +11 -0
  45. package/src/app/api/requirements/route.js +242 -0
  46. package/src/app/api/secretary/route.js +65 -0
  47. package/src/app/api/system/cli-backends/route.js +91 -0
  48. package/src/app/api/system/cron/route.js +110 -0
  49. package/src/app/api/system/knowledge/route.js +104 -0
  50. package/src/app/api/system/plugins/route.js +40 -0
  51. package/src/app/api/system/skills/route.js +46 -0
  52. package/src/app/api/system/status/route.js +46 -0
  53. package/src/app/api/talent-market/[profileId]/recall/route.js +22 -0
  54. package/src/app/api/talent-market/[profileId]/route.js +17 -0
  55. package/src/app/api/talent-market/route.js +26 -0
  56. package/src/app/api/teams/route.js +773 -0
  57. package/src/app/api/ws-files/[departmentId]/file/route.js +27 -0
  58. package/src/app/api/ws-files/[departmentId]/files/route.js +22 -0
  59. package/src/app/globals.css +130 -0
  60. package/src/app/layout.jsx +40 -0
  61. package/src/app/page.jsx +97 -0
  62. package/src/components/AgentChatModal.jsx +164 -0
  63. package/src/components/AgentDetailModal.jsx +425 -0
  64. package/src/components/AgentSpyModal.jsx +481 -0
  65. package/src/components/AvatarGrid.jsx +29 -0
  66. package/src/components/BossProfileModal.jsx +162 -0
  67. package/src/components/CachedAvatar.jsx +77 -0
  68. package/src/components/ChatPanel.jsx +219 -0
  69. package/src/components/ChatShared.jsx +255 -0
  70. package/src/components/DepartmentDetail.jsx +842 -0
  71. package/src/components/DepartmentView.jsx +367 -0
  72. package/src/components/FileReference.jsx +260 -0
  73. package/src/components/FilesView.jsx +465 -0
  74. package/src/components/GroupChatView.jsx +799 -0
  75. package/src/components/Mailbox.jsx +926 -0
  76. package/src/components/MessagesView.jsx +112 -0
  77. package/src/components/OnboardingGuide.jsx +209 -0
  78. package/src/components/OrgTree.jsx +151 -0
  79. package/src/components/Overview.jsx +391 -0
  80. package/src/components/PixelOffice.jsx +2281 -0
  81. package/src/components/ProviderGrid.jsx +551 -0
  82. package/src/components/ProvidersBoard.jsx +16 -0
  83. package/src/components/RequirementDetail.jsx +1279 -0
  84. package/src/components/RequirementsBoard.jsx +187 -0
  85. package/src/components/SecretarySettings.jsx +295 -0
  86. package/src/components/SetupWizard.jsx +388 -0
  87. package/src/components/Sidebar.jsx +169 -0
  88. package/src/components/SystemMonitor.jsx +808 -0
  89. package/src/components/TalentMarket.jsx +183 -0
  90. package/src/components/TeamDetail.jsx +697 -0
  91. package/src/core/agent/base-agent.js +104 -0
  92. package/src/core/agent/chat-store.js +602 -0
  93. package/src/core/agent/cli-agent/backends/claude-code/README.md +52 -0
  94. package/src/core/agent/cli-agent/backends/claude-code/config.js +27 -0
  95. package/src/core/agent/cli-agent/backends/codebuddy/README.md +236 -0
  96. package/src/core/agent/cli-agent/backends/codebuddy/config.js +27 -0
  97. package/src/core/agent/cli-agent/backends/codex/README.md +51 -0
  98. package/src/core/agent/cli-agent/backends/codex/config.js +27 -0
  99. package/src/core/agent/cli-agent/backends/index.js +27 -0
  100. package/src/core/agent/cli-agent/backends/registry.js +580 -0
  101. package/src/core/agent/cli-agent/index.js +154 -0
  102. package/src/core/agent/index.js +60 -0
  103. package/src/core/agent/llm-agent/client.js +320 -0
  104. package/src/core/agent/llm-agent/index.js +97 -0
  105. package/src/core/agent/message-bus.js +211 -0
  106. package/src/core/agent/session.js +608 -0
  107. package/src/core/agent/tools.js +596 -0
  108. package/src/core/agent/web-agent/backends/base-backend.js +180 -0
  109. package/src/core/agent/web-agent/backends/chatgpt/client.js +146 -0
  110. package/src/core/agent/web-agent/backends/chatgpt/config.js +148 -0
  111. package/src/core/agent/web-agent/backends/chatgpt/dom-scripts.js +303 -0
  112. package/src/core/agent/web-agent/backends/index.js +91 -0
  113. package/src/core/agent/web-agent/index.js +278 -0
  114. package/src/core/agent/web-agent/web-client.js +407 -0
  115. package/src/core/employee/base-employee.js +1088 -0
  116. package/src/core/employee/index.js +35 -0
  117. package/src/core/employee/knowledge.js +327 -0
  118. package/src/core/employee/lifecycle.js +990 -0
  119. package/src/core/employee/memory/index.js +642 -0
  120. package/src/core/employee/memory/store.js +143 -0
  121. package/src/core/employee/performance.js +224 -0
  122. package/src/core/employee/secretary.js +625 -0
  123. package/src/core/employee/skills.js +398 -0
  124. package/src/core/index.js +38 -0
  125. package/src/core/organization/company.js +2600 -0
  126. package/src/core/organization/department.js +737 -0
  127. package/src/core/organization/group-chat-loop.js +264 -0
  128. package/src/core/organization/index.js +8 -0
  129. package/src/core/organization/persistence.js +111 -0
  130. package/src/core/organization/team.js +267 -0
  131. package/src/core/organization/workforce/hr.js +377 -0
  132. package/src/core/organization/workforce/providers.js +468 -0
  133. package/src/core/organization/workforce/role-archetypes.js +805 -0
  134. package/src/core/organization/workforce/talent-market.js +205 -0
  135. package/src/core/prompts.js +532 -0
  136. package/src/core/requirement.js +1789 -0
  137. package/src/core/system/audit.js +483 -0
  138. package/src/core/system/cron.js +449 -0
  139. package/src/core/system/index.js +7 -0
  140. package/src/core/system/plugin.js +2183 -0
  141. package/src/core/utils/json-parse.js +188 -0
  142. package/src/core/workspace.js +239 -0
  143. package/src/lib/api-i18n.js +211 -0
  144. package/src/lib/avatar.js +268 -0
  145. package/src/lib/client-store.js +1025 -0
  146. package/src/lib/config-validator.js +483 -0
  147. package/src/lib/format-time.js +22 -0
  148. package/src/lib/hooks.js +414 -0
  149. package/src/lib/i18n.js +134 -0
  150. package/src/lib/paths.js +23 -0
  151. package/src/lib/store.js +72 -0
  152. package/src/locales/de.js +393 -0
  153. package/src/locales/en.js +1054 -0
  154. package/src/locales/es.js +393 -0
  155. package/src/locales/fr.js +393 -0
  156. package/src/locales/ja.js +501 -0
  157. package/src/locales/ko.js +513 -0
  158. package/src/locales/zh.js +828 -0
  159. package/tailwind.config.mjs +11 -0
@@ -0,0 +1,205 @@
1
+ import { v4 as uuidv4 } from 'uuid';
2
+
3
+ /**
4
+ * Talent Market - Buffer pool for dismissed Agents
5
+ *
6
+ * Dismissed employees enter the talent market, retaining their memories and skill experience.
7
+ * The secretary can recall former employees from the talent market; they'll return with their original memories and newly acquired skills.
8
+ * Alternatively, you can choose not to reuse them and recruit new hires instead.
9
+ */
10
+ export class TalentMarket {
11
+ constructor() {
12
+ this.pool = new Map(); // talentId => TalentProfile
13
+ }
14
+
15
+ /**
16
+ * Register a dismissed Agent into the talent market
17
+ * @param {Agent} agent - The dismissed Agent
18
+ * @param {string} reason - Dismissal reason
19
+ * @param {object} performanceData - Performance data
20
+ * @returns {object} Talent profile
21
+ */
22
+ register(agent, reason = 'Project ended', performanceData = null) {
23
+ const profile = {
24
+ id: uuidv4(),
25
+ originalAgentId: agent.id,
26
+ name: agent.name,
27
+ role: agent.role,
28
+ prompt: agent.prompt,
29
+ skills: [...agent.skills],
30
+ // Skills potentially acquired while in the talent market
31
+ acquiredSkills: [],
32
+ provider: agent.provider,
33
+ // Save avatar and personal attributes
34
+ avatar: agent.avatar,
35
+ avatarParams: agent.avatarParams || null,
36
+ gender: agent.gender,
37
+ age: agent.age,
38
+ personality: agent.personality,
39
+ signature: agent.signature,
40
+ // Save complete memory data
41
+ memorySnapshot: agent.memory ? agent.memory.serialize() : null,
42
+ // Save performance data
43
+ performanceData,
44
+ // Work history
45
+ workHistory: agent.taskHistory.map(h => ({
46
+ task: h.task,
47
+ completedAt: h.completedAt,
48
+ })),
49
+ previousDepartment: agent.department,
50
+ dismissalReason: reason,
51
+ registeredAt: new Date(),
52
+ status: 'available', // available | recalled | expired
53
+ };
54
+
55
+ this.pool.set(profile.id, profile);
56
+
57
+ console.log(` šŸŖ [${agent.name}] (${agent.role}) entered the talent market`);
58
+ console.log(` Dismissal reason: ${reason}`);
59
+ console.log(` Skills: ${agent.skills.join(', ')}`);
60
+ if (agent.memory) {
61
+ console.log(` Memories: short-term ${agent.memory.shortTerm.length}, long-term ${agent.memory.longTerm.length}`);
62
+ }
63
+
64
+ return profile;
65
+ }
66
+
67
+ /**
68
+ * Search for available talent in the talent market
69
+ * @param {object} criteria - Search criteria
70
+ * @param {string} [criteria.role] - Role/position
71
+ * @param {string[]} [criteria.skills] - Required skills
72
+ * @param {string} [criteria.name] - Name search
73
+ * @param {number} [criteria.minScore] - Minimum performance score
74
+ * @returns {Array} List of matching talent profiles
75
+ */
76
+ search(criteria = {}) {
77
+ const results = [];
78
+
79
+ for (const profile of this.pool.values()) {
80
+ if (profile.status !== 'available') continue;
81
+
82
+ let match = true;
83
+
84
+ // Match by role
85
+ if (criteria.role && !profile.role.includes(criteria.role)) {
86
+ match = false;
87
+ }
88
+
89
+ // Match by skills
90
+ if (criteria.skills && criteria.skills.length > 0) {
91
+ const allSkills = [...profile.skills, ...profile.acquiredSkills];
92
+ const hasSkills = criteria.skills.some(s =>
93
+ allSkills.some(ps => ps.includes(s))
94
+ );
95
+ if (!hasSkills) match = false;
96
+ }
97
+
98
+ // Match by name
99
+ if (criteria.name && !profile.name.includes(criteria.name)) {
100
+ match = false;
101
+ }
102
+
103
+ // Match by minimum performance score
104
+ if (criteria.minScore && profile.performanceData) {
105
+ if (profile.performanceData.averageScore < criteria.minScore) {
106
+ match = false;
107
+ }
108
+ }
109
+
110
+ if (match) results.push(profile);
111
+ }
112
+
113
+ return results;
114
+ }
115
+
116
+ /**
117
+ * Recall a talent from the talent market
118
+ * @param {string} profileId - Talent profile ID
119
+ * @param {string[]} [newSkills] - New skills acquired while in the talent market
120
+ * @returns {object} Recalled talent profile (with memories and new skills)
121
+ */
122
+ recall(profileId, newSkills = []) {
123
+ const profile = this.pool.get(profileId);
124
+ if (!profile) {
125
+ throw new Error(`Profile not found in talent market: ${profileId}`);
126
+ }
127
+ if (profile.status !== 'available') {
128
+ throw new Error(`This talent is no longer available, status: ${profile.status}`);
129
+ }
130
+
131
+ // Add new skills
132
+ profile.acquiredSkills.push(...newSkills);
133
+ profile.status = 'recalled';
134
+
135
+ console.log(` šŸ“ž Recalled from talent market: [${profile.name}] (${profile.role})`);
136
+ console.log(` Original skills: ${profile.skills.join(', ')}`);
137
+ if (profile.acquiredSkills.length > 0) {
138
+ console.log(` Newly acquired skills: ${profile.acquiredSkills.join(', ')}`);
139
+ }
140
+ if (profile.memorySnapshot) {
141
+ const memData = profile.memorySnapshot;
142
+ console.log(` Memories: short-term ${memData.shortTerm?.length || 0}, long-term ${memData.longTerm?.length || 0}`);
143
+ }
144
+
145
+ return profile;
146
+ }
147
+
148
+ /**
149
+ * Permanently remove a talent from the talent market
150
+ * @param {string} profileId - Talent profile ID
151
+ * @returns {object} The removed talent profile
152
+ */
153
+ remove(profileId) {
154
+ const profile = this.pool.get(profileId);
155
+ if (!profile) {
156
+ throw new Error(`Profile not found in talent market: ${profileId}`);
157
+ }
158
+ this.pool.delete(profileId);
159
+ console.log(` šŸ—‘ļø Permanently removed from talent market: [${profile.name}] (${profile.role})`);
160
+ return profile;
161
+ }
162
+
163
+ /**
164
+ * Get all available talent in the talent market
165
+ */
166
+ listAvailable() {
167
+ return [...this.pool.values()].filter(p => p.status === 'available');
168
+ }
169
+
170
+ /**
171
+ * Get talent market statistics
172
+ */
173
+ getStats() {
174
+ const all = [...this.pool.values()];
175
+ return {
176
+ total: all.length,
177
+ available: all.filter(p => p.status === 'available').length,
178
+ recalled: all.filter(p => p.status === 'recalled').length,
179
+ byRole: all.reduce((acc, p) => {
180
+ acc[p.role] = (acc[p.role] || 0) + 1;
181
+ return acc;
182
+ }, {}),
183
+ };
184
+ }
185
+
186
+ /**
187
+ * Print talent market information
188
+ */
189
+ print() {
190
+ const available = this.listAvailable();
191
+ console.log(`\nšŸŖ Talent Market (${available.length} available):`);
192
+ if (available.length === 0) {
193
+ console.log(' (empty)');
194
+ return;
195
+ }
196
+ available.forEach(p => {
197
+ const allSkills = [...p.skills, ...p.acquiredSkills.map(s => `${s}(new)`)];
198
+ console.log(` šŸ‘¤ ${p.name} (${p.role}) - ${p.dismissalReason}`);
199
+ console.log(` Skills: ${allSkills.join(', ')}`);
200
+ if (p.performanceData) {
201
+ console.log(` Historical performance: ${p.performanceData.averageScore} pts`);
202
+ }
203
+ });
204
+ }
205
+ }