oricore 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XKZSVWRX.js → chunk-4QYFQSAC.js} +250 -99
- package/dist/chunk-4QYFQSAC.js.map +1 -0
- package/dist/{chunk-SXDGT4YB.js → chunk-DO76AL42.js} +1813 -457
- package/dist/chunk-DO76AL42.js.map +1 -0
- package/dist/{chunk-AXJGNOSQ.js → chunk-OYWDQD3F.js} +2 -2
- package/dist/history-AGNMX5YW.js +8 -0
- package/dist/index.cjs +2008 -496
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/dist/{session-34VFUDZB.js → session-QMS6OYG2.js} +4 -4
- package/dist/undici-326ZBRKH.js +5 -0
- package/package.json +1 -1
- package/src/core/loop.ts +79 -25
- package/src/core/model/models.ts +69 -0
- package/src/core/model/providers.ts +76 -37
- package/src/core/model/resolution.ts +13 -0
- package/src/mcp/mcp.ts +4 -1
- package/src/skill/skill.ts +18 -3
- package/src/utils/messageNormalization.ts +18 -0
- package/dist/chunk-SXDGT4YB.js.map +0 -1
- package/dist/chunk-XKZSVWRX.js.map +0 -1
- package/dist/history-3JS745YJ.js +0 -8
- package/dist/undici-DJO5UB2C.js +0 -5
- /package/dist/{chunk-AXJGNOSQ.js.map → chunk-OYWDQD3F.js.map} +0 -0
- /package/dist/{history-3JS745YJ.js.map → history-AGNMX5YW.js.map} +0 -0
- /package/dist/{session-34VFUDZB.js.map → session-QMS6OYG2.js.map} +0 -0
- /package/dist/{undici-DJO5UB2C.js.map → undici-326ZBRKH.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Session,
|
|
3
3
|
SessionConfigManager,
|
|
4
4
|
loadSessionMessages
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OYWDQD3F.js";
|
|
6
6
|
import {
|
|
7
7
|
Compression,
|
|
8
8
|
ConfigManager,
|
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
resolveTools,
|
|
20
20
|
runLoop,
|
|
21
21
|
safeStringify
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-4QYFQSAC.js";
|
|
23
|
+
import "./chunk-DO76AL42.js";
|
|
24
24
|
|
|
25
25
|
// src/core/context.ts
|
|
26
26
|
import fs10 from "fs";
|
|
@@ -2213,8 +2213,10 @@ var MCPManager = class _MCPManager {
|
|
|
2213
2213
|
return true;
|
|
2214
2214
|
}
|
|
2215
2215
|
#convertAiSdkToolToLocal(toolName, toolDef, serverName, config) {
|
|
2216
|
+
const safeServerName = serverName.replace(/[^a-zA-Z0-9_-]/g, "");
|
|
2217
|
+
const safeToolName = toolName.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
2216
2218
|
return {
|
|
2217
|
-
name: `mcp__${
|
|
2219
|
+
name: `mcp__${safeServerName}__${safeToolName}`,
|
|
2218
2220
|
description: toolDef.description,
|
|
2219
2221
|
getDescription: ({ params }) => {
|
|
2220
2222
|
return formatParamsDescription(params);
|
|
@@ -2441,6 +2443,16 @@ import degit from "degit";
|
|
|
2441
2443
|
import fs9 from "fs";
|
|
2442
2444
|
import os3 from "os";
|
|
2443
2445
|
import path9 from "pathe";
|
|
2446
|
+
function isDirOrSymlinkToDir(parentDir, entry) {
|
|
2447
|
+
if (entry.isDirectory()) return true;
|
|
2448
|
+
if (entry.isSymbolicLink()) {
|
|
2449
|
+
try {
|
|
2450
|
+
return fs9.statSync(path9.join(parentDir, entry.name)).isDirectory();
|
|
2451
|
+
} catch {
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
return false;
|
|
2455
|
+
}
|
|
2444
2456
|
var SkillSource = /* @__PURE__ */ ((SkillSource2) => {
|
|
2445
2457
|
SkillSource2["Plugin"] = "plugin";
|
|
2446
2458
|
SkillSource2["GlobalClaude"] = "global-claude";
|
|
@@ -2531,7 +2543,7 @@ var SkillManager = class {
|
|
|
2531
2543
|
try {
|
|
2532
2544
|
const entries = fs9.readdirSync(skillsDir, { withFileTypes: true });
|
|
2533
2545
|
for (const entry of entries) {
|
|
2534
|
-
if (entry
|
|
2546
|
+
if (isDirOrSymlinkToDir(skillsDir, entry)) {
|
|
2535
2547
|
const skillPath = path9.join(skillsDir, entry.name, "SKILL.md");
|
|
2536
2548
|
if (fs9.existsSync(skillPath)) {
|
|
2537
2549
|
this.loadSkillFile(skillPath, source);
|
|
@@ -2741,7 +2753,7 @@ var SkillManager = class {
|
|
|
2741
2753
|
if (fs9.existsSync(skillsDir) && fs9.statSync(skillsDir).isDirectory()) {
|
|
2742
2754
|
const entries2 = fs9.readdirSync(skillsDir, { withFileTypes: true });
|
|
2743
2755
|
for (const entry of entries2) {
|
|
2744
|
-
if (entry
|
|
2756
|
+
if (isDirOrSymlinkToDir(skillsDir, entry)) {
|
|
2745
2757
|
const skillPath = path9.join(skillsDir, entry.name, "SKILL.md");
|
|
2746
2758
|
if (fs9.existsSync(skillPath)) {
|
|
2747
2759
|
skills.push(skillPath);
|
|
@@ -2754,7 +2766,7 @@ var SkillManager = class {
|
|
|
2754
2766
|
}
|
|
2755
2767
|
const entries = fs9.readdirSync(dir, { withFileTypes: true });
|
|
2756
2768
|
for (const entry of entries) {
|
|
2757
|
-
if (entry
|
|
2769
|
+
if (isDirOrSymlinkToDir(dir, entry)) {
|
|
2758
2770
|
const skillPath = path9.join(dir, entry.name, "SKILL.md");
|
|
2759
2771
|
if (fs9.existsSync(skillPath)) {
|
|
2760
2772
|
skills.push(skillPath);
|
|
@@ -4001,12 +4013,12 @@ var Engine = class {
|
|
|
4001
4013
|
const systemPrompt = context.config.systemPrompt || "";
|
|
4002
4014
|
let sessionHistory = void 0;
|
|
4003
4015
|
if (options.sessionId) {
|
|
4004
|
-
const { loadSessionMessages: loadSessionMessages2 } = await import("./session-
|
|
4016
|
+
const { loadSessionMessages: loadSessionMessages2 } = await import("./session-QMS6OYG2.js");
|
|
4005
4017
|
const logPath = context.paths.getSessionLogPath(sessionId);
|
|
4006
4018
|
try {
|
|
4007
4019
|
const existingMessages = loadSessionMessages2({ logPath });
|
|
4008
4020
|
if (existingMessages.length > 0) {
|
|
4009
|
-
const { History: History2 } = await import("./history-
|
|
4021
|
+
const { History: History2 } = await import("./history-AGNMX5YW.js");
|
|
4010
4022
|
sessionHistory = new History2({
|
|
4011
4023
|
messages: existingMessages
|
|
4012
4024
|
});
|