create-heresay 0.2.22 → 0.2.24

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.
@@ -139,6 +139,8 @@
139
139
  var email = $('link-email').value.trim();
140
140
  if (finishingLink) return finishLink(email);
141
141
  gateMsg('Sending…');
142
+ // A chat app sent them here to say yes: come back to that page after the link.
143
+ if (/^#\/authorize\?/.test(location.hash)) localStorage.setItem('heresay.after', JSON.stringify({ hash: location.hash, at: Date.now() }));
142
144
  auth.sendSignInLinkToEmail(email, { url: location.origin + '/app/', handleCodeInApp: true })
143
145
  .then(function () {
144
146
  localStorage.setItem('heresay.email', email);
@@ -178,6 +180,11 @@
178
180
  api('GET', '/me').then(function (b) {
179
181
  me = b;
180
182
  $('who').textContent = b.email;
183
+ try {
184
+ var after = JSON.parse(localStorage.getItem('heresay.after') || 'null');
185
+ localStorage.removeItem('heresay.after');
186
+ if (after && Date.now() - after.at < 15 * 60000 && !location.hash) history.replaceState(null, '', '/app/' + after.hash);
187
+ } catch (e) { /* nothing saved */ }
181
188
  route(); // first, so the view is already waiting when the app is shown
182
189
  show('app');
183
190
  checkForUpdate(b);
@@ -248,7 +255,7 @@
248
255
  var query = new URLSearchParams(hash.split('?')[1] || '');
249
256
  var parts = hash.split('?')[0].split('/').filter(Boolean);
250
257
  document.querySelectorAll('[data-nav]').forEach(function (a) {
251
- var active = parts[0] === 'team' || parts[0] === 'notifications' ? parts[0] : 'apps';
258
+ var active = parts[0] === 'team' || parts[0] === 'notifications' || parts[0] === 'chat' ? parts[0] : 'apps';
252
259
  a.setAttribute('aria-current', String(active === a.dataset.nav));
253
260
  });
254
261
  var view = $('view');
@@ -258,6 +265,8 @@
258
265
  if (parts[0] === 'team') return teamView(view);
259
266
  if (parts[0] === 'notifications') return notificationsView(view);
260
267
  if (parts[0] === 'connect') return connectView(view, query);
268
+ if (parts[0] === 'chat') return chatView(view);
269
+ if (parts[0] === 'authorize') return authorizeView(view, query);
261
270
  if (parts[0] === 'new') return newAppView(view, parts[1], query);
262
271
  if (parts[0] === 'apps' && parts[1]) {
263
272
  return withProject(parts[1], function (p) {
@@ -1395,7 +1404,15 @@
1395
1404
  return el('details', { class: 'trail', open: bad > 0 }, [
1396
1405
  el('summary', { text: 'What happened before · ' + t.length + (t.length === 1 ? ' step' : ' steps') +
1397
1406
  (bad ? ' · ' + bad + ' went wrong' : '') }),
1398
- el('ol', {}, t.map(function (e) {
1407
+ el('ol', {}, t.reduce(function (out, e, i) {
1408
+ // The run that crashed comes first, timed from when it ended; then this run.
1409
+ var prev = t[i - 1];
1410
+ if (e.run === 'last' && i === 0) out.push(el('li', { class: 'k-run' }, [el('span', { class: 'what', text: 'Last run, before the app closed' })]));
1411
+ if (e.run !== 'last' && prev && prev.run === 'last') out.push(el('li', { class: 'k-run' }, [el('span', { class: 'what', text: 'This run' })]));
1412
+ out.push(e);
1413
+ return out;
1414
+ }, []).map(function (e) {
1415
+ if (e.nodeType) return e;
1399
1416
  return el('li', { class: 'k-' + e.kind }, [
1400
1417
  el('span', { class: 'ago', text: ago(e.ago) }),
1401
1418
  el('span', { class: 'kind', text: TRAIL_LABEL[e.kind] || e.kind }),
@@ -1551,12 +1568,15 @@
1551
1568
  el('div', { class: 'meta' }, [
1552
1569
  el('span', { class: 'pill ' + r.type, text: TYPE_LABEL[r.type] }),
1553
1570
  showPlatform ? el('span', { class: 'pill platform-pill', text: platformOf(p.platform).label }) : null,
1571
+ r.source === 'chat' ? el('span', { class: 'pill chat-pill', text: 'From ' + (r.via || 'a chat app') }) : null,
1554
1572
  el('time', { datetime: r.created_at, text: new Date(r.created_at).toLocaleString() }),
1555
1573
  status,
1556
1574
  ]),
1557
1575
  el('p', { class: 'text', text: r.text }),
1558
- el('div', { class: 'ctx', text: ctxLine(r.context) }),
1559
- deviceLine(r.context) ? el('div', { class: 'ctx', text: deviceLine(r.context) }) : null,
1576
+ r.source === 'chat' ? el('div', { class: 'ctx', text: 'From the team: ' + (r.from_member || 'a team member') + ', in a conversation in ' + (r.via || 'a chat app') }) : null,
1577
+ r.details ? el('details', { class: 'chat-details', open: true }, [el('summary', { text: 'From the conversation' }), el('p', { text: r.details })]) : null,
1578
+ r.source === 'chat' ? null : el('div', { class: 'ctx', text: ctxLine(r.context) }),
1579
+ r.source !== 'chat' && deviceLine(r.context) ? el('div', { class: 'ctx', text: deviceLine(r.context) }) : null,
1560
1580
  r.context.page_url ? el('div', { class: 'ctx' }, [el('a', { href: r.context.page_url, target: '_blank', rel: 'noopener noreferrer', text: r.context.page_url })]) : null,
1561
1581
  reporterLine(r.context, r.reporter),
1562
1582
  trailView(r.trail),
@@ -1965,6 +1985,107 @@
1965
1985
  ]);
1966
1986
  }
1967
1987
 
1988
+ // ---- chat apps -------------------------------------------------------------------------
1989
+
1990
+ /**
1991
+ * ChatGPT and other chat apps: each member connects their own, with their own sign-in. Then
1992
+ * ideas from a conversation arrive in the inbox as from them, with the conversation's context.
1993
+ */
1994
+ function chatView(view) {
1995
+ var mcpUrl = location.origin + '/v1/mcp';
1996
+ view.appendChild(el('div', { class: 'head' }, [el('h1', { text: 'ChatGPT and other chat apps' })]));
1997
+ view.appendChild(el('p', { class: 'mute', text: 'Send ideas and bugs from a conversation straight to an app’s inbox, with what the conversation worked out. They arrive as from you and wait for someone to accept them, like any report. The chat app can’t read other people’s reports, accept, decline or fix anything.' }));
1998
+ view.appendChild(el('section', { class: 'card' }, [
1999
+ el('h2', { text: 'Add Heresay to ChatGPT' }),
2000
+ el('ol', { class: 'howto' }, [
2001
+ el('li', { html: 'In ChatGPT, open <b>Settings › Apps &amp; Connectors</b>. Under <b>Advanced settings</b>, turn on <b>Developer mode</b>.' }),
2002
+ el('li', { html: 'Choose <b>Create</b>, name it <b>Heresay</b>, and paste this as the <b>MCP server URL</b>. Authentication: <b>OAuth</b>.' }),
2003
+ el('li', {}, [el('div', { class: 'copy-prompt' }, [el('code', { class: 'url', text: mcpUrl }), copyButton(function () { return mcpUrl; }, 'Copy address')])]),
2004
+ el('li', { text: 'ChatGPT opens this dashboard to ask if it may send requests as you. Say yes.' }),
2005
+ el('li', { html: 'In a conversation, say <i>“Send this to Heresay as an idea for Greenroom”</i>, or <i>“What happened to my Heresay requests?”</i>.' }),
2006
+ ]),
2007
+ el('p', { class: 'hint', text: 'Claude, Cursor and other apps that take a remote MCP server use the same address.' }),
2008
+ ]));
2009
+ // For chat apps that can't sign in with OAuth: a ChatGPT workspace that blocks MCP plugins
2010
+ // (use a ChatGPT Sites bridge), or a script. Shown once.
2011
+ var tokenName = el('input', { name: 'token-name', value: 'ChatGPT', 'aria-label': 'What it is for', maxlength: '80' });
2012
+ var tokenOut = el('div');
2013
+ var tokenErr = el('p', { class: 'err', role: 'alert' });
2014
+ var tokenForm = el('form', { class: 'invite' }, [tokenName, el('button', { class: 'btn', text: 'Create chat token' })]);
2015
+ tokenForm.onsubmit = function (e) {
2016
+ e.preventDefault();
2017
+ tokenErr.textContent = '';
2018
+ api('POST', '/chat-connections', { name: tokenName.value }).then(function (b) {
2019
+ tokenOut.textContent = '';
2020
+ tokenOut.appendChild(el('p', { class: 'hint', text: 'Shown once. Paste it where the chat app asks for a Heresay token, with the address above. It sends requests as you; disconnect it below to stop it.' }));
2021
+ tokenOut.appendChild(el('div', { class: 'copy-prompt' }, [el('code', { class: 'url token-out', text: b.token }), copyButton(function () { return b.token; }, 'Copy token')]));
2022
+ load();
2023
+ }).catch(function (x) { tokenErr.textContent = x.message; });
2024
+ };
2025
+ view.appendChild(el('section', { class: 'card' }, [
2026
+ el('h2', { text: 'Can’t add MCP servers? Use a token' }),
2027
+ el('p', { class: 'mute', text: 'Some ChatGPT workspaces don’t allow plugins with MCPs. A ChatGPT Sites app (a bridge) can call this Heresay with a chat token instead, and works in Chat on every device. Scripts can use one too.' }),
2028
+ tokenForm, tokenErr, tokenOut,
2029
+ ]));
2030
+ var list = el('ul', { class: 'members' }, [loading('li')]);
2031
+ var err = el('p', { class: 'err', role: 'alert' });
2032
+ view.appendChild(el('section', { class: 'card' }, [el('h2', { text: me.role === 'owner' ? 'Connected chat apps' : 'Your connected chat apps' }), list, err]));
2033
+ function draw(cs) {
2034
+ list.textContent = '';
2035
+ if (!cs.length) { list.appendChild(el('li', { class: 'mute', text: 'None yet.' })); return; }
2036
+ cs.forEach(function (c) {
2037
+ list.appendChild(el('li', {}, [
2038
+ el('span', { class: 'avatar', text: (c.client_name || '?').charAt(0).toUpperCase() }),
2039
+ el('div', {}, [el('b', { text: c.client_name + (c.email === me.email ? '' : ' · ' + c.email) }),
2040
+ el('span', { class: 'mute', text: (c.kind === 'token' ? 'Chat token · created ' : 'Connected ') + new Date(c.created_at).toLocaleDateString() + (c.last_used_at ? ' · last used ' + new Date(c.last_used_at).toLocaleString() : '') })]),
2041
+ el('button', { class: 'btn ghost', type: 'button', text: 'Disconnect', onclick: function () {
2042
+ err.textContent = '';
2043
+ api('DELETE', '/chat-connections/' + c.id).then(load).catch(function (x) { err.textContent = x.message; });
2044
+ } }),
2045
+ ]));
2046
+ });
2047
+ }
2048
+ function load() { api('GET', '/chat-connections').then(function (b) { draw(b.connections); }); }
2049
+ load();
2050
+ }
2051
+
2052
+ /** A chat app sent the person here (OAuth): say what it may do, as whom, and ask. */
2053
+ function authorizeView(view, query) {
2054
+ var ask = {};
2055
+ query.forEach(function (v, k) { ask[k] = v; });
2056
+ var qs = new URLSearchParams(ask).toString();
2057
+ api('GET', '/oauth/ask?' + qs).then(function (b) {
2058
+ view.textContent = '';
2059
+ var err = el('p', { class: 'err', role: 'alert' });
2060
+ var answer = function (allow, btn) {
2061
+ err.textContent = '';
2062
+ busyButton(btn, allow ? 'Connecting…' : 'Cancelling…');
2063
+ api('POST', '/oauth/approve', Object.assign({}, ask, { allow: allow })).then(function (x) { location.href = x.redirect; })
2064
+ .catch(function (x) { err.textContent = x.message; });
2065
+ };
2066
+ view.appendChild(el('section', { class: 'card authorize' }, [
2067
+ el('img', { src: '/mark.svg', alt: '', width: '48', height: '48' }),
2068
+ el('h1', { text: 'Connect ' + b.client_name + ' to Heresay?' }),
2069
+ el('p', { class: 'mute', text: 'As ' + me.email + '. It will be able to:' }),
2070
+ el('ul', { class: 'can' }, [
2071
+ el('li', { text: 'See the names of the apps on this Heresay' }),
2072
+ el('li', { text: 'Send bugs and ideas to them as you, with context from the conversation. They wait for someone to accept them.' }),
2073
+ el('li', { text: 'See what happened to the requests you sent' }),
2074
+ ]),
2075
+ el('p', { class: 'mute', text: 'It can’t read anyone else’s reports, or accept, decline or fix anything. You can disconnect it any time under Chat apps.' }),
2076
+ el('div', { class: 'row' }, [
2077
+ el('button', { class: 'btn primary', type: 'button', text: 'Connect', onclick: function (e) { answer(true, e.currentTarget); } }),
2078
+ el('button', { class: 'btn ghost', type: 'button', text: 'Cancel', onclick: function (e) { answer(false, e.currentTarget); } }),
2079
+ ]),
2080
+ el('p', { class: 'hint', text: 'You’ll go back to ' + b.redirect_host + '.' }),
2081
+ err,
2082
+ ]));
2083
+ }).catch(function (x) {
2084
+ view.textContent = '';
2085
+ view.appendChild(el('section', { class: 'card' }, [el('h1', { text: 'This link doesn’t work' }), el('p', { class: 'mute', text: x.message })]));
2086
+ });
2087
+ }
2088
+
1968
2089
  function teamView(view) {
1969
2090
  var owner = me.role === 'owner';
1970
2091
  var list = el('ul', { class: 'members' }, [loading('li')]);
@@ -102,7 +102,7 @@
102
102
  <tr><td><code>data-preferences</code></td><td><code>show</code> · <code>hide</code></td></tr>
103
103
  <tr><td><code>data-trail</code></td><td>on · <code>off</code> · the parts to keep, like <code>pages errors requests</code>. What happened before a report: pages, clicks, failed requests, errors. The reporter sees it and can take it off. Never what anyone typed.</td></tr>
104
104
  <tr><td><code>data-heresay-private</code></td><td>on any element of your app: clicks on it are recorded without its text</td></tr>
105
- <tr><td><code>data-nudge</code></td><td>off · <code>on</code> · the signals to watch, like <code>clicks errors</code>. When someone seems stuck (a button pressed again and again with nothing happening, an error right after a click, requests failing), a small note by the button offers to report it. Watched on the device, never sent. Once per tab; quiet for 7 days after “Not now”.</td></tr></table>
105
+ <tr><td><code>data-nudge</code></td><td>off · <code>on</code> · the signals to watch, like <code>clicks errors</code>. When something failed (a button pressed again and again with nothing happening, an error right after a click, requests failing), a small note by the button asks “Something not working?”. When someone seems unsure (<code>stalled</code>: typing that stopped; <code>circles</code>: the same few pages over and over; <code>refused</code>: a field refused 3 times), it asks “Stuck on something?” and opens as Confusing. Watched on the device, never sent. Once per tab; quiet for 7 days after “Not now”.</td></tr></table>
106
106
  <p>Always there, whatever you choose: the Heresay mark on the button, the <b>Your reports</b> tab (people read why a report was declined), and <b>Powered by Heresay</b> in the panel and the introduction, so people can tell your app uses an outside tool. The widget lives in a shadow root, so your CSS can't restyle it.</p>
107
107
 
108
108
  <h2 id="api">JavaScript API</h2>
@@ -114,7 +114,7 @@
114
114
  <tr><td><code>Heresay.open({ type, text })</code></td><td>Open the report form from your own button or menu item. <code>type</code> and <code>text</code> are optional and fill it in, for example from an error screen; the person still reviews and sends it.</td></tr>
115
115
  <tr><td><code>Heresay.on("sent", fn)</code></td><td>Calls <code>fn({ id, type })</code> after each report is sent, to thank people or count it in your analytics. Returns a function that stops it.</td></tr>
116
116
  <tr><td><code>Heresay.introduce({ title, body })</code></td><td>Once per device, a small bubble over the button says what it's for, so people know it exists. Call it when your main screen is up (after sign-in or onboarding), or add <code>data-intro="auto"</code> to the tag. Later calls do nothing. <code>title</code> and <code>body</code> are optional, to use your own words.</td></tr>
117
- <tr><td><code>Heresay.nudge()</code></td><td>Your app saw trouble itself, such as an error screen or a retry that failed: a small note by the button offers to report it. Works without <code>data-nudge</code>; the same limits apply. Returns whether it showed.</td></tr>
117
+ <tr><td><code>Heresay.nudge()</code></td><td>Your app saw trouble itself, such as an error screen or a retry that failed: a small note by the button offers to report it. <code>nudge({ stuck: true })</code> for someone who seems unsure. Works without <code>data-nudge</code>; the same limits apply. Returns whether it showed.</td></tr>
118
118
  <tr><td><code>Heresay.openPreferences()</code></td><td>Open the Preferences tab: a note about their setup, sent with every report. People who aren't signed in can also add a name and an email for replies. It's all optional and saved on their device. Where the button sits is yours to choose, with <code>data-position</code>.</td></tr>
119
119
  <tr><td><code>Heresay.close()</code></td><td>Close the panel.</td></tr></table>
120
120
  <p>Each report also carries the page it came from: its title, its address without the query string, and the window size.</p>
@@ -158,9 +158,14 @@ router.afterEach((to) =&gt; Heresay.setScreen(to.name));</code></pre>
158
158
  <h3>Without MCP</h3>
159
159
  <p>The same actions are commands: <code>npx heresay briefs</code>, <code>brief &lt;id&gt;</code>, <code>claim &lt;id&gt;</code>, <code>note</code>, <code>handoff</code>, <code>fixed &lt;id&gt; "note"</code>, and <code>guide &lt;topic&gt;</code>. Agents can also read <a href="/llms.txt">/llms.txt</a> and the guides under <a href="/guides/start.md">/guides/</a>.</p>
160
160
  <h3>Keeping it current</h3>
161
- <p>The skill in your repo is small and rarely changes. The detailed steps come from your own Heresay each time, so they match what you have deployed. When a newer skill ships, the agent is told to run <code>npx heresay connect --update</code>, and the change shows up in git.</p>
161
+ <p>The skill in your repo is small and rarely changes. The detailed steps come from your own Heresay each time, so they match what you have deployed.</p>
162
+ <p>When a chat starts in a connected repo, Heresay checks for updates and the agent brings them up and asks before applying any: a newer Heresay (whoever set it up runs <code>npx create-heresay update</code>; web apps then get the new Report button with no code change), a newer Swift package than the one pinned in <code>Package.resolved</code>, older agent files (<code>npx heresay connect --update</code>), and features your app doesn't use yet. In Claude Code a session-start hook in <code>.claude/settings.json</code> runs the check, at most once a day per repo; other agents are asked to by <code>AGENTS.md</code>. A no is kept in <code>.claude/skills/heresay/decisions.json</code>, so nobody asks again. You can also ask "Update Heresay", or run <code>npx heresay updates</code>.</p>
162
163
  <p>You can still copy a single prompt from any accepted report in the dashboard with <b>Copy prompt for agent</b>.</p>
163
164
 
165
+ <h2 id="chat">ChatGPT and other chat apps</h2>
166
+ <p>Ideas that come up in a conversation can go straight to an app's inbox, with what the conversation worked out. Your Heresay is an MCP server at <code>https://&lt;your-heresay&gt;/v1/mcp</code>. In ChatGPT, open <b>Settings › Apps &amp; Connectors</b>, turn on <b>Developer mode</b> under Advanced settings, choose <b>Create</b>, paste that address and pick OAuth. ChatGPT opens your dashboard to ask if it may send requests as you. Then say <i>“Send this to Heresay as an idea for Greenroom”</i>.</p>
167
+ <p>Requests arrive as from you (<b>From ChatGPT · From the team</b>) and wait for someone to accept them, like any report. The chat app can list your apps, send requests and say what happened to yours; it can't read anyone else's reports, or accept, decline or fix anything. <b>Chat apps</b> in the dashboard shows each connection and disconnects it. Claude, Cursor and other remote MCP clients use the same address.</p>
168
+
164
169
  <h2 id="security">Security and limits</h2>
165
170
  <ul>
166
171
  <li><b>Your key is public, and that's fine.</b> It's in your page's HTML. It only identifies your project; it can't read or change anything.</li>
@@ -5,7 +5,7 @@
5
5
  "id": "nudge",
6
6
  "since": "0.2.21",
7
7
  "title": "Offer help when someone seems stuck",
8
- "summary": "A small note by the Report button asks “Something not working?” when someone presses a button again and again with nothing happening, hits an error right after a click, or sees requests fail (web), clicks a disabled control again and again (macOS), or comes back after a crash (iOS and macOS). It opens the form as Broken, with what happened attached. Watched on the device, never sent; once per visit, and quiet for a week after “Not now”. Off until the app turns it on.",
8
+ "summary": "A small note by the Report button asks “Something not working?” when someone presses a button again and again with nothing happening, hits an error right after a click, or sees requests fail (web), clicks a disabled control again and again (macOS), or comes back after a crash (iOS and macOS). And “Stuck on something?” when someone seems unsure: typing that stopped, going back and forth between the same few pages or screens, a field refused again and again. It opens the form as Broken or Confusing, with what happened attached. Watched on the device, never sent; once per visit, and quiet for a week after “Not now”. Off until the app turns it on.",
9
9
  "platforms": ["web", "ios", "macos"],
10
10
  "detect": ["data-nudge", "nudge:", "nudge()"],
11
11
  "how": { "web": "guide customize-web, Offering help", "ios": "guide customize-apple, Offering help", "macos": "guide customize-apple, Offering help" }
@@ -63,7 +63,8 @@ change. The first value is the default.
63
63
  With each report, Heresay attaches what happened in the app in the last few minutes: screens
64
64
  (named with `Heresay.setScreen` or `.heresayScreen("Settings")`), the app's own `Logger` errors,
65
65
  the last crash, going offline, and on macOS clicks (by their accessibility label) and menu
66
- commands. The reporter sees it in the sheet and can switch it off or leave parts out. Never what
66
+ commands. It is kept on disk as it happens, so after a crash the next report says what happened
67
+ before the app closed and whether it was the first launch after an update. The reporter sees it in the sheet and can switch it off or leave parts out. Never what
67
68
  anyone typed. On by default; change it only when asked.
68
69
 
69
70
  | Option | Values |
@@ -80,7 +81,7 @@ own screen, so add it only when asked.
80
81
 
81
82
  | Option | Values |
82
83
  | --- | --- |
83
- | `configure(…, nudge:)` | `[]` (default, off) · `.all` · `.clicks` (macOS: a disabled control clicked 3 times in 10 s, or one spot clicked 5 times in 2 s; leave it out for games and drawing apps) · `.crash` (the app crashed last time; once, at the next launch) |
84
+ | `configure(…, nudge:)` | `[]` (default, off) · `.all` · `.clicks` (macOS: a disabled control clicked 3 times in 10 s, or one spot clicked 5 times in 2 s; leave it out for games and drawing apps) · `.crash` (the app crashed last time; once, at the next launch) · `.circles` (6 screen changes in a minute among at most 3 screens; needs named screens) · `.stalled` (typed, then 45 s still editing with nothing more: the keyboard still up on iOS; search fields don't count). The last two say "Stuck on something?" and open as Confusing. |
84
85
 
85
86
  Screens make the trail readable: if the app has several screens and doesn't name them yet, add
86
87
  `.heresayScreen("<name>")` to each screen's root view.
@@ -88,7 +89,7 @@ Screens make the trail readable: if the app has several screens and doesn't name
88
89
  **Calls**
89
90
 
90
91
  - `Heresay.present(type:text:)`: opens the sheet, filled in. The person still reviews and sends it.
91
- - `Heresay.nudge()`: the app saw trouble itself (an error screen, a retry that failed): offer to report it. Works without `nudge:`; the same limits apply.
92
+ - `Heresay.nudge()`: the app saw trouble itself (an error screen, a retry that failed): offer to report it. `Heresay.nudge(stuck: true)` for someone who seems unsure. Works without `nudge:`; the same limits apply.
92
93
  - `Heresay.onSent { event in ... }`: after each report is sent, with `event.id` and `event.type`, never the text.
93
94
  - `Heresay.introduce(title:message:)`: the one-time introduction in your own words. Leave the
94
95
  words out unless asked; the default says where to find it.
@@ -80,7 +80,9 @@ a second or more, and leaving the tab and coming back. Each report also carries
80
80
  around the app: phone or desktop, touch or mouse, screen, light or dark, language, time zone,
81
81
  connection, and settings such as reduced motion. The reporter sees all of it in the form and can
82
82
  switch the trail off or leave parts out. Never what anyone typed, request bodies, headers or
83
- query strings. On by default; change it only when asked.
83
+ query strings. It survives a reload or a new page in the same tab (kept in that tab's
84
+ `sessionStorage`), says "The page was reloaded", and, with `data-version`, "First visit since the
85
+ app updated from 1.3 to 1.4". On by default; change it only when asked.
84
86
 
85
87
  | Attribute | Values |
86
88
  | --- | --- |
@@ -96,12 +98,12 @@ asked.
96
98
 
97
99
  | Attribute | Values |
98
100
  | --- | --- |
99
- | `data-nudge` | off (default) · `on` · the signals to watch, e.g. `clicks errors` (from `clicks`: the same button or link pressed 3 times in 10 s with no change to the page; `errors`: an uncaught error within 5 s of a click; `requests`: 2 requests failing with 5xx or no answer within 30 s) |
101
+ | `data-nudge` | off (default) · `on` (all of these) · the signals to watch, e.g. `clicks errors`. When something failed ("Something not working?", opens as Broken): `clicks`: the same button or link pressed 3 times in 10 s with no change to the page; `errors`: an uncaught error within 5 s of a click; `requests`: 2 requests failing with 5xx or no answer within 30 s. When someone seems unsure ("Stuck on something?", opens as Confusing): `stalled`: typed in a field, then 45 s with no more typing and nothing sent, while still moving or scrolling (search boxes don't count); `circles`: 6 page changes in a minute among at most 3 pages; `refused`: the same field refused 3 times in 2 minutes |
100
102
 
101
103
  **Calls**
102
104
 
103
105
  - `window.Heresay?.open({ type, text })`: opens the form, filled in. The person still reviews and sends it.
104
- - `window.Heresay?.nudge()`: the app saw trouble itself (an error screen, a retry that failed): offer to report it. Works without `data-nudge`; the same limits apply.
106
+ - `window.Heresay?.nudge()`: the app saw trouble itself (an error screen, a retry that failed): offer to report it. `nudge({ stuck: true })` for someone who seems unsure. Works without `data-nudge`; the same limits apply.
105
107
  - `window.Heresay?.on('sent', ({ id, type }) => ...)`: after each report is sent, for example to thank them or count it in the app's analytics. It returns a function that stops listening. It never gets the report text.
106
108
 
107
109
  ## Can't be changed
@@ -9,6 +9,6 @@
9
9
  "fix-brief": "Fix an accepted report: find, claim, fix, hand off, mark fixed",
10
10
  "write-note": "Write the note the reporter reads when a report is fixed",
11
11
  "uninstall": "Remove Heresay from an app, and disconnect the repo",
12
- "whats-new": "Heresay features this app doesn't use yet: tell the person, and ask before adding any"
12
+ "whats-new": "Updates for this repo (a newer Heresay, Swift package or agent files, and features this app doesn't use yet): tell the person, and ask before applying any"
13
13
  }
14
14
  }
@@ -22,11 +22,12 @@ sees the outcome in the app, including the note you write when you mark it fixed
22
22
  where nobody looks unprompted. `check_install` lists anything still owed in `todo`; the
23
23
  install isn't done until that list is empty.
24
24
 
25
- ## Before any task: what's new
25
+ ## Before any task: updates
26
26
 
27
- Call `whats_new`. If it lists Heresay features this app doesn't use yet, tell the person what
28
- each does in a sentence and **ask before adding any**. See `whats-new`. Never add one without a
29
- yes; on a no, `skip_update` so nobody asks again.
27
+ Call `whats_new`. If it lists updates (a newer Heresay, Swift package or agent files, or
28
+ features this app doesn't use yet), tell the person what each does in a sentence and **ask
29
+ before applying any**. See `whats-new`. Never apply one without a yes; on a no, `skip_update`
30
+ so nobody asks again.
30
31
 
31
32
  ## Which topic next
32
33
 
@@ -36,7 +37,7 @@ yes; on a no, `skip_update` so nobody asks again.
36
37
  change them only when asked.
37
38
  - Fixing reports: `fix-brief`, then `write-note`.
38
39
  - Removing Heresay from an app: `uninstall`.
39
- - New features for an app that already has Heresay: `whats-new`.
40
+ - Updating Heresay, or new features for an app that already has it: `whats-new`.
40
41
 
41
42
  ## Tools
42
43
 
@@ -1,23 +1,45 @@
1
1
  # What's new in Heresay
2
2
 
3
- Heresay gains features after an app is installed. When you work on anything Heresay in a
4
- connected repo, check whether this app is missing any, and **ask the person before adding them**.
5
-
6
- ## Every Heresay task starts with this
7
-
8
- 1. Call `whats_new` (or run `npx heresay whats-new`). It compares this Heresay's feature list with
9
- this repo's code and returns only the features this app doesn't have and nobody skipped.
10
- 2. If it returns nothing, carry on with the task. Don't mention it.
11
- 3. If it returns updates, tell the person in one short sentence each, in their words, not ours,
12
- for example: "Heresay can now show people a one-time note that the Report button exists
13
- (on the Mac it's otherwise hidden under Help). Want me to add it?" Then ask. One question for
14
- all of them is fine.
15
- 4. **Never add a feature without a yes.** A new feature changes what the app's users see.
16
- - Yes: follow the `how` guide for it, then `check_install` for that app.
17
- - No: call `skip_update` with its id (or `npx heresay whats-new --skip <id>`), so
18
- nobody asks again. It is recorded in `.claude/skills/heresay/decisions.json`; commit that.
19
- - Not now: leave it; it will come up next time.
20
- 5. Then do the task you were asked to do.
3
+ Heresay keeps changing after an app has it: new versions of the Heresay itself and the Swift
4
+ package, and new features. In a connected repo, bring these up with the person and **ask before
5
+ applying any**.
6
+
7
+ ## When to check
8
+
9
+ - **When a chat starts.** In Claude Code, a session-start check (`.claude/settings.json`, added
10
+ by `heresay connect`) does it and tells you what it found. Other agents: call `whats_new`
11
+ (or run `npx -y heresay@latest updates`) once early in the conversation, whatever it is about.
12
+ - **At the start of every Heresay task**, call `whats_new` yourself.
13
+
14
+ ## What to do with it
15
+
16
+ 1. If it returns nothing, carry on. Don't mention it.
17
+ 2. If it returns updates, tell the person in one short sentence each, in their words, not ours,
18
+ for example: "Heresay has a newer Swift package (0.2.22) with more context in reports. Want me
19
+ to update it?" One question for all of them is fine. If they asked about something else,
20
+ help with that first and ask at the end of your reply.
21
+ 3. **Never apply an update without a yes.** It changes what the app's users see.
22
+ - Yes: follow its `how` (below), then `check_install` for that app.
23
+ - No: call `skip_update` with its id (or `npx heresay updates --skip <id>`), so nobody asks
24
+ again. It is recorded in `.claude/skills/heresay/decisions.json`; commit that. A skipped
25
+ version is asked about again when a newer one comes out.
26
+ - Not now: leave it; it comes up again in a later chat.
27
+
28
+ ## The kinds of update
29
+
30
+ - **`instance@x.y.z`: this team's Heresay is behind.** The dashboard, the API and the web Report
31
+ button (web apps load it from the Heresay, so they get it with no code change). Whoever set the
32
+ Heresay up runs `npx create-heresay update`; it signs in to Google with their account. Offer to
33
+ run it only if that's the person you're talking to.
34
+ - **`swift@x.y.z`: the Swift package is behind.** Xcode: File › Packages › Update to Latest
35
+ Package Versions. A Swift package: `swift package update heresay-swift`. From a terminal for an
36
+ Xcode project: delete the `heresay-swift` pin from its `Package.resolved` and run
37
+ `xcodebuild -resolvePackageDependencies`. Build, read the CHANGELOG for anything that needs a
38
+ code change, and commit `Package.resolved`.
39
+ - **`agent-files@N`: this repo's Heresay agent files are old.** Run
40
+ `npx -y heresay@latest connect --update` and commit what it lists, in its own commit.
41
+ - **Anything else is a feature this app doesn't use yet**, from this Heresay's feature list. Its
42
+ `how` names the guide to follow.
21
43
 
22
44
  If the tool isn't there (an older `heresay` package), read `/guides/changes.json` on this Heresay
23
45
  and check the code for each entry's `detect` strings yourself.