@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/index.js
CHANGED
|
@@ -39,9 +39,32 @@ exports.runSesiFile = runSesiFile;
|
|
|
39
39
|
const lexer_1 = require("./lexer");
|
|
40
40
|
const parser_1 = require("./parser");
|
|
41
41
|
const interpreter_1 = require("./interpreter");
|
|
42
|
+
const types_1 = require("./types");
|
|
42
43
|
const fs = __importStar(require("fs"));
|
|
43
44
|
const path = __importStar(require("path"));
|
|
44
|
-
|
|
45
|
+
const crypto = __importStar(require("crypto"));
|
|
46
|
+
async function encrypt(content, password) {
|
|
47
|
+
const algorithm = 'aes-256-cbc';
|
|
48
|
+
const key = crypto.createHash('sha256').update(String(password)).digest();
|
|
49
|
+
const iv = crypto.randomBytes(16);
|
|
50
|
+
const cipher = crypto.createCipheriv(algorithm, key, iv);
|
|
51
|
+
let encrypted = cipher.update(content, 'utf8', 'hex');
|
|
52
|
+
encrypted += cipher.final('hex');
|
|
53
|
+
return iv.toString('hex') + ':' + encrypted;
|
|
54
|
+
}
|
|
55
|
+
async function decrypt(content, password) {
|
|
56
|
+
const parts = content.split(':');
|
|
57
|
+
if (parts.length !== 2)
|
|
58
|
+
throw new Error('Invalid encrypted format');
|
|
59
|
+
const iv = Buffer.from(parts[0], 'hex');
|
|
60
|
+
const algorithm = 'aes-256-cbc';
|
|
61
|
+
const key = crypto.createHash('sha256').update(String(password)).digest();
|
|
62
|
+
const decipher = crypto.createDecipheriv(algorithm, key, iv);
|
|
63
|
+
let decrypted = decipher.update(parts[1], 'hex', 'utf8');
|
|
64
|
+
decrypted += decipher.final('utf8');
|
|
65
|
+
return decrypted;
|
|
66
|
+
}
|
|
67
|
+
async function runSesi(source, scriptDir, options) {
|
|
45
68
|
try {
|
|
46
69
|
// Lex
|
|
47
70
|
const lexer = new lexer_1.Lexer(source);
|
|
@@ -49,21 +72,82 @@ async function runSesi(source, scriptDir) {
|
|
|
49
72
|
// Parse
|
|
50
73
|
const parser = new parser_1.Parser(tokens);
|
|
51
74
|
const program = parser.parse();
|
|
75
|
+
if (options?.encrypt) {
|
|
76
|
+
if (!options.password) {
|
|
77
|
+
console.error('Error: Password is required for encryption.');
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
source = await encrypt(source, options.password);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (options?.decrypt) {
|
|
84
|
+
if (!options.password) {
|
|
85
|
+
console.error('Error: Password is required for decryption.');
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
source = await decrypt(source, options.password);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (options?.raw) {
|
|
92
|
+
console.log(JSON.stringify(program, null, 2));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
52
95
|
// Interpret
|
|
53
|
-
const interpreter = new interpreter_1.Interpreter(scriptDir);
|
|
96
|
+
const interpreter = new interpreter_1.Interpreter(scriptDir, options);
|
|
54
97
|
await interpreter.interpret(program);
|
|
55
98
|
}
|
|
56
99
|
catch (error) {
|
|
57
|
-
|
|
100
|
+
if (error instanceof types_1.SesiRuntimeError) {
|
|
101
|
+
const lineInfo = error.column !== undefined
|
|
102
|
+
? ` at line ${error.line}, column ${error.column}`
|
|
103
|
+
: (error.line !== undefined ? ` at line ${error.line}` : '');
|
|
104
|
+
console.error(`Error${lineInfo}: ${error.message}`);
|
|
105
|
+
if (error.output) {
|
|
106
|
+
console.error(error.output);
|
|
107
|
+
}
|
|
108
|
+
if (error.stackTrace.length > 0) {
|
|
109
|
+
console.error('Stack trace:');
|
|
110
|
+
for (const frame of error.stackTrace) {
|
|
111
|
+
console.error(` at ${frame}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
console.error('Error:', error?.message ?? String(error));
|
|
117
|
+
}
|
|
58
118
|
process.exit(1);
|
|
59
119
|
}
|
|
60
120
|
}
|
|
61
|
-
async function runSesiFile(filePath) {
|
|
121
|
+
async function runSesiFile(filePath, options) {
|
|
62
122
|
try {
|
|
63
123
|
const filepath = path.resolve(filePath);
|
|
64
124
|
const scriptDir = path.dirname(filepath);
|
|
65
|
-
|
|
66
|
-
|
|
125
|
+
let source = fs.readFileSync(filepath, 'utf-8');
|
|
126
|
+
// If the file matches the exact signature of our AES-256-CBC encryption (32-char hex IV : hex payload)
|
|
127
|
+
if (/^[a-fA-F0-9]{32}:[a-fA-F0-9]+$/.test(source.trim()) && !options?.decrypt) {
|
|
128
|
+
console.error(`Error: The file '${path.basename(filePath)}' is encrypted.`);
|
|
129
|
+
console.error(`Please decrypt it first before running:`);
|
|
130
|
+
console.error(` sesi -decrypt ${path.basename(filePath)} -p <password>`);
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
if (options?.encrypt || options?.decrypt) {
|
|
134
|
+
if (!options.password) {
|
|
135
|
+
console.error(`Error: Password is required for ${options.encrypt ? 'encryption' : 'decryption'}.`);
|
|
136
|
+
process.exit(1);
|
|
137
|
+
}
|
|
138
|
+
if (options.encrypt) {
|
|
139
|
+
const encrypted = await encrypt(source, options.password);
|
|
140
|
+
fs.writeFileSync(filepath, encrypted, 'utf-8');
|
|
141
|
+
console.log(`Successfully encrypted ${filePath}`);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
const decrypted = await decrypt(source, options.password);
|
|
145
|
+
fs.writeFileSync(filepath, decrypted, 'utf-8');
|
|
146
|
+
console.log(`Successfully decrypted ${filePath}`);
|
|
147
|
+
}
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
await runSesi(source, scriptDir, options);
|
|
67
151
|
}
|
|
68
152
|
catch (error) {
|
|
69
153
|
console.error(`Error reading file ${filePath}:`, error.message);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;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,CAAC;gBACnG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACpB,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC1D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;gBAC/C,OAAO,CAAC,GAAG,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC1D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;gBAC/C,OAAO,CAAC,GAAG,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,OAAO;QACT,CAAC;QAED,MAAM,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,sBAAsB,QAAQ,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/interpreter.d.ts
CHANGED
|
@@ -4,15 +4,27 @@ export declare class Interpreter {
|
|
|
4
4
|
private currentEnv;
|
|
5
5
|
private prompts;
|
|
6
6
|
private memory;
|
|
7
|
+
private modelAliases;
|
|
8
|
+
private customTools;
|
|
7
9
|
exports: Map<string, RuntimeValue>;
|
|
8
10
|
private scriptDir;
|
|
9
11
|
safeMode: boolean;
|
|
10
|
-
|
|
12
|
+
allowLocalFs: boolean;
|
|
11
13
|
allowedPaths: string[];
|
|
14
|
+
encrypt: boolean;
|
|
15
|
+
decrypt: boolean;
|
|
16
|
+
password: string;
|
|
17
|
+
raw: boolean;
|
|
18
|
+
args: string[];
|
|
12
19
|
constructor(scriptDir?: string, options?: {
|
|
13
20
|
safeMode?: boolean;
|
|
14
|
-
|
|
21
|
+
allowLocalFs?: boolean;
|
|
15
22
|
allowedPaths?: string[];
|
|
23
|
+
encrypt?: boolean;
|
|
24
|
+
decrypt?: boolean;
|
|
25
|
+
password?: string;
|
|
26
|
+
raw?: boolean;
|
|
27
|
+
args?: string[];
|
|
16
28
|
});
|
|
17
29
|
/**
|
|
18
30
|
* Resolves a local module path by searching in priority order:
|
|
@@ -23,6 +35,12 @@ export declare class Interpreter {
|
|
|
23
35
|
*/
|
|
24
36
|
private resolveModulePath;
|
|
25
37
|
interpret(program: Program): Promise<void>;
|
|
38
|
+
private rethrowWithContext;
|
|
39
|
+
setModelAlias(alias: string, modelName: string): void;
|
|
40
|
+
resolveModelName(name: string): string;
|
|
41
|
+
defineCustomTool(name: string, fn: RuntimeFunction, description?: string): void;
|
|
42
|
+
getCustomTool(name: string): RuntimeFunction | null;
|
|
43
|
+
listCustomToolNames(): string[];
|
|
26
44
|
private executeStatement;
|
|
27
45
|
private executeLet;
|
|
28
46
|
private executeConst;
|
|
@@ -30,6 +48,7 @@ export declare class Interpreter {
|
|
|
30
48
|
private executeExpression;
|
|
31
49
|
private executeBlock;
|
|
32
50
|
private executeTry;
|
|
51
|
+
private normalizeCaughtError;
|
|
33
52
|
private executeIf;
|
|
34
53
|
private executeWhile;
|
|
35
54
|
private executeFor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../src/interpreter.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EAGZ,KAAK,YAAY,EAEjB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../src/interpreter.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAA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I,EAAE,MAAM,GAAG,MAAM;IAetC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;IAQ/E,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI;IAInD,mBAAmB,IAAI,MAAM,EAAE;YAIxB,gBAAgB;YA0DhB,UAAU;YAKV,YAAY;IAK1B,OAAO,CAAC,eAAe;YAWT,iBAAiB;YAIjB,YAAY;YAaZ,UAAU;IAiBxB,OAAO,CAAC,oBAAoB;YAUd,SAAS;YAaT,YAAY;YAgBZ,UAAU;YAoDV,aAAa;YAQb,kBAAkB;YA2DlB,gBAAgB;YAmChB,eAAe;YAaf,iBAAiB;YAajB,kBAAkB;YAsDlB,YAAY;YAiBZ,cAAc;YAUd,aAAa;YAeb,aAAa;YAQb,cAAc;YAQd,cAAc;YAYd,iBAAiB;YAmDjB,iBAAiB;YA2DjB,wBAAwB;YAe1B,gBAAgB;IAiCf,gBAAgB,CAAC,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;YA+BjF,aAAa;YAOb,aAAa;IAkFpB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,IAAI;CAqFvE"}
|
package/dist/interpreter.js
CHANGED
|
@@ -9,22 +9,36 @@ class Interpreter {
|
|
|
9
9
|
constructor(scriptDir, options) {
|
|
10
10
|
this.prompts = new Map();
|
|
11
11
|
this.memory = new Map();
|
|
12
|
+
this.modelAliases = new Map();
|
|
13
|
+
this.customTools = new Map();
|
|
12
14
|
this.exports = new Map();
|
|
13
15
|
this.safeMode = true;
|
|
14
|
-
this.
|
|
16
|
+
this.allowLocalFs = false;
|
|
15
17
|
this.allowedPaths = [];
|
|
18
|
+
this.encrypt = false;
|
|
19
|
+
this.decrypt = false;
|
|
20
|
+
this.password = '';
|
|
21
|
+
this.raw = false;
|
|
22
|
+
this.args = [];
|
|
16
23
|
this.safeMode = options?.safeMode ?? (process.env.SESI_SAFE_MODE !== 'false');
|
|
17
|
-
this.
|
|
24
|
+
this.allowLocalFs = options?.allowLocalFs ?? (process.env.SESI_LOCAL_FS === 'true');
|
|
25
|
+
this.raw = options?.raw ?? false;
|
|
18
26
|
this.allowedPaths = options?.allowedPaths || [process.cwd()];
|
|
27
|
+
this.encrypt = options?.encrypt ?? false;
|
|
28
|
+
this.decrypt = options?.decrypt ?? false;
|
|
29
|
+
this.password = options?.password ?? (process.env.SESI_PASSWORD ?? '');
|
|
30
|
+
this.args = options?.args || [];
|
|
19
31
|
if (scriptDir && !this.allowedPaths.includes(scriptDir)) {
|
|
20
32
|
this.allowedPaths.push(scriptDir);
|
|
21
33
|
}
|
|
22
34
|
if (this.safeMode) {
|
|
23
|
-
this.
|
|
35
|
+
this.allowLocalFs = false;
|
|
24
36
|
}
|
|
25
37
|
this.globalEnv = new types_1.Environment();
|
|
26
38
|
this.currentEnv = this.globalEnv;
|
|
27
39
|
this.scriptDir = scriptDir;
|
|
40
|
+
// Add command-line arguments
|
|
41
|
+
this.globalEnv.define('args', this.args);
|
|
28
42
|
// Add built-in functions
|
|
29
43
|
const builtins = (0, builtins_1.getBuiltins)(this);
|
|
30
44
|
for (const [name, fn] of builtins) {
|
|
@@ -75,52 +89,114 @@ class Interpreter {
|
|
|
75
89
|
await this.executeStatement(statement);
|
|
76
90
|
}
|
|
77
91
|
}
|
|
92
|
+
rethrowWithContext(error, line) {
|
|
93
|
+
if (error instanceof types_1.SesiRuntimeError) {
|
|
94
|
+
if (line !== undefined && error.line === undefined) {
|
|
95
|
+
error.line = line;
|
|
96
|
+
}
|
|
97
|
+
if (error.column === undefined) {
|
|
98
|
+
error.column = 1;
|
|
99
|
+
}
|
|
100
|
+
if (line !== undefined) {
|
|
101
|
+
error.stackTrace.push(`line ${line}`);
|
|
102
|
+
}
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
if (error instanceof Error) {
|
|
106
|
+
throw new types_1.SesiRuntimeError('RuntimeError', error.message, null, line, 1, undefined, line !== undefined ? [`line ${line}`] : []);
|
|
107
|
+
}
|
|
108
|
+
throw new types_1.SesiRuntimeError('RuntimeError', String(error), null, line, 1, undefined, line !== undefined ? [`line ${line}`] : []);
|
|
109
|
+
}
|
|
110
|
+
setModelAlias(alias, modelName) {
|
|
111
|
+
const aliasKey = alias.trim();
|
|
112
|
+
const modelValue = modelName.trim();
|
|
113
|
+
if (!aliasKey) {
|
|
114
|
+
throw new Error('Model alias cannot be empty');
|
|
115
|
+
}
|
|
116
|
+
if (!modelValue) {
|
|
117
|
+
throw new Error('Model name cannot be empty');
|
|
118
|
+
}
|
|
119
|
+
this.modelAliases.set(aliasKey, modelValue);
|
|
120
|
+
}
|
|
121
|
+
resolveModelName(name) {
|
|
122
|
+
let current = name;
|
|
123
|
+
const seen = new Set();
|
|
124
|
+
while (this.modelAliases.has(current)) {
|
|
125
|
+
if (seen.has(current)) {
|
|
126
|
+
throw new Error(`Model alias cycle detected for "${name}"`);
|
|
127
|
+
}
|
|
128
|
+
seen.add(current);
|
|
129
|
+
current = this.modelAliases.get(current);
|
|
130
|
+
}
|
|
131
|
+
return current;
|
|
132
|
+
}
|
|
133
|
+
defineCustomTool(name, fn, description) {
|
|
134
|
+
const toolName = name.trim();
|
|
135
|
+
if (!toolName) {
|
|
136
|
+
throw new Error('Tool name cannot be empty');
|
|
137
|
+
}
|
|
138
|
+
this.customTools.set(toolName, { fn, description: description?.trim() || undefined });
|
|
139
|
+
}
|
|
140
|
+
getCustomTool(name) {
|
|
141
|
+
return this.customTools.get(name)?.fn || null;
|
|
142
|
+
}
|
|
143
|
+
listCustomToolNames() {
|
|
144
|
+
return Array.from(this.customTools.keys());
|
|
145
|
+
}
|
|
78
146
|
async executeStatement(statement) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
147
|
+
try {
|
|
148
|
+
switch (statement.type) {
|
|
149
|
+
case 'LetStatement':
|
|
150
|
+
await this.executeLet(statement);
|
|
151
|
+
break;
|
|
152
|
+
case 'ConstStatement':
|
|
153
|
+
await this.executeConst(statement);
|
|
154
|
+
break;
|
|
155
|
+
case 'FunctionStatement':
|
|
156
|
+
await this.executeFunction(statement);
|
|
157
|
+
break;
|
|
158
|
+
case 'ExpressionStatement':
|
|
159
|
+
await this.executeExpression(statement);
|
|
160
|
+
break;
|
|
161
|
+
case 'BlockStatement':
|
|
162
|
+
await this.executeBlock(statement, new types_1.Environment(this.currentEnv));
|
|
163
|
+
break;
|
|
164
|
+
case 'IfStatement':
|
|
165
|
+
await this.executeIf(statement);
|
|
166
|
+
break;
|
|
167
|
+
case 'WhileStatement':
|
|
168
|
+
await this.executeWhile(statement);
|
|
169
|
+
break;
|
|
170
|
+
case 'ForStatement':
|
|
171
|
+
await this.executeFor(statement);
|
|
172
|
+
break;
|
|
173
|
+
case 'ReturnStatement':
|
|
174
|
+
throw new types_1.ReturnValue((statement).value
|
|
175
|
+
? await this.evaluateExpression((statement).value)
|
|
176
|
+
: null);
|
|
177
|
+
case 'BreakStatement':
|
|
178
|
+
throw new types_1.BreakException();
|
|
179
|
+
case 'ContinueStatement':
|
|
180
|
+
throw new types_1.ContinueException();
|
|
181
|
+
case 'TryStatement':
|
|
182
|
+
await this.executeTry(statement);
|
|
183
|
+
break;
|
|
184
|
+
case 'MemoryStatement':
|
|
185
|
+
await this.executeMemory(statement);
|
|
186
|
+
break;
|
|
187
|
+
case 'ImportStatement':
|
|
188
|
+
await this.executeImport(statement);
|
|
189
|
+
break;
|
|
190
|
+
case 'ExportStatement':
|
|
191
|
+
await this.executeExport(statement);
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
if (error instanceof types_1.ReturnValue || error instanceof types_1.BreakException || error instanceof types_1.ContinueException) {
|
|
197
|
+
throw error;
|
|
198
|
+
}
|
|
199
|
+
this.rethrowWithContext(error, statement.line);
|
|
124
200
|
}
|
|
125
201
|
}
|
|
126
202
|
async executeLet(stmt) {
|
|
@@ -165,9 +241,23 @@ class Interpreter {
|
|
|
165
241
|
throw e;
|
|
166
242
|
}
|
|
167
243
|
const catchEnv = new types_1.Environment(this.currentEnv);
|
|
168
|
-
catchEnv.define(stmt.catchParameter,
|
|
244
|
+
catchEnv.define(stmt.catchParameter, this.normalizeCaughtError(e));
|
|
169
245
|
await this.executeBlock(stmt.catchBlock, catchEnv);
|
|
170
246
|
}
|
|
247
|
+
finally {
|
|
248
|
+
if (stmt.finallyBlock) {
|
|
249
|
+
await this.executeBlock(stmt.finallyBlock, new types_1.Environment(this.currentEnv));
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
normalizeCaughtError(error) {
|
|
254
|
+
if (error instanceof types_1.SesiRuntimeError) {
|
|
255
|
+
return error.toRuntimeObject();
|
|
256
|
+
}
|
|
257
|
+
if (error instanceof Error) {
|
|
258
|
+
return error.message;
|
|
259
|
+
}
|
|
260
|
+
return String(error);
|
|
171
261
|
}
|
|
172
262
|
async executeIf(stmt) {
|
|
173
263
|
const condition = await this.evaluateExpression(stmt.condition);
|
|
@@ -260,41 +350,46 @@ class Interpreter {
|
|
|
260
350
|
this.currentEnv.define(stmt.name, stringValue);
|
|
261
351
|
}
|
|
262
352
|
async evaluateExpression(expr) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
353
|
+
try {
|
|
354
|
+
switch (expr.type) {
|
|
355
|
+
case 'Literal':
|
|
356
|
+
return (expr).value;
|
|
357
|
+
case 'Identifier':
|
|
358
|
+
return this.currentEnv.get((expr).name);
|
|
359
|
+
case 'BinaryOp':
|
|
360
|
+
return await this.evaluateBinaryOp(expr);
|
|
361
|
+
case 'UnaryOp':
|
|
362
|
+
return await this.evaluateUnaryOp(expr);
|
|
363
|
+
case 'LogicalOp':
|
|
364
|
+
return await this.evaluateLogicalOp(expr);
|
|
365
|
+
case 'Assignment':
|
|
366
|
+
return await this.evaluateAssignment(expr);
|
|
367
|
+
case 'CallExpression':
|
|
368
|
+
return await this.evaluateCall(expr);
|
|
369
|
+
case 'MemberExpression':
|
|
370
|
+
return await this.evaluateMember(expr);
|
|
371
|
+
case 'IndexExpression':
|
|
372
|
+
return await this.evaluateIndex(expr);
|
|
373
|
+
case 'ArrayLiteral':
|
|
374
|
+
return await this.evaluateArray(expr);
|
|
375
|
+
case 'ObjectLiteral':
|
|
376
|
+
return await this.evaluateObject(expr);
|
|
377
|
+
case 'PromptExpression':
|
|
378
|
+
return await this.evaluatePrompt(expr);
|
|
379
|
+
case 'ImageCallExpression':
|
|
380
|
+
return await this.evaluateImageCall(expr);
|
|
381
|
+
case 'ModelCallExpression':
|
|
382
|
+
return await this.evaluateModelCall(expr);
|
|
383
|
+
case 'StructuredOutputExpression':
|
|
384
|
+
return await this.evaluateStructuredOutput(expr);
|
|
385
|
+
case 'ToolCallExpression':
|
|
386
|
+
return await this.evaluateToolCall(expr);
|
|
387
|
+
default:
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
catch (error) {
|
|
392
|
+
this.rethrowWithContext(error, expr.line);
|
|
298
393
|
}
|
|
299
394
|
}
|
|
300
395
|
async evaluateBinaryOp(expr) {
|
|
@@ -488,7 +583,7 @@ class Interpreter {
|
|
|
488
583
|
}
|
|
489
584
|
}
|
|
490
585
|
const response = await ai_runtime_1.aiRuntime.callModel({
|
|
491
|
-
model: expr.modelName,
|
|
586
|
+
model: this.resolveModelName(expr.modelName),
|
|
492
587
|
prompt: promptText,
|
|
493
588
|
temperature: expr.config?.temperature ? await this.evaluateExpression(expr.config.temperature) : undefined,
|
|
494
589
|
maxTokens: expr.config?.max_tokens ? await this.evaluateExpression(expr.config.max_tokens) : undefined,
|
|
@@ -546,7 +641,7 @@ class Interpreter {
|
|
|
546
641
|
}
|
|
547
642
|
}
|
|
548
643
|
const response = await ai_runtime_1.aiRuntime.callModel({
|
|
549
|
-
model: expr.modelName,
|
|
644
|
+
model: this.resolveModelName(expr.modelName),
|
|
550
645
|
prompt: promptText,
|
|
551
646
|
temperature: expr.config?.temperature ? await this.evaluateExpression(expr.config.temperature) : undefined,
|
|
552
647
|
maxTokens: expr.config?.max_tokens ? await this.evaluateExpression(expr.config.max_tokens) : undefined,
|
|
@@ -558,20 +653,33 @@ class Interpreter {
|
|
|
558
653
|
return response.text;
|
|
559
654
|
}
|
|
560
655
|
async evaluateStructuredOutput(expr) {
|
|
561
|
-
const
|
|
656
|
+
const inputVal = await this.evaluateExpression(expr.modelCall);
|
|
562
657
|
const schemaObj = {};
|
|
563
658
|
for (const [key, typeAnnotation] of Object.entries(expr.schema)) {
|
|
564
659
|
schemaObj[key] = typeAnnotation.name || 'string';
|
|
565
660
|
}
|
|
566
|
-
|
|
567
|
-
|
|
661
|
+
if (typeof inputVal === 'string') {
|
|
662
|
+
const structured = await ai_runtime_1.aiRuntime.parseStructuredOutput(inputVal, schemaObj);
|
|
663
|
+
return structured;
|
|
664
|
+
}
|
|
665
|
+
return inputVal;
|
|
568
666
|
}
|
|
569
667
|
async evaluateToolCall(expr) {
|
|
570
668
|
const sensitiveBuiltins = ['exec', 'spawn'];
|
|
571
669
|
if (sensitiveBuiltins.includes(expr.functionName)) {
|
|
572
670
|
throw new Error(`Security Violation: Automated execution of sensitive tool "${expr.functionName}" is forbidden.`);
|
|
573
671
|
}
|
|
574
|
-
|
|
672
|
+
let fn;
|
|
673
|
+
if (this.currentEnv.exists(expr.functionName)) {
|
|
674
|
+
fn = this.currentEnv.get(expr.functionName);
|
|
675
|
+
}
|
|
676
|
+
else {
|
|
677
|
+
const custom = this.getCustomTool(expr.functionName);
|
|
678
|
+
if (!custom) {
|
|
679
|
+
throw new Error(`Tool not found: ${expr.functionName}`);
|
|
680
|
+
}
|
|
681
|
+
fn = custom;
|
|
682
|
+
}
|
|
575
683
|
if (typeof fn !== 'object' || !fn || fn.type !== 'function') {
|
|
576
684
|
throw new Error(`Tool not found: ${expr.functionName}`);
|
|
577
685
|
}
|
|
@@ -668,8 +776,9 @@ class Interpreter {
|
|
|
668
776
|
// Sub-interpreter inherits the resolved module's own directory so its imports also resolve correctly
|
|
669
777
|
const subInterpreter = new Interpreter(path.dirname(resolvedPath), {
|
|
670
778
|
safeMode: this.safeMode,
|
|
671
|
-
|
|
672
|
-
allowedPaths: this.allowedPaths
|
|
779
|
+
allowLocalFs: this.allowLocalFs,
|
|
780
|
+
allowedPaths: this.allowedPaths,
|
|
781
|
+
args: this.args
|
|
673
782
|
});
|
|
674
783
|
await subInterpreter.interpret(program);
|
|
675
784
|
moduleExports = subInterpreter.exports;
|