@misterscan/sesi 1.2.3 → 1.3.2

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 (96) hide show
  1. package/.agents/rules/sesi-must-read.md +116 -0
  2. package/.agents/workflows/create-sesi-script.md +44 -0
  3. package/.agents/workflows/fix-sesi-script.md +14 -0
  4. package/.github/prompts/MakeInSesi.prompt.md +79 -0
  5. package/README.md +163 -51
  6. package/bin/sesi.js +196 -38
  7. package/chatbot/chatbot.html +488 -0
  8. package/{main → chatbot}/chatbot.sesi +1 -2
  9. package/chatbot/chatbot_server.py +105 -0
  10. package/chatbot/sesi_db_chatbot.sesi +278 -0
  11. package/dist/ai-runtime.js +2 -2
  12. package/dist/builtins.d.ts.map +1 -1
  13. package/dist/builtins.js +199 -5
  14. package/dist/builtins.js.map +1 -1
  15. package/dist/index.d.ts +12 -2
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +90 -6
  18. package/dist/index.js.map +1 -1
  19. package/dist/interpreter.d.ts +21 -2
  20. package/dist/interpreter.d.ts.map +1 -1
  21. package/dist/interpreter.js +201 -92
  22. package/dist/interpreter.js.map +1 -1
  23. package/dist/lexer.d.ts.map +1 -1
  24. package/dist/lexer.js +8 -4
  25. package/dist/lexer.js.map +1 -1
  26. package/dist/parser.d.ts +1 -0
  27. package/dist/parser.d.ts.map +1 -1
  28. package/dist/parser.js +21 -12
  29. package/dist/parser.js.map +1 -1
  30. package/dist/sesi.bundled.js +2526 -1487
  31. package/dist/types.d.ts +14 -2
  32. package/dist/types.d.ts.map +1 -1
  33. package/dist/types.js +33 -1
  34. package/dist/types.js.map +1 -1
  35. package/docs/ARCHITECTURE.md +21 -13
  36. package/docs/BUILTINS.md +136 -19
  37. package/docs/CLI.md +200 -0
  38. package/docs/COMPARISON.md +16 -13
  39. package/docs/IMAGE_GENERATION.md +13 -14
  40. package/docs/IMPLEMENTATION_SUMMARY.md +174 -110
  41. package/docs/QUICKSTART.md +173 -39
  42. package/docs/README.md +202 -54
  43. package/docs/{SYSTEMS_REASONING.md → REASONING.md} +115 -120
  44. package/docs/ROADMAP.md +51 -47
  45. package/docs/SKILLS.md +73 -98
  46. package/docs/SPECIFICATION.md +59 -40
  47. package/examples/03_functions.sesi +30 -1
  48. package/examples/07_prompts.sesi +27 -3
  49. package/examples/08_model_call.sesi +6 -4
  50. package/examples/09_structured_output.sesi +19 -3
  51. package/examples/10_code_generation.sesi +6 -4
  52. package/examples/11_memory_conversation.sesi +47 -15
  53. package/examples/12_classification.sesi +62 -7
  54. package/examples/13_data_pipeline.sesi +55 -28
  55. package/examples/14_folder_explainer.sesi +52 -51
  56. package/examples/15_image_generation.sesi +15 -14
  57. package/examples/16_modules.sesi +27 -27
  58. package/examples/19_search_web.sesi +18 -2
  59. package/examples/20_model_aliases.sesi +22 -0
  60. package/examples/21_custom_tools.sesi +27 -0
  61. package/examples/22_reasoning_plus_custom_tools.sesi +19 -0
  62. package/main/tests/test-args.sesi +7 -0
  63. package/main/tests/test_args.sesi +7 -0
  64. package/main/tests/test_general_modules.sesi +127 -0
  65. package/main/tests/test_grounding.sesi +2 -0
  66. package/package.json +26 -22
  67. package/docs/DISTRIBUTED_SYSTEMS.md +0 -71
  68. package/docs/sesi_ai_chronicles.md +0 -209
  69. package/main/conversational_classifier_weights.json +0 -45
  70. package/main/conversational_sentences.json +0 -304
  71. package/main/epochs.sesi +0 -94
  72. package/main/gpu_orchestrator.sesi +0 -36
  73. package/main/hardware_diagnostics.sesi +0 -118
  74. package/main/inference.sesi +0 -54
  75. package/main/native_chatbot.sesi +0 -180
  76. package/main/native_synthesizer.sesi +0 -83
  77. package/main/nn_personas_trainer.sesi +0 -302
  78. package/main/nn_responses_trainer.sesi +0 -269
  79. package/main/nn_sentences_trainer.sesi +0 -330
  80. package/main/orchestrator.sesi +0 -15
  81. package/main/personas.json +0 -124
  82. package/main/personas_classifier_weights.json +0 -45
  83. package/main/playground.sesi +0 -3
  84. package/main/predictive_typing.sesi +0 -127
  85. package/main/query_brain.sesi +0 -45
  86. package/main/response_classifier_weights.json +0 -45
  87. package/main/retro_chat.html +0 -239
  88. package/main/retro_chat_generator.sesi +0 -745
  89. package/main/sesi_ai.sesi +0 -158
  90. package/main/sesi_db_chatbot.sesi +0 -280
  91. package/main/setup_swarm.sesi +0 -5
  92. package/main/start.sesi +0 -13
  93. package/main/terminal.log +0 -56
  94. package/main/terminal_chat.py +0 -385
  95. package/main/unified_sesi_ai.sesi +0 -334
  96. package/main/varied_responses.json +0 -304
@@ -1,16 +1,14 @@
1
- # The Sesi Advantage: Why We Built a Systems & Orchestration Language
1
+ # The Sesi Advantage: Removing Boilerplate
2
2
 
3
- Integrating Large Language Models (LLMs) into traditional applications today is painful. Standard programming languages treat AI as an external service requiring SDKs, manual prompt string concatenation, complex schema definitions, and fragile JSON parsing.
3
+ Integrating API calls or reasoning blocks into traditional applications today is painful. Standard programming languages treat API calls or reasoning blocks as an external service requiring SDKs, manual prompt string concatenation, complex schema definitions, and fragile JSON parsing.
4
4
 
5
- **Sesi treats Reasoning as a first-class language primitive.**
6
-
7
- This document demonstrates exactly how much boilerplate and complexity Sesi eliminates compared to traditional languages like TypeScript, Python, and Go.
5
+ This document demonstrates how much boilerplate Sesi eliminates.
8
6
 
9
7
  ---
10
8
 
11
9
  ## 📊 The Cost of Boilerplate: A Data Comparison
12
10
 
13
- When building a simple AI-powered data pipeline (structured data extraction + conditional function calling), traditional languages spend more than half their code managing the SDK rather than executing business logic.
11
+ When building simple API extraction pipelines, traditional languages spend more than half their code managing SDKs.
14
12
 
15
13
  ```mermaid
16
14
  xychart-beta
@@ -248,7 +246,7 @@ In Go, statically typed strictness combined with AI responses creates massive st
248
246
 
249
247
  ---
250
248
 
251
- ## Showcase 3: Distributed Orchestration Swarm
249
+ ## Showcase 3: Distributed Orchestration Processes
252
250
 
253
251
  This example demonstrates a complex distributed task: Spawning a background researcher, polling for completion with fault tolerance, and synthesizing results with AI.
254
252
 
@@ -325,10 +323,15 @@ Sesi isn't just syntactic sugar. By embedding the AI runtime directly into the p
325
323
 
326
324
  ## See Also
327
325
 
328
- - [Quickstart](../QUICKSTART.md)
326
+ - [Quick Start Guide](../QUICKSTART.md)
329
327
  - [Language Specification](SPECIFICATION.md)
330
- - [Image Generation](IMAGE_GENERATION.md)
331
- - [Built-in Functions](BUILTINS.md)
332
- - [Architecture](ARCHITECTURE.md)
333
- - [Reasoning Features](SYSTEMS_REASONING.md)
334
- - [Distributed Systems](DISTRIBUTED_SYSTEMS.md)
328
+ - [Runtime Architecture](ARCHITECTURE.md)
329
+ - [Built-in Functions Reference](BUILTINS.md)
330
+ - [Command Line Interface (CLI) Reference](CLI.md)
331
+ - [Image Generation & Input](IMAGE_GENERATION.md)
332
+ - [Compare to other languages](COMPARISON.md)
333
+ - [Concurrency & Coordination](CONCURRENCY.md)
334
+ - [Reasoning & Simple Logic](REASONING.md)
335
+ - [Agent-Native Programming Paradigm](agent_native_programming.md)
336
+ - [Historical Stress Test Chronicles](sesi_ai_chronicles.md)
337
+ - [Examples](../examples)
@@ -1,17 +1,17 @@
1
1
  # Image Generation in Sesi
2
2
 
3
- Sesi provides a native, language-level primitive for generating images using AI models. This primitive is designed to interoperate seamlessly with Sesi's file system builtins, allowing you to generate and persist images with minimal boilerplate.
3
+ Sesi provides a native, language-level primitive for image generation and manipulation, including image-to-image tasks like style transfer, upscaling, and editing. This primitive is designed to interoperate seamlessly with Sesi's file system builtins, allowing you to generate and persist images with minimal boilerplate.
4
4
 
5
5
  ## The `image` Primitive
6
6
 
7
- To generate an image, use the `image` keyword followed by the model name, an optional configuration block, and a prompt block.
7
+ To generate or manipulate an image, use the `image` keyword followed by the model name, an optional configuration block, and a prompt block.
8
8
 
9
9
  ### Syntax
10
10
 
11
11
  The syntax parallels standard `model` calls:
12
12
 
13
13
  ```
14
- image("model-name") {"configKey": "configValue"} {"Prompt text"}
14
+ image("model-name") {configKey: "configValue"} {"Prompt text"}
15
15
  ```
16
16
 
17
17
  ### Basic Example
@@ -23,7 +23,7 @@ Here is a simple example demonstrating how to generate a single image and save i
23
23
  prompt request {"A simple minimalist company logo for a bakery"}
24
24
 
25
25
  // 2. Call the image generation primitive
26
- let imageData = image("gemini-3.1-flash-image-preview") {"ratio": "1:1", "size": "1K"} {request}
26
+ let imageData = image("gemini-3.1-flash-image-preview") {ratio: "1:1", size: "1K"} {request}
27
27
 
28
28
  // 3. Write the payload to disk
29
29
  try
@@ -52,7 +52,7 @@ for product in products
52
52
  prompt request {"A clean studio presentation photograph of a " product " on a solid white background."}
53
53
  prompt filename { outputDir product ".png" }
54
54
  try
55
- {let imageData = image("gemini-3.1-flash-image-preview") {"ratio": '1:1', "size": "1K"} {request}
55
+ {let imageData = image("gemini-3.1-flash-image-preview") {ratio: "1:1", size: "1K"} {request}
56
56
 
57
57
  // Attempt local file write
58
58
  let success = write_image(filename, imageData)
@@ -69,9 +69,9 @@ print "Asset generation complete."
69
69
 
70
70
  When configuring the `image` call (specifically for models like `gemini-3.1-flash-image-preview`), the configuration block maps directly to backend SDK capabilities:
71
71
 
72
- - `"ratio"`: The aspect ratio of the image (e.g., `"1:1"`, `"16:9"`, `"9:16"`).
73
- - `"size"`: Dimensional sizing constraints (Must be `"512"`, `"1K"`, `"2K"`, or `"4K"`).
74
- - `"temperature"`: *Will be deprecated in Gemini 3.x+, use thinkingLevel instead.* — controls variance.
72
+ - `ratio`: The aspect ratio of the image (e.g., `"1:1"`, `"16:9"`, `"9:16"`).
73
+ - `size`: Dimensional sizing constraints (Must be `"512"`, `"1K"`, `"2K"`, or `"4K"`).
74
+ - `temperature`: *Will be deprecated in Gemini 3.x+, use thinkingLevel instead.* — controls variance.
75
75
 
76
76
  ## File I/O Integration: `write_image`
77
77
 
@@ -139,11 +139,10 @@ print "Render saved."
139
139
  let dir = "frames/"
140
140
  let files = list_dir(dir)
141
141
 
142
- for f in files {
143
- prompt p {dir f}
144
- let desc = model("gemini-3.1-flash-lite") {images: p} {"Describe this frame in one sentence."}
145
- print f desc
146
- }
142
+ for f in files
143
+ {prompt p {dir f}
144
+ let desc = model("gemini-3.1-flash-lite") {images: p} {"Describe this frame in one sentence."}
145
+ print f desc}
147
146
  ```
148
147
 
149
148
  ### Config Reference
@@ -154,4 +153,4 @@ When used inside `model()` or `image()` config blocks, `images` is resolved at r
154
153
  |-----|---------------|-------|
155
154
  | `images` | `string` or `array<string>` | One or more local file paths. Resolved relative to `process.cwd()`. |
156
155
 
157
- > **Note:** Multimodal input requires a vision-capable model (e.g. `gemini-3-flash-preview`, `gemini-3.1-flash-lite`, `gemini-3.1-pro-preview`). Image-generation models that accept reference images are listed in their respective model documentation.
156
+ > **Note:** Multimodal input requires a vision-capable model (e.g. `gemini-3-flash-preview`, `gemini-3.1-flash-lite`, `gemini-3.1-pro-preview`, `gemini-3.5-flash`). Image-generation models that accept reference images are listed in their respective model documentation.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## 📋 Overview
4
4
 
5
- **Sesi** is a high-performance **Systems Language** designed for building resilient, stateful applications. It provides first-class primitives for process management and filesystem orchestration, while integrating reasoning as a first-class execution primitive. Unlike traditional languages that rely on external SDKs for AI interaction, Sesi treats reasoning as a native language construct, enabling developers to build context-aware systems with minimal boilerplate.
5
+ **Sesi** is a highly legible, buildable **programming language**. It provides clean primitives for executing robust internal logic and external APIs, acting as the ideal layer to parse text, orchestrate shell commands, and interact with the file system. Unlike traditional languages that require sprawling SDKs for even basic interactions, Sesi integrates command execution naturally, enabling developers to build context-aware scripts with minimal boilerplate.
6
6
 
7
7
  ## 🎯 Design Philosophy
8
8
 
@@ -10,74 +10,88 @@ Sesi follows these core principles:
10
10
 
11
11
  1. **Reasoning as a Primitive**: Reasoning calls aren't library functions—they're language constructs with dedicated syntax. This allows for deep integration with the interpreter's environment and type system.
12
12
  2. **Practical Over Perfect**: Focus on what developers actually need, not theoretical completeness.
13
- 3. **Transparency Over Magic**: Explicit reasoning calls with clear costs and latency.
14
- 4. **Simplicity First**: Tree-walking interpreter for clarity and maintainability.
15
- 5. **Type Safety with Flexibility**: Static types for normal code, runtime checking for reasoning outputs.
13
+ 3. **Transparency Over Magic**: Sesi runs exactly what you write with clear costs and execution maps.
14
+ 4. **Simplicity First**: A custom tree-walking interpreter for clarity and maintainability.
15
+ 5. **Type Safety with Flexibility**: Static types for normal code, runtime checking for integration outputs.
16
16
 
17
17
  ## 📁 Complete Project Structure
18
18
 
19
19
  ```
20
20
  Sesi/
21
21
  ├── SKILLS.md # Workspace context and repo guardrails
22
- ├── index.html # Sesi-generated systems landing page
23
22
  ├── eslint.config.mjs # ESLint configuration
24
- ├── example.js # Helper script to run basic examples
25
- ├── example-ai.js # Helper script to run reasoning examples
26
- ├── README.md # Project overview
27
- ├── QUICKSTART.md # Getting started guide
28
- ├── package.json # Dependencies & scripts
29
- ├── tsconfig.json # TypeScript configuration
30
- ├── dist/ # Compiled TypeScript output
23
+ ├── example.js # Helper script to run basic examples
24
+ ├── example-ai.js # Helper script to run reasoning examples
25
+ ├── examples.sesi # Central execution suite for examples
26
+ ├── README.md # Project overview
27
+ ├── QUICKSTART.md # Getting started guide
28
+ ├── package.json # Dependencies & scripts
29
+ ├── tsconfig.json # TypeScript configuration
30
+ ├── dist/ # Compiled TypeScript output
31
31
 
32
- ├── src/ # Source code
33
- │ ├── types.ts # Type definitions & AST nodes (400+ lines)
34
- │ ├── lexer.ts # Tokenization (350+ lines)
35
- │ ├── parser.ts # Recursive descent parser (700+ lines)
36
- │ ├── interpreter.ts # Tree-walking interpreter (600+ lines)
37
- │ ├── builtins.ts # Built-in functions (250+ lines)
38
- │ ├── ai-runtime.ts # Integrated reasoning integration (120+ lines)
39
- │ └── index.ts # Entry point (30+ lines)
32
+ ├── src/ # Source code
33
+ │ ├── types.ts # Type definitions & AST nodes (400+ lines)
34
+ │ ├── lexer.ts # Tokenization (350+ lines)
35
+ │ ├── parser.ts # Recursive descent parser (700+ lines)
36
+ │ ├── interpreter.ts # Tree-walking interpreter (600+ lines)
37
+ │ ├── builtins.ts # Built-in functions (250+ lines)
38
+ │ ├── ai-runtime.ts # Integrated reasoning integration (120+ lines)
39
+ │ └── index.ts # Entry point (30+ lines)
40
40
 
41
41
  ├── bin/
42
- │ └── sesi.js # CLI executable
42
+ │ └── sesi.js # CLI executable
43
43
 
44
- ├── main/ # Playgrounds & debugging
45
- │ ├── playground.sesi # Main playground script
46
- ├── start.sesi # Beginner script
47
- │ ├── build_website.sesi # Sesi-powered systems site generator
48
- │ └── tests/ # Additional syntax validation scripts
44
+ ├── main/ # Playgrounds & debugging
45
+ │ ├── build_website.sesi # Sesi-powered systems site generator
46
+ └── tests/ # Additional syntax validation scripts
49
47
 
50
48
  ├── docs/
51
- │ ├── SPECIFICATION.md # Complete language spec (600+ lines)
52
- │ ├── ARCHITECTURE.md # Runtime & system design (400+ lines)
53
- │ ├── BUILTINS.md # Built-in functions reference (450+ lines)
54
- │ ├── IMAGE_GENERATION.md # Image generation guide (>100 lines)
55
- │ ├── SYSTEMS_REASONING.md # Integrated reasoning guide (500+ lines)
56
- │ ├── DISTRIBUTED_SYSTEMS.md # Swarm & coordination guide (>100 lines)
57
- └── ROADMAP.md # V2-V4+ development plan (400+ lines)
49
+ │ ├── SPECIFICATION.md # Complete language spec (600+ lines)
50
+ │ ├── ARCHITECTURE.md # Runtime & system design (400+ lines)
51
+ │ ├── BUILTINS.md # Built-in functions reference (450+ lines)
52
+ │ ├── CLI.md # Comprehensive CLI & Parametric Eval guide
53
+ │ ├── COMPARISON.md # Language comparison showcase
54
+ │ ├── CONCURRENCY.md # Concurrency & coordination guide (>100 lines)
55
+ ├── IMAGE_GENERATION.md # Image generation guide (>100 lines)
56
+ │ ├── REASONING.md # Reasoning and simple logic guide (>500 lines)
57
+ │ ├── ROADMAP.md # V2-V4+ development plan (400+ lines)
58
+ │ ├── agent_native_programming.md # Sesi as an Agent-Native Programming paradigm
59
+ │ └── sesi_ai_chronicles.md # AI project history & notes
58
60
 
59
61
  ├── examples/
60
- │ ├── 01_hello.sesi # Hello World
61
- │ ├── 02_variables.sesi # Variables & operations
62
- │ ├── 03_functions.sesi # Functions with parameters
63
- │ ├── 04_conditionals.sesi # If/else control flow
64
- │ ├── 05_loops.sesi # While, for, for-in loops
65
- │ ├── 06_arrays_objects.sesi # Collections
66
- │ ├── 07_prompts.sesi # Reasoning blocks
67
- │ ├── 08_model_call.sesi # Basic reasoning calls
68
- │ ├── 09_structured_output.sesi # Type-safe reasoning responses
69
- │ ├── 10_code_generation.sesi # Systems logic generation
70
- │ ├── 11_memory_conversation.sesi # Multi-turn stateful reasoning
71
- │ ├── 12_classification.sesi # Systems classification loop
72
- │ ├── 13_data_pipeline.sesi # Complete systems pipeline
73
- │ ├── 14_folder_explainer.sesi # Directory parsing & reasoning
74
- │ ├── 15_image_generation.sesi # Image generation API test
75
- │ ├── 16_modules.sesi # Modules & std library namespaces
76
- │ ├── 17_http_client.sesi # Network GET/POST client
77
- └── 18_parallel_requests.sesi # Parallel requests concurrency
62
+ │ ├── 01_hello.sesi # Hello World
63
+ │ ├── 02_variables.sesi # Variables & operations
64
+ │ ├── 03_functions.sesi # Functions with parameters
65
+ │ ├── 04_conditionals.sesi # If/else control flow
66
+ │ ├── 05_loops.sesi # While, for, for-in loops
67
+ │ ├── 06_arrays_objects.sesi # Collections
68
+ │ ├── 07_prompts.sesi # Reasoning blocks
69
+ │ ├── 08_model_call.sesi # Basic reasoning calls
70
+ │ ├── 09_structured_output.sesi # Type-safe reasoning responses
71
+ │ ├── 10_code_generation.sesi # Systems logic generation
72
+ │ ├── 11_memory_conversation.sesi # Multi-turn stateful reasoning
73
+ │ ├── 12_classification.sesi # Systems classification loop
74
+ │ ├── 13_data_pipeline.sesi # Complete systems pipeline
75
+ │ ├── 14_folder_explainer.sesi # Directory parsing & reasoning
76
+ │ ├── 15_image_generation.sesi # Image generation API test
77
+ │ ├── 16_modules.sesi # Modules & std library namespaces
78
+ │ ├── 17_http_client.sesi # Network GET/POST client
79
+ ├── 18_parallel_requests.sesi # Parallel requests concurrency
80
+ │ ├── 19_search_web.sesi # Web search integration
81
+ │ ├── 20_model_aliases.sesi # Custom model naming aliases
82
+ │ ├── 21_custom_tools.sesi # Custom runtime tool definitions
83
+ │ └── 22_reasoning_plus_custom_tools.sesi # Reasoning composed with custom tools
78
84
 
79
- └── tests/
80
- └── basic.test.ts # Test suite
85
+ └── tests/ # Engine test suite
86
+ ├── basic.test.ts # Core parsing & evaluation tests
87
+ ├── cache.test.ts # Execution caching tests
88
+ ├── http.test.ts # Web request builtins testing
89
+ ├── module.test.ts # Imports & module loading tests
90
+ ├── parallel.test.ts # Concurrent execution tests
91
+ ├── security.test.ts # Sandbox & guardrail tests
92
+ ├── test-gemini.ts # Base model integration test
93
+ ├── test-gemini2.ts # Extended model integration test
94
+ └── workflow.test.ts # Complex sequence workflows tests
81
95
  ```
82
96
 
83
97
  ## 🔧 Technology Stack
@@ -150,36 +164,43 @@ try { ... } catch (e) { ... }
150
164
  - Block scope for loops/conditionals
151
165
  - Closure support
152
166
 
153
- ### Integrated Reasoning Features ✅
154
-
155
167
  **Prompt Blocks**
156
168
 
157
169
  ```sesi
158
170
  prompt greeting {"Hello, " name "!"}
159
171
  ```
160
172
 
173
+ **Structured Output**
174
+
175
+ ```sesi
176
+ let rawJson = "{\"projectName\": \"Sesi\", \"version\": \"1.3.0\", \"status\": \"active\"}"
177
+ let parsedRegistry = structured_output({projectName: string, version: string, status: string})(rawJson)
178
+ ```
179
+
180
+ ### Integrated Reasoning Features ✅
181
+
161
182
  **Reasoning Calls**
162
183
 
163
184
  ```sesi
164
- let response = model("gemini-3-flash-preview") {"temperature": 0.7, "max_tokens": 1000} {"Your prompt here"}
185
+ let response = model("gemini-3-flash-preview") {temperature: 0.7, max_tokens: 1000} {"Your prompt here"}
165
186
  ```
166
187
 
167
- **Structured Output**
188
+ **Web Search Grounding**
168
189
 
169
190
  ```sesi
170
- let result = structured_output({field1: string, field2: number})(model("gemini-3.1-flash-lite") {"Your prompt here"})
191
+ let response = model("gemini-3.1-flash-lite") {search, max_tokens: 1000} {"What is the weather in Tokyo?"}
171
192
  ```
172
193
 
173
194
  **Image Generation**
174
195
 
175
196
  ```sesi
176
- let logo = image("gemini-3.1-flash-image-preview") {"ratio": '1:1', "size": 512} {"Your prompt here"}
197
+ let logo = image("gemini-3.1-flash-image-preview") {ratio: "1:1", size: "512"} {"Your prompt here"}
177
198
  write_image("logo.png", logo)
178
199
  ```
179
200
 
180
201
  **Temporal Context Injection** ✅
181
202
 
182
- Every reasoning call automatically includes the current UTC date and time in its context, providing the system with a native sense of "now."
203
+ Every reasoning call automatically includes the current UTC date and time in its context, providing the script with a native sense of "now."
183
204
 
184
205
  **Implicit Statement Termination** ✅
185
206
 
@@ -187,7 +208,7 @@ Expressions ending in `}` (such as prompt blocks or reasoning calls) no longer s
187
208
 
188
209
  **Async Polling for MAX_TOKENS** ✅
189
210
 
190
- The AI runtime natively polls the model if it hits a `MAX_TOKENS` finish reasoning block, automatically appending previous chunks and prompting the model to continue exactly where it left off, seamlessly synthesizing long responses.
211
+ The runtime natively polls the model if it hits a `MAX_TOKENS` finish status during large generation tasks.
191
212
 
192
213
  **Tool Calling**
193
214
 
@@ -209,6 +230,10 @@ let response = model("gemini-3-flash-preview") {conversation}
209
230
  print("Reasoning Response:", response)
210
231
  ```
211
232
 
233
+ ## 🌍 Built-in Global Variables
234
+
235
+ - `args` (`array<string>`): Contains the command-line arguments passed to the script, excluding Sesi runtime options and the script path.
236
+
212
237
  ## 🛠️ Built-in Functions
213
238
 
214
239
  ### I/O
@@ -217,7 +242,9 @@ print("Reasoning Response:", response)
217
242
  - `read_file(path)` - Read file contents
218
243
  - `write_file(path, content)` - Write file contents
219
244
  - `write_image(path, content)` - Write base64 image data to file
245
+ - `from_json(path)` - Read a JSON file
220
246
  - `list_dir(path)` - List directory contents
247
+ - `make_dir(path)` - Create a new directory
221
248
  - `spawn(path)` - Launch concurrent background process
222
249
  - `exec(command)` - Synchronous shell execution
223
250
  - `time()` - Unix timestamp (ms)
@@ -227,6 +254,7 @@ print("Reasoning Response:", response)
227
254
 
228
255
  - `type(value)` - Get type name
229
256
  - `str(value)` - Convert to string
257
+ - `to_json(value)` - Convert to JSON string
230
258
  - `num(value)` - Convert to number
231
259
  - `bool(value)` - Convert to boolean
232
260
 
@@ -250,21 +278,46 @@ print("Reasoning Response:", response)
250
278
 
251
279
  - `multi_req(fns)` - Concurrently execute multiple closures/functions
252
280
 
281
+ ### Reasoning
282
+
283
+ - `workflow(steps, input)` - Run a multi-step reasoning workflow
284
+ - `set_alias(alias, model)` - Register a custom local name for a model
285
+ - `define_tool(name, fn, description)` - Register a custom tool
286
+ - `list_tools()` - List custom tool names
287
+
288
+ ### Error Handling
289
+
290
+ - `error_type(type, message, data)` - Create a custom error object
291
+ - `raise_error(type_or_error, message, data)` - Throw an error
292
+
293
+ ### Math
294
+
295
+ - `exp(x)` - Exponential function
296
+
253
297
  ## 📊 Implementation Statistics
254
298
 
255
299
  | Metric | Value |
256
300
  | ------------------- | ------ |
257
301
  | Total lines of code | ~3,000 |
258
302
  | Source files | 7 |
259
- | Documentation pages | 5 |
260
- | Example programs | 15 |
261
- | Built-in functions | 23 |
303
+ | Documentation pages | 12 |
304
+ | Example programs | 22 |
305
+ | Built-in functions | 34 |
262
306
  | Supported operators | 20+ |
263
307
  | AST node types | 30+ |
264
308
  | Token types | 50+ |
265
309
 
266
310
  ## 🚀 Getting Started
267
311
 
312
+ ### Installation
313
+
314
+ ```bash
315
+ cd Sesi
316
+ npm install
317
+ npm run build
318
+ npm install -g .
319
+ ```
320
+
268
321
  ### Run Example
269
322
 
270
323
  ```bash
@@ -347,7 +400,7 @@ npm test
347
400
  - Performance notes
348
401
  - Standard library plans
349
402
 
350
- ✅ **SYSTEMS_REASONING.md** (500+ lines)
403
+ ✅ **REASONING.md** (500+ lines)
351
404
 
352
405
  - Systems reasoning overview
353
406
  - Prompt blocks explained
@@ -370,26 +423,30 @@ npm test
370
423
 
371
424
  ## 🎓 Example Programs
372
425
 
373
- | File | Demonstrates |
374
- | --------------------------- | ------------------------------- |
375
- | 01_hello.sesi | Basic print |
376
- | 02_variables.sesi | Variables and operations |
377
- | 03_functions.sesi | Functions, parameters, defaults |
378
- | 04_conditionals.sesi | If/else logic |
379
- | 05_loops.sesi | While, for, for-in |
380
- | 06_arrays_objects.sesi | Collections and indexing |
381
- | 07_prompts.sesi | Reasoning blocks |
382
- | 08_model_call.sesi | Basic reasoning calls |
383
- | 09_structured_output.sesi | Schema-guided output |
384
- | 10_code_generation.sesi | Reasoning code generation |
385
- | 11_memory_conversation.sesi | Multi-turn with memory |
386
- | 12_classification.sesi | Reasoning classification loop |
387
- | 13_data_pipeline.sesi | Complete pipeline |
388
- | 14_folder_explainer.sesi | Directory parsing & reasoning |
389
- | 15_image_generation.sesi | Image generation API test |
390
- | 16_modules.sesi | Imports/exports & std namespaces|
391
- | 17_http_client.sesi | HTTP GET and POST operations |
392
- | 18_parallel_requests.sesi | Parallel request concurrency |
426
+ | File | Demonstrates |
427
+ | ----------------------------------- | -------------------------------- |
428
+ | 01_hello.sesi | Basic print |
429
+ | 02_variables.sesi | Variables and operations |
430
+ | 03_functions.sesi | Functions, parameters, defaults |
431
+ | 04_conditionals.sesi | If/else logic |
432
+ | 05_loops.sesi | While, for, for-in |
433
+ | 06_arrays_objects.sesi | Collections and indexing |
434
+ | 07_prompts.sesi | Reasoning blocks |
435
+ | 08_model_call.sesi | Basic reasoning calls |
436
+ | 09_structured_output.sesi | Schema-guided output |
437
+ | 10_code_generation.sesi | Reasoning code generation |
438
+ | 11_memory_conversation.sesi | Multi-turn with memory |
439
+ | 12_classification.sesi | Reasoning classification loop |
440
+ | 13_data_pipeline.sesi | Complete pipeline |
441
+ | 14_folder_explainer.sesi | Directory parsing & reasoning |
442
+ | 15_image_generation.sesi | Image generation API test |
443
+ | 16_modules.sesi | Imports/exports & std namespaces |
444
+ | 17_http_client.sesi | HTTP GET and POST operations |
445
+ | 18_parallel_requests.sesi | Parallel request concurrency |
446
+ | 19_search_web.sesi | Web search integration |
447
+ | 20_model_aliases.sesi | Custom model naming aliases |
448
+ | 21_custom_tools.sesi | Custom runtime tool definitions |
449
+ | 22_reasoning_plus_custom_tools.sesi | Compose reasoning & tools |
393
450
 
394
451
  ## ✨ Unique Features
395
452
 
@@ -440,7 +497,7 @@ npm test
440
497
 
441
498
  **Example Coverage**
442
499
 
443
- - 15 complete example programs
500
+ - 22 complete example programs
444
501
  - Covers all major language features
445
502
  - Demonstrates reasoning integration
446
503
  - Real-world use cases
@@ -452,7 +509,7 @@ npm test
452
509
  - **Simplicity**: Easy to understand, modify, extend
453
510
  - **Debugging**: Can print AST and execution steps
454
511
  - **Iteration**: No compilation overhead, fast development
455
- - **Good enough**: Performance is adequate for v1
512
+ - **Good enough**: Performance is adequate for v1+
456
513
 
457
514
  ### Why recursive descent parser?
458
515
 
@@ -469,30 +526,37 @@ npm test
469
526
  - **Cost**: Competitive pricing
470
527
  - **Availability**: Easy to use via official SDK
471
528
 
472
- ### Why does v1.1.2 support a module system?
529
+ ### Why does v1+ support a module system?
473
530
 
474
- - **Organization**: As Sesi programs grew, having a single-file system became limiting. Local module imports/exports and standard libraries (`std/math`, `std/time`, `std/json`) are natively supported in v1.1.2.
531
+ - **Organization**: As Sesi programs grew, having a single-file system became limiting. Local module imports/exports and standard libraries (`std/math`, `std/time`, `std/json`) are natively supported in v1.x.
475
532
 
476
- ### Why does v1.1.2 support parallel execution?
533
+ ### Why does v1+ support parallel execution?
477
534
 
478
535
  - **Concurrency**: While the interpreter remains tree-walking and single-threaded for simplicity, native concurrency is supported via the parallel request executor `multi_req(array<function>)`, executing asynchronous operations physically in parallel.
479
536
 
480
537
  ## 📖 Learning Path
481
538
 
482
539
  1. **Start**: [QUICKSTART.md](QUICKSTART.md) - Get running in 5 minutes
483
- 2. **Basics**: examples/01-06 - Core language features
484
- 3. **Prompts**: examples/07 - Prompt blocks
485
- 4. **Reasoning**: examples/08-12 - Reasoning feature exploration
486
- 5. **Specification**: [SPECIFICATION.md](SPECIFICATION.md) - Complete grammar
487
- 6. **Advanced**: [SYSTEMS_REASONING.md](SYSTEMS_REASONING.md) - Patterns and best practices
488
- 7. **Builtins**: [BUILTINS.md](BUILTINS.md) - Built-in functions
489
- 8. **Image Generation**: [IMAGE_GENERATION.md](IMAGE_GENERATION.md) examples/15 - Generating images natively
490
- 9. **Architecture**: [ARCHITECTURE.md](ARCHITECTURE.md) - How it works
491
- 10. **Roadmap**: [ROADMAP.md](ROADMAP.md) - Future vision
492
-
493
- ## 🤝 Contributing Path (Future)
494
-
495
- When open source:
540
+ 2. **Builtins**: [BUILTINS.md](docs/BUILTINS.md) - Built-in functions
541
+ 3. **CLI**: [CLI.md](docs/CLI.md) - Complete CLI flags & parametric execution guide
542
+ 4. **Basics**: examples/01-06 - Core language features
543
+ 5. **Prompts**: examples/07 - Prompt blocks
544
+ 6. **Reasoning**: examples/08-12 - Reasoning feature exploration
545
+ 7. **Advanced**: [REASONING.md](docs/REASONING.md) - Patterns and best practices
546
+ 8. **Systems**: examples/13-14 - Systems reasoning and data pipelines
547
+ 9. **Modules**: examples/16 - Modules & std library namespaces
548
+ 10. **Image Generation**: [IMAGE_GENERATION.md](docs/IMAGE_GENERATION.md) examples/15 - Generating images natively
549
+ 11. **Concurrency**: examples/17-18 - Concurrency & coordination
550
+ 12. **Web Search**: examples/19 - Web search integration
551
+ 13. **Model Aliases**: examples/20 - Custom model naming aliases
552
+ 14. **Custom Tools**: examples/21-22 - Custom runtime tool definitions and compose reasoning with custom tools
553
+ 15. **Agent-Native Paradigm**: [agent_native_programming.md](docs/agent_native_programming.md) - Paradigms of LLM-native coding
554
+ 16. **AI History**: [sesi_ai_chronicles.md](docs/sesi_ai_chronicles.md) - Sesi's historical development and stress tests
555
+ 17. **Specification**: [SPECIFICATION.md](docs/SPECIFICATION.md) - Complete grammar
556
+ 18. **Architecture**: [ARCHITECTURE.md](docs/ARCHITECTURE.md) - How it works
557
+ 19. **Roadmap**: [ROADMAP.md](docs/ROADMAP.md) - Future vision
558
+
559
+ ## 🤝 Contributing Path
496
560
 
497
561
  1. Report bugs with minimal examples
498
562
  2. Suggest language features via RFCs
@@ -509,7 +573,7 @@ When open source:
509
573
  - ✅ API reference (450+ lines)
510
574
  - ✅ Systems reasoning guide (500+ lines)
511
575
  - ✅ Development roadmap (400+ lines)
512
- - ✅ 15 example programs
576
+ - ✅ 20+ example programs
513
577
  - ✅ CLI executable
514
578
  - ✅ Test suite
515
579
  - ✅ Quick start guide
@@ -526,19 +590,19 @@ When open source:
526
590
 
527
591
  ## 🚀 Philosophy
528
592
 
529
- > "Sesi demonstrates that systems-level logic and integrated reasoning can be unified into a single, elegant language primitive, eliminating the boilerplate of traditional AI development."
593
+ > "Sesi demonstrates that coding shouldn't need to be hard to understand, eliminating the boilerplate of traditional development and lowering the entry-level for those interested in code or programming."
530
594
 
531
- The language is designed to evolve. V1 provides a solid foundation. V2+ adds power. The architecture supports this gracefully without breaking existing programs.
595
+ The language is designed to evolve. V1+ provides a solid foundation. V2+ adds power. The architecture supports this gracefully without breaking existing programs.
532
596
 
533
597
  ---
534
598
 
535
- **Status**: Complete V1.1 implementation
536
- **Ready for**: Distributed systems orchestration and prototypes
599
+ **Status**: Ongoing V1.3 implementation
600
+ **Ready for**: File manipulation and process orchestration
537
601
  **Not ready for**: Massive-scale production (until v2.0 bytecode)
538
602
  **Next milestone**: V2.0 (Async & advanced reasoning)
539
603
 
540
- Sesi is an experiment in language design. Use it to learn, explore, and evolve what integrated reasoning will become.
604
+ Sesi is not just an experiment in language design. Use it to learn, explore, and evolve what the future of coding will become.
541
605
 
542
606
  ---
543
607
 
544
- For more information, see more of the documentation in this folder and examples in `examples/`.
608
+ For more information, see the documentation in `docs/` and examples in `examples/`.