mioku-plugin-media 2.2.1 → 2.2.2
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/package.json +1 -1
- package/runtime.ts +2 -2
- package/skills.ts +4 -2
package/package.json
CHANGED
package/runtime.ts
CHANGED
|
@@ -10,11 +10,11 @@ const PLUGIN_NAME = "media";
|
|
|
10
10
|
export function setMediaRuntimeState(
|
|
11
11
|
nextState: Partial<MediaRuntimeState>,
|
|
12
12
|
): MediaRuntimeState {
|
|
13
|
-
return setPluginRuntimeState
|
|
13
|
+
return setPluginRuntimeState(PLUGIN_NAME, nextState) as MediaRuntimeState;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function getMediaRuntimeState(): MediaRuntimeState {
|
|
17
|
-
return getPluginRuntimeState
|
|
17
|
+
return getPluginRuntimeState(PLUGIN_NAME) as MediaRuntimeState;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function resetMediaRuntimeState(): void {
|
package/skills.ts
CHANGED
|
@@ -31,7 +31,9 @@ const mediaSkills: AISkill[] = [
|
|
|
31
31
|
required: ["url"],
|
|
32
32
|
},
|
|
33
33
|
handler: async (args: any, runtimeCtx?: any) => {
|
|
34
|
-
const runtime = getMediaRuntimeState()
|
|
34
|
+
const runtime = getMediaRuntimeState() as unknown as {
|
|
35
|
+
amagiClient?: Parameters<typeof resolveMedia>[0];
|
|
36
|
+
};
|
|
35
37
|
if (!runtime.amagiClient) {
|
|
36
38
|
return "媒体解析插件尚未初始化";
|
|
37
39
|
}
|
|
@@ -55,7 +57,7 @@ const mediaSkills: AISkill[] = [
|
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
const result = await resolveMedia(runtime.amagiClient, parsed);
|
|
60
|
+
const result = await resolveMedia(runtime.amagiClient as any, parsed);
|
|
59
61
|
const info = buildInfoMessage(parsed, result);
|
|
60
62
|
|
|
61
63
|
const ctx = runtimeCtx?.ctx;
|