@to11ai/sdk 2.1.0-rc.1 → 2.1.0-rc.2
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/README.md +1 -2
- package/dist/errors.d.ts +3 -7
- package/dist/gateway.cjs +0 -3
- package/dist/gateway.d.ts +0 -3
- package/dist/gateway.js +0 -3
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/types.gen.d.ts +31 -1001
- package/dist/generated/zod.gen.d.ts +15 -698
- package/dist/prompts/resource.cjs +0 -3
- package/dist/prompts/resource.js +0 -3
- package/dist/prompts/shape.d.ts +0 -1
- package/dist/prompts/types.d.ts +0 -1
- package/package.json +1 -1
- package/src/errors.ts +3 -7
- package/src/gateway.ts +0 -7
- package/src/generated/index.ts +1 -1
- package/src/generated/types.gen.ts +13 -1026
- package/src/generated/zod.gen.ts +3 -582
- package/src/prompts/resource.ts +1 -15
- package/src/prompts/shape.ts +0 -3
- package/src/prompts/types.ts +0 -1
- package/src/transport.ts +5 -16
package/src/generated/zod.gen.ts
CHANGED
|
@@ -277,33 +277,6 @@ export const zPromptLabelPointer = z.object({
|
|
|
277
277
|
versionId: z.string()
|
|
278
278
|
});
|
|
279
279
|
|
|
280
|
-
export const zPromptRelease = z.object({
|
|
281
|
-
activeFrom: z.iso.datetime().nullable(),
|
|
282
|
-
activeTo: z.iso.datetime().nullable(),
|
|
283
|
-
actorId: z.string(),
|
|
284
|
-
actorType: z.enum([
|
|
285
|
-
'user',
|
|
286
|
-
'api_key',
|
|
287
|
-
'worker'
|
|
288
|
-
]),
|
|
289
|
-
assignmentSalt: z.string().nullable(),
|
|
290
|
-
changeKind: z.enum([
|
|
291
|
-
'release_initial',
|
|
292
|
-
'release_promoted',
|
|
293
|
-
'release_rolled_back',
|
|
294
|
-
'release_weight_changed'
|
|
295
|
-
]),
|
|
296
|
-
createdAt: z.iso.datetime(),
|
|
297
|
-
envSlug: z.string(),
|
|
298
|
-
environmentId: z.string(),
|
|
299
|
-
id: z.string(),
|
|
300
|
-
priorReleaseId: z.string().nullable(),
|
|
301
|
-
promptId: z.string(),
|
|
302
|
-
reason: z.string(),
|
|
303
|
-
strategy: z.enum(['single', 'weighted']),
|
|
304
|
-
versionId: z.string()
|
|
305
|
-
});
|
|
306
|
-
|
|
307
280
|
export const zPromptVersion = z.object({
|
|
308
281
|
changelog: z.string().nullable(),
|
|
309
282
|
createdAt: z.iso.datetime(),
|
|
@@ -337,6 +310,8 @@ export const zRenderedSkill = z.object({
|
|
|
337
310
|
label: z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/),
|
|
338
311
|
promptId: z.string(),
|
|
339
312
|
releaseId: z.string(),
|
|
313
|
+
releasedAt: z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/).nullish(),
|
|
314
|
+
releasedByDisplayName: z.string().nullish(),
|
|
340
315
|
version: z.number(),
|
|
341
316
|
versionId: z.string()
|
|
342
317
|
});
|
|
@@ -418,7 +393,6 @@ export const zResolvedPrompt = z.object({
|
|
|
418
393
|
promptId: z.string(),
|
|
419
394
|
releaseId: z.string(),
|
|
420
395
|
rendered: zRenderedPrompt,
|
|
421
|
-
subjectHash: z.string().nullish(),
|
|
422
396
|
toolChoice: z.union([
|
|
423
397
|
z.enum([
|
|
424
398
|
'auto',
|
|
@@ -430,7 +404,6 @@ export const zResolvedPrompt = z.object({
|
|
|
430
404
|
})
|
|
431
405
|
]).nullish(),
|
|
432
406
|
tools: z.array(zResolvedToolDefinition).nullish(),
|
|
433
|
-
variantName: z.string().nullish(),
|
|
434
407
|
version: z.number(),
|
|
435
408
|
versionId: z.string()
|
|
436
409
|
});
|
|
@@ -568,27 +541,6 @@ export const zServiceUnavailableError = z.object({
|
|
|
568
541
|
success: z.literal(false)
|
|
569
542
|
});
|
|
570
543
|
|
|
571
|
-
export const zSkillFileDiffRow = z.object({
|
|
572
|
-
change: z.enum([
|
|
573
|
-
'unchanged',
|
|
574
|
-
'modified',
|
|
575
|
-
'added',
|
|
576
|
-
'removed',
|
|
577
|
-
'renamed'
|
|
578
|
-
]),
|
|
579
|
-
filename: z.string(),
|
|
580
|
-
from: z.string().nullish(),
|
|
581
|
-
fromFilename: z.string().nullish(),
|
|
582
|
-
to: z.string().nullish()
|
|
583
|
-
});
|
|
584
|
-
|
|
585
|
-
export const zSkillVersionDiff = z.object({
|
|
586
|
-
files: z.array(zSkillFileDiffRow),
|
|
587
|
-
format: z.enum(['skill']),
|
|
588
|
-
from: z.number(),
|
|
589
|
-
to: z.number()
|
|
590
|
-
});
|
|
591
|
-
|
|
592
544
|
export const zTooManyRequestsError = z.object({
|
|
593
545
|
_tag: z.enum(['TooManyRequestsError']),
|
|
594
546
|
code: z.number(),
|
|
@@ -5737,119 +5689,6 @@ export const zProjectEnvironmentsCreateProjectEnvironmentResponse = z.object({
|
|
|
5737
5689
|
success: z.boolean()
|
|
5738
5690
|
});
|
|
5739
5691
|
|
|
5740
|
-
export const zPromptsGetPromptEnvPolicyPath = z.object({
|
|
5741
|
-
projectId: z.string().min(1),
|
|
5742
|
-
environmentId: z.string().min(1)
|
|
5743
|
-
});
|
|
5744
|
-
|
|
5745
|
-
/**
|
|
5746
|
-
* Success
|
|
5747
|
-
*/
|
|
5748
|
-
export const zPromptsGetPromptEnvPolicyResponse = z.object({
|
|
5749
|
-
code: z.number(),
|
|
5750
|
-
data: z.object({
|
|
5751
|
-
policy: z.object({
|
|
5752
|
-
createdAt: z.iso.datetime(),
|
|
5753
|
-
createdBy: z.string(),
|
|
5754
|
-
envSlug: z.string(),
|
|
5755
|
-
environmentId: z.string(),
|
|
5756
|
-
id: z.string(),
|
|
5757
|
-
minimumDwellTimeHours: z.number(),
|
|
5758
|
-
noRollbackInSource: z.boolean(),
|
|
5759
|
-
noRollbackLookBackHours: z.number(),
|
|
5760
|
-
projectId: z.string(),
|
|
5761
|
-
requiredSourceEnvId: z.string().nullable(),
|
|
5762
|
-
requiredSourceEnvSlug: z.string().nullable(),
|
|
5763
|
-
requiresApproval: z.boolean(),
|
|
5764
|
-
requiresApprovalSeparationOfDuties: z.boolean(),
|
|
5765
|
-
updatedAt: z.iso.datetime(),
|
|
5766
|
-
updatedBy: z.string()
|
|
5767
|
-
}).nullable()
|
|
5768
|
-
}).nullable(),
|
|
5769
|
-
error: z.object({
|
|
5770
|
-
code: z.string(),
|
|
5771
|
-
details: z.unknown().nullish(),
|
|
5772
|
-
message: z.string(),
|
|
5773
|
-
rowErrors: z.array(z.object({
|
|
5774
|
-
code: z.string(),
|
|
5775
|
-
message: z.string(),
|
|
5776
|
-
path: z.array(z.union([z.string(), z.number()]))
|
|
5777
|
-
})).nullish()
|
|
5778
|
-
}).nullable(),
|
|
5779
|
-
pagination: z.object({
|
|
5780
|
-
limit: z.int().gte(1).lte(100),
|
|
5781
|
-
page: z.int().gte(1),
|
|
5782
|
-
total: z.int().gte(0),
|
|
5783
|
-
totalPages: z.int().gte(0)
|
|
5784
|
-
}).nullable(),
|
|
5785
|
-
sdkBehavior: z.object({
|
|
5786
|
-
flags: z.record(z.string(), z.unknown()),
|
|
5787
|
-
v: z.int().gte(1)
|
|
5788
|
-
}).nullish(),
|
|
5789
|
-
success: z.boolean()
|
|
5790
|
-
});
|
|
5791
|
-
|
|
5792
|
-
export const zPromptsUpsertPromptEnvPolicyBody = z.object({
|
|
5793
|
-
minimumDwellTimeHours: z.int().gte(0).nullish(),
|
|
5794
|
-
noRollbackInSource: z.boolean().nullish(),
|
|
5795
|
-
noRollbackLookBackHours: z.int().gt(0).nullish(),
|
|
5796
|
-
requiredSourceEnvId: z.string().nullish(),
|
|
5797
|
-
requiresApproval: z.boolean().nullish(),
|
|
5798
|
-
requiresApprovalSeparationOfDuties: z.boolean().nullish()
|
|
5799
|
-
});
|
|
5800
|
-
|
|
5801
|
-
export const zPromptsUpsertPromptEnvPolicyPath = z.object({
|
|
5802
|
-
projectId: z.string().min(1),
|
|
5803
|
-
environmentId: z.string().min(1)
|
|
5804
|
-
});
|
|
5805
|
-
|
|
5806
|
-
/**
|
|
5807
|
-
* Success
|
|
5808
|
-
*/
|
|
5809
|
-
export const zPromptsUpsertPromptEnvPolicyResponse = z.object({
|
|
5810
|
-
code: z.number(),
|
|
5811
|
-
data: z.object({
|
|
5812
|
-
policy: z.object({
|
|
5813
|
-
createdAt: z.iso.datetime(),
|
|
5814
|
-
createdBy: z.string(),
|
|
5815
|
-
envSlug: z.string(),
|
|
5816
|
-
environmentId: z.string(),
|
|
5817
|
-
id: z.string(),
|
|
5818
|
-
minimumDwellTimeHours: z.number(),
|
|
5819
|
-
noRollbackInSource: z.boolean(),
|
|
5820
|
-
noRollbackLookBackHours: z.number(),
|
|
5821
|
-
projectId: z.string(),
|
|
5822
|
-
requiredSourceEnvId: z.string().nullable(),
|
|
5823
|
-
requiredSourceEnvSlug: z.string().nullable(),
|
|
5824
|
-
requiresApproval: z.boolean(),
|
|
5825
|
-
requiresApprovalSeparationOfDuties: z.boolean(),
|
|
5826
|
-
updatedAt: z.iso.datetime(),
|
|
5827
|
-
updatedBy: z.string()
|
|
5828
|
-
}).nullable()
|
|
5829
|
-
}).nullable(),
|
|
5830
|
-
error: z.object({
|
|
5831
|
-
code: z.string(),
|
|
5832
|
-
details: z.unknown().nullish(),
|
|
5833
|
-
message: z.string(),
|
|
5834
|
-
rowErrors: z.array(z.object({
|
|
5835
|
-
code: z.string(),
|
|
5836
|
-
message: z.string(),
|
|
5837
|
-
path: z.array(z.union([z.string(), z.number()]))
|
|
5838
|
-
})).nullish()
|
|
5839
|
-
}).nullable(),
|
|
5840
|
-
pagination: z.object({
|
|
5841
|
-
limit: z.int().gte(1).lte(100),
|
|
5842
|
-
page: z.int().gte(1),
|
|
5843
|
-
total: z.int().gte(0),
|
|
5844
|
-
totalPages: z.int().gte(0)
|
|
5845
|
-
}).nullable(),
|
|
5846
|
-
sdkBehavior: z.object({
|
|
5847
|
-
flags: z.record(z.string(), z.unknown()),
|
|
5848
|
-
v: z.int().gte(1)
|
|
5849
|
-
}).nullish(),
|
|
5850
|
-
success: z.boolean()
|
|
5851
|
-
});
|
|
5852
|
-
|
|
5853
5692
|
export const zSnapshotGetProjectSnapshotAtTimePath = z.object({
|
|
5854
5693
|
projectId: z.string(),
|
|
5855
5694
|
environmentId: z.string().min(1)
|
|
@@ -7363,7 +7202,7 @@ export const zPromptsListPromptsResponse = z.object({
|
|
|
7363
7202
|
weighted: z.object({
|
|
7364
7203
|
split: z.string(),
|
|
7365
7204
|
variants: z.number()
|
|
7366
|
-
}).
|
|
7205
|
+
}).nullish()
|
|
7367
7206
|
})),
|
|
7368
7207
|
lastModifiedAt: z.iso.datetime(),
|
|
7369
7208
|
lastModifiedByDisplayName: z.string().nullable(),
|
|
@@ -7963,50 +7802,6 @@ export const zPromptsListPromptLabelEventsByLabelResponse = z.object({
|
|
|
7963
7802
|
success: z.boolean()
|
|
7964
7803
|
});
|
|
7965
7804
|
|
|
7966
|
-
export const zPromptsSetWeightedReleaseBody = z.object({
|
|
7967
|
-
reason: z.string().min(1),
|
|
7968
|
-
variants: z.array(z.object({
|
|
7969
|
-
name: z.string().min(1),
|
|
7970
|
-
versionId: z.string().min(1),
|
|
7971
|
-
weight: z.number()
|
|
7972
|
-
})).min(1)
|
|
7973
|
-
});
|
|
7974
|
-
|
|
7975
|
-
export const zPromptsSetWeightedReleasePath = z.object({
|
|
7976
|
-
projectId: z.string().min(1),
|
|
7977
|
-
promptId: z.string(),
|
|
7978
|
-
label: z.string()
|
|
7979
|
-
});
|
|
7980
|
-
|
|
7981
|
-
/**
|
|
7982
|
-
* Success
|
|
7983
|
-
*/
|
|
7984
|
-
export const zPromptsSetWeightedReleaseResponse = z.object({
|
|
7985
|
-
code: z.number(),
|
|
7986
|
-
data: zPromptRelease.nullable(),
|
|
7987
|
-
error: z.object({
|
|
7988
|
-
code: z.string(),
|
|
7989
|
-
details: z.unknown().nullish(),
|
|
7990
|
-
message: z.string(),
|
|
7991
|
-
rowErrors: z.array(z.object({
|
|
7992
|
-
code: z.string(),
|
|
7993
|
-
message: z.string(),
|
|
7994
|
-
path: z.array(z.union([z.string(), z.number()]))
|
|
7995
|
-
})).nullish()
|
|
7996
|
-
}).nullable(),
|
|
7997
|
-
pagination: z.object({
|
|
7998
|
-
limit: z.int().gte(1).lte(100),
|
|
7999
|
-
page: z.int().gte(1),
|
|
8000
|
-
total: z.int().gte(0),
|
|
8001
|
-
totalPages: z.int().gte(0)
|
|
8002
|
-
}).nullable(),
|
|
8003
|
-
sdkBehavior: z.object({
|
|
8004
|
-
flags: z.record(z.string(), z.unknown()),
|
|
8005
|
-
v: z.int().gte(1)
|
|
8006
|
-
}).nullish(),
|
|
8007
|
-
success: z.boolean()
|
|
8008
|
-
});
|
|
8009
|
-
|
|
8010
7805
|
export const zPromptMetricsGetPromptRequestMetricsPath = z.object({
|
|
8011
7806
|
projectId: z.string(),
|
|
8012
7807
|
promptId: z.string().min(1)
|
|
@@ -8143,159 +7938,6 @@ export const zPromptsCreatePromptVersionResponse = z.object({
|
|
|
8143
7938
|
success: z.boolean()
|
|
8144
7939
|
});
|
|
8145
7940
|
|
|
8146
|
-
export const zPromptsGetPromptVersionDiffPath = z.object({
|
|
8147
|
-
projectId: z.string().min(1),
|
|
8148
|
-
promptId: z.string(),
|
|
8149
|
-
versionId: z.string().min(1)
|
|
8150
|
-
});
|
|
8151
|
-
|
|
8152
|
-
export const zPromptsGetPromptVersionDiffQuery = z.object({
|
|
8153
|
-
against: z.string().min(1).nullish()
|
|
8154
|
-
});
|
|
8155
|
-
|
|
8156
|
-
/**
|
|
8157
|
-
* Success
|
|
8158
|
-
*/
|
|
8159
|
-
export const zPromptsGetPromptVersionDiffResponse = z.object({
|
|
8160
|
-
code: z.number(),
|
|
8161
|
-
data: z.union([
|
|
8162
|
-
z.object({
|
|
8163
|
-
operations: z.array(z.union([
|
|
8164
|
-
z.object({
|
|
8165
|
-
condition: z.object({
|
|
8166
|
-
kind: z.string()
|
|
8167
|
-
}),
|
|
8168
|
-
content: z.string().nullish(),
|
|
8169
|
-
name: z.string(),
|
|
8170
|
-
op: z.enum(['add']),
|
|
8171
|
-
role: z.enum([
|
|
8172
|
-
'system',
|
|
8173
|
-
'user',
|
|
8174
|
-
'assistant',
|
|
8175
|
-
'developer',
|
|
8176
|
-
'tool'
|
|
8177
|
-
]),
|
|
8178
|
-
toolCallId: z.string().nullish(),
|
|
8179
|
-
toolCalls: z.array(z.object({
|
|
8180
|
-
arguments: z.record(z.string(), z.unknown()),
|
|
8181
|
-
id: z.string(),
|
|
8182
|
-
name: z.string()
|
|
8183
|
-
})).nullish()
|
|
8184
|
-
}),
|
|
8185
|
-
z.object({
|
|
8186
|
-
condition: z.object({
|
|
8187
|
-
kind: z.string()
|
|
8188
|
-
}),
|
|
8189
|
-
content: z.string().nullish(),
|
|
8190
|
-
name: z.string(),
|
|
8191
|
-
op: z.enum(['remove']),
|
|
8192
|
-
role: z.enum([
|
|
8193
|
-
'system',
|
|
8194
|
-
'user',
|
|
8195
|
-
'assistant',
|
|
8196
|
-
'developer',
|
|
8197
|
-
'tool'
|
|
8198
|
-
]),
|
|
8199
|
-
toolCallId: z.string().nullish(),
|
|
8200
|
-
toolCalls: z.array(z.object({
|
|
8201
|
-
arguments: z.record(z.string(), z.unknown()),
|
|
8202
|
-
id: z.string(),
|
|
8203
|
-
name: z.string()
|
|
8204
|
-
})).nullish()
|
|
8205
|
-
}),
|
|
8206
|
-
z.object({
|
|
8207
|
-
after: z.string(),
|
|
8208
|
-
before: z.string(),
|
|
8209
|
-
name: z.string(),
|
|
8210
|
-
op: z.enum(['edit_content'])
|
|
8211
|
-
}),
|
|
8212
|
-
z.object({
|
|
8213
|
-
after: z.object({
|
|
8214
|
-
kind: z.string()
|
|
8215
|
-
}),
|
|
8216
|
-
before: z.object({
|
|
8217
|
-
kind: z.string()
|
|
8218
|
-
}),
|
|
8219
|
-
name: z.string(),
|
|
8220
|
-
op: z.enum(['edit_condition'])
|
|
8221
|
-
}),
|
|
8222
|
-
z.object({
|
|
8223
|
-
after: z.enum([
|
|
8224
|
-
'system',
|
|
8225
|
-
'user',
|
|
8226
|
-
'assistant',
|
|
8227
|
-
'developer',
|
|
8228
|
-
'tool'
|
|
8229
|
-
]),
|
|
8230
|
-
before: z.enum([
|
|
8231
|
-
'system',
|
|
8232
|
-
'user',
|
|
8233
|
-
'assistant',
|
|
8234
|
-
'developer',
|
|
8235
|
-
'tool'
|
|
8236
|
-
]),
|
|
8237
|
-
name: z.string(),
|
|
8238
|
-
op: z.enum(['edit_role'])
|
|
8239
|
-
}),
|
|
8240
|
-
z.object({
|
|
8241
|
-
after: z.boolean(),
|
|
8242
|
-
before: z.boolean(),
|
|
8243
|
-
name: z.string(),
|
|
8244
|
-
op: z.enum(['edit_required'])
|
|
8245
|
-
}),
|
|
8246
|
-
z.object({
|
|
8247
|
-
after: z.string(),
|
|
8248
|
-
before: z.string(),
|
|
8249
|
-
name: z.string(),
|
|
8250
|
-
op: z.enum(['edit_tool_call_id'])
|
|
8251
|
-
}),
|
|
8252
|
-
z.object({
|
|
8253
|
-
after: z.array(z.object({
|
|
8254
|
-
arguments: z.record(z.string(), z.unknown()),
|
|
8255
|
-
id: z.string(),
|
|
8256
|
-
name: z.string()
|
|
8257
|
-
})),
|
|
8258
|
-
before: z.array(z.object({
|
|
8259
|
-
arguments: z.record(z.string(), z.unknown()),
|
|
8260
|
-
id: z.string(),
|
|
8261
|
-
name: z.string()
|
|
8262
|
-
})),
|
|
8263
|
-
name: z.string(),
|
|
8264
|
-
op: z.enum(['edit_tool_calls'])
|
|
8265
|
-
}),
|
|
8266
|
-
z.object({
|
|
8267
|
-
fromIndex: z.number(),
|
|
8268
|
-
name: z.string(),
|
|
8269
|
-
op: z.enum(['reorder']),
|
|
8270
|
-
toIndex: z.number()
|
|
8271
|
-
})
|
|
8272
|
-
]))
|
|
8273
|
-
}),
|
|
8274
|
-
zSkillVersionDiff
|
|
8275
|
-
]).nullable(),
|
|
8276
|
-
error: z.object({
|
|
8277
|
-
code: z.string(),
|
|
8278
|
-
details: z.unknown().nullish(),
|
|
8279
|
-
message: z.string(),
|
|
8280
|
-
rowErrors: z.array(z.object({
|
|
8281
|
-
code: z.string(),
|
|
8282
|
-
message: z.string(),
|
|
8283
|
-
path: z.array(z.union([z.string(), z.number()]))
|
|
8284
|
-
})).nullish()
|
|
8285
|
-
}).nullable(),
|
|
8286
|
-
pagination: z.object({
|
|
8287
|
-
limit: z.int().gte(1).lte(100),
|
|
8288
|
-
page: z.int().gte(1),
|
|
8289
|
-
total: z.int().gte(0),
|
|
8290
|
-
totalPages: z.int().gte(0)
|
|
8291
|
-
}).nullable(),
|
|
8292
|
-
sdkBehavior: z.object({
|
|
8293
|
-
flags: z.record(z.string(), z.unknown()),
|
|
8294
|
-
v: z.int().gte(1)
|
|
8295
|
-
}).nullish(),
|
|
8296
|
-
success: z.boolean()
|
|
8297
|
-
});
|
|
8298
|
-
|
|
8299
7941
|
export const zPromptsGetPromptVersionPath = z.object({
|
|
8300
7942
|
projectId: z.string().min(1),
|
|
8301
7943
|
promptId: z.string(),
|
|
@@ -8331,227 +7973,6 @@ export const zPromptsGetPromptVersionResponse = z.object({
|
|
|
8331
7973
|
success: z.boolean()
|
|
8332
7974
|
});
|
|
8333
7975
|
|
|
8334
|
-
export const zPromptsGetPromptReviewStatePath = z.object({
|
|
8335
|
-
projectId: z.string().min(1),
|
|
8336
|
-
promptId: z.string(),
|
|
8337
|
-
versionNumber: z.string()
|
|
8338
|
-
});
|
|
8339
|
-
|
|
8340
|
-
/**
|
|
8341
|
-
* Success
|
|
8342
|
-
*/
|
|
8343
|
-
export const zPromptsGetPromptReviewStateResponse = z.object({
|
|
8344
|
-
code: z.number(),
|
|
8345
|
-
data: z.object({
|
|
8346
|
-
activeDecisions: z.array(z.object({
|
|
8347
|
-
createdAt: z.iso.datetime(),
|
|
8348
|
-
decision: z.enum([
|
|
8349
|
-
'approve',
|
|
8350
|
-
'reject',
|
|
8351
|
-
'request_changes',
|
|
8352
|
-
'withdraw'
|
|
8353
|
-
]),
|
|
8354
|
-
hasActiveRejection: z.boolean(),
|
|
8355
|
-
reviewId: z.string(),
|
|
8356
|
-
reviewerPrincipalId: z.string()
|
|
8357
|
-
})),
|
|
8358
|
-
approvalCount: z.number(),
|
|
8359
|
-
callerHasActiveRejection: z.boolean(),
|
|
8360
|
-
hasActiveRejection: z.boolean(),
|
|
8361
|
-
reviews: z.array(z.object({
|
|
8362
|
-
createdAt: z.iso.datetime(),
|
|
8363
|
-
decision: z.enum([
|
|
8364
|
-
'approve',
|
|
8365
|
-
'reject',
|
|
8366
|
-
'request_changes',
|
|
8367
|
-
'withdraw'
|
|
8368
|
-
]),
|
|
8369
|
-
id: z.string(),
|
|
8370
|
-
note: z.string().nullable(),
|
|
8371
|
-
reviewerDisplayName: z.string().nullable(),
|
|
8372
|
-
reviewerPrincipalId: z.string()
|
|
8373
|
-
}))
|
|
8374
|
-
}).nullable(),
|
|
8375
|
-
error: z.object({
|
|
8376
|
-
code: z.string(),
|
|
8377
|
-
details: z.unknown().nullish(),
|
|
8378
|
-
message: z.string(),
|
|
8379
|
-
rowErrors: z.array(z.object({
|
|
8380
|
-
code: z.string(),
|
|
8381
|
-
message: z.string(),
|
|
8382
|
-
path: z.array(z.union([z.string(), z.number()]))
|
|
8383
|
-
})).nullish()
|
|
8384
|
-
}).nullable(),
|
|
8385
|
-
pagination: z.object({
|
|
8386
|
-
limit: z.int().gte(1).lte(100),
|
|
8387
|
-
page: z.int().gte(1),
|
|
8388
|
-
total: z.int().gte(0),
|
|
8389
|
-
totalPages: z.int().gte(0)
|
|
8390
|
-
}).nullable(),
|
|
8391
|
-
sdkBehavior: z.object({
|
|
8392
|
-
flags: z.record(z.string(), z.unknown()),
|
|
8393
|
-
v: z.int().gte(1)
|
|
8394
|
-
}).nullish(),
|
|
8395
|
-
success: z.boolean()
|
|
8396
|
-
});
|
|
8397
|
-
|
|
8398
|
-
export const zPromptsSubmitPromptReviewBody = z.object({
|
|
8399
|
-
decision: z.enum([
|
|
8400
|
-
'approve',
|
|
8401
|
-
'reject',
|
|
8402
|
-
'request_changes'
|
|
8403
|
-
]),
|
|
8404
|
-
note: z.string().max(4000).nullish()
|
|
8405
|
-
});
|
|
8406
|
-
|
|
8407
|
-
export const zPromptsSubmitPromptReviewPath = z.object({
|
|
8408
|
-
projectId: z.string().min(1),
|
|
8409
|
-
promptId: z.string(),
|
|
8410
|
-
versionNumber: z.string()
|
|
8411
|
-
});
|
|
8412
|
-
|
|
8413
|
-
/**
|
|
8414
|
-
* Success
|
|
8415
|
-
*/
|
|
8416
|
-
export const zPromptsSubmitPromptReviewResponse = z.object({
|
|
8417
|
-
code: z.number(),
|
|
8418
|
-
data: z.object({
|
|
8419
|
-
approvalState: z.object({
|
|
8420
|
-
approvalCount: z.number(),
|
|
8421
|
-
hasActiveRejection: z.boolean()
|
|
8422
|
-
}),
|
|
8423
|
-
review: z.object({
|
|
8424
|
-
createdAt: z.iso.datetime(),
|
|
8425
|
-
decision: z.enum([
|
|
8426
|
-
'approve',
|
|
8427
|
-
'reject',
|
|
8428
|
-
'request_changes',
|
|
8429
|
-
'withdraw'
|
|
8430
|
-
]),
|
|
8431
|
-
id: z.string(),
|
|
8432
|
-
note: z.string().nullable(),
|
|
8433
|
-
reviewerPrincipalId: z.string()
|
|
8434
|
-
})
|
|
8435
|
-
}).nullable(),
|
|
8436
|
-
error: z.object({
|
|
8437
|
-
code: z.string(),
|
|
8438
|
-
details: z.unknown().nullish(),
|
|
8439
|
-
message: z.string(),
|
|
8440
|
-
rowErrors: z.array(z.object({
|
|
8441
|
-
code: z.string(),
|
|
8442
|
-
message: z.string(),
|
|
8443
|
-
path: z.array(z.union([z.string(), z.number()]))
|
|
8444
|
-
})).nullish()
|
|
8445
|
-
}).nullable(),
|
|
8446
|
-
pagination: z.object({
|
|
8447
|
-
limit: z.int().gte(1).lte(100),
|
|
8448
|
-
page: z.int().gte(1),
|
|
8449
|
-
total: z.int().gte(0),
|
|
8450
|
-
totalPages: z.int().gte(0)
|
|
8451
|
-
}).nullable(),
|
|
8452
|
-
sdkBehavior: z.object({
|
|
8453
|
-
flags: z.record(z.string(), z.unknown()),
|
|
8454
|
-
v: z.int().gte(1)
|
|
8455
|
-
}).nullish(),
|
|
8456
|
-
success: z.boolean()
|
|
8457
|
-
});
|
|
8458
|
-
|
|
8459
|
-
export const zPromptsWithdrawPromptReviewBody = z.object({
|
|
8460
|
-
note: z.string().max(4000).nullish()
|
|
8461
|
-
});
|
|
8462
|
-
|
|
8463
|
-
export const zPromptsWithdrawPromptReviewPath = z.object({
|
|
8464
|
-
projectId: z.string().min(1),
|
|
8465
|
-
promptId: z.string(),
|
|
8466
|
-
versionNumber: z.string()
|
|
8467
|
-
});
|
|
8468
|
-
|
|
8469
|
-
/**
|
|
8470
|
-
* Success
|
|
8471
|
-
*/
|
|
8472
|
-
export const zPromptsWithdrawPromptReviewResponse = z.object({
|
|
8473
|
-
code: z.number(),
|
|
8474
|
-
data: z.object({
|
|
8475
|
-
approvalState: z.object({
|
|
8476
|
-
approvalCount: z.number(),
|
|
8477
|
-
hasActiveRejection: z.boolean()
|
|
8478
|
-
}),
|
|
8479
|
-
review: z.object({
|
|
8480
|
-
createdAt: z.iso.datetime(),
|
|
8481
|
-
decision: z.enum([
|
|
8482
|
-
'approve',
|
|
8483
|
-
'reject',
|
|
8484
|
-
'request_changes',
|
|
8485
|
-
'withdraw'
|
|
8486
|
-
]),
|
|
8487
|
-
id: z.string(),
|
|
8488
|
-
note: z.string().nullable(),
|
|
8489
|
-
reviewerPrincipalId: z.string()
|
|
8490
|
-
})
|
|
8491
|
-
}).nullable(),
|
|
8492
|
-
error: z.object({
|
|
8493
|
-
code: z.string(),
|
|
8494
|
-
details: z.unknown().nullish(),
|
|
8495
|
-
message: z.string(),
|
|
8496
|
-
rowErrors: z.array(z.object({
|
|
8497
|
-
code: z.string(),
|
|
8498
|
-
message: z.string(),
|
|
8499
|
-
path: z.array(z.union([z.string(), z.number()]))
|
|
8500
|
-
})).nullish()
|
|
8501
|
-
}).nullable(),
|
|
8502
|
-
pagination: z.object({
|
|
8503
|
-
limit: z.int().gte(1).lte(100),
|
|
8504
|
-
page: z.int().gte(1),
|
|
8505
|
-
total: z.int().gte(0),
|
|
8506
|
-
totalPages: z.int().gte(0)
|
|
8507
|
-
}).nullable(),
|
|
8508
|
-
sdkBehavior: z.object({
|
|
8509
|
-
flags: z.record(z.string(), z.unknown()),
|
|
8510
|
-
v: z.int().gte(1)
|
|
8511
|
-
}).nullish(),
|
|
8512
|
-
success: z.boolean()
|
|
8513
|
-
});
|
|
8514
|
-
|
|
8515
|
-
export const zPromptsResolvePromptBody = z.object({
|
|
8516
|
-
labels: z.array(z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/)).min(1).max(10),
|
|
8517
|
-
slug: z.string().min(1),
|
|
8518
|
-
subject: z.string().min(1).nullish(),
|
|
8519
|
-
variables: z.record(z.string(), z.unknown()).nullish()
|
|
8520
|
-
});
|
|
8521
|
-
|
|
8522
|
-
export const zPromptsResolvePromptPath = z.object({
|
|
8523
|
-
projectId: z.string().min(1)
|
|
8524
|
-
});
|
|
8525
|
-
|
|
8526
|
-
/**
|
|
8527
|
-
* Success
|
|
8528
|
-
*/
|
|
8529
|
-
export const zPromptsResolvePromptResponse = z.object({
|
|
8530
|
-
code: z.number(),
|
|
8531
|
-
data: zResolvedPrompt.nullable(),
|
|
8532
|
-
error: z.object({
|
|
8533
|
-
code: z.string(),
|
|
8534
|
-
details: z.unknown().nullish(),
|
|
8535
|
-
message: z.string(),
|
|
8536
|
-
rowErrors: z.array(z.object({
|
|
8537
|
-
code: z.string(),
|
|
8538
|
-
message: z.string(),
|
|
8539
|
-
path: z.array(z.union([z.string(), z.number()]))
|
|
8540
|
-
})).nullish()
|
|
8541
|
-
}).nullable(),
|
|
8542
|
-
pagination: z.object({
|
|
8543
|
-
limit: z.int().gte(1).lte(100),
|
|
8544
|
-
page: z.int().gte(1),
|
|
8545
|
-
total: z.int().gte(0),
|
|
8546
|
-
totalPages: z.int().gte(0)
|
|
8547
|
-
}).nullable(),
|
|
8548
|
-
sdkBehavior: z.object({
|
|
8549
|
-
flags: z.record(z.string(), z.unknown()),
|
|
8550
|
-
v: z.int().gte(1)
|
|
8551
|
-
}).nullish(),
|
|
8552
|
-
success: z.boolean()
|
|
8553
|
-
});
|
|
8554
|
-
|
|
8555
7976
|
export const zCredentialLifecycleRenameCredentialBody = z.object({
|
|
8556
7977
|
label: z.string().min(1).max(200)
|
|
8557
7978
|
});
|
package/src/prompts/resource.ts
CHANGED
|
@@ -165,8 +165,6 @@ function renderedToMessages(
|
|
|
165
165
|
* - `messages` is derived from the `rendered` chat payload.
|
|
166
166
|
* - `releaseId` is ALWAYS a key: a string when the server sends one, else
|
|
167
167
|
* explicit `null` (R5 `string | null`).
|
|
168
|
-
* - `variantName` is present IFF the server sent one (i.e. weighted release);
|
|
169
|
-
* absent for `single` — never `null`/`""`.
|
|
170
168
|
* - `blockRenderRecord` defaults to `{}` when the server omitted it.
|
|
171
169
|
*/
|
|
172
170
|
function normalizeResolvedEnvelope(
|
|
@@ -202,17 +200,6 @@ function normalizeResolvedEnvelope(
|
|
|
202
200
|
if (raw.toolChoice != null) {
|
|
203
201
|
result.toolChoice = raw.toolChoice;
|
|
204
202
|
}
|
|
205
|
-
// Set `variantName` only when it is a non-empty string, so the key is
|
|
206
|
-
// genuinely absent for `single`-strategy releases (R5: present IFF weighted —
|
|
207
|
-
// never `null`, never `""`). A `null`/`""` from the wire is normalized to
|
|
208
|
-
// absent, which also keeps the D8 `variantName !== undefined` weighted
|
|
209
|
-
// inference honest (Cursor).
|
|
210
|
-
if (
|
|
211
|
-
typeof provenance.variantName === "string" &&
|
|
212
|
-
provenance.variantName.length > 0
|
|
213
|
-
) {
|
|
214
|
-
result.variantName = provenance.variantName;
|
|
215
|
-
}
|
|
216
203
|
return result;
|
|
217
204
|
}
|
|
218
205
|
|
|
@@ -569,8 +556,7 @@ export class PromptResource<F extends RenderFormat | undefined = undefined> {
|
|
|
569
556
|
const { variables, fallback } = options;
|
|
570
557
|
|
|
571
558
|
// TO11-2743: slug + the single resolved label live in the PATH; the body
|
|
572
|
-
// carries only `variables`.
|
|
573
|
-
// supported by the render endpoint yet, so it's dropped from the surface.
|
|
559
|
+
// carries only `variables`.
|
|
574
560
|
const body: Record<string, unknown> = {};
|
|
575
561
|
if (variables !== undefined) body.variables = variables;
|
|
576
562
|
|
package/src/prompts/shape.ts
CHANGED
|
@@ -44,7 +44,6 @@ export interface PromptMetadata {
|
|
|
44
44
|
label: string;
|
|
45
45
|
/** The prompt's human-readable slug — surfaced as `x-to11-prompt-slug`. */
|
|
46
46
|
slug: string;
|
|
47
|
-
variantName?: string;
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
/** OpenAI-shaped render result: spread `{ ...config, messages }` into create(). */
|
|
@@ -94,8 +93,6 @@ function toMetadata(prompt: RenderedPrompt): PromptMetadata {
|
|
|
94
93
|
label: prompt.label,
|
|
95
94
|
slug: prompt.slug,
|
|
96
95
|
};
|
|
97
|
-
if (prompt.variantName !== undefined)
|
|
98
|
-
metadata.variantName = prompt.variantName;
|
|
99
96
|
return metadata;
|
|
100
97
|
}
|
|
101
98
|
|
package/src/prompts/types.ts
CHANGED