@gajae-code/ai 0.15.3 → 0.15.4
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/CHANGELOG.md +2 -0
- package/dist/types/types.d.ts +1 -1
- package/package.json +3 -3
- package/src/types.d.ts +1 -1
- package/src/types.ts +1 -0
- package/src/utils/idle-iterator.ts +6 -0
- package/src/utils/validation.ts +2 -0
package/CHANGELOG.md
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -630,7 +630,7 @@ export type TSchema = ZodType | TJsonSchema;
|
|
|
630
630
|
export type Static<S> = S extends ZodType ? z.infer<S> : S extends {
|
|
631
631
|
static: infer T;
|
|
632
632
|
} ? T : unknown;
|
|
633
|
-
export type RawArgumentRejectionCode = "ask-intent-review-requires-positive-round" | "ask-intent-contract-requires-non-empty-authority" | "ask-deep-interview-metadata-requires-deep-interview-gate" | "ask-round-zero-metadata-requires-full-topology-fields" | "todo-write-unknown-root-key" | "todo-write-unknown-op-entry-key" | "todo-write-unknown-op-value" | "todo-write-done-drop-requires-target" | "todo-write-unknown-init-entry-key";
|
|
633
|
+
export type RawArgumentRejectionCode = "ask-deep-interview-question-body-required" | "ask-intent-review-requires-positive-round" | "ask-intent-contract-requires-non-empty-authority" | "ask-deep-interview-metadata-requires-deep-interview-gate" | "ask-round-zero-metadata-requires-full-topology-fields" | "todo-write-unknown-root-key" | "todo-write-unknown-op-entry-key" | "todo-write-unknown-op-value" | "todo-write-done-drop-requires-target" | "todo-write-unknown-init-entry-key";
|
|
634
634
|
/**
|
|
635
635
|
* Optional structured detail attached to a raw-argument rejection. The fixed
|
|
636
636
|
* per-code guidance in `RAW_ARGUMENT_REJECTION_MESSAGES` explains the shape;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@gajae-code/ai",
|
|
4
|
-
"version": "0.15.
|
|
4
|
+
"version": "0.15.4",
|
|
5
5
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
6
6
|
"homepage": "https://gajae-code.com",
|
|
7
7
|
"author": "Yeachan-Heo and Gajae Code Contributors",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@anthropic-ai/sdk": "^0.94.0",
|
|
42
42
|
"@bufbuild/protobuf": "^2.12.0",
|
|
43
|
-
"@gajae-code/natives": "0.15.
|
|
44
|
-
"@gajae-code/utils": "0.15.
|
|
43
|
+
"@gajae-code/natives": "0.15.4",
|
|
44
|
+
"@gajae-code/utils": "0.15.4",
|
|
45
45
|
"openai": "^6.36.0",
|
|
46
46
|
"partial-json": "^0.1.7",
|
|
47
47
|
"zod": "4.4.3"
|
package/src/types.d.ts
CHANGED
|
@@ -630,7 +630,7 @@ export type TSchema = ZodType | TJsonSchema;
|
|
|
630
630
|
export type Static<S> = S extends ZodType ? z.infer<S> : S extends {
|
|
631
631
|
static: infer T;
|
|
632
632
|
} ? T : unknown;
|
|
633
|
-
export type RawArgumentRejectionCode = "ask-intent-review-requires-positive-round" | "ask-intent-contract-requires-non-empty-authority" | "ask-deep-interview-metadata-requires-deep-interview-gate" | "ask-round-zero-metadata-requires-full-topology-fields" | "todo-write-unknown-root-key" | "todo-write-unknown-op-entry-key" | "todo-write-unknown-op-value" | "todo-write-done-drop-requires-target" | "todo-write-unknown-init-entry-key";
|
|
633
|
+
export type RawArgumentRejectionCode = "ask-deep-interview-question-body-required" | "ask-intent-review-requires-positive-round" | "ask-intent-contract-requires-non-empty-authority" | "ask-deep-interview-metadata-requires-deep-interview-gate" | "ask-round-zero-metadata-requires-full-topology-fields" | "todo-write-unknown-root-key" | "todo-write-unknown-op-entry-key" | "todo-write-unknown-op-value" | "todo-write-done-drop-requires-target" | "todo-write-unknown-init-entry-key";
|
|
634
634
|
/**
|
|
635
635
|
* Optional structured detail attached to a raw-argument rejection. The fixed
|
|
636
636
|
* per-code guidance in `RAW_ARGUMENT_REJECTION_MESSAGES` explains the shape;
|
package/src/types.ts
CHANGED
|
@@ -871,6 +871,7 @@ export type TSchema = ZodType | TJsonSchema;
|
|
|
871
871
|
export type Static<S> = S extends ZodType ? z.infer<S> : S extends { static: infer T } ? T : unknown;
|
|
872
872
|
|
|
873
873
|
export type RawArgumentRejectionCode =
|
|
874
|
+
| "ask-deep-interview-question-body-required"
|
|
874
875
|
| "ask-intent-review-requires-positive-round"
|
|
875
876
|
| "ask-intent-contract-requires-non-empty-authority"
|
|
876
877
|
| "ask-deep-interview-metadata-requires-deep-interview-gate"
|
|
@@ -5,6 +5,11 @@ const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 120_000;
|
|
|
5
5
|
const DEFAULT_STREAM_FIRST_EVENT_TIMEOUT_MS = 100_000;
|
|
6
6
|
const ALIBABA_TOKEN_PLAN_FIRST_EVENT_TIMEOUT_MS = 600_000;
|
|
7
7
|
const KIMI_CODE_FIRST_EVENT_TIMEOUT_MS = 300_000;
|
|
8
|
+
// Local LM Studio models can spend several minutes loading weights and filling
|
|
9
|
+
// the prompt before emitting their first SSE event. Keep the shared default
|
|
10
|
+
// for other OpenAI-compatible providers, but avoid aborting legitimate local
|
|
11
|
+
// inference during that startup window.
|
|
12
|
+
const LM_STUDIO_FIRST_EVENT_TIMEOUT_MS = 300_000;
|
|
8
13
|
// Ollama Cloud is a hosted proxy where queueing/cold-start plus long prefill
|
|
9
14
|
// (thinking-mode requests over 1M-context sessions) routinely exceeds 120s before
|
|
10
15
|
// the first streamed token; 300s matches kimi-code's floor for long-reasoning silence.
|
|
@@ -34,6 +39,7 @@ export function isGrokModelId(modelId: string | undefined): boolean {
|
|
|
34
39
|
|
|
35
40
|
export function getProviderFirstEventTimeoutFallbackMs(provider: string): number | undefined {
|
|
36
41
|
if (provider === "alibaba-token-plan") return ALIBABA_TOKEN_PLAN_FIRST_EVENT_TIMEOUT_MS;
|
|
42
|
+
if (provider === "lm-studio") return LM_STUDIO_FIRST_EVENT_TIMEOUT_MS;
|
|
37
43
|
if (provider === "ollama-cloud") return OLLAMA_CLOUD_FIRST_EVENT_TIMEOUT_MS;
|
|
38
44
|
return provider === "kimi-code" ? KIMI_CODE_FIRST_EVENT_TIMEOUT_MS : undefined;
|
|
39
45
|
}
|
package/src/utils/validation.ts
CHANGED
|
@@ -959,6 +959,8 @@ export function validateToolCall(tools: Tool[], toolCall: ToolCall): ToolCall["a
|
|
|
959
959
|
}
|
|
960
960
|
|
|
961
961
|
const RAW_ARGUMENT_REJECTION_MESSAGES: Record<RawArgumentRejectionCode, string> = {
|
|
962
|
+
"ask-deep-interview-question-body-required":
|
|
963
|
+
"deep-interview question bodies must contain a specific question, not a placeholder",
|
|
962
964
|
"ask-intent-review-requires-positive-round":
|
|
963
965
|
"deepInterview.intent_review is post-Round-0 only and requires a positive round",
|
|
964
966
|
"ask-intent-contract-requires-non-empty-authority":
|