hoomanjs 1.41.0 → 1.42.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 +26 -701
- package/dist/acp/acp-agent.js +48 -29
- package/dist/acp/acp-agent.js.map +1 -1
- package/dist/chat/app.js +29 -27
- package/dist/chat/app.js.map +1 -1
- package/dist/chat/components/BottomChrome.d.ts +4 -1
- package/dist/chat/components/BottomChrome.js +3 -2
- package/dist/chat/components/BottomChrome.js.map +1 -1
- package/dist/chat/components/DownloadPanel.d.ts +9 -0
- package/dist/chat/components/DownloadPanel.js +16 -0
- package/dist/chat/components/DownloadPanel.js.map +1 -0
- package/dist/chat/components/StatusBar.js +5 -5
- package/dist/chat/components/StatusBar.js.map +1 -1
- package/dist/cli.js +23 -23
- package/dist/cli.js.map +1 -1
- package/dist/configure/app.js +30 -2
- package/dist/configure/app.js.map +1 -1
- package/dist/core/agent/index.js +0 -6
- package/dist/core/agent/index.js.map +1 -1
- package/dist/core/agent/prompt-cache-plugin.d.ts +1 -1
- package/dist/core/agent/prompt-cache-plugin.js +1 -1
- package/dist/core/config.d.ts +60 -0
- package/dist/core/config.js +25 -5
- package/dist/core/config.js.map +1 -1
- package/dist/core/mcp/index.d.ts +3 -3
- package/dist/core/mcp/index.js +2 -2
- package/dist/core/mcp/index.js.map +1 -1
- package/dist/core/mcp/manager.d.ts +28 -0
- package/dist/core/mcp/manager.js +171 -2
- package/dist/core/mcp/manager.js.map +1 -1
- package/dist/core/models/anthropic.d.ts +4 -3
- package/dist/core/models/anthropic.js.map +1 -1
- package/dist/core/models/download-progress.d.ts +65 -0
- package/dist/core/models/download-progress.js +154 -0
- package/dist/core/models/download-progress.js.map +1 -0
- package/dist/core/models/index.js +1 -0
- package/dist/core/models/index.js.map +1 -1
- package/dist/core/models/llama-cpp/gbnf-schema.d.ts +32 -0
- package/dist/core/models/llama-cpp/gbnf-schema.js +272 -0
- package/dist/core/models/llama-cpp/gbnf-schema.js.map +1 -0
- package/dist/core/models/llama-cpp/index.d.ts +8 -0
- package/dist/core/models/llama-cpp/index.js +37 -0
- package/dist/core/models/llama-cpp/index.js.map +1 -0
- package/dist/core/models/llama-cpp/resolve-model.d.ts +28 -0
- package/dist/core/models/llama-cpp/resolve-model.js +307 -0
- package/dist/core/models/llama-cpp/resolve-model.js.map +1 -0
- package/dist/core/models/llama-cpp/strands-llama-cpp.d.ts +40 -0
- package/dist/core/models/llama-cpp/strands-llama-cpp.js +422 -0
- package/dist/core/models/llama-cpp/strands-llama-cpp.js.map +1 -0
- package/dist/core/models/minimax.d.ts +2 -1
- package/dist/core/models/minimax.js +49 -7
- package/dist/core/models/minimax.js.map +1 -1
- package/dist/core/models/types.d.ts +125 -7
- package/dist/core/models/types.js +22 -2
- package/dist/core/models/types.js.map +1 -1
- package/dist/core/prompts/environment.d.ts +10 -1
- package/dist/core/prompts/environment.js +15 -1
- package/dist/core/prompts/environment.js.map +1 -1
- package/dist/core/prompts/static/environment.md +2 -1
- package/dist/core/prompts/static/web-search.md +1 -1
- package/dist/core/prompts/system.d.ts +6 -0
- package/dist/core/prompts/system.js +7 -1
- package/dist/core/prompts/system.js.map +1 -1
- package/dist/core/skills/built-in/hooman-config/SKILL.md +21 -5
- package/dist/core/skills/built-in/hooman-config/providers.md +2 -0
- package/dist/core/skills/built-in/hooman-mcp/SKILL.md +20 -0
- package/dist/core/tools/ask-user.d.ts +8 -0
- package/dist/core/tools/ask-user.js +8 -4
- package/dist/core/tools/ask-user.js.map +1 -1
- package/dist/core/tools/time.js +1 -1
- package/dist/core/tools/time.js.map +1 -1
- package/dist/core/utils/logging.d.ts +29 -0
- package/dist/core/utils/logging.js +64 -0
- package/dist/core/utils/logging.js.map +1 -0
- package/dist/daemon/index.js +5 -0
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/questions.d.ts +18 -0
- package/dist/daemon/questions.js +44 -0
- package/dist/daemon/questions.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
|
@@ -5,6 +5,7 @@ export declare enum LlmProvider {
|
|
|
5
5
|
Bedrock = "bedrock",
|
|
6
6
|
Google = "google",
|
|
7
7
|
Groq = "groq",
|
|
8
|
+
LlamaCpp = "llama-cpp",
|
|
8
9
|
Minimax = "minimax",
|
|
9
10
|
Moonshot = "moonshot",
|
|
10
11
|
Ollama = "ollama",
|
|
@@ -40,8 +41,8 @@ export type ReasoningOptions = {
|
|
|
40
41
|
};
|
|
41
42
|
/**
|
|
42
43
|
* Effort -> `budget_tokens` for providers that take an explicit thinking budget
|
|
43
|
-
* (
|
|
44
|
-
*
|
|
44
|
+
* (the native Anthropic API, Bedrock Converse). We always send a budget rather
|
|
45
|
+
* than omitting it; `medium` is the default when no effort is set.
|
|
45
46
|
*/
|
|
46
47
|
export declare const REASONING_BUDGET_TOKENS: Record<ReasoningEffort, number>;
|
|
47
48
|
export type LlmOptions = {
|
|
@@ -130,14 +131,41 @@ export type GroqProviderOptions = {
|
|
|
130
131
|
*/
|
|
131
132
|
reasoning?: ReasoningOptions;
|
|
132
133
|
};
|
|
134
|
+
export type LlamaCppProviderOptions = {
|
|
135
|
+
/**
|
|
136
|
+
* Hugging Face access token used when downloading GGUF weights from the Hub
|
|
137
|
+
* (gated/private repos). Falls back to the `HF_TOKEN` env var when unset.
|
|
138
|
+
*/
|
|
139
|
+
hfToken?: string;
|
|
140
|
+
/**
|
|
141
|
+
* GPU backend forwarded to node-llama-cpp's `getLlama` (default `"auto"`).
|
|
142
|
+
* Set `false` to force CPU-only inference.
|
|
143
|
+
*/
|
|
144
|
+
gpu?: "auto" | "metal" | "cuda" | "vulkan" | false;
|
|
145
|
+
/**
|
|
146
|
+
* Context size in tokens for the llama.cpp context. When omitted,
|
|
147
|
+
* node-llama-cpp adapts it to the model's training context and free memory.
|
|
148
|
+
*/
|
|
149
|
+
contextSize?: number;
|
|
150
|
+
/**
|
|
151
|
+
* Reasoning controls. Providing `reasoning` enables thinking: the chat
|
|
152
|
+
* template is configured to allow thought segments (Qwen `thoughts: "auto"`,
|
|
153
|
+
* Gemma 4 `reasoning: true`, gpt-oss/Harmony native reasoning-effort) and
|
|
154
|
+
* `effort` caps thought tokens via node-llama-cpp's thought budget
|
|
155
|
+
* (1024/2048/4096/8192, default `medium`). Omit `reasoning` to disable
|
|
156
|
+
* thinking (templates discourage thoughts, thought budget forced to 0).
|
|
157
|
+
*/
|
|
158
|
+
reasoning?: ReasoningOptions;
|
|
159
|
+
};
|
|
133
160
|
export type MinimaxProviderOptions = {
|
|
134
161
|
apiKey?: string;
|
|
162
|
+
baseURL?: string;
|
|
135
163
|
headers?: Record<string, string>;
|
|
136
164
|
/**
|
|
137
|
-
* Reasoning controls. Providing `reasoning` enables
|
|
138
|
-
*
|
|
139
|
-
* to leave thinking
|
|
140
|
-
* `
|
|
165
|
+
* Reasoning controls. Providing `reasoning` enables MiniMax's adaptive
|
|
166
|
+
* thinking (`thinking: { type: "adaptive" }` with `output_config.effort`);
|
|
167
|
+
* omit `reasoning` to leave thinking at the model default. `effort` defaults
|
|
168
|
+
* to `medium` (`minimal` maps to `low`); `display` is forwarded when set.
|
|
141
169
|
*/
|
|
142
170
|
reasoning?: ReasoningOptions;
|
|
143
171
|
};
|
|
@@ -210,7 +238,7 @@ export type XaiProviderOptions = {
|
|
|
210
238
|
*/
|
|
211
239
|
reasoning?: ReasoningOptions;
|
|
212
240
|
};
|
|
213
|
-
export type ProviderOptions = AnthropicProviderOptions | AzureProviderOptions | BedrockProviderOptions | GoogleProviderOptions | GroqProviderOptions | MinimaxProviderOptions | MoonshotProviderOptions | OllamaProviderOptions | OpenAIProviderOptions | OpenRouterProviderOptions | XaiProviderOptions;
|
|
241
|
+
export type ProviderOptions = AnthropicProviderOptions | AzureProviderOptions | BedrockProviderOptions | GoogleProviderOptions | GroqProviderOptions | LlamaCppProviderOptions | MinimaxProviderOptions | MoonshotProviderOptions | OllamaProviderOptions | OpenAIProviderOptions | OpenRouterProviderOptions | XaiProviderOptions;
|
|
214
242
|
export declare const OpenAIApiSchema: z.ZodEnum<{
|
|
215
243
|
chat: "chat";
|
|
216
244
|
responses: "responses";
|
|
@@ -386,8 +414,37 @@ export declare const GroqProviderOptionsSchema: z.ZodObject<{
|
|
|
386
414
|
}>>;
|
|
387
415
|
}, z.core.$strict>>;
|
|
388
416
|
}, z.core.$strict>;
|
|
417
|
+
export declare const LlamaCppProviderOptionsSchema: z.ZodObject<{
|
|
418
|
+
hfToken: z.ZodOptional<z.ZodString>;
|
|
419
|
+
gpu: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
420
|
+
auto: "auto";
|
|
421
|
+
metal: "metal";
|
|
422
|
+
cuda: "cuda";
|
|
423
|
+
vulkan: "vulkan";
|
|
424
|
+
}>, z.ZodLiteral<false>]>>;
|
|
425
|
+
contextSize: z.ZodOptional<z.ZodNumber>;
|
|
426
|
+
reasoning: z.ZodOptional<z.ZodObject<{
|
|
427
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
428
|
+
minimal: "minimal";
|
|
429
|
+
low: "low";
|
|
430
|
+
medium: "medium";
|
|
431
|
+
high: "high";
|
|
432
|
+
}>>;
|
|
433
|
+
summary: z.ZodOptional<z.ZodEnum<{
|
|
434
|
+
auto: "auto";
|
|
435
|
+
concise: "concise";
|
|
436
|
+
detailed: "detailed";
|
|
437
|
+
none: "none";
|
|
438
|
+
}>>;
|
|
439
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
440
|
+
summarized: "summarized";
|
|
441
|
+
omitted: "omitted";
|
|
442
|
+
}>>;
|
|
443
|
+
}, z.core.$strict>>;
|
|
444
|
+
}, z.core.$strict>;
|
|
389
445
|
export declare const MinimaxProviderOptionsSchema: z.ZodObject<{
|
|
390
446
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
447
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
391
448
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
392
449
|
reasoning: z.ZodOptional<z.ZodObject<{
|
|
393
450
|
effort: z.ZodOptional<z.ZodEnum<{
|
|
@@ -644,8 +701,37 @@ export declare const ProviderOptionsSchemas: {
|
|
|
644
701
|
}>>;
|
|
645
702
|
}, z.core.$strict>>;
|
|
646
703
|
}, z.core.$strict>;
|
|
704
|
+
readonly "llama-cpp": z.ZodObject<{
|
|
705
|
+
hfToken: z.ZodOptional<z.ZodString>;
|
|
706
|
+
gpu: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
707
|
+
auto: "auto";
|
|
708
|
+
metal: "metal";
|
|
709
|
+
cuda: "cuda";
|
|
710
|
+
vulkan: "vulkan";
|
|
711
|
+
}>, z.ZodLiteral<false>]>>;
|
|
712
|
+
contextSize: z.ZodOptional<z.ZodNumber>;
|
|
713
|
+
reasoning: z.ZodOptional<z.ZodObject<{
|
|
714
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
715
|
+
minimal: "minimal";
|
|
716
|
+
low: "low";
|
|
717
|
+
medium: "medium";
|
|
718
|
+
high: "high";
|
|
719
|
+
}>>;
|
|
720
|
+
summary: z.ZodOptional<z.ZodEnum<{
|
|
721
|
+
auto: "auto";
|
|
722
|
+
concise: "concise";
|
|
723
|
+
detailed: "detailed";
|
|
724
|
+
none: "none";
|
|
725
|
+
}>>;
|
|
726
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
727
|
+
summarized: "summarized";
|
|
728
|
+
omitted: "omitted";
|
|
729
|
+
}>>;
|
|
730
|
+
}, z.core.$strict>>;
|
|
731
|
+
}, z.core.$strict>;
|
|
647
732
|
readonly minimax: z.ZodObject<{
|
|
648
733
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
734
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
649
735
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
650
736
|
reasoning: z.ZodOptional<z.ZodObject<{
|
|
651
737
|
effort: z.ZodOptional<z.ZodEnum<{
|
|
@@ -917,11 +1003,43 @@ export declare const NamedProviderConfigSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
917
1003
|
}>>;
|
|
918
1004
|
}, z.core.$strict>>;
|
|
919
1005
|
}, z.core.$strict>;
|
|
1006
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1007
|
+
name: z.ZodString;
|
|
1008
|
+
provider: z.ZodLiteral<LlmProvider.LlamaCpp>;
|
|
1009
|
+
options: z.ZodObject<{
|
|
1010
|
+
hfToken: z.ZodOptional<z.ZodString>;
|
|
1011
|
+
gpu: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1012
|
+
auto: "auto";
|
|
1013
|
+
metal: "metal";
|
|
1014
|
+
cuda: "cuda";
|
|
1015
|
+
vulkan: "vulkan";
|
|
1016
|
+
}>, z.ZodLiteral<false>]>>;
|
|
1017
|
+
contextSize: z.ZodOptional<z.ZodNumber>;
|
|
1018
|
+
reasoning: z.ZodOptional<z.ZodObject<{
|
|
1019
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
1020
|
+
minimal: "minimal";
|
|
1021
|
+
low: "low";
|
|
1022
|
+
medium: "medium";
|
|
1023
|
+
high: "high";
|
|
1024
|
+
}>>;
|
|
1025
|
+
summary: z.ZodOptional<z.ZodEnum<{
|
|
1026
|
+
auto: "auto";
|
|
1027
|
+
concise: "concise";
|
|
1028
|
+
detailed: "detailed";
|
|
1029
|
+
none: "none";
|
|
1030
|
+
}>>;
|
|
1031
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
1032
|
+
summarized: "summarized";
|
|
1033
|
+
omitted: "omitted";
|
|
1034
|
+
}>>;
|
|
1035
|
+
}, z.core.$strict>>;
|
|
1036
|
+
}, z.core.$strict>;
|
|
920
1037
|
}, z.core.$strict>, z.ZodObject<{
|
|
921
1038
|
name: z.ZodString;
|
|
922
1039
|
provider: z.ZodLiteral<LlmProvider.Minimax>;
|
|
923
1040
|
options: z.ZodObject<{
|
|
924
1041
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
1042
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
925
1043
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
926
1044
|
reasoning: z.ZodOptional<z.ZodObject<{
|
|
927
1045
|
effort: z.ZodOptional<z.ZodEnum<{
|
|
@@ -6,6 +6,7 @@ export var LlmProvider;
|
|
|
6
6
|
LlmProvider["Bedrock"] = "bedrock";
|
|
7
7
|
LlmProvider["Google"] = "google";
|
|
8
8
|
LlmProvider["Groq"] = "groq";
|
|
9
|
+
LlmProvider["LlamaCpp"] = "llama-cpp";
|
|
9
10
|
LlmProvider["Minimax"] = "minimax";
|
|
10
11
|
LlmProvider["Moonshot"] = "moonshot";
|
|
11
12
|
LlmProvider["Ollama"] = "ollama";
|
|
@@ -15,8 +16,8 @@ export var LlmProvider;
|
|
|
15
16
|
})(LlmProvider || (LlmProvider = {}));
|
|
16
17
|
/**
|
|
17
18
|
* Effort -> `budget_tokens` for providers that take an explicit thinking budget
|
|
18
|
-
* (
|
|
19
|
-
*
|
|
19
|
+
* (the native Anthropic API, Bedrock Converse). We always send a budget rather
|
|
20
|
+
* than omitting it; `medium` is the default when no effort is set.
|
|
20
21
|
*/
|
|
21
22
|
export const REASONING_BUDGET_TOKENS = {
|
|
22
23
|
minimal: 1024,
|
|
@@ -121,9 +122,20 @@ export const GroqProviderOptionsSchema = z
|
|
|
121
122
|
reasoning: ReasoningOptionsSchema.optional(),
|
|
122
123
|
})
|
|
123
124
|
.strict();
|
|
125
|
+
export const LlamaCppProviderOptionsSchema = z
|
|
126
|
+
.object({
|
|
127
|
+
hfToken: NonEmptyStringSchema.optional(),
|
|
128
|
+
gpu: z
|
|
129
|
+
.union([z.enum(["auto", "metal", "cuda", "vulkan"]), z.literal(false)])
|
|
130
|
+
.optional(),
|
|
131
|
+
contextSize: z.number().int().positive().optional(),
|
|
132
|
+
reasoning: ReasoningOptionsSchema.optional(),
|
|
133
|
+
})
|
|
134
|
+
.strict();
|
|
124
135
|
export const MinimaxProviderOptionsSchema = z
|
|
125
136
|
.object({
|
|
126
137
|
apiKey: NonEmptyStringSchema.optional(),
|
|
138
|
+
baseURL: NonEmptyStringSchema.optional(),
|
|
127
139
|
headers: HeadersSchema,
|
|
128
140
|
reasoning: ReasoningOptionsSchema.optional(),
|
|
129
141
|
})
|
|
@@ -173,6 +185,7 @@ export const ProviderOptionsSchemas = {
|
|
|
173
185
|
[LlmProvider.Bedrock]: BedrockProviderOptionsSchema,
|
|
174
186
|
[LlmProvider.Google]: GoogleProviderOptionsSchema,
|
|
175
187
|
[LlmProvider.Groq]: GroqProviderOptionsSchema,
|
|
188
|
+
[LlmProvider.LlamaCpp]: LlamaCppProviderOptionsSchema,
|
|
176
189
|
[LlmProvider.Minimax]: MinimaxProviderOptionsSchema,
|
|
177
190
|
[LlmProvider.Moonshot]: MoonshotProviderOptionsSchema,
|
|
178
191
|
[LlmProvider.Ollama]: OllamaProviderOptionsSchema,
|
|
@@ -216,6 +229,13 @@ export const NamedProviderConfigSchema = z.discriminatedUnion("provider", [
|
|
|
216
229
|
options: GroqProviderOptionsSchema,
|
|
217
230
|
})
|
|
218
231
|
.strict(),
|
|
232
|
+
z
|
|
233
|
+
.object({
|
|
234
|
+
name: NonEmptyStringSchema,
|
|
235
|
+
provider: z.literal(LlmProvider.LlamaCpp),
|
|
236
|
+
options: LlamaCppProviderOptionsSchema,
|
|
237
|
+
})
|
|
238
|
+
.strict(),
|
|
219
239
|
z
|
|
220
240
|
.object({
|
|
221
241
|
name: NonEmptyStringSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/models/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/models/types.ts"],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AI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC;QACvC,OAAO,EAAE,2BAA2B;KACrC,CAAC;SACD,MAAM,EAAE;IACX,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC;QAC3C,OAAO,EAAE,+BAA+B;KACzC,CAAC;SACD,MAAM,EAAE;IACX,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC;QACpC,OAAO,EAAE,wBAAwB;KAClC,CAAC;SACD,MAAM,EAAE;CACZ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,oBAAoB;IAC9B,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,gBAAgB,CAAC,OAAO,EAAE;IACnC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACpC,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -5,6 +5,15 @@ type EnvironmentPromptContext = {
|
|
|
5
5
|
shell: string;
|
|
6
6
|
isGitRepo: boolean;
|
|
7
7
|
timeZone: string;
|
|
8
|
+
datetime: string;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
+
/** Human-readable local date & time, e.g. "Saturday, July 4, 2026, 2:25 PM". */
|
|
11
|
+
export declare function formatPromptDateTime(date: Date): string;
|
|
12
|
+
/**
|
|
13
|
+
* Environment facts rendered into the system prompt. `at` is the moment the
|
|
14
|
+
* prompt is considered built; callers that rebuild the prompt during a session
|
|
15
|
+
* must pass a stable value so the rendered prefix stays byte-identical across
|
|
16
|
+
* turns (a changing prefix defeats provider prompt caching).
|
|
17
|
+
*/
|
|
18
|
+
export declare function getEnvironmentPromptContext(at?: Date): EnvironmentPromptContext;
|
|
10
19
|
export {};
|
|
@@ -35,7 +35,20 @@ function detectGitRepo(startDir) {
|
|
|
35
35
|
function detectTimeZone() {
|
|
36
36
|
return Intl.DateTimeFormat().resolvedOptions().timeZone || "unknown";
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
/** Human-readable local date & time, e.g. "Saturday, July 4, 2026, 2:25 PM". */
|
|
39
|
+
export function formatPromptDateTime(date) {
|
|
40
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
41
|
+
dateStyle: "full",
|
|
42
|
+
timeStyle: "short",
|
|
43
|
+
}).format(date);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Environment facts rendered into the system prompt. `at` is the moment the
|
|
47
|
+
* prompt is considered built; callers that rebuild the prompt during a session
|
|
48
|
+
* must pass a stable value so the rendered prefix stays byte-identical across
|
|
49
|
+
* turns (a changing prefix defeats provider prompt caching).
|
|
50
|
+
*/
|
|
51
|
+
export function getEnvironmentPromptContext(at = new Date()) {
|
|
39
52
|
const cwd = process.cwd();
|
|
40
53
|
return {
|
|
41
54
|
cwd,
|
|
@@ -44,6 +57,7 @@ export function getEnvironmentPromptContext() {
|
|
|
44
57
|
shell: detectShell(),
|
|
45
58
|
isGitRepo: detectGitRepo(cwd),
|
|
46
59
|
timeZone: detectTimeZone(),
|
|
60
|
+
datetime: formatPromptDateTime(at),
|
|
47
61
|
};
|
|
48
62
|
}
|
|
49
63
|
//# sourceMappingURL=environment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/core/prompts/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,OAAO,IAA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ACd,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ,IAAI,SAAS,CAAC;AACvE,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CAAC,IAAU;IAC7C,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;QACtC,SAAS,EAAE,MAAM;QACjB,SAAS,EAAE,OAAO;KACnB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAAW,IAAI,IAAI,EAAE;IAErB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,OAAO;QACL,GAAG;QACH,QAAQ,EAAE,cAAc,EAAE;QAC1B,SAAS,EAAE,eAAe,EAAE;QAC5B,KAAK,EAAE,WAAW,EAAE;QACpB,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC;QAC7B,QAAQ,EAAE,cAAc,EAAE;QAC1B,QAAQ,EAAE,oBAAoB,CAAC,EAAE,CAAC;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -8,5 +8,6 @@ Runtime environment captured when this prompt was built:
|
|
|
8
8
|
- OS version: `{{ environment.osVersion }}`
|
|
9
9
|
- Is git repository: `{{ environment.isGitRepo }}`
|
|
10
10
|
- Time zone: `{{ environment.timeZone }}`
|
|
11
|
+
- Date & time at session start: `{{ environment.datetime }}`
|
|
11
12
|
|
|
12
|
-
Use this to choose correct path handling, shell syntax, and platform-specific behavior.
|
|
13
|
+
Use this to choose correct path handling, shell syntax, and platform-specific behavior. The date & time above is from session start and goes stale in long sessions; use `get_current_time` whenever the precise current time matters.
|
|
@@ -7,5 +7,5 @@ You have access to a `web_search` tool for finding relevant webpages and snippet
|
|
|
7
7
|
- Use only supported inputs: `query`, optional `count`, `freshness`, `start_date`, `end_date`, `country`, and `safe_search`.
|
|
8
8
|
- Keep `query` focused on the topic, entity, source, and search operators. Do not invent provider-specific parameters.
|
|
9
9
|
- For relative-time requests such as "latest" or "this week", prefer `freshness` or a date range over stuffing date words into `query`.
|
|
10
|
-
-
|
|
10
|
+
- To interpret relative dates, start from the session-start date & time in the Environment section, and call `get_current_time` when the precise current time or a specific timezone matters.
|
|
11
11
|
- `web_search` returns result pages and snippets, not full article bodies.
|
|
@@ -9,6 +9,12 @@ export declare class System {
|
|
|
9
9
|
private readonly path;
|
|
10
10
|
private readonly config;
|
|
11
11
|
private readonly mode;
|
|
12
|
+
/**
|
|
13
|
+
* Captured once per instance so every `reload()` in a session renders the
|
|
14
|
+
* same date/time — a per-turn timestamp would change the prompt prefix on
|
|
15
|
+
* every request and defeat provider prompt caching.
|
|
16
|
+
*/
|
|
17
|
+
private readonly builtAt;
|
|
12
18
|
private data;
|
|
13
19
|
private sourceFingerprint;
|
|
14
20
|
private compiledTemplate;
|
|
@@ -36,6 +36,12 @@ export class System {
|
|
|
36
36
|
path;
|
|
37
37
|
config;
|
|
38
38
|
mode;
|
|
39
|
+
/**
|
|
40
|
+
* Captured once per instance so every `reload()` in a session renders the
|
|
41
|
+
* same date/time — a per-turn timestamp would change the prompt prefix on
|
|
42
|
+
* every request and defeat provider prompt caching.
|
|
43
|
+
*/
|
|
44
|
+
builtAt = new Date();
|
|
39
45
|
data = "";
|
|
40
46
|
sourceFingerprint = "";
|
|
41
47
|
compiledTemplate = null;
|
|
@@ -157,7 +163,7 @@ export class System {
|
|
|
157
163
|
return {
|
|
158
164
|
name: this.config.name,
|
|
159
165
|
llm: this.config.llm,
|
|
160
|
-
environment: getEnvironmentPromptContext(),
|
|
166
|
+
environment: getEnvironmentPromptContext(this.builtAt),
|
|
161
167
|
compaction: this.config.compaction,
|
|
162
168
|
mode: this.mode,
|
|
163
169
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../../src/core/prompts/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;AAE/B,gEAAgE;AAChE,MAAM,mBAAmB,GAAG;IAC1B,aAAa;IACb,gBAAgB;IAChB,SAAS;IACT,aAAa;IACb,aAAa;IACb,eAAe;IACf,UAAU;IACV,eAAe;IACf,UAAU;IACV,WAAW;IACX,WAAW;IACX,cAAc;IACd,aAAa;CACL,CAAC;AAEX,MAAM,oBAAoB,GAAG;IAC3B,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE;IAC1C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,kBAAkB,EAAE;IAClD,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE;IAC1C,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE;CACpC,CAAC;AAIX,MAAM,aAAa,GAAG,aAAa,CAAC;AAEpC;;;;GAIG;AACH,MAAM,OAAO,MAAM;IACA,IAAI,CAAS;IACb,MAAM,CAAS;IACf,IAAI,CAAa;
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../../src/core/prompts/system.ts"],"names":[],"mappings":"AAAA,OAAO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AkB,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;aAC/C,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;aACnC,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -47,19 +47,35 @@ This is the default shape Hooman writes when `~/.hooman/config.json` is missing:
|
|
|
47
47
|
"name": "Hooman",
|
|
48
48
|
"providers": [
|
|
49
49
|
{
|
|
50
|
-
"name": "
|
|
51
|
-
"provider": "
|
|
50
|
+
"name": "llama.cpp",
|
|
51
|
+
"provider": "llama-cpp",
|
|
52
52
|
"options": {}
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
"llms": [
|
|
56
56
|
{
|
|
57
|
-
"name": "
|
|
58
|
-
"provider": "
|
|
57
|
+
"name": "Qwen3 1.7B",
|
|
58
|
+
"provider": "llama.cpp",
|
|
59
59
|
"options": {
|
|
60
|
-
"model": "
|
|
60
|
+
"model": "Qwen/Qwen3-1.7B-GGUF:Q8_0"
|
|
61
61
|
},
|
|
62
62
|
"default": true
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "Qwen3.5 0.8B",
|
|
66
|
+
"provider": "llama.cpp",
|
|
67
|
+
"options": {
|
|
68
|
+
"model": "unsloth/Qwen3.5-0.8B-MTP-GGUF:Q8_0"
|
|
69
|
+
},
|
|
70
|
+
"default": false
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "Gemma 4 E2B",
|
|
74
|
+
"provider": "llama.cpp",
|
|
75
|
+
"options": {
|
|
76
|
+
"model": "unsloth/gemma-4-E2B-it-GGUF:Q8_0"
|
|
77
|
+
},
|
|
78
|
+
"default": false
|
|
63
79
|
}
|
|
64
80
|
],
|
|
65
81
|
"search": {
|
|
@@ -47,6 +47,7 @@ Supported `providers[].provider` values:
|
|
|
47
47
|
"bedrock",
|
|
48
48
|
"google",
|
|
49
49
|
"groq",
|
|
50
|
+
"llama-cpp",
|
|
50
51
|
"minimax",
|
|
51
52
|
"moonshot",
|
|
52
53
|
"ollama",
|
|
@@ -91,6 +92,7 @@ Common shape:
|
|
|
91
92
|
- `bedrock`: provider `options` support `region`, `accessKeyId`, `secretAccessKey`, `sessionToken`, optional `apiKey`, and optional `reasoning` (an object with optional `effort` and optional `display` — `"summarized"` or `"omitted"`). Providing `reasoning` enables extended thinking on supported models (e.g. Claude); because Bedrock's Converse API requires a budget, `effort` (default `"medium"`) maps to `budget_tokens` (`minimal`→1024, `low`→2048, `medium`→4096, `high`→8192). Ensure the LLM `maxTokens` exceeds the budget. Newer Bedrock Claude (e.g. Opus 4.7+) hide reasoning by default and reject `type: "enabled"`; set `display: "summarized"` to reveal it — this switches to `thinking: { type: "adaptive", display }` with `output_config.effort` (`minimal`→`low`, else passthrough) sent via `additionalRequestFields`. LLM `options` support `model`, `temperature`, and `maxTokens`.
|
|
92
93
|
- `google`: provider `options` support `apiKey` and optional `reasoning` (an object with optional `effort`). Setting `reasoning.effort` enables Gemini thinking with a dynamic budget (`thinkingConfig: { includeThoughts: true, thinkingBudget: -1 }`). LLM `options` support `model`, `temperature`, and `maxTokens` (Hooman maps this to the Google SDK's `maxOutputTokens` internally).
|
|
93
94
|
- `groq`: provider `options` support `apiKey`, optional `baseURL`, optional `headers`, and optional `reasoning` (an object with optional `effort`). `reasoning.effort` maps to Groq's `reasoning_effort` (`minimal`→`low`) and streams reasoning via `reasoning_format: "parsed"`. Only reasoning models honor it. LLM `options` support `model`, `temperature`, and `maxTokens`.
|
|
95
|
+
- `llama-cpp`: runs GGUF models in-process via node-llama-cpp (no server needed); weights are downloaded from the Hugging Face Hub into `~/.hooman/cache/huggingface` on first use. Provider `options` support optional `hfToken` (Hugging Face access token for gated/private repos; falls back to the `HF_TOKEN` env var), optional `gpu` (`"auto"` — default, `"metal"`, `"cuda"`, `"vulkan"`, or `false` for CPU-only), optional `contextSize` (tokens; defaults to adapting to the model and available memory), and optional `reasoning` (an object with optional `effort`). Providing `reasoning` enables thinking (the chat template is configured to allow thought segments — Qwen3 thinking mode, Gemma 4 reasoning turns, gpt-oss/Harmony native effort levels — with `effort` capping thought tokens via a budget: `minimal`→1024, `low`→2048, `medium`→4096, `high`→8192, default `medium`); omitting it disables thinking (templates discourage thoughts, thought budget forced to 0). LLM `options.model` accepts a Hugging Face repo (`owner/repo`, GGUF auto-detected preferring common quantizations like Q4_K_M), a repo with a quant tag (`owner/repo:Q8_0`), an exact file (`owner/repo/path/to/file.gguf`), or a local `.gguf` path; the out-of-the-box config ships two entries — `Qwen/Qwen3-1.7B-GGUF:Q8_0` (default) and `unsloth/gemma-4-E2B-it-GGUF:Q8_0`; `temperature` and `maxTokens` are supported.
|
|
94
96
|
- `minimax`: provider `options` support `apiKey`, optional `headers`, and optional `reasoning` (an object with optional `effort` — `"minimal"`, `"low"`, `"medium"`, `"high"` — and optional `display` — `"summarized"` or `"omitted"`). Providing `reasoning` enables thinking, normalized to MiniMax's `thinking: { type: "adaptive", budget_tokens }`; `effort` defaults to `"medium"` and maps to an explicit budget (`minimal`→1024, `low`→2048, `medium`→4096, `high`→8192). Setting `display` switches to `thinking: { type: "adaptive", display }` with `output_config.effort` instead of a budget. Omit `reasoning` to keep thinking off. Hooman routes this through the Anthropic-compatible MiniMax endpoint automatically.
|
|
95
97
|
- `moonshot`: provider `options` support `apiKey`, optional `baseURL`, optional `headers`, and optional `reasoning` (an object with optional `effort`). Setting `reasoning.effort` enables Kimi thinking (`thinking: { type: "enabled" }`). Served through the reasoning-aware openai-compatible adapter, so Kimi's `reasoning_content` is surfaced as thinking. When `baseURL` is omitted, Hooman defaults it to `https://api.moonshot.ai/v1`. To reach Kimi through an OpenAI-compatible proxy (e.g. LiteLLM), use this provider with `baseURL` set to the proxy's `/v1` endpoint — the `openai` provider's Chat adapter would otherwise drop Kimi's reasoning.
|
|
96
98
|
- `ollama`: provider `options` support optional `baseURL` and optional `reasoning` (an object with optional `effort`). Setting `reasoning.effort` enables thinking, mapped to Ollama's `think` level (`minimal`/`low`→`"low"`, `medium`→`"medium"`, `high`→`"high"`). LLM `options` support `model`, `temperature`, and `maxTokens`.
|
|
@@ -78,3 +78,23 @@ Same shape as `streamable-http` but with `type: "sse"`. Use only for legacy remo
|
|
|
78
78
|
- Prefer `streamable-http` over `sse` for remote servers unless the user specifically needs SSE.
|
|
79
79
|
- For bearer tokens, use `headers.Authorization`; for local subprocess secrets, use `env`.
|
|
80
80
|
- If a server package's README gives a specific JSON block, adapt it into the `mcpServers` object and preserve the required command, args, env, URL, and headers.
|
|
81
|
+
|
|
82
|
+
## CLI Commands
|
|
83
|
+
|
|
84
|
+
Hooman ships `mcp` subcommands for OAuth-related maintenance of servers already defined in `~/.hooman/mcp.json`. These only apply to remote (`streamable-http`/`sse`) servers configured with OAuth — they do not add, remove, or edit server entries (that's a direct `mcp.json` edit, per above).
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
hooman mcp auth <server> # OAuth login for a configured MCP server
|
|
88
|
+
hooman mcp logout <server> # Clear stored OAuth credentials (defaults to scope "all")
|
|
89
|
+
hooman mcp logout <server> --scope all # Clear discovery, client registration, and tokens
|
|
90
|
+
hooman mcp logout <server> --scope client # Clear only the registered OAuth client
|
|
91
|
+
hooman mcp logout <server> --scope tokens # Clear only the stored access/refresh tokens
|
|
92
|
+
hooman mcp logout <server> --scope discovery # Clear only cached OAuth server metadata
|
|
93
|
+
hooman mcp auth-status # Show OAuth status for all configured MCP servers
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
- `<server>` must match a key under `mcpServers` in `mcp.json`.
|
|
97
|
+
- `hooman mcp auth` starts the OAuth flow (opening a local callback server as needed) and stores credentials in `~/.hooman/mcp-oauth.json`.
|
|
98
|
+
- `hooman mcp logout` clears stored OAuth state without touching `mcp.json`; use it before re-authenticating with different credentials or when decommissioning a server.
|
|
99
|
+
- `hooman mcp auth-status` reports each server's OAuth state (e.g. authenticated, expired, not authenticated) without making network calls to the server itself beyond what's needed to read stored state.
|
|
100
|
+
- These commands operate on the home config (`~/.hooman/mcp.json`) only, not repo-local `.hooman/mcp.json` overlays.
|
|
@@ -26,6 +26,14 @@ export type AskUserResponse = {
|
|
|
26
26
|
answer: string;
|
|
27
27
|
} | {
|
|
28
28
|
kind: "dismissed";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The backend exists but could not reach a user for this particular call
|
|
32
|
+
* (e.g. a channel job whose originating server does not relay questions).
|
|
33
|
+
* Reported to the model the same as having no backend at all.
|
|
34
|
+
*/
|
|
35
|
+
| {
|
|
36
|
+
kind: "unavailable";
|
|
29
37
|
};
|
|
30
38
|
export type AskUserBackend = {
|
|
31
39
|
ask(request: AskUserRequest): Promise<AskUserResponse>;
|
|
@@ -31,12 +31,13 @@ export function createAskUserTools() {
|
|
|
31
31
|
.describe(`Between ${MIN_OPTIONS} and ${MAX_OPTIONS} short answer choices, recommended option first.`),
|
|
32
32
|
}),
|
|
33
33
|
callback: async (input, context) => {
|
|
34
|
+
const noUserAvailable = () => toJsonValue({
|
|
35
|
+
status: "no_user_available",
|
|
36
|
+
message: "No interactive user is available to answer questions in this environment. Proceed with your best judgement and state the assumption you made.",
|
|
37
|
+
});
|
|
34
38
|
const backend = getAskUserBackend(context?.agent);
|
|
35
39
|
if (!backend) {
|
|
36
|
-
return
|
|
37
|
-
status: "no_user_available",
|
|
38
|
-
message: "No interactive user is available to answer questions in this environment. Proceed with your best judgement and state the assumption you made.",
|
|
39
|
-
});
|
|
40
|
+
return noUserAvailable();
|
|
40
41
|
}
|
|
41
42
|
const response = await backend.ask({
|
|
42
43
|
question: input.question,
|
|
@@ -44,6 +45,9 @@ export function createAskUserTools() {
|
|
|
44
45
|
toolUseId: context?.toolUse.toolUseId,
|
|
45
46
|
signal: context?.agent.cancelSignal,
|
|
46
47
|
});
|
|
48
|
+
if (response.kind === "unavailable") {
|
|
49
|
+
return noUserAvailable();
|
|
50
|
+
}
|
|
47
51
|
if (response.kind === "dismissed") {
|
|
48
52
|
return toJsonValue({
|
|
49
53
|
status: "dismissed",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user.js","sourceRoot":"","sources":["../../../src/core/tools/ask-user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;AAE7C,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,WAAW,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ask-user.js","sourceRoot":"","sources":["../../../src/core/tools/ask-user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;AAE7C,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,WAAW,GAAG,CAAC,CAAC;AAyCtB,4EAA4E;AAC5E,MAAM,QAAQ,GAAG,IAAI,OAAO,EAA0B,CAAC;AAEvD,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,OAAuB;IAEvB,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAAyB;IAEzB,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAc,CAAC;AACxD,CAAC;AA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,CAAC;oBAClC,OAAO,WAAW,CAAC;wBACjB,MAAM,EAAE,WAAW;wBACnB,OAAO,EACL,+JAA+J;qBAClK,CAAC,CAAC;gBACL,CAAC;gBACD,OAAO,WAAW,CAAC;oBACjB,MAAM,EAAE,UAAU;oBAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ;oBACxB,MAAM,EAAE,QAAQ,CAAC,MAAM;iBACxB,CAAC,CAAC;YACL,CAAC;SACF,CAAC;KACH,CAAC;AACJ,CAAC"}
|
package/dist/core/tools/time.js
CHANGED
|
@@ -50,7 +50,7 @@ export function createTimeTools() {
|
|
|
50
50
|
return [
|
|
51
51
|
tool({
|
|
52
52
|
name: "get_current_time",
|
|
53
|
-
description: "Get the current time in a specific timezone.
|
|
53
|
+
description: "Get the current time, optionally in a specific timezone. The system prompt only carries the session-start date & time, so use this whenever the precise current time matters.",
|
|
54
54
|
inputSchema: z.object({
|
|
55
55
|
timezone: z
|
|
56
56
|
.string()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../../src/core/tools/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAc,CAAC;AACxD,CAAC;AAED,SAAS,gBAAgB;IACvB,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC;IACvC,OAAO,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACnD,CAAC;AAED,SAAS,eAAe,CAAC,QAAiB;IACxC,MAAM,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