hoomanjs 1.6.0 → 1.7.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 +17 -1
- package/package.json +2 -1
- package/src/core/config.ts +1 -0
- package/src/core/models/index.ts +1 -0
- package/src/core/models/moonshot.ts +54 -0
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ It gives you:
|
|
|
26
26
|
|
|
27
27
|
## Features
|
|
28
28
|
|
|
29
|
-
- Multiple LLM providers: `ollama`, `openai`, `anthropic`, `google`, `bedrock`, `groq`, `xai`
|
|
29
|
+
- Multiple LLM providers: `ollama`, `openai`, `anthropic`, `google`, `bedrock`, `groq`, `moonshot`, `xai`
|
|
30
30
|
- Local configuration under `~/.hooman`
|
|
31
31
|
- MCP server support via `stdio`, `streamable-http`, and `sse`
|
|
32
32
|
- MCP server `instructions` support: server-provided instructions are appended to the agent system prompt
|
|
@@ -263,6 +263,7 @@ Supported `llm.provider` values:
|
|
|
263
263
|
- `google`
|
|
264
264
|
- `bedrock`
|
|
265
265
|
- `groq`
|
|
266
|
+
- `moonshot`
|
|
266
267
|
- `xai`
|
|
267
268
|
|
|
268
269
|
## Provider Notes
|
|
@@ -345,6 +346,21 @@ Uses the Vercel AI SDK Groq provider (`@ai-sdk/groq`) on top of Strands `VercelM
|
|
|
345
346
|
}
|
|
346
347
|
```
|
|
347
348
|
|
|
349
|
+
### Moonshot
|
|
350
|
+
|
|
351
|
+
Uses the Vercel AI SDK Moonshot provider (`@ai-sdk/moonshotai`) on top of Strands `VercelModel`. Provider-specific settings `apiKey`, `baseURL`, `headers`, and `fetch` are picked up; other values are forwarded into the model config (`temperature`, `maxTokens`, `providerOptions`, etc.). Defaults to `MOONSHOT_API_KEY` from the environment when no `apiKey` is supplied. Moonshot reasoning models such as `kimi-k2-thinking` can be configured through `params.providerOptions.moonshotai`.
|
|
352
|
+
|
|
353
|
+
```json
|
|
354
|
+
{
|
|
355
|
+
"provider": "moonshot",
|
|
356
|
+
"model": "kimi-k2.5",
|
|
357
|
+
"params": {
|
|
358
|
+
"apiKey": "...",
|
|
359
|
+
"temperature": 0.7
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
|
|
348
364
|
### xAI
|
|
349
365
|
|
|
350
366
|
Uses the Vercel AI SDK xAI provider (`@ai-sdk/xai`) on top of Strands `VercelModel`. Provider-specific settings `apiKey`, `baseURL`, and `headers` are picked up; other values are forwarded into the model config (`temperature`, `maxTokens`, etc.). Defaults to `XAI_API_KEY` from the environment when no `apiKey` is supplied.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoomanjs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Bun-powered local AI agent CLI with chat, exec, ACP, MCP, and skills support.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Vaibhav Pandey",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@agentclientprotocol/sdk": "^0.18.2",
|
|
53
53
|
"@ai-sdk/anthropic": "^3.0.69",
|
|
54
54
|
"@ai-sdk/groq": "^3.0.35",
|
|
55
|
+
"@ai-sdk/moonshotai": "^2.0.16",
|
|
55
56
|
"@ai-sdk/xai": "^3.0.83",
|
|
56
57
|
"@aws-sdk/client-bedrock-runtime": "^3.1028.0",
|
|
57
58
|
"@google/genai": "^1.40.0",
|
package/src/core/config.ts
CHANGED
package/src/core/models/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ export const modelProviders: Record<string, () => Promise<ModelProvider>> = {
|
|
|
12
12
|
bedrock: () => import("./bedrock.ts"),
|
|
13
13
|
google: () => import("./google.ts"),
|
|
14
14
|
groq: () => import("./groq.ts"),
|
|
15
|
+
moonshot: () => import("./moonshot.ts"),
|
|
15
16
|
ollama: () => import("./ollama/index.ts"),
|
|
16
17
|
openai: () => import("./openai.ts"),
|
|
17
18
|
xai: () => import("./xai.ts"),
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createMoonshotAI, moonshotai } from "@ai-sdk/moonshotai";
|
|
2
|
+
import { VercelModel } from "@strands-agents/sdk/models/vercel";
|
|
3
|
+
import type { MoonshotAIProviderSettings } from "@ai-sdk/moonshotai";
|
|
4
|
+
import type { VercelModelConfig } from "@strands-agents/sdk/models/vercel";
|
|
5
|
+
import { omit, pick } from "lodash";
|
|
6
|
+
|
|
7
|
+
const PROVIDER_SETTINGS_KEYS = [
|
|
8
|
+
"apiKey",
|
|
9
|
+
"baseURL",
|
|
10
|
+
"headers",
|
|
11
|
+
"fetch",
|
|
12
|
+
] as const;
|
|
13
|
+
|
|
14
|
+
function pickProviderSettings(
|
|
15
|
+
params: Record<string, unknown>,
|
|
16
|
+
): MoonshotAIProviderSettings {
|
|
17
|
+
const picked = pick(params, [...PROVIDER_SETTINGS_KEYS]) as Record<
|
|
18
|
+
string,
|
|
19
|
+
unknown
|
|
20
|
+
>;
|
|
21
|
+
const unset = Object.keys(picked).filter((k) => picked[k] === undefined);
|
|
22
|
+
return omit(picked, unset) as MoonshotAIProviderSettings;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function pickVercelModelConfig(
|
|
26
|
+
params: Record<string, unknown>,
|
|
27
|
+
): Partial<VercelModelConfig> {
|
|
28
|
+
return omit(params, [
|
|
29
|
+
...PROVIDER_SETTINGS_KEYS,
|
|
30
|
+
]) as Partial<VercelModelConfig>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Moonshot AI via AI SDK + Strands {@link VercelModel}.
|
|
35
|
+
*
|
|
36
|
+
* - **`config.llm.model`**: model id passed to `moonshotai(...)` (e.g. `kimi-k2.5`).
|
|
37
|
+
* - **`params`**: {@link MoonshotAIProviderSettings} (`apiKey`, `baseURL`, `headers`, `fetch`).
|
|
38
|
+
* If none are set, the default provider is used (`MOONSHOT_API_KEY` from env).
|
|
39
|
+
* - Any other `params` keys are forwarded as {@link VercelModelConfig} (e.g. `temperature`,
|
|
40
|
+
* `maxTokens`, `providerOptions`).
|
|
41
|
+
*/
|
|
42
|
+
export function create(
|
|
43
|
+
model: string,
|
|
44
|
+
params: Record<string, unknown> = {},
|
|
45
|
+
): VercelModel {
|
|
46
|
+
const settings = pickProviderSettings(params);
|
|
47
|
+
const provider =
|
|
48
|
+
Object.keys(settings).length > 0 ? createMoonshotAI(settings) : moonshotai;
|
|
49
|
+
const config = pickVercelModelConfig(params);
|
|
50
|
+
return new VercelModel({
|
|
51
|
+
provider: provider(model),
|
|
52
|
+
...config,
|
|
53
|
+
});
|
|
54
|
+
}
|