@glyphlang/glyph 0.1.68 → 0.1.70

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 (2) hide show
  1. package/README.md +42 -20
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -4,12 +4,31 @@
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@glyphlang/glyph.svg)](https://www.npmjs.com/package/@glyphlang/glyph)
6
6
  [![downloads](https://img.shields.io/npm/dm/@glyphlang/glyph.svg)](https://www.npmjs.com/package/@glyphlang/glyph)
7
+ [![CI](https://github.com/chadetov/glyph/actions/workflows/ci.yml/badge.svg)](https://github.com/chadetov/glyph/actions/workflows/ci.yml)
8
+ [![install size](https://packagephobia.com/badge?p=@glyphlang/glyph)](https://packagephobia.com/result?p=@glyphlang/glyph)
7
9
  [![license](https://img.shields.io/npm/l/@glyphlang/glyph.svg)](https://github.com/chadetov/glyph)
10
+ [![Socket Badge](https://badge.socket.dev/npm/package/@glyphlang/glyph/0.1.70)](https://badge.socket.dev/npm/package/@glyphlang/glyph/0.1.70)
11
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/chadetov/glyph/badge)](https://scorecard.dev/viewer/?uri=github.com/chadetov/glyph)
8
12
 
9
- Glyph is a statically typed language that **transpiles to TypeScript**, designed from the ground up so AI agents can read, write, and modify code safely. It looks almost like TypeScript — you read it on day one, no tutorial — but the differences are deliberate: each one closes a hole an agent falls through and `tsc --strict` waves past.
13
+ Glyph is a statically typed language that **transpiles to TypeScript**, built so AI agents can read, write, and modify code safely. It looks almost like TypeScript, so you read it on day one with no tutorial. Where it differs, each difference closes a hole an agent falls through and `tsc --strict` waves past.
14
+
15
+ ## Try it without installing anything
16
+
17
+ ```sh
18
+ npx @glyphlang/glyph init my-app
19
+ cd my-app
20
+ npm install
21
+ npx glyph run
22
+ # hello from glyph
23
+ ```
24
+
25
+ That scaffolds four files, pins the compiler in `devDependencies`, and runs the program. Anyone who clones the project builds it with `npm install` and nothing global.
26
+
27
+ Prefer it on your PATH:
10
28
 
11
29
  ```sh
12
30
  npm install -g @glyphlang/glyph
31
+ glyph init my-app && cd my-app && glyph run
13
32
  ```
14
33
 
15
34
  > **Website:** [glyphlang.io](https://glyphlang.io)  ·  **Try it in the browser:** [playground](https://glyphlang.io/playground/)  ·  **Pointing an agent at it?** [glyphlang.io/llms.txt](https://glyphlang.io/llms.txt)
@@ -18,13 +37,13 @@ npm install -g @glyphlang/glyph
18
37
 
19
38
  ## The problem it solves
20
39
 
21
- An AI agent will happily write TypeScript that compiles clean and breaks at runtime. It reaches for `any` at a boundary, casts an `unknown`, forgets a `switch` case, and drops a `Promise` on the floor — and `tsc --strict` stays green the whole time. On a large codebase it can't even reliably *find* where something is defined, because overloads, decorators, namespace merging, and barrel re-exports scatter one symbol across many places.
40
+ An AI agent will happily write TypeScript that compiles clean and breaks at runtime. It reaches for `any` at a boundary, casts an `unknown`, forgets a `switch` case, drops a `Promise` on the floor, and `tsc --strict` stays green the whole time. On a large codebase it cannot even reliably *find* where something is defined, because overloads, decorators, namespace merging, and barrel re-exports scatter one symbol across many places.
22
41
 
23
- Glyph removes those hazards at the language level. The bugs an agent ships don't compile here.
42
+ Glyph removes those hazards at the language level. The bugs an agent ships do not compile here.
24
43
 
25
44
  ## See it
26
45
 
27
- Glyph reads like TypeScript, but there's no `any`, `match` must cover every case, and a type you declare is *actually checked at runtime*:
46
+ Glyph reads like TypeScript, but there is no `any`, `match` must cover every case, and a type you declare is *actually checked at runtime*:
28
47
 
29
48
  ```glyph
30
49
  type User = {
@@ -44,34 +63,33 @@ fn handle(body: unknown) -> string {
44
63
 
45
64
  That compiles to clean, readable TypeScript you can commit, run anywhere TS runs, and mix with any npm package.
46
65
 
47
- ## Why teams pick it
66
+ ## What's different
48
67
 
49
- - **No `any`, no erasure.** What the types say is true when the code runs. Every record type generates a runtime validator (`User.parse(x)`), so untrusted input is typed only after it's checked.
50
- - **Exhaustive by default.** `match` over a union — or over `number`/`string` — must handle every case, or it doesn't compile. Add a variant and every unhandled site lights up.
51
- - **Errors are values.** `Result` and the `?` operator instead of thrown exceptions; drop a `Result` and you get a warning, because a discarded error is a swallowed failure.
52
- - **Greppable.** One name, one declaration form. `grep "fn parseUser"` finds the definition — always. No overloads, decorators, or barrel files.
53
- - **Stable diffs.** One canonical format, one element per line, trailing commas, no reflow. A one-line change is a one-line diff — so agent edits stay reviewable.
54
- - **Generate, don't hand-write.** `glyph gen openapi spec.yaml --client` emits a typed HTTP client and server stubs; `glyph gen zod` / `gen dts` turn existing schemas into checked Glyph types.
55
- - **Talks to real databases.** Import any npm client by name. Class-based clients (`new Pool`, `new MongoClient`) construct with `new`, and SQLite is built in via `std/sqlite`. A row comes back untrusted, so you `Row.parse` it into a typed record, and the schema-versus-code mismatch a cast would hide is caught at the boundary. See the [databases guide](https://github.com/chadetov/glyph/blob/main/docs/guide/databases.md).
68
+ - **No `any`, no erasure.** What the types say is true when the code runs. Every record type generates a runtime validator (`User.parse(x)`), so untrusted input is typed only after it has been checked, and a failure names the field and its path.
69
+ - **Exhaustive by default.** `match` over a union, or over `number`/`string`, must handle every case or it does not compile. Add a variant and every unhandled site lights up.
70
+ - **Errors are values.** `Result` and the `?` operator instead of thrown exceptions. Drop a `Result` and you get a warning, because a discarded error is a swallowed failure.
71
+ - **Greppable.** One name, one declaration form. `grep "fn parseUser"` finds the definition every time. No overloads, decorators, or barrel files.
72
+ - **Stable diffs.** One canonical format, one element per line, trailing commas, no reflow. A one-line change is a one-line diff, so agent edits stay reviewable.
73
+ - **Generate, don't hand-write.** `glyph gen openapi spec.yaml --client` emits a typed HTTP client and server stubs. `glyph gen zod` and `gen dts` turn existing schemas into checked Glyph types.
74
+ - **Talks to real databases.** Import any npm client by name. Class-based clients (`new Pool`, `new MongoClient`) construct with `new`, and SQLite is built in via `std/sqlite`. A row comes back untrusted, so you `Row.parse` it into a typed record and the schema-versus-code mismatch a cast would hide is caught at the boundary. See the [databases guide](https://github.com/chadetov/glyph/blob/main/docs/guide/databases.md).
56
75
 
57
- ## Quickstart
76
+ ## The commands
58
77
 
59
78
  ```sh
60
79
  glyph init my-app # scaffold a project
61
- cd my-app
62
80
  glyph run # build + type-check + execute
63
81
  glyph build --check # emit TypeScript, verified with tsc --strict
64
82
  glyph fmt # one canonical layout
65
83
  glyph --explain E0200 # long-form help for any diagnostic
66
84
  ```
67
85
 
68
- Glyph ships as a single prebuilt binary per platform (macOS, Linux, Windows — Intel and ARM). No postinstall download, no toolchain to set up. Running or type-checking uses your local `tsx`/`tsc`.
86
+ Glyph ships as a single prebuilt binary per platform (macOS, Linux, and Windows, on Intel and ARM). No postinstall download and no toolchain to set up. Running or type-checking uses your local `tsx`/`tsc`.
69
87
 
70
88
  ## Built for agents
71
89
 
72
- Point your coding agent at **[glyphlang.io/llms.txt](https://glyphlang.io/llms.txt)** — a single file that takes it from zero to correct, runnable Glyph: the canonical program shape, the full stdlib surface, the common gotchas, and the complete diagnostic catalogue with one-line fixes. Agents that write Glyph get compile-time feedback precise enough to self-correct.
90
+ Point your coding agent at **[glyphlang.io/llms.txt](https://glyphlang.io/llms.txt)**, a single file that takes it from zero to correct, runnable Glyph: the canonical program shape, the full stdlib surface, the common gotchas, and the complete diagnostic catalogue with one-line fixes. Agents writing Glyph get compile-time feedback precise enough to self-correct.
73
91
 
74
- **Model Context Protocol.** For an agent that speaks MCP, `glyph mcp` runs a server over stdio that gives it five queries: type-check a file for coded diagnostics, the inferred type at a cursor, where a name is defined (following imports), every reference to a symbol across the project, and symbol search. It runs the same analysis the editor uses, so the agent's answers match the compiler. Point any MCP client at `glyph mcp <project>`; details at [glyphlang.io/mcp](https://glyphlang.io/mcp/).
92
+ **Model Context Protocol.** For an agent that speaks MCP, `glyph mcp` runs a server over stdio that answers five queries: type-check a file for coded diagnostics, the inferred type at a cursor, where a name is defined (following imports), every reference to a symbol across the project, and symbol search. It runs the same analysis the editor uses, so the agent's answers match the compiler. Point any MCP client at `glyph mcp <project>`; details at [glyphlang.io/mcp](https://glyphlang.io/mcp/).
75
93
 
76
94
  **Editors.** `glyph lsp` is a full language server (diagnostics, hover, go-to-definition, completion, symbols, workspace-wide find-references and rename, formatting) that any LSP client can drive over stdio. A VS Code extension ships ready-made.
77
95
 
@@ -82,15 +100,15 @@ Point your coding agent at **[glyphlang.io/llms.txt](https://glyphlang.io/llms.t
82
100
  | Your first program in 10 minutes | [Start Here](https://glyphlang.io/start/) |
83
101
  | The whole language in five minutes | [the tour](https://github.com/chadetov/glyph/blob/main/docs/guide/tour.md) |
84
102
  | Try it without installing | [playground](https://glyphlang.io/playground/) |
85
- | Straight-talking answers to engineer questions | [glyphlang.io/answers](https://glyphlang.io/answers/) |
103
+ | Straight answers to engineer questions | [glyphlang.io/answers](https://glyphlang.io/answers/) |
86
104
  | The four pillars, in depth | [glyphlang.io/pillars/verifiability](https://glyphlang.io/pillars/verifiability/) |
87
105
  | Source, issues, roadmap | [github.com/chadetov/glyph](https://github.com/chadetov/glyph) |
88
106
 
89
107
  ## Status
90
108
 
91
- Glyph is an **early preview** and moves fast. The compiler toolchain — `build`, `run`, `fmt`, `gen`, `regen`, `--explain` — works end to end, and every release is type-checked against `tsc --strict`. It is not yet recommended for production; it's ready for you to try, break, and tell us about. Every version's changes are at [glyphlang.io/versions](https://glyphlang.io/versions/).
109
+ Glyph is an **early preview** and moves fast. The compiler toolchain (`build`, `run`, `fmt`, `gen`, `regen`, `--explain`) works end to end, and every release is type-checked against `tsc --strict`. It is not ready for production yet. It is ready for you to try and to tell us where it breaks. Every version's changes are at [glyphlang.io/versions](https://glyphlang.io/versions/).
92
110
 
93
- **Stability while pre-1.0:** the language can still change between 0.1.x releases. We hold two lines: your code stays runnable (it always compiles to plain TypeScript you own, so there's a permanent escape hatch), and when syntax does change we aim to make `glyph fmt` migrate it for you. Full policy: [docs/stability.md](https://github.com/chadetov/glyph/blob/main/docs/stability.md).
111
+ **Stability while pre-1.0:** the language can still change between 0.1.x releases. Two lines hold. Your code stays runnable, because it always compiles to plain TypeScript you own, which is a permanent escape hatch. And when syntax does change we aim to make `glyph fmt` migrate it for you. Full policy: [docs/stability.md](https://github.com/chadetov/glyph/blob/main/docs/stability.md).
94
112
 
95
113
  ## Verifying your download
96
114
 
@@ -104,6 +122,10 @@ npm audit signatures
104
122
  # GitHub Release archives: SLSA build-provenance attestation
105
123
  gh attestation verify glyph-<version>-<platform>.tar.gz --repo chadetov/glyph
106
124
 
125
+ # ...or against the provenance bundle attached to the release, with no network
126
+ gh attestation verify glyph-<version>-<platform>.tar.gz \
127
+ --bundle v<version>.intoto.jsonl --repo chadetov/glyph
128
+
107
129
  # ...and a SHA-256 for each archive
108
130
  sha256sum -c SHA256SUMS
109
131
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glyphlang/glyph",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "description": "TypeScript your AI agents can't quietly break: a statically typed language that transpiles to TypeScript, with no any, exhaustive matching, and runtime-checked types.",
5
5
  "bin": {
6
6
  "glyph": "bin/glyph.js"
@@ -13,11 +13,11 @@
13
13
  "node": ">=18"
14
14
  },
15
15
  "optionalDependencies": {
16
- "@glyphlang/darwin-x64": "0.1.68",
17
- "@glyphlang/darwin-arm64": "0.1.68",
18
- "@glyphlang/linux-x64": "0.1.68",
19
- "@glyphlang/linux-arm64": "0.1.68",
20
- "@glyphlang/win32-x64": "0.1.68"
16
+ "@glyphlang/darwin-x64": "0.1.70",
17
+ "@glyphlang/darwin-arm64": "0.1.70",
18
+ "@glyphlang/linux-x64": "0.1.70",
19
+ "@glyphlang/linux-arm64": "0.1.70",
20
+ "@glyphlang/win32-x64": "0.1.70"
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",