main
1import type { ArtifactsNamespace } from '../public.ts';
2import type { PackMap } from './packmap.ts';
4export type FilterName = 'tree:0' | 'blob:none';
6export type ServerInfo = {
7 agent: string;
8 protocol: number;
9 objectFormat: string;
10 caps: string[];
11 fetchFeatures: string[];
12 filterAdvertised: boolean;
13};
15export type CommitInfo = {
16 oid: string;
17 tree: string;
18 parents: string[];
19 authorName: string;
20 authorEmail: string;
21 authorTime: string;
22 authorTz: string;
23 message: string;
24 signed: boolean;
25};
27export type TreeEntry = { name: string; mode: string; oid: string; type: string };
29export type BranchInfo = { name: string; oid: string; head: boolean };
31export type TagInfo = { name: string; oid: string };
33export type TraceBar = {
34 name: string;
35 startMs: number;
36 durMs: number;
37 status: 'ok' | 'error';
38 httpStatus: number | null;
39 bytes: number | null;
40 cache: string;
41 lines: string[];
42 packWant: string | null;
43 packFilter: FilterName | null;
44};
46/** ?trace=1: render the Diagnostics section open. A missing flag stays closed. */
47type TraceOpen = Partial<{ expanded: boolean }>;
49export type TraceModel = {
50 bars: TraceBar[];
51 totalMs: number;
52 cfRay: string;
53 requestId: string;
54} & TraceOpen;
56export type RepoHeader = {
57 host: string;
58 repoPath: string;
59 ref: string;
60 commit: string;
61 treeHref: string;
62 server: ServerInfo;
63};
65export type Loaded =
66 | {
67 kind: 'tree';
68 header: RepoHeader;
69 path: string;
70 commit: CommitInfo;
71 log: CommitInfo[];
72 logStopped: boolean;
73 branches: BranchInfo[];
74 branchesTruncated: number;
75 tags: TagInfo[];
76 tagsTruncated: number;
77 entries: TreeEntry[];
78 entriesTruncated: number;
79 readme: { name: string; text: string } | { name: string; tooBig: true } | null;
80 }
81 | {
82 kind: 'file';
83 header: RepoHeader;
84 path: string;
85 branches: BranchInfo[];
86 branchesTruncated: number;
87 tags: TagInfo[];
88 tagsTruncated: number;
89 mode: string;
90 blob: string;
91 size: number;
92 note: 'text' | 'binary' | 'too-big' | 'submodule';
93 text: string | null;
94 }
95 | { kind: 'raw'; filename: string; bytes: Uint8Array; size: number }
96 | {
97 kind: 'pack';
98 header: RepoHeader;
99 want: string;
100 filterRequested: FilterName;
101 filterHonoured: FilterName;
102 map: PackMap;
103 offset: number | null;
104 askedOfsDelta: true;
105 askedThinPack: false;
106 };
108export type RateDecision = { ok: boolean; remaining: number; retryAfterMs: number };
110export type RateNamespace = {
111 idFromName(name: string): unknown;
112 get(id: unknown): { admit(bucket: string, now: number, limit: number, windowMs: number): Promise<RateDecision> | RateDecision };
113};
115export type ViewerEnv = Partial<{
116 VIEWER_RATE: RateNamespace;
117 /** Artifacts binding for the public namespace (cloudflare.config.ts). Mints read tokens; nothing else is called. */
118 PUBLIC_REPOS: ArtifactsNamespace;
119 /** Comma-separated exact hostnames appended to the built-in allowlist. Wildcards are ignored. */
120 VIEWER_EXTRA_HOSTS: string;
121 VIEWER_RATE_PER_MIN: string;
122 /** `memo` (default), `batched` or `legacy` (docs/rate-limit.md). Anything else is legacy. */
123 RATE_MODE: string;
124 /** The batched limiter's one counter (src/rate/counter.ts). */
125 RATE_COUNTER: import('../rate/stub.ts').CounterNamespace;
126 /** The /v1 bearer. The viewer never reads it: load-test headers are unlocked by PLY_LOAD_TOKEN alone. */
127 PLY_TOKEN: string;
128 /** Read only to authenticate load-test headers (src/rate/admit.ts). Never forwarded or echoed by the viewer. */
129 PLY_LOAD_TOKEN: string;
130 VIEWER_PACK_RATE_PER_MIN: string;
131 PACK_CACHE: string;
132 /** `watched`: public-namespace refs are cached long and purged on change (src/refs-watch.ts). Anything else: 5 s + 10 s. */
133 REFS_POLICY: string;
134 /** Workers version metadata (cloudflare.config.ts). Its id is the `ply.script_version` on the viewer's ply spans. */
135 VERSION: { readonly id: string };
136}>;
Diagnostics4 git calls · 304 ms
CallStatusSizeTime0304 ms
discover200152 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200145 B · hit4 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=4 git.response.bytes=145 git.response.cache=HIT git.response.duration_ms=4 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=145 git.pkt.payload.max=76 git.ls_refs.count=2 git.ls_refs.head=refs/heads/main
fetchblob:none · deepen 1020040 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=41349 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=526b305930b8ef382f2d7a1f9c0238730a585921 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=6 git.pkt.data=4 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=41349 git.pkt.payload.max=41254 git.sideband.band1.bytes=41253 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=61 git.pack.bytes=41253 git.pack.ofs_delta=0 git.pack.ref_delta=0 git.pack.chain.max=0 git.pack.trailer=ab60efef4b7243678c75de64a4386986ee885c1c git.pack.full=61Open pack map
fetch2001.6 KiB298 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=298 git.response.bytes=1591 git.response.cache=MISS git.response.duration_ms=298 git.fetch.wants=7f70b10976f49301665b661f973932e3b0d0e5a4 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=1591 git.pkt.payload.max=1570 git.sideband.band1.bytes=1569 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/ply-web.git
- Ref
- refs/heads/main
- Commit
- 526b305930b8ef382f2d7a1f9c0238730a585921
- cf-ray
- a5e2eb9e0f0e4bc2
- Request
- 1714f0f7…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format