@plures/runebook 0.4.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 (148) hide show
  1. package/ANALYSIS_LADDER.md +231 -0
  2. package/CHANGELOG.md +124 -0
  3. package/INTEGRATIONS.md +242 -0
  4. package/LICENSE +21 -0
  5. package/MEMORY.md +253 -0
  6. package/NIXOS.md +357 -0
  7. package/QUICKSTART.md +157 -0
  8. package/README.md +295 -0
  9. package/RELEASE.md +190 -0
  10. package/ValidationChecklist.md +598 -0
  11. package/docs/demo.md +338 -0
  12. package/docs/llm-integration.md +300 -0
  13. package/docs/parallel-execution-plan.md +160 -0
  14. package/flake.nix +228 -0
  15. package/integrations/README.md +242 -0
  16. package/integrations/demo-steps.sh +64 -0
  17. package/integrations/nvim-runebook.lua +140 -0
  18. package/integrations/tmux-status.sh +51 -0
  19. package/integrations/vim-runebook.vim +77 -0
  20. package/integrations/wezterm-status-simple.lua +48 -0
  21. package/integrations/wezterm-status.lua +76 -0
  22. package/nixos-module.nix +156 -0
  23. package/package.json +76 -0
  24. package/packages/design-dojo/index.js +4 -0
  25. package/packages/design-dojo/package.json +20 -0
  26. package/packages/design-dojo/tokens.css +69 -0
  27. package/playwright.config.ts +16 -0
  28. package/scripts/check-versions.cjs +62 -0
  29. package/scripts/demo.sh +220 -0
  30. package/shell.nix +31 -0
  31. package/src/app.html +13 -0
  32. package/src/cli/index.ts +1050 -0
  33. package/src/lib/agent/analysis-pipeline.ts +347 -0
  34. package/src/lib/agent/analysis-service.ts +171 -0
  35. package/src/lib/agent/analysis.ts +159 -0
  36. package/src/lib/agent/analyzers/heuristic.ts +289 -0
  37. package/src/lib/agent/analyzers/index.ts +7 -0
  38. package/src/lib/agent/analyzers/llm.ts +204 -0
  39. package/src/lib/agent/analyzers/local-search.ts +215 -0
  40. package/src/lib/agent/capture.ts +123 -0
  41. package/src/lib/agent/index.ts +244 -0
  42. package/src/lib/agent/integration.ts +81 -0
  43. package/src/lib/agent/llm/providers/base.ts +99 -0
  44. package/src/lib/agent/llm/providers/index.ts +60 -0
  45. package/src/lib/agent/llm/providers/mock.ts +67 -0
  46. package/src/lib/agent/llm/providers/ollama.ts +151 -0
  47. package/src/lib/agent/llm/providers/openai.ts +153 -0
  48. package/src/lib/agent/llm/sanitizer.ts +170 -0
  49. package/src/lib/agent/llm/types.ts +118 -0
  50. package/src/lib/agent/memory.ts +363 -0
  51. package/src/lib/agent/node-status.ts +56 -0
  52. package/src/lib/agent/node-suggestions.ts +64 -0
  53. package/src/lib/agent/status.ts +80 -0
  54. package/src/lib/agent/suggestions.ts +169 -0
  55. package/src/lib/components/Canvas.svelte +124 -0
  56. package/src/lib/components/ConnectionLine.svelte +46 -0
  57. package/src/lib/components/DisplayNode.svelte +167 -0
  58. package/src/lib/components/InputNode.svelte +158 -0
  59. package/src/lib/components/TerminalNode.svelte +237 -0
  60. package/src/lib/components/Toolbar.svelte +359 -0
  61. package/src/lib/components/TransformNode.svelte +327 -0
  62. package/src/lib/core/index.ts +31 -0
  63. package/src/lib/core/observer.ts +278 -0
  64. package/src/lib/core/redaction.ts +158 -0
  65. package/src/lib/core/shell-adapters/base.ts +325 -0
  66. package/src/lib/core/shell-adapters/bash.ts +110 -0
  67. package/src/lib/core/shell-adapters/index.ts +62 -0
  68. package/src/lib/core/shell-adapters/zsh.ts +105 -0
  69. package/src/lib/core/storage.ts +360 -0
  70. package/src/lib/core/types.ts +176 -0
  71. package/src/lib/design-dojo/Box.svelte +47 -0
  72. package/src/lib/design-dojo/Button.svelte +75 -0
  73. package/src/lib/design-dojo/Input.svelte +65 -0
  74. package/src/lib/design-dojo/List.svelte +38 -0
  75. package/src/lib/design-dojo/Select.svelte +48 -0
  76. package/src/lib/design-dojo/SplitPane.svelte +43 -0
  77. package/src/lib/design-dojo/StatusBar.svelte +61 -0
  78. package/src/lib/design-dojo/Table.svelte +47 -0
  79. package/src/lib/design-dojo/Text.svelte +36 -0
  80. package/src/lib/design-dojo/Toggle.svelte +48 -0
  81. package/src/lib/design-dojo/index.ts +10 -0
  82. package/src/lib/stores/canvas-praxis.ts +268 -0
  83. package/src/lib/stores/canvas.ts +58 -0
  84. package/src/lib/types/agent.ts +78 -0
  85. package/src/lib/types/canvas.ts +71 -0
  86. package/src/lib/utils/storage.ts +326 -0
  87. package/src/lib/utils/yaml-loader.ts +52 -0
  88. package/src/routes/+layout.svelte +5 -0
  89. package/src/routes/+layout.ts +5 -0
  90. package/src/routes/+page.svelte +32 -0
  91. package/src-tauri/Cargo.lock +5735 -0
  92. package/src-tauri/Cargo.toml +38 -0
  93. package/src-tauri/build.rs +3 -0
  94. package/src-tauri/capabilities/default.json +10 -0
  95. package/src-tauri/icons/128x128.png +0 -0
  96. package/src-tauri/icons/128x128@2x.png +0 -0
  97. package/src-tauri/icons/32x32.png +0 -0
  98. package/src-tauri/icons/Square107x107Logo.png +0 -0
  99. package/src-tauri/icons/Square142x142Logo.png +0 -0
  100. package/src-tauri/icons/Square150x150Logo.png +0 -0
  101. package/src-tauri/icons/Square284x284Logo.png +0 -0
  102. package/src-tauri/icons/Square30x30Logo.png +0 -0
  103. package/src-tauri/icons/Square310x310Logo.png +0 -0
  104. package/src-tauri/icons/Square44x44Logo.png +0 -0
  105. package/src-tauri/icons/Square71x71Logo.png +0 -0
  106. package/src-tauri/icons/Square89x89Logo.png +0 -0
  107. package/src-tauri/icons/StoreLogo.png +0 -0
  108. package/src-tauri/icons/icon.icns +0 -0
  109. package/src-tauri/icons/icon.ico +0 -0
  110. package/src-tauri/icons/icon.png +0 -0
  111. package/src-tauri/src/agents/agent1.rs +66 -0
  112. package/src-tauri/src/agents/agent2.rs +80 -0
  113. package/src-tauri/src/agents/agent3.rs +73 -0
  114. package/src-tauri/src/agents/agent4.rs +66 -0
  115. package/src-tauri/src/agents/agent5.rs +68 -0
  116. package/src-tauri/src/agents/agent6.rs +75 -0
  117. package/src-tauri/src/agents/base.rs +52 -0
  118. package/src-tauri/src/agents/mod.rs +17 -0
  119. package/src-tauri/src/core/coordination.rs +117 -0
  120. package/src-tauri/src/core/mod.rs +12 -0
  121. package/src-tauri/src/core/ownership.rs +61 -0
  122. package/src-tauri/src/core/types.rs +132 -0
  123. package/src-tauri/src/execution/mod.rs +5 -0
  124. package/src-tauri/src/execution/runner.rs +143 -0
  125. package/src-tauri/src/lib.rs +161 -0
  126. package/src-tauri/src/main.rs +6 -0
  127. package/src-tauri/src/memory/api.rs +422 -0
  128. package/src-tauri/src/memory/client.rs +156 -0
  129. package/src-tauri/src/memory/encryption.rs +79 -0
  130. package/src-tauri/src/memory/migration.rs +110 -0
  131. package/src-tauri/src/memory/mod.rs +28 -0
  132. package/src-tauri/src/memory/schema.rs +275 -0
  133. package/src-tauri/src/memory/tests.rs +192 -0
  134. package/src-tauri/src/orchestrator/coordinator.rs +232 -0
  135. package/src-tauri/src/orchestrator/mod.rs +13 -0
  136. package/src-tauri/src/orchestrator/planner.rs +304 -0
  137. package/src-tauri/tauri.conf.json +35 -0
  138. package/static/examples/date-time-example.yaml +147 -0
  139. package/static/examples/hello-world.yaml +74 -0
  140. package/static/examples/transform-example.yaml +157 -0
  141. package/static/favicon.png +0 -0
  142. package/static/svelte.svg +1 -0
  143. package/static/tauri.svg +6 -0
  144. package/static/vite.svg +1 -0
  145. package/svelte.config.js +18 -0
  146. package/tsconfig.json +19 -0
  147. package/vite.config.js +45 -0
  148. package/vitest.config.ts +21 -0
package/QUICKSTART.md ADDED
@@ -0,0 +1,157 @@
1
+ # Quick Start Guide
2
+
3
+ ## Installation
4
+
5
+ 1. **Install prerequisites:**
6
+ - Node.js 20.x or higher
7
+ - Rust 1.70 or higher
8
+ - Platform-specific dependencies (see main README)
9
+
10
+ 2. **Clone and install:**
11
+ ```bash
12
+ git clone https://github.com/plures/runebook.git
13
+ cd runebook
14
+ npm install
15
+ ```
16
+
17
+ 3. **Run in development mode:**
18
+ ```bash
19
+ npm run tauri dev
20
+ ```
21
+
22
+ ## Your First Canvas
23
+
24
+ When RuneBook starts, you'll see:
25
+ - A **dark canvas** (the main workspace)
26
+ - A **toolbar** on the left with buttons to add nodes
27
+ - An empty workspace ready for nodes
28
+
29
+ ### Creating a Simple Workflow
30
+
31
+ 1. **Add a Terminal Node:**
32
+ - Click "⚡ Terminal" in the toolbar
33
+ - A terminal node appears on the canvas
34
+ - The default command is `echo Hello, RuneBook!`
35
+
36
+ 2. **Add a Display Node:**
37
+ - Click "📊 Display" in the toolbar
38
+ - A display node appears on the canvas
39
+ - This will show the output from the terminal
40
+
41
+ 3. **Run the Terminal:**
42
+ - Click the "▶ Run" button on the terminal node
43
+ - You'll see the output appear in the terminal node's output area
44
+
45
+ 4. **Try an Input Node:**
46
+ - Click "📝 Input" in the toolbar
47
+ - An input node appears with a text field
48
+ - Type something and see it update in real-time
49
+
50
+ ### Moving Nodes
51
+
52
+ - Click and drag any node to reposition it on the canvas
53
+ - Nodes can be placed anywhere on the infinite canvas
54
+
55
+ ### Loading Examples
56
+
57
+ 1. Click "📂 Load Example" in the toolbar
58
+ 2. The hello-world example will load with:
59
+ - A terminal that runs `echo`
60
+ - An input widget
61
+ - Two display panels showing outputs
62
+
63
+ ### Saving Your Work
64
+
65
+ 1. Create your canvas layout
66
+ 2. Click "💾 Save" in the toolbar
67
+ 3. A YAML file downloads with your canvas definition
68
+
69
+ ## Common Terminal Commands
70
+
71
+ Here are some useful commands to try in terminal nodes:
72
+
73
+ ```bash
74
+ # Show current date
75
+ date
76
+
77
+ # List files
78
+ ls -la
79
+
80
+ # Show current directory
81
+ pwd
82
+
83
+ # Echo with variables
84
+ echo "Current user: $USER"
85
+
86
+ # Count files
87
+ ls | wc -l
88
+
89
+ # Show system info
90
+ uname -a
91
+ ```
92
+
93
+ ## Input Node Types
94
+
95
+ RuneBook supports several input types:
96
+
97
+ - **Text**: Free-form text input
98
+ - **Number**: Numeric values with optional min/max/step
99
+ - **Checkbox**: Boolean true/false toggle
100
+ - **Slider**: Visual range selector
101
+
102
+ ## Display Types
103
+
104
+ Display nodes can show data in different formats:
105
+
106
+ - **Text**: Plain text display
107
+ - **JSON**: Formatted JSON with syntax highlighting
108
+ - **Table**: Tabular data (for arrays of objects)
109
+
110
+ ## Next Steps
111
+
112
+ - Explore the example canvases in `/static/examples/`
113
+ - Read the full documentation in README.md
114
+ - Check INTEGRATIONS.md for upcoming features
115
+ - Experiment with different terminal commands
116
+ - Create custom workflows for your tasks
117
+
118
+ ## Tips
119
+
120
+ - Use the terminal's "Clear" button to reset output
121
+ - Drag nodes to organize your workspace
122
+ - Save frequently to preserve your work
123
+ - Terminal nodes can use environment variables
124
+ - Multiple display nodes can show the same data
125
+
126
+ ## Troubleshooting
127
+
128
+ **Terminal commands don't execute:**
129
+ - Check that the command is in your system PATH
130
+ - Verify command syntax is correct
131
+ - Check terminal output for error messages
132
+
133
+ **Can't see node output:**
134
+ - Ensure the terminal node has run successfully
135
+ - Check for errors in the terminal node
136
+ - Try the "Clear" button and run again
137
+
138
+ **Load Example doesn't work:**
139
+ - Ensure the examples directory exists: `/static/examples/`
140
+ - Check browser console for error messages
141
+ - Verify YAML files are properly formatted
142
+
143
+ ## keyboard Shortcuts (Coming Soon)
144
+
145
+ Future versions will include:
146
+ - Ctrl/Cmd + S: Save canvas
147
+ - Ctrl/Cmd + O: Load canvas
148
+ - Delete: Remove selected node
149
+ - Ctrl/Cmd + Z: Undo
150
+ - Ctrl/Cmd + Y: Redo
151
+
152
+ ## Learn More
153
+
154
+ - [Full README](README.md) - Complete documentation
155
+ - [Integration Plans](INTEGRATIONS.md) - Future features
156
+ - [Tauri Documentation](https://tauri.app/) - Desktop app framework
157
+ - [Svelte 5 Guide](https://svelte.dev/) - UI framework
package/README.md ADDED
@@ -0,0 +1,295 @@
1
+ # RuneBook
2
+
3
+ RuneBook is a reactive, canvas-native computing environment that merges terminals, notebooks, and web components. Built on Svelte 5, PluresDB, Tauri, and Sudolang, RuneBook lets you wire terminals, inputs, and UI components on a visual canvas to create programmable, AI-enhanced workflows that behave like reactive web apps.
4
+
5
+ ## Features
6
+
7
+ - **Visual Canvas Interface**: Drag-and-drop nodes on an infinite canvas
8
+ - **Terminal Nodes**: Execute shell commands with reactive output
9
+ - **Input Widgets**: Text inputs, sliders, checkboxes, and number inputs
10
+ - **Transform Nodes**: Process data with map, filter, and reduce operations
11
+ - **Display Components**: Visualize data as text, JSON, or tables
12
+ - **Reactive Data Flow**: Node outputs automatically flow to connected inputs
13
+ - **YAML Canvas Definitions**: Save and load canvas configurations
14
+ - **Ambient Agent Mode**: Intelligent command analysis and suggestions (opt-in)
15
+ - **Headless CLI**: SSH-friendly interface for agent management
16
+ - **Cross-Platform**: Windows, macOS, and Linux support
17
+
18
+ See [CHANGELOG.md](./CHANGELOG.md) for version history.
19
+
20
+ ## Installation
21
+
22
+ ### Download Pre-built Binaries
23
+
24
+ Download the latest release for your platform from [GitHub Releases](https://github.com/plures/runebook/releases):
25
+
26
+ - **macOS**: `.dmg` file (Intel and Apple Silicon)
27
+ - **Linux**: `.AppImage` or `.deb` file
28
+ - **Windows**: `.msi` or `.exe` installer
29
+
30
+ ### Package Managers
31
+
32
+ **npm**:
33
+ ```bash
34
+ npm install -g @plures/runebook
35
+ ```
36
+
37
+ **NixOS / Nix Flakes**:
38
+ ```bash
39
+ # Run directly from flake
40
+ nix run github:plures/runebook
41
+
42
+ # Build packages
43
+ nix build github:plures/runebook#runebook
44
+ nix build github:plures/runebook#runebook-agent
45
+ ```
46
+
47
+ ## Development Setup
48
+
49
+ ### Prerequisites
50
+
51
+ - Node.js 20.x or higher
52
+ - Rust 1.70 or higher
53
+ - Platform-specific dependencies:
54
+ - **Linux**: webkit2gtk, rsvg2 (see [Tauri prerequisites](https://tauri.app/guides/prerequisites/#linux))
55
+ - **macOS**: Xcode Command Line Tools
56
+ - **Windows**: Microsoft C++ Build Tools
57
+ - **NixOS**: Use `nix develop` (includes all dependencies)
58
+
59
+ ### Build from Source
60
+
61
+ 1. Clone the repository:
62
+ ```bash
63
+ git clone https://github.com/plures/runebook.git
64
+ cd runebook
65
+ ```
66
+
67
+ 2. Install dependencies:
68
+ ```bash
69
+ npm install
70
+ ```
71
+
72
+ 3. Run in development mode:
73
+ ```bash
74
+ npm run tauri dev
75
+ ```
76
+
77
+ 4. Build for production:
78
+ ```bash
79
+ npm run tauri build
80
+ ```
81
+
82
+ ### NixOS Support
83
+
84
+ **Development:**
85
+ ```bash
86
+ nix develop # Enter development shell
87
+ npm install
88
+ npm run dev
89
+ ```
90
+
91
+ **Building:**
92
+ ```bash
93
+ nix build .#runebook # Build Tauri app
94
+ nix build .#runebook-agent # Build headless agent CLI
95
+ ```
96
+
97
+ **Running:**
98
+ ```bash
99
+ nix run .#runebook # Run Tauri app
100
+ nix run .#runebook-agent -- agent status # Run agent CLI
101
+ ```
102
+
103
+ The flake includes a NixOS module for running `runebook-agent` as a systemd service. See [NIXOS.md](./NIXOS.md) for configuration details.
104
+
105
+ ## Usage
106
+
107
+ ### Creating Nodes
108
+
109
+ Use the toolbar to add nodes to the canvas:
110
+
111
+ - **⚡ Terminal**: Execute shell commands
112
+ - **📝 Input**: Create user input widgets
113
+ - **🔄 Transform**: Process and transform data
114
+ - **📊 Display**: Show data and outputs
115
+
116
+ ### Connecting Nodes
117
+
118
+ 1. Click and drag from an output port (right side of a node)
119
+ 2. Drop on an input port (left side of another node)
120
+ 3. Data flows automatically from output to input
121
+
122
+ ### Saving and Loading
123
+
124
+ **Save Options:**
125
+ - **Browser Storage**: Save to localStorage (click "💾 Save to Storage")
126
+ - **PluresDB Storage**: P2P-enabled persistent storage (requires PluresDB server)
127
+ - **Export YAML**: Download canvas as a file (click "📥 Export YAML")
128
+
129
+ **Load Options:**
130
+ - **Saved Canvases**: Click "📚 Saved Canvases" to view your saved work
131
+ - **Load Example**: Click "📂 Load Example" to try pre-built demos
132
+
133
+ ### Ambient Agent Mode
134
+
135
+ The Ambient Agent analyzes your terminal commands and provides intelligent suggestions. This feature runs in the background and operates entirely locally—no data leaves your machine.
136
+
137
+ **Features:**
138
+ - Captures terminal commands and outcomes automatically
139
+ - Analyzes patterns in command usage (frequency, success rates, performance)
140
+ - Suggests optimizations, shortcuts, and warnings
141
+ - Provides context-aware remediation suggestions for failures
142
+ - Uses multi-layer analysis (heuristics, local search, optional LLM)
143
+
144
+ **Enable via CLI:**
145
+ ```bash
146
+ # Enable the agent
147
+ npm run agent enable
148
+
149
+ # Check status
150
+ npm run agent status
151
+
152
+ # View suggestions
153
+ npm run agent suggestions
154
+
155
+ # View recent events
156
+ npm run agent events 20
157
+
158
+ # Analyze last failure
159
+ npm run analyze last
160
+ ```
161
+
162
+ **Enable via Observer:**
163
+ ```bash
164
+ # Enable terminal observer (captures all shell commands)
165
+ npm run observer enable
166
+
167
+ # View events in real-time
168
+ npm run observer events tail
169
+
170
+ # View recent events
171
+ npm run observer events 20
172
+ ```
173
+
174
+ **What Data is Stored:**
175
+
176
+ All data is stored locally:
177
+ - Command names, arguments, and outputs
178
+ - Working directory
179
+ - Environment variables (secrets automatically redacted)
180
+ - Exit codes and execution duration
181
+ - Command patterns and error classifications
182
+ - Generated suggestions with confidence scores
183
+
184
+ **Storage locations:**
185
+ - Observer events: `~/.runebook/observer/events.json`
186
+ - Agent config: `~/.runebook/agent-config.json`
187
+ - PluresDB data: `./pluresdb-data` (if PluresDB enabled)
188
+
189
+ **Privacy & Security:**
190
+ - All data stored locally—never sent to external services
191
+ - Secrets automatically redacted (API keys, tokens, passwords)
192
+ - Opt-in by default (disabled until explicitly enabled)
193
+ - Configurable retention period (default: 30 days)
194
+
195
+ **CLI Commands:**
196
+
197
+ Agent:
198
+ - `npm run agent enable|disable|status`
199
+ - `npm run agent suggestions [priority]`
200
+ - `npm run agent events [limit]`
201
+ - `npm run agent clear [days]`
202
+
203
+ Observer:
204
+ - `npm run observer enable|disable|status`
205
+ - `npm run observer events [limit]`
206
+ - `npm run observer events tail`
207
+
208
+ Analysis:
209
+ - `npm run analyze last`
210
+
211
+ Memory:
212
+ - `npm run memory inspect`
213
+
214
+ For detailed documentation, see:
215
+ - [ARCHITECTURE.md](./ARCHITECTURE.md) - Technical architecture
216
+ - [ANALYSIS_LADDER.md](./ANALYSIS_LADDER.md) - Analysis system
217
+ - [MEMORY.md](./MEMORY.md) - Memory storage schema
218
+
219
+ ## Architecture
220
+
221
+ **Stack:**
222
+ - **Frontend**: Svelte 5 with SvelteKit
223
+ - **State Management**: Praxis reactive logic engine
224
+ - **Backend**: Tauri (Rust) for native system access
225
+ - **Storage**: PluresDB for P2P-enabled persistent storage
226
+ - **Serialization**: YAML for canvas definitions
227
+
228
+ **Project Structure:**
229
+ ```
230
+ runebook/
231
+ ├── src/
232
+ │ ├── lib/
233
+ │ │ ├── components/ # Svelte components
234
+ │ │ ├── agent/ # Agent system
235
+ │ │ ├── core/ # Core utilities
236
+ │ │ └── types/ # TypeScript types
237
+ │ ├── cli/ # CLI commands
238
+ │ └── routes/ # SvelteKit routes
239
+ ├── src-tauri/
240
+ │ ├── src/ # Rust backend
241
+ │ │ ├── agents/ # Agent implementations
242
+ │ │ ├── orchestrator/ # Orchestration logic
243
+ │ │ ├── execution/ # Command execution
244
+ │ │ └── memory/ # Memory/storage
245
+ │ └── Cargo.toml # Rust dependencies
246
+ ├── static/
247
+ │ └── examples/ # Example canvas files
248
+ └── flake.nix # Nix build configuration
249
+ ```
250
+
251
+ ## Security
252
+
253
+ ### Command Execution
254
+
255
+ - **Direct Execution**: Commands use Rust's `std::process::Command` (no shell interpretation)
256
+ - **No Shell Injection**: Command strings like `ls | grep` won't work as pipelines
257
+ - **User Permissions**: Commands run with your user account permissions
258
+ - **Environment Validation**: Variable names validated to prevent injection
259
+
260
+ ### Transform Nodes
261
+
262
+ Transform nodes execute user-provided JavaScript:
263
+
264
+ - **Local Execution**: Runs in browser/app context only
265
+ - **No Sandboxing**: Has same permissions as the application
266
+ - **User Responsibility**: Only use code you trust
267
+ - **Strict Mode**: JavaScript strict mode enforced
268
+
269
+ ### Best Practices
270
+
271
+ - Only run commands you trust
272
+ - Review canvas files before loading from unknown sources
273
+ - Avoid storing secrets in canvas definitions
274
+ - Use environment variables for sensitive data
275
+
276
+ ## Contributing
277
+
278
+ Contributions are welcome! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before submitting PRs.
279
+
280
+ ### For Maintainers
281
+
282
+ - **Releases**: See [RELEASE.md](./RELEASE.md) for release process
283
+ - **Workflows**: See [.github/WORKFLOWS.md](./.github/WORKFLOWS.md) for CI/CD documentation
284
+
285
+ ## License
286
+
287
+ MIT License - see LICENSE file for details.
288
+
289
+ ## Recommended IDE Setup
290
+
291
+ [VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
292
+
293
+ ## Acknowledgments
294
+
295
+ Built with [Tauri](https://tauri.app/) and [Svelte 5](https://svelte.dev/). Inspired by node-based editors like Blender's Shader Editor and Unreal Engine's Blueprints.
package/RELEASE.md ADDED
@@ -0,0 +1,190 @@
1
+ # Quick Start Guide for CI/CD Workflows
2
+
3
+ This guide provides a quick overview of the automated CI/CD workflows for RuneBook maintainers.
4
+
5
+ ## Quick Links
6
+
7
+ - **Full Documentation**: [.github/WORKFLOWS.md](./.github/WORKFLOWS.md)
8
+ - **Contributing Guide**: [CONTRIBUTING.md](./CONTRIBUTING.md)
9
+ - **Release Checklist**: [.github/ISSUE_TEMPLATE/release-checklist.md](./.github/ISSUE_TEMPLATE/release-checklist.md)
10
+
11
+ ## Making a Release
12
+
13
+ ### 1. Prepare for Release
14
+
15
+ ```bash
16
+ # Ensure all changes are merged to main
17
+ git checkout main
18
+ git pull origin main
19
+
20
+ # Verify versions are synchronized
21
+ npm run version:check
22
+ ```
23
+
24
+ ### 2. Bump Version
25
+
26
+ 1. Go to [GitHub Actions](https://github.com/plures/runebook/actions)
27
+ 2. Select "Version Bump" workflow
28
+ 3. Click "Run workflow"
29
+ 4. Choose version type:
30
+ - **patch**: Bug fixes (0.2.0 → 0.2.1)
31
+ - **minor**: New features (0.2.0 → 0.3.0)
32
+ - **major**: Breaking changes (0.2.0 → 1.0.0)
33
+ 5. Click "Run workflow" button
34
+
35
+ The workflow will:
36
+ - Update version in all files
37
+ - Commit changes
38
+ - Create git tag
39
+ - Create draft GitHub Release
40
+
41
+ ### 3. Finalize Release
42
+
43
+ 1. Go to [Releases](https://github.com/plures/runebook/releases)
44
+ 2. Find the draft release
45
+ 3. Edit the release notes
46
+ 4. Update CHANGELOG.md if needed
47
+ 5. Click "Publish release"
48
+
49
+ This will trigger the Build and Publish workflow that:
50
+ - Builds for all platforms (macOS Intel/Apple Silicon, Linux, Windows)
51
+ - Uploads binaries to GitHub Release automatically
52
+ - Publishes to npm registry
53
+ - Publishes to GitHub Packages
54
+ - Submits to winget (if configured)
55
+ - Builds Nix packages for NixOS distribution
56
+
57
+ ### 4. Verify Release
58
+
59
+ ```bash
60
+ # Check npm package
61
+ npm view @plures/runebook
62
+
63
+ # Check GitHub Packages
64
+ # Visit: https://github.com/plures/runebook/packages
65
+
66
+ # Check GitHub Release (verify binaries are uploaded)
67
+ # Visit: https://github.com/plures/runebook/releases
68
+
69
+ # Verify Nix packages (if nixos-publish job ran)
70
+ # Check workflow artifacts for nix-packages
71
+ ```
72
+
73
+ ## Setup (First Time Only)
74
+
75
+ ### Configure Repository Secrets
76
+
77
+ 1. Go to Settings → Secrets and variables → Actions
78
+ 2. Add these secrets:
79
+ - **NPM_TOKEN**: Create at npmjs.com → Access Tokens
80
+ - **WINGET_GITHUB_TOKEN**: GitHub PAT with `public_repo` scope (optional)
81
+
82
+ ### Enable Workflow Permissions
83
+
84
+ 1. Go to Settings → Actions → General
85
+ 2. Under "Workflow permissions":
86
+ - Select "Read and write permissions"
87
+ - Check "Allow GitHub Actions to create and approve pull requests"
88
+ 3. Click "Save"
89
+
90
+ ## Common Tasks
91
+
92
+ ### Check Version Synchronization
93
+
94
+ ```bash
95
+ npm run version:check
96
+ ```
97
+
98
+ ### Manual Build Test
99
+
100
+ ```bash
101
+ # Frontend
102
+ npm run build
103
+
104
+ # Full Tauri build
105
+ npm run tauri build
106
+ ```
107
+
108
+ ### View Workflow Runs
109
+
110
+ ```bash
111
+ # Using GitHub CLI
112
+ gh run list --workflow=version-bump.yml
113
+ gh run list --workflow=publish-release.yml
114
+
115
+ # View details
116
+ gh run view <run-id>
117
+ ```
118
+
119
+ ## Troubleshooting
120
+
121
+ ### Workflow Fails
122
+
123
+ 1. Check workflow logs in Actions tab
124
+ 2. Look for error messages in red
125
+ 3. Common issues:
126
+ - Missing secrets (NPM_TOKEN)
127
+ - Permission issues (workflow permissions)
128
+ - Build errors (check build logs)
129
+
130
+ ### Version Mismatch
131
+
132
+ If versions get out of sync:
133
+
134
+ ```bash
135
+ # Fix manually
136
+ # 1. Update package.json version
137
+ # 2. Run: npm install
138
+ # 3. Update src-tauri/Cargo.toml version
139
+ # 4. Run: cd src-tauri && cargo update -p runebook
140
+ # 5. Update src-tauri/tauri.conf.json version
141
+ # 6. Verify: npm run version:check
142
+ ```
143
+
144
+ Or use the Version Bump workflow to re-sync.
145
+
146
+ ### npm Publish Fails
147
+
148
+ 1. Verify NPM_TOKEN is configured
149
+ 2. Check token hasn't expired
150
+ 3. Ensure package name `@plures/runebook` is available
151
+ 4. Verify you have permissions to publish to `@plures` scope
152
+
153
+ ## Package Distribution
154
+
155
+ After release, users can install RuneBook via:
156
+
157
+ **npm**:
158
+ ```bash
159
+ npm install -g @plures/runebook
160
+ ```
161
+
162
+ **GitHub Packages**:
163
+ ```bash
164
+ npm config set @plures:registry https://npm.pkg.github.com
165
+ npm install -g @plures/runebook
166
+ ```
167
+
168
+ **winget** (Windows):
169
+ ```powershell
170
+ winget install Plures.RuneBook
171
+ ```
172
+
173
+ **NixOS / Nix Flakes**:
174
+ ```bash
175
+ # Direct flake usage
176
+ nix run github:plures/runebook
177
+
178
+ # Or add to your flake inputs
179
+ # runebook.url = "github:plures/runebook";
180
+ ```
181
+
182
+ **Direct Download**:
183
+ - Visit [GitHub Releases](https://github.com/plures/runebook/releases)
184
+ - Download platform-specific installers (.dmg, .AppImage, .msi, .exe)
185
+
186
+ ## Need Help?
187
+
188
+ - Read the [full documentation](./.github/WORKFLOWS.md)
189
+ - Check the [troubleshooting guide](./.github/WORKFLOWS.md#troubleshooting)
190
+ - Open an issue if you need assistance