@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/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TokenType = 'NUMBER' | 'STRING' | 'IDENTIFIER' | 'LET' | 'CONST' | 'FN' | 'IF' | 'ELSE' | 'WHILE' | 'FOR' | 'IN' | 'RETURN' | 'BREAK' | 'CONTINUE' | 'TRY' | 'CATCH' | 'TRUE' | 'FALSE' | 'NULL' | 'PRINT' | 'PROMPT' | 'MODEL' | 'IMAGE' | 'STRUCTURED_OUTPUT' | 'TOOL_CALL' | 'MEMORY' | 'IMPORT' | 'FROM' | 'EXPORT' | 'TO' | 'PLUS' | 'MINUS' | 'STAR' | 'SLASH' | 'PERCENT' | 'EQUAL' | 'EQUAL_EQUAL' | 'BANG' | 'BANG_EQUAL' | 'LESS' | 'LESS_EQUAL' | 'GREATER' | 'GREATER_EQUAL' | 'AMPERSAND_AMPERSAND' | 'PIPE_PIPE' | 'PIPE' | 'DOT' | 'COMMA' | 'SEMICOLON' | 'COLON' | 'ARROW' | 'QUESTION' | 'LEFT_PAREN' | 'RIGHT_PAREN' | 'LEFT_BRACE' | 'RIGHT_BRACE' | 'LEFT_BRACKET' | 'RIGHT_BRACKET' | 'LESS_GREATER' | 'EOF' | 'NEWLINE';
|
|
1
|
+
export type TokenType = 'NUMBER' | 'STRING' | 'IDENTIFIER' | 'LET' | 'CONST' | 'FN' | 'IF' | 'ELSE' | 'WHILE' | 'FOR' | 'IN' | 'RETURN' | 'BREAK' | 'CONTINUE' | 'TRY' | 'CATCH' | 'FINALLY' | 'TRUE' | 'FALSE' | 'NULL' | 'PRINT' | 'PROMPT' | 'MODEL' | 'IMAGE' | 'STRUCTURED_OUTPUT' | 'TOOL_CALL' | 'MEMORY' | 'IMPORT' | 'FROM' | 'EXPORT' | 'TO' | 'PLUS' | 'MINUS' | 'STAR' | 'SLASH' | 'PERCENT' | 'EQUAL' | 'EQUAL_EQUAL' | 'BANG' | 'BANG_EQUAL' | 'LESS' | 'LESS_EQUAL' | 'GREATER' | 'GREATER_EQUAL' | 'AMPERSAND_AMPERSAND' | 'PIPE_PIPE' | 'PIPE' | 'DOT' | 'COMMA' | 'SEMICOLON' | 'COLON' | 'ARROW' | 'QUESTION' | 'LEFT_PAREN' | 'RIGHT_PAREN' | 'LEFT_BRACE' | 'RIGHT_BRACE' | 'LEFT_BRACKET' | 'RIGHT_BRACKET' | 'LESS_GREATER' | 'EOF' | 'NEWLINE';
|
|
2
2
|
export interface Token {
|
|
3
3
|
type: TokenType;
|
|
4
4
|
lexeme: string;
|
|
@@ -89,6 +89,7 @@ export interface TryStatement {
|
|
|
89
89
|
tryBlock: BlockStatement;
|
|
90
90
|
catchParameter: string;
|
|
91
91
|
catchBlock: BlockStatement;
|
|
92
|
+
finallyBlock?: BlockStatement;
|
|
92
93
|
line: number;
|
|
93
94
|
}
|
|
94
95
|
export interface ImportStatement {
|
|
@@ -202,7 +203,7 @@ export interface ImageCallExpression {
|
|
|
202
203
|
export interface StructuredOutputExpression {
|
|
203
204
|
type: 'StructuredOutputExpression';
|
|
204
205
|
schema: Record<string, TypeAnnotation>;
|
|
205
|
-
modelCall:
|
|
206
|
+
modelCall: Expression;
|
|
206
207
|
line: number;
|
|
207
208
|
}
|
|
208
209
|
export interface ToolCallExpression {
|
|
@@ -306,8 +307,19 @@ export declare class BreakException extends Error {
|
|
|
306
307
|
export declare class ContinueException extends Error {
|
|
307
308
|
constructor();
|
|
308
309
|
}
|
|
310
|
+
export declare class SesiRuntimeError extends Error {
|
|
311
|
+
errorType: string;
|
|
312
|
+
data: RuntimeValue;
|
|
313
|
+
line?: number;
|
|
314
|
+
column?: number;
|
|
315
|
+
output?: string;
|
|
316
|
+
stackTrace: string[];
|
|
317
|
+
constructor(errorType: string, message: string, data?: RuntimeValue, line?: number, column?: number, output?: string, stackTrace?: string[]);
|
|
318
|
+
toRuntimeObject(): RuntimeObject;
|
|
319
|
+
}
|
|
309
320
|
export type InterpreterError = {
|
|
310
321
|
message: string;
|
|
311
322
|
line?: number;
|
|
323
|
+
column?: number;
|
|
312
324
|
};
|
|
313
325
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAEjB,QAAQ,GACR,QAAQ,GACR,YAAY,GAEZ,KAAK,GACL,OAAO,GACP,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,OAAO,GACP,KAAK,GACL,IAAI,GACJ,QAAQ,GACR,OAAO,GACP,UAAU,GACV,KAAK,GACL,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,QAAQ,GACR,OAAO,GACP,OAAO,GACP,mBAAmB,GACnB,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,IAAI,GAEJ,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,SAAS,GACT,OAAO,GACP,aAAa,GACb,MAAM,GACN,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,SAAS,GACT,eAAe,GACf,qBAAqB,GACrB,WAAW,GACX,MAAM,GACN,KAAK,GACL,OAAO,GACP,WAAW,GACX,OAAO,GACP,OAAO,GACP,UAAU,GAEV,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,aAAa,GACb,cAAc,GACd,eAAe,GACf,cAAc,GAEd,KAAK,GACL,SAAS,CAAC;AAEd,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,MAAM,OAAO,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,CAAC,EAAE,MAAM,EACf,UAAU,GAAE,MAAM,EAAO;IAY3B,eAAe,IAAI,aAAa;CAmBjC;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Core type definitions and AST nodes for Sesi
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ContinueException = exports.BreakException = exports.ReturnValue = exports.Environment = void 0;
|
|
4
|
+
exports.SesiRuntimeError = exports.ContinueException = exports.BreakException = exports.ReturnValue = exports.Environment = void 0;
|
|
5
5
|
// Environment for variable scoping
|
|
6
6
|
class Environment {
|
|
7
7
|
constructor(parent = null) {
|
|
@@ -60,4 +60,36 @@ class ContinueException extends Error {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
exports.ContinueException = ContinueException;
|
|
63
|
+
class SesiRuntimeError extends Error {
|
|
64
|
+
constructor(errorType, message, data = null, line, column, output, stackTrace = []) {
|
|
65
|
+
super(message);
|
|
66
|
+
this.name = 'SesiRuntimeError';
|
|
67
|
+
this.errorType = errorType;
|
|
68
|
+
this.data = data;
|
|
69
|
+
this.line = line;
|
|
70
|
+
this.column = column;
|
|
71
|
+
this.output = output;
|
|
72
|
+
this.stackTrace = stackTrace;
|
|
73
|
+
}
|
|
74
|
+
toRuntimeObject() {
|
|
75
|
+
const obj = Object.create(null);
|
|
76
|
+
obj.type = this.errorType;
|
|
77
|
+
obj.message = this.message;
|
|
78
|
+
obj.data = this.data;
|
|
79
|
+
if (this.line !== undefined) {
|
|
80
|
+
obj.line = this.line;
|
|
81
|
+
}
|
|
82
|
+
if (this.column !== undefined) {
|
|
83
|
+
obj.column = this.column;
|
|
84
|
+
}
|
|
85
|
+
if (this.output !== undefined) {
|
|
86
|
+
obj.output = this.output;
|
|
87
|
+
}
|
|
88
|
+
if (this.stackTrace.length > 0) {
|
|
89
|
+
obj.stack_trace = this.stackTrace;
|
|
90
|
+
}
|
|
91
|
+
return obj;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.SesiRuntimeError = SesiRuntimeError;
|
|
63
95
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AA0a/C,mCAAmC;AACnC,MAAa,WAAW;IAItB,YAAY,SAA6B,IAAI;QAHrC,SAAI,GAA8B,IAAI,GAAG,EAAE,CAAC;QAIlD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,KAAmB;QACtC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,GAAG,CAAC,IAAY;QACd,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAC9B,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,GAAG,CAAC,IAAY,EAAE,KAAmB;QACnC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,IAAI,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B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,eAAe;QACb,MAAM,GAAG,GAAkB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC/C,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;QAC1B,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC5B,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC;QACpC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA9CD,4CA8CC"}
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
**Sesi** is a
|
|
5
|
+
**Sesi** is a concise and highly legible programming language. It uses a clean tree-walking interpreter model built in TypeScript. The architecture is optimized for simplicity and eliminating the need for `async/await` syntax or heavy module imports. By acting as a minimal orchestration layer, Sesi allows developers to write clean, straightforward logic that natively handles background processes and API or Reasoning calls without SDK overhead.
|
|
6
6
|
|
|
7
7
|
## Component Stack
|
|
8
8
|
|
|
@@ -198,7 +198,7 @@ false → false
|
|
|
198
198
|
- Construct prompt from string concatenation
|
|
199
199
|
- Make async API call to Gemini
|
|
200
200
|
|
|
201
|
-
- Wait for response (blocking in v1)
|
|
201
|
+
- Wait for response (blocking in v1.x)
|
|
202
202
|
- Validate finish reason and non-empty text
|
|
203
203
|
- Return text response to program or throw
|
|
204
204
|
|
|
@@ -213,7 +213,7 @@ false → false
|
|
|
213
213
|
ModelCallExpression (AST)
|
|
214
214
|
│
|
|
215
215
|
├─ Evaluate prompt expression
|
|
216
|
-
├─ Extract configuration (
|
|
216
|
+
├─ Extract configuration (`thinkingLevel`, `max_tokens`, `cache`, etc.)
|
|
217
217
|
├─ Call AIRuntime.callModel()
|
|
218
218
|
│ │
|
|
219
219
|
│ ├─ Create Gemini interaction request
|
|
@@ -298,11 +298,11 @@ Sesi now has basic exception-style error handling in v1:
|
|
|
298
298
|
|
|
299
299
|
```
|
|
300
300
|
SKILLS.md # AI-agent workspace context and repo guardrails
|
|
301
|
-
index.html # Sesi-generated landing page
|
|
302
301
|
eslint.config.mjs # ESLint configuration
|
|
303
302
|
dist/ # Compiled TypeScript output
|
|
304
303
|
example.js # Helper script to run basic examples
|
|
305
304
|
example-ai.js # Helper script to run Reasoning examples
|
|
305
|
+
examples.sesi # Central execution suite for examples
|
|
306
306
|
package.json # Dependencies & scripts
|
|
307
307
|
tsconfig.json # TypeScript configuration
|
|
308
308
|
QUICKSTART.md # Quick start guide
|
|
@@ -322,8 +322,6 @@ bin/
|
|
|
322
322
|
└── sesi.js # CLI executable
|
|
323
323
|
|
|
324
324
|
main/ # Main user scripts and debugging
|
|
325
|
-
├── playground.sesi # Main playground script
|
|
326
|
-
├── start.sesi # Beginner script
|
|
327
325
|
├── build_website.sesi # Sesi-generated landing page builder
|
|
328
326
|
└── tests/ # Additional syntax validation scripts
|
|
329
327
|
|
|
@@ -346,28 +344,38 @@ examples/
|
|
|
346
344
|
├── 16_modules.sesi # Modules & std library namespaces
|
|
347
345
|
├── 17_http_client.sesi # HTTP GET/POST client
|
|
348
346
|
├── 18_parallel_requests.sesi # Parallel requests concurrency
|
|
349
|
-
|
|
347
|
+
├── 19_search_web.sesi # Web search
|
|
348
|
+
├── 20_model_aliases.sesi # Custom model naming via aliases
|
|
349
|
+
├── 21_custom_tools.sesi # Runtime custom tool definitions
|
|
350
|
+
└── 22_reasoning_plus_custom_tools.sesi # Compose reasoning with custom tools
|
|
350
351
|
|
|
351
352
|
docs/
|
|
352
353
|
├── SPECIFICATION.md # Language spec
|
|
353
354
|
├── ARCHITECTURE.md # This file
|
|
354
355
|
├── BUILTINS.md # Built-in reference
|
|
356
|
+
├── CLI.md # Comprehensive CLI & Parametric Eval guide
|
|
355
357
|
├── IMAGE_GENERATION.md # Image generation guide
|
|
356
358
|
├── COMPARISON.md # Language comparison showcase
|
|
357
|
-
├──
|
|
358
|
-
├──
|
|
359
|
+
├── CONCURRENCY.md # Concurrency & coordination guide
|
|
360
|
+
├── REASONING.md # Reasoning and simple logic guide
|
|
359
361
|
└── ROADMAP.md # Future plans
|
|
360
362
|
|
|
361
363
|
tests/
|
|
362
|
-
|
|
364
|
+
├── basic.test.ts # Core parsing & evaluation tests
|
|
365
|
+
├── cache.test.ts # Execution caching tests
|
|
366
|
+
├── http.test.ts # Web request builtins testing
|
|
367
|
+
├── module.test.ts # Imports & module loading tests
|
|
368
|
+
├── parallel.test.ts # Concurrent execution tests
|
|
369
|
+
├── security.test.ts # Sandbox & guardrail tests
|
|
370
|
+
├── test-gemini.ts # Base model integration test
|
|
371
|
+
├── test-gemini2.ts # Extended model integration test
|
|
372
|
+
└── workflow.test.ts # Complex sequence workflows tests
|
|
363
373
|
```
|
|
364
374
|
|
|
365
375
|
## Workspace Context File
|
|
366
376
|
|
|
367
377
|
The root-level `SKILLS.md` file is part of the practical repo architecture. It is not consumed by the Sesi runtime, but it is intended to guide AI-assisted development in this workspace.
|
|
368
378
|
|
|
369
|
-
It defines repo-specific operating rules such as valid Sesi assumptions, normal execution via the global `sesi` command, and the fact that `main/` and `main/tests/` are intentional user workspace areas rather than anomalies.
|
|
370
|
-
|
|
371
379
|
## Testing Strategy
|
|
372
380
|
|
|
373
381
|
**Unit Tests** (per component):
|
|
@@ -429,6 +437,6 @@ Sesi's architecture prioritizes **clarity and simplicity** over performance. The
|
|
|
429
437
|
- Easy debugging
|
|
430
438
|
- Simple extensions
|
|
431
439
|
- Clear control flow
|
|
432
|
-
- Smooth Reasoning
|
|
440
|
+
- Smooth Reasoning integration
|
|
433
441
|
|
|
434
442
|
As the language matures, optimizations can be added without changing the API.
|
package/docs/BUILTINS.md
CHANGED
|
@@ -383,14 +383,12 @@ print "Elapsed time:" time() - start "ms"
|
|
|
383
383
|
Concurrently execute multiple Sesi function closures or builtins in parallel and return their results as an array.
|
|
384
384
|
|
|
385
385
|
```sesi
|
|
386
|
-
fn job1()
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
return "b"
|
|
393
|
-
}
|
|
386
|
+
fn job1()
|
|
387
|
+
{sleep(100)
|
|
388
|
+
return "a"}
|
|
389
|
+
fn job2()
|
|
390
|
+
{sleep(100)
|
|
391
|
+
return "b"}
|
|
394
392
|
let results = multi_req([job1, job2])
|
|
395
393
|
print results // ["a", "b"]
|
|
396
394
|
```
|
|
@@ -399,6 +397,106 @@ print results // ["a", "b"]
|
|
|
399
397
|
|
|
400
398
|
---
|
|
401
399
|
|
|
400
|
+
### workflow(steps, input = "") -> object
|
|
401
|
+
|
|
402
|
+
Run a multi-step reasoning workflow where each step can reference prior outputs.
|
|
403
|
+
|
|
404
|
+
Default behavior is automatic and requires no special syntax:
|
|
405
|
+
|
|
406
|
+
- Step 1 gets the workflow input appended to its prompt
|
|
407
|
+
- Step 2+ gets the previous step output appended to its prompt
|
|
408
|
+
|
|
409
|
+
Each step is an object with at minimum a `"prompt"` string. Optional keys include:
|
|
410
|
+
|
|
411
|
+
- `"model"` (default: `"gemini-3.1-flash-lite"`)
|
|
412
|
+
- `"temperature"`, `"max_tokens"`, `"top_k"`, `"top_p"`
|
|
413
|
+
- `"thinkingLevel"`, `"cache"`, `"search"`
|
|
414
|
+
|
|
415
|
+
```sesi
|
|
416
|
+
let steps = [{"prompt": "Summarize:"}, {"prompt": "Critique:"}, {"prompt": "Finalize:"}]
|
|
417
|
+
let result = workflow(steps, "Design a landing page brief")
|
|
418
|
+
print result["final"]
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
**Returns**: `object` with keys `"input"`, `"steps"` (array of step outputs), and `"final"`.
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
### set_alias(alias, model) -> bool
|
|
426
|
+
|
|
427
|
+
Register a custom local name for a model string. Aliases are resolved automatically by `model()`, `image()`, and `workflow()`.
|
|
428
|
+
|
|
429
|
+
```sesi
|
|
430
|
+
set_alias("fast", "gemini-3.1-flash-lite")
|
|
431
|
+
let answer = model("fast") {"Summarize this paragraph."}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**Returns**: `bool` (`true` when the alias is registered)
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
### define_tool(name, fn, description = "") -> bool
|
|
439
|
+
|
|
440
|
+
Register a custom tool name that can be called through `tool_call(name)(...)`.
|
|
441
|
+
|
|
442
|
+
```sesi
|
|
443
|
+
fn summarize(text)
|
|
444
|
+
{return "Summary: " + text}
|
|
445
|
+
|
|
446
|
+
define_tool("summarizer", summarize, "Summarizes text")
|
|
447
|
+
let result = tool_call(summarizer)("Hello")
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**Returns**: `bool` (`true` when the tool is registered)
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
### list_tools() -> array
|
|
455
|
+
|
|
456
|
+
List custom tool names registered by `define_tool`.
|
|
457
|
+
|
|
458
|
+
```sesi
|
|
459
|
+
let tools = list_tools()
|
|
460
|
+
print tools
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
**Returns**: `array<string>`
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
### error_type(type, message, data = null) -> object
|
|
468
|
+
|
|
469
|
+
Create a custom typed error object you can throw with `raise_error`.
|
|
470
|
+
|
|
471
|
+
```sesi
|
|
472
|
+
let err = error_type("ValidationError", "Missing email", {"field": "email"})
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
**Returns**: `object` with keys `"type"`, `"message"`, and `"data"`.
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
### raise_error(type_or_error, message = "", data = null) -> never
|
|
480
|
+
|
|
481
|
+
Throw a custom typed error that can be handled in `try/catch`.
|
|
482
|
+
|
|
483
|
+
```sesi
|
|
484
|
+
try {
|
|
485
|
+
raise_error("RateLimit", "Too many requests", {"retryIn": 30})
|
|
486
|
+
} catch (e) {print "type:" e["type"] "message:" e["message"]}
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
You can also pass an `error_type(...)` object directly:
|
|
490
|
+
|
|
491
|
+
```sesi
|
|
492
|
+
let err = error_type("ValidationError", "Invalid payload", {"field": "email"})
|
|
493
|
+
raise_error(err)
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
**Returns**: never (always throws)
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
402
500
|
### random() -> number
|
|
403
501
|
|
|
404
502
|
Returns a random floating-point number between 0 (inclusive) and 1 (exclusive).
|
|
@@ -408,7 +506,22 @@ let rand = random()
|
|
|
408
506
|
if rand > 0.5 {print "Heads"} else {print "Tails"}
|
|
409
507
|
```
|
|
410
508
|
|
|
411
|
-
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
## Global Variables
|
|
512
|
+
|
|
513
|
+
### args
|
|
514
|
+
|
|
515
|
+
An array of strings containing the command-line arguments passed to the Sesi script. This excludes any Sesi interpreter options (e.g. `-l`) and the script filename itself.
|
|
516
|
+
|
|
517
|
+
```sesi
|
|
518
|
+
print "Number of script args:" len(args)
|
|
519
|
+
if len(args) > 0 {
|
|
520
|
+
print "First script argument:" args[0]
|
|
521
|
+
}
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
**Type**: `array<string>`
|
|
412
525
|
|
|
413
526
|
---
|
|
414
527
|
|
|
@@ -431,7 +544,7 @@ print sigmoid // 0.6224593312018546
|
|
|
431
544
|
|
|
432
545
|
## Math-like Functions (v2 planned)
|
|
433
546
|
|
|
434
|
-
These are not yet implemented in v1
|
|
547
|
+
These are not yet implemented in v1+ but will be added:
|
|
435
548
|
|
|
436
549
|
```sesi
|
|
437
550
|
// Planned for v2:
|
|
@@ -593,7 +706,7 @@ keys(obj) contains "a" // Future: not yet supported
|
|
|
593
706
|
|
|
594
707
|
---
|
|
595
708
|
|
|
596
|
-
## Standard Library Modules (Supported natively in v1.
|
|
709
|
+
## Standard Library Modules (Supported natively in v1.3+)
|
|
597
710
|
|
|
598
711
|
### std/math
|
|
599
712
|
|
|
@@ -621,7 +734,7 @@ import { parse, stringify } from "std/json"
|
|
|
621
734
|
|
|
622
735
|
---
|
|
623
736
|
|
|
624
|
-
## Module Resolution (v1.
|
|
737
|
+
## Module Resolution (v1.3+)
|
|
625
738
|
|
|
626
739
|
Sesi resolves local module imports by searching directories in priority order:
|
|
627
740
|
|
|
@@ -707,11 +820,15 @@ Tip: add a folder to SESI_PATH, or place shared modules in ~/.sesi/lib
|
|
|
707
820
|
|
|
708
821
|
## See Also
|
|
709
822
|
|
|
710
|
-
- [Quick Start](QUICKSTART.md)
|
|
823
|
+
- [Quick Start Guide](../QUICKSTART.md)
|
|
824
|
+
- [Language Specification](SPECIFICATION.md)
|
|
825
|
+
- [Runtime Architecture](ARCHITECTURE.md)
|
|
826
|
+
- [Built-in Functions Reference](BUILTINS.md)
|
|
827
|
+
- [Command Line Interface (CLI) Reference](CLI.md)
|
|
828
|
+
- [Image Generation & Input](IMAGE_GENERATION.md)
|
|
711
829
|
- [Compare to other languages](COMPARISON.md)
|
|
712
|
-
- [
|
|
713
|
-
- [
|
|
714
|
-
- [
|
|
715
|
-
- [
|
|
716
|
-
- [
|
|
717
|
-
- [Examples](../examples/)
|
|
830
|
+
- [Concurrency & Coordination](CONCURRENCY.md)
|
|
831
|
+
- [Reasoning & Simple Logic](REASONING.md)
|
|
832
|
+
- [Agent-Native Programming Paradigm](agent_native_programming.md)
|
|
833
|
+
- [Historical Stress Test Chronicles](sesi_ai_chronicles.md)
|
|
834
|
+
- [Examples](../examples)
|
package/docs/CLI.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# ⚡ Sesi Command Line Interface Reference
|
|
2
|
+
|
|
3
|
+
Sesi’s CLI is a powerful, zero-footprint environment orchestrator. It allows you to run robust scripts, evaluate inline code filelessly, query the RAG-powered interactive Co-Pilot, encrypt files, and manage sandboxing controls directly from your shell.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🗺️ CLI Command Reference Matrix
|
|
8
|
+
|
|
9
|
+
| Command Syntax | Execution Mode | File Dependency | Description |
|
|
10
|
+
| :--------------------------- | :-------------------- | :-------------------------------- | :---------------------------------------------------------------------------------- |
|
|
11
|
+
| `sesi <file>` | Standard | Yes | Runs the Sesi script file sequentially. |
|
|
12
|
+
| `sesi <file> <args...>` | **Parametric Script** | Yes | Runs the script and exposes trailing parameters in `args`. |
|
|
13
|
+
| `sesi -e "<code>"` | Inline Eval | **No (Fileless)** | Evaluates the string of Sesi code directly in-memory. |
|
|
14
|
+
| `sesi -e "<code>" <args...>` | **Parametric Eval** | **No (Fileless)** | Evaluates inline code and populates `args` array with inputs. |
|
|
15
|
+
| `sesi -h "<query>"` | Co-Pilot Help | **Yes (Internal chatbot script)** | Converses with Sesi's internal Vector-RAG chatbot (`chatbot/sesi_db_chatbot.sesi`). |
|
|
16
|
+
| `sesi <file> -h "<query>"` | Grounded Help | **Yes (Chatbot + context file)** | Converses with the Co-Pilot using both the vector DB and the user's file. |
|
|
17
|
+
| `sesi -r <file>` | AST Inspector | Yes | Dumps raw syntax tokens and AST nodes without running code. |
|
|
18
|
+
| `sesi -enc <file> -p <pass>` | Encryption | Yes | Secures a script file using AES-256 password protection. |
|
|
19
|
+
| `sesi -dec <file> -p <pass>` | Decryption | Yes | Decrypts an encrypted script file back to cleartext `.sesi`. |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🚀 1. Parametric Script Execution
|
|
24
|
+
|
|
25
|
+
You can feed command-line arguments to Sesi scripts on launch. Sesi parses these inputs and binds them as standard string values in a globally accessible array called `args`.
|
|
26
|
+
|
|
27
|
+
### Usage
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
sesi main/test_args.sesi "hello" "world"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Accessing Arguments in Sesi Scripts
|
|
34
|
+
|
|
35
|
+
```sesi
|
|
36
|
+
// Get the number of inputs
|
|
37
|
+
let total = len(args)
|
|
38
|
+
|
|
39
|
+
// Access indices
|
|
40
|
+
if total > 0 {
|
|
41
|
+
print "First argument:" args[0]
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 🔮 2. Fileless Inline Execution (`-e` / `--eval`)
|
|
48
|
+
|
|
49
|
+
You do not need to create or save `.sesi` files on your disk to use Sesi. Using the `-e` flag, you can execute logic on the fly.
|
|
50
|
+
|
|
51
|
+
### A. Statement Termination Rules
|
|
52
|
+
|
|
53
|
+
Sesi requires statements to be terminated by either a **newline** or a **semicolon (`;`)**.
|
|
54
|
+
|
|
55
|
+
#### Single-line Semicolon Pattern
|
|
56
|
+
|
|
57
|
+
If writing on a single terminal line, separate statements manually with `;`:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
sesi -e "let x = 10; let y = 20; print x + y"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### Multiline Shell Pattern
|
|
64
|
+
|
|
65
|
+
If writing a multiline string in your shell, omit semicolons completely:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
sesi -e "
|
|
69
|
+
let x = 10
|
|
70
|
+
let y = 20
|
|
71
|
+
print x + y
|
|
72
|
+
"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### B. Parametric Fileless Execution
|
|
76
|
+
|
|
77
|
+
You can pass CLI arguments to fileless inline scripts too! Any positional arguments coming after the inline code string are loaded into the global `args` array.
|
|
78
|
+
|
|
79
|
+
#### Example: Dynamic File Character Counter
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
sesi -e "let path = args[0]; let content = read_file(path); print 'Character count:' len(content)" "package.json"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🎓 3. Interactive Co-Pilot Help (`-h` / `--help`)
|
|
88
|
+
|
|
89
|
+
Sesi’s CLI features an inline, dynamic RAG (Retrieval-Augmented Generation) co-pilot trained directly on Sesi's grammar rules, standard library, and architecture documentation.
|
|
90
|
+
|
|
91
|
+
### A. General Knowledge Queries (Fileless)
|
|
92
|
+
|
|
93
|
+
Ask Sesi how to write loops, parse JSON, what functions are available, what are the best practices in Sesi, etc:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
sesi -h "how do I use standard json module?"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### B. Context-Grounded Code Debugging
|
|
100
|
+
|
|
101
|
+
Pass a script file along with `-h` to chat with the co-pilot about your code. The co-pilot will automatically ingest the file contents as grounding context:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
sesi examples/01_hello.sesi -h "how can i improve this script?"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## ⚙️ 4. Security & Sandbox Overrides
|
|
110
|
+
|
|
111
|
+
Sesi runs in a safe-by-default, zero-trust sandbox. System shell commands (`exec`, `spawn`) are blocked by default. Use these CLI flags to configure safety parameters:
|
|
112
|
+
|
|
113
|
+
### A. Disable Sandboxing (`-l` / `--local`)
|
|
114
|
+
|
|
115
|
+
Unlocks the execution of raw system commands and allows directory whitelist escapes:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
sesi main/script.sesi --local
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### B. Directory Whitelisting (`-a` / `--allowed-paths`)
|
|
122
|
+
|
|
123
|
+
Adds custom directories to the safe path whitelist (Current Working Directory and Script Directory are whitelisted by default):
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
sesi main/script.sesi -a "./data,./logs"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 📦 5. Systems Utilities
|
|
132
|
+
|
|
133
|
+
### A. AST Raw Parser Dumps (`-r` / `--raw`)
|
|
134
|
+
|
|
135
|
+
Inspect exactly how Sesi's lexer tokenizes and parses code before execution:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
sesi -r examples/01_hello.sesi
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### B. AES-256 Script Encryption (`-enc` & `-dec`)
|
|
142
|
+
|
|
143
|
+
Secure your proprietary reasoning instructions or pipelines using password-based encryption:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Encrypt manually with password parameter
|
|
147
|
+
sesi -enc my_private_script.sesi -p "my-super-secret-password"
|
|
148
|
+
|
|
149
|
+
# Decrypt manually with password parameter
|
|
150
|
+
sesi -dec my_private_script.sesi -p "my-super-secret-password"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
#### 🔒 Zero-Configuration Environment Fallback (`SESI_PASSWORD`)
|
|
154
|
+
|
|
155
|
+
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).
|
|
156
|
+
|
|
157
|
+
When Sesi detects `SESI_PASSWORD`, you can omit the `-p` parameter entirely:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Encrypt automatically using SESI_PASSWORD from env
|
|
161
|
+
sesi -enc my_private_script.sesi
|
|
162
|
+
|
|
163
|
+
# Decrypt automatically using SESI_PASSWORD from env
|
|
164
|
+
sesi -dec my_private_script.sesi
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 🛠️ 6. Package.json Script Shortcuts
|
|
170
|
+
|
|
171
|
+
If you are working inside the Sesi repository, you can leverage native package manager shortcuts defined in `package.json` to execute, parse, or encrypt scripts:
|
|
172
|
+
|
|
173
|
+
| Package Script | CLI Equivalence | Description |
|
|
174
|
+
| :---------------------------------- | :------------------------ | :---------------------------------------------------- |
|
|
175
|
+
| `npm run lint` | `sesi lint.sesi` | Audits the entire workspace for errors/warnings. |
|
|
176
|
+
| `npm run lint <file>` | `sesi lint.sesi <file>` | Audits a single file and prints directly to terminal. |
|
|
177
|
+
| `npm run sesi <file>` | `sesi <file>` | Runs the Sesi script. |
|
|
178
|
+
| `npm run sesi:local <file>` | `sesi -l <file>` | Runs a script with safe-mode disabled. |
|
|
179
|
+
| `npm run sesi:eval "<code_to_run>"` | `sesi -e "<code_to_run>"` | Evaluates Sesi code in-memory. |
|
|
180
|
+
| `npm run sesi:parse <file>` | `sesi -r <file>` | Dumps the raw AST representation. |
|
|
181
|
+
| `npm run sesi:encrypt <file>` | `sesi -enc <file>` | Encrypts a file (using env password fallback). |
|
|
182
|
+
| `npm run sesi:decrypt <file>` | `sesi -dec <file>` | Decrypts a file (using env password fallback). |
|
|
183
|
+
| `npm run copilot "<query>"` | `sesi -h "<query>"` | Consults the RAG-trained Sesi Co-Pilot. |
|
|
184
|
+
| `npm run example:all` | `sesi examples.sesi` | Runs all examples in the examples/ directory. |
|
|
185
|
+
|
|
186
|
+
### Usage Example
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# Audit the entire workspace and save report to lint_report.md
|
|
190
|
+
npm run lint
|
|
191
|
+
|
|
192
|
+
# Audit a single file and print Errors & Warnings directly to stdout
|
|
193
|
+
npm run lint bad-syntax-file.sesi
|
|
194
|
+
|
|
195
|
+
# Evaluate inline code
|
|
196
|
+
npm run sesi:eval "print 'Sesi running via npm!'"
|
|
197
|
+
|
|
198
|
+
# Encrypt a private script using the .env password
|
|
199
|
+
npm run sesi:encrypt "my-pipeline.sesi"
|
|
200
|
+
```
|