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.
- package/dist/cli/{_events-BcapW3eh.mjs → _events-D_POEBYs.mjs} +4 -5
- package/dist/cli/appdata-D-luHxJU.mjs +19 -0
- package/dist/cli/{certificate-manager-SVYcCL_i.mjs → certificate-manager-v-yNLDFJ.mjs} +134 -15
- package/dist/cli/{delete-D1924O3o.mjs → delete-C4R7DV_E.mjs} +3 -3
- package/dist/cli/{helpers-oQuItT8n.mjs → helpers-CBl4GQzX.mjs} +2 -2
- package/dist/cli/{index-4lan3TI_.mjs → index-Bej4fL6n.mjs} +31 -4
- package/dist/cli/{index-DRQnCQvM.mjs → index-DYlrlauo.mjs} +1308 -1109
- package/dist/cli/{index-BjzOJKPi.mjs → index-jpyzVGrl.mjs} +90 -52
- package/dist/cli/{list-DOFyyV1f.mjs → list-BRllR-8H.mjs} +3 -3
- package/dist/cli/{login-BtPZeZ4G.mjs → login-CDVrFvfk.mjs} +3 -3
- package/dist/cli/{logout-Cr631QzG.mjs → logout-DLAXkbrZ.mjs} +2 -3
- package/dist/cli/main.mjs +2 -2
- package/dist/cli/{paths-CqXGLB7R.mjs → paths-D7DniT1Q.mjs} +7 -6
- package/dist/cli/plugin/skills/rank-me-up/SKILL.md +166 -0
- package/dist/cli/plugin/skills/site-spec/SKILL.md +4 -0
- package/dist/cli/process-manager-daemon.mjs +29 -5
- package/dist/cli/{process-manager-ipc-BisO0qtU.mjs → process-manager-ipc-GCdebuBH.mjs} +4 -1
- package/dist/cli/proxy-daemon.mjs +1 -1
- package/dist/cli/{prune-pm-logs-COryxqeo.mjs → prune-pm-logs-Dm_Bwi7l.mjs} +1 -1
- package/dist/cli/{resume-BwDwdJtq.mjs → resume-B8M2e-Ii.mjs} +4 -15
- package/dist/cli/{rewrite-wp-cli-post-content-2zlfFnKT.mjs → rewrite-wp-cli-post-content-Beo5_Ojo.mjs} +32 -531
- package/dist/cli/{set-D5eeqHbp.mjs → set-CizYT2gE.mjs} +2 -3
- package/dist/cli/{set-DYnzUz_G.mjs → set-_5ABvjxt.mjs} +4 -5
- package/dist/cli/{status-DNvMZBqD.mjs → status-D6Huwi6x.mjs} +2 -2
- package/dist/cli/well-known-paths-QcSJNi_l.mjs +95 -0
- package/dist/cli/wordpress-server-child.mjs +5 -3
- package/dist/cli/{wp-DD2-QiiP.mjs → wp-BevvZcM1.mjs} +2 -2
- package/dist/cli/wp-files/latest/available-site-translations.json +1 -1
- package/dist/cli/wp-files/sqlite-database-integration/admin-page.php +1 -2
- package/dist/cli/wp-files/sqlite-database-integration/constants.php +0 -5
- package/dist/cli/wp-files/sqlite-database-integration/load.php +1 -1
- package/dist/cli/wp-files/sqlite-database-integration/readme.txt +6 -3
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/database/sqlite/class-wp-pdo-mysql-on-sqlite.php +22 -3
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/database/version.php +1 -1
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php +41 -89
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/db.php +2 -24
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/install-functions.php +7 -16
- package/package.json +2 -1
- package/dist/cli/well-known-paths-BYA1Bw5o.mjs +0 -214
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-lexer.php +0 -2575
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php +0 -899
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-query-rewriter.php +0 -343
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-token.php +0 -327
- package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php +0 -4543
- 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-
|
|
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
|
-
|
|
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 {
|
|
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-
|
|
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-
|
|
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-
|
|
4
|
-
import { c as chooseSessionForAction } from "./helpers-
|
|
5
|
-
import { L as LoggerError,
|
|
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;
|