@proofhound/api-client 0.1.6

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.
Files changed (82) hide show
  1. package/LICENSE +190 -0
  2. package/dist/annotation.d.ts +245 -0
  3. package/dist/annotation.d.ts.map +1 -0
  4. package/dist/annotation.js +19 -0
  5. package/dist/annotation.js.map +1 -0
  6. package/dist/api-token.d.ts +53 -0
  7. package/dist/api-token.d.ts.map +1 -0
  8. package/dist/api-token.js +12 -0
  9. package/dist/api-token.js.map +1 -0
  10. package/dist/auth-source.d.ts +29 -0
  11. package/dist/auth-source.d.ts.map +1 -0
  12. package/dist/auth-source.js +30 -0
  13. package/dist/auth-source.js.map +1 -0
  14. package/dist/canary-release.d.ts +635 -0
  15. package/dist/canary-release.d.ts.map +1 -0
  16. package/dist/canary-release.js +48 -0
  17. package/dist/canary-release.js.map +1 -0
  18. package/dist/configure.d.ts +20 -0
  19. package/dist/configure.d.ts.map +1 -0
  20. package/dist/configure.js +41 -0
  21. package/dist/configure.js.map +1 -0
  22. package/dist/connector.d.ts +446 -0
  23. package/dist/connector.d.ts.map +1 -0
  24. package/dist/connector.js +70 -0
  25. package/dist/connector.js.map +1 -0
  26. package/dist/dataset-import.d.ts +75 -0
  27. package/dist/dataset-import.d.ts.map +1 -0
  28. package/dist/dataset-import.js +25 -0
  29. package/dist/dataset-import.js.map +1 -0
  30. package/dist/dataset.d.ts +136 -0
  31. package/dist/dataset.d.ts.map +1 -0
  32. package/dist/dataset.js +67 -0
  33. package/dist/dataset.js.map +1 -0
  34. package/dist/experiment.d.ts +365 -0
  35. package/dist/experiment.d.ts.map +1 -0
  36. package/dist/experiment.js +65 -0
  37. package/dist/experiment.js.map +1 -0
  38. package/dist/http.d.ts +3 -0
  39. package/dist/http.d.ts.map +1 -0
  40. package/dist/http.js +13 -0
  41. package/dist/http.js.map +1 -0
  42. package/dist/index.d.ts +20 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +39 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/model.d.ts +274 -0
  47. package/dist/model.d.ts.map +1 -0
  48. package/dist/model.js +73 -0
  49. package/dist/model.js.map +1 -0
  50. package/dist/monitoring.d.ts +200 -0
  51. package/dist/monitoring.d.ts.map +1 -0
  52. package/dist/monitoring.js +49 -0
  53. package/dist/monitoring.js.map +1 -0
  54. package/dist/optimization.d.ts +574 -0
  55. package/dist/optimization.d.ts.map +1 -0
  56. package/dist/optimization.js +22 -0
  57. package/dist/optimization.js.map +1 -0
  58. package/dist/production-release.d.ts +122 -0
  59. package/dist/production-release.d.ts.map +1 -0
  60. package/dist/production-release.js +22 -0
  61. package/dist/production-release.js.map +1 -0
  62. package/dist/prompt.d.ts +481 -0
  63. package/dist/prompt.d.ts.map +1 -0
  64. package/dist/prompt.js +22 -0
  65. package/dist/prompt.js.map +1 -0
  66. package/dist/public-env.d.ts +2 -0
  67. package/dist/public-env.d.ts.map +1 -0
  68. package/dist/public-env.js +50 -0
  69. package/dist/public-env.js.map +1 -0
  70. package/dist/quick-start.d.ts +71 -0
  71. package/dist/quick-start.d.ts.map +1 -0
  72. package/dist/quick-start.js +11 -0
  73. package/dist/quick-start.js.map +1 -0
  74. package/dist/release-line.d.ts +1052 -0
  75. package/dist/release-line.d.ts.map +1 -0
  76. package/dist/release-line.js +18 -0
  77. package/dist/release-line.js.map +1 -0
  78. package/dist/run-result.d.ts +120 -0
  79. package/dist/run-result.d.ts.map +1 -0
  80. package/dist/run-result.js +50 -0
  81. package/dist/run-result.js.map +1 -0
  82. package/package.json +45 -0
@@ -0,0 +1,122 @@
1
+ import type { CreateProductionReleaseInputDto, ProductionReleaseHistoryItemDto, ProductionReleaseListItemDto, StopProductionReleaseInputDto } from '@proofhound/shared';
2
+ export interface ProductionReleaseListResponseDto {
3
+ data: ProductionReleaseListItemDto[];
4
+ total: number;
5
+ }
6
+ export interface ProductionReleaseHistoryResponseDto {
7
+ data: ProductionReleaseHistoryItemDto[];
8
+ total: number;
9
+ }
10
+ export declare const productionReleaseClient: {
11
+ list: (projectId: string) => Promise<ProductionReleaseListResponseDto>;
12
+ get: (projectId: string, eventId: string) => Promise<{
13
+ id: string;
14
+ projectId: string;
15
+ promptId: string;
16
+ eventType: "from_experiment" | "rollback" | "force_stop" | "from_prompt" | "from_canary" | "config_change";
17
+ promptVersionId: string;
18
+ modelId: string;
19
+ inputConnectorId: string | null;
20
+ outputConnectorIds: string[];
21
+ runConfig: {
22
+ rpmLimit: number;
23
+ tpmLimit: number;
24
+ concurrency: number;
25
+ temperature: number;
26
+ };
27
+ variableMapping: Record<string, string>;
28
+ filterRules: Record<string, unknown> | null;
29
+ recordMode: "all" | "correct_only";
30
+ externalIdField: string | null;
31
+ retentionDays: number | null;
32
+ status: "failed" | "running" | "stopped" | "success";
33
+ createdBy: string;
34
+ submitReason: string;
35
+ sourceExperimentId: string | null;
36
+ sourceCanaryId: string | null;
37
+ sourceMetricsSnapshot: Record<string, unknown> | null;
38
+ promptSnapshot: Record<string, unknown>;
39
+ promptVersionSnapshot: Record<string, unknown>;
40
+ rollbackTargetEventId: string | null;
41
+ controlState: "stop" | "resume" | "cancel" | null;
42
+ startedAt: string | null;
43
+ finishedAt: string | null;
44
+ stopReason: "error" | "replaced" | "rolled_back" | "force_stopped" | null;
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ }>;
48
+ create: (projectId: string, body: CreateProductionReleaseInputDto) => Promise<{
49
+ id: string;
50
+ projectId: string;
51
+ promptId: string;
52
+ eventType: "from_experiment" | "rollback" | "force_stop" | "from_prompt" | "from_canary" | "config_change";
53
+ promptVersionId: string;
54
+ modelId: string;
55
+ inputConnectorId: string | null;
56
+ outputConnectorIds: string[];
57
+ runConfig: {
58
+ rpmLimit: number;
59
+ tpmLimit: number;
60
+ concurrency: number;
61
+ temperature: number;
62
+ };
63
+ variableMapping: Record<string, string>;
64
+ filterRules: Record<string, unknown> | null;
65
+ recordMode: "all" | "correct_only";
66
+ externalIdField: string | null;
67
+ retentionDays: number | null;
68
+ status: "failed" | "running" | "stopped" | "success";
69
+ createdBy: string;
70
+ submitReason: string;
71
+ sourceExperimentId: string | null;
72
+ sourceCanaryId: string | null;
73
+ sourceMetricsSnapshot: Record<string, unknown> | null;
74
+ promptSnapshot: Record<string, unknown>;
75
+ promptVersionSnapshot: Record<string, unknown>;
76
+ rollbackTargetEventId: string | null;
77
+ controlState: "stop" | "resume" | "cancel" | null;
78
+ startedAt: string | null;
79
+ finishedAt: string | null;
80
+ stopReason: "error" | "replaced" | "rolled_back" | "force_stopped" | null;
81
+ createdAt: string;
82
+ updatedAt: string;
83
+ }>;
84
+ stop: (projectId: string, eventId: string, body: StopProductionReleaseInputDto) => Promise<{
85
+ id: string;
86
+ projectId: string;
87
+ promptId: string;
88
+ eventType: "from_experiment" | "rollback" | "force_stop" | "from_prompt" | "from_canary" | "config_change";
89
+ promptVersionId: string;
90
+ modelId: string;
91
+ inputConnectorId: string | null;
92
+ outputConnectorIds: string[];
93
+ runConfig: {
94
+ rpmLimit: number;
95
+ tpmLimit: number;
96
+ concurrency: number;
97
+ temperature: number;
98
+ };
99
+ variableMapping: Record<string, string>;
100
+ filterRules: Record<string, unknown> | null;
101
+ recordMode: "all" | "correct_only";
102
+ externalIdField: string | null;
103
+ retentionDays: number | null;
104
+ status: "failed" | "running" | "stopped" | "success";
105
+ createdBy: string;
106
+ submitReason: string;
107
+ sourceExperimentId: string | null;
108
+ sourceCanaryId: string | null;
109
+ sourceMetricsSnapshot: Record<string, unknown> | null;
110
+ promptSnapshot: Record<string, unknown>;
111
+ promptVersionSnapshot: Record<string, unknown>;
112
+ rollbackTargetEventId: string | null;
113
+ controlState: "stop" | "resume" | "cancel" | null;
114
+ startedAt: string | null;
115
+ finishedAt: string | null;
116
+ stopReason: "error" | "replaced" | "rolled_back" | "force_stopped" | null;
117
+ createdAt: string;
118
+ updatedAt: string;
119
+ }>;
120
+ getHistory: (projectId: string, promptId: string) => Promise<ProductionReleaseHistoryResponseDto>;
121
+ };
122
+ //# sourceMappingURL=production-release.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production-release.d.ts","sourceRoot":"","sources":["../src/production-release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAE/B,+BAA+B,EAC/B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,oBAAoB,CAAC;AAG5B,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,4BAA4B,EAAE,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mCAAmC;IAClD,IAAI,EAAE,+BAA+B,EAAE,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,uBAAuB;sBAChB,MAAM;qBAKP,MAAM,WAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAKpB,MAAM,QAAQ,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAK/C,MAAM,WAAW,MAAM,QAAQ,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAQtD,MAAM,YAAY,MAAM;CAMjD,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.productionReleaseClient = void 0;
4
+ const http_1 = require("./http");
5
+ exports.productionReleaseClient = {
6
+ list: (projectId) => http_1.httpClient
7
+ .get(`/production-releases`)
8
+ .then((r) => r.data),
9
+ get: (projectId, eventId) => http_1.httpClient
10
+ .get(`/production-releases/${eventId}`)
11
+ .then((r) => r.data),
12
+ create: (projectId, body) => http_1.httpClient
13
+ .post(`/production-releases`, body)
14
+ .then((r) => r.data),
15
+ stop: (projectId, eventId, body) => http_1.httpClient
16
+ .post(`/production-releases/${eventId}/stop`, body)
17
+ .then((r) => r.data),
18
+ getHistory: (projectId, promptId) => http_1.httpClient
19
+ .get(`/production-releases/by-prompt/${promptId}/history`)
20
+ .then((r) => r.data),
21
+ };
22
+ //# sourceMappingURL=production-release.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production-release.js","sourceRoot":"","sources":["../src/production-release.ts"],"names":[],"mappings":";;;AAOA,iCAAoC;AAYvB,QAAA,uBAAuB,GAAG;IACrC,IAAI,EAAE,CAAC,SAAiB,EAAE,EAAE,CAC1B,iBAAU;SACP,GAAG,CAAmC,sBAAsB,CAAC;SAC7D,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAExB,GAAG,EAAE,CAAC,SAAiB,EAAE,OAAe,EAAE,EAAE,CAC1C,iBAAU;SACP,GAAG,CAA4B,wBAAwB,OAAO,EAAE,CAAC;SACjE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAExB,MAAM,EAAE,CAAC,SAAiB,EAAE,IAAqC,EAAE,EAAE,CACnE,iBAAU;SACP,IAAI,CAA4B,sBAAsB,EAAE,IAAI,CAAC;SAC7D,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAExB,IAAI,EAAE,CAAC,SAAiB,EAAE,OAAe,EAAE,IAAmC,EAAE,EAAE,CAChF,iBAAU;SACP,IAAI,CACH,wBAAwB,OAAO,OAAO,EACtC,IAAI,CACL;SACA,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAExB,UAAU,EAAE,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAClD,iBAAU;SACP,GAAG,CACF,kCAAkC,QAAQ,UAAU,CACrD;SACA,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;CACzB,CAAC"}
@@ -0,0 +1,481 @@
1
+ import type { CreatePromptDraftVersionDto, CreatePromptDto, PromptListItemDto, PromptTryRunRequestDto, UpdatePromptDraftVersionDto, UpdatePromptDto, UpdatePromptVersionLabelDto } from '@proofhound/shared';
2
+ export declare const promptClient: {
3
+ listPrompts: (projectId: string) => Promise<{
4
+ data: PromptListItemDto[];
5
+ total: number;
6
+ }>;
7
+ getPrompt: (projectId: string, promptId: string) => Promise<{
8
+ id: string;
9
+ projectId: string;
10
+ name: string;
11
+ defaultDatasetId: string | null;
12
+ defaultDatasetName: string | null;
13
+ latestVersionNumber: number;
14
+ currentOnlineVersionNumber: number | null;
15
+ currentGrayVersionNumber: number | null;
16
+ customLabels: {
17
+ name: string;
18
+ versionNumber: number;
19
+ }[];
20
+ latestVersionStatus: "editable" | "frozen";
21
+ createdBy: string;
22
+ createdByDisplayName: string | null;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ deletedAt: string | null;
26
+ activeReferences: number;
27
+ versions: {
28
+ id: string;
29
+ promptId: string;
30
+ versionNumber: number;
31
+ status: "editable" | "frozen";
32
+ body: string;
33
+ variables: {
34
+ name: string;
35
+ type: "number" | "text" | "image" | "image_url" | "image_base64";
36
+ required: boolean;
37
+ description?: string | undefined;
38
+ datasetField?: string | undefined;
39
+ }[];
40
+ outputSchema: {
41
+ fields: {
42
+ key: string;
43
+ value: string;
44
+ isJudgment: boolean;
45
+ }[];
46
+ } | null;
47
+ judgmentRules: Record<string, unknown> | null;
48
+ promptLanguage: "zh-CN" | "en-US";
49
+ parentVersionId: string | null;
50
+ generatedByOptimizationId: string | null;
51
+ changeReason: string | null;
52
+ labels: {
53
+ name: string;
54
+ type: "system" | "custom";
55
+ }[];
56
+ isFrozen: boolean;
57
+ createdBy: string;
58
+ createdByDisplayName: string | null;
59
+ createdAt: string;
60
+ frozenAt: string | null;
61
+ }[];
62
+ }>;
63
+ getPromptMetrics: (projectId: string, promptId: string) => Promise<{
64
+ promptId: string;
65
+ versions: {
66
+ promptVersionId: string;
67
+ versionNumber: number;
68
+ status: "editable" | "frozen";
69
+ labels: {
70
+ name: string;
71
+ type: "system" | "custom";
72
+ }[];
73
+ runCount: number;
74
+ successCount: number;
75
+ errorCount: number;
76
+ correctCount: number;
77
+ incorrectCount: number;
78
+ accuracy: number | null;
79
+ medianLatencyMs: number | null;
80
+ medianInputTokens: number | null;
81
+ medianOutputTokens: number | null;
82
+ totalInputTokens: number;
83
+ totalOutputTokens: number;
84
+ totalCostEstimate: number;
85
+ firstRunAt: string | null;
86
+ lastRunAt: string | null;
87
+ }[];
88
+ totals: {
89
+ runCount: number;
90
+ successCount: number;
91
+ errorCount: number;
92
+ totalInputTokens: number;
93
+ totalOutputTokens: number;
94
+ totalCostEstimate: number;
95
+ };
96
+ }>;
97
+ getPromptDeleteImpact: (projectId: string, promptId: string) => Promise<{
98
+ promptId: string;
99
+ versionId: string | null;
100
+ experiments: {
101
+ id: string;
102
+ kind: "canary_release" | "production_release" | "experiment" | "optimization";
103
+ name: string | null;
104
+ status: string | null;
105
+ promptId: string | null;
106
+ promptVersionId: string | null;
107
+ promptVersionNumber: number | null;
108
+ createdAt: string | null;
109
+ }[];
110
+ optimizations: {
111
+ id: string;
112
+ kind: "canary_release" | "production_release" | "experiment" | "optimization";
113
+ name: string | null;
114
+ status: string | null;
115
+ promptId: string | null;
116
+ promptVersionId: string | null;
117
+ promptVersionNumber: number | null;
118
+ createdAt: string | null;
119
+ }[];
120
+ canaryReleases: {
121
+ id: string;
122
+ kind: "canary_release" | "production_release" | "experiment" | "optimization";
123
+ name: string | null;
124
+ status: string | null;
125
+ promptId: string | null;
126
+ promptVersionId: string | null;
127
+ promptVersionNumber: number | null;
128
+ createdAt: string | null;
129
+ }[];
130
+ productionReleases: {
131
+ id: string;
132
+ kind: "canary_release" | "production_release" | "experiment" | "optimization";
133
+ name: string | null;
134
+ status: string | null;
135
+ promptId: string | null;
136
+ promptVersionId: string | null;
137
+ promptVersionNumber: number | null;
138
+ createdAt: string | null;
139
+ }[];
140
+ total: number;
141
+ }>;
142
+ getPromptVersionDeleteImpact: (projectId: string, promptId: string, versionId: string) => Promise<{
143
+ promptId: string;
144
+ versionId: string | null;
145
+ experiments: {
146
+ id: string;
147
+ kind: "canary_release" | "production_release" | "experiment" | "optimization";
148
+ name: string | null;
149
+ status: string | null;
150
+ promptId: string | null;
151
+ promptVersionId: string | null;
152
+ promptVersionNumber: number | null;
153
+ createdAt: string | null;
154
+ }[];
155
+ optimizations: {
156
+ id: string;
157
+ kind: "canary_release" | "production_release" | "experiment" | "optimization";
158
+ name: string | null;
159
+ status: string | null;
160
+ promptId: string | null;
161
+ promptVersionId: string | null;
162
+ promptVersionNumber: number | null;
163
+ createdAt: string | null;
164
+ }[];
165
+ canaryReleases: {
166
+ id: string;
167
+ kind: "canary_release" | "production_release" | "experiment" | "optimization";
168
+ name: string | null;
169
+ status: string | null;
170
+ promptId: string | null;
171
+ promptVersionId: string | null;
172
+ promptVersionNumber: number | null;
173
+ createdAt: string | null;
174
+ }[];
175
+ productionReleases: {
176
+ id: string;
177
+ kind: "canary_release" | "production_release" | "experiment" | "optimization";
178
+ name: string | null;
179
+ status: string | null;
180
+ promptId: string | null;
181
+ promptVersionId: string | null;
182
+ promptVersionNumber: number | null;
183
+ createdAt: string | null;
184
+ }[];
185
+ total: number;
186
+ }>;
187
+ createPrompt: (projectId: string, body: CreatePromptDto) => Promise<{
188
+ id: string;
189
+ projectId: string;
190
+ name: string;
191
+ defaultDatasetId: string | null;
192
+ defaultDatasetName: string | null;
193
+ latestVersionNumber: number;
194
+ currentOnlineVersionNumber: number | null;
195
+ currentGrayVersionNumber: number | null;
196
+ customLabels: {
197
+ name: string;
198
+ versionNumber: number;
199
+ }[];
200
+ latestVersionStatus: "editable" | "frozen";
201
+ createdBy: string;
202
+ createdByDisplayName: string | null;
203
+ createdAt: string;
204
+ updatedAt: string;
205
+ deletedAt: string | null;
206
+ activeReferences: number;
207
+ versions: {
208
+ id: string;
209
+ promptId: string;
210
+ versionNumber: number;
211
+ status: "editable" | "frozen";
212
+ body: string;
213
+ variables: {
214
+ name: string;
215
+ type: "number" | "text" | "image" | "image_url" | "image_base64";
216
+ required: boolean;
217
+ description?: string | undefined;
218
+ datasetField?: string | undefined;
219
+ }[];
220
+ outputSchema: {
221
+ fields: {
222
+ key: string;
223
+ value: string;
224
+ isJudgment: boolean;
225
+ }[];
226
+ } | null;
227
+ judgmentRules: Record<string, unknown> | null;
228
+ promptLanguage: "zh-CN" | "en-US";
229
+ parentVersionId: string | null;
230
+ generatedByOptimizationId: string | null;
231
+ changeReason: string | null;
232
+ labels: {
233
+ name: string;
234
+ type: "system" | "custom";
235
+ }[];
236
+ isFrozen: boolean;
237
+ createdBy: string;
238
+ createdByDisplayName: string | null;
239
+ createdAt: string;
240
+ frozenAt: string | null;
241
+ }[];
242
+ }>;
243
+ updatePrompt: (projectId: string, promptId: string, body: UpdatePromptDto) => Promise<{
244
+ id: string;
245
+ projectId: string;
246
+ name: string;
247
+ defaultDatasetId: string | null;
248
+ defaultDatasetName: string | null;
249
+ latestVersionNumber: number;
250
+ currentOnlineVersionNumber: number | null;
251
+ currentGrayVersionNumber: number | null;
252
+ customLabels: {
253
+ name: string;
254
+ versionNumber: number;
255
+ }[];
256
+ latestVersionStatus: "editable" | "frozen";
257
+ createdBy: string;
258
+ createdByDisplayName: string | null;
259
+ createdAt: string;
260
+ updatedAt: string;
261
+ deletedAt: string | null;
262
+ activeReferences: number;
263
+ versions: {
264
+ id: string;
265
+ promptId: string;
266
+ versionNumber: number;
267
+ status: "editable" | "frozen";
268
+ body: string;
269
+ variables: {
270
+ name: string;
271
+ type: "number" | "text" | "image" | "image_url" | "image_base64";
272
+ required: boolean;
273
+ description?: string | undefined;
274
+ datasetField?: string | undefined;
275
+ }[];
276
+ outputSchema: {
277
+ fields: {
278
+ key: string;
279
+ value: string;
280
+ isJudgment: boolean;
281
+ }[];
282
+ } | null;
283
+ judgmentRules: Record<string, unknown> | null;
284
+ promptLanguage: "zh-CN" | "en-US";
285
+ parentVersionId: string | null;
286
+ generatedByOptimizationId: string | null;
287
+ changeReason: string | null;
288
+ labels: {
289
+ name: string;
290
+ type: "system" | "custom";
291
+ }[];
292
+ isFrozen: boolean;
293
+ createdBy: string;
294
+ createdByDisplayName: string | null;
295
+ createdAt: string;
296
+ frozenAt: string | null;
297
+ }[];
298
+ }>;
299
+ updateVersionLabel: (projectId: string, promptId: string, body: UpdatePromptVersionLabelDto) => Promise<{
300
+ id: string;
301
+ projectId: string;
302
+ name: string;
303
+ defaultDatasetId: string | null;
304
+ defaultDatasetName: string | null;
305
+ latestVersionNumber: number;
306
+ currentOnlineVersionNumber: number | null;
307
+ currentGrayVersionNumber: number | null;
308
+ customLabels: {
309
+ name: string;
310
+ versionNumber: number;
311
+ }[];
312
+ latestVersionStatus: "editable" | "frozen";
313
+ createdBy: string;
314
+ createdByDisplayName: string | null;
315
+ createdAt: string;
316
+ updatedAt: string;
317
+ deletedAt: string | null;
318
+ activeReferences: number;
319
+ versions: {
320
+ id: string;
321
+ promptId: string;
322
+ versionNumber: number;
323
+ status: "editable" | "frozen";
324
+ body: string;
325
+ variables: {
326
+ name: string;
327
+ type: "number" | "text" | "image" | "image_url" | "image_base64";
328
+ required: boolean;
329
+ description?: string | undefined;
330
+ datasetField?: string | undefined;
331
+ }[];
332
+ outputSchema: {
333
+ fields: {
334
+ key: string;
335
+ value: string;
336
+ isJudgment: boolean;
337
+ }[];
338
+ } | null;
339
+ judgmentRules: Record<string, unknown> | null;
340
+ promptLanguage: "zh-CN" | "en-US";
341
+ parentVersionId: string | null;
342
+ generatedByOptimizationId: string | null;
343
+ changeReason: string | null;
344
+ labels: {
345
+ name: string;
346
+ type: "system" | "custom";
347
+ }[];
348
+ isFrozen: boolean;
349
+ createdBy: string;
350
+ createdByDisplayName: string | null;
351
+ createdAt: string;
352
+ frozenAt: string | null;
353
+ }[];
354
+ }>;
355
+ updateDraftVersion: (projectId: string, promptId: string, versionId: string, body: UpdatePromptDraftVersionDto) => Promise<{
356
+ id: string;
357
+ projectId: string;
358
+ name: string;
359
+ defaultDatasetId: string | null;
360
+ defaultDatasetName: string | null;
361
+ latestVersionNumber: number;
362
+ currentOnlineVersionNumber: number | null;
363
+ currentGrayVersionNumber: number | null;
364
+ customLabels: {
365
+ name: string;
366
+ versionNumber: number;
367
+ }[];
368
+ latestVersionStatus: "editable" | "frozen";
369
+ createdBy: string;
370
+ createdByDisplayName: string | null;
371
+ createdAt: string;
372
+ updatedAt: string;
373
+ deletedAt: string | null;
374
+ activeReferences: number;
375
+ versions: {
376
+ id: string;
377
+ promptId: string;
378
+ versionNumber: number;
379
+ status: "editable" | "frozen";
380
+ body: string;
381
+ variables: {
382
+ name: string;
383
+ type: "number" | "text" | "image" | "image_url" | "image_base64";
384
+ required: boolean;
385
+ description?: string | undefined;
386
+ datasetField?: string | undefined;
387
+ }[];
388
+ outputSchema: {
389
+ fields: {
390
+ key: string;
391
+ value: string;
392
+ isJudgment: boolean;
393
+ }[];
394
+ } | null;
395
+ judgmentRules: Record<string, unknown> | null;
396
+ promptLanguage: "zh-CN" | "en-US";
397
+ parentVersionId: string | null;
398
+ generatedByOptimizationId: string | null;
399
+ changeReason: string | null;
400
+ labels: {
401
+ name: string;
402
+ type: "system" | "custom";
403
+ }[];
404
+ isFrozen: boolean;
405
+ createdBy: string;
406
+ createdByDisplayName: string | null;
407
+ createdAt: string;
408
+ frozenAt: string | null;
409
+ }[];
410
+ }>;
411
+ createDraftVersion: (projectId: string, promptId: string, body: CreatePromptDraftVersionDto) => Promise<{
412
+ id: string;
413
+ projectId: string;
414
+ name: string;
415
+ defaultDatasetId: string | null;
416
+ defaultDatasetName: string | null;
417
+ latestVersionNumber: number;
418
+ currentOnlineVersionNumber: number | null;
419
+ currentGrayVersionNumber: number | null;
420
+ customLabels: {
421
+ name: string;
422
+ versionNumber: number;
423
+ }[];
424
+ latestVersionStatus: "editable" | "frozen";
425
+ createdBy: string;
426
+ createdByDisplayName: string | null;
427
+ createdAt: string;
428
+ updatedAt: string;
429
+ deletedAt: string | null;
430
+ activeReferences: number;
431
+ versions: {
432
+ id: string;
433
+ promptId: string;
434
+ versionNumber: number;
435
+ status: "editable" | "frozen";
436
+ body: string;
437
+ variables: {
438
+ name: string;
439
+ type: "number" | "text" | "image" | "image_url" | "image_base64";
440
+ required: boolean;
441
+ description?: string | undefined;
442
+ datasetField?: string | undefined;
443
+ }[];
444
+ outputSchema: {
445
+ fields: {
446
+ key: string;
447
+ value: string;
448
+ isJudgment: boolean;
449
+ }[];
450
+ } | null;
451
+ judgmentRules: Record<string, unknown> | null;
452
+ promptLanguage: "zh-CN" | "en-US";
453
+ parentVersionId: string | null;
454
+ generatedByOptimizationId: string | null;
455
+ changeReason: string | null;
456
+ labels: {
457
+ name: string;
458
+ type: "system" | "custom";
459
+ }[];
460
+ isFrozen: boolean;
461
+ createdBy: string;
462
+ createdByDisplayName: string | null;
463
+ createdAt: string;
464
+ frozenAt: string | null;
465
+ }[];
466
+ }>;
467
+ deleteDraftVersion: (projectId: string, promptId: string, versionId: string) => Promise<undefined>;
468
+ deletePrompt: (projectId: string, promptId: string) => Promise<undefined>;
469
+ tryRun: (projectId: string, promptId: string, body: PromptTryRunRequestDto) => Promise<{
470
+ status: "error" | "success";
471
+ rawOutput: string | null;
472
+ parsedOutput: unknown;
473
+ latencyMs: number;
474
+ inputTokens: number;
475
+ outputTokens: number;
476
+ costEstimate: number;
477
+ errorClass: string | null;
478
+ errorMessage: string | null;
479
+ }>;
480
+ };
481
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,eAAe,EAGf,iBAAiB,EAEjB,sBAAsB,EAEtB,2BAA2B,EAC3B,eAAe,EACf,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,YAAY;6BACE,MAAM;cACN,iBAAiB,EAAE;eAAS,MAAM;;2BACpC,MAAM,YAAY,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAEjB,MAAM,YAAY,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAEnB,MAAM,YAAY,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAEjB,MAAM,YAAY,MAAM,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAI3D,MAAM,QAAQ,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAE7B,MAAM,YAAY,MAAM,QAAQ,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAEzC,MAAM,YAAY,MAAM,QAAQ,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAE3D,MAAM,YAAY,MAAM,aAAa,MAAM,QAAQ,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAE9E,MAAM,YAAY,MAAM,QAAQ,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAE3D,MAAM,YAAY,MAAM,aAAa,MAAM;8BAEjD,MAAM,YAAY,MAAM;wBAE9B,MAAM,YAAY,MAAM,QAAQ,sBAAsB;;;;;;;;;;;CAE3E,CAAC"}
package/dist/prompt.js ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.promptClient = void 0;
4
+ const http_1 = require("./http");
5
+ exports.promptClient = {
6
+ listPrompts: (projectId) => http_1.httpClient.get(`/prompts`).then((r) => r.data),
7
+ getPrompt: (projectId, promptId) => http_1.httpClient.get(`/prompts/${promptId}`).then((r) => r.data),
8
+ getPromptMetrics: (projectId, promptId) => http_1.httpClient.get(`/prompts/${promptId}/metrics`).then((r) => r.data),
9
+ getPromptDeleteImpact: (projectId, promptId) => http_1.httpClient.get(`/prompts/${promptId}/delete-impact`).then((r) => r.data),
10
+ getPromptVersionDeleteImpact: (projectId, promptId, versionId) => http_1.httpClient
11
+ .get(`/prompts/${promptId}/versions/${versionId}/delete-impact`)
12
+ .then((r) => r.data),
13
+ createPrompt: (projectId, body) => http_1.httpClient.post(`/prompts`, body).then((r) => r.data),
14
+ updatePrompt: (projectId, promptId, body) => http_1.httpClient.patch(`/prompts/${promptId}`, body).then((r) => r.data),
15
+ updateVersionLabel: (projectId, promptId, body) => http_1.httpClient.patch(`/prompts/${promptId}/labels`, body).then((r) => r.data),
16
+ updateDraftVersion: (projectId, promptId, versionId, body) => http_1.httpClient.patch(`/prompts/${promptId}/versions/${versionId}`, body).then((r) => r.data),
17
+ createDraftVersion: (projectId, promptId, body) => http_1.httpClient.post(`/prompts/${promptId}/versions`, body).then((r) => r.data),
18
+ deleteDraftVersion: (projectId, promptId, versionId) => http_1.httpClient.delete(`/prompts/${promptId}/versions/${versionId}`).then(() => undefined),
19
+ deletePrompt: (projectId, promptId) => http_1.httpClient.delete(`/prompts/${promptId}`).then(() => undefined),
20
+ tryRun: (projectId, promptId, body) => http_1.httpClient.post(`/prompts/${promptId}/try-run`, body).then((r) => r.data),
21
+ };
22
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":";;;AAaA,iCAAoC;AAEvB,QAAA,YAAY,GAAG;IAC1B,WAAW,EAAE,CAAC,SAAiB,EAAE,EAAE,CACjC,iBAAU,CAAC,GAAG,CAA+C,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9F,SAAS,EAAE,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAE,CACjD,iBAAU,CAAC,GAAG,CAAkB,YAAY,QAAQ,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"","sources":["../src/public-env.ts"],"names":[],"mappings":"AAwCA,wBAAgB,gBAAgB,WAQ/B"}