@hatchingpoint/point 0.0.6 → 0.0.7

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Point
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Point
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,34 +1,34 @@
1
- # Point
2
-
3
- Point is an AI-first general-purpose language core for coding-agent-native software engineering.
4
-
5
- ## Install
6
-
7
- Requires [Bun](https://bun.sh) on PATH.
8
-
9
- ```bash
10
- npm install -g @hatchingpoint/point
11
- point check examples/math.point
12
- ```
13
-
14
- Pair with the [Point Language](https://marketplace.visualstudio.com/items?itemName=hatchingpoint.point) extension in VS Code or Cursor.
15
-
16
- Point's public source language is semantic product logic. The compiler lowers that source into an internal typed core and emits TypeScript for existing JavaScript infrastructure.
17
-
18
- This package is the source of truth for Point. It exposes:
19
-
20
- - `point` CLI through `src/cli.ts`
21
- - core language APIs through `@hatchingpoint/point/core`
22
- - semantic parser/lowering, core checker, formatter, and TypeScript emitter APIs
23
-
24
- Core workflow:
25
-
26
- ```bash
27
- bun run fmt-check
28
- bun run check
29
- bun run build
30
- ```
31
-
32
- `bun run build` emits TypeScript into `generated/` for React, Vue, Bun, Node, and Vite projects.
33
-
34
- When Point is extracted, this package can move into a standalone repo with the same package name and public entrypoints.
1
+ # Point
2
+
3
+ Point is an AI-first general-purpose language core for coding-agent-native software engineering.
4
+
5
+ ## Install
6
+
7
+ Requires [Bun](https://bun.sh) on PATH.
8
+
9
+ ```bash
10
+ npm install -g @hatchingpoint/point
11
+ point check examples/math.point
12
+ ```
13
+
14
+ Pair with the [Point Language](https://marketplace.visualstudio.com/items?itemName=hatchingpoint.point) extension in VS Code or Cursor.
15
+
16
+ Point's public source language is semantic product logic. The compiler lowers that source into an internal typed core and emits TypeScript for existing JavaScript infrastructure.
17
+
18
+ This package is the source of truth for Point. It exposes:
19
+
20
+ - `point` CLI through `src/cli.ts`
21
+ - core language APIs through `@hatchingpoint/point/core`
22
+ - semantic parser/lowering, core checker, formatter, and TypeScript emitter APIs
23
+
24
+ Core workflow:
25
+
26
+ ```bash
27
+ bun run fmt-check
28
+ bun run check
29
+ bun run build
30
+ ```
31
+
32
+ `bun run build` emits TypeScript into `generated/` for React, Vue, Bun, Node, and Vite projects.
33
+
34
+ When Point is extracted, this package can move into a standalone repo with the same package name and public entrypoints.
package/package.json CHANGED
@@ -1,30 +1,34 @@
1
- {
2
- "name": "@hatchingpoint/point",
3
- "version": "0.0.6",
4
- "private": false,
5
- "type": "module",
6
- "description": "Point language compiler and CLI.",
7
- "homepage": "https://github.com/HatchingPoint/point#readme",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/HatchingPoint/point.git",
11
- "directory": "packages/point"
12
- },
13
- "bugs": {
14
- "url": "https://github.com/HatchingPoint/point/issues"
15
- },
16
- "files": [
17
- "src",
18
- "README.md",
19
- "LICENSE"
20
- ],
21
- "bin": {
22
- "point": "src/cli.ts"
23
- },
24
- "exports": {
25
- ".": "./src/index.ts",
26
- "./cli": "./src/cli.ts",
27
- "./core": "./src/core/index.ts"
28
- },
29
- "license": "MIT"
30
- }
1
+ {
2
+ "name": "@hatchingpoint/point",
3
+ "version": "0.0.7",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Point language compiler and CLI.",
7
+ "homepage": "https://github.com/HatchingPoint/point#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/HatchingPoint/point.git",
11
+ "directory": "packages/point"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/HatchingPoint/point/issues"
15
+ },
16
+ "files": [
17
+ "src",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "bin": {
22
+ "point": "src/cli.ts"
23
+ },
24
+ "exports": {
25
+ ".": "./src/index.ts",
26
+ "./cli": "./src/cli.ts",
27
+ "./core": "./src/core/index.ts"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public",
31
+ "registry": "https://registry.npmjs.org/"
32
+ },
33
+ "license": "MIT"
34
+ }
package/src/cli.ts CHANGED
@@ -1,7 +1,7 @@
1
- #!/usr/bin/env bun
2
- import { main } from "./core/cli.ts";
3
-
4
- main().catch((error) => {
5
- console.error(error instanceof Error ? error.message : error);
6
- process.exit(1);
7
- });
1
+ #!/usr/bin/env bun
2
+ import { main } from "./core/cli.ts";
3
+
4
+ main().catch((error) => {
5
+ console.error(error instanceof Error ? error.message : error);
6
+ process.exit(1);
7
+ });
package/src/core/ast.ts CHANGED
@@ -1,162 +1,162 @@
1
- import type { PointSemanticProgram } from "../semantic/ast.ts";
2
-
3
- export type PointCorePrimitiveType = "Text" | "Int" | "Float" | "Bool" | "Void";
4
-
5
- export interface PointSourcePosition {
6
- line: number;
7
- column: number;
8
- offset: number;
9
- }
10
-
11
- export interface PointSourceSpan {
12
- start: PointSourcePosition;
13
- end: PointSourcePosition;
14
- }
15
-
16
- export interface PointCoreProgram {
17
- kind: "coreProgram";
18
- module?: string;
19
- declarations: PointCoreDeclaration[];
20
- span?: PointSourceSpan;
21
- semantic?: PointSemanticProgramMetadata;
22
- semanticSource?: PointSemanticProgram;
23
- }
24
-
25
- export type PointCoreDeclaration =
26
- | PointCoreImportDeclaration
27
- | PointCoreExternalDeclaration
28
- | PointCoreValueDeclaration
29
- | PointCoreFunctionDeclaration
30
- | PointCoreTypeDeclaration;
31
-
32
- export interface PointCoreImportDeclaration {
33
- kind: "import";
34
- names: string[];
35
- from: string;
36
- span?: PointSourceSpan;
37
- }
38
-
39
- export interface PointCoreValueDeclaration {
40
- kind: "value";
41
- name: string;
42
- type: PointCoreTypeExpression;
43
- value: PointCoreExpression;
44
- mutable: boolean;
45
- span?: PointSourceSpan;
46
- }
47
-
48
- export interface PointCoreFunctionDeclaration {
49
- kind: "function";
50
- name: string;
51
- params: PointCoreParameter[];
52
- returnType: PointCoreTypeExpression;
53
- body: PointCoreStatement[];
54
- span?: PointSourceSpan;
55
- semantic?: PointSemanticDeclarationMetadata;
56
- }
57
-
58
- export interface PointCoreExternalDeclaration {
59
- kind: "external";
60
- name: string;
61
- params: PointCoreParameter[];
62
- returnType: PointCoreTypeExpression;
63
- from: string;
64
- importName?: string;
65
- span?: PointSourceSpan;
66
- semantic?: PointSemanticDeclarationMetadata;
67
- }
68
-
69
- export interface PointCoreTypeDeclaration {
70
- kind: "type";
71
- name: string;
72
- fields: PointCoreParameter[];
73
- span?: PointSourceSpan;
74
- semantic?: PointSemanticDeclarationMetadata;
75
- }
76
-
77
- export interface PointCoreParameter {
78
- name: string;
79
- type: PointCoreTypeExpression;
80
- span?: PointSourceSpan;
81
- semanticName?: string;
82
- }
83
-
84
- export interface PointSemanticProgramMetadata {
85
- source: "semantic";
86
- }
87
-
88
- export interface PointSemanticDeclarationMetadata {
89
- kind: "record" | "calculation" | "rule" | "label" | "external" | "action" | "policy" | "view" | "route" | "workflow" | "command";
90
- name: string;
91
- outputName?: string;
92
- effects?: string[];
93
- }
94
-
95
- export interface PointCoreTypeExpression {
96
- kind: "typeRef";
97
- name: PointCorePrimitiveType | string;
98
- args: PointCoreTypeExpression[];
99
- span?: PointSourceSpan;
100
- }
101
-
102
- export interface PointCoreRecordField {
103
- name: string;
104
- value: PointCoreExpression;
105
- span?: PointSourceSpan;
106
- }
107
-
108
- export type PointCoreStatement =
109
- | { kind: "return"; value?: PointCoreExpression; span?: PointSourceSpan }
110
- | PointCoreValueDeclaration
111
- | {
112
- kind: "assignment";
113
- name: string;
114
- operator: "=" | "+=" | "-=";
115
- value: PointCoreExpression;
116
- span?: PointSourceSpan;
117
- }
118
- | {
119
- kind: "if";
120
- condition: PointCoreExpression;
121
- thenBody: PointCoreStatement[];
122
- elseBody: PointCoreStatement[];
123
- span?: PointSourceSpan;
124
- }
125
- | {
126
- kind: "for";
127
- itemName: string;
128
- iterable: PointCoreExpression;
129
- body: PointCoreStatement[];
130
- span?: PointSourceSpan;
131
- }
132
- | { kind: "expression"; value: PointCoreExpression; span?: PointSourceSpan };
133
-
134
- export type PointCoreExpression =
135
- | { kind: "literal"; value: string | number | boolean | null; span?: PointSourceSpan }
136
- | { kind: "identifier"; name: string; span?: PointSourceSpan }
137
- | { kind: "list"; items: PointCoreExpression[]; span?: PointSourceSpan }
138
- | { kind: "record"; fields: PointCoreRecordField[]; span?: PointSourceSpan }
139
- | { kind: "property"; target: PointCoreExpression; name: string; span?: PointSourceSpan }
140
- | { kind: "await"; value: PointCoreExpression; span?: PointSourceSpan }
141
- | {
142
- kind: "binary";
143
- operator: PointCoreBinaryOperator;
144
- left: PointCoreExpression;
145
- right: PointCoreExpression;
146
- span?: PointSourceSpan;
147
- }
148
- | { kind: "call"; callee: string; args: PointCoreExpression[]; span?: PointSourceSpan };
149
-
150
- export type PointCoreBinaryOperator =
151
- | "+"
152
- | "-"
153
- | "*"
154
- | "/"
155
- | "=="
156
- | "!="
157
- | "<"
158
- | "<="
159
- | ">"
160
- | ">="
161
- | "and"
162
- | "or";
1
+ import type { PointSemanticProgram } from "../semantic/ast.ts";
2
+
3
+ export type PointCorePrimitiveType = "Text" | "Int" | "Float" | "Bool" | "Void";
4
+
5
+ export interface PointSourcePosition {
6
+ line: number;
7
+ column: number;
8
+ offset: number;
9
+ }
10
+
11
+ export interface PointSourceSpan {
12
+ start: PointSourcePosition;
13
+ end: PointSourcePosition;
14
+ }
15
+
16
+ export interface PointCoreProgram {
17
+ kind: "coreProgram";
18
+ module?: string;
19
+ declarations: PointCoreDeclaration[];
20
+ span?: PointSourceSpan;
21
+ semantic?: PointSemanticProgramMetadata;
22
+ semanticSource?: PointSemanticProgram;
23
+ }
24
+
25
+ export type PointCoreDeclaration =
26
+ | PointCoreImportDeclaration
27
+ | PointCoreExternalDeclaration
28
+ | PointCoreValueDeclaration
29
+ | PointCoreFunctionDeclaration
30
+ | PointCoreTypeDeclaration;
31
+
32
+ export interface PointCoreImportDeclaration {
33
+ kind: "import";
34
+ names: string[];
35
+ from: string;
36
+ span?: PointSourceSpan;
37
+ }
38
+
39
+ export interface PointCoreValueDeclaration {
40
+ kind: "value";
41
+ name: string;
42
+ type: PointCoreTypeExpression;
43
+ value: PointCoreExpression;
44
+ mutable: boolean;
45
+ span?: PointSourceSpan;
46
+ }
47
+
48
+ export interface PointCoreFunctionDeclaration {
49
+ kind: "function";
50
+ name: string;
51
+ params: PointCoreParameter[];
52
+ returnType: PointCoreTypeExpression;
53
+ body: PointCoreStatement[];
54
+ span?: PointSourceSpan;
55
+ semantic?: PointSemanticDeclarationMetadata;
56
+ }
57
+
58
+ export interface PointCoreExternalDeclaration {
59
+ kind: "external";
60
+ name: string;
61
+ params: PointCoreParameter[];
62
+ returnType: PointCoreTypeExpression;
63
+ from: string;
64
+ importName?: string;
65
+ span?: PointSourceSpan;
66
+ semantic?: PointSemanticDeclarationMetadata;
67
+ }
68
+
69
+ export interface PointCoreTypeDeclaration {
70
+ kind: "type";
71
+ name: string;
72
+ fields: PointCoreParameter[];
73
+ span?: PointSourceSpan;
74
+ semantic?: PointSemanticDeclarationMetadata;
75
+ }
76
+
77
+ export interface PointCoreParameter {
78
+ name: string;
79
+ type: PointCoreTypeExpression;
80
+ span?: PointSourceSpan;
81
+ semanticName?: string;
82
+ }
83
+
84
+ export interface PointSemanticProgramMetadata {
85
+ source: "semantic";
86
+ }
87
+
88
+ export interface PointSemanticDeclarationMetadata {
89
+ kind: "record" | "calculation" | "rule" | "label" | "external" | "action" | "policy" | "view" | "route" | "workflow" | "command";
90
+ name: string;
91
+ outputName?: string;
92
+ effects?: string[];
93
+ }
94
+
95
+ export interface PointCoreTypeExpression {
96
+ kind: "typeRef";
97
+ name: PointCorePrimitiveType | string;
98
+ args: PointCoreTypeExpression[];
99
+ span?: PointSourceSpan;
100
+ }
101
+
102
+ export interface PointCoreRecordField {
103
+ name: string;
104
+ value: PointCoreExpression;
105
+ span?: PointSourceSpan;
106
+ }
107
+
108
+ export type PointCoreStatement =
109
+ | { kind: "return"; value?: PointCoreExpression; span?: PointSourceSpan }
110
+ | PointCoreValueDeclaration
111
+ | {
112
+ kind: "assignment";
113
+ name: string;
114
+ operator: "=" | "+=" | "-=";
115
+ value: PointCoreExpression;
116
+ span?: PointSourceSpan;
117
+ }
118
+ | {
119
+ kind: "if";
120
+ condition: PointCoreExpression;
121
+ thenBody: PointCoreStatement[];
122
+ elseBody: PointCoreStatement[];
123
+ span?: PointSourceSpan;
124
+ }
125
+ | {
126
+ kind: "for";
127
+ itemName: string;
128
+ iterable: PointCoreExpression;
129
+ body: PointCoreStatement[];
130
+ span?: PointSourceSpan;
131
+ }
132
+ | { kind: "expression"; value: PointCoreExpression; span?: PointSourceSpan };
133
+
134
+ export type PointCoreExpression =
135
+ | { kind: "literal"; value: string | number | boolean | null; span?: PointSourceSpan }
136
+ | { kind: "identifier"; name: string; span?: PointSourceSpan }
137
+ | { kind: "list"; items: PointCoreExpression[]; span?: PointSourceSpan }
138
+ | { kind: "record"; fields: PointCoreRecordField[]; span?: PointSourceSpan }
139
+ | { kind: "property"; target: PointCoreExpression; name: string; span?: PointSourceSpan }
140
+ | { kind: "await"; value: PointCoreExpression; span?: PointSourceSpan }
141
+ | {
142
+ kind: "binary";
143
+ operator: PointCoreBinaryOperator;
144
+ left: PointCoreExpression;
145
+ right: PointCoreExpression;
146
+ span?: PointSourceSpan;
147
+ }
148
+ | { kind: "call"; callee: string; args: PointCoreExpression[]; span?: PointSourceSpan };
149
+
150
+ export type PointCoreBinaryOperator =
151
+ | "+"
152
+ | "-"
153
+ | "*"
154
+ | "/"
155
+ | "=="
156
+ | "!="
157
+ | "<"
158
+ | "<="
159
+ | ">"
160
+ | ">="
161
+ | "and"
162
+ | "or";