mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
Fix host import paths after directory reorganization
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getContext as extensionGetContext } from "../../../../extensions.js";
|
||||
import { getContext as extensionGetContext } from "../../../../../extensions.js";
|
||||
|
||||
import { buildCapabilityStatus, mergeVersionHints } from "./capabilities.js";
|
||||
import { debugDebug } from "../../runtime/debug-logging.js";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// ST-BME: SillyTavern 上下文数据读取辅助
|
||||
// 为 prompt 变量扩展(Phase 2)提供统一的 ST 上下文数据接口
|
||||
|
||||
import { getContext } from "../../../extensions.js";
|
||||
import { getContext } from "../../../../extensions.js";
|
||||
|
||||
function safeClone(value, fallback) {
|
||||
if (value == null) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { substituteParamsExtended } from "../../../../script.js";
|
||||
import { substituteParamsExtended } from "../../../../../script.js";
|
||||
import jsyaml from "../vendor/js-yaml.mjs";
|
||||
|
||||
function getTemplateRuntime() {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// ST-BME: LLM 调用封装
|
||||
// 包装 ST 的 sendOpenAIRequest,提供结构化 JSON 输出和重试机制
|
||||
|
||||
import { getRequestHeaders } from "../../../../script.js";
|
||||
import { extension_settings } from "../../../extensions.js";
|
||||
import { chat_completion_sources, sendOpenAIRequest } from "../../../openai.js";
|
||||
import { getRequestHeaders } from "../../../../../script.js";
|
||||
import { extension_settings } from "../../../../extensions.js";
|
||||
import { chat_completion_sources, sendOpenAIRequest } from "../../../../openai.js";
|
||||
import { debugLog, debugWarn } from "../runtime/debug-logging.js";
|
||||
import { resolveTaskGenerationOptions } from "../runtime/generation-options.js";
|
||||
import { resolveLlmConfigSelection } from "./llm-preset-utils.js";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// 目标:在任务预设中复用 Tavern 正则来源(global/preset/character),
|
||||
// 同时叠加任务本地规则,并按任务阶段执行。
|
||||
|
||||
import { extension_settings, getContext } from "../../../extensions.js";
|
||||
import { extension_settings, getContext } from "../../../../extensions.js";
|
||||
import { debugDebug } from "../runtime/debug-logging.js";
|
||||
import { getHostAdapter } from "../host/adapter/index.js";
|
||||
import {
|
||||
|
||||
@@ -26,20 +26,27 @@ registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
if (
|
||||
specifier === "../../../extensions.js" ||
|
||||
specifier === "../../../../extensions.js"
|
||||
specifier === "../../../../extensions.js" ||
|
||||
specifier === "../../../../../extensions.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(extensionsShimSource)}`,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../../script.js") {
|
||||
if (
|
||||
specifier === "../../../../script.js" ||
|
||||
specifier === "../../../../../script.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(scriptShimSource)}`,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../openai.js") {
|
||||
if (
|
||||
specifier === "../../../openai.js" ||
|
||||
specifier === "../../../../openai.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(openAiShimSource)}`,
|
||||
|
||||
@@ -26,20 +26,27 @@ registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
if (
|
||||
specifier === "../../../extensions.js" ||
|
||||
specifier === "../../../../extensions.js"
|
||||
specifier === "../../../../extensions.js" ||
|
||||
specifier === "../../../../../extensions.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(extensionsShimSource)}`,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../../script.js") {
|
||||
if (
|
||||
specifier === "../../../../script.js" ||
|
||||
specifier === "../../../../../script.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(scriptShimSource)}`,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../openai.js") {
|
||||
if (
|
||||
specifier === "../../../openai.js" ||
|
||||
specifier === "../../../../openai.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(openAiShimSource)}`,
|
||||
|
||||
@@ -110,20 +110,27 @@ registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
if (
|
||||
specifier === "../../../extensions.js" ||
|
||||
specifier === "../../../../extensions.js"
|
||||
specifier === "../../../../extensions.js" ||
|
||||
specifier === "../../../../../extensions.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: extensionsShimUrl,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../../script.js") {
|
||||
if (
|
||||
specifier === "../../../../script.js" ||
|
||||
specifier === "../../../../../script.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: scriptShimUrl,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../openai.js") {
|
||||
if (
|
||||
specifier === "../../../openai.js" ||
|
||||
specifier === "../../../../openai.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: openAiShimUrl,
|
||||
|
||||
@@ -28,14 +28,18 @@ registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
if (
|
||||
specifier === "../../../extensions.js" ||
|
||||
specifier === "../../../../extensions.js"
|
||||
specifier === "../../../../extensions.js" ||
|
||||
specifier === "../../../../../extensions.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(extensionsShimSource)}`,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../../script.js") {
|
||||
if (
|
||||
specifier === "../../../../script.js" ||
|
||||
specifier === "../../../../../script.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(scriptShimSource)}`,
|
||||
|
||||
@@ -39,20 +39,27 @@ registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
if (
|
||||
specifier === "../../../extensions.js" ||
|
||||
specifier === "../../../../extensions.js"
|
||||
specifier === "../../../../extensions.js" ||
|
||||
specifier === "../../../../../extensions.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(extensionsShimSource)}`,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../../script.js") {
|
||||
if (
|
||||
specifier === "../../../../script.js" ||
|
||||
specifier === "../../../../../script.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(scriptShimSource)}`,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../openai.js") {
|
||||
if (
|
||||
specifier === "../../../openai.js" ||
|
||||
specifier === "../../../../openai.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: `data:text/javascript,${encodeURIComponent(openAiShimSource)}`,
|
||||
|
||||
@@ -12,7 +12,10 @@ const extensionsShimUrl = `data:text/javascript,${encodeURIComponent(
|
||||
|
||||
registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
if (specifier === "../../../extensions.js") {
|
||||
if (
|
||||
specifier === "../../../extensions.js" ||
|
||||
specifier === "../../../../extensions.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: extensionsShimUrl,
|
||||
|
||||
@@ -15,7 +15,8 @@ registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
if (
|
||||
specifier === "../../../extensions.js" ||
|
||||
specifier === "../../../../extensions.js"
|
||||
specifier === "../../../../extensions.js" ||
|
||||
specifier === "../../../../../extensions.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
|
||||
@@ -23,14 +23,18 @@ registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
if (
|
||||
specifier === "../../../extensions.js" ||
|
||||
specifier === "../../../../extensions.js"
|
||||
specifier === "../../../../extensions.js" ||
|
||||
specifier === "../../../../../extensions.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: extensionsShimUrl,
|
||||
};
|
||||
}
|
||||
if (specifier === "../../../../script.js") {
|
||||
if (
|
||||
specifier === "../../../../script.js" ||
|
||||
specifier === "../../../../../script.js"
|
||||
) {
|
||||
return {
|
||||
shortCircuit: true,
|
||||
url: scriptShimUrl,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// ST-BME: 操控面板交互逻辑
|
||||
|
||||
import { callGenericPopup, POPUP_TYPE } from "../../../popup.js";
|
||||
import { getContext } from "../../../extensions.js";
|
||||
import { renderTemplateAsync } from "../../../templates.js";
|
||||
import { callGenericPopup, POPUP_TYPE } from "../../../../popup.js";
|
||||
import { getContext } from "../../../../extensions.js";
|
||||
import { renderTemplateAsync } from "../../../../templates.js";
|
||||
import { GraphRenderer } from "./graph-renderer.js";
|
||||
import { getNodeDisplayName } from "../graph/node-labels.js";
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// ST-BME: 消息级召回卡片 UI
|
||||
// 纯 DOM 构建模块,不含模块级 mutable state
|
||||
|
||||
import { getContext } from "../../../extensions.js";
|
||||
import { getContext } from "../../../../extensions.js";
|
||||
import { GraphRenderer } from "./graph-renderer.js";
|
||||
|
||||
function _hostUserPovAliasHintsForRecallCanvas() {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* 调用外部 API 获取文本向量,并提供暴力搜索 cosine 相似度
|
||||
*/
|
||||
|
||||
import { extension_settings } from "../../../extensions.js";
|
||||
import { extension_settings } from "../../../../extensions.js";
|
||||
import { resolveConfiguredTimeoutMs } from "../runtime/request-timeout.js";
|
||||
|
||||
const MODULE_NAME = "st_bme";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ST-BME: 向量模式、后端索引与直连兜底
|
||||
|
||||
import { getRequestHeaders } from "../../../../script.js";
|
||||
import { getRequestHeaders } from "../../../../../script.js";
|
||||
import { embedBatch, embedText, searchSimilar } from "./embedding.js";
|
||||
import { getActiveNodes } from "../graph/graph.js";
|
||||
import { describeMemoryScope, normalizeMemoryScope } from "../graph/memory-scope.js";
|
||||
|
||||
Reference in New Issue
Block a user