@miraiclip/assistant 0.1.1 → 0.2.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/README.md +7 -5
- package/dist/index.cjs +727 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +350 -23
- package/dist/index.d.ts +350 -23
- package/dist/index.js +727 -62
- package/dist/index.js.map +1 -1
- package/package.json +12 -6
package/README.md
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
# @miraiclip/assistant
|
|
2
2
|
|
|
3
|
-
An AI editing assistant for [Miraiclip](https://
|
|
3
|
+
An AI editing assistant for [Miraiclip](https://docs.miraiclip.com/) editors. The user asks in plain words; the project changes as **one undo step**.
|
|
4
4
|
|
|
5
|
-
- **Any model**: one small `ChatModel` contract
|
|
5
|
+
- **Any model, any provider**: one small `ChatModel` contract with native adapters for OpenAI, Anthropic and Google Gemini, and one factory for the rest — `createChatModel({ provider, apiKey, model })` covers OpenRouter, Groq, Mistral, DeepSeek, xAI, Together, Ollama, LM Studio and any OpenAI-compatible server. Live model lists (`listModels`), several providers behind one model (`routedChatModel`, "provider/model" ids), and every configured key from env in one call (`chatModelsFromEnv`).
|
|
6
|
+
- **Bring your own key**: `createChatHandler(model, { userKeys: true })` lets each user call with their own provider key, per request, never stored.
|
|
6
7
|
- **Safe edits**: the agent works on a copy of the project; when the request finishes, its commands replay onto the real project in one transaction. Failed or canceled requests leave nothing behind. Review mode waits for `turn.apply()`.
|
|
7
8
|
- **Editing tools**: `get_state`, `get_command_schema`, `apply_commands`, `add_transition` (cuts, spare-footage aware), `animate_clip` (in / loop / out presets), plus `defineTool` and `toolsFromDefinitions` for your own (e.g. `@miraiclip/audio-sources`).
|
|
8
9
|
- **Keys stay on the server**: `createChatHandler` (Fetch API) on your backend, `remoteChatModel` in the browser.
|
|
9
10
|
|
|
10
11
|
```ts
|
|
11
|
-
import { createAssistant,
|
|
12
|
+
import { createAssistant, createChatModel } from "@miraiclip/assistant";
|
|
12
13
|
|
|
13
|
-
const
|
|
14
|
+
const model = createChatModel({ provider: "anthropic", apiKey, model: "claude-sonnet-5-5" }); // or "openai", "gemini", "openrouter", "ollama", …
|
|
15
|
+
const assistant = createAssistant({ model });
|
|
14
16
|
const turn = await assistant.run(project, "add dissolves between the clips and make the title pop in");
|
|
15
17
|
turn.reply; // what the model says it did
|
|
16
18
|
turn.changes; // ["Added crossDissolve at 10s (0.6s)", …]
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
Docs: https://
|
|
21
|
+
Docs: https://docs.miraiclip.com/ai/assistant · models and keys: https://docs.miraiclip.com/ai/models
|
|
20
22
|
|
|
21
23
|
MIT
|