generated from silverbulletmd/silverbullet-plug-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from justyns/use-space-config
Add support for config:loaded event
- Loading branch information
Showing
8 changed files
with
6,224 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import "./mocks/syscalls.ts"; | ||
import { syscall } from "./mocks/syscalls.ts"; | ||
import { aiSettings, initializeOpenAI } from "./init.ts"; | ||
import { | ||
canIndexPage, | ||
indexEmbeddings, | ||
shouldIndexEmbeddings, | ||
shouldIndexSummaries, | ||
} from "./embeddings.ts"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { readSecret } from "https://deno.land/x/[email protected]/plug-api/lib/secrets_page.ts"; | ||
import { readSetting } from "https://deno.land/x/[email protected]/plug-api/lib/settings_page.ts"; | ||
import { clientStore, system } from "@silverbulletmd/silverbullet/syscalls"; | ||
import { DallEProvider } from "./providers/dalle.ts"; | ||
import { GeminiEmbeddingProvider, GeminiProvider } from "./providers/gemini.ts"; | ||
|
@@ -347,7 +346,7 @@ async function loadAndMergeSettings() { | |
indexSummaryPrompt: "", | ||
enhanceFrontMatterPrompt: "", | ||
}; | ||
const newSettings = await readSetting("ai", {}); | ||
const newSettings = await system.getSpaceConfig("ai", {}); | ||
const newCombinedSettings = { ...defaultSettings, ...newSettings }; | ||
newCombinedSettings.chat = { | ||
...defaultChatSettings, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { parse as parseYAML } from "https://deno.land/[email protected]/yaml/mod.ts"; | ||
import { parseMarkdown } from "$common/markdown_parser/parser.ts"; | ||
import { syscall } from "@silverbulletmd/silverbullet/syscalls"; | ||
|
||
let editorText = "Mock data"; | ||
(globalThis as any).editorText; | ||
|
@@ -71,3 +72,5 @@ function invokeFunctionMock(args: readonly any[]) { | |
throw Error(`Missing invokeFunction mock for ${args[0]}`); | ||
} | ||
} | ||
|
||
export { syscall }; |