codex-relay 1.3.2 → 1.4.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/README.md +14 -4
- package/dist/api-schema.js +2 -2
- package/dist/api-schema2.js +76 -1
- package/dist/cli.js +1 -1
- package/dist/paths.js +78 -0
- package/dist/src.js +519 -134
- package/package.json +1 -1
- package/src/api-schema.ts +81 -0
package/package.json
CHANGED
package/src/api-schema.ts
CHANGED
|
@@ -95,6 +95,27 @@ export const RuntimePreferencesResponseSchema = z.object({
|
|
|
95
95
|
workspacePath: z.string().trim().min(1).optional(),
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
+
export const PushNotificationIntentSchema = z.enum(["turn_terminal", "action_required"]);
|
|
99
|
+
|
|
100
|
+
export const PushNotificationPreferencesSchema = z.object({
|
|
101
|
+
actionRequired: z.boolean(),
|
|
102
|
+
turnTerminal: z.boolean(),
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export const RegisterPushNotificationRequestSchema = z.object({
|
|
106
|
+
expoPushToken: z
|
|
107
|
+
.string()
|
|
108
|
+
.trim()
|
|
109
|
+
.regex(/^(?:Expo|Exponent)PushToken\[[^\]\r\n]{1,512}\]$/),
|
|
110
|
+
platform: z.enum(["android", "ios"]),
|
|
111
|
+
preferences: PushNotificationPreferencesSchema,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export const PushNotificationSettingsResponseSchema = z.object({
|
|
115
|
+
preferences: PushNotificationPreferencesSchema,
|
|
116
|
+
registered: z.boolean(),
|
|
117
|
+
});
|
|
118
|
+
|
|
98
119
|
export const CodexModelSchema = z.object({
|
|
99
120
|
id: z.string().min(1),
|
|
100
121
|
model: z.string().min(1),
|
|
@@ -753,6 +774,12 @@ export type RuntimePreferencesByWorkspacePath = z.infer<
|
|
|
753
774
|
typeof RuntimePreferencesByWorkspacePathSchema
|
|
754
775
|
>;
|
|
755
776
|
export type RuntimePreferencesResponse = z.infer<typeof RuntimePreferencesResponseSchema>;
|
|
777
|
+
export type PushNotificationIntent = z.infer<typeof PushNotificationIntentSchema>;
|
|
778
|
+
export type PushNotificationPreferences = z.infer<typeof PushNotificationPreferencesSchema>;
|
|
779
|
+
export type RegisterPushNotificationRequest = z.infer<typeof RegisterPushNotificationRequestSchema>;
|
|
780
|
+
export type PushNotificationSettingsResponse = z.infer<
|
|
781
|
+
typeof PushNotificationSettingsResponseSchema
|
|
782
|
+
>;
|
|
756
783
|
export type ContextWindowUsage = z.infer<typeof ContextWindowUsageSchema>;
|
|
757
784
|
export type RateLimitBucket = z.infer<typeof RateLimitBucketSchema>;
|
|
758
785
|
export type RateLimitWindow = z.infer<typeof RateLimitWindowSchema>;
|
|
@@ -1033,6 +1060,7 @@ export const apiPaths = {
|
|
|
1033
1060
|
sessionRefresh: "/v1/session/refresh",
|
|
1034
1061
|
status: "/v1/status",
|
|
1035
1062
|
preferences: "/v1/preferences",
|
|
1063
|
+
pushNotifications: "/v1/notifications/push",
|
|
1036
1064
|
rateLimits: "/v1/rate-limits",
|
|
1037
1065
|
models: "/v1/models",
|
|
1038
1066
|
skills: "/v1/skills",
|
|
@@ -1111,6 +1139,31 @@ export function createOpenApiDocument() {
|
|
|
1111
1139
|
},
|
|
1112
1140
|
},
|
|
1113
1141
|
},
|
|
1142
|
+
"/v1/notifications/push": {
|
|
1143
|
+
get: {
|
|
1144
|
+
summary: "Read push notification settings for this paired device",
|
|
1145
|
+
responses: {
|
|
1146
|
+
"200": jsonResponse("PushNotificationSettingsResponse"),
|
|
1147
|
+
"401": jsonResponse("ErrorResponse"),
|
|
1148
|
+
},
|
|
1149
|
+
},
|
|
1150
|
+
put: {
|
|
1151
|
+
summary: "Register push notifications for this paired device",
|
|
1152
|
+
requestBody: jsonRequest("RegisterPushNotificationRequest"),
|
|
1153
|
+
responses: {
|
|
1154
|
+
"200": jsonResponse("PushNotificationSettingsResponse"),
|
|
1155
|
+
"400": jsonResponse("ErrorResponse"),
|
|
1156
|
+
"401": jsonResponse("ErrorResponse"),
|
|
1157
|
+
},
|
|
1158
|
+
},
|
|
1159
|
+
delete: {
|
|
1160
|
+
summary: "Remove push notifications for this paired device",
|
|
1161
|
+
responses: {
|
|
1162
|
+
"200": jsonResponse("PushNotificationSettingsResponse"),
|
|
1163
|
+
"401": jsonResponse("ErrorResponse"),
|
|
1164
|
+
},
|
|
1165
|
+
},
|
|
1166
|
+
},
|
|
1114
1167
|
"/v1/threads": {
|
|
1115
1168
|
get: {
|
|
1116
1169
|
summary: "List locally known threads",
|
|
@@ -1491,6 +1544,34 @@ export function createOpenApiDocument() {
|
|
|
1491
1544
|
workspacePath: { type: "string" },
|
|
1492
1545
|
},
|
|
1493
1546
|
},
|
|
1547
|
+
PushNotificationPreferences: {
|
|
1548
|
+
type: "object",
|
|
1549
|
+
required: ["actionRequired", "turnTerminal"],
|
|
1550
|
+
properties: {
|
|
1551
|
+
actionRequired: { type: "boolean" },
|
|
1552
|
+
turnTerminal: { type: "boolean" },
|
|
1553
|
+
},
|
|
1554
|
+
},
|
|
1555
|
+
RegisterPushNotificationRequest: {
|
|
1556
|
+
type: "object",
|
|
1557
|
+
required: ["expoPushToken", "platform", "preferences"],
|
|
1558
|
+
properties: {
|
|
1559
|
+
expoPushToken: {
|
|
1560
|
+
type: "string",
|
|
1561
|
+
pattern: "^(?:Expo|Exponent)PushToken\\[[^\\]\\r\\n]{1,512}\\]$",
|
|
1562
|
+
},
|
|
1563
|
+
platform: { type: "string", enum: ["android", "ios"] },
|
|
1564
|
+
preferences: { $ref: "#/components/schemas/PushNotificationPreferences" },
|
|
1565
|
+
},
|
|
1566
|
+
},
|
|
1567
|
+
PushNotificationSettingsResponse: {
|
|
1568
|
+
type: "object",
|
|
1569
|
+
required: ["preferences", "registered"],
|
|
1570
|
+
properties: {
|
|
1571
|
+
preferences: { $ref: "#/components/schemas/PushNotificationPreferences" },
|
|
1572
|
+
registered: { type: "boolean" },
|
|
1573
|
+
},
|
|
1574
|
+
},
|
|
1494
1575
|
WorkspaceDirectoryEntry: {
|
|
1495
1576
|
type: "object",
|
|
1496
1577
|
required: ["name", "path"],
|