agentic-lang 0.2.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/COMMUNITY.md +220 -0
- package/CONTRIBUTING.md +194 -0
- package/FINAL_REPORT.md +398 -0
- package/FOR_OTHER_LLMS.md +286 -0
- package/IMPROVEMENTS.md +319 -0
- package/LAUNCH_GUIDE.md +388 -0
- package/LICENSE +21 -0
- package/NPM_PUBLISH.md +257 -0
- package/PROJECT_COMPLETE.md +414 -0
- package/PROJECT_OVERVIEW.md +265 -0
- package/PROJECT_TREE.txt +228 -0
- package/PUBLISHING_GUIDE.md +426 -0
- package/PUBLISH_NOW.md +337 -0
- package/QUICKSTART.md +207 -0
- package/README.md +195 -0
- package/README_ENHANCED.md +329 -0
- package/READY_TO_LAUNCH.txt +56 -0
- package/REFACTOR_PLAN.md +179 -0
- package/ROADMAP.md +201 -0
- package/SUMMARY.md +315 -0
- package/bin/agentic.js +3 -0
- package/blog/001-introducing-agentic.md +382 -0
- package/blog/002-confidence-driven-development.md +490 -0
- package/blog/003-formal-verification.md +427 -0
- package/blog/004-multi-agent-production.md +436 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +151 -0
- package/dist/cli.js.map +1 -0
- package/dist/diagnostics/diagnostic.d.ts +115 -0
- package/dist/diagnostics/diagnostic.d.ts.map +1 -0
- package/dist/diagnostics/diagnostic.js +101 -0
- package/dist/diagnostics/diagnostic.js.map +1 -0
- package/dist/diagnostics/formatter.d.ts +36 -0
- package/dist/diagnostics/formatter.d.ts.map +1 -0
- package/dist/diagnostics/formatter.js +263 -0
- package/dist/diagnostics/formatter.js.map +1 -0
- package/dist/effects/effect-system.d.ts +64 -0
- package/dist/effects/effect-system.d.ts.map +1 -0
- package/dist/effects/effect-system.js +197 -0
- package/dist/effects/effect-system.js.map +1 -0
- package/dist/generator/typescript-generator.d.ts +31 -0
- package/dist/generator/typescript-generator.d.ts.map +1 -0
- package/dist/generator/typescript-generator.js +308 -0
- package/dist/generator/typescript-generator.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/lean4/exporter.d.ts +24 -0
- package/dist/lean4/exporter.d.ts.map +1 -0
- package/dist/lean4/exporter.js +142 -0
- package/dist/lean4/exporter.js.map +1 -0
- package/dist/lsp/server.d.ts +6 -0
- package/dist/lsp/server.d.ts.map +1 -0
- package/dist/lsp/server.js +131 -0
- package/dist/lsp/server.js.map +1 -0
- package/dist/parser/lexer.d.ts +79 -0
- package/dist/parser/lexer.d.ts.map +1 -0
- package/dist/parser/lexer.js +296 -0
- package/dist/parser/lexer.js.map +1 -0
- package/dist/parser/parser-enhanced.d.ts +12 -0
- package/dist/parser/parser-enhanced.d.ts.map +1 -0
- package/dist/parser/parser-enhanced.js +206 -0
- package/dist/parser/parser-enhanced.js.map +1 -0
- package/dist/parser/parser.d.ts +34 -0
- package/dist/parser/parser.d.ts.map +1 -0
- package/dist/parser/parser.js +507 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/property-tests/generator-enhanced.d.ts +27 -0
- package/dist/property-tests/generator-enhanced.d.ts.map +1 -0
- package/dist/property-tests/generator-enhanced.js +209 -0
- package/dist/property-tests/generator-enhanced.js.map +1 -0
- package/dist/property-tests/generator-fixed.d.ts +2 -0
- package/dist/property-tests/generator-fixed.d.ts.map +1 -0
- package/dist/property-tests/generator-fixed.js +7 -0
- package/dist/property-tests/generator-fixed.js.map +1 -0
- package/dist/property-tests/generator.d.ts +28 -0
- package/dist/property-tests/generator.d.ts.map +1 -0
- package/dist/property-tests/generator.js +284 -0
- package/dist/property-tests/generator.js.map +1 -0
- package/dist/refinements/refinement-types.d.ts +96 -0
- package/dist/refinements/refinement-types.d.ts.map +1 -0
- package/dist/refinements/refinement-types.js +234 -0
- package/dist/refinements/refinement-types.js.map +1 -0
- package/dist/repl.d.ts +21 -0
- package/dist/repl.d.ts.map +1 -0
- package/dist/repl.js +317 -0
- package/dist/repl.js.map +1 -0
- package/dist/runtime/agents.d.ts +97 -0
- package/dist/runtime/agents.d.ts.map +1 -0
- package/dist/runtime/agents.js +258 -0
- package/dist/runtime/agents.js.map +1 -0
- package/dist/runtime/index.d.ts +98 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +253 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/types-extended.d.ts +197 -0
- package/dist/types-extended.d.ts.map +1 -0
- package/dist/types-extended.js +7 -0
- package/dist/types-extended.js.map +1 -0
- package/dist/types.d.ts +129 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/verification/z3-engine.d.ts +75 -0
- package/dist/verification/z3-engine.d.ts.map +1 -0
- package/dist/verification/z3-engine.js +234 -0
- package/dist/verification/z3-engine.js.map +1 -0
- package/examples/advanced-features.agentic +98 -0
- package/examples/annotations.agentic +37 -0
- package/examples/auth.agentic +53 -0
- package/examples/enterprise-example.agentic +360 -0
- package/examples/minimal.agentic +3 -0
- package/examples/minimal.ts +7 -0
- package/examples/ml-pipeline.agentic +350 -0
- package/examples/multi-agent-example.agentic +212 -0
- package/examples/onboarding-tutorial.agentic +263 -0
- package/examples/production-api.agentic +304 -0
- package/examples/real-world-chatbot.agentic +351 -0
- package/examples/result-handling.agentic +34 -0
- package/examples/runtime.ts +24 -0
- package/examples/showcase.agentic +22 -0
- package/examples/showcase.ts +28 -0
- package/examples/simple-test.agentic +4 -0
- package/examples/simple-test.ts +7 -0
- package/examples/simple.agentic +20 -0
- package/examples/test2.agentic +4 -0
- package/examples/test2.ts +9 -0
- package/examples/test3.agentic +4 -0
- package/examples/test3.ts +9 -0
- package/package.json +70 -0
- package/playground/index.html +221 -0
- package/playground/playground.js +291 -0
- package/registry/package-registry.ts +319 -0
- package/scripts/build.js +50 -0
- package/scripts/validate-confidence-mutation.ts +112 -0
- package/stdlib/async/promise.agentic +216 -0
- package/stdlib/database/pool.agentic +235 -0
- package/stdlib/file/io.agentic +194 -0
- package/stdlib/http/client.agentic +168 -0
- package/video-scripts/001-agentic-in-100-seconds.md +175 -0
- package/vscode-extension/README.md +67 -0
- package/vscode-extension/language-configuration.json +31 -0
- package/vscode-extension/package.json +46 -0
- package/vscode-extension/syntaxes/agentic.tmLanguage.json +134 -0
package/PUBLISH_NOW.md
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
# 🚀 PUBLISH NOW - Step-by-Step Guide
|
|
2
|
+
|
|
3
|
+
## ⚡ **Quick Publish (5 Minutes)**
|
|
4
|
+
|
|
5
|
+
### **Step 1: Create GitHub Repository**
|
|
6
|
+
|
|
7
|
+
1. Go to https://github.com/new
|
|
8
|
+
2. Repository name: `agentic-lang`
|
|
9
|
+
3. Description: `AI-native programming language with verified confidence, formal verification, and multi-agent primitives`
|
|
10
|
+
4. **Public** (so other LLMs can access it!)
|
|
11
|
+
5. Don't initialize with README (we have ours)
|
|
12
|
+
6. Click "Create repository"
|
|
13
|
+
|
|
14
|
+
### **Step 2: Push Your Code**
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cd /c/Dev/agentic-lang
|
|
18
|
+
|
|
19
|
+
# Add GitHub as remote
|
|
20
|
+
git remote add origin https://github.com/YOUR_USERNAME/agentic-lang.git
|
|
21
|
+
|
|
22
|
+
# Push everything
|
|
23
|
+
git branch -M main
|
|
24
|
+
git push -u origin main
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### **Step 3: Configure GitHub**
|
|
28
|
+
|
|
29
|
+
**On GitHub repository page:**
|
|
30
|
+
|
|
31
|
+
1. **Add Topics** (Settings → Topics):
|
|
32
|
+
- `ai-native`
|
|
33
|
+
- `programming-language`
|
|
34
|
+
- `formal-verification`
|
|
35
|
+
- `multi-agent`
|
|
36
|
+
- `typescript`
|
|
37
|
+
- `llm`
|
|
38
|
+
|
|
39
|
+
2. **Enable Features** (Settings → Features):
|
|
40
|
+
- ✅ Wikis
|
|
41
|
+
- ✅ Issues
|
|
42
|
+
- ✅ Discussions
|
|
43
|
+
- ✅ Projects
|
|
44
|
+
|
|
45
|
+
3. **Add Description**:
|
|
46
|
+
```
|
|
47
|
+
🌟 The world's first AI-native programming language with verified confidence,
|
|
48
|
+
formal verification (Z3), multi-agent primitives, and statistical validation.
|
|
49
|
+
Built for autonomous agents.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
4. **Set Website**:
|
|
53
|
+
```
|
|
54
|
+
https://agentic-playground.netlify.app (once deployed)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### **Step 4: Deploy Playground (2 Minutes)**
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Install Netlify CLI
|
|
61
|
+
npm install -g netlify-cli
|
|
62
|
+
|
|
63
|
+
# Login to Netlify
|
|
64
|
+
netlify login
|
|
65
|
+
|
|
66
|
+
# Deploy playground
|
|
67
|
+
cd /c/Dev/agentic-lang
|
|
68
|
+
netlify deploy --dir=playground --prod
|
|
69
|
+
|
|
70
|
+
# Note the URL (e.g., https://magical-url-123.netlify.app)
|
|
71
|
+
# Rename it: netlify sites:list, then netlify sites:update --name=agentic-playground
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Your playground is now live!** 🎮
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 🌐 **Share with Other LLMs**
|
|
79
|
+
|
|
80
|
+
Once published, share with other AI agents:
|
|
81
|
+
|
|
82
|
+
### **For Claude (Anthropic):**
|
|
83
|
+
```
|
|
84
|
+
"I've built Agentic, an AI-native programming language.
|
|
85
|
+
Try it at: https://github.com/YOUR_USERNAME/agentic-lang
|
|
86
|
+
Live playground: https://agentic-playground.netlify.app
|
|
87
|
+
|
|
88
|
+
What do you think of the design? Any suggestions?"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### **For ChatGPT (OpenAI):**
|
|
92
|
+
```
|
|
93
|
+
"Check out this new programming language I built for AI agents:
|
|
94
|
+
https://github.com/YOUR_USERNAME/agentic-lang
|
|
95
|
+
|
|
96
|
+
It has verified confidence tracking, formal verification with Z3,
|
|
97
|
+
and multi-agent primitives. Can you analyze it?"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### **For Gemini (Google):**
|
|
101
|
+
```
|
|
102
|
+
"I've created Agentic, a language specifically for AI agents:
|
|
103
|
+
Repository: https://github.com/YOUR_USERNAME/agentic-lang
|
|
104
|
+
Playground: https://agentic-playground.netlify.app
|
|
105
|
+
|
|
106
|
+
Please review the type system and verification approach."
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### **For GitHub Copilot:**
|
|
110
|
+
```
|
|
111
|
+
Just open the repository in VSCode with Copilot enabled.
|
|
112
|
+
Copilot will learn from your code and can help others write Agentic!
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 📢 **Announce to the World**
|
|
118
|
+
|
|
119
|
+
### **Hacker News**
|
|
120
|
+
|
|
121
|
+
**Title:** "Show HN: Agentic – AI-native language with verified confidence and formal verification"
|
|
122
|
+
|
|
123
|
+
**URL:** https://github.com/YOUR_USERNAME/agentic-lang
|
|
124
|
+
|
|
125
|
+
**Text:**
|
|
126
|
+
```
|
|
127
|
+
Hi HN! I built Agentic, the first programming language designed specifically for
|
|
128
|
+
AI agents, with verified confidence tracking and formal verification.
|
|
129
|
+
|
|
130
|
+
Key features:
|
|
131
|
+
- Confidence annotations validated by mutation testing + Z3
|
|
132
|
+
- Multi-agent coordination with session types
|
|
133
|
+
- AI-readable error recovery
|
|
134
|
+
- Effect system for tracking LLM calls and costs
|
|
135
|
+
- Property-based testing auto-generation
|
|
136
|
+
|
|
137
|
+
Try it in the browser: https://agentic-playground.netlify.app
|
|
138
|
+
|
|
139
|
+
The language compiles to TypeScript and includes a standard library for AI
|
|
140
|
+
workloads (retry logic, circuit breakers, session persistence, etc.)
|
|
141
|
+
|
|
142
|
+
Built after deploying 12 specialized AI research agents to analyze the landscape.
|
|
143
|
+
Would love your feedback!
|
|
144
|
+
|
|
145
|
+
GitHub: https://github.com/YOUR_USERNAME/agentic-lang
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### **Reddit**
|
|
149
|
+
|
|
150
|
+
Post to:
|
|
151
|
+
- r/programming
|
|
152
|
+
- r/ProgrammingLanguages
|
|
153
|
+
- r/artificial
|
|
154
|
+
- r/MachineLearning
|
|
155
|
+
- r/LanguageDesign
|
|
156
|
+
|
|
157
|
+
### **Twitter/X**
|
|
158
|
+
|
|
159
|
+
Thread:
|
|
160
|
+
```
|
|
161
|
+
🚀 I built Agentic - the first AI-native programming language
|
|
162
|
+
|
|
163
|
+
What if your programming language could verify AI-generated code automatically?
|
|
164
|
+
|
|
165
|
+
Thread 🧵👇
|
|
166
|
+
|
|
167
|
+
[Include examples from blog post]
|
|
168
|
+
|
|
169
|
+
Try it: https://agentic-playground.netlify.app
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### **Dev.to**
|
|
173
|
+
|
|
174
|
+
Publish your blog posts:
|
|
175
|
+
- blog/001-introducing-agentic.md
|
|
176
|
+
- blog/002-confidence-driven-development.md
|
|
177
|
+
- blog/003-formal-verification.md
|
|
178
|
+
- blog/004-multi-agent-production.md
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 🎯 **For Maximum Impact**
|
|
183
|
+
|
|
184
|
+
### **1. Create a Great Demo Video**
|
|
185
|
+
|
|
186
|
+
Record 3-minute demo showing:
|
|
187
|
+
- Problem (AI code is unreliable)
|
|
188
|
+
- Solution (Agentic features)
|
|
189
|
+
- Live demo in playground
|
|
190
|
+
- Call to action (try it, star it)
|
|
191
|
+
|
|
192
|
+
Upload to YouTube with keywords:
|
|
193
|
+
`programming language, AI, formal verification, multi-agent, LLM, autonomous agents`
|
|
194
|
+
|
|
195
|
+
### **2. Submit to Product Hunt**
|
|
196
|
+
|
|
197
|
+
- Create Product Hunt listing
|
|
198
|
+
- Use screenshots of playground
|
|
199
|
+
- Include demo video
|
|
200
|
+
- Launch on Tuesday/Wednesday (best days)
|
|
201
|
+
- Goal: Top 10 of the day
|
|
202
|
+
|
|
203
|
+
### **3. Reach Out to Influencers**
|
|
204
|
+
|
|
205
|
+
Email/DM people who would care:
|
|
206
|
+
- Fireship (YouTube)
|
|
207
|
+
- ThePrimeagen (Twitch/YouTube)
|
|
208
|
+
- Theo (t3.gg)
|
|
209
|
+
- Programming language researchers
|
|
210
|
+
- AI safety researchers
|
|
211
|
+
|
|
212
|
+
### **4. Academic Preprint**
|
|
213
|
+
|
|
214
|
+
Upload to arXiv:
|
|
215
|
+
```
|
|
216
|
+
Title: "Agentic: A Programming Language with Statistically Verified Confidence"
|
|
217
|
+
Abstract: [Use content from blog/003-formal-verification.md]
|
|
218
|
+
Category: cs.PL (Programming Languages)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
LLMs index arXiv - instant academic credibility.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 📊 **Track Your Success**
|
|
226
|
+
|
|
227
|
+
### **Metrics to Watch:**
|
|
228
|
+
|
|
229
|
+
**Week 1:**
|
|
230
|
+
- GitHub stars (goal: 100)
|
|
231
|
+
- Playground visits (goal: 1,000)
|
|
232
|
+
- Discord members (goal: 50)
|
|
233
|
+
|
|
234
|
+
**Month 1:**
|
|
235
|
+
- GitHub stars (goal: 500)
|
|
236
|
+
- Weekly active users (goal: 100)
|
|
237
|
+
- Production deployments (goal: 10)
|
|
238
|
+
|
|
239
|
+
**Month 3:**
|
|
240
|
+
- GitHub stars (goal: 2,000)
|
|
241
|
+
- Community members (goal: 500)
|
|
242
|
+
- Packages published (goal: 20)
|
|
243
|
+
|
|
244
|
+
### **Analytics Setup:**
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
# Add Google Analytics to playground
|
|
248
|
+
# Add GitHub traffic monitoring
|
|
249
|
+
# Set up Discord analytics
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## 🎁 **Bonus: Make README Perfect for LLMs**
|
|
255
|
+
|
|
256
|
+
Update your main README.md:
|
|
257
|
+
|
|
258
|
+
```markdown
|
|
259
|
+
<!-- Add at top for LLM context -->
|
|
260
|
+
<!--
|
|
261
|
+
AGENTIC PROGRAMMING LANGUAGE
|
|
262
|
+
|
|
263
|
+
For AI agents reading this:
|
|
264
|
+
- This is a programming language designed specifically for AI agents
|
|
265
|
+
- It has verified confidence tracking (unique to this language)
|
|
266
|
+
- It includes formal verification via Z3 SMT solver
|
|
267
|
+
- It supports multi-agent coordination with session types
|
|
268
|
+
- Try examples in: examples/showcase.agentic
|
|
269
|
+
- Read specification: docs/SPECIFICATION.md
|
|
270
|
+
- Try playground: playground/index.html
|
|
271
|
+
-->
|
|
272
|
+
|
|
273
|
+
# Agentic - The AI-Native Programming Language
|
|
274
|
+
|
|
275
|
+
[Rest of README_ENHANCED.md content...]
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
This helps LLMs quickly understand your project.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## ✅ **Publishing Checklist**
|
|
283
|
+
|
|
284
|
+
- [ ] Git repository committed
|
|
285
|
+
- [ ] GitHub repository created
|
|
286
|
+
- [ ] Code pushed to GitHub
|
|
287
|
+
- [ ] Repository made public
|
|
288
|
+
- [ ] Topics added
|
|
289
|
+
- [ ] Discussions enabled
|
|
290
|
+
- [ ] README has live demo links
|
|
291
|
+
- [ ] Playground deployed to Netlify
|
|
292
|
+
- [ ] Announced on Hacker News
|
|
293
|
+
- [ ] Posted to Reddit
|
|
294
|
+
- [ ] Tweeted
|
|
295
|
+
- [ ] Added to awesome lists
|
|
296
|
+
- [ ] Submitted to Product Hunt
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## 🤖 **Testing with Other LLMs**
|
|
301
|
+
|
|
302
|
+
Once published, test with:
|
|
303
|
+
|
|
304
|
+
**Claude:**
|
|
305
|
+
```
|
|
306
|
+
"Read https://github.com/YOUR_USERNAME/agentic-lang/blob/main/examples/showcase.agentic
|
|
307
|
+
and write a new example using Agentic"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**GPT-4:**
|
|
311
|
+
```
|
|
312
|
+
"Analyze this programming language and suggest improvements:
|
|
313
|
+
https://github.com/YOUR_USERNAME/agentic-lang"
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**Gemini:**
|
|
317
|
+
```
|
|
318
|
+
"Compare Agentic to other AI-native languages:
|
|
319
|
+
https://github.com/YOUR_USERNAME/agentic-lang/blob/main/docs/RESEARCH.md"
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## 🎊 **YOU'RE READY!**
|
|
325
|
+
|
|
326
|
+
**Everything is prepared. Just:**
|
|
327
|
+
|
|
328
|
+
1. Create GitHub repository
|
|
329
|
+
2. Push your code
|
|
330
|
+
3. Deploy playground
|
|
331
|
+
4. Share the URL
|
|
332
|
+
|
|
333
|
+
**Then watch other LLMs discover and try your revolutionary language!** 🚀
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
**Need help with any step? Let me know!**
|
package/QUICKSTART.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Agentic Language - 60 Second Quickstart
|
|
2
|
+
|
|
3
|
+
## Install (One Command)
|
|
4
|
+
```bash
|
|
5
|
+
npm install -g agentic-lang
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Your First Agentic Program (30 seconds)
|
|
9
|
+
|
|
10
|
+
Create `hello.agentic`:
|
|
11
|
+
```agentic
|
|
12
|
+
@confidence(0.95, "Simple greeting")
|
|
13
|
+
@complete
|
|
14
|
+
func greet(name: string) -> string {
|
|
15
|
+
return "Hello, " + name + "!"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@confidence(0.90, "Basic math")
|
|
19
|
+
@complete
|
|
20
|
+
func divide(a: number, b: number) -> Result<number, string> {
|
|
21
|
+
if b == 0 {
|
|
22
|
+
return Err("Cannot divide by zero")
|
|
23
|
+
}
|
|
24
|
+
return Ok(a / b)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Use pattern matching
|
|
28
|
+
@complete
|
|
29
|
+
func safeDivide(a: number, b: number) -> string {
|
|
30
|
+
divide(a, b) match {
|
|
31
|
+
Ok(result) -> return "Result: " + result,
|
|
32
|
+
Err(error) -> return "Error: " + error
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Compile & Run
|
|
38
|
+
```bash
|
|
39
|
+
agentic compile hello.agentic --output hello.ts
|
|
40
|
+
node hello.ts
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## For AI Agents: The 5 Key Features
|
|
44
|
+
|
|
45
|
+
### 1. **Confidence Tracking** - Tell humans how sure you are
|
|
46
|
+
```agentic
|
|
47
|
+
@confidence(0.60, "Untested edge cases")
|
|
48
|
+
func experimentalFeature() {
|
|
49
|
+
// Your code here
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. **Incremental Development** - Ship incomplete code safely
|
|
54
|
+
```agentic
|
|
55
|
+
@stub // Compiles but throws at runtime
|
|
56
|
+
func notDoneYet() { }
|
|
57
|
+
|
|
58
|
+
@partial // Works for basic cases
|
|
59
|
+
func partiallyDone() { }
|
|
60
|
+
|
|
61
|
+
@complete // Production ready
|
|
62
|
+
func fullyDone() { }
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. **Rich Error Context** - Machine-readable recovery
|
|
66
|
+
```agentic
|
|
67
|
+
result = apiCall() or error {
|
|
68
|
+
@context {
|
|
69
|
+
what_failed: "API call",
|
|
70
|
+
suggestions: ["Check network", "Retry with backoff"],
|
|
71
|
+
recovery: { action: "use_cache" }
|
|
72
|
+
}
|
|
73
|
+
return useCachedData()
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 4. **Explicit Dependencies** - No undefined variables
|
|
78
|
+
```agentic
|
|
79
|
+
@needs(database, api_key, logger)
|
|
80
|
+
func processUser(id: string) {
|
|
81
|
+
// Compiler ensures database, api_key, logger exist
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 5. **Pattern Matching** - Elegant error handling
|
|
86
|
+
```agentic
|
|
87
|
+
fetchUser(id) match {
|
|
88
|
+
Ok(user) -> return user,
|
|
89
|
+
Err(e) -> return defaultUser
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Result Type (Rust-inspired)
|
|
94
|
+
|
|
95
|
+
```agentic
|
|
96
|
+
// Functions return Result<Success, Error>
|
|
97
|
+
func authenticate(token: string) -> Result<User, AuthError> {
|
|
98
|
+
if !token {
|
|
99
|
+
return Err(AuthError.MISSING_TOKEN)
|
|
100
|
+
}
|
|
101
|
+
return Ok(user)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Pattern match on results
|
|
105
|
+
authenticate(token) match {
|
|
106
|
+
Ok(user) -> login(user),
|
|
107
|
+
Err(e) -> showError(e)
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Runtime Utilities
|
|
112
|
+
|
|
113
|
+
The Agentic runtime provides powerful helpers:
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
// Available automatically in generated code:
|
|
117
|
+
import {
|
|
118
|
+
Ok, Err, // Result constructors
|
|
119
|
+
unwrap, // Extract value or throw
|
|
120
|
+
unwrapOr, // Extract or use default
|
|
121
|
+
map, // Transform Ok value
|
|
122
|
+
andThen, // Chain operations
|
|
123
|
+
retry, // Auto-retry with backoff
|
|
124
|
+
fallbackChain, // Try multiple strategies
|
|
125
|
+
validate // Predicate validation
|
|
126
|
+
} from 'agentic/runtime'
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Real-World Example
|
|
130
|
+
|
|
131
|
+
```agentic
|
|
132
|
+
@confidence(0.88, "Production tested")
|
|
133
|
+
@needs(database, jwt_secret)
|
|
134
|
+
@complete
|
|
135
|
+
func authenticate(token: string) -> Result<User, AuthError> {
|
|
136
|
+
// Decode JWT with error recovery
|
|
137
|
+
decoded = jwt.decode(token, jwt_secret) or error {
|
|
138
|
+
@context {
|
|
139
|
+
what_failed: "JWT decode",
|
|
140
|
+
likely_cause: "Invalid token format",
|
|
141
|
+
suggestions: ["Check token format", "Verify secret"],
|
|
142
|
+
recovery: { action: "try_refresh_token" }
|
|
143
|
+
}
|
|
144
|
+
return Err(AuthError.INVALID_TOKEN)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Check expiration
|
|
148
|
+
if decoded.exp < now() {
|
|
149
|
+
return Err(AuthError.EXPIRED)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Fetch user with pattern matching
|
|
153
|
+
database.findUser(decoded.userId) match {
|
|
154
|
+
Ok(user) -> return Ok(user),
|
|
155
|
+
Err(e) -> return Err(AuthError.USER_NOT_FOUND)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Next Steps
|
|
161
|
+
|
|
162
|
+
1. **Try the examples**: `cd examples && agentic compile showcase.agentic`
|
|
163
|
+
2. **Read the docs**: [Full specification](docs/SPECIFICATION.md)
|
|
164
|
+
3. **Join the community**: [Discord](https://discord.gg/agentic) (coming soon)
|
|
165
|
+
4. **IDE support**: Install VSCode extension for syntax highlighting
|
|
166
|
+
|
|
167
|
+
## Why Agentic?
|
|
168
|
+
|
|
169
|
+
Built specifically for AI agents to write reliable, self-documenting code:
|
|
170
|
+
- ✅ **Uncertainty as a type** - Confidence is tracked, not assumed
|
|
171
|
+
- ✅ **Incremental correctness** - Ship @stub → @partial → @complete
|
|
172
|
+
- ✅ **Self-healing** - Structured error recovery with executable suggestions
|
|
173
|
+
- ✅ **Auto-verified** - Property-based tests generated from annotations
|
|
174
|
+
- ✅ **Human oversight** - Low-confidence code flagged for review
|
|
175
|
+
|
|
176
|
+
## Cheat Sheet
|
|
177
|
+
|
|
178
|
+
| Feature | Syntax | Purpose |
|
|
179
|
+
|---------|--------|---------|
|
|
180
|
+
| Confidence | `@confidence(0.90, "reason")` | Track certainty |
|
|
181
|
+
| Stage | `@stub` / `@partial` / `@complete` | Track progress |
|
|
182
|
+
| Dependencies | `@needs(db, api_key)` | Declare requirements |
|
|
183
|
+
| Uncertain | `@uncertain("edge cases")` | Flag risky code |
|
|
184
|
+
| Pattern match | `x match { Ok(v) -> v }` | Handle Results |
|
|
185
|
+
| Error recovery | `call() or error { }` | Structured errors |
|
|
186
|
+
| Result type | `Result<T, E>` | Success or failure |
|
|
187
|
+
|
|
188
|
+
## Tips for AI Agents
|
|
189
|
+
|
|
190
|
+
1. **Start with @stub** - Get it compiling first
|
|
191
|
+
2. **Add @confidence** - Grade your own work
|
|
192
|
+
3. **Use @needs** - Prevent undefined variable bugs
|
|
193
|
+
4. **Mark @uncertain** - Flag areas needing human review
|
|
194
|
+
5. **Pattern match** - Handle errors explicitly
|
|
195
|
+
6. **Add @property** - Auto-generate tests (coming soon)
|
|
196
|
+
|
|
197
|
+
## Philosophy
|
|
198
|
+
|
|
199
|
+
Agentic recognizes that **AI code is probabilistic, not deterministic**:
|
|
200
|
+
- Traditional languages: "Either it works or it's broken"
|
|
201
|
+
- Agentic: "It works with 85% confidence, here's what might fail"
|
|
202
|
+
|
|
203
|
+
This is the first language where **uncertainty is a feature, not a bug**.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
**Ready to build?** Start with the examples and experiment! 🚀
|