@phnx-labs/artifacts-cli 0.18.1 → 0.18.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.18.3 — 2026-11-12
6
+
7
+ - **Change who can open a page without leaving it.** The owner's Share sheet now holds the Rush console's Share panel for the page instead of a **Change who can open it** link to a new tab. Pick Only you, everyone at your domain, anyone with the link or public, and it saves on that click; the Share button's icon follows. The panel loads from `cloud.getrush.ai/embed/artifact-share/` the first time the sheet opens and saves with the console's sign-in, so the page and its script still send no write (PHNX-4398). The sheet trusts only that frame's messages, and only its height and the saved level. The bar's blur moved behind its content and the sheet dropped its own, so the framed panel counts as visible to the console's clickjacking check.
8
+
9
+ ## 0.18.2 — 2026-11-12
10
+
11
+ - **A sign-in ticket never stays in a page's address.** The share Worker now answers every request for a page, its cover or its revision list that carries `phoenix_ticket` with a redirect to the same address without it, after spending the ticket, whether or not the reader was already signed in. Before, a reader who already had the share cookie, or sent a Phoenix bearer, was served the page with the ticket still in its URL, where browser history, the `Referer` header and the page's own scripts could read it; a stale ticket on a public page stayed there too. A reader already signed in keeps that identity, so a link carrying someone else's ticket cannot switch accounts (PHNX-4480).
12
+
5
13
  ## 0.18.1 — 2026-11-12
6
14
 
7
15
  - **Change who can open a page from the page.** The Share sheet on a published page no longer shows the owner an `artifacts share visibility` command. It shows **Change who can open it**, which opens that page's Share panel in the Rush console (`cloud.getrush.ai/console/artifacts?share=<user>/<slug>`) in a new tab, where the owner picks Only you, everyone at their domain, anyone with the link, or public. Writes still take only the Phoenix bearer, never the page's `__share` cookie (PHNX-4398). The share server's visibility refusals now carry a `code` (`org_public_domain`, `org_domain_unverified`, `visibility_needs_publish`, `needs_phoenix_identity`) beside the message, so the console names the reason.
@@ -645,8 +645,8 @@ export default {
645
645
  // never invoked ticket redemption, so a stale ticket must not 401 it.
646
646
  if (canonical && isIdentityGated(canonicalVis)) {
647
647
  const viewer = await resolveViewer(request, env, url);
648
- if (viewer.redirect) return viewer.redirect;
649
648
  if (viewer.error) return viewer.error;
649
+ if (viewer.redirect) return viewer.redirect;
650
650
  const denied = await gateVisibility(url, env, canonical, viewer.identity || null);
651
651
  if (denied) return denied;
652
652
  }
@@ -684,7 +684,6 @@ export default {
684
684
  const page = await env.BUCKET.get(pagePath);
685
685
  if (!page) return new Response('not found', { status: 404, headers: { 'content-type': 'text/plain' } });
686
686
  const pageVisibility = (page.customMetadata && page.customMetadata.visibility) || 'public';
687
- if (viewer.error && isIdentityGated(pageVisibility)) return viewer.error;
688
687
  const denied = await gateVisibility(url, env, page, viewer.identity || null);
689
688
  if (denied) return isIdentityGated(pageVisibility) && denied.status !== 503 ? sealedCover(request, url, page, segments[0], pagePath) : denied;
690
689
  // A token-gated page's cover is token-gated too (PHNX-3654): a crawler
@@ -840,6 +839,11 @@ export default {
840
839
  // this refactor, so a stale ticket there must serve anonymously, not 401.
841
840
  const visibility = (gateObj.customMetadata && gateObj.customMetadata.visibility) || 'public';
842
841
  const viewer = await resolveViewer(request, env, url);
842
+ if (viewer.error && isIdentityGated(visibility)) {
843
+ viewer.error.headers.set('cache-control', 'private, no-store');
844
+ viewer.error.headers.set('X-Robots-Tag', 'noindex');
845
+ return viewer.error;
846
+ }
843
847
  if (viewer.redirect) {
844
848
  if (isIdentityGated(visibility)) {
845
849
  viewer.redirect.headers.set('cache-control', 'private, no-store');
@@ -847,11 +851,6 @@ export default {
847
851
  }
848
852
  return viewer.redirect;
849
853
  }
850
- if (viewer.error && isIdentityGated(visibility)) {
851
- viewer.error.headers.set('cache-control', 'private, no-store');
852
- viewer.error.headers.set('X-Robots-Tag', 'noindex');
853
- return viewer.error;
854
- }
855
854
  const identity = viewer.identity || null;
856
855
  const denied = await gateVisibility(url, env, gateObj, identity);
857
856
  if (denied) {
@@ -874,8 +873,9 @@ export default {
874
873
  return tokenDenied;
875
874
  }
876
875
  // The owner of the namespace (their handle === the first path segment) sees
877
- // the commands that change the page; everyone else keeps the static cue.
876
+ // the console's Share panel for the page; everyone else keeps the static cue.
878
877
  const isOwner = !!identity && handleFromEmail(identity.email) === firstSeg;
878
+ const ownerDomain = isOwner ? emailDomain(identity.email) : '';
879
879
  let range = null;
880
880
  const requestedRange = request.method === 'GET' ? request.headers.get('range') : null;
881
881
  if (requestedRange) range = parseByteRange(requestedRange, gateObj.size);
@@ -934,6 +934,7 @@ export default {
934
934
  if (!range && ctype.indexOf('text/html') === -1 && !wantsRaw && kind && acceptsHtml(request) && visibility !== 'private') {
935
935
  const viewerPage = renderAssetViewer(url.pathname, kind, gateObj.customMetadata || {}, firstSeg, {
936
936
  isOwner,
937
+ ownerDomain,
937
938
  link: shareLink(url),
938
939
  media: kind === 'video' ? await mediaViewData(env, ctx, gateObj, path, isOwner) : null,
939
940
  canRetry: isOwner && !!mediaConfig(env),
@@ -975,6 +976,7 @@ export default {
975
976
  }
976
977
  const withBar = injectAttributionBar(servedFooter(rawHtml), obj.customMetadata || {}, firstSeg, {
977
978
  isOwner,
979
+ ownerDomain,
978
980
  views,
979
981
  uploaded: obj.uploaded,
980
982
  link: shareLink(url),
@@ -1340,7 +1342,6 @@ var VIS_ICON = {
1340
1342
  var STAT_EYE_ICON = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>';
1341
1343
  var COMMENT_ICON = '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z"/></svg>';
1342
1344
  var COPY_ICON = '<svg viewBox="0 0 24 24" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg>';
1343
- var ASH_EXTERNAL_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" aria-hidden="true"><path d="M7 17 17 7"/><path d="M8 7h9v9"/></svg>';
1344
1345
  var CHECK_ICON = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><path d="m5 12 5 5 9-10"/></svg>';
1345
1346
 
1346
1347
  // "Rush" in Cormorant Upright 500, outlined, so the lockup needs no extra face.
@@ -1355,7 +1356,12 @@ var ASH_LOCKUP = '<a class="ash-lock" href="https://getrush.ai" aria-label="Rush
1355
1356
 
1356
1357
  // The Share sheet, for every viewer: open and close, the link without view-only
1357
1358
  // query parameters (a protected page keeps its key, k, so the link still opens),
1358
- // and the copy control, which answers with a check for 1.4 s.
1359
+ // and the copy control, which answers with a check for 1.4 s. For the owner it
1360
+ // also loads the console's panel on first open and trusts only that frame's
1361
+ // messages: its height, and the level it saved, which repaints the Share pill.
1362
+ // The tallest the console's Share panel may make itself in the sheet.
1363
+ var ASH_EMBED_MAX_HEIGHT = 560;
1364
+
1359
1365
  var ASH_SHARE_JS = '(function(){' +
1360
1366
  'var root = document.querySelector(".agents-share-bar");' +
1361
1367
  'if(!root) return;' +
@@ -1366,7 +1372,22 @@ var ASH_SHARE_JS = '(function(){' +
1366
1372
  'var url = pop.querySelector("[data-ash-url]");' +
1367
1373
  'if(url) url.textContent = link().slice(location.protocol.length + 2);' +
1368
1374
  'function isOpen(){ return pop.classList.contains("ash-open"); }' +
1369
- 'function open(){ pop.classList.add("ash-open"); pop.setAttribute("aria-hidden","false"); btn.setAttribute("aria-expanded","true"); var f = pop.querySelector("[data-ash-copy]"); if(f) f.focus(); }' +
1375
+ 'var frame = pop.querySelector(".ash-embed");' +
1376
+ 'var frameOrigin = "";' +
1377
+ 'if(frame){ try { frameOrigin = new URL(frame.getAttribute("data-src")).origin; } catch (e) { frame = null; } }' +
1378
+ 'function loadEmbed(){ if(frame && !frame.getAttribute("src")) frame.setAttribute("src", frame.getAttribute("data-src")); }' +
1379
+ 'if(frame) window.addEventListener("message", function(e){' +
1380
+ 'if(e.origin !== frameOrigin || e.source !== frame.contentWindow || !e.data || typeof e.data !== "object") return;' +
1381
+ 'if(e.data.type === "rush-share:height" && typeof e.data.height === "number" && isFinite(e.data.height)){ frame.style.height = Math.max(0, Math.min(' + ASH_EMBED_MAX_HEIGHT + ', Math.ceil(e.data.height))) + "px"; return; }' +
1382
+ 'if(e.data.type !== "rush-share:saved") return;' +
1383
+ 'var levels = JSON.parse(frame.getAttribute("data-ash-levels") || "{}");' +
1384
+ 'var c = typeof e.data.visibility === "string" && Object.prototype.hasOwnProperty.call(levels, e.data.visibility) ? levels[e.data.visibility] : null;' +
1385
+ 'if(!c) return;' +
1386
+ 'var cic = btn.querySelector(".ash-cic");' +
1387
+ 'if(cic){ cic.innerHTML = c.icon; cic.style.color = c.color; }' +
1388
+ 'btn.title = c.label;' +
1389
+ '});' +
1390
+ 'function open(){ loadEmbed(); pop.classList.add("ash-open"); pop.setAttribute("aria-hidden","false"); btn.setAttribute("aria-expanded","true"); var f = pop.querySelector("[data-ash-copy]"); if(f) f.focus(); }' +
1370
1391
  'function close(back){ if(!isOpen()) return; pop.classList.remove("ash-open"); pop.setAttribute("aria-hidden","true"); btn.setAttribute("aria-expanded","false"); if(back) btn.focus(); }' +
1371
1392
  'btn.addEventListener("click", function(e){ e.stopPropagation(); if(isOpen()) close(true); else open(); });' +
1372
1393
  'pop.addEventListener("click", function(e){ e.stopPropagation(); });' +
@@ -1408,10 +1429,10 @@ var ASH_LEGACY_REVIEW_JS = '(function(){' +
1408
1429
  '})();';
1409
1430
 
1410
1431
  // Each level's semantic hue lives on its icon only; the chip itself is neutral
1411
- // glass, so the bar never reads as an alert.
1432
+ // glass, so the bar never reads as an alert. The label is plain text.
1412
1433
  function visibilityChip(visibility, orgDomain) {
1413
1434
  if (visibility === 'me') return { icon: VIS_ICON.me, label: 'Only you', color: '#fbbf24' };
1414
- if (visibility === 'org') return { icon: VIS_ICON.org, label: 'Anyone at ' + escapeHtml(orgDomain || 'your organization'), color: '#93c5fd' };
1435
+ if (visibility === 'org') return { icon: VIS_ICON.org, label: 'Anyone at ' + (orgDomain || 'your organization'), color: '#93c5fd' };
1415
1436
  if (visibility === 'private') return { icon: VIS_ICON.me, label: 'Protected (link + key)', color: '#fbbf24' };
1416
1437
  if (visibility === 'unlisted') return { icon: VIS_ICON.unlisted, label: 'Unlisted', color: '#a1a1aa' };
1417
1438
  return { icon: VIS_ICON.public, label: 'Public', color: '#34d399' };
@@ -1474,9 +1495,10 @@ function renderMediaPill(media) {
1474
1495
  return '<span class="ash-job ash-job-run" role="status"><span class="ash-jdot"></span><span class="ash-jtxt">' + doing + '</span></span>';
1475
1496
  }
1476
1497
 
1477
- // opts: { isOwner, views, uploaded, title, media, link } — all optional.
1478
- // isOwner adds the command that changes who can open the page and keeps the
1479
- // author's provenance in view. title overrides the stored label (a video's
1498
+ // opts: { isOwner, ownerDomain, views, uploaded, title, media, link } — all
1499
+ // optional. isOwner puts the console's Share panel in the sheet and keeps the
1500
+ // author's provenance in view; ownerDomain names the org level before the page
1501
+ // has one. title overrides the stored label (a video's
1480
1502
  // summary title); media adds the transcript status.
1481
1503
  function renderAttributionBar(meta, handle, opts) {
1482
1504
  var o = opts || {};
@@ -1502,14 +1524,21 @@ function renderAttributionBar(meta, handle, opts) {
1502
1524
 
1503
1525
  // Share: the visibility icon on the button; the sheet holds the link, who can
1504
1526
  // open it and the stats. The page cannot change its own visibility: anything
1505
- // the bar could send, the page's own script could send too (PHNX-4398), so
1506
- // the owner's link opens the page's Share panel in the console.
1527
+ // the bar could send, the page's own script could send too (PHNX-4398). So
1528
+ // for the owner, who can open it is the console's own Share panel, framed
1529
+ // from cloud.getrush.ai: it saves with the console's session, which this
1530
+ // origin never holds, and tells the bar only its height and the saved level.
1507
1531
  var cic = '<span class="ash-cic" style="color:' + chip.color + '">' + chip.icon + '</span>';
1508
- var levels = '<p class="ash-ro">' + cic + '<span>' + chip.label + '</span></p>';
1532
+ var levels = '<p class="ash-ro">' + cic + '<span>' + escapeHtml(chip.label) + '</span></p>';
1509
1533
  var key = '';
1510
1534
  try { key = o.link ? decodeURIComponent(new URL(o.link).pathname).replace(/^\\/+/, '') : ''; } catch (e) { key = ''; }
1511
1535
  if (o.isOwner && key) {
1512
- levels += '<a class="ash-change" href="' + escapeHtml(CONSOLE_ARTIFACTS_URL + '?' + new URLSearchParams({ share: key }).toString()) + '" target="_blank" rel="noopener">Change who can open it' + ASH_EXTERNAL_ICON + '</a>';
1536
+ // A PATCH to org stamps the owner's own domain, so that names the level.
1537
+ var domain = o.ownerDomain || cm.org_domain;
1538
+ var chips = {};
1539
+ ['me', 'org', 'unlisted', 'public'].forEach(function (v) { chips[v] = visibilityChip(v, domain); });
1540
+ levels = '<iframe class="ash-embed" title="Who can open it" referrerpolicy="strict-origin"' +
1541
+ ' data-src="' + escapeHtml(consoleEmbedUrl(key)) + '" data-ash-levels="' + escapeHtml(JSON.stringify(chips)) + '"></iframe>';
1513
1542
  }
1514
1543
  var stats = [];
1515
1544
  if (o.views != null) stats.push(STAT_EYE_ICON + '<b>' + escapeHtml(String(o.views)) + '</b>&nbsp;' + (Number(o.views) === 1 ? 'view' : 'views'));
@@ -1518,7 +1547,7 @@ function renderAttributionBar(meta, handle, opts) {
1518
1547
  var qr = o.link && o.link.length <= QR_LINK_MAX ? '<div class="ash-qr" role="img" aria-label="QR code that opens this link"><span class="ash-qrc">' + shareQrSvg(o.link) + '</span>' +
1519
1548
  '<span class="ash-qrt"><b>Open on your phone</b><span>Point your camera at the code. It opens this link, with the same access.</span></span></div>' : '';
1520
1549
  var share = '<span class="ash-vis">' +
1521
- '<button type="button" class="ash-share" data-ash-share aria-label="Share" aria-haspopup="dialog" aria-expanded="false" title="' + chip.label + '">' + cic + '<span class="ash-sl" aria-hidden="true">Share</span></button>' +
1550
+ '<button type="button" class="ash-share" data-ash-share aria-label="Share" aria-haspopup="dialog" aria-expanded="false" title="' + escapeHtml(chip.label) + '">' + cic + '<span class="ash-sl" aria-hidden="true">Share</span></button>' +
1522
1551
  '<div class="ash-pop" data-ash-pop role="dialog" aria-label="Share" aria-hidden="true">' +
1523
1552
  '<div class="ash-link"><span class="ash-url" data-ash-url></span>' +
1524
1553
  '<button type="button" class="ash-copy" data-ash-copy aria-label="Copy link" title="Copy link"><span class="ash-cpi" data-ash-copy-ic>' + COPY_ICON + '</span></button></div>' +
@@ -1563,8 +1592,12 @@ var ASH_BAR_CSS =
1563
1592
  // hosted page only copies the URL. The bar's Share sheet owns that here.
1564
1593
  '[data-header-actions] .share-action{display:none !important}' +
1565
1594
  '.agents-share-bar{all:initial;position:fixed !important;top:0 !important;left:0 !important;right:0 !important;width:100% !important;height:' + ASH_BAR_HEIGHT + 'px;z-index:2147483647 !important;box-sizing:border-box;display:flex !important;align-items:center;gap:12px;padding:0 12px 0 16px;' +
1566
- '-webkit-backdrop-filter:blur(28px) saturate(1.3);backdrop-filter:blur(28px) saturate(1.3);border-bottom:1px solid rgba(255,255,255,.07) !important;box-shadow:0 10px 30px -18px rgba(0,0,0,.8);' +
1595
+ 'border-bottom:1px solid rgba(255,255,255,.07) !important;box-shadow:0 10px 30px -18px rgba(0,0,0,.8);' +
1567
1596
  'font:13px/1.2 "ash-inter",Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui,sans-serif !important;-webkit-font-smoothing:antialiased}' +
1597
+ // The blur sits on a layer behind the bar's content, never on an ancestor of
1598
+ // the Share sheet: a filtered ancestor makes the console's framed panel read
1599
+ // as not visible to IntersectionObserver v2, and it then refuses every save.
1600
+ '.agents-share-bar::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;-webkit-backdrop-filter:blur(28px) saturate(1.3);backdrop-filter:blur(28px) saturate(1.3)}' +
1568
1601
  '.agents-share-bar *{box-sizing:border-box;font-family:inherit;letter-spacing:normal;text-transform:none}' +
1569
1602
  '.agents-share-bar svg{flex:none;display:block}' +
1570
1603
  '.agents-share-bar button{margin:0;font:inherit;-webkit-appearance:none;appearance:none}' +
@@ -1597,7 +1630,7 @@ var ASH_BAR_CSS =
1597
1630
  '.agents-share-bar .ash-share:hover,.agents-share-bar .ash-share[aria-expanded="true"]{background:rgba(255,255,255,.09) !important;border-color:rgba(255,255,255,.16) !important}' +
1598
1631
  '.agents-share-bar .ash-cic{display:inline-flex}' +
1599
1632
  '.agents-share-bar .ash-pop{position:absolute !important;top:calc(100% + 8px);right:0;width:320px;max-width:calc(100vw - 20px);padding:6px;border-radius:16px;z-index:2147483647;text-align:left;' +
1600
- 'background:rgba(18,18,21,.95) !important;-webkit-backdrop-filter:blur(28px) saturate(1.3);backdrop-filter:blur(28px) saturate(1.3);border:1px solid rgba(255,255,255,.1) !important;box-shadow:0 24px 60px -12px rgba(0,0,0,.75);' +
1633
+ 'background:#09090b !important;border:1px solid rgba(255,255,255,.1) !important;box-shadow:0 24px 60px -12px rgba(0,0,0,.75);' +
1601
1634
  'visibility:hidden;opacity:0;transform:translateY(-4px);transition:opacity .18s cubic-bezier(.22,1,.36,1),transform .18s cubic-bezier(.22,1,.36,1),visibility 0s linear .18s}' +
1602
1635
  '.agents-share-bar .ash-pop.ash-open{visibility:visible;opacity:1;transform:none;transition-delay:0s}' +
1603
1636
  '.agents-share-bar .ash-link{display:flex;align-items:center;gap:6px;height:40px;margin:2px 2px 6px;padding:0 4px 0 12px;border-radius:12px;border:1px solid rgba(255,255,255,.08) !important;background:rgba(255,255,255,.03) !important}' +
@@ -1711,13 +1744,18 @@ var ASH_RAIL_CSS =
1711
1744
 
1712
1745
  var ASH_VISITOR_CSS = '.origin-inline,.creator-line,.print-provenance,.collab-provenance{display:none !important}';
1713
1746
 
1714
- // Owner-only styling for the Share sheet's link to the console, added to the
1715
- // bar's <style> only when the viewer owns the namespace.
1747
+ // The console's Share panel for one page, the only frame the owner's sheet
1748
+ // loads. Its origin is the console's, so there is one console host.
1749
+ function consoleEmbedUrl(key) {
1750
+ return new URL(CONSOLE_ARTIFACTS_URL).origin + '/embed/artifact-share/?' + new URLSearchParams({ path: key }).toString();
1751
+ }
1752
+
1753
+ // Owner-only styling for the console's panel in the Share sheet, added to the
1754
+ // bar's <style> only when the viewer owns the namespace. The sheet widens to
1755
+ // the panel's width; on a phone it already spans the viewport.
1716
1756
  var OWNER_BAR_CSS =
1717
- '.agents-share-bar .ash-change{display:inline-flex;align-items:center;gap:6px;margin:0 12px 8px;padding:6px 12px;border-radius:999px;font-size:12.5px;font-weight:500;color:#e4e4e7 !important;background:rgba(255,255,255,.06) !important;border:1px solid rgba(255,255,255,.1) !important;text-decoration:none !important;transition:background .15s cubic-bezier(.22,1,.36,1)}' +
1718
- '.agents-share-bar .ash-change:hover{background:rgba(255,255,255,.1) !important;color:#fff !important}' +
1719
- '.agents-share-bar .ash-change:focus-visible{outline:2px solid #c9a962;outline-offset:2px}' +
1720
- '.agents-share-bar .ash-change svg{width:13px;height:13px;flex:none}';
1757
+ '@media(min-width:561px){.agents-share-bar .ash-pop{width:380px}}' +
1758
+ '.agents-share-bar .ash-embed{display:block;width:100%;height:248px;max-height:' + ASH_EMBED_MAX_HEIGHT + 'px;margin:0;padding:0;border:0 !important;background:transparent !important;color-scheme:dark}';
1721
1759
 
1722
1760
  // The bar's own files: its two faces and the Phoenix mark of the Rush by
1723
1761
  // Phoenix lockup, bundled into the Worker so a page never loads them elsewhere.
@@ -3336,32 +3374,40 @@ function phoenixIdentity(body) {
3336
3374
  // via records HOW the reader proved who they are: 'bearer' (a Phoenix token,
3337
3375
  // what the CLI and agents send) or 'cookie' (a browser). Only a bearer may act
3338
3376
  // as an agent on review threads.
3377
+ //
3378
+ // On every route that resolves a viewer (the page, its cover and revision
3379
+ // list), a phoenix_ticket is spent and answered with a redirect to the URL
3380
+ // without it (PHNX-4480): a ticket left in a served page's URL reaches history,
3381
+ // Referer and the page's scripts. A reader already signed in keeps that
3382
+ // identity, so a ticket in a link cannot switch them to another account.
3383
+ // error is set only when no identity resulted; the caller decides whether the
3384
+ // page needs one, and otherwise follows the redirect.
3339
3385
  async function resolveViewer(request, env, url) {
3340
3386
  const claims = phoenixIdentity(await hooks.verifyPhoenixToken(request, env));
3341
- if (claims) return { identity: claims, via: 'bearer' };
3342
- const cookieId = await identityFromCookie(request, env);
3343
- if (cookieId) return { identity: cookieId, via: 'cookie' };
3344
- const ticket = url.searchParams.get('phoenix_ticket');
3345
- if (!ticket) return {};
3346
- // Prefer the locally-verifiable self-signed ticket (PHNX-3370, no network), and
3347
- // enforce single use by claiming its signature on first redemption — a captured
3348
- // ticket replayed within its TTL finds it already spent. Fall back to the
3349
- // external identity-server redeem for tickets it issued.
3350
- let redeemed = await verifySelfTicket(ticket, env);
3351
- if (redeemed) {
3352
- const sig = ticket.slice(ticket.lastIndexOf('.') + 1);
3353
- if (!(await consumeSelfTicket(env, sig))) redeemed = null;
3354
- } else {
3355
- redeemed = await redeemTicket(ticket, env);
3356
- }
3357
- if (!redeemed) return { error: json({ error: 'invalid ticket' }, 401) };
3358
- const cookie = await signShareCookie(redeemed, env);
3359
- if (!cookie) return { error: json({ error: 'phoenix login is not configured' }, 401) };
3387
+ const current = claims
3388
+ ? { identity: claims, via: 'bearer' }
3389
+ : await identityFromCookie(request, env).then(function (id) { return id ? { identity: id, via: 'cookie' } : {}; });
3390
+ if (!url.searchParams.has('phoenix_ticket')) return current;
3391
+ const redeemed = await spendTicket(url.searchParams.get('phoenix_ticket'), env);
3360
3392
  url.searchParams.delete('phoenix_ticket');
3361
- const headers = new Headers();
3362
- headers.set('Location', url.toString());
3363
- headers.append('Set-Cookie', cookie);
3364
- return { redirect: new Response(null, { status: 302, headers: headers }) };
3393
+ const redirect = new Response(null, { status: 302, headers: { Location: url.toString() } });
3394
+ if (current.identity) return Object.assign({ redirect: redirect }, current);
3395
+ if (!redeemed) return { redirect: redirect, error: json({ error: 'invalid ticket' }, 401) };
3396
+ const cookie = await signShareCookie(redeemed, env);
3397
+ if (!cookie) return { redirect: redirect, error: json({ error: 'phoenix login is not configured' }, 401) };
3398
+ redirect.headers.append('Set-Cookie', cookie);
3399
+ return { redirect: redirect };
3400
+ }
3401
+
3402
+ // Prefer the locally-verifiable self-signed ticket (PHNX-3370, no network), and
3403
+ // enforce single use by claiming its signature on first redemption, so a
3404
+ // captured ticket replayed within its TTL finds it already spent. Fall back to
3405
+ // the external identity-server redeem for tickets it issued.
3406
+ async function spendTicket(ticket, env) {
3407
+ if (!ticket) return null;
3408
+ const self = await verifySelfTicket(ticket, env);
3409
+ if (!self) return redeemTicket(ticket, env);
3410
+ return (await consumeSelfTicket(env, ticket.slice(ticket.lastIndexOf('.') + 1))) ? self : null;
3365
3411
  }
3366
3412
 
3367
3413
  function extractHtmlMeta(html, field) {
@@ -1 +1 @@
1
- {"version":3,"file":"worker-template.js","sourceRoot":"","sources":["../../../src/lib/share/worker-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC5G,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEtD,yDAAyD;AACzD,EAAE;AACF,mCAAmC;AACnC,gFAAgF;AACh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,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phnx-labs/artifacts-cli",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "Your coding agent writes Markdown; artifacts turns it into one polished HTML page you can read, mark up and share as a link.",
5
5
  "homepage": "https://artifacts-cli.sh",
6
6
  "repository": {