@strangenoob/colophon 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 StrangeNoob
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/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # colophon
2
+
3
+ Publish a directory to the web and get back one governed, versioned URL.
4
+
5
+ ```bash
6
+ npm i -g @strangenoob/colophon
7
+
8
+ export COLOPHON_TOKEN=colo_live_… # app.colophon.fyi → Keys
9
+ colophon publish ./report --name "Q3 report"
10
+ # → https://<workspace>.usercontent.colophon.fyi/report/
11
+ ```
12
+
13
+ Publishing again with the same slug replaces what is live and **keeps the URL**. The previous
14
+ version is kept and can be rolled back from the dashboard, so a link you have already given
15
+ someone stays correct as the work changes.
16
+
17
+ ## Commands
18
+
19
+ ```
20
+ colophon publish <dir> [--name N] [--slug S] [--visibility V]
21
+ colophon list
22
+ colophon delete <slug|id>
23
+ colophon link <url> [--code C] [--title T]
24
+ colophon whoami
25
+ ```
26
+
27
+ `--slug` fixes the URL path. Pass it explicitly when you intend to update the site later, so
28
+ that renaming it cannot move the URL.
29
+
30
+ ## Visibility
31
+
32
+ Defaults to `unlisted` — the one that matches what people usually mean by "send me a link".
33
+
34
+ | | Who can open it |
35
+ |---|---|
36
+ | `public` | Anyone. Indexed by search engines. |
37
+ | `unlisted` | Anyone with the link. Not indexed. Default. |
38
+ | `restricted` | Workspace members, plus named email addresses. Each signs in first. |
39
+ | `private` | Workspace members only. |
40
+
41
+ ## What is not uploaded
42
+
43
+ `.git`, `.env`, `node_modules`, `.next`, `.venv`, `__pycache__`, and editor junk are skipped.
44
+ This is a convenience, not a security boundary — the server validates every entry too — but a
45
+ published `.git` means the whole history is fetchable over HTTP, and by then the mistake has
46
+ already happened.
47
+
48
+ ## Environment
49
+
50
+ | | |
51
+ |---|---|
52
+ | `COLOPHON_TOKEN` | API key, from the dashboard's Keys tab. Required. |
53
+ | `COLOPHON_API` | API origin. Defaults to `https://api.usercontent.colophon.fyi`. |
54
+
55
+ ## Requirements
56
+
57
+ Node 22.18 or newer — the CLI ships as TypeScript and Node strips the types itself, so there
58
+ is no build step and no compiled copy to fall out of date.
59
+
60
+ MIT © StrangeNoob
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ // Version gate, then hand over to the compiled entry point.
3
+ //
4
+ // The source is TypeScript and the repo runs it directly — Node strips types itself, so there
5
+ // is no build step during development. A *published* package cannot do that: Node refuses to
6
+ // strip types anywhere under node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING), on
7
+ // every version. So `prepack` compiles to dist/ and this loads that.
8
+ //
9
+ // The gate stays because compiled ES2023 still fails to parse on an old Node, and it fails
10
+ // while parsing — which no guard inside cli.js could catch. This shim is deliberately plain,
11
+ // conservative JS so that it always parses and can say what is actually wrong.
12
+
13
+ const [major] = process.versions.node.split('.').map(Number);
14
+ if (major < 18) {
15
+ process.stderr.write(
16
+ 'colophon needs Node 18 or newer (this is ' + process.versions.node + ').\n');
17
+ process.exit(1);
18
+ }
19
+
20
+ await import('../dist/cli.js');
package/dist/cli.js ADDED
@@ -0,0 +1,223 @@
1
+ #!/usr/bin/env node
2
+ // The agent's front door.
3
+ //
4
+ // Everything here exists so that publishing a directory is one command with no ceremony:
5
+ // no tarball to build, no multipart form to assemble, no id to look up. The dashboard is
6
+ // for people; this is for the thing that made the files.
7
+ //
8
+ // Runs as TypeScript directly — Node strips types from 22.18 on, so there is no build step
9
+ // and no dist/ to fall out of date with src/.
10
+ import { readdir, stat } from 'node:fs/promises';
11
+ import { basename, join, resolve } from 'node:path';
12
+ import { create } from 'tar';
13
+ const API = (process.env.COLOPHON_API ?? 'https://api.usercontent.colophon.fyi').replace(/\/+$/, '');
14
+ const TOKEN = process.env.COLOPHON_TOKEN ?? '';
15
+ const USAGE = `colophon — publish a directory to the web
16
+
17
+ colophon publish <dir> [--name N] [--slug S] [--visibility V]
18
+ colophon list
19
+ colophon delete <slug|id>
20
+ colophon link <url> [--code C] [--title T]
21
+ colophon whoami
22
+
23
+ Visibility is one of public, unlisted, restricted, private (default: unlisted).
24
+
25
+ Environment
26
+ COLOPHON_TOKEN API key from the dashboard, Keys tab. Required.
27
+ COLOPHON_API API origin. Default ${API}
28
+ `;
29
+ class Fail extends Error {
30
+ }
31
+ // ─────────────────────────────────────────────────────────────────── transport
32
+ async function api(path, init = {}) {
33
+ if (!TOKEN)
34
+ throw new Fail('COLOPHON_TOKEN is not set. Create a key in the dashboard, Keys tab.');
35
+ let res;
36
+ try {
37
+ res = await fetch(`${API}${path}`, {
38
+ ...init,
39
+ headers: { authorization: `Bearer ${TOKEN}`, ...(init.headers ?? {}) },
40
+ });
41
+ }
42
+ catch (e) {
43
+ // A DNS or TLS failure here is almost always COLOPHON_API pointing at nothing, and the
44
+ // raw fetch message ("fetch failed") says none of that.
45
+ throw new Fail(`could not reach ${API} — ${e instanceof Error ? e.message : e}`);
46
+ }
47
+ const body = await res.json().catch(() => ({}));
48
+ if (!res.ok)
49
+ throw new Fail(body.error ?? `${res.status} ${res.statusText}`);
50
+ return body;
51
+ }
52
+ // ─────────────────────────────────────────────────────────────────── packing
53
+ /**
54
+ * Refuse to upload things a static site never wants published.
55
+ *
56
+ * This is a courtesy, not a security boundary — the server re-validates every entry. But
57
+ * `.git` in a published directory means the whole history is fetchable over HTTP, and
58
+ * `.env` means the secrets are, and by the time either is on the internet the mistake has
59
+ * already happened. Cheaper to never send them.
60
+ */
61
+ const SKIP = new Set(['.git', '.env', 'node_modules', '.DS_Store', '.next', '.venv', '__pycache__']);
62
+ const skip = (name) => SKIP.has(name) || name.startsWith('._') || name.endsWith('.env');
63
+ async function entries(dir, prefix = '') {
64
+ const out = [];
65
+ for (const e of await readdir(dir, { withFileTypes: true })) {
66
+ if (skip(e.name))
67
+ continue;
68
+ const rel = prefix ? `${prefix}/${e.name}` : e.name;
69
+ if (e.isDirectory())
70
+ out.push(...await entries(join(dir, e.name), rel));
71
+ else if (e.isFile())
72
+ out.push(rel);
73
+ }
74
+ return out;
75
+ }
76
+ async function pack(dir) {
77
+ const files = await entries(dir);
78
+ if (!files.length)
79
+ throw new Fail(`${dir} contains no files to publish`);
80
+ if (!files.includes('index.html')) {
81
+ // Not fatal — a site can be a single named page — but silently serving a 404 at the
82
+ // root is the confusing outcome, so say it now rather than after the upload.
83
+ process.stderr.write(`note: no index.html at the top level; the site root will 404\n`);
84
+ }
85
+ // portable:true drops uid/gid/atime, so the same directory packs to the same bytes twice
86
+ // — which is what makes the server's content-addressed dedup actually dedup.
87
+ const chunks = [];
88
+ for await (const c of create({ gzip: true, cwd: dir, portable: true }, files)) {
89
+ chunks.push(Buffer.from(c));
90
+ }
91
+ // Copied into a freshly allocated Uint8Array rather than handed Buffer.concat's own view:
92
+ // a Node Buffer can sit on a SharedArrayBuffer, which is not a BlobPart.
93
+ const merged = Buffer.concat(chunks);
94
+ const bytes = new Uint8Array(merged.byteLength);
95
+ bytes.set(merged);
96
+ return { blob: new Blob([bytes], { type: 'application/gzip' }), files };
97
+ }
98
+ // ──────────────────────────────────────────────────────────────── flag parsing
99
+ function parse(argv) {
100
+ const positional = [];
101
+ const flags = {};
102
+ for (let i = 0; i < argv.length; i++) {
103
+ const a = argv[i];
104
+ if (a.startsWith('--')) {
105
+ const eq = a.indexOf('=');
106
+ if (eq !== -1) {
107
+ flags[a.slice(2, eq)] = a.slice(eq + 1);
108
+ continue;
109
+ }
110
+ const next = argv[i + 1];
111
+ if (next === undefined || next.startsWith('--'))
112
+ throw new Fail(`${a} needs a value`);
113
+ flags[a.slice(2)] = next;
114
+ i++;
115
+ }
116
+ else
117
+ positional.push(a);
118
+ }
119
+ return { positional, flags };
120
+ }
121
+ const kb = (n) => (n < 1024 ? `${n} B` : `${(n / 1024).toFixed(1)} KB`);
122
+ // ────────────────────────────────────────────────────────────────── commands
123
+ async function publish(positional, flags) {
124
+ const dir = resolve(positional[0] ?? '.');
125
+ if (!(await stat(dir).catch(() => null))?.isDirectory())
126
+ throw new Fail(`${dir} is not a directory`);
127
+ const { blob, files } = await pack(dir);
128
+ const form = new FormData();
129
+ form.set('archive', blob, 'site.tar.gz');
130
+ form.set('name', flags.name ?? basename(dir));
131
+ if (flags.slug)
132
+ form.set('slug', flags.slug);
133
+ form.set('visibility', flags.visibility ?? 'unlisted');
134
+ const r = await api('/api/v1/sites', { method: 'POST', body: form });
135
+ if (r.held) {
136
+ process.stdout.write(`held for review — ${(r.reasons ?? []).join(', ') || 'flagged'}\n`);
137
+ process.stdout.write(`${r.url}\n`);
138
+ return;
139
+ }
140
+ process.stdout.write(`${r.url}\n`);
141
+ process.stderr.write(`${r.files} files, ${kb(r.bytes)}, ${r.new_blobs} new\n`);
142
+ }
143
+ async function list() {
144
+ const { sites } = await api('/api/v1/sites');
145
+ if (!sites.length) {
146
+ process.stderr.write('no sites published yet\n');
147
+ return;
148
+ }
149
+ const w = Math.max(...sites.map((s) => s.slug.length));
150
+ for (const s of sites) {
151
+ process.stdout.write(`${s.slug.padEnd(w)} ${s.visibility.padEnd(10)} ${s.url}\n`);
152
+ }
153
+ }
154
+ async function remove(positional) {
155
+ const ref = positional[0];
156
+ if (!ref)
157
+ throw new Fail('which site? pass a slug or id');
158
+ // Slugs are what a person remembers and what `list` prints, so accept either and resolve
159
+ // the slug here rather than making the caller look the id up.
160
+ let id = ref;
161
+ if (!/^[0-9a-f-]{36}$/i.test(ref)) {
162
+ const { sites } = await api('/api/v1/sites');
163
+ const hit = sites.find((s) => s.slug === ref);
164
+ if (!hit)
165
+ throw new Fail(`no site with slug '${ref}'`);
166
+ id = hit.id;
167
+ }
168
+ const r = await api(`/api/v1/sites/${id}`, { method: 'DELETE' });
169
+ process.stdout.write(`deleted ${r.slug} (${r.versions} version${r.versions === 1 ? '' : 's'})\n`);
170
+ }
171
+ async function link(positional, flags) {
172
+ const url = positional[0];
173
+ if (!url)
174
+ throw new Fail('which URL? pass the target');
175
+ const r = await api('/api/v1/links', {
176
+ method: 'POST',
177
+ headers: { 'content-type': 'application/json' },
178
+ body: JSON.stringify({ url, code: flags.code ?? null, title: flags.title ?? null }),
179
+ });
180
+ process.stdout.write(`${r.url}\n`);
181
+ }
182
+ async function whoami() {
183
+ const r = await api('/api/v1/whoami');
184
+ process.stdout.write(`${r.tenant.name} (${r.tenant.subdomain})\n`);
185
+ process.stderr.write(`key scopes: ${r.key.scopes.join(', ')}\n`);
186
+ }
187
+ // ────────────────────────────────────────────────────────────────────── main
188
+ const [command, ...rest] = process.argv.slice(2);
189
+ try {
190
+ if (!command || command === 'help' || command === '--help' || command === '-h') {
191
+ process.stdout.write(USAGE);
192
+ process.exit(0);
193
+ }
194
+ const { positional, flags } = parse(rest);
195
+ switch (command) {
196
+ case 'publish':
197
+ await publish(positional, flags);
198
+ break;
199
+ case 'list':
200
+ await list();
201
+ break;
202
+ case 'delete':
203
+ await remove(positional);
204
+ break;
205
+ case 'link':
206
+ await link(positional, flags);
207
+ break;
208
+ case 'whoami':
209
+ await whoami();
210
+ break;
211
+ default: throw new Fail(`unknown command '${command}'. Try: colophon help`);
212
+ }
213
+ }
214
+ catch (e) {
215
+ // Fail carries a message meant for a human (or an agent reading stderr). Anything else is
216
+ // a bug here, and its stack is worth more than a tidy one-liner.
217
+ if (e instanceof Fail) {
218
+ process.stderr.write(`error: ${e.message}\n`);
219
+ process.exit(1);
220
+ }
221
+ throw e;
222
+ }
223
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,0BAA0B;AAC1B,EAAE;AACF,yFAAyF;AACzF,yFAAyF;AACzF,yDAAyD;AACzD,EAAE;AACF,2FAA2F;AAC3F,8CAA8C;AAE9C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,sCAAsC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACrG,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC;AAE/C,MAAM,KAAK,GAAG;;;;;;;;;;;;yCAY2B,GAAG;CAC3C,CAAC;AAEF,MAAM,IAAK,SAAQ,KAAK;CAAG;AAE3B,gFAAgF;AAEhF,KAAK,UAAU,GAAG,CAAC,IAAY,EAAE,OAAoB,EAAE;IACrD,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,IAAI,CAAC,qEAAqE,CAAC,CAAC;IAClG,IAAI,GAAa,CAAC;IAClB,IAAI,CAAC;QACH,GAAG,GAA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IAC1C,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,SAAS;YAAE,MAAM,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAAC,MAAM;QACxD,KAAK,MAAM;YAAK,MAAM,IAAI,EAAE,CAAC;YAAC,MAAM;QACpC,KAAK,QAAQ;YAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;YAAC,MAAM;QAChD,KAAK,MAAM;YAAK,MAAM,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAAC,MAAM;QACrD,KAAK,QAAQ;YAAG,MAAM,MAAM,EAAE,CAAC;YAAC,MAAM;QACtC,OAAO,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,oBAAoB,OAAO,uBAAuB,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC;AAAC,OAAO,CAAC,EAAE,CAAC;IACX,0FAA0F;IAC1F,iEAAiE;IACjE,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;QAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;QAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAAC,CAAC;IAC1F,MAAM,CAAC,CAAC;AACV,CAAC"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@strangenoob/colophon",
3
+ "version": "0.1.0",
4
+ "description": "Publish a directory to the web and get back one governed, versioned URL.",
5
+ "keywords": [
6
+ "colophon",
7
+ "publish",
8
+ "static-site",
9
+ "hosting",
10
+ "agent",
11
+ "cli"
12
+ ],
13
+ "license": "MIT",
14
+ "author": "StrangeNoob",
15
+ "homepage": "https://colophon.fyi",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/StrangeNoob/colophon.git",
19
+ "directory": "packages/cli"
20
+ },
21
+ "bugs": "https://github.com/StrangeNoob/colophon/issues",
22
+ "type": "module",
23
+ "bin": {
24
+ "colophon": "bin/colophon.mjs"
25
+ },
26
+ "files": [
27
+ "bin",
28
+ "dist",
29
+ "README.md"
30
+ ],
31
+ "engines": {
32
+ "node": ">=18"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "scripts": {
38
+ "build": "tsc -p tsconfig.build.json",
39
+ "typecheck": "tsc -p .",
40
+ "prepack": "npm run build"
41
+ },
42
+ "dependencies": {
43
+ "tar": "^7.5.22"
44
+ }
45
+ }