dirac-lang 0.1.24 → 0.1.26

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 (221) hide show
  1. package/dist/cli.js +13 -1
  2. package/lib/index.di +9 -0
  3. package/{examples/lib → lib}/math.di +3 -3
  4. package/package.json +13 -1
  5. package/.env.example +0 -8
  6. package/COMMUNITY.md +0 -465
  7. package/CONDITIONAL-TAGS.md +0 -172
  8. package/EXCEPTION-HANDLING.md +0 -156
  9. package/LIBRARIES.md +0 -172
  10. package/LLM-VALIDATION.md +0 -128
  11. package/NAMESPACES.md +0 -366
  12. package/PROMOTION.md +0 -257
  13. package/QUICKSTART-LIBRARY.md +0 -93
  14. package/TEST-COVERAGE.md +0 -113
  15. package/TESTING.md +0 -162
  16. package/config.test.yml +0 -5
  17. package/dirac-http/examples/demo.di +0 -9
  18. package/dirac-http/lib/index.di +0 -12
  19. package/examples/add-demo.di +0 -74
  20. package/examples/add.bk +0 -11
  21. package/examples/advanced-math-demo.di +0 -53
  22. package/examples/calculator.di +0 -32
  23. package/examples/compact-test.di +0 -6
  24. package/examples/comprehensive.bk +0 -29
  25. package/examples/defvar-variable-demo.di +0 -18
  26. package/examples/direct-call.di +0 -17
  27. package/examples/disk-analysis.di +0 -16
  28. package/examples/exception-demo.di +0 -82
  29. package/examples/executable-hello.di +0 -7
  30. package/examples/execute-demo.di +0 -38
  31. package/examples/file-manager.di +0 -77
  32. package/examples/file-stats.di +0 -18
  33. package/examples/hello.bk +0 -1
  34. package/examples/hello.di +0 -5
  35. package/examples/if-comparison.di +0 -91
  36. package/examples/if-cstyle-test.di +0 -149
  37. package/examples/if-vs-testif.di +0 -56
  38. package/examples/import-demo.di +0 -31
  39. package/examples/inline-test.bk +0 -7
  40. package/examples/llm-agent.di +0 -32
  41. package/examples/llm-basic.di +0 -12
  42. package/examples/llm-command-more.di +0 -6
  43. package/examples/llm-command-no-exec.di +0 -13
  44. package/examples/llm-command.di +0 -6
  45. package/examples/llm-complex.di +0 -141
  46. package/examples/llm-feedback-debug.di +0 -30
  47. package/examples/llm-feedback-demo.di +0 -19
  48. package/examples/llm-feedback-math.di +0 -22
  49. package/examples/llm-feedback-simple.di +0 -16
  50. package/examples/llm-feedback-sub.di +0 -22
  51. package/examples/llm-no-feedback.di +0 -10
  52. package/examples/llm-recursive.di +0 -31
  53. package/examples/llm-reflection-test.di +0 -19
  54. package/examples/llm-simple-test.di +0 -12
  55. package/examples/llm-subs.di +0 -132
  56. package/examples/llm-use-subs.di +0 -6
  57. package/examples/llm-validate-test.di +0 -18
  58. package/examples/loop.di +0 -12
  59. package/examples/math-test.di +0 -22
  60. package/examples/minimal-test.di +0 -13
  61. package/examples/mongodb-context-test.di +0 -27
  62. package/examples/mongodb-count-events.di +0 -8
  63. package/examples/mongodb-import-demo.di +0 -25
  64. package/examples/mongodb-simple-test.di +0 -18
  65. package/examples/nl-agent.di +0 -47
  66. package/examples/parameters-demo.di +0 -68
  67. package/examples/params-meta-test.di +0 -17
  68. package/examples/params-test.di +0 -10
  69. package/examples/recipe-chain.di +0 -38
  70. package/examples/recursive-llm.di +0 -44
  71. package/examples/sample-library/README.md +0 -152
  72. package/examples/sample-library/examples/demo.di +0 -34
  73. package/examples/sample-library/lib/index.di +0 -65
  74. package/examples/sample-library/package.json +0 -31
  75. package/examples/scope-test-nested.di +0 -60
  76. package/examples/scope-test.di +0 -55
  77. package/examples/seamless.di +0 -45
  78. package/examples/shell-test.bk +0 -10
  79. package/examples/simple-import.di +0 -13
  80. package/examples/simple-recursive.di +0 -26
  81. package/examples/story-builder.di +0 -45
  82. package/examples/subroutine.di +0 -23
  83. package/examples/system-llm.di +0 -21
  84. package/examples/system-simple.di +0 -3
  85. package/examples/system-test.di +0 -8
  86. package/examples/tag-check-test.di +0 -139
  87. package/examples/task-assistant.di +0 -27
  88. package/examples/test-if-demo.di +0 -110
  89. package/examples/test-parameters.di +0 -50
  90. package/examples/try-catch-test.di +0 -118
  91. package/examples/two-styles.di +0 -28
  92. package/examples/var-debug.di +0 -6
  93. package/examples/var-inline.di +0 -4
  94. package/examples/var-test2.di +0 -6
  95. package/examples/variable-replace.di +0 -25
  96. package/examples/variable-simple.di +0 -16
  97. package/examples/variable-test.di +0 -22
  98. package/examples/whitespace-test.di +0 -24
  99. package/filePath +0 -1
  100. package/greeting.txt +0 -1
  101. package/src/cli.ts +0 -140
  102. package/src/index.ts +0 -33
  103. package/src/llm/ollama.ts +0 -58
  104. package/src/runtime/braket-parser.ts +0 -234
  105. package/src/runtime/interpreter.ts +0 -203
  106. package/src/runtime/parser.ts +0 -155
  107. package/src/runtime/session.ts +0 -325
  108. package/src/tags/assign.ts +0 -37
  109. package/src/tags/attr.ts +0 -64
  110. package/src/tags/available-subroutines.ts +0 -70
  111. package/src/tags/call.ts +0 -259
  112. package/src/tags/catch.ts +0 -24
  113. package/src/tags/defvar.ts +0 -115
  114. package/src/tags/environment.ts +0 -21
  115. package/src/tags/eval.ts +0 -71
  116. package/src/tags/exception.ts +0 -20
  117. package/src/tags/execute.ts +0 -52
  118. package/src/tags/expr.ts +0 -128
  119. package/src/tags/foreach.ts +0 -170
  120. package/src/tags/if.ts +0 -191
  121. package/src/tags/import.ts +0 -135
  122. package/src/tags/index.ts +0 -41
  123. package/src/tags/input.ts +0 -182
  124. package/src/tags/llm.ts +0 -415
  125. package/src/tags/loop.ts +0 -43
  126. package/src/tags/mongodb.ts +0 -70
  127. package/src/tags/output.ts +0 -53
  128. package/src/tags/parameters.ts +0 -81
  129. package/src/tags/require_module.ts +0 -19
  130. package/src/tags/subroutine.ts +0 -75
  131. package/src/tags/system.ts +0 -93
  132. package/src/tags/tag-check.ts +0 -176
  133. package/src/tags/test-if.ts +0 -112
  134. package/src/tags/throw.ts +0 -26
  135. package/src/tags/try.ts +0 -19
  136. package/src/tags/variable.ts +0 -25
  137. package/src/test-runner.ts +0 -300
  138. package/src/types/index.ts +0 -128
  139. package/src/utils/llm-adapter.ts +0 -113
  140. package/src/utils/tag-validator.ts +0 -231
  141. package/test-available-extends.di +0 -28
  142. package/test-available-simple.di +0 -12
  143. package/test-available-subroutines.di +0 -16
  144. package/test-call.di +0 -9
  145. package/test-extend-basic.di +0 -17
  146. package/test-extend-chain.di +0 -26
  147. package/test-extend-debug.di +0 -17
  148. package/test-extend-debug2.di +0 -15
  149. package/test-extend-person.di +0 -17
  150. package/test-extend-simple.di +0 -11
  151. package/test-extend-zhi.di +0 -23
  152. package/test-extend.di +0 -19
  153. package/test-extend2.di +0 -26
  154. package/test-extend3-fixed.di +0 -23
  155. package/test-extend3-trouble.di +0 -23
  156. package/test-extend3.di +0 -21
  157. package/test-factorial.di +0 -19
  158. package/test-input-debug.di +0 -19
  159. package/test-nested-debug.di +0 -7
  160. package/test-nested-debug2.di +0 -8
  161. package/test-no-extend.di +0 -16
  162. package/test-simple-call.di +0 -7
  163. package/test-simple.di +0 -6
  164. package/tests/README.md +0 -69
  165. package/tests/assign-basic.test.di +0 -7
  166. package/tests/assign-from-eval.test.di +0 -7
  167. package/tests/available-subroutines-foreach.test.di +0 -32
  168. package/tests/basic-output.test.di +0 -5
  169. package/tests/call-basic.test.di +0 -11
  170. package/tests/call-with-output.test.di +0 -10
  171. package/tests/comments-before-content.test.di +0 -6
  172. package/tests/defvar-multiple.test.di +0 -8
  173. package/tests/environment-basic.test.di +0 -22
  174. package/tests/environment-nonexistent.test.di +0 -5
  175. package/tests/environment-with-defvar.test.di +0 -15
  176. package/tests/eval-basic.test.di +0 -6
  177. package/tests/eval-with-variables.test.di +0 -8
  178. package/tests/exception-basic.test.di +0 -10
  179. package/tests/expr-basic.test.di +0 -11
  180. package/tests/extend-basic.test.di +0 -19
  181. package/tests/extend-inheritance-chain.test.di +0 -26
  182. package/tests/extend-multiple-nested.test.di +0 -24
  183. package/tests/extend-self.test.di +0 -19
  184. package/tests/extend-with-parameters.test.di +0 -14
  185. package/tests/generate-dirac.test.di +0 -22
  186. package/tests/if-conditional.test.di +0 -17
  187. package/tests/if-else.test.di +0 -11
  188. package/tests/if-with-variables.test.di +0 -8
  189. package/tests/import-basic.test.di +0 -6
  190. package/tests/input-file-all.test.di +0 -5
  191. package/tests/input-file-line.test.di +0 -15
  192. package/tests/input-file-loop.test.di +0 -12
  193. package/tests/input-stdin-all.test.di +0 -8
  194. package/tests/input-stdin-all.txt +0 -1
  195. package/tests/llm-validate.test.di +0 -17
  196. package/tests/loop-basic.test.di +0 -9
  197. package/tests/loop-nested.test.di +0 -10
  198. package/tests/loop-with-eval.test.di +0 -8
  199. package/tests/no-root-element.test.di +0 -6
  200. package/tests/output-file.test.di +0 -19
  201. package/tests/output-multiple.test.di +0 -9
  202. package/tests/parameters-basic.test.di +0 -6
  203. package/tests/require-module-basic.test.di +0 -7
  204. package/tests/subroutine-basic.test.di +0 -9
  205. package/tests/subroutine-multiple-params.test.di +0 -10
  206. package/tests/subroutine-nested-calls.test.di +0 -32
  207. package/tests/subroutine-sequential-calls.test.di +0 -36
  208. package/tests/system-background.test.di +0 -39
  209. package/tests/system-basic.test.di +0 -5
  210. package/tests/tag-check.test.di +0 -27
  211. package/tests/test-if-basic.test.di +0 -8
  212. package/tests/test-input.txt +0 -3
  213. package/tests/try-catch-basic.test.di +0 -10
  214. package/tests/try-catch-eval-error.test.di +0 -10
  215. package/tests/variable-basic.test.di +0 -6
  216. package/tests/variable-interpolation.test.di +0 -7
  217. package/tools/create-library.sh +0 -175
  218. package/tsconfig.json +0 -19
  219. /package/{examples/lib → lib}/advanced-math.di +0 -0
  220. /package/{examples/lib → lib}/fileops.di +0 -0
  221. /package/{examples/lib → lib}/mongodb.di +0 -0
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import "dotenv/config";
13
13
  // package.json
14
14
  var package_default = {
15
15
  name: "dirac-lang",
16
- version: "0.1.23",
16
+ version: "0.1.26",
17
17
  description: "LLM-Augmented Declarative Execution",
18
18
  type: "module",
19
19
  main: "dist/index.js",
@@ -21,6 +21,18 @@ var package_default = {
21
21
  bin: {
22
22
  dirac: "dist/cli.js"
23
23
  },
24
+ exports: {
25
+ ".": "./dist/index.js",
26
+ "./lib": "./lib/index.di",
27
+ "./lib/math": "./lib/math.di",
28
+ "./lib/advanced-math": "./lib/advanced-math.di",
29
+ "./lib/fileops": "./lib/fileops.di",
30
+ "./lib/mongodb": "./lib/mongodb.di"
31
+ },
32
+ files: [
33
+ "dist/",
34
+ "lib/"
35
+ ],
24
36
  scripts: {
25
37
  dev: "tsx src/cli.ts",
26
38
  build: "tsup src/index.ts src/cli.ts src/test-runner.ts --format esm --dts --clean",
package/lib/index.di ADDED
@@ -0,0 +1,9 @@
1
+ <dirac>
2
+ <!-- DIRAC Standard Library -->
3
+ <!-- Import all standard library modules -->
4
+
5
+ <import src="./math.di"/>
6
+ <import src="./advanced-math.di"/>
7
+ <import src="./fileops.di"/>
8
+ <import src="./mongodb.di"/>
9
+ </dirac>
@@ -2,20 +2,20 @@
2
2
  <dirac>
3
3
  <!-- Square a number -->
4
4
  <subroutine name="SQUARE" param-x="number">
5
- <eval name="result">return x * x;</eval>
5
+ <eval name="result">return Number(x) * Number(x);</eval>
6
6
  <output><variable name="result" /></output>
7
7
  </subroutine>
8
8
 
9
9
  <!-- Add two numbers -->
10
10
  <subroutine name="ADD" param-a="number" param-b="number">
11
- <eval name="result">return a + b;</eval>
11
+ <eval name="result">return Number(a) + Number(b);</eval>
12
12
  <output><variable name="result" /></output>
13
13
  </subroutine>
14
14
 
15
15
  <!-- Calculate factorial -->
16
16
  <subroutine name="FACTORIAL" param-num="number">
17
17
  <eval name="result">
18
- const n = parseInt(num);
18
+ const n = parseInt(num, 10);
19
19
  let fact = 1;
20
20
  for (let i = 2; i &lt;= n; i++) fact *= i;
21
21
  return fact;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirac-lang",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,6 +8,18 @@
8
8
  "bin": {
9
9
  "dirac": "dist/cli.js"
10
10
  },
11
+ "exports": {
12
+ ".": "./dist/index.js",
13
+ "./lib": "./lib/index.di",
14
+ "./lib/math": "./lib/math.di",
15
+ "./lib/advanced-math": "./lib/advanced-math.di",
16
+ "./lib/fileops": "./lib/fileops.di",
17
+ "./lib/mongodb": "./lib/mongodb.di"
18
+ },
19
+ "files": [
20
+ "dist/",
21
+ "lib/"
22
+ ],
11
23
  "scripts": {
12
24
  "dev": "tsx src/cli.ts",
13
25
  "build": "tsup src/index.ts src/cli.ts src/test-runner.ts --format esm --dts --clean",
package/.env.example DELETED
@@ -1,8 +0,0 @@
1
- # OpenAI API Key (recommended)
2
- OPENAI_API_KEY=sk-your-key-here
3
-
4
- # Or Anthropic API Key
5
- # ANTHROPIC_API_KEY=sk-ant-your-key-here
6
-
7
- # Default model (optional)
8
- # DEFAULT_MODEL=gpt-4-turbo-preview
package/COMMUNITY.md DELETED
@@ -1,465 +0,0 @@
1
- # Dirac Community Library Ecosystem
2
-
3
- ## Publishing a Library
4
-
5
- ### Step 1: Create Your Library
6
-
7
- Create a repository structure:
8
- ```
9
- my-dirac-library/
10
- ├── package.json # npm metadata
11
- ├── README.md # Documentation
12
- ├── lib/
13
- │ ├── main.di # Your subroutines
14
- │ └── utils.di # Helper functions
15
- ├── examples/
16
- │ └── demo.di # Usage examples
17
- └── tests/
18
- └── test.di # Tests
19
- ```
20
-
21
- ### Step 2: Follow Naming Convention
22
-
23
- **CRITICAL: Prevent conflicts with prefixes**
24
-
25
- All library tags MUST use a prefix:
26
- - Package: `dirac-http` → Prefix: `HTTP_`
27
- - Package: `dirac-crypto` → Prefix: `CRYPTO_`
28
- - Example: `<HTTP_GET/>`, `<CRYPTO_SHA256/>`
29
-
30
- ### Step 3: Add package.json
31
-
32
- ```json
33
- {
34
- "name": "dirac-crypto",
35
- "version": "1.0.0",
36
- "description": "Cryptography library for Dirac",
37
- "main": "lib/main.di",
38
- "keywords": ["dirac", "crypto", "hash"],
39
- "author": "Your Name",
40
- "license": "MIT",
41
- "repository": {
42
- "type": "git",
43
- "url": "https://github.com/username/dirac-crypto"
44
- },
45
- "dirac": {
46
- "version": ">=0.1.0",
47
- "exports": {
48
- "main": "lib/main.di",
49
- "utils": "lib/utils.di"
50
- },
51
- "dependencies": {}
52
- }
53
- }
54
- ```
55
-
56
- ### Step 3: Publish
57
-
58
- #### Option A: npm (Recommended)
59
- ```bash
60
- npm login
61
- npm publish
62
- ```
63
-
64
- Users install:
65
- ```bash
66
- npm install dirac-crypto
67
- ```
68
-
69
- Use:
70
- ```xml
71
- <import src="./node_modules/dirac-crypto/lib/main.di"/>
72
- <SHA256 text="hello world"/>
73
- ```
74
-
75
- #### Option B: GitHub
76
- ```bash
77
- git tag v1.0.0
78
- git push --tags
79
- ```
80
-
81
- Users install:
82
- ```bash
83
- npm install github:username/dirac-crypto
84
- ```
85
-
86
- #### Option C: Dirac Registry (Future)
87
- ```bash
88
- dirac publish
89
- ```
90
-
91
- Users install:
92
- ```bash
93
- dirac install crypto
94
- ```
95
-
96
- Use:
97
- ```xml
98
- <import src="@dirac/crypto/main"/>
99
- ```
100
-
101
- ## Discovery Mechanisms
102
-
103
- ### 1. npm with "dirac-" prefix
104
-
105
- Convention: All Dirac libraries use `dirac-` prefix:
106
- - `dirac-http` - HTTP client
107
- - `dirac-db` - Database operations
108
- - `dirac-ml` - Machine learning
109
- - `dirac-crypto` - Cryptography
110
-
111
- Search on npm:
112
- ```bash
113
- npm search dirac-
114
- ```
115
-
116
- ### 2. GitHub Topics
117
-
118
- Tag repos with:
119
- - `dirac`
120
- - `dirac-library`
121
- - `mask-language`
122
-
123
- Browse: https://github.com/topics/dirac-library
124
-
125
- ### 3. Central Registry Website
126
-
127
- Create `diraclibs.org`:
128
- - **Browse** libraries by category
129
- - **Search** by functionality
130
- - **Ratings** and downloads
131
- - **Documentation** for each library
132
- - **Examples** and tutorials
133
-
134
- ### 4. CLI Discovery
135
-
136
- ```bash
137
- dirac search "http client"
138
- dirac info dirac-http
139
- dirac install dirac-http
140
- ```
141
-
142
- ## Quality Standards
143
-
144
- ### Verified Libraries
145
-
146
- Libraries can be "verified" by passing:
147
-
148
- 1. **Tests** - Automated test suite
149
- 2. **Documentation** - README with examples
150
- 3. **Compatibility** - Works with current Dirac version
151
- 4. **Security** - No malicious code (automated scan)
152
- 5. **Community** - Downloads, stars, issues resolved
153
-
154
- Badge in README:
155
- ```markdown
156
- ![Dirac Verified](https://img.shields.io/badge/dirac-verified-green)
157
- ```
158
-
159
- ### Library Template
160
-
161
- Provide starter template:
162
- ```bash
163
- dirac create-lib my-library
164
- ```
165
-
166
- Generates:
167
- ```
168
- my-library/
169
- ├── package.json
170
- ├── README.md
171
- ├── lib/
172
- │ └── index.di
173
- ├── examples/
174
- │ └── example.di
175
- ├── tests/
176
- │ └── test.di
177
- └── .github/
178
- └── workflows/
179
- └── test.yml # Auto-test on push
180
- ```
181
-
182
- ## Version Management
183
-
184
- ### Semantic Versioning
185
-
186
- Follow semver for library versions:
187
- - `1.0.0` - Initial release
188
- - `1.1.0` - New subroutines (backward compatible)
189
- - `2.0.0` - Breaking changes
190
-
191
- ### Dependency Resolution
192
-
193
- In `package.json`:
194
- ```json
195
- {
196
- "dirac": {
197
- "dependencies": {
198
- "dirac-utils": "^1.0.0",
199
- "dirac-http": "^2.1.0"
200
- }
201
- }
202
- }
203
- ```
204
-
205
- Install with:
206
- ```bash
207
- npm install
208
- ```
209
-
210
- ### Import from Dependencies
211
-
212
- ```xml
213
- <!-- Import from node_modules -->
214
- <import src="./node_modules/dirac-http/lib/main.di"/>
215
-
216
- <!-- Or use a helper tag (future) -->
217
- <import package="dirac-http"/>
218
- ```
219
-
220
- ## Community Governance
221
-
222
- ### 1. Core Standard Library
223
-
224
- Official libraries maintained by Dirac team:
225
- - `@dirac/stdlib` - Standard library
226
- - `@dirac/test` - Testing framework
227
- - `@dirac/docs` - Documentation generator
228
-
229
- Published under `@dirac` scope on npm.
230
-
231
- ### 2. Community Libraries
232
-
233
- Anyone can publish `dirac-*` packages:
234
- - Use npm's existing infrastructure
235
- - No approval needed
236
- - Free innovation
237
-
238
- ### 3. Awesome List
239
-
240
- Maintain `awesome-dirac` repo:
241
- ```markdown
242
- # Awesome Dirac
243
-
244
- ## HTTP & Networking
245
- - [dirac-http](https://github.com/user/dirac-http) - HTTP client
246
- - [dirac-websocket](https://github.com/user/dirac-ws) - WebSocket
247
-
248
- ## Data Processing
249
- - [dirac-json](https://github.com/user/dirac-json) - JSON parser
250
- - [dirac-csv](https://github.com/user/dirac-csv) - CSV operations
251
-
252
- ## Machine Learning
253
- - [dirac-ml](https://github.com/user/dirac-ml) - ML toolkit
254
- ```
255
-
256
- ### 4. Discord/Forum
257
-
258
- Community channels:
259
- - **#library-showcase** - Share new libraries
260
- - **#help** - Get support
261
- - **#development** - Discuss features
262
- - **#security** - Report issues
263
-
264
- ## Example: Publishing dirac-http
265
-
266
- ### 1. Create Library
267
-
268
- `lib/main.di`:
269
- ```xml
270
- <dirac>
271
-
272
- <subroutine name="HTTP_GET">
273
- <eval>
274
- const caller = getParams();
275
- const url = caller.attributes.url;
276
- const response = await fetch(url);
277
- const text = await response.text();
278
- console.log(text);
279
- </eval>
280
- </subroutine>
281
-
282
- <subroutine name="HTTP_POST">
283
- <eval>
284
- const caller = getParams();
285
- const url = caller.attributes.url;
286
- const body = caller.attributes.body || '';
287
- const response = await fetch(url, {
288
- method: 'POST',
289
- body: body
290
- });
291
- const text = await response.text();
292
- console.log(text);
293
- </eval>
294
- </subroutine>
295
-
296
- </dirac>
297
- ```
298
-
299
- ### 2. Create package.json
300
-
301
- ```json
302
- {
303
- "name": "dirac-http",
304
- "version": "1.0.0",
305
- "description": "HTTP client for Dirac",
306
- "main": "lib/main.di",
307
- "keywords": ["dirac", "http", "fetch", "rest"],
308
- "author": "Community Member",
309
- "license": "MIT",
310
- "repository": "github:username/dirac-http",
311
- "dirac": {
312
- "version": ">=0.1.0"
313
- }
314
- }
315
- ```
316
-
317
- ### 3. Create README.md
318
-
319
- ```markdown
320
- # dirac-http
321
-
322
- HTTP client library for Dirac.
323
-
324
- ## Installation
325
-
326
- \`\`\`bash
327
- npm install dirac-http
328
- \`\`\`
329
-
330
- ## Usage
331
-
332
- \`\`\`xml
333
- <import src="./node_modules/dirac-http/lib/main.di"/>
334
-
335
- <HTTP_GET url="https://api.github.com/users/octocat"/>
336
-
337
- <HTTP_POST
338
- url="https://httpbin.org/post"
339
- body='{"key":"value"}'/>
340
- \`\`\`
341
-
342
- ## API
343
-
344
- ### HTTP_GET
345
- Get a URL.
346
-
347
- **Attributes:**
348
- - `url` - URL to fetch (required)
349
-
350
- ### HTTP_POST
351
- Post to a URL.
352
-
353
- **Attributes:**
354
- - `url` - URL to post to (required)
355
- - `body` - Request body (optional)
356
- ```
357
-
358
- ### 4. Publish
359
-
360
- ```bash
361
- npm login
362
- npm publish
363
- ```
364
-
365
- ### 5. Users Install & Use
366
-
367
- ```bash
368
- npm install dirac-http
369
- ```
370
-
371
- ```xml
372
- <import src="./node_modules/dirac-http/lib/main.di"/>
373
- <HTTP_GET url="https://example.com"/>
374
- ```
375
-
376
- ## Future Enhancements
377
-
378
- ### 1. Dirac Package Manager
379
-
380
- ```bash
381
- dirac init # Initialize project
382
- dirac add http # Add library
383
- dirac remove http # Remove library
384
- dirac list # List installed
385
- dirac search "machine learning" # Search registry
386
- dirac publish # Publish library
387
- ```
388
-
389
- ### 2. Smart Imports
390
-
391
- ```xml
392
- <!-- Current -->
393
- <import src="./node_modules/dirac-http/lib/main.di"/>
394
-
395
- <!-- Future -->
396
- <import package="http"/> <!-- From installed packages -->
397
- <import from="http" names="GET"/> <!-- Named imports -->
398
- <import src="https://cdn.dirac.org/http/1.0.0/main.di"/> <!-- CDN -->
399
- ```
400
-
401
- ### 3. Type System (Optional)
402
-
403
- ```xml
404
- <subroutine name="ADD" params="(x: number, y: number) -> number">
405
- <expr eval="plus">
406
- <arg><parameters select="@x"/></arg>
407
- <arg><parameters select="@y"/></arg>
408
- </expr>
409
- </subroutine>
410
- ```
411
-
412
- ### 4. Testing Framework
413
-
414
- ```xml
415
- <import src="@dirac/test"/>
416
-
417
- <test name="ADD works correctly">
418
- <assert>
419
- <expr eval="eq">
420
- <arg><ADD x="1" y="2"/></arg>
421
- <arg>3</arg>
422
- </expr>
423
- </assert>
424
- </test>
425
- ```
426
-
427
- ## Community Growth Phases
428
-
429
- ### Phase 1: Bootstrap (Month 1-3)
430
- - ✅ Core interpreter working
431
- - ✅ Basic examples
432
- - Create 5-10 core libraries
433
- - Set up GitHub org
434
- - Launch Discord
435
-
436
- ### Phase 2: Early Adopters (Month 4-6)
437
- - npm publishing convention
438
- - awesome-dirac list
439
- - Tutorial videos
440
- - First community libraries
441
-
442
- ### Phase 3: Growth (Month 7-12)
443
- - 50+ libraries on npm
444
- - diraclibs.org registry
445
- - Conference talks
446
- - Plugin for VS Code
447
-
448
- ### Phase 4: Maturity (Year 2+)
449
- - 200+ libraries
450
- - Dirac package manager
451
- - Corporate adoption
452
- - Certification program
453
-
454
- ## Getting Started Contributing
455
-
456
- 1. **Pick a domain**: crypto, http, db, ml, etc.
457
- 2. **Check existing**: Search npm for `dirac-*`
458
- 3. **Create library**: Use template
459
- 4. **Test thoroughly**: Write examples
460
- 5. **Document well**: README + examples
461
- 6. **Publish**: npm publish
462
- 7. **Announce**: Discord + GitHub discussions
463
- 8. **Maintain**: Respond to issues
464
-
465
- The ecosystem grows organically as developers scratch their own itches!