@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.
- package/dist/agent/agent-loop.d.ts +25 -0
- package/dist/agent/agent-loop.d.ts.map +1 -1
- package/dist/agent/agent-loop.js +67 -14
- package/dist/agent/agent-loop.js.map +1 -1
- package/dist/agent/code-act/host-bridge.d.ts.map +1 -1
- package/dist/agent/code-act/host-bridge.js +98 -0
- package/dist/agent/code-act/host-bridge.js.map +1 -1
- package/dist/agent/code-act/type-definition-generator.d.ts.map +1 -1
- package/dist/agent/code-act/type-definition-generator.js +0 -1
- package/dist/agent/code-act/type-definition-generator.js.map +1 -1
- package/dist/agent/gateway-tool-executor.d.ts +36 -1
- package/dist/agent/gateway-tool-executor.d.ts.map +1 -1
- package/dist/agent/gateway-tool-executor.js +938 -54
- package/dist/agent/gateway-tool-executor.js.map +1 -1
- package/dist/agent/gateway-tools.md +9 -0
- package/dist/agent/managed-agent-runtime-sync.d.ts +36 -0
- package/dist/agent/managed-agent-runtime-sync.d.ts.map +1 -0
- package/dist/agent/managed-agent-runtime-sync.js +207 -0
- package/dist/agent/managed-agent-runtime-sync.js.map +1 -0
- package/dist/agent/managed-agent-validation.d.ts +4 -0
- package/dist/agent/managed-agent-validation.d.ts.map +1 -0
- package/dist/agent/managed-agent-validation.js +84 -0
- package/dist/agent/managed-agent-validation.js.map +1 -0
- package/dist/agent/os-agent-capabilities.md +400 -0
- package/dist/agent/skill-loader.d.ts +2 -0
- package/dist/agent/skill-loader.d.ts.map +1 -1
- package/dist/agent/skill-loader.js +28 -0
- package/dist/agent/skill-loader.js.map +1 -1
- package/dist/agent/tool-registry.d.ts.map +1 -1
- package/dist/agent/tool-registry.js +66 -0
- package/dist/agent/tool-registry.js.map +1 -1
- package/dist/agent/types.d.ts +2 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/api/agent-handler.d.ts +34 -0
- package/dist/api/agent-handler.d.ts.map +1 -0
- package/dist/api/agent-handler.js +216 -0
- package/dist/api/agent-handler.js.map +1 -0
- package/dist/api/graph-api-types.d.ts +4 -0
- package/dist/api/graph-api-types.d.ts.map +1 -1
- package/dist/api/graph-api.d.ts +2 -2
- package/dist/api/graph-api.d.ts.map +1 -1
- package/dist/api/graph-api.js +480 -51
- package/dist/api/graph-api.js.map +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/token-handler.d.ts +1 -0
- package/dist/api/token-handler.d.ts.map +1 -1
- package/dist/api/token-handler.js +4 -3
- package/dist/api/token-handler.js.map +1 -1
- package/dist/api/ui-command-handler.d.ts +48 -0
- package/dist/api/ui-command-handler.d.ts.map +1 -0
- package/dist/api/ui-command-handler.js +160 -0
- package/dist/api/ui-command-handler.js.map +1 -0
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +127 -1
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/config/config-manager.d.ts.map +1 -1
- package/dist/cli/config/config-manager.js +16 -31
- package/dist/cli/config/config-manager.js.map +1 -1
- package/dist/cli/runtime/agent-loop-init.d.ts.map +1 -1
- package/dist/cli/runtime/agent-loop-init.js +31 -7
- package/dist/cli/runtime/agent-loop-init.js.map +1 -1
- package/dist/cli/runtime/api-routes-init.d.ts +3 -0
- package/dist/cli/runtime/api-routes-init.d.ts.map +1 -1
- package/dist/cli/runtime/api-routes-init.js +283 -34
- package/dist/cli/runtime/api-routes-init.js.map +1 -1
- package/dist/cli/runtime/gateway-init.d.ts +2 -1
- package/dist/cli/runtime/gateway-init.d.ts.map +1 -1
- package/dist/cli/runtime/gateway-init.js +5 -1
- package/dist/cli/runtime/gateway-init.js.map +1 -1
- package/dist/connectors/framework/raw-store.d.ts +4 -0
- package/dist/connectors/framework/raw-store.d.ts.map +1 -1
- package/dist/connectors/framework/raw-store.js +33 -10
- package/dist/connectors/framework/raw-store.js.map +1 -1
- package/dist/db/agent-store.d.ts +115 -0
- package/dist/db/agent-store.d.ts.map +1 -0
- package/dist/db/agent-store.js +248 -0
- package/dist/db/agent-store.js.map +1 -0
- package/dist/db/migrations/agent-activity-validation-columns.d.ts +3 -0
- package/dist/db/migrations/agent-activity-validation-columns.d.ts.map +1 -0
- package/dist/db/migrations/agent-activity-validation-columns.js +22 -0
- package/dist/db/migrations/agent-activity-validation-columns.js.map +1 -0
- package/dist/db/migrations/agent-metrics-response-avg.d.ts +3 -0
- package/dist/db/migrations/agent-metrics-response-avg.d.ts.map +1 -0
- package/dist/db/migrations/agent-metrics-response-avg.js +19 -0
- package/dist/db/migrations/agent-metrics-response-avg.js.map +1 -0
- package/dist/db/migrations/agent-store-tables.d.ts +3 -0
- package/dist/db/migrations/agent-store-tables.d.ts.map +1 -0
- package/dist/db/migrations/agent-store-tables.js +59 -0
- package/dist/db/migrations/agent-store-tables.js.map +1 -0
- package/dist/db/migrations/token-usage-agent-version.d.ts +3 -0
- package/dist/db/migrations/token-usage-agent-version.d.ts.map +1 -0
- package/dist/db/migrations/token-usage-agent-version.js +16 -0
- package/dist/db/migrations/token-usage-agent-version.js.map +1 -0
- package/dist/db/migrations/validation-session-tables.d.ts +3 -0
- package/dist/db/migrations/validation-session-tables.d.ts.map +1 -0
- package/dist/db/migrations/validation-session-tables.js +59 -0
- package/dist/db/migrations/validation-session-tables.js.map +1 -0
- package/dist/gateways/message-router.d.ts +10 -0
- package/dist/gateways/message-router.d.ts.map +1 -1
- package/dist/gateways/message-router.js +188 -14
- package/dist/gateways/message-router.js.map +1 -1
- package/dist/gateways/types.d.ts +1 -1
- package/dist/gateways/types.d.ts.map +1 -1
- package/dist/multi-agent/agent-process-manager.js +1 -1
- package/dist/multi-agent/agent-process-manager.js.map +1 -1
- package/dist/multi-agent/conductor-persona.d.ts +13 -0
- package/dist/multi-agent/conductor-persona.d.ts.map +1 -0
- package/dist/multi-agent/conductor-persona.js +157 -0
- package/dist/multi-agent/conductor-persona.js.map +1 -0
- package/dist/multi-agent/dashboard-agent-persona.d.ts +1 -1
- package/dist/multi-agent/dashboard-agent-persona.d.ts.map +1 -1
- package/dist/multi-agent/dashboard-agent-persona.js +7 -3
- package/dist/multi-agent/dashboard-agent-persona.js.map +1 -1
- package/dist/multi-agent/delegation-manager.d.ts +5 -0
- package/dist/multi-agent/delegation-manager.d.ts.map +1 -1
- package/dist/multi-agent/delegation-manager.js +37 -0
- package/dist/multi-agent/delegation-manager.js.map +1 -1
- package/dist/multi-agent/ultrawork.d.ts +3 -0
- package/dist/multi-agent/ultrawork.d.ts.map +1 -1
- package/dist/multi-agent/ultrawork.js +9 -0
- package/dist/multi-agent/ultrawork.js.map +1 -1
- package/dist/validation/session-service.d.ts +72 -0
- package/dist/validation/session-service.d.ts.map +1 -0
- package/dist/validation/session-service.js +298 -0
- package/dist/validation/session-service.js.map +1 -0
- package/dist/validation/store.d.ts +25 -0
- package/dist/validation/store.d.ts.map +1 -0
- package/dist/validation/store.js +200 -0
- package/dist/validation/store.js.map +1 -0
- package/dist/validation/types.d.ts +119 -0
- package/dist/validation/types.d.ts.map +1 -0
- package/dist/validation/types.js +57 -0
- package/dist/validation/types.js.map +1 -0
- package/package.json +3 -3
- package/public/viewer/js/modules/agents.js +1148 -0
- package/public/viewer/js/modules/chat.js +20 -11
- package/public/viewer/js/modules/connector-feed.js +35 -0
- package/public/viewer/js/modules/dashboard.js +49 -0
- package/public/viewer/js/modules/memory.js +32 -0
- package/public/viewer/js/modules/settings.js +34 -79
- package/public/viewer/js/modules/wiki.js +59 -4
- package/public/viewer/js/utils/api.js +70 -0
- package/public/viewer/js/utils/dom.js +3 -0
- package/public/viewer/js/utils/ui-commands.js +93 -0
- package/public/viewer/log-viewer.html +2 -2
- package/public/viewer/src/modules/agents.ts +1299 -0
- package/public/viewer/src/modules/chat.ts +23 -14
- package/public/viewer/src/modules/connector-feed.ts +35 -0
- package/public/viewer/src/modules/dashboard.ts +50 -0
- package/public/viewer/src/modules/memory.ts +31 -0
- package/public/viewer/src/modules/settings.ts +36 -96
- package/public/viewer/src/modules/wiki.ts +73 -6
- package/public/viewer/src/types/global.d.ts +0 -9
- package/public/viewer/src/utils/api.ts +156 -2
- package/public/viewer/src/utils/dom.ts +6 -1
- package/public/viewer/src/utils/ui-commands.ts +118 -0
- package/public/viewer/viewer.css +105 -10
- package/public/viewer/viewer.html +1868 -777
- package/scripts/generate-gateway-tools.ts +5 -1
- package/public/viewer/js/modules/playground.js +0 -148
- package/public/viewer/js/modules/skills.js +0 -451
- package/public/viewer/src/modules/playground.ts +0 -173
- package/public/viewer/src/modules/skills.ts +0 -491
- package/templates/playgrounds/cron-workflow-lab.html +0 -1601
- package/templates/playgrounds/mama-log-viewer.html +0 -1341
- package/templates/playgrounds/skill-lab-playground.html +0 -1625
- package/templates/playgrounds/wave-visualizer.html +0 -694
- 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
|