create-heresay 0.2.2 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-heresay",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Set up your own Heresay: in-app feedback that every report gets a hearing. Creates a Firebase project in your Google account and deploys the dashboard, API and SDK to it.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/release/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -1,3 +1,3 @@
1
1
  /** The Heresay release. Bumped by the release script; the CLI and /v1/health report it. */
2
- export const VERSION = '0.2.2';
2
+ export const VERSION = '0.2.3';
3
3
  //# sourceMappingURL=version.js.map
@@ -198,3 +198,13 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
198
198
  .btn.danger:disabled { opacity:.4; }
199
199
  .row.tight { margin-top:0; }
200
200
  .form label input[name=confirm] { margin-top:6px; }
201
+
202
+ /* copy prompt; the quieter alternative */
203
+ .copy-prompt { display:flex; flex-direction:column; align-items:flex-start; gap:10px; margin-top:4px; }
204
+ .copy-prompt .hint, .copy-prompt .ok-msg, .copy-prompt .err { margin:0; }
205
+ .alt { margin-top:18px; font-size:13px; }
206
+ .alt summary { cursor:pointer; color:var(--mute); list-style:none; text-decoration:underline; text-underline-offset:3px; display:inline; }
207
+ .alt summary::-webkit-details-marker { display:none; }
208
+ .alt summary:hover { color:var(--fg); }
209
+ .alt[open] summary { margin-bottom:10px; }
210
+ .alt[open] { font-size:15px; }
@@ -413,15 +413,15 @@
413
413
  '',
414
414
  '1. Connect this repo to Heresay. This adds .mcp.json, a Heresay skill and an AGENTS.md section, and saves the token in ~/.heresay, outside the repo. Do not copy the token into any file.',
415
415
  '',
416
- ' npx -y heresay@0 connect --url ' + location.origin + ' --token ' + token + ' --yes',
416
+ ' npx -y heresay@latest connect --url ' + location.origin + ' --token ' + token + ' --yes',
417
417
  '',
418
418
  '2. Print the install steps for this app and follow them. They include the app\'s key and exactly where the code goes' + (apple ? ' (a Swift package and one line of setup).' : ', for any framework.'),
419
419
  '',
420
- ' npx -y heresay@0 install ' + p.id,
420
+ ' npx -y heresay@latest install ' + p.id,
421
421
  '',
422
422
  '3. Verify the install. This finds the app\'s key in the code and tells the Heresay dashboard, which is waiting for it:',
423
423
  '',
424
- ' npx -y heresay@0 check ' + p.id,
424
+ ' npx -y heresay@latest check ' + p.id,
425
425
  '',
426
426
  ' You are done when it prints "installed": true. If it doesn\'t, fix what it says and run it again.',
427
427
  '',
@@ -437,29 +437,46 @@
437
437
 
438
438
  // The agent route: one prompt by default, with the same thing as two steps for people who
439
439
  // would rather run the command themselves.
440
- var promptBox = el('div');
441
- var getPrompt = el('button', { class: 'btn primary', type: 'button', text: 'Get the prompt' });
442
- getPrompt.onclick = function () {
443
- getPrompt.disabled = true;
444
- getPrompt.textContent = 'Making a token…';
440
+ // The prompt is copied, not shown: it's long, and it carries a token.
441
+ var promptBox = el('div', { class: 'copy-prompt' });
442
+ var copyBtn = el('button', { class: 'btn primary', type: 'button', text: 'Copy prompt' });
443
+ var copyNote = el('p', { class: 'hint', role: 'status', text: 'It connects the repo, installs Heresay and verifies it. This page ticks over by itself when it’s done.' });
444
+ var promptText = null;
445
+ function makePrompt() {
446
+ if (promptText) return Promise.resolve(promptText);
445
447
  // No repo yet: the token binds to whichever repo the agent runs it in.
446
- api('POST', '/agent-tokens', { app_ids: [p.id] }).then(function (b) {
447
- getPrompt.remove();
448
- promptBox.appendChild(codeBlock(onePrompt(p, b.token)));
449
- promptBox.appendChild(el('p', { class: 'hint', html: 'It carries a token for this app that works only in the first repo that uses it. You can revoke it under <a href="#/connect">Connected repos</a>.' }));
448
+ return api('POST', '/agent-tokens', { app_ids: [p.id] }).then(function (b) { return (promptText = onePrompt(p, b.token)); });
449
+ }
450
+ copyBtn.onclick = function () {
451
+ copyBtn.disabled = true;
452
+ var text = makePrompt();
453
+ // Safari only allows a copy inside the click, so hand the clipboard a promise of the text.
454
+ var copied = window.ClipboardItem && navigator.clipboard.write
455
+ ? navigator.clipboard.write([new ClipboardItem({ 'text/plain': text.then(function (t) { return new Blob([t], { type: 'text/plain' }); }) })])
456
+ : text.then(function (t) { return navigator.clipboard.writeText(t); });
457
+ Promise.all([text, copied]).then(function () {
458
+ copyBtn.disabled = false;
459
+ copyBtn.textContent = 'Copied ✓';
460
+ copyNote.className = 'ok-msg';
461
+ copyNote.innerHTML = '';
462
+ copyNote.appendChild(document.createTextNode('Copied. Paste it into your coding agent and send it. It carries a token for this app that works only in the first repo that uses it; you can revoke it under '));
463
+ copyNote.appendChild(el('a', { href: '#/connect', text: 'Connected repos' }));
464
+ copyNote.appendChild(document.createTextNode('.'));
465
+ setTimeout(function () { copyBtn.textContent = 'Copy prompt'; }, 2500);
450
466
  }).catch(function (x) {
451
- getPrompt.disabled = false;
452
- getPrompt.textContent = 'Get the prompt';
453
- promptBox.appendChild(el('p', { class: 'err', text: x.message }));
467
+ copyBtn.disabled = false;
468
+ copyNote.className = 'err';
469
+ copyNote.textContent = x && x.message ? x.message : 'Couldn’t copy. Try again.';
454
470
  });
455
471
  };
456
- promptBox.appendChild(getPrompt);
472
+ promptBox.appendChild(copyBtn);
473
+ promptBox.appendChild(copyNote);
457
474
 
458
475
  var agentFirst = !apple && (!p.framework || p.framework === 'other');
459
476
  var panes = { hand: el('div', { hidden: agentFirst }, byHand(p)), agent: el('div', { hidden: !agentFirst }, [
460
- el('p', { text: 'Paste one prompt into your coding agent (Claude Code, Cursor, Codex, …), opened in your app’s repo. It connects the repo, installs Heresay, and verifies it.' }),
477
+ el('p', { html: 'Open your coding agent (Claude Code, Cursor, Codex, …) in your app’s repo, then paste in this prompt.' }),
461
478
  promptBox,
462
- el('details', { class: 'where' }, [el('summary', { text: 'Or do it in two steps' }),
479
+ el('details', { class: 'alt' }, [el('summary', { text: 'Prefer to run the command yourself?' }),
463
480
  el('ol', { class: 'agent-steps' }, [
464
481
  el('li', {}, [el('b', { text: 'In your app’s repo, run:' }), codeBlock('npx heresay connect --url ' + location.origin),
465
482
  el('p', { class: 'hint', text: 'It opens this dashboard to make a token for the repo, and adds the Heresay skill and MCP server for your agent. The token stays on your computer, not in the repo.' })]),
@@ -716,7 +733,7 @@
716
733
  '',
717
734
  '1. Read the removal steps and follow them:',
718
735
  '',
719
- ' npx -y heresay@0 guide uninstall',
736
+ ' npx -y heresay@latest guide uninstall',
720
737
  '',
721
738
  '2. Remove it from the app\'s code. Search for the key ' + p.key + ' and for "' + (apple ? 'Heresay' : 'sdk/v1.js') + '". ' + (apple
722
739
  ? 'Remove the Heresay Swift package dependency, `import Heresay`, the Heresay.configure(…) call, .heresayReportButton() / .heresay(), HeresayCommands, and any Heresay.identify / setScreen / present calls.'
@@ -724,7 +741,7 @@
724
741
  '',
725
742
  '3. Remove the agent files Heresay added (.mcp.json entry, skill, AGENTS.md section, saved token):',
726
743
  '',
727
- ' npx -y heresay@0 disconnect --yes',
744
+ ' npx -y heresay@latest disconnect --yes',
728
745
  '',
729
746
  'Change nothing else. Build and run the tests to make sure nothing else broke.',
730
747
  ].join('\n');