@to11ai/sdk 2.1.0-rc.3 → 2.1.0-rc.4
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/generated/types.gen.d.ts +3 -3
- package/dist/generated/zod.gen.d.ts +4 -6
- package/dist/prompts/resource.cjs +1 -2
- package/dist/prompts/resource.js +1 -2
- package/package.json +1 -1
- package/src/generated/types.gen.ts +3 -3
- package/src/generated/zod.gen.ts +3 -7
- package/src/prompts/resource.ts +1 -3
|
@@ -149,7 +149,7 @@ export type OAuthCredential = {
|
|
|
149
149
|
type: 'oauth';
|
|
150
150
|
};
|
|
151
151
|
export type PrincipalApiKeyContextInvariant = {
|
|
152
|
-
actorType?: 'oidc' | 'api_key' |
|
|
152
|
+
actorType?: 'oidc' | 'api_key' | null;
|
|
153
153
|
apiKey?: {
|
|
154
154
|
allowed: Array<string>;
|
|
155
155
|
denied: Array<string>;
|
|
@@ -279,7 +279,7 @@ export type RenderedSkill = {
|
|
|
279
279
|
format: 'skill';
|
|
280
280
|
label: string;
|
|
281
281
|
promptId: string;
|
|
282
|
-
releaseId
|
|
282
|
+
releaseId?: string | null;
|
|
283
283
|
releasedAt?: string | null;
|
|
284
284
|
releasedByDisplayName?: string | null | null;
|
|
285
285
|
version: number;
|
|
@@ -325,7 +325,7 @@ export type ResolvedPrompt = {
|
|
|
325
325
|
label: string;
|
|
326
326
|
modelConfig?: unknown | null;
|
|
327
327
|
promptId: string;
|
|
328
|
-
releaseId
|
|
328
|
+
releaseId?: string | null;
|
|
329
329
|
rendered: RenderedPrompt;
|
|
330
330
|
toolChoice?: 'auto' | 'none' | 'required' | {
|
|
331
331
|
name: string;
|
|
@@ -171,7 +171,6 @@ export declare const zPrincipalApiKeyContextInvariant: z.ZodObject<{
|
|
|
171
171
|
actorType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
172
172
|
oidc: "oidc";
|
|
173
173
|
api_key: "api_key";
|
|
174
|
-
internal_secret: "internal_secret";
|
|
175
174
|
}>>>;
|
|
176
175
|
apiKey: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
177
176
|
allowed: z.ZodArray<z.ZodString>;
|
|
@@ -352,7 +351,7 @@ export declare const zRenderedSkill: z.ZodObject<{
|
|
|
352
351
|
}>;
|
|
353
352
|
label: z.ZodString;
|
|
354
353
|
promptId: z.ZodString;
|
|
355
|
-
releaseId: z.ZodString
|
|
354
|
+
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
356
355
|
releasedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
357
356
|
releasedByDisplayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
358
357
|
version: z.ZodNumber;
|
|
@@ -519,7 +518,7 @@ export declare const zResolvedPrompt: z.ZodObject<{
|
|
|
519
518
|
label: z.ZodString;
|
|
520
519
|
modelConfig: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
521
520
|
promptId: z.ZodString;
|
|
522
|
-
releaseId: z.ZodString
|
|
521
|
+
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
523
522
|
rendered: z.ZodUnion<readonly [z.ZodObject<{
|
|
524
523
|
format: z.ZodEnum<{
|
|
525
524
|
text: "text";
|
|
@@ -1802,7 +1801,6 @@ export declare const zAuthAuthMeResponse: z.ZodObject<{
|
|
|
1802
1801
|
actorType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1803
1802
|
oidc: "oidc";
|
|
1804
1803
|
api_key: "api_key";
|
|
1805
|
-
internal_secret: "internal_secret";
|
|
1806
1804
|
}>>>;
|
|
1807
1805
|
apiKey: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1808
1806
|
allowed: z.ZodArray<z.ZodString>;
|
|
@@ -7927,7 +7925,7 @@ export declare const zPromptsRenderPromptResponse: z.ZodObject<{
|
|
|
7927
7925
|
label: z.ZodString;
|
|
7928
7926
|
modelConfig: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
7929
7927
|
promptId: z.ZodString;
|
|
7930
|
-
releaseId: z.ZodString
|
|
7928
|
+
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7931
7929
|
rendered: z.ZodUnion<readonly [z.ZodObject<{
|
|
7932
7930
|
format: z.ZodEnum<{
|
|
7933
7931
|
text: "text";
|
|
@@ -7992,7 +7990,7 @@ export declare const zPromptsRenderPromptResponse: z.ZodObject<{
|
|
|
7992
7990
|
}>;
|
|
7993
7991
|
label: z.ZodString;
|
|
7994
7992
|
promptId: z.ZodString;
|
|
7995
|
-
releaseId: z.ZodString
|
|
7993
|
+
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7996
7994
|
releasedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7997
7995
|
releasedByDisplayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7998
7996
|
version: z.ZodNumber;
|
|
@@ -46,7 +46,6 @@ var import_errors = require("../errors");
|
|
|
46
46
|
var import_zod = require("../generated/zod.gen");
|
|
47
47
|
var import_shape = require("./shape");
|
|
48
48
|
var import_types = require("./types");
|
|
49
|
-
var zResolvedPromptEnvelope = import_zod.zResolvedPrompt.partial({ releaseId: true });
|
|
50
49
|
function unwrap(envelope) {
|
|
51
50
|
if (envelope.data === null || envelope.data === undefined) {
|
|
52
51
|
throw new Error("API returned success but data is null");
|
|
@@ -237,7 +236,7 @@ class PromptResource {
|
|
|
237
236
|
try {
|
|
238
237
|
const envelope = await this.transport.request("POST", `${getProjectPromptsPath(this.projectId)}/by-slug/${encodeURIComponent(slug)}/labels/${encodeURIComponent(label)}/render`, {
|
|
239
238
|
body,
|
|
240
|
-
decode: (data) =>
|
|
239
|
+
decode: (data) => import_zod.zResolvedPrompt.parse(data)
|
|
241
240
|
});
|
|
242
241
|
const raw = unwrap(envelope);
|
|
243
242
|
return normalizeResolvedEnvelope(raw, slug);
|
package/dist/prompts/resource.js
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
import { zResolvedPrompt } from "../generated/zod.gen";
|
|
8
8
|
import { shapePrompt } from "./shape";
|
|
9
9
|
import { ENV_SLUG_REGEX } from "./types";
|
|
10
|
-
var zResolvedPromptEnvelope = zResolvedPrompt.partial({ releaseId: true });
|
|
11
10
|
function unwrap(envelope) {
|
|
12
11
|
if (envelope.data === null || envelope.data === undefined) {
|
|
13
12
|
throw new Error("API returned success but data is null");
|
|
@@ -198,7 +197,7 @@ class PromptResource {
|
|
|
198
197
|
try {
|
|
199
198
|
const envelope = await this.transport.request("POST", `${getProjectPromptsPath(this.projectId)}/by-slug/${encodeURIComponent(slug)}/labels/${encodeURIComponent(label)}/render`, {
|
|
200
199
|
body,
|
|
201
|
-
decode: (data) =>
|
|
200
|
+
decode: (data) => zResolvedPrompt.parse(data)
|
|
202
201
|
});
|
|
203
202
|
const raw = unwrap(envelope);
|
|
204
203
|
return normalizeResolvedEnvelope(raw, slug);
|
package/package.json
CHANGED
|
@@ -164,7 +164,7 @@ export type OAuthCredential = {
|
|
|
164
164
|
};
|
|
165
165
|
|
|
166
166
|
export type PrincipalApiKeyContextInvariant = {
|
|
167
|
-
actorType?: 'oidc' | 'api_key' |
|
|
167
|
+
actorType?: 'oidc' | 'api_key' | null;
|
|
168
168
|
apiKey?: {
|
|
169
169
|
allowed: Array<string>;
|
|
170
170
|
denied: Array<string>;
|
|
@@ -306,7 +306,7 @@ export type RenderedSkill = {
|
|
|
306
306
|
format: 'skill';
|
|
307
307
|
label: string;
|
|
308
308
|
promptId: string;
|
|
309
|
-
releaseId
|
|
309
|
+
releaseId?: string | null;
|
|
310
310
|
releasedAt?: string | null;
|
|
311
311
|
releasedByDisplayName?: string | null | null;
|
|
312
312
|
version: number;
|
|
@@ -359,7 +359,7 @@ export type ResolvedPrompt = {
|
|
|
359
359
|
label: string;
|
|
360
360
|
modelConfig?: unknown | null;
|
|
361
361
|
promptId: string;
|
|
362
|
-
releaseId
|
|
362
|
+
releaseId?: string | null;
|
|
363
363
|
rendered: RenderedPrompt;
|
|
364
364
|
toolChoice?: 'auto' | 'none' | 'required' | {
|
|
365
365
|
name: string;
|
package/src/generated/zod.gen.ts
CHANGED
|
@@ -157,11 +157,7 @@ export const zOAuthCredential = z.object({
|
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
export const zPrincipalApiKeyContextInvariant = z.object({
|
|
160
|
-
actorType: z.enum([
|
|
161
|
-
'oidc',
|
|
162
|
-
'api_key',
|
|
163
|
-
'internal_secret'
|
|
164
|
-
]).nullish(),
|
|
160
|
+
actorType: z.enum(['oidc', 'api_key']).nullish(),
|
|
165
161
|
apiKey: z.object({
|
|
166
162
|
allowed: z.array(z.string()),
|
|
167
163
|
denied: z.array(z.string()),
|
|
@@ -309,7 +305,7 @@ export const zRenderedSkill = z.object({
|
|
|
309
305
|
format: z.enum(['skill']),
|
|
310
306
|
label: z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/),
|
|
311
307
|
promptId: z.string(),
|
|
312
|
-
releaseId: z.string(),
|
|
308
|
+
releaseId: z.string().nullish(),
|
|
313
309
|
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
310
|
releasedByDisplayName: z.string().nullish(),
|
|
315
311
|
version: z.number(),
|
|
@@ -391,7 +387,7 @@ export const zResolvedPrompt = z.object({
|
|
|
391
387
|
label: z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/),
|
|
392
388
|
modelConfig: z.unknown().nullish(),
|
|
393
389
|
promptId: z.string(),
|
|
394
|
-
releaseId: z.string(),
|
|
390
|
+
releaseId: z.string().nullish(),
|
|
395
391
|
rendered: zRenderedPrompt,
|
|
396
392
|
toolChoice: z.union([
|
|
397
393
|
z.enum([
|
package/src/prompts/resource.ts
CHANGED
|
@@ -118,8 +118,6 @@ export type {
|
|
|
118
118
|
UpdatePromptResult,
|
|
119
119
|
} from "./types";
|
|
120
120
|
|
|
121
|
-
const zResolvedPromptEnvelope = zResolvedPrompt.partial({ releaseId: true });
|
|
122
|
-
|
|
123
121
|
function unwrap<T>(envelope: ApiEnvelope<T>): T {
|
|
124
122
|
if (envelope.data === null || envelope.data === undefined) {
|
|
125
123
|
throw new Error("API returned success but data is null");
|
|
@@ -567,7 +565,7 @@ export class PromptResource<F extends RenderFormat | undefined = undefined> {
|
|
|
567
565
|
{
|
|
568
566
|
body,
|
|
569
567
|
decode: (data) =>
|
|
570
|
-
|
|
568
|
+
zResolvedPrompt.parse(data) as ResolvedPromptEnvelope,
|
|
571
569
|
},
|
|
572
570
|
);
|
|
573
571
|
const raw = unwrap(envelope);
|