@ryuhq/sdk 0.2.0 → 0.2.2
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 +51 -2
- package/dist/action.cjs +839 -0
- package/dist/action.d.cts +88 -0
- package/dist/action.d.ts +88 -0
- package/dist/action.js +8 -0
- package/dist/agent-plugin.d.cts +1 -1
- package/dist/agent-plugin.d.ts +1 -1
- package/dist/agent.cjs +7 -0
- package/dist/agent.d.cts +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{app-DNaGmLVf.d.cts → app-B0Z9Ew_R.d.cts} +18 -6
- package/dist/{app-Bkw7LlCK.d.ts → app-C-BDJwfG.d.ts} +18 -6
- package/dist/builder.cjs +110 -11
- package/dist/builder.d.cts +7 -2
- package/dist/builder.d.ts +7 -2
- package/dist/builder.js +4 -3
- package/dist/chunk-4TPUZDTI.js +94 -0
- package/dist/{chunk-T5676WL2.js → chunk-BC3A7HMO.js} +1 -77
- package/dist/{chunk-IOLP5FFE.js → chunk-HLKJZAFK.js} +9 -2
- package/dist/{chunk-IEUQ3CDG.js → chunk-NZKVOSC2.js} +71 -5
- package/dist/chunk-QYFUNJOH.js +83 -0
- package/dist/{chunk-W3KPP4WN.js → chunk-SN2QBJUF.js} +20 -7
- package/dist/{chunk-ULSVL7EC.js → chunk-Z57QDDJR.js} +1 -1
- package/dist/{chunk-A3RGEPDG.js → chunk-ZTJWBRUL.js} +32 -0
- package/dist/cli.cjs +93 -8
- package/dist/cli.js +33 -8
- package/dist/index.cjs +297 -87
- package/dist/index.d.cts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.js +34 -19
- package/dist/manifest.cjs +76 -6
- package/dist/manifest.d.cts +157 -5
- package/dist/manifest.d.ts +157 -5
- package/dist/manifest.js +9 -1
- package/dist/mcp/server.d.cts +2 -1
- package/dist/mcp/server.d.ts +2 -1
- package/dist/runnable.cjs +279 -71
- package/dist/runnable.d.cts +6 -3
- package/dist/runnable.d.ts +6 -3
- package/dist/runnable.js +11 -5
- package/dist/{tool-DSx2bFx8.d.ts → tool-AjkdFvhE.d.ts} +54 -4
- package/dist/{tool-u-VR0fLF.d.cts → tool-CgzW92O_.d.cts} +54 -4
- package/package.json +12 -3
- package/src/agent-plugin.ts +1 -1
- package/src/builder.ts +9 -0
- package/src/cli-security.test.ts +109 -0
- package/src/cli.ts +43 -10
- package/src/contracts-lockstep.test.ts +16 -2
- package/src/exports-lockstep.test.ts +1 -0
- package/src/generated/plugin-manifest.ts +82 -5
- package/src/index.ts +18 -0
- package/src/manifest.fixtures.test.ts +9 -3
- package/src/manifest.test.ts +69 -0
- package/src/manifest.ts +137 -18
- package/src/mcp/server.ts +2 -1
- package/src/runnable/action.test.ts +128 -0
- package/src/runnable/action.ts +202 -0
- package/src/runnable/app.ts +45 -12
- package/src/runnable/index.ts +18 -3
- package/src/runnable/primitives.test.ts +34 -0
- package/src/runnable/primitives.ts +59 -0
- package/src/runnable/runnable-types.ts +3 -0
- package/src/runnable/tool.ts +35 -4
- package/src/runnable/turn-hook.ts +4 -2
- package/src/slash-command.test.ts +69 -0
package/dist/index.js
CHANGED
|
@@ -4,10 +4,8 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
defineAgent,
|
|
6
6
|
defineSkill,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
inlineToolRunnable
|
|
10
|
-
} from "./chunk-T5676WL2.js";
|
|
7
|
+
defineWorkflow
|
|
8
|
+
} from "./chunk-BC3A7HMO.js";
|
|
11
9
|
import {
|
|
12
10
|
AgentBuilder,
|
|
13
11
|
AppBuilder,
|
|
@@ -20,11 +18,29 @@ import {
|
|
|
20
18
|
skill,
|
|
21
19
|
tool,
|
|
22
20
|
workflow
|
|
23
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HLKJZAFK.js";
|
|
24
22
|
import {
|
|
25
23
|
appToolId,
|
|
26
24
|
defineApp
|
|
27
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-SN2QBJUF.js";
|
|
26
|
+
import {
|
|
27
|
+
Agent,
|
|
28
|
+
createAgent,
|
|
29
|
+
query,
|
|
30
|
+
ryuTool
|
|
31
|
+
} from "./chunk-Z57QDDJR.js";
|
|
32
|
+
import {
|
|
33
|
+
PRIMITIVE_BINDINGS,
|
|
34
|
+
createPrimitives,
|
|
35
|
+
httpPrimitiveTransport
|
|
36
|
+
} from "./chunk-ZTJWBRUL.js";
|
|
37
|
+
import {
|
|
38
|
+
defineAction
|
|
39
|
+
} from "./chunk-4TPUZDTI.js";
|
|
40
|
+
import {
|
|
41
|
+
defineTool,
|
|
42
|
+
inlineToolRunnable
|
|
43
|
+
} from "./chunk-QYFUNJOH.js";
|
|
28
44
|
import {
|
|
29
45
|
AppDependencySchema,
|
|
30
46
|
CapabilityReqSchema,
|
|
@@ -35,24 +51,17 @@ import {
|
|
|
35
51
|
RequiresSchema,
|
|
36
52
|
RunnableKindSchema,
|
|
37
53
|
RunnableMetaSchema,
|
|
54
|
+
SlashCommandArgumentSchema,
|
|
55
|
+
SlashCommandContributionSchema,
|
|
56
|
+
SlashCommandCustomOptionSchema,
|
|
57
|
+
SlashCommandOptionSchema,
|
|
38
58
|
SurfaceSchema,
|
|
39
59
|
ToolAppConfigSchema,
|
|
40
60
|
WidgetContributionSchema,
|
|
41
61
|
coreManifestJsonSchema,
|
|
42
62
|
validateManifestStrict,
|
|
43
63
|
validatePluginId
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import {
|
|
46
|
-
Agent,
|
|
47
|
-
createAgent,
|
|
48
|
-
query,
|
|
49
|
-
ryuTool
|
|
50
|
-
} from "./chunk-ULSVL7EC.js";
|
|
51
|
-
import {
|
|
52
|
-
PRIMITIVE_BINDINGS,
|
|
53
|
-
createPrimitives,
|
|
54
|
-
httpPrimitiveTransport
|
|
55
|
-
} from "./chunk-A3RGEPDG.js";
|
|
64
|
+
} from "./chunk-NZKVOSC2.js";
|
|
56
65
|
import {
|
|
57
66
|
ModelClient,
|
|
58
67
|
defineModel
|
|
@@ -105,7 +114,8 @@ function definePlugin(options) {
|
|
|
105
114
|
data_categories: [],
|
|
106
115
|
pi_extensions: [],
|
|
107
116
|
output_styles: [],
|
|
108
|
-
message_actions: []
|
|
117
|
+
message_actions: [],
|
|
118
|
+
selection_actions: []
|
|
109
119
|
};
|
|
110
120
|
const tools = options.tools ?? [];
|
|
111
121
|
const runnables = tools.map((t) => inlineToolRunnable(t));
|
|
@@ -154,6 +164,10 @@ export {
|
|
|
154
164
|
RunnableKindSchema,
|
|
155
165
|
RunnableMetaSchema,
|
|
156
166
|
SkillBuilder,
|
|
167
|
+
SlashCommandArgumentSchema,
|
|
168
|
+
SlashCommandContributionSchema,
|
|
169
|
+
SlashCommandCustomOptionSchema,
|
|
170
|
+
SlashCommandOptionSchema,
|
|
157
171
|
SurfaceSchema,
|
|
158
172
|
ToolAppConfigSchema,
|
|
159
173
|
ToolBuilder,
|
|
@@ -167,6 +181,7 @@ export {
|
|
|
167
181
|
coreManifestJsonSchema,
|
|
168
182
|
createAgent,
|
|
169
183
|
createPrimitives,
|
|
184
|
+
defineAction,
|
|
170
185
|
defineAgent,
|
|
171
186
|
defineApp,
|
|
172
187
|
defineModel,
|
package/dist/manifest.cjs
CHANGED
|
@@ -36,6 +36,10 @@ __export(manifest_exports, {
|
|
|
36
36
|
RunnableKindSchema: () => RunnableKindSchema,
|
|
37
37
|
RunnableMetaSchema: () => RunnableMetaSchema,
|
|
38
38
|
SetupStepSchema: () => SetupStepSchema,
|
|
39
|
+
SlashCommandArgumentSchema: () => SlashCommandArgumentSchema,
|
|
40
|
+
SlashCommandContributionSchema: () => SlashCommandContributionSchema,
|
|
41
|
+
SlashCommandCustomOptionSchema: () => SlashCommandCustomOptionSchema,
|
|
42
|
+
SlashCommandOptionSchema: () => SlashCommandOptionSchema,
|
|
39
43
|
SurfaceSchema: () => SurfaceSchema,
|
|
40
44
|
ToolAppConfigSchema: () => ToolAppConfigSchema,
|
|
41
45
|
TurnHookContributionSchema: () => TurnHookContributionSchema,
|
|
@@ -47,7 +51,7 @@ __export(manifest_exports, {
|
|
|
47
51
|
});
|
|
48
52
|
module.exports = __toCommonJS(manifest_exports);
|
|
49
53
|
|
|
50
|
-
// ../../node_modules/.bun/tsup@8.5.1+
|
|
54
|
+
// ../../node_modules/.bun/tsup@8.5.1+68ce2442ac00f52e/node_modules/tsup/assets/cjs_shims.js
|
|
51
55
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
52
56
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
53
57
|
|
|
@@ -215,10 +219,18 @@ var ChatWidgetTemplateSchema = import_zod.z.object({
|
|
|
215
219
|
}).superRefine((value, ctx) => {
|
|
216
220
|
const count = Number(Boolean(value.backing.tool_id)) + Number(Boolean(value.backing.view_id));
|
|
217
221
|
if (count !== 1 && value.availability === "available") {
|
|
218
|
-
ctx.addIssue({
|
|
222
|
+
ctx.addIssue({
|
|
223
|
+
code: "custom",
|
|
224
|
+
path: ["backing"],
|
|
225
|
+
message: "available templates need exactly one backing tool_id or view_id"
|
|
226
|
+
});
|
|
219
227
|
}
|
|
220
228
|
if (count > 1) {
|
|
221
|
-
ctx.addIssue({
|
|
229
|
+
ctx.addIssue({
|
|
230
|
+
code: "custom",
|
|
231
|
+
path: ["backing"],
|
|
232
|
+
message: "backing must declare at most one of tool_id or view_id"
|
|
233
|
+
});
|
|
222
234
|
}
|
|
223
235
|
});
|
|
224
236
|
var ToolAppConfigSchema = import_zod.z.object({
|
|
@@ -241,6 +253,33 @@ var ToolAppConfigSchema = import_zod.z.object({
|
|
|
241
253
|
/** Optional status label shown when the render tool finishes. */
|
|
242
254
|
invoked: import_zod.z.string().optional()
|
|
243
255
|
});
|
|
256
|
+
var SlashCommandOptionSchema = import_zod.z.object({
|
|
257
|
+
description: import_zod.z.string().optional(),
|
|
258
|
+
label: import_zod.z.string().min(1),
|
|
259
|
+
value: import_zod.z.string().min(1)
|
|
260
|
+
}).passthrough();
|
|
261
|
+
var SlashCommandCustomOptionSchema = import_zod.z.union([
|
|
262
|
+
import_zod.z.literal(true),
|
|
263
|
+
import_zod.z.object({
|
|
264
|
+
description: import_zod.z.string().optional(),
|
|
265
|
+
label: import_zod.z.string().min(1).optional()
|
|
266
|
+
}).passthrough()
|
|
267
|
+
]);
|
|
268
|
+
var SlashCommandArgumentSchema = import_zod.z.object({
|
|
269
|
+
allow_custom: import_zod.z.boolean().optional(),
|
|
270
|
+
custom: SlashCommandCustomOptionSchema.optional(),
|
|
271
|
+
description: import_zod.z.string().optional(),
|
|
272
|
+
name: import_zod.z.string().min(1),
|
|
273
|
+
options: import_zod.z.array(SlashCommandOptionSchema).optional()
|
|
274
|
+
}).passthrough();
|
|
275
|
+
var SlashCommandContributionSchema = import_zod.z.object({
|
|
276
|
+
args: import_zod.z.array(SlashCommandArgumentSchema).optional(),
|
|
277
|
+
body: import_zod.z.string().optional(),
|
|
278
|
+
command: import_zod.z.string().min(1),
|
|
279
|
+
description: import_zod.z.string().optional(),
|
|
280
|
+
id: import_zod.z.string().optional(),
|
|
281
|
+
parameters: import_zod.z.array(SlashCommandArgumentSchema).optional()
|
|
282
|
+
}).passthrough();
|
|
244
283
|
var ContributesSchema = import_zod.z.object({
|
|
245
284
|
turn_hooks: import_zod.z.array(TurnHookContributionSchema).default([]),
|
|
246
285
|
/** App events this plugin EMITS — the provider half of the hook system, whose
|
|
@@ -255,7 +294,7 @@ var ContributesSchema = import_zod.z.object({
|
|
|
255
294
|
* feature declaration before signing. */
|
|
256
295
|
chat_features: import_zod.z.array(import_zod.z.record(import_zod.z.string(), import_zod.z.unknown())).default([]),
|
|
257
296
|
settings_tabs: import_zod.z.array(import_zod.z.record(import_zod.z.string(), import_zod.z.unknown())).default([]),
|
|
258
|
-
slash_commands: import_zod.z.array(
|
|
297
|
+
slash_commands: import_zod.z.array(SlashCommandContributionSchema).default([]),
|
|
259
298
|
/** App widgets (Ryu Apps). Each binds a render tool id to its
|
|
260
299
|
* `ui://widget/<slug>.html` template. Mirrors the Rust-side
|
|
261
300
|
* `Contributes.widgets` field, without which the CLI's zod parse would strip
|
|
@@ -322,7 +361,10 @@ var ContributesSchema = import_zod.z.object({
|
|
|
322
361
|
output_styles: import_zod.z.array(OutputStyleContributionSchema).default([]),
|
|
323
362
|
/** Per-message actions contributed by an enabled plugin. Kept as loose records
|
|
324
363
|
* so renderer-specific `kind`/`args` payloads survive `ryu pack` unchanged. */
|
|
325
|
-
message_actions: import_zod.z.array(import_zod.z.record(import_zod.z.string(), import_zod.z.unknown())).default([])
|
|
364
|
+
message_actions: import_zod.z.array(import_zod.z.record(import_zod.z.string(), import_zod.z.unknown())).default([]),
|
|
365
|
+
/** Buttons contributed to the floating text-selection toolbar. Kept as loose
|
|
366
|
+
* records so host-owned dispatch args survive `ryu pack` unchanged. */
|
|
367
|
+
selection_actions: import_zod.z.array(import_zod.z.record(import_zod.z.string(), import_zod.z.unknown())).default([])
|
|
326
368
|
});
|
|
327
369
|
var SetupStepSchema = import_zod.z.object({
|
|
328
370
|
/** Card heading (e.g. the companion app name). */
|
|
@@ -472,6 +514,9 @@ var PluginManifestSchema = import_zod.z.object({
|
|
|
472
514
|
/^\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)?$/,
|
|
473
515
|
"version must be a valid semver string (e.g. 1.0.0)"
|
|
474
516
|
),
|
|
517
|
+
/** Core-owned release maturity metadata. The Rust contract validates the
|
|
518
|
+
* richer shape; the SDK authoring parser must preserve it for pack/publish. */
|
|
519
|
+
stability: import_zod.z.unknown().optional(),
|
|
475
520
|
/**
|
|
476
521
|
* Lower-case hex `sha256(utf8_bytes(ui_code))` binding the plugin's bundled
|
|
477
522
|
* sandboxed-UI code to this manifest. `ryu pack` / `ryu publish` compute it and
|
|
@@ -489,8 +534,26 @@ var PluginManifestSchema = import_zod.z.object({
|
|
|
489
534
|
* Declarations only — grant enforcement is the Gateway's responsibility.
|
|
490
535
|
*/
|
|
491
536
|
permission_grants: import_zod.z.array(import_zod.z.string()).default([]),
|
|
537
|
+
/** Deny-by-default sandbox permissions. Core remains authoritative; this
|
|
538
|
+
* schema mirrors the fields so `ryu pack` cannot strip them. */
|
|
539
|
+
permissions: import_zod.z.object({
|
|
540
|
+
fs: import_zod.z.object({
|
|
541
|
+
read: import_zod.z.array(import_zod.z.string()).default([]),
|
|
542
|
+
write: import_zod.z.array(import_zod.z.string()).default([])
|
|
543
|
+
}).optional(),
|
|
544
|
+
child_process: import_zod.z.boolean().optional(),
|
|
545
|
+
run: import_zod.z.array(import_zod.z.string()).default([]),
|
|
546
|
+
network: import_zod.z.union([import_zod.z.boolean(), import_zod.z.array(import_zod.z.string())]).optional(),
|
|
547
|
+
tool: import_zod.z.array(import_zod.z.string()).default([])
|
|
548
|
+
}).optional(),
|
|
549
|
+
/** Core-owned permission presentation levels. Preserved verbatim here and
|
|
550
|
+
* validated by Core's authoritative manifest contract. */
|
|
551
|
+
permission_levels: import_zod.z.unknown().optional(),
|
|
492
552
|
/** Remote or stdio MCP servers registered by this plugin. */
|
|
493
553
|
mcp_servers: import_zod.z.record(import_zod.z.string(), McpServerDeclSchema).optional(),
|
|
554
|
+
/** Core-owned sidecar declarations. Their full process/HTTP schema stays in
|
|
555
|
+
* the Rust contract; this authoring layer must never strip them. */
|
|
556
|
+
sidecars: import_zod.z.unknown().optional(),
|
|
494
557
|
/**
|
|
495
558
|
* Optional Companion surface (an in-desktop overlay or sidebar panel).
|
|
496
559
|
* Absent when the plugin has no Companion surface.
|
|
@@ -526,6 +589,9 @@ var PluginManifestSchema = import_zod.z.object({
|
|
|
526
589
|
* an unsupported-target plugin stays installable and inspectable.
|
|
527
590
|
*/
|
|
528
591
|
targets: import_zod.z.array(SurfaceSchema).default([]),
|
|
592
|
+
/** Rich per-surface declarations (`support`, UI, contributed commands, …).
|
|
593
|
+
* Core owns and validates the nested vocabulary. */
|
|
594
|
+
surfaces: import_zod.z.unknown().optional(),
|
|
529
595
|
/**
|
|
530
596
|
* Host version floors — the semver requirement each surface must satisfy for
|
|
531
597
|
* this plugin to install. Mirrors Core's `EnginesReq`
|
|
@@ -640,7 +706,7 @@ var PluginManifestSchema = import_zod.z.object({
|
|
|
640
706
|
* array of steps guiding the user through post-install configuration.
|
|
641
707
|
*/
|
|
642
708
|
setup: import_zod.z.union([SetupStepSchema, import_zod.z.array(SetupStepSchema)]).optional()
|
|
643
|
-
}).superRefine((manifest, context) => {
|
|
709
|
+
}).passthrough().superRefine((manifest, context) => {
|
|
644
710
|
const hasOAuthServer = Object.values(manifest.mcp_servers ?? {}).some(
|
|
645
711
|
(server) => server.auth?.type === "oauth"
|
|
646
712
|
);
|
|
@@ -684,6 +750,10 @@ function coreManifestJsonSchema() {
|
|
|
684
750
|
RunnableKindSchema,
|
|
685
751
|
RunnableMetaSchema,
|
|
686
752
|
SetupStepSchema,
|
|
753
|
+
SlashCommandArgumentSchema,
|
|
754
|
+
SlashCommandContributionSchema,
|
|
755
|
+
SlashCommandCustomOptionSchema,
|
|
756
|
+
SlashCommandOptionSchema,
|
|
687
757
|
SurfaceSchema,
|
|
688
758
|
ToolAppConfigSchema,
|
|
689
759
|
TurnHookContributionSchema,
|
package/dist/manifest.d.cts
CHANGED
|
@@ -217,10 +217,80 @@ declare const ToolAppConfigSchema: z.ZodObject<{
|
|
|
217
217
|
invoked: z.ZodOptional<z.ZodString>;
|
|
218
218
|
}, z.core.$strip>;
|
|
219
219
|
type ToolAppConfig = z.infer<typeof ToolAppConfigSchema>;
|
|
220
|
+
/** One selectable value for a plugin/app slash-command argument. */
|
|
221
|
+
declare const SlashCommandOptionSchema: z.ZodObject<{
|
|
222
|
+
description: z.ZodOptional<z.ZodString>;
|
|
223
|
+
label: z.ZodString;
|
|
224
|
+
value: z.ZodString;
|
|
225
|
+
}, z.core.$loose>;
|
|
226
|
+
type SlashCommandOption = z.infer<typeof SlashCommandOptionSchema>;
|
|
227
|
+
/** A registered free-form option shown alongside an argument's choices. */
|
|
228
|
+
declare const SlashCommandCustomOptionSchema: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
229
|
+
description: z.ZodOptional<z.ZodString>;
|
|
230
|
+
label: z.ZodOptional<z.ZodString>;
|
|
231
|
+
}, z.core.$loose>]>;
|
|
232
|
+
type SlashCommandCustomOption = z.infer<typeof SlashCommandCustomOptionSchema>;
|
|
233
|
+
/** One sequential argument in a plugin/app slash command. */
|
|
234
|
+
declare const SlashCommandArgumentSchema: z.ZodObject<{
|
|
235
|
+
allow_custom: z.ZodOptional<z.ZodBoolean>;
|
|
236
|
+
custom: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
237
|
+
description: z.ZodOptional<z.ZodString>;
|
|
238
|
+
label: z.ZodOptional<z.ZodString>;
|
|
239
|
+
}, z.core.$loose>]>>;
|
|
240
|
+
description: z.ZodOptional<z.ZodString>;
|
|
241
|
+
name: z.ZodString;
|
|
242
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
243
|
+
description: z.ZodOptional<z.ZodString>;
|
|
244
|
+
label: z.ZodString;
|
|
245
|
+
value: z.ZodString;
|
|
246
|
+
}, z.core.$loose>>>;
|
|
247
|
+
}, z.core.$loose>;
|
|
248
|
+
type SlashCommandArgument = z.infer<typeof SlashCommandArgumentSchema>;
|
|
249
|
+
/**
|
|
250
|
+
* A command registered by a plugin or Ryu App. `args` is the preferred key;
|
|
251
|
+
* `parameters` is accepted as a readable alias for hand-authored manifests.
|
|
252
|
+
* Each argument's options are plugin-owned, so the shell never needs a closed
|
|
253
|
+
* enum for app-specific values.
|
|
254
|
+
*/
|
|
255
|
+
declare const SlashCommandContributionSchema: z.ZodObject<{
|
|
256
|
+
args: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
257
|
+
allow_custom: z.ZodOptional<z.ZodBoolean>;
|
|
258
|
+
custom: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
259
|
+
description: z.ZodOptional<z.ZodString>;
|
|
260
|
+
label: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, z.core.$loose>]>>;
|
|
262
|
+
description: z.ZodOptional<z.ZodString>;
|
|
263
|
+
name: z.ZodString;
|
|
264
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
265
|
+
description: z.ZodOptional<z.ZodString>;
|
|
266
|
+
label: z.ZodString;
|
|
267
|
+
value: z.ZodString;
|
|
268
|
+
}, z.core.$loose>>>;
|
|
269
|
+
}, z.core.$loose>>>;
|
|
270
|
+
body: z.ZodOptional<z.ZodString>;
|
|
271
|
+
command: z.ZodString;
|
|
272
|
+
description: z.ZodOptional<z.ZodString>;
|
|
273
|
+
id: z.ZodOptional<z.ZodString>;
|
|
274
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
275
|
+
allow_custom: z.ZodOptional<z.ZodBoolean>;
|
|
276
|
+
custom: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
277
|
+
description: z.ZodOptional<z.ZodString>;
|
|
278
|
+
label: z.ZodOptional<z.ZodString>;
|
|
279
|
+
}, z.core.$loose>]>>;
|
|
280
|
+
description: z.ZodOptional<z.ZodString>;
|
|
281
|
+
name: z.ZodString;
|
|
282
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
283
|
+
description: z.ZodOptional<z.ZodString>;
|
|
284
|
+
label: z.ZodString;
|
|
285
|
+
value: z.ZodString;
|
|
286
|
+
}, z.core.$loose>>>;
|
|
287
|
+
}, z.core.$loose>>>;
|
|
288
|
+
}, z.core.$loose>;
|
|
289
|
+
type SlashCommandContribution = z.infer<typeof SlashCommandContributionSchema>;
|
|
220
290
|
/**
|
|
221
291
|
* The `contributes` block. Mirrors `Contributes` in
|
|
222
292
|
* `apps/core/src/plugin_manifest/mod.rs`. The declarative UI surfaces
|
|
223
|
-
* (`composer_controls` / `chat_features` / `settings_tabs`
|
|
293
|
+
* (`composer_controls` / `chat_features` / `settings_tabs`) are passed verbatim
|
|
224
294
|
* to the desktop renderer, so they are typed loosely here (records).
|
|
225
295
|
*/
|
|
226
296
|
declare const ContributesSchema: z.ZodObject<{
|
|
@@ -245,7 +315,40 @@ declare const ContributesSchema: z.ZodObject<{
|
|
|
245
315
|
composer_controls: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
246
316
|
chat_features: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
247
317
|
settings_tabs: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
248
|
-
slash_commands: z.ZodDefault<z.ZodArray<z.
|
|
318
|
+
slash_commands: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
319
|
+
args: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
320
|
+
allow_custom: z.ZodOptional<z.ZodBoolean>;
|
|
321
|
+
custom: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
322
|
+
description: z.ZodOptional<z.ZodString>;
|
|
323
|
+
label: z.ZodOptional<z.ZodString>;
|
|
324
|
+
}, z.core.$loose>]>>;
|
|
325
|
+
description: z.ZodOptional<z.ZodString>;
|
|
326
|
+
name: z.ZodString;
|
|
327
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
328
|
+
description: z.ZodOptional<z.ZodString>;
|
|
329
|
+
label: z.ZodString;
|
|
330
|
+
value: z.ZodString;
|
|
331
|
+
}, z.core.$loose>>>;
|
|
332
|
+
}, z.core.$loose>>>;
|
|
333
|
+
body: z.ZodOptional<z.ZodString>;
|
|
334
|
+
command: z.ZodString;
|
|
335
|
+
description: z.ZodOptional<z.ZodString>;
|
|
336
|
+
id: z.ZodOptional<z.ZodString>;
|
|
337
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
338
|
+
allow_custom: z.ZodOptional<z.ZodBoolean>;
|
|
339
|
+
custom: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
340
|
+
description: z.ZodOptional<z.ZodString>;
|
|
341
|
+
label: z.ZodOptional<z.ZodString>;
|
|
342
|
+
}, z.core.$loose>]>>;
|
|
343
|
+
description: z.ZodOptional<z.ZodString>;
|
|
344
|
+
name: z.ZodString;
|
|
345
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
346
|
+
description: z.ZodOptional<z.ZodString>;
|
|
347
|
+
label: z.ZodString;
|
|
348
|
+
value: z.ZodString;
|
|
349
|
+
}, z.core.$loose>>>;
|
|
350
|
+
}, z.core.$loose>>>;
|
|
351
|
+
}, z.core.$loose>>>;
|
|
249
352
|
widgets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
250
353
|
tool_id: z.ZodString;
|
|
251
354
|
uri: z.ZodString;
|
|
@@ -284,6 +387,7 @@ declare const ContributesSchema: z.ZodObject<{
|
|
|
284
387
|
source: z.ZodOptional<z.ZodString>;
|
|
285
388
|
}, z.core.$strip>>>;
|
|
286
389
|
message_actions: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
390
|
+
selection_actions: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
287
391
|
}, z.core.$strip>;
|
|
288
392
|
type Contributes = z.infer<typeof ContributesSchema>;
|
|
289
393
|
/**
|
|
@@ -434,6 +538,7 @@ declare const PluginManifestSchema: z.ZodObject<{
|
|
|
434
538
|
id: z.ZodString;
|
|
435
539
|
name: z.ZodString;
|
|
436
540
|
version: z.ZodString;
|
|
541
|
+
stability: z.ZodOptional<z.ZodUnknown>;
|
|
437
542
|
ui_code_sha256: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
438
543
|
runnables: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
439
544
|
id: z.ZodString;
|
|
@@ -448,6 +553,17 @@ declare const PluginManifestSchema: z.ZodObject<{
|
|
|
448
553
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
449
554
|
}, z.core.$strip>>>;
|
|
450
555
|
permission_grants: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
556
|
+
permissions: z.ZodOptional<z.ZodObject<{
|
|
557
|
+
fs: z.ZodOptional<z.ZodObject<{
|
|
558
|
+
read: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
559
|
+
write: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
560
|
+
}, z.core.$strip>>;
|
|
561
|
+
child_process: z.ZodOptional<z.ZodBoolean>;
|
|
562
|
+
run: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
563
|
+
network: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
564
|
+
tool: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
565
|
+
}, z.core.$strip>>;
|
|
566
|
+
permission_levels: z.ZodOptional<z.ZodUnknown>;
|
|
451
567
|
mcp_servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
452
568
|
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
453
569
|
auth: z.ZodOptional<z.ZodObject<{
|
|
@@ -469,6 +585,7 @@ declare const PluginManifestSchema: z.ZodObject<{
|
|
|
469
585
|
}>>;
|
|
470
586
|
url: z.ZodOptional<z.ZodURL>;
|
|
471
587
|
}, z.core.$strip>>>;
|
|
588
|
+
sidecars: z.ZodOptional<z.ZodUnknown>;
|
|
472
589
|
companion: z.ZodOptional<z.ZodObject<{
|
|
473
590
|
label: z.ZodString;
|
|
474
591
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -497,7 +614,40 @@ declare const PluginManifestSchema: z.ZodObject<{
|
|
|
497
614
|
composer_controls: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
498
615
|
chat_features: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
499
616
|
settings_tabs: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
500
|
-
slash_commands: z.ZodDefault<z.ZodArray<z.
|
|
617
|
+
slash_commands: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
618
|
+
args: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
619
|
+
allow_custom: z.ZodOptional<z.ZodBoolean>;
|
|
620
|
+
custom: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
621
|
+
description: z.ZodOptional<z.ZodString>;
|
|
622
|
+
label: z.ZodOptional<z.ZodString>;
|
|
623
|
+
}, z.core.$loose>]>>;
|
|
624
|
+
description: z.ZodOptional<z.ZodString>;
|
|
625
|
+
name: z.ZodString;
|
|
626
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
627
|
+
description: z.ZodOptional<z.ZodString>;
|
|
628
|
+
label: z.ZodString;
|
|
629
|
+
value: z.ZodString;
|
|
630
|
+
}, z.core.$loose>>>;
|
|
631
|
+
}, z.core.$loose>>>;
|
|
632
|
+
body: z.ZodOptional<z.ZodString>;
|
|
633
|
+
command: z.ZodString;
|
|
634
|
+
description: z.ZodOptional<z.ZodString>;
|
|
635
|
+
id: z.ZodOptional<z.ZodString>;
|
|
636
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
637
|
+
allow_custom: z.ZodOptional<z.ZodBoolean>;
|
|
638
|
+
custom: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
639
|
+
description: z.ZodOptional<z.ZodString>;
|
|
640
|
+
label: z.ZodOptional<z.ZodString>;
|
|
641
|
+
}, z.core.$loose>]>>;
|
|
642
|
+
description: z.ZodOptional<z.ZodString>;
|
|
643
|
+
name: z.ZodString;
|
|
644
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
645
|
+
description: z.ZodOptional<z.ZodString>;
|
|
646
|
+
label: z.ZodString;
|
|
647
|
+
value: z.ZodString;
|
|
648
|
+
}, z.core.$loose>>>;
|
|
649
|
+
}, z.core.$loose>>>;
|
|
650
|
+
}, z.core.$loose>>>;
|
|
501
651
|
widgets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
502
652
|
tool_id: z.ZodString;
|
|
503
653
|
uri: z.ZodString;
|
|
@@ -536,6 +686,7 @@ declare const PluginManifestSchema: z.ZodObject<{
|
|
|
536
686
|
source: z.ZodOptional<z.ZodString>;
|
|
537
687
|
}, z.core.$strip>>>;
|
|
538
688
|
message_actions: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
689
|
+
selection_actions: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
539
690
|
}, z.core.$strip>>;
|
|
540
691
|
requires: z.ZodOptional<z.ZodObject<{
|
|
541
692
|
apps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -558,6 +709,7 @@ declare const PluginManifestSchema: z.ZodObject<{
|
|
|
558
709
|
web: "web";
|
|
559
710
|
cli: "cli";
|
|
560
711
|
}>>>;
|
|
712
|
+
surfaces: z.ZodOptional<z.ZodUnknown>;
|
|
561
713
|
engines: z.ZodOptional<z.ZodObject<{
|
|
562
714
|
cli: z.ZodOptional<z.ZodString>;
|
|
563
715
|
desktop: z.ZodOptional<z.ZodString>;
|
|
@@ -627,7 +779,7 @@ declare const PluginManifestSchema: z.ZodObject<{
|
|
|
627
779
|
actionLabel: z.ZodOptional<z.ZodString>;
|
|
628
780
|
actionUrl: z.ZodOptional<z.ZodString>;
|
|
629
781
|
}, z.core.$strip>>]>>;
|
|
630
|
-
}, z.core.$
|
|
782
|
+
}, z.core.$loose>;
|
|
631
783
|
type PluginManifest = z.infer<typeof PluginManifestSchema>;
|
|
632
784
|
/**
|
|
633
785
|
* Validate a plugin id with Core's strict reverse-domain, path-traversal-safe
|
|
@@ -646,4 +798,4 @@ declare function validateManifestStrict(manifestJson: string): string;
|
|
|
646
798
|
*/
|
|
647
799
|
declare function coreManifestJsonSchema(): unknown;
|
|
648
800
|
|
|
649
|
-
export { type AppDependency, AppDependencySchema, type CapabilityReq, CapabilityReqSchema, type ChatWidgetTemplate, ChatWidgetTemplateSchema, type CompanionSurface, CompanionSurfaceSchema, type Contributes, ContributesSchema, type EnginesReq, EnginesReqSchema, type HookEventContribution, HookEventContributionSchema, type McpServerAuth, McpServerAuthSchema, type McpServerDecl, McpServerDeclSchema, type OutputStyleContribution, OutputStyleContributionSchema, type PiExtensionContribution, PiExtensionContributionSchema, type PluginManifest, PluginManifestSchema, type Requires, RequiresSchema, type RunnableKind, RunnableKindSchema, type RunnableMeta, RunnableMetaSchema, type SetupStep, SetupStepSchema, type Surface, SurfaceSchema, type ToolAppConfig, ToolAppConfigSchema, type TurnHookContribution, TurnHookContributionSchema, type WidgetContribution, WidgetContributionSchema, coreManifestJsonSchema, labelImpersonatesSystemChrome, validateManifestStrict, validatePluginId };
|
|
801
|
+
export { type AppDependency, AppDependencySchema, type CapabilityReq, CapabilityReqSchema, type ChatWidgetTemplate, ChatWidgetTemplateSchema, type CompanionSurface, CompanionSurfaceSchema, type Contributes, ContributesSchema, type EnginesReq, EnginesReqSchema, type HookEventContribution, HookEventContributionSchema, type McpServerAuth, McpServerAuthSchema, type McpServerDecl, McpServerDeclSchema, type OutputStyleContribution, OutputStyleContributionSchema, type PiExtensionContribution, PiExtensionContributionSchema, type PluginManifest, PluginManifestSchema, type Requires, RequiresSchema, type RunnableKind, RunnableKindSchema, type RunnableMeta, RunnableMetaSchema, type SetupStep, SetupStepSchema, type SlashCommandArgument, SlashCommandArgumentSchema, type SlashCommandContribution, SlashCommandContributionSchema, type SlashCommandCustomOption, SlashCommandCustomOptionSchema, type SlashCommandOption, SlashCommandOptionSchema, type Surface, SurfaceSchema, type ToolAppConfig, ToolAppConfigSchema, type TurnHookContribution, TurnHookContributionSchema, type WidgetContribution, WidgetContributionSchema, coreManifestJsonSchema, labelImpersonatesSystemChrome, validateManifestStrict, validatePluginId };
|