@zenuml/core 3.33.0 → 3.34.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/.kiro/hooks/README.md +38 -0
- package/.kiro/hooks/session-sound-notification.js +44 -0
- package/.kiro/hooks/session-sound-notification.json +23 -0
- package/DEPLOYMENT.md +62 -0
- package/dist/zenuml.esm.mjs +2 -2
- package/dist/zenuml.js +2 -2
- package/index.html +131 -42
- package/package.json +8 -3
- package/renderer.html +366 -0
- package/test-compression.html +274 -0
- package/test-url-params.html +192 -0
- package/vite.config.ts +1 -1
- package/wrangler.toml +12 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Kiro Agent Hooks
|
|
2
|
+
|
|
3
|
+
This directory contains custom hooks that automatically execute when specific events occur in Kiro.
|
|
4
|
+
|
|
5
|
+
## Session Sound Notification Hook
|
|
6
|
+
|
|
7
|
+
**File:** `session-sound-notification.json` and `session-sound-notification.js`
|
|
8
|
+
|
|
9
|
+
**Purpose:** Plays system sounds to notify you when:
|
|
10
|
+
|
|
11
|
+
- An AI session completes
|
|
12
|
+
- User input is required to continue
|
|
13
|
+
- An error occurs
|
|
14
|
+
|
|
15
|
+
**Sounds Used (macOS):**
|
|
16
|
+
|
|
17
|
+
- **Session Complete:** Glass.aiff - A pleasant chime when tasks finish
|
|
18
|
+
- **Input Required:** Sosumi.aiff - An attention-getting sound when you need to respond
|
|
19
|
+
- **Error:** Basso.aiff - A distinctive sound for errors
|
|
20
|
+
- **Default:** Ping.aiff - Fallback sound
|
|
21
|
+
|
|
22
|
+
**Configuration:**
|
|
23
|
+
The hook is enabled by default and will auto-execute. You can disable it by setting `"enabled": false` in the JSON configuration file.
|
|
24
|
+
|
|
25
|
+
**Platform Notes:**
|
|
26
|
+
|
|
27
|
+
- Currently optimized for macOS using the `afplay` command
|
|
28
|
+
- Uses built-in system sounds located in `/System/Library/Sounds/`
|
|
29
|
+
- For other platforms, the sound files and playback command would need to be adjusted
|
|
30
|
+
|
|
31
|
+
## Managing Hooks
|
|
32
|
+
|
|
33
|
+
You can:
|
|
34
|
+
|
|
35
|
+
1. View current hooks in the Kiro Explorer under "Agent Hooks"
|
|
36
|
+
2. Use Command Palette → "Open Kiro Hook UI" to create new hooks
|
|
37
|
+
3. Edit hook files directly in this directory
|
|
38
|
+
4. Enable/disable hooks by modifying the `enabled` property
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Sound Notification Hook
|
|
3
|
+
* Plays a sound when sessions end or user input is required
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const playSound = (soundType = 'default') => {
|
|
7
|
+
// For macOS, we can use the 'afplay' command to play system sounds
|
|
8
|
+
const sounds = {
|
|
9
|
+
default: '/System/Library/Sounds/Ping.aiff',
|
|
10
|
+
complete: '/System/Library/Sounds/Glass.aiff',
|
|
11
|
+
attention: '/System/Library/Sounds/Sosumi.aiff',
|
|
12
|
+
error: '/System/Library/Sounds/Basso.aiff'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const soundFile = sounds[soundType] || sounds.default;
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
// Use afplay to play the sound on macOS
|
|
19
|
+
require('child_process').exec(`afplay "${soundFile}"`, (error) => {
|
|
20
|
+
if (error) {
|
|
21
|
+
console.log('Could not play sound:', error.message);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
} catch (err) {
|
|
25
|
+
console.log('Sound playback failed:', err.message);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports = {
|
|
30
|
+
onSessionEnd: () => {
|
|
31
|
+
console.log('🔊 Session completed - playing completion sound');
|
|
32
|
+
playSound('complete');
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
onUserInputRequired: () => {
|
|
36
|
+
console.log('🔊 User input needed - playing attention sound');
|
|
37
|
+
playSound('attention');
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
onError: () => {
|
|
41
|
+
console.log('🔊 Error occurred - playing error sound');
|
|
42
|
+
playSound('error');
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Session Sound Notification",
|
|
3
|
+
"description": "Plays a sound when a session ends or user input is needed",
|
|
4
|
+
"triggers": [
|
|
5
|
+
{
|
|
6
|
+
"event": "session.end",
|
|
7
|
+
"description": "Triggered when an AI session completes"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"event": "user.input.required",
|
|
11
|
+
"description": "Triggered when the AI needs user input to continue"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"actions": [
|
|
15
|
+
{
|
|
16
|
+
"type": "system.sound",
|
|
17
|
+
"sound": "notification",
|
|
18
|
+
"description": "Play system notification sound"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"autoExecute": true
|
|
23
|
+
}
|
package/DEPLOYMENT.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# ZenUML Web Renderer Deployment
|
|
2
|
+
|
|
3
|
+
This document describes the deployment process for the ZenUML Web Renderer to Cloudflare Pages.
|
|
4
|
+
|
|
5
|
+
## Deployment Strategy
|
|
6
|
+
|
|
7
|
+
- **Production**: Deploys from `main` branch to `zenuml-web-renderer` project
|
|
8
|
+
- **Staging**: Deploys from any non-main branch to `zenuml-web-renderer-staging` project
|
|
9
|
+
|
|
10
|
+
## GitHub Actions Workflow
|
|
11
|
+
|
|
12
|
+
The deployment is automated through GitHub Actions (`.github/workflows/cloudflare-pages.yml`):
|
|
13
|
+
|
|
14
|
+
1. **Triggers**:
|
|
15
|
+
- Push to `main` or `feat/public-renderer` branches
|
|
16
|
+
- Pull requests to `main` branch
|
|
17
|
+
- Only when relevant files are changed (renderer.html, public/**, src/**, etc.)
|
|
18
|
+
|
|
19
|
+
2. **Build Process**:
|
|
20
|
+
- Install dependencies with pnpm
|
|
21
|
+
- Build the site using `pnpm build:site`
|
|
22
|
+
- Deploy to appropriate Cloudflare Pages project
|
|
23
|
+
|
|
24
|
+
## Required Secrets
|
|
25
|
+
|
|
26
|
+
Add these secrets to your GitHub repository settings:
|
|
27
|
+
|
|
28
|
+
- `CLOUDFLARE_API_TOKEN`: Cloudflare API token with Pages permissions
|
|
29
|
+
- `CLOUDFLARE_ACCOUNT_ID`: Your Cloudflare account ID
|
|
30
|
+
|
|
31
|
+
## Manual Deployment
|
|
32
|
+
|
|
33
|
+
You can also deploy manually using wrangler:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Deploy to staging
|
|
37
|
+
pnpm pages:deploy:staging
|
|
38
|
+
|
|
39
|
+
# Deploy to production
|
|
40
|
+
pnpm pages:deploy
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Project Structure
|
|
44
|
+
|
|
45
|
+
- `renderer.html`: Main renderer page (root level)
|
|
46
|
+
- `public/renderer.html`: Copy of renderer page for static hosting
|
|
47
|
+
- `dist/`: Build output directory (created by `pnpm build:site`)
|
|
48
|
+
- `wrangler.toml`: Cloudflare configuration
|
|
49
|
+
|
|
50
|
+
## URLs
|
|
51
|
+
|
|
52
|
+
- **Production**: `https://zenuml-web-renderer.pages.dev`
|
|
53
|
+
- **Staging**: `https://zenuml-web-renderer-staging.pages.dev`
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
Once deployed, you can use the renderer by visiting:
|
|
58
|
+
- `https://your-domain.pages.dev/renderer.html`
|
|
59
|
+
- `https://your-domain.pages.dev/` (if configured as index)
|
|
60
|
+
|
|
61
|
+
Future URL parameter support will allow:
|
|
62
|
+
- `https://your-domain.pages.dev/renderer.html?code=<base64-encoded-zenuml>`
|