sdn-flow 0.2.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 (69) hide show
  1. package/.claude/SKILLS.md +7 -0
  2. package/.claude/skills/sdn-plugin-abi-compliance/SKILL.md +56 -0
  3. package/.claude/todo/001-js-host-startup-and-deno.md +85 -0
  4. package/LICENSE +21 -0
  5. package/README.md +223 -0
  6. package/bin/sdn-flow-host.js +169 -0
  7. package/docs/.nojekyll +0 -0
  8. package/docs/ARCHITECTURE.md +200 -0
  9. package/docs/HOST_CAPABILITY_MODEL.md +317 -0
  10. package/docs/PLUGIN_ARCHITECTURE.md +145 -0
  11. package/docs/PLUGIN_COMPATIBILITY.md +61 -0
  12. package/docs/PLUGIN_COMPLIANCE_CHECKS.md +82 -0
  13. package/docs/PLUGIN_MANIFEST.md +94 -0
  14. package/docs/css/style.css +465 -0
  15. package/docs/index.html +218 -0
  16. package/docs/js/app.mjs +751 -0
  17. package/docs/js/editor-panel.mjs +203 -0
  18. package/docs/js/flow-canvas.mjs +515 -0
  19. package/docs/js/flow-model.mjs +391 -0
  20. package/docs/js/workers/emception.worker.js +146 -0
  21. package/docs/js/workers/pyodide.worker.js +134 -0
  22. package/native/flow_source_generator.cpp +1958 -0
  23. package/package.json +67 -0
  24. package/schemas/FlowRuntimeAbi.fbs +91 -0
  25. package/src/auth/canonicalize.js +5 -0
  26. package/src/auth/index.js +11 -0
  27. package/src/auth/permissions.js +8 -0
  28. package/src/compiler/CppFlowSourceGenerator.js +475 -0
  29. package/src/compiler/EmceptionCompilerAdapter.js +244 -0
  30. package/src/compiler/SignedArtifactCatalog.js +152 -0
  31. package/src/compiler/index.js +8 -0
  32. package/src/compiler/nativeFlowSourceGeneratorTool.js +144 -0
  33. package/src/compliance/index.js +13 -0
  34. package/src/compliance/pluginCompliance.js +11 -0
  35. package/src/deploy/FlowDeploymentClient.js +532 -0
  36. package/src/deploy/index.js +8 -0
  37. package/src/designer/FlowDesignerSession.js +158 -0
  38. package/src/designer/index.js +2 -0
  39. package/src/designer/requirements.js +184 -0
  40. package/src/generated/runtimeAbiLayouts.js +544 -0
  41. package/src/host/appHost.js +105 -0
  42. package/src/host/autoHost.js +113 -0
  43. package/src/host/browserHostAdapters.js +108 -0
  44. package/src/host/compiledFlowRuntimeHost.js +703 -0
  45. package/src/host/constants.js +55 -0
  46. package/src/host/dependencyRuntime.js +227 -0
  47. package/src/host/descriptorAbi.js +351 -0
  48. package/src/host/fetchService.js +237 -0
  49. package/src/host/httpHostAdapters.js +280 -0
  50. package/src/host/index.js +91 -0
  51. package/src/host/installedFlowHost.js +885 -0
  52. package/src/host/invocationAbi.js +440 -0
  53. package/src/host/normalize.js +372 -0
  54. package/src/host/packageManagers.js +369 -0
  55. package/src/host/profile.js +134 -0
  56. package/src/host/runtimeAbi.js +106 -0
  57. package/src/host/workspace.js +895 -0
  58. package/src/index.js +8 -0
  59. package/src/runtime/FlowRuntime.js +273 -0
  60. package/src/runtime/MethodRegistry.js +295 -0
  61. package/src/runtime/constants.js +44 -0
  62. package/src/runtime/index.js +19 -0
  63. package/src/runtime/normalize.js +377 -0
  64. package/src/transport/index.js +7 -0
  65. package/src/transport/pki.js +7 -0
  66. package/src/utils/crypto.js +7 -0
  67. package/src/utils/encoding.js +65 -0
  68. package/src/utils/wasmCrypto.js +69 -0
  69. package/tools/run-plugin-compliance-check.mjs +153 -0
@@ -0,0 +1,218 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>sdn-flow IDE</title>
7
+ <link rel="stylesheet" href="css/style.css">
8
+ <script type="importmap">
9
+ {
10
+ "imports": {
11
+ "hd-wallet-wasm": "https://cdn.jsdelivr.net/npm/hd-wallet-wasm@1.6.0/src/index.mjs",
12
+ "hd-wallet-wasm/": "https://cdn.jsdelivr.net/npm/hd-wallet-wasm@1.6.0/"
13
+ }
14
+ }
15
+ </script>
16
+ </head>
17
+ <body>
18
+ <!-- ─── Header / Toolbar ─── -->
19
+ <header id="toolbar">
20
+ <div class="toolbar-left">
21
+ <div class="brand">
22
+ <svg class="brand-icon" viewBox="0 0 24 24" width="20" height="20">
23
+ <circle cx="6" cy="12" r="3" fill="#569cd6"/>
24
+ <circle cx="18" cy="6" r="3" fill="#4ec9b0"/>
25
+ <circle cx="18" cy="18" r="3" fill="#ce9178"/>
26
+ <line x1="9" y1="12" x2="15" y2="6" stroke="#569cd6" stroke-width="1.5"/>
27
+ <line x1="9" y1="12" x2="15" y2="18" stroke="#569cd6" stroke-width="1.5"/>
28
+ </svg>
29
+ <span class="brand-name">sdn-flow</span>
30
+ </div>
31
+ </div>
32
+ <div class="toolbar-center">
33
+ <button id="btn-import" class="tb-btn" title="Import flow JSON">
34
+ <svg viewBox="0 0 16 16" width="14" height="14"><path d="M3 1h7l3 3v9a1 1 0 01-1 1H3a1 1 0 01-1-1V2a1 1 0 011-1z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M8 6v5M6 9l2 2 2-2" fill="none" stroke="currentColor" stroke-width="1.2"/></svg>
35
+ Import
36
+ </button>
37
+ <button id="btn-export" class="tb-btn" title="Export flow JSON">
38
+ <svg viewBox="0 0 16 16" width="14" height="14"><path d="M3 1h7l3 3v9a1 1 0 01-1 1H3a1 1 0 01-1-1V2a1 1 0 011-1z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M8 11V6M6 8l2-2 2 2" fill="none" stroke="currentColor" stroke-width="1.2"/></svg>
39
+ Export
40
+ </button>
41
+ <div class="tb-sep"></div>
42
+ <button id="btn-crc" class="tb-btn" title="Compute CRC-32 integrity check">
43
+ <svg viewBox="0 0 16 16" width="14" height="14"><path d="M8 1a7 7 0 110 14A7 7 0 018 1z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M5 8l2 2 4-4" fill="none" stroke="currentColor" stroke-width="1.2"/></svg>
44
+ CRC
45
+ </button>
46
+ <button id="btn-compile" class="tb-btn tb-btn-accent" title="Compile flow to WASM">
47
+ <svg viewBox="0 0 16 16" width="14" height="14"><path d="M2 3l5 5-5 5" fill="none" stroke="currentColor" stroke-width="1.5"/><line x1="9" y1="13" x2="14" y2="13" stroke="currentColor" stroke-width="1.5"/></svg>
48
+ Compile
49
+ </button>
50
+ <button id="btn-deploy" class="tb-btn tb-btn-deploy" title="Compile, sign, and deploy">
51
+ <svg viewBox="0 0 16 16" width="14" height="14"><path d="M8 1v10M4 7l4 4 4-4M2 13h12" fill="none" stroke="currentColor" stroke-width="1.5"/></svg>
52
+ Deploy
53
+ </button>
54
+ </div>
55
+ <div class="toolbar-right">
56
+ <span id="crc-badge" class="crc-badge" title="Flow CRC-32">--</span>
57
+ <button id="btn-wallet" class="tb-btn" title="Wallet / signing key">
58
+ <svg viewBox="0 0 16 16" width="14" height="14"><rect x="1" y="4" width="14" height="9" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M4 4V3a4 4 0 018 0v1" fill="none" stroke="currentColor" stroke-width="1.2"/><circle cx="8" cy="9" r="1.5" fill="currentColor"/></svg>
59
+ </button>
60
+ </div>
61
+ </header>
62
+
63
+ <!-- ─── Main Layout ─── -->
64
+ <div id="main">
65
+ <!-- ─── Left: Node Palette ─── -->
66
+ <aside id="palette">
67
+ <div class="palette-header">Nodes</div>
68
+ <div class="palette-list">
69
+ <div class="palette-item" data-kind="trigger" draggable="true">
70
+ <span class="kind-dot" style="background:#c586c0"></span>Trigger
71
+ </div>
72
+ <div class="palette-item" data-kind="transform" draggable="true">
73
+ <span class="kind-dot" style="background:#569cd6"></span>Transform
74
+ </div>
75
+ <div class="palette-item" data-kind="analyzer" draggable="true">
76
+ <span class="kind-dot" style="background:#4ec9b0"></span>Analyzer
77
+ </div>
78
+ <div class="palette-item" data-kind="publisher" draggable="true">
79
+ <span class="kind-dot" style="background:#ce9178"></span>Publisher
80
+ </div>
81
+ <div class="palette-item" data-kind="responder" draggable="true">
82
+ <span class="kind-dot" style="background:#dcdcaa"></span>Responder
83
+ </div>
84
+ <div class="palette-item" data-kind="renderer" draggable="true">
85
+ <span class="kind-dot" style="background:#d16969"></span>Renderer
86
+ </div>
87
+ <div class="palette-item" data-kind="sink" draggable="true">
88
+ <span class="kind-dot" style="background:#d7ba7d"></span>Sink
89
+ </div>
90
+ </div>
91
+ <div class="palette-header">Languages</div>
92
+ <div class="palette-list">
93
+ <div class="palette-item" data-kind="transform" data-lang="cpp" draggable="true">
94
+ <span class="kind-dot" style="background:#569cd6"></span>C++ Module
95
+ </div>
96
+ <div class="palette-item" data-kind="transform" data-lang="python" draggable="true">
97
+ <span class="kind-dot" style="background:#4ec9b0"></span>Python Module
98
+ </div>
99
+ <div class="palette-item" data-kind="transform" data-lang="rust" draggable="true">
100
+ <span class="kind-dot" style="background:#ce9178"></span>Rust Module
101
+ </div>
102
+ <div class="palette-item" data-kind="transform" data-lang="typescript" draggable="true">
103
+ <span class="kind-dot" style="background:#dcdcaa"></span>TypeScript Module
104
+ </div>
105
+ </div>
106
+ <div class="palette-header">Templates</div>
107
+ <div class="palette-list">
108
+ <button class="palette-btn" id="btn-load-iss">ISS Proximity OEM</button>
109
+ </div>
110
+ </aside>
111
+
112
+ <!-- ─── Center: Flow Canvas ─── -->
113
+ <div id="canvas-wrap">
114
+ <svg id="flow-canvas" xmlns="http://www.w3.org/2000/svg">
115
+ <defs>
116
+ <pattern id="grid-small" width="20" height="20" patternUnits="userSpaceOnUse">
117
+ <path d="M 20 0 L 0 0 0 20" fill="none" stroke="#2a2d2e" stroke-width="0.5"/>
118
+ </pattern>
119
+ <pattern id="grid-large" width="100" height="100" patternUnits="userSpaceOnUse">
120
+ <rect width="100" height="100" fill="url(#grid-small)"/>
121
+ <path d="M 100 0 L 0 0 0 100" fill="none" stroke="#333639" stroke-width="1"/>
122
+ </pattern>
123
+ <marker id="arrow" viewBox="0 0 10 10" refX="10" refY="5"
124
+ markerWidth="6" markerHeight="6" orient="auto-start-reverse">
125
+ <path d="M0 0 L10 5 L0 10 z" fill="#858585"/>
126
+ </marker>
127
+ </defs>
128
+ <rect class="canvas-bg" width="100%" height="100%" fill="url(#grid-large)"/>
129
+ <g id="canvas-viewport">
130
+ <g id="layer-wires"></g>
131
+ <g id="layer-nodes"></g>
132
+ </g>
133
+ <!-- Temporary wire being drawn -->
134
+ <path id="temp-wire" class="wire temp" d="" style="display:none"/>
135
+ </svg>
136
+ <!-- Selection rectangle -->
137
+ <div id="select-rect" style="display:none"></div>
138
+ </div>
139
+
140
+ <!-- ─── Right: Properties + Editor + Terminal ─── -->
141
+ <aside id="right-panel">
142
+ <!-- Resize handle -->
143
+ <div id="right-resize" class="resize-handle-v"></div>
144
+
145
+ <!-- Properties -->
146
+ <div id="props-panel" class="panel-section">
147
+ <div class="panel-header">
148
+ <span>Properties</span>
149
+ <button id="btn-delete-node" class="icon-btn" title="Delete selected">
150
+ <svg viewBox="0 0 16 16" width="14" height="14"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5"/></svg>
151
+ </button>
152
+ </div>
153
+ <div id="props-body" class="panel-body">
154
+ <div class="empty-state">Select a node to edit</div>
155
+ </div>
156
+ </div>
157
+
158
+ <!-- Editor resize -->
159
+ <div class="resize-handle-h" id="editor-resize"></div>
160
+
161
+ <!-- Monaco Editor -->
162
+ <div id="editor-panel" class="panel-section">
163
+ <div class="panel-header">
164
+ <span>Generated Source</span>
165
+ <span class="panel-tag">read-only</span>
166
+ </div>
167
+ <div id="editor-container"></div>
168
+ </div>
169
+
170
+ <!-- Terminal resize -->
171
+ <div class="resize-handle-h" id="terminal-resize"></div>
172
+
173
+ <!-- Terminal -->
174
+ <div id="terminal-panel" class="panel-section">
175
+ <div class="panel-header">
176
+ <span>Output</span>
177
+ <button id="btn-clear-term" class="icon-btn" title="Clear">
178
+ <svg viewBox="0 0 16 16" width="14" height="14"><path d="M2 2h12M5 5h6M3 8h10M6 11h4M7 14h2" stroke="currentColor" stroke-width="1" opacity="0.7"/></svg>
179
+ </button>
180
+ </div>
181
+ <div id="terminal" class="terminal"></div>
182
+ </div>
183
+ </aside>
184
+ </div>
185
+
186
+ <!-- ─── Status Bar ─── -->
187
+ <footer id="statusbar">
188
+ <span id="status-msg">Ready</span>
189
+ <span id="status-right">
190
+ <span id="node-count">0 nodes</span>
191
+ <span class="status-sep">|</span>
192
+ <span id="edge-count">0 wires</span>
193
+ </span>
194
+ </footer>
195
+
196
+ <!-- ─── Wallet Modal (HD-Wallet-UI integration point) ─── -->
197
+ <dialog id="wallet-dialog">
198
+ <div class="dialog-header">
199
+ <span>Signing Wallet</span>
200
+ <button id="btn-close-wallet" class="icon-btn">
201
+ <svg viewBox="0 0 16 16" width="14" height="14"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5"/></svg>
202
+ </button>
203
+ </div>
204
+ <div id="wallet-mount"></div>
205
+ </dialog>
206
+
207
+ <!-- ─── Scripts ─── -->
208
+ <script>
209
+ // Monaco Editor AMD loader
210
+ window.MonacoEnvironment = { getWorkerUrl: () => URL.createObjectURL(new Blob([`
211
+ self.MonacoEnvironment = { baseUrl: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/' };
212
+ importScripts('https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs/base/worker/workerMain.js');
213
+ `], { type: 'text/javascript' })) };
214
+ </script>
215
+ <script src="https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs/loader.js"></script>
216
+ <script type="module" src="js/app.mjs"></script>
217
+ </body>
218
+ </html>