typeglish 0.1.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/LICENSE +201 -0
- package/NOTICE +13 -0
- package/README.md +301 -0
- package/dist/chunk-3NQ3VYO6.js +566 -0
- package/dist/chunk-3NQ3VYO6.js.map +1 -0
- package/dist/chunk-KRYC4OTL.js +3573 -0
- package/dist/chunk-KRYC4OTL.js.map +1 -0
- package/dist/chunk-NLQIL5WD.js +25 -0
- package/dist/chunk-NLQIL5WD.js.map +1 -0
- package/dist/chunk-PR4QN5HX.js +39 -0
- package/dist/chunk-PR4QN5HX.js.map +1 -0
- package/dist/chunk-PXAMTGYY.js +3 -0
- package/dist/chunk-PXAMTGYY.js.map +1 -0
- package/dist/chunk-VMACILYN.js +140 -0
- package/dist/chunk-VMACILYN.js.map +1 -0
- package/dist/chunk-Y64EAEYB.js +10919 -0
- package/dist/chunk-Y64EAEYB.js.map +1 -0
- package/dist/chunk-YH4ZLQ4G.js +4260 -0
- package/dist/chunk-YH4ZLQ4G.js.map +1 -0
- package/dist/chunk-ZKMHZHID.js +56 -0
- package/dist/chunk-ZKMHZHID.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +447 -0
- package/dist/cli.js.map +1 -0
- package/dist/compile-DViQS2oG.d.ts +310 -0
- package/dist/diagnostics-BWJ_oMd8.d.ts +49 -0
- package/dist/exhaustiveness-VBVWCX5W.js +123 -0
- package/dist/exhaustiveness-VBVWCX5W.js.map +1 -0
- package/dist/index-Df_QnTgq.d.ts +313 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp.d.ts +11 -0
- package/dist/mcp.js +36378 -0
- package/dist/mcp.js.map +1 -0
- package/dist/monaco.css +46 -0
- package/dist/monaco.d.ts +43 -0
- package/dist/monaco.js +971 -0
- package/dist/monaco.js.map +1 -0
- package/dist/node.d.ts +21 -0
- package/dist/node.js +8 -0
- package/dist/node.js.map +1 -0
- package/dist/spell-node.d.ts +8 -0
- package/dist/spell-node.js +23 -0
- package/dist/spell-node.js.map +1 -0
- package/dist/spell.d.ts +18 -0
- package/dist/spell.js +4 -0
- package/dist/spell.js.map +1 -0
- package/dist/z3-MWU3GSVT.js +5 -0
- package/dist/z3-MWU3GSVT.js.map +1 -0
- package/package.json +160 -0
package/dist/monaco.css
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* ── typeglish/monaco.css ──────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
Styles the TypeGlish editor needs beyond the Monaco theme (which setupTypeGlish registers in JS): the
|
|
3
|
+
object-reference decoration and the object-record hover table. Import once alongside the editor:
|
|
4
|
+
|
|
5
|
+
import 'typeglish/monaco.css';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* The object-record hover renders as a field/value table: a compact muted field column and room for values. */
|
|
9
|
+
.monaco-hover table {
|
|
10
|
+
border-collapse: collapse;
|
|
11
|
+
margin: 3px 0;
|
|
12
|
+
min-width: 300px;
|
|
13
|
+
}
|
|
14
|
+
.monaco-hover th,
|
|
15
|
+
.monaco-hover td {
|
|
16
|
+
padding: 2px 16px 2px 0;
|
|
17
|
+
text-align: left;
|
|
18
|
+
vertical-align: top;
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
.monaco-hover td:first-child,
|
|
22
|
+
.monaco-hover th:first-child {
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
color: #8b949e;
|
|
25
|
+
}
|
|
26
|
+
.monaco-hover td:last-child {
|
|
27
|
+
max-width: 440px;
|
|
28
|
+
}
|
|
29
|
+
.monaco-hover {
|
|
30
|
+
max-width: 720px !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* ── Structural program view ───────────────────────────────────────────────────────────────────────────
|
|
34
|
+
Structural nesting shows as real (virtual) indentation injected per line in monaco.ts — no styling needed
|
|
35
|
+
here. Below: the declaration-vs-reference styling. References are "pointers": blue + dotted, Cmd-clickable
|
|
36
|
+
to their target; a dangling one wavy-red like an error squiggle. */
|
|
37
|
+
.monaco-editor .tg-ref {
|
|
38
|
+
text-decoration: underline dotted rgba(121, 192, 255, 0.55);
|
|
39
|
+
text-underline-offset: 2px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
.monaco-editor .tg-ref-dangling {
|
|
43
|
+
text-decoration: underline wavy rgba(248, 81, 73, 0.7);
|
|
44
|
+
text-underline-offset: 2px;
|
|
45
|
+
}
|
|
46
|
+
|
package/dist/monaco.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as Mon from 'monaco-editor';
|
|
2
|
+
import { C as CompileOptions } from './compile-DViQS2oG.js';
|
|
3
|
+
export { f as compile } from './compile-DViQS2oG.js';
|
|
4
|
+
import './diagnostics-BWJ_oMd8.js';
|
|
5
|
+
|
|
6
|
+
declare const LANG_ID = "tg";
|
|
7
|
+
declare const FILE_EXT = ".tg";
|
|
8
|
+
declare const THEME_ID = "typeglish-dark";
|
|
9
|
+
|
|
10
|
+
type MonacoApi = typeof Mon;
|
|
11
|
+
type CodeEditor = Mon.editor.IStandaloneCodeEditor;
|
|
12
|
+
|
|
13
|
+
interface AttachOptions {
|
|
14
|
+
/** Compute diagnostics on every edit and show them as squiggles (default true). Turn off to drive
|
|
15
|
+
* markers yourself, e.g. when you compile with extra options elsewhere. */
|
|
16
|
+
diagnostics?: boolean;
|
|
17
|
+
/** Extra compile options (e.g. an eval rubric) for the auto-diagnostics pass. */
|
|
18
|
+
compileOptions?: CompileOptions;
|
|
19
|
+
/** List auto-continue (Enter/Tab) and leading-operator UPPERCASING as you type (default true). */
|
|
20
|
+
authoring?: boolean;
|
|
21
|
+
/** Render the structural program view — reference styling (default true). */
|
|
22
|
+
structure?: boolean;
|
|
23
|
+
/** Structural authoring aids as you type (default true): a new line snaps to its indent the moment its marker
|
|
24
|
+
* is completed (`2.1. ` / `## `) — once, a suggestion, so backspace/dedent stick afterward (Python-IDE feel, not
|
|
25
|
+
* a forced reformat) — AND sub-steps are renumbered to close gaps after a delete (`1A 1C` → `1A 1B`), with
|
|
26
|
+
* label references rewritten to follow. Both are cosmetic to the compiler, which strips indentation. */
|
|
27
|
+
autoIndent?: boolean;
|
|
28
|
+
/** Number ONLY content lines — blank lines get an empty gutter (default). Set true to number every line the
|
|
29
|
+
* way a plain code editor does. The host must not also pass a `lineNumbers` option, which would override this. */
|
|
30
|
+
numberBlankLines?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Register the `.tg` language, its Monarch tokenizer + dark theme, the object-record hover, and completion
|
|
33
|
+
* on a Monaco instance. Idempotent and safe to call once at startup. */
|
|
34
|
+
declare function setupTypeGlish(monaco: MonacoApi): void;
|
|
35
|
+
/** Recompute and apply TypeGlish diagnostics (consistency errors, clarity warnings) as model markers. */
|
|
36
|
+
declare function applyDiagnostics(monaco: MonacoApi, model: Mon.editor.ITextModel, compileOptions?: CompileOptions): void;
|
|
37
|
+
/** Wire an editor for TypeGlish: live diagnostics, object-reference highlighting, and (optional) authoring
|
|
38
|
+
* behaviors. Returns a disposable that removes every listener + decoration. */
|
|
39
|
+
declare function attachTypeGlish(monaco: MonacoApi, editor: CodeEditor, opts?: AttachOptions): {
|
|
40
|
+
dispose(): void;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { type AttachOptions, FILE_EXT, LANG_ID, THEME_ID, applyDiagnostics, attachTypeGlish, setupTypeGlish };
|