@zabaca/zbc 0.17.0 → 0.19.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/package.json +1 -1
- package/templates/apps/walgit/CONTEXT.md +9 -1
- package/templates/apps/walgit/README.md +48 -1
- package/templates/apps/walgit/e2e/README.md +44 -0
- package/templates/apps/walgit/e2e/load-report.ts +240 -0
- package/templates/apps/walgit/e2e/load.ts +449 -0
- package/templates/apps/walgit/package.json +2 -1
- package/templates/apps/walgit/shared/capabilities.ts +52 -0
- package/templates/apps/walgit/shared/container-env.ts +89 -0
- package/templates/apps/walgit/shared/landing.ts +668 -133
- package/templates/apps/walgit/shared/llms.ts +99 -8
- package/templates/apps/walgit/shared/operator.ts +86 -0
- package/templates/apps/walgit/shared/policy.ts +25 -0
- package/templates/apps/walgit/shared/protocol.ts +15 -0
- package/templates/apps/walgit/src/git-backend.ts +12 -0
- package/templates/apps/walgit/src/hook-main.ts +20 -1
- package/templates/apps/walgit/src/http.ts +130 -1
- package/templates/apps/walgit/src/instructions.ts +17 -1
- package/templates/apps/walgit/src/proposals.ts +47 -11
- package/templates/apps/walgit/src/rate-limit.ts +264 -0
- package/templates/apps/walgit/src/server.ts +5 -0
- package/templates/apps/walgit/src/signers.ts +44 -3
- package/templates/apps/walgit/worker/index.ts +72 -39
- package/templates/infra/modules/cloudflare/index.ts +106 -6
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
52
|
import type { Capabilities } from './capabilities'
|
|
53
|
-
import {
|
|
53
|
+
import { contactHref, type Operator } from './operator'
|
|
54
|
+
import { describeBytes, describeWindow } from './policy'
|
|
54
55
|
import { EVENTS_PATH, SIGNERS_REF } from './protocol'
|
|
55
56
|
import { CONTENT_SIGNAL } from './robots'
|
|
56
57
|
|
|
@@ -73,45 +74,120 @@ function describeHours(hours: number): string {
|
|
|
73
74
|
return `${hours} hours`
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
/**
|
|
78
|
+
* A cap without its exact byte count.
|
|
79
|
+
*
|
|
80
|
+
* `describeBytes` renders `99 MiB (103809024 bytes)` because the refusal it was
|
|
81
|
+
* written for is read by a client comparing a number to its own, and a
|
|
82
|
+
* parenthetical there is the difference between a machine acting on the message
|
|
83
|
+
* and a machine guessing at a rounded figure. On a page somebody is deciding
|
|
84
|
+
* whether to use this host at all, the same nine digits are noise in the middle
|
|
85
|
+
* of a sentence — and `The rules.` is where every term is being cut to what
|
|
86
|
+
* scans.
|
|
87
|
+
*
|
|
88
|
+
* DERIVED from `describeBytes` rather than formatted again, which is the whole
|
|
89
|
+
* care here: the invariant this file keeps is that the cap the page prints and
|
|
90
|
+
* the cap `pre-receive` refuses on cannot look like two different numbers, and
|
|
91
|
+
* a second formatter is exactly how they would. Stripping a suffix off the one
|
|
92
|
+
* rendering cannot change the figure in front of it, so the page still cannot
|
|
93
|
+
* disagree with the hook — it only says less.
|
|
94
|
+
*/
|
|
95
|
+
function shortBytes(bytes: number): string {
|
|
96
|
+
return describeBytes(bytes).replace(/ \(\d+ bytes\)$/, '')
|
|
97
|
+
}
|
|
98
|
+
|
|
76
99
|
const claim = (key: string, value: string) =>
|
|
77
100
|
` <li><span class="k">${key}</span><span class="v">${value}</span></li>`
|
|
78
101
|
|
|
79
102
|
/**
|
|
80
|
-
* The
|
|
103
|
+
* The size caps, as fine print.
|
|
81
104
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
105
|
+
* These used to be the fourth term in `The rules.`, and the retention window
|
|
106
|
+
* before them. Neither is a feature: a cap is a safeguard against one push
|
|
107
|
+
* costing what a thousand should, and a term is a highlight. So the caps join
|
|
108
|
+
* the window in the caveat under the roadmap — stated once, in the muted line
|
|
109
|
+
* a reader checks before pointing an agent loop here, and never sold. The
|
|
110
|
+
* figures still derive from `describeBytes`, so the page cannot print a cap
|
|
111
|
+
* `pre-receive` does not refuse on. Empty when a deployment enforces none.
|
|
87
112
|
*/
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
113
|
+
function sizeLimits(caps: Capabilities): string {
|
|
114
|
+
const parts: string[] = []
|
|
115
|
+
if (caps.maxPushBytes !== null) parts.push(`${shortBytes(caps.maxPushBytes)} per push`)
|
|
116
|
+
if (caps.maxRepoBytes !== null) parts.push(`${shortBytes(caps.maxRepoBytes)} per repository`)
|
|
117
|
+
return parts.join(', ')
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* What one client may spend in a window (`src/rate-limit.ts`), as fine print.
|
|
122
|
+
*
|
|
123
|
+
* Was its own term, `Throughput`, framed as an allowance. Same demotion as the
|
|
124
|
+
* size caps and for the same reason: a rate limit is a safeguard, and the page
|
|
125
|
+
* should not be selling its safeguards. Empty when the deployment bounds
|
|
126
|
+
* nothing per source, which is the default.
|
|
127
|
+
*/
|
|
128
|
+
function sourceLimits(caps: Capabilities): string {
|
|
129
|
+
if (!caps.sourceLimited) return ''
|
|
130
|
+
const window = describeWindow(caps.rateWindowSeconds)
|
|
131
|
+
const parts: string[] = []
|
|
132
|
+
if (caps.maxNewReposPerSource !== null) {
|
|
133
|
+
parts.push(`${caps.maxNewReposPerSource} new repositories`)
|
|
95
134
|
}
|
|
96
|
-
if (caps.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (caps.maxRepoBytes !== null) {
|
|
100
|
-
parts.push(`${describeBytes(caps.maxRepoBytes)} per repository`)
|
|
101
|
-
}
|
|
102
|
-
return claim(
|
|
103
|
-
'Bounded',
|
|
104
|
-
`<b>${parts.join(', ')}.</b> Refused in <code>pre-receive</code>, by a message that names which cap and what to do instead.`,
|
|
105
|
-
)
|
|
135
|
+
if (caps.maxPushesPerSource !== null) parts.push(`${caps.maxPushesPerSource} pushes`)
|
|
136
|
+
if (caps.maxPushBytesPerSource !== null) {
|
|
137
|
+
parts.push(shortBytes(caps.maxPushBytesPerSource))
|
|
106
138
|
}
|
|
107
|
-
return ''
|
|
139
|
+
return `${parts.join(', ')} per client per ${window}`
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The limits sentence in the caveat, or nothing.
|
|
144
|
+
*
|
|
145
|
+
* One sentence, two clauses, each absent where nothing is enforced — so a
|
|
146
|
+
* deployment that bounds nothing prints no reassuring "no limits" it cannot
|
|
147
|
+
* back, exactly as the terms did.
|
|
148
|
+
*/
|
|
149
|
+
function limits(caps: Capabilities): string {
|
|
150
|
+
const clauses = [sizeLimits(caps), sourceLimits(caps)].filter((c) => c !== '')
|
|
151
|
+
return clauses.length === 0 ? '' : ` Limits: ${clauses.join('; ')}.`
|
|
108
152
|
}
|
|
109
153
|
|
|
110
154
|
/** The permanence sentence, which turns on the same variable as the claim. */
|
|
111
155
|
function permanence(caps: Capabilities): string {
|
|
112
156
|
return caps.retentionHours === null
|
|
113
|
-
? '
|
|
114
|
-
: `Not permanent: ${describeHours(caps.retentionHours)} from the last push,
|
|
157
|
+
? 'Built as a working surface rather than an archive: nothing here is a promise to keep your history.'
|
|
158
|
+
: `Not permanent: ${describeHours(caps.retentionHours)} from the last push, an unclaimed repository is collected.`
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The chapter break before the client.
|
|
163
|
+
*
|
|
164
|
+
* The two sections above it are about the host: get a repository, own it. The
|
|
165
|
+
* two below are about a different problem — several agents inside one branch,
|
|
166
|
+
* none knowing what the others just did — and the thing that solves it is not
|
|
167
|
+
* the host but a command run in the clone. Without a break the page slides
|
|
168
|
+
* from one into the other and a reader takes the socket for another feature
|
|
169
|
+
* of the same thing. A rule, a kicker, a heading, one paragraph and the
|
|
170
|
+
* command: it names the problem and the client and hands over the one thing
|
|
171
|
+
* to run, and argues nothing — the two sections under it are the argument.
|
|
172
|
+
* The command lives here rather than beside the socket because it is the
|
|
173
|
+
* client's, not the socket's: both sections below are what it does.
|
|
174
|
+
*
|
|
175
|
+
* Gated on `events` exactly as they are: no socket, no client to introduce.
|
|
176
|
+
*/
|
|
177
|
+
function clientChapter(caps: Capabilities): string {
|
|
178
|
+
if (!caps.events) return ''
|
|
179
|
+
return `
|
|
180
|
+
<section class="chapter">
|
|
181
|
+
<span class="kicker">the client</span>
|
|
182
|
+
<h2>Many agents, one branch.</h2>
|
|
183
|
+
<p>Getting a repository is solved above. Keeping several agents straight inside one is the other problem, and git has no opinion on it. <code>@zabaca/agentgit</code> is one command, run in the clone, that keeps it current and speaks only when it matters.</p>
|
|
184
|
+
<div class="term term-solo">
|
|
185
|
+
<pre id="watch-cmd"><span class="p">$</span> bunx @zabaca/agentgit watch</pre>
|
|
186
|
+
<button class="copy" id="copy-watch" type="button" aria-live="polite" aria-label="Copy the watch command">Copy</button>
|
|
187
|
+
</div>
|
|
188
|
+
<p class="under"><span>npx</span> too · <span>--once</span> waits for the handoff</p>
|
|
189
|
+
</section>
|
|
190
|
+
`
|
|
115
191
|
}
|
|
116
192
|
|
|
117
193
|
/**
|
|
@@ -146,14 +222,6 @@ function eventsSection(host: string, caps: Capabilities): string {
|
|
|
146
222
|
</div>
|
|
147
223
|
|
|
148
224
|
<div class="split-show">
|
|
149
|
-
<div>
|
|
150
|
-
<div class="term term-solo">
|
|
151
|
-
<pre id="watch-cmd"><span class="p">$</span> bunx @zabaca/agentgit watch</pre>
|
|
152
|
-
<button class="copy" id="copy-watch" type="button" aria-live="polite" aria-label="Copy the watch command">Copy</button>
|
|
153
|
-
</div>
|
|
154
|
-
<p class="under"><span>npx</span> too · <span>--once</span> waits for the handoff</p>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
225
|
<div class="panel wire" id="wire">
|
|
158
226
|
<div class="panel-head">
|
|
159
227
|
<span><span class="pulse"></span>${socket}</span>
|
|
@@ -173,6 +241,58 @@ function eventsSection(host: string, caps: Capabilities): string {
|
|
|
173
241
|
`
|
|
174
242
|
}
|
|
175
243
|
|
|
244
|
+
/**
|
|
245
|
+
* The collision, which is the half of `watch` that a timer could never do.
|
|
246
|
+
*
|
|
247
|
+
* The section above sells the socket: no polling, no webhook. This one sells
|
|
248
|
+
* what the socket is FOR. Being told main moved is an event; being told *main
|
|
249
|
+
* moved in the file you are editing right now* is a decision the agent can
|
|
250
|
+
* act on, and it is the one thing on this page a cron job could not replicate.
|
|
251
|
+
*
|
|
252
|
+
* Every sentence here is a behaviour of `packages/agentgit/src/watch.ts`, and
|
|
253
|
+
* the transcript is a line it prints. `git stash create` is why uncommitted
|
|
254
|
+
* work counts — `merge-tree` compares commits, so an agent mid-task would be
|
|
255
|
+
* invisible to it without the throwaway commit. The notice fires on CHANGE
|
|
256
|
+
* only, and clears itself, which is the whole reason an agent keeps believing
|
|
257
|
+
* the channel. And it never merges: a line and a file list is information, a
|
|
258
|
+
* merge attempt would be work the agent did not ask for.
|
|
259
|
+
*
|
|
260
|
+
* Gated on `events` exactly as the section above: there is no collision notice
|
|
261
|
+
* without a socket to carry the event that triggers it.
|
|
262
|
+
*/
|
|
263
|
+
function collisionSection(host: string, caps: Capabilities): string {
|
|
264
|
+
if (!caps.events) return ''
|
|
265
|
+
const socket = `wss://${host}${EVENTS_PATH}`
|
|
266
|
+
|
|
267
|
+
return `
|
|
268
|
+
<section class="split">
|
|
269
|
+
<div class="split-say">
|
|
270
|
+
<h2>Stop discovering conflicts at push time.</h2>
|
|
271
|
+
<p>Two agents on one branch meet when the second one pushes — an hour of work later, with a merge to resolve cold. The client checks the moment the first push lands, uncommitted edits included.</p>
|
|
272
|
+
<p><strong>It says so once.</strong> Reported when it appears, cleared when it goes, never repeated.</p>
|
|
273
|
+
<p><strong>It touches nothing.</strong> No merge, no stash, no rebase. The line names the files; the call is yours.</p>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<div class="split-show">
|
|
277
|
+
<div class="panel wire">
|
|
278
|
+
<div class="panel-head">
|
|
279
|
+
<span><span class="pulse"></span>${socket}</span>
|
|
280
|
+
</div>
|
|
281
|
+
<pre class="tx"><span class="ln" style="--d:0ms"><span class="c"># you are editing src/index.ts. nothing committed yet.</span>
|
|
282
|
+
</span><span class="ln" style="--d:900ms">
|
|
283
|
+
<span class="ok">study-42 main: origin/main is ef759899</span>
|
|
284
|
+
</span><span class="ln" style="--d:1250ms"><span class="no">study-42 main: COLLIDES with your work in src/index.ts</span>
|
|
285
|
+
</span><span class="ln" style="--d:2300ms">
|
|
286
|
+
<span class="c"># you rebase, or finish first and resolve. your call.</span>
|
|
287
|
+
</span><span class="ln" style="--d:3300ms">
|
|
288
|
+
<span class="ok">study-42 main: no longer collides with your work</span><span class="caret"></span></span></pre>
|
|
289
|
+
<div class="panel-foot">Said once when it appears, once when it clears. Never repeated.</div>
|
|
290
|
+
</div>
|
|
291
|
+
</div>
|
|
292
|
+
</section>
|
|
293
|
+
`
|
|
294
|
+
}
|
|
295
|
+
|
|
176
296
|
/**
|
|
177
297
|
* Append-only, whose second clause makes the same promise `Public` does.
|
|
178
298
|
*
|
|
@@ -197,8 +317,12 @@ function appendOnlyClaim(caps: Capabilities): string {
|
|
|
197
317
|
'<b>Nothing you push can be destroyed.</b> ' +
|
|
198
318
|
(caps.namesCanRefuse
|
|
199
319
|
? 'Whoever the name takes a push from may add; no one may rewrite or delete.'
|
|
200
|
-
: 'Anyone may add; no one may rewrite or delete.')
|
|
201
|
-
|
|
320
|
+
: 'Anyone may add; no one may rewrite or delete.'),
|
|
321
|
+
// The sentence that used to close this term — a rewrite is turned away
|
|
322
|
+
// before anything uploads, by a message naming the remedy — is the foot of
|
|
323
|
+
// the refusal panel two sections up, word for word. Saying it in both
|
|
324
|
+
// places cost this term half its length to repeat a thing the page has
|
|
325
|
+
// already SHOWN, which is the stronger telling of the two.
|
|
202
326
|
)
|
|
203
327
|
}
|
|
204
328
|
|
|
@@ -305,7 +429,7 @@ function proposalsClaim(caps: Capabilities): string {
|
|
|
305
429
|
if (!caps.proposals) return ''
|
|
306
430
|
return claim(
|
|
307
431
|
'Proposals',
|
|
308
|
-
'<b>A claimed name takes a change from anyone who may read it.</b> Push to <code>refs/walgit/proposals/<branch>/<your-id></code
|
|
432
|
+
'<b>A claimed name takes a change from anyone who may read it.</b> Push to <code>refs/walgit/proposals/<branch>/<your-id></code>. A Signer merges it, and <em>merged</em> means the branch\u2019s history contains it.',
|
|
309
433
|
)
|
|
310
434
|
}
|
|
311
435
|
|
|
@@ -313,7 +437,7 @@ function privateClaim(caps: Capabilities): string {
|
|
|
313
437
|
if (!caps.namesCanBePrivate) return ''
|
|
314
438
|
return claim(
|
|
315
439
|
'Private',
|
|
316
|
-
'<b>A claimed name can refuse a stranger reading it.</b> Write a <b>Reader List</b> beside the signers
|
|
440
|
+
'<b>A claimed name can refuse a stranger reading it.</b> Write a <b>Reader List</b> beside the signers, and the key that signs your pushes is the key that reads.',
|
|
317
441
|
)
|
|
318
442
|
}
|
|
319
443
|
|
|
@@ -338,23 +462,18 @@ function privateClaim(caps: Capabilities): string {
|
|
|
338
462
|
* summary of it, so the two arguments read together and the terms below read as
|
|
339
463
|
* what both of them settle.
|
|
340
464
|
*
|
|
341
|
-
* The right column is
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
* `signers`. A reader who has a PGP key would claim the name and then be locked
|
|
354
|
-
* out of it by their own next push.
|
|
355
|
-
*
|
|
356
|
-
* What is left to `/llms.txt` (`shared/llms.ts`) is `set -e` and the second
|
|
357
|
-
* key: this panel is the argument, and that document is the manual.
|
|
465
|
+
* The right column is one thing: the refusal a stranger reads. The six
|
|
466
|
+
* commands that write the list used to sit above it — first in full, then
|
|
467
|
+
* behind a disclosure — and both were the tallest thing on a pitch page, beside
|
|
468
|
+
* prose that had been cut to three sentences. They are gone from the page
|
|
469
|
+
* entirely, not abbreviated: every shorter form tried hands a reader a command
|
|
470
|
+
* that fails (only the `git push` pushes their project's `HEAD` at the signers
|
|
471
|
+
* ref; without `-c user.email` a fresh container aborts; without
|
|
472
|
+
* `-c gpg.format=ssh` a PGP holder signs with the wrong key and is locked out of
|
|
473
|
+
* the name they just claimed). Zero lines is the one abbreviation with no
|
|
474
|
+
* footgun. The recipe is in `/llms.txt` (`shared/llms.ts`), whole, which the
|
|
475
|
+
* closing block and the footer both link — this section is the argument, and
|
|
476
|
+
* that document is the manual.
|
|
358
477
|
*
|
|
359
478
|
* **The transcript is an excerpt, and says so.** Every line of it is a line
|
|
360
479
|
* `heldMessage` (`src/signers.ts`) actually writes, and `landing.test.ts`
|
|
@@ -383,43 +502,71 @@ function privateClaim(caps: Capabilities): string {
|
|
|
383
502
|
* enforce it would be the promise `appendOnlyClaim` just stopped making,
|
|
384
503
|
* reappearing two sections up the page.
|
|
385
504
|
*/
|
|
505
|
+
/**
|
|
506
|
+
* The handoff, which used to be one sentence under the hero.
|
|
507
|
+
*
|
|
508
|
+
* *"Handing work to another agent is the URL, and there is nothing else to
|
|
509
|
+
* send"* was the hero's second lede, and it was the second-best sentence on the
|
|
510
|
+
* page carrying its own argument in a place built for one. A section gives it
|
|
511
|
+
* the shape the other arguments have: the pain first, then what the URL
|
|
512
|
+
* replaces, then the one thing to send.
|
|
513
|
+
*
|
|
514
|
+
* "Nothing else to send" is only true where nothing else is asked for. On a
|
|
515
|
+
* credentialed deployment the receiving agent needs the host's token as well,
|
|
516
|
+
* so the closing sentence is rendered from `publicAccess` — the same rule
|
|
517
|
+
* `heroUnder` follows, one section down from where it made the same promise.
|
|
518
|
+
*/
|
|
519
|
+
function handoffSection(host: string, caps: Capabilities): string {
|
|
520
|
+
const send = caps.publicAccess
|
|
521
|
+
? 'There is nothing else to send: no invite, no token, no archive of a working directory.'
|
|
522
|
+
: 'There is nothing else to send but the one token the host already asks every agent for.'
|
|
523
|
+
|
|
524
|
+
return `
|
|
525
|
+
<section class="split">
|
|
526
|
+
<div class="split-say">
|
|
527
|
+
<h2>Hand it to the next agent. Send the URL.</h2>
|
|
528
|
+
<p>Work passes between agents as a tarball, a shared volume, or a token to a repository somebody had to create first — and the agent receiving it starts by working out which.</p>
|
|
529
|
+
<p><strong>Here the handoff is the URL.</strong> Push, send the address, and the next agent clones it. ${send}</p>
|
|
530
|
+
<p><strong>Nobody set it up.</strong> The repository came into being on the first push, so there was never a step before the handoff.</p>
|
|
531
|
+
</div>
|
|
532
|
+
|
|
533
|
+
<div class="split-show">
|
|
534
|
+
<div class="panel">
|
|
535
|
+
<div class="panel-head"><span>the whole handoff</span></div>
|
|
536
|
+
<pre class="tx"><span class="ln" style="--d:0ms"><span class="c"># agent A, done for now.</span>
|
|
537
|
+
</span><span class="ln" style="--d:200ms"><span class="p">$</span> git push agentgit main
|
|
538
|
+
</span><span class="ln" style="--d:1000ms">
|
|
539
|
+
<span class="c"># what it sends. all of it.</span>
|
|
540
|
+
</span><span class="ln" style="--d:1250ms"><span class="ok">https://${host}/study-42.git</span>
|
|
541
|
+
</span><span class="ln" style="--d:2200ms">
|
|
542
|
+
<span class="c"># agent B, in a different sandbox.</span>
|
|
543
|
+
</span><span class="ln" style="--d:2450ms"><span class="p">$</span> git clone https://${host}/study-42.git<span class="caret"></span></span></pre>
|
|
544
|
+
<div class="panel-foot">A URL is the one thing every sandbox can already receive.</div>
|
|
545
|
+
</div>
|
|
546
|
+
</div>
|
|
547
|
+
</section>
|
|
548
|
+
`
|
|
549
|
+
}
|
|
550
|
+
|
|
386
551
|
function ownershipCost(caps: Capabilities): string {
|
|
387
552
|
return caps.appendOnly
|
|
388
|
-
?
|
|
389
|
-
:
|
|
553
|
+
? "An unclaimed name takes anyone's push, and append-only keeps it forever — a stranger's branch in your agent's repository is <em>there for good</em>. Claim the name and that stops."
|
|
554
|
+
: "An unclaimed name takes anyone's push — a branch, a moved <code>main</code>, a deleted ref — and <em>whoever pushes last wins</em>. Claim the name and your history is yours."
|
|
390
555
|
}
|
|
391
556
|
|
|
392
|
-
function ownershipSection(
|
|
557
|
+
function ownershipSection(caps: Capabilities): string {
|
|
393
558
|
if (!caps.namesCanBeClaimed) return ''
|
|
394
559
|
|
|
395
560
|
return `
|
|
396
561
|
<section class="split">
|
|
397
562
|
<div class="split-say">
|
|
398
|
-
<h2>
|
|
563
|
+
<h2>Claim it. Only your keys push.</h2>
|
|
399
564
|
<p>${ownershipCost(caps)}</p>
|
|
400
|
-
<p><strong>
|
|
401
|
-
<p><strong>List two keys.</strong> There is
|
|
565
|
+
<p><strong>Claiming one takes a single push.</strong> Write the fingerprints you trust to <code>${SIGNERS_REF}</code>; from then on only their pushes land. No account, no invite, no dashboard.</p>
|
|
566
|
+
<p><strong>List two keys.</strong> There is nothing to reset, so a second one is your way back in.</p>
|
|
402
567
|
</div>
|
|
403
568
|
|
|
404
569
|
<div class="split-show">
|
|
405
|
-
<div>
|
|
406
|
-
<div class="term term-solo">
|
|
407
|
-
<pre><span class="c"># a repository whose tree is one file: signers.</span>
|
|
408
|
-
<span class="p">$</span> git init -q claim && cd claim
|
|
409
|
-
<span class="p">$</span> ssh-keygen -lf $HOME/.ssh/id_ed25519.pub \\
|
|
410
|
-
| awk '{print $2}' > signers
|
|
411
|
-
<span class="p">$</span> git add signers
|
|
412
|
-
<span class="p">$</span> git -c user.email=agent@localhost \\
|
|
413
|
-
-c user.name=agent commit -qm claim
|
|
414
|
-
<span class="p">$</span> git -c gpg.format=ssh \\
|
|
415
|
-
-c user.signingkey=$HOME/.ssh/id_ed25519.pub \\
|
|
416
|
-
push --signed=if-asked \\
|
|
417
|
-
https://${host}/$NAME.git \\
|
|
418
|
-
HEAD:${SIGNERS_REF}</pre>
|
|
419
|
-
</div>
|
|
420
|
-
<p class="under">List a second key · the full recipe is in <span>/llms.txt</span></p>
|
|
421
|
-
</div>
|
|
422
|
-
|
|
423
570
|
<div class="panel">
|
|
424
571
|
<div class="panel-head">
|
|
425
572
|
<span>what a stranger reads</span>
|
|
@@ -432,7 +579,126 @@ function ownershipSection(host: string, caps: Capabilities): string {
|
|
|
432
579
|
</span><span class="ln"><span class="c"> git push --signed=yes origin HEAD:refs/heads/<branch></span>
|
|
433
580
|
</span><span class="ln"><span class="c">…</span>
|
|
434
581
|
</span><span class="ln"><span class="ok">Nothing was uploaded; the repository is unchanged.</span></span></pre>
|
|
435
|
-
<div class="panel-foot">
|
|
582
|
+
<div class="panel-foot">Turned away before anything is uploaded. The message names a free name to use instead, and how to be added to this one.</div>
|
|
583
|
+
</div>
|
|
584
|
+
</div>
|
|
585
|
+
</section>
|
|
586
|
+
`
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Letting another agent push, which is the step the claim section leaves open.
|
|
591
|
+
*
|
|
592
|
+
* Two routes, rendered from `proposals`. Where Proposals are on, the new agent
|
|
593
|
+
* ASKS: a signed Proposal against the Signer List itself, carrying its own
|
|
594
|
+
* fingerprint line, and a Signer runs `agentgit accept` — which is the page's
|
|
595
|
+
* whole pitch (no invite, no seat, no dashboard) applied to access itself.
|
|
596
|
+
* Where they are off, what exists is the grant: a listed key adds the line and
|
|
597
|
+
* pushes the list signed, and the fingerprint reaches that key out of band.
|
|
598
|
+
*
|
|
599
|
+
* The target is `SIGNERS_TARGET` in `src/proposals.ts` (ADR-0018, amended by
|
|
600
|
+
* #160): `walgit/signers` in the slot a branch name takes. `landing.test.ts`
|
|
601
|
+
* pins the spelling against that constant, and the success line is the one
|
|
602
|
+
* `runAccept` in `packages/agentgit/src/accept.ts` prints for this path.
|
|
603
|
+
*
|
|
604
|
+
* The grant illustration is the DIFF, not the commands: those are the six the
|
|
605
|
+
* claim recipe needs and every shorter form is one that fails. The Proposal
|
|
606
|
+
* illustration IS commands, because there are exactly two and both are whole.
|
|
607
|
+
*/
|
|
608
|
+
function grantSection(host: string, caps: Capabilities): string {
|
|
609
|
+
if (!caps.namesCanBeClaimed) return ''
|
|
610
|
+
|
|
611
|
+
if (caps.proposals) {
|
|
612
|
+
return `
|
|
613
|
+
<section class="split">
|
|
614
|
+
<div class="split-say">
|
|
615
|
+
<h2>Let another agent push.</h2>
|
|
616
|
+
<p>A claimed name refuses the next agent too — that is what claiming is for. Letting one in is not a seat, a role or an invite: the agent asks, and a Signer says yes.</p>
|
|
617
|
+
<p><strong>The new agent proposes itself.</strong> A signed push of the Signer List with its own line added, to the Proposals namespace, from any key that may read the name.</p>
|
|
618
|
+
<p><strong>A Signer accepts.</strong> One command in its clone, and the next push from the new key lands. Nothing is retroactive, in either direction.</p>
|
|
619
|
+
</div>
|
|
620
|
+
|
|
621
|
+
<div class="split-show">
|
|
622
|
+
<div class="panel">
|
|
623
|
+
<div class="panel-head">
|
|
624
|
+
<span>the whole grant</span>
|
|
625
|
+
</div>
|
|
626
|
+
<pre class="tx"><span class="ln"><span class="c"># agent B, anywhere it may read the name.</span>
|
|
627
|
+
</span><span class="ln"><span class="p">$</span> git push --signed=yes agentgit \\
|
|
628
|
+
HEAD:refs/walgit/proposals/walgit/signers/kq3LmW
|
|
629
|
+
</span><span class="ln">
|
|
630
|
+
<span class="c"># agent A, a Signer, in its clone.</span>
|
|
631
|
+
</span><span class="ln"><span class="p">$</span> agentgit accept kq3LmW
|
|
632
|
+
</span><span class="ln"><span class="ok">accepted kq3LmW (5b1c09e4) onto ${SIGNERS_REF} — it is now e0a7d2c1</span></span></pre>
|
|
633
|
+
<div class="panel-foot">Two commands, one each. Nobody sent a fingerprint anywhere.</div>
|
|
634
|
+
</div>
|
|
635
|
+
</div>
|
|
636
|
+
</section>
|
|
637
|
+
`
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
return `
|
|
641
|
+
<section class="split">
|
|
642
|
+
<div class="split-say">
|
|
643
|
+
<h2>Let another agent push.</h2>
|
|
644
|
+
<p>A claimed name refuses the next agent too — that is what claiming is for. Letting one in is a line in a file, not a seat, a role or an invite.</p>
|
|
645
|
+
<p><strong>The new agent sends its fingerprint.</strong> <code>ssh-keygen -lf</code> prints it. A listed key adds the line to <code>signers</code> and pushes the list, signed.</p>
|
|
646
|
+
<p><strong>The grant governs the next push.</strong> Nothing is retroactive, in either direction: remove the line the same way.</p>
|
|
647
|
+
</div>
|
|
648
|
+
|
|
649
|
+
<div class="split-show">
|
|
650
|
+
<div class="panel">
|
|
651
|
+
<div class="panel-head">
|
|
652
|
+
<span>the whole grant</span>
|
|
653
|
+
</div>
|
|
654
|
+
<pre class="tx"><span class="ln"><span class="c"># ${SIGNERS_REF}, one commit later</span>
|
|
655
|
+
</span><span class="ln"><span class="c">--- a/signers</span>
|
|
656
|
+
</span><span class="ln"><span class="c">+++ b/signers</span>
|
|
657
|
+
</span><span class="ln"> SHA256:9fXbQ2… <span class="c"># agent A</span>
|
|
658
|
+
</span><span class="ln"><span class="ok">+SHA256:kq3LmW… <span class="c"># agent B</span></span></span></pre>
|
|
659
|
+
<div class="panel-foot">Pushed by a key already on the list. Agent B's next push lands.</div>
|
|
660
|
+
</div>
|
|
661
|
+
</div>
|
|
662
|
+
</section>
|
|
663
|
+
`
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Going private, which is the second file on the same ref.
|
|
668
|
+
*
|
|
669
|
+
* Claimed is who may WRITE (`signers`); Private is who may READ (`readers`),
|
|
670
|
+
* beside it on the same commit chain, written by the same signed push. Three
|
|
671
|
+
* rules from `shared/llms.ts` are the ones every agent gets wrong, so the
|
|
672
|
+
* section states all three: an empty Reader List is valid and means only the
|
|
673
|
+
* Signers read; Signers read without being listed; and your own pushes are
|
|
674
|
+
* gated too, because a push begins with a read. The manual carries the fourth,
|
|
675
|
+
* which is the credential-helper line to run before writing the file.
|
|
676
|
+
*
|
|
677
|
+
* Gated on `namesCanBePrivate`, which already requires everything the claim
|
|
678
|
+
* section needs plus the private seed — so this never renders where the claim
|
|
679
|
+
* section does not.
|
|
680
|
+
*/
|
|
681
|
+
function privateSection(host: string, caps: Capabilities): string {
|
|
682
|
+
if (!caps.namesCanBePrivate) return ''
|
|
683
|
+
|
|
684
|
+
return `
|
|
685
|
+
<section class="split">
|
|
686
|
+
<div class="split-say">
|
|
687
|
+
<h2>Keep it to yourselves.</h2>
|
|
688
|
+
<p>Claimed says who may push. Everyone can still clone it, and work in progress is not always something to leave in the open.</p>
|
|
689
|
+
<p><strong>Private is a second file.</strong> Write <code>readers</code> beside <code>signers</code>, one fingerprint per line, and every clone, fetch and watch is refused unless the reader proves a listed key. Empty means only the Signers read.</p>
|
|
690
|
+
<p><strong>Signers read without being listed.</strong> So <code>readers</code> is for agents that may read and not push — and your own pushes are gated too, since a push begins with a read.</p>
|
|
691
|
+
</div>
|
|
692
|
+
|
|
693
|
+
<div class="split-show">
|
|
694
|
+
<div class="panel">
|
|
695
|
+
<div class="panel-head">
|
|
696
|
+
<span>what a stranger reads</span>
|
|
697
|
+
</div>
|
|
698
|
+
<pre class="tx"><span class="ln"><span class="p">$</span> git clone https://${host}/study-42.git
|
|
699
|
+
</span><span class="ln"><span class="c">Cloning into 'study-42'...</span>
|
|
700
|
+
</span><span class="ln"><span class="no">fatal: could not read Username for 'https://${host}'</span></span></pre>
|
|
701
|
+
<div class="panel-foot">A 401 is the whole answer: taken, and kept private by a Reader List. The manual has the one line that makes your own clone pass.</div>
|
|
436
702
|
</div>
|
|
437
703
|
</div>
|
|
438
704
|
</section>
|
|
@@ -452,8 +718,8 @@ function signingClaim(caps: Capabilities): string {
|
|
|
452
718
|
'Attributed',
|
|
453
719
|
"<b>A push signed with your key records that key's fingerprint.</b> " +
|
|
454
720
|
(caps.namesCanRefuse
|
|
455
|
-
? 'Unsigned is fine unless a name has written a Signer List
|
|
456
|
-
: 'Nothing is refused for being unsigned
|
|
721
|
+
? 'Unsigned is fine unless a name has written a Signer List. The fingerprint is the whole identity.'
|
|
722
|
+
: 'Nothing is refused for being unsigned. The fingerprint is the whole identity.') +
|
|
457
723
|
' <code>git push --signed=if-asked</code>.',
|
|
458
724
|
)
|
|
459
725
|
}
|
|
@@ -477,14 +743,13 @@ function claims(caps: Capabilities): string {
|
|
|
477
743
|
publicClaim(caps),
|
|
478
744
|
privateClaim(caps),
|
|
479
745
|
proposalsClaim(caps),
|
|
480
|
-
thirdClaim(caps),
|
|
481
746
|
signingClaim(caps),
|
|
482
747
|
// Unconditional, unlike every term above it: nothing in `/robots.txt` is
|
|
483
748
|
// read from a flag. It is the one claim on this page addressed to the
|
|
484
749
|
// crawler rather than to the agent driving it.
|
|
485
750
|
claim(
|
|
486
751
|
'Crawlable',
|
|
487
|
-
`<b><code>/robots.txt</code> says yes, out loud.</b> <code>Allow: /</code> for every agent, and <code>Content-Signal: ${CONTENT_SIGNAL}</code
|
|
752
|
+
`<b><code>/robots.txt</code> says yes, out loud.</b> <code>Allow: /</code> for every agent, and <code>Content-Signal: ${CONTENT_SIGNAL}</code> — told so in the one file it checks.`,
|
|
488
753
|
),
|
|
489
754
|
]
|
|
490
755
|
.filter((term) => term !== '')
|
|
@@ -530,13 +795,13 @@ function heroUnder(caps: Capabilities): string {
|
|
|
530
795
|
/**
|
|
531
796
|
* The first two roadmap rows, which are the two the gate makes untrue.
|
|
532
797
|
*
|
|
533
|
-
* The roadmap is "
|
|
798
|
+
* The roadmap is "where this is going, in the order it gets there", so a
|
|
534
799
|
* deployment where a name can already refuse a stranger must not go on calling
|
|
535
800
|
* ownership Next. Same rule as every limit on this page, applied to a promise
|
|
536
801
|
* instead of a cap.
|
|
537
802
|
*
|
|
538
803
|
* Where it shipped the row does not become a `Shipped` row — it LEAVES. This
|
|
539
|
-
* list is what is
|
|
804
|
+
* list is what is still ahead, and a section above now states ownership as a rule
|
|
540
805
|
* of the host; carrying it in both places would be the page describing one
|
|
541
806
|
* capability twice, once as a fact and once as an achievement. Only Private
|
|
542
807
|
* stays, because Private is genuinely still missing and the row was wrong about
|
|
@@ -563,18 +828,18 @@ function roadmapOwnership(caps: Capabilities): string {
|
|
|
563
828
|
return ` <li data-next>
|
|
564
829
|
<span class="when">Next</span>
|
|
565
830
|
<h3>Ownership</h3>
|
|
566
|
-
<p>
|
|
831
|
+
<p>A name only your keys can write to. Who pushed is already recorded; what is left is the rule that says the first key to push a name keeps it — and because un-claiming is hard to take back, it gets designed carefully rather than quickly.</p>
|
|
567
832
|
</li>
|
|
568
833
|
<li>
|
|
569
834
|
<span class="when">After ownership</span>
|
|
570
835
|
<h3>Private</h3>
|
|
571
|
-
<p>
|
|
836
|
+
<p>Reads closed to everyone but the keys you list — gated on the same fingerprint a signed push already carries, once holding a name means something.</p>
|
|
572
837
|
</li>`
|
|
573
838
|
}
|
|
574
839
|
return ` <li>
|
|
575
|
-
<span class="when">Unblocked
|
|
840
|
+
<span class="when">Unblocked</span>
|
|
576
841
|
<h3>Private</h3>
|
|
577
|
-
<p>
|
|
842
|
+
<p>Reads closed to everyone but the keys you list. Holding a name is what makes that possible, and nothing else stands in the way of it — but it is not built yet, and today a claimed repository reads as openly as any other.</p>
|
|
578
843
|
</li>`
|
|
579
844
|
}
|
|
580
845
|
|
|
@@ -597,15 +862,44 @@ function roadmapPulls(caps: Capabilities): string {
|
|
|
597
862
|
// capability in two contradictory places.
|
|
598
863
|
if (caps.proposals) return ''
|
|
599
864
|
const missing = caps.appendOnly
|
|
600
|
-
? 'Append-only already makes a proposal safe to push. What is
|
|
601
|
-
: 'A branch is already the whole of a proposal. What is
|
|
865
|
+
? 'Append-only already makes a proposal safe to push. What is left is a way to say a branch is one, and a way to say it landed — not a review UI.'
|
|
866
|
+
: 'A branch is already the whole of a proposal. What is left is a way to say that is what it is, and a way to say it landed — not a review UI.'
|
|
602
867
|
return ` <li>
|
|
603
|
-
<span class="when">
|
|
868
|
+
<span class="when">In design</span>
|
|
604
869
|
<h3>Pull requests</h3>
|
|
605
870
|
<p>${missing}</p>
|
|
606
871
|
</li>`
|
|
607
872
|
}
|
|
608
873
|
|
|
874
|
+
/**
|
|
875
|
+
* The standfirst under `What's next.`, which has to survive the rows leaving.
|
|
876
|
+
*
|
|
877
|
+
* The two functions above are the page's best rule applied to a promise: a row
|
|
878
|
+
* LEAVES when its deployment ships the thing, so the list is always what is
|
|
879
|
+
* still ahead. What nobody checked is what the sentence above the list says
|
|
880
|
+
* once three of the four rows have left. *"Where this is going, in the order it
|
|
881
|
+
* gets there"* promises a sequence, and on the deployment that has shipped the
|
|
882
|
+
* most — Signer Lists, Reader Lists and Proposals all on, which is agentgit —
|
|
883
|
+
* the list under it is one row. A standfirst describing an ORDER over a single
|
|
884
|
+
* item reads as a roadmap that ran out rather than one that was delivered.
|
|
885
|
+
*
|
|
886
|
+
* So the lede is rendered from the same fragments the list is built from: the
|
|
887
|
+
* rows are COUNTED out of the markup rather than re-derived from the flags,
|
|
888
|
+
* because a count computed from the capabilities is a second reading of the
|
|
889
|
+
* same question and the two would eventually disagree. `<h3>` is one per row.
|
|
890
|
+
*
|
|
891
|
+
* The no-date promise is in both spellings. It is the one thing on this page
|
|
892
|
+
* that is not rendered from config, so it is the one sentence that has to admit
|
|
893
|
+
* as much however many rows are left to admit it about.
|
|
894
|
+
*/
|
|
895
|
+
function roadmapLede(caps: Capabilities): string {
|
|
896
|
+
const rows = 1 + (roadmapOwnership(caps) + roadmapPulls(caps)).split('<h3>').length - 1
|
|
897
|
+
|
|
898
|
+
return rows === 1
|
|
899
|
+
? 'One thing is left, and nothing here is a date — it is designed in the open before it ships.'
|
|
900
|
+
: 'Where this is going, in the order it gets there. Nothing here is a date — each one is designed in the open before it ships.'
|
|
901
|
+
}
|
|
902
|
+
|
|
609
903
|
/**
|
|
610
904
|
* The live client, shipped only where there is a socket to open.
|
|
611
905
|
*
|
|
@@ -617,30 +911,196 @@ function wireScript(): string {
|
|
|
617
911
|
return `${WIRE_CLIENT}`
|
|
618
912
|
}
|
|
619
913
|
|
|
914
|
+
/**
|
|
915
|
+
* Everything on this page is a constant of the template or a number read from
|
|
916
|
+
* the environment — except the two values below, which are free text somebody
|
|
917
|
+
* put in a deployment variable and which land in markup. So they are escaped
|
|
918
|
+
* here, once, at the only place they enter the document.
|
|
919
|
+
*/
|
|
920
|
+
function escapeHtml(raw: string): string {
|
|
921
|
+
return raw
|
|
922
|
+
.replaceAll('&', '&')
|
|
923
|
+
.replaceAll('<', '<')
|
|
924
|
+
.replaceAll('>', '>')
|
|
925
|
+
.replaceAll('"', '"')
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Who runs this, and what happens to what you push.
|
|
930
|
+
*
|
|
931
|
+
* The one block on the page addressed to somebody who is not about to push:
|
|
932
|
+
* an aggregator asks who is answerable in the first ten minutes, and the page
|
|
933
|
+
* that could not answer sent them looking for a WHOIS record.
|
|
934
|
+
*
|
|
935
|
+
* The expiry promise stands here as well as in `The rules.` on purpose, and it
|
|
936
|
+
* is not the page saying one thing twice — the terms tell a visitor what the
|
|
937
|
+
* host will do with their push, and this tells somebody else what it already
|
|
938
|
+
* did with a stranger's. On a deployment that collects, "it expires in 24
|
|
939
|
+
* hours" is most of the answer to a takedown, so the two facts are read
|
|
940
|
+
* together or not at all. It is rendered from `retentionHours` like every
|
|
941
|
+
* other statement of the window, so it cannot outlive the config either.
|
|
942
|
+
*
|
|
943
|
+
* Absent whole where nothing is configured, for the reason `operatorFrom`
|
|
944
|
+
* returns `null` there: a page that printed a heading with nobody under it
|
|
945
|
+
* would be worse than one that never claimed to have an operator.
|
|
946
|
+
*/
|
|
947
|
+
function operatorSection(caps: Capabilities, operator: Operator | null): string {
|
|
948
|
+
if (operator === null) return ''
|
|
949
|
+
|
|
950
|
+
const rows: string[] = []
|
|
951
|
+
if (operator.name !== null) {
|
|
952
|
+
rows.push(claim('Operator', `<b>${escapeHtml(operator.name)}</b> runs this deployment.`))
|
|
953
|
+
}
|
|
954
|
+
if (operator.contact !== null) {
|
|
955
|
+
const text = escapeHtml(operator.contact)
|
|
956
|
+
const href = contactHref(operator.contact)
|
|
957
|
+
rows.push(
|
|
958
|
+
claim(
|
|
959
|
+
'Contact',
|
|
960
|
+
`<b>${href === null ? text : `<a href="${escapeHtml(href)}">${text}</a>`}</b> — takedowns, abuse and anything else about this host.`,
|
|
961
|
+
),
|
|
962
|
+
)
|
|
963
|
+
}
|
|
964
|
+
if (caps.retentionHours !== null) {
|
|
965
|
+
const window = describeHours(caps.retentionHours)
|
|
966
|
+
rows.push(
|
|
967
|
+
claim(
|
|
968
|
+
'Expiry',
|
|
969
|
+
`<b>A repository is collected ${window} after its last push</b>, whether or not anybody asks. Nothing here is archived.`,
|
|
970
|
+
),
|
|
971
|
+
)
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
// `operatorFrom` cannot return an `Operator` with neither half, so this is
|
|
975
|
+
// unreachable from the Worker — but a heading with nothing under it is the
|
|
976
|
+
// one output this block must never produce, and the guard costs a line.
|
|
977
|
+
if (rows.length === 0) return ''
|
|
978
|
+
|
|
979
|
+
return `
|
|
980
|
+
<section>
|
|
981
|
+
<h2>Who runs this.</h2>
|
|
982
|
+
<ul class="claims">
|
|
983
|
+
${rows.join('\n')}
|
|
984
|
+
</ul>
|
|
985
|
+
</section>
|
|
986
|
+
`
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* The last thing on the page, which used to be a takedown address.
|
|
991
|
+
*
|
|
992
|
+
* The page's whole asset is two commands that work, and they appeared once,
|
|
993
|
+
* above the fold, and never again — so a reader who scrolled the argument to
|
|
994
|
+
* its end was returned nothing to do. `Who runs this.` is the right block to
|
|
995
|
+
* have last of the informational ones and the wrong one to LEAVE last: it is
|
|
996
|
+
* addressed to somebody who is not about to push, and it was closing a page
|
|
997
|
+
* for everybody who was.
|
|
998
|
+
*
|
|
999
|
+
* The commands are the hero's, not a second copy of them: the name field above
|
|
1000
|
+
* echoes into this block as well (`repo-echo-end`), so what a visitor reads
|
|
1001
|
+
* here is the name they typed there, and the copy button reads its text out of
|
|
1002
|
+
* the block beside it exactly as the other two do.
|
|
1003
|
+
*
|
|
1004
|
+
* The client is named only where there is a socket to open, the same gate
|
|
1005
|
+
* `eventsSection` sits behind — a page that linked a watcher for a stream its
|
|
1006
|
+
* own Worker answers 404 for would be the one lie this file exists to prevent.
|
|
1007
|
+
*/
|
|
1008
|
+
function closeSection(host: string, caps: Capabilities): string {
|
|
1009
|
+
const line = caps.publicAccess
|
|
1010
|
+
? 'No account, no key. The name you pick <em>is</em> the repository, and it exists the moment the push lands.'
|
|
1011
|
+
: 'The name you pick <em>is</em> the repository, and it exists the moment the push lands.'
|
|
1012
|
+
|
|
1013
|
+
const client = caps.events
|
|
1014
|
+
? ' · keep a clone current with <a href="https://www.npmjs.com/package/@zabaca/agentgit">@zabaca/agentgit</a>'
|
|
1015
|
+
: ''
|
|
1016
|
+
|
|
1017
|
+
return `
|
|
1018
|
+
<section class="close">
|
|
1019
|
+
<h2>Push something.</h2>
|
|
1020
|
+
<p>${line}</p>
|
|
1021
|
+
<div class="term">
|
|
1022
|
+
<pre id="cmd-end"><span class="p">$</span> git remote add agentgit https://${host}/<span id="repo-echo-end">my-thing</span>.git
|
|
1023
|
+
<span class="p">$</span> git push agentgit main</pre>
|
|
1024
|
+
<button class="copy" id="copy-end" type="button" aria-live="polite" aria-label="Copy the two commands">Copy</button>
|
|
1025
|
+
</div>
|
|
1026
|
+
<p class="under">The whole manual is <a href="/llms.txt">/llms.txt</a>${client}</p>
|
|
1027
|
+
</section>
|
|
1028
|
+
`
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* The footer, which is where a reader goes looking for the source.
|
|
1033
|
+
*
|
|
1034
|
+
* It said `Open source` and `Run your own: zbc add walgit` as plain text, which
|
|
1035
|
+
* is a claim with nowhere to check it: the page carried exactly two anchors,
|
|
1036
|
+
* one of them an in-page skip link, so anybody who wanted the repository, the
|
|
1037
|
+
* client or the manual had to retype a path from memory.
|
|
1038
|
+
*
|
|
1039
|
+
* The client's entry is gated like every other mention of it. The source and
|
|
1040
|
+
* the manual are not: walgit is open source wherever it is deployed, and
|
|
1041
|
+
* `/llms.txt` is served by every deployment.
|
|
1042
|
+
*/
|
|
1043
|
+
function footerLinks(caps: Capabilities): string {
|
|
1044
|
+
const rows = [
|
|
1045
|
+
' <a href="https://github.com/Zabaca/zbc">Open source</a>',
|
|
1046
|
+
caps.events
|
|
1047
|
+
? ' <a href="https://www.npmjs.com/package/@zabaca/agentgit">@zabaca/agentgit</a>'
|
|
1048
|
+
: '',
|
|
1049
|
+
' <a href="/llms.txt">The manual</a>',
|
|
1050
|
+
]
|
|
1051
|
+
return rows.filter((row) => row !== '').join('\n')
|
|
1052
|
+
}
|
|
1053
|
+
|
|
620
1054
|
/**
|
|
621
1055
|
* Every substitution passes a FUNCTION, never the string itself.
|
|
622
1056
|
*
|
|
623
1057
|
* `String.replace` reads `$` sequences in a replacement STRING as capture-group
|
|
624
|
-
* references, and these fragments
|
|
625
|
-
* `<span class="p">$</span>`, the
|
|
626
|
-
*
|
|
1058
|
+
* references, and these fragments carry them: every shell prompt is
|
|
1059
|
+
* `<span class="p">$</span>`, and the hero's credentialed form is
|
|
1060
|
+
* `https://walgit:$TOKEN@`. Today every one of those is left literal — there are no capture
|
|
627
1061
|
* groups in a string pattern — but that is a rule about what the fragments
|
|
628
1062
|
* happen to contain, re-checked on every copy edit, and the failure it guards
|
|
629
1063
|
* is silent: a command on the page that quietly differs from the one anybody
|
|
630
1064
|
* runs. A function replacer is not interpreted at all, so the question stops
|
|
631
1065
|
* being asked.
|
|
632
1066
|
*/
|
|
633
|
-
export function renderLanding(
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
1067
|
+
export function renderLanding(
|
|
1068
|
+
host: string,
|
|
1069
|
+
caps: Capabilities,
|
|
1070
|
+
/**
|
|
1071
|
+
* Who runs this deployment (`shared/operator.ts`), beside the capabilities
|
|
1072
|
+
* rather than folded into them: nothing branches on it and the push path
|
|
1073
|
+
* never sees it. Optional and `null` by default — a deployment that names
|
|
1074
|
+
* nobody renders the page it renders today, which is also what every test
|
|
1075
|
+
* fixture that is not about the operator wants to say.
|
|
1076
|
+
*/
|
|
1077
|
+
operator: Operator | null = null,
|
|
1078
|
+
): string {
|
|
1079
|
+
return (
|
|
1080
|
+
PAGE.replaceAll('{{HOST}}', () => host)
|
|
1081
|
+
// `replaceAll`, because the sentence written to travel now travels in
|
|
1082
|
+
// three places: the description, the Open Graph card and the Twitter card.
|
|
1083
|
+
// One rendering, substituted thrice — not three strings to keep in step.
|
|
1084
|
+
.replaceAll('{{META_DESCRIPTION}}', () => metaDescription(caps))
|
|
1085
|
+
.replace('{{HERO_UNDER}}', () => heroUnder(caps))
|
|
1086
|
+
.replace('{{CLAIMS}}', () => claims(caps))
|
|
1087
|
+
.replace('{{ROADMAP_LEDE}}', () => roadmapLede(caps))
|
|
1088
|
+
.replace('{{ROADMAP_OWNERSHIP}}', () => roadmapOwnership(caps))
|
|
1089
|
+
.replace('{{ROADMAP_PULLS}}', () => roadmapPulls(caps))
|
|
1090
|
+
.replace('{{CLIENT}}', () => clientChapter(caps))
|
|
1091
|
+
.replace('{{EVENTS}}', () => eventsSection(host, caps))
|
|
1092
|
+
.replace('{{COLLISION}}', () => collisionSection(host, caps))
|
|
1093
|
+
.replace('{{HANDOFF}}', () => handoffSection(host, caps))
|
|
1094
|
+
.replace('{{OWNERSHIP}}', () => ownershipSection(caps))
|
|
1095
|
+
.replace('{{GRANT}}', () => grantSection(host, caps))
|
|
1096
|
+
.replace('{{PRIVATE}}', () => privateSection(host, caps))
|
|
1097
|
+
.replace('{{CLOSE}}', () => closeSection(host, caps))
|
|
1098
|
+
.replace('{{FOOTER_LINKS}}', () => footerLinks(caps))
|
|
1099
|
+
.replace('{{WIRE_SCRIPT}}', () => (caps.events ? wireScript() : ''))
|
|
1100
|
+
.replace('{{PERMANENCE}}', () => permanence(caps))
|
|
1101
|
+
.replace('{{LIMITS}}', () => limits(caps))
|
|
1102
|
+
.replace('{{OPERATOR}}', () => operatorSection(caps, operator))
|
|
1103
|
+
)
|
|
644
1104
|
}
|
|
645
1105
|
|
|
646
1106
|
const WIRE_CLIENT = `
|
|
@@ -663,19 +1123,26 @@ const WIRE_CLIENT = `
|
|
|
663
1123
|
// takes them away to give them back in order, so no JavaScript, a script
|
|
664
1124
|
// that fails, or a request for less motion all leave the whole transcript
|
|
665
1125
|
// on screen.
|
|
666
|
-
|
|
667
|
-
|
|
1126
|
+
//
|
|
1127
|
+
// Every transcript on the page, not one by id: the collision panel below
|
|
1128
|
+
// the socket panel is the same illustration with a different script, and
|
|
1129
|
+
// each one arms and plays on its own as it scrolls into view.
|
|
1130
|
+
var txs = document.querySelectorAll(".tx");
|
|
1131
|
+
if (!txs.length || !("IntersectionObserver" in window)) return;
|
|
668
1132
|
if (window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
669
1133
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
1134
|
+
Array.prototype.forEach.call(txs, function (tx) {
|
|
1135
|
+
tx.classList.add("armed");
|
|
1136
|
+
var io = new IntersectionObserver(function (entries) {
|
|
1137
|
+
if (!entries[0] || !entries[0].isIntersecting) return;
|
|
1138
|
+
io.disconnect();
|
|
1139
|
+
// Played once. A transcript that restarted every time it came back
|
|
1140
|
+
// into view would read as a loop rather than as something that
|
|
1141
|
+
// happened.
|
|
1142
|
+
tx.classList.add("play");
|
|
1143
|
+
}, { threshold: 0.35 });
|
|
1144
|
+
io.observe(tx);
|
|
1145
|
+
});
|
|
679
1146
|
`
|
|
680
1147
|
|
|
681
1148
|
const PAGE = `<!doctype html>
|
|
@@ -685,6 +1152,30 @@ const PAGE = `<!doctype html>
|
|
|
685
1152
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
686
1153
|
<title>agentgit — Git for AI agents</title>
|
|
687
1154
|
<meta name="description" content="{{META_DESCRIPTION}}">
|
|
1155
|
+
<!-- The card this page becomes when somebody posts the link.
|
|
1156
|
+
The placement of this whole document is justified by aggregator traffic —
|
|
1157
|
+
a link on one sends thousands of people to the root, which is why the
|
|
1158
|
+
Worker answers it and never wakes the container. That argument was being
|
|
1159
|
+
made by a page with no card: posted to HN, Reddit, Slack or Discord it
|
|
1160
|
+
rendered as a bare hostname, so the one sentence written to travel
|
|
1161
|
+
(metaDescription) travelled nowhere.
|
|
1162
|
+
Same two strings as the title and the description, deliberately: a card
|
|
1163
|
+
that says something the page does not is the drift every rendered claim
|
|
1164
|
+
here exists to prevent, so the description below is the SAME rendering,
|
|
1165
|
+
not a second copy of it.
|
|
1166
|
+
No picture, and no card layout that needs one. A preview image has to be
|
|
1167
|
+
a fetchable raster at a stable URL, which means an asset in the Worker
|
|
1168
|
+
bundle and a route serving it, and neither exists yet. The summary card is
|
|
1169
|
+
the one that is honest without a picture; the wide variant pointing at
|
|
1170
|
+
nothing degrades worse than this does. -->
|
|
1171
|
+
<meta property="og:type" content="website">
|
|
1172
|
+
<meta property="og:site_name" content="agentgit">
|
|
1173
|
+
<meta property="og:title" content="agentgit — Git for AI agents">
|
|
1174
|
+
<meta property="og:description" content="{{META_DESCRIPTION}}">
|
|
1175
|
+
<meta property="og:url" content="https://{{HOST}}/">
|
|
1176
|
+
<meta name="twitter:card" content="summary">
|
|
1177
|
+
<meta name="twitter:title" content="agentgit — Git for AI agents">
|
|
1178
|
+
<meta name="twitter:description" content="{{META_DESCRIPTION}}">
|
|
688
1179
|
<!-- The agent-facing version of this page. GET / splits on Accept: a browser
|
|
689
1180
|
gets this HTML, everything else gets the manual as text. Fetch tools that
|
|
690
1181
|
agents drive send a browser's Accept, so they land here; this is how they
|
|
@@ -790,11 +1281,12 @@ const PAGE = `<!doctype html>
|
|
|
790
1281
|
font-size: clamp(1.15rem, 2.9vw, 1.5rem);
|
|
791
1282
|
line-height: 1.5;
|
|
792
1283
|
color: var(--bone);
|
|
793
|
-
|
|
1284
|
+
/* Three lines, one sentence each, broken by hand — so the column has to
|
|
1285
|
+
hold the longest of them unwrapped, and the promise is 42 characters. */
|
|
1286
|
+
max-width: 46ch;
|
|
794
1287
|
margin: 0 0 2.75rem;
|
|
795
1288
|
}
|
|
796
1289
|
.lede em { font-style: normal; color: var(--copper); }
|
|
797
|
-
|
|
798
1290
|
/* ── the command, which is the CTA ────────────────────── */
|
|
799
1291
|
|
|
800
1292
|
.cta { margin: 0 0 1rem; max-width: 44rem; }
|
|
@@ -1032,7 +1524,9 @@ const PAGE = `<!doctype html>
|
|
|
1032
1524
|
display: grid;
|
|
1033
1525
|
grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
|
|
1034
1526
|
gap: 0 2.5rem;
|
|
1035
|
-
|
|
1527
|
+
/* The illustration sits at the vertical middle of the prose beside it,
|
|
1528
|
+
so a shorter transcript is not left hanging off the top of a column. */
|
|
1529
|
+
align-items: center;
|
|
1036
1530
|
}
|
|
1037
1531
|
/* A grid item defaults to min-width:auto, so a track cannot shrink below its
|
|
1038
1532
|
content's min-content width — and .tx is white-space:pre with 53-character
|
|
@@ -1136,6 +1630,39 @@ const PAGE = `<!doctype html>
|
|
|
1136
1630
|
margin: 0;
|
|
1137
1631
|
}
|
|
1138
1632
|
|
|
1633
|
+
/* A chapter break: the rule says "different subject", the kicker names it,
|
|
1634
|
+
and the paragraph is the widest prose on the page because it has no
|
|
1635
|
+
illustration to share the row with. */
|
|
1636
|
+
.chapter {
|
|
1637
|
+
margin-top: 6rem;
|
|
1638
|
+
padding-top: 2.5rem;
|
|
1639
|
+
border-top: 1px solid var(--rule-2);
|
|
1640
|
+
}
|
|
1641
|
+
.chapter .kicker {
|
|
1642
|
+
display: block;
|
|
1643
|
+
font-family: var(--mono);
|
|
1644
|
+
font-size: .72rem;
|
|
1645
|
+
letter-spacing: .12em;
|
|
1646
|
+
text-transform: uppercase;
|
|
1647
|
+
color: var(--verdi);
|
|
1648
|
+
margin-bottom: 1rem;
|
|
1649
|
+
}
|
|
1650
|
+
.chapter p { max-width: 58ch; }
|
|
1651
|
+
.chapter .term-solo { margin-top: 1.75rem; }
|
|
1652
|
+
|
|
1653
|
+
/* The last block, and the only one after it is the footer. The command is
|
|
1654
|
+
the point of it, so the prose above is one line and the type is the
|
|
1655
|
+
hero's rather than a section's. */
|
|
1656
|
+
.close { margin-top: 5rem; }
|
|
1657
|
+
.close p { font-size: 1.08rem; max-width: 50ch; margin-bottom: 1.4rem; }
|
|
1658
|
+
/* Not the faint italic every other section's em is: this one is stress on
|
|
1659
|
+
the word the whole page turns on, not something the tool said. */
|
|
1660
|
+
.close p em { font-style: normal; color: var(--copper); }
|
|
1661
|
+
/* The hero's width, not the 34rem of .term-solo: this is the same command,
|
|
1662
|
+
and at 34rem the host is long enough to push the URL into a scroll nobody
|
|
1663
|
+
scrolls — a closing command a reader cannot read is not a call to act. */
|
|
1664
|
+
.close .term { max-width: 44rem; margin-bottom: .75rem; }
|
|
1665
|
+
|
|
1139
1666
|
footer {
|
|
1140
1667
|
margin-top: 5rem;
|
|
1141
1668
|
padding-top: 1.4rem;
|
|
@@ -1174,11 +1701,11 @@ const PAGE = `<!doctype html>
|
|
|
1174
1701
|
<div class="wrap">
|
|
1175
1702
|
|
|
1176
1703
|
<main id="start">
|
|
1177
|
-
<span class="badge">
|
|
1704
|
+
<span class="badge">agentgit — open source, run your own</span>
|
|
1178
1705
|
|
|
1179
1706
|
<h1>Git for AI agents<span class="dot">.</span></h1>
|
|
1180
1707
|
|
|
1181
|
-
<p class="lede">Your agent
|
|
1708
|
+
<p class="lede">You have GitHub.<br>Your agent does not.<br><em>Push to a name and the repository exists.</em></p>
|
|
1182
1709
|
|
|
1183
1710
|
<div class="cta">
|
|
1184
1711
|
<label class="repo-field" for="repo">
|
|
@@ -1197,7 +1724,7 @@ const PAGE = `<!doctype html>
|
|
|
1197
1724
|
</div>
|
|
1198
1725
|
</div>
|
|
1199
1726
|
<p class="under" id="repo-help">{{HERO_UNDER}}</p>
|
|
1200
|
-
{{
|
|
1727
|
+
{{HANDOFF}}{{OWNERSHIP}}{{GRANT}}{{PRIVATE}}{{CLIENT}}{{EVENTS}}{{COLLISION}}
|
|
1201
1728
|
<section>
|
|
1202
1729
|
<h2>The rules.</h2>
|
|
1203
1730
|
<ul class="claims">
|
|
@@ -1206,24 +1733,25 @@ const PAGE = `<!doctype html>
|
|
|
1206
1733
|
</section>
|
|
1207
1734
|
|
|
1208
1735
|
<section>
|
|
1209
|
-
<h2>
|
|
1210
|
-
<p>
|
|
1736
|
+
<h2>What's next.</h2>
|
|
1737
|
+
<p>{{ROADMAP_LEDE}}</p>
|
|
1211
1738
|
<ul class="road">
|
|
1212
1739
|
{{ROADMAP_OWNERSHIP}}
|
|
1213
1740
|
{{ROADMAP_PULLS}}
|
|
1214
1741
|
<li>
|
|
1215
|
-
<span class="when">
|
|
1742
|
+
<span class="when">Soon</span>
|
|
1216
1743
|
<h3>CI</h3>
|
|
1217
|
-
<p>A ref moving is already an event
|
|
1744
|
+
<p>A ref moving is already an event and the client already runs a command on it, so the step left is running that command somewhere other than your laptop.</p>
|
|
1218
1745
|
</li>
|
|
1219
1746
|
</ul>
|
|
1220
|
-
<p class="caveat">{{PERMANENCE}} Not a place for anything you cannot lose
|
|
1747
|
+
<p class="caveat">{{PERMANENCE}} Not a place for anything you cannot lose.{{LIMITS}}</p>
|
|
1221
1748
|
</section>
|
|
1749
|
+
{{OPERATOR}}{{CLOSE}}
|
|
1222
1750
|
</main>
|
|
1223
1751
|
|
|
1224
1752
|
<footer>
|
|
1225
1753
|
<span>agentgit</span>
|
|
1226
|
-
|
|
1754
|
+
{{FOOTER_LINKS}}
|
|
1227
1755
|
<span>Run your own: <code>zbc add walgit</code></span>
|
|
1228
1756
|
</footer>
|
|
1229
1757
|
</div>
|
|
@@ -1239,7 +1767,10 @@ const PAGE = `<!doctype html>
|
|
|
1239
1767
|
// near-identical prompts at the same time, and a plain name is probably
|
|
1240
1768
|
// taken — is better given as the default anyone starts from.
|
|
1241
1769
|
var field = document.getElementById("repo");
|
|
1242
|
-
|
|
1770
|
+
// Both places the command appears: the hero, and the closing block that
|
|
1771
|
+
// sends a reader who scrolled the whole page back to it. One field feeds
|
|
1772
|
+
// both, so the page never shows two different names.
|
|
1773
|
+
var echoes = [document.getElementById("repo-echo"), document.getElementById("repo-echo-end")];
|
|
1243
1774
|
|
|
1244
1775
|
var chars = "abcdefghjkmnpqrstuvwxyz23456789";
|
|
1245
1776
|
var suffix = "";
|
|
@@ -1254,7 +1785,10 @@ const PAGE = `<!doctype html>
|
|
|
1254
1785
|
};
|
|
1255
1786
|
|
|
1256
1787
|
var render = function () {
|
|
1257
|
-
|
|
1788
|
+
var name = clean(field.value) || "my-thing";
|
|
1789
|
+
for (var e = 0; e < echoes.length; e++) {
|
|
1790
|
+
if (echoes[e]) echoes[e].textContent = name;
|
|
1791
|
+
}
|
|
1258
1792
|
};
|
|
1259
1793
|
|
|
1260
1794
|
field.value = "my-thing-" + suffix;
|
|
@@ -1329,6 +1863,7 @@ const PAGE = `<!doctype html>
|
|
|
1329
1863
|
|
|
1330
1864
|
copy(document.getElementById("copy"));
|
|
1331
1865
|
copy(document.getElementById("copy-watch"));
|
|
1866
|
+
copy(document.getElementById("copy-end"));
|
|
1332
1867
|
|
|
1333
1868
|
{{WIRE_SCRIPT}}
|
|
1334
1869
|
})();
|