my-durable 0.0.114 → 0.0.116
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/apps/dpi-backend/src/diagnostics.ts +12 -1
- package/apps/dpi-backend/src/git.ts +32 -8
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-CRTYV5V2.js +83 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/{index-lji31QeB.css → index-DD66rPUN.css} +1 -1
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/index.html +2 -2
- package/apps/dpi-playground/apps/dpi-playground-fe/src/client/composables.ts +29 -2
- package/apps/dpi-playground/apps/dpi-playground-fe/src/client/markdown.ts +7 -2
- package/apps/dpi-playground/apps/dpi-playground-fe/src/components/GitPanel.vue +11 -8
- package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TunnelStatusBar.vue +5 -1
- package/apps/dpi-playground/apps/dpi-playground-hub/src/main.ts +12 -2
- package/apps/dpi-playground/apps/dpi-playground-hub/src/mux.ts +20 -3
- package/apps/dpi-sdk/src/client.ts +53 -2
- package/apps/dpi-sdk/src/node/ops.ts +6 -2
- package/apps/dpi-sdk/src/node/private-file.ts +34 -1
- package/apps/dpi-sdk/src/node/registry.ts +5 -1
- package/package.json +1 -1
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-DrpVM1aK.js +0 -83
|
@@ -253,9 +253,20 @@ function diagnosticsDoctorIo(io: DiagnosticsIo): DoctorIo {
|
|
|
253
253
|
env: io.env,
|
|
254
254
|
nodeVersion: io.nodeVersion,
|
|
255
255
|
// doctor's FetchLike wants json(); this io speaks text() — adapt, never reimplement.
|
|
256
|
+
// r10 h2-1: the adapter used to res.text() the WHOLE body — the doctor
|
|
257
|
+
// section was the one diagnostics read that bypassed the R9 byte caps
|
|
258
|
+
// ("duration is not a byte budget"). Route through the capped reader.
|
|
256
259
|
fetchImpl: async (url, init) => {
|
|
257
260
|
const res = await io.fetch(url, init);
|
|
258
|
-
return {
|
|
261
|
+
return {
|
|
262
|
+
ok: res.ok,
|
|
263
|
+
status: res.status,
|
|
264
|
+
json: async () => {
|
|
265
|
+
const raw = await readCappedBody(res, API_BODY_MAX_BYTES);
|
|
266
|
+
if (raw.length > API_BODY_MAX_BYTES) throw Error(`doctor body over ${API_BODY_MAX_BYTES} bytes`);
|
|
267
|
+
return JSON.parse(raw);
|
|
268
|
+
},
|
|
269
|
+
};
|
|
259
270
|
},
|
|
260
271
|
access: io.accessSync,
|
|
261
272
|
exists: io.existsSync,
|
|
@@ -165,13 +165,20 @@ export function parseRemote(url?: string): ParsedRemote | undefined {
|
|
|
165
165
|
path = path.replace(/\/+$/, "").replace(/\.git$/, "");
|
|
166
166
|
if (!host || !path) return undefined;
|
|
167
167
|
const h = host.toLowerCase();
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
// r10 h2-6: forge classification is EXACT (host or subdomain of the known
|
|
169
|
+
// forge, or a dedicated DNS label for self-hosted gitlab/bitbucket). The old
|
|
170
|
+
// substring regexes matched github.com.evil.com → GitHub-styled PR buttons
|
|
171
|
+
// on lookalike hosts. A host carrying '@' (scp-form with two @) is never real.
|
|
172
|
+
if (h.includes("@")) return undefined;
|
|
173
|
+
const labels = h.split(".").filter(Boolean);
|
|
174
|
+
const forge: Forge =
|
|
175
|
+
h === "github.com" || h.endsWith(".github.com")
|
|
176
|
+
? "github"
|
|
177
|
+
: h === "gitlab.com" || h.endsWith(".gitlab.com") || labels.includes("gitlab")
|
|
178
|
+
? "gitlab"
|
|
179
|
+
: h === "bitbucket.org" || h.endsWith(".bitbucket.org") || labels.includes("bitbucket")
|
|
180
|
+
? "bitbucket"
|
|
181
|
+
: "other";
|
|
175
182
|
const scheme = /^http:\/\//.test(raw) ? "http" : "https";
|
|
176
183
|
return { host, path, forge, webUrl: `${scheme}://${host}/${path}` };
|
|
177
184
|
}
|
|
@@ -569,7 +576,24 @@ async function statusOnce(path: string, key: string): Promise<GitStatus> {
|
|
|
569
576
|
// resolve an identity at all. That is the only case worth warning about.
|
|
570
577
|
out.identityComplete = Boolean(identMatch?.[1]?.trim() && identMatch?.[2]?.trim());
|
|
571
578
|
if (!out.identityComplete) delete out.identity;
|
|
572
|
-
if (remoteP.status === "fulfilled")
|
|
579
|
+
if (remoteP.status === "fulfilled") {
|
|
580
|
+
out.remoteUrl = remoteP.value.trim() || undefined;
|
|
581
|
+
// r10 h2-5: `git remote get-url origin` echoes credential-bearing URLs
|
|
582
|
+
// verbatim (https://user:PAT@forge/…) to every token-holding viewer.
|
|
583
|
+
// Strip userinfo before the value enters status responses and caches.
|
|
584
|
+
if (out.remoteUrl) {
|
|
585
|
+
try {
|
|
586
|
+
const u = new URL(out.remoteUrl);
|
|
587
|
+
if (u.username || u.password) {
|
|
588
|
+
u.username = "";
|
|
589
|
+
u.password = "";
|
|
590
|
+
out.remoteUrl = u.toString();
|
|
591
|
+
}
|
|
592
|
+
} catch {
|
|
593
|
+
/* ssh/scp form: no password syntax */
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
573
597
|
const parsed = parseRemote(out.remoteUrl);
|
|
574
598
|
if (parsed) {
|
|
575
599
|
out.forge = parsed.forge;
|