@jungjaehoon/mama-os 0.18.2 → 0.19.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.
Files changed (171) hide show
  1. package/dist/agent/agent-loop.d.ts +25 -0
  2. package/dist/agent/agent-loop.d.ts.map +1 -1
  3. package/dist/agent/agent-loop.js +67 -14
  4. package/dist/agent/agent-loop.js.map +1 -1
  5. package/dist/agent/code-act/host-bridge.d.ts.map +1 -1
  6. package/dist/agent/code-act/host-bridge.js +98 -0
  7. package/dist/agent/code-act/host-bridge.js.map +1 -1
  8. package/dist/agent/code-act/type-definition-generator.d.ts.map +1 -1
  9. package/dist/agent/code-act/type-definition-generator.js +0 -1
  10. package/dist/agent/code-act/type-definition-generator.js.map +1 -1
  11. package/dist/agent/gateway-tool-executor.d.ts +36 -1
  12. package/dist/agent/gateway-tool-executor.d.ts.map +1 -1
  13. package/dist/agent/gateway-tool-executor.js +938 -54
  14. package/dist/agent/gateway-tool-executor.js.map +1 -1
  15. package/dist/agent/gateway-tools.md +9 -0
  16. package/dist/agent/managed-agent-runtime-sync.d.ts +36 -0
  17. package/dist/agent/managed-agent-runtime-sync.d.ts.map +1 -0
  18. package/dist/agent/managed-agent-runtime-sync.js +207 -0
  19. package/dist/agent/managed-agent-runtime-sync.js.map +1 -0
  20. package/dist/agent/managed-agent-validation.d.ts +4 -0
  21. package/dist/agent/managed-agent-validation.d.ts.map +1 -0
  22. package/dist/agent/managed-agent-validation.js +84 -0
  23. package/dist/agent/managed-agent-validation.js.map +1 -0
  24. package/dist/agent/os-agent-capabilities.md +400 -0
  25. package/dist/agent/skill-loader.d.ts +2 -0
  26. package/dist/agent/skill-loader.d.ts.map +1 -1
  27. package/dist/agent/skill-loader.js +28 -0
  28. package/dist/agent/skill-loader.js.map +1 -1
  29. package/dist/agent/tool-registry.d.ts.map +1 -1
  30. package/dist/agent/tool-registry.js +66 -0
  31. package/dist/agent/tool-registry.js.map +1 -1
  32. package/dist/agent/types.d.ts +2 -1
  33. package/dist/agent/types.d.ts.map +1 -1
  34. package/dist/agent/types.js.map +1 -1
  35. package/dist/api/agent-handler.d.ts +34 -0
  36. package/dist/api/agent-handler.d.ts.map +1 -0
  37. package/dist/api/agent-handler.js +216 -0
  38. package/dist/api/agent-handler.js.map +1 -0
  39. package/dist/api/graph-api-types.d.ts +4 -0
  40. package/dist/api/graph-api-types.d.ts.map +1 -1
  41. package/dist/api/graph-api.d.ts +2 -2
  42. package/dist/api/graph-api.d.ts.map +1 -1
  43. package/dist/api/graph-api.js +480 -51
  44. package/dist/api/graph-api.js.map +1 -1
  45. package/dist/api/index.d.ts.map +1 -1
  46. package/dist/api/index.js +4 -0
  47. package/dist/api/index.js.map +1 -1
  48. package/dist/api/token-handler.d.ts +1 -0
  49. package/dist/api/token-handler.d.ts.map +1 -1
  50. package/dist/api/token-handler.js +4 -3
  51. package/dist/api/token-handler.js.map +1 -1
  52. package/dist/api/ui-command-handler.d.ts +48 -0
  53. package/dist/api/ui-command-handler.d.ts.map +1 -0
  54. package/dist/api/ui-command-handler.js +160 -0
  55. package/dist/api/ui-command-handler.js.map +1 -0
  56. package/dist/cli/commands/start.d.ts.map +1 -1
  57. package/dist/cli/commands/start.js +127 -1
  58. package/dist/cli/commands/start.js.map +1 -1
  59. package/dist/cli/config/config-manager.d.ts.map +1 -1
  60. package/dist/cli/config/config-manager.js +16 -31
  61. package/dist/cli/config/config-manager.js.map +1 -1
  62. package/dist/cli/runtime/agent-loop-init.d.ts.map +1 -1
  63. package/dist/cli/runtime/agent-loop-init.js +31 -7
  64. package/dist/cli/runtime/agent-loop-init.js.map +1 -1
  65. package/dist/cli/runtime/api-routes-init.d.ts +3 -0
  66. package/dist/cli/runtime/api-routes-init.d.ts.map +1 -1
  67. package/dist/cli/runtime/api-routes-init.js +283 -34
  68. package/dist/cli/runtime/api-routes-init.js.map +1 -1
  69. package/dist/cli/runtime/gateway-init.d.ts +2 -1
  70. package/dist/cli/runtime/gateway-init.d.ts.map +1 -1
  71. package/dist/cli/runtime/gateway-init.js +5 -1
  72. package/dist/cli/runtime/gateway-init.js.map +1 -1
  73. package/dist/connectors/framework/raw-store.d.ts +4 -0
  74. package/dist/connectors/framework/raw-store.d.ts.map +1 -1
  75. package/dist/connectors/framework/raw-store.js +33 -10
  76. package/dist/connectors/framework/raw-store.js.map +1 -1
  77. package/dist/db/agent-store.d.ts +115 -0
  78. package/dist/db/agent-store.d.ts.map +1 -0
  79. package/dist/db/agent-store.js +248 -0
  80. package/dist/db/agent-store.js.map +1 -0
  81. package/dist/db/migrations/agent-activity-validation-columns.d.ts +3 -0
  82. package/dist/db/migrations/agent-activity-validation-columns.d.ts.map +1 -0
  83. package/dist/db/migrations/agent-activity-validation-columns.js +22 -0
  84. package/dist/db/migrations/agent-activity-validation-columns.js.map +1 -0
  85. package/dist/db/migrations/agent-metrics-response-avg.d.ts +3 -0
  86. package/dist/db/migrations/agent-metrics-response-avg.d.ts.map +1 -0
  87. package/dist/db/migrations/agent-metrics-response-avg.js +19 -0
  88. package/dist/db/migrations/agent-metrics-response-avg.js.map +1 -0
  89. package/dist/db/migrations/agent-store-tables.d.ts +3 -0
  90. package/dist/db/migrations/agent-store-tables.d.ts.map +1 -0
  91. package/dist/db/migrations/agent-store-tables.js +59 -0
  92. package/dist/db/migrations/agent-store-tables.js.map +1 -0
  93. package/dist/db/migrations/token-usage-agent-version.d.ts +3 -0
  94. package/dist/db/migrations/token-usage-agent-version.d.ts.map +1 -0
  95. package/dist/db/migrations/token-usage-agent-version.js +16 -0
  96. package/dist/db/migrations/token-usage-agent-version.js.map +1 -0
  97. package/dist/db/migrations/validation-session-tables.d.ts +3 -0
  98. package/dist/db/migrations/validation-session-tables.d.ts.map +1 -0
  99. package/dist/db/migrations/validation-session-tables.js +59 -0
  100. package/dist/db/migrations/validation-session-tables.js.map +1 -0
  101. package/dist/gateways/message-router.d.ts +10 -0
  102. package/dist/gateways/message-router.d.ts.map +1 -1
  103. package/dist/gateways/message-router.js +188 -14
  104. package/dist/gateways/message-router.js.map +1 -1
  105. package/dist/gateways/types.d.ts +1 -1
  106. package/dist/gateways/types.d.ts.map +1 -1
  107. package/dist/multi-agent/agent-process-manager.js +1 -1
  108. package/dist/multi-agent/agent-process-manager.js.map +1 -1
  109. package/dist/multi-agent/conductor-persona.d.ts +13 -0
  110. package/dist/multi-agent/conductor-persona.d.ts.map +1 -0
  111. package/dist/multi-agent/conductor-persona.js +157 -0
  112. package/dist/multi-agent/conductor-persona.js.map +1 -0
  113. package/dist/multi-agent/dashboard-agent-persona.d.ts +1 -1
  114. package/dist/multi-agent/dashboard-agent-persona.d.ts.map +1 -1
  115. package/dist/multi-agent/dashboard-agent-persona.js +7 -3
  116. package/dist/multi-agent/dashboard-agent-persona.js.map +1 -1
  117. package/dist/multi-agent/delegation-manager.d.ts +5 -0
  118. package/dist/multi-agent/delegation-manager.d.ts.map +1 -1
  119. package/dist/multi-agent/delegation-manager.js +37 -0
  120. package/dist/multi-agent/delegation-manager.js.map +1 -1
  121. package/dist/multi-agent/ultrawork.d.ts +3 -0
  122. package/dist/multi-agent/ultrawork.d.ts.map +1 -1
  123. package/dist/multi-agent/ultrawork.js +9 -0
  124. package/dist/multi-agent/ultrawork.js.map +1 -1
  125. package/dist/validation/session-service.d.ts +72 -0
  126. package/dist/validation/session-service.d.ts.map +1 -0
  127. package/dist/validation/session-service.js +298 -0
  128. package/dist/validation/session-service.js.map +1 -0
  129. package/dist/validation/store.d.ts +25 -0
  130. package/dist/validation/store.d.ts.map +1 -0
  131. package/dist/validation/store.js +200 -0
  132. package/dist/validation/store.js.map +1 -0
  133. package/dist/validation/types.d.ts +119 -0
  134. package/dist/validation/types.d.ts.map +1 -0
  135. package/dist/validation/types.js +57 -0
  136. package/dist/validation/types.js.map +1 -0
  137. package/package.json +3 -3
  138. package/public/viewer/js/modules/agents.js +1148 -0
  139. package/public/viewer/js/modules/chat.js +20 -11
  140. package/public/viewer/js/modules/connector-feed.js +35 -0
  141. package/public/viewer/js/modules/dashboard.js +49 -0
  142. package/public/viewer/js/modules/memory.js +32 -0
  143. package/public/viewer/js/modules/settings.js +34 -79
  144. package/public/viewer/js/modules/wiki.js +59 -4
  145. package/public/viewer/js/utils/api.js +70 -0
  146. package/public/viewer/js/utils/dom.js +3 -0
  147. package/public/viewer/js/utils/ui-commands.js +93 -0
  148. package/public/viewer/log-viewer.html +2 -2
  149. package/public/viewer/src/modules/agents.ts +1299 -0
  150. package/public/viewer/src/modules/chat.ts +23 -14
  151. package/public/viewer/src/modules/connector-feed.ts +35 -0
  152. package/public/viewer/src/modules/dashboard.ts +50 -0
  153. package/public/viewer/src/modules/memory.ts +31 -0
  154. package/public/viewer/src/modules/settings.ts +36 -96
  155. package/public/viewer/src/modules/wiki.ts +73 -6
  156. package/public/viewer/src/types/global.d.ts +0 -9
  157. package/public/viewer/src/utils/api.ts +156 -2
  158. package/public/viewer/src/utils/dom.ts +6 -1
  159. package/public/viewer/src/utils/ui-commands.ts +118 -0
  160. package/public/viewer/viewer.css +105 -10
  161. package/public/viewer/viewer.html +1868 -777
  162. package/scripts/generate-gateway-tools.ts +5 -1
  163. package/public/viewer/js/modules/playground.js +0 -148
  164. package/public/viewer/js/modules/skills.js +0 -451
  165. package/public/viewer/src/modules/playground.ts +0 -173
  166. package/public/viewer/src/modules/skills.ts +0 -491
  167. package/templates/playgrounds/cron-workflow-lab.html +0 -1601
  168. package/templates/playgrounds/mama-log-viewer.html +0 -1341
  169. package/templates/playgrounds/skill-lab-playground.html +0 -1625
  170. package/templates/playgrounds/wave-visualizer.html +0 -694
  171. package/templates/skills/playground.md +0 -197
@@ -1,197 +0,0 @@
1
- ---
2
- name: Playground Creator
3
- description: Create interactive HTML playgrounds displayed in the Viewer Playground tab. Configure visually → auto-generate prompt → copy or send to chat.
4
- keywords:
5
- - playground
6
- - explorer
7
- - color palette
8
- - concept map
9
- - code map
10
- - data explorer
11
- - diff review
12
- - document critique
13
- - visualizer
14
- - prompt generator
15
- - interactive
16
- - HTML tool
17
- - playground_create
18
- - comparison tool
19
- - configuration tool
20
- output: text
21
- ---
22
-
23
- # Playground Creator
24
-
25
- ## CRITICAL: Always use playground_create tool
26
-
27
- **Never create files directly with Write/Bash tool.**
28
- You MUST use the `playground_create` gateway tool.
29
- Only this tool registers the playground in `index.json` so it appears in the Viewer Playground tab.
30
-
31
- ```tool_call
32
- {"name": "playground_create", "input": {"name": "Color Palette Explorer", "html": "<!doctype html><html>..full HTML..</html>", "description": "Color palette exploration tool"}}
33
- ```
34
-
35
- **Parameters:**
36
-
37
- - `name`: Short title (used to generate a URL-safe slug)
38
- - `html`: Complete self-contained HTML string (full `<!doctype html>` to `</html>`)
39
- - `description`: One-line description (optional)
40
-
41
- Returns: `{ success: true, url: "/playgrounds/{slug}.html", slug: "..." }`
42
-
43
- **Warning:** Writing directly to `~/.mama/workspace/playgrounds/` skips `index.json` registration — the playground won't appear in the tab.
44
-
45
- ## JS String Caution
46
-
47
- When inserting newlines in JavaScript inside HTML, always use the escape sequence `\n`.
48
- Never put actual newlines inside string literals — it breaks the entire script parser.
49
-
50
- ```javascript
51
- // GOOD
52
- parts.join('\n')
53
-
54
- // BAD — entire JS parsing error
55
- parts.join('
56
- ')
57
- ```
58
-
59
- ## Core Pattern: Configure → Preview → Prompt → Copy/Send
60
-
61
- Every playground follows this structure:
62
-
63
- 1. **Control Panel** (left/top): Sliders, color pickers, selects, toggles, etc.
64
- 2. **Live Preview** (center): Updates instantly on control changes. No "Apply" button.
65
- 3. **Prompt Output** (bottom): Auto-generates a natural-language prompt from current settings + **Copy button** + **Send to Chat button**
66
-
67
- ### Prompt Output Rules
68
-
69
- - Written in **natural language**, not a value dump.
70
- - Only includes items that **differ from defaults**. Unchanged settings are omitted.
71
- - **Self-contained context**: The prompt must be actionable without the playground.
72
- - **Real-time updates**: Refreshes instantly on every control change.
73
-
74
- ### Prompt Area HTML Structure (Required)
75
-
76
- Every playground must include this structure at the bottom:
77
-
78
- ```html
79
- <div class="prompt-output">
80
- <div class="prompt-header">
81
- <label>Generated Prompt</label>
82
- <div class="prompt-actions">
83
- <button id="copyPromptBtn" onclick="copyPrompt()">Copy</button>
84
- <button id="sendToChatBtn" onclick="sendToChat()">Send to Chat</button>
85
- </div>
86
- </div>
87
- <div id="promptText" class="prompt-text">Using default settings.</div>
88
- </div>
89
- ```
90
-
91
- ### Copy + Send to Chat Functions (Required)
92
-
93
- ```javascript
94
- async function copyPrompt() {
95
- var text = document.getElementById('promptText').textContent;
96
- try {
97
- await navigator.clipboard.writeText(text);
98
- document.getElementById('copyPromptBtn').textContent = 'Copied!';
99
- setTimeout(function () {
100
- document.getElementById('copyPromptBtn').textContent = 'Copy';
101
- }, 1500);
102
- } catch (e) {
103
- // fallback
104
- }
105
- }
106
-
107
- function sendToChat() {
108
- var text = document.getElementById('promptText').textContent;
109
- if (!text || text === 'Using default settings.') return;
110
- window.parent.postMessage({ type: 'playground:sendToChat', message: text }, '*');
111
- document.getElementById('sendToChatBtn').textContent = 'Sent!';
112
- setTimeout(function () {
113
- document.getElementById('sendToChatBtn').textContent = 'Send to Chat';
114
- }, 1500);
115
- }
116
- ```
117
-
118
- `window.parent.postMessage` is received by the Viewer and forwarded to webchat.
119
- This only works when the playground is opened inside the Viewer iframe; in a standalone tab, only Copy works.
120
-
121
- ### State Management Pattern
122
-
123
- ```javascript
124
- var DEFAULTS = { borderRadius: 8, shadow: 'subtle', color: '#006d77' };
125
- var state = { borderRadius: 8, shadow: 'subtle', color: '#006d77' };
126
-
127
- function updateAll() {
128
- renderPreview();
129
- updatePrompt();
130
- }
131
-
132
- function updatePrompt() {
133
- var parts = [];
134
- if (state.borderRadius !== DEFAULTS.borderRadius) {
135
- parts.push('border-radius ' + state.borderRadius + 'px');
136
- }
137
- if (state.shadow !== DEFAULTS.shadow) {
138
- parts.push(state.shadow === 'strong' ? 'strong shadow' : 'no shadow');
139
- }
140
- document.getElementById('promptText').textContent = parts.length
141
- ? 'Apply the following: ' + parts.join(', ') + '.'
142
- : 'Using default settings.';
143
- }
144
- ```
145
-
146
- ### Presets
147
-
148
- Include 3–5 named presets. Clicking one snaps all controls to a coherent combination.
149
-
150
- ## 6 Template Types
151
-
152
- ### Design Explorer
153
-
154
- Color palettes, typography preview, layout comparison. Real-time adjustment via sliders/color pickers.
155
- → Prompt: "Apply border-radius 12px, strong shadow, primary color #006d77 to this component"
156
-
157
- ### Data Explorer
158
-
159
- Table/chart views, filter/sort, CSV paste support. Simple aggregation/statistics display.
160
- → Prompt: "Write a query filtered by date range 2025-01 to 03, category 'sales'"
161
-
162
- ### Concept Map
163
-
164
- Node/edge diagrams. Drag to arrange, zoom/pan, add/remove nodes. Canvas or SVG based.
165
- → Prompt: "Organize the Authentication → Session → Token relationships as a diagram"
166
-
167
- ### Code Map
168
-
169
- File tree structure, module dependency visualization. Search/filter, zoom/pan support.
170
- → Prompt: "Refactor the agent → gateways dependency in the multi-agent module"
171
-
172
- ### Diff Review
173
-
174
- Side-by-side or unified diff comparison. Line-level highlighting, change statistics, comments.
175
- → Prompt: "Revert changes on lines 42-58 and change the type on line 73 to string"
176
-
177
- ### Document Critique
178
-
179
- Document text analysis, inline annotations, section-level summary/evaluation. Markdown support.
180
- → Prompt: "Make the requirements in section 3 more specific, remove duplicates in section 5"
181
-
182
- ## HTML Quality Standards
183
-
184
- 1. **Self-contained**: No external CDN/resources. All CSS/JS inline.
185
- 2. **Responsive**: Supports min-width 320px up to desktop.
186
- 3. **Live preview**: Reflects control changes instantly. No "Apply" button.
187
- 4. **Prompt output + Send to Chat**: Bottom area with natural-language prompt + Copy + Send to Chat buttons required.
188
- 5. **Presets**: 3–5 named presets for a meaningful initial state on first load.
189
- 6. **Dark theme**: Dark by default, light toggle available.
190
-
191
- ## Workflow
192
-
193
- 1. Identify the playground type from the user's request
194
- 2. Define DEFAULTS + PRESETS
195
- 3. Build HTML with Control → Preview → Prompt output (Copy + Send to Chat) structure
196
- 4. **Always create with `playground_create` tool** (Write tool is forbidden)
197
- 5. Share the returned URL with the user