heyquilt 0.3.191 → 0.3.193

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/RELEASES.md CHANGED
@@ -11,6 +11,17 @@ Format: `## <version> — <YYYY-MM-DD>`, an optional one-line summary, then bull
11
11
  Lead each bullet with a short bold phrase. Inline `code` and **bold** are rendered;
12
12
  nothing else is.
13
13
 
14
+ ## 0.3.193 — 2026-11-23
15
+
16
+ - **The Connections page, redrawn.** A project's and a codebase's Connections page (and the Connections cards in the pop-ups) show what is connected as the same tiles as a project's Overview: the app's logo, who connected it, where it is from, and who may use it. "Connect an app" opens the apps to pick from in the page, with the search across it. With nothing connected yet, the apps are there to pick from straight away.
17
+ - **See what an app does before you connect it.** In the apps to pick from, click an app's name: its page says what it is and lists what agents could do with it, the things they would do at once (reads) apart from the ones they would ask a person about first (anything that sends, changes or deletes).
18
+ - **Download updates automatically.** A new switch in Settings, under Account, in About Quilt. With it on, a newer Quilt is downloaded as soon as it is out, and the update button becomes "Restart to update": the restart is all that is left. Nothing is installed without you.
19
+
20
+ ## 0.3.192 — 2026-11-23
21
+
22
+ - **A preview's own pages look like Quilt.** What a preview's address shows by itself (open it from Quilt, starting, it did not start, nothing running) was bare text on grey. They now carry Quilt's mark, type and colours, in light and dark, and the starting page shows the mark piecing itself while it waits. The pages that send you back to Quilt have the Open in Quilt button.
23
+ - **The sidebar's button is in the sidebar.** The button that closes the sidebar of a project or a codebase sits at the sidebar's top right, not beside the logo. While the sidebar is closed, the button that opens it is in the header.
24
+
14
25
  ## 0.3.191 — 2026-11-23
15
26
 
16
27
  - **"Open in Quilt" on a preview's address.** A preview's address opened by itself in a browser said to open it from Quilt and left you there. It now has an Open in Quilt button: Quilt comes forward on that preview, on the branch that address shows. The link carries only the address, so it tells nobody which codebase or branch it is.
package/desktop/main.js CHANGED
@@ -15,7 +15,7 @@ import { registerProcess } from '../src/procs.js'
15
15
  import { decodeInvite } from '../src/runner.js'
16
16
  import { quiltHome, adoptLegacyEnv } from '../src/legacy.js'
17
17
  import { downloadUrl } from '../src/releases.js'
18
- import { installUpdate } from './updater.js'
18
+ import { installUpdate, downloadUpdate } from './updater.js'
19
19
  import { registerOnStart } from '../src/integrations.js'
20
20
  import { adoptLoginShellPath } from '../src/shell-path.js'
21
21
  import { getSettings } from '../src/settings.js'
@@ -140,7 +140,8 @@ async function start () {
140
140
  return r.canceled ? null : r.filePaths[0]
141
141
  })
142
142
 
143
- ipcMain.handle('install-update', () => update())
143
+ ipcMain.handle('install-update', (e, version) => update(typeof version === 'string' ? version : ''))
144
+ ipcMain.handle('download-update', (e, version) => downloadAhead(typeof version === 'string' ? version : ''))
144
145
  ipcMain.handle('dev-restart', () => devRestart())
145
146
 
146
147
  // The title bar follows the app's theme (Settings → Appearance), from the saved one at launch, then as the
@@ -165,14 +166,30 @@ const windowIcon = () => path.join(HERE, 'icons', (nativeTheme.shouldUseDarkColo
165
166
 
166
167
  // ---------------------------------------------------------------- update --
167
168
  // "Update Quilt" in the app: download the newest build, install it, restart.
169
+ // With "Download updates automatically" on, the page asks for the newest build ahead of time
170
+ // (downloadAhead): "Restart to update" then installs that file without fetching it again.
168
171
  let updating = null
169
- function update () {
172
+ const ahead = new Map() // a version -> its download ahead of time, while it runs and once it is there
173
+ function downloadAhead (version) {
174
+ if (!app.isPackaged) return Promise.reject(new Error('Updates install into the packaged app only; from source, pull and restart.'))
175
+ if (updating) return Promise.reject(new Error('It is being installed.'))
176
+ if (!ahead.has(version)) {
177
+ ahead.set(version, downloadUpdate(downloadUrl(), { version, tempDir: app.getPath('temp') }).then(() => ({ ok: true }), (err) => {
178
+ ahead.delete(version)
179
+ throw new Error(err.message || 'The download failed.')
180
+ }))
181
+ }
182
+ return ahead.get(version)
183
+ }
184
+ function update (version = '') {
170
185
  if (updating) return updating
171
186
  updating = (async () => {
172
187
  if (!app.isPackaged) throw new Error('Updates install into the packaged app only; from source, pull and restart.')
173
188
  const progress = (p) => { if (win && !win.isDestroyed()) win.webContents.send('update-progress', p) }
174
189
  try {
175
- const next = await installUpdate(downloadUrl(), { tempDir: app.getPath('temp'), onProgress: progress })
190
+ // A download ahead of time that is still running is waited for, not started a second time.
191
+ if (ahead.has(version)) await ahead.get(version).catch(() => {})
192
+ const next = await installUpdate(downloadUrl(), { version, tempDir: app.getPath('temp'), onProgress: progress })
176
193
  quitting = true
177
194
  // An AppImage relaunches from its file, not from the mount it runs in now.
178
195
  if (next === 'relaunch') app.relaunch(process.env.APPIMAGE ? { execPath: process.env.APPIMAGE, args: process.argv.slice(1) } : undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyquilt",
3
- "version": "0.3.191",
3
+ "version": "0.3.193",
4
4
  "description": "Real-time, tool-agnostic pair vibe coding: sync a project folder live between collaborators using any AI coding tool.",
5
5
  "author": {
6
6
  "name": "Daniel Carmichael",
@@ -220,6 +220,15 @@ export function connectionRoutes (ctx) {
220
220
  return { apps: await composio.toolkits({ search: u.searchParams.get('search') || '', limit: Number(u.searchParams.get('limit')) || 60 }) }
221
221
  }],
222
222
 
223
+ // One app, before anyone connects it: what it is, and what agents could do with it (each action
224
+ // says whether it only reads, so the page can tell what would run at once from what would ask first).
225
+ ['GET', /^\/v1\/connections\/apps\/([a-z0-9][a-z0-9_-]{0,79})$/i, async (req, body, [slug]) => {
226
+ await whoCalls(req)
227
+ const [app, tools] = await Promise.all([composio.toolkit(slug.toLowerCase()), composio.tools({ app: slug.toLowerCase(), limit: 100 })])
228
+ const actions = tools.map((t) => ({ name: t.name, description: String(t.description || '').replace(/\s+/g, ' ').trim().slice(0, 240), readOnly: !!t.readOnly }))
229
+ return { app, actions }
230
+ }],
231
+
223
232
  // Composio sends the browser back here once someone signed in (or gave up).
224
233
  ['GET', /^\/v1\/connections\/done$/, async (req, body, params, url) => {
225
234
  const u = url || new URL(req.url, 'http://x')
@@ -0,0 +1,7 @@
1
+ // Poppins (the app's typeface), regular and semibold, for the pages a preview machine shows by
2
+ // itself (proxy.js): they are served from the machine, which has no font files, so the two weights
3
+ // travel in the page. These are @fontsource/poppins's Latin files as base64 (SIL Open Font License);
4
+ // test/unit/preview-pages.test.js checks they are still those files. Made with:
5
+ // node scripts/preview-page-fonts.mjs
6
+ export const POPPINS_400 = 'd09GMgABAAAAAB7MAAwAAAAAP6AAAB54AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGx4cLgZgAIFUCudM0jYLgzYAATYCJAOGaAQgBYNcB4QLG34ysyLYOAAgoXcUUbVZLPs/JHBDBr6G+hIpYlQoaayFQFiGbR8DjCviFJxE41HqT/OOXC0/Z9GQVQfAWhGOAF/O89SlbJ4fIclsS0SNUfbMPgE5dhgAVqioPNrYqNhUZCQIRaCBLIK83W+vy6VjrXTMAYfFIfS65yPR0ziMQaj0M56vY3h+bj1EaSMJC9jIVbCMv+2vgv0FSxg1alhIGl2gBxecx4xqvCi9NvP2XXsT27xJRGharfanif3dB1IbH7D/n1vvG1gi90J+0acoU3UyzKzznZ8Q8S/KSQdFE/HKrFSrbCW+EZMGJ/JOrWFOCzJcLDcqMIye7xUDVgJSUf//a37amcAiFDGyIExnC3pkybH+6s19gXl5eXMmRB9Ln2eT0vLklZIpALkqpMkyJiUkt25tgVyFkF8WZYV0VRkTScF3O1cffLfDNqsTWFV2rwUPIfjECpG7lz5AAVbIGyfmmutgE0hgB8wJNaQ30lgYP+3xQCMZjDoEDzyVUi580bg7SwwCfbU2wM1JQR5DDgSJxZ7llnqObrxHpgXHgAOb7RkL2/gXhVu/D4DXAHqoBwD7DAQKDGCTWIoEB7JEnap7PP3Aas/+DynGHuqZ3u8P+0ZRlopUoQZt6CZzX2tbJVpJTFb5OJJs6W/YeiSlKS9d/6ya+d/8fZ6YS2ftgn326bdP//3yrm98rcc+6yxV+PO3P/P9e2I8D/za2srbgL+A1V8AG18HMDYA+dea0d4dnI0DUjAxhECe4VuLDc7VmwqwYTiuFzfuViWi6aNC0Z4wRhGs1DQggom7F3EXA3Uj7W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ikgmgb7J1Ykb759+DDXhXogpLQ3lmVpPFusFYYsLv0XkPG7AJrdqGQ2sEGewcm3jdfDD5uuxQXlIbCAdJ6xNQ2wIDdhZtxBEa+4MGXJCmJkhaWtf4VlC3Iv0I9XqeuhZMP53kuNHcy3FlqloRlhakXYZMNZ8smlg86ksUNhfWlEg+L14AP4IRR6zQK4MPXRgGAhwCDL2A1Mz8+CwQAr/u4OsQH1LFDfIWaPcQPm6F8zelD/K2lOyQAFDUUessBp1ob34ff5MrKFJirarDtQo3Zn+EK1UrO2WBpFatFCo1zPGCTzfFThcuvrrPxnLUmcgYeT5YWiNRMKEODUPxoZcpV0vPSg2dpqjU2sFL+A21RnVq06oMS8e9paMHOuVoB/BBqkJC9TquI09wmUqu2+JRzGj5NFttjuqnylqty1lXwVdrshNFhamhBqW6y7Yrm6+V05zuIzn8CSH38gN9fAf1vIAjEWsHWCREqTLgIkaJEixErTrz1EiRKssFGyaBSwMClQkBCSYOGkQ4LJ0MmPAIiEjIKKho6hixM2VjYcnBw8fAJCImISUjJyCkoqahp5MqTr4CWTqEixUqUKlOugp6BMWvAXj16XTbtF32Gbfeaw/bFH2xzU7cJjz0xlAAw4B13PTLriGee+suc4z7wvhMqVRll8pFqyz70mY994lO/MvvK575wksWfxlz1tW9YPfCbQXY2NerUctjNqd4mNxKXfhbcmt23mUeLVlu0+Z89tmrXodNDv1twzSmnEwiuu+OGM8664KJ3nXPee/oddcUbLiUIeP0RyBrVzQqFL/+GwKaHbXg8F994BVvzKDqRx1/zv4vxmk4kEigAAAA='
@@ -12,24 +12,84 @@ import http from 'node:http'
12
12
  import net from 'node:net'
13
13
  import crypto from 'node:crypto'
14
14
  import { parsePreviewHost, previewDomain, previewHost, previewAppLink } from './address.js'
15
+ import { quiltMark } from '../ui/mark.js'
16
+ import { POPPINS_400, POPPINS_600 } from './page-fonts.js'
15
17
  import { verifyPreviewTicket, mintCookie, readCookie, cookieFrom, withoutCookie, setCookieHeader, TICKET_PARAM } from './ticket.js'
16
18
 
19
+ // Says which of the machine's own pages an answer is, so the starting page knows when to load the app.
20
+ const STATE_HEADER = 'x-quilt-preview'
17
21
  const esc = (s) => String(s).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[c])
18
- const page = (title, body, extra = '') => `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${extra}<title>${esc(title)}</title><style>body{font:15px/1.5 system-ui,sans-serif;margin:0;min-height:100vh;display:grid;place-items:center;background:#f3f3f6;color:#1d1b2e}main{max-width:34em;padding:24px}h1{font-size:19px;margin:0 0 6px}p{margin:0 0 10px;color:#55536a}.btn{display:inline-block;margin-top:6px;padding:8px 14px;border-radius:6px;background:#1d1b2e;color:#fff;font-weight:600;text-decoration:none}.btn:hover{background:#34314d}pre{font:12px/1.5 ui-monospace,Menlo,monospace;background:#fff;border:1px solid #dfdfe6;border-radius:6px;padding:12px;overflow:auto;max-height:50vh;white-space:pre-wrap}</style></head><body><main><h1>${esc(title)}</h1>${body}</main></body></html>`
22
+
23
+ // The machine's own pages (no ticket, starting, did not start, nothing running), in Quilt's
24
+ // colours and type (src/ui/app.css) and with its mark (brand/SPEC.md): linen or ink ground by the
25
+ // reader's own light or dark setting, one card, the mark as the only vermilion. Everything is in
26
+ // the page: the machine has no files to serve beside the app it previews.
27
+ const STYLE = `@font-face{font-family:Poppins;font-weight:400;font-display:swap;src:url(data:font/woff2;base64,${POPPINS_400}) format("woff2")}
28
+ @font-face{font-family:Poppins;font-weight:600;font-display:swap;src:url(data:font/woff2;base64,${POPPINS_600}) format("woff2")}
29
+ :root{color-scheme:light dark;--bg:#f7f3ec;--panel:#fff;--fill:#efeff3;--text:#1d1b2e;--muted:#55546a;--faint:#696879;--border:#dfdfe6;--btn:#1d1b2e;--on-btn:#f7f3ec;--btn-hover:#34314d;--mark-ink:#1d1b2e;--lift:0 1px 2px rgba(29,27,46,.08),0 10px 30px rgba(29,27,46,.07)}
30
+ @media (prefers-color-scheme:dark){:root{--bg:#17161f;--panel:#211f2c;--fill:#2b2938;--text:#f1ede6;--muted:#aaa6b6;--faint:#9692a5;--border:#33303f;--btn:#f1ede6;--on-btn:#1d1b2e;--btn-hover:#fff;--mark-ink:#f7f3ec;--lift:4px 4px 0 #33303f}}
31
+ *{box-sizing:border-box}
32
+ body{margin:0;min-height:100vh;display:grid;place-items:center;padding:32px 20px;background:var(--bg);color:var(--text);font:15px/1.55 Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}
33
+ main{width:100%;max-width:31rem}
34
+ .brand{display:inline-block;margin:0 0 26px 2px;line-height:0}
35
+ .brand svg{height:30px;width:auto}
36
+ .card{padding:30px 32px 28px;border:1px solid var(--border);border-radius:12px;background:var(--panel);box-shadow:var(--lift)}
37
+ .wait{display:block;width:44px;height:44px;margin:0 0 18px}
38
+ h1{margin:0 0 8px;font-size:23px;line-height:1.25;font-weight:600;letter-spacing:-.01em}
39
+ p{margin:0 0 12px;color:var(--muted)}
40
+ .row{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;margin:20px 0 0}
41
+ .btn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 16px;border-radius:8px;background:var(--btn);color:var(--on-btn);font-weight:600;font-size:14.5px;text-decoration:none}
42
+ .btn:hover{background:var(--btn-hover)}
43
+ .btn:focus-visible,.row a:focus-visible,.brand:focus-visible{outline:2px solid #c8361a;outline-offset:2px}
44
+ .btn svg{width:16px;height:16px}
45
+ .row .more{font-size:13.5px;color:var(--muted)}
46
+ .row .more a{color:var(--text);text-underline-offset:3px}
47
+ pre{margin:14px 0 0;padding:12px 14px;max-height:46vh;overflow:auto;border:1px solid var(--border);border-radius:8px;background:var(--fill);color:var(--text);font:12.5px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
48
+ .at{margin:22px 0 0;padding:14px 0 0;border-top:1px solid var(--border);color:var(--faint);font:12px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;overflow-wrap:anywhere}
49
+ .qm-i{fill:var(--mark-ink)}.qm-a{fill:#ff4f2b}.qm-w{stroke:var(--mark-ink)}.qm-p{transform-box:fill-box;transform-origin:center}
50
+ .qm-sew .qm-p{opacity:0;transform:scale(.35) rotate(-10deg);animation:qm-sew .42s cubic-bezier(.2,.9,.3,1.25) forwards;animation-delay:calc(var(--o)*60ms + 80ms)}
51
+ .qm-sew .qm-c{animation-delay:560ms}
52
+ .qm-sew .qm-wm{opacity:0;animation:qm-fade .35s ease-out .6s forwards}
53
+ @keyframes qm-sew{to{opacity:1;transform:none}}
54
+ @keyframes qm-fade{to{opacity:1}}
55
+ .qm-loop .qm-p{opacity:0;animation:qm-loop 2.8s ease-in-out infinite;animation-delay:calc(var(--o)*100ms)}
56
+ .qm-loop .qm-c{animation-delay:780ms}
57
+ @keyframes qm-loop{0%{opacity:0;transform:scale(.3)}14%,80%{opacity:1;transform:none}94%,100%{opacity:0;transform:scale(.3)}}
58
+ @media (prefers-reduced-motion:reduce){.qm-sew .qm-p,.qm-sew .qm-wm,.qm-loop .qm-p{animation:none;opacity:1;transform:none}}
59
+ @media (max-width:480px){.card{padding:24px 20px 22px}h1{font-size:21px}}`
60
+
61
+ const ARROW = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>'
62
+ /** The button back into the Quilt app, for the preview at `host`. */
63
+ const openButton = (host) => `<a class="btn" href="${esc(previewAppLink(host))}">Open in Quilt${ARROW}</a>`
64
+ /**
65
+ * One of the machine's pages. `body`: what follows the title, as HTML; `host`: the preview's own
66
+ * address, shown under it; `sew`: the mark pieces itself together once; `wait`: the mark keeps
67
+ * piecing itself, as every wait in Quilt does; `head`: more for the page's head.
68
+ */
69
+ const page = (title, body, { host = '', sew = false, wait = false, head = '' } = {}) => `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${head}<title>${esc(title)}</title><style>${STYLE}</style></head><body><main><a class="brand" href="https://heyquilt.com" aria-label="Quilt">${quiltMark({ sew })}</a><div class="card">${wait ? quiltMark({ word: false, loop: true, cls: 'wait' }) : ''}<h1>${esc(title)}</h1>${body}${host ? `<p class="at">${esc(host)}</p>` : ''}</div></main></body></html>`
19
70
 
20
71
  /**
21
72
  * What someone with no ticket gets: a preview's address opened by itself, in a browser. `host`:
22
73
  * the preview's own (this machine, that slot); the button opens it in the Quilt app, where a
23
74
  * member of the codebase is given a ticket.
24
75
  */
25
- export const notAllowedPage = (host) => page('Open this preview from Quilt', `<p>A preview is for the people in its codebase. Open it from the codebase in Quilt, or ask someone in it for an invite.</p><p><a class="btn" href="${esc(previewAppLink(host))}">Open in Quilt</a></p>`)
76
+ export const notAllowedPage = (host) => page('Open this preview from Quilt', `<p>A preview is for the people in its codebase. Open it from the codebase in Quilt, or ask someone in it for an invite.</p><div class="row">${openButton(host)}<span class="more">New to Quilt? <a href="https://heyquilt.com">heyquilt.com</a></span></div>`, { host, sew: true })
26
77
 
27
- /** What a slot with no running app answers: it is starting, it failed (with the last of what it printed), or nothing is there. */
28
- export function waitingPage (app) {
29
- if (app && app.state === 'starting') return page('Starting…', `<p>${esc(app.name || 'The app')} is starting${app.branch ? ` from ${esc(app.branch)}` : ''}. This page loads it when it is up.</p>`, '<meta http-equiv="refresh" content="2">')
30
- if (app && app.state === 'failed') return page('It did not start', `<p>${esc(app.name || 'The app')} stopped before it was up${app.branch ? ` (${esc(app.branch)})` : ''}. The last of what it printed:</p><pre>${esc(app.output || 'Nothing was printed.')}</pre>`)
31
- return page('Nothing is running here', '<p>Nobody has this branch of the preview open. Open it from the codebase in Quilt to start it.</p>')
78
+ // While it starts the page asks again every two seconds and loads the app when the answer is no
79
+ // longer "starting" (the header below says which page an answer is); without scripts, it reloads.
80
+ const STARTING_HEAD = `<noscript><meta http-equiv="refresh" content="2"></noscript><script>setInterval(async function(){try{var r=await fetch(location.href,{cache:"no-store",credentials:"same-origin"});if(r.headers.get("${STATE_HEADER}")!=="starting")location.reload()}catch(e){}},2000)</script>`
81
+
82
+ /**
83
+ * What a slot with no running app answers: it is starting, it failed (with the last of what it
84
+ * printed), or nothing is there. `host`: the preview's own address, for the button back to Quilt.
85
+ */
86
+ export function waitingPage (app, host = '') {
87
+ if (app && app.state === 'starting') return page('Starting…', `<p>${esc(app.name || 'The app')} is starting${app.branch ? ` from ${esc(app.branch)}` : ''}. This page loads it when it is up.</p>`, { host, wait: true, head: STARTING_HEAD })
88
+ if (app && app.state === 'failed') return page('It did not start', `<p>${esc(app.name || 'The app')} stopped before it was up${app.branch ? ` (${esc(app.branch)})` : ''}. The last of what it printed:</p><pre>${esc(app.output || 'Nothing was printed.')}</pre>${host ? `<div class="row">${openButton(host)}<span class="more">to change it or try again</span></div>` : ''}`, { host })
89
+ return page('Nothing is running here', `<p>Nobody has this branch of the preview open. Open it from the codebase in Quilt to start it.</p>${host ? `<div class="row">${openButton(host)}</div>` : ''}`, { host })
32
90
  }
91
+ /** Which of those pages an answer is (the starting page watches it): 'starting', 'failed' or 'idle'. */
92
+ const waitingState = (app) => (app && (app.state === 'starting' || app.state === 'failed') ? app.state : 'idle')
33
93
 
34
94
  /** The address without the ticket: what the app being previewed is asked for, and where a ticket's redirect goes. */
35
95
  export function withoutTicket (url) {
@@ -127,7 +187,7 @@ export async function startPreviewProxy ({ port = 8080, host = '0.0.0.0', machin
127
187
  if (member.fresh) { res.writeHead(302, { location: withoutTicket(req.url), 'set-cookie': setCookieHeader(mintCookie({ sub: member.sub, now: now() }, secret)), 'cache-control': 'no-store' }); return res.end() }
128
188
  lastRequestAt = now()
129
189
  const app = slots.get(at.slot)
130
- if (!app || app.state !== 'running' || !app.port) return send(res, 503, waitingPage(app), { 'retry-after': '2' })
190
+ if (!app || app.state !== 'running' || !app.port) return send(res, 503, waitingPage(app, previewHost(me, at.slot, dom)), { 'retry-after': '2', [STATE_HEADER]: waitingState(app) })
131
191
  const outside = `https://${previewHost(me, at.slot, dom)}`
132
192
  const headers = inHeaders(req.headers, { port: app.port, outside })
133
193
  delete headers.connection
package/src/ui/app.css CHANGED
@@ -1612,7 +1612,12 @@ body.has-asks .prail { margin-top: calc(var(--update-bar, 0px) + var(--asks-bar)
1612
1612
  .pj-crumb > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1613
1613
  .pj-crumb:hover { background: var(--panel-2); }
1614
1614
  #pj-side-btn { flex: none; margin-left: 6px; }
1615
- #pj-side-btn[aria-pressed="true"] { color: var(--text); }
1615
+ /* The sidebar's button is in the sidebar, top right, beside its first row. Only while the sidebar
1616
+ is closed is there one in the header, to open it again. */
1617
+ :is(.pj-home, .ws.pj-cb):not([data-side="shut"]) #pj-side-btn { display: none; }
1618
+ .pj-side-hide { position: absolute; top: 13px; right: 9px; z-index: 1; color: var(--muted); }
1619
+ .pj-side-hide:hover { color: var(--text); }
1620
+ .pj-side > nav.side-nav > button:first-child { margin-right: 34px; }
1616
1621
  .pj-home .ws-top .spacer { flex: 1; }
1617
1622
  .pj-home .ws-top .brand .qm-word { transform: translateY(11%); }
1618
1623
  .pj-home .page { flex: 1; min-height: 0; padding: 16px 24px 32px; overflow-y: auto; }
@@ -1712,7 +1717,7 @@ body.has-asks .prail { margin-top: calc(var(--update-bar, 0px) + var(--asks-bar)
1712
1717
  .pj-home[data-side="shut"] .page.pj-proj { grid-template-columns: 0px minmax(0, 1fr); }
1713
1718
  :is(.pj-home, .ws.pj-cb)[data-side="shut"] .pj-side { transform: translateX(-100%); visibility: hidden; transition: transform var(--side-slide), visibility 0s .22s; }
1714
1719
  @media (prefers-reduced-motion: reduce) { .pj-home, .ws.pj-cb { --side-slide: 0s; } :is(.pj-home, .ws.pj-cb)[data-side="shut"] .pj-side { transition: none; } }
1715
- .pj-side { width: 244px; transition: transform var(--side-slide), visibility 0s; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; padding: 14px 10px 10px; background: var(--panel); border-right: 1px solid var(--border); }
1720
+ .pj-side { position: relative; width: 244px; transition: transform var(--side-slide), visibility 0s; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; padding: 14px 10px 10px; background: var(--panel); border-right: 1px solid var(--border); }
1716
1721
  .pj-side .side-nav, .pj-side .side-sessions { display: flex; flex-direction: column; gap: 1px; }
1717
1722
  .pj-side .side-nav button, .pj-side .side-sessions button { height: 28px; }
1718
1723
  .pj-side .side-nav svg { flex: none; color: var(--muted); }
@@ -3104,28 +3109,68 @@ label.radio:has(input:disabled) { cursor: default; opacity: .75; }
3104
3109
  .ss-secrets { padding: 4px 0; }
3105
3110
  /* App connections (connections.js): cards that fill their container, and the approval card in the chat */
3106
3111
  .ss-connections { padding: 4px 0; }
3112
+ /* Connections (connections.js): what is connected as the Overview's tiles, each with who may use it;
3113
+ "Connect an app" opens the apps to pick from in the page. */
3107
3114
  .cn { display: flex; flex-direction: column; gap: 18px; }
3108
- .cn .lead { margin: 0; }
3115
+ .cn > .files-head { margin-bottom: 0; }
3109
3116
  .cn-sec { display: flex; flex-direction: column; gap: 10px; }
3110
- .cn-sec h4 { margin: 0; font-size: 13px; font-weight: 600; } .cn-sec h4 i { font-style: normal; color: var(--muted); font-weight: 500; margin-left: 4px; }
3111
- .cn-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .cn-head h4 { flex: 1; }
3112
- .cn-search { display: flex; align-items: center; gap: 6px; flex: 1 1 240px; } .cn-search svg { width: 14px; height: 14px; color: var(--muted); flex: none; } .cn-search .input { flex: 1; min-width: 0; }
3113
- .cn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
3114
- .cn-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
3115
- .cn-card.off { background: var(--panel); }
3116
- .cn-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
3117
- .cn-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; } .cn-what b { font-size: 14px; } .cn-what small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3118
- .cn-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; flex: none; background: #fff; }
3119
- .cn-logo.none { display: grid; place-items: center; background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 13px; }
3117
+ .cn-sec h3, .cn-add h3 { margin: 0; font-size: 14px; font-weight: 600; }
3118
+ .cn-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 10px; align-items: start; }
3119
+ .cn-tiles > .pj-slot { align-self: stretch; }
3120
+ .cn-tile { grid-template-rows: auto 12px auto auto; min-height: 0; }
3121
+ .cn-tile.off { background: none; box-shadow: 0 0 0 1px var(--border); }
3122
+ .cn-tile.off .pj-face { opacity: .55; }
3123
+ .cn-corner { grid-area: 1 / 2; align-self: start; justify-self: end; display: flex; align-items: center; min-height: 26px; }
3124
+ .cn-remove { width: 26px; height: 26px; margin: -3px -5px 0 0; color: var(--faint); opacity: 0; transition: opacity .12s; }
3125
+ .cn-tile:hover .cn-remove, .cn-tile:focus-within .cn-remove { opacity: 1; }
3126
+ .cn-remove:hover { color: var(--bad); }
3127
+ @media (hover: none) { .cn-remove { opacity: 1; } }
3120
3128
  .cn-state { font-size: 11.5px; font-weight: 600; color: var(--warn); white-space: nowrap; } .cn-state.failed { color: var(--bad); }
3121
- .cn-foot { display: flex; align-items: center; gap: 8px; } .cn-foot .spacer { flex: 1; }
3122
- .cn-confirm { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
3123
- .cn-agents { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 10px; border-top: 1px solid var(--border); }
3124
- .cn-agent { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
3125
- .cn-agents .hint { flex-basis: 100%; }
3126
- .cn-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
3127
- .cn-app { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); min-width: 0; }
3128
- .cn-app b { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3129
+ .cn-who, .cn-confirm, .cn-agents { grid-column: 1 / 3; margin-top: 12px; min-width: 0; }
3130
+ .cn-who, .cn-confirm { grid-row: 6; } .cn-agents { grid-row: 7; }
3131
+ .cn-who .input, .cn-who .dd-btn { width: 100%; }
3132
+ .cn-who .dd-btn { padding: 0 10px; font-size: 13px; }
3133
+ .cn-who .btn { width: 100%; justify-content: center; }
3134
+ .cn-confirm { display: flex; align-items: center; gap: 6px; font-size: 12.5px; } .cn-confirm span { flex: 1; min-width: 0; font-weight: 600; }
3135
+ .cn-agents { display: flex; flex-direction: column; gap: 7px; padding-top: 12px; border-top: 1px solid var(--border); }
3136
+ .cn-agent { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; cursor: pointer; } .cn-agent span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3137
+ /* the apps to pick from */
3138
+ .cn-add { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px light-dark(rgba(29, 27, 46, .08), var(--border)); }
3139
+ .cn-add.enter { animation: cn-in .2s cubic-bezier(.3, .7, .2, 1); }
3140
+ @keyframes cn-in { from { opacity: 0; transform: translateY(-6px); } }
3141
+ @media (prefers-reduced-motion: reduce) { .cn-add.enter { animation: none; } }
3142
+ .cn-add-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; } .cn-add-head .spacer { flex: 1; } .cn-add-head .btn { align-self: center; margin: -4px -4px -4px 0; }
3143
+ .cn-add-head .hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3144
+ .cn-search { position: relative; display: block; }
3145
+ .cn-search svg { position: absolute; left: 12px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; color: var(--muted); pointer-events: none; }
3146
+ .cn-search .input { width: 100%; height: 38px; padding-left: 36px; }
3147
+ .cn-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
3148
+ .cn-app { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 4px 6px 4px 4px; border-radius: 10px; background: var(--panel-2); transition: background .12s; }
3149
+ .cn-app:hover { background: color-mix(in srgb, var(--text) 9%, var(--panel)); }
3150
+ .cn-app-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 5px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
3151
+ .cn-app-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
3152
+ .cn-app .pj-face.md { width: 32px; height: 32px; border-radius: 9px; }
3153
+ .cn-app b { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3154
+ .cn-go { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); }
3155
+ .cn-go:hover:not(:disabled) { color: var(--accent); background: none; }
3156
+ /* one app, opened: what it is, and what agents could do with it */
3157
+ .cn-back { margin: -4px 0 -4px -6px; color: var(--muted); } .cn-back svg { width: 14px; height: 14px; }
3158
+ .cn-app-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
3159
+ .cn-app-top .pj-face.md { width: 48px; height: 48px; border-radius: 13px; }
3160
+ .cn-app-top .t { flex: 1; min-width: 0; } .cn-app-top h3 { font-size: 17px; } .cn-app-top .hint { margin: 2px 0 0; }
3161
+ .cn-acts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
3162
+ .cn-acts { min-width: 0; padding: 14px; border-radius: 10px; background: var(--panel-2); }
3163
+ .cn-acts h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; }
3164
+ .cn-acts h4 i { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--panel); border-radius: 999px; padding: 0 7px; line-height: 18px; }
3165
+ .cn-acts > .hint { margin: 2px 0 0; }
3166
+ .cn-acts ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
3167
+ .cn-acts li { display: flex; flex-direction: column; min-width: 0; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; }
3168
+ .cn-acts li b { font-weight: 600; } .cn-acts li span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3169
+ .cn-acts .cn-none { margin-top: 10px; }
3170
+ @media (max-width: 760px) { .cn-acts-grid { grid-template-columns: minmax(0, 1fr); } .cn-app-top { flex-wrap: wrap; } }
3171
+ .cn-more { align-self: flex-start; }
3172
+ .cn-note { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 0; }
3173
+ .cn-note svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
3129
3174
  .cn-calls { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); }
3130
3175
  .cn-call { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12.5px; min-width: 0; } .cn-call + .cn-call { border-top: 1px solid var(--border); }
3131
3176
  .cn-call code { font: 12px var(--mono); } .cn-call .hint { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@@ -1,7 +1,9 @@
1
- // The Connections card in the app (Session settings → Connections, and the header's Connections
2
- // button): apps people connect for a session, workspace or team through Composio, which keeps the
1
+ // Connections in the app (a project's and a codebase's Connections page, and the pop-ups' Connections
2
+ // cards): apps people connect for a session, workspace or team through Composio, which keeps the
3
3
  // sign-ins (plans/app-connections.md). Agents use them with quilt_apps / quilt_app_tools /
4
4
  // quilt_app_call. Also the approval card an app action waiting for a person draws in the chat.
5
+ // What is connected shows as the same tiles as on a project's Overview (projects.js), each with who
6
+ // may use it; "Connect an app" opens the apps to pick from, in the page.
5
7
  // A person's own connections ({ type: 'account', id: 'me' }) are for every project of theirs. A
6
8
  // connection is for people and agents, for people only, or for the agents chosen for it.
7
9
  import { api, esc, toast, ago, I } from './common.js'
@@ -9,9 +11,13 @@ import { api, esc, toast, ago, I } from './common.js'
9
11
  const SEARCH_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>'
10
12
 
11
13
  const views = new Map() // `${type}:${id}` -> the last view, so a redraw shows it at once
14
+ const appInfo = new Map() // an app's slug -> { app, actions } once asked, or { error }: what it is and what agents can do with it
15
+ const ACTS_SHOWN = 8
16
+ const BACK_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>'
12
17
  const urlOf = (type, id, rest = '') => `/api/connections/${type}/${encodeURIComponent(id)}${rest}`
13
- const LEVEL = { session: 'this codebase', workspace: 'the project', org: 'the team', account: 'every project of yours' }
14
- const FROM = { ...LEVEL, account: 'every project' }
18
+ // Where a connection is from, on its tile: the ones made here, and the ones this place gets from above.
19
+ const HERE = { session: 'This codebase', workspace: 'This project', org: 'This team', account: 'Every project' }
20
+ const ABOVE = { workspace: 'This project', org: 'Team', account: 'Every project' }
15
21
 
16
22
  // Your agents, asked once: who a connection can be for. A page that knows more (a project's agents) hands them in.
17
23
  let mine = null
@@ -27,17 +33,20 @@ export function whoWords (c, names = new Map()) {
27
33
  const STATUS = { active: 'Connected', pending: 'Waiting for sign-in', failed: 'Didn\'t connect' }
28
34
  const SHOWN = 12
29
35
 
30
- const logoHtml = (a) => a.logo
31
- ? `<img class="cn-logo" src="${esc(a.logo)}" alt="" loading="lazy" referrerpolicy="no-referrer">`
32
- : `<span class="cn-logo none">${esc(String(a.name || a.app || a.slug || '?').slice(0, 1).toUpperCase())}</span>`
36
+ // An app's face: its logo on a white tile, as on a project's Overview; its first letter without one.
37
+ const logoHtml = (a) => `<span class="pj-face md sq">${a.logo
38
+ ? `<img src="${esc(a.logo)}" alt="" loading="lazy" referrerpolicy="no-referrer">`
39
+ : `<i class="show">${esc(String(a.name || a.app || a.slug || '?').slice(0, 1).toUpperCase())}</i>`}</span>`
33
40
 
34
41
  /**
35
42
  * Draws the card into `root` for one scope ({ type, id }: a session's room, a workspace's id, a
36
43
  * team's slug, or 'account' with 'me'). `agents()`: more agents a connection here can be for
37
- * ([{ id, name }]: a project's), besides your own. Answers { refresh, destroy }.
44
+ * ([{ id, name }]: a project's), besides your own. `page`: { title, hint } when it is a page of its
45
+ * own, which then gets its heading with "Connect an app" in it. Answers { refresh, destroy }.
38
46
  */
39
- export function mountConnections (root, { type, id, agents = () => [] }) {
40
- const ui = { search: '', apps: null, appsFor: null, more: false, busy: '', error: '', calls: null, confirm: null, choosing: null, yours: [] }
47
+ export function mountConnections (root, { type, id, agents = () => [], page = null }) {
48
+ // `adding`: the apps to pick from are open (null: not chosen yet, so open when nothing is connected).
49
+ const ui = { search: '', apps: null, appsFor: null, more: false, busy: '', error: '', calls: null, confirm: null, choosing: null, yours: [], adding: null, entering: false, app: null, allActs: false }
41
50
  /** The agents a connection here can be for, once each. */
42
51
  const choices = () => { const seen = new Map(); for (const a of [...agents(), ...ui.yours]) if (a && a.id && !seen.has(a.id)) seen.set(a.id, a.name || 'an agent'); return seen }
43
52
  let view = views.get(`${type}:${id}`) || null
@@ -46,61 +55,109 @@ export function mountConnections (root, { type, id, agents = () => [] }) {
46
55
  let searchTimer = null
47
56
 
48
57
  function connectedHtml (c, own) {
49
- const status = c.status === 'active' ? '' : `<span class="cn-state ${esc(c.status)}">${esc(STATUS[c.status] || c.status)}</span>`
50
58
  const names = choices()
59
+ const mayChange = own && c.mayChange
60
+ const active = c.status === 'active'
51
61
  // Chosen agents: the ones it is for are ticked; a tick saves at once, and at least one stays ticked.
52
- const picking = own && c.mayChange && c.status === 'active' && (c.who === 'agents' || ui.choosing === c.id)
62
+ const picking = mayChange && active && (c.who === 'agents' || ui.choosing === c.id)
53
63
  const value = picking ? 'agents' : c.who
54
- const who = own && c.mayChange && c.status === 'active'
55
- ? `<select class="input sm" data-who="${esc(c.id)}" aria-label="Who may use ${esc(c.name)}"><option value="all"${value === 'all' ? ' selected' : ''}>People and agents</option><option value="agents"${value === 'agents' ? ' selected' : ''}>People and chosen agents</option><option value="people"${value === 'people' ? ' selected' : ''}>People only</option></select>`
56
- : `<span class="hint">${esc(whoWords(c, names))}</span>`
57
64
  const chosen = new Set(c.who === 'agents' ? c.agents || [] : [])
58
65
  for (const a of chosen) if (!names.has(a)) names.set(a, 'an agent')
59
- const pick = !picking ? '' : `<div class="cn-agents" role="group" aria-label="The agents that may use ${esc(c.name)}">${names.size
66
+ // Top right: how it stands while it is not connected, else the way to remove it.
67
+ const corner = !active
68
+ ? `<span class="cn-state ${esc(c.status)}">${esc(STATUS[c.status] || c.status)}</span>`
69
+ : mayChange && ui.confirm !== c.id ? `<button class="btn sm ghost icon cn-remove" data-ask-remove="${esc(c.id)}" title="Remove ${esc(c.name)}" aria-label="Remove ${esc(c.name)}">${I.trash}</button>` : ''
70
+ const where = own ? HERE[type] || '' : c.level === 'org' ? c.levelName || ABOVE.org : ABOVE[c.level] || c.levelName || ''
71
+ const pills = `${where ? `<span class="pill pj-scope${own ? ' own' : ''}"${!own && c.levelName ? ` title="Connected for ${esc(c.levelName)}"` : ''}>${esc(where)}</span>` : ''}${mayChange && active ? '' : `<span class="pill pj-scope" title="Who may use it">${esc(whoWords(c, names))}</span>`}`
72
+ const who = !(mayChange && active) ? '' : ui.confirm === c.id
73
+ ? `<div class="cn-confirm"><span>Remove it?</span><button class="btn sm danger" data-remove="${esc(c.id)}">Remove</button><button class="btn sm ghost" data-cancel>Keep</button></div>`
74
+ : `<div class="cn-who"><select class="input sm" data-who="${esc(c.id)}" aria-label="Who may use ${esc(c.name)}"><option value="all"${value === 'all' ? ' selected' : ''}>People and agents</option><option value="agents"${value === 'agents' ? ' selected' : ''}>People and chosen agents</option><option value="people"${value === 'people' ? ' selected' : ''}>People only</option></select></div>`
75
+ const pick = !picking || ui.confirm === c.id ? '' : `<div class="cn-agents" role="group" aria-label="The agents that may use ${esc(c.name)}">${names.size
60
76
  ? [...names].map(([aid, name]) => `<label class="cn-agent"><input type="checkbox" data-agent-of="${esc(c.id)}" value="${esc(aid)}"${chosen.has(aid) ? ' checked' : ''}><span>${esc(name)}</span></label>`).join('')
61
77
  : '<span class="hint">You have no agents yet.</span>'}${chosen.size ? '' : '<span class="hint">Tick the agents that may use it. Until then it stays as it was.</span>'}</div>`
62
- const remove = own && c.mayChange
78
+ // A connection that waits for its sign-in or did not connect can still be removed.
79
+ const stuck = mayChange && !active
63
80
  ? (ui.confirm === c.id
64
- ? `<span class="cn-confirm">Remove ${esc(c.name)}? <button class="btn sm danger" data-remove="${esc(c.id)}">Remove</button><button class="btn sm ghost" data-cancel>Keep</button></span>`
65
- : `<button class="btn sm ghost icon" data-ask-remove="${esc(c.id)}" title="Remove ${esc(c.name)}" aria-label="Remove ${esc(c.name)}">${I.trash}</button>`)
81
+ ? `<div class="cn-confirm"><span>Remove it?</span><button class="btn sm danger" data-remove="${esc(c.id)}">Remove</button><button class="btn sm ghost" data-cancel>Keep</button></div>`
82
+ : `<div class="cn-who"><button class="btn sm ghost" data-ask-remove="${esc(c.id)}">${I.trash}<span>Remove</span></button></div>`)
66
83
  : ''
67
- return `<div class="cn-card${c.status === 'active' ? '' : ' off'}">
68
- <div class="cn-top">${logoHtml(c)}<div class="cn-what"><b>${esc(c.name)}</b><small>${own ? `${c.status === 'active' ? 'Connected' : 'Started'} by ${esc(c.by)} · ${esc(ago(c.createdAt))}` : `From ${esc(FROM[c.level] || c.level)}${c.levelName ? ` (${esc(c.levelName)})` : ''} · by ${esc(c.by)}`}</small></div>${status}</div>
69
- <div class="cn-foot">${who}<span class="spacer"></span>${remove}</div>${pick}</div>`
84
+ return `<div class="pj-app cn-tile${active ? '' : ' off'}">${logoHtml(c)}<span class="cn-corner">${corner}</span>
85
+ <b title="${esc(c.name)}">${esc(c.name)}</b><span class="hint">${active ? 'Connected' : 'Started'} by ${esc(c.by)}${own ? ` · ${esc(ago(c.createdAt))}` : ''}</span>
86
+ <span class="pj-pills">${pills}</span>${who}${stuck}${pick}</div>`
70
87
  }
71
88
 
89
+ // An app to connect: its name opens what it is and what it does; Connect connects it straight away.
72
90
  function appHtml (a, connected) {
73
91
  const busy = ui.busy === a.slug
74
- return `<div class="cn-app">${logoHtml(a)}<b title="${esc(a.description || a.name)}">${esc(a.name)}</b>
75
- <button class="btn sm${connected ? ' ghost' : ''}" data-connect="${esc(a.slug)}"${busy ? ' disabled' : ''}>${busy ? 'Opening…' : connected ? 'Add another' : 'Connect'}</button></div>`
92
+ return `<div class="cn-app"><button type="button" class="cn-app-open" data-app="${esc(a.slug)}" title="See what ${esc(a.name)} does">${logoHtml(a)}<b>${esc(a.name)}</b></button>
93
+ <button type="button" class="btn sm ghost cn-go" data-connect="${esc(a.slug)}"${busy ? ' disabled' : ''}>${busy ? 'Opening…' : connected ? 'Add another' : 'Connect'}</button></div>`
94
+ }
95
+
96
+ /** One app, opened from the apps to pick from: what it is, and what agents could do with it once it is connected. */
97
+ function appDetailHtml (ownApps) {
98
+ const slug = ui.app
99
+ const info = appInfo.get(slug)
100
+ const a = (info && info.app) || (ui.apps || []).find((x) => x.slug === slug) || { slug, name: slug }
101
+ const busy = ui.busy === slug
102
+ const acts = (info && info.actions) || []
103
+ const list = (title, hint, items) => {
104
+ const shown = ui.allActs ? items : items.slice(0, ACTS_SHOWN)
105
+ return `<div class="cn-acts"><h4>${title}<i>${items.length}</i></h4><p class="hint">${hint}</p>${items.length
106
+ ? `<ul>${shown.map((x) => `<li><b>${esc(x.name)}</b>${x.description ? `<span title="${esc(x.description)}">${esc(x.description)}</span>` : ''}</li>`).join('')}</ul>`
107
+ : '<p class="hint cn-none">None.</p>'}</div>`
108
+ }
109
+ const reads = acts.filter((x) => x.readOnly)
110
+ const asks = acts.filter((x) => !x.readOnly)
111
+ const more = !ui.allActs && (reads.length > ACTS_SHOWN || asks.length > ACTS_SHOWN)
112
+ return `<section class="cn-add cn-detail${ui.entering ? ' enter' : ''}" data-add-panel aria-label="${esc(a.name)}">
113
+ <div class="cn-add-head"><button type="button" class="btn sm ghost cn-back" data-app-back>${BACK_ICON}<span>All apps</span></button><span class="spacer"></span><button type="button" class="btn sm ghost icon" data-add-close title="Close" aria-label="Close">${I.x}</button></div>
114
+ <div class="cn-app-top">${logoHtml(a)}<div class="t"><h3>${esc(a.name)}</h3>${a.description ? `<p class="hint">${esc(a.description)}</p>` : ''}</div>
115
+ <button type="button" class="btn primary" data-connect="${esc(slug)}"${busy ? ' disabled' : ''}>${busy ? 'Opening…' : ownApps.has(slug) ? 'Add another' : 'Connect'}</button></div>
116
+ ${!info ? '<p class="hint">Loading what it can do…</p>' : info.error ? `<p class="hint">${esc(info.error)}</p>` : `<div class="cn-acts-grid">
117
+ ${list('Reads', 'Agents do these at once.', reads)}${list('Sends, changes or deletes', 'Agents ask a person here first, each time.', asks)}</div>
118
+ ${more ? `<button type="button" class="btn sm ghost cn-more" data-all-acts>Show all ${acts.length}${acts.length >= 100 ? '+' : ''} actions</button>` : ''}`}
119
+ </section>`
76
120
  }
77
121
 
78
122
  function callsHtml () {
79
123
  if (type !== 'session' || !ui.calls || !ui.calls.length) return ''
80
124
  const word = { waiting: 'waiting for approval', approved: 'approved', declined: 'declined', ran: 'ran', failed: 'failed' }
81
- return `<section class="cn-sec"><h4>What agents did in apps</h4><div class="cn-calls">${ui.calls.slice(0, 20).map((c) => `<div class="cn-call">
125
+ return `<section class="cn-sec"><h3>What agents did in apps</h3><div class="cn-calls">${ui.calls.slice(0, 20).map((c) => `<div class="cn-call">
82
126
  <span class="cn-call-state ${esc(c.state)}">${esc(word[c.state] || c.state)}</span><code>${esc(c.tool)}</code><span class="hint">by ${esc(c.by)}${c.decidedBy ? ` · ${c.state === 'declined' ? 'declined' : 'approved'} by ${esc(c.decidedBy)}` : ''} · ${esc(ago(c.at))}</span></div>`).join('')}</div></section>`
83
127
  }
84
128
 
129
+ /** The apps to pick from: a search across the page, then a tile an app. */
130
+ function addHtml (ownApps, first) {
131
+ if (ui.app) return appDetailHtml(ownApps)
132
+ const apps = ui.apps || []
133
+ const shown = ui.more || ui.search ? apps : apps.slice(0, SHOWN)
134
+ return `<section class="cn-add${ui.entering ? ' enter' : ''}" data-add-panel aria-label="Connect an app">
135
+ <div class="cn-add-head"><h3>${first ? 'Connect your first app' : 'Connect an app'}</h3><span class="hint">You sign in to it in your browser. Agents never see the login.</span><span class="spacer"></span>${first ? '' : `<button type="button" class="btn sm ghost icon" data-add-close title="Close" aria-label="Close">${I.x}</button>`}</div>
136
+ <label class="cn-search">${SEARCH_ICON}<input class="input" data-search placeholder="Search thousands of apps" value="${esc(ui.search)}" aria-label="Search apps" autocomplete="off" spellcheck="false"></label>
137
+ ${ui.apps === null ? '<p class="hint">Loading apps…</p>' : shown.length ? `<div class="cn-apps">${shown.map((a) => appHtml(a, ownApps.has(a.slug))).join('')}</div>` : `<p class="hint">No app matches "${esc(ui.search)}".</p>`}
138
+ ${!ui.search && !ui.more && apps.length > SHOWN ? '<button type="button" class="btn sm ghost cn-more" data-more>Show more apps</button>' : ''}</section>`
139
+ }
140
+
85
141
  function draw () {
86
142
  if (!alive) return
87
143
  const had = root.contains(document.activeElement) && document.activeElement.matches('[data-search]')
88
- if (ui.error && !view) { root.innerHTML = `<div class="cn"><p class="hint">${esc(ui.error)}</p></div>`; return }
89
- if (!view) { root.innerHTML = '<div class="cn"><p class="hint">Loading connections…</p></div>'; return }
90
- const own = view.connections || []
144
+ const canAdd = !!view && view.canManage
145
+ const own = view ? view.connections || [] : []
146
+ const above = view ? view.inherited || [] : []
147
+ const none = !own.length && !above.length
148
+ const adding = canAdd && (ui.adding ?? none)
149
+ const head = page ? `<div class="files-head"><div class="t"><h2 class="crumbs">${esc(page.title)}</h2><p class="hint">${esc(page.hint)}</p></div><span class="spacer"></span>${canAdd && !none ? `<button type="button" class="btn sm primary" data-add aria-expanded="${adding}">${I.plus}<span>Connect an app</span></button>` : ''}</div>` : ''
150
+ if (!view) { root.innerHTML = `<div class="cn">${head}<p class="hint">${esc(ui.error || 'Loading connections…')}</p></div>`; return }
91
151
  const ownApps = new Set(own.map((c) => c.app))
92
- const apps = ui.apps || []
93
- const shown = ui.more || ui.search ? apps : apps.slice(0, SHOWN)
94
- root.innerHTML = `<div class="cn">
95
- <p class="lead">Apps agents in ${esc(LEVEL[type] || type)} can use: they read at once and ask a person here before they send, change or delete anything. Composio keeps each sign-in; Quilt never sees it.</p>
96
- ${own.length ? `<section class="cn-sec"><h4>Connected here <i>${own.length}</i></h4><div class="cn-grid">${own.map((c) => connectedHtml(c, true)).join('')}</div></section>` : ''}
97
- ${(view.inherited || []).length ? `<section class="cn-sec"><h4>From above</h4><div class="cn-grid">${view.inherited.map((c) => connectedHtml(c, false)).join('')}</div></section>` : ''}
98
- ${view.canManage ? `<section class="cn-sec"><div class="cn-head"><h4>Add an app</h4><label class="cn-search">${SEARCH_ICON}<input class="input" data-search placeholder="Search thousands of apps" value="${esc(ui.search)}" aria-label="Search apps"></label></div>
99
- ${ui.apps === null ? '<p class="hint">Loading apps…</p>' : shown.length ? `<div class="cn-apps">${shown.map((a) => appHtml(a, ownApps.has(a.slug))).join('')}</div>` : `<p class="hint">No app matches "${esc(ui.search)}".</p>`}
100
- ${!ui.search && !ui.more && apps.length > SHOWN ? '<button class="btn sm ghost" data-more>Show more apps</button>' : ''}</section>` : ''}
152
+ root.innerHTML = `<div class="cn">${head}
153
+ ${none ? (canAdd ? '' : '<p class="hint">Nothing is connected here yet.</p>') : `<div class="cn-tiles">${own.map((c) => connectedHtml(c, true)).join('')}${above.map((c) => connectedHtml(c, false)).join('')}
154
+ ${canAdd && !adding ? `<button type="button" class="pj-app pj-slot" data-add aria-expanded="false"><span class="pj-plus">${I.plus}</span><span>Connect an app</span></button>` : ''}</div>`}
155
+ ${adding ? addHtml(ownApps, none) : ''}
101
156
  ${callsHtml()}
157
+ <p class="hint cn-note">${I.lock}<span>Agents read at once, and ask a person here before they send, change or delete anything. Composio keeps each sign-in: Quilt never sees it.</span></p>
102
158
  </div>`
103
- if (had) { const s = root.querySelector('[data-search]'); s.focus(); s.setSelectionRange(s.value.length, s.value.length) }
159
+ ui.entering = false
160
+ if (had) { const s = root.querySelector('[data-search]'); if (s) { s.focus(); s.setSelectionRange(s.value.length, s.value.length) } }
104
161
  }
105
162
 
106
163
  yourAgents().then((list) => { ui.yours = list; if (alive && view) draw() })
@@ -155,7 +212,22 @@ export function mountConnections (root, { type, id, agents = () => [] }) {
155
212
  try { await api('PATCH', urlOf(type, id, `/${sel.dataset.who}`), { who: sel.value }); load() } catch (err) { toast(err.message); load() }
156
213
  })
157
214
 
215
+ /** Opens one app: what it is and what it does, asked once. */
216
+ async function openApp (slug) {
217
+ ui.app = slug
218
+ ui.allActs = false
219
+ draw()
220
+ root.querySelector('[data-app-back]')?.focus()
221
+ if (appInfo.has(slug)) return
222
+ try { appInfo.set(slug, await api('GET', `/api/connections/apps/${encodeURIComponent(slug)}`)) } catch (err) { appInfo.set(slug, { error: `Couldn't load what it can do. ${err.message}` }); setTimeout(() => appInfo.delete(slug), 5000) }
223
+ if (ui.app === slug) draw()
224
+ }
225
+
158
226
  root.addEventListener('click', async (e) => {
227
+ const open = e.target.closest('[data-app]')
228
+ if (open) return openApp(open.dataset.app)
229
+ if (e.target.closest('[data-app-back]')) { const was = ui.app; ui.app = null; draw(); [...root.querySelectorAll('[data-app]')].find((b) => b.dataset.app === was)?.focus(); return }
230
+ if (e.target.closest('[data-all-acts]')) { ui.allActs = true; draw(); return }
159
231
  const c = e.target.closest('[data-connect]')
160
232
  if (c) {
161
233
  ui.busy = c.dataset.connect
@@ -179,7 +251,20 @@ export function mountConnections (root, { type, id, agents = () => [] }) {
179
251
  load()
180
252
  return
181
253
  }
182
- if (e.target.closest('[data-more]')) { ui.more = true; draw() }
254
+ if (e.target.closest('[data-more]')) { ui.more = true; draw(); return }
255
+ // "Connect an app" opens the apps to pick from, in the page, with the search ready to type in.
256
+ if (e.target.closest('[data-add]')) {
257
+ ui.adding = !(ui.adding ?? false)
258
+ ui.app = null
259
+ ui.entering = ui.adding
260
+ draw()
261
+ if (ui.adding) { const box = root.querySelector('[data-search]'); box?.focus(); root.querySelector('[data-add-panel]')?.scrollIntoView({ block: 'nearest', behavior: 'smooth' }) }
262
+ return
263
+ }
264
+ if (e.target.closest('[data-add-close]')) { ui.adding = false; ui.app = null; ui.search = ''; draw(); loadApps() }
265
+ })
266
+ root.addEventListener('keydown', (e) => {
267
+ if (e.key === 'Escape' && e.target.matches('[data-search]') && ui.adding) { ui.adding = false; ui.search = ''; draw(); loadApps(); root.querySelector('[data-add]')?.focus() }
183
268
  })
184
269
 
185
270
  draw()
package/src/ui/home.js CHANGED
@@ -5,7 +5,7 @@ import { go, pickFolder, signedOutNow, agentInviteHtml } from './app.js'
5
5
  import { agentPaste } from './invite.js'
6
6
  import { openKindMenu, kindLineHtml } from './agent-kinds.js'
7
7
  import { quiltMark } from './mark.js'
8
- import { updateControl } from './releases.js'
8
+ import { updateControl, downloadAhead } from './releases.js'
9
9
  import { workspacesHtml, bindWorkspaces, workspacePageHtml, bindWorkspacePage, loadWorkspaces, openWorkspace, wsIdOf, COLORS } from './workspaces.js'
10
10
  import { allFilesHtml, bindAllFiles } from './files.js'
11
11
  import { invitesHtml, bindInvites } from './invites.js'
@@ -814,6 +814,7 @@ function settingsHtml (session = null) {
814
814
  <div class="sec-intro"><h2>About Quilt</h2><p>${state.release?.outOfDate ? `Quilt ${esc(state.release.latest.version)} is out.` : 'The version on this computer.'}</p></div>
815
815
  <div class="sec-body">
816
816
  <div class="kv"><span>Version</span><span>${esc(state.release?.version || '…')}${state.release?.outOfDate ? ` <span class="pill warn">update available</span>` : state.release ? ' <span class="pill">up to date</span>' : ''}</span></div>
817
+ ${window.quiltDesktop?.downloadUpdate && !window.quiltDesktop.dev ? `<div class="row">${toggle('autoUpdate', !!p.autoUpdate, 'Download updates automatically', 'A newer Quilt is downloaded as soon as it is out. You restart when you like: nothing is installed without you.')}</div>` : ''}
817
818
  <div class="sec-actions"><span class="hint">Everything that changed, release by release.</span><span class="row">
818
819
  ${state.release?.outOfDate ? updateControl() : ''}
819
820
  <button class="btn" type="button" data-release-notes>${I.sparkle}<span>What's new</span></button></span></div>
@@ -1025,6 +1026,18 @@ function bindSettings (root, refresh) {
1025
1026
  }
1026
1027
  })
1027
1028
 
1029
+ // Download updates automatically: saved at once, and a newer Quilt that is already out is fetched now.
1030
+ $('#about-sec [name="autoUpdate"]', root)?.addEventListener('change', async (e) => {
1031
+ const box = e.target
1032
+ try {
1033
+ state.profile = await api('POST', '/api/settings', { autoUpdate: box.checked })
1034
+ if (box.checked) downloadAhead()
1035
+ } catch (err) {
1036
+ box.checked = !box.checked
1037
+ toast(err.message)
1038
+ }
1039
+ })
1040
+
1028
1041
  if ($('#agents-sec', root)) bindAgents(root)
1029
1042
 
1030
1043
  const signOut = $('#sign-out', root)
@@ -29,12 +29,17 @@ const foldedNow = () => (folded ||= readFolded(saved('quilt.sideFolded')))
29
29
  /** Whether the sidebar of a project or a codebase is closed (one choice for both, kept on this computer). */
30
30
  export const sideShut = () => saved('quilt.projectSide') === 'shut'
31
31
  export const toggleSideShut = () => save('quilt.projectSide', sideShut() ? 'open' : 'shut')
32
- /** Shows the sidebar closed or open, as it was just set: on the page's shell (`ws`), where it slides, and on its button. */
32
+ // The sidebar's own button, top right in it, closes it. While it is closed the button that opens
33
+ // it again is in the header, where the sidebar's edge was (the styles show one or the other).
34
+ const sideHideBtn = () => `<button type="button" class="btn sm ghost icon pj-side-hide" data-side-toggle aria-expanded="true" title="Hide the sidebar" aria-label="Hide the sidebar">${panelIcon}</button>`
35
+ const sideShowBtn = () => `<button type="button" class="btn sm ghost icon" id="pj-side-btn" aria-expanded="false" title="Show the sidebar" aria-label="Show the sidebar">${panelIcon}</button>`
36
+ /** Shows the sidebar closed or open, as it was just set: on the page's shell (`ws`), where it slides. The button now showing takes the focus the other had. */
33
37
  export function drawSideShut (ws) {
34
38
  const shut = sideShut()
35
- if (ws) ws.dataset.side = shut ? 'shut' : 'open'
36
- const b = $('#pj-side-btn')
37
- if (b) { b.setAttribute('aria-pressed', String(!shut)); b.title = `${shut ? 'Show' : 'Hide'} the sidebar`; b.setAttribute('aria-label', b.title) }
39
+ if (!ws) return
40
+ const had = ws.contains(document.activeElement) && document.activeElement.matches('#pj-side-btn, [data-side-toggle]')
41
+ ws.dataset.side = shut ? 'shut' : 'open'
42
+ if (had) ws.querySelector(shut ? '#pj-side-btn' : '.pj-side [data-side-toggle]')?.focus({ preventScroll: true })
38
43
  }
39
44
  /** Folds or unfolds one of the sidebar's sections. */
40
45
  export function toggleFolded (k) { const f = foldedNow(); f.has(k) ? f.delete(k) : f.add(k); save('quilt.sideFolded', JSON.stringify([...f])) }
@@ -73,7 +78,7 @@ function headerHtml (p) {
73
78
  return `
74
79
  <header class="ws-top">
75
80
  <button class="brand" data-go="home" aria-label="Home">${quiltMark({ sew: 'first' })}</button>
76
- ${p ? `<button type="button" class="btn sm ghost icon" id="pj-side-btn" aria-pressed="${!sideShut()}" title="${sideShut() ? 'Show' : 'Hide'} the sidebar" aria-label="${sideShut() ? 'Show' : 'Hide'} the sidebar">${panelIcon}</button>
81
+ ${p ? `${sideShowBtn()}
77
82
  <button type="button" class="pj-crumb" data-go="ws:${esc(p.id)}" title="${esc(p.description || p.name)}">${tile(p, 'xs')}<span>${esc(p.name)}</span></button>` : ''}
78
83
  <span class="spacer"></span>
79
84
  ${p ? '' : `<div class="menu-wrap pj-new"><button type="button" class="btn sm primary" id="pj-new-btn" aria-haspopup="true" aria-expanded="false">${I.plus}<span>New</span><span class="caret">${I.caret}</span></button>
@@ -231,6 +236,7 @@ function sideHtml (p, d, page) {
231
236
  }
232
237
  return `
233
238
  <aside class="pj-side" aria-label="${esc(p.name)}">
239
+ ${sideHideBtn()}
234
240
  <nav class="side-nav" aria-label="Pages">${nav('', I.grid, 'Overview')}${nav('tasks', I.board, 'Tasks', projectOpenTasks(d))}${nav('artifacts', I.folder, 'Artifacts', files)}${state.connectionsOn ? nav('connections', I.link, 'Connections') : ''}</nav>
235
241
  ${label('codebases', 'Codebases', list.length, d.access?.access === 'edit' ? `<button type="button" class="btn sm ghost icon" data-new-codebase title="New codebase" aria-label="New codebase">${I.plus}</button>` : '')}
236
242
  <div class="side-sessions">${isFolded('codebases') ? '' : list.map(row).join('')}</div>
@@ -253,8 +259,7 @@ function sideHtml (p, d, page) {
253
259
 
254
260
  /** Beside the logo on a codebase's page: the button that closes the sidebar, then the project it is in, if any. */
255
261
  export function codeCrumbHtml (project) {
256
- const shut = sideShut()
257
- return `<button type="button" class="btn sm ghost icon" id="pj-side-btn" aria-pressed="${!shut}" title="${shut ? 'Show' : 'Hide'} the sidebar" aria-label="${shut ? 'Show' : 'Hide'} the sidebar">${panelIcon}</button>${project ? `
262
+ return `${sideShowBtn()}${project ? `
258
263
  <button type="button" class="pj-crumb" data-go="ws:${esc(project.id)}" title="${esc(project.description || project.name)}">${tile(project, 'xs')}<span>${esc(project.name)}</span></button><span class="pj-crumb-sep">/</span>` : ''}`
259
264
  }
260
265
 
@@ -276,6 +281,7 @@ export function codeSideHtml ({ page, name, project, tasks = 0, artifacts = 0, c
276
281
  const channel = !isFolded('channels') || page === 'chat' || chatNew || call
277
282
  const inDm = page === 'chat' ? dmOn : ''
278
283
  return `
284
+ ${sideHideBtn()}
279
285
  <nav class="side-nav" aria-label="Pages">${nav('loom', I.users, 'Loom')}${nav('tasks', I.board, 'Tasks', tasks)}${project ? nav('artifacts', I.folder, 'Artifacts', artifacts) : ''}${connections ? nav('connections', I.link, 'Connections') : ''}</nav>
280
286
  ${pvHtml}
281
287
  ${label('channels', 'Channels', chatNew)}
@@ -339,7 +345,7 @@ function projectPageHtml (p, view) {
339
345
  const main = page === 'artifacts' ? artifactsHtml(d)
340
346
  : page === 'tasks' ? '<div class="pj-board" data-project-board></div>'
341
347
  : page === 'channel' ? '<div class="pj-chanpage" data-project-channel></div>'
342
- : page === 'connections' ? `<div class="files-head"><div class="t"><h2 class="crumbs">Connections</h2><p class="hint">Apps this project's agents can use. Agents never see the logins.</p></div></div><div data-project-connections></div>`
348
+ : page === 'connections' ? '<div data-project-connections></div>'
343
349
  : codebasesHtml(projectCodebases(d, state.sessions, `person:${state.account?.id}`), { project: p, canAdd: d.access?.access === 'edit' }) +
344
350
  projectAgentsHtml(d) + (state.connectionsOn ? appsSectionHtml(appsOf(p.id)) : '')
345
351
  return `${sideHtml(p, d, page)}<div class="pj-pmain${page === 'artifacts' ? ' pj-files' : page === 'tasks' ? ' pj-tasks' : page === 'channel' ? ' pj-chat' : ''}">${main}</div>`
@@ -424,8 +430,7 @@ export function bindProjectShell (view, { go, rerender, newSessionDialog, joinSe
424
430
  root.querySelectorAll('[data-manage-connections]').forEach((b) => { b.onclick = () => { state.settingsTab = 'connections'; openSettings() } })
425
431
  if (!p) return
426
432
  // The sidebar: its pages, closing it, folding a section.
427
- const side = $('#pj-side-btn')
428
- if (side) side.onclick = () => { toggleSideShut(); drawSideShut(root) }
433
+ root.querySelectorAll('#pj-side-btn, [data-side-toggle]').forEach((b) => { b.onclick = () => { toggleSideShut(); drawSideShut(root) } })
429
434
  root.querySelectorAll('[data-page]').forEach((b) => {
430
435
  b.onclick = () => {
431
436
  const page = b.dataset.page
@@ -467,7 +472,7 @@ export function bindProjectShell (view, { go, rerender, newSessionDialog, joinSe
467
472
  // The open count beside Tasks follows the board as it changes.
468
473
  if (board) mountProjectBoard(board, { d, go, reload, changed: () => { const ct = root.querySelector('[data-page="tasks"] .ct'); if (ct) ct.textContent = projectOpenTasks(state.workspace) } })
469
474
  const conns = root.querySelector('[data-project-connections]')
470
- if (conns) mountConnections(conns, { type: 'workspace', id: p.id, agents: () => ((state.workspace && state.workspace.agents) || []).filter((a) => a.agentId).map((a) => ({ id: a.agentId, name: a.name })) })
475
+ if (conns) mountConnections(conns, { type: 'workspace', id: p.id, page: { title: 'Connections', hint: "Apps this project's agents can use." }, agents: () => ((state.workspace && state.workspace.agents) || []).filter((a) => a.agentId).map((a) => ({ id: a.agentId, name: a.name })) })
471
476
  // An agent's switch in this project: one added here keeps its place and changes whether it is invited; one from above gets this project's own setting.
472
477
  root.querySelectorAll('[data-agent-here]').forEach((box) => {
473
478
  box.onchange = async () => {
@@ -27,6 +27,7 @@ export async function checkRelease () {
27
27
  r.unseen = false
28
28
  }
29
29
  renderUpdateBar()
30
+ downloadAhead()
30
31
  if (!checkRelease.timer) checkRelease.timer = setInterval(() => checkRelease().catch(() => {}), RECHECK_MS)
31
32
  }
32
33
 
@@ -34,17 +35,19 @@ export async function checkRelease () {
34
35
  const desktop = () => window.quiltDesktop?.installUpdate ? window.quiltDesktop : null
35
36
  // Quilt run from source can't install a build: its folder gets each release with main, by itself.
36
37
  const fromSource = () => window.quiltDesktop?.dev === true
37
- let update = null // { phase: 'downloading' | 'installing' | 'restarting' | 'failed', received, total, error }
38
+ let update = null // { phase: 'ready' | 'downloading' | 'installing' | 'restarting' | 'failed', received, total, error }: 'ready' is downloaded ahead, waiting for a restart
39
+ let fetching = '' // the version being downloaded ahead of time, or already asked for
38
40
 
39
41
  /** Downloads and installs the newest Quilt from inside the desktop app. */
40
42
  async function startUpdate () {
41
43
  const d = desktop()
42
- if (!d || (update && update.phase !== 'failed')) return
44
+ if (!d || (update && update.phase !== 'failed' && update.phase !== 'ready')) return
43
45
  if (!startUpdate.listening) { startUpdate.listening = true; d.onUpdateProgress?.((p) => { update = { ...update, ...p }; refreshUpdateControls() }) }
44
- update = { phase: 'downloading', received: 0, total: 0 }
46
+ // Downloaded ahead of time: there is only the install left.
47
+ update = update?.phase === 'ready' ? { phase: 'installing' } : { phase: 'downloading', received: 0, total: 0 }
45
48
  refreshUpdateControls()
46
49
  try {
47
- await d.installUpdate()
50
+ await d.installUpdate(state.release?.latest?.version || '')
48
51
  update = { phase: 'restarting' }
49
52
  } catch (err) {
50
53
  update = { phase: 'failed', error: String(err?.message || err).replace(/^Error invoking remote method '[^']*': (Error: )?/, '') }
@@ -52,6 +55,27 @@ async function startUpdate () {
52
55
  refreshUpdateControls()
53
56
  }
54
57
 
58
+ /**
59
+ * With "Download updates automatically" on (Settings, About Quilt): fetches the newer Quilt quietly as
60
+ * soon as it is out, so the button only has to restart. A download that fails says nothing: the
61
+ * button still downloads it.
62
+ */
63
+ export async function downloadAhead () {
64
+ const d = desktop()
65
+ const r = state.release
66
+ const version = r?.latest?.version || ''
67
+ if (!d?.downloadUpdate || fromSource() || !r?.outOfDate || !state.profile?.autoUpdate) return
68
+ if (update || fetching === version) return
69
+ fetching = version
70
+ try {
71
+ await d.downloadUpdate(version)
72
+ if (update || state.release?.latest?.version !== version) return
73
+ update = { phase: 'ready' }
74
+ refreshUpdateControls()
75
+ renderUpdateBar()
76
+ } catch { fetching = '' }
77
+ }
78
+
55
79
  /** The button that gets the newer Quilt: installs it in the desktop app, downloads it elsewhere. */
56
80
  export function updateControl () {
57
81
  const r = state.release
@@ -60,6 +84,7 @@ export function updateControl () {
60
84
  if (!desktop()) return `<span class="update-ctl">${download}</span>`
61
85
  const phase = update?.phase
62
86
  if (!phase) return `<span class="update-ctl"><button class="btn sm primary" type="button" data-update>${I.down}<span>Update Quilt</span></button></span>`
87
+ if (phase === 'ready') return `<span class="update-ctl"><button class="btn sm primary" type="button" data-update>${I.refresh}<span>Restart to update</span></button></span>`
63
88
  if (phase === 'failed') {
64
89
  return `<span class="update-ctl update-failed"><span class="update-err" title="${esc(update.error)}">${esc(update.error)}</span><button class="btn sm primary" type="button" data-update>${I.refresh}<span>Try again</span></button>${download}</span>`
65
90
  }
@@ -89,7 +114,7 @@ export function renderUpdateBar () {
89
114
  }
90
115
  bar.innerHTML = `
91
116
  <span class="ub-dot"></span>
92
- <span class="ub-text"><b>Quilt ${esc(r.latest.version)} is out.</b> You have ${esc(r.version)}.</span>
117
+ <span class="ub-text"><b>Quilt ${esc(r.latest.version)} is ${update?.phase === 'ready' ? 'downloaded' : 'out'}.</b> You have ${esc(r.version)}.</span>
93
118
  <button class="btn sm ghost" type="button" data-release-notes>What's new</button>
94
119
  ${updateControl()}
95
120
  <label class="ub-never" title="Hide this bar until a newer Quilt than ${esc(r.latest.version)} is out"><input type="checkbox" data-update-never><span class="ub-long">Don't show this again</span><span class="ub-short">Don't show again</span></label>
package/src/ui/session.js CHANGED
@@ -461,8 +461,8 @@ function renderCodeSide () {
461
461
  })
462
462
  }
463
463
  if (boxed === 'connections') {
464
- extra.innerHTML = '<div class="files-head"><div class="t"><h2 class="crumbs">Connections</h2><p class="hint">Apps the agents in this codebase can use: its own, and the ones it gets from above. Agents never see the logins.</p></div></div><div data-code-connections></div>'
465
- codeConns = mountConnections(extra.querySelector('[data-code-connections]'), { type: 'session', id: st.room })
464
+ extra.innerHTML = '<div data-code-connections></div>'
465
+ codeConns = mountConnections(extra.firstElementChild, { type: 'session', id: st.room, page: { title: 'Connections', hint: `Apps the agents in this codebase can use: its own, and the ones it gets from ${projectHere() ? projectHere().name : 'above'}.` } })
466
466
  }
467
467
  if (boxed === 'artifacts') { drawCodeArtifacts(); loadCodeArtifacts() }
468
468
  } else if (codePreview) codePreview.update()
@@ -516,6 +516,7 @@ function bindCodeSide () {
516
516
  // The channel is for everyone; a direct message's row is that person alone.
517
517
  if (b.dataset.dm !== undefined) { state.to = b.dataset.dm; showCodePage('chat'); renderRecipients(); updatePlaceholder(); return renderCodeSide() }
518
518
  if (b.dataset.codePage) return showCodePage(b.dataset.codePage)
519
+ if (b.hasAttribute('data-side-toggle')) { toggleSideShut(); return drawSideShut($('#ws')) }
519
520
  if (b.dataset.fold) return foldSection(b.dataset.fold, renderCodeSide)
520
521
  if (b.dataset.go) return go(b.dataset.go)
521
522
  if (b.hasAttribute('data-code-team')) { e.stopPropagation(); return $('#people-btn').click() }
@@ -525,7 +526,7 @@ function bindCodeSide () {
525
526
  const b = e.target.closest('button')
526
527
  if (!b) return
527
528
  if (b.dataset.go) return go(b.dataset.go)
528
- if (b.id === 'pj-side-btn') { toggleSideShut(); drawSideShut($('#ws')); renderCodeSide() }
529
+ if (b.id === 'pj-side-btn') { toggleSideShut(); drawSideShut($('#ws')) }
529
530
  }, { signal: mounted.signal })
530
531
  }
531
532
 
package/src/ui-server.js CHANGED
@@ -74,6 +74,8 @@ function profile () {
74
74
  preferLocal: !!s.preferLocal,
75
75
  theme: THEMES.includes(s.theme) ? s.theme : 'dark', // dark unless you pick another
76
76
  report: s.report !== false,
77
+ // Download updates automatically (the desktop app): a newer Quilt is fetched as soon as it is out, so updating is a restart.
78
+ autoUpdate: !!s.autoUpdate,
77
79
  aiTasks: pickupMode(s.aiTasks),
78
80
  // When work comes to your AI (autowork.js): 'chat', 'open' or 'auto', with its model, files and daily cap.
79
81
  auto: publicConfig(autoConfig(s)),
@@ -104,6 +106,7 @@ function updateProfile (b) {
104
106
  patch.theme = b.theme === 'dark' ? undefined : b.theme
105
107
  }
106
108
  if ('report' in b) patch.report = b.report ? undefined : false
109
+ if ('autoUpdate' in b) patch.autoUpdate = b.autoUpdate ? true : undefined
107
110
  if ('aiTasks' in b) {
108
111
  if (!PICKUP_MODES.includes(b.aiTasks)) throw httpError(400, 'Pick Off, Assigned to it, or Assigned and unassigned.')
109
112
  patch.aiTasks = b.aiTasks === 'off' ? undefined : b.aiTasks
@@ -1041,6 +1044,8 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
1041
1044
  const enc = (v) => encodeURIComponent(String(v))
1042
1045
  return asAccount(async (token) => {
1043
1046
  const c = secretsApi(token)
1047
+ const one = method === 'GET' && p.match(/^\/api\/connections\/apps\/([a-z0-9][a-z0-9_-]{0,79})$/i)
1048
+ if (one) return apiCall(c, 'GET', `/v1/connections/apps/${enc(one[1])}`)
1044
1049
  if (method === 'GET' && p === '/api/connections/apps') return apiCall(c, 'GET', `/v1/connections/apps?search=${enc(url.searchParams.get('search') || '')}&limit=${enc(url.searchParams.get('limit') || '60')}`)
1045
1050
  const sc = p.match(/^\/api\/connections\/(org|workspace|session|account)\/([^/]+)(?:\/([0-9a-f-]{36}))?$/i)
1046
1051
  // A person's own connections are always "me": the accounts API reads who from the sign-in.