@getmateo/protocol 0.0.0-stage → 0.18.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/LICENSE +211 -0
- package/README.md +11 -2
- package/dist/addresses.d.ts +6 -0
- package/dist/addresses.js +2 -0
- package/dist/agent-attention-notification.d.ts +57 -0
- package/dist/agent-attention-notification.js +177 -0
- package/dist/agent-deep-link.d.ts +8 -0
- package/dist/agent-deep-link.js +49 -0
- package/dist/agent-labels.d.ts +14 -0
- package/dist/agent-labels.js +38 -0
- package/dist/agent-lifecycle.d.ts +3 -0
- package/dist/agent-lifecycle.js +8 -0
- package/dist/agent-message.d.ts +20 -0
- package/dist/agent-message.js +12 -0
- package/dist/agent-profile.d.ts +31 -0
- package/dist/agent-profile.js +32 -0
- package/dist/agent-runtime-config.d.ts +4 -0
- package/dist/agent-runtime-config.js +5 -0
- package/dist/agent-shells.d.ts +25 -0
- package/dist/agent-shells.js +17 -0
- package/dist/agent-state-bucket.d.ts +15 -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 +484 -0
- package/dist/agent-types.js +33 -0
- package/dist/binary-frames/demux.d.ts +15 -0
- package/dist/binary-frames/demux.js +28 -0
- package/dist/binary-frames/file-transfer.d.ts +51 -0
- package/dist/binary-frames/file-transfer.js +108 -0
- package/dist/binary-frames/host-route.d.ts +13 -0
- package/dist/binary-frames/host-route.js +39 -0
- package/dist/binary-frames/index.d.ts +5 -0
- package/dist/binary-frames/index.js +5 -0
- package/dist/binary-frames/terminal.d.ts +35 -0
- package/dist/binary-frames/terminal.js +100 -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 +1224 -0
- package/dist/browser-automation/rpc-schemas.js +497 -0
- package/dist/browser-download-rules.d.ts +21 -0
- package/dist/browser-download-rules.js +54 -0
- package/dist/build-metadata.d.ts +17 -0
- package/dist/build-metadata.js +61 -0
- package/dist/chat/rpc-schemas.d.ts +158 -0
- package/dist/chat/rpc-schemas.js +104 -0
- package/dist/chat/types.d.ts +30 -0
- package/dist/chat/types.js +23 -0
- package/dist/check-traits.d.ts +11 -0
- package/dist/check-traits.js +10 -0
- package/dist/chunked-transport.d.ts +42 -0
- package/dist/chunked-transport.js +277 -0
- package/dist/client-capabilities.d.ts +24 -0
- package/dist/client-capabilities.js +52 -0
- package/dist/connection-offer.d.ts +36 -0
- package/dist/connection-offer.js +53 -0
- package/dist/daemon-auth.d.ts +548 -0
- package/dist/daemon-auth.js +152 -0
- package/dist/daemon-endpoints.d.ts +54 -0
- package/dist/daemon-endpoints.js +243 -0
- package/dist/error-utils.d.ts +11 -0
- package/dist/error-utils.js +27 -0
- package/dist/fleet.d.ts +381 -0
- package/dist/fleet.js +134 -0
- package/dist/forge-manifest.d.ts +66 -0
- package/dist/forge-manifest.js +92 -0
- package/dist/generated/validation/ws-outbound-schema-metadata.d.ts +14187 -0
- package/dist/generated/validation/ws-outbound-schema-metadata.js +262 -0
- package/dist/generated/validation/ws-outbound.aot.d.ts +520 -0
- package/dist/generated/validation/ws-outbound.aot.js +106677 -0
- package/dist/git-remote.d.ts +33 -0
- package/dist/git-remote.js +94 -0
- package/dist/gitea-status.d.ts +10 -0
- package/dist/gitea-status.js +23 -0
- package/dist/gitlab-pipeline.d.ts +10 -0
- package/dist/gitlab-pipeline.js +17 -0
- package/dist/global-terminal.d.ts +3 -0
- package/dist/global-terminal.js +8 -0
- package/dist/host-connection-schema.d.ts +11 -0
- package/dist/host-connection-schema.js +9 -0
- package/dist/host-target.d.ts +20 -0
- package/dist/host-target.js +137 -0
- package/dist/hosts.d.ts +133 -0
- package/dist/hosts.js +82 -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 +164 -0
- package/dist/mateo-config-schema.d.ts +138 -0
- package/dist/mateo-config-schema.js +98 -0
- package/dist/mateo-tool-call-detail.d.ts +2 -0
- package/dist/mateo-tool-call-detail.js +3 -0
- package/dist/mateo-tool-presentation/agent-message.d.ts +10 -0
- package/dist/mateo-tool-presentation/agent-message.js +23 -0
- package/dist/mateo-tool-presentation/catalog.d.ts +321 -0
- package/dist/mateo-tool-presentation/catalog.js +319 -0
- package/dist/mateo-tool-presentation/detail-sections.d.ts +15 -0
- package/dist/mateo-tool-presentation/detail-sections.js +161 -0
- package/dist/mateo-tool-presentation/index.d.ts +22 -0
- package/dist/mateo-tool-presentation/index.js +62 -0
- package/dist/mateo-tool-presentation/summary-text.d.ts +7 -0
- package/dist/mateo-tool-presentation/summary-text.js +22 -0
- package/dist/messages.d.ts +70260 -0
- package/dist/messages.js +6740 -0
- package/dist/path-utils.d.ts +2 -0
- package/dist/path-utils.js +16 -0
- package/dist/plugin-browser-consent-copy.d.ts +193 -0
- package/dist/plugin-browser-consent-copy.js +109 -0
- package/dist/plugin-browser-grants.d.ts +48 -0
- package/dist/plugin-browser-grants.js +56 -0
- package/dist/plugin-browser.d.ts +321 -0
- package/dist/plugin-browser.js +109 -0
- package/dist/plugin-config.d.ts +18 -0
- package/dist/plugin-config.js +13 -0
- package/dist/plugin-overview.d.ts +12 -0
- package/dist/plugin-overview.js +50 -0
- package/dist/plugin-registry.d.ts +153 -0
- package/dist/plugin-registry.js +83 -0
- package/dist/plugin-requirements.d.ts +11 -0
- package/dist/plugin-requirements.js +26 -0
- package/dist/plugin-source-reference.d.ts +11 -0
- package/dist/plugin-source-reference.js +68 -0
- package/dist/provider-config.d.ts +141 -0
- package/dist/provider-config.js +113 -0
- package/dist/provider-icon-names.d.ts +5 -0
- package/dist/provider-icon-names.js +54 -0
- package/dist/provider-manifest.d.ts +30 -0
- package/dist/provider-manifest.js +247 -0
- package/dist/provider-snapshot-codec.d.ts +18 -0
- package/dist/provider-snapshot-codec.js +71 -0
- package/dist/schedule/cadence.d.ts +6 -0
- package/dist/schedule/cadence.js +28 -0
- package/dist/schedule/cron-expression.d.ts +14 -0
- package/dist/schedule/cron-expression.js +107 -0
- package/dist/schedule/rpc-schemas.d.ts +570 -0
- package/dist/schedule/rpc-schemas.js +158 -0
- package/dist/schedule/types.d.ts +201 -0
- package/dist/schedule/types.js +68 -0
- package/dist/search/text-match.d.ts +78 -0
- package/dist/search/text-match.js +330 -0
- package/dist/service-defaults.d.ts +3 -0
- package/dist/service-defaults.js +5 -0
- package/dist/ssh-transport.d.ts +11 -0
- package/dist/ssh-transport.js +72 -0
- package/dist/terminal-activity.d.ts +21 -0
- package/dist/terminal-activity.js +25 -0
- package/dist/terminal-input-mode.d.ts +30 -0
- package/dist/terminal-input-mode.js +180 -0
- package/dist/terminal-key-input.d.ts +13 -0
- package/dist/terminal-key-input.js +210 -0
- package/dist/terminal-profile.d.ts +10 -0
- package/dist/terminal-profile.js +11 -0
- package/dist/terminal-profiles.d.ts +41 -0
- package/dist/terminal-profiles.js +276 -0
- package/dist/terminal-snapshot.d.ts +4 -0
- package/dist/terminal-snapshot.js +220 -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/timeline-identity.d.ts +3 -0
- package/dist/timeline-identity.js +8 -0
- package/dist/tool-call-display.d.ts +13 -0
- package/dist/tool-call-display.js +144 -0
- package/dist/tool-name-normalization.d.ts +9 -0
- package/dist/tool-name-normalization.js +82 -0
- package/dist/user-agent.d.ts +26 -0
- package/dist/user-agent.js +101 -0
- package/dist/validation/ws-outbound-envelope.d.ts +13413 -0
- package/dist/validation/ws-outbound-envelope.js +17 -0
- package/dist/validation/ws-outbound.d.ts +12 -0
- package/dist/validation/ws-outbound.js +38 -0
- package/dist/websocket-message-limit.d.ts +5 -0
- package/dist/websocket-message-limit.js +5 -0
- package/dist/workspace-labels.d.ts +9 -0
- package/dist/workspace-labels.js +19 -0
- package/package.json +48 -4
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
// Stable across transport retries; callers should generate a UUID per intended run.
|
|
63
|
+
runId: z.string().optional(),
|
|
64
|
+
});
|
|
65
|
+
const ScheduleUpdateNewAgentConfigSchema = z.object({
|
|
66
|
+
provider: z.string().trim().min(1).optional(),
|
|
67
|
+
model: z.string().trim().min(1).nullable().optional(),
|
|
68
|
+
modeId: z.string().trim().min(1).nullable().optional(),
|
|
69
|
+
thinkingOptionId: z.string().trim().min(1).nullable().optional(),
|
|
70
|
+
archiveOnFinish: z.boolean().optional(),
|
|
71
|
+
isolation: z.enum(["local", "worktree"]).optional(),
|
|
72
|
+
cwd: z.string().trim().min(1).optional(),
|
|
73
|
+
});
|
|
74
|
+
export const ScheduleUpdateRequestSchema = z.object({
|
|
75
|
+
type: z.literal("schedule/update"),
|
|
76
|
+
requestId: z.string(),
|
|
77
|
+
scheduleId: z.string(),
|
|
78
|
+
name: z.string().nullable().optional(),
|
|
79
|
+
prompt: z.string().min(1).optional(),
|
|
80
|
+
cadence: ScheduleCadenceSchema.optional(),
|
|
81
|
+
newAgentConfig: ScheduleUpdateNewAgentConfigSchema.optional(),
|
|
82
|
+
maxRuns: z.number().int().positive().nullable().optional(),
|
|
83
|
+
expiresAt: z.string().nullable().optional(),
|
|
84
|
+
});
|
|
85
|
+
export const ScheduleCreateResponseSchema = z.object({
|
|
86
|
+
type: z.literal("schedule/create/response"),
|
|
87
|
+
payload: z.object({
|
|
88
|
+
requestId: z.string(),
|
|
89
|
+
schedule: ScheduleSummarySchema.nullable(),
|
|
90
|
+
error: z.string().nullable(),
|
|
91
|
+
}),
|
|
92
|
+
});
|
|
93
|
+
export const ScheduleListResponseSchema = z.object({
|
|
94
|
+
type: z.literal("schedule/list/response"),
|
|
95
|
+
payload: z.object({
|
|
96
|
+
requestId: z.string(),
|
|
97
|
+
schedules: z.array(ScheduleSummarySchema),
|
|
98
|
+
error: z.string().nullable(),
|
|
99
|
+
}),
|
|
100
|
+
});
|
|
101
|
+
export const ScheduleInspectResponseSchema = z.object({
|
|
102
|
+
type: z.literal("schedule/inspect/response"),
|
|
103
|
+
payload: z.object({
|
|
104
|
+
requestId: z.string(),
|
|
105
|
+
schedule: StoredScheduleSchema.nullable(),
|
|
106
|
+
error: z.string().nullable(),
|
|
107
|
+
}),
|
|
108
|
+
});
|
|
109
|
+
export const ScheduleLogsResponseSchema = z.object({
|
|
110
|
+
type: z.literal("schedule/logs/response"),
|
|
111
|
+
payload: z.object({
|
|
112
|
+
requestId: z.string(),
|
|
113
|
+
runs: z.array(ScheduleRunSchema),
|
|
114
|
+
error: z.string().nullable(),
|
|
115
|
+
}),
|
|
116
|
+
});
|
|
117
|
+
export const SchedulePauseResponseSchema = z.object({
|
|
118
|
+
type: z.literal("schedule/pause/response"),
|
|
119
|
+
payload: z.object({
|
|
120
|
+
requestId: z.string(),
|
|
121
|
+
schedule: ScheduleSummarySchema.nullable(),
|
|
122
|
+
error: z.string().nullable(),
|
|
123
|
+
}),
|
|
124
|
+
});
|
|
125
|
+
export const ScheduleResumeResponseSchema = z.object({
|
|
126
|
+
type: z.literal("schedule/resume/response"),
|
|
127
|
+
payload: z.object({
|
|
128
|
+
requestId: z.string(),
|
|
129
|
+
schedule: ScheduleSummarySchema.nullable(),
|
|
130
|
+
error: z.string().nullable(),
|
|
131
|
+
}),
|
|
132
|
+
});
|
|
133
|
+
export const ScheduleDeleteResponseSchema = z.object({
|
|
134
|
+
type: z.literal("schedule/delete/response"),
|
|
135
|
+
payload: z.object({
|
|
136
|
+
requestId: z.string(),
|
|
137
|
+
scheduleId: z.string(),
|
|
138
|
+
error: z.string().nullable(),
|
|
139
|
+
}),
|
|
140
|
+
});
|
|
141
|
+
export const ScheduleRunOnceResponseSchema = z.object({
|
|
142
|
+
type: z.literal("schedule/run-once/response"),
|
|
143
|
+
payload: z.object({
|
|
144
|
+
requestId: z.string(),
|
|
145
|
+
runId: z.string().optional(),
|
|
146
|
+
schedule: StoredScheduleSchema.nullable(),
|
|
147
|
+
error: z.string().nullable(),
|
|
148
|
+
}),
|
|
149
|
+
});
|
|
150
|
+
export const ScheduleUpdateResponseSchema = z.object({
|
|
151
|
+
type: z.literal("schedule/update/response"),
|
|
152
|
+
payload: z.object({
|
|
153
|
+
requestId: z.string(),
|
|
154
|
+
schedule: StoredScheduleSchema.nullable(),
|
|
155
|
+
error: z.string().nullable(),
|
|
156
|
+
}),
|
|
157
|
+
});
|
|
158
|
+
//# sourceMappingURL=rpc-schemas.js.map
|
|
@@ -0,0 +1,201 @@
|
|
|
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
|
+
modeId: z.ZodOptional<z.ZodString>;
|
|
26
|
+
model: z.ZodOptional<z.ZodString>;
|
|
27
|
+
thinkingOptionId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
archiveOnFinish: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
isolation: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
local: "local";
|
|
31
|
+
worktree: "worktree";
|
|
32
|
+
}>>;
|
|
33
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
35
|
+
featureValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
37
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
}, z.core.$strip>], "type">;
|
|
40
|
+
export type ScheduleTarget = z.infer<typeof ScheduleTargetSchema>;
|
|
41
|
+
export declare const ScheduleRunSchema: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
scheduledFor: z.ZodString;
|
|
44
|
+
startedAt: z.ZodString;
|
|
45
|
+
endedAt: z.ZodNullable<z.ZodString>;
|
|
46
|
+
status: z.ZodEnum<{
|
|
47
|
+
running: "running";
|
|
48
|
+
failed: "failed";
|
|
49
|
+
succeeded: "succeeded";
|
|
50
|
+
}>;
|
|
51
|
+
agentId: z.ZodNullable<z.ZodGUID>;
|
|
52
|
+
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
output: z.ZodNullable<z.ZodString>;
|
|
54
|
+
error: z.ZodNullable<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export type ScheduleRun = z.infer<typeof ScheduleRunSchema>;
|
|
57
|
+
export declare const StoredScheduleSchema: z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
name: z.ZodNullable<z.ZodString>;
|
|
60
|
+
prompt: z.ZodString;
|
|
61
|
+
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
62
|
+
type: z.ZodLiteral<"every">;
|
|
63
|
+
everyMs: z.ZodNumber;
|
|
64
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"cron">;
|
|
66
|
+
expression: z.ZodString;
|
|
67
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>], "type">;
|
|
69
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"agent">;
|
|
71
|
+
agentId: z.ZodGUID;
|
|
72
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
73
|
+
type: z.ZodLiteral<"new-agent">;
|
|
74
|
+
config: z.ZodObject<{
|
|
75
|
+
provider: z.ZodString;
|
|
76
|
+
cwd: z.ZodString;
|
|
77
|
+
modeId: z.ZodOptional<z.ZodString>;
|
|
78
|
+
model: z.ZodOptional<z.ZodString>;
|
|
79
|
+
thinkingOptionId: z.ZodOptional<z.ZodString>;
|
|
80
|
+
archiveOnFinish: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
isolation: z.ZodOptional<z.ZodEnum<{
|
|
82
|
+
local: "local";
|
|
83
|
+
worktree: "worktree";
|
|
84
|
+
}>>;
|
|
85
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
87
|
+
featureValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
88
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
89
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
}, z.core.$strip>], "type">;
|
|
92
|
+
status: z.ZodEnum<{
|
|
93
|
+
completed: "completed";
|
|
94
|
+
active: "active";
|
|
95
|
+
paused: "paused";
|
|
96
|
+
}>;
|
|
97
|
+
createdAt: z.ZodString;
|
|
98
|
+
updatedAt: z.ZodString;
|
|
99
|
+
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
100
|
+
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
101
|
+
pausedAt: z.ZodNullable<z.ZodString>;
|
|
102
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
103
|
+
maxRuns: z.ZodNullable<z.ZodNumber>;
|
|
104
|
+
runs: z.ZodArray<z.ZodObject<{
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
scheduledFor: z.ZodString;
|
|
107
|
+
startedAt: z.ZodString;
|
|
108
|
+
endedAt: z.ZodNullable<z.ZodString>;
|
|
109
|
+
status: z.ZodEnum<{
|
|
110
|
+
running: "running";
|
|
111
|
+
failed: "failed";
|
|
112
|
+
succeeded: "succeeded";
|
|
113
|
+
}>;
|
|
114
|
+
agentId: z.ZodNullable<z.ZodGUID>;
|
|
115
|
+
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
output: z.ZodNullable<z.ZodString>;
|
|
117
|
+
error: z.ZodNullable<z.ZodString>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export type StoredSchedule = z.infer<typeof StoredScheduleSchema>;
|
|
121
|
+
export declare const ScheduleSummarySchema: z.ZodObject<{
|
|
122
|
+
name: z.ZodNullable<z.ZodString>;
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
status: z.ZodEnum<{
|
|
125
|
+
completed: "completed";
|
|
126
|
+
active: "active";
|
|
127
|
+
paused: "paused";
|
|
128
|
+
}>;
|
|
129
|
+
createdAt: z.ZodString;
|
|
130
|
+
updatedAt: z.ZodString;
|
|
131
|
+
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
132
|
+
type: z.ZodLiteral<"every">;
|
|
133
|
+
everyMs: z.ZodNumber;
|
|
134
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
135
|
+
type: z.ZodLiteral<"cron">;
|
|
136
|
+
expression: z.ZodString;
|
|
137
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, z.core.$strip>], "type">;
|
|
139
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
140
|
+
type: z.ZodLiteral<"agent">;
|
|
141
|
+
agentId: z.ZodGUID;
|
|
142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
143
|
+
type: z.ZodLiteral<"new-agent">;
|
|
144
|
+
config: z.ZodObject<{
|
|
145
|
+
provider: z.ZodString;
|
|
146
|
+
cwd: z.ZodString;
|
|
147
|
+
modeId: z.ZodOptional<z.ZodString>;
|
|
148
|
+
model: z.ZodOptional<z.ZodString>;
|
|
149
|
+
thinkingOptionId: z.ZodOptional<z.ZodString>;
|
|
150
|
+
archiveOnFinish: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
+
isolation: z.ZodOptional<z.ZodEnum<{
|
|
152
|
+
local: "local";
|
|
153
|
+
worktree: "worktree";
|
|
154
|
+
}>>;
|
|
155
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
156
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
157
|
+
featureValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
158
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
159
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
}, z.core.$strip>], "type">;
|
|
162
|
+
prompt: z.ZodString;
|
|
163
|
+
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
164
|
+
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
165
|
+
pausedAt: z.ZodNullable<z.ZodString>;
|
|
166
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
167
|
+
maxRuns: z.ZodNullable<z.ZodNumber>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
export type ScheduleSummary = z.infer<typeof ScheduleSummarySchema>;
|
|
170
|
+
export interface CreateScheduleInput {
|
|
171
|
+
name?: string | null;
|
|
172
|
+
prompt: string;
|
|
173
|
+
cadence: ScheduleCadence;
|
|
174
|
+
target: ScheduleTarget;
|
|
175
|
+
maxRuns?: number | null;
|
|
176
|
+
expiresAt?: string | null;
|
|
177
|
+
runOnCreate?: boolean | null;
|
|
178
|
+
}
|
|
179
|
+
export interface UpdateScheduleNewAgentConfig {
|
|
180
|
+
provider?: string;
|
|
181
|
+
model?: string | null;
|
|
182
|
+
modeId?: string | null;
|
|
183
|
+
thinkingOptionId?: string | null;
|
|
184
|
+
archiveOnFinish?: boolean;
|
|
185
|
+
isolation?: "local" | "worktree";
|
|
186
|
+
cwd?: string;
|
|
187
|
+
}
|
|
188
|
+
export interface UpdateScheduleInput {
|
|
189
|
+
id: string;
|
|
190
|
+
name?: string | null;
|
|
191
|
+
prompt?: string;
|
|
192
|
+
cadence?: ScheduleCadence;
|
|
193
|
+
newAgentConfig?: UpdateScheduleNewAgentConfig;
|
|
194
|
+
maxRuns?: number | null;
|
|
195
|
+
expiresAt?: string | null;
|
|
196
|
+
}
|
|
197
|
+
export interface ScheduleExecutionResult {
|
|
198
|
+
agentId: string | null;
|
|
199
|
+
output: string | null;
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
modeId: z.string().trim().min(1).optional(),
|
|
26
|
+
model: z.string().trim().min(1).optional(),
|
|
27
|
+
thinkingOptionId: z.string().trim().min(1).optional(),
|
|
28
|
+
archiveOnFinish: z.boolean().optional(),
|
|
29
|
+
isolation: z.enum(["local", "worktree"]).optional(),
|
|
30
|
+
title: z.string().trim().min(1).nullable().optional(),
|
|
31
|
+
providerOptions: z.record(z.string(), z.unknown()).optional(),
|
|
32
|
+
featureValues: z.record(z.string(), z.unknown()).optional(),
|
|
33
|
+
systemPrompt: z.string().optional(),
|
|
34
|
+
mcpServers: z.record(z.string(), z.unknown()).optional(),
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
]);
|
|
38
|
+
export const ScheduleRunSchema = z.object({
|
|
39
|
+
id: z.string(),
|
|
40
|
+
scheduledFor: z.string(),
|
|
41
|
+
startedAt: z.string(),
|
|
42
|
+
endedAt: z.string().nullable(),
|
|
43
|
+
status: z.enum(["running", "succeeded", "failed"]),
|
|
44
|
+
agentId: z.guid().nullable(),
|
|
45
|
+
workspaceId: z.string().nullable().optional(),
|
|
46
|
+
output: z.string().nullable(),
|
|
47
|
+
error: z.string().nullable(),
|
|
48
|
+
});
|
|
49
|
+
export const StoredScheduleSchema = z.object({
|
|
50
|
+
id: z.string(),
|
|
51
|
+
name: z.string().nullable(),
|
|
52
|
+
prompt: z.string().min(1),
|
|
53
|
+
cadence: ScheduleCadenceSchema,
|
|
54
|
+
target: ScheduleTargetSchema,
|
|
55
|
+
status: ScheduleStatusSchema,
|
|
56
|
+
createdAt: z.string(),
|
|
57
|
+
updatedAt: z.string(),
|
|
58
|
+
nextRunAt: z.string().nullable(),
|
|
59
|
+
lastRunAt: z.string().nullable(),
|
|
60
|
+
pausedAt: z.string().nullable(),
|
|
61
|
+
expiresAt: z.string().nullable(),
|
|
62
|
+
maxRuns: z.number().int().positive().nullable(),
|
|
63
|
+
runs: z.array(ScheduleRunSchema),
|
|
64
|
+
});
|
|
65
|
+
export const ScheduleSummarySchema = StoredScheduleSchema.omit({
|
|
66
|
+
runs: true,
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ranked text matching shared by the app's pickers and the daemon's history
|
|
3
|
+
* search. A match is a tier plus the offset it was found at; lower is better on
|
|
4
|
+
* both, so callers sort ascending and never have to invent a scale.
|
|
5
|
+
*
|
|
6
|
+
* Typo tolerance is opt-in via `fuzzy`. The pickers leave it off — a combobox
|
|
7
|
+
* over a known list wants exact narrowing — while history search turns it on
|
|
8
|
+
* because the user is recalling a title from memory.
|
|
9
|
+
*/
|
|
10
|
+
export interface MatchScore {
|
|
11
|
+
tier: number;
|
|
12
|
+
offset: number;
|
|
13
|
+
spread?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface MatchOptions {
|
|
16
|
+
/** Omit or pass null to match exactly. `fuzzyPolicyForToken` picks a policy. */
|
|
17
|
+
fuzzy?: FuzzyPolicy | null;
|
|
18
|
+
/**
|
|
19
|
+
* Match characters in order within one whitespace-delimited word, so `pasbab`
|
|
20
|
+
* finds `paseo-babysit`, but `labdes` cannot join "Label as Design". Defaults to on.
|
|
21
|
+
*/
|
|
22
|
+
subsequence?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* How much a typo in one query token is forgiven. Short tokens get
|
|
26
|
+
* transpositions and nothing else: at four characters a free substitution turns
|
|
27
|
+
* "main" into "mail", "maid", and "rain", while a swap can only ever reach the
|
|
28
|
+
* word the user meant. Null means the token is matched exactly.
|
|
29
|
+
*/
|
|
30
|
+
export interface FuzzyPolicy {
|
|
31
|
+
maxEdits: number;
|
|
32
|
+
transpositionsOnly: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function fuzzyPolicyForToken(token: string): FuzzyPolicy | null;
|
|
35
|
+
export declare function scoreMatch(query: string, text: string, options?: MatchOptions): MatchScore | null;
|
|
36
|
+
/** Match a query against a complete displayed path, including its separators. */
|
|
37
|
+
export declare function scorePathMatch(query: string, path: string): MatchScore | null;
|
|
38
|
+
export interface MatchRange {
|
|
39
|
+
start: number;
|
|
40
|
+
length: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Where a score's match actually landed, so a caller can mark it. Derived from
|
|
44
|
+
* a score rather than produced alongside one: ranking touches every candidate
|
|
45
|
+
* and needs no ranges, while only the handful of rows that get rendered do.
|
|
46
|
+
*
|
|
47
|
+
* The tier decides the shape. A substring hit is one span; a subsequence hit is
|
|
48
|
+
* the scattered characters it walked; a typo hit marks the whole word, because
|
|
49
|
+
* the characters the user got wrong are not in the text to point at.
|
|
50
|
+
*/
|
|
51
|
+
export declare function matchRanges(query: string, text: string, score: MatchScore): MatchRange[];
|
|
52
|
+
export declare function compareMatchScores(a: MatchScore, b: MatchScore): number;
|
|
53
|
+
export declare function tokenizeQuery(query: string): string[];
|
|
54
|
+
export interface TextFieldsOptions {
|
|
55
|
+
/**
|
|
56
|
+
* Forgive typos. The budget is per token rather than per query, because a
|
|
57
|
+
* query mixes long words that can absorb an edit with short ones that cannot.
|
|
58
|
+
*/
|
|
59
|
+
typoTolerant?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* See `MatchOptions.subsequence`. Applied per token, so turning it off means
|
|
62
|
+
* every token has to appear as a run of adjacent characters in some field —
|
|
63
|
+
* `lab des` still matches "Label as Design", `labdes` no longer does.
|
|
64
|
+
*/
|
|
65
|
+
subsequence?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare function scoreTextFields(query: string, fields: string[], options?: TextFieldsOptions): MatchScore | null;
|
|
68
|
+
/**
|
|
69
|
+
* How closely a query matched, coarser than a tier: every token at a word boundary, some token
|
|
70
|
+
* inside a word, or some token only scattered across a word or misspelled. Positional tier
|
|
71
|
+
* differences ("lo" at a title's start versus a branch's middle word) stay within one class.
|
|
72
|
+
*/
|
|
73
|
+
export type MatchClass = "word" | "inside-word" | "scattered";
|
|
74
|
+
/** Closer classes first. */
|
|
75
|
+
export declare function compareMatchClasses(a: MatchClass, b: MatchClass): number;
|
|
76
|
+
/** The class of the query's loosest token, or null when some token matches no field. */
|
|
77
|
+
export declare function textFieldsMatchClass(query: string, fields: string[], options?: TextFieldsOptions): MatchClass | null;
|
|
78
|
+
//# sourceMappingURL=text-match.d.ts.map
|