@pablopunk/webr 0.3.3 → 0.3.6

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.
@@ -1,5 +1,5 @@
1
- import { S as createAstro, f as renderHead, i as renderComponent, m as createRenderInstruction, p as addAttribute, s as renderSlot, u as renderTemplate } from "./server_CnGYDmxV.mjs";
2
- import { t as createComponent } from "./compiler_BiU10Vds.mjs";
1
+ import { S as createAstro, f as renderHead, i as renderComponent, m as createRenderInstruction, p as addAttribute, s as renderSlot, u as renderTemplate } from "./server_dfdLOyV2.mjs";
2
+ import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
3
3
  import { ViewTransition, createContext, memo, useCallback, useContext, useDeferredValue, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
4
4
  import { Archive, ArchiveRestore, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Bot, Check, ChevronDown, ChevronRight, Circle, CircleAlert, CircleCheck, CircleHelp, Command, Copy, Cpu, Folder, FolderTree, GitBranch, ImagePlus, LayoutList, LoaderCircle, MessageCircleQuestion, Mic, Monitor, Moon, PanelLeft, PanelLeftClose, PanelLeftOpen, Pencil, Plus, Search, Server, Settings2, Square, SquarePen, SquareTerminal, Sun, TerminalSquare, Trash2, TriangleAlert, X } from "lucide-react";
5
5
  import { createRoot } from "react-dom/client";
@@ -4422,7 +4422,8 @@ function PaneTabs({ panes, focusedPane, onFocusPane, renderPane }) {
4422
4422
  //#endregion
4423
4423
  //#region src/components/ThreadView.tsx
4424
4424
  function ThreadView({ thread, connected, canControl, onFocusPane, focusedPane, windowStart, narrow }) {
4425
- const detached = connected && thread.bindingState === "detached";
4425
+ const showingLaunch = connected && (isLaunching(thread) || launchFailed(thread));
4426
+ const detached = connected && thread.bindingState === "detached" && !showingLaunch;
4426
4427
  useEffect(() => {
4427
4428
  if (detached) navigate(`/new?project=${encodeURIComponent(thread.projectId)}`);
4428
4429
  }, [detached, thread.projectId]);
@@ -4434,7 +4435,7 @@ function ThreadView({ thread, connected, canControl, onFocusPane, focusedPane, w
4434
4435
  canControl,
4435
4436
  onFocus: () => onFocusPane(pane.id)
4436
4437
  }, pane.terminalId) : null;
4437
- if (connected && (isLaunching(thread) || launchFailed(thread))) return /* @__PURE__ */ jsx(LaunchProgress, { thread });
4438
+ if (showingLaunch) return /* @__PURE__ */ jsx(LaunchProgress, { thread });
4438
4439
  const strip = {
4439
4440
  panes: thread.panes,
4440
4441
  focusedPane,
@@ -1,7 +1,6 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
- import { S as createAstro, i as renderComponent, u as renderTemplate } from "./server_CnGYDmxV.mjs";
3
- import { t as createComponent } from "./compiler_BiU10Vds.mjs";
4
- import { n as $$Base, t as App } from "./App_1wfxblxd.mjs";
1
+ import { S as createAstro, V as __exportAll, i as renderComponent, u as renderTemplate } from "./server_dfdLOyV2.mjs";
2
+ import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
3
+ import { n as $$Base, t as App } from "./App_DDOnT1vx.mjs";
5
4
  //#region src/pages/threads/[id].astro
6
5
  var _id__exports = /* @__PURE__ */ __exportAll({
7
6
  default: () => $$Id,
@@ -1,7 +1,6 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
- import { S as createAstro, i as renderComponent, u as renderTemplate } from "./server_CnGYDmxV.mjs";
3
- import { t as createComponent } from "./compiler_BiU10Vds.mjs";
4
- import { n as $$Base, t as App } from "./App_1wfxblxd.mjs";
1
+ import { S as createAstro, V as __exportAll, i as renderComponent, u as renderTemplate } from "./server_dfdLOyV2.mjs";
2
+ import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
3
+ import { n as $$Base, t as App } from "./App_DDOnT1vx.mjs";
5
4
  //#region src/pages/sessions/[session]/tabs/[tab].astro
6
5
  var _tab__exports = /* @__PURE__ */ __exportAll({
7
6
  default: () => $$Tab,
@@ -1,5 +1,5 @@
1
+ import "./server_dfdLOyV2.mjs";
1
2
  import { t as AstroError, x as InvalidComponentArgs } from "./errors_BgIp4W2B.mjs";
2
- import "./server_CnGYDmxV.mjs";
3
3
  //#region node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/runtime/server/astro-component.js
4
4
  function validateArgs(args) {
5
5
  if (args.length !== 3) return false;
@@ -1,4 +1,4 @@
1
- import { T as s } from "./server_CnGYDmxV.mjs";
1
+ import { T as s } from "./server_dfdLOyV2.mjs";
2
2
  //#region node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/core/logger/core.js
3
3
  var dateTimeFormat = new Intl.DateTimeFormat([], {
4
4
  hour: "2-digit",
@@ -1,6 +1,5 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
- import { S as createAstro } from "./server_CnGYDmxV.mjs";
3
- import { t as createComponent } from "./compiler_BiU10Vds.mjs";
1
+ import { S as createAstro, V as __exportAll } from "./server_dfdLOyV2.mjs";
2
+ import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
4
3
  //#region src/pages/index.astro
5
4
  var pages_exports = /* @__PURE__ */ __exportAll({
6
5
  default: () => $$Index,
@@ -1,7 +1,6 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
- import { S as createAstro, i as renderComponent, u as renderTemplate } from "./server_CnGYDmxV.mjs";
3
- import { t as createComponent } from "./compiler_BiU10Vds.mjs";
4
- import { n as $$Base, t as App } from "./App_1wfxblxd.mjs";
1
+ import { S as createAstro, V as __exportAll, i as renderComponent, u as renderTemplate } from "./server_dfdLOyV2.mjs";
2
+ import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
3
+ import { n as $$Base, t as App } from "./App_DDOnT1vx.mjs";
5
4
  //#region src/pages/new.astro
6
5
  var new_exports = /* @__PURE__ */ __exportAll({
7
6
  default: () => $$New,
@@ -1,9 +1,8 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
1
+ import { S as createAstro, V as __exportAll, b as unescapeHTML, d as maybeRenderHead, p as addAttribute, t as spreadAttributes, u as renderTemplate } from "./server_dfdLOyV2.mjs";
2
2
  import { $ as UnsupportedImageFormat, A as MissingGetFontFileRequestUrl, F as NoImageMetadata, Q as UnsupportedImageConversion, T as LocalImageUsedWrongly, W as RemoteImageNotAllowed, b as IncompatibleDescriptorOptions, d as ExpectedNotESMImage, f as FailedToFetchRemoteImageDimensions, j as MissingImageDimension, l as ExpectedImage, p as FontFamilyNotFound, t as AstroError, u as ExpectedImageOptions, w as InvalidImageService, y as ImageMissingAlt } from "./errors_BgIp4W2B.mjs";
3
- import { S as createAstro, b as unescapeHTML, d as maybeRenderHead, p as addAttribute, t as spreadAttributes, u as renderTemplate } from "./server_CnGYDmxV.mjs";
4
3
  import { d as isRemotePath, f as joinPaths, h as removeQueryString, t as isRemoteAllowed, u as isParentDirectory } from "./remote_BxuVLM0r.mjs";
5
- import { t as createComponent } from "./compiler_BiU10Vds.mjs";
6
- import { t as createConsoleLogger } from "./console_BOi2ismd.mjs";
4
+ import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
5
+ import { t as createConsoleLogger } from "./console_BOJ74XrS.mjs";
7
6
  import path from "node:path";
8
7
  import { fileURLToPath } from "node:url";
9
8
  import { readFile } from "node:fs/promises";
@@ -1343,7 +1342,7 @@ var cssFitValues = [
1343
1342
  ];
1344
1343
  async function getConfiguredImageService() {
1345
1344
  if (!globalThis?.astroAsset?.imageService) {
1346
- const { default: service } = await import("./sharp_qIaxzsTp.mjs").catch((e) => {
1345
+ const { default: service } = await import("./sharp_8J8zk4Wd.mjs").catch((e) => {
1347
1346
  const error = new AstroError(InvalidImageService);
1348
1347
  error.cause = e;
1349
1348
  throw error;
@@ -1,5 +1,48 @@
1
1
  import { B as OnlyResponseCanBeReturned, K as ResponseSentError, L as NoMatchingImport, M as MissingMediaQueryDirective, P as NoClientOnlyHint, R as NoMatchingRenderer, Z as UnavailableAstroGlobal, c as EndpointDidNotReturnAResponse, t as AstroError } from "./errors_BgIp4W2B.mjs";
2
+ import { createRequire } from "node:module";
2
3
  import * as z from "zod/v4";
4
+ //#region \0rolldown/runtime.js
5
+ var __create = Object.create;
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __esmMin = (fn, res, err) => () => {
12
+ if (err) throw err[0];
13
+ try {
14
+ return fn && (res = fn(fn = 0)), res;
15
+ } catch (e) {
16
+ throw err = [e], e;
17
+ }
18
+ };
19
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
20
+ var __exportAll = (all, no_symbols) => {
21
+ let target = {};
22
+ for (var name in all) __defProp(target, name, {
23
+ get: all[name],
24
+ enumerable: true
25
+ });
26
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
27
+ return target;
28
+ };
29
+ var __copyProps = (to, from, except, desc) => {
30
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
31
+ key = keys[i];
32
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
33
+ get: ((k) => from[k]).bind(null, key),
34
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
35
+ });
36
+ }
37
+ return to;
38
+ };
39
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
40
+ value: mod,
41
+ enumerable: true
42
+ }) : target, mod));
43
+ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
44
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
45
+ //#endregion
3
46
  //#region node_modules/.pnpm/@oslojs+encoding@1.1.0/node_modules/@oslojs/encoding/dist/hex.js
4
47
  function encodeHexUpperCase(data) {
5
48
  let result = "";
@@ -2749,4 +2792,4 @@ function spreadAttributes(values = {}, _name, { class: scopedClassName } = {}) {
2749
2792
  return markHTMLString(output);
2750
2793
  }
2751
2794
  //#endregion
2752
- export { REROUTABLE_STATUS_CODES as A, isRoute404 as C, ASTRO_GENERATOR as D, ASTRO_ERROR_HEADER as E, responseSentSymbol as F, decodeKey as I, decryptString as L, fetchStateSymbol as M, nodeRequestAbortControllerCleanupSymbol as N, DEFAULT_404_COMPONENT as O, originPathnameSymbol as P, generateCspDigest as R, createAstro as S, s as T, pushDirective as _, chunkToString as a, unescapeHTML as b, renderSlotToString as c, maybeRenderHead as d, renderHead as f, normalizeCspResourceEntry as g, isRenderInstruction as h, renderComponent as i, clientAddressSymbol as j, REDIRECT_STATUS_CODES as k, isRenderTemplateResult as l, createRenderInstruction as m, renderPage as n, createSlotValueFromString as o, addAttribute as p, renderJSX as r, renderSlot as s, spreadAttributes as t, renderTemplate as u, isAstroComponentFactory as v, isRoute500 as w, renderEndpoint as x, markHTMLString as y };
2795
+ export { REROUTABLE_STATUS_CODES as A, __esmMin as B, isRoute404 as C, ASTRO_GENERATOR as D, ASTRO_ERROR_HEADER as E, responseSentSymbol as F, __require as H, decodeKey as I, decryptString as L, fetchStateSymbol as M, nodeRequestAbortControllerCleanupSymbol as N, DEFAULT_404_COMPONENT as O, originPathnameSymbol as P, generateCspDigest as R, createAstro as S, s as T, __toCommonJS as U, __exportAll as V, __toESM as W, pushDirective as _, chunkToString as a, unescapeHTML as b, renderSlotToString as c, maybeRenderHead as d, renderHead as f, normalizeCspResourceEntry as g, isRenderInstruction as h, renderComponent as i, clientAddressSymbol as j, REDIRECT_STATUS_CODES as k, isRenderTemplateResult as l, createRenderInstruction as m, renderPage as n, createSlotValueFromString as o, addAttribute as p, renderJSX as r, renderSlot as s, spreadAttributes as t, renderTemplate as u, isAstroComponentFactory as v, isRoute500 as w, renderEndpoint as x, markHTMLString as y, __commonJSMin as z };
@@ -1,7 +1,6 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
- import { S as createAstro, i as renderComponent, u as renderTemplate } from "./server_CnGYDmxV.mjs";
3
- import { t as createComponent } from "./compiler_BiU10Vds.mjs";
4
- import { n as $$Base, t as App } from "./App_1wfxblxd.mjs";
1
+ import { S as createAstro, V as __exportAll, i as renderComponent, u as renderTemplate } from "./server_dfdLOyV2.mjs";
2
+ import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
3
+ import { n as $$Base, t as App } from "./App_DDOnT1vx.mjs";
5
4
  //#region src/pages/settings.astro
6
5
  var settings_exports = /* @__PURE__ */ __exportAll({
7
6
  default: () => $$Settings,
@@ -1,5 +1,5 @@
1
1
  import { $ as UnsupportedImageFormat, F as NoImageMetadata, N as MissingSharp, t as AstroError } from "./errors_BgIp4W2B.mjs";
2
- import { a as resolveDefaultOutputFormat, i as detector, n as baseService, r as parseQuality } from "./node_BcIF-BVp.mjs";
2
+ import { a as resolveDefaultOutputFormat, i as detector, n as baseService, r as parseQuality } from "./node_C8FqXy_n.mjs";
3
3
  //#region node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/services/sharp.js
4
4
  var sharp;
5
5
  var qualityTable = {
@@ -45,7 +45,7 @@ function resolveSharpEncoderOptions(transform, inputFormat, serviceConfig = {})
45
45
  async function loadSharp() {
46
46
  let sharpImport;
47
47
  try {
48
- sharpImport = (await import("./dist_CpTFMtqT.mjs")).default;
48
+ sharpImport = (await import("sharp")).default;
49
49
  } catch {
50
50
  throw new AstroError(MissingSharp);
51
51
  }
@@ -1,8 +1,7 @@
1
- import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "./chunks/rolldown-runtime_BMI-E3GI.mjs";
1
+ import { A as REROUTABLE_STATUS_CODES, B as __esmMin, C as isRoute404, D as ASTRO_GENERATOR, E as ASTRO_ERROR_HEADER, F as responseSentSymbol$1, H as __require, I as decodeKey, L as decryptString, M as fetchStateSymbol, N as nodeRequestAbortControllerCleanupSymbol, O as DEFAULT_404_COMPONENT, P as originPathnameSymbol, R as generateCspDigest, T as s, U as __toCommonJS, V as __exportAll, W as __toESM, _ as pushDirective, a as chunkToString, c as renderSlotToString, g as normalizeCspResourceEntry, h as isRenderInstruction, i as renderComponent, j as clientAddressSymbol, k as REDIRECT_STATUS_CODES, l as isRenderTemplateResult, n as renderPage, o as createSlotValueFromString, r as renderJSX, u as renderTemplate, v as isAstroComponentFactory, w as isRoute500, x as renderEndpoint, y as markHTMLString, z as __commonJSMin } from "./chunks/server_dfdLOyV2.mjs";
2
2
  import { C as InvalidGetStaticPathsReturn, D as LocalsReassigned, E as LocalsNotAnObject, G as ReservedSlotName, H as PrerenderClientAddressNotAvailable, I as NoManifestAvailable, J as SessionStorageInitError, K as ResponseSentError, O as MiddlewareNoDataOrNextCalled, S as InvalidGetStaticPathsEntry, U as PrerenderDynamicEndpointPathCollide, V as PageNumberParamNotFound, X as StaticClientAddressNotAvailable, Y as SessionStorageSaveError, _ as GetStaticPathsInvalidRouteParam, a as AstroResponseHeadersReassigned, et as i18nNoLocaleFoundInPath, g as GetStaticPathsExpectedParams, h as ForbiddenRewrite, i as ActionsReturnedInvalidDataError, k as MiddlewareNotAResponse, n as isAstroError, o as CacheNotEnabled, q as RewriteWithBodyUsed, r as ActionNotFoundError, s as ClientAddressNotAvailable, t as AstroError, v as GetStaticPathsRequired, z as NoMatchingStaticPathFound } from "./chunks/errors_BgIp4W2B.mjs";
3
- import { A as REROUTABLE_STATUS_CODES, C as isRoute404, D as ASTRO_GENERATOR, E as ASTRO_ERROR_HEADER, F as responseSentSymbol$1, I as decodeKey, L as decryptString, M as fetchStateSymbol, N as nodeRequestAbortControllerCleanupSymbol, O as DEFAULT_404_COMPONENT, P as originPathnameSymbol, R as generateCspDigest, T as s, _ as pushDirective, a as chunkToString, c as renderSlotToString, g as normalizeCspResourceEntry, h as isRenderInstruction, i as renderComponent, j as clientAddressSymbol, k as REDIRECT_STATUS_CODES, l as isRenderTemplateResult, n as renderPage, o as createSlotValueFromString, r as renderJSX, u as renderTemplate, v as isAstroComponentFactory, w as isRoute500, x as renderEndpoint, y as markHTMLString } from "./chunks/server_CnGYDmxV.mjs";
4
3
  import { _ as slash, a as collapseDuplicateSlashes, c as hasFileExtension, f as joinPaths, g as removeTrailingForwardSlash, i as collapseDuplicateLeadingSlashes, l as isInternalPath, m as removeLeadingForwardSlash, n as matchPattern, o as collapseDuplicateTrailingSlashes, p as prependForwardSlash$1, r as appendForwardSlash, s as fileExtension, v as stripRequestBase, y as trimSlashes } from "./chunks/remote_BxuVLM0r.mjs";
5
- import { n as AstroIntegrationLogger, r as astroToRuntimeLogger, t as createConsoleLogger } from "./chunks/console_BOi2ismd.mjs";
4
+ import { n as AstroIntegrationLogger, r as astroToRuntimeLogger, t as createConsoleLogger } from "./chunks/console_BOJ74XrS.mjs";
6
5
  import React, { createElement, memo } from "react";
7
6
  import ReactDOM from "react-dom/server";
8
7
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -2426,12 +2425,12 @@ var renderers = [Object.assign({
2426
2425
  ].map(deserializeRouteInfo);
2427
2426
  //#endregion
2428
2427
  //#region \0virtual:astro:pages
2429
- var _page0 = () => import("./chunks/node_BcIF-BVp.mjs").then((n) => n.t);
2430
- var _page1 = () => import("./chunks/new_kkCg5K67.mjs");
2431
- var _page2 = () => import("./chunks/_tab__4yg4_FHP.mjs");
2432
- var _page3 = () => import("./chunks/settings_BpXfHFqU.mjs");
2433
- var _page4 = () => import("./chunks/_id__kbExCoFS.mjs");
2434
- var _page5 = () => import("./chunks/index_DRfLd22k.mjs");
2428
+ var _page0 = () => import("./chunks/node_C8FqXy_n.mjs").then((n) => n.t);
2429
+ var _page1 = () => import("./chunks/new_CBpgizdT.mjs");
2430
+ var _page2 = () => import("./chunks/_tab__1TQX6GGq.mjs");
2431
+ var _page3 = () => import("./chunks/settings_BahL_Diu.mjs");
2432
+ var _page4 = () => import("./chunks/_id__CRXKeG9Q.mjs");
2433
+ var _page5 = () => import("./chunks/index_Bvv1gpI0.mjs");
2435
2434
  var pageMap = /* @__PURE__ */ new Map([
2436
2435
  ["node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/endpoint/node.js", _page0],
2437
2436
  ["src/pages/new.astro", _page1],
@@ -2442,7 +2441,7 @@ var pageMap = /* @__PURE__ */ new Map([
2442
2441
  ]);
2443
2442
  //#endregion
2444
2443
  //#region \0virtual:astro:manifest
2445
- var _manifest = deserializeManifest({"rootDir":"file:///home/runner/work/webr/webr/","cacheDir":"file:///home/runner/work/webr/webr/node_modules/.astro/","outDir":"file:///home/runner/work/webr/webr/dist/","srcDir":"file:///home/runner/work/webr/webr/src/","publicDir":"file:///home/runner/work/webr/webr/public/","buildClientDir":"file:///home/runner/work/webr/webr/dist/client/","buildServerDir":"file:///home/runner/work/webr/webr/dist/server/","adapterName":"@astrojs/node","assetsDir":"_astro","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"page","component":"_server-islands.astro","params":["name"],"segments":[[{"content":"_server-islands","dynamic":false,"spread":false}],[{"content":"name","dynamic":true,"spread":false}]],"pattern":"^\\/_server-islands\\/([^/]+?)\\/?$","prerender":false,"isIndex":false,"fallbackRoutes":[],"route":"/_server-islands/[name]","origin":"internal","distURL":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/_image","component":"node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/endpoint/node.js","params":[],"pathname":"/_image","pattern":"^\\/_image\\/?$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"type":"endpoint","prerender":false,"fallbackRoutes":[],"distURL":[],"isIndex":false,"origin":"internal","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/new","isIndex":false,"type":"page","pattern":"^\\/new\\/?$","segments":[[{"content":"new","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/new.astro","pathname":"/new","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/sessions/[session]/tabs/[tab]","isIndex":false,"type":"page","pattern":"^\\/sessions\\/([^/]+?)\\/tabs\\/([^/]+?)\\/?$","segments":[[{"content":"sessions","dynamic":false,"spread":false}],[{"content":"session","dynamic":true,"spread":false}],[{"content":"tabs","dynamic":false,"spread":false}],[{"content":"tab","dynamic":true,"spread":false}]],"params":["session","tab"],"component":"src/pages/sessions/[session]/tabs/[tab].astro","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/settings","isIndex":false,"type":"page","pattern":"^\\/settings\\/?$","segments":[[{"content":"settings","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/settings.astro","pathname":"/settings","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/threads/[id]","isIndex":false,"type":"page","pattern":"^\\/threads\\/([^/]+?)\\/?$","segments":[[{"content":"threads","dynamic":false,"spread":false}],[{"content":"id","dynamic":true,"spread":false}]],"params":["id"],"component":"src/pages/threads/[id].astro","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/","isIndex":true,"type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}}],"serverLike":true,"middlewareMode":"classic","base":"/","trailingSlash":"ignore","compressHTML":"jsx","componentMetadata":[["/home/runner/work/webr/webr/src/pages/new.astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/sessions/[session]/tabs/[tab].astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/settings.astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/threads/[id].astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var l=(n,t)=>{let i=async()=>{await(await n())()},e=typeof t.value==\"object\"?t.value:void 0,s={timeout:e==null?void 0:e.timeout};\"requestIdleCallback\"in window?window.requestIdleCallback(i,s):setTimeout(i,s.timeout||200)};(self.Astro||(self.Astro={})).idle=l;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var n=(a,t)=>{let i=async()=>{await(await a())()};if(t.value){let e=matchMedia(t.value);e.matches?i():e.addEventListener(\"change\",i,{once:!0})}};(self.Astro||(self.Astro={})).media=n;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var a=(s,i,o)=>{let r=async()=>{await(await s())()},t=typeof i.value==\"object\"?i.value:void 0,c={rootMargin:t==null?void 0:t.rootMargin},n=new IntersectionObserver(e=>{for(let l of e)if(l.isIntersecting){n.disconnect(),r();break}},c);for(let e of o.children)n.observe(e)};(self.Astro||(self.Astro={})).visible=a;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000noop-middleware":"virtual_astro_middleware.mjs","\u0000virtual:astro:server-island-manifest":"chunks/_virtual_astro_server-island-manifest_C1Q2srgE.mjs","\u0000virtual:astro:session-driver":"chunks/_virtual_astro_session-driver_Dp7RXjOf.mjs","\u0000virtual:astro:actions/noop-entrypoint":"chunks/noop-entrypoint_Z3zFhrGC.mjs","/home/runner/work/webr/webr/node_modules/.pnpm/@astrojs+react@7.0.0_@types+node@22.20.4_@types+react-dom@19.3.0_@types+react@19.3.0__@_02aa85dceaccf3d763325676dd8540a8/node_modules/@astrojs/react/dist/vnode-children.js":"chunks/vnode-children_BSi0H4PL.mjs","@astrojs/node/server.js":"entry.mjs","\u0000virtual:astro:page:src/pages/threads/[id]@_@astro":"chunks/_id__kbExCoFS.mjs","\u0000virtual:astro:page:src/pages/sessions/[session]/tabs/[tab]@_@astro":"chunks/_tab__4yg4_FHP.mjs","/home/runner/work/webr/webr/node_modules/.pnpm/sharp@0.35.5_@types+node@22.20.4/node_modules/sharp/dist/index.mjs":"chunks/dist_CpTFMtqT.mjs","\u0000virtual:astro:page:src/pages/index@_@astro":"chunks/index_DRfLd22k.mjs","\u0000virtual:astro:page:src/pages/new@_@astro":"chunks/new_kkCg5K67.mjs","\u0000virtual:astro:page:node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/endpoint/node@_@js":"chunks/node_BcIF-BVp.mjs","\u0000virtual:astro:page:src/pages/settings@_@astro":"chunks/settings_BpXfHFqU.mjs","/home/runner/work/webr/webr/node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/services/sharp.js":"chunks/sharp_qIaxzsTp.mjs","/home/runner/work/webr/webr/src/components/App.tsx":"_astro/App.8tCy4opo.js","/home/runner/work/webr/webr/node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/components/ClientRouter.astro?astro&type=script&index=0&lang.ts":"_astro/ClientRouter.astro_astro_type_script_index_0_lang.CTgtIFyY.js","@astrojs/react/client.js":"_astro/client.BDkzSRUN.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+addon-fit@0.10.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-fit/lib/addon-fit.js":"_astro/addon-fit.jgKqzwky.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+addon-web-links@0.11.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-web-links/lib/addon-web-links.js":"_astro/addon-web-links.C9lyQRxI.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+addon-webgl@0.18.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-webgl/lib/addon-webgl.js":"_astro/addon-webgl.Bd5ox92E.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+xterm@5.5.0/node_modules/@xterm/xterm/lib/xterm.js":"_astro/xterm.B-l5AIf6.js","astro:scripts/before-hydration.js":""},"inlinedScripts":[],"assets":["/apple-touch-icon.png","/brand-mark.png","/favicon-16.png","/favicon-32.png","/favicon.ico","/icon-192.png","/icon-512.png","/icon-maskable-512.png","/manifest.webmanifest","/_astro/App.8tCy4opo.js","/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CTgtIFyY.js","/_astro/addon-fit.jgKqzwky.js","/_astro/addon-web-links.C9lyQRxI.js","/_astro/addon-webgl.Bd5ox92E.js","/_astro/client.BDkzSRUN.js","/_astro/client.Bbg9OBwT.js","/_astro/client.CLSsMr2g.js","/_astro/xterm.B-l5AIf6.js","/_astro/App.B7RjqN_I.css","/_astro/jetbrains-mono.CFJaiWaY.woff2","/_astro/symbols-nerd.CEdkKAK8.woff2"],"buildFormat":"directory","checkOrigin":true,"actionBodySizeLimit":1048576,"serverIslandBodySizeLimit":1048576,"allowedDomains":[],"key":"XbDOGJXcyfjr3P2+RqNitqxzQoBJeE7z5hrQF1Mugk4=","sessionConfig":{"driver":"unstorage/drivers/fs-lite","options":{"base":"/home/runner/work/webr/webr/node_modules/.astro/sessions"}},"image":{},"devToolbar":{"enabled":false,"debugInfoOutput":""},"logLevel":"info","shouldInjectCspMetaTags":false});
2444
+ var _manifest = deserializeManifest({"rootDir":"file:///home/runner/work/webr/webr/","cacheDir":"file:///home/runner/work/webr/webr/node_modules/.astro/","outDir":"file:///home/runner/work/webr/webr/dist/","srcDir":"file:///home/runner/work/webr/webr/src/","publicDir":"file:///home/runner/work/webr/webr/public/","buildClientDir":"file:///home/runner/work/webr/webr/dist/client/","buildServerDir":"file:///home/runner/work/webr/webr/dist/server/","adapterName":"@astrojs/node","assetsDir":"_astro","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"page","component":"_server-islands.astro","params":["name"],"segments":[[{"content":"_server-islands","dynamic":false,"spread":false}],[{"content":"name","dynamic":true,"spread":false}]],"pattern":"^\\/_server-islands\\/([^/]+?)\\/?$","prerender":false,"isIndex":false,"fallbackRoutes":[],"route":"/_server-islands/[name]","origin":"internal","distURL":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/_image","component":"node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/endpoint/node.js","params":[],"pathname":"/_image","pattern":"^\\/_image\\/?$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"type":"endpoint","prerender":false,"fallbackRoutes":[],"distURL":[],"isIndex":false,"origin":"internal","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/new","isIndex":false,"type":"page","pattern":"^\\/new\\/?$","segments":[[{"content":"new","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/new.astro","pathname":"/new","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/sessions/[session]/tabs/[tab]","isIndex":false,"type":"page","pattern":"^\\/sessions\\/([^/]+?)\\/tabs\\/([^/]+?)\\/?$","segments":[[{"content":"sessions","dynamic":false,"spread":false}],[{"content":"session","dynamic":true,"spread":false}],[{"content":"tabs","dynamic":false,"spread":false}],[{"content":"tab","dynamic":true,"spread":false}]],"params":["session","tab"],"component":"src/pages/sessions/[session]/tabs/[tab].astro","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/settings","isIndex":false,"type":"page","pattern":"^\\/settings\\/?$","segments":[[{"content":"settings","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/settings.astro","pathname":"/settings","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/threads/[id]","isIndex":false,"type":"page","pattern":"^\\/threads\\/([^/]+?)\\/?$","segments":[[{"content":"threads","dynamic":false,"spread":false}],[{"content":"id","dynamic":true,"spread":false}]],"params":["id"],"component":"src/pages/threads/[id].astro","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/","isIndex":true,"type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}}],"serverLike":true,"middlewareMode":"classic","base":"/","trailingSlash":"ignore","compressHTML":"jsx","componentMetadata":[["/home/runner/work/webr/webr/src/pages/new.astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/sessions/[session]/tabs/[tab].astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/settings.astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/threads/[id].astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var l=(n,t)=>{let i=async()=>{await(await n())()},e=typeof t.value==\"object\"?t.value:void 0,s={timeout:e==null?void 0:e.timeout};\"requestIdleCallback\"in window?window.requestIdleCallback(i,s):setTimeout(i,s.timeout||200)};(self.Astro||(self.Astro={})).idle=l;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var n=(a,t)=>{let i=async()=>{await(await a())()};if(t.value){let e=matchMedia(t.value);e.matches?i():e.addEventListener(\"change\",i,{once:!0})}};(self.Astro||(self.Astro={})).media=n;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var a=(s,i,o)=>{let r=async()=>{await(await s())()},t=typeof i.value==\"object\"?i.value:void 0,c={rootMargin:t==null?void 0:t.rootMargin},n=new IntersectionObserver(e=>{for(let l of e)if(l.isIntersecting){n.disconnect(),r();break}},c);for(let e of o.children)n.observe(e)};(self.Astro||(self.Astro={})).visible=a;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000noop-middleware":"virtual_astro_middleware.mjs","\u0000virtual:astro:server-island-manifest":"chunks/_virtual_astro_server-island-manifest_C1Q2srgE.mjs","\u0000virtual:astro:session-driver":"chunks/_virtual_astro_session-driver_Dp7RXjOf.mjs","\u0000virtual:astro:actions/noop-entrypoint":"chunks/noop-entrypoint_Z3zFhrGC.mjs","/home/runner/work/webr/webr/node_modules/.pnpm/@astrojs+react@7.0.0_@types+node@22.20.4_@types+react-dom@19.3.0_@types+react@19.3.0__@_02aa85dceaccf3d763325676dd8540a8/node_modules/@astrojs/react/dist/vnode-children.js":"chunks/vnode-children_BSi0H4PL.mjs","@astrojs/node/server.js":"entry.mjs","\u0000virtual:astro:page:src/pages/threads/[id]@_@astro":"chunks/_id__CRXKeG9Q.mjs","\u0000virtual:astro:page:src/pages/sessions/[session]/tabs/[tab]@_@astro":"chunks/_tab__1TQX6GGq.mjs","\u0000virtual:astro:page:src/pages/index@_@astro":"chunks/index_Bvv1gpI0.mjs","\u0000virtual:astro:page:src/pages/new@_@astro":"chunks/new_CBpgizdT.mjs","\u0000virtual:astro:page:node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/endpoint/node@_@js":"chunks/node_C8FqXy_n.mjs","\u0000virtual:astro:page:src/pages/settings@_@astro":"chunks/settings_BahL_Diu.mjs","/home/runner/work/webr/webr/node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/services/sharp.js":"chunks/sharp_8J8zk4Wd.mjs","/home/runner/work/webr/webr/src/components/App.tsx":"_astro/App.CuhTptJe.js","/home/runner/work/webr/webr/node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/components/ClientRouter.astro?astro&type=script&index=0&lang.ts":"_astro/ClientRouter.astro_astro_type_script_index_0_lang.CTgtIFyY.js","@astrojs/react/client.js":"_astro/client.BDkzSRUN.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+addon-fit@0.10.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-fit/lib/addon-fit.js":"_astro/addon-fit.jgKqzwky.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+addon-web-links@0.11.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-web-links/lib/addon-web-links.js":"_astro/addon-web-links.C9lyQRxI.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+addon-webgl@0.18.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-webgl/lib/addon-webgl.js":"_astro/addon-webgl.Bd5ox92E.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+xterm@5.5.0/node_modules/@xterm/xterm/lib/xterm.js":"_astro/xterm.B-l5AIf6.js","astro:scripts/before-hydration.js":""},"inlinedScripts":[],"assets":["/apple-touch-icon.png","/brand-mark.png","/favicon-16.png","/favicon-32.png","/favicon.ico","/icon-192.png","/icon-512.png","/icon-maskable-512.png","/manifest.webmanifest","/_astro/App.CuhTptJe.js","/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CTgtIFyY.js","/_astro/addon-fit.jgKqzwky.js","/_astro/addon-web-links.C9lyQRxI.js","/_astro/addon-webgl.Bd5ox92E.js","/_astro/client.BDkzSRUN.js","/_astro/client.Bbg9OBwT.js","/_astro/client.CLSsMr2g.js","/_astro/xterm.B-l5AIf6.js","/_astro/App.B7RjqN_I.css","/_astro/jetbrains-mono.CFJaiWaY.woff2","/_astro/symbols-nerd.CEdkKAK8.woff2"],"buildFormat":"directory","checkOrigin":true,"actionBodySizeLimit":1048576,"serverIslandBodySizeLimit":1048576,"allowedDomains":[],"key":"OHDEDDVwGB8u/lNYgpUP7JiqvImUlEaJfuJDt9HpdpQ=","sessionConfig":{"driver":"unstorage/drivers/fs-lite","options":{"base":"/home/runner/work/webr/webr/node_modules/.astro/sessions"}},"image":{},"devToolbar":{"enabled":false,"debugInfoOutput":""},"logLevel":"info","shouldInjectCspMetaTags":false});
2446
2445
  var manifestRoutes = _manifest.routes;
2447
2446
  var manifest = Object.assign(_manifest, {
2448
2447
  renderers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pablopunk/webr",
3
- "version": "0.3.3",
3
+ "version": "0.3.6",
4
4
  "description": "Control your Herdr agents from anywhere.",
5
5
  "keywords": [
6
6
  "herdr",
@@ -48,7 +48,9 @@
48
48
  "icons": "tsx scripts/build-icons.ts",
49
49
  "validate:offline": "tsx scripts/validate-protocol.ts",
50
50
  "prepack": "astro build",
51
- "smoke:install": "tsx scripts/smoke-install.ts"
51
+ "smoke:install": "tsx scripts/smoke-install.ts",
52
+ "screenshots": "tsx scripts/screenshots/capture.ts",
53
+ "screenshots:serve": "tsx scripts/screenshots/serve.ts"
52
54
  },
53
55
  "dependencies": {
54
56
  "@astrojs/node": "11.1.6",
@@ -83,6 +85,7 @@
83
85
  "@types/react-dom": "19.3.0",
84
86
  "@types/ws": "8.18.2",
85
87
  "jsdom": "30.1.1",
88
+ "sharp": "0.35.5",
86
89
  "typescript": "5.9.3",
87
90
  "vitest": "5.0.3",
88
91
  "ws": "8.22.0"
package/server/cli.ts CHANGED
@@ -2,7 +2,7 @@ import { parseArgs } from 'node:util';
2
2
  import { renderUnicode } from 'uqr';
3
3
  import { runServer } from './run';
4
4
  import { explicitPort, knownPort } from './port';
5
- import { defaultDeps, installPlugin, pluginStatus, uninstallWebrPlugin, updatePlugin } from './plugin';
5
+ import { defaultDeps, installPlugin, uninstallWebrPlugin, updatePlugin } from './plugin';
6
6
  import { checkHerdr } from './herdr-check';
7
7
  import { modeLines, pluginMode } from './plugin/mode';
8
8
  import { openWebr, statusLines } from './where';
@@ -16,9 +16,8 @@ const HELP = `Webr — control your Herdr agents from anywhere.
16
16
  Usage
17
17
  webr Show status and this help
18
18
  webr start [options] Run the server in this terminal
19
- webr plugin install [options] Start Webr whenever the Herdr server starts, and open it
20
- webr plugin uninstall Remove the Herdr plugin
21
- webr plugin status Show whether the plugin is installed and Webr is running
19
+ webr install [options] Start Webr whenever the Herdr server starts, and open it
20
+ webr uninstall Remove Webr from Herdr
22
21
  webr invite [--port <port>] Print a one-time code and QR to connect a device
23
22
  webr status Show whether Webr is running and where
24
23
  webr open Open Webr in your browser
@@ -27,7 +26,7 @@ Usage
27
26
  Options
28
27
  --port <port> Port to listen on (default: first free port from 4444, then remembered)
29
28
  --host <address> Listen on a specific address (default 0.0.0.0, every interface)
30
- --no-open Don't open the browser after "plugin install"
29
+ --no-open Don't open the browser after "install"
31
30
  --origin <url> Public URL when served through a proxy, e.g. https://mac.tailnet.ts.net
32
31
  -v, --version Print the version
33
32
  -h, --help Print this help
@@ -76,11 +75,13 @@ const pluginSettings = (values: ReturnType<typeof parseCommand>['values']) => ({
76
75
  ...(values.origin ? { origin: values.origin } : {}),
77
76
  });
78
77
 
79
- async function pluginCommand(action: string, values: ReturnType<typeof parseCommand>['values']) {
80
- const deps = defaultDeps();
81
- const lines = action === 'install' ? await installPlugin(pluginSettings(values), deps) : action === 'uninstall' ? await uninstallWebrPlugin(deps) : await pluginStatus(deps);
82
- for (const line of lines.filter(Boolean)) console.log(line);
83
- if (action === 'install' && !values['no-open']) await openWhenUp(knownPort(values.port ? ['--port', values.port] : []));
78
+ async function install(values: ReturnType<typeof parseCommand>['values']) {
79
+ for (const line of (await installPlugin(pluginSettings(values), defaultDeps())).filter(Boolean)) console.log(line);
80
+ if (!values['no-open']) await openWhenUp(knownPort(values.port ? ['--port', values.port] : []));
81
+ }
82
+
83
+ async function uninstall() {
84
+ for (const line of (await uninstallWebrPlugin(defaultDeps())).filter(Boolean)) console.log(line);
84
85
  }
85
86
 
86
87
  async function openWhenUp(port: number) {
@@ -101,7 +102,7 @@ async function printStatusAndHelp(values: ReturnType<typeof parseCommand>['value
101
102
 
102
103
  export async function main(argv: string[]) {
103
104
  const { values, positionals } = parseCommand(argv);
104
- const [command, subcommand] = positionals;
105
+ const [command] = positionals;
105
106
  if (values.help || command === 'help') return void console.log(HELP);
106
107
  if (values.version) { console.log(packageInfo().version); return printUpdateHint(); }
107
108
  if (!command) return printStatusAndHelp(values);
@@ -111,6 +112,7 @@ export async function main(argv: string[]) {
111
112
  if (command === 'status') return printStatus(values);
112
113
  if (command === 'open') return void (await openWebr(knownPort(values.port ? ['--port', values.port] : []))).forEach((line) => console.log(line));
113
114
  if (command === 'invite') return invite(knownPort(values.port ? ['--port', values.port] : []));
114
- if (command === 'plugin' && ['install', 'uninstall', 'status'].includes(subcommand ?? '')) return pluginCommand(subcommand!, values);
115
+ if (command === 'install') return install(values);
116
+ if (command === 'uninstall') return uninstall();
115
117
  throw new Error(`Unknown command: ${positionals.join(' ')}\n\n${HELP}`);
116
118
  }
@@ -39,6 +39,6 @@ export function enterPluginDevMode(checkout: string, run: RunCommand = realRun,
39
39
  return () => {
40
40
  rmSync(join(stateDir, DEV_FILE), { force: true });
41
41
  restorePrevious(previous, run);
42
- if (restartProduction) try { startProduction(run, stateDir); } catch { console.error('Could not start production Webr. Run "webr plugin install".'); }
42
+ if (restartProduction) try { startProduction(run, stateDir); } catch { console.error('Could not start production Webr. Run "webr install".'); }
43
43
  };
44
44
  }
@@ -61,22 +61,7 @@ export async function updatePlugin(deps: PluginDeps) {
61
61
  if (!deps.run('herdr', ['--version']).ok) return undefined;
62
62
  if (!installedPlugin(deps.run)) return undefined;
63
63
  const address = probeAddress(readPluginConfig(pluginConfigDir(deps.run)));
64
- if ((await isPortOpen(address)) && !(await stopPluginWebr(deps.stateDir, address))) return [`Webr is running on port ${address.port} but the plugin did not start it. Stop it and run "webr plugin install" to use the new version.`];
65
- const refreshed = deps.run('webr', ['plugin', 'install', '--no-open']);
66
- return refreshed.ok ? quiet(refreshed.output) : [`The new Webr could not refresh the plugin. Run "webr plugin install". ${quiet(refreshed.output).join(' ')}`];
67
- }
68
-
69
- export async function pluginStatus(deps: PluginDeps) {
70
- requireHerdr(deps.run);
71
- const plugin = installedPlugin(deps.run);
72
- if (!plugin) return ['The Webr plugin is not installed. Install it with "webr plugin install".'];
73
- const config = readPluginConfig(pluginConfigDir(deps.run));
74
- const address = probeAddress(config);
75
- return [
76
- `Installed (${plugin.kind === 'github' ? 'from GitHub' : `linked to ${plugin.root}`}).`,
77
- `Webr is ${await isPortOpen(address) ? 'running' : 'not running'} on port ${address.port}.`,
78
- ...modeLines(pluginMode(deps.run, deps.stateDir)),
79
- `Settings: ${JSON.stringify(config)}`,
80
- `Logs and state: ${deps.stateDir}`,
81
- ];
64
+ if ((await isPortOpen(address)) && !(await stopPluginWebr(deps.stateDir, address))) return [`Webr is running on port ${address.port} but the plugin did not start it. Stop it and run "webr install" to use the new version.`];
65
+ const refreshed = deps.run('webr', ['install', '--no-open']);
66
+ return refreshed.ok ? quiet(refreshed.output) : [`The new Webr could not refresh the plugin. Run "webr install". ${quiet(refreshed.output).join(' ')}`];
82
67
  }
@@ -35,6 +35,6 @@ export function pluginMode(run: RunCommand, stateDir: string): PluginMode {
35
35
  export function modeLines(mode: PluginMode) {
36
36
  if (mode.kind === 'production') return ['Mode: production (started by the Herdr plugin).'];
37
37
  if (mode.kind === 'dev') return [`Mode: dev, running from ${mode.checkout}. Stopping "pnpm dev" brings production back.`];
38
- if (mode.kind === 'stuck') return [`Mode: the plugin still points at ${mode.where} but dev is not running. Run "webr plugin install" to restore production.`];
38
+ if (mode.kind === 'stuck') return [`Mode: the plugin still points at ${mode.where} but dev is not running. Run "webr install" to restore production.`];
39
39
  return [];
40
40
  }
package/server/where.ts CHANGED
@@ -6,7 +6,7 @@ const launcher = (platform = process.platform) => platform === 'darwin' ? ['open
6
6
 
7
7
  export async function statusLines(port: number, mode: string[] = []) {
8
8
  if (await isPortOpen({ host: '127.0.0.1', port })) return [`Webr is running at ${localUrl(port)}`, ...mode];
9
- return [`Webr is not running. Its address is ${localUrl(port)}.`, ...mode, 'It starts with the Herdr server once the plugin is installed ("webr plugin install"), or run "webr start".'];
9
+ return [`Webr is not running. Its address is ${localUrl(port)}.`, ...mode, 'It starts with the Herdr server once the plugin is installed ("webr install"), or run "webr start".'];
10
10
  }
11
11
 
12
12
  export async function openWebr(port: number, open = openInBrowser) {
@@ -70,6 +70,15 @@ async function iconInDirectory(root: string, directory: string, generic = false)
70
70
  }
71
71
  }
72
72
 
73
+ async function childDirectories(directory: string): Promise<string[]> {
74
+ try {
75
+ return (await readdir(directory, { withFileTypes: true })).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort().slice(0, 8);
76
+ } catch (error) {
77
+ if (!unavailable(error)) throw error;
78
+ return [];
79
+ }
80
+ }
81
+
73
82
  async function discover(project: Project): Promise<ProjectIcon | undefined> {
74
83
  const directory = project.path.startsWith('~/') ? join(homedir(), project.path.slice(2)) : resolve(project.path);
75
84
  let root: string;
@@ -90,8 +99,10 @@ async function discover(project: Project): Promise<ProjectIcon | undefined> {
90
99
  } catch (error) {
91
100
  if (!unavailable(error)) throw error;
92
101
  }
102
+ const sources = await childDirectories(join(root, 'src'));
93
103
  const directories = [
94
104
  ...['', 'public', 'static', 'assets', 'web', 'web/public', 'app', 'app/public', 'src/assets', 'src/app', 'frontend/public'].map((path) => join(root, path)),
105
+ ...sources.map((source) => join(root, 'src', source, 'public')),
95
106
  ...apps.flatMap((app) => ['public', 'src/assets', 'assets'].map((path) => join(root, 'apps', app, path))),
96
107
  ];
97
108
  for (const generic of [false, true]) {