@zabaca/zbc 0.19.1 → 0.21.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/LICENSE +21 -0
- package/package.json +2 -1
- package/src/utils/copy-template.ts +37 -0
- package/templates/apps/inbox/package.json +1 -0
- package/templates/apps/secret-relay/package.json +1 -0
- package/templates/apps/walgit/CONTEXT.md +12 -0
- package/templates/apps/walgit/README.md +73 -2
- package/templates/apps/walgit/assets/agentgit-mark.svg +1 -0
- package/templates/apps/walgit/assets/agentgit-og.png +0 -0
- package/templates/apps/walgit/package.json +6 -1
- package/templates/apps/walgit/registry.json +1 -1
- package/templates/apps/walgit/shared/analytics.ts +100 -0
- package/templates/apps/walgit/shared/favicon.ts +72 -0
- package/templates/apps/walgit/shared/landing.ts +82 -9
- package/templates/apps/walgit/shared/llms.ts +16 -0
- package/templates/apps/walgit/shared/mcp.ts +286 -0
- package/templates/apps/walgit/shared/og-image.ts +51 -0
- package/templates/apps/walgit/shared/protocol.ts +20 -0
- package/templates/apps/walgit/shared/telemetry.ts +86 -2
- package/templates/apps/walgit/worker/assets.d.ts +13 -0
- package/templates/apps/walgit/worker/index.ts +173 -3
- package/templates/apps/walgit/worker/mcp.ts +281 -0
- package/templates/apps/walgit/wrangler.jsonc +10 -0
- package/templates/apps/warehouse/package.json +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zabaca
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zabaca/zbc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Zabaca stack CLI — scaffold and deploy infrastructure",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"CHANGELOG.md",
|
|
12
|
+
"LICENSE",
|
|
12
13
|
"bin",
|
|
13
14
|
"src",
|
|
14
15
|
"templates",
|
|
@@ -25,6 +25,29 @@ function substitute(body: string, vars: Record<string, string>): string {
|
|
|
25
25
|
})
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Extensions a template may carry that are bytes rather than source. Kept as an
|
|
30
|
+
* allow-list rather than sniffed: a template tree is ours, so what is in it is
|
|
31
|
+
* known, and a guess that reads a source file as binary would silently stop
|
|
32
|
+
* substituting its `{{VARS}}`.
|
|
33
|
+
*/
|
|
34
|
+
const BINARY_TEMPLATE_EXTENSIONS = new Set([
|
|
35
|
+
'.png',
|
|
36
|
+
'.jpg',
|
|
37
|
+
'.jpeg',
|
|
38
|
+
'.gif',
|
|
39
|
+
'.webp',
|
|
40
|
+
'.avif',
|
|
41
|
+
'.ico',
|
|
42
|
+
'.woff',
|
|
43
|
+
'.woff2',
|
|
44
|
+
'.pdf',
|
|
45
|
+
])
|
|
46
|
+
|
|
47
|
+
function isBinaryTemplate(sourcePath: string): boolean {
|
|
48
|
+
return BINARY_TEMPLATE_EXTENSIONS.has(path.extname(sourcePath).toLowerCase())
|
|
49
|
+
}
|
|
50
|
+
|
|
28
51
|
/**
|
|
29
52
|
* Copy a single template file. Returns true if written, false if skipped.
|
|
30
53
|
* Always logs the action.
|
|
@@ -42,6 +65,20 @@ export async function copyTemplateFile(
|
|
|
42
65
|
return false
|
|
43
66
|
}
|
|
44
67
|
|
|
68
|
+
// A binary template is copied as bytes, not as text. Every template was text
|
|
69
|
+
// until walgit's `assets/agentgit-og.png` — the card its Worker serves — and
|
|
70
|
+
// reading a file as UTF-8 and writing the string back does not round-trip:
|
|
71
|
+
// the bytes that are not valid UTF-8 come out as U+FFFD, so the scaffolded
|
|
72
|
+
// PNG is not a PNG. Substitution is skipped too, deliberately: `{{VARS}}` is
|
|
73
|
+
// a source-text convention and a match inside compressed bytes would be
|
|
74
|
+
// damage rather than configuration.
|
|
75
|
+
if (isBinaryTemplate(sourcePath)) {
|
|
76
|
+
await fs.mkdir(path.dirname(destPath), { recursive: true })
|
|
77
|
+
await Bun.write(destPath, Bun.file(sourcePath))
|
|
78
|
+
console.log(` write ${path.relative(process.cwd(), destPath)}`)
|
|
79
|
+
return true
|
|
80
|
+
}
|
|
81
|
+
|
|
45
82
|
let body = await Bun.file(sourcePath).text()
|
|
46
83
|
if (opts.vars) body = substitute(body, opts.vars)
|
|
47
84
|
|
|
@@ -197,3 +197,15 @@ not exist at all on a deployment that does not offer Proposals. *Superseded* is
|
|
|
197
197
|
deliberately not reported: ADR-0018 admits it only if the same walk yields it
|
|
198
198
|
free, and it does not.
|
|
199
199
|
_Avoid_: list endpoint, PR list, the proposals API
|
|
200
|
+
|
|
201
|
+
## The MCP endpoint
|
|
202
|
+
|
|
203
|
+
**MCP Endpoint**:
|
|
204
|
+
`/_walgit/mcp` — a Model Context Protocol server over Streamable HTTP, answered at the edge on every deployment (`shared/mcp.ts`, transported by `worker/mcp.ts`). The rule that decides what belongs on it: **it carries only what the host can answer without the agent's disk** — `agentgit_status` (a name's existence, its Claim, its Reader List, its refs), `agentgit_watch` (block until a ref moves), `agentgit_provenance` (who signed the push that moved one), and the manual as the resource `agentgit://manual`. Accepting a Proposal, writing a credential helper and fetching into a clone act on a tree the host cannot see, so they stay client commands.
|
|
205
|
+
_Avoid_: "the API" — it is one more way to ask the questions the existing routes answer, not a second surface with its own answers.
|
|
206
|
+
|
|
207
|
+
**The gate is not copied**:
|
|
208
|
+
The MCP reads reach the host's own gated routes rather than re-deciding anything: `agentgit_status` and `agentgit_provenance` go through `PROVENANCE_PATH` (the deployment credential, then the Read Challenge on a Private name), and `agentgit_watch` subscribes to the **Fan-out** the way a **Watch** client does. A refusal is forwarded verbatim and is the *whole* answer — a Private name an unproven reader asked about leaks no refs, no existence and no lists alongside its 401, which is the property `info/refs` has.
|
|
209
|
+
|
|
210
|
+
**The watch cap**:
|
|
211
|
+
`agentgit_watch` holds a Worker request open, so the five-minute deadline is the **host's** and not the caller's: a longer `timeoutMs` is clamped, not honoured. Reaching it answers `{ timedOut: true }` — an answer, never an error — and calling again loses nothing, because a **Ref Event** is latest state and the next call is current state rather than a replay (ADR-0009).
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<img src="assets/agentgit-mark.svg" alt="" width="72" height="72">
|
|
2
|
+
|
|
1
3
|
# walgit
|
|
2
4
|
|
|
3
5
|
A git host where **object storage holds the write-ahead log and is the source of
|
|
@@ -91,13 +93,21 @@ come from the log only, because two records of one fact disagree the first time
|
|
|
91
93
|
a write fails between them.
|
|
92
94
|
|
|
93
95
|
Each datapoint carries, as blobs: `kind` (`clone-advertise`, `clone`,
|
|
94
|
-
`push-advertise`, `push`, `instructions`, `
|
|
96
|
+
`push-advertise`, `push`, `instructions`, `landing`, `og-image`, `favicon`,
|
|
97
|
+
`provenance`, `health`, `other`), `outcome`
|
|
95
98
|
(`ok`/`reject`), `reject`, `repo`, `temperature` (`cold`/`warm`), `answered`
|
|
96
|
-
(`container`/`edge`)
|
|
99
|
+
(`container`/`edge`), `bucket`; and as doubles: `status`, `ttfb_ms`, `total_ms`,
|
|
97
100
|
`bytes_served`, `bytes_received`, `cold`. The index is `kind`, so refusals — the
|
|
98
101
|
rare thing an operator is hunting — are sampled independently of clones, the
|
|
99
102
|
loud thing.
|
|
100
103
|
|
|
104
|
+
`bucket` (blob7) is the shape of an **unroutable** path, and is written only for
|
|
105
|
+
`kind = other`, empty everywhere else: one of `favicon`, `apple-touch`,
|
|
106
|
+
`well-known`, `dotfile`, `php`, `bare-name`, `else`. It exists because the
|
|
107
|
+
dataset records no path on purpose — a path is attacker-controlled and unbounded
|
|
108
|
+
— which left a burst of 404s unattributable. A bucket name is bounded, so the
|
|
109
|
+
question "what are these?" is a `GROUP BY` rather than a guess.
|
|
110
|
+
|
|
101
111
|
Refusals are counted **by kind**, never as an error rate, because the kinds mean
|
|
102
112
|
different things: `size-cap` (abuse or a misconfigured client), `collision` (a
|
|
103
113
|
product signal about naming), `unauthorized`, `not-found`, `unavailable`, and
|
|
@@ -125,6 +135,14 @@ SELECT blob1 AS kind, blob3 AS reject, count() AS n, sum(double4) AS bytes_serve
|
|
|
125
135
|
FROM walgit_requests WHERE timestamp > now() - INTERVAL '24' HOUR GROUP BY kind, reject
|
|
126
136
|
```
|
|
127
137
|
|
|
138
|
+
And what the 404s actually are:
|
|
139
|
+
|
|
140
|
+
```sql
|
|
141
|
+
SELECT blob7 AS bucket, sum(_sample_interval) AS n
|
|
142
|
+
FROM walgit_requests WHERE index1 = 'other' AND timestamp > now() - INTERVAL '24' HOUR
|
|
143
|
+
GROUP BY bucket
|
|
144
|
+
```
|
|
145
|
+
|
|
128
146
|
It runs where the app's environment is — inside the container, or anywhere the
|
|
129
147
|
same `WALGIT_*` variables are set:
|
|
130
148
|
|
|
@@ -416,6 +434,47 @@ A repository is created on first contact: pushing to a name nobody has used
|
|
|
416
434
|
creates it, with `receive.unpackLimit=0` so even a tiny push is retained as a
|
|
417
435
|
packfile (what the WAL will upload).
|
|
418
436
|
|
|
437
|
+
### The MCP endpoint
|
|
438
|
+
|
|
439
|
+
`/_walgit/mcp` is a Model Context Protocol server over Streamable HTTP
|
|
440
|
+
(`shared/mcp.ts` builds it, `worker/mcp.ts` transports it), answered at the edge
|
|
441
|
+
on every deployment. An MCP client reaches it by URL — nothing to install,
|
|
442
|
+
nothing to spawn:
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
claude mcp add --transport http agentgit https://<worker-host>/_walgit/mcp
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
It carries only what the host can answer **without the agent's disk**:
|
|
449
|
+
|
|
450
|
+
| tool | what it answers |
|
|
451
|
+
| --- | --- |
|
|
452
|
+
| `agentgit_status` | does a name exist, is it claimed, is it private, and its refs |
|
|
453
|
+
| `agentgit_watch` | blocks until a ref moves; `{ ref, sha }` or `{ timedOut: true }`, capped at five minutes per call |
|
|
454
|
+
| `agentgit_provenance` | which key signed the push that moved a ref |
|
|
455
|
+
|
|
456
|
+
plus `agentgit://manual` as a resource — the same `renderLlms` output `/llms.txt`
|
|
457
|
+
serves, from the same capabilities.
|
|
458
|
+
|
|
459
|
+
The gate is the host's own and never a second copy: `status` and `provenance`
|
|
460
|
+
both go through the container's `PROVENANCE_PATH`, which already sits behind
|
|
461
|
+
exactly the credential a clone needs and already applies the Read Challenge for
|
|
462
|
+
a Private name, so an unproven reader is refused there and the refusal is
|
|
463
|
+
forwarded verbatim. `watch` subscribes to the ref-event Durable Object exactly
|
|
464
|
+
as a WebSocket client does, so the Reader List is judged by the same code that
|
|
465
|
+
judges a subscription — and it needs the event stream configured, saying so
|
|
466
|
+
where it is not.
|
|
467
|
+
|
|
468
|
+
Which means `status` and `provenance` **do** wake the container, and `status`
|
|
469
|
+
twice (the gated provenance read, then `REFS_PATH`). Refs are authoritative in
|
|
470
|
+
the Index, the Index is reachable only with the container's object-store
|
|
471
|
+
credentials, and the gate is the container's — an edge answer would need a
|
|
472
|
+
second verifier and a second reader, which is what
|
|
473
|
+
[ADR-0013](../../../../../docs/adr/0013-a-name-can-refuse-a-stranger-reading.md)
|
|
474
|
+
and [ADR-0007](../../../../../docs/adr/0007-walgit-object-storage-holds-the-log.md)
|
|
475
|
+
each refuse. The protocol itself, `agentgit_watch` and the manual are answered
|
|
476
|
+
at the edge and touch it not at all.
|
|
477
|
+
|
|
419
478
|
## Deployment
|
|
420
479
|
|
|
421
480
|
Through the `cloudflare` module, never by hand — `zbc apply <env>`. The Worker
|
|
@@ -475,6 +534,18 @@ nobody reads (`operatorFrom`, `shared/operator.ts`). A contact that is an email
|
|
|
475
534
|
address or an `https://` URL is rendered as a link on the page; anything else is
|
|
476
535
|
rendered as text.
|
|
477
536
|
|
|
537
|
+
`WALGIT_POSTHOG_KEY` turns on **browser analytics** on the landing page, and
|
|
538
|
+
`WALGIT_POSTHOG_HOST` says where to send them (PostHog Cloud US unless set —
|
|
539
|
+
usually set to a reverse proxy on the deployment's own name, with
|
|
540
|
+
`WALGIT_POSTHOG_UI_HOST` naming the PostHog region the project lives in).
|
|
541
|
+
Edge-only for the same reason as the operator pair: the container renders
|
|
542
|
+
nothing a browser runs. The edge telemetry above already counts page views and
|
|
543
|
+
records nothing about who made them; this is for the questions it cannot
|
|
544
|
+
answer — referrer, scroll depth, return visits — once traffic is real. The
|
|
545
|
+
snippet creates no profile for an anonymous reader; session replay follows
|
|
546
|
+
the PostHog project's own setting. Unset, the page carries no script at all (`analyticsFrom`,
|
|
547
|
+
`shared/analytics.ts`).
|
|
548
|
+
|
|
478
549
|
For the three boolean flags — `WALGIT_APPEND_ONLY`, `WALGIT_PUBLIC` and
|
|
479
550
|
`WALGIT_SIGNER_LISTS` — **on means `1` or `true`, and nothing else**
|
|
480
551
|
(`flagEnabled`, `shared/policy.ts`). An unrecognised value (`yes`, `on`, `TRUE`)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="7" fill="#ede6de"/><g transform="translate(1 1) scale(.9375)"><path stroke="#14100e" fill="none" stroke-width="4.5" d="M9 25V9M9 13c0 6 14 3 14 11"/><circle fill="#14100e" cx="9" cy="8" r="5"/><circle fill="#14100e" cx="9" cy="25" r="5"/><rect fill="#c56a3e" x="17.5" y="18.5" width="11" height="11" rx="2"/></g></svg>
|
|
Binary file
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zbc/walgit",
|
|
3
|
+
"license": "MIT",
|
|
3
4
|
"version": "0.0.1",
|
|
4
5
|
"private": true,
|
|
5
6
|
"type": "module",
|
|
@@ -17,7 +18,11 @@
|
|
|
17
18
|
"deploy": "wrangler deploy"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
|
-
"
|
|
21
|
+
"@hono/mcp": "^0.3.1",
|
|
22
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
23
|
+
"aws4fetch": "^1.0.20",
|
|
24
|
+
"hono": "^4.12.30",
|
|
25
|
+
"zod": "^4.4.3"
|
|
21
26
|
},
|
|
22
27
|
"devDependencies": {
|
|
23
28
|
"@cloudflare/containers": "^0.3.7",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
],
|
|
18
18
|
"signupUrl": "https://dash.cloudflare.com/sign-up",
|
|
19
19
|
"tokenUrl": "https://dash.cloudflare.com/profile/api-tokens",
|
|
20
|
-
"instructions": "STATUS: the front door and the push path are deployable — a Cloudflare Worker proxying to a Durable-Object-bound Container that serves git smart-HTTP, with every push persisted to the write-ahead log in object storage before it is acknowledged and linearized by compare-and-swap on index.json. The bare repos on the container's filesystem are a cache, reconciled against the log on every access and materialized from it when the objects a ref needs are absent. A repo whose cache is gone is rebuilt from the log on first access — not disaster recovery but the normal path, since the container sleeps when idle and its disk is wiped completely on every restart. The log is compacted in the background: once a repo accumulates WALGIT_COMPACTION_THRESHOLD (default 50) un-superseded entries, a post-receive hook hands a detached process a `git repack -adf` whose single pack is published as one WAL entry under a per-repo lease, so a cold restore replays one entry however many pushes the repo has taken. Superseded entries and the packs rejected pushes leave behind are deleted only after WALGIT_GC_GRACE_MS (default one hour), never immediately — a restore that read index.json a moment before a compaction is still downloading what that compaction superseded, and deleting it out from under that restore fails silently. Both knobs are optional environment variables, not secrets.\n\nTRANSPORT: smart-HTTP only. walgit used to also serve SSH, which needed raw inbound TCP and is why it ran on Fly (docs/adr/0006 in the zbc repository); no Cloudflare product delivers raw inbound TCP, so the SSH transport was removed rather than kept on a second host. Clients send the token as the Basic-auth password: `git clone https://walgit:$TOKEN@<worker-host>/myrepo.git`. A repository is created on first push to a name nobody has used.\n\nDEPLOYMENT: through the `cloudflare` module. `wrangler deploy` builds the container image from this package's Dockerfile, so Docker must be running at apply time and the account must be on a Workers Paid plan with Containers enabled. Set `immediateContainerRollout: true` on the instance — wrangler's gradual rollout never drains a single always-warm container, so a redeployed image otherwise never takes effect until it idle-sleeps. That flag covers the IMAGE only; a deploy that changes only forwarded env vars produces no new container version to roll, and the container reads its environment once at start — so the Durable Object fingerprints the environment it would boot with, keeps it in DO storage, and destroys the running container the first time the two differ (reconcileEnv in worker/index.ts). Changing a var therefore costs one container restart on the next request and takes effect immediately. CLOUDFLARE_API_TOKEN needs Workers Scripts: Edit and Containers: Edit. Trap when tearing one down: `wrangler delete` on the Worker does NOT delete its container application — that needs a separate `wrangler containers delete`, or the instances stay live.\n\nCONFIGURATION: the container runs outside the Worker's binding graph, so it reads the store over the S3 API rather than through an r2 binding, and it can only be told about it via environment variables the Worker forwards (CONTAINER_ENV in shared/container-env.ts). Wire these as the cloudflare instance's `workerSecrets`: WALGIT_HTTP_TOKENS (comma-separated bearer tokens, comma-separated so a credential can be rotated without a window where neither works), and the log's home — WALGIT_S3_ENDPOINT, WALGIT_S3_BUCKET, WALGIT_S3_ACCESS_KEY_ID and WALGIT_S3_SECRET_ACCESS_KEY, from an r2 module instance's S3-API credentials. Without those four the host still serves reads from its local cache but REFUSES every push — accepting one it cannot persist is the single failure this app exists to prevent. A secret that is not in that forward list reaches the Worker and stops there.\n\nOPERATOR CLI: src/cli.ts — `bun src/cli.ts <serve|materialize|verify|gc|compact>`, run inside the container so it reads the same credentials the app does; there is no separate config file. `verify` is read-only and exits non-zero when the disk disagrees with index.json; `gc` reclaims superseded and orphaned objects and only reports unless given --yes; `compact` forces a compaction now rather than waiting for the threshold, and `--force=false` asks whether one is due without causing it.\n\nREF EVENTS: optional, off unless configured. Set WALGIT_EVENTS_URL (the deployment's own public origin) and WALGIT_EVENTS_TOKEN (a shared secret, wired as a workerSecret and forwarded to the container) and walgit serves a WebSocket at /_walgit/events: a client sends {\"watch\":[{\"repo\":\"my-thing\",\"refs\":[\"refs/heads/main\"]}]}, is answered with the current sha of each watched ref, and is then sent the new sha every time one moves (sha null is a deletion; an omitted refs list watches every ref in that repository). Subscribing takes exactly the credential a read takes, so a public deployment has a public stream. Events are latest state, not a log — no cursor, no since, no sequence number on the wire; a reconnecting client gets current state in its handshake. The push path announces from post-receive, which git runs only after the compare-and-swap on index.json won, so a push that lost is never announced; the announcement is authenticated, bounded, and can never fail a push. With either variable unset the endpoint does not exist."
|
|
20
|
+
"instructions": "STATUS: the front door and the push path are deployable — a Cloudflare Worker proxying to a Durable-Object-bound Container that serves git smart-HTTP, with every push persisted to the write-ahead log in object storage before it is acknowledged and linearized by compare-and-swap on index.json. The bare repos on the container's filesystem are a cache, reconciled against the log on every access and materialized from it when the objects a ref needs are absent. A repo whose cache is gone is rebuilt from the log on first access — not disaster recovery but the normal path, since the container sleeps when idle and its disk is wiped completely on every restart. The log is compacted in the background: once a repo accumulates WALGIT_COMPACTION_THRESHOLD (default 50) un-superseded entries, a post-receive hook hands a detached process a `git repack -adf` whose single pack is published as one WAL entry under a per-repo lease, so a cold restore replays one entry however many pushes the repo has taken. Superseded entries and the packs rejected pushes leave behind are deleted only after WALGIT_GC_GRACE_MS (default one hour), never immediately — a restore that read index.json a moment before a compaction is still downloading what that compaction superseded, and deleting it out from under that restore fails silently. Both knobs are optional environment variables, not secrets.\n\nTRANSPORT: smart-HTTP only. walgit used to also serve SSH, which needed raw inbound TCP and is why it ran on Fly (docs/adr/0006 in the zbc repository); no Cloudflare product delivers raw inbound TCP, so the SSH transport was removed rather than kept on a second host. Clients send the token as the Basic-auth password: `git clone https://walgit:$TOKEN@<worker-host>/myrepo.git`. A repository is created on first push to a name nobody has used.\n\nDEPLOYMENT: through the `cloudflare` module. `wrangler deploy` builds the container image from this package's Dockerfile, so Docker must be running at apply time and the account must be on a Workers Paid plan with Containers enabled. Set `immediateContainerRollout: true` on the instance — wrangler's gradual rollout never drains a single always-warm container, so a redeployed image otherwise never takes effect until it idle-sleeps. That flag covers the IMAGE only; a deploy that changes only forwarded env vars produces no new container version to roll, and the container reads its environment once at start — so the Durable Object fingerprints the environment it would boot with, keeps it in DO storage, and destroys the running container the first time the two differ (reconcileEnv in worker/index.ts). Changing a var therefore costs one container restart on the next request and takes effect immediately. CLOUDFLARE_API_TOKEN needs Workers Scripts: Edit and Containers: Edit. Trap when tearing one down: `wrangler delete` on the Worker does NOT delete its container application — that needs a separate `wrangler containers delete`, or the instances stay live.\n\nCONFIGURATION: the container runs outside the Worker's binding graph, so it reads the store over the S3 API rather than through an r2 binding, and it can only be told about it via environment variables the Worker forwards (CONTAINER_ENV in shared/container-env.ts). Wire these as the cloudflare instance's `workerSecrets`: WALGIT_HTTP_TOKENS (comma-separated bearer tokens, comma-separated so a credential can be rotated without a window where neither works), and the log's home — WALGIT_S3_ENDPOINT, WALGIT_S3_BUCKET, WALGIT_S3_ACCESS_KEY_ID and WALGIT_S3_SECRET_ACCESS_KEY, from an r2 module instance's S3-API credentials. Without those four the host still serves reads from its local cache but REFUSES every push — accepting one it cannot persist is the single failure this app exists to prevent. A secret that is not in that forward list reaches the Worker and stops there.\n\nOPERATOR CLI: src/cli.ts — `bun src/cli.ts <serve|materialize|verify|gc|compact>`, run inside the container so it reads the same credentials the app does; there is no separate config file. `verify` is read-only and exits non-zero when the disk disagrees with index.json; `gc` reclaims superseded and orphaned objects and only reports unless given --yes; `compact` forces a compaction now rather than waiting for the threshold, and `--force=false` asks whether one is due without causing it.\n\nREF EVENTS: optional, off unless configured. Set WALGIT_EVENTS_URL (the deployment's own public origin) and WALGIT_EVENTS_TOKEN (a shared secret, wired as a workerSecret and forwarded to the container) and walgit serves a WebSocket at /_walgit/events: a client sends {\"watch\":[{\"repo\":\"my-thing\",\"refs\":[\"refs/heads/main\"]}]}, is answered with the current sha of each watched ref, and is then sent the new sha every time one moves (sha null is a deletion; an omitted refs list watches every ref in that repository). Subscribing takes exactly the credential a read takes, so a public deployment has a public stream. Events are latest state, not a log — no cursor, no since, no sequence number on the wire; a reconnecting client gets current state in its handshake. The push path announces from post-receive, which git runs only after the compare-and-swap on index.json won, so a push that lost is never announced; the announcement is authenticated, bounded, and can never fail a push. With either variable unset the endpoint does not exist.\n\nMCP: the deployment answers the Model Context Protocol at /_walgit/mcp (Streamable HTTP), at the edge and on every deployment — there is no variable to set and nothing to install. `claude mcp add --transport http agentgit https://<host>/_walgit/mcp`. It carries only what the host can answer without the caller's disk: agentgit_status (does a name exist, is it claimed, is it private, and its refs), agentgit_watch (blocks until a ref moves, five minutes per call), agentgit_provenance (which key signed the push that moved a ref), and the /llms.txt manual as the resource agentgit://manual. agentgit_status and agentgit_provenance read through the same gate a clone passes, so a Private name refuses an unproven reader exactly as info/refs does; agentgit_watch needs the ref-event stream above and says so where it is unconfigured."
|
|
21
21
|
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser analytics on the landing page, or none.
|
|
3
|
+
*
|
|
4
|
+
* `shared/telemetry.ts` already counts every request at the edge, page views
|
|
5
|
+
* included, and records nothing about who made them — no IP, no user agent —
|
|
6
|
+
* by design. That answers "how many", and it cannot answer what a launch page
|
|
7
|
+
* actually needs to know once traffic is real: where a reader came from,
|
|
8
|
+
* whether they scrolled to the clone command, whether the same person came
|
|
9
|
+
* back. Those are browser questions, and a browser tool answers them.
|
|
10
|
+
*
|
|
11
|
+
* Off unless the instance says otherwise. The project key is a public,
|
|
12
|
+
* write-only token — it lands in the page source of every PostHog site — but
|
|
13
|
+
* WHICH project is an instance's business, not the template's: this package
|
|
14
|
+
* ships to other companies, and a hard-coded key would send their readers to
|
|
15
|
+
* ours. So the key and host are two edge-only variables, read here the way
|
|
16
|
+
* `shared/operator.ts` reads its two, and the page carries no script at all
|
|
17
|
+
* when the key is unset. Edge-only for the same reason the operator is: the
|
|
18
|
+
* container serves nothing a browser renders, and putting the key on
|
|
19
|
+
* `CONTAINER_ENV` would restart the container to rotate it.
|
|
20
|
+
*
|
|
21
|
+
* What the snippet is told: no person profiles for anonymous readers. Session
|
|
22
|
+
* replay is left to the PostHog project's own setting — the page has no forms
|
|
23
|
+
* and nothing to type into, so a recording shows scrolling and clicks and
|
|
24
|
+
* PostHog's default input masking covers the rest. Turned on 2026-09-18 after
|
|
25
|
+
* shipping off for a day; an operator who wants it off again sets it off in
|
|
26
|
+
* the project, not here.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** The variables analytics is read from, and only those. */
|
|
30
|
+
export type AnalyticsVar = 'WALGIT_POSTHOG_KEY' | 'WALGIT_POSTHOG_HOST' | 'WALGIT_POSTHOG_UI_HOST'
|
|
31
|
+
|
|
32
|
+
/** An environment named exactly by those variables — see `OperatorEnv`. */
|
|
33
|
+
export type AnalyticsEnv = Partial<Record<AnalyticsVar, string>>
|
|
34
|
+
|
|
35
|
+
export type Analytics = {
|
|
36
|
+
/** The PostHog project API key, `phc_…`. */
|
|
37
|
+
key: string
|
|
38
|
+
/**
|
|
39
|
+
* The ingestion origin. PostHog Cloud US unless the instance says EU,
|
|
40
|
+
* self-hosted, or — the usual reason to set it — a reverse proxy on the
|
|
41
|
+
* deployment's own name, so a browser sees one first-party origin.
|
|
42
|
+
*/
|
|
43
|
+
host: string
|
|
44
|
+
/**
|
|
45
|
+
* The PostHog app the project lives in. Only matters when `host` is a
|
|
46
|
+
* proxy: the SDK needs it to reach the toolbar and the app's own endpoints,
|
|
47
|
+
* which the proxy does not carry. Harmless otherwise.
|
|
48
|
+
*/
|
|
49
|
+
uiHost: string
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const DEFAULT_POSTHOG_HOST = 'https://us.i.posthog.com'
|
|
53
|
+
export const DEFAULT_POSTHOG_UI_HOST = 'https://us.posthog.com'
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The `defaults` date the SDK is initialised with — PostHog's own mechanism
|
|
57
|
+
* for shipping new default behaviour without breaking an existing snippet.
|
|
58
|
+
* Bump deliberately, after reading what changed.
|
|
59
|
+
*/
|
|
60
|
+
export const POSTHOG_DEFAULTS = '2026-05-30'
|
|
61
|
+
|
|
62
|
+
/** Read an environment into an analytics config, or `null` for "off". */
|
|
63
|
+
export function analyticsFrom(
|
|
64
|
+
env: AnalyticsEnv | Record<string, string | undefined>,
|
|
65
|
+
): Analytics | null {
|
|
66
|
+
const key = trimmed(env.WALGIT_POSTHOG_KEY)
|
|
67
|
+
if (key === null) return null
|
|
68
|
+
return {
|
|
69
|
+
key,
|
|
70
|
+
host: trimmed(env.WALGIT_POSTHOG_HOST) ?? DEFAULT_POSTHOG_HOST,
|
|
71
|
+
uiHost: trimmed(env.WALGIT_POSTHOG_UI_HOST) ?? DEFAULT_POSTHOG_UI_HOST,
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The `<script>` the head carries, or the empty string.
|
|
77
|
+
*
|
|
78
|
+
* PostHog's own loader stub, verbatim from their docs, then `init`. The two
|
|
79
|
+
* values are interpolated as JSON string literals, so a key or host containing
|
|
80
|
+
* a quote cannot close the literal early — both come from an operator's own
|
|
81
|
+
* config, but "cannot" is cheaper than "would not".
|
|
82
|
+
*/
|
|
83
|
+
export function analyticsScript(analytics: Analytics | null): string {
|
|
84
|
+
if (analytics === null) return ''
|
|
85
|
+
const key = JSON.stringify(analytics.key)
|
|
86
|
+
const host = JSON.stringify(analytics.host)
|
|
87
|
+
const uiHost = JSON.stringify(analytics.uiHost)
|
|
88
|
+
return (
|
|
89
|
+
'<script>\n' +
|
|
90
|
+
'!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="init capture register register_once register_for_session unregister unregister_for_session getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey getNextSurveyStep identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty createPersonProfile opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing clear_opt_in_out_capturing debug".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);\n' +
|
|
91
|
+
`posthog.init(${key},{api_host:${host},ui_host:${uiHost},defaults:"${POSTHOG_DEFAULTS}",person_profiles:"identified_only"});\n` +
|
|
92
|
+
'</script>\n'
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const trimmed = (raw: string | undefined): string | null => {
|
|
97
|
+
if (raw === undefined) return null
|
|
98
|
+
const value = raw.trim()
|
|
99
|
+
return value === '' ? null : value
|
|
100
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/favicon.ico` and the touch icons — the requests a browser makes without
|
|
3
|
+
* being asked.
|
|
4
|
+
*
|
|
5
|
+
* The head already carries the mark as a data URI (`shared/landing.ts`), which
|
|
6
|
+
* is enough for Chrome and Firefox and is not enough for anyone else: Safari,
|
|
7
|
+
* most link unfurlers and every feed reader ask for `/favicon.ico` regardless.
|
|
8
|
+
* Until this module existed those requests fell through to the container and
|
|
9
|
+
* came back 404 — during the 2026-09-18 launch burst, ~282 of them in two
|
|
10
|
+
* hours, tracking landing page views nearly one for one. Every one was a
|
|
11
|
+
* container round trip for a file the edge can answer from a string constant.
|
|
12
|
+
*
|
|
13
|
+
* So the same shape `shared/robots.ts` and `shared/og-image.ts` have: this
|
|
14
|
+
* module states the paths, the methods and the headers, the Worker owns the
|
|
15
|
+
* response. Runtime-neutral (docs/adr/0010), so a test reaches it with no
|
|
16
|
+
* runtime.
|
|
17
|
+
*
|
|
18
|
+
* No collision with a repository, the same argument the other two make:
|
|
19
|
+
* smart-HTTP paths are `/<name>.git/…`, so a repository literally called
|
|
20
|
+
* `favicon.ico` is reached at `/favicon.ico.git/…` and is untouched by this
|
|
21
|
+
* route.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { MARK_SVG } from './landing'
|
|
25
|
+
|
|
26
|
+
/** The one icon path every client asks for whatever the head says. */
|
|
27
|
+
export const FAVICON_PATH = '/favicon.ico'
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The two paths iOS and macOS ask for when a page is bookmarked, neither of
|
|
31
|
+
* which is declared in the head. There is no raster to serve them, and a
|
|
32
|
+
* missing one is not an error worth a body — see `TOUCH_ICON_STATUS`.
|
|
33
|
+
*/
|
|
34
|
+
export const TOUCH_ICON_PATHS = ['/apple-touch-icon.png', '/apple-touch-icon-precomposed.png']
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The bytes are the mark the head inlines, read from the one constant, so the
|
|
38
|
+
* tab icon and the masthead cannot drift apart.
|
|
39
|
+
*
|
|
40
|
+
* Served as SVG under a `.ico` name deliberately: the extension is what clients
|
|
41
|
+
* request, and every client that requests it honours the `content-type` over
|
|
42
|
+
* the name. An actual ICO would be a second rendering of the same mark to keep
|
|
43
|
+
* in sync, which is the thing this whole file exists to avoid.
|
|
44
|
+
*/
|
|
45
|
+
export const FAVICON_BODY = MARK_SVG
|
|
46
|
+
export const FAVICON_CONTENT_TYPE = 'image/svg+xml'
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 204: there is no raster, and a 404 is what the browser retries. A no-content
|
|
50
|
+
* answer is the cheapest way to say "there is nothing here, stop asking", and
|
|
51
|
+
* with the cache header below it is asked once a day rather than once a page.
|
|
52
|
+
*/
|
|
53
|
+
export const TOUCH_ICON_STATUS = 204
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A day, for the same reason the card's picture gets one (`shared/og-image.ts`):
|
|
57
|
+
* the mark states no capability and no limit, so nothing in it can outlive a
|
|
58
|
+
* config change, and this is exactly the traffic worth absorbing at the edge.
|
|
59
|
+
*/
|
|
60
|
+
export const ICON_CACHE_CONTROL = 'public, max-age=86400'
|
|
61
|
+
|
|
62
|
+
/** Only GET or HEAD on the one path. A POST to it is git, and falls through. */
|
|
63
|
+
export function wantsFavicon(method: string, pathname: string): boolean {
|
|
64
|
+
if (method !== 'GET' && method !== 'HEAD') return false
|
|
65
|
+
return pathname === FAVICON_PATH
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Only GET or HEAD on the two touch-icon paths. */
|
|
69
|
+
export function wantsTouchIcon(method: string, pathname: string): boolean {
|
|
70
|
+
if (method !== 'GET' && method !== 'HEAD') return false
|
|
71
|
+
return TOUCH_ICON_PATHS.includes(pathname)
|
|
72
|
+
}
|
|
@@ -50,7 +50,9 @@
|
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
52
|
import type { Capabilities } from './capabilities'
|
|
53
|
+
import { analyticsScript, type Analytics } from './analytics'
|
|
53
54
|
import { contactHref, type Operator } from './operator'
|
|
55
|
+
import { OG_IMAGE_HEIGHT, OG_IMAGE_PATH, OG_IMAGE_WIDTH } from './og-image'
|
|
54
56
|
import { describeBytes, describeWindow } from './policy'
|
|
55
57
|
import { EVENTS_PATH, SIGNERS_REF } from './protocol'
|
|
56
58
|
import { CONTENT_SIGNAL } from './robots'
|
|
@@ -1086,9 +1088,16 @@ export function renderLanding(
|
|
|
1086
1088
|
* fixture that is not about the operator wants to say.
|
|
1087
1089
|
*/
|
|
1088
1090
|
operator: Operator | null = null,
|
|
1091
|
+
/**
|
|
1092
|
+
* Browser analytics (`shared/analytics.ts`), beside the operator for the
|
|
1093
|
+
* same reason: nothing branches on it, the manual never carries it, and a
|
|
1094
|
+
* deployment that configured none renders a page with no script at all.
|
|
1095
|
+
*/
|
|
1096
|
+
analytics: Analytics | null = null,
|
|
1089
1097
|
): string {
|
|
1090
1098
|
return (
|
|
1091
1099
|
PAGE.replaceAll('{{HOST}}', () => host)
|
|
1100
|
+
.replace('{{ANALYTICS}}', () => analyticsScript(analytics))
|
|
1092
1101
|
// `replaceAll`, because the sentence written to travel now travels in
|
|
1093
1102
|
// three places: the description, the Open Graph card and the Twitter card.
|
|
1094
1103
|
// One rendering, substituted thrice — not three strings to keep in step.
|
|
@@ -1154,6 +1163,45 @@ const WIRE_CLIENT = `
|
|
|
1154
1163
|
});
|
|
1155
1164
|
`
|
|
1156
1165
|
|
|
1166
|
+
/**
|
|
1167
|
+
* The mark, once — three commits, and the newest one is a square.
|
|
1168
|
+
*
|
|
1169
|
+
* Two people on the trunk, an agent on the branch: the graph git already
|
|
1170
|
+
* draws, with the one node this host exists for drawn differently. Painted in
|
|
1171
|
+
* the page's own palette (bone tile, ground ink, copper agent) so it holds on
|
|
1172
|
+
* a light tab strip and a dark one without a second asset. Concept sheet: the
|
|
1173
|
+
* "three nodes" mark, framing L, 2026-09-18. The source of truth for the
|
|
1174
|
+
* geometry is `assets/agentgit-mark.svg`, which this is a transcription of and
|
|
1175
|
+
* which the og card is rendered from.
|
|
1176
|
+
*
|
|
1177
|
+
* ONE constant because the mark now appears twice on this page — as the
|
|
1178
|
+
* favicon and in the masthead — and a logo kept in two places drifts, starting
|
|
1179
|
+
* with the copy nobody looks at closely.
|
|
1180
|
+
*/
|
|
1181
|
+
const MARK_GEOMETRY = `<rect width="32" height="32" rx="7" fill="#ede6de"/><g transform="translate(1 1) scale(.9375)"><path stroke="#14100e" fill="none" stroke-width="4.5" d="M9 25V9M9 13c0 6 14 3 14 11"/><circle fill="#14100e" cx="9" cy="8" r="5"/><circle fill="#14100e" cx="9" cy="25" r="5"/><rect fill="#c56a3e" x="17.5" y="18.5" width="11" height="11" rx="2"/></g>`
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* The mark as a standalone document. Exported because `/favicon.ico` is now a
|
|
1185
|
+
* route too (`shared/favicon.ts`) — the clients that ignore the tag below ask
|
|
1186
|
+
* for that path whatever the head says — and the tag and the route must be the
|
|
1187
|
+
* same picture, so they read one constant.
|
|
1188
|
+
*/
|
|
1189
|
+
export const MARK_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">${MARK_GEOMETRY}</svg>`
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* The favicon, inline as a data URI as well as a route: the tag costs no
|
|
1193
|
+
* request for the browsers that honour it, and `shared/favicon.ts` catches the
|
|
1194
|
+
* ones that ask for `/favicon.ico` regardless.
|
|
1195
|
+
*/
|
|
1196
|
+
const MARK_FAVICON_HREF = `data:image/svg+xml,${encodeURIComponent(MARK_SVG)}`
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* The masthead's copy. Inline, so it is there on the first paint and costs no
|
|
1200
|
+
* request, and `aria-hidden` because the wordmark it sits beside already says
|
|
1201
|
+
* the name — a screen reader announcing both would say it twice.
|
|
1202
|
+
*/
|
|
1203
|
+
const MARK_INLINE = `<svg class="mark" viewBox="0 0 32 32" aria-hidden="true" focusable="false">${MARK_GEOMETRY}</svg>`
|
|
1204
|
+
|
|
1157
1205
|
const PAGE = `<!doctype html>
|
|
1158
1206
|
<html lang="en">
|
|
1159
1207
|
<head>
|
|
@@ -1172,25 +1220,38 @@ const PAGE = `<!doctype html>
|
|
|
1172
1220
|
that says something the page does not is the drift every rendered claim
|
|
1173
1221
|
here exists to prevent, so the description below is the SAME rendering,
|
|
1174
1222
|
not a second copy of it.
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1223
|
+
The picture is the mark, rendered once and committed — assets/
|
|
1224
|
+
agentgit-og.png, served by the Worker at ${OG_IMAGE_PATH}
|
|
1225
|
+
(shared/og-image.ts). It is stated absolutely, on this deployment's own
|
|
1226
|
+
host: a crawler resolves neither a relative path nor a data URI, so a
|
|
1227
|
+
relative one is an empty card that looks filled in. The size is declared
|
|
1228
|
+
because several platforms lay the card out before they have fetched the
|
|
1229
|
+
bytes, and it is the size the PNG is actually rendered at — the two
|
|
1230
|
+
numbers live in shared/og-image.ts so they cannot drift apart. -->
|
|
1180
1231
|
<meta property="og:type" content="website">
|
|
1181
1232
|
<meta property="og:site_name" content="agentgit">
|
|
1182
1233
|
<meta property="og:title" content="agentgit — Git for AI agents">
|
|
1183
1234
|
<meta property="og:description" content="{{META_DESCRIPTION}}">
|
|
1184
1235
|
<meta property="og:url" content="https://{{HOST}}/">
|
|
1185
|
-
<meta
|
|
1236
|
+
<meta property="og:image" content="https://{{HOST}}${OG_IMAGE_PATH}">
|
|
1237
|
+
<meta property="og:image:width" content="${OG_IMAGE_WIDTH}">
|
|
1238
|
+
<meta property="og:image:height" content="${OG_IMAGE_HEIGHT}">
|
|
1239
|
+
<meta property="og:image:alt" content="agentgit — Git for AI agents">
|
|
1240
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
1186
1241
|
<meta name="twitter:title" content="agentgit — Git for AI agents">
|
|
1187
1242
|
<meta name="twitter:description" content="{{META_DESCRIPTION}}">
|
|
1243
|
+
<meta name="twitter:image" content="https://{{HOST}}${OG_IMAGE_PATH}">
|
|
1188
1244
|
<!-- The agent-facing version of this page. GET / splits on Accept: a browser
|
|
1189
1245
|
gets this HTML, everything else gets the manual as text. Fetch tools that
|
|
1190
1246
|
agents drive send a browser's Accept, so they land here; this is how they
|
|
1191
1247
|
find the page they wanted. -->
|
|
1192
1248
|
<link rel="alternate" type="text/plain" href="https://{{HOST}}/llms.txt" title="The manual, for agents">
|
|
1193
|
-
|
|
1249
|
+
<!-- The mark, from the one MARK_GEOMETRY constant above: the favicon and the
|
|
1250
|
+
masthead are the same paths, so they cannot drift. -->
|
|
1251
|
+
<link rel="icon" type="image/svg+xml" href="${MARK_FAVICON_HREF}">
|
|
1252
|
+
<!-- Browser analytics, when the instance configured any (shared/analytics.ts).
|
|
1253
|
+
Empty otherwise: a template that ships to other companies carries no key. -->
|
|
1254
|
+
{{ANALYTICS}}<style>
|
|
1194
1255
|
/* Deliberately single-theme: a launch page with a fixed identity.
|
|
1195
1256
|
Every colour is painted explicitly so it holds on either host ground. */
|
|
1196
1257
|
:root {
|
|
@@ -1263,7 +1324,9 @@ const PAGE = `<!doctype html>
|
|
|
1263
1324
|
.skip:focus { clip-path: none; color: var(--sunk); }
|
|
1264
1325
|
|
|
1265
1326
|
.badge {
|
|
1266
|
-
display: inline-
|
|
1327
|
+
display: inline-flex;
|
|
1328
|
+
align-items: center;
|
|
1329
|
+
gap: .5rem;
|
|
1267
1330
|
font-size: .68rem;
|
|
1268
1331
|
letter-spacing: .14em;
|
|
1269
1332
|
text-transform: uppercase;
|
|
@@ -1273,6 +1336,16 @@ const PAGE = `<!doctype html>
|
|
|
1273
1336
|
margin-bottom: 2rem;
|
|
1274
1337
|
}
|
|
1275
1338
|
|
|
1339
|
+
/* The mark, at the badge's own cap height so it reads as part of the line
|
|
1340
|
+
rather than as a picture next to it. It carries its own bone tile, so it
|
|
1341
|
+
needs nothing from the ground behind it. */
|
|
1342
|
+
.badge .mark {
|
|
1343
|
+
width: 1.15rem;
|
|
1344
|
+
height: 1.15rem;
|
|
1345
|
+
flex: none;
|
|
1346
|
+
display: block;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1276
1349
|
h1 {
|
|
1277
1350
|
font-family: var(--mono);
|
|
1278
1351
|
font-weight: 700;
|
|
@@ -1713,7 +1786,7 @@ const PAGE = `<!doctype html>
|
|
|
1713
1786
|
<div class="wrap">
|
|
1714
1787
|
|
|
1715
1788
|
<main id="start">
|
|
1716
|
-
<span class="badge">agentgit — open source, run your own</span>
|
|
1789
|
+
<span class="badge">${MARK_INLINE}<span>agentgit — open source, run your own</span></span>
|
|
1717
1790
|
|
|
1718
1791
|
<h1>Git for AI agents<span class="dot">.</span></h1>
|
|
1719
1792
|
|