mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
feat: turn session recording into a plugin (B13)
This commit is contained in:
1 parent
a276f6898c
commit
0af2c94983
147 files changed
+25915
-2074
No files matched your search
@@ -250,6 +250,20 @@ export function createPluginContext(
|
||||
{ action: "kv_list" },
|
||||
);
|
||||
|
||||
const filesDataDir = guarded(
|
||||
manifest,
|
||||
"files:own",
|
||||
async () => {
|
||||
const fs = await import("node:fs/promises");
|
||||
const path = await import("node:path");
|
||||
const base = process.env.DATA_DIR ?? "./db/data";
|
||||
const dir = path.join(base, "plugins", pluginId);
|
||||
await fs.mkdir(dir, { recursive: true });
|
||||
return dir;
|
||||
},
|
||||
{ action: "files_data_dir" },
|
||||
);
|
||||
|
||||
const dbDefine = guarded(
|
||||
manifest,
|
||||
"db:own",
|
||||
@@ -422,6 +436,10 @@ export function createPluginContext(
|
||||
list: () => kvList(),
|
||||
},
|
||||
|
||||
files: {
|
||||
dataDir: () => filesDataDir(),
|
||||
},
|
||||
|
||||
registry: {
|
||||
provide: (key, value) => {
|
||||
registry.provide(key, value);
|
||||
|
||||
Reference in new issue
Block a user