@miraiclip/assistant 0.1.2 → 0.3.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 comaniacs
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 comaniacs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,21 +1,23 @@
1
- # @miraiclip/assistant
2
-
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
-
5
- - **Any model**: one small `ChatModel` contract. OpenAI ships first (`openAIChatModel`, Chat Completions with function calling and streaming); `baseUrl` reaches any OpenAI-compatible server (Azure OpenAI, OpenRouter, Groq, vLLM, Ollama…).
6
- - **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
- - **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
- - **Keys stay on the server**: `createChatHandler` (Fetch API) on your backend, `remoteChatModel` in the browser.
9
-
10
- ```ts
11
- import { createAssistant, openAIChatModel } from "@miraiclip/assistant";
12
-
13
- const assistant = createAssistant({ model: openAIChatModel({ apiKey, model: "gpt-5.4-mini" }) });
14
- const turn = await assistant.run(project, "add dissolves between the clips and make the title pop in");
15
- turn.reply; // what the model says it did
16
- turn.changes; // ["Added crossDissolve at 10s (0.6s)", …]
17
- ```
18
-
19
- Docs: https://docs.miraiclip.com/ai/assistant
20
-
21
- MIT
1
+ # @miraiclip/assistant
2
+
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
+
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.
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()`.
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`).
9
+ - **Keys stay on the server**: `createChatHandler` (Fetch API) on your backend, `remoteChatModel` in the browser.
10
+
11
+ ```ts
12
+ import { createAssistant, createChatModel } from "@miraiclip/assistant";
13
+
14
+ const model = createChatModel({ provider: "anthropic", apiKey, model: "claude-sonnet-5-5" }); // or "openai", "gemini", "openrouter", "ollama", …
15
+ const assistant = createAssistant({ model });
16
+ const turn = await assistant.run(project, "add dissolves between the clips and make the title pop in");
17
+ turn.reply; // what the model says it did
18
+ turn.changes; // ["Added crossDissolve at 10s (0.6s)", …]
19
+ ```
20
+
21
+ Docs: https://docs.miraiclip.com/ai/assistant · models and keys: https://docs.miraiclip.com/ai/models
22
+
23
+ MIT