@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.
- package/CHANGELOG.md +27 -0
- package/LICENSE +204 -0
- package/README.md +248 -2
- package/contracts/wirecat.json +2535 -0
- package/dist/bin/wordpress.d.ts +3 -0
- package/dist/bin/wordpress.d.ts.map +1 -0
- package/dist/bin/wordpress.js +40 -0
- package/dist/bin/wordpress.js.map +1 -0
- package/dist/bundle/agent-LKBRYKNB.js +37 -0
- package/dist/bundle/all-profiles-OEV7VFQG.js +320 -0
- package/dist/bundle/anthropic-JKTZP2DW.js +91 -0
- package/dist/bundle/app-server-7LWLDDE2.js +249 -0
- package/dist/bundle/bun-2FLR4IV4.js +169 -0
- package/dist/bundle/bun-sqlite-GRSRX5P4.js +76 -0
- package/dist/bundle/chunk-2BI25SEE.js +259 -0
- package/dist/bundle/chunk-2UEGJ5AJ.js +52 -0
- package/dist/bundle/chunk-2XUV7HNE.js +58 -0
- package/dist/bundle/chunk-2Z7UOXFC.js +16 -0
- package/dist/bundle/chunk-3BM6KBWP.js +2788 -0
- package/dist/bundle/chunk-3BRAZVHR.js +1010 -0
- package/dist/bundle/chunk-3LMW7U7F.js +1233 -0
- package/dist/bundle/chunk-3LVTQFGB.js +2000 -0
- package/dist/bundle/chunk-3TKFFSFU.js +106 -0
- package/dist/bundle/chunk-3UX4VJWD.js +78 -0
- package/dist/bundle/chunk-4HEXAGKT.js +334 -0
- package/dist/bundle/chunk-4HP6KGBI.js +32 -0
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/chunk-5XPHFV7H.js +2333 -0
- package/dist/bundle/chunk-5Z3P543G.js +80 -0
- package/dist/bundle/chunk-6UYDKCV6.js +794 -0
- package/dist/bundle/chunk-7GNB4LBX.js +50 -0
- package/dist/bundle/chunk-7HJFBOAT.js +161 -0
- package/dist/bundle/chunk-7JVKQ6NM.js +206 -0
- package/dist/bundle/chunk-7QH5BZUG.js +142 -0
- package/dist/bundle/chunk-A474OVIW.js +1392 -0
- package/dist/bundle/chunk-AENEMQL3.js +1068 -0
- package/dist/bundle/chunk-AL7I4DT4.js +65718 -0
- package/dist/bundle/chunk-ARGRGTPX.js +108 -0
- package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
- package/dist/bundle/chunk-BAXNAOOL.js +76 -0
- package/dist/bundle/chunk-BH63B66W.js +407 -0
- package/dist/bundle/chunk-CCOSG3F2.js +24616 -0
- package/dist/bundle/chunk-CFQQTDSA.js +46 -0
- package/dist/bundle/chunk-CGCUOT67.js +388 -0
- package/dist/bundle/chunk-CHPWBQUK.js +39 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-EHW45LLT.js +100 -0
- package/dist/bundle/chunk-F3AV5ZSL.js +338 -0
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/chunk-F5ZAN7OC.js +6848 -0
- package/dist/bundle/chunk-FMMYBVCH.js +38 -0
- package/dist/bundle/chunk-FNB4SWTY.js +66 -0
- package/dist/bundle/chunk-FQROWBKV.js +12660 -0
- package/dist/bundle/chunk-FV2HJOSC.js +771 -0
- package/dist/bundle/chunk-GCAJW4SR.js +53 -0
- package/dist/bundle/chunk-GPRJXJC7.js +102 -0
- package/dist/bundle/chunk-HCOZUOSN.js +54 -0
- package/dist/bundle/chunk-HM6AMYHR.js +72 -0
- package/dist/bundle/chunk-HVXOA4FO.js +23 -0
- package/dist/bundle/chunk-HWQ7572G.js +95 -0
- package/dist/bundle/chunk-IJVTN5L3.js +82 -0
- package/dist/bundle/chunk-IZDDBOHU.js +3610 -0
- package/dist/bundle/chunk-JAE5B4G7.js +388 -0
- package/dist/bundle/chunk-K2Y5K37O.js +218 -0
- package/dist/bundle/chunk-KCH224US.js +9581 -0
- package/dist/bundle/chunk-KZJQPJK5.js +230 -0
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/chunk-LECMHK2F.js +18 -0
- package/dist/bundle/chunk-LWEMZJLG.js +1332 -0
- package/dist/bundle/chunk-LWTETL2O.js +185 -0
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/chunk-MJ6LTG4L.js +170 -0
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/chunk-ODVGFCBE.js +557 -0
- package/dist/bundle/chunk-OEQNP56V.js +633 -0
- package/dist/bundle/chunk-OV6WQY3L.js +39 -0
- package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
- package/dist/bundle/chunk-PPNTY7LD.js +733 -0
- package/dist/bundle/chunk-PRZYRA66.js +358 -0
- package/dist/bundle/chunk-PV5UYGRJ.js +41594 -0
- package/dist/bundle/chunk-QYTOLPNI.js +52 -0
- package/dist/bundle/chunk-R7Y3XU66.js +362 -0
- package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
- package/dist/bundle/chunk-SD5CXGIG.js +188 -0
- package/dist/bundle/chunk-SXY5G62I.js +288 -0
- package/dist/bundle/chunk-T37TAXVL.js +29 -0
- package/dist/bundle/chunk-T5SOY3AE.js +1197 -0
- package/dist/bundle/chunk-TJ7OORSO.js +1876 -0
- package/dist/bundle/chunk-TRYYWV7J.js +291 -0
- package/dist/bundle/chunk-U6VLNYCO.js +73 -0
- package/dist/bundle/chunk-UC7JLE6J.js +58 -0
- package/dist/bundle/chunk-UUIOAZPH.js +156 -0
- package/dist/bundle/chunk-UXQ24OY6.js +4072 -0
- package/dist/bundle/chunk-VBRRMGON.js +1007 -0
- package/dist/bundle/chunk-VRIBES2C.js +319 -0
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/chunk-XT5XYQEZ.js +3414 -0
- package/dist/bundle/chunk-XTAS5Z3G.js +2231 -0
- package/dist/bundle/chunk-XYQVVW4R.js +24 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/chunk-YUDVRFXN.js +63 -0
- package/dist/bundle/chunk-Z3I2MCUT.js +131 -0
- package/dist/bundle/chunk-ZDI3WC7V.js +353 -0
- package/dist/bundle/chunk-ZVQ7KFMT.js +274 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-P7YE4EKS.js +37 -0
- package/dist/bundle/command-server-entry-XIMCBWMV.js +166 -0
- package/dist/bundle/decode-6XK55WYV.js +297 -0
- package/dist/bundle/definitions-GIQCGYPR.js +7986 -0
- package/dist/bundle/dispatch-JQBAZWCL.js +411 -0
- package/dist/bundle/dist-2TV3NVE5.js +7577 -0
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/echarts-YRRVLEX3.js +42501 -0
- package/dist/bundle/embed-L3EEQSGX.js +38 -0
- package/dist/bundle/embedder-BIKLBV3J.js +111 -0
- package/dist/bundle/failure-I6AAF5R5.js +25 -0
- package/dist/bundle/first-run-W6G6TYZ2.js +29 -0
- package/dist/bundle/first-screen-ITIAJIBU.js +37 -0
- package/dist/bundle/hast-util-from-html-ZHU6HGIE.js +10531 -0
- package/dist/bundle/hast-util-to-html-IIFHILP5.js +998 -0
- package/dist/bundle/hast-util-to-mdast-D62XX3NR.js +2272 -0
- package/dist/bundle/instructions-AG7SRWTR.js +11 -0
- package/dist/bundle/mcp-YGOAUNC3.js +167 -0
- package/dist/bundle/mdast-util-from-markdown-WVUJDSUO.js +1900 -0
- package/dist/bundle/mdast-util-gfm-KN2D32QS.js +1040 -0
- package/dist/bundle/mdast-util-to-hast-AYJV7KAE.js +879 -0
- package/dist/bundle/mdast-util-to-markdown-UCAJNHJO.js +18 -0
- package/dist/bundle/meeting-combined-CQJ3JHHU.js +24 -0
- package/dist/bundle/meeting-model-MZ7VVBNK.js +25 -0
- package/dist/bundle/meeting-semantic-DADWRRHP.js +22 -0
- package/dist/bundle/micromark-extension-gfm-EEJRRJ36.js +1771 -0
- package/dist/bundle/node-GJQYN4FT.js +176 -0
- package/dist/bundle/node-JJ3WDCNJ.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-TPR62DT2.js +74 -0
- package/dist/bundle/oauth-WGY7JQVW.js +20 -0
- package/dist/bundle/open-DE7QZNAN.js +23 -0
- package/dist/bundle/openai-NHEFT3HS.js +238 -0
- package/dist/bundle/process-MEKCZMX3.js +91 -0
- package/dist/bundle/program-EP2S5BTM.js +38857 -0
- package/dist/bundle/prompt-PWY53BYH.js +17 -0
- package/dist/bundle/recognize-74TXHKMQ.js +26 -0
- package/dist/bundle/remote-F5TJZ5ER.js +31 -0
- package/dist/bundle/rerank-HWUO52UF.js +52 -0
- package/dist/bundle/schemas-4K6WWS5N.js +2157 -0
- package/dist/bundle/serve-I2USUY4X.js +199 -0
- package/dist/bundle/server-GDYDNO6K.js +79 -0
- package/dist/bundle/server-KYUW2AHB.js +212 -0
- package/dist/bundle/sqlite-runtime-N6VFGBJK.js +20 -0
- package/dist/bundle/state-L6JSCN77.js +36 -0
- package/dist/bundle/store-EPG2YPN3.js +291 -0
- package/dist/bundle/store-SQWQJE32.js +181 -0
- package/dist/bundle/store-maintenance-command-FTGSICVA.js +66 -0
- package/dist/bundle/surface-SNMHY6GP.js +65 -0
- package/dist/bundle/wordpress.js +183 -0
- package/dist/commands/api.d.ts +22 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +37 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/content.d.ts +4 -0
- package/dist/commands/content.d.ts.map +1 -0
- package/dist/commands/content.js +94 -0
- package/dist/commands/content.js.map +1 -0
- package/dist/commands/session.d.ts +8 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +28 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +69 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +37 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +31 -0
- package/dist/context.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +7982 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +6 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +8830 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +229 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +2019 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +3365 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/generated/wirecat-config.d.ts +11 -0
- package/dist/generated/wirecat-config.d.ts.map +1 -0
- package/dist/generated/wirecat-config.js +337 -0
- package/dist/generated/wirecat-config.js.map +1 -0
- package/dist/identity.d.ts +28 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +29 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +53 -0
- package/dist/program.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/package.json +87 -4
- package/skills/wordpress-cli/SKILL.md +88 -0
- package/skills/wordpress-cli/references/api/api-block-directory.md +17 -0
- package/skills/wordpress-cli/references/api/api-block-patterns.md +13 -0
- package/skills/wordpress-cli/references/api/api-block-types.md +34 -0
- package/skills/wordpress-cli/references/api/api-blocks.md +159 -0
- package/skills/wordpress-cli/references/api/api-categories.md +69 -0
- package/skills/wordpress-cli/references/api/api-comments.md +79 -0
- package/skills/wordpress-cli/references/api/api-font-collections.md +16 -0
- package/skills/wordpress-cli/references/api/api-font-families.md +122 -0
- package/skills/wordpress-cli/references/api/api-global-styles.md +29 -0
- package/skills/wordpress-cli/references/api/api-media.md +106 -0
- package/skills/wordpress-cli/references/api/api-menu-items.md +115 -0
- package/skills/wordpress-cli/references/api/api-menu-locations.md +22 -0
- package/skills/wordpress-cli/references/api/api-menus.md +69 -0
- package/skills/wordpress-cli/references/api/api-navigation.md +155 -0
- package/skills/wordpress-cli/references/api/api-pages.md +161 -0
- package/skills/wordpress-cli/references/api/api-pattern-directory.md +23 -0
- package/skills/wordpress-cli/references/api/api-plugins.md +25 -0
- package/skills/wordpress-cli/references/api/api-posts.md +166 -0
- package/skills/wordpress-cli/references/api/api-search.md +21 -0
- package/skills/wordpress-cli/references/api/api-settings.md +19 -0
- package/skills/wordpress-cli/references/api/api-sidebars.md +34 -0
- package/skills/wordpress-cli/references/api/api-statuses.md +22 -0
- package/skills/wordpress-cli/references/api/api-tags.md +69 -0
- package/skills/wordpress-cli/references/api/api-taxonomies.md +23 -0
- package/skills/wordpress-cli/references/api/api-template-parts.md +38 -0
- package/skills/wordpress-cli/references/api/api-templates.md +38 -0
- package/skills/wordpress-cli/references/api/api-themes.md +12 -0
- package/skills/wordpress-cli/references/api/api-types.md +22 -0
- package/skills/wordpress-cli/references/api/api-users.md +149 -0
- package/skills/wordpress-cli/references/api/api-widget-types.md +46 -0
- package/skills/wordpress-cli/references/api/api-widgets.md +57 -0
- package/skills/wordpress-cli/references/api/api-wp-pattern-category.md +69 -0
- package/skills/wordpress-cli/references/api.md +44 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
3
|
+
const require = __bundleRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
DESKTOP
|
|
6
|
+
} from "./chunk-OV6WQY3L.js";
|
|
7
|
+
import {
|
|
8
|
+
installerOf
|
|
9
|
+
} from "./chunk-HVXOA4FO.js";
|
|
10
|
+
import {
|
|
11
|
+
DESCRIBE_FLAG,
|
|
12
|
+
DISPATCH_FLAG,
|
|
13
|
+
PROGRAM_PREFIX,
|
|
14
|
+
SHIM_FORMAT,
|
|
15
|
+
describeAnswer,
|
|
16
|
+
exists,
|
|
17
|
+
fileState,
|
|
18
|
+
shimFiles,
|
|
19
|
+
writeShim
|
|
20
|
+
} from "./chunk-7JVKQ6NM.js";
|
|
21
|
+
import "./chunk-3BM6KBWP.js";
|
|
22
|
+
import {
|
|
23
|
+
catchCrashes
|
|
24
|
+
} from "./chunk-3LMW7U7F.js";
|
|
25
|
+
import "./chunk-S4UUN6LD.js";
|
|
26
|
+
import "./chunk-Y5E2WNWB.js";
|
|
27
|
+
import "./chunk-HM6AMYHR.js";
|
|
28
|
+
import {
|
|
29
|
+
__name
|
|
30
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
31
|
+
|
|
32
|
+
// dist/bin/wordpress.js
|
|
33
|
+
import { enableCompileCache } from "node:module";
|
|
34
|
+
|
|
35
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
|
|
36
|
+
import { createHash } from "node:crypto";
|
|
37
|
+
import { existsSync, readFileSync as readFileSync2, realpathSync } from "node:fs";
|
|
38
|
+
import { dirname as dirname2, join as join2 } from "node:path";
|
|
39
|
+
import { fileURLToPath } from "node:url";
|
|
40
|
+
|
|
41
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/launcher.js
|
|
42
|
+
import { readFileSync } from "node:fs";
|
|
43
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
44
|
+
var posix = /* @__PURE__ */ __name((path) => path.replaceAll("\\", "/"), "posix");
|
|
45
|
+
var pnpmHome = /* @__PURE__ */ __name((path, env) => {
|
|
46
|
+
const home = env.PNPM_HOME;
|
|
47
|
+
return home && path.startsWith(`${posix(home).replace(/\/+$/, "")}/`) ? home : void 0;
|
|
48
|
+
}, "pnpmHome");
|
|
49
|
+
var layoutFolders = /* @__PURE__ */ __name((script, env) => {
|
|
50
|
+
const path = posix(script);
|
|
51
|
+
const home = pnpmHome(path, env);
|
|
52
|
+
if (home)
|
|
53
|
+
return [join(home, "bin"), home];
|
|
54
|
+
switch (installerOf(script)) {
|
|
55
|
+
case "bun":
|
|
56
|
+
return [`${path.slice(0, path.indexOf("/install/global/node_modules/"))}/bin`];
|
|
57
|
+
case "npm": {
|
|
58
|
+
const root = path.slice(0, path.indexOf("/node_modules/"));
|
|
59
|
+
return [basename(root) === "lib" ? join(dirname(root), "bin") : root];
|
|
60
|
+
}
|
|
61
|
+
default:
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
}, "layoutFolders");
|
|
65
|
+
var binFolder = /* @__PURE__ */ __name(({ name, argv1, script, env, platform }) => {
|
|
66
|
+
if (!["npm", "pnpm", "bun"].includes(installerOf(script)) && !pnpmHome(posix(script), env))
|
|
67
|
+
return void 0;
|
|
68
|
+
const extensions = platform === "win32" ? [".cmd", ".exe"] : [""];
|
|
69
|
+
const candidates = [argv1 ? dirname(argv1) : void 0, ...layoutFolders(script, env)];
|
|
70
|
+
for (const dir of new Set(candidates)) {
|
|
71
|
+
if (dir === void 0 || basename(dir) === ".bin")
|
|
72
|
+
continue;
|
|
73
|
+
for (const extension of extensions) {
|
|
74
|
+
const program = `${PROGRAM_PREFIX}${name}${extension}`;
|
|
75
|
+
if (exists(join(dir, program)))
|
|
76
|
+
return { dir, program };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return void 0;
|
|
80
|
+
}, "binFolder");
|
|
81
|
+
var installed = /* @__PURE__ */ __name((dir, program) => {
|
|
82
|
+
if (!exists(join(dir, program)))
|
|
83
|
+
return false;
|
|
84
|
+
if (!program.toLowerCase().endsWith(".exe"))
|
|
85
|
+
return true;
|
|
86
|
+
let script;
|
|
87
|
+
try {
|
|
88
|
+
script = readFileSync(join(dir, `${program.slice(0, -4)}.bunx`)).toString("utf16le").split('"')[0] ?? "";
|
|
89
|
+
} catch {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
if (script === "" || exists(resolve(dir, script)))
|
|
93
|
+
return true;
|
|
94
|
+
const at = posix(script).lastIndexOf("/install/global/node_modules/");
|
|
95
|
+
return at < 0 || exists(join(dirname(dir), posix(script).slice(at + 1)));
|
|
96
|
+
}, "installed");
|
|
97
|
+
var NAME = "wcat";
|
|
98
|
+
var ensureLauncher = /* @__PURE__ */ __name(({ dir, program, platform }) => {
|
|
99
|
+
try {
|
|
100
|
+
if (!exists(join(dir, program)))
|
|
101
|
+
return "failed";
|
|
102
|
+
const mine = shimFiles("launcher", { dir, name: NAME, target: program, platform });
|
|
103
|
+
const states = mine.map((file) => fileState(file.path));
|
|
104
|
+
if (states.some((one) => one.state === "foreign"))
|
|
105
|
+
return "foreign";
|
|
106
|
+
const ours = states.flatMap((one) => one.state === "ours" ? [one] : []);
|
|
107
|
+
if (ours.some(({ mark }) => mark.format > SHIM_FORMAT))
|
|
108
|
+
return "newer";
|
|
109
|
+
if (ours.some(({ mark }) => mark.kind !== "launcher"))
|
|
110
|
+
return "foreign";
|
|
111
|
+
const current = ours.find(({ mark }) => installed(dir, mark.target))?.mark.target;
|
|
112
|
+
const wanted = shimFiles("launcher", { dir, name: NAME, target: current ?? program, platform });
|
|
113
|
+
const stale = wanted.filter((file, at) => {
|
|
114
|
+
const state = states[at];
|
|
115
|
+
return state?.state !== "ours" || state.text !== file.text;
|
|
116
|
+
});
|
|
117
|
+
if (stale.length === 0)
|
|
118
|
+
return "kept";
|
|
119
|
+
for (const file of stale)
|
|
120
|
+
writeShim(file);
|
|
121
|
+
return "written";
|
|
122
|
+
} catch {
|
|
123
|
+
return "failed";
|
|
124
|
+
}
|
|
125
|
+
}, "ensureLauncher");
|
|
126
|
+
|
|
127
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
|
|
128
|
+
var wcatStart = /* @__PURE__ */ __name(async (tool, io = {}) => {
|
|
129
|
+
const argv = io.argv ?? process.argv;
|
|
130
|
+
const env = io.env ?? process.env;
|
|
131
|
+
const platform = io.platform ?? process.platform;
|
|
132
|
+
const stdout = io.stdout ?? process.stdout;
|
|
133
|
+
const [first, ...rest] = argv.slice(2);
|
|
134
|
+
if (first === DESCRIBE_FLAG) {
|
|
135
|
+
stdout.write(`${JSON.stringify(describeAnswer(tool, shippedManifest(argv[1])))}
|
|
136
|
+
`);
|
|
137
|
+
return { code: 0 };
|
|
138
|
+
}
|
|
139
|
+
if (first === DISPATCH_FLAG) {
|
|
140
|
+
const { runWcat } = await import("./dispatch-JQBAZWCL.js");
|
|
141
|
+
const code = await runWcat(rest, { env, platform, stdout, stderr: io.stderr ?? process.stderr, self: tool });
|
|
142
|
+
return { code };
|
|
143
|
+
}
|
|
144
|
+
const folder = binFolder({
|
|
145
|
+
name: tool.command,
|
|
146
|
+
argv1: argv[1],
|
|
147
|
+
script: io.script ?? fileURLToPath(new URL("wcat/start.js", import.meta.resolve("@wirecat/cli-base")).href),
|
|
148
|
+
env,
|
|
149
|
+
platform
|
|
150
|
+
});
|
|
151
|
+
return folder ? { launcher: ensureLauncher({ ...folder, platform }) } : {};
|
|
152
|
+
}, "wcatStart");
|
|
153
|
+
var shippedManifest = /* @__PURE__ */ __name((bin) => {
|
|
154
|
+
if (!bin)
|
|
155
|
+
return void 0;
|
|
156
|
+
try {
|
|
157
|
+
for (let dir = dirname2(realpathSync(bin)); ; dir = dirname2(dir)) {
|
|
158
|
+
if (existsSync(join2(dir, "package.json"))) {
|
|
159
|
+
const bytes = readFileSync2(join2(dir, "contracts", "wirecat.json"));
|
|
160
|
+
const { wcat_manifest: format, desktop } = JSON.parse(bytes.toString("utf8"));
|
|
161
|
+
if (format !== 2 || typeof desktop !== "object" || desktop === null)
|
|
162
|
+
return void 0;
|
|
163
|
+
return { desktop, sha256: createHash("sha256").update(bytes).digest("hex") };
|
|
164
|
+
}
|
|
165
|
+
if (dirname2(dir) === dir)
|
|
166
|
+
return void 0;
|
|
167
|
+
}
|
|
168
|
+
} catch {
|
|
169
|
+
return void 0;
|
|
170
|
+
}
|
|
171
|
+
}, "shippedManifest");
|
|
172
|
+
|
|
173
|
+
// dist/bin/wordpress.js
|
|
174
|
+
enableCompileCache();
|
|
175
|
+
var stopCatching = catchCrashes({ cli: DESKTOP.command, interactive: process.stdout.isTTY === true });
|
|
176
|
+
var wcat = await wcatStart(DESKTOP);
|
|
177
|
+
if (wcat.code !== void 0) {
|
|
178
|
+
process.exitCode = wcat.code;
|
|
179
|
+
} else {
|
|
180
|
+
const { run } = await import("./program-EP2S5BTM.js");
|
|
181
|
+
process.exitCode = await run(process.argv.slice(2));
|
|
182
|
+
}
|
|
183
|
+
stopCatching();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ServiceApiOptions } from "@wirecat/cli-core/cli";
|
|
2
|
+
import type { Command } from "commander";
|
|
3
|
+
import { type ServiceEnvironment } from "../context.js";
|
|
4
|
+
/** The site this run's profile signed in to, as `session start --site` kept it beside the password. */
|
|
5
|
+
export declare const siteOf: (command: Command) => {
|
|
6
|
+
site: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The CLI's own hosts and the profile's site (WC-CMD-32), over the test's fake when it gives one. Sites under one host
|
|
10
|
+
* (host/blog, a multisite in subfolders) share it, so the sign-in goes only under the site's own /wp-json and drops on
|
|
11
|
+
* a redirect out of it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const serviceFetch: (environment: ServiceEnvironment, site: string) => import("@wirecat/cli-base/http").FetchLike;
|
|
14
|
+
/** The api group's options: its commands, and every write code sends through `serviceApiWriter`, use these alone. */
|
|
15
|
+
export declare const API_OPTIONS: ServiceApiOptions;
|
|
16
|
+
/**
|
|
17
|
+
* WordPress's REST API from the index, `api list`, `api show` and one command per route, through cli-core's shared
|
|
18
|
+
* group, sent to the profile's own site. Each write asks or refuses by `api.<operation>`; a publish, a scheduled date
|
|
19
|
+
* moved, a password taken off, a delete and a delete for good also by their keys.
|
|
20
|
+
*/
|
|
21
|
+
export declare const apiCommand: () => Command;
|
|
22
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/commands/api.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,iBAAiB,EAGvB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAAmB,KAAK,kBAAkB,EAAW,MAAM,eAAe,CAAA;AAGjF,uGAAuG;AACvG,eAAO,MAAM,MAAM;;CAAwD,CAAA;AAE3E;;;;GAIG;AACH,eAAO,MAAM,YAAY,gBAAiB,kBAAkB,QAAQ,MAAM,+CAKvE,CAAA;AAEH,qHAAqH;AACrH,eAAO,MAAM,WAAW,EAAE,iBAczB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,QAAO,OAAyC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { retrying } from "@wirecat/cli-base/http";
|
|
2
|
+
import { hostsFetch, manifestBaseUrl, serviceApiCommand, signedInSite, } from "@wirecat/cli-core/cli";
|
|
3
|
+
import { Pacer, pacePathFor } from "@wirecat/cli-core/sends";
|
|
4
|
+
import { API, configuration } from "../config.js";
|
|
5
|
+
import { contextOf, PACE, tokenOf } from "../context.js";
|
|
6
|
+
import { DESKTOP, IDENTITY } from "../identity.js";
|
|
7
|
+
/** The site this run's profile signed in to, as `session start --site` kept it beside the password. */
|
|
8
|
+
export const siteOf = signedInSite(IDENTITY, configuration.resolveSettings);
|
|
9
|
+
/**
|
|
10
|
+
* The CLI's own hosts and the profile's site (WC-CMD-32), over the test's fake when it gives one. Sites under one host
|
|
11
|
+
* (host/blog, a multisite in subfolders) share it, so the sign-in goes only under the site's own /wp-json and drops on
|
|
12
|
+
* a redirect out of it.
|
|
13
|
+
*/
|
|
14
|
+
export const serviceFetch = (environment, site) => hostsFetch([...new Set([...DESKTOP.hosts, new URL(`https://${site}`).hostname])], environment.fetch, manifestBaseUrl(API.manifest, undefined, { site }));
|
|
15
|
+
/** The api group's options: its commands, and every write code sends through `serviceApiWriter`, use these alone. */
|
|
16
|
+
export const API_OPTIONS = {
|
|
17
|
+
...API,
|
|
18
|
+
app: IDENTITY,
|
|
19
|
+
configuration,
|
|
20
|
+
serverVariables: siteOf,
|
|
21
|
+
fetch: (command) => {
|
|
22
|
+
const { environment, env, profile } = contextOf(command);
|
|
23
|
+
return retrying(serviceFetch(environment, siteOf(command).site), {
|
|
24
|
+
pacer: new Pacer(pacePathFor(IDENTITY, profile, env), PACE),
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
token: tokenOf,
|
|
28
|
+
schemas: () => import("../generated/schemas.js").then((module) => module.schemas),
|
|
29
|
+
definitions: () => import("../generated/definitions.js").then((module) => module.definitions),
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* WordPress's REST API from the index, `api list`, `api show` and one command per route, through cli-core's shared
|
|
33
|
+
* group, sent to the profile's own site. Each write asks or refuses by `api.<operation>`; a publish, a scheduled date
|
|
34
|
+
* moved, a password taken off, a delete and a delete for good also by their keys.
|
|
35
|
+
*/
|
|
36
|
+
export const apiCommand = () => serviceApiCommand(API_OPTIONS);
|
|
37
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/commands/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EACL,UAAU,EACV,eAAe,EAEf,iBAAiB,EACjB,YAAY,GACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,IAAI,EAA2B,OAAO,EAAE,MAAM,eAAe,CAAA;AACjF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAElD,uGAAuG;AACvG,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;AAE3E;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAA+B,EAAE,IAAY,EAAE,EAAE,CAC5E,UAAU,CACR,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EACrE,WAAW,CAAC,KAAK,EACjB,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CACnD,CAAA;AAEH,qHAAqH;AACrH,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,GAAG,GAAG;IACN,GAAG,EAAE,QAAQ;IACb,aAAa;IACb,eAAe,EAAE,MAAM;IACvB,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QACxD,OAAO,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE;YAC/D,KAAK,EAAE,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC;SAC5D,CAAC,CAAA;IACJ,CAAC;IACD,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;IACjF,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC;CAC9F,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAY,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/commands/content.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAyFnC,sHAAsH;AACtH,eAAO,MAAM,eAAe,QAAO,OAAO,EAIzC,CAAA"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
import { retrying } from "@wirecat/cli-base/http";
|
|
3
|
+
import { baseContext, recalledAccount, serviceApiCall, serviceApiWriter } from "@wirecat/cli-core/cli";
|
|
4
|
+
import { addContentCommands, contentSourceFromManifest, contentWriterFromManifest, } from "@wirecat/cli-core/content";
|
|
5
|
+
import { openCrmStore } from "@wirecat/cli-core/crm/cli";
|
|
6
|
+
import { Pacer, pacePathFor } from "@wirecat/cli-core/sends";
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
import { API, configuration } from "../config.js";
|
|
9
|
+
import { contextOf, PACE, tokenOf } from "../context.js";
|
|
10
|
+
import { SOURCE } from "../generated/wirecat-config.js";
|
|
11
|
+
import { IDENTITY } from "../identity.js";
|
|
12
|
+
import { API_OPTIONS, serviceFetch, siteOf } from "./api.js";
|
|
13
|
+
// Posts are not a kind the shared search reads yet, so the store gets no provider entry.
|
|
14
|
+
const openStore = async (env, { readOnly = false } = {}) => {
|
|
15
|
+
const { ensureSqlite } = await import("@wirecat/cli-core/sqlite-runtime");
|
|
16
|
+
await ensureSqlite();
|
|
17
|
+
const { openStore: open, storePath } = await import("@wirecat/cli-core/store");
|
|
18
|
+
return open({
|
|
19
|
+
path: storePath(env),
|
|
20
|
+
env,
|
|
21
|
+
command: IDENTITY.command,
|
|
22
|
+
version: IDENTITY.version,
|
|
23
|
+
...(readOnly ? { readOnly } : {}),
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
// The account is the one `session start` checked the password against; the store keeps each account's rows apart.
|
|
27
|
+
const accountOf = (command) => {
|
|
28
|
+
const { env, profile } = contextOf(command);
|
|
29
|
+
const account = recalledAccount(IDENTITY, SOURCE.provider, profile, env);
|
|
30
|
+
if (!account)
|
|
31
|
+
throw new CliError("authentication_error", `${profile} is not signed in; run ${IDENTITY.command} ${profile} session start`, {
|
|
32
|
+
reason: "auth.missing",
|
|
33
|
+
});
|
|
34
|
+
return account;
|
|
35
|
+
};
|
|
36
|
+
// Every write goes through the api group's own write path, with its keys: never a second door.
|
|
37
|
+
const write = serviceApiWriter(API_OPTIONS);
|
|
38
|
+
const open = async (command, { readOnly }) => {
|
|
39
|
+
const { env, profile, environment } = contextOf(command);
|
|
40
|
+
const { store, account } = await openCrmStore({
|
|
41
|
+
app: IDENTITY,
|
|
42
|
+
env,
|
|
43
|
+
profile,
|
|
44
|
+
readOnly,
|
|
45
|
+
provider: SOURCE.provider,
|
|
46
|
+
open: openStore,
|
|
47
|
+
account: () => accountOf(command),
|
|
48
|
+
});
|
|
49
|
+
let source;
|
|
50
|
+
// Built on first use: a command that only reads the store never reads the sign-in.
|
|
51
|
+
const sourceOf = () => {
|
|
52
|
+
if (source)
|
|
53
|
+
return source;
|
|
54
|
+
const { site } = siteOf(command);
|
|
55
|
+
const fetch = retrying(serviceFetch(environment, site), {
|
|
56
|
+
pacer: new Pacer(pacePathFor(IDENTITY, profile, env), PACE),
|
|
57
|
+
});
|
|
58
|
+
const call = serviceApiCall({
|
|
59
|
+
manifest: API.manifest,
|
|
60
|
+
service: API.service,
|
|
61
|
+
serverVariables: { site },
|
|
62
|
+
fetch,
|
|
63
|
+
token: () => tokenOf(command),
|
|
64
|
+
});
|
|
65
|
+
source = contentSourceFromManifest(SOURCE, { api: API.manifest, call, site });
|
|
66
|
+
return source;
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
account,
|
|
70
|
+
store,
|
|
71
|
+
env,
|
|
72
|
+
source: sourceOf,
|
|
73
|
+
writes: (invoked) => ({
|
|
74
|
+
writer: contentWriterFromManifest(SOURCE, {
|
|
75
|
+
api: API.manifest,
|
|
76
|
+
command: invoked,
|
|
77
|
+
source: sourceOf(),
|
|
78
|
+
// The keys the posts command already asked about are not asked again; deny and readonly still refuse.
|
|
79
|
+
write: (on, operation, input, confirmed) => write(on, operation, input, { confirmed }),
|
|
80
|
+
}),
|
|
81
|
+
app: IDENTITY,
|
|
82
|
+
env,
|
|
83
|
+
settings: () => baseContext(invoked, configuration.resolveSettings).settings,
|
|
84
|
+
}),
|
|
85
|
+
close: () => store.close(),
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/** cli-core's content commands over the source wirecat.config.ts describes: sync, posts, tags, users and channels. */
|
|
89
|
+
export const contentCommands = () => {
|
|
90
|
+
const holder = new Command(IDENTITY.command);
|
|
91
|
+
addContentCommands(holder, { app: IDENTITY, open, writes: SOURCE.writes !== undefined });
|
|
92
|
+
return [...holder.commands];
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/commands/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACtG,OAAO,EACL,kBAAkB,EAElB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAE5D,yFAAyF;AACzF,MAAM,SAAS,GAAG,KAAK,EAAE,GAAsB,EAAE,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,EAAE,EAAyB,EAAE;IACnG,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAA;IACzE,MAAM,YAAY,EAAE,CAAA;IACpB,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EA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,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC;aACvF,CAAC;YACF,GAAG,EAAE,QAAQ;YACb,GAAG;YACH,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC,QAAQ;SAC7E,CAAC;QACF,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE;KAC3B,CAAA;AACH,CAAC,CAAA;AAED,sHAAsH;AACtH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAc,EAAE;IAC7C,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC5C,kBAAkB,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC,CAAA;IACxF,OAAO,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC7B,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* `session start --site <address> --login <name> | status | end | list` (WC-ACCT-12): the WordPress application
|
|
4
|
+
* password is asked hidden, checked on that site by the call `auth.verify` names in wirecat.config.ts, and kept with
|
|
5
|
+
* the site, so it only ever goes there. The account is the id and name the answer holds.
|
|
6
|
+
*/
|
|
7
|
+
export declare const sessionCommand: () => Command;
|
|
8
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOxC;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAAO,OAgB9B,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { manifestVerify, tokenSessionCommand } from "@wirecat/cli-core/cli";
|
|
2
|
+
import { API, configuration } from "../config.js";
|
|
3
|
+
import { contextOf } from "../context.js";
|
|
4
|
+
import { VERIFY } from "../generated/wirecat-config.js";
|
|
5
|
+
import { IDENTITY } from "../identity.js";
|
|
6
|
+
import { serviceFetch } from "./api.js";
|
|
7
|
+
/**
|
|
8
|
+
* `session start --site <address> --login <name> | status | end | list` (WC-ACCT-12): the WordPress application
|
|
9
|
+
* password is asked hidden, checked on that site by the call `auth.verify` names in wirecat.config.ts, and kept with
|
|
10
|
+
* the site, so it only ever goes there. The account is the id and name the answer holds.
|
|
11
|
+
*/
|
|
12
|
+
export const sessionCommand = () => tokenSessionCommand({
|
|
13
|
+
app: IDENTITY,
|
|
14
|
+
service: API.service,
|
|
15
|
+
resolveSettings: configuration.resolveSettings,
|
|
16
|
+
token: "application password",
|
|
17
|
+
site: { example: "blog.example.com" },
|
|
18
|
+
login: { page: (site) => `https://${site}/wp-admin/profile.php#application-passwords-section` },
|
|
19
|
+
about: "Make an application password in your WordPress profile; it can do what your user can, no more.",
|
|
20
|
+
verify: manifestVerify({
|
|
21
|
+
manifest: API.manifest,
|
|
22
|
+
service: API.service,
|
|
23
|
+
verify: VERIFY,
|
|
24
|
+
// session start refuses a sign-in without --site before it checks one.
|
|
25
|
+
fetch: (command, site) => serviceFetch(contextOf(command).environment, site),
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3E,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAY,EAAE,CAC1C,mBAAmB,CAAC;IAClB,GAAG,EAAE,QAAQ;IACb,OAAO,EAAE,GAAG,CAAC,OAAO;IACpB,eAAe,EAAE,aAAa,CAAC,eAAe;IAC9C,KAAK,EAAE,sBAAsB;IAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE;IACrC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,IAAI,qDAAqD,EAAE;IAC/F,KAAK,EAAE,gGAAgG;IACvG,MAAM,EAAE,cAAc,CAAC;QACrB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,MAAM;QACd,uEAAuE;QACvE,KAAK,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,IAAc,CAAC;KACvF,CAAC;CACH,CAAC,CAAA"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Configuration } from "@wirecat/cli-core/cli";
|
|
2
|
+
export declare const API: {
|
|
3
|
+
manifest: {
|
|
4
|
+
servers: readonly import("@wirecat/cli-base/codegen").ApiServer[];
|
|
5
|
+
securitySchemes: Readonly<Record<string, import("@wirecat/cli-base/codegen").SecurityScheme>>;
|
|
6
|
+
security: readonly import("@wirecat/cli-base/codegen").SecurityRequirement[];
|
|
7
|
+
operations: import("@wirecat/cli-base/codegen").ManifestOperation[];
|
|
8
|
+
};
|
|
9
|
+
service: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const permissions: import("@wirecat/cli-core/cli").CommandPermissions;
|
|
12
|
+
export declare const configuration: Configuration;
|
|
13
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,uBAAuB,CAAA;AAqB9B,eAAO,MAAM,GAAG;;;;;;;;CASf,CAAA;AAqCD,eAAO,MAAM,WAAW,oDAOtB,CAAA;AAEF,eAAO,MAAM,aAAa,EAAE,aAAsD,CAAA"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { commandPermissions, serviceApiOperations, serviceApiPermissions, settingsFor, } from "@wirecat/cli-core/cli";
|
|
2
|
+
import { CONTENT_WRITE_DEFAULTS, CONTENT_WRITE_KEYS, contentAlsoChecks } from "@wirecat/cli-core/content";
|
|
3
|
+
import * as manifest from "./generated/manifest.js";
|
|
4
|
+
import { IDENTITY } from "./identity.js";
|
|
5
|
+
/**
|
|
6
|
+
* The operations the api group cannot offer are left out: one that answers with a credential (the CLI signs in
|
|
7
|
+
* through `session`) and a body it cannot send, such as a multipart form.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The content command each raw write does the same as, so `posts.create: deny` also stops `api posts-create` and
|
|
11
|
+
* `api pages-create` (WC-PERM-22). Deletes need no entry: the generator gave them `posts.delete` already.
|
|
12
|
+
*/
|
|
13
|
+
const COMMAND_KEYS = {
|
|
14
|
+
"posts-create": "posts.create",
|
|
15
|
+
"posts-update": "posts.update",
|
|
16
|
+
"pages-create": "posts.create",
|
|
17
|
+
"pages-update": "posts.update",
|
|
18
|
+
};
|
|
19
|
+
const offered = serviceApiOperations(manifest).offered;
|
|
20
|
+
export const API = {
|
|
21
|
+
manifest: {
|
|
22
|
+
...manifest,
|
|
23
|
+
operations: offered.map((operation) => {
|
|
24
|
+
const key = COMMAND_KEYS[operation.command];
|
|
25
|
+
return key ? { ...operation, permissions: [...(operation.permissions ?? []), { key }] } : operation;
|
|
26
|
+
}),
|
|
27
|
+
},
|
|
28
|
+
service: "WordPress",
|
|
29
|
+
};
|
|
30
|
+
const api = serviceApiPermissions(API);
|
|
31
|
+
/** The content commands write through the api group's operations, whose own keys the run checks too. */
|
|
32
|
+
const API_KEYS = {
|
|
33
|
+
"posts.create": "api.posts-create",
|
|
34
|
+
"posts.update": "api.posts-update",
|
|
35
|
+
"posts.publish": "api.posts-update",
|
|
36
|
+
"posts.unpublish": "api.posts-update",
|
|
37
|
+
};
|
|
38
|
+
// cli-core lets every api write but a delete run unasked. These install code, give a user a role, or change what
|
|
39
|
+
// every visitor sees, so they ask (WC-PERM-7: a CLI only tightens). A new comment is public at once.
|
|
40
|
+
const SITE_WIDE_WRITES = Object.fromEntries([
|
|
41
|
+
"plugins-create",
|
|
42
|
+
"settings-create",
|
|
43
|
+
"users-create",
|
|
44
|
+
"users-update",
|
|
45
|
+
"users-me-create",
|
|
46
|
+
"comments-create",
|
|
47
|
+
"comments-update",
|
|
48
|
+
"templates-create",
|
|
49
|
+
"template-parts-create",
|
|
50
|
+
"sidebars-update",
|
|
51
|
+
"widgets-create",
|
|
52
|
+
"widgets-update",
|
|
53
|
+
"menus-create",
|
|
54
|
+
"menus-update",
|
|
55
|
+
"menu-items-create",
|
|
56
|
+
"menu-items-update",
|
|
57
|
+
"navigation-create",
|
|
58
|
+
"navigation-update",
|
|
59
|
+
].map((command) => [`api.${command}`, "ask"]));
|
|
60
|
+
export const permissions = commandPermissions({
|
|
61
|
+
extra: [...new Set([...api.extra, ...CONTENT_WRITE_KEYS])],
|
|
62
|
+
alsoChecks: (path) => {
|
|
63
|
+
const own = API_KEYS[path.join(".")];
|
|
64
|
+
return [...api.alsoChecks(path), ...contentAlsoChecks(path), ...(own ? [own] : [])];
|
|
65
|
+
},
|
|
66
|
+
defaults: { ...api.defaults, ...SITE_WIDE_WRITES, ...CONTENT_WRITE_DEFAULTS },
|
|
67
|
+
});
|
|
68
|
+
export const configuration = settingsFor(IDENTITY, { permissions });
|
|
69
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,GACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AACzG,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC;;;GAGG;AACH;;;GAGG;AACH,MAAM,YAAY,GAAqC;IACrD,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,cAAc;CAC/B,CAAA;AAED,MAAM,OAAO,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAA;AACtD,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,QAAQ,EAAE;QACR,GAAG,QAAQ;QACX,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;YACpC,MAAM,GAAG,GAAG,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YAC3C,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,WAAW,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;QACrG,CAAC,CAAC;KACH;IACD,OAAO,EAAE,WAAW;CACrB,CAAA;AAED,MAAM,GAAG,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAA;AAEtC,wGAAwG;AACxG,MAAM,QAAQ,GAAqC;IAC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Q,EAAE,EAAE,WAAW,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type BaseEnvironment, type GlobalFlags, ProfileTokenStore } from "@wirecat/cli-core/cli";
|
|
2
|
+
import type { Command } from "commander";
|
|
3
|
+
/** What a test hands `run()` beside cli-core's own: the fake service in place of the network (WC-ARCH-10). */
|
|
4
|
+
export interface ServiceEnvironment extends BaseEnvironment {
|
|
5
|
+
fetch?: typeof fetch;
|
|
6
|
+
}
|
|
7
|
+
export declare const PACE: {
|
|
8
|
+
perMinute: number;
|
|
9
|
+
burst: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Settings, keyring and the run come from cli-core's `baseContext` and nowhere else: a command that resolves settings
|
|
13
|
+
* on its own skips `--timeout`, the run record and the profile's permissions (WC-LIFE-5, WC-LIFE-15).
|
|
14
|
+
*/
|
|
15
|
+
export declare const contextOf: (command: Command) => {
|
|
16
|
+
settings: import("@wirecat/cli-core/cli").Settings;
|
|
17
|
+
renderer: import("@wirecat/cli-base").Renderer;
|
|
18
|
+
format: import("@wirecat/cli-base").RenderFormat;
|
|
19
|
+
color: boolean;
|
|
20
|
+
streams: import("@wirecat/cli-base").Streams;
|
|
21
|
+
compact?: boolean;
|
|
22
|
+
full?: boolean;
|
|
23
|
+
env: NodeJS.ProcessEnv;
|
|
24
|
+
keyring?: import("@wirecat/cli-base").KeyringStore;
|
|
25
|
+
run: <T>(body: (events: import("@wirecat/cli-core/cli").EventSink) => Promise<T>, options?: {
|
|
26
|
+
unbounded?: boolean;
|
|
27
|
+
name?: string;
|
|
28
|
+
}) => Promise<T>;
|
|
29
|
+
track: (closeable: import("@wirecat/cli-core/cli").Closeable) => void;
|
|
30
|
+
environment: ServiceEnvironment;
|
|
31
|
+
flags: GlobalFlags;
|
|
32
|
+
profile: string;
|
|
33
|
+
tokens: ProfileTokenStore;
|
|
34
|
+
};
|
|
35
|
+
/** The profile's saved token, or an authentication error that says how to sign in. Read before any request. */
|
|
36
|
+
export declare const tokenOf: (command: Command) => string;
|
|
37
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EAGpB,KAAK,WAAW,EAChB,iBAAiB,EAElB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIxC,8GAA8G;AAC9G,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;CACrB;AAGD,eAAO,MAAM,IAAI;IAAK,SAAS;IAAO,KAAK;CAAM,CAAA;AAEjD;;;GAGG;AACH,eAAO,MAAM,SAAS,YAAa,OAAO;;;;;;;;;;;;;;;;;;;CAczC,CAAA;AAED,+GAA+G;AAC/G,eAAO,MAAM,OAAO,YAAa,OAAO,KAAG,MAI1C,CAAA"}
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { baseContext, environmentOf, ProfileTokenStore, refuseOffline, } from "@wirecat/cli-core/cli";
|
|
2
|
+
import { configuration } from "./config.js";
|
|
3
|
+
import { IDENTITY, SERVICE } from "./identity.js";
|
|
4
|
+
// WordPress sets no rate limit of its own; a host or a security plugin may. A person in the editor sends about this.
|
|
5
|
+
export const PACE = { perMinute: 120, burst: 20 };
|
|
6
|
+
/**
|
|
7
|
+
* Settings, keyring and the run come from cli-core's `baseContext` and nowhere else: a command that resolves settings
|
|
8
|
+
* on its own skips `--timeout`, the run record and the profile's permissions (WC-LIFE-5, WC-LIFE-15).
|
|
9
|
+
*/
|
|
10
|
+
export const contextOf = (command) => {
|
|
11
|
+
const base = baseContext(command, configuration.resolveSettings);
|
|
12
|
+
return {
|
|
13
|
+
...base,
|
|
14
|
+
environment: environmentOf(command),
|
|
15
|
+
flags: command.optsWithGlobals(),
|
|
16
|
+
profile: base.settings.profile,
|
|
17
|
+
tokens: new ProfileTokenStore({
|
|
18
|
+
app: IDENTITY,
|
|
19
|
+
env: base.env,
|
|
20
|
+
keyring: base.keyring,
|
|
21
|
+
warn: base.renderer.warn,
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** The profile's saved token, or an authentication error that says how to sign in. Read before any request. */
|
|
26
|
+
export const tokenOf = (command) => {
|
|
27
|
+
const { profile, tokens } = contextOf(command);
|
|
28
|
+
refuseOffline(command, SERVICE);
|
|
29
|
+
return tokens.need(profile);
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,aAAa,EAEb,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAOjD,qHAAqH;AACrH,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC5C,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;IAChE,OAAO;QACL,GAAG,IAAI;QACP,WAAW,EAAE,aAAa,CAAqB,OAAO,CAAC;QACvD,KAAK,EAAE,OAAO,CAAC,eAAe,EAAe;QAC7C,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO;QAC9B,MAAM,EAAE,IAAI,iBAAiB,CAAC;YAC5B,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,IAAI,CA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