@chatu-ai/builder-sdk 0.2.2 → 0.3.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/client.d.ts CHANGED
@@ -94,6 +94,19 @@ export interface GitPushResult {
94
94
  webUrl?: string;
95
95
  credentialId?: string | null;
96
96
  }
97
+ export interface DataUsageEnv {
98
+ raw: Record<string, number>;
99
+ points: number;
100
+ }
101
+ export interface DataUsage {
102
+ ok: boolean;
103
+ month?: string;
104
+ readOnly?: boolean;
105
+ dev?: DataUsageEnv;
106
+ prod?: DataUsageEnv;
107
+ rates?: Record<string, number>;
108
+ error?: string;
109
+ }
97
110
  export interface BuilderClient {
98
111
  chat: {
99
112
  stream(conversationId: string, prompt: string, opts?: {
@@ -167,6 +180,8 @@ export interface BuilderClient {
167
180
  envs: string[];
168
181
  envVars: Record<string, string | null>;
169
182
  }>;
183
+ /** 本月用量:dev/prod 原始计量与折算点数估算、只读状态、单价 */
184
+ usage(conversationId: string): Promise<DataUsage>;
170
185
  };
171
186
  export: {
172
187
  /**
package/dist/client.js CHANGED
@@ -88,6 +88,7 @@ export function createBuilderClient(options) {
88
88
  },
89
89
  data: {
90
90
  access: id => req(`/${id}/data-access`),
91
+ usage: id => req(`/${id}/data-usage`),
91
92
  },
92
93
  export: {
93
94
  zip: async (id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",