dirac-lang 0.1.84 → 0.1.86
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/dist/{agent-VAFUNYDM.js → agent-UMP5VWLO.js} +5 -5
- package/dist/{chunk-M57VI7KL.js → chunk-2VFQ2YBT.js} +7 -0
- package/dist/{chunk-VUMS53GF.js → chunk-AEYISK7W.js} +2 -2
- package/dist/{chunk-FPDW535D.js → chunk-BGG2SULN.js} +1 -1
- package/dist/{chunk-VC23AJJJ.js → chunk-HJSHCEK4.js} +1 -1
- package/dist/{chunk-CLGQYGHT.js → chunk-VEFJ4NM3.js} +2 -2
- package/dist/{chunk-TYIDNAZ7.js → chunk-WVFFIHZL.js} +21 -21
- package/dist/cli.js +22 -16
- package/dist/{cron-RWSM6IBB.js → cron-UH6AQRDK.js} +4 -4
- package/dist/index.js +5 -5
- package/dist/interpreter-LTE43E4A.js +12 -0
- package/dist/{run-at-3QL4C4UD.js → run-at-L2N6DS6Y.js} +4 -4
- package/dist/{schedule-4B3KUC7T.js → schedule-JTX4TJ5U.js} +4 -4
- package/dist/{session-OL5ARO6Q.js → session-YZHVQ4XN.js} +1 -1
- package/dist/{session-server-IDEV4CXY.js → session-server-I3XM7YYC.js} +5 -5
- package/dist/{shell-QEN2FMAY.js → shell-HINR647H.js} +41 -22
- package/dist/{subroutine-OQJ3AY27.js → subroutine-5SNHBXRN.js} +2 -2
- package/dist/{subroutine-index-7B5YXKAA.js → subroutine-index-E6XE6XNL.js} +2 -2
- package/dist/{tag-validator-JZVMOKGK.js → tag-validator-DBQVSG75.js} +1 -1
- package/dist/test-runner.js +4 -4
- package/package.json +1 -1
- package/dist/interpreter-X5V2FFGI.js +0 -12
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
SessionServer,
|
|
3
3
|
getSocketPath,
|
|
4
4
|
isSessionRunning
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-VEFJ4NM3.js";
|
|
6
|
+
import "./chunk-WVFFIHZL.js";
|
|
7
|
+
import "./chunk-HJSHCEK4.js";
|
|
8
|
+
import "./chunk-BGG2SULN.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-2VFQ2YBT.js";
|
|
11
11
|
|
|
12
12
|
// src/agent.ts
|
|
13
13
|
import fs from "fs";
|
|
@@ -150,6 +150,13 @@ function createSession(config = {}) {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
function setVariable(session, name, value, visible = false) {
|
|
153
|
+
for (let i = session.variables.length - 1; i >= 0; i--) {
|
|
154
|
+
if (session.variables[i].name === name && session.variables[i].boundary === session.varBoundary) {
|
|
155
|
+
session.variables[i].value = value;
|
|
156
|
+
session.variables[i].visible = visible;
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
153
160
|
session.variables.push({
|
|
154
161
|
name,
|
|
155
162
|
value,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
integrate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WVFFIHZL.js";
|
|
4
4
|
import {
|
|
5
5
|
DiracParser
|
|
6
6
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
createSession,
|
|
9
9
|
getAvailableSubroutines,
|
|
10
10
|
getOutput
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2VFQ2YBT.js";
|
|
12
12
|
|
|
13
13
|
// src/utils/llm-adapter.ts
|
|
14
14
|
function createLLMAdapter(session) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
integrate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WVFFIHZL.js";
|
|
4
4
|
import {
|
|
5
5
|
DiracParser
|
|
6
6
|
} from "./chunk-HRHAMPOB.js";
|
|
7
7
|
import {
|
|
8
8
|
createSession
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2VFQ2YBT.js";
|
|
10
10
|
|
|
11
11
|
// src/session-server.ts
|
|
12
12
|
import net from "net";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeSubroutine
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HJSHCEK4.js";
|
|
4
4
|
import {
|
|
5
5
|
executeIndexSubroutines,
|
|
6
6
|
executeRegistryStats,
|
|
7
7
|
executeSearchSubroutines,
|
|
8
8
|
registry
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BGG2SULN.js";
|
|
10
10
|
import {
|
|
11
11
|
DiracParser
|
|
12
12
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
substituteVariables,
|
|
35
35
|
throwException,
|
|
36
36
|
unsetExceptionBoundary
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-2VFQ2YBT.js";
|
|
38
38
|
|
|
39
39
|
// src/tags/parameters.ts
|
|
40
40
|
async function executeParameters(session, element) {
|
|
@@ -297,7 +297,7 @@ async function executeCall(session, element) {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
async function registerExtendChain(session, subroutine, currentName) {
|
|
300
|
-
const { executeSubroutine: executeSubroutine2 } = await import("./subroutine-
|
|
300
|
+
const { executeSubroutine: executeSubroutine2 } = await import("./subroutine-5SNHBXRN.js");
|
|
301
301
|
const extendsAttr = subroutine.attributes.extends;
|
|
302
302
|
let parentName;
|
|
303
303
|
if (extendsAttr) {
|
|
@@ -487,12 +487,12 @@ async function executeIf(session, element) {
|
|
|
487
487
|
const condition = await evaluatePredicate(session, conditionElement);
|
|
488
488
|
if (condition) {
|
|
489
489
|
if (thenElement) {
|
|
490
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
490
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
|
|
491
491
|
await integrateChildren2(session, thenElement);
|
|
492
492
|
}
|
|
493
493
|
} else {
|
|
494
494
|
if (elseElement) {
|
|
495
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
495
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
|
|
496
496
|
await integrateChildren2(session, elseElement);
|
|
497
497
|
}
|
|
498
498
|
}
|
|
@@ -505,7 +505,7 @@ async function evaluatePredicate(session, predicateElement) {
|
|
|
505
505
|
return await evaluateCondition(session, predicateElement);
|
|
506
506
|
}
|
|
507
507
|
const outputLengthBefore = session.output.length;
|
|
508
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
508
|
+
const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
|
|
509
509
|
await integrate2(session, predicateElement);
|
|
510
510
|
const newOutputChunks = session.output.slice(outputLengthBefore);
|
|
511
511
|
const result = newOutputChunks.join("").trim();
|
|
@@ -528,11 +528,11 @@ async function evaluateCondition(session, condElement) {
|
|
|
528
528
|
}
|
|
529
529
|
const outputLengthBefore = session.output.length;
|
|
530
530
|
const args = [];
|
|
531
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
531
|
+
const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
|
|
532
532
|
for (const child of condElement.children) {
|
|
533
533
|
if (child.tag.toLowerCase() === "arg") {
|
|
534
534
|
const argOutputStart = session.output.length;
|
|
535
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
535
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
|
|
536
536
|
await integrateChildren2(session, child);
|
|
537
537
|
const newChunks = session.output.slice(argOutputStart);
|
|
538
538
|
const argValue = newChunks.join("");
|
|
@@ -763,7 +763,7 @@ async function executeLLM(session, element) {
|
|
|
763
763
|
const isOpenAI = providerName === "OpenAI";
|
|
764
764
|
const isOllama = providerName === "OllamaProvider";
|
|
765
765
|
const isCustom = providerName === "CustomLLMProvider";
|
|
766
|
-
const defaultModel = isOpenAI ? "gpt-4.1-2025-04-14" : isOllama ? "llama2" : isCustom ? "custom-model" : "claude-sonnet-4-
|
|
766
|
+
const defaultModel = isOpenAI ? "gpt-4.1-2025-04-14" : isOllama ? "llama2" : isCustom ? "custom-model" : "claude-sonnet-4-5-20250929";
|
|
767
767
|
const model = element.attributes.model || process.env.DEFAULT_MODEL || defaultModel;
|
|
768
768
|
const outputVar = element.attributes.output;
|
|
769
769
|
const contextVar = element.attributes.context;
|
|
@@ -821,7 +821,7 @@ async function executeLLM(session, element) {
|
|
|
821
821
|
let systemPrompt = "";
|
|
822
822
|
let currentUserPrompt = userPrompt;
|
|
823
823
|
if (!noExtra) {
|
|
824
|
-
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-
|
|
824
|
+
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-YZHVQ4XN.js");
|
|
825
825
|
const allSubroutines = getAvailableSubroutines2(session);
|
|
826
826
|
if (session.debug) {
|
|
827
827
|
console.error(`[LLM] Total subroutines from session: ${allSubroutines.length}`);
|
|
@@ -1025,7 +1025,7 @@ ${result}
|
|
|
1025
1025
|
const parser = new DiracParser();
|
|
1026
1026
|
let dynamicAST = parser.parse(diracCode);
|
|
1027
1027
|
if (validateTags) {
|
|
1028
|
-
const { validateDiracCode, applyCorrectedTags } = await import("./tag-validator-
|
|
1028
|
+
const { validateDiracCode, applyCorrectedTags } = await import("./tag-validator-DBQVSG75.js");
|
|
1029
1029
|
let validation = await validateDiracCode(session, dynamicAST, { autocorrect });
|
|
1030
1030
|
let retryCount = 0;
|
|
1031
1031
|
while (!validation.valid && retryCount < maxRetries) {
|
|
@@ -1663,7 +1663,7 @@ async function getBestTagMatch(candidate, allowed) {
|
|
|
1663
1663
|
return { tag: allowed[bestIdx], score: bestScore };
|
|
1664
1664
|
}
|
|
1665
1665
|
async function executeTagCheck(session, element) {
|
|
1666
|
-
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-
|
|
1666
|
+
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-YZHVQ4XN.js");
|
|
1667
1667
|
const subroutines = getAvailableSubroutines2(session);
|
|
1668
1668
|
const allowed = new Set(subroutines.map((s) => s.name));
|
|
1669
1669
|
console.error("[tag-check] Allowed subroutines:", Array.from(allowed));
|
|
@@ -1756,7 +1756,7 @@ async function executeTagCheck(session, element) {
|
|
|
1756
1756
|
const executeTag = correctedTag || tagName;
|
|
1757
1757
|
console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
|
|
1758
1758
|
const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
|
|
1759
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1759
|
+
const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
|
|
1760
1760
|
await integrate2(session, elementToExecute);
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
@@ -1765,7 +1765,7 @@ async function executeTagCheck(session, element) {
|
|
|
1765
1765
|
// src/tags/throw.ts
|
|
1766
1766
|
async function executeThrow(session, element) {
|
|
1767
1767
|
const exceptionName = element.attributes?.name || "exception";
|
|
1768
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1768
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
|
|
1769
1769
|
const exceptionDom = {
|
|
1770
1770
|
tag: "exception-content",
|
|
1771
1771
|
attributes: { name: exceptionName },
|
|
@@ -1778,7 +1778,7 @@ async function executeThrow(session, element) {
|
|
|
1778
1778
|
// src/tags/try.ts
|
|
1779
1779
|
async function executeTry(session, element) {
|
|
1780
1780
|
setExceptionBoundary(session);
|
|
1781
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1781
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
|
|
1782
1782
|
await integrateChildren2(session, element);
|
|
1783
1783
|
unsetExceptionBoundary(session);
|
|
1784
1784
|
}
|
|
@@ -1788,7 +1788,7 @@ async function executeCatch(session, element) {
|
|
|
1788
1788
|
const exceptionName = element.attributes?.name || "exception";
|
|
1789
1789
|
const caughtCount = lookupException(session, exceptionName);
|
|
1790
1790
|
if (caughtCount > 0) {
|
|
1791
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1791
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
|
|
1792
1792
|
await integrateChildren2(session, element);
|
|
1793
1793
|
}
|
|
1794
1794
|
flushCurrentException(session);
|
|
@@ -1797,7 +1797,7 @@ async function executeCatch(session, element) {
|
|
|
1797
1797
|
// src/tags/exception.ts
|
|
1798
1798
|
async function executeException(session, element) {
|
|
1799
1799
|
const exceptions = getCurrentExceptions(session);
|
|
1800
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1800
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
|
|
1801
1801
|
for (const exceptionDom of exceptions) {
|
|
1802
1802
|
await integrateChildren2(session, exceptionDom);
|
|
1803
1803
|
}
|
|
@@ -1998,7 +1998,7 @@ async function executeLoadContext(session, element) {
|
|
|
1998
1998
|
query = element.text.trim();
|
|
1999
1999
|
}
|
|
2000
2000
|
if (!query && element.children.length > 0) {
|
|
2001
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2001
|
+
const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
|
|
2002
2002
|
const beforeOutput = session.output.length;
|
|
2003
2003
|
for (const child of element.children) {
|
|
2004
2004
|
await integrate2(session, child);
|
|
@@ -2067,7 +2067,7 @@ async function executeLoadContext(session, element) {
|
|
|
2067
2067
|
parameters: s.parameters.map((p) => p.name),
|
|
2068
2068
|
filePath: s.filePath
|
|
2069
2069
|
}));
|
|
2070
|
-
const { setVariable: setVariable2 } = await import("./session-
|
|
2070
|
+
const { setVariable: setVariable2 } = await import("./session-YZHVQ4XN.js");
|
|
2071
2071
|
setVariable2(session, outputVar, JSON.stringify(summary, null, 2), false);
|
|
2072
2072
|
}
|
|
2073
2073
|
}
|
|
@@ -2429,7 +2429,7 @@ async function executeForeach(session, element) {
|
|
|
2429
2429
|
const parser2 = new DiracParser2();
|
|
2430
2430
|
try {
|
|
2431
2431
|
const fromElement = parser2.parse(fromAttr);
|
|
2432
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2432
|
+
const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
|
|
2433
2433
|
await integrate2(session, fromElement);
|
|
2434
2434
|
} catch (e) {
|
|
2435
2435
|
session.output = savedOutput;
|
package/dist/cli.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-AJSYOXXZ.js";
|
|
5
5
|
import {
|
|
6
6
|
execute
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-AEYISK7W.js";
|
|
8
|
+
import "./chunk-WVFFIHZL.js";
|
|
9
|
+
import "./chunk-HJSHCEK4.js";
|
|
10
|
+
import "./chunk-BGG2SULN.js";
|
|
11
11
|
import "./chunk-HRHAMPOB.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-2VFQ2YBT.js";
|
|
13
13
|
|
|
14
14
|
// src/cli.ts
|
|
15
15
|
import "dotenv/config";
|
|
@@ -17,7 +17,7 @@ import "dotenv/config";
|
|
|
17
17
|
// package.json
|
|
18
18
|
var package_default = {
|
|
19
19
|
name: "dirac-lang",
|
|
20
|
-
version: "0.1.
|
|
20
|
+
version: "0.1.86",
|
|
21
21
|
description: "LLM-Augmented Declarative Execution",
|
|
22
22
|
type: "module",
|
|
23
23
|
main: "dist/index.js",
|
|
@@ -115,13 +115,19 @@ function loadShellConfig(args = []) {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
if (!shellConfig.llmProvider) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
if (process.env.LLM_PROVIDER) {
|
|
119
|
+
shellConfig.llmProvider = process.env.LLM_PROVIDER;
|
|
120
|
+
}
|
|
121
|
+
if (process.env.LLM_MODEL) {
|
|
122
|
+
shellConfig.llmModel = process.env.LLM_MODEL;
|
|
123
|
+
}
|
|
124
|
+
if (process.env.CUSTOM_LLM_URL) {
|
|
125
|
+
shellConfig.customLLMUrl = process.env.CUSTOM_LLM_URL;
|
|
126
|
+
}
|
|
121
127
|
if (!shellConfig.llmProvider) {
|
|
122
128
|
if (process.env.ANTHROPIC_API_KEY) {
|
|
123
129
|
shellConfig.llmProvider = "anthropic";
|
|
124
|
-
shellConfig.llmModel = shellConfig.llmModel || "claude-sonnet-4-
|
|
130
|
+
shellConfig.llmModel = shellConfig.llmModel || "claude-sonnet-4-5-20250929";
|
|
125
131
|
} else if (process.env.OPENAI_API_KEY) {
|
|
126
132
|
shellConfig.llmProvider = "openai";
|
|
127
133
|
shellConfig.llmModel = shellConfig.llmModel || "gpt-4o";
|
|
@@ -145,7 +151,7 @@ async function main() {
|
|
|
145
151
|
const args = process.argv.slice(2);
|
|
146
152
|
const calledAs = process.argv[1];
|
|
147
153
|
if (calledAs && calledAs.endsWith("/dish")) {
|
|
148
|
-
const { DiracShell } = await import("./shell-
|
|
154
|
+
const { DiracShell } = await import("./shell-HINR647H.js");
|
|
149
155
|
const shellConfig = loadShellConfig(args);
|
|
150
156
|
const shell = new DiracShell(shellConfig);
|
|
151
157
|
await shell.start();
|
|
@@ -194,11 +200,11 @@ async function main() {
|
|
|
194
200
|
if (args[0] === "agent") {
|
|
195
201
|
const subcommand = args[1];
|
|
196
202
|
if (subcommand === "daemon") {
|
|
197
|
-
const { runAgentDaemon } = await import("./agent-
|
|
203
|
+
const { runAgentDaemon } = await import("./agent-UMP5VWLO.js");
|
|
198
204
|
await runAgentDaemon();
|
|
199
205
|
return;
|
|
200
206
|
}
|
|
201
|
-
const { AgentCLI } = await import("./agent-
|
|
207
|
+
const { AgentCLI } = await import("./agent-UMP5VWLO.js");
|
|
202
208
|
const agent = new AgentCLI();
|
|
203
209
|
switch (subcommand) {
|
|
204
210
|
case "start":
|
|
@@ -225,8 +231,8 @@ async function main() {
|
|
|
225
231
|
return;
|
|
226
232
|
}
|
|
227
233
|
if (args[0] === "shell") {
|
|
228
|
-
const { DiracShell } = await import("./shell-
|
|
229
|
-
const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-
|
|
234
|
+
const { DiracShell } = await import("./shell-HINR647H.js");
|
|
235
|
+
const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-I3XM7YYC.js");
|
|
230
236
|
const { SessionClient } = await import("./session-client-3VTC5MLO.js");
|
|
231
237
|
const daemonMode = args.includes("--daemon") || args.includes("-d");
|
|
232
238
|
const agentMode = args.includes("--agent") || args.includes("-a");
|
|
@@ -272,7 +278,7 @@ async function main() {
|
|
|
272
278
|
return;
|
|
273
279
|
}
|
|
274
280
|
if (args[0] === "daemon") {
|
|
275
|
-
const { SessionServer } = await import("./session-server-
|
|
281
|
+
const { SessionServer } = await import("./session-server-I3XM7YYC.js");
|
|
276
282
|
const server = new SessionServer();
|
|
277
283
|
await server.start();
|
|
278
284
|
console.log("Session daemon started");
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
listCronJobs,
|
|
4
4
|
stopAllCronJobs,
|
|
5
5
|
stopCronJob
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-WVFFIHZL.js";
|
|
7
|
+
import "./chunk-HJSHCEK4.js";
|
|
8
|
+
import "./chunk-BGG2SULN.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-2VFQ2YBT.js";
|
|
11
11
|
export {
|
|
12
12
|
executeCron,
|
|
13
13
|
listCronJobs,
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
createLLMAdapter,
|
|
3
3
|
execute,
|
|
4
4
|
executeUserCommand
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AEYISK7W.js";
|
|
6
6
|
import {
|
|
7
7
|
integrate
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-WVFFIHZL.js";
|
|
9
|
+
import "./chunk-HJSHCEK4.js";
|
|
10
|
+
import "./chunk-BGG2SULN.js";
|
|
11
11
|
import {
|
|
12
12
|
DiracParser
|
|
13
13
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
createSession,
|
|
16
16
|
getAvailableSubroutines,
|
|
17
17
|
getOutput
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2VFQ2YBT.js";
|
|
19
19
|
export {
|
|
20
20
|
DiracParser,
|
|
21
21
|
createLLMAdapter,
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
cancelScheduledRun,
|
|
4
4
|
executeRunAt,
|
|
5
5
|
listScheduledRuns
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-WVFFIHZL.js";
|
|
7
|
+
import "./chunk-HJSHCEK4.js";
|
|
8
|
+
import "./chunk-BGG2SULN.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-2VFQ2YBT.js";
|
|
11
11
|
export {
|
|
12
12
|
cancelAllScheduledRuns,
|
|
13
13
|
cancelScheduledRun,
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
listScheduledTasks,
|
|
4
4
|
stopAllScheduledTasks,
|
|
5
5
|
stopScheduledTask
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-WVFFIHZL.js";
|
|
7
|
+
import "./chunk-HJSHCEK4.js";
|
|
8
|
+
import "./chunk-BGG2SULN.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-2VFQ2YBT.js";
|
|
11
11
|
export {
|
|
12
12
|
executeSchedule,
|
|
13
13
|
listScheduledTasks,
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
SessionServer,
|
|
3
3
|
getSocketPath,
|
|
4
4
|
isSessionRunning
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-VEFJ4NM3.js";
|
|
6
|
+
import "./chunk-WVFFIHZL.js";
|
|
7
|
+
import "./chunk-HJSHCEK4.js";
|
|
8
|
+
import "./chunk-BGG2SULN.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-2VFQ2YBT.js";
|
|
11
11
|
export {
|
|
12
12
|
SessionServer,
|
|
13
13
|
getSocketPath,
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
} from "./chunk-AJSYOXXZ.js";
|
|
5
5
|
import {
|
|
6
6
|
integrate
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-WVFFIHZL.js";
|
|
8
|
+
import "./chunk-HJSHCEK4.js";
|
|
9
|
+
import "./chunk-BGG2SULN.js";
|
|
10
10
|
import {
|
|
11
11
|
DiracParser
|
|
12
12
|
} from "./chunk-HRHAMPOB.js";
|
|
13
13
|
import {
|
|
14
14
|
createSession
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2VFQ2YBT.js";
|
|
16
16
|
|
|
17
17
|
// src/shell.ts
|
|
18
18
|
import * as readline from "readline";
|
|
@@ -360,7 +360,7 @@ var DiracShell = class {
|
|
|
360
360
|
if (this.client) {
|
|
361
361
|
this.client.disconnect();
|
|
362
362
|
}
|
|
363
|
-
import("./schedule-
|
|
363
|
+
import("./schedule-JTX4TJ5U.js").then(({ stopAllScheduledTasks }) => {
|
|
364
364
|
stopAllScheduledTasks();
|
|
365
365
|
console.log("\nGoodbye!");
|
|
366
366
|
process.exit(0);
|
|
@@ -582,7 +582,18 @@ Examples:
|
|
|
582
582
|
console.log("Variables:");
|
|
583
583
|
for (const v of variables) {
|
|
584
584
|
if (v.visible) {
|
|
585
|
-
|
|
585
|
+
let formattedValue;
|
|
586
|
+
if (typeof v.value === "object" && v.value !== null) {
|
|
587
|
+
formattedValue = JSON.stringify(v.value, null, 2);
|
|
588
|
+
} else if (typeof v.value === "string" && (v.value.startsWith("[") || v.value.startsWith("{"))) {
|
|
589
|
+
try {
|
|
590
|
+
formattedValue = JSON.stringify(JSON.parse(v.value), null, 2);
|
|
591
|
+
} catch {
|
|
592
|
+
formattedValue = JSON.stringify(v.value);
|
|
593
|
+
}
|
|
594
|
+
} else {
|
|
595
|
+
formattedValue = JSON.stringify(v.value);
|
|
596
|
+
}
|
|
586
597
|
console.log(` ${v.name} =`);
|
|
587
598
|
console.log(formattedValue.split("\n").map((line) => ` ${line}`).join("\n"));
|
|
588
599
|
}
|
|
@@ -753,7 +764,7 @@ Examples:
|
|
|
753
764
|
break;
|
|
754
765
|
case "tasks":
|
|
755
766
|
try {
|
|
756
|
-
const { listScheduledTasks } = await import("./schedule-
|
|
767
|
+
const { listScheduledTasks } = await import("./schedule-JTX4TJ5U.js");
|
|
757
768
|
const tasks = listScheduledTasks();
|
|
758
769
|
if (tasks.length === 0) {
|
|
759
770
|
console.log("No scheduled tasks running.");
|
|
@@ -772,7 +783,7 @@ Examples:
|
|
|
772
783
|
console.log("Usage: :stop <task-name>");
|
|
773
784
|
} else {
|
|
774
785
|
try {
|
|
775
|
-
const { stopScheduledTask } = await import("./schedule-
|
|
786
|
+
const { stopScheduledTask } = await import("./schedule-JTX4TJ5U.js");
|
|
776
787
|
const taskName = args[0];
|
|
777
788
|
const stopped = stopScheduledTask(taskName);
|
|
778
789
|
if (stopped) {
|
|
@@ -787,7 +798,7 @@ Examples:
|
|
|
787
798
|
break;
|
|
788
799
|
case "stopall":
|
|
789
800
|
try {
|
|
790
|
-
const { stopAllScheduledTasks } = await import("./schedule-
|
|
801
|
+
const { stopAllScheduledTasks } = await import("./schedule-JTX4TJ5U.js");
|
|
791
802
|
stopAllScheduledTasks();
|
|
792
803
|
console.log("All scheduled tasks stopped.");
|
|
793
804
|
} catch (error) {
|
|
@@ -796,7 +807,7 @@ Examples:
|
|
|
796
807
|
break;
|
|
797
808
|
case "crons":
|
|
798
809
|
try {
|
|
799
|
-
const { listCronJobs } = await import("./cron-
|
|
810
|
+
const { listCronJobs } = await import("./cron-UH6AQRDK.js");
|
|
800
811
|
const jobs = listCronJobs();
|
|
801
812
|
if (jobs.length === 0) {
|
|
802
813
|
console.log("No cron jobs running.");
|
|
@@ -816,7 +827,7 @@ Examples:
|
|
|
816
827
|
console.log("Usage: :stopcron <job-name>");
|
|
817
828
|
} else {
|
|
818
829
|
try {
|
|
819
|
-
const { stopCronJob } = await import("./cron-
|
|
830
|
+
const { stopCronJob } = await import("./cron-UH6AQRDK.js");
|
|
820
831
|
const jobName = args[0];
|
|
821
832
|
const stopped = stopCronJob(jobName);
|
|
822
833
|
if (stopped) {
|
|
@@ -831,7 +842,7 @@ Examples:
|
|
|
831
842
|
break;
|
|
832
843
|
case "stopallcrons":
|
|
833
844
|
try {
|
|
834
|
-
const { stopAllCronJobs } = await import("./cron-
|
|
845
|
+
const { stopAllCronJobs } = await import("./cron-UH6AQRDK.js");
|
|
835
846
|
stopAllCronJobs();
|
|
836
847
|
console.log("All cron jobs stopped.");
|
|
837
848
|
} catch (error) {
|
|
@@ -840,7 +851,7 @@ Examples:
|
|
|
840
851
|
break;
|
|
841
852
|
case "scheduled":
|
|
842
853
|
try {
|
|
843
|
-
const { listScheduledRuns } = await import("./run-at-
|
|
854
|
+
const { listScheduledRuns } = await import("./run-at-L2N6DS6Y.js");
|
|
844
855
|
const runs = listScheduledRuns();
|
|
845
856
|
if (runs.length === 0) {
|
|
846
857
|
console.log("No scheduled runs pending.");
|
|
@@ -860,7 +871,7 @@ Examples:
|
|
|
860
871
|
console.log("Usage: :cancel <run-name>");
|
|
861
872
|
} else {
|
|
862
873
|
try {
|
|
863
|
-
const { cancelScheduledRun } = await import("./run-at-
|
|
874
|
+
const { cancelScheduledRun } = await import("./run-at-L2N6DS6Y.js");
|
|
864
875
|
const runName = args[0];
|
|
865
876
|
const cancelled = cancelScheduledRun(runName);
|
|
866
877
|
if (cancelled) {
|
|
@@ -875,7 +886,7 @@ Examples:
|
|
|
875
886
|
break;
|
|
876
887
|
case "cancelall":
|
|
877
888
|
try {
|
|
878
|
-
const { cancelAllScheduledRuns } = await import("./run-at-
|
|
889
|
+
const { cancelAllScheduledRuns } = await import("./run-at-L2N6DS6Y.js");
|
|
879
890
|
cancelAllScheduledRuns();
|
|
880
891
|
console.log("All scheduled runs cancelled.");
|
|
881
892
|
} catch (error) {
|
|
@@ -943,8 +954,10 @@ Examples:
|
|
|
943
954
|
child.on("close", async (code) => {
|
|
944
955
|
this.rl.resume();
|
|
945
956
|
const commandNotFound = code === 127 || stderrData.includes("command not found");
|
|
946
|
-
|
|
947
|
-
|
|
957
|
+
const likelyNaturalLanguage = code !== 0 && this.isLikelyNaturalLanguage(trimmed);
|
|
958
|
+
if (commandNotFound || likelyNaturalLanguage) {
|
|
959
|
+
const reason = commandNotFound ? "Command not found" : "Command failed, looks like natural language";
|
|
960
|
+
console.log(`\u{1F4A1} ${reason}, trying as AI query...`);
|
|
948
961
|
if (this.config.debug) {
|
|
949
962
|
console.log(`[executing: |ai>${trimmed}]`);
|
|
950
963
|
}
|
|
@@ -972,7 +985,7 @@ Examples:
|
|
|
972
985
|
console.log("Set ANTHROPIC_API_KEY or OPENAI_API_KEY environment variable,");
|
|
973
986
|
console.log("or create ~/.dirac/config.yml with llmProvider and llmModel.\n");
|
|
974
987
|
}
|
|
975
|
-
const { registry } = await import("./subroutine-index-
|
|
988
|
+
const { registry } = await import("./subroutine-index-E6XE6XNL.js");
|
|
976
989
|
const wasIndexed = await registry.autoIndexStdlib();
|
|
977
990
|
await this.loadEssentialSubroutines();
|
|
978
991
|
if (this.config.initScript) {
|
|
@@ -1103,13 +1116,19 @@ async function main() {
|
|
|
1103
1116
|
}
|
|
1104
1117
|
}
|
|
1105
1118
|
if (!configLoaded) {
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1119
|
+
if (process.env.LLM_PROVIDER) {
|
|
1120
|
+
config.llmProvider = process.env.LLM_PROVIDER;
|
|
1121
|
+
}
|
|
1122
|
+
if (process.env.LLM_MODEL) {
|
|
1123
|
+
config.llmModel = process.env.LLM_MODEL;
|
|
1124
|
+
}
|
|
1125
|
+
if (process.env.CUSTOM_LLM_URL) {
|
|
1126
|
+
config.customLLMUrl = process.env.CUSTOM_LLM_URL;
|
|
1127
|
+
}
|
|
1109
1128
|
if (!config.llmProvider) {
|
|
1110
1129
|
if (process.env.ANTHROPIC_API_KEY) {
|
|
1111
1130
|
config.llmProvider = "anthropic";
|
|
1112
|
-
config.llmModel = config.llmModel || "claude-sonnet-4-
|
|
1131
|
+
config.llmModel = config.llmModel || "claude-sonnet-4-5-20250929";
|
|
1113
1132
|
} else if (process.env.OPENAI_API_KEY) {
|
|
1114
1133
|
config.llmProvider = "openai";
|
|
1115
1134
|
config.llmModel = config.llmModel || "gpt-4o";
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
executeRegistryStats,
|
|
4
4
|
executeSearchSubroutines,
|
|
5
5
|
registry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BGG2SULN.js";
|
|
7
7
|
import "./chunk-HRHAMPOB.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-2VFQ2YBT.js";
|
|
9
9
|
export {
|
|
10
10
|
executeIndexSubroutines,
|
|
11
11
|
executeRegistryStats,
|
|
@@ -49,7 +49,7 @@ async function getBestTagMatch(candidate, allowed) {
|
|
|
49
49
|
}
|
|
50
50
|
async function validateTag(session, element, options = {}) {
|
|
51
51
|
const { autocorrect = false, similarityCutoff = SIMILARITY_CUTOFF } = options;
|
|
52
|
-
const { getAvailableSubroutines } = await import("./session-
|
|
52
|
+
const { getAvailableSubroutines } = await import("./session-YZHVQ4XN.js");
|
|
53
53
|
const subroutines = getAvailableSubroutines(session);
|
|
54
54
|
const allowed = new Set(subroutines.map((s) => s.name));
|
|
55
55
|
const tagName = element.tag;
|
package/dist/test-runner.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
integrate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-WVFFIHZL.js";
|
|
4
|
+
import "./chunk-HJSHCEK4.js";
|
|
5
|
+
import "./chunk-BGG2SULN.js";
|
|
6
6
|
import {
|
|
7
7
|
DiracParser
|
|
8
8
|
} from "./chunk-HRHAMPOB.js";
|
|
9
9
|
import {
|
|
10
10
|
createSession,
|
|
11
11
|
getOutput
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2VFQ2YBT.js";
|
|
13
13
|
|
|
14
14
|
// src/test-runner.ts
|
|
15
15
|
import fs from "fs";
|
package/package.json
CHANGED