@misterscan/sesi 1.2.2 → 1.3.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/README.md +138 -34
- package/bin/sesi.js +163 -38
- package/dist/ai-runtime.d.ts.map +1 -1
- package/dist/ai-runtime.js +22 -4
- package/dist/ai-runtime.js.map +1 -1
- package/dist/builtins.d.ts +1 -0
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +257 -17
- package/dist/builtins.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -5
- package/dist/index.js.map +1 -1
- package/dist/interpreter.d.ts +17 -1
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +256 -98
- package/dist/interpreter.js.map +1 -1
- package/dist/lexer.d.ts.map +1 -1
- package/dist/lexer.js +8 -4
- package/dist/lexer.js.map +1 -1
- package/dist/parser.d.ts +2 -0
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +76 -32
- package/dist/parser.js.map +1 -1
- package/dist/sesi.bundled.js +87 -20
- package/dist/types.d.ts +14 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +33 -1
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +26 -9
- package/docs/BUILTINS.md +111 -13
- package/docs/COMPARISON.md +7 -9
- package/docs/{DISTRIBUTED_SYSTEMS.md → CONCURRENCY.md} +11 -11
- package/docs/IMAGE_GENERATION.md +13 -14
- package/docs/IMPLEMENTATION_SUMMARY.md +141 -84
- package/docs/QUICKSTART.md +81 -28
- package/docs/README.md +140 -34
- package/docs/{SYSTEMS_REASONING.md → REASONING.md} +107 -109
- package/docs/ROADMAP.md +44 -44
- package/docs/SKILLS.md +56 -28
- package/docs/SPECIFICATION.md +25 -18
- package/docs/sesi_ai_chronicles.md +96 -209
- package/examples/07_prompts.sesi +1 -1
- package/examples/08_model_call.sesi +1 -1
- package/examples/09_structured_output.sesi +1 -1
- package/examples/10_code_generation.sesi +1 -1
- package/examples/13_data_pipeline.sesi +1 -1
- package/examples/14_folder_explainer.sesi +2 -2
- package/examples/15_image_generation.sesi +1 -1
- package/examples/16_modules.sesi +27 -27
- package/examples/19_search_web.sesi +4 -0
- package/examples/20_model_aliases.sesi +22 -0
- package/examples/21_custom_tools.sesi +27 -0
- package/examples/22_reasoning_plus_custom_tools.sesi +19 -0
- package/main/orchestrator.sesi +2 -2
- package/main/sesi_db_chatbot.sesi +7 -3
- package/main/tests/test_grounding.sesi +2 -0
- package/package.json +6 -6
package/docs/COMPARISON.md
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
# The Sesi Advantage:
|
|
1
|
+
# The Sesi Advantage: Removing Boilerplate
|
|
2
2
|
|
|
3
|
-
Integrating
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
|
@@ -330,5 +328,5 @@ Sesi isn't just syntactic sugar. By embedding the AI runtime directly into the p
|
|
|
330
328
|
- [Image Generation](IMAGE_GENERATION.md)
|
|
331
329
|
- [Built-in Functions](BUILTINS.md)
|
|
332
330
|
- [Architecture](ARCHITECTURE.md)
|
|
333
|
-
- [Reasoning Features](
|
|
334
|
-
- [
|
|
331
|
+
- [Reasoning Features](REASONING.md)
|
|
332
|
+
- [Concurrent Processes](CONCURRENCY.md)
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Concurrency with Sesi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This document details how Sesi handles process concurrency and file locks.
|
|
4
4
|
|
|
5
|
-
## The "Bank
|
|
5
|
+
## The "Bank" Case Study
|
|
6
6
|
|
|
7
|
-
In this experiment, Sesi was used to solve
|
|
7
|
+
In this experiment, Sesi was used to solve file contention.
|
|
8
8
|
|
|
9
9
|
### The Challenge
|
|
10
10
|
|
|
11
|
-
Five independent Sesi
|
|
11
|
+
Five independent Sesi instances (3 Deposits, 2 Withdrawals) were launched simultaneously. All instances needed to update a single `balance.txt` file without causing data loss through race conditions.
|
|
12
12
|
|
|
13
|
-
### The
|
|
13
|
+
### The Solution (Mutex / File Locking)
|
|
14
14
|
|
|
15
|
-
Sesi solves this using
|
|
15
|
+
Sesi solves this using file locking via `try/catch` and file I/O builtins.
|
|
16
16
|
|
|
17
17
|
#### 1. Unique Identity
|
|
18
18
|
|
|
19
|
-
Each
|
|
19
|
+
Each instance generates a unique ID using Sesi's native `time()` and `random()` builtins.
|
|
20
20
|
|
|
21
21
|
```sesi
|
|
22
22
|
let id = "Agent_" + str(time()) + "_" + str(random())
|
|
@@ -40,7 +40,7 @@ while locked {
|
|
|
40
40
|
|
|
41
41
|
#### 3. Critical Section Resilience
|
|
42
42
|
|
|
43
|
-
Using `try/catch`, Sesi
|
|
43
|
+
Using `try/catch`, Sesi scripts gracefully handle filesystem contention.
|
|
44
44
|
|
|
45
45
|
```sesi
|
|
46
46
|
try {
|
|
@@ -53,10 +53,10 @@ try {
|
|
|
53
53
|
|
|
54
54
|
## Concurrency via `spawn()`
|
|
55
55
|
|
|
56
|
-
Sesi v1.1 introduced the `spawn()` builtin, allowing a single **Master Orchestrator** to launch
|
|
56
|
+
Sesi v1.1 introduced the `spawn()` builtin, allowing a single **Master Orchestrator** to launch concurrent proccesses of sesi scripts from one main file.
|
|
57
57
|
|
|
58
58
|
```sesi
|
|
59
|
-
// Master: Launching 5
|
|
59
|
+
// Master: Launching 5 Concurrent Processes...
|
|
60
60
|
spawn("main/atm_deposit.sesi")
|
|
61
61
|
spawn("main/atm_withdraw.sesi")
|
|
62
62
|
spawn("main/atm_deposit.sesi")
|
package/docs/IMAGE_GENERATION.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# Image Generation in Sesi
|
|
2
2
|
|
|
3
|
-
Sesi provides a native, language-level primitive for
|
|
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") {
|
|
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") {
|
|
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") {
|
|
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
|
-
- `
|
|
73
|
-
- `
|
|
74
|
-
- `
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
|
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,9 +10,9 @@ 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**:
|
|
14
|
-
4. **Simplicity First**:
|
|
15
|
-
5. **Type Safety with Flexibility**: Static types for normal code, runtime checking for
|
|
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
|
|
|
@@ -21,63 +21,78 @@ Sesi/
|
|
|
21
21
|
├── SKILLS.md # Workspace context and repo guardrails
|
|
22
22
|
├── index.html # Sesi-generated systems landing page
|
|
23
23
|
├── eslint.config.mjs # ESLint configuration
|
|
24
|
-
├── example.js
|
|
25
|
-
├── example-ai.js
|
|
26
|
-
├──
|
|
27
|
-
├──
|
|
28
|
-
├──
|
|
29
|
-
├──
|
|
30
|
-
├──
|
|
24
|
+
├── example.js # Helper script to run basic examples
|
|
25
|
+
├── example-ai.js # Helper script to run reasoning examples
|
|
26
|
+
├── examples.sesi # Central execution suite for examples
|
|
27
|
+
├── README.md # Project overview
|
|
28
|
+
├── QUICKSTART.md # Getting started guide
|
|
29
|
+
├── package.json # Dependencies & scripts
|
|
30
|
+
├── tsconfig.json # TypeScript configuration
|
|
31
|
+
├── dist/ # Compiled TypeScript output
|
|
31
32
|
│
|
|
32
|
-
├── src/
|
|
33
|
-
│ ├── types.ts
|
|
34
|
-
│ ├── lexer.ts
|
|
35
|
-
│ ├── parser.ts
|
|
36
|
-
│ ├── interpreter.ts
|
|
37
|
-
│ ├── builtins.ts
|
|
38
|
-
│ ├── ai-runtime.ts
|
|
39
|
-
│ └── index.ts
|
|
33
|
+
├── src/ # Source code
|
|
34
|
+
│ ├── types.ts # Type definitions & AST nodes (400+ lines)
|
|
35
|
+
│ ├── lexer.ts # Tokenization (350+ lines)
|
|
36
|
+
│ ├── parser.ts # Recursive descent parser (700+ lines)
|
|
37
|
+
│ ├── interpreter.ts # Tree-walking interpreter (600+ lines)
|
|
38
|
+
│ ├── builtins.ts # Built-in functions (250+ lines)
|
|
39
|
+
│ ├── ai-runtime.ts # Integrated reasoning integration (120+ lines)
|
|
40
|
+
│ └── index.ts # Entry point (30+ lines)
|
|
40
41
|
│
|
|
41
42
|
├── bin/
|
|
42
|
-
│ └── sesi.js
|
|
43
|
+
│ └── sesi.js # CLI executable
|
|
43
44
|
│
|
|
44
|
-
├── main/
|
|
45
|
-
│ ├── playground.sesi
|
|
46
|
-
│ ├── start.sesi
|
|
47
|
-
│ ├── build_website.sesi
|
|
48
|
-
│ └── tests/
|
|
45
|
+
├── main/ # Playgrounds & debugging
|
|
46
|
+
│ ├── playground.sesi # Main playground script
|
|
47
|
+
│ ├── start.sesi # Beginner script
|
|
48
|
+
│ ├── build_website.sesi # Sesi-powered systems site generator
|
|
49
|
+
│ └── tests/ # Additional syntax validation scripts
|
|
49
50
|
│
|
|
50
51
|
├── docs/
|
|
51
|
-
│ ├── SPECIFICATION.md
|
|
52
|
-
│ ├── ARCHITECTURE.md
|
|
53
|
-
│ ├── BUILTINS.md
|
|
54
|
-
│ ├──
|
|
55
|
-
│ ├──
|
|
56
|
-
│ ├──
|
|
57
|
-
│
|
|
52
|
+
│ ├── SPECIFICATION.md # Complete language spec (600+ lines)
|
|
53
|
+
│ ├── ARCHITECTURE.md # Runtime & system design (400+ lines)
|
|
54
|
+
│ ├── BUILTINS.md # Built-in functions reference (450+ lines)
|
|
55
|
+
│ ├── COMPARISON.md # Language comparison showcase
|
|
56
|
+
│ ├── CONCURRENCY.md # Concurrency & coordination guide (>100 lines)
|
|
57
|
+
│ ├── IMAGE_GENERATION.md # Image generation guide (>100 lines)
|
|
58
|
+
│ ├── REASONING.md # Reasoning and simple logic guide (>500 lines)
|
|
59
|
+
│ ├── ROADMAP.md # V2-V4+ development plan (400+ lines)
|
|
60
|
+
│ └── sesi_ai_chronicles.md # AI project history & notes
|
|
58
61
|
│
|
|
59
62
|
├── examples/
|
|
60
|
-
│ ├── 01_hello.sesi
|
|
61
|
-
│ ├── 02_variables.sesi
|
|
62
|
-
│ ├── 03_functions.sesi
|
|
63
|
-
│ ├── 04_conditionals.sesi
|
|
64
|
-
│ ├── 05_loops.sesi
|
|
65
|
-
│ ├── 06_arrays_objects.sesi
|
|
66
|
-
│ ├── 07_prompts.sesi
|
|
67
|
-
│ ├── 08_model_call.sesi
|
|
68
|
-
│ ├── 09_structured_output.sesi
|
|
69
|
-
│ ├── 10_code_generation.sesi
|
|
70
|
-
│ ├── 11_memory_conversation.sesi
|
|
71
|
-
│ ├── 12_classification.sesi
|
|
72
|
-
│ ├── 13_data_pipeline.sesi
|
|
73
|
-
│ ├── 14_folder_explainer.sesi
|
|
74
|
-
│ ├── 15_image_generation.sesi
|
|
75
|
-
│ ├── 16_modules.sesi
|
|
76
|
-
│ ├── 17_http_client.sesi
|
|
77
|
-
│
|
|
63
|
+
│ ├── 01_hello.sesi # Hello World
|
|
64
|
+
│ ├── 02_variables.sesi # Variables & operations
|
|
65
|
+
│ ├── 03_functions.sesi # Functions with parameters
|
|
66
|
+
│ ├── 04_conditionals.sesi # If/else control flow
|
|
67
|
+
│ ├── 05_loops.sesi # While, for, for-in loops
|
|
68
|
+
│ ├── 06_arrays_objects.sesi # Collections
|
|
69
|
+
│ ├── 07_prompts.sesi # Reasoning blocks
|
|
70
|
+
│ ├── 08_model_call.sesi # Basic reasoning calls
|
|
71
|
+
│ ├── 09_structured_output.sesi # Type-safe reasoning responses
|
|
72
|
+
│ ├── 10_code_generation.sesi # Systems logic generation
|
|
73
|
+
│ ├── 11_memory_conversation.sesi # Multi-turn stateful reasoning
|
|
74
|
+
│ ├── 12_classification.sesi # Systems classification loop
|
|
75
|
+
│ ├── 13_data_pipeline.sesi # Complete systems pipeline
|
|
76
|
+
│ ├── 14_folder_explainer.sesi # Directory parsing & reasoning
|
|
77
|
+
│ ├── 15_image_generation.sesi # Image generation API test
|
|
78
|
+
│ ├── 16_modules.sesi # Modules & std library namespaces
|
|
79
|
+
│ ├── 17_http_client.sesi # Network GET/POST client
|
|
80
|
+
│ ├── 18_parallel_requests.sesi # Parallel requests concurrency
|
|
81
|
+
│ ├── 19_search_web.sesi # Web search integration
|
|
82
|
+
│ ├── 20_model_aliases.sesi # Custom model naming aliases
|
|
83
|
+
│ ├── 21_custom_tools.sesi # Custom runtime tool definitions
|
|
84
|
+
│ └── 22_reasoning_plus_custom_tools.sesi # Reasoning composed with custom tools
|
|
78
85
|
│
|
|
79
|
-
└── tests/
|
|
80
|
-
|
|
86
|
+
└── tests/ # Engine test suite
|
|
87
|
+
├── basic.test.ts # Core parsing & evaluation tests
|
|
88
|
+
├── cache.test.ts # Execution caching tests
|
|
89
|
+
├── http.test.ts # Web request builtins testing
|
|
90
|
+
├── module.test.ts # Imports & module loading tests
|
|
91
|
+
├── parallel.test.ts # Concurrent execution tests
|
|
92
|
+
├── security.test.ts # Sandbox & guardrail tests
|
|
93
|
+
├── test-gemini.ts # Base model integration test
|
|
94
|
+
├── test-gemini2.ts # Extended model integration test
|
|
95
|
+
└── workflow.test.ts # Complex sequence workflows tests
|
|
81
96
|
```
|
|
82
97
|
|
|
83
98
|
## 🔧 Technology Stack
|
|
@@ -161,7 +176,13 @@ prompt greeting {"Hello, " name "!"}
|
|
|
161
176
|
**Reasoning Calls**
|
|
162
177
|
|
|
163
178
|
```sesi
|
|
164
|
-
let response = model("gemini-3-flash-preview") {
|
|
179
|
+
let response = model("gemini-3-flash-preview") {temperature: 0.7, max_tokens: 1000} {"Your prompt here"}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Web Search Grounding**
|
|
183
|
+
|
|
184
|
+
```sesi
|
|
185
|
+
let response = model("gemini-3.1-flash-lite") {search, max_tokens: 1000} {"What is the weather in Tokyo?"}
|
|
165
186
|
```
|
|
166
187
|
|
|
167
188
|
**Structured Output**
|
|
@@ -173,13 +194,13 @@ let result = structured_output({field1: string, field2: number})(model("gemini-3
|
|
|
173
194
|
**Image Generation**
|
|
174
195
|
|
|
175
196
|
```sesi
|
|
176
|
-
let logo = image("gemini-3.1-flash-image-preview") {
|
|
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
|
|
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
|
|
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
|
|
|
@@ -217,7 +238,9 @@ print("Reasoning Response:", response)
|
|
|
217
238
|
- `read_file(path)` - Read file contents
|
|
218
239
|
- `write_file(path, content)` - Write file contents
|
|
219
240
|
- `write_image(path, content)` - Write base64 image data to file
|
|
241
|
+
- `from_json(path)` - Read a JSON file
|
|
220
242
|
- `list_dir(path)` - List directory contents
|
|
243
|
+
- `make_dir(path)` - Create a new directory
|
|
221
244
|
- `spawn(path)` - Launch concurrent background process
|
|
222
245
|
- `exec(command)` - Synchronous shell execution
|
|
223
246
|
- `time()` - Unix timestamp (ms)
|
|
@@ -227,6 +250,7 @@ print("Reasoning Response:", response)
|
|
|
227
250
|
|
|
228
251
|
- `type(value)` - Get type name
|
|
229
252
|
- `str(value)` - Convert to string
|
|
253
|
+
- `to_json(value)` - Convert to JSON string
|
|
230
254
|
- `num(value)` - Convert to number
|
|
231
255
|
- `bool(value)` - Convert to boolean
|
|
232
256
|
|
|
@@ -250,21 +274,46 @@ print("Reasoning Response:", response)
|
|
|
250
274
|
|
|
251
275
|
- `multi_req(fns)` - Concurrently execute multiple closures/functions
|
|
252
276
|
|
|
277
|
+
### Reasoning
|
|
278
|
+
|
|
279
|
+
- `workflow(steps, input)` - Run a multi-step reasoning workflow
|
|
280
|
+
- `set_alias(alias, model)` - Register a custom local name for a model
|
|
281
|
+
- `define_tool(name, fn, description)` - Register a custom tool
|
|
282
|
+
- `list_tools()` - List custom tool names
|
|
283
|
+
|
|
284
|
+
### Error Handling
|
|
285
|
+
|
|
286
|
+
- `error_type(type, message, data)` - Create a custom error object
|
|
287
|
+
- `raise_error(type_or_error, message, data)` - Throw an error
|
|
288
|
+
|
|
289
|
+
### Math
|
|
290
|
+
|
|
291
|
+
- `exp(x)` - Exponential function
|
|
292
|
+
|
|
253
293
|
## 📊 Implementation Statistics
|
|
254
294
|
|
|
255
295
|
| Metric | Value |
|
|
256
296
|
| ------------------- | ------ |
|
|
257
297
|
| Total lines of code | ~3,000 |
|
|
258
298
|
| Source files | 7 |
|
|
259
|
-
| Documentation pages |
|
|
260
|
-
| Example programs |
|
|
261
|
-
| Built-in functions |
|
|
299
|
+
| Documentation pages | 12 |
|
|
300
|
+
| Example programs | 22 |
|
|
301
|
+
| Built-in functions | 34 |
|
|
262
302
|
| Supported operators | 20+ |
|
|
263
303
|
| AST node types | 30+ |
|
|
264
304
|
| Token types | 50+ |
|
|
265
305
|
|
|
266
306
|
## 🚀 Getting Started
|
|
267
307
|
|
|
308
|
+
### Installation
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
cd Sesi
|
|
312
|
+
npm install
|
|
313
|
+
npm run build
|
|
314
|
+
npm install -g .
|
|
315
|
+
```
|
|
316
|
+
|
|
268
317
|
### Run Example
|
|
269
318
|
|
|
270
319
|
```bash
|
|
@@ -347,7 +396,7 @@ npm test
|
|
|
347
396
|
- Performance notes
|
|
348
397
|
- Standard library plans
|
|
349
398
|
|
|
350
|
-
✅ **
|
|
399
|
+
✅ **REASONING.md** (500+ lines)
|
|
351
400
|
|
|
352
401
|
- Systems reasoning overview
|
|
353
402
|
- Prompt blocks explained
|
|
@@ -390,6 +439,10 @@ npm test
|
|
|
390
439
|
| 16_modules.sesi | Imports/exports & std namespaces|
|
|
391
440
|
| 17_http_client.sesi | HTTP GET and POST operations |
|
|
392
441
|
| 18_parallel_requests.sesi | Parallel request concurrency |
|
|
442
|
+
| 19_search_web.sesi | Web search integration |
|
|
443
|
+
| 20_model_aliases.sesi | Custom model naming aliases |
|
|
444
|
+
| 21_custom_tools.sesi | Custom runtime tool definitions |
|
|
445
|
+
| 22_reasoning_plus_custom_tools.sesi | Compose reasoning & tools |
|
|
393
446
|
|
|
394
447
|
## ✨ Unique Features
|
|
395
448
|
|
|
@@ -440,7 +493,7 @@ npm test
|
|
|
440
493
|
|
|
441
494
|
**Example Coverage**
|
|
442
495
|
|
|
443
|
-
-
|
|
496
|
+
- 22 complete example programs
|
|
444
497
|
- Covers all major language features
|
|
445
498
|
- Demonstrates reasoning integration
|
|
446
499
|
- Real-world use cases
|
|
@@ -469,30 +522,34 @@ npm test
|
|
|
469
522
|
- **Cost**: Competitive pricing
|
|
470
523
|
- **Availability**: Easy to use via official SDK
|
|
471
524
|
|
|
472
|
-
### Why does v1
|
|
525
|
+
### Why does v1+ support a module system?
|
|
473
526
|
|
|
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.
|
|
527
|
+
- **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
528
|
|
|
476
|
-
### Why does v1
|
|
529
|
+
### Why does v1+ support parallel execution?
|
|
477
530
|
|
|
478
531
|
- **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
532
|
|
|
480
533
|
## 📖 Learning Path
|
|
481
534
|
|
|
482
535
|
1. **Start**: [QUICKSTART.md](QUICKSTART.md) - Get running in 5 minutes
|
|
483
|
-
2. **
|
|
484
|
-
3. **
|
|
485
|
-
4. **
|
|
486
|
-
5. **
|
|
487
|
-
6. **Advanced**: [
|
|
488
|
-
7. **
|
|
489
|
-
8. **
|
|
490
|
-
9. **
|
|
491
|
-
10. **
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
536
|
+
2. **Builtins**: [BUILTINS.md](docs/BUILTINS.md) - Built-in functions
|
|
537
|
+
3. **Basics**: examples/01-06 - Core language features
|
|
538
|
+
4. **Prompts**: examples/07 - Prompt blocks
|
|
539
|
+
5. **Reasoning**: examples/08-12 - Reasoning feature exploration
|
|
540
|
+
6. **Advanced**: [REASONING.md](docs/REASONING.md) - Patterns and best practices
|
|
541
|
+
7. **Systems**: examples/13-14 - Systems reasoning and data pipelines
|
|
542
|
+
8. **Modules**: examples/16 - Modules & std library namespaces
|
|
543
|
+
9. **Image Generation**: [IMAGE_GENERATION.md](docs/IMAGE_GENERATION.md) examples/15 - Generating images natively
|
|
544
|
+
10. **Concurrency**: examples/17-18 - Concurrency & coordination
|
|
545
|
+
11. **Web Search**: examples/19 - Web search integration
|
|
546
|
+
12. **Model Aliases**: examples/20 - Custom model naming aliases
|
|
547
|
+
13. **Custom Tools**: examples/21-22 - Custom runtime tool definitions and compose reasoning with custom tools
|
|
548
|
+
14. **Specification**: [SPECIFICATION.md](docs/SPECIFICATION.md) - Complete grammar
|
|
549
|
+
15. **Architecture**: [ARCHITECTURE.md](docs/ARCHITECTURE.md) - How it works
|
|
550
|
+
16. **Roadmap**: [ROADMAP.md](docs/ROADMAP.md) - Future vision
|
|
551
|
+
|
|
552
|
+
## 🤝 Contributing Path
|
|
496
553
|
|
|
497
554
|
1. Report bugs with minimal examples
|
|
498
555
|
2. Suggest language features via RFCs
|
|
@@ -509,7 +566,7 @@ When open source:
|
|
|
509
566
|
- ✅ API reference (450+ lines)
|
|
510
567
|
- ✅ Systems reasoning guide (500+ lines)
|
|
511
568
|
- ✅ Development roadmap (400+ lines)
|
|
512
|
-
- ✅
|
|
569
|
+
- ✅ 20+ example programs
|
|
513
570
|
- ✅ CLI executable
|
|
514
571
|
- ✅ Test suite
|
|
515
572
|
- ✅ Quick start guide
|
|
@@ -526,19 +583,19 @@ When open source:
|
|
|
526
583
|
|
|
527
584
|
## 🚀 Philosophy
|
|
528
585
|
|
|
529
|
-
> "Sesi demonstrates that
|
|
586
|
+
> "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
587
|
|
|
531
|
-
The language is designed to evolve. V1 provides a solid foundation. V2+ adds power. The architecture supports this gracefully without breaking existing programs.
|
|
588
|
+
The language is designed to evolve. V1+ provides a solid foundation. V2+ adds power. The architecture supports this gracefully without breaking existing programs.
|
|
532
589
|
|
|
533
590
|
---
|
|
534
591
|
|
|
535
|
-
**Status**:
|
|
536
|
-
**Ready for**:
|
|
592
|
+
**Status**: ⏳ Ongoing V1.3 implementation
|
|
593
|
+
**Ready for**: File manipulation and process orchestration
|
|
537
594
|
**Not ready for**: Massive-scale production (until v2.0 bytecode)
|
|
538
595
|
**Next milestone**: V2.0 (Async & advanced reasoning)
|
|
539
596
|
|
|
540
|
-
Sesi is an experiment in language design. Use it to learn, explore, and evolve what
|
|
597
|
+
Sesi is not just an experiment in language design. Use it to learn, explore, and evolve what the future of coding will become.
|
|
541
598
|
|
|
542
599
|
---
|
|
543
600
|
|
|
544
|
-
For more information, see
|
|
601
|
+
For more information, see the documentation in `docs/` and examples in `examples/`.
|