@phnx-labs/artifacts-cli 0.9.7 → 0.9.9
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 +19 -0
- package/dist/lib/collab.js +41 -27
- package/dist/lib/collab.js.map +1 -1
- package/dist/lib/share/worker-template.js +254 -1
- package/dist/lib/share/worker-template.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.9 — 2026-10-13
|
|
4
|
+
|
|
5
|
+
- **A private link explains itself instead of bouncing to a login page.** Opening a page
|
|
6
|
+
shared with your organization, or with its owner only, when you may not read it now shows
|
|
7
|
+
a sealed page: the title, who shared it, the agent that made it and who can open it, over a
|
|
8
|
+
blurred stand-in for the page, with one Continue with Phoenix ID button. Signed in with the
|
|
9
|
+
wrong account, it names that account and offers another sign-in instead of a bare 404. The
|
|
10
|
+
page's content is never sent before sign-in; the blurred page is a decoy, not a preview.
|
|
11
|
+
- **Private links unfurl in Slack.** A link-preview bot now gets the page's own title, a one-line
|
|
12
|
+
description and a card showing the title and who may open it, never the page's description.
|
|
13
|
+
Token-protected links still answer 404.
|
|
14
|
+
|
|
15
|
+
## 0.9.8 — 2026-10-12
|
|
16
|
+
|
|
17
|
+
- **A reply you are typing survives a teammate's comment.** On a shared document's review
|
|
18
|
+
rail, a new comment on any thread no longer wipes the reply, new comment or inline edit
|
|
19
|
+
you are writing; the text, focus and caret stay put, and a reply on the same thread no
|
|
20
|
+
longer closes your composer.
|
|
21
|
+
|
|
3
22
|
## 0.9.7 — 2026-10-11
|
|
4
23
|
|
|
5
24
|
- **Comments live in the share bar.** On a shared document with review threads, a
|
package/dist/lib/collab.js
CHANGED
|
@@ -301,6 +301,29 @@ export const COLLAB_SCRIPT = `<script>
|
|
|
301
301
|
const item = document.createElement('li');
|
|
302
302
|
item.className = 'collab-comment';
|
|
303
303
|
item.dataset.commentId = comment.id;
|
|
304
|
+
const mine = !comment.deleted && !comment.pending && comment.author && comment.author.id && comment.author.id === viewerId();
|
|
305
|
+
if (mine && canComment() && thread.editing === comment.id) {
|
|
306
|
+
const form = document.createElement('form');
|
|
307
|
+
form.className = 'collab-editor';
|
|
308
|
+
const textarea = document.createElement('textarea');
|
|
309
|
+
textarea.setAttribute('aria-label', 'Edit comment');
|
|
310
|
+
textarea.value = thread.editValue;
|
|
311
|
+
textarea.addEventListener('input', () => { thread.editValue = textarea.value; });
|
|
312
|
+
const row = document.createElement('div');
|
|
313
|
+
row.className = 'collab-actions';
|
|
314
|
+
const save = document.createElement('button');
|
|
315
|
+
save.type = 'submit';
|
|
316
|
+
save.textContent = 'Save';
|
|
317
|
+
row.append(save, button('cancel-edit', 'Cancel'));
|
|
318
|
+
form.append(textarea, row);
|
|
319
|
+
form.addEventListener('submit', (event) => {
|
|
320
|
+
event.preventDefault();
|
|
321
|
+
const value = textarea.value.trim();
|
|
322
|
+
if (value) patchComment(thread, comment.id, { body: value }, 'Edit failed.');
|
|
323
|
+
});
|
|
324
|
+
item.append(form);
|
|
325
|
+
return item;
|
|
326
|
+
}
|
|
304
327
|
const byline = document.createElement('div');
|
|
305
328
|
byline.className = 'collab-byline';
|
|
306
329
|
const author = document.createElement('span');
|
|
@@ -314,7 +337,6 @@ export const COLLAB_SCRIPT = `<script>
|
|
|
314
337
|
body.className = 'collab-body' + (comment.deleted ? ' is-deleted' : '') + (comment.pending ? ' is-pending' : '');
|
|
315
338
|
body.textContent = comment.deleted ? 'Comment deleted' : comment.body;
|
|
316
339
|
item.append(byline, body);
|
|
317
|
-
const mine = !comment.deleted && !comment.pending && comment.author && comment.author.id && comment.author.id === viewerId();
|
|
318
340
|
if (mine && canComment()) {
|
|
319
341
|
const actions = document.createElement('div');
|
|
320
342
|
actions.className = 'collab-actions';
|
|
@@ -365,6 +387,7 @@ export const COLLAB_SCRIPT = `<script>
|
|
|
365
387
|
textarea.setAttribute('aria-label', thread.draft ? 'Comment' : 'Reply');
|
|
366
388
|
textarea.placeholder = thread.draft ? 'Comment on this selection…' : 'Reply…';
|
|
367
389
|
textarea.value = thread.composerValue || '';
|
|
390
|
+
textarea.addEventListener('input', () => { thread.composerValue = textarea.value; });
|
|
368
391
|
const row = document.createElement('div');
|
|
369
392
|
row.className = 'collab-actions';
|
|
370
393
|
const submit = document.createElement('button');
|
|
@@ -394,6 +417,11 @@ export const COLLAB_SCRIPT = `<script>
|
|
|
394
417
|
};
|
|
395
418
|
|
|
396
419
|
const renderRail = () => {
|
|
420
|
+
// Rebuilding replaces every textarea. Their text lives on the thread, but
|
|
421
|
+
// focus and the caret do not, so they are carried across: a teammate's
|
|
422
|
+
// comment landing anywhere must not interrupt whoever is typing.
|
|
423
|
+
const field = list.contains(document.activeElement) && document.activeElement.tagName === 'TEXTAREA' ? document.activeElement : null;
|
|
424
|
+
const typing = field && { thread: field.closest('[data-thread-id]').dataset.threadId, form: field.form.className, start: field.selectionStart, end: field.selectionEnd, direction: field.selectionDirection };
|
|
397
425
|
const shown = [...threads.values()].filter((thread) => thread.draft || visible(thread));
|
|
398
426
|
list.replaceChildren();
|
|
399
427
|
if (!shown.length) {
|
|
@@ -403,6 +431,8 @@ export const COLLAB_SCRIPT = `<script>
|
|
|
403
431
|
list.append(empty);
|
|
404
432
|
}
|
|
405
433
|
for (const thread of shown) list.append(threadItem(thread));
|
|
434
|
+
const restored = typing && list.querySelector('[data-thread-id="' + CSS.escape(typing.thread) + '"] .' + typing.form + ' textarea');
|
|
435
|
+
if (restored) { restored.focus(); restored.setSelectionRange(typing.start, typing.end, typing.direction); }
|
|
406
436
|
const open = [...threads.values()].filter((thread) => !thread.draft && thread.status !== 'resolved').length;
|
|
407
437
|
launcher.querySelector('.collab-count').textContent = String(open);
|
|
408
438
|
launcher.setAttribute('aria-label', open === 1 ? '1 open review thread' : open + ' open review threads');
|
|
@@ -419,7 +449,7 @@ export const COLLAB_SCRIPT = `<script>
|
|
|
419
449
|
if (!thread || !thread.id) return false;
|
|
420
450
|
const existing = threads.get(thread.id);
|
|
421
451
|
if (existing && Number(thread.cursor || 0) < Number(existing.cursor || 0)) return false;
|
|
422
|
-
threads.set(thread.id, { ...existing, ...thread, draft: false,
|
|
452
|
+
threads.set(thread.id, { ...existing, ...thread, draft: false, error: null });
|
|
423
453
|
return true;
|
|
424
454
|
};
|
|
425
455
|
|
|
@@ -569,6 +599,7 @@ export const COLLAB_SCRIPT = `<script>
|
|
|
569
599
|
comments: current.comments.map((comment) => (comment.id === commentId
|
|
570
600
|
? { ...comment, ...(payload.deleted ? { deleted: true } : { body: payload.body, edited: true }) }
|
|
571
601
|
: comment)),
|
|
602
|
+
editing: current.editing === commentId ? null : current.editing,
|
|
572
603
|
error: null,
|
|
573
604
|
}));
|
|
574
605
|
renderRail();
|
|
@@ -612,7 +643,9 @@ export const COLLAB_SCRIPT = `<script>
|
|
|
612
643
|
const thread = item && threads.get(item.dataset.threadId);
|
|
613
644
|
if (!thread) return;
|
|
614
645
|
const action = target.dataset.collabAction;
|
|
615
|
-
|
|
646
|
+
// Rendering replaces the clicked item, so the new field is found through the list.
|
|
647
|
+
const field = (form) => list.querySelector('[data-thread-id="' + CSS.escape(thread.id) + '"] .' + form + ' textarea');
|
|
648
|
+
if (action === 'reply') { thread.composer = true; thread.composerValue = ''; renderRail(); field('collab-composer')?.focus(); return; }
|
|
616
649
|
if (action === 'cancel') {
|
|
617
650
|
if (thread.draft) { threads.delete('draft'); draft = null; selected = null; }
|
|
618
651
|
else { thread.composer = false; thread.composerValue = ''; thread.error = null; }
|
|
@@ -622,32 +655,13 @@ export const COLLAB_SCRIPT = `<script>
|
|
|
622
655
|
if (action === 'reopen') { setStatus(thread, 'open'); return; }
|
|
623
656
|
if (action === 'delete') { patchComment(thread, target.dataset.collabTarget, { deleted: true }, 'Delete failed.'); return; }
|
|
624
657
|
if (action === 'edit') {
|
|
625
|
-
const
|
|
626
|
-
const comment = thread.comments.find((value) => value.id === commentId);
|
|
658
|
+
const comment = thread.comments.find((value) => value.id === target.dataset.collabTarget);
|
|
627
659
|
if (!comment) return;
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
textarea.setAttribute('aria-label', 'Edit comment');
|
|
632
|
-
textarea.value = comment.body;
|
|
633
|
-
const row = document.createElement('div');
|
|
634
|
-
row.className = 'collab-actions';
|
|
635
|
-
const save = document.createElement('button');
|
|
636
|
-
save.type = 'submit';
|
|
637
|
-
save.textContent = 'Save';
|
|
638
|
-
row.append(save, button('cancel-edit', 'Cancel'));
|
|
639
|
-
form.append(textarea, row);
|
|
640
|
-
form.addEventListener('submit', (submitEvent) => {
|
|
641
|
-
submitEvent.preventDefault();
|
|
642
|
-
const value = textarea.value.trim();
|
|
643
|
-
if (value) patchComment(thread, commentId, { body: value }, 'Edit failed.');
|
|
644
|
-
});
|
|
645
|
-
form.addEventListener('click', (clickEvent) => {
|
|
646
|
-
if (clickEvent.target.closest('[data-collab-action="cancel-edit"]')) { clickEvent.preventDefault(); clickEvent.stopPropagation(); renderRail(); }
|
|
647
|
-
});
|
|
648
|
-
holder.replaceChildren(form);
|
|
649
|
-
textarea.focus();
|
|
660
|
+
thread.editing = comment.id;
|
|
661
|
+
thread.editValue = comment.body;
|
|
662
|
+
renderRail(); field('collab-editor')?.focus(); return;
|
|
650
663
|
}
|
|
664
|
+
if (action === 'cancel-edit') { thread.editing = null; renderRail(); }
|
|
651
665
|
});
|
|
652
666
|
|
|
653
667
|
list.addEventListener('focusin', (event) => {
|
package/dist/lib/collab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collab.js","sourceRoot":"","sources":["../../src/lib/collab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAE5D;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAgiB7E,CAAC"}
|
|
@@ -583,7 +583,7 @@ export default {
|
|
|
583
583
|
const pageVisibility = (page.customMetadata && page.customMetadata.visibility) || 'public';
|
|
584
584
|
if (viewer.error && isIdentityGated(pageVisibility)) return viewer.error;
|
|
585
585
|
const denied = await gateVisibility(url, env, page, viewer.identity || null);
|
|
586
|
-
if (denied) return denied;
|
|
586
|
+
if (denied) return isIdentityGated(pageVisibility) ? sealedCover(request, url, page, segments[0], pagePath) : denied;
|
|
587
587
|
// A token-gated page's cover is token-gated too (PHNX-3654): a crawler
|
|
588
588
|
// fetching <slug>.png without the key gets 404, so no preview leaks.
|
|
589
589
|
const coverTokenDenied = await gateTokenRead(request, url, page, viewer.identity || null);
|
|
@@ -747,6 +747,10 @@ export default {
|
|
|
747
747
|
const identity = viewer.identity || null;
|
|
748
748
|
const denied = await gateVisibility(url, env, gateObj, identity);
|
|
749
749
|
if (denied) {
|
|
750
|
+
if (isIdentityGated(visibility) && wantsSealedPage(request)) {
|
|
751
|
+
const sealed = renderSealedPage(url, env, gateObj, identity);
|
|
752
|
+
if (sealed) return sealed;
|
|
753
|
+
}
|
|
750
754
|
denied.headers.set('cache-control', 'private, no-store');
|
|
751
755
|
denied.headers.set('X-Robots-Tag', 'noindex');
|
|
752
756
|
return denied;
|
|
@@ -1682,6 +1686,255 @@ function renderAssetViewer(pathname, kind, meta, handle, opts) {
|
|
|
1682
1686
|
'</style></head><body>' + bar + '<div class="ashv">' + asset + '</div></body></html>';
|
|
1683
1687
|
}
|
|
1684
1688
|
|
|
1689
|
+
// --- The sealed page (me/org) ----------------------------------------------
|
|
1690
|
+
// A browser or link-preview bot that may not read a me/org page gets this page
|
|
1691
|
+
// instead of a bare login redirect or a text 404, so a link pasted in Slack
|
|
1692
|
+
// shows what it is and a stranger sees why to sign in. It is built ONLY from
|
|
1693
|
+
// the object's metadata (label, handle, agent, dates, org domain) and the path:
|
|
1694
|
+
// the page body is never read, so nothing of the content can leak. The blurred
|
|
1695
|
+
// page behind the glass is a decoy drawn from a hash of the path. A 'private'
|
|
1696
|
+
// (token) page keeps its 404: its URL is the secret, and a title would confirm
|
|
1697
|
+
// it exists. 200, not 401, because Slack and other unfurlers drop error pages.
|
|
1698
|
+
var PREVIEW_BOT = /Slackbot|facebookexternalhit|Twitterbot|LinkedInBot|Discordbot|WhatsApp|TelegramBot|Applebot|redditbot|Embedly|SkypeUriPreview|Iframely|Mastodon|vkShare|Pinterest/i;
|
|
1699
|
+
var AGENT_NAMES = { claude: 'Claude Code', codex: 'Codex', opencode: 'OpenCode', gemini: 'Gemini', cursor: 'Cursor', droid: 'Droid', grok: 'Grok', kimi: 'Kimi', antigravity: 'Antigravity' };
|
|
1700
|
+
|
|
1701
|
+
function wantsSealedPage(request) {
|
|
1702
|
+
if (request.method !== 'GET' && request.method !== 'HEAD') return false;
|
|
1703
|
+
return acceptsHtml(request) || PREVIEW_BOT.test(request.headers.get('user-agent') || '');
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
function shortDate(value) {
|
|
1707
|
+
var t = Date.parse(value || '');
|
|
1708
|
+
if (!t) return '';
|
|
1709
|
+
return new Date(t).toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'UTC' });
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
function sealedTitle(meta, slug) {
|
|
1713
|
+
var title = (meta && (meta.label || meta['og-title'])) || '';
|
|
1714
|
+
if (title) return title;
|
|
1715
|
+
try { return decodeURIComponent(slug || 'Shared page'); } catch (e) { return slug || 'Shared page'; }
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
// Deterministic page-shaped shapes from the path alone. Percent units so the
|
|
1719
|
+
// same markup fills the glass at any width.
|
|
1720
|
+
function sealedDecoy(seed) {
|
|
1721
|
+
var h = 2166136261;
|
|
1722
|
+
for (var i = 0; i < seed.length; i++) { h ^= seed.charCodeAt(i); h = Math.imul(h, 16777619); }
|
|
1723
|
+
function rnd() { h ^= h << 13; h ^= h >>> 17; h ^= h << 5; return ((h >>> 0) % 10000) / 10000; }
|
|
1724
|
+
var out = '';
|
|
1725
|
+
function add(cls, x, y, w, hh, style) {
|
|
1726
|
+
out += '<i class="sd ' + cls + '" style="left:' + x.toFixed(1) + '%;top:' + y.toFixed(1) + '%;width:' + w.toFixed(1) + '%;height:' + hh.toFixed(1) + '%' + (style ? ';' + style : '') + '"></i>';
|
|
1727
|
+
}
|
|
1728
|
+
var hue = Math.floor(rnd() * 360);
|
|
1729
|
+
var y = 6;
|
|
1730
|
+
add('s1', 6, y, 30 + rnd() * 20, 4.5); y += 8;
|
|
1731
|
+
add('s2', 6, y, 55 + rnd() * 25, 2.2); y += 4;
|
|
1732
|
+
add('s3', 6, y, 40 + rnd() * 20, 2.2); y += 7;
|
|
1733
|
+
var cols = rnd() > 0.5 ? 2 : 3;
|
|
1734
|
+
var cw = (88 - (cols - 1) * 2) / cols;
|
|
1735
|
+
for (var c = 0; c < cols; c++) {
|
|
1736
|
+
var x = 6 + c * (cw + 2);
|
|
1737
|
+
add('sb', x, y, cw, 22);
|
|
1738
|
+
add('s2', x + 2, y + 4, cw * 0.5, 2.4);
|
|
1739
|
+
add('s3', x + 2, y + 9, cw * 0.75, 1.8);
|
|
1740
|
+
add('s3', x + 2, y + 13, cw * 0.6, 1.8);
|
|
1741
|
+
if (c === 0) add('sa', x + 2, y + 17, cw * 0.22, 2.2);
|
|
1742
|
+
}
|
|
1743
|
+
y += 27;
|
|
1744
|
+
if (rnd() > 0.35) {
|
|
1745
|
+
add('si', 6, y, 40, 26, 'background:linear-gradient(135deg,hsl(' + hue + ' 45% 45% / .55),hsl(' + ((hue + 60) % 360) + ' 40% 30% / .45))');
|
|
1746
|
+
for (var k = 0; k < 6; k++) add(k % 3 === 0 ? 's2' : 's3', 50, y + 2 + k * 4, 30 + rnd() * 14, 1.8);
|
|
1747
|
+
} else {
|
|
1748
|
+
for (var m = 0; m < 7; m++) add(m === 0 ? 's2' : 's3', 6, y + m * 4, 60 + rnd() * 28, 1.8);
|
|
1749
|
+
}
|
|
1750
|
+
y += 30;
|
|
1751
|
+
for (var n = 0; n < 5 && y < 96; n++, y += 4) add('s3', 6, y, 50 + rnd() * 36, 1.8);
|
|
1752
|
+
return out;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
var SEALED_CSS =
|
|
1756
|
+
'html,body{margin:0;background:#09090b;color:#fafafa}' +
|
|
1757
|
+
'body{font-family:"ash-inter",ui-sans-serif,system-ui,sans-serif;font-size:15px;line-height:1.5;min-height:100vh;' +
|
|
1758
|
+
'background:radial-gradient(120% 60% at 50% 112%,rgba(201,169,98,.16),transparent 60%),radial-gradient(80% 50% at 50% 100%,rgba(90,70,140,.10),transparent 70%),linear-gradient(#060608,#0b0b0e 55%,#121015) fixed}' +
|
|
1759
|
+
'.sw{max-width:760px;margin:0 auto;padding:28px 16px 56px;box-sizing:border-box}' +
|
|
1760
|
+
'.sx{display:block;width:52px;height:auto;margin:0 auto -26px;position:relative;z-index:3;filter:drop-shadow(0 10px 24px rgba(201,169,98,.35));animation:sr 1.4s cubic-bezier(.22,1,.36,1) both .15s}' +
|
|
1761
|
+
'@keyframes sr{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}' +
|
|
1762
|
+
'@keyframes sl{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}' +
|
|
1763
|
+
'.sg{position:relative;border-radius:22px;overflow:hidden;border:1px solid rgba(255,255,255,.09);background:#0e0e11;aspect-ratio:16/11;max-height:560px;box-shadow:0 40px 90px -40px rgba(0,0,0,.9);animation:sl 1s cubic-bezier(.22,1,.36,1) both}' +
|
|
1764
|
+
'.sdc,.sln{position:absolute;inset:0}' +
|
|
1765
|
+
'.sdc{filter:blur(9px) saturate(1.1);transform:scale(1.06);opacity:.9}' +
|
|
1766
|
+
'.sln{pointer-events:none;-webkit-mask-image:radial-gradient(circle 92px at var(--lx,-200px) var(--ly,-200px),#000 55%,transparent 100%);mask-image:radial-gradient(circle 92px at var(--lx,-200px) var(--ly,-200px),#000 55%,transparent 100%)}' +
|
|
1767
|
+
'.sln:after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(135deg,transparent 0 10px,rgba(0,0,0,.25) 10px 12px)}' +
|
|
1768
|
+
'.sd{position:absolute;border-radius:6px}' +
|
|
1769
|
+
'.sd.s1{background:rgba(255,255,255,.55)}.sd.s2{background:rgba(255,255,255,.28)}.sd.s3{background:rgba(255,255,255,.16)}' +
|
|
1770
|
+
'.sd.sb{background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.08);border-radius:12px}.sd.sa{background:#C9A962;opacity:.8}.sd.si{border-radius:12px}' +
|
|
1771
|
+
'.sln .sd.s1,.sln .sd.s2,.sln .sd.s3{background:#e4e4e7;opacity:.85}' +
|
|
1772
|
+
'.sfr{position:absolute;inset:0;background:linear-gradient(180deg,rgba(9,9,11,.15),rgba(9,9,11,.55) 60%,rgba(9,9,11,.82))}' +
|
|
1773
|
+
'.ssh{position:absolute;inset:-40% -60%;pointer-events:none;background:linear-gradient(105deg,transparent 42%,rgba(232,206,140,.10) 49%,rgba(255,255,255,.07) 50%,transparent 57%);transform:translateX(-60%);animation:ss 2.6s cubic-bezier(.22,1,.36,1) .9s both}' +
|
|
1774
|
+
'@keyframes ss{to{transform:translateX(60%)}}' +
|
|
1775
|
+
'.sc{position:absolute;left:50%;bottom:7%;translate:-50% 0;width:min(520px,88%);box-sizing:border-box;text-align:center;padding:30px 28px 24px;border-radius:20px;background:rgba(24,24,27,.55);border:1px solid rgba(255,255,255,.16);backdrop-filter:blur(22px) saturate(1.2);-webkit-backdrop-filter:blur(22px) saturate(1.2);box-shadow:0 24px 60px -20px rgba(0,0,0,.8);animation:sl 1s cubic-bezier(.22,1,.36,1) both .35s}' +
|
|
1776
|
+
'.se{font-family:"ash-jost",ui-sans-serif,system-ui,sans-serif;font-weight:500;font-size:11px;letter-spacing:.24em;text-transform:uppercase;color:#a1a1aa}' +
|
|
1777
|
+
'.st{font-family:"ash-jost",ui-sans-serif,system-ui,sans-serif;font-weight:500;font-size:clamp(24px,4.2vw,34px);line-height:1.1;letter-spacing:-.01em;margin:10px 0 12px;text-wrap:balance;overflow-wrap:anywhere}' +
|
|
1778
|
+
'.swh{font-size:13.5px;line-height:1.7;color:#d4d4d8;text-wrap:balance}' +
|
|
1779
|
+
'.swh b{font-weight:500;color:#fff}' +
|
|
1780
|
+
'.sav{width:22px;height:22px;border-radius:6px;display:inline-grid;vertical-align:middle;margin:-2px 8px 0 0;place-items:center;font-size:11px;font-weight:600;color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.18);flex:none}' +
|
|
1781
|
+
'.sm{margin-top:6px;font-size:12.5px;color:#71717a;font-variant-numeric:tabular-nums}' +
|
|
1782
|
+
'.sb2{display:inline-flex;align-items:center;justify-content:center;gap:10px;margin-top:20px;min-height:48px;padding:0 22px;border-radius:999px;font-size:15px;font-weight:500;color:#17140c;text-decoration:none;background:linear-gradient(135deg,#E8CE8C,#C9A962 55%,#A8884A);box-shadow:0 10px 30px -10px rgba(201,169,98,.55),inset 0 1px 0 rgba(255,255,255,.35);transition:translate .25s cubic-bezier(.22,1,.36,1)}' +
|
|
1783
|
+
'.sb2 img{width:12px;height:auto;filter:brightness(.15)}' +
|
|
1784
|
+
'.sb2:focus-visible{outline:2px solid #C9A962;outline-offset:3px}' +
|
|
1785
|
+
'@media (hover:hover) and (pointer:fine){.sb2:hover{translate:0 -2px}}' +
|
|
1786
|
+
'.sh{margin-top:10px;font-size:12.5px;color:#71717a}' +
|
|
1787
|
+
'.sy{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:30px;animation:sl 1s cubic-bezier(.22,1,.36,1) both .6s}' +
|
|
1788
|
+
'.sy div{border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.025);border-radius:14px;padding:14px 16px}' +
|
|
1789
|
+
'.sy b{display:block;font-family:"ash-jost",ui-sans-serif,system-ui,sans-serif;font-weight:500;font-size:15px;margin-bottom:4px}' +
|
|
1790
|
+
'.sy span{font-size:13px;color:#a1a1aa}' +
|
|
1791
|
+
'.smd{margin:18px 0 0;text-align:center;font-size:13px;color:#71717a}.smd a{color:#a1a1aa}' +
|
|
1792
|
+
'@media (max-width:640px){.sy{grid-template-columns:minmax(0,1fr)}.sg{aspect-ratio:auto;height:540px}.sc{bottom:16px;padding:24px 18px 20px}}' +
|
|
1793
|
+
'@media (prefers-reduced-motion:reduce){.sx,.sg,.sc,.sy,.ssh{animation:none}.sln{display:none}}';
|
|
1794
|
+
|
|
1795
|
+
function renderSealedPage(url, env, obj, identity) {
|
|
1796
|
+
var base = typeof env.PHOENIX_ID_BASE === 'string' ? env.PHOENIX_ID_BASE.replace(/\\/+$/, '') : '';
|
|
1797
|
+
if (!base) return null;
|
|
1798
|
+
var meta = obj.customMetadata || {};
|
|
1799
|
+
var visibility = meta.visibility || 'public';
|
|
1800
|
+
var segs = url.pathname.split('/').filter(Boolean);
|
|
1801
|
+
var handle = '';
|
|
1802
|
+
try { handle = decodeURIComponent(segs[0] || ''); } catch (e) { handle = segs[0] || ''; }
|
|
1803
|
+
var title = sealedTitle(meta, segs[segs.length - 1]);
|
|
1804
|
+
var domain = meta.org_domain || '';
|
|
1805
|
+
var agent = meta.agent ? (AGENT_NAMES[String(meta.agent).toLowerCase()] || meta.agent) : '';
|
|
1806
|
+
var made = shortDate(meta['published-at']) || meta.date || '';
|
|
1807
|
+
var until = shortDate(meta['expires-at']);
|
|
1808
|
+
var loginUrl = base + '/login?return=' + encodeURIComponent(url.toString());
|
|
1809
|
+
var E = escapeHtml;
|
|
1810
|
+
var av = '<span class="sav" style="background:hsl(' + avatarHue(handle) + ',38%,38%)">' + E((handle || '?').charAt(0).toUpperCase()) + '</span>';
|
|
1811
|
+
var signedIn = identity && identity.email ? E(identity.email) : '';
|
|
1812
|
+
|
|
1813
|
+
var eyebrow, who, metaLine, cta, hint, description;
|
|
1814
|
+
var bits = [];
|
|
1815
|
+
if (agent) bits.push('Made with ' + E(agent));
|
|
1816
|
+
if (made) bits.push(E(made));
|
|
1817
|
+
if (visibility === 'org') {
|
|
1818
|
+
description = 'Shared with ' + (domain || 'an organization') + ' by ' + handle + '. Sign in with Phoenix ID to open it.';
|
|
1819
|
+
if (signedIn) {
|
|
1820
|
+
eyebrow = domain ? 'For ' + E(domain) + ' accounts' : 'For your organization';
|
|
1821
|
+
who = 'You\\u2019re signed in as <b>' + signedIn + '</b>';
|
|
1822
|
+
bits = [E(handle) + ' shared this page with ' + E(domain) + ' only'];
|
|
1823
|
+
cta = 'Sign in with another account';
|
|
1824
|
+
} else {
|
|
1825
|
+
eyebrow = domain ? 'Shared with ' + E(domain) : 'Shared with your organization';
|
|
1826
|
+
who = av + '<b>' + E(handle) + '</b> shared this with everyone at ' + (domain ? E(domain) : 'your organization');
|
|
1827
|
+
if (until) bits.push('open until ' + E(until));
|
|
1828
|
+
cta = 'Continue with Phoenix ID';
|
|
1829
|
+
}
|
|
1830
|
+
hint = domain ? 'Use your ' + E(domain) + ' Google account.' : 'Use your work Google account.';
|
|
1831
|
+
} else {
|
|
1832
|
+
description = 'A private page by ' + handle + '. Only ' + handle + ' can open it.';
|
|
1833
|
+
eyebrow = 'Private page';
|
|
1834
|
+
who = av + 'Only <b>' + E(handle) + '</b> can open this page.';
|
|
1835
|
+
cta = signedIn ? 'Sign in with another account' : 'Continue with Phoenix ID';
|
|
1836
|
+
hint = signedIn ? 'You\\u2019re signed in as ' + signedIn + '.' : 'Sign in as ' + E(handle) + ' to open it.';
|
|
1837
|
+
}
|
|
1838
|
+
metaLine = bits.join(' \\u00b7 ');
|
|
1839
|
+
|
|
1840
|
+
var page = url.origin + url.pathname;
|
|
1841
|
+
var image = page.replace(/\\/+$/, '') + '.png';
|
|
1842
|
+
var head =
|
|
1843
|
+
'<title>' + E(title) + '</title>' +
|
|
1844
|
+
'<meta name="description" content="' + E(description) + '">' +
|
|
1845
|
+
'<meta name="robots" content="noindex">' +
|
|
1846
|
+
'<meta property="og:type" content="website">' +
|
|
1847
|
+
'<meta property="og:site_name" content="Rush">' +
|
|
1848
|
+
'<meta property="og:title" content="' + E(title) + '">' +
|
|
1849
|
+
'<meta property="og:description" content="' + E(description) + '">' +
|
|
1850
|
+
'<meta property="og:url" content="' + E(page) + '">' +
|
|
1851
|
+
'<meta property="og:image" content="' + E(image) + '">' +
|
|
1852
|
+
'<meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">' +
|
|
1853
|
+
'<meta name="twitter:card" content="summary_large_image">' +
|
|
1854
|
+
'<meta name="twitter:title" content="' + E(title) + '">' +
|
|
1855
|
+
'<meta name="twitter:description" content="' + E(description) + '">' +
|
|
1856
|
+
'<meta name="twitter:image" content="' + E(image) + '">' +
|
|
1857
|
+
'<link rel="icon" href="/__brand/phoenix.webp">';
|
|
1858
|
+
var decoy = sealedDecoy(url.pathname);
|
|
1859
|
+
var bar = '<div class="agents-share-bar" role="banner" style="background:rgba(9,9,11,.92) !important;color:#e4e4e7 !important">' +
|
|
1860
|
+
'<span class="ash-left">' + ASH_LOCKUP + '</span></div>';
|
|
1861
|
+
var lens = 'var g=document.querySelector(".sg"),l=document.querySelector(".sln");if(g&&l){' +
|
|
1862
|
+
'g.addEventListener("pointermove",function(e){var b=g.getBoundingClientRect();l.style.setProperty("--lx",(e.clientX-b.left)+"px");l.style.setProperty("--ly",(e.clientY-b.top)+"px")});' +
|
|
1863
|
+
'g.addEventListener("pointerleave",function(){l.style.setProperty("--lx","-200px");l.style.setProperty("--ly","-200px")})}';
|
|
1864
|
+
var html = '<!doctype html><html lang="en"><head><meta charset="utf-8">' +
|
|
1865
|
+
'<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">' + head +
|
|
1866
|
+
'<style>' + ASH_FONT_CSS + ASH_BAR_CSS + SEALED_CSS + '</style></head><body>' + bar +
|
|
1867
|
+
'<main class="sw">' +
|
|
1868
|
+
'<img class="sx" src="/__brand/phoenix.webp" alt="" width="82" height="128">' +
|
|
1869
|
+
'<div class="sg">' +
|
|
1870
|
+
'<div class="sdc" aria-hidden="true">' + decoy + '</div>' +
|
|
1871
|
+
'<div class="sln" aria-hidden="true">' + decoy + '</div>' +
|
|
1872
|
+
'<div class="sfr"></div><div class="ssh"></div>' +
|
|
1873
|
+
'<section class="sc" aria-label="Sign in to open this page">' +
|
|
1874
|
+
'<div class="se">' + eyebrow + '</div>' +
|
|
1875
|
+
'<h1 class="st">' + E(title) + '</h1>' +
|
|
1876
|
+
'<div class="swh">' + who + '</div>' +
|
|
1877
|
+
(metaLine ? '<div class="sm">' + metaLine + '</div>' : '') +
|
|
1878
|
+
'<a class="sb2" href="' + E(loginUrl) + '"><img src="/__brand/phoenix.webp" alt="">' + cta + '</a>' +
|
|
1879
|
+
'<div class="sh">' + hint + '</div>' +
|
|
1880
|
+
'</section>' +
|
|
1881
|
+
'</div>' +
|
|
1882
|
+
'<div class="sy">' +
|
|
1883
|
+
'<div><b>Ask for the work</b><span>Send a request; an agent does it in its own cloud computer.</span></div>' +
|
|
1884
|
+
'<div><b>Get it back with proof</b><span>A page like this one, a PR with checks, files or an answer.</span></div>' +
|
|
1885
|
+
'<div><b>Share it with your team</b><span>Only the people you pick can open it, like this link.</span></div>' +
|
|
1886
|
+
'</div>' +
|
|
1887
|
+
'<p class="smd">This page was made in Rush. <a href="https://getrush.ai">See what Rush does</a></p>' +
|
|
1888
|
+
'</main><script>' + lens + '</script></body></html>';
|
|
1889
|
+
return new Response(html, {
|
|
1890
|
+
status: 200,
|
|
1891
|
+
headers: {
|
|
1892
|
+
'content-type': 'text/html; charset=utf-8',
|
|
1893
|
+
'cache-control': 'private, no-store',
|
|
1894
|
+
'X-Robots-Tag': 'noindex',
|
|
1895
|
+
'vary': 'Cookie, Authorization, Accept, User-Agent',
|
|
1896
|
+
},
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
// The preview card for a me/org page a caller may not read: title, handle and
|
|
1901
|
+
// who may open it, never the page's own description. Kept in the Worker's HTTP
|
|
1902
|
+
// cache keyed on the page etag, never in R2, so it cannot be confused with the
|
|
1903
|
+
// full card an allowed viewer gets.
|
|
1904
|
+
async function sealedCover(request, url, page, handle, pagePath) {
|
|
1905
|
+
const meta = page.customMetadata || {};
|
|
1906
|
+
const input = {
|
|
1907
|
+
title: sealedTitle(meta, pagePath.split('/').pop()),
|
|
1908
|
+
description: 'Sign in with Phoenix ID to open this page.',
|
|
1909
|
+
handle: handle,
|
|
1910
|
+
visibility: meta.visibility || 'public',
|
|
1911
|
+
orgDomain: meta.org_domain || '',
|
|
1912
|
+
};
|
|
1913
|
+
// A metadata-only PATCH keeps the body etag, so the key carries every input
|
|
1914
|
+
// the card is drawn from: a rename or visibility change is a new card at once.
|
|
1915
|
+
const cache = typeof caches !== 'undefined' && caches.default ? caches.default : null;
|
|
1916
|
+
const key = new Request(url.origin + '/' + pagePath + '.png?sealed=' + encodeURIComponent(page.etag || '') +
|
|
1917
|
+
'&v=' + encodeURIComponent(JSON.stringify(input)));
|
|
1918
|
+
// The browser copy stays private like every me/org response (PHNX-3676): the
|
|
1919
|
+
// same URL answers an allowed viewer with the full card. Only the Worker's
|
|
1920
|
+
// own cache entry is marked storable.
|
|
1921
|
+
const headers = { 'content-type': 'image/png', 'cache-control': 'private, no-store', 'X-Robots-Tag': 'noindex' };
|
|
1922
|
+
let png = null;
|
|
1923
|
+
if (cache) {
|
|
1924
|
+
const hit = await cache.match(key);
|
|
1925
|
+
if (hit) png = await hit.arrayBuffer();
|
|
1926
|
+
}
|
|
1927
|
+
if (!png) {
|
|
1928
|
+
try {
|
|
1929
|
+
png = await hooks.renderOgCard(input);
|
|
1930
|
+
} catch (error) {
|
|
1931
|
+
return new Response('OG card render failed', { status: 500, headers: { 'content-type': 'text/plain; charset=utf-8' } });
|
|
1932
|
+
}
|
|
1933
|
+
if (cache) await cache.put(key, new Response(png, { headers: { 'content-type': 'image/png', 'cache-control': 'public, max-age=600' } }));
|
|
1934
|
+
}
|
|
1935
|
+
return new Response(request.method === 'HEAD' ? null : png, { status: 200, headers: headers });
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1685
1938
|
// --- Hosted review threads (PHNX-3835) ---------------------------------------
|
|
1686
1939
|
// The Worker is the only party Rush Cloud trusts for review threads: it knows
|
|
1687
1940
|
// the reader (resolveViewer), applies the page's own visibility gate plus the
|
|
@@ -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,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAqGvE,IAAI,aAAuC,CAAC;AAC5C,IAAI,gBAAoC,CAAC;AAEzC,uFAAuF;AACvF,MAAM,UAAU,kBAAkB;IAChC,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IACxC,MAAM,MAAM,GAAG,SAAS,CAAC;QACvB,KAAK,EAAE;YACL,QAAQ,EAAE,kBAAkB,EAAE;YAC9B,MAAM,EAAE,IAAI;YACZ,UAAU,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgyB1B,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/artifacts-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
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": {
|