mu-agent 0.1.7 → 0.1.10

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.
Files changed (198) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +34 -29
  3. package/dist/bundle/chunks/anthropic-messages-4PAJY4R6.js +6 -0
  4. package/dist/bundle/chunks/anthropic.js +2 -2
  5. package/dist/bundle/chunks/azure-openai-responses-Y4BBWQ3N.js +2 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +12 -9
  7. package/dist/bundle/chunks/{chunk-TRDNDS6A.js → chunk-3V45WARH.js} +6 -3
  8. package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-5AGIVGSV.js} +3 -3
  9. package/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
  10. package/dist/bundle/chunks/chunk-7CBJINYJ.js +20 -0
  11. package/dist/bundle/chunks/{chunk-DRQDKNXA.js → chunk-7DDKXS2Q.js} +1 -1
  12. package/dist/bundle/chunks/chunk-BSS6T6KQ.js +2 -0
  13. package/dist/bundle/chunks/chunk-CF5GWZHW.js +31 -0
  14. package/dist/bundle/chunks/chunk-DNNHZBQR.js +4 -0
  15. package/dist/bundle/chunks/chunk-FN6OEZYR.js +2 -0
  16. package/dist/bundle/chunks/chunk-FTJT2X6E.js +2 -0
  17. package/dist/bundle/chunks/chunk-HZNN636Z.js +130 -0
  18. package/dist/bundle/chunks/{chunk-4L3WN2XY.js → chunk-JXWJOIH4.js} +1 -1
  19. package/dist/bundle/chunks/{chunk-4O2SCVYF.js → chunk-KIDDRTZP.js} +4 -4
  20. package/dist/bundle/chunks/chunk-LMNWTX2L.js +11 -0
  21. package/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
  22. package/dist/bundle/chunks/{chunk-6CYCI3EJ.js → chunk-LVVZS2NO.js} +1 -1
  23. package/dist/bundle/chunks/chunk-NN4BEPYX.js +2 -0
  24. package/dist/bundle/chunks/chunk-O7IPTASE.js +1221 -0
  25. package/dist/bundle/chunks/chunk-PMRZO46Y.js +2 -0
  26. package/dist/bundle/chunks/chunk-QOEEJKS4.js +9 -0
  27. package/dist/bundle/chunks/chunk-R4VPBBDS.js +2 -0
  28. package/dist/bundle/chunks/chunk-RAQ6TU76.js +2 -0
  29. package/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
  30. package/dist/bundle/chunks/chunk-SGOTYFMT.js +91 -0
  31. package/dist/bundle/chunks/chunk-TMTOQ7H7.js +2 -0
  32. package/dist/bundle/chunks/chunk-UKVNB6C4.js +2 -0
  33. package/dist/bundle/chunks/chunk-VJLOQZKR.js +9 -0
  34. package/dist/bundle/chunks/chunk-WCGU75WO.js +11 -0
  35. package/dist/bundle/chunks/chunk-X234222Q.js +64 -0
  36. package/dist/bundle/chunks/cli-722OL3K5.js +51 -0
  37. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-MEZHQVNP.js +2 -0
  38. package/dist/bundle/chunks/codemode-worker.js +478 -0
  39. package/dist/bundle/chunks/easter-egg-3d-6H34EDGX.js +2 -0
  40. package/dist/bundle/chunks/execute-KVSEIDWL.js +499 -0
  41. package/dist/bundle/chunks/github-copilot.js +1 -1
  42. package/dist/bundle/chunks/{google-generative-ai-C44KRRZ4.js → google-generative-ai-D2VJQBTK.js} +1 -1
  43. package/dist/bundle/chunks/{google-vertex-25DUXPTJ.js → google-vertex-SQG2BO6C.js} +1 -1
  44. package/dist/bundle/chunks/https-proxy-agent-LVOO5TPL.js +13 -0
  45. package/dist/bundle/chunks/image-resize-worker.js +1 -1
  46. package/dist/bundle/chunks/{jiti-loader-C3NU2SDH.js → jiti-loader-GL4HJFAD.js} +1 -1
  47. package/dist/bundle/chunks/{jiti-static-loader-E6ANQD5T.js → jiti-static-loader-2RCDI6B4.js} +1 -1
  48. package/dist/bundle/chunks/{lib-HGQMNYVT.js → lib-4AVRLBHM.js} +2 -2
  49. package/dist/bundle/chunks/llama-cpp-classify-5YHLY3RC.js +22 -0
  50. package/dist/bundle/chunks/mistral-conversations-BDARVJTT.js +5 -0
  51. package/dist/bundle/chunks/{multipart-parser-SQ6GDJL7.js → multipart-parser-FMGQ7342.js} +1 -1
  52. package/dist/bundle/chunks/{node-TWVVAGPO.js → node-AUOGOBCN.js} +1 -1
  53. package/dist/bundle/chunks/node-KCMANYC2.js +16 -0
  54. package/dist/bundle/chunks/openai-chatgpt.js +86 -0
  55. package/dist/bundle/chunks/openai-codex-responses-CECGTDYD.js +10 -0
  56. package/dist/bundle/chunks/openai-codex.js +2 -2
  57. package/dist/bundle/chunks/openai-completions-UOA7MELD.js +7 -0
  58. package/dist/bundle/chunks/openai-decisions-HLM372N6.js +5 -0
  59. package/dist/bundle/chunks/openai-responses-TII7ZY5X.js +3 -0
  60. package/dist/bundle/chunks/{openrouter-images-JVEJN44Q.js → openrouter-images-7T452AS5.js} +1 -1
  61. package/dist/bundle/chunks/openrouter.js +2 -2
  62. package/dist/bundle/chunks/{pi-messages-TM5SOOIW.js → pi-messages-2UDKLKOO.js} +1 -1
  63. package/dist/bundle/chunks/radius.js +2 -2
  64. package/dist/bundle/chunks/runtime-O3ELDOM7.js +2 -0
  65. package/dist/bundle/chunks/{src-UK77SYZE.js → src-QKGKDFSU.js} +1 -1
  66. package/dist/bundle/chunks/typesafe-system-one-KNCICMO5.js +2 -0
  67. package/dist/bundle/chunks/virtual-modules-IKEARUOZ.js +2 -0
  68. package/dist/bundle/cli-runtime.js +1 -1
  69. package/dist/bundle/index.js +1 -1
  70. package/dist/bundle/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
  71. package/dist/bundle/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
  72. package/dist/bundle/rpc-entry.js +1 -1
  73. package/dist/core/export-html/template.js +37 -16
  74. package/dist/modes/interactive/theme/dark.json +60 -73
  75. package/dist/modes/interactive/theme/light.json +58 -70
  76. package/dist/modes/interactive/theme/system-theme.d.ts +55 -0
  77. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  78. package/dist/modes/interactive/theme/system-theme.js +546 -0
  79. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  80. package/dist/modes/interactive/theme/theme-controller.d.ts +43 -9
  81. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  82. package/dist/modes/interactive/theme/theme-controller.js +121 -79
  83. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  84. package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
  85. package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  86. package/dist/modes/interactive/theme/theme-schema.js +105 -0
  87. package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  88. package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
  89. package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
  90. package/dist/modes/interactive/theme/theme-tokens.js +94 -0
  91. package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
  92. package/dist/modes/interactive/theme/theme.d.ts +47 -56
  93. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  94. package/dist/modes/interactive/theme/theme.js +149 -143
  95. package/dist/modes/interactive/theme/theme.js.map +1 -1
  96. package/dist/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
  97. package/dist/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
  98. package/docs/cli-integration.md +1 -1
  99. package/docs/cli.md +78 -13
  100. package/docs/codemode.md +230 -0
  101. package/docs/compaction.md +5 -5
  102. package/docs/configuration.md +2 -0
  103. package/docs/custom-provider.md +53 -1
  104. package/docs/docs.json +21 -1
  105. package/docs/environment-variables.md +5 -3
  106. package/docs/extensions.md +172 -10
  107. package/docs/index.md +1 -1
  108. package/docs/json.md +3 -3
  109. package/docs/keybindings.md +7 -6
  110. package/docs/llama-cpp.md +21 -1
  111. package/docs/mcp.md +272 -0
  112. package/docs/message-types.md +22 -4
  113. package/docs/models-configuration.md +187 -0
  114. package/docs/models.md +100 -2
  115. package/docs/nvidia-rtx-llama-cpp.md +96 -0
  116. package/docs/packages.md +1 -1
  117. package/docs/providers.md +66 -6
  118. package/docs/quickstart.md +16 -2
  119. package/docs/rpc-commands.md +9 -3
  120. package/docs/rpc.md +3 -1
  121. package/docs/sdk.md +8 -3
  122. package/docs/security.md +2 -0
  123. package/docs/session-format.md +5 -1
  124. package/docs/sessions.md +1 -1
  125. package/docs/settings.md +30 -8
  126. package/docs/terminal-setup.md +14 -0
  127. package/docs/themes.md +31 -7
  128. package/docs/tui.md +71 -1
  129. package/docs/usage.md +2 -2
  130. package/docs/virtual-models.md +114 -0
  131. package/docs/windows.md +2 -0
  132. package/examples/README.md +1 -4
  133. package/examples/extensions/README.md +1 -0
  134. package/examples/extensions/built-in-tool-renderer.ts +16 -40
  135. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  136. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  137. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  138. package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  139. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  140. package/examples/extensions/gondolin/package-lock.json +2 -2
  141. package/examples/extensions/gondolin/package.json +1 -1
  142. package/examples/extensions/jev-router.ts +113 -0
  143. package/examples/extensions/minimal-mode.ts +28 -101
  144. package/examples/extensions/overlay-test.ts +2 -2
  145. package/examples/extensions/plan-mode/index.ts +6 -2
  146. package/examples/extensions/sandbox/package-lock.json +2 -2
  147. package/examples/extensions/sandbox/package.json +1 -1
  148. package/examples/extensions/subagent/index.ts +4 -6
  149. package/examples/extensions/with-deps/package-lock.json +2 -2
  150. package/examples/extensions/with-deps/package.json +1 -1
  151. package/examples/rpc-client.ts +1 -1
  152. package/examples/rpc-extension-ui.ts +1 -1
  153. package/examples/sdk/14-codemode-mcp.ts +61 -0
  154. package/examples/sdk/README.md +2 -1
  155. package/judge/THIRD_PARTY_NOTICES.md +63 -0
  156. package/judge/dist/auth.js +169 -123
  157. package/judge/dist/import.js +36 -30
  158. package/judge/dist/setup.js +250 -120
  159. package/judge/manifest.json +1008 -316
  160. package/judge/{dist/kyrn-judge.js → mu/index.js} +6933 -5995
  161. package/judge/themes/mu-dark.json +80 -0
  162. package/judge/themes/mu-light.json +80 -0
  163. package/kyrn/bin/kyrn-doctor +75 -25
  164. package/kyrn/bin/kyrn-judge-local +2 -2
  165. package/kyrn/bin/kyrn-ledger +1 -1
  166. package/kyrn/bin/mu.mjs +149 -107
  167. package/package.json +4 -5
  168. package/dist/bundle/chunks/anthropic-messages-VMESUHQ7.js +0 -6
  169. package/dist/bundle/chunks/azure-openai-responses-K232MQFF.js +0 -2
  170. package/dist/bundle/chunks/chunk-A3JYRWB6.js +0 -2
  171. package/dist/bundle/chunks/chunk-AYFRR3OD.js +0 -2
  172. package/dist/bundle/chunks/chunk-DTD7JQ7Y.js +0 -42
  173. package/dist/bundle/chunks/chunk-FU4XQUSL.js +0 -11
  174. package/dist/bundle/chunks/chunk-GNYZK6XN.js +0 -2
  175. package/dist/bundle/chunks/chunk-HEMXN7VJ.js +0 -1653
  176. package/dist/bundle/chunks/chunk-MVPXOVOJ.js +0 -2
  177. package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
  178. package/dist/bundle/chunks/chunk-V7IXECST.js +0 -11
  179. package/dist/bundle/chunks/chunk-XNGRGP62.js +0 -2
  180. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-NR2TDCXU.js +0 -2
  181. package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +0 -13
  182. package/dist/bundle/chunks/mistral-conversations-6IHQOR4R.js +0 -5
  183. package/dist/bundle/chunks/node-O3RIBJRH.js +0 -16
  184. package/dist/bundle/chunks/openai-codex-responses-3UAYOSSR.js +0 -10
  185. package/dist/bundle/chunks/openai-completions-FIEQGWAH.js +0 -7
  186. package/dist/bundle/chunks/openai-responses-OZJXLHFC.js +0 -2
  187. package/dist/bundle/chunks/typesafe-system-one-VKYX4OGY.js +0 -2
  188. package/dist/bundle/chunks/virtual-modules-V7SXVVLP.js +0 -2
  189. package/dist/modes/interactive/theme/theme-json.d.ts +0 -85
  190. package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
  191. package/dist/modes/interactive/theme/theme-json.js +0 -132
  192. package/dist/modes/interactive/theme/theme-json.js.map +0 -1
  193. package/dist/modes/interactive/theme/theme-schema.json +0 -361
  194. package/examples/plugins/pi-example-plugin/README.md +0 -38
  195. package/examples/plugins/pi-example-plugin/package.json +0 -10
  196. package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  197. package/examples/plugins/pi-example-plugin/src/session.ts +0 -24
  198. package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
@@ -1,85 +0,0 @@
1
- /**
2
- * Theme JSON validation, kept out of `theme.ts` on purpose.
3
- *
4
- * Validating user-authored theme files needs typebox, which costs ~17 MB of module graph to import.
5
- * Palette lookup does not, so a presentation that only uses built-in themes should never pay for it.
6
- * `interactive-mode.ts` installs this validator; anything that does not simply skips validation, as
7
- * built-in themes already do.
8
- */
9
- import { type Static, Type } from "typebox";
10
- declare const ColorValueSchema: Type.TUnion<[Type.TString, Type.TInteger]>;
11
- declare const ThemeJsonSchema: Type.TObject<{
12
- $schema: Type.TOptional<Type.TString>;
13
- name: Type.TString;
14
- appearance: Type.TOptional<Type.TUnion<[Type.TLiteral<"dark">, Type.TLiteral<"light">]>>;
15
- vars: Type.TOptional<Type.TRecord<"^.*$", Type.TUnion<[Type.TString, Type.TInteger]>>>;
16
- colors: Type.TObject<{
17
- accent: Type.TUnion<[Type.TString, Type.TInteger]>;
18
- border: Type.TUnion<[Type.TString, Type.TInteger]>;
19
- borderAccent: Type.TUnion<[Type.TString, Type.TInteger]>;
20
- borderMuted: Type.TUnion<[Type.TString, Type.TInteger]>;
21
- success: Type.TUnion<[Type.TString, Type.TInteger]>;
22
- error: Type.TUnion<[Type.TString, Type.TInteger]>;
23
- warning: Type.TUnion<[Type.TString, Type.TInteger]>;
24
- muted: Type.TUnion<[Type.TString, Type.TInteger]>;
25
- dim: Type.TUnion<[Type.TString, Type.TInteger]>;
26
- text: Type.TUnion<[Type.TString, Type.TInteger]>;
27
- thinkingText: Type.TUnion<[Type.TString, Type.TInteger]>;
28
- scrollbarTrack: Type.TOptional<Type.TUnion<[Type.TString, Type.TInteger]>>;
29
- scrollbarThumb: Type.TOptional<Type.TUnion<[Type.TString, Type.TInteger]>>;
30
- selectedBg: Type.TUnion<[Type.TString, Type.TInteger]>;
31
- searchMatchBg: Type.TOptional<Type.TUnion<[Type.TString, Type.TInteger]>>;
32
- searchMatchText: Type.TOptional<Type.TUnion<[Type.TString, Type.TInteger]>>;
33
- userMessageBg: Type.TUnion<[Type.TString, Type.TInteger]>;
34
- userMessageText: Type.TUnion<[Type.TString, Type.TInteger]>;
35
- customMessageBg: Type.TUnion<[Type.TString, Type.TInteger]>;
36
- customMessageText: Type.TUnion<[Type.TString, Type.TInteger]>;
37
- customMessageLabel: Type.TUnion<[Type.TString, Type.TInteger]>;
38
- toolPendingBg: Type.TUnion<[Type.TString, Type.TInteger]>;
39
- toolSuccessBg: Type.TUnion<[Type.TString, Type.TInteger]>;
40
- toolErrorBg: Type.TUnion<[Type.TString, Type.TInteger]>;
41
- toolTitle: Type.TUnion<[Type.TString, Type.TInteger]>;
42
- toolOutput: Type.TUnion<[Type.TString, Type.TInteger]>;
43
- mdHeading: Type.TUnion<[Type.TString, Type.TInteger]>;
44
- mdLink: Type.TUnion<[Type.TString, Type.TInteger]>;
45
- mdLinkUrl: Type.TUnion<[Type.TString, Type.TInteger]>;
46
- mdCode: Type.TUnion<[Type.TString, Type.TInteger]>;
47
- mdCodeBlock: Type.TUnion<[Type.TString, Type.TInteger]>;
48
- mdCodeBlockBorder: Type.TUnion<[Type.TString, Type.TInteger]>;
49
- mdQuote: Type.TUnion<[Type.TString, Type.TInteger]>;
50
- mdQuoteBorder: Type.TUnion<[Type.TString, Type.TInteger]>;
51
- mdHr: Type.TUnion<[Type.TString, Type.TInteger]>;
52
- mdListBullet: Type.TUnion<[Type.TString, Type.TInteger]>;
53
- toolDiffAdded: Type.TUnion<[Type.TString, Type.TInteger]>;
54
- toolDiffRemoved: Type.TUnion<[Type.TString, Type.TInteger]>;
55
- toolDiffContext: Type.TUnion<[Type.TString, Type.TInteger]>;
56
- syntaxComment: Type.TUnion<[Type.TString, Type.TInteger]>;
57
- syntaxKeyword: Type.TUnion<[Type.TString, Type.TInteger]>;
58
- syntaxFunction: Type.TUnion<[Type.TString, Type.TInteger]>;
59
- syntaxVariable: Type.TUnion<[Type.TString, Type.TInteger]>;
60
- syntaxString: Type.TUnion<[Type.TString, Type.TInteger]>;
61
- syntaxNumber: Type.TUnion<[Type.TString, Type.TInteger]>;
62
- syntaxType: Type.TUnion<[Type.TString, Type.TInteger]>;
63
- syntaxOperator: Type.TUnion<[Type.TString, Type.TInteger]>;
64
- syntaxPunctuation: Type.TUnion<[Type.TString, Type.TInteger]>;
65
- thinkingOff: Type.TUnion<[Type.TString, Type.TInteger]>;
66
- thinkingMinimal: Type.TUnion<[Type.TString, Type.TInteger]>;
67
- thinkingLow: Type.TUnion<[Type.TString, Type.TInteger]>;
68
- thinkingMedium: Type.TUnion<[Type.TString, Type.TInteger]>;
69
- thinkingHigh: Type.TUnion<[Type.TString, Type.TInteger]>;
70
- thinkingXhigh: Type.TUnion<[Type.TString, Type.TInteger]>;
71
- thinkingMax: Type.TOptional<Type.TUnion<[Type.TString, Type.TInteger]>>;
72
- bashMode: Type.TUnion<[Type.TString, Type.TInteger]>;
73
- }>;
74
- export: Type.TOptional<Type.TObject<{
75
- pageBg: Type.TOptional<Type.TUnion<[Type.TString, Type.TInteger]>>;
76
- cardBg: Type.TOptional<Type.TUnion<[Type.TString, Type.TInteger]>>;
77
- infoBg: Type.TOptional<Type.TUnion<[Type.TString, Type.TInteger]>>;
78
- }>>;
79
- }>;
80
- export type ThemeColorValue = Static<typeof ColorValueSchema>;
81
- export type ValidatedThemeJson = Static<typeof ThemeJsonSchema>;
82
- /** Validate one theme document, throwing a message that names the offending tokens. */
83
- export declare function validateThemeJson(label: string, json: unknown): ValidatedThemeJson;
84
- export {};
85
- //# sourceMappingURL=theme-json.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-json.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme-json.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG5C,QAAA,MAAM,gBAAgB,4CAGpB,CAAC;AAEH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+EnB,CAAC;AAIH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAEhE,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,kBAAkB,CA2ClF","sourcesContent":["/**\n * Theme JSON validation, kept out of `theme.ts` on purpose.\n *\n * Validating user-authored theme files needs typebox, which costs ~17 MB of module graph to import.\n * Palette lookup does not, so a presentation that only uses built-in themes should never pay for it.\n * `interactive-mode.ts` installs this validator; anything that does not simply skips validation, as\n * built-in themes already do.\n */\n\nimport { type Static, Type } from \"typebox\";\nimport { Compile } from \"typebox/compile\";\n\nconst ColorValueSchema = Type.Union([\n\tType.String(), // hex, OKLCH, var ref \"primary\", or empty \"\"\n\tType.Integer({ minimum: 0, maximum: 255 }), // 256-color index\n]);\n\nconst ThemeJsonSchema = Type.Object({\n\t$schema: Type.Optional(Type.String()),\n\tname: Type.String(),\n\t// Background the theme is designed for. Detected from the theme colors when omitted.\n\tappearance: Type.Optional(Type.Union([Type.Literal(\"dark\"), Type.Literal(\"light\")])),\n\tvars: Type.Optional(Type.Record(Type.String(), ColorValueSchema)),\n\tcolors: Type.Object({\n\t\t// Core UI (11 colors)\n\t\taccent: ColorValueSchema,\n\t\tborder: ColorValueSchema,\n\t\tborderAccent: ColorValueSchema,\n\t\tborderMuted: ColorValueSchema,\n\t\tsuccess: ColorValueSchema,\n\t\terror: ColorValueSchema,\n\t\twarning: ColorValueSchema,\n\t\tmuted: ColorValueSchema,\n\t\tdim: ColorValueSchema,\n\t\ttext: ColorValueSchema,\n\t\tthinkingText: ColorValueSchema,\n\t\t// Scrollbar (2 optional colors)\n\t\tscrollbarTrack: Type.Optional(ColorValueSchema),\n\t\tscrollbarThumb: Type.Optional(ColorValueSchema),\n\t\t// Backgrounds & Content Text (11 required, 2 optional)\n\t\tselectedBg: ColorValueSchema,\n\t\tsearchMatchBg: Type.Optional(ColorValueSchema),\n\t\tsearchMatchText: Type.Optional(ColorValueSchema),\n\t\tuserMessageBg: ColorValueSchema,\n\t\tuserMessageText: ColorValueSchema,\n\t\tcustomMessageBg: ColorValueSchema,\n\t\tcustomMessageText: ColorValueSchema,\n\t\tcustomMessageLabel: ColorValueSchema,\n\t\ttoolPendingBg: ColorValueSchema,\n\t\ttoolSuccessBg: ColorValueSchema,\n\t\ttoolErrorBg: ColorValueSchema,\n\t\ttoolTitle: ColorValueSchema,\n\t\ttoolOutput: ColorValueSchema,\n\t\t// Markdown (10 colors)\n\t\tmdHeading: ColorValueSchema,\n\t\tmdLink: ColorValueSchema,\n\t\tmdLinkUrl: ColorValueSchema,\n\t\tmdCode: ColorValueSchema,\n\t\tmdCodeBlock: ColorValueSchema,\n\t\tmdCodeBlockBorder: ColorValueSchema,\n\t\tmdQuote: ColorValueSchema,\n\t\tmdQuoteBorder: ColorValueSchema,\n\t\tmdHr: ColorValueSchema,\n\t\tmdListBullet: ColorValueSchema,\n\t\t// Tool Diffs (3 colors)\n\t\ttoolDiffAdded: ColorValueSchema,\n\t\ttoolDiffRemoved: ColorValueSchema,\n\t\ttoolDiffContext: ColorValueSchema,\n\t\t// Syntax Highlighting (9 colors)\n\t\tsyntaxComment: ColorValueSchema,\n\t\tsyntaxKeyword: ColorValueSchema,\n\t\tsyntaxFunction: ColorValueSchema,\n\t\tsyntaxVariable: ColorValueSchema,\n\t\tsyntaxString: ColorValueSchema,\n\t\tsyntaxNumber: ColorValueSchema,\n\t\tsyntaxType: ColorValueSchema,\n\t\tsyntaxOperator: ColorValueSchema,\n\t\tsyntaxPunctuation: ColorValueSchema,\n\t\t// Thinking Level Borders (6 colors)\n\t\tthinkingOff: ColorValueSchema,\n\t\tthinkingMinimal: ColorValueSchema,\n\t\tthinkingLow: ColorValueSchema,\n\t\tthinkingMedium: ColorValueSchema,\n\t\tthinkingHigh: ColorValueSchema,\n\t\tthinkingXhigh: ColorValueSchema,\n\t\tthinkingMax: Type.Optional(ColorValueSchema),\n\t\t// Bash Mode (1 color)\n\t\tbashMode: ColorValueSchema,\n\t}),\n\texport: Type.Optional(\n\t\tType.Object({\n\t\t\tpageBg: Type.Optional(ColorValueSchema),\n\t\t\tcardBg: Type.Optional(ColorValueSchema),\n\t\t\tinfoBg: Type.Optional(ColorValueSchema),\n\t\t}),\n\t),\n});\n\nconst compiledThemeSchema = Compile(ThemeJsonSchema);\n\nexport type ThemeColorValue = Static<typeof ColorValueSchema>;\nexport type ValidatedThemeJson = Static<typeof ThemeJsonSchema>;\n\n/** Validate one theme document, throwing a message that names the offending tokens. */\nexport function validateThemeJson(label: string, json: unknown): ValidatedThemeJson {\n\tif (!compiledThemeSchema.Check(json)) {\n\t\tconst errors = Array.from(compiledThemeSchema.Errors(json));\n\t\tconst missingColors = new Set<string>();\n\t\tconst otherErrors: string[] = [];\n\n\t\tfor (const error of errors) {\n\t\t\tif (error.keyword === \"required\" && error.instancePath === \"/colors\") {\n\t\t\t\tconst requiredProperties = (error.params as { requiredProperties?: string[] }).requiredProperties;\n\t\t\t\tfor (const requiredProperty of requiredProperties ?? []) {\n\t\t\t\t\tmissingColors.add(requiredProperty);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst path = error.instancePath || \"/\";\n\t\t\totherErrors.push(` - ${path}: ${error.message}`);\n\t\t}\n\n\t\tlet errorMessage = `Invalid theme \"${label}\":\\n`;\n\t\tif (missingColors.size > 0) {\n\t\t\terrorMessage += \"\\nMissing required color tokens:\\n\";\n\t\t\terrorMessage += Array.from(missingColors)\n\t\t\t\t.sort()\n\t\t\t\t.map((color) => ` - ${color}`)\n\t\t\t\t.join(\"\\n\");\n\t\t\terrorMessage += '\\n\\nPlease add these colors to your theme\\'s \"colors\" object.';\n\t\t\terrorMessage += \"\\nSee the built-in themes (dark.json, light.json) for reference values.\";\n\t\t}\n\t\tif (otherErrors.length > 0) {\n\t\t\terrorMessage += `\\n\\nOther errors:\\n${otherErrors.join(\"\\n\")}`;\n\t\t}\n\n\t\tthrow new Error(errorMessage);\n\t}\n\n\tconst themeJson = json as ValidatedThemeJson;\n\tif (themeJson.name.includes(\"/\")) {\n\t\tthrow new Error(\n\t\t\t`Invalid theme name \"${themeJson.name}\": theme names cannot contain \"/\" because it is reserved for automatic light/dark theme settings.`,\n\t\t);\n\t}\n\treturn themeJson;\n}\n"]}
@@ -1,132 +0,0 @@
1
- /**
2
- * Theme JSON validation, kept out of `theme.ts` on purpose.
3
- *
4
- * Validating user-authored theme files needs typebox, which costs ~17 MB of module graph to import.
5
- * Palette lookup does not, so a presentation that only uses built-in themes should never pay for it.
6
- * `interactive-mode.ts` installs this validator; anything that does not simply skips validation, as
7
- * built-in themes already do.
8
- */
9
- import { Type } from "typebox";
10
- import { Compile } from "typebox/compile";
11
- const ColorValueSchema = Type.Union([
12
- Type.String(), // hex, OKLCH, var ref "primary", or empty ""
13
- Type.Integer({ minimum: 0, maximum: 255 }), // 256-color index
14
- ]);
15
- const ThemeJsonSchema = Type.Object({
16
- $schema: Type.Optional(Type.String()),
17
- name: Type.String(),
18
- // Background the theme is designed for. Detected from the theme colors when omitted.
19
- appearance: Type.Optional(Type.Union([Type.Literal("dark"), Type.Literal("light")])),
20
- vars: Type.Optional(Type.Record(Type.String(), ColorValueSchema)),
21
- colors: Type.Object({
22
- // Core UI (11 colors)
23
- accent: ColorValueSchema,
24
- border: ColorValueSchema,
25
- borderAccent: ColorValueSchema,
26
- borderMuted: ColorValueSchema,
27
- success: ColorValueSchema,
28
- error: ColorValueSchema,
29
- warning: ColorValueSchema,
30
- muted: ColorValueSchema,
31
- dim: ColorValueSchema,
32
- text: ColorValueSchema,
33
- thinkingText: ColorValueSchema,
34
- // Scrollbar (2 optional colors)
35
- scrollbarTrack: Type.Optional(ColorValueSchema),
36
- scrollbarThumb: Type.Optional(ColorValueSchema),
37
- // Backgrounds & Content Text (11 required, 2 optional)
38
- selectedBg: ColorValueSchema,
39
- searchMatchBg: Type.Optional(ColorValueSchema),
40
- searchMatchText: Type.Optional(ColorValueSchema),
41
- userMessageBg: ColorValueSchema,
42
- userMessageText: ColorValueSchema,
43
- customMessageBg: ColorValueSchema,
44
- customMessageText: ColorValueSchema,
45
- customMessageLabel: ColorValueSchema,
46
- toolPendingBg: ColorValueSchema,
47
- toolSuccessBg: ColorValueSchema,
48
- toolErrorBg: ColorValueSchema,
49
- toolTitle: ColorValueSchema,
50
- toolOutput: ColorValueSchema,
51
- // Markdown (10 colors)
52
- mdHeading: ColorValueSchema,
53
- mdLink: ColorValueSchema,
54
- mdLinkUrl: ColorValueSchema,
55
- mdCode: ColorValueSchema,
56
- mdCodeBlock: ColorValueSchema,
57
- mdCodeBlockBorder: ColorValueSchema,
58
- mdQuote: ColorValueSchema,
59
- mdQuoteBorder: ColorValueSchema,
60
- mdHr: ColorValueSchema,
61
- mdListBullet: ColorValueSchema,
62
- // Tool Diffs (3 colors)
63
- toolDiffAdded: ColorValueSchema,
64
- toolDiffRemoved: ColorValueSchema,
65
- toolDiffContext: ColorValueSchema,
66
- // Syntax Highlighting (9 colors)
67
- syntaxComment: ColorValueSchema,
68
- syntaxKeyword: ColorValueSchema,
69
- syntaxFunction: ColorValueSchema,
70
- syntaxVariable: ColorValueSchema,
71
- syntaxString: ColorValueSchema,
72
- syntaxNumber: ColorValueSchema,
73
- syntaxType: ColorValueSchema,
74
- syntaxOperator: ColorValueSchema,
75
- syntaxPunctuation: ColorValueSchema,
76
- // Thinking Level Borders (6 colors)
77
- thinkingOff: ColorValueSchema,
78
- thinkingMinimal: ColorValueSchema,
79
- thinkingLow: ColorValueSchema,
80
- thinkingMedium: ColorValueSchema,
81
- thinkingHigh: ColorValueSchema,
82
- thinkingXhigh: ColorValueSchema,
83
- thinkingMax: Type.Optional(ColorValueSchema),
84
- // Bash Mode (1 color)
85
- bashMode: ColorValueSchema,
86
- }),
87
- export: Type.Optional(Type.Object({
88
- pageBg: Type.Optional(ColorValueSchema),
89
- cardBg: Type.Optional(ColorValueSchema),
90
- infoBg: Type.Optional(ColorValueSchema),
91
- })),
92
- });
93
- const compiledThemeSchema = Compile(ThemeJsonSchema);
94
- /** Validate one theme document, throwing a message that names the offending tokens. */
95
- export function validateThemeJson(label, json) {
96
- if (!compiledThemeSchema.Check(json)) {
97
- const errors = Array.from(compiledThemeSchema.Errors(json));
98
- const missingColors = new Set();
99
- const otherErrors = [];
100
- for (const error of errors) {
101
- if (error.keyword === "required" && error.instancePath === "/colors") {
102
- const requiredProperties = error.params.requiredProperties;
103
- for (const requiredProperty of requiredProperties ?? []) {
104
- missingColors.add(requiredProperty);
105
- }
106
- continue;
107
- }
108
- const path = error.instancePath || "/";
109
- otherErrors.push(` - ${path}: ${error.message}`);
110
- }
111
- let errorMessage = `Invalid theme "${label}":\n`;
112
- if (missingColors.size > 0) {
113
- errorMessage += "\nMissing required color tokens:\n";
114
- errorMessage += Array.from(missingColors)
115
- .sort()
116
- .map((color) => ` - ${color}`)
117
- .join("\n");
118
- errorMessage += '\n\nPlease add these colors to your theme\'s "colors" object.';
119
- errorMessage += "\nSee the built-in themes (dark.json, light.json) for reference values.";
120
- }
121
- if (otherErrors.length > 0) {
122
- errorMessage += `\n\nOther errors:\n${otherErrors.join("\n")}`;
123
- }
124
- throw new Error(errorMessage);
125
- }
126
- const themeJson = json;
127
- if (themeJson.name.includes("/")) {
128
- throw new Error(`Invalid theme name "${themeJson.name}": theme names cannot contain "/" because it is reserved for automatic light/dark theme settings.`);
129
- }
130
- return themeJson;
131
- }
132
- //# sourceMappingURL=theme-json.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-json.js","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme-json.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC;IACnC,IAAI,CAAC,MAAM,EAAE,EAAE,6CAA6C;IAC5D,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,kBAAkB;CAC9D,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACrC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,qFAAqF;IACrF,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpF,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC;IACjE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QACnB,sBAAsB;QACtB,MAAM,EAAE,gBAAgB;QACxB,MAAM,EAAE,gBAAgB;QACxB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C;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AAAA,CACjB","sourcesContent":["/**\n * Theme JSON validation, kept out of `theme.ts` on purpose.\n *\n * Validating user-authored theme files needs typebox, which costs ~17 MB of module graph to import.\n * Palette lookup does not, so a presentation that only uses built-in themes should never pay for it.\n * `interactive-mode.ts` installs this validator; anything that does not simply skips validation, as\n * built-in themes already do.\n */\n\nimport { type Static, Type } from \"typebox\";\nimport { Compile } from \"typebox/compile\";\n\nconst ColorValueSchema = Type.Union([\n\tType.String(), // hex, OKLCH, var ref \"primary\", or empty \"\"\n\tType.Integer({ minimum: 0, maximum: 255 }), // 256-color index\n]);\n\nconst ThemeJsonSchema = Type.Object({\n\t$schema: Type.Optional(Type.String()),\n\tname: Type.String(),\n\t// Background the theme is designed for. Detected from the theme colors when omitted.\n\tappearance: Type.Optional(Type.Union([Type.Literal(\"dark\"), Type.Literal(\"light\")])),\n\tvars: Type.Optional(Type.Record(Type.String(), ColorValueSchema)),\n\tcolors: Type.Object({\n\t\t// Core UI (11 colors)\n\t\taccent: ColorValueSchema,\n\t\tborder: ColorValueSchema,\n\t\tborderAccent: ColorValueSchema,\n\t\tborderMuted: ColorValueSchema,\n\t\tsuccess: ColorValueSchema,\n\t\terror: ColorValueSchema,\n\t\twarning: ColorValueSchema,\n\t\tmuted: ColorValueSchema,\n\t\tdim: ColorValueSchema,\n\t\ttext: ColorValueSchema,\n\t\tthinkingText: ColorValueSchema,\n\t\t// Scrollbar (2 optional colors)\n\t\tscrollbarTrack: Type.Optional(ColorValueSchema),\n\t\tscrollbarThumb: Type.Optional(ColorValueSchema),\n\t\t// Backgrounds & Content Text (11 required, 2 optional)\n\t\tselectedBg: ColorValueSchema,\n\t\tsearchMatchBg: Type.Optional(ColorValueSchema),\n\t\tsearchMatchText: Type.Optional(ColorValueSchema),\n\t\tuserMessageBg: ColorValueSchema,\n\t\tuserMessageText: ColorValueSchema,\n\t\tcustomMessageBg: ColorValueSchema,\n\t\tcustomMessageText: ColorValueSchema,\n\t\tcustomMessageLabel: ColorValueSchema,\n\t\ttoolPendingBg: ColorValueSchema,\n\t\ttoolSuccessBg: ColorValueSchema,\n\t\ttoolErrorBg: ColorValueSchema,\n\t\ttoolTitle: ColorValueSchema,\n\t\ttoolOutput: ColorValueSchema,\n\t\t// Markdown (10 colors)\n\t\tmdHeading: ColorValueSchema,\n\t\tmdLink: ColorValueSchema,\n\t\tmdLinkUrl: ColorValueSchema,\n\t\tmdCode: ColorValueSchema,\n\t\tmdCodeBlock: ColorValueSchema,\n\t\tmdCodeBlockBorder: ColorValueSchema,\n\t\tmdQuote: ColorValueSchema,\n\t\tmdQuoteBorder: ColorValueSchema,\n\t\tmdHr: ColorValueSchema,\n\t\tmdListBullet: ColorValueSchema,\n\t\t// Tool Diffs (3 colors)\n\t\ttoolDiffAdded: ColorValueSchema,\n\t\ttoolDiffRemoved: ColorValueSchema,\n\t\ttoolDiffContext: ColorValueSchema,\n\t\t// Syntax Highlighting (9 colors)\n\t\tsyntaxComment: ColorValueSchema,\n\t\tsyntaxKeyword: ColorValueSchema,\n\t\tsyntaxFunction: ColorValueSchema,\n\t\tsyntaxVariable: ColorValueSchema,\n\t\tsyntaxString: ColorValueSchema,\n\t\tsyntaxNumber: ColorValueSchema,\n\t\tsyntaxType: ColorValueSchema,\n\t\tsyntaxOperator: ColorValueSchema,\n\t\tsyntaxPunctuation: ColorValueSchema,\n\t\t// Thinking Level Borders (6 colors)\n\t\tthinkingOff: ColorValueSchema,\n\t\tthinkingMinimal: ColorValueSchema,\n\t\tthinkingLow: ColorValueSchema,\n\t\tthinkingMedium: ColorValueSchema,\n\t\tthinkingHigh: ColorValueSchema,\n\t\tthinkingXhigh: ColorValueSchema,\n\t\tthinkingMax: Type.Optional(ColorValueSchema),\n\t\t// Bash Mode (1 color)\n\t\tbashMode: ColorValueSchema,\n\t}),\n\texport: Type.Optional(\n\t\tType.Object({\n\t\t\tpageBg: Type.Optional(ColorValueSchema),\n\t\t\tcardBg: Type.Optional(ColorValueSchema),\n\t\t\tinfoBg: Type.Optional(ColorValueSchema),\n\t\t}),\n\t),\n});\n\nconst compiledThemeSchema = Compile(ThemeJsonSchema);\n\nexport type ThemeColorValue = Static<typeof ColorValueSchema>;\nexport type ValidatedThemeJson = Static<typeof ThemeJsonSchema>;\n\n/** Validate one theme document, throwing a message that names the offending tokens. */\nexport function validateThemeJson(label: string, json: unknown): ValidatedThemeJson {\n\tif (!compiledThemeSchema.Check(json)) {\n\t\tconst errors = Array.from(compiledThemeSchema.Errors(json));\n\t\tconst missingColors = new Set<string>();\n\t\tconst otherErrors: string[] = [];\n\n\t\tfor (const error of errors) {\n\t\t\tif (error.keyword === \"required\" && error.instancePath === \"/colors\") {\n\t\t\t\tconst requiredProperties = (error.params as { requiredProperties?: string[] }).requiredProperties;\n\t\t\t\tfor (const requiredProperty of requiredProperties ?? []) {\n\t\t\t\t\tmissingColors.add(requiredProperty);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst path = error.instancePath || \"/\";\n\t\t\totherErrors.push(` - ${path}: ${error.message}`);\n\t\t}\n\n\t\tlet errorMessage = `Invalid theme \"${label}\":\\n`;\n\t\tif (missingColors.size > 0) {\n\t\t\terrorMessage += \"\\nMissing required color tokens:\\n\";\n\t\t\terrorMessage += Array.from(missingColors)\n\t\t\t\t.sort()\n\t\t\t\t.map((color) => ` - ${color}`)\n\t\t\t\t.join(\"\\n\");\n\t\t\terrorMessage += '\\n\\nPlease add these colors to your theme\\'s \"colors\" object.';\n\t\t\terrorMessage += \"\\nSee the built-in themes (dark.json, light.json) for reference values.\";\n\t\t}\n\t\tif (otherErrors.length > 0) {\n\t\t\terrorMessage += `\\n\\nOther errors:\\n${otherErrors.join(\"\\n\")}`;\n\t\t}\n\n\t\tthrow new Error(errorMessage);\n\t}\n\n\tconst themeJson = json as ValidatedThemeJson;\n\tif (themeJson.name.includes(\"/\")) {\n\t\tthrow new Error(\n\t\t\t`Invalid theme name \"${themeJson.name}\": theme names cannot contain \"/\" because it is reserved for automatic light/dark theme settings.`,\n\t\t);\n\t}\n\treturn themeJson;\n}\n"]}
@@ -1,361 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Pi Coding Agent Theme",
4
- "description": "Theme schema for Pi coding agent",
5
- "type": "object",
6
- "required": ["name", "colors"],
7
- "properties": {
8
- "$schema": {
9
- "type": "string",
10
- "description": "JSON schema reference"
11
- },
12
- "name": {
13
- "type": "string",
14
- "pattern": "^[^/]+$",
15
- "description": "Theme name. Must not contain '/' because it is reserved for automatic light/dark theme settings."
16
- },
17
- "appearance": {
18
- "type": "string",
19
- "enum": ["dark", "light"],
20
- "description": "Background the theme is designed for. Detected from the theme colors when omitted."
21
- },
22
- "vars": {
23
- "type": "object",
24
- "description": "Reusable color variables",
25
- "additionalProperties": {
26
- "oneOf": [
27
- {
28
- "type": "string",
29
- "description": "Hex color (#RGB or #RRGGBB), OKLCH color, variable reference, or empty string for terminal default"
30
- },
31
- {
32
- "type": "integer",
33
- "minimum": 0,
34
- "maximum": 255,
35
- "description": "256-color palette index (0-255)"
36
- }
37
- ]
38
- }
39
- },
40
- "colors": {
41
- "type": "object",
42
- "description": "Theme color definitions (scrollbar, thinkingMax, and search highlight colors are optional and use compatible fallbacks)",
43
- "required": [
44
- "accent",
45
- "border",
46
- "borderAccent",
47
- "borderMuted",
48
- "success",
49
- "error",
50
- "warning",
51
- "muted",
52
- "dim",
53
- "text",
54
- "thinkingText",
55
- "selectedBg",
56
- "userMessageBg",
57
- "userMessageText",
58
- "customMessageBg",
59
- "customMessageText",
60
- "customMessageLabel",
61
- "toolPendingBg",
62
- "toolSuccessBg",
63
- "toolErrorBg",
64
- "toolTitle",
65
- "toolOutput",
66
- "mdHeading",
67
- "mdLink",
68
- "mdLinkUrl",
69
- "mdCode",
70
- "mdCodeBlock",
71
- "mdCodeBlockBorder",
72
- "mdQuote",
73
- "mdQuoteBorder",
74
- "mdHr",
75
- "mdListBullet",
76
- "toolDiffAdded",
77
- "toolDiffRemoved",
78
- "toolDiffContext",
79
- "syntaxComment",
80
- "syntaxKeyword",
81
- "syntaxFunction",
82
- "syntaxVariable",
83
- "syntaxString",
84
- "syntaxNumber",
85
- "syntaxType",
86
- "syntaxOperator",
87
- "syntaxPunctuation",
88
- "thinkingOff",
89
- "thinkingMinimal",
90
- "thinkingLow",
91
- "thinkingMedium",
92
- "thinkingHigh",
93
- "thinkingXhigh",
94
- "bashMode"
95
- ],
96
- "properties": {
97
- "accent": {
98
- "$ref": "#/$defs/colorValue",
99
- "description": "Primary accent color (logo, selected items, cursor)"
100
- },
101
- "border": {
102
- "$ref": "#/$defs/colorValue",
103
- "description": "Normal borders"
104
- },
105
- "borderAccent": {
106
- "$ref": "#/$defs/colorValue",
107
- "description": "Highlighted borders"
108
- },
109
- "borderMuted": {
110
- "$ref": "#/$defs/colorValue",
111
- "description": "Subtle borders"
112
- },
113
- "success": {
114
- "$ref": "#/$defs/colorValue",
115
- "description": "Success states"
116
- },
117
- "error": {
118
- "$ref": "#/$defs/colorValue",
119
- "description": "Error states"
120
- },
121
- "warning": {
122
- "$ref": "#/$defs/colorValue",
123
- "description": "Warning states"
124
- },
125
- "muted": {
126
- "$ref": "#/$defs/colorValue",
127
- "description": "Secondary/dimmed text"
128
- },
129
- "dim": {
130
- "$ref": "#/$defs/colorValue",
131
- "description": "Very dimmed text (more subtle than muted)"
132
- },
133
- "text": {
134
- "$ref": "#/$defs/colorValue",
135
- "description": "Default text color (usually empty string)"
136
- },
137
- "thinkingText": {
138
- "$ref": "#/$defs/colorValue",
139
- "description": "Thinking block text color"
140
- },
141
- "selectedBg": {
142
- "$ref": "#/$defs/colorValue",
143
- "description": "Selected item background"
144
- },
145
- "scrollbarTrack": {
146
- "$ref": "#/$defs/colorValue",
147
- "description": "Fullscreen scrollbar track foreground (falls back to muted when omitted)"
148
- },
149
- "scrollbarThumb": {
150
- "$ref": "#/$defs/colorValue",
151
- "description": "Fullscreen scrollbar thumb foreground (falls back to text when omitted)"
152
- },
153
- "searchMatchBg": {
154
- "$ref": "#/$defs/colorValue",
155
- "description": "Transcript search match background and current-match text (falls back to selectedBg when omitted)"
156
- },
157
- "searchMatchText": {
158
- "$ref": "#/$defs/colorValue",
159
- "description": "Transcript search match text and current-match background (falls back to text when omitted)"
160
- },
161
- "userMessageBg": {
162
- "$ref": "#/$defs/colorValue",
163
- "description": "User message background"
164
- },
165
- "userMessageText": {
166
- "$ref": "#/$defs/colorValue",
167
- "description": "User message text color"
168
- },
169
- "customMessageBg": {
170
- "$ref": "#/$defs/colorValue",
171
- "description": "Custom message background (hook-injected messages)"
172
- },
173
- "customMessageText": {
174
- "$ref": "#/$defs/colorValue",
175
- "description": "Custom message text color"
176
- },
177
- "customMessageLabel": {
178
- "$ref": "#/$defs/colorValue",
179
- "description": "Custom message type label color"
180
- },
181
- "toolPendingBg": {
182
- "$ref": "#/$defs/colorValue",
183
- "description": "Tool execution box (pending state)"
184
- },
185
- "toolSuccessBg": {
186
- "$ref": "#/$defs/colorValue",
187
- "description": "Tool execution box (success state)"
188
- },
189
- "toolErrorBg": {
190
- "$ref": "#/$defs/colorValue",
191
- "description": "Tool execution box (error state)"
192
- },
193
- "toolTitle": {
194
- "$ref": "#/$defs/colorValue",
195
- "description": "Tool execution box title color"
196
- },
197
- "toolOutput": {
198
- "$ref": "#/$defs/colorValue",
199
- "description": "Tool execution box output text color"
200
- },
201
- "mdHeading": {
202
- "$ref": "#/$defs/colorValue",
203
- "description": "Markdown heading text"
204
- },
205
- "mdLink": {
206
- "$ref": "#/$defs/colorValue",
207
- "description": "Markdown link text"
208
- },
209
- "mdLinkUrl": {
210
- "$ref": "#/$defs/colorValue",
211
- "description": "Markdown link URL"
212
- },
213
- "mdCode": {
214
- "$ref": "#/$defs/colorValue",
215
- "description": "Markdown inline code"
216
- },
217
- "mdCodeBlock": {
218
- "$ref": "#/$defs/colorValue",
219
- "description": "Markdown code block content"
220
- },
221
- "mdCodeBlockBorder": {
222
- "$ref": "#/$defs/colorValue",
223
- "description": "Markdown code block fences"
224
- },
225
- "mdQuote": {
226
- "$ref": "#/$defs/colorValue",
227
- "description": "Markdown blockquote text"
228
- },
229
- "mdQuoteBorder": {
230
- "$ref": "#/$defs/colorValue",
231
- "description": "Markdown blockquote border"
232
- },
233
- "mdHr": {
234
- "$ref": "#/$defs/colorValue",
235
- "description": "Markdown horizontal rule"
236
- },
237
- "mdListBullet": {
238
- "$ref": "#/$defs/colorValue",
239
- "description": "Markdown list bullets/numbers"
240
- },
241
- "toolDiffAdded": {
242
- "$ref": "#/$defs/colorValue",
243
- "description": "Added lines in tool diffs"
244
- },
245
- "toolDiffRemoved": {
246
- "$ref": "#/$defs/colorValue",
247
- "description": "Removed lines in tool diffs"
248
- },
249
- "toolDiffContext": {
250
- "$ref": "#/$defs/colorValue",
251
- "description": "Context lines in tool diffs"
252
- },
253
- "syntaxComment": {
254
- "$ref": "#/$defs/colorValue",
255
- "description": "Syntax highlighting: comments"
256
- },
257
- "syntaxKeyword": {
258
- "$ref": "#/$defs/colorValue",
259
- "description": "Syntax highlighting: keywords"
260
- },
261
- "syntaxFunction": {
262
- "$ref": "#/$defs/colorValue",
263
- "description": "Syntax highlighting: function names"
264
- },
265
- "syntaxVariable": {
266
- "$ref": "#/$defs/colorValue",
267
- "description": "Syntax highlighting: variable names"
268
- },
269
- "syntaxString": {
270
- "$ref": "#/$defs/colorValue",
271
- "description": "Syntax highlighting: string literals"
272
- },
273
- "syntaxNumber": {
274
- "$ref": "#/$defs/colorValue",
275
- "description": "Syntax highlighting: number literals"
276
- },
277
- "syntaxType": {
278
- "$ref": "#/$defs/colorValue",
279
- "description": "Syntax highlighting: type names"
280
- },
281
- "syntaxOperator": {
282
- "$ref": "#/$defs/colorValue",
283
- "description": "Syntax highlighting: operators"
284
- },
285
- "syntaxPunctuation": {
286
- "$ref": "#/$defs/colorValue",
287
- "description": "Syntax highlighting: punctuation"
288
- },
289
- "thinkingOff": {
290
- "$ref": "#/$defs/colorValue",
291
- "description": "Thinking level border: off"
292
- },
293
- "thinkingMinimal": {
294
- "$ref": "#/$defs/colorValue",
295
- "description": "Thinking level border: minimal"
296
- },
297
- "thinkingLow": {
298
- "$ref": "#/$defs/colorValue",
299
- "description": "Thinking level border: low"
300
- },
301
- "thinkingMedium": {
302
- "$ref": "#/$defs/colorValue",
303
- "description": "Thinking level border: medium"
304
- },
305
- "thinkingHigh": {
306
- "$ref": "#/$defs/colorValue",
307
- "description": "Thinking level border: high"
308
- },
309
- "thinkingXhigh": {
310
- "$ref": "#/$defs/colorValue",
311
- "description": "Thinking level border: xhigh"
312
- },
313
- "thinkingMax": {
314
- "$ref": "#/$defs/colorValue",
315
- "description": "Thinking level border: max (falls back to thinkingXhigh when omitted)"
316
- },
317
- "bashMode": {
318
- "$ref": "#/$defs/colorValue",
319
- "description": "Editor border color in bash mode"
320
- }
321
- },
322
- "additionalProperties": false
323
- },
324
- "export": {
325
- "type": "object",
326
- "description": "Optional colors for HTML export (defaults derived from userMessageBg if not specified)",
327
- "properties": {
328
- "pageBg": {
329
- "$ref": "#/$defs/colorValue",
330
- "description": "Page background color"
331
- },
332
- "cardBg": {
333
- "$ref": "#/$defs/colorValue",
334
- "description": "Card/container background color"
335
- },
336
- "infoBg": {
337
- "$ref": "#/$defs/colorValue",
338
- "description": "Info sections background (system prompt, notices)"
339
- }
340
- },
341
- "additionalProperties": false
342
- }
343
- },
344
- "additionalProperties": false,
345
- "$defs": {
346
- "colorValue": {
347
- "oneOf": [
348
- {
349
- "type": "string",
350
- "description": "Hex color (#RGB or #RRGGBB), OKLCH color, variable reference, or empty string for terminal default"
351
- },
352
- {
353
- "type": "integer",
354
- "minimum": 0,
355
- "maximum": 255,
356
- "description": "256-color palette index (0-255)"
357
- }
358
- ]
359
- }
360
- }
361
- }
@@ -1,38 +0,0 @@
1
- # `@earendil-works/pi-example-plugin`
2
-
3
- This package provides conventional `session` and `tui` Chord facets. The Session-worker facet provides a remote greeting service. The TUI facet contributes `/hello` and calls that service.
4
-
5
- The package needs no build script. Pi asks Chord to discover `src/session.ts` and `src/tui.ts`, builds both entries into its server-owned plugin cache, and sends the TUI artifact to clients.
6
-
7
- From the repository root:
8
-
9
- ```bash
10
- PI_EXPERIMENTAL=1 ./pi-test.sh server \
11
- -e "$PWD/packages/coding-agent/examples/plugins/pi-example-plugin"
12
- ```
13
-
14
- Alternatively, a client can select the plugin for the Session it creates or resumes on one local server:
15
-
16
- ```bash
17
- PI_EXPERIMENTAL=1 ./pi-test.sh client \
18
- -e "$PWD/packages/coding-agent/examples/plugins/pi-example-plugin"
19
- ```
20
-
21
- Repeat `-e` to select multiple plugin packages. Client paths are resolved locally and sent only to a Unix server; Radius clients cannot select server filesystem paths. The Session and matching TUI facets are stored with that Session, so later server generations and clients can resume it without plugin arguments. Other Sessions and their workers are unaffected. An active Session rejects a different package selection instead of being restarted.
22
-
23
- `server -e` establishes the server profile's default Session and TUI facets. Starting an explicit foreground server without `-e` clears that default. Client selection never changes the server's root facet generation.
24
-
25
- Run `/hello Armin` in the TUI. After editing a facet, run `/reload`. The server atomically rebuilds the package, reloads the attached Session-worker generation, updates the current TUI generation, and serves the new artifact to future clients.
26
-
27
- Package metadata can override or disable conventional entries:
28
-
29
- ```json
30
- {
31
- "chord": {
32
- "facets": {
33
- "session": "./src/worker.ts",
34
- "tui": false
35
- }
36
- }
37
- }
38
- ```
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@earendil-works/pi-example-plugin",
3
- "version": "1.0.0",
4
- "private": true,
5
- "type": "module",
6
- "peerDependencies": {
7
- "@earendil-works/chord": "^0.84.4",
8
- "@earendil-works/pi-coding-agent": "^0.84.4"
9
- }
10
- }