@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.
- package/.agents/rules/sesi-must-read.md +116 -0
- package/.agents/workflows/create-sesi-script.md +44 -0
- package/.agents/workflows/fix-sesi-script.md +14 -0
- package/.github/prompts/MakeInSesi.prompt.md +79 -0
- package/README.md +163 -51
- package/bin/sesi.js +196 -38
- package/chatbot/chatbot.html +488 -0
- package/{main → chatbot}/chatbot.sesi +1 -2
- package/chatbot/chatbot_server.py +105 -0
- package/chatbot/sesi_db_chatbot.sesi +278 -0
- package/dist/ai-runtime.js +2 -2
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +199 -5
- package/dist/builtins.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +90 -6
- package/dist/index.js.map +1 -1
- package/dist/interpreter.d.ts +21 -2
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +201 -92
- 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 +1 -0
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +21 -12
- package/dist/parser.js.map +1 -1
- package/dist/sesi.bundled.js +2526 -1487
- package/dist/types.d.ts +14 -2
- 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 +21 -13
- package/docs/BUILTINS.md +136 -19
- package/docs/CLI.md +200 -0
- package/docs/COMPARISON.md +16 -13
- package/docs/IMAGE_GENERATION.md +13 -14
- package/docs/IMPLEMENTATION_SUMMARY.md +174 -110
- package/docs/QUICKSTART.md +173 -39
- package/docs/README.md +202 -54
- package/docs/{SYSTEMS_REASONING.md → REASONING.md} +115 -120
- package/docs/ROADMAP.md +51 -47
- package/docs/SKILLS.md +73 -98
- package/docs/SPECIFICATION.md +59 -40
- package/examples/03_functions.sesi +30 -1
- package/examples/07_prompts.sesi +27 -3
- package/examples/08_model_call.sesi +6 -4
- package/examples/09_structured_output.sesi +19 -3
- package/examples/10_code_generation.sesi +6 -4
- package/examples/11_memory_conversation.sesi +47 -15
- package/examples/12_classification.sesi +62 -7
- package/examples/13_data_pipeline.sesi +55 -28
- package/examples/14_folder_explainer.sesi +52 -51
- package/examples/15_image_generation.sesi +15 -14
- package/examples/16_modules.sesi +27 -27
- package/examples/19_search_web.sesi +18 -2
- 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/tests/test-args.sesi +7 -0
- package/main/tests/test_args.sesi +7 -0
- package/main/tests/test_general_modules.sesi +127 -0
- package/main/tests/test_grounding.sesi +2 -0
- package/package.json +26 -22
- package/docs/DISTRIBUTED_SYSTEMS.md +0 -71
- package/docs/sesi_ai_chronicles.md +0 -209
- package/main/conversational_classifier_weights.json +0 -45
- package/main/conversational_sentences.json +0 -304
- package/main/epochs.sesi +0 -94
- package/main/gpu_orchestrator.sesi +0 -36
- package/main/hardware_diagnostics.sesi +0 -118
- package/main/inference.sesi +0 -54
- package/main/native_chatbot.sesi +0 -180
- package/main/native_synthesizer.sesi +0 -83
- package/main/nn_personas_trainer.sesi +0 -302
- package/main/nn_responses_trainer.sesi +0 -269
- package/main/nn_sentences_trainer.sesi +0 -330
- package/main/orchestrator.sesi +0 -15
- package/main/personas.json +0 -124
- package/main/personas_classifier_weights.json +0 -45
- package/main/playground.sesi +0 -3
- package/main/predictive_typing.sesi +0 -127
- package/main/query_brain.sesi +0 -45
- package/main/response_classifier_weights.json +0 -45
- package/main/retro_chat.html +0 -239
- package/main/retro_chat_generator.sesi +0 -745
- package/main/sesi_ai.sesi +0 -158
- package/main/sesi_db_chatbot.sesi +0 -280
- package/main/setup_swarm.sesi +0 -5
- package/main/start.sesi +0 -13
- package/main/terminal.log +0 -56
- package/main/terminal_chat.py +0 -385
- package/main/unified_sesi_ai.sesi +0 -334
- package/main/varied_responses.json +0 -304
package/docs/ROADMAP.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Sesi
|
|
1
|
+
# Sesi Programming Language Roadmap
|
|
2
2
|
|
|
3
3
|
## Version 1.0 - Foundation (Complete)
|
|
4
4
|
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
- [x] Lexer and parser
|
|
43
43
|
- [x] Tree-walking interpreter
|
|
44
44
|
- [x] CLI executable (sesi)
|
|
45
|
-
- [x] Examples (
|
|
45
|
+
- [x] Examples (22 programs)
|
|
46
46
|
- [x] Documentation
|
|
47
47
|
|
|
48
48
|
### Limitations
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
|
|
57
57
|
---
|
|
58
58
|
|
|
59
|
-
## Version 1.
|
|
59
|
+
## Version 1.3 - Stability & Systems Logic (In Progress)
|
|
60
60
|
|
|
61
|
-
**Status**: In Progress V1.
|
|
62
|
-
**Ready for**:
|
|
61
|
+
**Status**: In Progress V1.3 implementation
|
|
62
|
+
**Ready for**: File manipulation and process orchestration
|
|
63
63
|
**Not ready for**: Massive-scale production (until v2.0 bytecode)
|
|
64
64
|
**Next milestone**: V2.0 (Async & advanced reasoning)
|
|
65
65
|
|
|
@@ -74,20 +74,20 @@
|
|
|
74
74
|
- [x] Simple error recovery (Parser synchronization)
|
|
75
75
|
- [x] Implicit statement termination for blocks ending in `}`
|
|
76
76
|
- [x] Temporal Context Injection for reasoning calls
|
|
77
|
-
- [x]
|
|
77
|
+
- [x] Concurrency capabilities (File-based lock pattern)
|
|
78
78
|
- [x] API reference (`BUILTINS.md`)
|
|
79
79
|
- [x] Tutorial: Getting started (`QUICKSTART.md`)
|
|
80
|
-
- [x] Cookbook: Common patterns (`
|
|
80
|
+
- [x] Cookbook: Common patterns (`PROCESS_EXECUTION.md`)
|
|
81
81
|
|
|
82
82
|
### Deferred to V2.0 ⏳
|
|
83
83
|
|
|
84
|
-
- [
|
|
84
|
+
- [x] Better error messages with line numbers and stack traces
|
|
85
85
|
- [ ] REPL (Read-Eval-Print Loop)
|
|
86
|
-
- [
|
|
86
|
+
- [x] String escape sequences & Multiline strings
|
|
87
87
|
- [ ] Comments preservation (for docs)
|
|
88
88
|
- [ ] Type hints in function signatures
|
|
89
89
|
- [ ] Performance optimizations
|
|
90
|
-
- [ ] Tutorial: Writing
|
|
90
|
+
- [ ] Tutorial: Writing scripts
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
@@ -105,10 +105,10 @@
|
|
|
105
105
|
### Advanced Reasoning Features
|
|
106
106
|
|
|
107
107
|
- [ ] Streaming responses
|
|
108
|
-
- [x] Extended thinking
|
|
109
|
-
- [
|
|
108
|
+
- [x] Extended thinking
|
|
109
|
+
- [x] Multi-step workflows
|
|
110
110
|
- [ ] Tool composition and piping
|
|
111
|
-
- [
|
|
111
|
+
- [x] Custom tool definitions
|
|
112
112
|
- [ ] Function calling with automatic orchestration
|
|
113
113
|
- [x] Web search grounding
|
|
114
114
|
|
|
@@ -122,8 +122,8 @@
|
|
|
122
122
|
|
|
123
123
|
### Error Handling
|
|
124
124
|
|
|
125
|
-
- [
|
|
126
|
-
- [
|
|
125
|
+
- [x] finally blocks (try/catch completed in V1)
|
|
126
|
+
- [x] Custom error types
|
|
127
127
|
- [ ] Error recovery strategies
|
|
128
128
|
- [ ] Retry logic with exponential backoff
|
|
129
129
|
- [ ] Timeout handling
|
|
@@ -169,16 +169,16 @@
|
|
|
169
169
|
|
|
170
170
|
---
|
|
171
171
|
|
|
172
|
-
## Version 3.0 -
|
|
172
|
+
## Version 3.0 - Robust Logic Frameworks (2027)
|
|
173
173
|
|
|
174
|
-
**Focus**:
|
|
174
|
+
**Focus**: Complete language tooling
|
|
175
175
|
|
|
176
|
-
###
|
|
176
|
+
### Technical Frameworks
|
|
177
177
|
|
|
178
|
-
- [ ]
|
|
178
|
+
- [ ] Advanced scripting definition models
|
|
179
179
|
- [ ] Logic composition and chaining
|
|
180
|
-
- [ ]
|
|
181
|
-
- [ ] Communication
|
|
180
|
+
- [ ] Extended process collaboration
|
|
181
|
+
- [ ] Communication protocols
|
|
182
182
|
- [ ] Persistence layer
|
|
183
183
|
|
|
184
184
|
### Knowledge Base
|
|
@@ -191,11 +191,11 @@
|
|
|
191
191
|
|
|
192
192
|
### Advanced Patterns
|
|
193
193
|
|
|
194
|
-
- [ ]
|
|
195
|
-
- [ ]
|
|
196
|
-
- [ ]
|
|
197
|
-
- [ ]
|
|
198
|
-
- [ ] Human-in-the-loop
|
|
194
|
+
- [ ] Sub-process execution workflows
|
|
195
|
+
- [ ] Modular scripting decomposition
|
|
196
|
+
- [ ] Retry safety check loops
|
|
197
|
+
- [ ] Deep AST reflection
|
|
198
|
+
- [ ] Human-in-the-loop prompts
|
|
199
199
|
|
|
200
200
|
### Ecosystem
|
|
201
201
|
|
|
@@ -207,8 +207,8 @@
|
|
|
207
207
|
|
|
208
208
|
### Examples
|
|
209
209
|
|
|
210
|
-
- [ ]
|
|
211
|
-
- [ ]
|
|
210
|
+
- [ ] Automated code formatting process
|
|
211
|
+
- [ ] Command line utility expansion
|
|
212
212
|
- [ ] Code generation and testing
|
|
213
213
|
- [ ] Data analysis pipeline
|
|
214
214
|
- [ ] Multi-process reasoning debate
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
| Error handling | 🔴 High | ✅ | ⏳ | | |
|
|
261
261
|
| Async/await | 🔴 High | | ⏳ | | |
|
|
262
262
|
| Streaming | 🟡 Medium | | ⏳ | | |
|
|
263
|
-
|
|
|
263
|
+
| Process Logic | 🟡 Medium | | | ⏳ | |
|
|
264
264
|
| Knowledge base | 🟡 Medium | | | ⏳ | |
|
|
265
265
|
| Module system | 🟡 Medium | | ⏳ | | |
|
|
266
266
|
| Debugger | 🟢 Low | | ⏳ | | |
|
|
@@ -273,16 +273,16 @@
|
|
|
273
273
|
|
|
274
274
|
```
|
|
275
275
|
2026 Q2
|
|
276
|
-
└─ v1.
|
|
276
|
+
└─ v1.3 - Polish & stabilize
|
|
277
277
|
|
|
278
278
|
2026 Q3-Q4
|
|
279
|
-
└─ v2.0 -
|
|
279
|
+
└─ v2.0 - Async & advanced APIs
|
|
280
280
|
|
|
281
281
|
2027 Q1-Q2
|
|
282
|
-
└─ v3.0 -
|
|
282
|
+
└─ v3.0 - Language Ecosystem
|
|
283
283
|
|
|
284
284
|
2027 Q3+
|
|
285
|
-
└─ v4.0+ - Mature
|
|
285
|
+
└─ v4.0+ - Mature compilation
|
|
286
286
|
```
|
|
287
287
|
|
|
288
288
|
---
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
| Startup time | <100ms | <100ms | <50ms |
|
|
353
353
|
| Simple expression eval | <1µs | <100ns | <10ns |
|
|
354
354
|
| Function call overhead | <10µs | <1µs | <100ns |
|
|
355
|
-
| Reasoning
|
|
355
|
+
| Reasoning latency | 2-5s (API) | 2-5s | 2-5s |
|
|
356
356
|
| Memory usage | <50MB | <50MB | <100MB |
|
|
357
357
|
|
|
358
358
|
---
|
|
@@ -367,12 +367,11 @@
|
|
|
367
367
|
- **Go**: Clear error handling
|
|
368
368
|
- **Rust**: Type safety, memory safety
|
|
369
369
|
|
|
370
|
-
###
|
|
370
|
+
### Code Control
|
|
371
371
|
|
|
372
|
-
- **
|
|
373
|
-
- **
|
|
374
|
-
- **
|
|
375
|
-
- **LLM frameworks**: Best practices
|
|
372
|
+
- **CLI utilities**: Direct data piping
|
|
373
|
+
- **Shell scripting**: Execution transparency
|
|
374
|
+
- **Modern SDKs**: Model abstraction
|
|
376
375
|
|
|
377
376
|
### Community
|
|
378
377
|
|
|
@@ -387,9 +386,9 @@
|
|
|
387
386
|
Sesi is designed to evolve with reasoning needs. The roadmap balances:
|
|
388
387
|
|
|
389
388
|
- **Simplicity** (v1: core features only)
|
|
390
|
-
- **Power** (v2: advanced reasoning
|
|
391
|
-
- **
|
|
392
|
-
- **Scale** (v4+: production readiness)
|
|
389
|
+
- **Power** (v2: advanced reasoning and extended functionality)
|
|
390
|
+
- **Maturity** (v3: comprehensive libraries and frameworks)
|
|
391
|
+
- **Scale** (v4+: production readiness and compilation)
|
|
393
392
|
|
|
394
393
|
The journey from v1 (interpreter) to v4+ (distributed compiler) maintains backward compatibility while adding power where needed.
|
|
395
394
|
|
|
@@ -399,10 +398,15 @@ The journey from v1 (interpreter) to v4+ (distributed compiler) maintains backwa
|
|
|
399
398
|
|
|
400
399
|
## See Also
|
|
401
400
|
|
|
402
|
-
- [
|
|
403
|
-
- [
|
|
404
|
-
- [
|
|
405
|
-
- [
|
|
406
|
-
- [
|
|
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)
|
|
407
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)
|
|
408
412
|
- [Examples](../examples)
|
package/docs/SKILLS.md
CHANGED
|
@@ -1,8 +1,50 @@
|
|
|
1
1
|
# The Sesi Programming Language
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Core Identity & Execution
|
|
4
|
+
|
|
5
|
+
- **File Extension:** `.sesi`
|
|
6
|
+
- `src/`: The core TypeScript engine (Lexer, Parser, Interpreter, AI-Runtime, Builtins).
|
|
7
|
+
- `bin/sesi.js`: The global CLI executable entry point.
|
|
8
|
+
- `examples/`: Official syntax-demonstration scripts (`01_hello.sesi` through `13_data_pipeline.sesi`).
|
|
9
|
+
- `chatbot/`: Local Sesi support and `sesi_db_chatbot.sesi` - Sesi's built-in Co-Pilot.
|
|
10
|
+
- `main/`: `tests/` like `test_failure_debug.sesi`. **Run inline code evaluations (`-e 'code'`) instead of writing new `.sesi` files for quick tests. Do not overwrite existing `.sesi` files unless explicitly asked to.**
|
|
11
|
+
- `docs/`: The source of truth for all sesi syntax, formatting, and structuring guidelines. It contains the official API docs for all built-in functions and types. AIs must treat this as the primary source of truth for syntax and structure.
|
|
12
|
+
- Root helper scripts: `example.js`, `example-ai.js`, and `examples.sesi` are convenience wrappers. AI agents should still use the `npx sesi` command as specified.
|
|
13
|
+
- **Paradigm:** **Sesi** is a clean, minimal, and highly legible programming language. Built from the ground up to be concise and buildable, Sesi removes unnecessary boilerplate. The language itself is so simple. It is a language built for clarity and reusability.
|
|
14
|
+
|
|
15
|
+
## Agent Debug Protocol (MANDATORY)
|
|
16
|
+
|
|
17
|
+
When AI agents write or edit `.sesi` scripts, they must use this debugging loop:
|
|
18
|
+
|
|
19
|
+
1. **Draft in file, isolate risky snippet:** Identify the smallest parser/runtime-risky block (prompt block, model call, object schema, loop, etc.).
|
|
20
|
+
2. **Validate snippet with eval mode first:** Run `npm run sesi:eval <file>.sesi` to test the isolated block before full-script execution.
|
|
21
|
+
3. **Apply fix in file only after eval passes:** If eval fails, iterate on snippet; do not repeatedly run full scripts while syntax is unresolved.
|
|
22
|
+
4. **Run full script after snippet stabilization:** Execute `npm run sesi <file>.sesi` only once the isolated logic is valid.
|
|
23
|
+
5. **Use file-aware help when blocked:** Run `npm run sesi:help <file>.sesi "<question>"` to get context-grounded help tied to the active script.
|
|
24
|
+
6. **NEVER EDIT ANY .SESI FILES IN THE TERMINAL (ABSOLUTE RULE):**
|
|
25
|
+
- Do NOT run `sed`, `awk`, `perl`, or any other shell text-processing tools on `.sesi` files.
|
|
26
|
+
- Do NOT use `npm run sesi:eval` to modify files; it is only for syntax validation.
|
|
27
|
+
- Do NOT use Bash/Shell scripting to rewrite or patch Sesi source code.
|
|
28
|
+
|
|
29
|
+
**Correct approach:** You MUST always use your native editor/IDE's file editing capabilities to make clean, safe changes directly to `.sesi` files.
|
|
30
|
+
**Why:** Sesi syntax is sensitive to whitespace, newlines, and brace positioning. Terminal-based string replacement will invariably break code. Use the editor, not the terminal.
|
|
31
|
+
|
|
32
|
+
7. **Emphasize Native Verification Commands:** Prior to saving or running full Sesi scripts, proactively use inline evaluation (`npm run sesi:eval <file>.sesi` or `node bin/sesi.js -e "..."`) to check and verify syntax and runtime behaviors instantly. It keeps execution cycles fast and deterministic.
|
|
33
|
+
|
|
34
|
+
## Standards (ONLY REGARDING src/ FILES)
|
|
35
|
+
|
|
36
|
+
- **Type-Only Imports (MANDATORY):** Use `import {type ...}` for AST nodes. **DO NOT REMOVE** these. Removing them will break the build.
|
|
37
|
+
- **Interpreter Patterns (DO NOT "CLEAN UP"):** Dynamic casting and `any` are **EXPLICITLY PERMITTED** for tree-walking logic. They are a foundational part of the Sesi engine's design.
|
|
38
|
+
- **Ignore Linting Noise:** If you see warnings like "Unexpected any" or "Unsafe member access", **IGNORE THEM**.
|
|
39
|
+
- **Build Requirement:** You MUST run `npm run build` after every code change to the backend logic. Failure to build will result in testing stale code.
|
|
40
|
+
|
|
41
|
+
This protocol is required to reduce noisy full-run failures and speed up AI-assisted iteration.
|
|
4
42
|
|
|
5
43
|
Sesi is **NOT** the following coding languages, therefore **NEVER UTILIZE THE SAME SYNTAX OR FORMATTING UNDER ANY CIRCUMSTANCES WHATSOEVER!!!!!**
|
|
44
|
+
|
|
45
|
+
- **NOT** An "AI Wrapper"
|
|
46
|
+
- **NOT** A "LLM Framework"
|
|
47
|
+
- **NOT** An "AI-Native Programming Language"
|
|
6
48
|
- **NOT** Python
|
|
7
49
|
- **NOT** Rust
|
|
8
50
|
- **NOT** Typescript
|
|
@@ -13,7 +55,6 @@ Sesi is **NOT** the following coding languages, therefore **NEVER UTILIZE THE SA
|
|
|
13
55
|
- **NOT** C
|
|
14
56
|
- **NOT** Java
|
|
15
57
|
- **NOT** C#
|
|
16
|
-
- **NOT** Java
|
|
17
58
|
- **NOT** Javascript
|
|
18
59
|
- **NOT** Bash
|
|
19
60
|
- **NOT** Shell
|
|
@@ -22,112 +63,46 @@ Sesi is **NOT** the following coding languages, therefore **NEVER UTILIZE THE SA
|
|
|
22
63
|
- **NOT** Swift
|
|
23
64
|
- **NOT** Julia
|
|
24
65
|
- **NOT** Scala
|
|
66
|
+
- **NOT** Any other programming language or scripting language.
|
|
25
67
|
|
|
26
|
-
|
|
27
|
-
Under no circumstances should an AI agent treat `.sesi` files as anomalies, unknown text formats, or mistakes.
|
|
28
|
-
|
|
29
|
-
## 🌟 THE DYNAMIC PIPELINE PHILOSOPHY (MANDATORY AGENT THINKING)
|
|
30
|
-
|
|
31
|
-
When a user requests a content-rich asset or application (e.g. "make a website", "make a visualization", "...uses an api...", "come up with/make/write a script...", etc.), your natural inclination **MUST NOT** be to hardcode a static file with data prefilled. Instead, always design a **Dynamic Sesi Pipeline**:
|
|
32
|
-
1. **Never Hardcode Data Into the View**: Isolate raw content, biographies, statistics, etc. into a structured database layer (e.g., `data.json`) using native typed Sesi outputs.
|
|
33
|
-
2. **Build Sesi Compiler/Builder Scripts**: Write a `.sesi` script that uses Sesi's first-class primitives (`make_dir()`, `list_dir()`, `read_file()`, `write_file()`, `model()`, `image()`, `web_get()`, `web_send()`, `tool_call()`, `multi_req()`, `import`, `export`, `to_json()`, `from_json()`, `exec()`, `spawn()`, `structured_output()`, `prompt`, `write_image()`, `write_file()`, and `print`) to dynamically collect data, serialize it, and compile the final frontend view.
|
|
34
|
-
3. **Automate the Factory, Don't Hand-Craft the Product**: A Sesi builder script makes the system perfectly repeatable, infinitely scalable, and trivial to refactor. In this repository, the Sesi script is the core product; the compiled file is merely the byproduct for post edits and making sure our scripts are beh
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
**This is a non-negotiable quality bar.** Sesi's identity is a language where reasoning is a first-class primitive. Every script you write should reflect that.
|
|
68
|
+
### ✅ REQUIRED — Sesi scripts must use the language's built-ins:
|
|
38
69
|
|
|
39
|
-
### ❌ FORBIDDEN — Never generate these as Sesi examples or demos:
|
|
40
|
-
- Math solvers, calculators, arithmetic pipelines
|
|
41
|
-
- Prime number finders, Fibonacci sequences, sorting algorithms
|
|
42
|
-
- Unit converters, currency converters, grade calculators
|
|
43
|
-
- Budget trackers, invoice generators, tax tools
|
|
44
|
-
- Generic "Hello World" clones with no AI interaction
|
|
45
|
-
- Compliance checkers, OSHA reports, logistics routers
|
|
46
|
-
- Any script whose core loop is just arithmetic with a `print` at the end
|
|
47
|
-
- **AI cybernetic, futuristic, sci-fi, or deep-space themes** (e.g., holographic star-charts, cyber-gardens, spatial telemetry, spacecraft command interfaces, alien translators).
|
|
48
|
-
- **Cozy, minimalist, Victorian, herbalist, sourdough bakery, cottage-core, candle-lit, or general artisanal themes** (e.g., village herbalist teabags, sourdough yeast logs, candlelit journals, mahogany apothecary drawers, victorian scroll philologists). These are overdone, precious, and clichéd.
|
|
49
|
-
|
|
50
|
-
These are lazy defaults. They don't demonstrate what makes Sesi unique.
|
|
51
|
-
|
|
52
|
-
### ✅ REQUIRED — Sesi scripts must showcase the language's actual superpowers:
|
|
53
70
|
Every script you write must use **at least one** of:
|
|
54
|
-
- `model()` — reasoning, analysis, generation, conversation
|
|
55
|
-
- `image()` — visual generation, art, diagrams
|
|
56
|
-
- `structured_output()` — typed AI responses, schema extraction
|
|
57
|
-
- `memory` — stateful multi-turn context
|
|
58
|
-
- `spawn()` / `exec()` — concurrent process orchestration
|
|
59
|
-
|
|
60
|
-
#### 🏷️ Lexicon & Vocabulary Guardrails (MANDATORY)
|
|
61
|
-
**Completely ban both sci-fi tech-jargon/themes AND cottage-core words/themes.**
|
|
62
|
-
- **FORBIDDEN TECH/SCI-FI WORDS:** *"cybernetic," "telemetry," "synapses," "latent space," "nodes," "diodes," "quantum," "activation coordinates," "calibration," "hyper-speed," "data pipelines," "neural matrices."*
|
|
63
|
-
- **FORBIDDEN COTTAGE-CORE WORDS:** *"apothecary," "herbs," "infusion," "yeast," "sourdough," "hearth," "candlelit," "flour," "boulangerie," "tea," "potion," "cozy," "victorian," "parchment," "scroll," "philologist."*
|
|
64
|
-
- **FORBIDDEN ANALOG/WORKSHOP WORDS:** *"mixing console," "tape reel," "splice," "fader," "VU meter," "compressor," "track sheet," "carburetor," "spark plug," "manifold," "tachometer," "cogs," "gears," "escapement," "celluloid," "projector," "blueprint," "drafting board," "logbook," "workshop."*
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
72
|
+
- `prompt` - composable script templates, this is NOT related to AI at all
|
|
73
|
+
- `structured_output` - structured data extraction, this is NOT related to AI at all
|
|
74
|
+
- `memory` — stateful multi-turn context, this is NOT related to AI at all
|
|
75
|
+
- `exec()` — concurrent process orchestration
|
|
76
|
+
- `web_send()` - sending an HTTP request to a URL
|
|
77
|
+
- `web_get()` - collecting data from a URL
|
|
78
|
+
- `define_tool()` - categorizing tool calls
|
|
79
|
+
- `list_tools()` - displaying custom tools
|
|
80
|
+
- `tool_call()` - calling a predefined function, this is NOT related to AI at all
|
|
81
|
+
- `multi_req()` - concurrent function execution
|
|
82
|
+
- `import` / `export` - reusable configuration modules
|
|
71
83
|
|
|
72
|
-
The bar is: **"
|
|
73
|
-
|
|
74
|
-
## 1. Core Identity & Execution
|
|
75
|
-
|
|
76
|
-
- **File Extension:** `.sesi`
|
|
77
|
-
- **Execution:** Sesi programs are executed using `node bin/sesi.js`. (e.g., `node bin/sesi.js main/start.sesi`). DO NOT USE `sesi` CLI command. Only the developer has access to it. It will return a false positive error. Trust only `node bin/sesi.js`. ALWAYS TEST YOUR `.sesi` FILES WITH THIS COMMAND.
|
|
78
|
-
- **Paradigm:** **Sesi** is a high-performance **Systems Language** designed for building resilient, stateful applications. It uses a tree-walking interpreter model via Typescript with asynchronous host-side model execution, but no language-level `async/await` syntax in v1.2. The architecture is optimized for coordination, distributed state management, and first-class reasoning primitives.
|
|
79
|
-
|
|
80
|
-
## 2. Workspace Topography (DO NOT ALTER)
|
|
81
|
-
|
|
82
|
-
- `src/`: The core TypeScript engine (Lexer, Parser, Interpreter, AI-Runtime, Builtins).
|
|
83
|
-
- `bin/sesi.js`: The global CLI executable entry point.
|
|
84
|
-
- `examples/`: Official syntax-demonstration scripts (`01_hello.sesi` through `13_data_pipeline.sesi`).
|
|
85
|
-
- `main/`: The user's active development space (contains `playground.sesi` playground, `start.sesi` beginner script options, `build_website.sesi` baseplate website builder, and `tests/` like `test_failure_debug.sesi`). **These are valid, expected files.**
|
|
86
|
-
- `docs/`: The source of truth for Architecture, AI Features (Systems Reasoning ), Builtins, Specifications, and more.
|
|
87
|
-
- Root helper scripts: `example.js` and `example-ai.js` are convenience wrappers. AI agents should still use the global `sesi` command as specified.
|
|
84
|
+
The bar is: **"Is this easy to write and read?"** If the answer is no, rewrite it.
|
|
88
85
|
|
|
89
|
-
##
|
|
86
|
+
## Mandatory Syntax Rules & Quirks
|
|
90
87
|
|
|
91
|
-
- **Block Termination:** Closing braces `}` for blocks (if, while, try, model) no longer strictly require a following newline or semicolon. Condensed one-liners like `while x {x = x + 1}` are
|
|
92
|
-
- **Prompts & Prints:** Inside `prompt` blocks, anonymous model blocks, and `print` statements, literal strings and variables are placed sequentially (e.g., `print "User:" name`).
|
|
88
|
+
- **Block Termination:** Closing braces `}` for blocks (if, while, try, model) no longer strictly require a following newline or semicolon. Condensed one-liners like `while x {x = x + 1}` are valid.
|
|
89
|
+
- **Prompts & Prints:** Inside `prompt` blocks, anonymous model blocks, and `print` statements, literal strings and variables are placed sequentially naturally (e.g., `print "User:" name`). It's highly preferred to **AVOID** use of the `+` operator in these contexts, regardless of its backwards-compatibility.
|
|
93
90
|
- **Structured Output Schemas:** Keys in schemas MUST be unquoted identifiers (e.g., `{key: string}` instead of `{"key": string}`). This is a known deviation from standard JSON objects in the Sesi parser.
|
|
94
91
|
- **Object Literals:** Conversely, standard object literals `{}` DO require strictly quoted string keys (e.g., `{"name": "Alice"}`).
|
|
95
|
-
- **
|
|
96
|
-
- **
|
|
97
|
-
- **Systems Primitive:** Forbid `const` (use `let`), `main()` wrappers, and `return` statements. Focus on side-effects and top-level execution.
|
|
98
|
-
|
|
99
|
-
## 4. AI Behavioral Guidelines Working in this Repo
|
|
100
|
-
|
|
101
|
-
1. **Never** "investigate" user testing directories (like `main/tests/`) as "deviations." They are active playgrounds.
|
|
102
|
-
2. **Never** attempt to execute file modifications via shell/terminal text replacements. Use native file editing tools ONLY.
|
|
103
|
-
3. **Always** check the `.md files` and `examples/` folder for the exact language specification before making assumptions about how Sesi works.
|
|
104
|
-
4. If a file tree is mentioned in documentation, it represents an explicit layout constraint and must map 1:1 **UNLESS .gitignored FILES STATE OTHERWISE.**
|
|
105
|
-
|
|
106
|
-
## 5. Development & TypeScript Standards (COMMANDS FOR AI AGENTS)
|
|
107
|
-
|
|
108
|
-
- **Type-Only Imports (MANDATORY):** Use `import { type ... }` for AST nodes. **DO NOT REMOVE** these. Removing them will break the build.
|
|
109
|
-
- **Interpreter Patterns (DO NOT "CLEAN UP"):** Dynamic casting and `any` are **EXPLICITLY PERMITTED** for tree-walking logic. They are a foundational part of the Sesi engine's design.
|
|
110
|
-
- **Ignore Linting Noise:** If you see warnings like "Unexpected any" or "Unsafe member access", **IGNORE THEM**.
|
|
111
|
-
- **Build Requirement:** You MUST run `npm run build` after every code change to the backend logic. Failure to build will result in testing stale code.
|
|
112
|
-
|
|
113
|
-
## 6. Concurrency & Orchestration Patterns
|
|
114
|
-
|
|
115
|
-
- **Process Spawning:** Use `spawn(path)` or `exec(command)` to launch background Sesi processes.
|
|
116
|
-
- **Distributed Locking:** When agents share files, use the **Double-Check Write** pattern:
|
|
117
|
-
1. Generate unique ID: `str(time()) + "_" + str(random())`
|
|
118
|
-
2. Write ID to lock file if "unlocked".
|
|
119
|
-
3. Wait micro-delay (empty `while` loop).
|
|
120
|
-
4. Verify ID is still in lock file before entering critical section.
|
|
92
|
+
- **JSON Serialization:** Use `to_json(object)` for valid JSON output. Avoid `stringify(object)` for JSON.
|
|
93
|
+
- **Systems Primitive:** Forbid `const` (use `let`), `main()` wrappers, and `return` statements (however, `return` is neccessary inside of a `fn` block). Focus on side-effects and top-level execution.
|
|
121
94
|
- **Resilience:** Always wrap file I/O in `try/catch` retry loops to handle filesystem contention.
|
|
122
95
|
|
|
96
|
+
For all quirks and specific syntaxing, visit IMPLEMENTATION_SUMMARY.md, /docs/SPECIFICATION.md, /docs/BUILTINS.md, and /docs/CLI.
|
|
123
97
|
|
|
124
|
-
##
|
|
125
|
-
|
|
126
|
-
When implementing offline deep learning, probabilistic dialogue routing, or native classification models in Sesi:
|
|
98
|
+
## IGNORE THESE FILES
|
|
127
99
|
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
-
|
|
100
|
+
- `docs/agent_native_programming.md`
|
|
101
|
+
- `docs/REASONING.md`
|
|
102
|
+
- `docs/IMAGE_GENERATION.md`
|
|
103
|
+
- `*.txt`
|
|
104
|
+
- `*.log`
|
|
105
|
+
- `query.txt`
|
|
106
|
+
- `.sesi_cache.json`
|
|
107
|
+
- `.sesi_chat_history.json`
|
|
108
|
+
- `/landing-pages/`
|