@misterscan/sesi 1.3.0 → 1.3.3

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 (86) 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 +74 -33
  6. package/bin/sesi.js +56 -23
  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 +3 -1
  14. package/dist/builtins.js.map +1 -1
  15. package/dist/index.d.ts +5 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +61 -2
  18. package/dist/index.js.map +1 -1
  19. package/dist/interpreter.d.ts +10 -0
  20. package/dist/interpreter.d.ts.map +1 -1
  21. package/dist/interpreter.js +20 -4
  22. package/dist/interpreter.js.map +1 -1
  23. package/dist/parser.d.ts.map +1 -1
  24. package/dist/parser.js +3 -4
  25. package/dist/parser.js.map +1 -1
  26. package/dist/sesi.bundled.js +2526 -1487
  27. package/dist/types.d.ts +1 -1
  28. package/dist/types.d.ts.map +1 -1
  29. package/docs/ARCHITECTURE.md +2 -7
  30. package/docs/BUILTINS.md +27 -8
  31. package/docs/CLI.md +200 -0
  32. package/docs/COMPARISON.md +11 -6
  33. package/docs/IMPLEMENTATION_SUMMARY.md +57 -50
  34. package/docs/QUICKSTART.md +104 -23
  35. package/docs/README.md +84 -42
  36. package/docs/REASONING.md +21 -16
  37. package/docs/ROADMAP.md +10 -5
  38. package/docs/SKILLS.md +63 -116
  39. package/docs/SPECIFICATION.md +35 -23
  40. package/examples/03_functions.sesi +30 -1
  41. package/examples/07_prompts.sesi +26 -2
  42. package/examples/08_model_call.sesi +6 -4
  43. package/examples/09_structured_output.sesi +18 -2
  44. package/examples/10_code_generation.sesi +6 -4
  45. package/examples/11_memory_conversation.sesi +47 -15
  46. package/examples/12_classification.sesi +62 -7
  47. package/examples/13_data_pipeline.sesi +55 -28
  48. package/examples/14_folder_explainer.sesi +52 -51
  49. package/examples/15_image_generation.sesi +15 -14
  50. package/examples/16_modules.sesi +1 -1
  51. package/examples/19_search_web.sesi +18 -2
  52. package/examples/20_model_aliases.sesi +6 -6
  53. package/main/tests/test-args.sesi +7 -0
  54. package/main/tests/test_args.sesi +7 -0
  55. package/main/tests/test_general_modules.sesi +127 -0
  56. package/package.json +25 -21
  57. package/docs/CONCURRENCY.md +0 -71
  58. package/docs/sesi_ai_chronicles.md +0 -96
  59. package/main/conversational_classifier_weights.json +0 -45
  60. package/main/conversational_sentences.json +0 -304
  61. package/main/epochs.sesi +0 -94
  62. package/main/gpu_orchestrator.sesi +0 -36
  63. package/main/hardware_diagnostics.sesi +0 -118
  64. package/main/inference.sesi +0 -54
  65. package/main/native_chatbot.sesi +0 -180
  66. package/main/native_synthesizer.sesi +0 -83
  67. package/main/nn_personas_trainer.sesi +0 -302
  68. package/main/nn_responses_trainer.sesi +0 -269
  69. package/main/nn_sentences_trainer.sesi +0 -330
  70. package/main/orchestrator.sesi +0 -15
  71. package/main/personas.json +0 -124
  72. package/main/personas_classifier_weights.json +0 -45
  73. package/main/playground.sesi +0 -3
  74. package/main/predictive_typing.sesi +0 -127
  75. package/main/query_brain.sesi +0 -45
  76. package/main/response_classifier_weights.json +0 -45
  77. package/main/retro_chat.html +0 -239
  78. package/main/retro_chat_generator.sesi +0 -745
  79. package/main/sesi_ai.sesi +0 -158
  80. package/main/sesi_db_chatbot.sesi +0 -284
  81. package/main/setup_swarm.sesi +0 -5
  82. package/main/start.sesi +0 -13
  83. package/main/terminal.log +0 -56
  84. package/main/terminal_chat.py +0 -385
  85. package/main/unified_sesi_ai.sesi +0 -334
  86. package/main/varied_responses.json +0 -304
@@ -5,12 +5,19 @@
5
5
  Once Sesi is installed, you can run Sesi files globally:
6
6
 
7
7
  ```bash
8
- sesi main/start.sesi
8
+ sesi examples/01_hello.sesi
9
+ ```
10
+
11
+ You can also pass arguments to your script, which are exposed under the global `args` array:
12
+
13
+ ```bash
14
+ sesi main/test_args.sesi arg1 arg2
9
15
  ```
10
16
 
11
17
  ### Run Tests
12
18
 
13
19
  For devs working on Sesi, you can verify your backend edits with the built-in test suite:
20
+
14
21
  ```bash
15
22
  npm test
16
23
  ```
@@ -19,8 +26,10 @@ npm test
19
26
 
20
27
  Create a file called `hello.sesi`:
21
28
 
22
- ```sesi
23
- print "Hello, Sesi!"
29
+ ```bash
30
+ sesi -e 'let txt = "Hello, world!"
31
+ prompt file {"print \"" txt "\""}
32
+ write_file("hello.sesi", file)'
24
33
  ```
25
34
 
26
35
  Run it:
@@ -84,6 +93,53 @@ let person = {"name": "Alice", "age": age}
84
93
  print person["name"] "is" person["age"] "years old." // "Alice is 25 years old."
85
94
  ```
86
95
 
96
+ Prompts are **composable message templates** that evaluate to strings. You can also utilize these to write clean and concise sesi scripts by nesting variables and even other prompts within prompts.
97
+
98
+ ### Basic Prompt
99
+
100
+ ```sesi
101
+ prompt simplePrompt {"Hello, Sesi!"}
102
+ print simplePrompt // "Hello, Sesi!"
103
+ ```
104
+
105
+ ### Prompts with Variables
106
+
107
+ ```sesi
108
+ let name = "Alice"
109
+ prompt greeting {"Hello, " name "! How are you?"}
110
+ print greeting // "Hello, Alice! How are you?"
111
+ ```
112
+
113
+ ### Composing Prompts
114
+
115
+ ```sesi
116
+ prompt part1 {"First part"}
117
+ prompt part2 {part1 " Second part"}
118
+ print part2 // "First part Second part"
119
+ ```
120
+
121
+ ### Prompts in Functions
122
+
123
+ ```sesi
124
+ let text = "Testing"
125
+ let language = "Spanish"
126
+ fn translatePrompt(text: string, language: string) -> string
127
+ {prompt translate {"Translate " text " to " language ": "} return translate}
128
+ print translatePrompt(text, language)
129
+ ```
130
+
131
+ Structured output allows you to extract structured data natively or via Reasoning. It uses a JSON Schema to define the structure of the output.
132
+
133
+ ### Basic Structured Output
134
+
135
+ ```sesi
136
+ let rawJson = "{\"projectName\": \"Sesi\", \"version\": \"1.3.0\", \"status\": \"active\"}"
137
+ let analysis = structured_output({projectName: string, version: string, status: string})(rawJson)
138
+ print "Project: " analysis["projectName"]
139
+ print "Version: " analysis["version"]
140
+ print "Status: " analysis["status"]
141
+ ```
142
+
87
143
  ## Reasoning Features
88
144
 
89
145
  ### Requiring Gemini API
@@ -111,15 +167,7 @@ let response = model("gemini-3-flash-preview") {temperature: 0.8, max_tokens: 10
111
167
  print response
112
168
  ```
113
169
 
114
- ### Prompts
115
-
116
- ```sesi
117
- let name = "Developer"
118
- prompt greeting {"Hello, " name "! " "How are you today?"}
119
- print greeting
120
- ```
121
-
122
- ### Structured Output
170
+ ### Reasoning with Structured Output
123
171
 
124
172
  ```sesi
125
173
  let analysis = structured_output({sentiment: string, score: number})(model("gemini-3.1-flash-lite") {"Analyze sentiment of: This product is great!"})
@@ -314,7 +362,7 @@ let rejoined = join(words, "-")
314
362
  ### Reasoning Classification
315
363
 
316
364
  ```sesi
317
- fn classify(item: string)
365
+ fn classify(item: string)
318
366
  {print model("gemini-3-flash-preview"){"Classify as: FRUIT, VEGETABLE, or GRAIN. Item: " item}}
319
367
  classify("apple")
320
368
  classify("carrot")
@@ -326,7 +374,7 @@ classify("wheat")
326
374
  ### Print Intermediate Values
327
375
 
328
376
  ```sesi
329
- fn complex(x: number)
377
+ fn complex(x: number)
330
378
  {let step1 = x * 2
331
379
  print "Step 1:" str(step1)
332
380
  let step2 = step1 + 10
@@ -365,6 +413,8 @@ else {print "Response: " response}
365
413
  3. **Understand architecture**: [ARCHITECTURE.md](docs/ARCHITECTURE.md)
366
414
  4. **Check roadmap**: [ROADMAP.md](docs/ROADMAP.md)
367
415
  5. **Study examples**: [examples/](examples/)
416
+ 6. **Understand the Agent-Native Paradigm**: [agent_native_programming.md](docs/agent_native_programming.md)
417
+ 7. **Read the historical Stress Test Chronicles**: [sesi_ai_chronicles.md](docs/sesi_ai_chronicles.md)
368
418
 
369
419
  ## Getting Help
370
420
 
@@ -380,30 +430,61 @@ sesi -h "how to spawn background processes?"
380
430
  You can also pass a file into the help context so the co-pilot can talk about that exact script:
381
431
 
382
432
  ```bash
383
- sesi main/playground.sesi -h
384
- sesi main/playground.sesi -h "why is this failing?"
433
+ sesi examples/01_hello.sesi -h
434
+ sesi examples/01_hello.sesi -h "what is this script doing?"
385
435
  ```
386
436
 
387
437
  Other useful CLI options:
388
438
 
389
439
  ```bash
390
- # Run a one-line snippet
440
+ # Run a one-line snippet (inline)
391
441
  sesi -e "print 'hello'"
442
+ ```
392
443
 
393
- # Encrypt or decrypt a script file
394
- sesi -encrypt my_script.sesi -p "my-password"
395
- sesi -decrypt my_script.sesi -p "my-password"
444
+ ### Security & Sandboxing
445
+
446
+ ```bash
447
+ # Encrypt or decrypt a script file (with password parameter)
448
+ sesi -enc my_script.sesi -p "my-password"
449
+ sesi -dec my_script.sesi -p "my-password"
450
+ ```
451
+
452
+ To avoid exposing passwords in your shell's history, you can set the `SESI_PASSWORD` environment variable in your `.env` file (or your system's shell environment).
453
+
454
+ ```bash
455
+ export SESI_PASSWORD="my-password"
456
+
457
+ # Encrypt or decrypt automatically using SESI_PASSWORD environment variable
458
+ sesi -enc my_script.sesi
459
+ sesi -dec my_script.sesi
396
460
 
397
461
  # Disable sandbox protections for a run
398
- sesi main/start.sesi --local
462
+ sesi examples/01_hello.sesi -l
399
463
 
400
464
  # Add extra allowed filesystem paths
401
- sesi main/start.sesi --allowed-paths ./docs,./examples
465
+ sesi examples/01_hello.sesi -a ./docs,./examples
466
+ ```
467
+
468
+ ### Repository Script Shortcuts
469
+
470
+ If working directly inside the Sesi codebase, you can use convenient npm shortcuts to run Sesi commands:
471
+
472
+ ```bash
473
+ # Evaluate inline code
474
+ npm run sesi:eval -- "print 'Hello from npm!'"
475
+
476
+ # Encrypt / Decrypt files using SESI_PASSWORD environment fallback
477
+ npm run sesi:encrypt -- "my_script.sesi"
478
+ npm run sesi:decrypt -- "my_script.sesi"
479
+
480
+ # Search with Sesi's Co-Pilot
481
+ npm run sesi:help -- "how do I use multi_req()?"
402
482
  ```
403
483
 
404
484
  The co-pilot will dynamically index and train on Sesi's native repository database and retrieve full RAG context from our standard specification docs to generate a syntactically correct, 100% accurate, conversational answer in real-time!
405
485
 
406
486
  You can also:
487
+
407
488
  - Check documentation in [docs/](docs/)
408
489
  - Review examples in [examples/](examples/)
409
490
  - Read error messages carefully
@@ -420,4 +501,4 @@ When reporting bugs:
420
501
 
421
502
  ---
422
503
 
423
- Happy programming with Sesi! 🚀
504
+ Happy programming with Sesi! 🚀
package/docs/README.md CHANGED
@@ -1,7 +1,3 @@
1
- <p align="center">
2
- <img src="favicon.ico" alt="Sesi Logo" height="100" />
3
- </p>
4
-
5
1
  <h1 align="center">Sesi: A Concise, Legible Programming Language</h1>
6
2
 
7
3
  <p align="center">
@@ -16,20 +12,25 @@
16
12
  </p>
17
13
 
18
14
  <p align="center">
19
- <strong>Sesi</strong> is a clean, minimal, and highly legible programming language. Built from the ground up to be concise and buildable, Sesi removes unnecessary boilerplate. Because the language itself is so simple, integrating external tools like shell commands or Reasoning models becomes effortless. It is a language built for clarity.
15
+ <strong>Sesi</strong> is a clean, minimal, and highly legible programming language. Built from the ground up to be concise and buildable, Sesi removes unnecessary boilerplate. It is a language built for clarity.
20
16
  </p>
21
17
 
22
18
  <p align="center">
23
19
  <a href="https://code-with-sesi.netlify.app/">Homepage</a>
24
20
  </p>
25
21
 
22
+ ## SESI IS **NOT** AN AI WRAPPER LANGUAGE. IT IS **NOT** AN AI-NATIVE PROGRAMMING LANGUAGE. IT IS A GENERAL-PURPOSE PROGRAMMING LANGUAGE WITH **OPTIONAL** AI CAPABILITIES BUILT-IN. STRONG EMPHASIS ON **OPTIONAL**.
23
+
26
24
  ## Quick Start
27
25
 
28
26
  Run any program directly:
29
27
 
30
28
  ```bash
31
29
  # Standard script execution
32
- sesi main/start.sesi
30
+ sesi examples/01_hello.sesi
31
+
32
+ # Run script with arguments
33
+ sesi main/test_args.sesi arg1 arg2
33
34
 
34
35
  # Reasoning script example
35
36
  sesi examples/08_model_call.sesi
@@ -43,28 +44,67 @@ Useful CLI shortcuts:
43
44
  ```bash
44
45
  # Evaluate a quick snippet
45
46
  sesi -e "print 'hello'"
47
+ ```
46
48
 
49
+ ```bash
47
50
  # Ask the built-in co-pilot a question
48
- sesi -help "how do I use memory?"
51
+ sesi -h "how do I use memory?"
52
+ ```
49
53
 
54
+ ```bash
50
55
  # Ask for help about a specific file
51
- sesi main/playground.sesi -h "why is this failing"
56
+ sesi examples/01_hello.sesi -h "what is this script doing?"
57
+ ```
52
58
 
53
- # Encrypt or decrypt a script file
54
- sesi -encrypt my_script.sesi -p "my-password"
55
- sesi -decrypt my_script.sesi -p "my-password"
59
+ ```bash
60
+ # Encrypt or decrypt a script file manually
61
+ sesi -enc my_script.sesi -p "my-password"
62
+ sesi -dec my_script.sesi -p "my-password"
63
+ ```
56
64
 
65
+ To avoid exposing passwords in your shell's history, you can set the `SESI_PASSWORD` environment variable in your `.env` file (or your system's shell environment).
66
+
67
+ ```bash
68
+ export SESI_PASSWORD="my-password"
69
+ # Encrypt or decrypt automatically using SESI_PASSWORD environment variable
70
+ sesi -enc my_script.sesi
71
+ sesi -dec my_script.sesi
72
+ ```
73
+
74
+ ```bash
57
75
  # Run with sandbox restrictions disabled
58
- sesi main/start.sesi --local
76
+ sesi examples/01_hello.sesi -l
59
77
  ```
60
78
 
61
79
  # Local Execution (Development)
62
80
 
63
- If you choose not use the `sesi` command, use the helper npm scripts:
81
+ If you are developing inside the repository or haven't installed `sesi` globally, use the npm scripts:
82
+
83
+ ```bash
84
+ # Run a Sesi script
85
+ npm run sesi -- examples/01_hello.sesi
86
+ ```
87
+
88
+ ```bash
89
+ # Evaluate an inline snippet
90
+ npm run sesi:eval -- "print 'Sesi running!'"
91
+ ```
92
+
93
+ ```bash
94
+ # Ask Sesi's Co-Pilot
95
+ npm run sesi:help -- "how to make a directory?"
96
+ ```
97
+
98
+ ```bash
99
+ # Encrypt / Decrypt scripts (uses SESI_PASSWORD from your .env automatically)
100
+ npm run sesi:encrypt -- "secret.sesi"
101
+ npm run sesi:decrypt -- "secret.sesi"
102
+ ```
64
103
 
65
104
  ```bash
66
- npm run example 01_hello.sesi
67
- npm run example:ai 08_model_call.sesi
105
+ # Run classic examples
106
+ npm run example examples/01_hello.sesi
107
+ npm run example:ai examples/08_model_call.sesi
68
108
  npm run example:all
69
109
  ```
70
110
 
@@ -95,13 +135,13 @@ print code
95
135
 
96
136
  ## Security & Sandboxing
97
137
 
98
- Sesi is designed to run and orchestrate untrusted AI reasoning pipelines. Because code can be influenced by prompt injections or generated model instructions, Sesi incorporates a **safe-by-default, zero-trust sandboxing engine**.
138
+ Sesi incorporates a **safe-by-default, zero-trust sandboxing engine**.
99
139
 
100
140
  ### 🛡️ Core Security Features
101
141
 
102
142
  1. **Safe-by-Default Execution**:
103
143
  - Sesi's sandbox is **enabled by default**. Any standard Sesi interpreter execution blocks system command lines (`exec`, `spawn`) and locks down imports and paths.
104
- - *Overriding Safety:* Developers can explicitly bypass safe mode programmatically by initializing the interpreter with options, or on the command line by setting `SESI_SAFE_MODE=false`.
144
+ - _Overriding Safety:_ Developers can explicitly bypass safe mode programmatically by initializing the interpreter with options, or on the command line by setting `SESI_SAFE_MODE=false`.
105
145
 
106
146
  2. **Absolute Prototype Pollution Immunity**:
107
147
  - Sesi uses **prototype-free objects (`Object.create(null)`)** for all object literals, JSON parses (`from_json` or `std/json`), and structured model responses inside the interpreter.
@@ -118,36 +158,38 @@ Sesi is designed to run and orchestrate untrusted AI reasoning pipelines. Becaus
118
158
  - Sub-interpreters loaded via concurrent workflows (`multi_req`) are fully isolated. Sesi **deep-clones** prompts and memories, preventing concurrent agent tasks from leaking state or polluting each other.
119
159
 
120
160
  ### ⚙️ Programmatic Embedding Configurations
161
+
121
162
  When embedding Sesi inside a host application, you can statically configure safety settings directly in code:
163
+
122
164
  ```typescript
123
165
  const interpreter = new Interpreter(scriptDir, {
124
- safeMode: true, // Enable full sandbox limits (on by default)
125
- allowLocalFs: false, // Block directory escapes (on by default)
126
- allowedPaths: ['/var/tmp/sandbox'] // Custom strict whitelist directories
166
+ safeMode: true, // Enable full sandbox limits (on by default)
167
+ allowLocalFs: false, // Block directory escapes (on by default)
168
+ allowedPaths: ["/var/tmp/sandbox"], // Custom strict whitelist directories
127
169
  });
128
170
  ```
129
171
 
130
172
  ## Documentation
131
173
 
132
- - [Getting Started](https://github.com/Misterscan/Sesi/blob/main/QUICKSTART.md)
174
+ - [Getting Started](./QUICKSTART.md)
133
175
  - [Examples](./examples/)
134
- - [Language Specification](https://github.com/Misterscan/Sesi/blob/main/docs/SPECIFICATION.md)
135
- - [Language Comparison Showcase](https://github.com/Misterscan/Sesi/blob/main/docs/COMPARISON.md)
136
- - [Built-in Functions](https://github.com/Misterscan/Sesi/blob/main/docs/BUILTINS.md)
137
- - [Reasoning Guide](https://github.com/Misterscan/Sesi/blob/main/docs/REASONING.md)
138
- - [Concurrency Systems](https://github.com/Misterscan/Sesi/blob/main/docs/CONCURRENCY.md)
139
- - [Runtime Architecture](https://github.com/Misterscan/Sesi/blob/main/docs/ARCHITECTURE.md)
176
+ - [CLI Reference](./docs/CLI.md)
177
+ - [Language Specification](./docs/SPECIFICATION.md)
178
+ - [Language Comparison Showcase](./docs/COMPARISON.md)
179
+ - [Built-in Functions](./docs/BUILTINS.md)
180
+ - [Reasoning](./docs/REASONING.md)
181
+ - [Concurrency Systems](./docs/CONCURRENCY.md)
182
+ - [Runtime Architecture](./docs/ARCHITECTURE.md)
140
183
 
141
184
  ## Agent Context
142
185
 
143
- The root-level `SKILLS.md` file is a workspace context file for AI agents. It records repo-specific constraints such as valid Sesi syntax expectations, execution conventions, and the intended meaning of directories like `main/` and `main/tests/`.
186
+ The root-level `SKILLS.md` file is a workspace context file for AI agents.
144
187
 
145
188
  ## Project Structure
146
189
 
147
190
  ```
148
191
  Sesi/
149
192
  ├── SKILLS.md # Workspace context and repo guardrails
150
- ├── index.html # Sesi-generated systems landing page
151
193
  ├── eslint.config.mjs # ESLint configuration
152
194
  ├── example.js # Helper script to run basic examples
153
195
  ├── example-ai.js # Helper script to run reasoning examples
@@ -171,20 +213,18 @@ Sesi/
171
213
  │ └── sesi.js # CLI executable
172
214
 
173
215
  ├── main/ # Playgrounds & debugging
174
- │ ├── playground.sesi # Main playground script
175
- │ ├── start.sesi # Beginner script
176
216
  │ └── tests/ # Additional syntax validation scripts
177
217
 
178
218
  ├── docs/
219
+ │ ├── CLI.md # Comprehensive CLI & Parametric Eval guide
179
220
  │ ├── SPECIFICATION.md # Complete language spec (600+ lines)
180
221
  │ ├── ARCHITECTURE.md # Runtime & system design (400+ lines)
181
222
  │ ├── BUILTINS.md # Built-in functions reference (450+ lines)
182
223
  │ ├── COMPARISON.md # Language comparison showcase
183
- │ ├── CONCURRENCY.md # Concurrency & coordination guide (>100 lines)
184
224
  │ ├── IMAGE_GENERATION.md # Image generation guide (>100 lines)
185
225
  │ ├── REASONING.md # Reasoning and simple logic guide (>500 lines)
186
- ├── ROADMAP.md # V2-V4+ development plan (400+ lines)
187
- └── sesi_ai_chronicles.md # AI project history & notes
226
+ └── ROADMAP.md # V2-V4+ development plan (400+ lines)
227
+
188
228
 
189
229
  ├── examples/
190
230
  │ ├── 01_hello.sesi # Hello World
@@ -239,19 +279,21 @@ Sesi/
239
279
 
240
280
  ### Reasoning-Native Features ✅
241
281
 
242
- - `prompt` blocks for message composition
243
282
  - `model()` calls with Reasoning provider configuration
244
283
  - `image()` calls with specific ratio/size generation capabilities
245
- - `structured_output()` for typed Reasoning responses
246
- - `tool_call()` for function calling
247
- - Basic memory for multi-turn reasoning
248
- - `read_file()`, `write_file()`, `to_json()`, `write_image()`, and `list_dir()` for local file I/O
284
+ - **Async Polling**: Native looping to auto-resume generation when hitting `MAX_TOKENS` limit
285
+
286
+ ### System Features
287
+
288
+ - **Memory**: Basic memory for multi-turn reasoning
289
+ - **Filesystem I/O**: `read_file()`, `write_file()`, `to_json()`, `write_image()`, and `list_dir()` for local file I/O
249
290
  - **Native Concurrency**: `spawn()` and `exec()` for concurrent process management, and `multi_req(array<function>)` for physical parallel request execution.
250
291
  - **Logic Caching**: High-efficiency Sesi Logic Caching (`.sesi_cache.json`) for local call caching.
251
- - **Thinking Scale**: Scaled Gemini reasoning configurations using the `thinking` parameters.
252
292
  - **HTTP Client**: Built-in, native HTTP client support using `web_get(url)` and `web_send(url, body, headers)` with zero external dependencies.
253
- - **Async Polling**: Native looping to auto-resume generation when hitting `MAX_TOKENS` limit
254
293
  - **Utility Builtins**: `time()` and `random()` for robust coordination
294
+ - **Structured Output**: `structured_output()` for typed JSON Schema
295
+ - **Function Calling**: `tool_call()` for function calling
296
+ - **Prompt Blocks**: `prompt` blocks for cleaner and more concise script composition
255
297
 
256
298
  ### Type System
257
299
 
@@ -276,4 +318,4 @@ Sesi/
276
318
 
277
319
  ## License
278
320
 
279
- MIT
321
+ MIT
package/docs/REASONING.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- In Sesi, Reasoning is used to evaluate state, make logical decisions, and handle complex patterns. This guide covers how to leverage Sesi's built-in Reasoning functions (`model`, `image` `prompt`, `structured_output`, `tool_call`) to build scripts for your designated needs.
5
+ In Sesi, Reasoning is used to evaluate state, make logical decisions, and handle complex patterns. This guide covers how to leverage Sesi's built-in Reasoning functions (`model`, `image`, `workflow`) to build scripts for your designated needs.
6
6
 
7
7
  ## 1. Prompting
8
8
 
@@ -62,8 +62,9 @@ print creative
62
62
 
63
63
  // Config options:
64
64
  // - thinkingLevel: "minimal", "low", "medium", "high" (natively configures Gemini's reasoning budget)
65
- // - max_tokens: max length of response (OPTIONAL: if not specified, will use the model's default max tokens=2048)
66
- // - temperature / top_k / top_p: *Will be deprecated in Gemini 3.x+, use thinkingLevel instead (reasoning is mathematically optimized for default settings)*
65
+ // - max_tokens: max length of response (OPTIONAL: if not specified, will use the model's default max tokens=4096)
66
+ // - temperature: creative variation (OPTIONAL: defaults to 0.1 for high-fidelity reasoning precision)
67
+ // - top_k / top_p: parameter options for specialized sampling configurations
67
68
  ```
68
69
 
69
70
  ### Model Selection
@@ -126,7 +127,7 @@ print diff
126
127
 
127
128
  // Mixed with other config keys
128
129
  let scannedDocument = "doc_scan.jpg"
129
- let result = model("gemini-3.5-flash") {images: scannedDocument, thinkingLevel: "low", max_tokens: 2048} {"Transcribe all text visible in this scan."}
130
+ let result = model("gemini-3.5-flash") {images: scannedDocument, thinkingLevel: "low", max_tokens: 4096} {"Transcribe all text visible in this scan."}
130
131
  write_file("transcript.txt", result)
131
132
  ```
132
133
 
@@ -178,13 +179,12 @@ Let Reasoning call functions in your program.
178
179
  ```sesi
179
180
  let city = "New York"
180
181
  fn getWeather(city: string) -> string
181
- {let weather = model("gemini-3.1-flash-lite") {"What is the weather like in " city}
182
+ {let weather = model("gemini-3.1-flash-lite") {"What is the weather like in " city}
182
183
  return weather}
183
184
  let result = getWeather(city)
184
185
  print result
185
186
 
186
187
  // When defined inside a function, local variables MUST be defined on new lines.
187
- // (A current limitation of the parser).
188
188
  fn calculateTax(amount: number, rate: number) -> number
189
189
  {let amount = 100
190
190
  let rate = 0.08
@@ -419,7 +419,7 @@ print response
419
419
 
420
420
  ```sesi
421
421
  // Bad: Same analysis done multiple times
422
- for person in people
422
+ for person in people
423
423
  {let assessment = model("gemini-3.1-flash-lite") {"Assess based on criteria A, B, C: " person}}
424
424
  print assessment
425
425
 
@@ -428,7 +428,7 @@ print assessment
428
428
  let people = ["Elon Musk", "Bill Gates", "Steve Jobs"]
429
429
  fn assessPerson(person: string) -> string
430
430
  {return model("gemini-3.1-flash-lite") {"Assess on A, B, C: " person}}
431
- for person in people
431
+ for person in people
432
432
  {print assessPerson(person)}
433
433
  ```
434
434
 
@@ -463,7 +463,7 @@ fn smartSummarize(text: string) -> string
463
463
  let topics = structured_output({topics: string})(model("gemini-3.5-flash") {thinkingLevel: "low"} {"Identify topics in: " keyPoints})
464
464
 
465
465
  // Step 3: Generate summary
466
- let summary = model("gemini-3-flash-preview") {"Summarize with topics " topics ": " keyPoints}
466
+ let summary = model("gemini-3-flash-preview") {"Summarize with topics " topics ": " keyPoints}
467
467
  return summary}
468
468
  print "Summary:" smartSummarize(text)
469
469
  ```
@@ -517,7 +517,7 @@ print answer
517
517
  Sesi allows you to define custom tools that can be invoked during reasoning operations.
518
518
 
519
519
  ```sesi
520
- fn get_weather(city: string, conditions: string) -> string
520
+ fn get_weather(city: string, conditions: string) -> string
521
521
  {return "It is currently " + conditions + " in " + city}
522
522
  // Register the tool
523
523
  define_tool("weather", get_weather, "Get weather for a city")
@@ -535,10 +535,15 @@ print result
535
535
 
536
536
  ## See Also
537
537
 
538
- - [Compare to other languages](COMPARISON.md)
538
+ - [Quick Start Guide](../QUICKSTART.md)
539
539
  - [Language Specification](SPECIFICATION.md)
540
- - [Image Generation](IMAGE_GENERATION.md)
541
- - [Architecture](ARCHITECTURE.md)
542
- - [Built-ins](BUILTINS.md)
543
- - [Examples](../examples/)
544
- - [Roadmap](ROADMAP.md)
540
+ - [Runtime Architecture](ARCHITECTURE.md)
541
+ - [Built-in Functions Reference](BUILTINS.md)
542
+ - [Command Line Interface (CLI) Reference](CLI.md)
543
+ - [Image Generation & Input](IMAGE_GENERATION.md)
544
+ - [Compare to other languages](COMPARISON.md)
545
+ - [Concurrency & Coordination](CONCURRENCY.md)
546
+ - [Reasoning & Simple Logic](REASONING.md)
547
+ - [Agent-Native Programming Paradigm](agent_native_programming.md)
548
+ - [Historical Stress Test Chronicles](sesi_ai_chronicles.md)
549
+ - [Examples](../examples)
package/docs/ROADMAP.md CHANGED
@@ -398,10 +398,15 @@ The journey from v1 (interpreter) to v4+ (distributed compiler) maintains backwa
398
398
 
399
399
  ## See Also
400
400
 
401
- - [Specification](SPECIFICATION.md)
402
- - [Architecture](ARCHITECTURE.md)
403
- - [Built-ins](BUILTINS.md)
404
- - [Process Execution](PROCESS_EXECUTION.md)
405
- - [Image Generation](IMAGE_GENERATION.md)
401
+ - [Quick Start Guide](../QUICKSTART.md)
402
+ - [Language Specification](SPECIFICATION.md)
403
+ - [Runtime Architecture](ARCHITECTURE.md)
404
+ - [Built-in Functions Reference](BUILTINS.md)
405
+ - [Command Line Interface (CLI) Reference](CLI.md)
406
+ - [Image Generation & Input](IMAGE_GENERATION.md)
406
407
  - [Compare to other languages](COMPARISON.md)
408
+ - [Concurrency & Coordination](CONCURRENCY.md)
409
+ - [Reasoning & Simple Logic](REASONING.md)
410
+ - [Agent-Native Programming Paradigm](agent_native_programming.md)
411
+ - [Historical Stress Test Chronicles](sesi_ai_chronicles.md)
407
412
  - [Examples](../examples)