@nuvin/agent-core 0.1.1-rc.0 → 0.2.0-rc.2
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/dist/VERSION +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/agent/metrics.d.ts +8 -0
- package/dist/chunk-D5IVWJHX.js +1 -1
- package/dist/chunk-FFIZ6TKW.js +1 -1
- package/dist/chunk-JQLCZGQ7.js +1 -0
- package/dist/chunk-NYZR4XKO.js +1 -1
- package/dist/chunk-WDPOWIJR.js +1 -0
- package/dist/chunk-X7VAACWY.js +1 -1
- package/dist/chunk-YNOIG4FD.js +1 -0
- package/dist/formats/index.js +1 -1
- package/dist/formats/message-format.d.ts +1 -0
- package/dist/hooks/index.js +1 -1
- package/dist/models/chat-model.d.ts +1 -0
- package/dist/models/github-model.d.ts +2 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +1 -1
- package/dist/models/mock-model.d.ts +2 -0
- package/dist/models/model-cost.d.ts +5 -0
- package/dist/models/model-pricing-generator.d.ts +9 -0
- package/dist/models/model-pricing-products.d.ts +45 -0
- package/dist/models/model-pricing-types.d.ts +33 -0
- package/dist/models/model-pricing.d.ts +13 -0
- package/dist/models/model-pricing.generated.d.ts +23147 -0
- package/dist/models/openai-surfaces.d.ts +3 -0
- package/dist/models/routed-model.d.ts +3 -0
- package/dist/shared/index.js +1 -1
- package/dist/shared/types.d.ts +38 -7
- package/dist/tools/index.js +1 -1
- package/dist/tools/mcp-server-manager.d.ts +9 -4
- package/dist/tools/mcp-tool-adapter.d.ts +6 -1
- package/dist/tools/runtime-manager-tools.d.ts +11 -0
- package/dist/tools/tools.d.ts +4 -1
- package/package.json +2 -2
- package/dist/chunk-BLGBVFVX.js +0 -1
- package/dist/chunk-UIXQPCSN.js +0 -1
- package/dist/chunk-YWQXXHHU.js +0 -1
|
@@ -3,12 +3,14 @@ export interface MockModelOptions {
|
|
|
3
3
|
model?: string;
|
|
4
4
|
modelIdentity?: string;
|
|
5
5
|
maxTokens?: number;
|
|
6
|
+
pricingProviderId?: string;
|
|
6
7
|
reasoning?: ReasoningConfig;
|
|
7
8
|
}
|
|
8
9
|
export declare class MockModel implements EngineChatModel {
|
|
9
10
|
readonly model: string;
|
|
10
11
|
readonly modelIdentity: string;
|
|
11
12
|
readonly maxTokens?: number;
|
|
13
|
+
readonly pricingProviderId?: string;
|
|
12
14
|
readonly requests: ChatRequest[];
|
|
13
15
|
private readonly reasoning?;
|
|
14
16
|
constructor(options?: MockModelOptions);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReportedModelCost } from "../shared/types.ts";
|
|
2
|
+
export declare const USD_TICKS_PER_DOLLAR = 10000000000;
|
|
3
|
+
export declare function normalizeOpenRouterReportedCost(pricingProviderId: string | undefined, value: unknown): ReportedModelCost | undefined;
|
|
4
|
+
export declare function normalizeXaiReportedCost(pricingProviderId: string | undefined, value: unknown): ReportedModelCost | undefined;
|
|
5
|
+
//# sourceMappingURL=model-cost.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PricingProjection } from "./model-pricing-types.ts";
|
|
2
|
+
export interface BuildPricingProjectionOptions {
|
|
3
|
+
generatedAt: string;
|
|
4
|
+
snapshotId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function buildPricingProjection(source: unknown, options: BuildPricingProjectionOptions): PricingProjection;
|
|
7
|
+
export declare function renderPricingProjection(projection: PricingProjection): string;
|
|
8
|
+
export declare function hasSnapshotId(generatedSource: string, snapshotId: string): boolean;
|
|
9
|
+
//# sourceMappingURL=model-pricing-generator.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type ModelsDevProviderId = "anthropic" | "deepseek" | "github-copilot" | "minimax" | "openai" | "opencode-go" | "openrouter" | "xai" | "xiaomi-token-plan-sgp" | "zai-coding-plan";
|
|
2
|
+
export interface PricingProductDefinition {
|
|
3
|
+
modelsDevProviderId?: ModelsDevProviderId;
|
|
4
|
+
chatCompletionsIncludeUsage?: true;
|
|
5
|
+
}
|
|
6
|
+
export declare const NUVIN_PRICING_PRODUCTS: {
|
|
7
|
+
readonly anthropic: {
|
|
8
|
+
readonly modelsDevProviderId: "anthropic";
|
|
9
|
+
};
|
|
10
|
+
readonly commandcode: {};
|
|
11
|
+
readonly deepseek: {
|
|
12
|
+
readonly modelsDevProviderId: "deepseek";
|
|
13
|
+
};
|
|
14
|
+
readonly github: {
|
|
15
|
+
readonly modelsDevProviderId: "github-copilot";
|
|
16
|
+
readonly chatCompletionsIncludeUsage: true;
|
|
17
|
+
};
|
|
18
|
+
readonly grok: {
|
|
19
|
+
readonly modelsDevProviderId: "xai";
|
|
20
|
+
};
|
|
21
|
+
readonly minimax: {
|
|
22
|
+
readonly modelsDevProviderId: "minimax";
|
|
23
|
+
};
|
|
24
|
+
readonly openai: {
|
|
25
|
+
readonly modelsDevProviderId: "openai";
|
|
26
|
+
readonly chatCompletionsIncludeUsage: true;
|
|
27
|
+
};
|
|
28
|
+
readonly "openai-codex": {};
|
|
29
|
+
readonly "opencode-go": {
|
|
30
|
+
readonly modelsDevProviderId: "opencode-go";
|
|
31
|
+
};
|
|
32
|
+
readonly openrouter: {
|
|
33
|
+
readonly modelsDevProviderId: "openrouter";
|
|
34
|
+
};
|
|
35
|
+
readonly xiaomi: {
|
|
36
|
+
readonly modelsDevProviderId: "xiaomi-token-plan-sgp";
|
|
37
|
+
};
|
|
38
|
+
readonly zai: {
|
|
39
|
+
readonly modelsDevProviderId: "zai-coding-plan";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare function modelsDevProviderIdForNuvinProvider(providerId: string | undefined): ModelsDevProviderId | undefined;
|
|
43
|
+
export declare function pricingProviderNeedsChatUsage(pricingProviderId: string | undefined): boolean;
|
|
44
|
+
export declare const SUPPORTED_MODELS_DEV_PROVIDER_IDS: ("openrouter" | "xai" | "anthropic" | "deepseek" | "github-copilot" | "minimax" | "openai" | "opencode-go" | "xiaomi-token-plan-sgp" | "zai-coding-plan")[];
|
|
45
|
+
//# sourceMappingURL=model-pricing-products.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface PricingRate {
|
|
2
|
+
input: number;
|
|
3
|
+
output: number;
|
|
4
|
+
reasoning?: number;
|
|
5
|
+
cacheRead?: number;
|
|
6
|
+
cacheWrite?: number;
|
|
7
|
+
inputAudio?: number;
|
|
8
|
+
outputAudio?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ContextPricingTier extends PricingRate {
|
|
11
|
+
thresholdInputTokens: number;
|
|
12
|
+
}
|
|
13
|
+
export interface PricingModel {
|
|
14
|
+
modelId: string;
|
|
15
|
+
rates: PricingRate;
|
|
16
|
+
contextTiers?: readonly ContextPricingTier[];
|
|
17
|
+
}
|
|
18
|
+
export interface PricingProvider {
|
|
19
|
+
providerId: string;
|
|
20
|
+
models: Readonly<Record<string, PricingModel>>;
|
|
21
|
+
}
|
|
22
|
+
export interface SafeModelFallback extends PricingModel {
|
|
23
|
+
pricingProviderIds: readonly string[];
|
|
24
|
+
matchKind: "model-unique" | "model-identical";
|
|
25
|
+
}
|
|
26
|
+
export interface PricingProjection {
|
|
27
|
+
source: "https://models.dev/api.json";
|
|
28
|
+
snapshotId: string;
|
|
29
|
+
generatedAt: string;
|
|
30
|
+
providers: Readonly<Record<string, PricingProvider>>;
|
|
31
|
+
safeModelFallbacks: Readonly<Record<string, SafeModelFallback>>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=model-pricing-types.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChatResponse, ChatResponseUsage, EstimatedModelCost } from "../shared/types.ts";
|
|
2
|
+
import type { PricingProjection } from "./model-pricing-types.ts";
|
|
3
|
+
/** 10_000_000_000 ticks/dollar ÷ 1_000_000 tokens = 10_000 ticks per token at $1/M. */
|
|
4
|
+
export declare const USD_TICKS_PER_TOKEN_AT_ONE_DOLLAR_PER_MILLION = 10000;
|
|
5
|
+
export interface ModelCostRequest {
|
|
6
|
+
model: string;
|
|
7
|
+
metadata: {
|
|
8
|
+
pricingProviderId?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare function estimateModelCost(request: ModelCostRequest, usage: ChatResponseUsage, projection?: PricingProjection): EstimatedModelCost | undefined;
|
|
12
|
+
export declare function withEstimatedModelCost(request: ModelCostRequest, response: ChatResponse, projection?: PricingProjection): ChatResponse;
|
|
13
|
+
//# sourceMappingURL=model-pricing.d.ts.map
|