@otto-code/protocol 0.5.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/README.md +12 -0
- package/dist/agent-attention-notification.d.ts +41 -0
- package/dist/agent-attention-notification.js +140 -0
- package/dist/agent-labels.d.ts +7 -0
- package/dist/agent-labels.js +11 -0
- package/dist/agent-lifecycle.d.ts +3 -0
- package/dist/agent-lifecycle.js +8 -0
- package/dist/agent-personalities.d.ts +32 -0
- package/dist/agent-personalities.js +69 -0
- package/dist/agent-state-bucket.d.ts +14 -0
- package/dist/agent-state-bucket.js +41 -0
- package/dist/agent-title-limits.d.ts +2 -0
- package/dist/agent-title-limits.js +2 -0
- package/dist/agent-types.d.ts +479 -0
- package/dist/agent-types.js +22 -0
- package/dist/artifacts/rpc-schemas.d.ts +396 -0
- package/dist/artifacts/rpc-schemas.js +175 -0
- package/dist/artifacts/types.d.ts +166 -0
- package/dist/artifacts/types.js +73 -0
- package/dist/binary-frames/demux.d.ts +11 -0
- package/dist/binary-frames/demux.js +23 -0
- package/dist/binary-frames/file-transfer.d.ts +50 -0
- package/dist/binary-frames/file-transfer.js +107 -0
- package/dist/binary-frames/index.d.ts +4 -0
- package/dist/binary-frames/index.js +4 -0
- package/dist/binary-frames/terminal.d.ts +31 -0
- package/dist/binary-frames/terminal.js +99 -0
- package/dist/branch-slug.d.ts +14 -0
- package/dist/branch-slug.js +49 -0
- package/dist/browser-automation/capabilities.d.ts +7 -0
- package/dist/browser-automation/capabilities.js +31 -0
- package/dist/browser-automation/rpc-schemas.d.ts +1329 -0
- package/dist/browser-automation/rpc-schemas.js +555 -0
- package/dist/chat/rpc-schemas.d.ts +158 -0
- package/dist/chat/rpc-schemas.js +103 -0
- package/dist/chat/types.d.ts +30 -0
- package/dist/chat/types.js +22 -0
- package/dist/client-capabilities.d.ts +8 -0
- package/dist/client-capabilities.js +16 -0
- package/dist/connection-offer.d.ts +36 -0
- package/dist/connection-offer.js +53 -0
- package/dist/daemon-endpoints.d.ts +47 -0
- package/dist/daemon-endpoints.js +201 -0
- package/dist/default-personalities.d.ts +3 -0
- package/dist/default-personalities.js +127 -0
- package/dist/effort.d.ts +32 -0
- package/dist/effort.js +99 -0
- package/dist/error-utils.d.ts +11 -0
- package/dist/error-utils.js +27 -0
- package/dist/generated/validation/ws-outbound.aot.d.ts +2 -0
- package/dist/generated/validation/ws-outbound.aot.js +48755 -0
- package/dist/git-hosting.d.ts +21 -0
- package/dist/git-hosting.js +36 -0
- package/dist/git-remote.d.ts +18 -0
- package/dist/git-remote.js +84 -0
- package/dist/host-connection-schema.d.ts +11 -0
- package/dist/host-connection-schema.js +9 -0
- package/dist/literal-union.d.ts +2 -0
- package/dist/literal-union.js +2 -0
- package/dist/loop/rpc-schemas.d.ts +636 -0
- package/dist/loop/rpc-schemas.js +163 -0
- package/dist/messages.d.ts +38505 -0
- package/dist/messages.js +4719 -0
- package/dist/otto-config-schema.d.ts +136 -0
- package/dist/otto-config-schema.js +96 -0
- package/dist/path-utils.d.ts +2 -0
- package/dist/path-utils.js +16 -0
- package/dist/provider-config.d.ts +266 -0
- package/dist/provider-config.js +238 -0
- package/dist/provider-icon-names.d.ts +5 -0
- package/dist/provider-icon-names.js +52 -0
- package/dist/provider-manifest.d.ts +34 -0
- package/dist/provider-manifest.js +227 -0
- package/dist/schedule/cron-expression.d.ts +13 -0
- package/dist/schedule/cron-expression.js +97 -0
- package/dist/schedule/rpc-schemas.d.ts +667 -0
- package/dist/schedule/rpc-schemas.js +155 -0
- package/dist/schedule/types.d.ts +236 -0
- package/dist/schedule/types.js +84 -0
- package/dist/terminal-activity.d.ts +21 -0
- package/dist/terminal-activity.js +25 -0
- package/dist/terminal-input-mode.d.ts +26 -0
- package/dist/terminal-input-mode.js +151 -0
- package/dist/terminal-key-input.d.ts +13 -0
- package/dist/terminal-key-input.js +201 -0
- package/dist/terminal-profiles.d.ts +6 -0
- package/dist/terminal-profiles.js +28 -0
- package/dist/terminal-snapshot.d.ts +3 -0
- package/dist/terminal-snapshot.js +178 -0
- package/dist/terminal-stream-protocol.d.ts +2 -0
- package/dist/terminal-stream-protocol.js +2 -0
- package/dist/terminal-subscription-key.d.ts +2 -0
- package/dist/terminal-subscription-key.js +9 -0
- package/dist/tool-call-display.d.ts +11 -0
- package/dist/tool-call-display.js +135 -0
- package/dist/tool-name-normalization.d.ts +9 -0
- package/dist/tool-name-normalization.js +82 -0
- package/dist/validation/ws-outbound-schema-metadata.d.ts +7256 -0
- package/dist/validation/ws-outbound-schema-metadata.js +3 -0
- package/dist/validation/ws-outbound.d.ts +12 -0
- package/dist/validation/ws-outbound.js +8 -0
- package/package.json +42 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ScheduleCadenceSchema, ScheduleRunSchema, ScheduleSummarySchema, StoredScheduleSchema, ScheduleTargetSchema, } from "./types.js";
|
|
3
|
+
const ScheduleCreateNewAgentConfigSchema = ScheduleTargetSchema.options[1].shape.config;
|
|
4
|
+
const ScheduleCreateTargetSchema = z.discriminatedUnion("type", [
|
|
5
|
+
z.object({
|
|
6
|
+
type: z.literal("self"),
|
|
7
|
+
agentId: z.guid(),
|
|
8
|
+
}),
|
|
9
|
+
z.object({
|
|
10
|
+
type: z.literal("agent"),
|
|
11
|
+
agentId: z.guid(),
|
|
12
|
+
}),
|
|
13
|
+
z.object({
|
|
14
|
+
type: z.literal("new-agent"),
|
|
15
|
+
config: ScheduleCreateNewAgentConfigSchema,
|
|
16
|
+
}),
|
|
17
|
+
]);
|
|
18
|
+
export const ScheduleCreateRequestSchema = z.object({
|
|
19
|
+
type: z.literal("schedule/create"),
|
|
20
|
+
requestId: z.string(),
|
|
21
|
+
prompt: z.string().min(1),
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
cadence: ScheduleCadenceSchema,
|
|
24
|
+
target: ScheduleCreateTargetSchema,
|
|
25
|
+
maxRuns: z.number().int().positive().optional(),
|
|
26
|
+
expiresAt: z.string().optional(),
|
|
27
|
+
runOnCreate: z.boolean().optional(),
|
|
28
|
+
});
|
|
29
|
+
export const ScheduleListRequestSchema = z.object({
|
|
30
|
+
type: z.literal("schedule/list"),
|
|
31
|
+
requestId: z.string(),
|
|
32
|
+
});
|
|
33
|
+
export const ScheduleInspectRequestSchema = z.object({
|
|
34
|
+
type: z.literal("schedule/inspect"),
|
|
35
|
+
requestId: z.string(),
|
|
36
|
+
scheduleId: z.string(),
|
|
37
|
+
});
|
|
38
|
+
export const ScheduleLogsRequestSchema = z.object({
|
|
39
|
+
type: z.literal("schedule/logs"),
|
|
40
|
+
requestId: z.string(),
|
|
41
|
+
scheduleId: z.string(),
|
|
42
|
+
});
|
|
43
|
+
export const SchedulePauseRequestSchema = z.object({
|
|
44
|
+
type: z.literal("schedule/pause"),
|
|
45
|
+
requestId: z.string(),
|
|
46
|
+
scheduleId: z.string(),
|
|
47
|
+
});
|
|
48
|
+
export const ScheduleResumeRequestSchema = z.object({
|
|
49
|
+
type: z.literal("schedule/resume"),
|
|
50
|
+
requestId: z.string(),
|
|
51
|
+
scheduleId: z.string(),
|
|
52
|
+
});
|
|
53
|
+
export const ScheduleDeleteRequestSchema = z.object({
|
|
54
|
+
type: z.literal("schedule/delete"),
|
|
55
|
+
requestId: z.string(),
|
|
56
|
+
scheduleId: z.string(),
|
|
57
|
+
});
|
|
58
|
+
export const ScheduleRunOnceRequestSchema = z.object({
|
|
59
|
+
type: z.literal("schedule/run-once"),
|
|
60
|
+
requestId: z.string(),
|
|
61
|
+
scheduleId: z.string(),
|
|
62
|
+
});
|
|
63
|
+
const ScheduleUpdateNewAgentConfigSchema = z.object({
|
|
64
|
+
provider: z.string().trim().min(1).optional(),
|
|
65
|
+
model: z.string().trim().min(1).nullable().optional(),
|
|
66
|
+
modeId: z.string().trim().min(1).nullable().optional(),
|
|
67
|
+
thinkingOptionId: z.string().trim().min(1).nullable().optional(),
|
|
68
|
+
archiveOnFinish: z.boolean().optional(),
|
|
69
|
+
isolation: z.enum(["local", "worktree"]).optional(),
|
|
70
|
+
cwd: z.string().trim().min(1).optional(),
|
|
71
|
+
});
|
|
72
|
+
export const ScheduleUpdateRequestSchema = z.object({
|
|
73
|
+
type: z.literal("schedule/update"),
|
|
74
|
+
requestId: z.string(),
|
|
75
|
+
scheduleId: z.string(),
|
|
76
|
+
name: z.string().nullable().optional(),
|
|
77
|
+
prompt: z.string().min(1).optional(),
|
|
78
|
+
cadence: ScheduleCadenceSchema.optional(),
|
|
79
|
+
newAgentConfig: ScheduleUpdateNewAgentConfigSchema.optional(),
|
|
80
|
+
maxRuns: z.number().int().positive().nullable().optional(),
|
|
81
|
+
expiresAt: z.string().nullable().optional(),
|
|
82
|
+
});
|
|
83
|
+
export const ScheduleCreateResponseSchema = z.object({
|
|
84
|
+
type: z.literal("schedule/create/response"),
|
|
85
|
+
payload: z.object({
|
|
86
|
+
requestId: z.string(),
|
|
87
|
+
schedule: ScheduleSummarySchema.nullable(),
|
|
88
|
+
error: z.string().nullable(),
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
export const ScheduleListResponseSchema = z.object({
|
|
92
|
+
type: z.literal("schedule/list/response"),
|
|
93
|
+
payload: z.object({
|
|
94
|
+
requestId: z.string(),
|
|
95
|
+
schedules: z.array(ScheduleSummarySchema),
|
|
96
|
+
error: z.string().nullable(),
|
|
97
|
+
}),
|
|
98
|
+
});
|
|
99
|
+
export const ScheduleInspectResponseSchema = z.object({
|
|
100
|
+
type: z.literal("schedule/inspect/response"),
|
|
101
|
+
payload: z.object({
|
|
102
|
+
requestId: z.string(),
|
|
103
|
+
schedule: StoredScheduleSchema.nullable(),
|
|
104
|
+
error: z.string().nullable(),
|
|
105
|
+
}),
|
|
106
|
+
});
|
|
107
|
+
export const ScheduleLogsResponseSchema = z.object({
|
|
108
|
+
type: z.literal("schedule/logs/response"),
|
|
109
|
+
payload: z.object({
|
|
110
|
+
requestId: z.string(),
|
|
111
|
+
runs: z.array(ScheduleRunSchema),
|
|
112
|
+
error: z.string().nullable(),
|
|
113
|
+
}),
|
|
114
|
+
});
|
|
115
|
+
export const SchedulePauseResponseSchema = z.object({
|
|
116
|
+
type: z.literal("schedule/pause/response"),
|
|
117
|
+
payload: z.object({
|
|
118
|
+
requestId: z.string(),
|
|
119
|
+
schedule: ScheduleSummarySchema.nullable(),
|
|
120
|
+
error: z.string().nullable(),
|
|
121
|
+
}),
|
|
122
|
+
});
|
|
123
|
+
export const ScheduleResumeResponseSchema = z.object({
|
|
124
|
+
type: z.literal("schedule/resume/response"),
|
|
125
|
+
payload: z.object({
|
|
126
|
+
requestId: z.string(),
|
|
127
|
+
schedule: ScheduleSummarySchema.nullable(),
|
|
128
|
+
error: z.string().nullable(),
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
131
|
+
export const ScheduleDeleteResponseSchema = z.object({
|
|
132
|
+
type: z.literal("schedule/delete/response"),
|
|
133
|
+
payload: z.object({
|
|
134
|
+
requestId: z.string(),
|
|
135
|
+
scheduleId: z.string(),
|
|
136
|
+
error: z.string().nullable(),
|
|
137
|
+
}),
|
|
138
|
+
});
|
|
139
|
+
export const ScheduleRunOnceResponseSchema = z.object({
|
|
140
|
+
type: z.literal("schedule/run-once/response"),
|
|
141
|
+
payload: z.object({
|
|
142
|
+
requestId: z.string(),
|
|
143
|
+
schedule: StoredScheduleSchema.nullable(),
|
|
144
|
+
error: z.string().nullable(),
|
|
145
|
+
}),
|
|
146
|
+
});
|
|
147
|
+
export const ScheduleUpdateResponseSchema = z.object({
|
|
148
|
+
type: z.literal("schedule/update/response"),
|
|
149
|
+
payload: z.object({
|
|
150
|
+
requestId: z.string(),
|
|
151
|
+
schedule: StoredScheduleSchema.nullable(),
|
|
152
|
+
error: z.string().nullable(),
|
|
153
|
+
}),
|
|
154
|
+
});
|
|
155
|
+
//# sourceMappingURL=rpc-schemas.js.map
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ScheduleStatusSchema: z.ZodEnum<{
|
|
3
|
+
completed: "completed";
|
|
4
|
+
active: "active";
|
|
5
|
+
paused: "paused";
|
|
6
|
+
}>;
|
|
7
|
+
export type ScheduleStatus = z.infer<typeof ScheduleStatusSchema>;
|
|
8
|
+
export declare const ScheduleCadenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"every">;
|
|
10
|
+
everyMs: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
type: z.ZodLiteral<"cron">;
|
|
13
|
+
expression: z.ZodString;
|
|
14
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>], "type">;
|
|
16
|
+
export type ScheduleCadence = z.infer<typeof ScheduleCadenceSchema>;
|
|
17
|
+
export declare const ScheduleTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"agent">;
|
|
19
|
+
agentId: z.ZodGUID;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"new-agent">;
|
|
22
|
+
config: z.ZodObject<{
|
|
23
|
+
provider: z.ZodString;
|
|
24
|
+
cwd: z.ZodString;
|
|
25
|
+
personality: z.ZodOptional<z.ZodString>;
|
|
26
|
+
modeId: z.ZodOptional<z.ZodString>;
|
|
27
|
+
model: z.ZodOptional<z.ZodString>;
|
|
28
|
+
thinkingOptionId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
archiveOnFinish: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
isolation: z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
worktree: "worktree";
|
|
32
|
+
local: "local";
|
|
33
|
+
}>>;
|
|
34
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
approvalPolicy: z.ZodOptional<z.ZodString>;
|
|
36
|
+
sandboxMode: z.ZodOptional<z.ZodString>;
|
|
37
|
+
networkAccess: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
webSearch: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
featureValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
40
|
+
extra: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
codex: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
42
|
+
claude: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
45
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
}, z.core.$strip>], "type">;
|
|
48
|
+
export type ScheduleTarget = z.infer<typeof ScheduleTargetSchema>;
|
|
49
|
+
export declare const ScheduleRunSchema: z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
scheduledFor: z.ZodString;
|
|
52
|
+
startedAt: z.ZodString;
|
|
53
|
+
endedAt: z.ZodNullable<z.ZodString>;
|
|
54
|
+
status: z.ZodEnum<{
|
|
55
|
+
running: "running";
|
|
56
|
+
succeeded: "succeeded";
|
|
57
|
+
failed: "failed";
|
|
58
|
+
}>;
|
|
59
|
+
agentId: z.ZodNullable<z.ZodGUID>;
|
|
60
|
+
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
output: z.ZodNullable<z.ZodString>;
|
|
62
|
+
error: z.ZodNullable<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export type ScheduleRun = z.infer<typeof ScheduleRunSchema>;
|
|
65
|
+
export declare const StoredScheduleSchema: z.ZodObject<{
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
name: z.ZodNullable<z.ZodString>;
|
|
68
|
+
prompt: z.ZodString;
|
|
69
|
+
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"every">;
|
|
71
|
+
everyMs: z.ZodNumber;
|
|
72
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
73
|
+
type: z.ZodLiteral<"cron">;
|
|
74
|
+
expression: z.ZodString;
|
|
75
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>], "type">;
|
|
77
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
78
|
+
type: z.ZodLiteral<"agent">;
|
|
79
|
+
agentId: z.ZodGUID;
|
|
80
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"new-agent">;
|
|
82
|
+
config: z.ZodObject<{
|
|
83
|
+
provider: z.ZodString;
|
|
84
|
+
cwd: z.ZodString;
|
|
85
|
+
personality: z.ZodOptional<z.ZodString>;
|
|
86
|
+
modeId: z.ZodOptional<z.ZodString>;
|
|
87
|
+
model: z.ZodOptional<z.ZodString>;
|
|
88
|
+
thinkingOptionId: z.ZodOptional<z.ZodString>;
|
|
89
|
+
archiveOnFinish: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
isolation: z.ZodOptional<z.ZodEnum<{
|
|
91
|
+
worktree: "worktree";
|
|
92
|
+
local: "local";
|
|
93
|
+
}>>;
|
|
94
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
95
|
+
approvalPolicy: z.ZodOptional<z.ZodString>;
|
|
96
|
+
sandboxMode: z.ZodOptional<z.ZodString>;
|
|
97
|
+
networkAccess: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
webSearch: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
+
featureValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
100
|
+
extra: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
codex: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
102
|
+
claude: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
105
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
}, z.core.$strip>], "type">;
|
|
108
|
+
status: z.ZodEnum<{
|
|
109
|
+
completed: "completed";
|
|
110
|
+
active: "active";
|
|
111
|
+
paused: "paused";
|
|
112
|
+
}>;
|
|
113
|
+
createdAt: z.ZodString;
|
|
114
|
+
updatedAt: z.ZodString;
|
|
115
|
+
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
116
|
+
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
117
|
+
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
118
|
+
succeeded: "succeeded";
|
|
119
|
+
failed: "failed";
|
|
120
|
+
}>>>;
|
|
121
|
+
lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
122
|
+
pausedAt: z.ZodNullable<z.ZodString>;
|
|
123
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
124
|
+
maxRuns: z.ZodNullable<z.ZodNumber>;
|
|
125
|
+
runs: z.ZodArray<z.ZodObject<{
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
scheduledFor: z.ZodString;
|
|
128
|
+
startedAt: z.ZodString;
|
|
129
|
+
endedAt: z.ZodNullable<z.ZodString>;
|
|
130
|
+
status: z.ZodEnum<{
|
|
131
|
+
running: "running";
|
|
132
|
+
succeeded: "succeeded";
|
|
133
|
+
failed: "failed";
|
|
134
|
+
}>;
|
|
135
|
+
agentId: z.ZodNullable<z.ZodGUID>;
|
|
136
|
+
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
137
|
+
output: z.ZodNullable<z.ZodString>;
|
|
138
|
+
error: z.ZodNullable<z.ZodString>;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
export type StoredSchedule = z.infer<typeof StoredScheduleSchema>;
|
|
142
|
+
export declare const ScheduleSummarySchema: z.ZodObject<{
|
|
143
|
+
name: z.ZodNullable<z.ZodString>;
|
|
144
|
+
status: z.ZodEnum<{
|
|
145
|
+
completed: "completed";
|
|
146
|
+
active: "active";
|
|
147
|
+
paused: "paused";
|
|
148
|
+
}>;
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
createdAt: z.ZodString;
|
|
151
|
+
updatedAt: z.ZodString;
|
|
152
|
+
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
153
|
+
type: z.ZodLiteral<"every">;
|
|
154
|
+
everyMs: z.ZodNumber;
|
|
155
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
156
|
+
type: z.ZodLiteral<"cron">;
|
|
157
|
+
expression: z.ZodString;
|
|
158
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strip>], "type">;
|
|
160
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
161
|
+
type: z.ZodLiteral<"agent">;
|
|
162
|
+
agentId: z.ZodGUID;
|
|
163
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
164
|
+
type: z.ZodLiteral<"new-agent">;
|
|
165
|
+
config: z.ZodObject<{
|
|
166
|
+
provider: z.ZodString;
|
|
167
|
+
cwd: z.ZodString;
|
|
168
|
+
personality: z.ZodOptional<z.ZodString>;
|
|
169
|
+
modeId: z.ZodOptional<z.ZodString>;
|
|
170
|
+
model: z.ZodOptional<z.ZodString>;
|
|
171
|
+
thinkingOptionId: z.ZodOptional<z.ZodString>;
|
|
172
|
+
archiveOnFinish: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
isolation: z.ZodOptional<z.ZodEnum<{
|
|
174
|
+
worktree: "worktree";
|
|
175
|
+
local: "local";
|
|
176
|
+
}>>;
|
|
177
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
178
|
+
approvalPolicy: z.ZodOptional<z.ZodString>;
|
|
179
|
+
sandboxMode: z.ZodOptional<z.ZodString>;
|
|
180
|
+
networkAccess: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
+
webSearch: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
featureValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
183
|
+
extra: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
codex: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
185
|
+
claude: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
188
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
}, z.core.$strip>], "type">;
|
|
191
|
+
prompt: z.ZodString;
|
|
192
|
+
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
193
|
+
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
194
|
+
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
195
|
+
succeeded: "succeeded";
|
|
196
|
+
failed: "failed";
|
|
197
|
+
}>>>;
|
|
198
|
+
lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
199
|
+
pausedAt: z.ZodNullable<z.ZodString>;
|
|
200
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
201
|
+
maxRuns: z.ZodNullable<z.ZodNumber>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export type ScheduleSummary = z.infer<typeof ScheduleSummarySchema>;
|
|
204
|
+
export interface CreateScheduleInput {
|
|
205
|
+
name?: string | null;
|
|
206
|
+
prompt: string;
|
|
207
|
+
cadence: ScheduleCadence;
|
|
208
|
+
target: ScheduleTarget;
|
|
209
|
+
maxRuns?: number | null;
|
|
210
|
+
expiresAt?: string | null;
|
|
211
|
+
runOnCreate?: boolean | null;
|
|
212
|
+
}
|
|
213
|
+
export interface UpdateScheduleNewAgentConfig {
|
|
214
|
+
provider?: string;
|
|
215
|
+
personality?: string | null;
|
|
216
|
+
model?: string | null;
|
|
217
|
+
modeId?: string | null;
|
|
218
|
+
thinkingOptionId?: string | null;
|
|
219
|
+
archiveOnFinish?: boolean;
|
|
220
|
+
isolation?: "local" | "worktree";
|
|
221
|
+
cwd?: string;
|
|
222
|
+
}
|
|
223
|
+
export interface UpdateScheduleInput {
|
|
224
|
+
id: string;
|
|
225
|
+
name?: string | null;
|
|
226
|
+
prompt?: string;
|
|
227
|
+
cadence?: ScheduleCadence;
|
|
228
|
+
newAgentConfig?: UpdateScheduleNewAgentConfig;
|
|
229
|
+
maxRuns?: number | null;
|
|
230
|
+
expiresAt?: string | null;
|
|
231
|
+
}
|
|
232
|
+
export interface ScheduleExecutionResult {
|
|
233
|
+
agentId: string | null;
|
|
234
|
+
output: string | null;
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AgentProviderSchema } from "../provider-manifest.js";
|
|
3
|
+
export const ScheduleStatusSchema = z.enum(["active", "paused", "completed"]);
|
|
4
|
+
export const ScheduleCadenceSchema = z.discriminatedUnion("type", [
|
|
5
|
+
z.object({
|
|
6
|
+
type: z.literal("every"),
|
|
7
|
+
everyMs: z.number().int().positive(),
|
|
8
|
+
}),
|
|
9
|
+
z.object({
|
|
10
|
+
type: z.literal("cron"),
|
|
11
|
+
expression: z.string().trim().min(1),
|
|
12
|
+
timezone: z.string().trim().min(1).optional(),
|
|
13
|
+
}),
|
|
14
|
+
]);
|
|
15
|
+
export const ScheduleTargetSchema = z.discriminatedUnion("type", [
|
|
16
|
+
z.object({
|
|
17
|
+
type: z.literal("agent"),
|
|
18
|
+
agentId: z.guid(),
|
|
19
|
+
}),
|
|
20
|
+
z.object({
|
|
21
|
+
type: z.literal("new-agent"),
|
|
22
|
+
config: z.object({
|
|
23
|
+
provider: AgentProviderSchema,
|
|
24
|
+
cwd: z.string().trim().min(1),
|
|
25
|
+
// Optional Agent Personality binding (by name). When set, each run
|
|
26
|
+
// re-resolves the personality against the run cwd and hard-fails if it is
|
|
27
|
+
// unavailable — so schedule runs pick up personality edits between runs.
|
|
28
|
+
personality: z.string().trim().min(1).optional(),
|
|
29
|
+
modeId: z.string().trim().min(1).optional(),
|
|
30
|
+
model: z.string().trim().min(1).optional(),
|
|
31
|
+
thinkingOptionId: z.string().trim().min(1).optional(),
|
|
32
|
+
archiveOnFinish: z.boolean().optional(),
|
|
33
|
+
isolation: z.enum(["local", "worktree"]).optional(),
|
|
34
|
+
title: z.string().trim().min(1).nullable().optional(),
|
|
35
|
+
approvalPolicy: z.string().trim().min(1).optional(),
|
|
36
|
+
sandboxMode: z.string().trim().min(1).optional(),
|
|
37
|
+
networkAccess: z.boolean().optional(),
|
|
38
|
+
webSearch: z.boolean().optional(),
|
|
39
|
+
featureValues: z.record(z.string(), z.unknown()).optional(),
|
|
40
|
+
extra: z
|
|
41
|
+
.object({
|
|
42
|
+
codex: z.record(z.string(), z.unknown()).optional(),
|
|
43
|
+
claude: z.record(z.string(), z.unknown()).optional(),
|
|
44
|
+
})
|
|
45
|
+
.partial()
|
|
46
|
+
.optional(),
|
|
47
|
+
systemPrompt: z.string().optional(),
|
|
48
|
+
mcpServers: z.record(z.string(), z.unknown()).optional(),
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
]);
|
|
52
|
+
export const ScheduleRunSchema = z.object({
|
|
53
|
+
id: z.string(),
|
|
54
|
+
scheduledFor: z.string(),
|
|
55
|
+
startedAt: z.string(),
|
|
56
|
+
endedAt: z.string().nullable(),
|
|
57
|
+
status: z.enum(["running", "succeeded", "failed"]),
|
|
58
|
+
agentId: z.guid().nullable(),
|
|
59
|
+
workspaceId: z.string().nullable().optional(),
|
|
60
|
+
output: z.string().nullable(),
|
|
61
|
+
error: z.string().nullable(),
|
|
62
|
+
});
|
|
63
|
+
export const StoredScheduleSchema = z.object({
|
|
64
|
+
id: z.string(),
|
|
65
|
+
name: z.string().nullable(),
|
|
66
|
+
prompt: z.string().min(1),
|
|
67
|
+
cadence: ScheduleCadenceSchema,
|
|
68
|
+
target: ScheduleTargetSchema,
|
|
69
|
+
status: ScheduleStatusSchema,
|
|
70
|
+
createdAt: z.string(),
|
|
71
|
+
updatedAt: z.string(),
|
|
72
|
+
nextRunAt: z.string().nullable(),
|
|
73
|
+
lastRunAt: z.string().nullable(),
|
|
74
|
+
lastRunStatus: z.enum(["succeeded", "failed"]).nullable().optional(),
|
|
75
|
+
lastRunError: z.string().nullable().optional(),
|
|
76
|
+
pausedAt: z.string().nullable(),
|
|
77
|
+
expiresAt: z.string().nullable(),
|
|
78
|
+
maxRuns: z.number().int().positive().nullable(),
|
|
79
|
+
runs: z.array(ScheduleRunSchema),
|
|
80
|
+
});
|
|
81
|
+
export const ScheduleSummarySchema = StoredScheduleSchema.omit({
|
|
82
|
+
runs: true,
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TERMINAL_ACTIVITY_STATES: readonly ["idle", "working", "attention"];
|
|
3
|
+
export declare const TERMINAL_ACTIVITY_ATTENTION_REASONS: readonly ["finished", "needs_input"];
|
|
4
|
+
export type TerminalActivityState = (typeof TERMINAL_ACTIVITY_STATES)[number];
|
|
5
|
+
export type TerminalActivityAttentionReason = (typeof TERMINAL_ACTIVITY_ATTENTION_REASONS)[number];
|
|
6
|
+
export declare const TerminalActivitySchema: z.ZodObject<{
|
|
7
|
+
state: z.ZodCatch<z.ZodEnum<{
|
|
8
|
+
idle: "idle";
|
|
9
|
+
working: "working";
|
|
10
|
+
attention: "attention";
|
|
11
|
+
}>>;
|
|
12
|
+
attentionReason: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
13
|
+
finished: "finished";
|
|
14
|
+
needs_input: "needs_input";
|
|
15
|
+
}>>>>;
|
|
16
|
+
changedAt: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type TerminalActivity = z.infer<typeof TerminalActivitySchema>;
|
|
19
|
+
export type TerminalActivityStatusBucket = "running" | "needs_input" | "attention";
|
|
20
|
+
export declare function deriveTerminalActivityStatusBucket(activity: TerminalActivity | null | undefined): TerminalActivityStatusBucket | null;
|
|
21
|
+
//# sourceMappingURL=terminal-activity.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const TERMINAL_ACTIVITY_STATES = ["idle", "working", "attention"];
|
|
3
|
+
export const TERMINAL_ACTIVITY_ATTENTION_REASONS = ["finished", "needs_input"];
|
|
4
|
+
export const TerminalActivitySchema = z.object({
|
|
5
|
+
// Forward-compat: a newer daemon may send a state this client doesn't know.
|
|
6
|
+
// Degrade unknown states to "idle" (no indicator, no notification) so the
|
|
7
|
+
// message still parses, instead of a strict enum rejecting the whole payload.
|
|
8
|
+
state: z.enum(TERMINAL_ACTIVITY_STATES).catch("idle"),
|
|
9
|
+
attentionReason: z.enum(TERMINAL_ACTIVITY_ATTENTION_REASONS).nullable().optional().catch(null),
|
|
10
|
+
changedAt: z.number(),
|
|
11
|
+
});
|
|
12
|
+
export function deriveTerminalActivityStatusBucket(activity) {
|
|
13
|
+
if (!activity)
|
|
14
|
+
return null;
|
|
15
|
+
if (activity.attentionReason === "needs_input")
|
|
16
|
+
return "needs_input";
|
|
17
|
+
if (activity.attentionReason === "finished")
|
|
18
|
+
return "attention";
|
|
19
|
+
if (activity.state === "working")
|
|
20
|
+
return "running";
|
|
21
|
+
if (activity.state === "attention")
|
|
22
|
+
return "needs_input";
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=terminal-activity.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface TerminalInputModeFeedResult {
|
|
2
|
+
changed: boolean;
|
|
3
|
+
responses: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface TerminalInputModeState {
|
|
6
|
+
kittyKeyboardFlags: number;
|
|
7
|
+
win32InputMode: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEFAULT_TERMINAL_INPUT_MODE_STATE: TerminalInputModeState;
|
|
10
|
+
export declare function terminalInputModeSupportsModifiedEnter(state: TerminalInputModeState): boolean;
|
|
11
|
+
export declare function terminalInputModeStatesEqual(left: TerminalInputModeState, right: TerminalInputModeState): boolean;
|
|
12
|
+
export declare class TerminalInputModeTracker {
|
|
13
|
+
private kittyKeyboardFlags;
|
|
14
|
+
private win32InputMode;
|
|
15
|
+
private readonly kittyKeyboardStack;
|
|
16
|
+
private pending;
|
|
17
|
+
feed(data: string): TerminalInputModeFeedResult;
|
|
18
|
+
reset(): void;
|
|
19
|
+
getState(): TerminalInputModeState;
|
|
20
|
+
getKittyKeyboardFlags(): number;
|
|
21
|
+
supportsModifiedEnter(): boolean;
|
|
22
|
+
getPreamble(): string;
|
|
23
|
+
private applyKittyKeyboardSequence;
|
|
24
|
+
private applyPrivateModeSequence;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=terminal-input-mode.d.ts.map
|