@wirl/mcp 0.2.4 → 0.2.5
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/bin.js +56 -7
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -3013,7 +3013,7 @@ var init_version = __esm({
|
|
|
3013
3013
|
"packages/core/src/version.ts"() {
|
|
3014
3014
|
"use strict";
|
|
3015
3015
|
WORKSPACE_VERSION = "0.0.0";
|
|
3016
|
-
BUILT_VERSION = true ? "0.2.
|
|
3016
|
+
BUILT_VERSION = true ? "0.2.5" : null;
|
|
3017
3017
|
}
|
|
3018
3018
|
});
|
|
3019
3019
|
|
|
@@ -5321,7 +5321,8 @@ var SERVER_HEAD = String.raw`/**
|
|
|
5321
5321
|
* and what you get. Under them, the app's pages on app.wirl.dev.
|
|
5322
5322
|
*
|
|
5323
5323
|
* The whole app is this one file:
|
|
5324
|
-
* - The page is HTML this module returns: plain forms,
|
|
5324
|
+
* - The page is HTML this module returns: plain forms, and one small script
|
|
5325
|
+
* for the Copy prompt buttons.
|
|
5325
5326
|
* - Notes live in env.DB, a SQLite database that belongs to this app alone.
|
|
5326
5327
|
* Its tables are in migrations/0001_init.sql, and wirl applies each new
|
|
5327
5328
|
* file in migrations/ before a version goes live. Put the next change in
|
|
@@ -5486,17 +5487,30 @@ async function page(request, url, me, env) {
|
|
|
5486
5487
|
"<style>" + STYLE + "</style>",
|
|
5487
5488
|
"<main>",
|
|
5488
5489
|
"<header><h1>" + TITLE + "</h1>",
|
|
5489
|
-
"<p class='dim'>
|
|
5490
|
+
"<p class='dim'>Signed in as <b>" + escape(me.name) + "</b>" + (me.role ? " (" + escape(me.role) + ")" : "") + ".</p></header>",
|
|
5491
|
+
me.role === "owner" ? welcome() : "",
|
|
5490
5492
|
shown,
|
|
5491
5493
|
"<ul class='notes'>" + (notes.length === 0 ? "<li class='dim'>Nothing here yet.</li>" : notes.map((note) => card(note, me, archived)).join("")) + "</ul>",
|
|
5492
5494
|
"<p class='dim'>Nightly tidy-up, which archives notes older than " + ARCHIVE_AFTER_DAYS + " days that nobody pinned: " +
|
|
5493
5495
|
(lastRun ? "last run " + escape(lastRun.ran_at.slice(0, 16)) + " UTC: " + escape(lastRun.note) : "Not run yet.") + "</p>",
|
|
5494
5496
|
prompts(request),
|
|
5495
5497
|
"</main>",
|
|
5498
|
+
COPY_SCRIPT,
|
|
5496
5499
|
"</html>",
|
|
5497
5500
|
].join("\n");
|
|
5498
5501
|
}
|
|
5499
5502
|
|
|
5503
|
+
// For the app's owner only: what this is, in a box above the note form.
|
|
5504
|
+
function welcome() {
|
|
5505
|
+
return [
|
|
5506
|
+
"<section class='welcome'>",
|
|
5507
|
+
"<p class='kicker'>Your first app on wirl</p>",
|
|
5508
|
+
"<h2>Your coding agent just built this, and it's live.</h2>",
|
|
5509
|
+
"<p>A small team noticeboard: notes, a nightly tidy-up, company sign-in, its own database. It runs at this address, it's private to you until you share it, and it's yours to change. Try out the app below and then customize it.</p>",
|
|
5510
|
+
"</section>",
|
|
5511
|
+
].join("");
|
|
5512
|
+
}
|
|
5513
|
+
|
|
5500
5514
|
function form() {
|
|
5501
5515
|
return [
|
|
5502
5516
|
"<form class='add' method='post' action='/notes'>",
|
|
@@ -5567,12 +5581,16 @@ function prompts(request) {
|
|
|
5567
5581
|
const step = (each) => {
|
|
5568
5582
|
const stop = each.capability.indexOf(". ");
|
|
5569
5583
|
return (
|
|
5570
|
-
"<li class='step" + (each.optional ? " optional" : "") + "'>" +
|
|
5584
|
+
"<li class='step" + (each.number === 1 ? " first" : "") + (each.optional ? " optional" : "") + "'>" +
|
|
5571
5585
|
"<h3><span class='number'>" + each.number + "</span> " + escape(each.title) +
|
|
5586
|
+
(each.number === 1 ? " <span class='badge start'>Start here</span>" : "") +
|
|
5572
5587
|
(each.optional ? " <span class='badge'>Optional. The big one.</span>" : "") + "</h3>" +
|
|
5573
5588
|
"<p class='dim'><b>" + escape(each.capability.slice(0, stop + 1)) + "</b> " + escape(each.capability.slice(stop + 2)) + "</p>" +
|
|
5574
|
-
"<
|
|
5575
|
-
"<
|
|
5589
|
+
"<div class='getrow'>" +
|
|
5590
|
+
"<button type='button' class='copy' data-copy-for='prompt-" + each.number + "'>Copy prompt</button>" +
|
|
5591
|
+
"<p class='dim'>You get: " + escape(each.youGet) + "</p></div>" +
|
|
5592
|
+
"<details class='prompt'><summary>Show the prompt</summary>" +
|
|
5593
|
+
"<pre id='prompt-" + each.number + "'>" + escape(each.prompt) + "</pre></details>" +
|
|
5576
5594
|
"</li>"
|
|
5577
5595
|
);
|
|
5578
5596
|
};
|
|
@@ -5600,6 +5618,7 @@ const STYLE = [
|
|
|
5600
5618
|
"a { color: var(--accent); } .dim { color: var(--dim); }",
|
|
5601
5619
|
"form.add, form.edit { display: grid; gap: 8px; margin: 16px 0 8px; }",
|
|
5602
5620
|
"textarea, input, button { font: inherit; color: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }",
|
|
5621
|
+
"button.copy { min-height: 44px; margin-top: 4px; }",
|
|
5603
5622
|
"button { cursor: pointer; } button.primary { justify-self: start; background: var(--accent); border-color: var(--accent); color: var(--bg); }",
|
|
5604
5623
|
"ul.notes { list-style: none; padding: 0; display: grid; gap: 10px; }",
|
|
5605
5624
|
".note { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }",
|
|
@@ -5616,11 +5635,41 @@ const STYLE = [
|
|
|
5616
5635
|
".number { font-size: 12px; background: var(--ink); color: var(--bg); padding: 2px 7px; border-radius: 5px; }",
|
|
5617
5636
|
".optional .number { background: var(--accent); }",
|
|
5618
5637
|
".badge { font-size: 12px; font-weight: 600; color: var(--dim); border: 1px solid var(--line); padding: 1px 8px; border-radius: 999px; }",
|
|
5638
|
+
".step.first { border: 2px solid var(--accent); }",
|
|
5639
|
+
".badge.start { color: var(--accent); border-color: var(--accent); }",
|
|
5640
|
+
".welcome { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 16px 0 8px; }",
|
|
5641
|
+
".welcome h2 { font-size: 19px; margin: 4px 0 8px; } .welcome p { margin: 0; }",
|
|
5642
|
+
".welcome .kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }",
|
|
5643
|
+
".getrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; } .getrow p { margin: 0; }",
|
|
5644
|
+
"details.prompt summary { display: flex; align-items: center; min-height: 44px; color: var(--dim); font-size: 14px; cursor: pointer; }",
|
|
5619
5645
|
".uses { border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; }",
|
|
5620
5646
|
"pre { white-space: pre-wrap; user-select: all; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 13px; }",
|
|
5621
5647
|
"details { margin: 6px 0; } summary { cursor: pointer; }",
|
|
5622
5648
|
].join("\n");
|
|
5623
5649
|
|
|
5650
|
+
const COPY_SCRIPT = [
|
|
5651
|
+
"<script>",
|
|
5652
|
+
"document.addEventListener('click', (event) => {",
|
|
5653
|
+
" const button = event.target.closest('.copy');",
|
|
5654
|
+
" if (!button) return;",
|
|
5655
|
+
" const pre = document.getElementById(button.getAttribute('data-copy-for'));",
|
|
5656
|
+
" const flash = (label) => {",
|
|
5657
|
+
" button.textContent = label;",
|
|
5658
|
+
" setTimeout(() => { button.textContent = 'Copy prompt'; }, 1500);",
|
|
5659
|
+
" };",
|
|
5660
|
+
" const select = () => {",
|
|
5661
|
+
" const range = document.createRange();",
|
|
5662
|
+
" range.selectNodeContents(pre);",
|
|
5663
|
+
" window.getSelection().removeAllRanges();",
|
|
5664
|
+
" window.getSelection().addRange(range);",
|
|
5665
|
+
" flash('Select and copy');",
|
|
5666
|
+
" };",
|
|
5667
|
+
" if (!navigator.clipboard) return select();",
|
|
5668
|
+
" navigator.clipboard.writeText(pre.textContent).then(() => flash('Copied'), select);",
|
|
5669
|
+
"});",
|
|
5670
|
+
"</script>",
|
|
5671
|
+
].join("\n");
|
|
5672
|
+
|
|
5624
5673
|
const home = (to = "/") => new Response(null, { status: 303, headers: { location: to } });
|
|
5625
5674
|
|
|
5626
5675
|
const text = (body, status = 200) => new Response(body, { status, headers: { "content-type": "text/plain; charset=utf-8" } });
|
|
@@ -5658,7 +5707,7 @@ var STARTER_MIGRATION = [
|
|
|
5658
5707
|
"-- Make the next change in 0002_<what>.sql; never edit a file that has been deployed.",
|
|
5659
5708
|
"create table notes (id integer primary key, body text not null, tags text not null default '', pinned integer not null default 0, author_id text not null, author_name text not null default '', created_at text not null default (datetime('now')), archived_at text)",
|
|
5660
5709
|
"create table runs (id integer primary key, schedule text not null, note text not null, ran_at text not null default (datetime('now')))",
|
|
5661
|
-
"insert into notes (body, tags, pinned, author_id, author_name) values ('Welcome to the noticeboard.
|
|
5710
|
+
"insert into notes (body, tags, pinned, author_id, author_name) values ('Welcome to the noticeboard. This note is pinned so everyone sees it first; post your own below.', 'welcome', 1, '', 'wirl')",
|
|
5662
5711
|
""
|
|
5663
5712
|
].join("\n");
|
|
5664
5713
|
function starterManifest(app, org) {
|