@automate.ax/api-contract 0.30.0 → 0.32.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/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/runtime.d.ts +9 -6
- package/dist/runtime.js +6 -1
- package/package.json +3 -2
- package/src/index.ts +2 -0
- package/src/runtime.ts +13 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { AUTOMATION_SDK_VERSION, deploymentTriggerInfoSchema, type DeploymentTriggerInfo, } from "./deployment.js";
|
|
2
2
|
export { integrationAccountOutputSchema } from "./account.js";
|
|
3
|
-
export { generationInputSchema, generationResultSchema, runtimeContract, type GenerationInput, type GenerationResult, type RuntimeGenerationInput, } from "./runtime.js";
|
|
3
|
+
export { DEFAULT_GATEWAY_MODEL_ID, generationInputSchema, generationResultSchema, runtimeContract, type GenerationInput, type GenerationResult, type RuntimeGenerationInput, } from "./runtime.js";
|
|
4
|
+
export type { GatewayModelId } from "@ai-sdk/gateway";
|
|
4
5
|
export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
|
|
5
6
|
export { integrationConnectionManifestSchema, integrationServiceManifestSchema, type IntegrationConnectionManifest, type IntegrationServiceManifest, } from "./authorization.js";
|
|
6
7
|
export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
|
|
@@ -1046,7 +1047,7 @@ export declare const contract: {
|
|
|
1046
1047
|
instructions: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1047
1048
|
maxOutputTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1048
1049
|
maxRetries: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1049
|
-
model: import("zod").
|
|
1050
|
+
model: import("zod").ZodDefault<import("zod").ZodCustom<import("@ai-sdk/gateway").GatewayModelId, import("@ai-sdk/gateway").GatewayModelId>>;
|
|
1050
1051
|
presencePenalty: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1051
1052
|
providerOptions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodJSONSchema>>>;
|
|
1052
1053
|
seed: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -1068,7 +1069,7 @@ export declare const contract: {
|
|
|
1068
1069
|
instructions: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1069
1070
|
maxOutputTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1070
1071
|
maxRetries: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1071
|
-
model: import("zod").
|
|
1072
|
+
model: import("zod").ZodDefault<import("zod").ZodCustom<import("@ai-sdk/gateway").GatewayModelId, import("@ai-sdk/gateway").GatewayModelId>>;
|
|
1072
1073
|
presencePenalty: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1073
1074
|
providerOptions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodJSONSchema>>>;
|
|
1074
1075
|
seed: import("zod").ZodOptional<import("zod").ZodNumber>;
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { projectContract } from "./project.js";
|
|
|
9
9
|
import { runtimeContract } from "./runtime.js";
|
|
10
10
|
export { AUTOMATION_SDK_VERSION, deploymentTriggerInfoSchema, } from "./deployment.js";
|
|
11
11
|
export { integrationAccountOutputSchema } from "./account.js";
|
|
12
|
-
export { generationInputSchema, generationResultSchema, runtimeContract, } from "./runtime.js";
|
|
12
|
+
export { DEFAULT_GATEWAY_MODEL_ID, generationInputSchema, generationResultSchema, runtimeContract, } from "./runtime.js";
|
|
13
13
|
export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
|
|
14
14
|
export { integrationConnectionManifestSchema, integrationServiceManifestSchema, } from "./authorization.js";
|
|
15
15
|
export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { GatewayModelId } from "@ai-sdk/gateway";
|
|
1
2
|
import { z } from "zod";
|
|
3
|
+
/** Default model used by the platform Vercel AI Gateway account. */
|
|
4
|
+
export declare const DEFAULT_GATEWAY_MODEL_ID = "openai/gpt-4.1-nano";
|
|
2
5
|
/** Shared text-generation options accepted by the built-in generate action. */
|
|
3
6
|
export declare const generationInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
4
7
|
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
|
|
5
8
|
instructions: z.ZodOptional<z.ZodString>;
|
|
6
9
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
7
10
|
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
8
|
-
model: z.
|
|
11
|
+
model: z.ZodDefault<z.ZodCustom<GatewayModelId, GatewayModelId>>;
|
|
9
12
|
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
10
13
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>;
|
|
11
14
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -22,7 +25,7 @@ export declare const generationInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
22
25
|
instructions: z.ZodOptional<z.ZodString>;
|
|
23
26
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
24
27
|
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
25
|
-
model: z.
|
|
28
|
+
model: z.ZodDefault<z.ZodCustom<GatewayModelId, GatewayModelId>>;
|
|
26
29
|
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
27
30
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>;
|
|
28
31
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -101,7 +104,7 @@ declare const RUNTIME_GENERATION_INPUT_SCHEMA: z.ZodUnion<readonly [z.ZodObject<
|
|
|
101
104
|
instructions: z.ZodOptional<z.ZodString>;
|
|
102
105
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
103
106
|
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
104
|
-
model: z.
|
|
107
|
+
model: z.ZodDefault<z.ZodCustom<GatewayModelId, GatewayModelId>>;
|
|
105
108
|
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
106
109
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>;
|
|
107
110
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -123,7 +126,7 @@ declare const RUNTIME_GENERATION_INPUT_SCHEMA: z.ZodUnion<readonly [z.ZodObject<
|
|
|
123
126
|
instructions: z.ZodOptional<z.ZodString>;
|
|
124
127
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
125
128
|
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
126
|
-
model: z.
|
|
129
|
+
model: z.ZodDefault<z.ZodCustom<GatewayModelId, GatewayModelId>>;
|
|
127
130
|
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
128
131
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>;
|
|
129
132
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -176,7 +179,7 @@ export declare const runtimeContract: {
|
|
|
176
179
|
instructions: z.ZodOptional<z.ZodString>;
|
|
177
180
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
178
181
|
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
179
|
-
model: z.
|
|
182
|
+
model: z.ZodDefault<z.ZodCustom<GatewayModelId, GatewayModelId>>;
|
|
180
183
|
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
181
184
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>;
|
|
182
185
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -198,7 +201,7 @@ export declare const runtimeContract: {
|
|
|
198
201
|
instructions: z.ZodOptional<z.ZodString>;
|
|
199
202
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
200
203
|
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
201
|
-
model: z.
|
|
204
|
+
model: z.ZodDefault<z.ZodCustom<GatewayModelId, GatewayModelId>>;
|
|
202
205
|
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
203
206
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>;
|
|
204
207
|
seed: z.ZodOptional<z.ZodNumber>;
|
package/dist/runtime.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { encodableSchema } from "@automate.ax/codec";
|
|
2
2
|
import { oc } from "@orpc/contract";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
/** Default model used by the platform Vercel AI Gateway account. */
|
|
5
|
+
export const DEFAULT_GATEWAY_MODEL_ID = "openai/gpt-4.1-nano";
|
|
4
6
|
const SIGNAL_FAILURE_SCHEMA = z.object({
|
|
5
7
|
message: z.string(),
|
|
6
8
|
name: z.string(),
|
|
@@ -42,12 +44,15 @@ const GENERATION_USAGE_SCHEMA = z.object({
|
|
|
42
44
|
raw: encodableSchema,
|
|
43
45
|
totalTokens: z.number().optional(),
|
|
44
46
|
});
|
|
47
|
+
const GATEWAY_MODEL_ID_SCHEMA = z
|
|
48
|
+
.custom((value) => typeof value === "string" && value.length > 0, "Model must be a nonempty AI Gateway model ID.")
|
|
49
|
+
.default(DEFAULT_GATEWAY_MODEL_ID);
|
|
45
50
|
const GENERATION_OPTIONS_SCHEMA = z.object({
|
|
46
51
|
frequencyPenalty: z.number().optional(),
|
|
47
52
|
instructions: z.string().optional(),
|
|
48
53
|
maxOutputTokens: z.number().int().positive().optional(),
|
|
49
54
|
maxRetries: z.number().int().nonnegative().optional(),
|
|
50
|
-
model:
|
|
55
|
+
model: GATEWAY_MODEL_ID_SCHEMA,
|
|
51
56
|
presencePenalty: z.number().optional(),
|
|
52
57
|
providerOptions: z
|
|
53
58
|
.record(z.string(), z.record(z.string(), z.json()))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Public oRPC contract for the Automate.ax API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@
|
|
29
|
+
"@ai-sdk/gateway": "^4.0.46",
|
|
30
|
+
"@automate.ax/codec": "0.32.0",
|
|
30
31
|
"@orpc/contract": "1.13.14",
|
|
31
32
|
"zod": "^4.3.6"
|
|
32
33
|
},
|
package/src/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ export {
|
|
|
15
15
|
} from "./deployment"
|
|
16
16
|
export { integrationAccountOutputSchema } from "./account"
|
|
17
17
|
export {
|
|
18
|
+
DEFAULT_GATEWAY_MODEL_ID,
|
|
18
19
|
generationInputSchema,
|
|
19
20
|
generationResultSchema,
|
|
20
21
|
runtimeContract,
|
|
@@ -22,6 +23,7 @@ export {
|
|
|
22
23
|
type GenerationResult,
|
|
23
24
|
type RuntimeGenerationInput,
|
|
24
25
|
} from "./runtime"
|
|
26
|
+
export type { GatewayModelId } from "@ai-sdk/gateway"
|
|
25
27
|
export {
|
|
26
28
|
createdOrganizationApiKeyOutputSchema,
|
|
27
29
|
organizationApiKeyOutputSchema,
|
package/src/runtime.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { encodableSchema } from "@automate.ax/codec"
|
|
2
|
+
import type { GatewayModelId } from "@ai-sdk/gateway"
|
|
2
3
|
import { oc } from "@orpc/contract"
|
|
3
4
|
import { z } from "zod"
|
|
4
5
|
|
|
6
|
+
/** Default model used by the platform Vercel AI Gateway account. */
|
|
7
|
+
export const DEFAULT_GATEWAY_MODEL_ID =
|
|
8
|
+
"openai/gpt-4.1-nano" satisfies GatewayModelId
|
|
9
|
+
|
|
5
10
|
const SIGNAL_FAILURE_SCHEMA = z.object({
|
|
6
11
|
message: z.string(),
|
|
7
12
|
name: z.string(),
|
|
@@ -47,12 +52,19 @@ const GENERATION_USAGE_SCHEMA = z.object({
|
|
|
47
52
|
totalTokens: z.number().optional(),
|
|
48
53
|
})
|
|
49
54
|
|
|
55
|
+
const GATEWAY_MODEL_ID_SCHEMA = z
|
|
56
|
+
.custom<GatewayModelId>(
|
|
57
|
+
(value) => typeof value === "string" && value.length > 0,
|
|
58
|
+
"Model must be a nonempty AI Gateway model ID.",
|
|
59
|
+
)
|
|
60
|
+
.default(DEFAULT_GATEWAY_MODEL_ID)
|
|
61
|
+
|
|
50
62
|
const GENERATION_OPTIONS_SCHEMA = z.object({
|
|
51
63
|
frequencyPenalty: z.number().optional(),
|
|
52
64
|
instructions: z.string().optional(),
|
|
53
65
|
maxOutputTokens: z.number().int().positive().optional(),
|
|
54
66
|
maxRetries: z.number().int().nonnegative().optional(),
|
|
55
|
-
model:
|
|
67
|
+
model: GATEWAY_MODEL_ID_SCHEMA,
|
|
56
68
|
presencePenalty: z.number().optional(),
|
|
57
69
|
providerOptions: z
|
|
58
70
|
.record(z.string(), z.record(z.string(), z.json()))
|