@koinzhang/paseo-plugin-commands 0.1.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.
@@ -0,0 +1,376 @@
1
+ import { formatToggle, parseToggle, splitFirst, TOGGLE_WORDS } from "./parse.ts";
2
+ import { formatList, requireOption } from "./resolve-option.ts";
3
+ import type { AgentControl } from "./rpc.ts";
4
+
5
+ export interface SelectOption {
6
+ id: string;
7
+ label: string;
8
+ isDefault?: boolean;
9
+ }
10
+
11
+ export interface ModelOption {
12
+ id: string;
13
+ label: string;
14
+ aliases?: string[];
15
+ isDefault?: boolean;
16
+ thinkingOptions?: SelectOption[];
17
+ defaultThinkingOptionId?: string;
18
+ }
19
+
20
+ export type Feature =
21
+ | { type: "toggle"; id: string; label: string; value: boolean }
22
+ | { type: "select"; id: string; label: string; value: string | null; options: SelectOption[] };
23
+
24
+ export interface Profile {
25
+ id: string;
26
+ name: string;
27
+ provider: string;
28
+ model?: string;
29
+ modeId?: string;
30
+ thinkingOptionId?: string;
31
+ featureValues?: Record<string, unknown>;
32
+ [key: string]: unknown;
33
+ }
34
+
35
+ /** What a command needs to know about the current agent. Values are effective, not requested. */
36
+ export interface AgentState {
37
+ agentId: string;
38
+ provider: string;
39
+ status: string;
40
+ modelId: string | null;
41
+ thinkingOptionId: string | null;
42
+ modeId: string | null;
43
+ models: ModelOption[];
44
+ modes: SelectOption[];
45
+ features: Feature[];
46
+ }
47
+
48
+ export type PickerEntry =
49
+ | {
50
+ id: string;
51
+ title: string;
52
+ current?: boolean;
53
+ disabled?: boolean;
54
+ control?: AgentControl;
55
+ note?: string;
56
+ }
57
+ | { id: string; title: string; items: PickerEntry[] };
58
+
59
+ export type Plan =
60
+ | { kind: "picker"; title: string; icon: string; items: PickerEntry[] }
61
+ /** `note` is a short message to show after the control succeeds. */
62
+ | { kind: "run"; control: AgentControl; note?: string };
63
+
64
+ export function findModel(models: readonly ModelOption[], id: string | null): ModelOption | null {
65
+ if (!id) return models.find((model) => model.isDefault) ?? null;
66
+ return models.find((model) => model.id === id || model.aliases?.includes(id)) ?? null;
67
+ }
68
+
69
+ export function defaultThinkingId(model: ModelOption | null): string | null {
70
+ if (!model) return null;
71
+ return (
72
+ model.defaultThinkingOptionId ??
73
+ model.thinkingOptions?.find((option) => option.isDefault)?.id ??
74
+ null
75
+ );
76
+ }
77
+
78
+ export function planModel(args: string, state: AgentState): Plan {
79
+ const { agentId, models } = state;
80
+ if (models.length === 0) throw new Error(`Provider "${state.provider}" exposes no models.`);
81
+ const current = findModel(models, state.modelId);
82
+ if (!args.trim()) {
83
+ return {
84
+ kind: "picker",
85
+ title: "Model",
86
+ icon: "Cpu",
87
+ items: models.map((model) => ({
88
+ id: model.id,
89
+ title: model.label,
90
+ current: model.id === current?.id,
91
+ control: { op: "model", agentId, modelId: model.id },
92
+ })),
93
+ };
94
+ }
95
+ const model = requireOption("model", args, models, { substring: false });
96
+ return { kind: "run", control: { op: "model", agentId, modelId: model.id } };
97
+ }
98
+
99
+ export function planEffort(args: string, state: AgentState): Plan {
100
+ const { agentId } = state;
101
+ const model = findModel(state.models, state.modelId);
102
+ const options = model?.thinkingOptions ?? [];
103
+ if (options.length === 0) {
104
+ const name = model?.label ?? state.modelId ?? state.provider;
105
+ throw new Error(`"${name}" has no thinking effort levels.`);
106
+ }
107
+ if (!args.trim()) {
108
+ const current = state.thinkingOptionId ?? defaultThinkingId(model);
109
+ return {
110
+ kind: "picker",
111
+ title: "Thinking effort",
112
+ icon: "Brain",
113
+ items: options.map((option) => ({
114
+ id: option.id,
115
+ title: option.label,
116
+ current: option.id === current,
117
+ control: { op: "thinking", agentId, thinkingOptionId: option.id },
118
+ })),
119
+ };
120
+ }
121
+ const option = requireOption("effort", args, options);
122
+ return { kind: "run", control: { op: "thinking", agentId, thinkingOptionId: option.id } };
123
+ }
124
+
125
+ export function planMode(args: string, state: AgentState): Plan {
126
+ const { agentId, modes } = state;
127
+ if (modes.length === 0) throw new Error(`Provider "${state.provider}" exposes no modes.`);
128
+ if (!args.trim()) {
129
+ return {
130
+ kind: "picker",
131
+ title: "Mode",
132
+ icon: "ShieldCheck",
133
+ items: modes.map((mode) => ({
134
+ id: mode.id,
135
+ title: mode.label,
136
+ current: mode.id === state.modeId,
137
+ control: { op: "mode", agentId, modeId: mode.id },
138
+ })),
139
+ };
140
+ }
141
+ const mode = requireOption("mode", args, modes);
142
+ return { kind: "run", control: { op: "mode", agentId, modeId: mode.id } };
143
+ }
144
+
145
+ function featureValueEntries(agentId: string, feature: Feature): PickerEntry[] {
146
+ if (feature.type === "toggle") {
147
+ return [true, false].map((value) => ({
148
+ id: formatToggle(value),
149
+ title: value ? "On" : "Off",
150
+ current: feature.value === value,
151
+ control: { op: "feature", agentId, featureId: feature.id, value },
152
+ }));
153
+ }
154
+ return feature.options.map((option) => ({
155
+ id: option.id,
156
+ title: option.label,
157
+ current: option.id === feature.value,
158
+ control: { op: "feature", agentId, featureId: feature.id, value: option.id },
159
+ }));
160
+ }
161
+
162
+ export function formatFeatureValue(feature: Feature): string {
163
+ if (feature.type === "toggle") return formatToggle(feature.value);
164
+ const option = feature.options.find((entry) => entry.id === feature.value);
165
+ return option?.label ?? feature.value ?? "default";
166
+ }
167
+
168
+ export function planFeature(args: string, state: AgentState): Plan {
169
+ const { agentId, features } = state;
170
+ if (features.length === 0) throw new Error(`Provider "${state.provider}" exposes no features.`);
171
+ const { head, rest } = splitFirst(args);
172
+ if (!head) {
173
+ return {
174
+ kind: "picker",
175
+ title: "Features",
176
+ icon: "SlidersHorizontal",
177
+ items: features.map((feature) => ({
178
+ id: feature.id,
179
+ title: `${feature.label}: ${formatFeatureValue(feature)}`,
180
+ items: featureValueEntries(agentId, feature),
181
+ })),
182
+ };
183
+ }
184
+ const feature = requireOption("feature", head, features);
185
+ if (!rest) {
186
+ return {
187
+ kind: "picker",
188
+ title: feature.label,
189
+ icon: "SlidersHorizontal",
190
+ items: featureValueEntries(agentId, feature),
191
+ };
192
+ }
193
+ if (feature.type === "toggle") {
194
+ const value = parseToggle(rest);
195
+ if (value === null) {
196
+ throw new Error(
197
+ `Unknown ${feature.id} value "${rest}".\nAvailable: ${TOGGLE_WORDS.join(", ")}`,
198
+ );
199
+ }
200
+ return { kind: "run", control: { op: "feature", agentId, featureId: feature.id, value } };
201
+ }
202
+ const option = requireOption(`${feature.id} value`, rest, feature.options);
203
+ return {
204
+ kind: "run",
205
+ control: { op: "feature", agentId, featureId: feature.id, value: option.id },
206
+ };
207
+ }
208
+
209
+ const PROFILE_KEYS = new Set([
210
+ "id",
211
+ "name",
212
+ "icon",
213
+ "color",
214
+ "notes",
215
+ "provider",
216
+ "model",
217
+ "modeId",
218
+ "thinkingOptionId",
219
+ "featureValues",
220
+ ]);
221
+
222
+ function trimmed(value: unknown): string {
223
+ return typeof value === "string" ? value.trim() : "";
224
+ }
225
+
226
+ /**
227
+ * Builds the runtime subset of a profile. A running agent cannot change
228
+ * provider, and fields the daemon cannot apply at runtime are reported rather
229
+ * than silently dropped.
230
+ */
231
+ export function profileControl(
232
+ profile: Profile,
233
+ state: AgentState,
234
+ ): { control: Extract<AgentControl, { op: "config" }>; ignored: string[] } {
235
+ const provider = trimmed(profile.provider);
236
+ if (provider && provider !== state.provider) {
237
+ throw new Error(
238
+ `Profile "${profile.name}" targets ${provider}; this agent runs ${state.provider}.`,
239
+ );
240
+ }
241
+ const ignored: string[] = [];
242
+ const config: Extract<AgentControl, { op: "config" }>["config"] = {};
243
+
244
+ const modelId = trimmed(profile.model);
245
+ let targetModel = findModel(state.models, state.modelId);
246
+ if (modelId) {
247
+ const known = findModel(state.models, modelId);
248
+ if (known || state.models.length === 0) {
249
+ config.modelId = modelId;
250
+ targetModel = known;
251
+ } else {
252
+ ignored.push(`model "${modelId}"`);
253
+ }
254
+ }
255
+
256
+ const modeId = trimmed(profile.modeId);
257
+ if (modeId) {
258
+ if (state.modes.some((mode) => mode.id === modeId)) config.modeId = modeId;
259
+ else ignored.push(`mode "${modeId}"`);
260
+ }
261
+
262
+ const thinkingId = trimmed(profile.thinkingOptionId);
263
+ if (thinkingId) {
264
+ const options = targetModel?.thinkingOptions;
265
+ if (!options || options.some((option) => option.id === thinkingId)) {
266
+ config.thinkingOptionId = thinkingId;
267
+ } else {
268
+ ignored.push(`effort "${thinkingId}"`);
269
+ }
270
+ }
271
+
272
+ const featureValues: Record<string, unknown> = {};
273
+ for (const [id, value] of Object.entries(profile.featureValues ?? {})) {
274
+ if (state.features.some((feature) => feature.id === id)) featureValues[id] = value;
275
+ else ignored.push(`feature "${id}"`);
276
+ }
277
+ if (Object.keys(featureValues).length > 0) config.featureValues = featureValues;
278
+
279
+ for (const key of Object.keys(profile)) {
280
+ if (!PROFILE_KEYS.has(key)) ignored.push(key);
281
+ }
282
+ return { control: { op: "config", agentId: state.agentId, config }, ignored };
283
+ }
284
+
285
+ function profileRun(profile: Profile, state: AgentState): Extract<Plan, { kind: "run" }> {
286
+ const { control, ignored } = profileControl(profile, state);
287
+ const skipped = ignored.length > 0 ? ` Ignored: ${formatList(ignored)}.` : "";
288
+ if (Object.keys(control.config).length === 0) {
289
+ throw new Error(`Profile "${profile.name}" has nothing to apply to this agent.${skipped}`);
290
+ }
291
+ return {
292
+ kind: "run",
293
+ control,
294
+ ...(skipped ? { note: `Applied profile "${profile.name}".${skipped}` } : {}),
295
+ };
296
+ }
297
+
298
+ export function planProfile(args: string, state: AgentState, profiles: readonly Profile[]): Plan {
299
+ if (profiles.length === 0) throw new Error("No agent profiles configured.");
300
+ if (!args.trim()) {
301
+ return {
302
+ kind: "picker",
303
+ title: "Profile",
304
+ icon: "Layers",
305
+ items: profiles.map((profile) => {
306
+ const provider = trimmed(profile.provider);
307
+ const title =
308
+ provider && provider !== state.provider ? `${profile.name} (${provider})` : profile.name;
309
+ try {
310
+ const run = profileRun(profile, state);
311
+ return { id: profile.id, title, control: run.control, note: run.note };
312
+ } catch {
313
+ return { id: profile.id, title, disabled: true };
314
+ }
315
+ }),
316
+ };
317
+ }
318
+ const { profile } = requireOption(
319
+ "profile",
320
+ args,
321
+ profiles.map((entry) => ({ id: entry.id, label: entry.name, profile: entry })),
322
+ );
323
+ return profileRun(profile, state);
324
+ }
325
+
326
+ export type RenameTarget = "tab" | "workspace";
327
+
328
+ export interface RenameRequest {
329
+ target: RenameTarget;
330
+ title: string;
331
+ }
332
+
333
+ const RENAME_FLAGS: Record<string, RenameTarget> = {
334
+ "-t": "tab",
335
+ "--tab": "tab",
336
+ "-w": "workspace",
337
+ "--workspace": "workspace",
338
+ };
339
+
340
+ export const RENAME_USAGE = "Usage: /rename [-t|--tab|-w|--workspace] <title>";
341
+
342
+ function firstToken(value: string): string {
343
+ const space = value.search(/\s/);
344
+ return space === -1 ? value : value.slice(0, space);
345
+ }
346
+
347
+ /** Drop a leading `--` used to end options, so a title may start with `-`. */
348
+ function stripEndOfOptions(value: string): string {
349
+ if (value === "--") return "";
350
+ if (value.startsWith("-- ") || value.startsWith("--\t")) return value.slice(2).trim();
351
+ return value;
352
+ }
353
+
354
+ export function planRename(args: string): RenameRequest {
355
+ let rest = args.trim();
356
+ if (!rest) throw new Error(RENAME_USAGE);
357
+
358
+ let target: RenameTarget = "tab";
359
+ const head = firstToken(rest);
360
+ if (head === "--") {
361
+ rest = stripEndOfOptions(rest);
362
+ } else if (head.startsWith("-")) {
363
+ const mapped = RENAME_FLAGS[head];
364
+ if (!mapped) throw new Error(`Unknown option "${head}". ${RENAME_USAGE}`);
365
+ target = mapped;
366
+ rest = stripEndOfOptions(rest.slice(head.length).trim());
367
+ }
368
+
369
+ if (!rest) throw new Error(RENAME_USAGE);
370
+ return { target, title: rest };
371
+ }
372
+
373
+ export function planCancel(agentId: string, status: string): Plan {
374
+ if (status !== "running") throw new Error(`Nothing to cancel: the agent is ${status}.`);
375
+ return { kind: "run", control: { op: "cancel", agentId } };
376
+ }
@@ -0,0 +1,23 @@
1
+ /** Splits `/feature fast_mode true` style args into the first token and the remainder. */
2
+ export function splitFirst(args: string): { head: string; rest: string } {
3
+ const trimmed = args.trim();
4
+ const match = /^(\S+)\s*([\s\S]*)$/.exec(trimmed);
5
+ if (!match) return { head: "", rest: "" };
6
+ return { head: match[1] ?? "", rest: (match[2] ?? "").trim() };
7
+ }
8
+
9
+ const TRUE_WORDS = new Set(["true", "on", "yes", "1", "enable", "enabled"]);
10
+ const FALSE_WORDS = new Set(["false", "off", "no", "0", "disable", "disabled"]);
11
+
12
+ export const TOGGLE_WORDS = ["on", "off"] as const;
13
+
14
+ export function parseToggle(value: string): boolean | null {
15
+ const key = value.trim().toLowerCase();
16
+ if (TRUE_WORDS.has(key)) return true;
17
+ if (FALSE_WORDS.has(key)) return false;
18
+ return null;
19
+ }
20
+
21
+ export function formatToggle(value: boolean): string {
22
+ return value ? "on" : "off";
23
+ }
@@ -0,0 +1,66 @@
1
+ export interface Rect {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ }
7
+
8
+ export interface Size {
9
+ width: number;
10
+ height: number;
11
+ }
12
+
13
+ export type Placement = "top" | "bottom";
14
+
15
+ /** Gap kept between the surface and the window edge, as in Paseo's menus. */
16
+ const EDGE_PADDING = 8;
17
+
18
+ /** Paseo composer pill geometry: 12px horizontal padding, 1px border, 32px minimum height. */
19
+ const PILL_INSET_X = 13;
20
+ const PILL_HEIGHT = 32;
21
+
22
+ /** The pill's box, derived from its centred icon since only the icon is plugin-owned. */
23
+ export function pillRectFromIcon(icon: Rect): Rect {
24
+ return {
25
+ x: icon.x - PILL_INSET_X,
26
+ y: icon.y + icon.height / 2 - PILL_HEIGHT / 2,
27
+ width: icon.width + PILL_INSET_X * 2,
28
+ height: PILL_HEIGHT,
29
+ };
30
+ }
31
+
32
+ /**
33
+ * Start-aligned placement with Paseo's flip rule: leave the requested side only when the
34
+ * surface does not fit there and the other side has more room; then clamp inside the window.
35
+ */
36
+ export function placePopover(input: {
37
+ trigger: Rect;
38
+ content: Size;
39
+ window: Size;
40
+ side: Placement;
41
+ offset: number;
42
+ }): { x: number; y: number; placement: Placement } {
43
+ const { trigger, content, window, offset } = input;
44
+ const spaceTop = trigger.y;
45
+ const spaceBottom = window.height - (trigger.y + trigger.height);
46
+ let placement = input.side;
47
+ if (placement === "top" && spaceTop < content.height && spaceBottom > spaceTop) {
48
+ placement = "bottom";
49
+ } else if (placement === "bottom" && spaceBottom < content.height && spaceTop > spaceBottom) {
50
+ placement = "top";
51
+ }
52
+ const y =
53
+ placement === "top"
54
+ ? trigger.y - content.height - offset
55
+ : trigger.y + trigger.height + offset;
56
+ return {
57
+ x: Math.max(EDGE_PADDING, Math.min(window.width - content.width - EDGE_PADDING, trigger.x)),
58
+ y: Math.max(EDGE_PADDING, Math.min(window.height - content.height - EDGE_PADDING, y)),
59
+ placement,
60
+ };
61
+ }
62
+
63
+ /** Scrollable surfaces never exceed their max height or the window less both edge gaps. */
64
+ export function visibleHeight(contentHeight: number, maxHeight: number, windowHeight: number) {
65
+ return Math.min(contentHeight, maxHeight, Math.max(windowHeight - EDGE_PADDING * 2, 0));
66
+ }
@@ -0,0 +1,26 @@
1
+ export interface PromptTimelineEntry {
2
+ item: { type: string; text?: string | null };
3
+ seqStart?: number;
4
+ }
5
+
6
+ /** Returns the newest non-empty user prompt while preserving its original text. */
7
+ export function latestUserPrompt(
8
+ entries: readonly PromptTimelineEntry[],
9
+ ): string | null {
10
+ let latest: { text: string; seq: number; index: number } | null = null;
11
+ for (let index = 0; index < entries.length; index++) {
12
+ const entry = entries[index]!;
13
+ if (entry.item.type !== "user_message" || !entry.item.text?.trim()) continue;
14
+ const seq = entry.seqStart ?? -1;
15
+ if (!latest || seq > latest.seq || (seq === latest.seq && index > latest.index)) {
16
+ latest = { text: entry.item.text, seq, index };
17
+ }
18
+ }
19
+ return latest?.text ?? null;
20
+ }
21
+
22
+ /** Appends optional instructions after the previous prompt, separated by one newline. */
23
+ export function composeResendPrompt(prompt: string, args: string): string {
24
+ const extra = args.trim();
25
+ return extra ? `${prompt}\n${extra}` : prompt;
26
+ }
@@ -0,0 +1,80 @@
1
+ export interface ResolvableOption {
2
+ id: string;
3
+ label?: string;
4
+ aliases?: readonly string[];
5
+ }
6
+
7
+ export type ResolveResult<T extends ResolvableOption> =
8
+ | { kind: "match"; option: T }
9
+ | { kind: "ambiguous"; candidates: T[] }
10
+ | { kind: "not-found" };
11
+
12
+ export interface ResolveOptionConfig {
13
+ /** Substring matching is off for large catalogs of similar IDs such as models. */
14
+ substring?: boolean;
15
+ }
16
+
17
+ /** Case-insensitive, and treats runs of spaces, `_` and `-` as one separator. */
18
+ export function normalizeKey(value: string): string {
19
+ return value.trim().toLowerCase().replace(/[\s_-]+/g, "-");
20
+ }
21
+
22
+ function keysOf(option: ResolvableOption): string[] {
23
+ const keys = [option.id];
24
+ if (option.label) keys.push(option.label);
25
+ if (option.aliases) keys.push(...option.aliases);
26
+ return keys;
27
+ }
28
+
29
+ /**
30
+ * Matches in order: exact, case-insensitive exact, unique prefix, then unique
31
+ * substring. The first stage with any hit decides; several hits are ambiguous.
32
+ */
33
+ export function resolveOption<T extends ResolvableOption>(
34
+ input: string,
35
+ options: readonly T[],
36
+ config: ResolveOptionConfig = {},
37
+ ): ResolveResult<T> {
38
+ const raw = input.trim();
39
+ if (!raw) return { kind: "not-found" };
40
+ const query = normalizeKey(raw);
41
+ const stages: Array<(key: string) => boolean> = [
42
+ (key) => key === raw,
43
+ (key) => normalizeKey(key) === query,
44
+ (key) => normalizeKey(key).startsWith(query),
45
+ ];
46
+ if (config.substring !== false) stages.push((key) => normalizeKey(key).includes(query));
47
+
48
+ for (const test of stages) {
49
+ const hits = options.filter((option) => keysOf(option).some(test));
50
+ if (hits.length === 1) return { kind: "match", option: hits[0] as T };
51
+ if (hits.length > 1) return { kind: "ambiguous", candidates: hits };
52
+ }
53
+ return { kind: "not-found" };
54
+ }
55
+
56
+ const LIST_LIMIT = 12;
57
+
58
+ export function formatList(values: readonly string[]): string {
59
+ if (values.length <= LIST_LIMIT) return values.join(", ");
60
+ return `${values.slice(0, LIST_LIMIT).join(", ")}, … (+${values.length - LIST_LIMIT})`;
61
+ }
62
+
63
+ /** Returns the option or throws a short, user-facing error. */
64
+ export function requireOption<T extends ResolvableOption>(
65
+ noun: string,
66
+ input: string,
67
+ options: readonly T[],
68
+ config?: ResolveOptionConfig,
69
+ ): T {
70
+ const result = resolveOption(input, options, config);
71
+ if (result.kind === "match") return result.option;
72
+ if (result.kind === "ambiguous") {
73
+ throw new Error(
74
+ `Ambiguous ${noun} "${input.trim()}".\nCandidates: ${formatList(result.candidates.map((option) => option.id))}`,
75
+ );
76
+ }
77
+ throw new Error(
78
+ `Unknown ${noun} "${input.trim()}".\nAvailable: ${formatList(options.map((option) => option.id))}`,
79
+ );
80
+ }
package/shared/rpc.ts ADDED
@@ -0,0 +1,42 @@
1
+ import { defineRpc } from "@getpaseo/plugin";
2
+ import { z } from "zod";
3
+
4
+ /**
5
+ * Agent mutations the plugin SDK does not expose yet. The daemon side forwards
6
+ * each one to the matching native daemon request.
7
+ */
8
+ export const AgentControlSchema = z.discriminatedUnion("op", [
9
+ z.object({ op: z.literal("model"), agentId: z.string(), modelId: z.string() }),
10
+ z.object({ op: z.literal("thinking"), agentId: z.string(), thinkingOptionId: z.string() }),
11
+ z.object({ op: z.literal("mode"), agentId: z.string(), modeId: z.string() }),
12
+ z.object({
13
+ op: z.literal("feature"),
14
+ agentId: z.string(),
15
+ featureId: z.string(),
16
+ value: z.union([z.boolean(), z.string(), z.null()]),
17
+ }),
18
+ z.object({
19
+ op: z.literal("config"),
20
+ agentId: z.string(),
21
+ config: z.object({
22
+ modelId: z.string().optional(),
23
+ modeId: z.string().optional(),
24
+ thinkingOptionId: z.string().optional(),
25
+ featureValues: z.record(z.string(), z.unknown()).optional(),
26
+ }),
27
+ }),
28
+ z.object({ op: z.literal("rename"), agentId: z.string(), title: z.string().min(1) }),
29
+ z.object({ op: z.literal("cancel"), agentId: z.string() }),
30
+ ]);
31
+
32
+ export type AgentControl = z.infer<typeof AgentControlSchema>;
33
+
34
+ export const NoticeSchema = z
35
+ .object({ type: z.enum(["info", "warning", "error"]), message: z.string() })
36
+ .nullable();
37
+
38
+ export const agentControl = defineRpc({
39
+ name: "commands.agent.control",
40
+ input: AgentControlSchema,
41
+ output: z.object({ notice: NoticeSchema }),
42
+ });
@@ -0,0 +1,13 @@
1
+ import { defineSettings } from "@getpaseo/plugin";
2
+ import { z } from "zod";
3
+
4
+ export const COMMANDS_SETTINGS = defineSettings({
5
+ id: "commands",
6
+ scope: "host",
7
+ version: 1,
8
+ schema: z.object({
9
+ disabled: z.array(z.string()).default([]),
10
+ }),
11
+ });
12
+
13
+ export type CommandsSettings = z.output<typeof COMMANDS_SETTINGS.schema>;