@wirecat/wordpress-cli 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +204 -0
  3. package/README.md +248 -2
  4. package/contracts/wirecat.json +2535 -0
  5. package/dist/bin/wordpress.d.ts +3 -0
  6. package/dist/bin/wordpress.d.ts.map +1 -0
  7. package/dist/bin/wordpress.js +40 -0
  8. package/dist/bin/wordpress.js.map +1 -0
  9. package/dist/bundle/agent-LKBRYKNB.js +37 -0
  10. package/dist/bundle/all-profiles-OEV7VFQG.js +320 -0
  11. package/dist/bundle/anthropic-JKTZP2DW.js +91 -0
  12. package/dist/bundle/app-server-7LWLDDE2.js +249 -0
  13. package/dist/bundle/bun-2FLR4IV4.js +169 -0
  14. package/dist/bundle/bun-sqlite-GRSRX5P4.js +76 -0
  15. package/dist/bundle/chunk-2BI25SEE.js +259 -0
  16. package/dist/bundle/chunk-2UEGJ5AJ.js +52 -0
  17. package/dist/bundle/chunk-2XUV7HNE.js +58 -0
  18. package/dist/bundle/chunk-2Z7UOXFC.js +16 -0
  19. package/dist/bundle/chunk-3BM6KBWP.js +2788 -0
  20. package/dist/bundle/chunk-3BRAZVHR.js +1010 -0
  21. package/dist/bundle/chunk-3LMW7U7F.js +1233 -0
  22. package/dist/bundle/chunk-3LVTQFGB.js +2000 -0
  23. package/dist/bundle/chunk-3TKFFSFU.js +106 -0
  24. package/dist/bundle/chunk-3UX4VJWD.js +78 -0
  25. package/dist/bundle/chunk-4HEXAGKT.js +334 -0
  26. package/dist/bundle/chunk-4HP6KGBI.js +32 -0
  27. package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
  28. package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
  29. package/dist/bundle/chunk-5XPHFV7H.js +2333 -0
  30. package/dist/bundle/chunk-5Z3P543G.js +80 -0
  31. package/dist/bundle/chunk-6UYDKCV6.js +794 -0
  32. package/dist/bundle/chunk-7GNB4LBX.js +50 -0
  33. package/dist/bundle/chunk-7HJFBOAT.js +161 -0
  34. package/dist/bundle/chunk-7JVKQ6NM.js +206 -0
  35. package/dist/bundle/chunk-7QH5BZUG.js +142 -0
  36. package/dist/bundle/chunk-A474OVIW.js +1392 -0
  37. package/dist/bundle/chunk-AENEMQL3.js +1068 -0
  38. package/dist/bundle/chunk-AL7I4DT4.js +65718 -0
  39. package/dist/bundle/chunk-ARGRGTPX.js +108 -0
  40. package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
  41. package/dist/bundle/chunk-BAXNAOOL.js +76 -0
  42. package/dist/bundle/chunk-BH63B66W.js +407 -0
  43. package/dist/bundle/chunk-CCOSG3F2.js +24616 -0
  44. package/dist/bundle/chunk-CFQQTDSA.js +46 -0
  45. package/dist/bundle/chunk-CGCUOT67.js +388 -0
  46. package/dist/bundle/chunk-CHPWBQUK.js +39 -0
  47. package/dist/bundle/chunk-D72URWJE.js +532 -0
  48. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  49. package/dist/bundle/chunk-DQSOYH6N.js +20 -0
  50. package/dist/bundle/chunk-ECYOTDJM.js +14 -0
  51. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  52. package/dist/bundle/chunk-EHW45LLT.js +100 -0
  53. package/dist/bundle/chunk-F3AV5ZSL.js +338 -0
  54. package/dist/bundle/chunk-F4BX7TH2.js +15 -0
  55. package/dist/bundle/chunk-F5ZAN7OC.js +6848 -0
  56. package/dist/bundle/chunk-FMMYBVCH.js +38 -0
  57. package/dist/bundle/chunk-FNB4SWTY.js +66 -0
  58. package/dist/bundle/chunk-FQROWBKV.js +12660 -0
  59. package/dist/bundle/chunk-FV2HJOSC.js +771 -0
  60. package/dist/bundle/chunk-GCAJW4SR.js +53 -0
  61. package/dist/bundle/chunk-GPRJXJC7.js +102 -0
  62. package/dist/bundle/chunk-HCOZUOSN.js +54 -0
  63. package/dist/bundle/chunk-HM6AMYHR.js +72 -0
  64. package/dist/bundle/chunk-HVXOA4FO.js +23 -0
  65. package/dist/bundle/chunk-HWQ7572G.js +95 -0
  66. package/dist/bundle/chunk-IJVTN5L3.js +82 -0
  67. package/dist/bundle/chunk-IZDDBOHU.js +3610 -0
  68. package/dist/bundle/chunk-JAE5B4G7.js +388 -0
  69. package/dist/bundle/chunk-K2Y5K37O.js +218 -0
  70. package/dist/bundle/chunk-KCH224US.js +9581 -0
  71. package/dist/bundle/chunk-KZJQPJK5.js +230 -0
  72. package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
  73. package/dist/bundle/chunk-LECMHK2F.js +18 -0
  74. package/dist/bundle/chunk-LWEMZJLG.js +1332 -0
  75. package/dist/bundle/chunk-LWTETL2O.js +185 -0
  76. package/dist/bundle/chunk-MEYYH47C.js +25 -0
  77. package/dist/bundle/chunk-MJ6LTG4L.js +170 -0
  78. package/dist/bundle/chunk-NMQRSEZM.js +37 -0
  79. package/dist/bundle/chunk-ODVGFCBE.js +557 -0
  80. package/dist/bundle/chunk-OEQNP56V.js +633 -0
  81. package/dist/bundle/chunk-OV6WQY3L.js +39 -0
  82. package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
  83. package/dist/bundle/chunk-PPNTY7LD.js +733 -0
  84. package/dist/bundle/chunk-PRZYRA66.js +358 -0
  85. package/dist/bundle/chunk-PV5UYGRJ.js +41594 -0
  86. package/dist/bundle/chunk-QYTOLPNI.js +52 -0
  87. package/dist/bundle/chunk-R7Y3XU66.js +362 -0
  88. package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
  89. package/dist/bundle/chunk-SD5CXGIG.js +188 -0
  90. package/dist/bundle/chunk-SXY5G62I.js +288 -0
  91. package/dist/bundle/chunk-T37TAXVL.js +29 -0
  92. package/dist/bundle/chunk-T5SOY3AE.js +1197 -0
  93. package/dist/bundle/chunk-TJ7OORSO.js +1876 -0
  94. package/dist/bundle/chunk-TRYYWV7J.js +291 -0
  95. package/dist/bundle/chunk-U6VLNYCO.js +73 -0
  96. package/dist/bundle/chunk-UC7JLE6J.js +58 -0
  97. package/dist/bundle/chunk-UUIOAZPH.js +156 -0
  98. package/dist/bundle/chunk-UXQ24OY6.js +4072 -0
  99. package/dist/bundle/chunk-VBRRMGON.js +1007 -0
  100. package/dist/bundle/chunk-VRIBES2C.js +319 -0
  101. package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
  102. package/dist/bundle/chunk-XT5XYQEZ.js +3414 -0
  103. package/dist/bundle/chunk-XTAS5Z3G.js +2231 -0
  104. package/dist/bundle/chunk-XYQVVW4R.js +24 -0
  105. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  106. package/dist/bundle/chunk-YHWFF6DN.js +39 -0
  107. package/dist/bundle/chunk-YUDVRFXN.js +63 -0
  108. package/dist/bundle/chunk-Z3I2MCUT.js +131 -0
  109. package/dist/bundle/chunk-ZDI3WC7V.js +353 -0
  110. package/dist/bundle/chunk-ZVQ7KFMT.js +274 -0
  111. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  112. package/dist/bundle/command-contract-P7YE4EKS.js +37 -0
  113. package/dist/bundle/command-server-entry-XIMCBWMV.js +166 -0
  114. package/dist/bundle/decode-6XK55WYV.js +297 -0
  115. package/dist/bundle/definitions-GIQCGYPR.js +7986 -0
  116. package/dist/bundle/dispatch-JQBAZWCL.js +411 -0
  117. package/dist/bundle/dist-2TV3NVE5.js +7577 -0
  118. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  119. package/dist/bundle/echarts-YRRVLEX3.js +42501 -0
  120. package/dist/bundle/embed-L3EEQSGX.js +38 -0
  121. package/dist/bundle/embedder-BIKLBV3J.js +111 -0
  122. package/dist/bundle/failure-I6AAF5R5.js +25 -0
  123. package/dist/bundle/first-run-W6G6TYZ2.js +29 -0
  124. package/dist/bundle/first-screen-ITIAJIBU.js +37 -0
  125. package/dist/bundle/hast-util-from-html-ZHU6HGIE.js +10531 -0
  126. package/dist/bundle/hast-util-to-html-IIFHILP5.js +998 -0
  127. package/dist/bundle/hast-util-to-mdast-D62XX3NR.js +2272 -0
  128. package/dist/bundle/instructions-AG7SRWTR.js +11 -0
  129. package/dist/bundle/mcp-YGOAUNC3.js +167 -0
  130. package/dist/bundle/mdast-util-from-markdown-WVUJDSUO.js +1900 -0
  131. package/dist/bundle/mdast-util-gfm-KN2D32QS.js +1040 -0
  132. package/dist/bundle/mdast-util-to-hast-AYJV7KAE.js +879 -0
  133. package/dist/bundle/mdast-util-to-markdown-UCAJNHJO.js +18 -0
  134. package/dist/bundle/meeting-combined-CQJ3JHHU.js +24 -0
  135. package/dist/bundle/meeting-model-MZ7VVBNK.js +25 -0
  136. package/dist/bundle/meeting-semantic-DADWRRHP.js +22 -0
  137. package/dist/bundle/micromark-extension-gfm-EEJRRJ36.js +1771 -0
  138. package/dist/bundle/node-GJQYN4FT.js +176 -0
  139. package/dist/bundle/node-JJ3WDCNJ.js +2340 -0
  140. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  141. package/dist/bundle/node-sqlite-TPR62DT2.js +74 -0
  142. package/dist/bundle/oauth-WGY7JQVW.js +20 -0
  143. package/dist/bundle/open-DE7QZNAN.js +23 -0
  144. package/dist/bundle/openai-NHEFT3HS.js +238 -0
  145. package/dist/bundle/process-MEKCZMX3.js +91 -0
  146. package/dist/bundle/program-EP2S5BTM.js +38857 -0
  147. package/dist/bundle/prompt-PWY53BYH.js +17 -0
  148. package/dist/bundle/recognize-74TXHKMQ.js +26 -0
  149. package/dist/bundle/remote-F5TJZ5ER.js +31 -0
  150. package/dist/bundle/rerank-HWUO52UF.js +52 -0
  151. package/dist/bundle/schemas-4K6WWS5N.js +2157 -0
  152. package/dist/bundle/serve-I2USUY4X.js +199 -0
  153. package/dist/bundle/server-GDYDNO6K.js +79 -0
  154. package/dist/bundle/server-KYUW2AHB.js +212 -0
  155. package/dist/bundle/sqlite-runtime-N6VFGBJK.js +20 -0
  156. package/dist/bundle/state-L6JSCN77.js +36 -0
  157. package/dist/bundle/store-EPG2YPN3.js +291 -0
  158. package/dist/bundle/store-SQWQJE32.js +181 -0
  159. package/dist/bundle/store-maintenance-command-FTGSICVA.js +66 -0
  160. package/dist/bundle/surface-SNMHY6GP.js +65 -0
  161. package/dist/bundle/wordpress.js +183 -0
  162. package/dist/commands/api.d.ts +22 -0
  163. package/dist/commands/api.d.ts.map +1 -0
  164. package/dist/commands/api.js +37 -0
  165. package/dist/commands/api.js.map +1 -0
  166. package/dist/commands/content.d.ts +4 -0
  167. package/dist/commands/content.d.ts.map +1 -0
  168. package/dist/commands/content.js +94 -0
  169. package/dist/commands/content.js.map +1 -0
  170. package/dist/commands/session.d.ts +8 -0
  171. package/dist/commands/session.d.ts.map +1 -0
  172. package/dist/commands/session.js +28 -0
  173. package/dist/commands/session.js.map +1 -0
  174. package/dist/config.d.ts +13 -0
  175. package/dist/config.d.ts.map +1 -0
  176. package/dist/config.js +69 -0
  177. package/dist/config.js.map +1 -0
  178. package/dist/context.d.ts +37 -0
  179. package/dist/context.d.ts.map +1 -0
  180. package/dist/context.js +31 -0
  181. package/dist/context.js.map +1 -0
  182. package/dist/generated/definitions.d.ts +3 -0
  183. package/dist/generated/definitions.d.ts.map +1 -0
  184. package/dist/generated/definitions.js +7982 -0
  185. package/dist/generated/definitions.js.map +1 -0
  186. package/dist/generated/manifest.d.ts +6 -0
  187. package/dist/generated/manifest.d.ts.map +1 -0
  188. package/dist/generated/manifest.js +8830 -0
  189. package/dist/generated/manifest.js.map +1 -0
  190. package/dist/generated/schemas.d.ts +229 -0
  191. package/dist/generated/schemas.d.ts.map +1 -0
  192. package/dist/generated/schemas.js +2019 -0
  193. package/dist/generated/schemas.js.map +1 -0
  194. package/dist/generated/types.d.ts +3365 -0
  195. package/dist/generated/types.d.ts.map +1 -0
  196. package/dist/generated/types.js +5 -0
  197. package/dist/generated/types.js.map +1 -0
  198. package/dist/generated/wirecat-config.d.ts +11 -0
  199. package/dist/generated/wirecat-config.d.ts.map +1 -0
  200. package/dist/generated/wirecat-config.js +337 -0
  201. package/dist/generated/wirecat-config.js.map +1 -0
  202. package/dist/identity.d.ts +28 -0
  203. package/dist/identity.d.ts.map +1 -0
  204. package/dist/identity.js +29 -0
  205. package/dist/identity.js.map +1 -0
  206. package/dist/index.d.ts +3 -0
  207. package/dist/index.d.ts.map +1 -0
  208. package/dist/index.js +3 -0
  209. package/dist/index.js.map +1 -0
  210. package/dist/program.d.ts +6 -0
  211. package/dist/program.d.ts.map +1 -0
  212. package/dist/program.js +53 -0
  213. package/dist/program.js.map +1 -0
  214. package/dist/version.d.ts +2 -0
  215. package/dist/version.d.ts.map +1 -0
  216. package/dist/version.js +2 -0
  217. package/dist/version.js.map +1 -0
  218. package/dist/wcat.d.ts +3 -0
  219. package/dist/wcat.d.ts.map +1 -0
  220. package/dist/wcat.js +4 -0
  221. package/dist/wcat.js.map +1 -0
  222. package/package.json +87 -4
  223. package/skills/wordpress-cli/SKILL.md +88 -0
  224. package/skills/wordpress-cli/references/api/api-block-directory.md +17 -0
  225. package/skills/wordpress-cli/references/api/api-block-patterns.md +13 -0
  226. package/skills/wordpress-cli/references/api/api-block-types.md +34 -0
  227. package/skills/wordpress-cli/references/api/api-blocks.md +159 -0
  228. package/skills/wordpress-cli/references/api/api-categories.md +69 -0
  229. package/skills/wordpress-cli/references/api/api-comments.md +79 -0
  230. package/skills/wordpress-cli/references/api/api-font-collections.md +16 -0
  231. package/skills/wordpress-cli/references/api/api-font-families.md +122 -0
  232. package/skills/wordpress-cli/references/api/api-global-styles.md +29 -0
  233. package/skills/wordpress-cli/references/api/api-media.md +106 -0
  234. package/skills/wordpress-cli/references/api/api-menu-items.md +115 -0
  235. package/skills/wordpress-cli/references/api/api-menu-locations.md +22 -0
  236. package/skills/wordpress-cli/references/api/api-menus.md +69 -0
  237. package/skills/wordpress-cli/references/api/api-navigation.md +155 -0
  238. package/skills/wordpress-cli/references/api/api-pages.md +161 -0
  239. package/skills/wordpress-cli/references/api/api-pattern-directory.md +23 -0
  240. package/skills/wordpress-cli/references/api/api-plugins.md +25 -0
  241. package/skills/wordpress-cli/references/api/api-posts.md +166 -0
  242. package/skills/wordpress-cli/references/api/api-search.md +21 -0
  243. package/skills/wordpress-cli/references/api/api-settings.md +19 -0
  244. package/skills/wordpress-cli/references/api/api-sidebars.md +34 -0
  245. package/skills/wordpress-cli/references/api/api-statuses.md +22 -0
  246. package/skills/wordpress-cli/references/api/api-tags.md +69 -0
  247. package/skills/wordpress-cli/references/api/api-taxonomies.md +23 -0
  248. package/skills/wordpress-cli/references/api/api-template-parts.md +38 -0
  249. package/skills/wordpress-cli/references/api/api-templates.md +38 -0
  250. package/skills/wordpress-cli/references/api/api-themes.md +12 -0
  251. package/skills/wordpress-cli/references/api/api-types.md +22 -0
  252. package/skills/wordpress-cli/references/api/api-users.md +149 -0
  253. package/skills/wordpress-cli/references/api/api-widget-types.md +46 -0
  254. package/skills/wordpress-cli/references/api/api-widgets.md +57 -0
  255. package/skills/wordpress-cli/references/api/api-wp-pattern-category.md +69 -0
  256. package/skills/wordpress-cli/references/api.md +44 -0
@@ -0,0 +1,319 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ wrapAnsi
5
+ } from "./chunk-EH6ZEJGT.js";
6
+ import {
7
+ WIRECAT_TOOLS
8
+ } from "./chunk-GPRJXJC7.js";
9
+ import {
10
+ commandPathOf,
11
+ outputOf
12
+ } from "./chunk-Z3I2MCUT.js";
13
+ import {
14
+ Command,
15
+ Help,
16
+ NO_EFFECTS,
17
+ Option,
18
+ annotate,
19
+ commandAt,
20
+ environmentOf,
21
+ metaOf,
22
+ takesProfile
23
+ } from "./chunk-FQROWBKV.js";
24
+ import {
25
+ writes
26
+ } from "./chunk-3LMW7U7F.js";
27
+ import {
28
+ CliError
29
+ } from "./chunk-HM6AMYHR.js";
30
+ import {
31
+ __name
32
+ } from "./chunk-ZVVMGPBJ.js";
33
+
34
+ // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/cli/help/command-help.js
35
+ var ARGUMENT_KINDS = {
36
+ chat: "chat",
37
+ chats: "chat",
38
+ message: "message",
39
+ messages: "message",
40
+ post: "message",
41
+ person: "person",
42
+ people: "person",
43
+ task: "task",
44
+ meeting: "meeting",
45
+ folder: "folder",
46
+ folders: "folder",
47
+ topic: "topic",
48
+ note: "note",
49
+ document: "document",
50
+ model: "model"
51
+ };
52
+ var ENTITY_KINDS = {
53
+ message: "message",
54
+ message_link: "message",
55
+ chat: "chat",
56
+ contact: "person",
57
+ member: "person",
58
+ person: "person",
59
+ task: "task",
60
+ meeting: "meeting",
61
+ meeting_details: "meeting",
62
+ meeting_hit: "meeting",
63
+ meeting_summary: "meeting",
64
+ folder: "folder",
65
+ topic: "topic",
66
+ note: "note",
67
+ document: "document",
68
+ model: "model"
69
+ };
70
+ var HOME = {
71
+ chat: "chats",
72
+ message: "messages",
73
+ person: "contacts",
74
+ task: "tasks",
75
+ meeting: "meetings",
76
+ folder: "folders",
77
+ topic: "topics",
78
+ note: "notes",
79
+ document: "documents",
80
+ model: "models"
81
+ };
82
+ var SAMPLES = {
83
+ chat: "Team",
84
+ message: "1234",
85
+ post: "1234",
86
+ person: "Anna",
87
+ people: "Anna",
88
+ task: "12",
89
+ meeting: "123",
90
+ folder: "Work",
91
+ topic: "General",
92
+ model: "default",
93
+ query: '"invoice"',
94
+ text: '"on my way"',
95
+ title: '"Weekly sync"',
96
+ name: "daily",
97
+ id: "1",
98
+ file: "./report.pdf",
99
+ link: "https://example.com/join/abc",
100
+ url: "https://example.com",
101
+ since: "1d",
102
+ duration: "1d",
103
+ limit: "20"
104
+ };
105
+ var MAX_NEXT = 3;
106
+ var choices = /* @__PURE__ */ new WeakMap();
107
+ var kindOfArgument = /* @__PURE__ */ __name((argument) => ARGUMENT_KINDS[argument.name()], "kindOfArgument");
108
+ var runs = /* @__PURE__ */ __name((command) => command.commands.length === 0 || Boolean(command._actionHandler), "runs");
109
+ var leaves = /* @__PURE__ */ __name((command) => command.commands.filter((child) => !child._hidden).flatMap((child) => [...runs(child) ? [child] : [], ...leaves(child)]), "leaves");
110
+ var rootOf = /* @__PURE__ */ __name((command) => {
111
+ let at = command;
112
+ while (at.parent)
113
+ at = at.parent;
114
+ return at;
115
+ }, "rootOf");
116
+ var call = /* @__PURE__ */ __name((command) => [
117
+ rootOf(command).name(),
118
+ ...commandPathOf(command),
119
+ ...command.registeredArguments.map((one) => one.required ? `<${one.name()}>` : `[${one.name()}]`)
120
+ ].join(" "), "call");
121
+ var fieldsOf = /* @__PURE__ */ __name((schema) => {
122
+ const variants = schema.anyOf;
123
+ if (variants)
124
+ return variants.flatMap(fieldsOf);
125
+ const required = schema.required ?? [];
126
+ return [...required, ...Object.keys(schema.properties ?? {})];
127
+ }, "fieldsOf");
128
+ var returnsOf = /* @__PURE__ */ __name((command) => {
129
+ const output = metaOf(command).output;
130
+ const { item, coverage } = outputOf(command);
131
+ if (!output || coverage !== "declared-entity")
132
+ return "";
133
+ const fields = [...new Set(fieldsOf(item))];
134
+ const noun = (output.view ? `${output.entity} ${output.view}` : output.entity).replaceAll("_", " ");
135
+ const more = fields.length > 8 ? `, and ${fields.length - 8} more` : "";
136
+ const root = rootOf(command);
137
+ const schema = commandAt(root, "commands info") ? `; every field: ${root.name()} commands info ${commandPathOf(command).join(" ")}` : "";
138
+ return `${noun} \u2014 ${fields.slice(0, 8).join(", ")}${more}${schema}`;
139
+ }, "returnsOf");
140
+ var nextOf = /* @__PURE__ */ __name((command) => {
141
+ const root = rootOf(command);
142
+ const choice = choices.get(command) ?? {};
143
+ const drop = new Set(choice.drop ?? []);
144
+ const pinned = (choice.pin ?? []).flatMap((path) => commandAt(root, path) ?? []);
145
+ const output = metaOf(command).output;
146
+ const kind = output ? ENTITY_KINDS[output.entity] : void 0;
147
+ const all = leaves(root);
148
+ const derived = kind ? all.filter((other) => other !== command && !pinned.includes(other)).filter((other) => other.registeredArguments.some((argument) => kindOfArgument(argument) === kind)).map((other, order) => ({ other, order })).sort((a, b) => {
149
+ const rank = /* @__PURE__ */ __name((other) => [
150
+ Number(writes(metaOf(other).effects)),
151
+ Number(!other.registeredArguments.some((one) => one.required && kindOfArgument(one) === kind)),
152
+ Number(commandPathOf(other)[0] !== HOME[kind]),
153
+ Number(other.parent !== command.parent)
154
+ ], "rank");
155
+ const [left, right] = [rank(a.other), rank(b.other)];
156
+ return left.reduce((found, value, at) => found || value - (right[at] ?? 0), 0) || a.order - b.order;
157
+ }).map(({ other }) => other) : [];
158
+ return [...pinned, ...derived].filter((other) => !drop.has(commandPathOf(other).join(" "))).slice(0, MAX_NEXT);
159
+ }, "nextOf");
160
+ var sample = /* @__PURE__ */ __name((name) => SAMPLES[name] ?? `<${name}>`, "sample");
161
+ var generatedExample = /* @__PURE__ */ __name((command) => {
162
+ const { query } = metaOf(command);
163
+ const words = command.registeredArguments.flatMap((argument) => {
164
+ const name = argument.name();
165
+ if (name === "query" && query)
166
+ return [];
167
+ if (!argument.required && SAMPLES[name] === void 0)
168
+ return [];
169
+ return [argument.argChoices?.[0] ?? sample(name)];
170
+ });
171
+ const options = command.options.filter((option) => option.mandatory).flatMap((option) => {
172
+ const flag = option.long ?? option.short ?? option.flags;
173
+ const placeholder = /[<[]([^>\]]+)[>\]]/.exec(option.flags)?.[1];
174
+ if (!(option.required || option.optional))
175
+ return [flag];
176
+ return [flag, option.argChoices?.[0] ?? sample(placeholder ?? option.attributeName())];
177
+ });
178
+ return [rootOf(command).name(), ...commandPathOf(command), ...words, ...options].join(" ");
179
+ }, "generatedExample");
180
+ var profiled = /* @__PURE__ */ new WeakSet();
181
+ var EXAMPLE_PROFILE = "personal";
182
+ var withProfile = /* @__PURE__ */ __name((command, example) => {
183
+ const root = rootOf(command);
184
+ const top = commandPathOf(command)[0];
185
+ if (!profiled.has(root) || top === void 0 || !takesProfile(command))
186
+ return example;
187
+ if (example.split(" ").includes("--profiles"))
188
+ return example;
189
+ const prefix = `${root.name()} ${top}`;
190
+ return example === prefix || example.startsWith(`${prefix} `) ? `${root.name()} ${EXAMPLE_PROFILE} ${example.slice(root.name().length + 1)}` : example;
191
+ }, "withProfile");
192
+ var commandHelp = /* @__PURE__ */ __name((command) => {
193
+ const written = metaOf(command).examples ?? [];
194
+ return {
195
+ returns: returnsOf(command),
196
+ next: nextOf(command).map(call),
197
+ examples: (written.length > 0 ? written : [generatedExample(command)]).map((one) => withProfile(command, one)),
198
+ origin: written.length > 0 ? "written" : "generated"
199
+ };
200
+ }, "commandHelp");
201
+ var LABEL = 15;
202
+ var commandHelpText = /* @__PURE__ */ __name((command) => {
203
+ const { returns, next, examples } = commandHelp(command);
204
+ const rows = /* @__PURE__ */ __name((label, values) => values.map((value, at) => `${(at === 0 ? label : "").padEnd(LABEL)}${value}`), "rows");
205
+ const availability = environmentOf(command).discoveryAvailability?.({
206
+ ...metaOf(command),
207
+ path: commandPathOf(command)
208
+ });
209
+ const profileMatters = profiled.has(rootOf(command)) && takesProfile(command);
210
+ const access = !availability ? [] : availability.available ? profileMatters ? rows("Availability:", ["available for this profile"]) : [] : rows("Availability:", [`unavailable \u2014 ${availability.reason}`]);
211
+ return [
212
+ "",
213
+ ...access,
214
+ ...rows("Returns:", returns ? [returns] : []),
215
+ ...rows("Next usually:", next),
216
+ ...rows("Example:", examples),
217
+ ""
218
+ ].join("\n");
219
+ }, "commandHelpText");
220
+ var installCommandHelp = /* @__PURE__ */ __name((program, { profile = true } = {}) => {
221
+ if (profile)
222
+ profiled.add(program);
223
+ for (const command of leaves(program))
224
+ command.addHelpText("after", () => commandHelpText(command));
225
+ }, "installCommandHelp");
226
+
227
+ // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/cli/help/first-screen.js
228
+ var WIDTH = 100;
229
+ var widest = /* @__PURE__ */ __name((texts) => texts.reduce((most, text) => Math.max(most, text.length), 0), "widest");
230
+ var block = /* @__PURE__ */ __name((title, rows, column) => rows.length === 0 ? [] : ["", `${title}:`, ...rows.map(([left, right]) => ` ${left.padEnd(column)}${right}`)], "block");
231
+ var TOPICS = [
232
+ ["--json", "output"],
233
+ ["--offline", "offline"],
234
+ ["--timeout", "timeouts"],
235
+ ["--dry-run", "dry run"]
236
+ ];
237
+ var optionTopics = /* @__PURE__ */ __name((program) => {
238
+ const longs = new Set(program.options.map((option) => option.long));
239
+ const topics = TOPICS.filter(([long]) => longs.has(long)).map(([, topic]) => topic);
240
+ return topics.length > 0 ? topics.join(", ") : "the options every command takes";
241
+ }, "optionTopics");
242
+ var pointers = /* @__PURE__ */ __name((program, cli, start, profile) => {
243
+ const has = /* @__PURE__ */ __name((path) => commandAt(program, path) !== void 0, "has");
244
+ const next = [
245
+ has("commands") ? [`${cli} commands`, "every command, by section"] : void 0,
246
+ has("guide") ? [`${cli} guide`, "scenarios: command sequences for common tasks"] : void 0,
247
+ [`${cli} help options`, optionTopics(program)]
248
+ ].filter((row) => row !== void 0);
249
+ const rows = [
250
+ ...start ? [["Start here:", start, profile ? "(any profile name works)" : ""]] : [],
251
+ ...has("account list") ? [["", `${cli} account list`, "your profiles and their logged-in accounts"]] : [],
252
+ ...next.map(([command = "", does = ""], at) => [at === 0 ? "Next:" : "", command, does]),
253
+ ...has("skill show") ? [["For agents:", `${cli} skill show`, "rules and the discovery loop"]] : []
254
+ ];
255
+ const width = widest(rows.map(([, command]) => command)) + 2;
256
+ return ["", ...rows.map(([label, command, does]) => `${label.padEnd(14)}${command.padEnd(width)}${does}`.trimEnd())];
257
+ }, "pointers");
258
+ var firstScreen = /* @__PURE__ */ __name((program, screen = {}) => {
259
+ const cli = program.name();
260
+ const profile = screen.profile !== false;
261
+ const pitch = screen.pitch ?? program.description().split("\n")[0] ?? "";
262
+ const can = (screen.can ?? []).map(({ command, does }) => [command, does]);
263
+ const works = WIRECAT_TOOLS.filter((tool) => tool.command !== cli).map(({ command, shown, does }) => [shown ?? command, does]);
264
+ const column = Math.max(22, widest([...can, ...works].map(([left]) => left))) + 2;
265
+ const start = screen.start ?? (commandAt(program, "setup") ? `${cli} ${EXAMPLE_PROFILE} setup` : void 0);
266
+ return [
267
+ wrapAnsi(`${cli} \u2014 ${pitch}`, WIDTH),
268
+ "",
269
+ `Usage: ${cli} ${profile ? "<profile> " : ""}<command> [options]`,
270
+ ...profile ? ["Account commands start with your profile, a name you choose; none is ever assumed."] : [],
271
+ ...block("What you can do", can, column),
272
+ ...block("Works with", works, column),
273
+ ...pointers(program, cli, start, profile),
274
+ ""
275
+ ].join("\n");
276
+ }, "firstScreen");
277
+ var optionsScreen = /* @__PURE__ */ __name((program) => {
278
+ const helper = program.createHelp();
279
+ const width = helper.longestOptionTermLength(program, helper);
280
+ return [
281
+ `Options for every ${program.name()} command:`,
282
+ ...helper.visibleOptions(program).map((option) => helper.formatItem(helper.optionTerm(option), width, helper.optionDescription(option), helper)),
283
+ ""
284
+ ].join("\n");
285
+ }, "optionsScreen");
286
+ var installHelp = /* @__PURE__ */ __name((program, screen = {}) => {
287
+ let full = false;
288
+ const own = program.configureHelp();
289
+ program.configureHelp({
290
+ ...own,
291
+ // Commander copies this configuration to children made with `.command()`, so only the root gets the screen.
292
+ formatHelp: /* @__PURE__ */ __name((command, helper) => command === program && !full ? firstScreen(program, screen) : (own.formatHelp ?? Help.prototype.formatHelp).call(helper, command, helper), "formatHelp")
293
+ });
294
+ installCommandHelp(program, { profile: screen.profile !== false });
295
+ program.addOption(new Option("--help-all", "the full help: every command and option").hideHelp());
296
+ program.on("option:help-all", () => {
297
+ full = true;
298
+ program.help();
299
+ });
300
+ if (program.commands.some((command) => command.name() === "help"))
301
+ return program;
302
+ const help = annotate(new Command("help"), { effects: NO_EFFECTS, mcp: false }).description("this screen; help options: the options for every command; help <command>: that command's help").argument("[topic...]", "options, or a command path").action((topic) => {
303
+ if (topic.length === 0)
304
+ return program.outputHelp();
305
+ if (topic.length === 1 && topic[0] === "options")
306
+ return program.configureOutput().writeOut?.(optionsScreen(program));
307
+ const command = commandAt(program, topic.join(" "));
308
+ if (!command)
309
+ throw new CliError("validation_error", `no command "${topic.join(" ")}" \u2014 run \`${program.name()} help\`, or \`${program.name()} help options\``, { available: program.commands.map((one) => one.name()).filter((name) => name !== "help") });
310
+ command.outputHelp();
311
+ });
312
+ program.addCommand(help, { hidden: true });
313
+ return program;
314
+ }, "installHelp");
315
+
316
+ export {
317
+ firstScreen,
318
+ installHelp
319
+ };
@@ -0,0 +1,50 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ __name
5
+ } from "./chunk-ZVVMGPBJ.js";
6
+
7
+ // node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
8
+ var emptyOptions = {};
9
+ function toString(value, options) {
10
+ const settings = options || emptyOptions;
11
+ const includeImageAlt = typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true;
12
+ const includeHtml = typeof settings.includeHtml === "boolean" ? settings.includeHtml : true;
13
+ return one(value, includeImageAlt, includeHtml);
14
+ }
15
+ __name(toString, "toString");
16
+ function one(value, includeImageAlt, includeHtml) {
17
+ if (node(value)) {
18
+ if ("value" in value) {
19
+ return value.type === "html" && !includeHtml ? "" : value.value;
20
+ }
21
+ if (includeImageAlt && "alt" in value && value.alt) {
22
+ return value.alt;
23
+ }
24
+ if ("children" in value) {
25
+ return all(value.children, includeImageAlt, includeHtml);
26
+ }
27
+ }
28
+ if (Array.isArray(value)) {
29
+ return all(value, includeImageAlt, includeHtml);
30
+ }
31
+ return "";
32
+ }
33
+ __name(one, "one");
34
+ function all(values, includeImageAlt, includeHtml) {
35
+ const result = [];
36
+ let index = -1;
37
+ while (++index < values.length) {
38
+ result[index] = one(values[index], includeImageAlt, includeHtml);
39
+ }
40
+ return result.join("");
41
+ }
42
+ __name(all, "all");
43
+ function node(value) {
44
+ return Boolean(value && typeof value === "object");
45
+ }
46
+ __name(node, "node");
47
+
48
+ export {
49
+ toString
50
+ };