@crewx/sdk 0.8.9-rc.16 → 0.8.9-rc.17
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/activity-log/builder.d.ts +0 -4
- package/dist/config/pricing.d.ts +9 -0
- package/dist/esm/index.js +88 -52
- package/dist/esm/plugins/index.js +63 -27
- package/dist/esm/repository/index.js +61 -25
- package/dist/index.js +89 -53
- package/dist/plugins/index.js +63 -27
- package/dist/repository/index.d.ts +1 -1
- package/dist/repository/index.js +61 -25
- package/dist/repository/task.repository.d.ts +12 -0
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const DEFAULT_ACTIVITY_LOG_BUDGET = 24000;
|
|
2
1
|
export declare function checkStale(tool: string, input: string | null, taskCompletedAt?: string | null): 'ok' | 'stale' | 'unknown';
|
|
3
2
|
export interface ActivityEntry {
|
|
4
3
|
tool: string;
|
|
@@ -6,7 +5,6 @@ export interface ActivityEntry {
|
|
|
6
5
|
result: string | null;
|
|
7
6
|
status: 'ok' | 'stale' | 'unknown';
|
|
8
7
|
reusable: boolean;
|
|
9
|
-
bodyIncluded: boolean;
|
|
10
8
|
}
|
|
11
9
|
export interface ActivityLogResult {
|
|
12
10
|
threadId: string;
|
|
@@ -15,11 +13,9 @@ export interface ActivityLogResult {
|
|
|
15
13
|
entries: ActivityEntry[];
|
|
16
14
|
totalEntries: number;
|
|
17
15
|
truncated: boolean;
|
|
18
|
-
budgetUsed: number;
|
|
19
16
|
}
|
|
20
17
|
export declare function buildActivityLogByTask(opts: {
|
|
21
18
|
threadId: string;
|
|
22
19
|
agentId: string;
|
|
23
20
|
lookback: number;
|
|
24
|
-
tokenBudget?: number;
|
|
25
21
|
}): Map<string, string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ModelPricing {
|
|
2
|
+
input: number;
|
|
3
|
+
cachedInput: number;
|
|
4
|
+
output: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const MODEL_PRICING: Record<string, ModelPricing>;
|
|
7
|
+
export declare function getPricing(model: string | null | undefined): ModelPricing;
|
|
8
|
+
export declare function calculateCost(inputTokens: number, outputTokens: number, model: string | null | undefined, cachedInputTokens?: number): number;
|
|
9
|
+
export declare function resolveCost(costUsd: number | undefined, inputTokens: number | undefined, outputTokens: number | undefined, cachedInputTokens: number | undefined, model: string | null | undefined): number;
|