wp-studio 1.7.10 → 1.7.11-beta1

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 (45) hide show
  1. package/dist/cli/{_events-BcapW3eh.mjs → _events-D_POEBYs.mjs} +4 -5
  2. package/dist/cli/appdata-D-luHxJU.mjs +19 -0
  3. package/dist/cli/{certificate-manager-SVYcCL_i.mjs → certificate-manager-v-yNLDFJ.mjs} +134 -15
  4. package/dist/cli/{delete-D1924O3o.mjs → delete-C4R7DV_E.mjs} +3 -3
  5. package/dist/cli/{helpers-oQuItT8n.mjs → helpers-CBl4GQzX.mjs} +2 -2
  6. package/dist/cli/{index-4lan3TI_.mjs → index-Bej4fL6n.mjs} +31 -4
  7. package/dist/cli/{index-DRQnCQvM.mjs → index-DYlrlauo.mjs} +1308 -1109
  8. package/dist/cli/{index-BjzOJKPi.mjs → index-jpyzVGrl.mjs} +90 -52
  9. package/dist/cli/{list-DOFyyV1f.mjs → list-BRllR-8H.mjs} +3 -3
  10. package/dist/cli/{login-BtPZeZ4G.mjs → login-CDVrFvfk.mjs} +3 -3
  11. package/dist/cli/{logout-Cr631QzG.mjs → logout-DLAXkbrZ.mjs} +2 -3
  12. package/dist/cli/main.mjs +2 -2
  13. package/dist/cli/{paths-CqXGLB7R.mjs → paths-D7DniT1Q.mjs} +7 -6
  14. package/dist/cli/plugin/skills/rank-me-up/SKILL.md +166 -0
  15. package/dist/cli/plugin/skills/site-spec/SKILL.md +4 -0
  16. package/dist/cli/process-manager-daemon.mjs +29 -5
  17. package/dist/cli/{process-manager-ipc-BisO0qtU.mjs → process-manager-ipc-GCdebuBH.mjs} +4 -1
  18. package/dist/cli/proxy-daemon.mjs +1 -1
  19. package/dist/cli/{prune-pm-logs-COryxqeo.mjs → prune-pm-logs-Dm_Bwi7l.mjs} +1 -1
  20. package/dist/cli/{resume-BwDwdJtq.mjs → resume-B8M2e-Ii.mjs} +4 -15
  21. package/dist/cli/{rewrite-wp-cli-post-content-2zlfFnKT.mjs → rewrite-wp-cli-post-content-Beo5_Ojo.mjs} +32 -531
  22. package/dist/cli/{set-D5eeqHbp.mjs → set-CizYT2gE.mjs} +2 -3
  23. package/dist/cli/{set-DYnzUz_G.mjs → set-_5ABvjxt.mjs} +4 -5
  24. package/dist/cli/{status-DNvMZBqD.mjs → status-D6Huwi6x.mjs} +2 -2
  25. package/dist/cli/well-known-paths-QcSJNi_l.mjs +95 -0
  26. package/dist/cli/wordpress-server-child.mjs +5 -3
  27. package/dist/cli/{wp-DD2-QiiP.mjs → wp-BevvZcM1.mjs} +2 -2
  28. package/dist/cli/wp-files/latest/available-site-translations.json +1 -1
  29. package/dist/cli/wp-files/sqlite-database-integration/admin-page.php +1 -2
  30. package/dist/cli/wp-files/sqlite-database-integration/constants.php +0 -5
  31. package/dist/cli/wp-files/sqlite-database-integration/load.php +1 -1
  32. package/dist/cli/wp-files/sqlite-database-integration/readme.txt +6 -3
  33. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/database/sqlite/class-wp-pdo-mysql-on-sqlite.php +22 -3
  34. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/database/version.php +1 -1
  35. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php +41 -89
  36. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/db.php +2 -24
  37. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/install-functions.php +7 -16
  38. package/package.json +2 -1
  39. package/dist/cli/well-known-paths-BYA1Bw5o.mjs +0 -214
  40. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-lexer.php +0 -2575
  41. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php +0 -899
  42. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-query-rewriter.php +0 -343
  43. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-token.php +0 -327
  44. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php +0 -4543
  45. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/php-polyfills.php +0 -68
@@ -3,9 +3,11 @@ import fs__default, { createWriteStream } from "fs";
3
3
  import path__default from "path";
4
4
  import readline from "readline";
5
5
  import semver from "semver";
6
- import { g as SocketServer, b as PROCESS_MANAGER_CONTROL_SOCKET_PATH, a as PROCESS_MANAGER_EVENTS_SOCKET_PATH, h as PROCESS_MANAGER_LOGS_DIR, i as daemonRequestSchema, f as daemonEventSchema } from "./process-manager-ipc-BisO0qtU.mjs";
6
+ import { g as SocketServer, b as PROCESS_MANAGER_CONTROL_SOCKET_PATH, a as PROCESS_MANAGER_EVENTS_SOCKET_PATH, h as PROCESS_MANAGER_LOGS_DIR, i as daemonRequestSchema, f as daemonEventSchema } from "./process-manager-ipc-GCdebuBH.mjs";
7
7
  const SOCKET_TIMEOUT_MS = 2500;
8
8
  const STOP_TIMEOUT_MS = 5e3;
9
+ const STDERR_BUFFER_MAX_LINES = 100;
10
+ const STDERR_BUFFER_MAX_BYTES = 16 * 1024;
9
11
  function formatLogDateTag(date) {
10
12
  const year = date.getFullYear();
11
13
  const month = String(date.getMonth() + 1).padStart(2, "0");
@@ -168,11 +170,15 @@ class ProcessManagerDaemon {
168
170
  stderrLogPath,
169
171
  stdoutStream,
170
172
  stderrStream,
173
+ stderrBuffer: [],
174
+ stderrBufferBytes: 0,
171
175
  settled: false
172
176
  };
173
177
  this.managedProcesses.set(pmId, managedProcess);
174
178
  this.pipeOutputWithTimestamp(child.stdout, stdoutStream);
175
- this.pipeOutputWithTimestamp(child.stderr, stderrStream);
179
+ this.pipeOutputWithTimestamp(child.stderr, stderrStream, (line) => {
180
+ this.recordStderrLine(managedProcess, line);
181
+ });
176
182
  child.on("message", (raw) => {
177
183
  const event = daemonEventSchema.safeParse({
178
184
  type: "process-message",
@@ -186,7 +192,11 @@ class ProcessManagerDaemon {
186
192
  }
187
193
  });
188
194
  child.on("error", (error) => {
189
- writeTimestampedLines(stderrStream, error.stack ?? error.message);
195
+ const errorText = error.stack ?? error.message;
196
+ writeTimestampedLines(stderrStream, errorText);
197
+ for (const line of errorText.split("\n")) {
198
+ this.recordStderrLine(managedProcess, line);
199
+ }
190
200
  void this.handleProcessExit(managedProcess);
191
201
  });
192
202
  child.on("exit", () => {
@@ -233,11 +243,13 @@ class ProcessManagerDaemon {
233
243
  this.managedProcesses.delete(managedProcess.pmId);
234
244
  managedProcess.stdoutStream.end();
235
245
  managedProcess.stderrStream.end();
246
+ const stderrTail = managedProcess.stderrBuffer.join("\n");
236
247
  await this.broadcastEvent({
237
248
  type: "process-event",
238
249
  payload: {
239
250
  process: { name: managedProcess.name, pm_id: managedProcess.pmId },
240
- event: "exit"
251
+ event: "exit",
252
+ ...stderrTail ? { stderrTail } : {}
241
253
  }
242
254
  });
243
255
  }
@@ -262,7 +274,7 @@ class ProcessManagerDaemon {
262
274
  async broadcastEvent(event) {
263
275
  this.eventsServer.broadcast(event);
264
276
  }
265
- pipeOutputWithTimestamp(input, target) {
277
+ pipeOutputWithTimestamp(input, target, onLine) {
266
278
  if (!input) {
267
279
  return;
268
280
  }
@@ -272,8 +284,20 @@ class ProcessManagerDaemon {
272
284
  });
273
285
  lineReader.on("line", (line) => {
274
286
  void target.write(timestampLogLine(line));
287
+ onLine?.(line);
275
288
  });
276
289
  }
290
+ recordStderrLine(managedProcess, line) {
291
+ managedProcess.stderrBuffer.push(line);
292
+ managedProcess.stderrBufferBytes += Buffer.byteLength(line, "utf8") + 1;
293
+ while (managedProcess.stderrBuffer.length > STDERR_BUFFER_MAX_LINES || managedProcess.stderrBufferBytes > STDERR_BUFFER_MAX_BYTES) {
294
+ const dropped = managedProcess.stderrBuffer.shift();
295
+ if (dropped === void 0) {
296
+ break;
297
+ }
298
+ managedProcess.stderrBufferBytes -= Buffer.byteLength(dropped, "utf8") + 1;
299
+ }
300
+ }
277
301
  toProcessDescription(managedProcess) {
278
302
  if (managedProcess.status === "stopped") {
279
303
  return {
@@ -417,7 +417,10 @@ const processEventSchema = z.object({
417
417
  z.literal("online"),
418
418
  z.literal("restart"),
419
419
  z.literal("stop")
420
- ])
420
+ ]),
421
+ // Tail of the child's stderr captured during this invocation. Only populated on `exit`
422
+ // events; undefined for any other event.
423
+ stderrTail: z.string().optional()
421
424
  });
422
425
  const daemonProcessEventSchema = z.object({
423
426
  type: z.literal("process-event"),
@@ -3,7 +3,7 @@ import require$$1 from "https";
3
3
  import { createSecureContext } from "node:tls";
4
4
  import { domainToASCII } from "node:url";
5
5
  import httpProxy from "http-proxy";
6
- import { i as generateSiteCertificate, r as readCliConfig } from "./certificate-manager-SVYcCL_i.mjs";
6
+ import { n as generateSiteCertificate, r as readCliConfig } from "./certificate-manager-v-yNLDFJ.mjs";
7
7
  let httpProxyServer = null;
8
8
  let httpsProxyServer = null;
9
9
  let isHttpProxyRunning = false;
@@ -1,6 +1,6 @@
1
1
  import fs__default from "fs";
2
2
  import path__default from "path";
3
- import { h as PROCESS_MANAGER_LOGS_DIR } from "./process-manager-ipc-BisO0qtU.mjs";
3
+ import { h as PROCESS_MANAGER_LOGS_DIR } from "./process-manager-ipc-GCdebuBH.mjs";
4
4
  const RETENTION_DAYS = 14;
5
5
  const MS_PER_DAY = 24 * 60 * 60 * 1e3;
6
6
  const LOG_FILE_REGEX = /^.+-(?:out|error)(?:-\d{8})?\.log$/;
@@ -1,8 +1,8 @@
1
- import { l as listAiSessions, g as getAiSessionsRootDirectory, a as loadAiSession } from "./paths-CqXGLB7R.mjs";
1
+ import { l as listAiSessions, g as getAiSessionsRootDirectory, a as loadAiSession } from "./paths-D7DniT1Q.mjs";
2
2
  import { __ } from "@wordpress/i18n";
3
- import { J as JsonAdapter, A as AiChatUI, r as runCommand$1 } from "./index-BjzOJKPi.mjs";
4
- import { c as chooseSessionForAction } from "./helpers-oQuItT8n.mjs";
5
- import { L as LoggerError, d as Logger } from "./well-known-paths-BYA1Bw5o.mjs";
3
+ import { J as JsonAdapter, A as AiChatUI, r as runCommand$1 } from "./index-jpyzVGrl.mjs";
4
+ import { c as chooseSessionForAction } from "./helpers-CBl4GQzX.mjs";
5
+ import { L as LoggerError, c as Logger } from "./certificate-manager-v-yNLDFJ.mjs";
6
6
  function resolveActiveSiteFromEvents(events) {
7
7
  let state;
8
8
  for (const event of events) {
@@ -14,17 +14,6 @@ function resolveActiveSiteFromEvents(events) {
14
14
  url: event.url,
15
15
  wpcomSiteId: event.wpcomSiteId
16
16
  };
17
- continue;
18
- }
19
- if (event.type === "environment.selected" && state) {
20
- const isLive = event.environment === "live";
21
- state = {
22
- name: state.name,
23
- path: state.path,
24
- remote: isLive,
25
- url: isLive ? event.url : void 0,
26
- wpcomSiteId: isLive ? event.wpcomSiteId : void 0
27
- };
28
17
  }
29
18
  }
30
19
  return state;