indusagi 0.13.9 → 0.13.11
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 +6 -0
- package/dist/agent.js +125 -29
- package/dist/ai.js +173 -51
- package/dist/cli.js +36 -4
- package/dist/index.js +36 -4
- package/dist/llmgateway.js +36 -4
- package/dist/runtime.js +36 -4
- package/dist/shell-app.js +36 -4
- package/dist/smithy.js +36 -4
- package/dist/swarm.js +36 -4
- package/dist/types/facade/agent.d.ts +1 -1
- package/dist/types/facade/agent.test.d.ts +1 -0
- package/dist/types/facade/ai.d.ts +1 -1
- package/dist/types/facade/bot/types.d.ts +3 -3
- package/dist/types/facade/mcp.d.ts +1 -1
- package/dist/types/facade/ml/adapters/openai-codex-responses.d.ts +1 -1
- package/dist/types/facade/ml/adapters/openai-codex-responses.test.d.ts +1 -0
- package/dist/types/facade/ml/adapters/openai-responses.d.ts +1 -1
- package/dist/types/facade/ml/adapters/openai-responses.test.d.ts +1 -0
- package/dist/types/facade/ml/adapters/simple-options.d.ts +2 -2
- package/dist/types/facade/ml/models.generated.d.ts +54 -0
- package/dist/types/facade/ml/types.d.ts +14 -1
- package/dist/types/llmgateway/connectors/openai-responses.test.d.ts +1 -0
- package/dist/types/llmgateway/contract/index.d.ts +2 -2
- package/dist/types/llmgateway/contract/model-card.d.ts +14 -0
- package/dist/types/llmgateway/contract/options.d.ts +3 -1
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ResponseCreateParamsStreaming } from "openai/resources/responses/responses.js";
|
|
2
2
|
import type { SimpleStreamOptions, StreamFunction, StreamOptions } from "../types.js";
|
|
3
3
|
export interface OpenAIResponsesOptions extends StreamOptions {
|
|
4
|
-
reasoningEffort?: "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
4
|
+
reasoningEffort?: "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
5
5
|
reasoningSummary?: "auto" | "detailed" | "concise" | null;
|
|
6
6
|
serviceTier?: ResponseCreateParamsStreaming["service_tier"];
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -31,8 +31,8 @@ export declare class SimpleOptionsProviderError extends Error {
|
|
|
31
31
|
export declare function normalizeProviderError(error: unknown): SimpleOptionsProviderError;
|
|
32
32
|
export declare function executeWithRetry<T>(operation: () => Promise<T>, policy: RetryPolicy): Promise<T>;
|
|
33
33
|
export declare function buildBaseOptions(model: Model<Api>, options?: SimpleStreamOptions, apiKey?: string): StreamOptions;
|
|
34
|
-
export declare function clampReasoning(effort: ThinkingLevel | undefined): Exclude<ThinkingLevel, "xhigh"> | undefined;
|
|
35
|
-
export declare function mapThinkingLevel(level: ThinkingLevel | undefined, provider?: "supports-xhigh" | "clamp-xhigh"):
|
|
34
|
+
export declare function clampReasoning(effort: ThinkingLevel | undefined): Exclude<ThinkingLevel, "xhigh" | "max"> | undefined;
|
|
35
|
+
export declare function mapThinkingLevel(level: ThinkingLevel | undefined, provider?: "supports-xhigh" | "clamp-xhigh"): Exclude<ThinkingLevel, "max"> | undefined;
|
|
36
36
|
export declare function adjustMaxTokensForThinking(baseMaxTokens: number, modelMaxTokens: number, reasoningLevel: ThinkingLevel, customBudgets?: ThinkingBudgets): {
|
|
37
37
|
maxTokens: number;
|
|
38
38
|
thinkingBudget: number;
|
|
@@ -4637,6 +4637,33 @@ export declare const MODELS: {
|
|
|
4637
4637
|
contextWindow: number;
|
|
4638
4638
|
maxTokens: number;
|
|
4639
4639
|
};
|
|
4640
|
+
readonly "gpt-6-astra": {
|
|
4641
|
+
id: string;
|
|
4642
|
+
name: string;
|
|
4643
|
+
api: "openai-responses";
|
|
4644
|
+
provider: string;
|
|
4645
|
+
baseUrl: string;
|
|
4646
|
+
reasoning: true;
|
|
4647
|
+
reasoningEfforts: ("low" | "medium" | "high" | "xhigh" | "max")[];
|
|
4648
|
+
input: ("text" | "image")[];
|
|
4649
|
+
cost: {
|
|
4650
|
+
input: number;
|
|
4651
|
+
output: number;
|
|
4652
|
+
cacheRead: number;
|
|
4653
|
+
cacheWrite: number;
|
|
4654
|
+
};
|
|
4655
|
+
longContextPricing: {
|
|
4656
|
+
threshold: number;
|
|
4657
|
+
multipliers: {
|
|
4658
|
+
input: number;
|
|
4659
|
+
output: number;
|
|
4660
|
+
cacheRead: number;
|
|
4661
|
+
cacheWrite: number;
|
|
4662
|
+
};
|
|
4663
|
+
};
|
|
4664
|
+
contextWindow: number;
|
|
4665
|
+
maxTokens: number;
|
|
4666
|
+
};
|
|
4640
4667
|
readonly "gpt-5.6-sol": {
|
|
4641
4668
|
id: string;
|
|
4642
4669
|
name: string;
|
|
@@ -5098,6 +5125,33 @@ export declare const MODELS: {
|
|
|
5098
5125
|
contextWindow: number;
|
|
5099
5126
|
maxTokens: number;
|
|
5100
5127
|
};
|
|
5128
|
+
readonly "gpt-6-astra": {
|
|
5129
|
+
id: string;
|
|
5130
|
+
name: string;
|
|
5131
|
+
api: "openai-codex-responses";
|
|
5132
|
+
provider: string;
|
|
5133
|
+
baseUrl: string;
|
|
5134
|
+
reasoning: true;
|
|
5135
|
+
reasoningEfforts: ("low" | "medium" | "high" | "xhigh" | "max")[];
|
|
5136
|
+
input: ("text" | "image")[];
|
|
5137
|
+
cost: {
|
|
5138
|
+
input: number;
|
|
5139
|
+
output: number;
|
|
5140
|
+
cacheRead: number;
|
|
5141
|
+
cacheWrite: number;
|
|
5142
|
+
};
|
|
5143
|
+
longContextPricing: {
|
|
5144
|
+
threshold: number;
|
|
5145
|
+
multipliers: {
|
|
5146
|
+
input: number;
|
|
5147
|
+
output: number;
|
|
5148
|
+
cacheRead: number;
|
|
5149
|
+
cacheWrite: number;
|
|
5150
|
+
};
|
|
5151
|
+
};
|
|
5152
|
+
contextWindow: number;
|
|
5153
|
+
maxTokens: number;
|
|
5154
|
+
};
|
|
5101
5155
|
};
|
|
5102
5156
|
readonly opencode: {
|
|
5103
5157
|
readonly "big-pickle": {
|
|
@@ -4,13 +4,14 @@ export type KnownApi = "mock-ai" | "openai-completions" | "openai-responses" | "
|
|
|
4
4
|
export type Api = KnownApi | (string & {});
|
|
5
5
|
export type KnownProvider = "mock" | "amazon-bedrock" | "anthropic" | "google" | "google-vertex" | "openai" | "azure-openai-responses" | "openai-codex" | "github-copilot" | "xai" | "groq" | "cerebras" | "openrouter" | "vercel-ai-gateway" | "zai" | "mistral" | "minimax" | "minimax-cn" | "opencode" | "kimi" | "kimi-coding" | "sarvam" | "krutrim" | "nvidia";
|
|
6
6
|
export type Provider = KnownProvider | string;
|
|
7
|
-
export type ThinkingLevel = "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
7
|
+
export type ThinkingLevel = "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
8
8
|
/** Per-level token allowances for reasoning, used only by token-budget providers. */
|
|
9
9
|
export interface ThinkingBudgets {
|
|
10
10
|
minimal?: number;
|
|
11
11
|
low?: number;
|
|
12
12
|
medium?: number;
|
|
13
13
|
high?: number;
|
|
14
|
+
max?: number;
|
|
14
15
|
}
|
|
15
16
|
export interface StreamOptions {
|
|
16
17
|
temperature?: number;
|
|
@@ -228,6 +229,8 @@ export interface Model<TApi extends Api> {
|
|
|
228
229
|
provider: Provider;
|
|
229
230
|
baseUrl: string;
|
|
230
231
|
reasoning: boolean;
|
|
232
|
+
/** Explicit reasoning efforts accepted by this model; omitted when provider defaults apply. */
|
|
233
|
+
reasoningEfforts?: readonly Exclude<ThinkingLevel, "minimal">[];
|
|
231
234
|
input: ("text" | "image")[];
|
|
232
235
|
cost: {
|
|
233
236
|
input: number;
|
|
@@ -235,6 +238,16 @@ export interface Model<TApi extends Api> {
|
|
|
235
238
|
cacheRead: number;
|
|
236
239
|
cacheWrite: number;
|
|
237
240
|
};
|
|
241
|
+
/** Optional pricing tier applied by providers after an input-token threshold. */
|
|
242
|
+
longContextPricing?: {
|
|
243
|
+
threshold: number;
|
|
244
|
+
multipliers: {
|
|
245
|
+
input: number;
|
|
246
|
+
output: number;
|
|
247
|
+
cacheRead: number;
|
|
248
|
+
cacheWrite: number;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
238
251
|
contextWindow: number;
|
|
239
252
|
maxTokens: number;
|
|
240
253
|
headers?: Record<string, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Every downstream gateway module imports its vocabulary from this barrel.
|
|
5
5
|
*/
|
|
6
|
-
export type { ProviderId, ApiKind, Modality, CostSheet, ModelCard, } from "./model-card";
|
|
6
|
+
export type { ProviderId, ApiKind, Modality, CostSheet, LongContextPricing, ModelCard, } from "./model-card";
|
|
7
7
|
export type { JsonSchema, TextBlock, ThinkingBlock, ToolCallBlock, ToolResultBlock, ImageBlock, CommandBlock, Block, UserTurn, AssistantTurn, ToolTurn, Turn, ToolDescriptor, Conversation, } from "./conversation";
|
|
8
8
|
export type { Usage, StopReason, Reply } from "./reply";
|
|
9
9
|
export type { TextEmission, ThinkingEmission, ToolCallStartEmission, ToolCallDeltaEmission, UsageEmission, StopEmission, DoneEmission, ErrorEmission, Emission, Channel, } from "./emission";
|
|
10
|
-
export type { ThinkingLevel, ToolChoice, StreamOptions, } from "./options";
|
|
10
|
+
export type { ThinkingLevel, ReasoningEffort, ToolChoice, StreamOptions, } from "./options";
|
|
11
11
|
export type { GatewayErrorKind, GatewayErrorExtra, } from "./errors";
|
|
12
12
|
export { GatewayError, gatewayError } from "./errors";
|
|
13
13
|
export type { Connector, CredentialResolver } from "./connector";
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* behavior; connectors read it to shape their wire requests, and the pricing
|
|
6
6
|
* helpers read it to turn token counts into money.
|
|
7
7
|
*/
|
|
8
|
+
import type { ReasoningEffort } from "./options";
|
|
8
9
|
/**
|
|
9
10
|
* The upstream organization that owns a model. This is the *vendor* identity,
|
|
10
11
|
* independent of which HTTP dialect we speak to reach it (see {@link ApiKind}).
|
|
@@ -25,6 +26,16 @@ export interface CostSheet {
|
|
|
25
26
|
readonly cacheReadPerMTok?: number;
|
|
26
27
|
readonly cacheWritePerMTok?: number;
|
|
27
28
|
}
|
|
29
|
+
/** Optional higher-price tier triggered by a long input context. */
|
|
30
|
+
export interface LongContextPricing {
|
|
31
|
+
readonly threshold: number;
|
|
32
|
+
readonly multipliers: {
|
|
33
|
+
readonly input: number;
|
|
34
|
+
readonly output: number;
|
|
35
|
+
readonly cacheRead: number;
|
|
36
|
+
readonly cacheWrite: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
28
39
|
/**
|
|
29
40
|
* Static descriptor for one model. Identified by `id` within a `provider`.
|
|
30
41
|
*/
|
|
@@ -38,5 +49,8 @@ export interface ModelCard {
|
|
|
38
49
|
readonly maxOutputTokens: number;
|
|
39
50
|
readonly modalities: readonly Modality[];
|
|
40
51
|
readonly reasoning: boolean;
|
|
52
|
+
/** Explicit wire efforts for models whose accepted set differs from provider defaults. */
|
|
53
|
+
readonly reasoningEfforts?: readonly ReasoningEffort[];
|
|
54
|
+
readonly longContextPricing?: LongContextPricing;
|
|
41
55
|
readonly cost: CostSheet;
|
|
42
56
|
}
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* How much reasoning budget to grant a reasoning-capable model.
|
|
10
10
|
* `off` disables thinking entirely; the remaining levels scale the budget up.
|
|
11
11
|
*/
|
|
12
|
-
export type ThinkingLevel = "off" | "low" | "medium" | "high" | "max";
|
|
12
|
+
export type ThinkingLevel = "off" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
13
|
+
/** Reasoning efforts that can be sent on the wire (excluding disabled reasoning). */
|
|
14
|
+
export type ReasoningEffort = Exclude<ThinkingLevel, "off">;
|
|
13
15
|
/** Constrains how the model may use the declared tools on this turn. */
|
|
14
16
|
export type ToolChoice = "auto" | "required" | "none";
|
|
15
17
|
/** Options for a single streaming or one-shot invocation. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "indusagi",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.11",
|
|
4
4
|
"description": "Indusagi — a terminal-first AI coding agent framework. Clean-room implementation.",
|
|
5
5
|
"author": "Varun Israni",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
"marked": "^18.0.4",
|
|
158
158
|
"openai": "^6.41.0",
|
|
159
159
|
"partial-json": "^0.1.7",
|
|
160
|
+
"proxy-agent": "^8.0.2",
|
|
160
161
|
"react": "^18.3.1",
|
|
161
162
|
"strip-ansi": "^7.2.0",
|
|
162
163
|
"ulid": "^3.0.2",
|