@womp/spark-agent 3.0.0 → 3.0.1
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/agent-tools.js +4 -4
- package/dist/agent.js +1 -0
- package/dist/ui.d.ts +2 -0
- package/dist/ui.js +1 -0
- package/package.json +1 -1
package/dist/agent-tools.js
CHANGED
|
@@ -82,7 +82,7 @@ export function createSparkTools(options) {
|
|
|
82
82
|
},
|
|
83
83
|
};
|
|
84
84
|
const logs = [];
|
|
85
|
-
const receipts =
|
|
85
|
+
const receipts = new Map();
|
|
86
86
|
const artifacts = [];
|
|
87
87
|
const pending = new Set();
|
|
88
88
|
let outputBytes = 0;
|
|
@@ -117,7 +117,7 @@ export function createSparkTools(options) {
|
|
|
117
117
|
}
|
|
118
118
|
}),
|
|
119
119
|
recordReceipt: (receipt) => {
|
|
120
|
-
receipts.
|
|
120
|
+
receipts.set(receipt.id, structuredClone(receipt));
|
|
121
121
|
options.write({
|
|
122
122
|
type: "data-execution-receipt",
|
|
123
123
|
id: receipt.id,
|
|
@@ -169,7 +169,7 @@ export function createSparkTools(options) {
|
|
|
169
169
|
purpose: input.purpose,
|
|
170
170
|
value: jsonValue(value),
|
|
171
171
|
logs,
|
|
172
|
-
receipts,
|
|
172
|
+
receipts: [...receipts.values()],
|
|
173
173
|
artifacts,
|
|
174
174
|
};
|
|
175
175
|
}
|
|
@@ -182,7 +182,7 @@ export function createSparkTools(options) {
|
|
|
182
182
|
purpose: input.purpose,
|
|
183
183
|
value: null,
|
|
184
184
|
logs,
|
|
185
|
-
receipts,
|
|
185
|
+
receipts: [...receipts.values()],
|
|
186
186
|
artifacts,
|
|
187
187
|
error: errorMessage(error),
|
|
188
188
|
};
|
package/dist/agent.js
CHANGED
|
@@ -144,6 +144,7 @@ export function runSparkAgent(options) {
|
|
|
144
144
|
toolNames: step.toolCalls.map(({ toolName }) => toolName),
|
|
145
145
|
responseTimeMs: step.performance.responseTimeMs,
|
|
146
146
|
cost: calculateStepCost(options.modelId, step.usage),
|
|
147
|
+
usage: step.usage,
|
|
147
148
|
},
|
|
148
149
|
});
|
|
149
150
|
if (options.persistence?.saveMessage !== undefined) {
|
package/dist/ui.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export type SparkStepMetricsData = {
|
|
|
53
53
|
toolNames: string[];
|
|
54
54
|
responseTimeMs: number;
|
|
55
55
|
cost?: SparkStepCost;
|
|
56
|
+
usage?: unknown;
|
|
56
57
|
};
|
|
57
58
|
export declare const sparkExecutionReceiptSchema: z.ZodObject<{
|
|
58
59
|
id: z.ZodString;
|
|
@@ -220,5 +221,6 @@ export declare const sparkDataPartSchemas: {
|
|
|
220
221
|
usd: z.ZodNumber;
|
|
221
222
|
}, z.core.$strip>>;
|
|
222
223
|
}, z.core.$strip>>;
|
|
224
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
223
225
|
}, z.core.$strip>;
|
|
224
226
|
};
|
package/dist/ui.js
CHANGED