@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,291 @@
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/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.js
8
+ var convert = (
9
+ // Note: overloads in JSDoc can’t yet use different `@template`s.
10
+ /**
11
+ * @type {(
12
+ * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
13
+ * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
14
+ * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
15
+ * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
16
+ * ((test?: Test) => Check)
17
+ * )}
18
+ */
19
+ /**
20
+ * @param {Test} [test]
21
+ * @returns {Check}
22
+ */
23
+ /* @__PURE__ */ __name((function(test) {
24
+ if (test === null || test === void 0) {
25
+ return ok;
26
+ }
27
+ if (typeof test === "function") {
28
+ return castFactory(test);
29
+ }
30
+ if (typeof test === "object") {
31
+ return Array.isArray(test) ? anyFactory(test) : (
32
+ // Cast because `ReadonlyArray` goes into the above but `isArray`
33
+ // narrows to `Array`.
34
+ propertiesFactory(
35
+ /** @type {Props} */
36
+ test
37
+ )
38
+ );
39
+ }
40
+ if (typeof test === "string") {
41
+ return typeFactory(test);
42
+ }
43
+ throw new Error("Expected function, string, or object as test");
44
+ }), "convert")
45
+ );
46
+ function anyFactory(tests) {
47
+ const checks = [];
48
+ let index = -1;
49
+ while (++index < tests.length) {
50
+ checks[index] = convert(tests[index]);
51
+ }
52
+ return castFactory(any);
53
+ function any(...parameters) {
54
+ let index2 = -1;
55
+ while (++index2 < checks.length) {
56
+ if (checks[index2].apply(this, parameters)) return true;
57
+ }
58
+ return false;
59
+ }
60
+ __name(any, "any");
61
+ }
62
+ __name(anyFactory, "anyFactory");
63
+ function propertiesFactory(check) {
64
+ const checkAsRecord = (
65
+ /** @type {Record<string, unknown>} */
66
+ check
67
+ );
68
+ return castFactory(all);
69
+ function all(node) {
70
+ const nodeAsRecord = (
71
+ /** @type {Record<string, unknown>} */
72
+ /** @type {unknown} */
73
+ node
74
+ );
75
+ let key;
76
+ for (key in check) {
77
+ if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
78
+ }
79
+ return true;
80
+ }
81
+ __name(all, "all");
82
+ }
83
+ __name(propertiesFactory, "propertiesFactory");
84
+ function typeFactory(check) {
85
+ return castFactory(type);
86
+ function type(node) {
87
+ return node && node.type === check;
88
+ }
89
+ __name(type, "type");
90
+ }
91
+ __name(typeFactory, "typeFactory");
92
+ function castFactory(testFunction) {
93
+ return check;
94
+ function check(value, index, parent) {
95
+ return Boolean(
96
+ looksLikeANode(value) && testFunction.call(
97
+ this,
98
+ value,
99
+ typeof index === "number" ? index : void 0,
100
+ parent || void 0
101
+ )
102
+ );
103
+ }
104
+ __name(check, "check");
105
+ }
106
+ __name(castFactory, "castFactory");
107
+ function ok() {
108
+ return true;
109
+ }
110
+ __name(ok, "ok");
111
+ function looksLikeANode(value) {
112
+ return value !== null && typeof value === "object" && "type" in value;
113
+ }
114
+ __name(looksLikeANode, "looksLikeANode");
115
+
116
+ // node_modules/.pnpm/unist-util-visit-parents@6.1.0/node_modules/unist-util-visit-parents/lib/color.node.js
117
+ function color(d) {
118
+ return "\x1B[33m" + d + "\x1B[39m";
119
+ }
120
+ __name(color, "color");
121
+
122
+ // node_modules/.pnpm/unist-util-visit-parents@6.1.0/node_modules/unist-util-visit-parents/lib/index.js
123
+ var empty = [];
124
+ var CONTINUE = true;
125
+ var EXIT = false;
126
+ var SKIP = "skip";
127
+ function visitParents(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
128
+ if (!tree || typeof tree !== "object") {
129
+ throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
130
+ }
131
+ let preorder = true;
132
+ let check;
133
+ let visitors;
134
+ let enter;
135
+ let exit;
136
+ if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
137
+ check = /** @type {Test} */
138
+ testOrEnterOrVisitors;
139
+ visitors = enterOrVisitorsOrReverse;
140
+ if (reverse) preorder = false;
141
+ } else {
142
+ visitors = /** @type {Visitors | Visitor} */
143
+ testOrEnterOrVisitors;
144
+ if (enterOrVisitorsOrReverse) preorder = false;
145
+ }
146
+ if (typeof visitors === "function") {
147
+ enter = visitors;
148
+ } else if (visitors && typeof visitors === "object") {
149
+ if (visitors.enter === null || visitors.enter === void 0) {
150
+ } else if (typeof visitors.enter === "function") {
151
+ enter = visitors.enter;
152
+ } else {
153
+ throw new Error(
154
+ "Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor"
155
+ );
156
+ }
157
+ if (typeof visitors.exit === "function") {
158
+ exit = visitors.exit;
159
+ } else {
160
+ throw new Error(
161
+ "Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)"
162
+ );
163
+ }
164
+ } else {
165
+ throw new Error(
166
+ "Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors"
167
+ );
168
+ }
169
+ const is2 = convert(check);
170
+ const step = preorder ? 1 : -1;
171
+ factory(tree, void 0, [])();
172
+ function factory(node, index, parents) {
173
+ const value = (
174
+ /** @type {Record<string, unknown>} */
175
+ node && typeof node === "object" ? node : {}
176
+ );
177
+ if (typeof value.type === "string") {
178
+ const name = (
179
+ // `hast`
180
+ typeof value.tagName === "string" ? value.tagName : (
181
+ // `xast`
182
+ typeof value.name === "string" ? value.name : void 0
183
+ )
184
+ );
185
+ Object.defineProperty(visit2, "name", {
186
+ value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")"
187
+ });
188
+ }
189
+ return visit2;
190
+ function visit2() {
191
+ const matches = !check || is2(node, index, parents[parents.length - 1] || void 0);
192
+ let result = empty;
193
+ if (enter && matches) {
194
+ result = toResult(enter(node, parents, index));
195
+ if (result[0] === EXIT) {
196
+ return result;
197
+ }
198
+ }
199
+ if ("children" in node && node.children) {
200
+ const nodeAsParent = (
201
+ /** @type {UnistParent} */
202
+ node
203
+ );
204
+ if (nodeAsParent.children && result[0] !== SKIP) {
205
+ let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
206
+ const grandparents = [...parents, nodeAsParent];
207
+ while (offset > -1 && offset < nodeAsParent.children.length) {
208
+ const child = nodeAsParent.children[offset];
209
+ const subresult = factory(child, offset, grandparents)();
210
+ if (subresult[0] === EXIT) {
211
+ return subresult;
212
+ }
213
+ offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
214
+ }
215
+ }
216
+ }
217
+ if (exit && matches) {
218
+ const exitResult = toResult(exit(node, parents, index));
219
+ if (exitResult[0] === SKIP) {
220
+ throw new Error(
221
+ "Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing"
222
+ );
223
+ }
224
+ if (exitResult[0] === EXIT || typeof exitResult[1] === "number") {
225
+ return exitResult;
226
+ }
227
+ }
228
+ return result;
229
+ }
230
+ __name(visit2, "visit");
231
+ }
232
+ __name(factory, "factory");
233
+ }
234
+ __name(visitParents, "visitParents");
235
+ function toResult(value) {
236
+ if (Array.isArray(value)) {
237
+ return value;
238
+ }
239
+ if (typeof value === "number") {
240
+ return [CONTINUE, value];
241
+ }
242
+ return value === null || value === void 0 ? empty : [value];
243
+ }
244
+ __name(toResult, "toResult");
245
+
246
+ // node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.js
247
+ function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
248
+ let check;
249
+ let visitors;
250
+ let reverse;
251
+ if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
252
+ check = /** @type {Test} */
253
+ testOrEnterOrVisitors;
254
+ visitors = enterOrVisitorsOrReverse;
255
+ reverse = maybeReverse;
256
+ } else {
257
+ visitors = /** @type {Visitor | Visitors} */
258
+ testOrEnterOrVisitors;
259
+ reverse = enterOrVisitorsOrReverse;
260
+ }
261
+ if (typeof visitors === "function") {
262
+ visitParents(tree, check, wrap(visitors), reverse);
263
+ } else {
264
+ visitParents(tree, check, wrapVisitors(visitors), reverse);
265
+ }
266
+ }
267
+ __name(visit, "visit");
268
+ function wrapVisitors(visitors) {
269
+ if (!visitors || typeof visitors !== "object") return visitors;
270
+ return {
271
+ enter: typeof visitors.enter === "function" ? wrap(visitors.enter) : visitors.enter,
272
+ exit: typeof visitors.exit === "function" ? wrap(visitors.exit) : visitors.exit
273
+ };
274
+ }
275
+ __name(wrapVisitors, "wrapVisitors");
276
+ function wrap(visitor) {
277
+ return overload;
278
+ function overload(node, parents, index) {
279
+ return visitor(node, index, parents[parents.length - 1]);
280
+ }
281
+ __name(overload, "overload");
282
+ }
283
+ __name(wrap, "wrap");
284
+
285
+ export {
286
+ convert,
287
+ EXIT,
288
+ SKIP,
289
+ visitParents,
290
+ visit
291
+ };
@@ -0,0 +1,73 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ alive
5
+ } from "./chunk-YUDVRFXN.js";
6
+ import {
7
+ resolvePaths,
8
+ writeSecurely
9
+ } from "./chunk-3BM6KBWP.js";
10
+ import {
11
+ __name
12
+ } from "./chunk-ZVVMGPBJ.js";
13
+
14
+ // 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/background/lock.js
15
+ import { existsSync, linkSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
16
+ import { dirname, join } from "node:path";
17
+ var lockPath = /* @__PURE__ */ __name((app, profile, env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "serve", `${profile}.lock`), "lockPath");
18
+ var readLock = /* @__PURE__ */ __name((path) => {
19
+ try {
20
+ const lock = JSON.parse(readFileSync(path, "utf8"));
21
+ return typeof lock.pid === "number" && typeof lock.startedAt === "string" ? lock : void 0;
22
+ } catch {
23
+ return void 0;
24
+ }
25
+ }, "readLock");
26
+ var holdLock = /* @__PURE__ */ __name((path, lock) => writeSecurely(path, `${JSON.stringify(lock)}
27
+ `, 384), "holdLock");
28
+ var takeLock = /* @__PURE__ */ __name((path, lock) => {
29
+ mkdirSync(dirname(path), { recursive: true, mode: 448 });
30
+ const draft = `${path}.${lock.pid}.tmp`;
31
+ writeFileSync(draft, `${JSON.stringify(lock)}
32
+ `, { mode: 384 });
33
+ try {
34
+ for (let attempt = 0; attempt < 5; attempt++) {
35
+ try {
36
+ linkSync(draft, path);
37
+ return void 0;
38
+ } catch (error) {
39
+ if (error.code !== "EEXIST")
40
+ throw error;
41
+ }
42
+ const held = readLock(path);
43
+ if (held && held.pid !== lock.pid && alive(held.pid))
44
+ return held;
45
+ rmSync(path, { force: true });
46
+ }
47
+ throw new Error(`could not take the lock ${path}: it keeps changing`);
48
+ } finally {
49
+ rmSync(draft, { force: true });
50
+ }
51
+ }, "takeLock");
52
+ var releaseLock = /* @__PURE__ */ __name((path, pid = process.pid) => {
53
+ if (readLock(path)?.pid === pid)
54
+ rmSync(path, { force: true });
55
+ }, "releaseLock");
56
+ var servingProfiles = /* @__PURE__ */ __name((app, env) => {
57
+ const dir = dirname(lockPath(app, "default", env));
58
+ if (!existsSync(dir))
59
+ return [];
60
+ return readdirSync(dir).filter((name) => name.endsWith(".lock")).map((name) => name.slice(0, -".lock".length)).filter((profile) => {
61
+ const lock = readLock(lockPath(app, profile, env));
62
+ return lock !== void 0 && alive(lock.pid);
63
+ });
64
+ }, "servingProfiles");
65
+
66
+ export {
67
+ lockPath,
68
+ readLock,
69
+ holdLock,
70
+ takeLock,
71
+ releaseLock,
72
+ servingProfiles
73
+ };
@@ -0,0 +1,58 @@
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/micromark-util-character@2.1.1/node_modules/micromark-util-character/index.js
8
+ var asciiAlpha = regexCheck(/[A-Za-z]/);
9
+ var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
10
+ var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
11
+ function asciiControl(code) {
12
+ return (
13
+ // Special whitespace codes (which have negative values), C0 and Control
14
+ // character DEL
15
+ code !== null && (code < 32 || code === 127)
16
+ );
17
+ }
18
+ __name(asciiControl, "asciiControl");
19
+ var asciiDigit = regexCheck(/\d/);
20
+ var asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
21
+ var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
22
+ function markdownLineEnding(code) {
23
+ return code !== null && code < -2;
24
+ }
25
+ __name(markdownLineEnding, "markdownLineEnding");
26
+ function markdownLineEndingOrSpace(code) {
27
+ return code !== null && (code < 0 || code === 32);
28
+ }
29
+ __name(markdownLineEndingOrSpace, "markdownLineEndingOrSpace");
30
+ function markdownSpace(code) {
31
+ return code === -2 || code === -1 || code === 32;
32
+ }
33
+ __name(markdownSpace, "markdownSpace");
34
+ var unicodePunctuation = regexCheck(new RegExp("\\p{P}|\\p{S}", "u"));
35
+ var unicodeWhitespace = regexCheck(/\s/);
36
+ function regexCheck(regex) {
37
+ return check;
38
+ function check(code) {
39
+ return code !== null && code > -1 && regex.test(String.fromCharCode(code));
40
+ }
41
+ __name(check, "check");
42
+ }
43
+ __name(regexCheck, "regexCheck");
44
+
45
+ export {
46
+ asciiAlpha,
47
+ asciiAlphanumeric,
48
+ asciiAtext,
49
+ asciiControl,
50
+ asciiDigit,
51
+ asciiHexDigit,
52
+ asciiPunctuation,
53
+ markdownLineEnding,
54
+ markdownLineEndingOrSpace,
55
+ markdownSpace,
56
+ unicodePunctuation,
57
+ unicodeWhitespace
58
+ };
@@ -0,0 +1,156 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError,
5
+ errorCodes
6
+ } from "./chunk-HM6AMYHR.js";
7
+ import {
8
+ __name
9
+ } from "./chunk-ZVVMGPBJ.js";
10
+
11
+ // 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/errors/failures.js
12
+ var isCliFailure = /* @__PURE__ */ __name((value) => value instanceof Error && value.name === "CliError" && errorCodes.includes(value.code), "isCliFailure");
13
+ var isCommanderFailure = /* @__PURE__ */ __name((value) => {
14
+ const { code, exitCode } = value ?? {};
15
+ return value instanceof Error && typeof code === "string" && code.startsWith("commander.") && typeof exitCode === "number";
16
+ }, "isCommanderFailure");
17
+ var USAGE_REASONS = {
18
+ "commander.unknownCommand": "usage.unknown-command",
19
+ "commander.unknownOption": "usage.unknown-option"
20
+ };
21
+ var usageReason = /* @__PURE__ */ __name((code) => USAGE_REASONS[code], "usageReason");
22
+ var failureKey = /* @__PURE__ */ __name((error) => isCliFailure(error) ? error.code : error instanceof Error ? error.name : "error", "failureKey");
23
+ var SQLITE_CORRUPT = 11;
24
+ var SQLITE_NOTADB = 26;
25
+ var DAMAGED_TEXT = /database disk image is malformed|file is not a database|fts5: corruption/i;
26
+ var sqliteCode = /* @__PURE__ */ __name((error) => {
27
+ const { errcode, errno, name } = error ?? {};
28
+ const code = typeof errcode === "number" ? errcode : name === "SQLiteError" && typeof errno === "number" ? errno : null;
29
+ return code === null ? void 0 : code & 255;
30
+ }, "sqliteCode");
31
+ var damageIn = /* @__PURE__ */ __name((error) => {
32
+ if (isCliFailure(error) || isCommanderFailure(error))
33
+ return void 0;
34
+ let at = error;
35
+ for (let depth = 0; depth < 5 && at instanceof Error; depth += 1) {
36
+ const code = sqliteCode(at);
37
+ if (code !== void 0 && [SQLITE_CORRUPT, SQLITE_NOTADB].includes(code) || DAMAGED_TEXT.test(at.message))
38
+ return at;
39
+ at = at.cause;
40
+ }
41
+ return void 0;
42
+ }, "damageIn");
43
+ var wrapping = /* @__PURE__ */ __name((error, original) => {
44
+ Object.defineProperty(error, "cause", { value: original, configurable: true, writable: true });
45
+ if (original instanceof Error && original.stack)
46
+ error.stack = original.stack;
47
+ return error;
48
+ }, "wrapping");
49
+ var storeDamaged = /* @__PURE__ */ __name((error, next) => damageIn(error) ? wrapping(new CliError("configuration_error", `the store file is damaged${next ? `; \`${next}\` says what is damaged and what to do` : ""}`, { reason: "store.damaged" }), error) : error, "storeDamaged");
50
+ var damagedFile = /* @__PURE__ */ __name(async (files, work) => {
51
+ try {
52
+ return await work();
53
+ } catch (error) {
54
+ if (!damageIn(error))
55
+ throw error;
56
+ throw wrapping(new CliError("validation_error", `${files.join(" or ")} is damaged or not a database`, {
57
+ reason: "store.file-damaged"
58
+ }), error);
59
+ }
60
+ }, "damagedFile");
61
+ var isStoreDamage = /* @__PURE__ */ __name((error) => damageIn(error) !== void 0, "isStoreDamage");
62
+
63
+ // 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/runs/secrets.js
64
+ var SECRET_WORDS = /* @__PURE__ */ new Set([
65
+ "authorization",
66
+ "cookie",
67
+ "credential",
68
+ "credentials",
69
+ "passphrase",
70
+ "password",
71
+ "passwd",
72
+ "pwd",
73
+ "pass",
74
+ "passcode",
75
+ "pin",
76
+ "otp",
77
+ "2fa",
78
+ "secret",
79
+ "token",
80
+ "contrase\xF1a",
81
+ "contrasena",
82
+ "clave",
83
+ "\u043F\u0430\u0440\u043E\u043B\u044C",
84
+ "\u043F\u0438\u043D",
85
+ "\u043A\u043E\u0434",
86
+ ...["api", "auth", "service", "account", "db", "database", "priv", "private", "client"].map((word) => `${word}key`),
87
+ ...["db", "database", "key"].map((word) => `${word}pass`)
88
+ ]);
89
+ var secretNamed = /* @__PURE__ */ __name((name) => {
90
+ const words = name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_.-]+/).map((word) => word.toLowerCase());
91
+ return words.some((word, at) => SECRET_WORDS.has(word) || SECRET_WORDS.has(word + (words[at + 1] ?? "")));
92
+ }, "secretNamed");
93
+ var START = "(?<![A-Za-z0-9_-])";
94
+ var END = "(?![A-Za-z0-9_-])";
95
+ var KNOWN_TOKENS = new RegExp(`${[
96
+ "gh[pousr]_[A-Za-z0-9]{36,}",
97
+ "github_pat_[A-Za-z0-9_]{22,}",
98
+ "sk-[A-Za-z0-9_-]{20,}",
99
+ "xox[abprs]-[A-Za-z0-9-]{10,}",
100
+ "(?:AKIA|ASIA)[A-Z0-9]{16}",
101
+ "AIza[A-Za-z0-9_-]{35}",
102
+ "(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{10,}",
103
+ "npm_[A-Za-z0-9]{36}",
104
+ "eyJ[A-Za-z0-9_-]{5,}\\.eyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]*"
105
+ ].map((pattern) => `${START}${pattern}${END}`).join("|")}|(?<!\\d)\\d{8,10}:[A-Za-z0-9_-]{35}${END}`, "g");
106
+ var WEBHOOK_PATH = /(\/rest\/\d+\/)[^/\s?#"']+/g;
107
+ var PRIVATE_KEY = /-----BEGIN[A-Z ]* PRIVATE KEY-----[\s\S]*?(?:-----END[A-Z ]* PRIVATE KEY-----|$)/g;
108
+ var SCHEME = /(?<![A-Za-z])(Bearer|Basic)(\s+)(?![A-Z]?[a-z]+(?![A-Za-z0-9]))[A-Za-z0-9._~+/=-]{8,}/g;
109
+ var NAMED_PAIR = /(?<![\p{L}\p{N}])([\p{L}\p{N}_.-]*(?:token|pass|pwd|pin|otp|2fa|secret|credential|cookie|authorization|key|contrase|clave|пароль|пин|код)[\p{L}\p{N}_.-]*)(["']?\s*(?:=>|[:=])\s*["']?|\s+(?![\p{L}]+(?![\p{L}\p{N}])))((?:Bearer\s+|Basic\s+)?)([^\s"'&,;]+)/giu;
110
+ var looksRandom = /* @__PURE__ */ __name((run) => {
111
+ if (run.length < 20)
112
+ return false;
113
+ const classes = [/[a-z]/, /[A-Z]/, /\d/, /[^A-Za-z0-9]/].filter((kind) => kind.test(run)).length;
114
+ if (classes < 3)
115
+ return false;
116
+ let switches = 0;
117
+ for (let at = 1; at < run.length; at++) {
118
+ const [before, after] = [run[at - 1], run[at]];
119
+ if (/[a-z]/.test(before) && /[A-Z]/.test(after) || /[A-Z]/.test(before) && /[a-z]/.test(after))
120
+ switches += 1;
121
+ }
122
+ if (switches / run.length < 0.15)
123
+ return false;
124
+ const pieces = run.match(/[A-Z]?[a-z]+|[A-Z]+(?![a-z])|\d+/g) ?? [];
125
+ if (pieces.join("").length / Math.max(pieces.length, 1) >= 2.75)
126
+ return false;
127
+ return entropy(run) >= 3.5;
128
+ }, "looksRandom");
129
+ var entropy = /* @__PURE__ */ __name((text) => {
130
+ const counts = /* @__PURE__ */ new Map();
131
+ for (const char of text)
132
+ counts.set(char, (counts.get(char) ?? 0) + 1);
133
+ let bits = 0;
134
+ for (const count of counts.values())
135
+ bits -= count / text.length * Math.log2(count / text.length);
136
+ return bits;
137
+ }, "entropy");
138
+ var withoutSecrets = /* @__PURE__ */ __name((text, mark = "[redacted]") => text.replace(WEBHOOK_PATH, `$1${mark}`).replace(PRIVATE_KEY, mark).replace(KNOWN_TOKENS, mark).replace(SCHEME, `$1$2${mark}`).replace(NAMED_PAIR, (whole, name, separator, scheme) => secretNamed(name) ? `${name}${separator}${scheme}${mark}` : whole).replace(/[!-~]{20,}/g, (token) => (
139
+ // A URL or a path is somebody's address, not a key; a credential in one is caught by the rules above.
140
+ token.includes("://") || /^(?:\/|~\/|\.\.?\/)/.test(token) ? token : token.replace(RUN, (run) => looksRandom(run) ? mark : run.replace(HEX, (hex) => entropy(hex) >= 3 ? mark : hex))
141
+ )), "withoutSecrets");
142
+ var RUN = /(?<![A-Za-z0-9_+/-])[A-Za-z0-9_+/-]{20,}/g;
143
+ var HEX = /(?<![A-Za-z0-9])(?=[0-9]*[a-f])[0-9a-f]{20,}(?![A-Za-z0-9])/g;
144
+
145
+ export {
146
+ isCliFailure,
147
+ isCommanderFailure,
148
+ usageReason,
149
+ failureKey,
150
+ sqliteCode,
151
+ storeDamaged,
152
+ damagedFile,
153
+ isStoreDamage,
154
+ secretNamed,
155
+ withoutSecrets
156
+ };