dialog-ide 0.5.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 (225) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/LICENSE +201 -0
  3. package/README.md +211 -0
  4. package/THIRD_PARTY_LICENSES.md +157 -0
  5. package/bin/darwin-arm64/aambundle +0 -0
  6. package/bin/darwin-arm64/dgdebug +0 -0
  7. package/bin/darwin-arm64/dialogc +0 -0
  8. package/bin/dialog-lib/stddebug.dg +112 -0
  9. package/bin/dialog-lib/stdlib.dg +6730 -0
  10. package/bin/dialog-lib/unit.dg +187 -0
  11. package/dist/cli/commands/run-skein.d.ts +17 -0
  12. package/dist/cli/commands/run-skein.d.ts.map +1 -0
  13. package/dist/cli/commands/run-skein.js +105 -0
  14. package/dist/cli/commands/run-skein.js.map +1 -0
  15. package/dist/cli/commands/sources.d.ts +12 -0
  16. package/dist/cli/commands/sources.d.ts.map +1 -0
  17. package/dist/cli/commands/sources.js +42 -0
  18. package/dist/cli/commands/sources.js.map +1 -0
  19. package/dist/cli/commands/test.d.ts +9 -0
  20. package/dist/cli/commands/test.d.ts.map +1 -0
  21. package/dist/cli/commands/test.js +41 -0
  22. package/dist/cli/commands/test.js.map +1 -0
  23. package/dist/cli/context.d.ts +9 -0
  24. package/dist/cli/context.d.ts.map +1 -0
  25. package/dist/cli/context.js +78 -0
  26. package/dist/cli/context.js.map +1 -0
  27. package/dist/cli.d.ts +3 -0
  28. package/dist/cli.d.ts.map +1 -0
  29. package/dist/cli.js +32 -0
  30. package/dist/cli.js.map +1 -0
  31. package/dist/dialog-cover-resize.d.ts +2 -0
  32. package/dist/dialog-cover-resize.d.ts.map +1 -0
  33. package/dist/dialog-cover-resize.js +46 -0
  34. package/dist/dialog-cover-resize.js.map +1 -0
  35. package/dist/dialog-export.d.ts +23 -0
  36. package/dist/dialog-export.d.ts.map +1 -0
  37. package/dist/dialog-export.js +133 -0
  38. package/dist/dialog-export.js.map +1 -0
  39. package/dist/dialog-feelies.d.ts +4 -0
  40. package/dist/dialog-feelies.d.ts.map +1 -0
  41. package/dist/dialog-feelies.js +62 -0
  42. package/dist/dialog-feelies.js.map +1 -0
  43. package/dist/dialog-outline.d.ts +19 -0
  44. package/dist/dialog-outline.d.ts.map +1 -0
  45. package/dist/dialog-outline.js +122 -0
  46. package/dist/dialog-outline.js.map +1 -0
  47. package/dist/dialog-project-init.d.ts +5 -0
  48. package/dist/dialog-project-init.d.ts.map +1 -0
  49. package/dist/dialog-project-init.js +107 -0
  50. package/dist/dialog-project-init.js.map +1 -0
  51. package/dist/dialog-source-coverage.d.ts +9 -0
  52. package/dist/dialog-source-coverage.d.ts.map +1 -0
  53. package/dist/dialog-source-coverage.js +61 -0
  54. package/dist/dialog-source-coverage.js.map +1 -0
  55. package/dist/dialog-source-decoration-provider.d.ts +11 -0
  56. package/dist/dialog-source-decoration-provider.d.ts.map +1 -0
  57. package/dist/dialog-source-decoration-provider.js +79 -0
  58. package/dist/dialog-source-decoration-provider.js.map +1 -0
  59. package/dist/dialog-symbol-index.d.ts +19 -0
  60. package/dist/dialog-symbol-index.d.ts.map +1 -0
  61. package/dist/dialog-symbol-index.js +107 -0
  62. package/dist/dialog-symbol-index.js.map +1 -0
  63. package/dist/dialog-symbol-provider.d.ts +5 -0
  64. package/dist/dialog-symbol-provider.d.ts.map +1 -0
  65. package/dist/dialog-symbol-provider.js +56 -0
  66. package/dist/dialog-symbol-provider.js.map +1 -0
  67. package/dist/dialog-web-export.d.ts +25 -0
  68. package/dist/dialog-web-export.d.ts.map +1 -0
  69. package/dist/dialog-web-export.js +283 -0
  70. package/dist/dialog-web-export.js.map +1 -0
  71. package/dist/dialog-workspace-symbol-provider.d.ts +16 -0
  72. package/dist/dialog-workspace-symbol-provider.d.ts.map +1 -0
  73. package/dist/dialog-workspace-symbol-provider.js +107 -0
  74. package/dist/dialog-workspace-symbol-provider.js.map +1 -0
  75. package/dist/dialog-workspace-watcher.d.ts +22 -0
  76. package/dist/dialog-workspace-watcher.d.ts.map +1 -0
  77. package/dist/dialog-workspace-watcher.js +102 -0
  78. package/dist/dialog-workspace-watcher.js.map +1 -0
  79. package/dist/dialoged/skein/compile-error.d.ts +10 -0
  80. package/dist/dialoged/skein/compile-error.d.ts.map +1 -0
  81. package/dist/dialoged/skein/compile-error.js +28 -0
  82. package/dist/dialoged/skein/compile-error.js.map +1 -0
  83. package/dist/dialoged/skein/dynamic.d.ts +14 -0
  84. package/dist/dialoged/skein/dynamic.d.ts.map +1 -0
  85. package/dist/dialoged/skein/dynamic.js +176 -0
  86. package/dist/dialoged/skein/dynamic.js.map +1 -0
  87. package/dist/dialoged/skein/frotz-build.d.ts +10 -0
  88. package/dist/dialoged/skein/frotz-build.d.ts.map +1 -0
  89. package/dist/dialoged/skein/frotz-build.js +70 -0
  90. package/dist/dialoged/skein/frotz-build.js.map +1 -0
  91. package/dist/dialoged/skein/index.d.ts +15 -0
  92. package/dist/dialoged/skein/index.d.ts.map +1 -0
  93. package/dist/dialoged/skein/index.js +31 -0
  94. package/dist/dialoged/skein/index.js.map +1 -0
  95. package/dist/dialoged/skein/io.d.ts +15 -0
  96. package/dist/dialoged/skein/io.d.ts.map +1 -0
  97. package/dist/dialoged/skein/io.js +53 -0
  98. package/dist/dialoged/skein/io.js.map +1 -0
  99. package/dist/dialoged/skein/persistence.d.ts +13 -0
  100. package/dist/dialoged/skein/persistence.d.ts.map +1 -0
  101. package/dist/dialoged/skein/persistence.js +228 -0
  102. package/dist/dialoged/skein/persistence.js.map +1 -0
  103. package/dist/dialoged/skein/process.d.ts +38 -0
  104. package/dist/dialoged/skein/process.d.ts.map +1 -0
  105. package/dist/dialoged/skein/process.js +189 -0
  106. package/dist/dialoged/skein/process.js.map +1 -0
  107. package/dist/dialoged/skein/progress.d.ts +17 -0
  108. package/dist/dialoged/skein/progress.d.ts.map +1 -0
  109. package/dist/dialoged/skein/progress.js +9 -0
  110. package/dist/dialoged/skein/progress.js.map +1 -0
  111. package/dist/dialoged/skein/project.d.ts +44 -0
  112. package/dist/dialoged/skein/project.d.ts.map +1 -0
  113. package/dist/dialoged/skein/project.js +223 -0
  114. package/dist/dialoged/skein/project.js.map +1 -0
  115. package/dist/dialoged/skein/search.d.ts +15 -0
  116. package/dist/dialoged/skein/search.d.ts.map +1 -0
  117. package/dist/dialoged/skein/search.js +99 -0
  118. package/dist/dialoged/skein/search.js.map +1 -0
  119. package/dist/dialoged/skein/service.d.ts +91 -0
  120. package/dist/dialoged/skein/service.d.ts.map +1 -0
  121. package/dist/dialoged/skein/service.js +1097 -0
  122. package/dist/dialoged/skein/service.js.map +1 -0
  123. package/dist/dialoged/skein/session.d.ts +96 -0
  124. package/dist/dialoged/skein/session.d.ts.map +1 -0
  125. package/dist/dialoged/skein/session.js +690 -0
  126. package/dist/dialoged/skein/session.js.map +1 -0
  127. package/dist/dialoged/skein/syntax.d.ts +5 -0
  128. package/dist/dialoged/skein/syntax.d.ts.map +1 -0
  129. package/dist/dialoged/skein/syntax.js +150 -0
  130. package/dist/dialoged/skein/syntax.js.map +1 -0
  131. package/dist/dialoged/skein/trace.d.ts +31 -0
  132. package/dist/dialoged/skein/trace.d.ts.map +1 -0
  133. package/dist/dialoged/skein/trace.js +172 -0
  134. package/dist/dialoged/skein/trace.js.map +1 -0
  135. package/dist/dialoged/skein/tree.d.ts +114 -0
  136. package/dist/dialoged/skein/tree.d.ts.map +1 -0
  137. package/dist/dialoged/skein/tree.js +701 -0
  138. package/dist/dialoged/skein/tree.js.map +1 -0
  139. package/dist/dialoged/skein/ui/ansi.d.ts +4 -0
  140. package/dist/dialoged/skein/ui/ansi.d.ts.map +1 -0
  141. package/dist/dialoged/skein/ui/ansi.js +215 -0
  142. package/dist/dialoged/skein/ui/ansi.js.map +1 -0
  143. package/dist/dialoged/skein/ui/diff.d.ts +7 -0
  144. package/dist/dialoged/skein/ui/diff.d.ts.map +1 -0
  145. package/dist/dialoged/skein/ui/diff.js +17 -0
  146. package/dist/dialoged/skein/ui/diff.js.map +1 -0
  147. package/dist/dialoged/skein/ui/knot-menu.d.ts +5 -0
  148. package/dist/dialoged/skein/ui/knot-menu.d.ts.map +1 -0
  149. package/dist/dialoged/skein/ui/knot-menu.js +89 -0
  150. package/dist/dialoged/skein/ui/knot-menu.js.map +1 -0
  151. package/dist/dialoged/skein/ui/marker-colors.d.ts +5 -0
  152. package/dist/dialoged/skein/ui/marker-colors.d.ts.map +1 -0
  153. package/dist/dialoged/skein/ui/marker-colors.js +18 -0
  154. package/dist/dialoged/skein/ui/marker-colors.js.map +1 -0
  155. package/dist/dialoged/skein/ui/render.d.ts +13 -0
  156. package/dist/dialoged/skein/ui/render.d.ts.map +1 -0
  157. package/dist/dialoged/skein/ui/render.js +332 -0
  158. package/dist/dialoged/skein/ui/render.js.map +1 -0
  159. package/dist/dialoged/skein/ui/traceRender.d.ts +11 -0
  160. package/dist/dialoged/skein/ui/traceRender.d.ts.map +1 -0
  161. package/dist/dialoged/skein/ui/traceRender.js +139 -0
  162. package/dist/dialoged/skein/ui/traceRender.js.map +1 -0
  163. package/dist/dialoged/skein/ui/tree-pane.d.ts +3 -0
  164. package/dist/dialoged/skein/ui/tree-pane.d.ts.map +1 -0
  165. package/dist/dialoged/skein/ui/tree-pane.js +135 -0
  166. package/dist/dialoged/skein/ui/tree-pane.js.map +1 -0
  167. package/dist/dialoged/skein/ui/webExportPage.d.ts +29 -0
  168. package/dist/dialoged/skein/ui/webExportPage.d.ts.map +1 -0
  169. package/dist/dialoged/skein/ui/webExportPage.js +72 -0
  170. package/dist/dialoged/skein/ui/webExportPage.js.map +1 -0
  171. package/dist/extension.d.ts +4 -0
  172. package/dist/extension.d.ts.map +1 -0
  173. package/dist/extension.js +885 -0
  174. package/dist/extension.js.map +1 -0
  175. package/dist/session-runner.d.ts +23 -0
  176. package/dist/session-runner.d.ts.map +1 -0
  177. package/dist/session-runner.js +92 -0
  178. package/dist/session-runner.js.map +1 -0
  179. package/language-configuration.json +43 -0
  180. package/media/icon.png +0 -0
  181. package/media/icons/arrow-down-circle-solid.svg +3 -0
  182. package/media/icons/arrow-down-solid.svg +3 -0
  183. package/media/icons/arrow-path-solid.svg +3 -0
  184. package/media/icons/arrow-right-solid.svg +3 -0
  185. package/media/icons/arrow-up-on-square-stack-solid.svg +5 -0
  186. package/media/icons/arrow-up-solid.svg +3 -0
  187. package/media/icons/arrow-uturn-left.svg +3 -0
  188. package/media/icons/arrow-uturn-right.svg +3 -0
  189. package/media/icons/bookmark-solid.svg +3 -0
  190. package/media/icons/bug-ant-solid.svg +3 -0
  191. package/media/icons/check-badge-solid.svg +3 -0
  192. package/media/icons/check-circle-solid.svg +3 -0
  193. package/media/icons/chevron-double-down-solid.svg +4 -0
  194. package/media/icons/chevron-double-up-solid.svg +4 -0
  195. package/media/icons/command-line-solid.svg +3 -0
  196. package/media/icons/cpu-chip-solid.svg +4 -0
  197. package/media/icons/dg-file-dark.svg +6 -0
  198. package/media/icons/dg-file-light.svg +6 -0
  199. package/media/icons/ellipsis-vertical-solid.svg +3 -0
  200. package/media/icons/exclamation-triangle.svg +3 -0
  201. package/media/icons/folder-arrow-down-solid.svg +3 -0
  202. package/media/icons/globe-alt.svg +3 -0
  203. package/media/icons/lock-closed-solid.svg +3 -0
  204. package/media/icons/magnifying-glass-solid.svg +3 -0
  205. package/media/icons/pencil-solid.svg +4 -0
  206. package/media/icons/play-solid.svg +3 -0
  207. package/media/icons/plus-circle-solid.svg +3 -0
  208. package/media/icons/scissors-solid.svg +5 -0
  209. package/media/icons/tag-solid.svg +3 -0
  210. package/media/icons/trash-solid.svg +3 -0
  211. package/media/icons/x-circle-solid.svg +3 -0
  212. package/media/js/datastar.js +9 -0
  213. package/media/js/main.js +1109 -0
  214. package/media/js/skein-loader.js +10 -0
  215. package/media/js/trace-loader.js +4 -0
  216. package/media/js/trace.js +147 -0
  217. package/media/style.css +5783 -0
  218. package/package.json +231 -0
  219. package/resources/bundle/default-cover.png +0 -0
  220. package/resources/bundle/introduction-to-if.pdf +0 -0
  221. package/resources/bundle/play-if-card.pdf +1990 -1
  222. package/resources/bundle/play.css +432 -0
  223. package/resources/bundle/style.css +450 -0
  224. package/resources/dfrotz-skein-patch.dg +4 -0
  225. package/syntaxes/dialog.tmLanguage.json +490 -0
@@ -0,0 +1,10 @@
1
+ // Single entry point for the Skein page's two module scripts, replacing separate <script
2
+ // type="module"> tags for each - ES modules guarantee sibling static imports with no dependency
3
+ // edge between them evaluate in declaration order, so main.js is guaranteed to finish setting
4
+ // window.sk before datastar.js runs and starts dereferencing it from data-init="sk...()"
5
+ // attributes already in the page (e.g. sk.initTreeGraph()). Relying on <script> tag order alone
6
+ // worked (both are deferred, and deferred scripts execute in document order) but was an implicit
7
+ // contract nothing in the markup made obvious - a future reordering could silently reintroduce
8
+ // the "sk is not defined" race.
9
+ import './main.js';
10
+ import './datastar.js';
@@ -0,0 +1,4 @@
1
+ // Single entry point for the Trace panel's two module scripts - see skein-loader.js for why
2
+ // order matters and why a loader (rather than separate <script> tags) makes it explicit.
3
+ import './trace.js';
4
+ import './datastar.js';
@@ -0,0 +1,147 @@
1
+ // Client-side JS for the Trace panel (its own page, served at /trace - see traceRender.ts).
2
+ // Independent of main.js: this page has no tree graph, no knot menus, nothing else main.js
3
+ // handles - just the hover-to-preview and click-to-open-source interactions specific to trace
4
+ // rows, plus the postMessage bridge back to the extension host (only extension.ts has the
5
+ // vscode API needed to actually open/focus an editor - see extension.ts's TraceViewProvider).
6
+ window.sk = window.sk || {};
7
+ window.sk.trace = {
8
+ openSource(file, line) {
9
+ window.parent.postMessage({ type: 'openSource', file, line }, '*');
10
+ }
11
+ };
12
+
13
+ let hoverTimer = null;
14
+ let currentHoverRow = null;
15
+ // Latest known pointer position, used at show time rather than whatever position the mouse was
16
+ // at when the hover first started - the 150ms delay before showing means the cursor may have
17
+ // drifted a little further into the row by the time the popover actually appears.
18
+ let lastMouseX = 0;
19
+ let lastMouseY = 0;
20
+
21
+ document.addEventListener('mousemove', (evt) => {
22
+ lastMouseX = evt.clientX;
23
+ lastMouseY = evt.clientY;
24
+ });
25
+
26
+ /**
27
+ * Places the popover near (x, y) rather than anchored to the hovered row - the row spans most
28
+ * of the panel's width, so any single fixed side/offset relative to it ran out of room near one
29
+ * end (that's what made the popover behave differently depending on which part of a row -
30
+ * query term vs. filename - triggered the hover). Following the cursor sidesteps the row's own
31
+ * geometry entirely. Offsets and clamps against the viewport so it doesn't open off-screen or
32
+ * directly under the cursor (which would immediately trigger mouseout on the row underneath).
33
+ */
34
+ function positionPopover(popover, x, y) {
35
+ const OFFSET = 14;
36
+ const rect = popover.getBoundingClientRect();
37
+ let left = x + OFFSET;
38
+ let top = y + OFFSET;
39
+ if (left + rect.width > window.innerWidth) {
40
+ left = Math.max(0, x - rect.width - OFFSET);
41
+ }
42
+ if (top + rect.height > window.innerHeight) {
43
+ top = Math.max(0, y - rect.height - OFFSET);
44
+ }
45
+ popover.style.left = `${left}px`;
46
+ popover.style.top = `${top}px`;
47
+ }
48
+
49
+ function showSourcePreview(row) {
50
+ const nodeId = row.dataset.nodeId;
51
+ const popover = document.getElementById('trace-source-popover');
52
+ if (!nodeId || !popover) return;
53
+
54
+ fetch(`/trace/source-preview?nodeId=${encodeURIComponent(nodeId)}`)
55
+ .then((res) => (res.ok ? res.text() : null))
56
+ .then((html) => {
57
+ // The mouse may have moved to a different row (or off the tree entirely) while this
58
+ // request was in flight - only show it if this row is still the one being hovered.
59
+ if (html == null || currentHoverRow !== row) return;
60
+ popover.innerHTML = html;
61
+ popover.showPopover();
62
+ positionPopover(popover, lastMouseX, lastMouseY);
63
+ })
64
+ .catch(() => {});
65
+ }
66
+
67
+ function hideSourcePreview() {
68
+ clearTimeout(hoverTimer);
69
+ currentHoverRow = null;
70
+ document.getElementById('trace-source-popover')?.hidePopover();
71
+ }
72
+
73
+ document.addEventListener('mouseover', (evt) => {
74
+ const row = evt.target.closest('.trace-row[data-node-id]');
75
+ if (!row || row === currentHoverRow) return;
76
+ currentHoverRow = row;
77
+ clearTimeout(hoverTimer);
78
+ hoverTimer = setTimeout(() => showSourcePreview(row), 150);
79
+ });
80
+
81
+ document.addEventListener('mouseout', (evt) => {
82
+ const row = evt.target.closest('.trace-row[data-node-id]');
83
+ if (!row || row !== currentHoverRow) return;
84
+ // Moving within the same row (e.g. onto a child element) isn't leaving it.
85
+ if (evt.relatedTarget && row.contains(evt.relatedTarget)) return;
86
+ hideSourcePreview();
87
+ });
88
+
89
+ document.addEventListener('click', (evt) => {
90
+ const row = evt.target.closest('.trace-row[data-file]');
91
+ if (!row || evt.target.closest('.trace-chevron')) return;
92
+ window.sk.trace.openSource(row.dataset.file, Number(row.dataset.line));
93
+ });
94
+
95
+ // Enter in the search field jumps to the next match and scrolls it into view, cycling back to
96
+ // the first once past the last. Purely client-side (no server round trip): a search already
97
+ // marks matches with .trace-row-match and expands every ancestor needed to make them visible
98
+ // (trace.ts's searchTree/expandToMatches), so by the time the debounced search has landed,
99
+ // every match is already a real, visible element to walk through.
100
+ let matchIndex = -1;
101
+
102
+ document.addEventListener('input', (evt) => {
103
+ if (evt.target.matches('input[type="search"]')) {
104
+ matchIndex = -1;
105
+ }
106
+ });
107
+
108
+ document.addEventListener('keydown', (evt) => {
109
+ if (evt.key !== 'Enter' || !evt.target.matches('input[type="search"]')) return;
110
+ const matches = document.querySelectorAll('.trace-row-match');
111
+ if (matches.length === 0) return;
112
+ evt.preventDefault();
113
+ matchIndex = (matchIndex + 1) % matches.length;
114
+ matches[matchIndex].scrollIntoView({ block: 'center', behavior: 'smooth' });
115
+ });
116
+
117
+ // Cmd/Ctrl+A (select-all) inside the search field: VS Code's own "Select All" keybinding can
118
+ // intercept this before it ever reaches a doubly-nested webview -> iframe -> input, since VS
119
+ // Code's focus-aware keybinding suppression is built around its own top-level webview content,
120
+ // not a further iframe nested inside it. Handling it explicitly here is a harmless no-op if the
121
+ // browser's native behavior already worked, and a real fix if VS Code's own binding got there
122
+ // first.
123
+ document.addEventListener('keydown', (evt) => {
124
+ const mod = evt.metaKey || evt.ctrlKey;
125
+ // !shiftKey: Cmd/Ctrl+Shift+A is a separate relay (below), not select-all.
126
+ if (mod && !evt.shiftKey && evt.key.toLowerCase() === 'a' && evt.target.matches('input[type="search"]')) {
127
+ evt.preventDefault();
128
+ evt.target.select();
129
+ }
130
+ });
131
+
132
+ // Command Palette - same relay as the Skein panel's main.js (see its own comment for why this is
133
+ // needed): VS Code's webview-forwarding bridge only reaches the outer webview shell
134
+ // (getTraceWebviewHtml in extension.ts), not this nested localhost iframe where keydowns
135
+ // actually land. Posted up via postMessage; the shell re-dispatches a synthetic keydown that VS
136
+ // Code's bridge can forward to workbench.action.showCommands (package.json's
137
+ // contributes.keybindings, scoped to focusedView == 'dialogIdeTraceView').
138
+ document.addEventListener('keydown', (evt) => {
139
+ const mod = evt.metaKey || evt.ctrlKey;
140
+ if (mod && evt.shiftKey && evt.code === 'KeyA') {
141
+ evt.preventDefault();
142
+ window.parent.postMessage(
143
+ { type: 'forward-keydown', key: 'a', code: 'KeyA', metaKey: evt.metaKey, ctrlKey: evt.ctrlKey, shiftKey: true, altKey: false },
144
+ '*'
145
+ );
146
+ }
147
+ });