Skip to content

Commit 8983d4b

Browse files
sh1pt-actions-fleet[bot]ralyodioclaude
authored
packages: /packages/<short-name> links; Ollama model + update tips (#274)
- w3bs.org/packages/ollama (any unambiguous short name) 301s to the full id page, e.g. /packages/ollama.com/ollama; ambiguous/unknown names 404. - Ollama entry: "Try a model" example (ollama run hf.co/profullstack/saas-business-strategist-agent-GGUF, hf.co/ needs Ollama 0.3.13+) and the update tip (rerun the installer; sudo + systemd on Linux, Ollama.app on macOS). Co-authored-by: Anthony Ettinger <anthony@profullstack.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e11a4f5 commit 8983d4b

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

‎catalog/catalog.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,6 +2223,14 @@
22232223
{
22242224
"run": "ollama launch claude",
22252225
"does": "Launch Claude Code wired to a local Ollama model"
2226+
},
2227+
{
2228+
"run": "ollama run hf.co/profullstack/saas-business-strategist-agent-GGUF",
2229+
"does": "Try a model: Profullstack's CPU-friendly SaaS business strategist from Hugging Face (hf.co/ models need Ollama 0.3.13 or later)"
2230+
},
2231+
{
2232+
"run": "curl -fsSL https://ollama.com/install.sh | sh",
2233+
"does": "Update: rerun the installer (w3bs update does this for you). On Linux it uses sudo to install a systemd service; on macOS it installs Ollama.app"
22262234
}
22272235
],
22282236
"description": "Runs open-weight language models locally behind a CLI and a local HTTP API.",

‎src/server.mjs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,21 @@ export function createApp({
447447
const query = req.originalUrl.indexOf('?');
448448
res.redirect(301, `/desktop${query === -1 ? '' : req.originalUrl.slice(query)}`);
449449
});
450+
// Short package links: w3bs.org/packages/ollama -> /packages/ollama.com/ollama when exactly one
451+
// catalog entry has that short name (the part after the slash, or its display name), the same
452+
// rule `w3bs install <short-name>` uses. Ambiguous or unknown names fall through to a 404.
453+
app.get('/packages/:name', async (req, res, next) => {
454+
const short = String(req.params.name).toLowerCase();
455+
const hits = (await store.packages('')).filter(
456+
(item) => item.id.split('/')[1] === short || String(item.name).toLowerCase() === short,
457+
);
458+
if (hits.length !== 1) return next();
459+
const query = req.originalUrl.indexOf('?');
460+
res.redirect(
461+
301,
462+
`/packages/${hits[0].id}${query === -1 ? '' : req.originalUrl.slice(query)}`,
463+
);
464+
});
450465
app.get(/.*/, async (req, res, next) => {
451466
try {
452467
res.type('html').send(

‎test/site.test.mjs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,21 @@ test('/os offers only what exists: Docker now, the ISO from the newest os-v* rel
203203
await t.close();
204204
}
205205
});
206+
207+
test('/packages/<short-name> redirects to the full package id; the Ollama page shows the model tip', async () => {
208+
const t = await boot();
209+
try {
210+
const res = await fetch(`${t.base}/packages/ollama`, { redirect: 'manual' });
211+
assert.equal(res.status, 301);
212+
assert.equal(res.headers.get('location'), '/packages/ollama.com/ollama');
213+
const html = await (await fetch(`${t.base}/packages/ollama.com/ollama`)).text();
214+
assert.ok(html.includes('curl -fsSL https://ollama.com/install.sh | sh'));
215+
assert.ok(html.includes('ollama run hf.co/profullstack/saas-business-strategist-agent-GGUF'));
216+
assert.match(html, /0\.3\.13/);
217+
// Unknown short names and the publish page are untouched.
218+
assert.equal((await fetch(`${t.base}/packages/no-such-tool`, { redirect: 'manual' })).status, 404);
219+
assert.equal((await fetch(`${t.base}/packages/publish`, { redirect: 'manual' })).status, 200);
220+
} finally {
221+
await t.close();
222+
}
223+
});

0 commit comments

Comments
 (0)