@love-moon/conductor-sdk 0.13.2 → 0.14.0

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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @love-moon/conductor-sdk
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 12a829c: Show each AI reply's token usage beside its timestamp: the turn's tokens, the
8
+ task total after it, and the input cache share (the part of the turn's input
9
+ served from the prompt cache).
10
+
11
+ - `@love-moon/ai-sdk`: new `summarizeTurnUsage(usage)` normalizes a turn's usage
12
+ into `{ tokens, inputTokens, cachedInputTokens }` (Claude: fresh input + cache
13
+ writes + cache reads; Codex: input already includes cached). The Codex
14
+ app-server provider's turn/goal `usage` now also carries `turnInputTokens` and
15
+ `turnCachedInputTokens`.
16
+ - `@love-moon/conductor-sdk`: `sendTurnUsage` accepts `input_tokens`,
17
+ `cached_input_tokens` and the reply's `message_id`.
18
+ - `conductor fire` reports a finished turn's usage after its reply, naming that
19
+ reply (for streamed sessions, the turn's last streamed reply), so the server
20
+ records it on the message (`metadata.turn_usage`) and pushes it to open chats.
21
+
22
+ ## 0.13.3
23
+
3
24
  ## 0.13.2
4
25
 
5
26
  ### Patch Changes
package/dist/client.d.ts CHANGED
@@ -120,10 +120,14 @@ export declare class ConductorClient {
120
120
  sendRuntimeStatus(taskId: string, payload: Record<string, any>): Promise<Record<string, any>>;
121
121
  /**
122
122
  * Report the tokens one finished turn consumed; the server adds them to the task total.
123
- * `null` marks a failed turn whose usage is unknown.
123
+ * `null` marks a failed turn whose usage is unknown. With `message_id` (the turn's reply)
124
+ * the server also records the turn's usage on that message.
124
125
  */
125
126
  sendTurnUsage(taskId: string, payload: {
126
127
  tokens: number | null;
128
+ input_tokens?: number;
129
+ cached_input_tokens?: number;
130
+ message_id?: string;
127
131
  }): Promise<Record<string, any>>;
128
132
  sendAgentResume(payload?: {
129
133
  active_tasks?: string[];
package/dist/client.js CHANGED
@@ -307,12 +307,13 @@ export class ConductorClient {
307
307
  }
308
308
  /**
309
309
  * Report the tokens one finished turn consumed; the server adds them to the task total.
310
- * `null` marks a failed turn whose usage is unknown.
310
+ * `null` marks a failed turn whose usage is unknown. With `message_id` (the turn's reply)
311
+ * the server also records the turn's usage on that message.
311
312
  */
312
313
  async sendTurnUsage(taskId, payload) {
313
314
  await this.sendEnvelope({
314
315
  type: 'task_turn_usage',
315
- payload: { task_id: taskId, tokens: payload.tokens },
316
+ payload: { ...payload, task_id: taskId },
316
317
  });
317
318
  return { delivered: true };
318
319
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@love-moon/conductor-sdk",
3
- "version": "0.13.2",
3
+ "version": "0.14.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lovemoon-ai/conductor.git"
@@ -33,5 +33,5 @@
33
33
  "typescript": "^5.6.3",
34
34
  "vitest": "^2.1.4"
35
35
  },
36
- "gitCommitId": "d60a6a2"
36
+ "gitCommitId": "6def94c"
37
37
  }