@x-otto/plugin 0.1.0-alpha.1 → 0.1.0-alpha.11

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/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { TypedEventEmitter } from "@x-otto/shared";
3
3
  import * as _$_x_otto_interchange0 from "@x-otto/interchange";
4
- import { PluginInputRegistry, SigilEntry, SigilKind, SigilPrefix, SigilProvider, SigilSource, sigilOf } from "@x-otto/interchange";
4
+ import { PluginInputRegistry, PluginInputRegistry as PluginInputRegistry$1, SigilEntry, SigilEntry as SigilEntry$1, SigilKind, SigilPrefix, SigilProvider, SigilProvider as SigilProvider$1, SigilSource, sigilOf } from "@x-otto/interchange";
5
5
  import * as _$_x_otto_provider0 from "@x-otto/provider";
6
+ import { HookAbortSignal, HookPayloadMap, WaterfallTiming } from "@x-otto/hook-contracts";
6
7
 
7
8
  //#region src/capabilities.d.ts
8
9
  /**
@@ -21,7 +22,7 @@ import * as _$_x_otto_provider0 from "@x-otto/provider";
21
22
  * - 非高危 = 纯数据 / 用户显式触发 / 写面物理隔离 / 单向推送不进入模型上下文。
22
23
  */
23
24
  /** 能力声明词表(RFC-105 D8)。详见各能力注释。 */
24
- declare const PLUGIN_CAPABILITIES: readonly ["provider", "tools", "hooks", "tui.renderer", "network", "context", "monitor", "wire-protocol", "a2ui.component", "panel.backend", "mcp.server", "feedback", "input.resolver", "a2ui.renderer", "theme", "agent.dispatch", "service", "storage", "session.read", "llm.complete", "user.notify", "user.ask"];
25
+ declare const PLUGIN_CAPABILITIES: readonly ["provider", "tools", "hooks", "tui.renderer", "network", "context", "monitor", "wire-protocol", "a2ui.component", "panel.backend", "mcp.server", "feedback", "input.resolver", "a2ui.renderer", "theme", "agent.dispatch", "service", "storage", "session.read", "llm.complete", "user.notify", "user.ask", "config", "credentials", "cli.command", "tui.command", "events", "settings.read", "schedule"];
25
26
  type PluginCapability = (typeof PLUGIN_CAPABILITIES)[number];
26
27
  /**
27
28
  * 高危能力轴(RFC-105 D8):既有布尔信任**不**自动授予这些轴——已信任插件升级后首次
@@ -240,6 +241,10 @@ declare const modelEntrySchema: z.ZodObject<{
240
241
  "long-context": "long-context";
241
242
  }>>>>;
242
243
  reasoning: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
244
+ input: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodEnum<{
245
+ text: "text";
246
+ image: "image";
247
+ }>>>>;
243
248
  thinkingLevels: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodEnum<{
244
249
  low: "low";
245
250
  medium: "medium";
@@ -400,11 +405,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
400
405
  success: "success";
401
406
  error: "error";
402
407
  accent: "accent";
408
+ text: "text";
403
409
  brand: "brand";
404
410
  brandShimmer: "brandShimmer";
405
411
  accentDim: "accentDim";
406
412
  accentBright: "accentBright";
407
- text: "text";
408
413
  inactive: "inactive";
409
414
  secondary: "secondary";
410
415
  subtle: "subtle";
@@ -429,11 +434,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
429
434
  success: "success";
430
435
  error: "error";
431
436
  accent: "accent";
437
+ text: "text";
432
438
  brand: "brand";
433
439
  brandShimmer: "brandShimmer";
434
440
  accentDim: "accentDim";
435
441
  accentBright: "accentBright";
436
- text: "text";
437
442
  inactive: "inactive";
438
443
  secondary: "secondary";
439
444
  subtle: "subtle";
@@ -458,11 +463,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
458
463
  success: "success";
459
464
  error: "error";
460
465
  accent: "accent";
466
+ text: "text";
461
467
  brand: "brand";
462
468
  brandShimmer: "brandShimmer";
463
469
  accentDim: "accentDim";
464
470
  accentBright: "accentBright";
465
- text: "text";
466
471
  inactive: "inactive";
467
472
  secondary: "secondary";
468
473
  subtle: "subtle";
@@ -487,11 +492,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
487
492
  success: "success";
488
493
  error: "error";
489
494
  accent: "accent";
495
+ text: "text";
490
496
  brand: "brand";
491
497
  brandShimmer: "brandShimmer";
492
498
  accentDim: "accentDim";
493
499
  accentBright: "accentBright";
494
- text: "text";
495
500
  inactive: "inactive";
496
501
  secondary: "secondary";
497
502
  subtle: "subtle";
@@ -516,11 +521,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
516
521
  success: "success";
517
522
  error: "error";
518
523
  accent: "accent";
524
+ text: "text";
519
525
  brand: "brand";
520
526
  brandShimmer: "brandShimmer";
521
527
  accentDim: "accentDim";
522
528
  accentBright: "accentBright";
523
- text: "text";
524
529
  inactive: "inactive";
525
530
  secondary: "secondary";
526
531
  subtle: "subtle";
@@ -545,11 +550,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
545
550
  success: "success";
546
551
  error: "error";
547
552
  accent: "accent";
553
+ text: "text";
548
554
  brand: "brand";
549
555
  brandShimmer: "brandShimmer";
550
556
  accentDim: "accentDim";
551
557
  accentBright: "accentBright";
552
- text: "text";
553
558
  inactive: "inactive";
554
559
  secondary: "secondary";
555
560
  subtle: "subtle";
@@ -574,11 +579,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
574
579
  success: "success";
575
580
  error: "error";
576
581
  accent: "accent";
582
+ text: "text";
577
583
  brand: "brand";
578
584
  brandShimmer: "brandShimmer";
579
585
  accentDim: "accentDim";
580
586
  accentBright: "accentBright";
581
- text: "text";
582
587
  inactive: "inactive";
583
588
  secondary: "secondary";
584
589
  subtle: "subtle";
@@ -603,11 +608,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
603
608
  success: "success";
604
609
  error: "error";
605
610
  accent: "accent";
611
+ text: "text";
606
612
  brand: "brand";
607
613
  brandShimmer: "brandShimmer";
608
614
  accentDim: "accentDim";
609
615
  accentBright: "accentBright";
610
- text: "text";
611
616
  inactive: "inactive";
612
617
  secondary: "secondary";
613
618
  subtle: "subtle";
@@ -632,11 +637,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
632
637
  success: "success";
633
638
  error: "error";
634
639
  accent: "accent";
640
+ text: "text";
635
641
  brand: "brand";
636
642
  brandShimmer: "brandShimmer";
637
643
  accentDim: "accentDim";
638
644
  accentBright: "accentBright";
639
- text: "text";
640
645
  inactive: "inactive";
641
646
  secondary: "secondary";
642
647
  subtle: "subtle";
@@ -661,11 +666,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
661
666
  success: "success";
662
667
  error: "error";
663
668
  accent: "accent";
669
+ text: "text";
664
670
  brand: "brand";
665
671
  brandShimmer: "brandShimmer";
666
672
  accentDim: "accentDim";
667
673
  accentBright: "accentBright";
668
- text: "text";
669
674
  inactive: "inactive";
670
675
  secondary: "secondary";
671
676
  subtle: "subtle";
@@ -690,11 +695,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
690
695
  success: "success";
691
696
  error: "error";
692
697
  accent: "accent";
698
+ text: "text";
693
699
  brand: "brand";
694
700
  brandShimmer: "brandShimmer";
695
701
  accentDim: "accentDim";
696
702
  accentBright: "accentBright";
697
- text: "text";
698
703
  inactive: "inactive";
699
704
  secondary: "secondary";
700
705
  subtle: "subtle";
@@ -719,11 +724,11 @@ declare const themePresetContributionSchema: z.ZodObject<{
719
724
  success: "success";
720
725
  error: "error";
721
726
  accent: "accent";
727
+ text: "text";
722
728
  brand: "brand";
723
729
  brandShimmer: "brandShimmer";
724
730
  accentDim: "accentDim";
725
731
  accentBright: "accentBright";
726
- text: "text";
727
732
  inactive: "inactive";
728
733
  secondary: "secondary";
729
734
  subtle: "subtle";
@@ -768,6 +773,14 @@ declare const MAX_I18N_TRANSLATION_BYTES: number;
768
773
  declare const MAX_I18N_LOCALE_FILES_PER_PLUGIN = 20;
769
774
  /** 单个 locale 文件的字节上限(RFC-141 D4,对齐 `context-sources.ts` 的 `MAX_CONTENT_BYTES` 纪律,超限整个文件跳过)。 */
770
775
  declare const MAX_I18N_FILE_BYTES: number;
776
+ /** 单插件可声明的配置字段数上限(RFC-401 D4,防海量字段内存膨胀 DoS)。 */
777
+ declare const MAX_CONFIG_FIELDS_PER_PLUGIN = 32;
778
+ /** 配置 schema 最大嵌套深度(RFC-401 D4,防深嵌套解析 DoS)。 */
779
+ declare const MAX_CONFIG_SCHEMA_DEPTH = 4;
780
+ /** 配置 schema 片段总字节数上限(RFC-401 D4,对齐 i18n 文件上限纪律)。 */
781
+ declare const MAX_CONFIG_SCHEMA_BYTES: number;
782
+ /** 单字段 description 最大字符数(RFC-401 D4,防 UI 渲染膨胀)。 */
783
+ declare const MAX_CONFIG_FIELD_DESCRIPTION_CHARS = 256;
771
784
  /**
772
785
  * 性能采集器贡献(RFC-116 §8:插件可执行的指标采集器,非静态文本)。
773
786
  * `toolRef` 引用同插件 `contributes.tools` 已声明的某个工具名——该工具的返回值即本
@@ -809,6 +822,7 @@ declare const providerEntrySchema: z.ZodObject<{
809
822
  } | undefined;
810
823
  strengths?: ("planning" | "knowledge" | "coding" | "reasoning" | "vision" | "speed" | "long-context")[] | undefined;
811
824
  reasoning?: boolean | undefined;
825
+ input?: ("text" | "image")[] | undefined;
812
826
  thinkingLevels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
813
827
  thinkingMode?: "enabled" | "adaptive" | undefined;
814
828
  }[] | undefined, unknown, z.core.$ZodTypeInternals<{
@@ -823,6 +837,7 @@ declare const providerEntrySchema: z.ZodObject<{
823
837
  } | undefined;
824
838
  strengths?: ("planning" | "knowledge" | "coding" | "reasoning" | "vision" | "speed" | "long-context")[] | undefined;
825
839
  reasoning?: boolean | undefined;
840
+ input?: ("text" | "image")[] | undefined;
826
841
  thinkingLevels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
827
842
  thinkingMode?: "enabled" | "adaptive" | undefined;
828
843
  }[] | undefined, unknown>>>>;
@@ -860,6 +875,7 @@ declare const providerEntrySchema: z.ZodObject<{
860
875
  }, z.core.$strip>>>;
861
876
  allowAuthHeaderOverride: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
862
877
  preserveProviderId: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
878
+ requiresIntranet: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
863
879
  imageConstraints: z.ZodCatch<z.ZodOptional<z.ZodObject<{
864
880
  maxImagesPerRequest: z.ZodNumber;
865
881
  maxDimensionPxIfOverLimit: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
@@ -878,6 +894,36 @@ declare const cliContributionSchema: z.ZodObject<{
878
894
  bin: z.ZodCatch<z.ZodOptional<z.ZodString>>;
879
895
  }, z.core.$strip>;
880
896
  type PluginCliContribution = z.infer<typeof cliContributionSchema>;
897
+ /**
898
+ * RFC-410 M2:进程内 CLI 命令贡献(`otto <name> [args...]` 在宿主进程内执行插件
899
+ * definePlugin 导出的 handler,与 RFC-112 的 `contributes.cli`(bin 透传子进程)并列)。
900
+ * `name` 命名约束与 `cliContributionSchema` 完全一致(lowercase kebab-case,同一命名空间——
901
+ * 装载层把 cli 与 cliCommands 的 name 放入同一冲突判定漏斗做 fail-closed)。
902
+ * `summary` 是 `otto --help` 命令段与命令列表的帮助行;`i18nKey` 可选指向本插件
903
+ * contributes.i18n 条目做本地化。带 `.max()` + noControlChars 做终端注入防护。
904
+ * 需 `capabilities:["cli.command"]`(高危,宿主进程内执行代码)。
905
+ */
906
+ declare const cliCommandContributionSchema: z.ZodObject<{
907
+ name: z.ZodString;
908
+ summary: z.ZodString;
909
+ i18nKey: z.ZodCatch<z.ZodOptional<z.ZodString>>;
910
+ }, z.core.$strip>;
911
+ type PluginCliCommandContribution = z.infer<typeof cliCommandContributionSchema>;
912
+ /**
913
+ * RFC-440:TUI 斜杠命令贡献元数据(`contributes.slashCommands[].name`)。
914
+ * `name` 命名约束:lowercase kebab-case(对齐 cliCommands;斜杠命令消费方在命令前加 `/`)。
915
+ * `description` 是 `/help` 与命令列表的帮助行;`group` 可选对齐内置 SLASH_COMMANDS 的
916
+ * 分组('session'/'model'/'agent'/'debug'/'ui'/'other',未知值归 'other');`i18nKey` 可选指向
917
+ * 本插件 contributes.i18n 条目做本地化。带 `.max()` + noControlChars 做终端注入防护。
918
+ * 需 `capabilities:["tui.command"]`(高危,宿主进程内执行代码 + TUI 交互面)。
919
+ */
920
+ declare const slashCommandContributionSchema: z.ZodObject<{
921
+ name: z.ZodString;
922
+ description: z.ZodString;
923
+ group: z.ZodCatch<z.ZodOptional<z.ZodString>>;
924
+ i18nKey: z.ZodCatch<z.ZodOptional<z.ZodString>>;
925
+ }, z.core.$strip>;
926
+ type PluginSlashCommandContribution = z.infer<typeof slashCommandContributionSchema>;
881
927
  /**
882
928
  * 声明式 OAuth 贡献(RFC-122 D1):插件声明一个 OAuth 流程(PKCE 或 device-flow),
883
929
  * 装载器据此注册 `OAuthProvider` 实例到 `OAuthRegistry`,`/login` 命令自动发现。
@@ -918,6 +964,52 @@ declare const oauthContributionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
918
964
  }, z.core.$strip>], "kind">;
919
965
  type OAuthContribution = z.infer<typeof oauthContributionSchema>;
920
966
  /** 插件声明贡献了哪些能力面(信息性 + 未来 gating;缺省全部按目录探测)。 */
967
+ /**
968
+ * config schema 格式 = JSON Schema Draft 07 子集(RFC-401 D6)。
969
+ * 支持的 type: string/number/integer/boolean/array/object。
970
+ * 支持的关键字: type/title/description/default/enum/minimum/maximum/pattern/items/properties。
971
+ * 不支持: $ref/oneOf/anyOf/allOf/$defs(DoS 防护 + YAGNI)。
972
+ * DoS 上限: 字段数 ≤32 / 嵌套深度 ≤4 / 总字节 ≤8192 / description ≤256 字符。
973
+ */
974
+ declare const configSchemaEntrySchema: z.ZodObject<{
975
+ type: z.ZodEnum<{
976
+ string: "string";
977
+ number: "number";
978
+ boolean: "boolean";
979
+ object: "object";
980
+ array: "array";
981
+ integer: "integer";
982
+ }>;
983
+ title: z.ZodCatch<z.ZodOptional<z.ZodString>>;
984
+ description: z.ZodCatch<z.ZodOptional<z.ZodString>>;
985
+ default: z.ZodOptional<z.ZodUnknown>;
986
+ enum: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodUnknown>>>;
987
+ minimum: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
988
+ maximum: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
989
+ pattern: z.ZodCatch<z.ZodOptional<z.ZodString>>;
990
+ items: z.ZodOptional<z.ZodUnknown>;
991
+ properties: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
992
+ }, z.core.$strip>;
993
+ /** RFC-401: 配置 schema 片段类型(JSON Schema Draft 07 子集,z.infer 单一真源)。 */
994
+ type PluginConfigSchemaEntry = z.infer<typeof configSchemaEntrySchema>;
995
+ /**
996
+ * RFC-427 D1:插件事件贡献条目。插件声明可发布的自定义事件类型 + payload schema。
997
+ *
998
+ * - `type`:事件类型,强制 `<pluginId>.<event>` 命名空间格式(zod refine 校验),
999
+ * 防跨插件撞名。如 `skill-inductor.candidate-detected`。
1000
+ * - `description`:供事件订阅方理解事件语义(文档性 + 审计面)。
1001
+ * - `payloadSchema`:JSON Schema Draft 07 子集(同 `configField` 约束,RFC-401),
1002
+ * 装载时解析为校验器;emit 时 safeParse,失败 → 丢弃 + warn(fail-closed)。
1003
+ *
1004
+ * 不需要 capability(纯数据声明);但 emit/subscribe 运行时需 `events` capability(D3)。
1005
+ * 卸载走 unregisterBySource 漏斗(R4 可逆 effect)。
1006
+ */
1007
+ declare const eventContributionSchema: z.ZodObject<{
1008
+ type: z.ZodString;
1009
+ description: z.ZodCatch<z.ZodOptional<z.ZodString>>;
1010
+ payloadSchema: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1011
+ }, z.core.$strip>;
1012
+ type PluginEventContribution = z.infer<typeof eventContributionSchema>;
921
1013
  declare const contributesSchema: z.ZodObject<{
922
1014
  skills: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
923
1015
  agents: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
@@ -927,6 +1019,26 @@ declare const contributesSchema: z.ZodObject<{
927
1019
  name: z.ZodString;
928
1020
  bin: z.ZodCatch<z.ZodOptional<z.ZodString>>;
929
1021
  }, z.core.$strip>>>;
1022
+ cliCommands: z.ZodCatch<z.ZodOptional<z.ZodType<{
1023
+ name: string;
1024
+ summary: string;
1025
+ i18nKey?: string | undefined;
1026
+ }[] | undefined, unknown, z.core.$ZodTypeInternals<{
1027
+ name: string;
1028
+ summary: string;
1029
+ i18nKey?: string | undefined;
1030
+ }[] | undefined, unknown>>>>;
1031
+ slashCommands: z.ZodCatch<z.ZodOptional<z.ZodType<{
1032
+ name: string;
1033
+ description: string;
1034
+ group?: string | undefined;
1035
+ i18nKey?: string | undefined;
1036
+ }[] | undefined, unknown, z.core.$ZodTypeInternals<{
1037
+ name: string;
1038
+ description: string;
1039
+ group?: string | undefined;
1040
+ i18nKey?: string | undefined;
1041
+ }[] | undefined, unknown>>>>;
930
1042
  panels: z.ZodCatch<z.ZodOptional<z.ZodType<{
931
1043
  id: string;
932
1044
  title: string;
@@ -1034,6 +1146,7 @@ declare const contributesSchema: z.ZodObject<{
1034
1146
  } | undefined;
1035
1147
  strengths?: ("planning" | "knowledge" | "coding" | "reasoning" | "vision" | "speed" | "long-context")[] | undefined;
1036
1148
  reasoning?: boolean | undefined;
1149
+ input?: ("text" | "image")[] | undefined;
1037
1150
  thinkingLevels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
1038
1151
  thinkingMode?: "enabled" | "adaptive" | undefined;
1039
1152
  }[] | undefined;
@@ -1059,6 +1172,7 @@ declare const contributesSchema: z.ZodObject<{
1059
1172
  } | undefined;
1060
1173
  allowAuthHeaderOverride?: boolean | undefined;
1061
1174
  preserveProviderId?: boolean | undefined;
1175
+ requiresIntranet?: boolean | undefined;
1062
1176
  imageConstraints?: {
1063
1177
  maxImagesPerRequest: number;
1064
1178
  maxDimensionPxIfOverLimit?: number | undefined;
@@ -1085,6 +1199,7 @@ declare const contributesSchema: z.ZodObject<{
1085
1199
  } | undefined;
1086
1200
  strengths?: ("planning" | "knowledge" | "coding" | "reasoning" | "vision" | "speed" | "long-context")[] | undefined;
1087
1201
  reasoning?: boolean | undefined;
1202
+ input?: ("text" | "image")[] | undefined;
1088
1203
  thinkingLevels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
1089
1204
  thinkingMode?: "enabled" | "adaptive" | undefined;
1090
1205
  }[] | undefined;
@@ -1110,6 +1225,7 @@ declare const contributesSchema: z.ZodObject<{
1110
1225
  } | undefined;
1111
1226
  allowAuthHeaderOverride?: boolean | undefined;
1112
1227
  preserveProviderId?: boolean | undefined;
1228
+ requiresIntranet?: boolean | undefined;
1113
1229
  imageConstraints?: {
1114
1230
  maxImagesPerRequest: number;
1115
1231
  maxDimensionPxIfOverLimit?: number | undefined;
@@ -1313,18 +1429,18 @@ declare const contributesSchema: z.ZodObject<{
1313
1429
  text?: string | undefined;
1314
1430
  };
1315
1431
  markdown?: {
1316
- heading1?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1317
- heading2?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1318
- headingWeak?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1319
- listMarker?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1320
- listMarkerMuted?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1321
- quoteBar?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1322
- quoteText?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1323
- link?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1324
- inlineCode?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1325
- codeFence?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1326
- tableHeader?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1327
- tableDivider?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1432
+ heading1?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1433
+ heading2?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1434
+ headingWeak?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1435
+ listMarker?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1436
+ listMarkerMuted?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1437
+ quoteBar?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1438
+ quoteText?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1439
+ link?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1440
+ inlineCode?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1441
+ codeFence?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1442
+ tableHeader?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1443
+ tableDivider?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1328
1444
  listIndent?: 2 | 3 | undefined;
1329
1445
  listMarkers?: [string, string, string, string] | undefined;
1330
1446
  codeBlockDivider?: "none" | "hr" | undefined;
@@ -1368,18 +1484,18 @@ declare const contributesSchema: z.ZodObject<{
1368
1484
  text?: string | undefined;
1369
1485
  };
1370
1486
  markdown?: {
1371
- heading1?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1372
- heading2?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1373
- headingWeak?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1374
- listMarker?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1375
- listMarkerMuted?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1376
- quoteBar?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1377
- quoteText?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1378
- link?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1379
- inlineCode?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1380
- codeFence?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1381
- tableHeader?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1382
- tableDivider?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1487
+ heading1?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1488
+ heading2?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1489
+ headingWeak?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1490
+ listMarker?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1491
+ listMarkerMuted?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1492
+ quoteBar?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1493
+ quoteText?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1494
+ link?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1495
+ inlineCode?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1496
+ codeFence?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1497
+ tableHeader?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1498
+ tableDivider?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1383
1499
  listIndent?: 2 | 3 | undefined;
1384
1500
  listMarkers?: [string, string, string, string] | undefined;
1385
1501
  codeBlockDivider?: "none" | "hr" | undefined;
@@ -1424,6 +1540,48 @@ declare const contributesSchema: z.ZodObject<{
1424
1540
  entry: string;
1425
1541
  export?: string | undefined;
1426
1542
  }[] | undefined, unknown>>>>;
1543
+ config: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
1544
+ type: "string" | "number" | "boolean" | "object" | "array" | "integer";
1545
+ title?: string | undefined;
1546
+ description?: string | undefined;
1547
+ default?: unknown;
1548
+ enum?: unknown[] | undefined;
1549
+ minimum?: number | undefined;
1550
+ maximum?: number | undefined;
1551
+ pattern?: string | undefined;
1552
+ items?: unknown;
1553
+ properties?: Record<string, unknown> | undefined;
1554
+ } | undefined, unknown>>>>;
1555
+ credentialBackends: z.ZodCatch<z.ZodOptional<z.ZodType<{
1556
+ id: string;
1557
+ entry: string;
1558
+ label?: string | undefined;
1559
+ capabilities?: {
1560
+ atomic?: boolean | undefined;
1561
+ permSecure?: boolean | undefined;
1562
+ crossProcessLock?: boolean | undefined;
1563
+ watchable?: boolean | undefined;
1564
+ } | undefined;
1565
+ }[] | undefined, unknown, z.core.$ZodTypeInternals<{
1566
+ id: string;
1567
+ entry: string;
1568
+ label?: string | undefined;
1569
+ capabilities?: {
1570
+ atomic?: boolean | undefined;
1571
+ permSecure?: boolean | undefined;
1572
+ crossProcessLock?: boolean | undefined;
1573
+ watchable?: boolean | undefined;
1574
+ } | undefined;
1575
+ }[] | undefined, unknown>>>>;
1576
+ events: z.ZodCatch<z.ZodOptional<z.ZodType<{
1577
+ type: string;
1578
+ description?: string | undefined;
1579
+ payloadSchema?: Record<string, unknown> | undefined;
1580
+ }[] | undefined, unknown, z.core.$ZodTypeInternals<{
1581
+ type: string;
1582
+ description?: string | undefined;
1583
+ payloadSchema?: Record<string, unknown> | undefined;
1584
+ }[] | undefined, unknown>>>>;
1427
1585
  }, z.core.$strip>;
1428
1586
  type PluginContributes = z.infer<typeof contributesSchema>;
1429
1587
  /**
@@ -1436,6 +1594,10 @@ declare const scriptsSchema: z.ZodObject<{
1436
1594
  }, z.core.$catchall<z.ZodString>>;
1437
1595
  type PluginScripts = z.infer<typeof scriptsSchema>;
1438
1596
  declare const manifestSchema: z.ZodObject<{
1597
+ plane: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
1598
+ host: "host";
1599
+ preset: "preset";
1600
+ }>>>;
1439
1601
  id: z.ZodString;
1440
1602
  name: z.ZodCatch<z.ZodOptional<z.ZodString>>;
1441
1603
  version: z.ZodCatch<z.ZodOptional<z.ZodString>>;
@@ -1452,6 +1614,26 @@ declare const manifestSchema: z.ZodObject<{
1452
1614
  name: z.ZodString;
1453
1615
  bin: z.ZodCatch<z.ZodOptional<z.ZodString>>;
1454
1616
  }, z.core.$strip>>>;
1617
+ cliCommands: z.ZodCatch<z.ZodOptional<z.ZodType<{
1618
+ name: string;
1619
+ summary: string;
1620
+ i18nKey?: string | undefined;
1621
+ }[] | undefined, unknown, z.core.$ZodTypeInternals<{
1622
+ name: string;
1623
+ summary: string;
1624
+ i18nKey?: string | undefined;
1625
+ }[] | undefined, unknown>>>>;
1626
+ slashCommands: z.ZodCatch<z.ZodOptional<z.ZodType<{
1627
+ name: string;
1628
+ description: string;
1629
+ group?: string | undefined;
1630
+ i18nKey?: string | undefined;
1631
+ }[] | undefined, unknown, z.core.$ZodTypeInternals<{
1632
+ name: string;
1633
+ description: string;
1634
+ group?: string | undefined;
1635
+ i18nKey?: string | undefined;
1636
+ }[] | undefined, unknown>>>>;
1455
1637
  panels: z.ZodCatch<z.ZodOptional<z.ZodType<{
1456
1638
  id: string;
1457
1639
  title: string;
@@ -1559,6 +1741,7 @@ declare const manifestSchema: z.ZodObject<{
1559
1741
  } | undefined;
1560
1742
  strengths?: ("planning" | "knowledge" | "coding" | "reasoning" | "vision" | "speed" | "long-context")[] | undefined;
1561
1743
  reasoning?: boolean | undefined;
1744
+ input?: ("text" | "image")[] | undefined;
1562
1745
  thinkingLevels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
1563
1746
  thinkingMode?: "enabled" | "adaptive" | undefined;
1564
1747
  }[] | undefined;
@@ -1584,6 +1767,7 @@ declare const manifestSchema: z.ZodObject<{
1584
1767
  } | undefined;
1585
1768
  allowAuthHeaderOverride?: boolean | undefined;
1586
1769
  preserveProviderId?: boolean | undefined;
1770
+ requiresIntranet?: boolean | undefined;
1587
1771
  imageConstraints?: {
1588
1772
  maxImagesPerRequest: number;
1589
1773
  maxDimensionPxIfOverLimit?: number | undefined;
@@ -1610,6 +1794,7 @@ declare const manifestSchema: z.ZodObject<{
1610
1794
  } | undefined;
1611
1795
  strengths?: ("planning" | "knowledge" | "coding" | "reasoning" | "vision" | "speed" | "long-context")[] | undefined;
1612
1796
  reasoning?: boolean | undefined;
1797
+ input?: ("text" | "image")[] | undefined;
1613
1798
  thinkingLevels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
1614
1799
  thinkingMode?: "enabled" | "adaptive" | undefined;
1615
1800
  }[] | undefined;
@@ -1635,6 +1820,7 @@ declare const manifestSchema: z.ZodObject<{
1635
1820
  } | undefined;
1636
1821
  allowAuthHeaderOverride?: boolean | undefined;
1637
1822
  preserveProviderId?: boolean | undefined;
1823
+ requiresIntranet?: boolean | undefined;
1638
1824
  imageConstraints?: {
1639
1825
  maxImagesPerRequest: number;
1640
1826
  maxDimensionPxIfOverLimit?: number | undefined;
@@ -1838,18 +2024,18 @@ declare const manifestSchema: z.ZodObject<{
1838
2024
  text?: string | undefined;
1839
2025
  };
1840
2026
  markdown?: {
1841
- heading1?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1842
- heading2?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1843
- headingWeak?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1844
- listMarker?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1845
- listMarkerMuted?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1846
- quoteBar?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1847
- quoteText?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1848
- link?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1849
- inlineCode?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1850
- codeFence?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1851
- tableHeader?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1852
- tableDivider?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2027
+ heading1?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2028
+ heading2?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2029
+ headingWeak?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2030
+ listMarker?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2031
+ listMarkerMuted?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2032
+ quoteBar?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2033
+ quoteText?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2034
+ link?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2035
+ inlineCode?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2036
+ codeFence?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2037
+ tableHeader?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2038
+ tableDivider?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1853
2039
  listIndent?: 2 | 3 | undefined;
1854
2040
  listMarkers?: [string, string, string, string] | undefined;
1855
2041
  codeBlockDivider?: "none" | "hr" | undefined;
@@ -1893,18 +2079,18 @@ declare const manifestSchema: z.ZodObject<{
1893
2079
  text?: string | undefined;
1894
2080
  };
1895
2081
  markdown?: {
1896
- heading1?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1897
- heading2?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1898
- headingWeak?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1899
- listMarker?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1900
- listMarkerMuted?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1901
- quoteBar?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1902
- quoteText?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1903
- link?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1904
- inlineCode?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1905
- codeFence?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1906
- tableHeader?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1907
- tableDivider?: "success" | "error" | "accent" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "text" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2082
+ heading1?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2083
+ heading2?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2084
+ headingWeak?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2085
+ listMarker?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2086
+ listMarkerMuted?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2087
+ quoteBar?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2088
+ quoteText?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2089
+ link?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2090
+ inlineCode?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2091
+ codeFence?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2092
+ tableHeader?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
2093
+ tableDivider?: "success" | "error" | "accent" | "text" | "brand" | "brandShimmer" | "accentDim" | "accentBright" | "inactive" | "secondary" | "subtle" | "replyPrefix" | "warning" | "special" | "suggestion" | "permission" | "codeText" | "diffAdd" | "diffRemove" | "diffAddBg" | "diffRemoveBg" | "panelBorder" | "overlayBg" | "tagBg" | "toolText" | "focusBorder" | "selection" | undefined;
1908
2094
  listIndent?: 2 | 3 | undefined;
1909
2095
  listMarkers?: [string, string, string, string] | undefined;
1910
2096
  codeBlockDivider?: "none" | "hr" | undefined;
@@ -1949,12 +2135,54 @@ declare const manifestSchema: z.ZodObject<{
1949
2135
  entry: string;
1950
2136
  export?: string | undefined;
1951
2137
  }[] | undefined, unknown>>>>;
2138
+ config: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
2139
+ type: "string" | "number" | "boolean" | "object" | "array" | "integer";
2140
+ title?: string | undefined;
2141
+ description?: string | undefined;
2142
+ default?: unknown;
2143
+ enum?: unknown[] | undefined;
2144
+ minimum?: number | undefined;
2145
+ maximum?: number | undefined;
2146
+ pattern?: string | undefined;
2147
+ items?: unknown;
2148
+ properties?: Record<string, unknown> | undefined;
2149
+ } | undefined, unknown>>>>;
2150
+ credentialBackends: z.ZodCatch<z.ZodOptional<z.ZodType<{
2151
+ id: string;
2152
+ entry: string;
2153
+ label?: string | undefined;
2154
+ capabilities?: {
2155
+ atomic?: boolean | undefined;
2156
+ permSecure?: boolean | undefined;
2157
+ crossProcessLock?: boolean | undefined;
2158
+ watchable?: boolean | undefined;
2159
+ } | undefined;
2160
+ }[] | undefined, unknown, z.core.$ZodTypeInternals<{
2161
+ id: string;
2162
+ entry: string;
2163
+ label?: string | undefined;
2164
+ capabilities?: {
2165
+ atomic?: boolean | undefined;
2166
+ permSecure?: boolean | undefined;
2167
+ crossProcessLock?: boolean | undefined;
2168
+ watchable?: boolean | undefined;
2169
+ } | undefined;
2170
+ }[] | undefined, unknown>>>>;
2171
+ events: z.ZodCatch<z.ZodOptional<z.ZodType<{
2172
+ type: string;
2173
+ description?: string | undefined;
2174
+ payloadSchema?: Record<string, unknown> | undefined;
2175
+ }[] | undefined, unknown, z.core.$ZodTypeInternals<{
2176
+ type: string;
2177
+ description?: string | undefined;
2178
+ payloadSchema?: Record<string, unknown> | undefined;
2179
+ }[] | undefined, unknown>>>>;
1952
2180
  }, z.core.$strip>>>;
1953
2181
  scripts: z.ZodCatch<z.ZodOptional<z.ZodObject<{
1954
2182
  postinstall: z.ZodCatch<z.ZodOptional<z.ZodString>>;
1955
2183
  setup: z.ZodCatch<z.ZodOptional<z.ZodString>>;
1956
2184
  }, z.core.$catchall<z.ZodString>>>>;
1957
- capabilities: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<("provider" | "tools" | "hooks" | "tui.renderer" | "network" | "context" | "monitor" | "wire-protocol" | "a2ui.component" | "panel.backend" | "mcp.server" | "feedback" | "input.resolver" | "a2ui.renderer" | "theme" | "agent.dispatch" | "service" | "storage" | "session.read" | "llm.complete" | "user.notify" | "user.ask")[] | undefined, unknown[]>>>>;
2185
+ capabilities: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<("config" | "events" | "provider" | "tools" | "hooks" | "tui.renderer" | "network" | "context" | "monitor" | "wire-protocol" | "a2ui.component" | "panel.backend" | "mcp.server" | "feedback" | "input.resolver" | "a2ui.renderer" | "theme" | "agent.dispatch" | "service" | "storage" | "session.read" | "llm.complete" | "user.notify" | "user.ask" | "credentials" | "cli.command" | "tui.command" | "settings.read" | "schedule")[] | undefined, unknown[]>>>>;
1958
2186
  activationEvents: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<string[] | undefined, unknown[]>>>>;
1959
2187
  dependsOn: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<string[] | undefined, unknown[]>>>>;
1960
2188
  codeProviderIds: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<string[] | undefined, unknown[]>>>>;
@@ -1980,6 +2208,7 @@ declare const manifestSchema: z.ZodObject<{
1980
2208
  } | undefined;
1981
2209
  strengths?: ("planning" | "knowledge" | "coding" | "reasoning" | "vision" | "speed" | "long-context")[] | undefined;
1982
2210
  reasoning?: boolean | undefined;
2211
+ input?: ("text" | "image")[] | undefined;
1983
2212
  thinkingLevels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
1984
2213
  thinkingMode?: "enabled" | "adaptive" | undefined;
1985
2214
  }[] | undefined;
@@ -1995,6 +2224,13 @@ declare const manifestSchema: z.ZodObject<{
1995
2224
  }> | undefined, Record<string, unknown>>>>>;
1996
2225
  }, z.core.$strip>;
1997
2226
  type PluginManifest = z.infer<typeof manifestSchema>;
2227
+ /** RFC-327 修订 D2(M2):manifest 显式 plane 声明('host' | 'preset')。 */
2228
+ type PluginManifestPlane = 'host' | 'preset';
2229
+ /**
2230
+ * RFC-327 修订 D2(M2):解析 manifest 的 plane 声明。缺省 = `'preset'`
2231
+ * (存量插件零行为变化——绝大多数插件贡献是会话/workspace 级,host 是刻意声明)。
2232
+ */
2233
+ declare function resolveManifestPlane(manifest: PluginManifest): PluginManifestPlane;
1998
2234
  /** 有效激活事件:字段缺失或空 → `['onStartup']`(存量插件零行为变化,RFC-105 D7)。 */
1999
2235
  declare function resolveActivationEvents(manifest: PluginManifest): string[];
2000
2236
  /**
@@ -2205,6 +2441,13 @@ interface PluginContributions {
2205
2441
  * 贡献——凡是"需要先加载 plugin.ts 代码才能算出"的注入内容,视为独立后续项(YAGNI)。
2206
2442
  */
2207
2443
  contextSources?: ContextSourceContribution[];
2444
+ /**
2445
+ * RFC-427 D1:插件事件贡献面(纯数据声明,逐条 fail-soft)。插件声明可发布的自定义
2446
+ * 事件类型 + payload schema,其他插件经 `subscribeEvent` 订阅。需 `capabilities` 含
2447
+ * `events`(非高危——observer-only,不改写引擎状态、不进 prompt)。事件经宿主 event-dispatcher
2448
+ * 中转(身份/权限/payload/频率单点执法),不持久化、不回放(R7)。卸载走 unregisterBySource。
2449
+ */
2450
+ events?: PluginEventContribution[];
2208
2451
  }
2209
2452
  /**
2210
2453
  * 合并多源贡献为单一 `PluginContributions`(RFC-082 §4.2 装载流,R7;RFC-157 M1 轴表化)。
@@ -2307,15 +2550,32 @@ declare function dispatch(cmd: CommandRef, caps: DispatchCaps): Promise<void>;
2307
2550
  * 安全(RFC-082 R10):`plugin.ts` 在 otto 主进程内、装载时执行(非沙箱,全 Node 权限),
2308
2551
  * 由信任门门控*是否*执行;hooks(尤其可 deny/block 工具的 preToolUse)默认关 + 显式启用。
2309
2552
  */
2310
- /** 工具调用上下文(hooks 观测/拦截用)。 */
2553
+ /**
2554
+ * 工具调用上下文(hooks 观测/拦截用)。
2555
+ *
2556
+ * `paths`/`readonly`/`sessionId` 是只读上下文(从 `ToolExecuteBeforeInput` 透传),
2557
+ * 让插件做路径级权限策略(如 browser-use 的站点级规则)。三字段可选——
2558
+ * 旧宿主不注入时 undefined,插件容错(`?? fallback`)。只读透传不破坏 R10
2559
+ * (插件只能 deny/ask 不能 allow)。
2560
+ */
2311
2561
  interface ToolUseContext {
2312
2562
  toolName: string;
2313
2563
  input: unknown;
2564
+ /** 工具声明的 AgentTool.pathParams 从 args 解析出的文件系统路径(只读)。 */
2565
+ paths?: readonly string[];
2566
+ /** 工具是否为只读(AgentTool.readonly,只读)。 */
2567
+ readonly?: boolean;
2568
+ /** 会话 ID(只读)。 */
2569
+ sessionId?: string;
2314
2570
  }
2315
- /** PreToolUse 决策(拦截器返回)。`allow` 放行;`deny` 拒绝;`ask` 转人工确认。 */
2571
+ /**
2572
+ * PreToolUse 决策(拦截器返回)。`deny` 拒绝;`ask` 转人工确认。
2573
+ *
2574
+ * `void` = 无意见/放行到既有 hook 链判定(等价于 `allow`——不干预,交由既有权限链判定)。
2575
+ * 插件不能授权,只能限制(R10:allow 恒 no-op,故不设 allow 变体——
2576
+ * 返回 void 即放行,deny/ask 之外无需第三个值)。
2577
+ */
2316
2578
  type PreToolUseDecision = {
2317
- decision: 'allow';
2318
- } | {
2319
2579
  decision: 'deny';
2320
2580
  reason?: string;
2321
2581
  } | {
@@ -2330,6 +2590,10 @@ type PreToolUseDecision = {
2330
2590
  * RFC-129 D1 边界纪律:新增的 9 个字段全部是 observer-only——不开放任何可变换消息/参数的
2331
2591
  * interceptor timing(`messages.transform`/`chat.params`/`system.prompt.transform`/
2332
2592
  * `chat.message.after` 均不对插件开放,见 RFC-129 §1.2 非目标 + 放弃方案)。
2593
+ *
2594
+ * RFC-327 修订 D1(M1)显式修订:上述边界纪律对 `waterfall` 贡献面**不再成立**——
2595
+ * waterfall 是**新的贡献面**(不是 observer 改 interceptor),经受控白名单 timing
2596
+ * (`WaterfallTiming`)开放三个受控中间产物的改写点,见下方 `waterfall` 字段说明。
2333
2597
  */
2334
2598
  interface PluginHooks {
2335
2599
  preToolUse?: (ctx: ToolUseContext) => PreToolUseDecision | void | Promise<PreToolUseDecision | void>;
@@ -2399,6 +2663,13 @@ interface PluginHooks {
2399
2663
  taskId: string;
2400
2664
  error: string;
2401
2665
  }) => void | Promise<void>;
2666
+ /**
2667
+ * 任务被取消时触发(`task.cancelled`,08-13 终局 review 观察项:纯 observer,
2668
+ * 对自迭代感知"子任务被取消"有真实价值——被取消的任务不该重复派发)。
2669
+ */
2670
+ taskCancelled?: (ctx: {
2671
+ taskId: string;
2672
+ }) => void | Promise<void>;
2402
2673
  /**
2403
2674
  * 任务(子 agent task)建档时触发(`task.created`),先于 `task.started` 触发。
2404
2675
  * 此时 agent 归属尚未确定(`TaskHookInfo` 无 subagent 字段),仅 taskId 可用。
@@ -2411,7 +2682,72 @@ interface PluginHooks {
2411
2682
  taskId: string;
2412
2683
  agent: string;
2413
2684
  }) => void | Promise<void>;
2685
+ /**
2686
+ * 通知发生时触发(`notification`,终局 review 2026-08-14 插件化方案 A)。
2687
+ * 来自 @x-otto/notification 脊柱的出站交付——会话事件经归一
2688
+ * (turn_complete/error/approval_required/input_required)后由 hook 桥 emit。
2689
+ * `notification_type` 是归一类别而非原始 AgentSessionEvent 形状(跨包边界纪律)。
2690
+ */
2691
+ onNotification?: (ctx: {
2692
+ sessionId: string;
2693
+ message: string;
2694
+ title?: string;
2695
+ notification_type: string;
2696
+ }) => void | Promise<void>;
2697
+ /**
2698
+ * RFC-327 修订 D1(M1):waterfall 贡献面——插件经受控白名单 timing 改写主循环中间产物。
2699
+ *
2700
+ * 语义对齐 HookRegistry 既有 interceptor(priority 序 → 共享可变 output → 后续可见前者
2701
+ * 改写),**外加** serial-with-early-bail:任一 handler 返回 `{ abort: true }` →
2702
+ * 终止该 timing 的整条 hook 链,output 保留已累积值(后续引擎 hook 不执行)。
2703
+ *
2704
+ * 安全边界(R1'/R10):
2705
+ * - 只作用于白名单 timing 的**受控中间产物**(`system.prompt.transform` /
2706
+ * `chat.params` / `messages.transform`)——不开放原始会话存储与工具执行参数
2707
+ * (messages.transform 会看到待发送消息列表,含历史派生内容——白名单设计内的
2708
+ * 能力,全程审计);
2709
+ * - 白名单编译期强制(`WaterfallTiming` 从 `HookPayloadMap` Pick),装载器运行时校验兜底,
2710
+ * 白名单外 timing 一律拒绝注册(fail-closed);
2711
+ * - `system.prompt.transform` 默认只开放 `systemTail`(volatile,cache 断点后,逐轮可变)
2712
+ * + 预算闸(4KB 顶)——`systemPrompt`(stable,进 prompt cache)**第一版不开放**,
2713
+ * 尝试写入被装载器拒绝(fail-closed,写入会永久污染后续所有轮次的 prompt cache 前缀);
2714
+ * - 全程审计(pluginId + timing + 变更摘要),走既有 capability/trust/隔离 RPC 三重门,
2715
+ * 不另建旁路。
2716
+ *
2717
+ * 能力面跃迁声明:从「插件只能 deny/ask 升级限制」到「插件能改写受控中间产物」是质变,
2718
+ * 本字段是新贡献面(非 observer 改 interceptor),配套 D1a 分权与安全门见 RFC-327 修订 §3。
2719
+ */
2720
+ waterfall?: PluginWaterfallHooks;
2721
+ /**
2722
+ * RFC-401 D5:配置变更通知(observer-only,不走整插件重载)。
2723
+ * 宿主在 PluginConfigStore 写入后调用此 hook 传入新配置对象——插件可选择实现
2724
+ * (不实现则下次 reload 时自然更新)。与 onActivate/onDeactivate 的区别:
2725
+ * onActivate/onDeactivate 是"装载/卸载"生命周期,onConfigChange 是"运行时配置热更"。
2726
+ * observer 纹理:不改变引擎状态,异常被吞 + 记录日志(同其他 observer hook,R5)。
2727
+ */
2728
+ onConfigChange?: (newConfig: Record<string, unknown>) => void | Promise<void>;
2414
2729
  }
2730
+ /**
2731
+ * RFC-327 修订 D1(M1):waterfall handler 逐 timing 签名——input/output 与引擎
2732
+ * `HookPayloadMap` 对齐(编译期逐 timing 精确类型,无双重断言),返回值支持 abort 哨兵。
2733
+ */
2734
+ type PluginWaterfallHandler<T extends WaterfallTiming> = (input: HookPayloadMap[T]['input'], output: HookPayloadMap[T]['output']) => void | HookAbortSignal | Promise<void | HookAbortSignal>;
2735
+ /** RFC-327 修订 D1(M1):waterfall 贡献面的逐 timing 映射(mapped type 保持 per-key 类型精确)。 */
2736
+ type PluginWaterfallHooks = { [T in WaterfallTiming]?: PluginWaterfallHandler<T> };
2737
+ /**
2738
+ * 终局 review(2026-08-14):PluginHooks 按域分组类型别名。
2739
+ * 运行时契约不变——PluginHooks 仍是一层扁平可选字段;这些别名在类型层补域结构,
2740
+ * 供 IDE/文档/插件作者理解 hook 的分类。新增 timing 必须在此登记到对应域,
2741
+ * 且在 module-wiring 的 ScalarPluginHookField 排除/登记(编译期门)。
2742
+ */
2743
+ /** 工具域 hooks(pre/post tool use)。 */
2744
+ type PluginToolHooks = Pick<PluginHooks, 'preToolUse' | 'postToolUse'>;
2745
+ /** 会话域 hooks(session lifecycle + stream + compaction)。 */
2746
+ type PluginSessionHooks = Pick<PluginHooks, 'sessionStart' | 'sessionRestored' | 'sessionDeleted' | 'sessionIdle' | 'sessionError' | 'stop' | 'streamStart' | 'compactionPending' | 'compactionOccurred'>;
2747
+ /** 任务域 hooks(task lifecycle)。 */
2748
+ type PluginTaskHooks = Pick<PluginHooks, 'taskCreated' | 'taskStarted' | 'taskCompleted' | 'taskFailed' | 'taskCancelled'>;
2749
+ /** 消息域 hooks(prompt submit + config change)。 */
2750
+ type PluginMessageHooks = Pick<PluginHooks, 'userPromptSubmit' | 'onConfigChange'>;
2415
2751
  /** 装载时注入工厂的上下文。 */
2416
2752
  interface PluginContext {
2417
2753
  /** 插件 id(= manifest.id = source 标签)。 */
@@ -2450,9 +2786,18 @@ interface PluginContext {
2450
2786
  * 未注入 `wireProtocolRegistry` 时(如轻量测试装配)恒返回 `undefined`。
2451
2787
  */
2452
2788
  getWireProtocol: (wireApi: string) => _$_x_otto_provider0.WireProtocolRegistration | undefined;
2789
+ /**
2790
+ * 解析该插件自身 provider 的裸凭据 key(RFC-148 M3,`resolveProviderAuth` 的姊妹方法):
2791
+ * 多数代码式 provider 工厂(如 GitHub Copilot 自定义头场景)只需要裸 key,不需要
2792
+ * `mode`/`beta` 等完整凭据上下文。跨插件隔离:仅放行该插件 manifest 声明的
2793
+ * `codeProviderIds` 白名单或自身 `<pluginId>:` 前缀命名空间,其余一律返回 `null`
2794
+ * (不触达 AuthStore,见 `plugin-module-manager.ts` 装载器实现)。
2795
+ * 未注入 `providerRegistry` 或 api 不属于本插件时恒返回 `null`。
2796
+ */
2797
+ resolveProviderCredential: (api: string) => Promise<string | null>;
2453
2798
  /**
2454
2799
  * 解析该插件自身 provider 的完整凭据(RFC-148 M3,`resolveProviderCredential` 的姊妹方法):
2455
- * 后者只给裸 key(多数代码式 provider 够用,如 GitHub Copilot),本方法额外给 `mode`/`beta`
2800
+ * 前者只给裸 key(多数代码式 provider 够用,如 GitHub Copilot),本方法额外给 `mode`/`beta`
2456
2801
  * ——`anthropic-messages` 协议实现需要区分 api_key 与 oauth 模式(决定是否启用 Claude Code
2457
2802
  * 客户端伪装)。跨插件隔离规则与 `resolveProviderCredential` 一致(同一 owned-namespace
2458
2803
  * 白名单校验,装载器实现层面共享同一份判定逻辑,见 `plugin-module-manager.ts`)。
@@ -2472,6 +2817,44 @@ interface PluginContext {
2472
2817
  * 可选(additive)——旧宿主不注入时插件侧应容忍 undefined。
2473
2818
  */
2474
2819
  listActivePlugins?: () => readonly ActivePluginSnapshot[];
2820
+ /**
2821
+ * RFC-401 D2:插件配置值(解析后的对象,additive——旧宿主不注入时为 undefined)。
2822
+ * 宿主在装载时合并 manifest config schema 默认值 + PluginConfigStore 持久化值 → 注入。
2823
+ * 配置变更时经 onConfigChange hook 通知插件(不走整插件重载)。
2824
+ */
2825
+ config?: Record<string, unknown>;
2826
+ /**
2827
+ * RFC-427 D2:发布一个插件事件。事件类型必须在本插件 manifest 的 `contributes.events`
2828
+ * 中声明(未声明 → fail-closed 丢弃 + warn)。payload 经声明式 schema 校验,
2829
+ * 校验失败 → fail-closed 丢弃 + warn。宿主中转给所有已声明订阅的插件。
2830
+ * observer-only:不影响引擎状态、不写 prompt、不进 session log(R2/R7)。
2831
+ *
2832
+ * 跨进程(service worker 插件):经反向 RPC 桥接到宿主 event-dispatcher
2833
+ * (复用 RFC-287 D2 host 能力面桥接模式),不是 postMessage 函数传递。
2834
+ *
2835
+ * 可选(additive)——旧宿主/轻量测试装配不注入时插件侧应容忍 undefined。
2836
+ */
2837
+ emitEvent?: (type: string, payload: Readonly<Record<string, unknown>>) => void;
2838
+ /**
2839
+ * RFC-427 D2:订阅一个插件事件。type 可以是完整事件类型
2840
+ * (`skill-inductor.candidate-detected`)或通配符(`skill-inductor.*`)。
2841
+ * 订阅是 effect:插件卸载时自动反注册(unregisterBySource,R4 可逆 effect)。
2842
+ * handler 收到的 payload 已过 schema 校验 + 深冻结(Object.freeze 递归,R2 observer-only),
2843
+ * handler 不可 mutate。
2844
+ *
2845
+ * 通配符 `*`(订阅全部)在 M2 阶段不实现(R5 闸门)——API 签名保留但运行时 reject + warn,
2846
+ * 防止实现时顺手支持绕过闸门。
2847
+ *
2848
+ * handler 异常 = 吞掉 + warn,不传播、不阻断其他订阅方(R2a,对齐 PluginMonitor.onEvent
2849
+ * 既有纪律 sdk.ts:524-530)。
2850
+ *
2851
+ * 可选(additive)——旧宿主不注入时为 undefined。
2852
+ *
2853
+ * @returns disposer,手动取消订阅(对齐 dsh 可逆 effect 语义)
2854
+ */
2855
+ subscribeEvent?: (type: string, handler: (payload: Readonly<Record<string, unknown>>, source: {
2856
+ pluginId: string;
2857
+ }) => void) => () => void;
2475
2858
  }
2476
2859
  /**
2477
2860
  * provider 工厂(RFC-105 D3,代码式 provider 轴)。
@@ -2554,12 +2937,60 @@ interface PluginTool {
2554
2937
  data?: unknown;
2555
2938
  error?: unknown;
2556
2939
  };
2940
+ /**
2941
+ * 模型侧序列化契约(与 @x-otto/interchange 的 AgentTool.parameters 对齐):
2942
+ * provider 序列化时无此方法则模型收到空 {} schema、参数完全不可见。
2943
+ * 手写 schema 必须与 safeParse 成对提供(2026-08-13 终局复核回归教训)。
2944
+ */
2945
+ toJSONSchema?: () => unknown;
2557
2946
  };
2558
2947
  /**
2559
2948
  * 执行体。第二参数 `ctx` 为 RFC-303 M4 可选上下文(pluginId/workspaceDir/logger/
2560
2949
  * host/signal);存量单参工具不传第二参数即忽略,天然兼容。
2561
2950
  */
2562
2951
  execute: (args: unknown, ctx?: PluginToolContext) => Promise<unknown>;
2952
+ /**
2953
+ * RFC-397 D1:工具所属预设层级。缺省 'full'(= 当前硬编码行为)。
2954
+ * 内联联合而非 import ToolPreset——packages/plugin 不依赖 @x-otto/setting,
2955
+ * 保持分层纪律(同 PluginTool 不 import AgentTool)。
2956
+ */
2957
+ preset?: 'minimal' | 'standard' | 'full';
2958
+ /** RFC-397 D4:工具分类(如 'fs'/'search'/'analysis')。缺省 = 不分组。 */
2959
+ category?: string;
2960
+ /**
2961
+ * RFC-397 D4:行为指南文本(注入 system prompt 的 Tool Reference 段,按 category 分组渲染)。
2962
+ * 与内置工具的 ToolNode.guidance 同等待遇。缺省 = 无指南。
2963
+ */
2964
+ guideline?: string;
2965
+ /**
2966
+ * RFC-397 D2:工具对模型的暴露策略。缺省 'direct'(= 当前行为,直接进模型工具表)。
2967
+ * 'deferred' = 经 tool_search 按需发现(MCP 工具默认态);'hidden' = 仅可派发,不进表。
2968
+ */
2969
+ exposure?: 'direct' | 'deferred' | 'hidden';
2970
+ /**
2971
+ * RFC-397 D3:声明哪些参数承载文件系统路径(如 ['path'] / ['filePath'])。
2972
+ * PEP(permission/file guard)据此解析受管路径。
2973
+ * **必须与 resolvePath 成对声明**——无 resolvePath 时 PEP 拿到原始相对串,
2974
+ * file-guard 锚定模式(如 `^/etc/`)对相对穿越(`../../etc/x`)失配 = 路径权限绕过。
2975
+ */
2976
+ pathParams?: readonly string[];
2977
+ /**
2978
+ * RFC-397 D3:把 pathParams 的原始值解析成工具实际操作的绝对路径。
2979
+ * **pathParams 的安全伴侣**——声明了 pathParams 就必须声明 resolvePath。
2980
+ *
2981
+ * 二参函数(与 AgentTool.resolvePath 的单参形态不同):第二参数 projectRoot 由
2982
+ * toAgentTool 在透传时从 PluginToolCtxSource.workspaceDir 注入,适配为单参闭包
2983
+ * `(raw) => tool.resolvePath!(raw, projectRoot)`(RFC-397 D6)。
2984
+ */
2985
+ resolvePath?: (rawPath: string, projectRoot: string) => string;
2986
+ /** RFC-397 D3:标记为只读工具,可与其他只读工具并发执行(work-loop 并发桶)。 */
2987
+ readonly?: boolean;
2988
+ /**
2989
+ * RFC-437 D1:声明本工具输出可再生可剪(无副作用查询类)。memory prune 经装配侧
2990
+ * ToolRegistry 收集(listRegenerableNames)——插件工具声明即生效,长会话可剪。
2991
+ * 缺省 undefined = 不声明 = 不可再生(fail-closed)。写类工具不得声明。
2992
+ */
2993
+ regenerableOutput?: boolean;
2563
2994
  }
2564
2995
  /**
2565
2996
  * Monitor 投影事件(RFC-129 D6):与 `PluginHooks` 平行的独立概念——"被动订阅事件流做旁路统计"
@@ -2580,14 +3011,25 @@ interface PluginTool {
2580
3011
  type MonitorEvent = {
2581
3012
  type: 'turn.completed';
2582
3013
  sessionId: string;
2583
- tokens: {
3014
+ tokenUsage: {
2584
3015
  input: number;
2585
3016
  output: number;
2586
3017
  };
2587
- } | {
3018
+ }
3019
+ /**
3020
+ * 压缩发生。`tokensSaved` **可选**——引擎侧 `compaction.after` 当前只携带
3021
+ * `retainedCount`(裁剪后保留的消息数),没有"裁剪前后 token 差值"这个量纲
3022
+ * (见 `@x-otto/hook-contracts` 的 `HookPayloadMap['compaction.after']`)。
3023
+ *
3024
+ * 为什么是可选而不是填 0:`0` 是一个**合法取值**("确实没省下 token"),用它冒充
3025
+ * "未知"会让任何基于该字段的统计静默得到错误结果,且插件作者无从分辨。`undefined`
3026
+ * 在类型层就强制消费方处理"拿不到这个量"的情况,这是诚实降级的正确形态。
3027
+ * 若未来 `compaction.after` 补充 token 维度数据,此处透传真实值即可,契约无需再改。
3028
+ */
3029
+ | {
2588
3030
  type: 'compaction.occurred';
2589
3031
  sessionId: string;
2590
- tokensSaved: number;
3032
+ tokensSaved?: number;
2591
3033
  } | {
2592
3034
  type: 'error';
2593
3035
  sessionId: string;
@@ -2615,7 +3057,32 @@ type MonitorEvent = {
2615
3057
  type: 'tool.unregistered';
2616
3058
  toolName: string;
2617
3059
  source?: string;
3060
+ }
3061
+ /**
3062
+ * 插件装载失败(自迭代闭环负反馈面,08-13 终局 review B1):模型生成/用户安装的
3063
+ * 插件在装载链路任一环节失败时派发。与 `pluginHealthTracker`(人看面板)不同,
3064
+ * 本事件进 monitor 事件面——运行中的插件(如 skill-inductor)与模型可感知
3065
+ * "我生成的插件坏了",是自迭代"失败可学习"的结构化通道。observer-only。
3066
+ */
3067
+ | {
3068
+ type: 'plugin.load-failed';
3069
+ pluginId: string;
3070
+ reason: PluginLoadFailureReason;
3071
+ message: string;
3072
+ }
3073
+ /**
3074
+ * 能力缺口上报(自迭代闭环认知输入面,08-13 终局 review B2):capability_gap 工具
3075
+ * 每次上报经宿主桥接派发。缺口记录本身是跨会话聚合 store(CapabilityGapReportStore),
3076
+ * 本事件是同一事实的事件面投影——运行中的 service 插件无需轮询即可感知"本工作区
3077
+ * 出现了新能力缺口"并主动响应。observer-only。
3078
+ */
3079
+ | {
3080
+ type: 'capability_gap.reported';
3081
+ dedupKey: string;
3082
+ searchTerms: string[];
2618
3083
  };
3084
+ /** 插件装载失败原因分类(`plugin.load-failed` 事件 reason 字段)。 */
3085
+ type PluginLoadFailureReason = /** 依赖缺失/环(topology 层剔除,RFC-132 D5)。 */'dependency-missing' /** 依赖环(topology 层剔除,RFC-132 D5)。 */ | 'dependency-cycle' /** 引擎版本门不兼容(RFC-148 M0)。 */ | 'version-incompatible' /** plugin.ts 编译/加载/工厂执行失败(module-loader 层)。 */ | 'module-error' /** project/repository 插件未通过布尔信任门(RFC-124 C1,08-13 终局复核 B1 扩展)。 */ | 'not-trusted' /** manifest 声明高危能力但未显式授予(pendingCapabilities 门,RFC-140 D3,08-13 终局复核 B1 扩展)。 */ | 'capability-not-granted' /** 声明式 provider/oauth 轴装载拒绝(能力未声明/id 冲突/保留 id 等,08-13 终局复核 B1 扩展)。 */ | 'provider-rejected';
2619
3086
  /**
2620
3087
  * 插件后台观察者(RFC-129 D6,capability: `monitor`)。`onEvent` 抛错被装载器 100% 隔离
2621
3088
  * (try/catch 吞掉 + 记录日志,绝不 rethrow、绝不阻塞引擎主流程或影响其他插件/hook,R5)——
@@ -2665,6 +3132,46 @@ type FeedbackIssueResult = {
2665
3132
  kind: string;
2666
3133
  detail: string;
2667
3134
  };
3135
+ /**
3136
+ * issue 反馈来源平台(RFC-430 §2.1 双平台)。`'github'` = 公网 GitHub;`'coding'` =
3137
+ * 企业内网代码托管平台——内网地址一律经 settings(`feedback_coding_base_url`)/
3138
+ * env(token)运行时注入,公网源码(含注释)零内网域名硬编码。
3139
+ */
3140
+ type FeedbackSource = 'github' | 'coding';
3141
+ /** 面板列表展示的归一化 issue 条目(RFC-430 §2.4,github/coding 双源归一到同一形状)。 */
3142
+ interface FeedbackIssueItem {
3143
+ source: FeedbackSource;
3144
+ /** 平台侧 issue 标识(GitHub number / Coding issue id 字符串化)。 */
3145
+ platformIssueId: string;
3146
+ title: string;
3147
+ state: 'open' | 'closed';
3148
+ url: string;
3149
+ author?: string;
3150
+ createdAt?: string;
3151
+ updatedAt?: string;
3152
+ /** GitHub REST `/issues` 端点会把 PR 一并返回——`kind` 区分 issue 与讨论类条目。 */
3153
+ kind: 'issue' | 'discussion';
3154
+ /** 列表行预览摘要(正文截断片段,可选)。 */
3155
+ excerpt?: string;
3156
+ labels?: string[];
3157
+ }
3158
+ /**
3159
+ * 双源聚合列表结果(RFC-430 §2.4):任一源失败/无凭据/超时时不抛错——该源
3160
+ * `items` 为空且 `unavailable[source]` 携带面向用户的原因文案(**只含 HTTP 状态码/
3161
+ * 失败类别,绝不携带 token 或内网地址以外的敏感信息**)。
3162
+ */
3163
+ interface FeedbackIssueListResult {
3164
+ items: FeedbackIssueItem[];
3165
+ unavailable?: Partial<Record<FeedbackSource, string>>;
3166
+ }
3167
+ /** 一条「本地标记已解决」记录(RFC-430 §2.4,插件侧 JSONL 落地)。 */
3168
+ interface FeedbackResolvedMark {
3169
+ ts: number;
3170
+ source: FeedbackSource;
3171
+ platformIssueId: string;
3172
+ url: string;
3173
+ title: string;
3174
+ }
2668
3175
  /**
2669
3176
  * Feedback 能力契约(RFC-209 §2.1,capability: `feedback`)——业务逻辑/数据契约层,
2670
3177
  * 不含任何 TUI/web-ui 渲染代码。核心包(coding/cli/tui/service)只通过 `FeedbackRegistry`
@@ -2688,6 +3195,32 @@ interface FeedbackProvider {
2688
3195
  * 提供 `feedbackProviders` 的插件必须实现本方法,即使不实现 `submitIssueViaGh`)。
2689
3196
  */
2690
3197
  buildIssueUrl: (input: FeedbackIssueInput) => string;
3198
+ /**
3199
+ * 双源 issue 列表聚合(RFC-430 §2.4,反馈面板数据面)。**必填**(M1 契约扩展,
3200
+ * 与 `buildIssueUrl` 同为面板/路由的最低兜底方法)。必须 fail-soft:任一源失败/
3201
+ * 无凭据/超时时该源 items 为空且 `unavailable[source]` 携带原因,绝不抛出。
3202
+ */
3203
+ listIssues: (opts?: {
3204
+ state?: 'open' | 'closed' | 'all';
3205
+ limitPerSource?: number;
3206
+ }) => Promise<FeedbackIssueListResult>;
3207
+ /** RFC-430 §2.1 平台判定链:settings 显式值优先,`auto` 时按内网可达性探测。 */
3208
+ resolveFeedbackPlatform?: () => Promise<FeedbackSource>;
3209
+ /**
3210
+ * 本地标记「已解决」(RFC-430 §2.4)——仅本地标记(JSONL 落地),真实关闭请在
3211
+ * 平台侧操作。返回是否实际写入(shadow 模式零写盘返回 false)。
3212
+ */
3213
+ markIssueResolved?: (mark: Omit<FeedbackResolvedMark, 'ts'>) => Promise<boolean>;
3214
+ /** 取消本地「已解决」标记(原子重写剔除匹配行);无匹配/影子态返回 false。 */
3215
+ unmarkIssueResolved?: (source: FeedbackSource, platformIssueId: string) => Promise<boolean>;
3216
+ /** 读取全部本地「已解决」标记;读取失败/影子态返回空数组(fail-soft,不抛)。 */
3217
+ listResolvedMarks?: () => Promise<FeedbackResolvedMark[]>;
3218
+ /**
3219
+ * 构造 Coding 平台新建 issue 预填 URL(RFC-430 §2.6)——纯函数式字符串构造,
3220
+ * 不执行任何子进程/网络调用(同 `buildIssueUrl` 的物理分离纪律);未配置
3221
+ * `feedback_coding_base_url`/`feedback_coding_repo` 时返回 null。
3222
+ */
3223
+ buildCodingIssueUrl?: (input: FeedbackIssueInput) => string | null;
2691
3224
  }
2692
3225
  /**
2693
3226
  * 工厂返回的插件模块(装载器拆解的对象)。
@@ -2768,11 +3301,135 @@ interface PluginModule {
2768
3301
  * `onActivate` 里起 setInterval——那会被既有池的超时/回收语义打断。
2769
3302
  */
2770
3303
  services?: PluginService[];
3304
+ /**
3305
+ * RFC-410 M2:进程内 CLI 命令 handler(代码轴,挂 `PluginModule`——不是 `contributes.*`
3306
+ * 声明式轴,元数据在 `contributes.cliCommands` 声明、handler 实现在此)。key = 命令名
3307
+ * (必须与 `contributes.cliCommands[].name` 对应;装载器只注册两侧都齐全的命令)。
3308
+ *
3309
+ * 需 manifest 声明 `capabilities: ["cli.command"]`(高危,fail-closed——宿主进程内自主
3310
+ * 执行代码,同 tui.renderer 风险等级)。handler 收窄 ctx(`PluginCliCommandContext`),
3311
+ * **不含** CliContext——只有 args/options/stdout/stderr + 有限 host 能力。
3312
+ *
3313
+ * 无状态一次性边界(RFC-112 D5 继承):handler 只做查询/配置读写类一次性子命令,
3314
+ * **不得**做生命周期管理/后台常驻/detached 进程/daemonize——宿主以一次性调用 + 超时
3315
+ * 包装执行(对齐透传档 60s 语义)。返回退出码(0=成功)。
3316
+ */
3317
+ cliCommands?: Record<string, PluginCliCommandHandler>;
3318
+ /**
3319
+ * RFC-440:TUI 斜杠命令 handler(代码轴,挂 `PluginModule`——元数据在
3320
+ * `contributes.slashCommands` 声明、handler 实现在此)。key = 命令名(必须与
3321
+ * `contributes.slashCommands[].name` 对应;装载器只注册两侧都齐全的命令)。
3322
+ *
3323
+ * 需 manifest 声明 `capabilities: ["tui.command"]`(高危,fail-closed——宿主进程内
3324
+ * 自主执行代码 + TUI 交互面,同 cli.command/tui.renderer 风险等级)。handler 收窄 ctx
3325
+ * (`PluginSlashCommandContext`),**不含** CliContext——TUI 桥(openInput/confirm/
3326
+ * openPluginPanel/showToast)与 app 窄面(workspaceDir/modelId/settings.get/pluginPanels)
3327
+ * 由宿主在命令执行时注入(装载时不持有 TUI 会话状态)。
3328
+ *
3329
+ * 一次性边界(继承 RFC-410 D5 纪律):handler 只做查询/交互式一次性命令,**不得**做
3330
+ * 生命周期管理/后台常驻/detached 进程。
3331
+ *
3332
+ * **超时语义(RFC-440 §M2 D8)**:宿主以 60s 超时包装执行。超时后宿主**停止等待**并向用户
3333
+ * 提示,但**无法强杀** handler(进程内无独立线程)——挂起的 handler 会作为孤儿继续运行。
3334
+ * 因此"不常驻、按时返回"是插件作者必须自觉遵守的契约,而非宿主能强制的边界。
3335
+ */
3336
+ slashCommands?: Record<string, PluginSlashCommandHandler>;
2771
3337
  /** 激活钩子:装载完成、贡献注册后调用。 */
2772
3338
  onActivate?: () => void | Promise<void>;
2773
3339
  /** 卸载/禁用钩子。 */
2774
3340
  onDeactivate?: () => void | Promise<void>;
2775
3341
  }
3342
+ /**
3343
+ * RFC-410 M2:进程内 CLI 命令 handler 的执行上下文(**窄接口**,独立于 `@x-otto/cli`——
3344
+ * plugin 包禁止反向依赖 cli 包,故不复用 `SubCommandContext`/`CLIOptions`,只声明命令
3345
+ * handler 真正需要的字段)。
3346
+ */
3347
+ interface PluginCliCommandContext {
3348
+ /** 命令名之后的位置参数(已 tokenize,不含命令名本身)。 */
3349
+ args: string[];
3350
+ /**
3351
+ * 与命令相关的运行选项子集(宿主从 CLI 解析结果投影而来的**纯数据**快照,只读)。
3352
+ * 有意只暴露命令 handler 常用的少数字段,不透传完整 CLIOptions(避免耦合与越权)。
3353
+ */
3354
+ options: PluginCliCommandOptions;
3355
+ /** 写 stdout(宿主注入,默认 process.stdout.write)。 */
3356
+ stdout: (s: string) => void;
3357
+ /** 写 stderr(宿主注入,默认 process.stderr.write)。 */
3358
+ stderr: (s: string) => void;
3359
+ /** JSON 输出模式(`otto --json <cmd>`)——handler 据此决定输出形状(RFC-410 M3 语义)。 */
3360
+ json: boolean;
3361
+ }
3362
+ /** RFC-410 M2:投影给插件 CLI handler 的只读运行选项(纯数据,不含引擎/会话句柄)。 */
3363
+ interface PluginCliCommandOptions {
3364
+ /** 工作区目录(绝对路径)。 */
3365
+ workspaceDir: string;
3366
+ /** 显式模型 id(`-m/--model`),未指定为 undefined。 */
3367
+ model?: string;
3368
+ /** 配置文件路径(`-c/--config`),未指定为 undefined。 */
3369
+ configPath?: string;
3370
+ }
3371
+ /**
3372
+ * RFC-410 M2:进程内 CLI 命令 handler 签名。返回退出码(0=成功,非 0=失败)。
3373
+ * 宿主以超时包装调用(handler 挂起 → 超时报错,不阻塞 CLI 无限期)。
3374
+ */
3375
+ type PluginCliCommandHandler = (ctx: PluginCliCommandContext) => Promise<number> | number;
3376
+ /**
3377
+ * RFC-440:TUI 斜杠命令 handler 的 TUI 窄桥(宿主执行命令时注入)。
3378
+ * 窄接口自声明(本包不依赖 cli/tui 包,同 PluginCliCommandContext 纪律)——只暴露
3379
+ * 命令 handler 真正需要的 TUI 原语,不透传 CliContext(53 成员教训,RFC-410 评审必须调整项 #3)。
3380
+ */
3381
+ interface PluginSlashCommandTuiBridge {
3382
+ /** 打开输入弹层,返回用户输入(取消/关闭返回 null)。 */
3383
+ openInput(opts: {
3384
+ title: string;
3385
+ description?: string[];
3386
+ placeholder?: string;
3387
+ }): Promise<string | null>;
3388
+ /** 打开确认弹层,返回用户选择。 */
3389
+ confirm(title: string, message: string | string[]): Promise<boolean>;
3390
+ /** 打开插件面板(contributes.panels 注册的 Ink 面板,对齐 /schedule 的 pluginPanel 打开模式)。 */
3391
+ openPluginPanel(info: {
3392
+ title: string;
3393
+ modulePath: string;
3394
+ exportName: string;
3395
+ pluginId: string;
3396
+ }): Promise<void>;
3397
+ /** 状态栏 toast。 */
3398
+ showToast(title: string, message: string): void;
3399
+ }
3400
+ /** RFC-440:投影给插件斜杠命令 handler 的只读 app 窄面(纯数据 + 窄读取,无引擎/会话句柄)。 */
3401
+ interface PluginSlashCommandAppBridge {
3402
+ /** 工作区目录(绝对路径)。 */
3403
+ workspaceDir: string;
3404
+ /** 当前会话模型 id(可能未配置)。 */
3405
+ modelId: string | undefined;
3406
+ /** settings 窄读取(对齐 RFC-430 的 host.getSettings 语义:只读单键值,返回 unknown)。 */
3407
+ settings: {
3408
+ get(key: string): unknown;
3409
+ };
3410
+ /** 已注册的插件面板列表(供 handler 定位自己的面板打开)。 */
3411
+ pluginPanels: Array<{
3412
+ pluginId: string;
3413
+ title: string;
3414
+ modulePath: string;
3415
+ exportName: string;
3416
+ }>;
3417
+ }
3418
+ /** RFC-440:TUI 斜杠命令 handler 上下文(窄接口,宿主执行命令时注入 TUI 桥与 app 窄面)。 */
3419
+ interface PluginSlashCommandContext {
3420
+ /** 命令名之后的参数(不含 '/' 前缀与命令名本身)。 */
3421
+ args: string[];
3422
+ tui: PluginSlashCommandTuiBridge;
3423
+ app: PluginSlashCommandAppBridge;
3424
+ }
3425
+ /**
3426
+ * RFC-440:TUI 斜杠命令 handler 签名。返回 void(TUI 内以 toast/面板呈现结果,
3427
+ * 无进程退出码概念)。
3428
+ *
3429
+ * 宿主以 60s 超时包装调用:handler 挂起时宿主停止等待并 toast 提示,TUI 不被无限期阻塞;
3430
+ * 但进程内**无法强杀** handler,超时后它仍可能在后台运行(RFC-440 §M2 D8/R3)。
3431
+ */
3432
+ type PluginSlashCommandHandler = (ctx: PluginSlashCommandContext) => Promise<void> | void;
2776
3433
  /**
2777
3434
  * RFC-287 D2:宿主注入给插件的**受控能力面**(capability-gated host capabilities)。
2778
3435
  *
@@ -2822,6 +3479,57 @@ interface PluginHostCapabilities {
2822
3479
  }) => Promise<{
2823
3480
  jobId: string;
2824
3481
  }>;
3482
+ /**
3483
+ * RFC-441 M2:操作宿主调度器(**扁平端口**——隔离路径 stub 是扁平方法名→函数 Proxy,
3484
+ * 嵌套 `schedule:{...}` 必然 TypeError,评审 P0-2)。需 manifest 声明
3485
+ * `capabilities: ["schedule"]`(高危,fail-closed);未授予时均为 `undefined`。
3486
+ *
3487
+ * **安全契约(宿主侧强制)**:
3488
+ * - origin 固定 `'model'`(工具场景——插件是工具载体,发起者仍是模型,评审 P1);
3489
+ * 插件不可自选 origin,不可伪装 user/main/plugin。
3490
+ * - cron/锁/持久化/terminate 咽喉点全在宿主侧(RFC-443 内核留主线程)。
3491
+ * - 数据形状完全对齐 ScheduleCapability(create 含 name/target echo,list 含
3492
+ * enabled/recurring/last*——工具结果文案依赖,不缩减,评审 P1)。
3493
+ */
3494
+ scheduleCreate?: (input: {
3495
+ cron: string;
3496
+ prompt: string;
3497
+ recurring: boolean;
3498
+ name?: string;
3499
+ maxDurationMs?: number;
3500
+ target?: 'job' | 'session';
3501
+ modelId?: string;
3502
+ thinkingLevel?: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
3503
+ eventTrigger?: {
3504
+ source: string;
3505
+ event: string;
3506
+ filter?: {
3507
+ sessionId?: string;
3508
+ };
3509
+ };
3510
+ }) => Promise<{
3511
+ taskId: string;
3512
+ nextFireAt: number;
3513
+ name: string;
3514
+ target?: 'job' | 'session';
3515
+ }>;
3516
+ scheduleList?: () => Promise<Array<{
3517
+ id: string;
3518
+ name: string;
3519
+ cronExpression: string;
3520
+ enabled: boolean;
3521
+ recurring: boolean;
3522
+ nextFireAt: number;
3523
+ lastFiredAt?: number;
3524
+ lastFireFailed?: boolean;
3525
+ lastFireError?: string;
3526
+ }>>;
3527
+ scheduleDelete?: (taskId: string) => Promise<boolean>;
3528
+ scheduleRun?: (taskId: string) => Promise<void>;
3529
+ scheduleCancel?: (taskId: string) => Promise<{
3530
+ ok: boolean;
3531
+ reason?: string;
3532
+ }>;
2825
3533
  /**
2826
3534
  * RFC-318 D2(M1):读取一段会话轨迹(**只读**)。需 manifest 声明
2827
3535
  * `capabilities: ["session.read"]`(高危,fail-closed);未授予时本字段为 `undefined`。
@@ -2886,6 +3594,18 @@ interface PluginHostCapabilities {
2886
3594
  * `plugin:<pluginId>`,插件不能伪装成 agent/user/其他插件。
2887
3595
  */
2888
3596
  ask?: (input: HostAskInput) => Promise<_$_x_otto_interchange0.GrillAnswer>;
3597
+ /**
3598
+ * RFC-430 M1:读取宿主 settings 的**单个键值**。需 manifest 声明并授权
3599
+ * `capabilities: ["settings.read"]`(fail-closed);未授予或宿主未提供取值源时
3600
+ * 本字段为 `undefined`。
3601
+ *
3602
+ * **契约**:
3603
+ * - 只读单键、返回 `unknown`——插件侧自行运行时收窄(非法值落默认),宿主不做类型保证;
3604
+ * - 不做键白名单:settings 值面与凭据物理隔离(token 走 env / AuthStore,不进 settings);
3605
+ * - 惰性:`settings.load()` 完成前调用返回 `undefined`,插件应 fail-soft 落默认值
3606
+ * (与 RFC-230 D5「延迟冻结」纹理一致)。
3607
+ */
3608
+ getSettings?: (key: string) => unknown;
2889
3609
  }
2890
3610
  /**
2891
3611
  * RFC-318 D2(M1):`readTranscript` 的投影消息——**不是** `@x-otto/ai` 的 `Message`。
@@ -2997,6 +3717,19 @@ interface PluginServiceContext {
2997
3717
  * (走既有退避重启),**不静默吞掉**。未注册 handler 时通知被丢弃。
2998
3718
  */
2999
3719
  onNotify?: (handler: (n: PluginServiceNotification) => void | Promise<void>) => void;
3720
+ /**
3721
+ * RFC-427 D2:插件事件发布函数(可选——同 PluginContext.emitEvent)。
3722
+ * 在 service worker 中经反向 RPC 桥接到宿主 event-dispatcher。
3723
+ * 需 manifest 声明 `capabilities: ["events"]`(fail-closed:未声明不注入)。
3724
+ */
3725
+ emitEvent?: (type: string, payload: Readonly<Record<string, unknown>>) => void;
3726
+ /**
3727
+ * RFC-427 D2:插件事件订阅函数(可选——同 PluginContext.subscribeEvent)。
3728
+ * 返回 disposer(R4 可逆 effect)。
3729
+ */
3730
+ subscribeEvent?: (type: string, handler: (payload: Readonly<Record<string, unknown>>, source: {
3731
+ pluginId: string;
3732
+ }) => void) => () => void;
3000
3733
  }
3001
3734
  /**
3002
3735
  * RFC-303 M5:插件 scoped persistence 的契约 shape(`@x-otto/plugin` 契约层不下沉实现——
@@ -3081,10 +3814,10 @@ type PluginFactory = (ctx: PluginContext) => PluginModule | Promise<PluginModule
3081
3814
  declare function definePlugin(factory: PluginFactory): PluginFactory;
3082
3815
  //#endregion
3083
3816
  //#region src/input/registry.d.ts
3084
- declare function createPluginInputRegistry(): PluginInputRegistry;
3817
+ declare function createPluginInputRegistry(): PluginInputRegistry$1;
3085
3818
  //#endregion
3086
3819
  //#region src/input/builtin.d.ts
3087
- declare function createBuiltinHashtags(): SigilEntry[];
3820
+ declare function createBuiltinHashtags(): SigilEntry$1[];
3088
3821
  //#endregion
3089
3822
  //#region src/input/file-provider.d.ts
3090
3823
  interface FileProviderOptions {
@@ -3102,15 +3835,37 @@ interface FileProviderOptions {
3102
3835
  * 创建 @file 供给器。walk 结果按 TTL 缓存,query 在缓存上过滤——
3103
3836
  * 每次按键 O(n) 过滤而非重 walk 文件系统。
3104
3837
  */
3105
- declare function createFileProvider(opts: FileProviderOptions): SigilProvider;
3838
+ declare function createFileProvider(opts: FileProviderOptions): SigilProvider$1;
3106
3839
  //#endregion
3107
3840
  //#region src/trust-store.d.ts
3108
3841
  /** key(绝对路径)是否在白名单中。 */
3109
3842
  declare function isPathTrusted(storePath: string, key: string): boolean;
3110
3843
  /** 加入白名单(幂等)。返回是否发生变更(供调用方决定是否记日志)。 */
3111
3844
  declare function trustPath(storePath: string, key: string, label: string): boolean;
3112
- /** 移出白名单。返回是否发生变更。同时清除该 key 的已授予能力集(撤信任=能力清零,无残留特权)。 */
3845
+ /**
3846
+ * 移出白名单。返回是否发生变更。同时清除该 key 的已授予能力集
3847
+ * (撤信任=能力清零,无残留特权)。
3848
+ *
3849
+ * **RFC-354 P1-1**:本函数是唯一走 `requireLock` 的路径——撤销丢失是 fail-open
3850
+ * (用户以为收回权限、实际没有),故锁拿不到时**抛错而非无锁硬写**。
3851
+ * 同理 `writeStore` 落盘失败也会抛出(P5-2):撤销必须失败可见,不允许虚假确认。
3852
+ * 调用方(`extension-plugin.ts` / `misc.ts` 的撤销入口)应捕获并如实告知用户。
3853
+ */
3113
3854
  declare function untrustPath(storePath: string, key: string, label: string): boolean;
3855
+ /**
3856
+ * RFC-327 修订 R6'(M2):版本感知的授予——授予高危能力的同时记录授权时刻的插件
3857
+ * manifest 版本快照。语义同 `grantCapabilities`,额外写 `versions[key] = version`。
3858
+ *
3859
+ * 幂等语义:同 key 同版本重复调用 → 能力已含 + 版本已一致 → 返回 false(无变更)。
3860
+ * 版本变更后再次授予 → 覆盖版本快照并合并能力(重新评估的落点)。
3861
+ */
3862
+ declare function grantCapabilitiesWithVersion(storePath: string, key: string, caps: readonly string[], version: string, label: string): boolean;
3863
+ /**
3864
+ * RFC-327 修订 R6'(M2):版本匹配的能力读取——仅当记录的授权版本 === 当前版本时
3865
+ * 返回已授予能力;版本不符(或旧文件无版本快照)返回 `[]`(fail-closed)——
3866
+ * 插件更新后需重新评估白名单 timing,trust 不跨版本自动存续。
3867
+ */
3868
+ declare function grantedCapabilitiesForVersion(storePath: string, key: string, currentVersion: string): string[];
3114
3869
  //#endregion
3115
3870
  //#region src/plugin-trust.d.ts
3116
3871
  /** 信任白名单落盘路径(用户级)。`OTTO_PLUGIN_TRUST_PATH` 可覆盖(测试隔离)。调用时求值。 */
@@ -3135,12 +3890,26 @@ declare function grantedPluginCapabilities(pluginDir: string, storePath?: string
3135
3890
  declare function readHighRiskCapabilities(sourceDir: string): string[];
3136
3891
  /** 显式授予插件一组高危能力(幂等,持久化;用户逐项/整体确认后调用)。 */
3137
3892
  declare function grantPluginCapabilities(pluginDir: string, caps: readonly string[], storePath?: string): void;
3893
+ /**
3894
+ * RFC-327 修订 R6'(M2):版本感知的授予——同 grantPluginCapabilities,额外记录
3895
+ * 授权时刻的 manifest 版本快照。插件更新后调用
3896
+ * `grantedPluginCapabilitiesForVersion` 读取时版本不匹配 → 空集(fail-closed,
3897
+ * trust 不跨版本自动存续,需重新评估白名单)。
3898
+ */
3899
+ declare function grantPluginCapabilitiesWithVersion(pluginDir: string, caps: readonly string[], version: string, storePath?: string): void;
3900
+ /**
3901
+ * RFC-327 修订 R6'(M2):版本匹配的能力读取——仅当授权版本 === 当前 manifest 版本时
3902
+ * 返回已授予能力;版本变更(或旧文件无版本快照)→ `[]`(需重新评估)。
3903
+ */
3904
+ declare function grantedPluginCapabilitiesForVersion(pluginDir: string, version: string, storePath?: string): string[];
3138
3905
  /** 插件目录受信任门面探测结果(可执行面 ① + 内容面 ② + 高危能力声明 ③)。 */
3139
3906
  interface PluginExecutableSurface {
3140
3907
  mcpJson: boolean;
3141
3908
  commands: boolean;
3142
3909
  scripts: boolean;
3143
3910
  panels: boolean;
3911
+ /** 插件代码入口存在(`plugin.ts`/`plugin.tsx`,与 module-loader 的 PLUGIN_ENTRY_CANDIDATES 同源)。 */
3912
+ pluginEntry: boolean;
3144
3913
  skills: boolean;
3145
3914
  agents: boolean;
3146
3915
  cli: boolean;
@@ -3204,6 +3973,47 @@ interface PluginTrustVerdict {
3204
3973
  */
3205
3974
  declare function evaluatePluginTrust(plugin: DiscoveredPlugin, storePath?: string): PluginTrustVerdict;
3206
3975
  //#endregion
3976
+ //#region src/config-sensitive.d.ts
3977
+ /**
3978
+ * config-sensitive.ts —— RFC-401 重要事项规则 9:配置敏感字段脱敏。
3979
+ *
3980
+ * config 能力本身非高危(纯数据声明),但配置值可能含 apiKey/secret/token 等敏感字段。
3981
+ * 宿主在日志/错误信息中输出配置值时,须自动 redact 敏感字段——不依赖插件自觉。
3982
+ *
3983
+ * 判据:字段名(不区分大小写)匹配 `apiKey`/`secret`/`token`/`password`/`credential`
3984
+ * 任一子串 → 值替换为 `'[REDACTED]'`。非敏感字段原样输出。
3985
+ */
3986
+ /** 判断字段名是否敏感(子串匹配,不区分大小写)。 */
3987
+ declare function isSensitiveField(fieldName: string): boolean;
3988
+ /**
3989
+ * 脱敏配置对象:深遍历,敏感字段的值替换为 `'[REDACTED]'`。
3990
+ * 返回新对象,不修改原对象。
3991
+ */
3992
+ declare function redactSensitiveFields(config: Record<string, unknown>): Record<string, unknown>;
3993
+ //#endregion
3994
+ //#region src/config-merge.d.ts
3995
+ /**
3996
+ * config-merge.ts —— RFC-401 D2:配置合并纯函数。
3997
+ *
3998
+ * 将 manifest config schema 的默认值与 PluginConfigStore 持久化值合并
3999
+ * (store 值 overlay manifest 默认值)。纯函数、零副作用、零依赖。
4000
+ *
4001
+ * 供 @x-otto/coding 的 module-loader 在装载时调用,也供测试验证。
4002
+ */
4003
+ interface ConfigSchemaLike {
4004
+ /**
4005
+ * 属性表:值类型为 unknown(与 manifest 的 zod schema 对齐——z.record(z.string(), z.unknown()),
4006
+ * 递归 JSON schema entry 的值在 zod 推导时为 unknown)。合并实现做运行时窄化
4007
+ * (`typeof def === 'object' && 'default' in def`),只读 default 字段,不关心其余形状。
4008
+ */
4009
+ properties?: Record<string, unknown>;
4010
+ }
4011
+ /**
4012
+ * 合并 manifest config schema 默认值与 PluginConfigStore 持久化值。
4013
+ * store 值 overlay manifest 默认值——store 里不在 schema 里的字段保留(前向兼容)。
4014
+ */
4015
+ declare function mergeConfigWithDefaults(schema: ConfigSchemaLike | undefined, stored: Record<string, unknown>): Record<string, unknown>;
4016
+ //#endregion
3207
4017
  //#region src/i18n-registry.d.ts
3208
4018
  /** 单条 i18n 贡献条目(loader 产出,供 `register()` 消费)。 */
3209
4019
  interface PluginI18nEntry {
@@ -3253,5 +4063,5 @@ declare class PluginI18nRegistry extends TypedEventEmitter<PluginI18nRegistryEve
3253
4063
  t(fullKey: string, locale?: string): string;
3254
4064
  }
3255
4065
  //#endregion
3256
- export { type ActionContribution, type AgentContribution, type CommandContribution, type CommandRef, type ContextKeyProvider, type ContextMap, type ContextSourceContribution, type ContributionPoint, type DiscoverPluginsOptions, type DiscoveredPlugin, type DispatchCaps, EXTENSION_POINTS, type EngineCompatResult, type FeedbackIssueInput, type FeedbackIssueResult, type FeedbackProvider, type FileProviderOptions, HIGH_RISK_CAPABILITIES, type HostAskInput, ID_RE, MAX_I18N_ENTRIES_PER_PLUGIN, MAX_I18N_FILE_BYTES, MAX_I18N_LOCALE_FILES_PER_PLUGIN, MAX_I18N_TRANSLATION_BYTES, MAX_THEME_PRESETS_PER_PLUGIN, type McpContribution, type McpTransport, type MenuContribution, type MonitorEvent, type OAuthContribution, PLUGIN_API_VERSION, PLUGIN_CAPABILITIES, PLUGIN_MANIFEST_FILENAME, POINT, type PerfMetricContribution, type PluginA2uiComponentEntry, type PluginA2uiRendererEntry, type PluginCapability, type PluginCliContribution, type PluginContext, type PluginContributes, type PluginContributions, type PluginExecutableSurface, type PluginFactory, type PluginFileViewerEntry, type PluginHooks, type PluginHostCapabilities, type PluginI18nContribution, type PluginI18nEntry, PluginI18nRegistry, type PluginInputRegistry, type PluginManifest, type PluginModelEntry, type PluginModule, type PluginMonitor, type PluginPanelEntry, type PluginProviderEntry, type PluginProviderFactory, type PluginRendererEntry, type PluginScheduleSubscription, type PluginScopedStorageShape, type PluginScripts, type PluginService, type PluginServiceContext, type PluginServiceNotification, type PluginThemePresetColors, type PluginThemePresetContribution, type PluginTool, type PluginToolContext, type PluginTrustVerdict, type PluginWireProtocolRegistration, type PreToolUseDecision, type PulseSurveyEntry, type PulseSurveyRating, type PulseSurveyResolvedConfig, type ResolvedAction, SHELL_POINTS, type ScheduleTickNotification, type SessionIdleNotification, type SigilEntry, type SigilEntryContribution, type SigilKind, type SigilPrefix, type SigilProvider, type SigilSource, type SkillContribution, type StatusItemContribution, type StatusWidgetContribution, type ToolUseContext, type TopoSortResult, type TranscriptMessage, createBuiltinHashtags, createFileProvider, createPluginInputRegistry, definePlugin, detectPluginExecutableSurface, discoverPlugins, dispatch, evaluateContextKey, evaluateContextKeys, evaluatePluginTrust, evaluateWhen, expandPath, filterEngineCompatible, grantPluginCapabilities, grantedPluginCapabilities, isEngineCompatible, isPathTrusted, isPluginTrusted, mergeContributions, parsePluginManifest, pluginTrustStorePath, readHighRiskCapabilities, resolveActions, resolveActivationEvents, sigilOf, topoSortPlugins, trustPath, trustPlugin, untrustPath, untrustPlugin };
4066
+ export { type ActionContribution, type AgentContribution, type CommandContribution, type CommandRef, type ConfigSchemaLike, type ContextKeyProvider, type ContextMap, type ContextSourceContribution, type ContributionPoint, type DiscoverPluginsOptions, type DiscoveredPlugin, type DispatchCaps, EXTENSION_POINTS, type EngineCompatResult, type FeedbackIssueInput, type FeedbackIssueItem, type FeedbackIssueListResult, type FeedbackIssueResult, type FeedbackProvider, type FeedbackResolvedMark, type FeedbackSource, type FileProviderOptions, HIGH_RISK_CAPABILITIES, type HostAskInput, ID_RE, MAX_CONFIG_FIELDS_PER_PLUGIN, MAX_CONFIG_FIELD_DESCRIPTION_CHARS, MAX_CONFIG_SCHEMA_BYTES, MAX_CONFIG_SCHEMA_DEPTH, MAX_I18N_ENTRIES_PER_PLUGIN, MAX_I18N_FILE_BYTES, MAX_I18N_LOCALE_FILES_PER_PLUGIN, MAX_I18N_TRANSLATION_BYTES, MAX_THEME_PRESETS_PER_PLUGIN, type McpContribution, type McpTransport, type MenuContribution, type MonitorEvent, type OAuthContribution, PLUGIN_API_VERSION, PLUGIN_CAPABILITIES, PLUGIN_MANIFEST_FILENAME, POINT, type PerfMetricContribution, type PluginA2uiComponentEntry, type PluginA2uiRendererEntry, type PluginCapability, type PluginCliCommandContext, type PluginCliCommandContribution, type PluginCliCommandHandler, type PluginCliCommandOptions, type PluginCliContribution, type PluginConfigSchemaEntry, type PluginContext, type PluginContributes, type PluginContributions, type PluginEventContribution, type PluginExecutableSurface, type PluginFactory, type PluginFileViewerEntry, type PluginHooks, type PluginHostCapabilities, type PluginI18nContribution, type PluginI18nEntry, PluginI18nRegistry, type PluginInputRegistry, type PluginLoadFailureReason, type PluginManifest, type PluginManifestPlane, type PluginMessageHooks, type PluginModelEntry, type PluginModule, type PluginMonitor, type PluginPanelEntry, type PluginProviderEntry, type PluginProviderFactory, type PluginRendererEntry, type PluginScheduleSubscription, type PluginScopedStorageShape, type PluginScripts, type PluginService, type PluginServiceContext, type PluginServiceNotification, type PluginSessionHooks, type PluginSlashCommandAppBridge, type PluginSlashCommandContext, type PluginSlashCommandContribution, type PluginSlashCommandHandler, type PluginSlashCommandTuiBridge, type PluginTaskHooks, type PluginThemePresetColors, type PluginThemePresetContribution, type PluginTool, type PluginToolContext, type PluginToolHooks, type PluginTrustVerdict, type PluginWaterfallHandler, type PluginWaterfallHooks, type PluginWireProtocolRegistration, type PreToolUseDecision, type PulseSurveyEntry, type PulseSurveyRating, type PulseSurveyResolvedConfig, type ResolvedAction, SHELL_POINTS, type ScheduleTickNotification, type SessionIdleNotification, type SigilEntry, type SigilEntryContribution, type SigilKind, type SigilPrefix, type SigilProvider, type SigilSource, type SkillContribution, type StatusItemContribution, type StatusWidgetContribution, type ToolUseContext, type TopoSortResult, type TranscriptMessage, createBuiltinHashtags, createFileProvider, createPluginInputRegistry, definePlugin, detectPluginExecutableSurface, discoverPlugins, dispatch, evaluateContextKey, evaluateContextKeys, evaluatePluginTrust, evaluateWhen, expandPath, filterEngineCompatible, grantCapabilitiesWithVersion, grantPluginCapabilities, grantPluginCapabilitiesWithVersion, grantedCapabilitiesForVersion, grantedPluginCapabilities, grantedPluginCapabilitiesForVersion, isEngineCompatible, isPathTrusted, isPluginTrusted, isSensitiveField, mergeConfigWithDefaults, mergeContributions, parsePluginManifest, pluginTrustStorePath, readHighRiskCapabilities, redactSensitiveFields, resolveActions, resolveActivationEvents, resolveManifestPlane, sigilOf, topoSortPlugins, trustPath, trustPlugin, untrustPath, untrustPlugin };
3257
4067
  //# sourceMappingURL=index.d.ts.map