heyquilt 0.3.188 → 0.3.189

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,11 @@ 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.189 — 2026-11-23
15
+
16
+ - **Agents can read a codebase's previews.** `quilt_previews` tells an agent who has a preview open, the address of each branch that is running, and what an app printed when it did not start, so it can say where a change can be looked at or see why it broke. It works for an agent on a computer and for one over HTTP. An agent cannot start a preview: a person opens it.
17
+ - **A preview that was changed starts again by itself**, and each app on a preview's machine gets a port nothing else has.
18
+
14
19
  ## 0.3.188 — 2026-11-23
15
20
 
16
21
  Previews: a codebase's app, running, for everyone in it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyquilt",
3
- "version": "0.3.188",
3
+ "version": "0.3.189",
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",
package/src/control.js CHANGED
@@ -163,6 +163,7 @@ export async function startControl (session, extras = {}) {
163
163
  },
164
164
  'POST /tasks/delete': (b) => { session.deleteTask(b.id); return { tasks: session.taskList() } },
165
165
  'GET /rules': () => ({ text: session.projectRulesText() }),
166
+ 'GET /previews': () => ({ text: session.previewsText() }),
166
167
  // Held conflicts (held.js): the list (quilt_resolve_merge without a how), and resolving one { ref, how } (any member, any conflict).
167
168
  'GET /held': () => ({ held: session.heldList ? session.heldList() : [] }),
168
169
  'POST /resolve-merge': (b) => session.resolveHeld({ ref: String(b.ref || ''), how: String(b.how || ''), via: b.via ? String(b.via) : null }),
package/src/mcp.js CHANGED
@@ -41,6 +41,7 @@ import { describeSecretNames, SECRET_NAMES_DESCRIPTION, RUN_GUIDE } from './secr
41
41
  import { appWorkspaces } from './app-workspaces.js'
42
42
  import { TRANSCRIPT_DESCRIPTION, JOIN_DESCRIPTION, SAY_DESCRIPTION, MAX_LINE, renderLines, agentsJoinCalls } from './voice.js'
43
43
  import { describeHeld, RESOLVE_DESCRIPTION, findHeldIn, renderOwnHeld } from './held.js'
44
+ import { PREVIEWS_DESCRIPTION } from './previews.js'
44
45
 
45
46
  // The board's columns, from tasks.js, so this and the hosted MCP (relay-mcp.js) never drift apart.
46
47
  const COLUMN_IDS_LIST = COLUMNS.map((c) => c.id)
@@ -816,6 +817,11 @@ export async function runMcp () {
816
817
  inputSchema: {}
817
818
  }, () => withDaemon(async (d) => (await call(d, 'GET', '/rules')).text))
818
819
 
820
+ server.registerTool('quilt_previews', {
821
+ description: PREVIEWS_DESCRIPTION,
822
+ inputSchema: {}
823
+ }, () => withDaemon(async (d) => (await call(d, 'GET', '/previews')).text))
824
+
819
825
  server.registerTool('quilt_secret_names', {
820
826
  description: SECRET_NAMES_DESCRIPTION,
821
827
  inputSchema: {}
package/src/preview-vm.js CHANGED
@@ -17,7 +17,7 @@ import fs from 'node:fs'
17
17
  import path from 'node:path'
18
18
  import { WebSocketServer } from 'ws'
19
19
  import { startPreviewProxy } from './preview/proxy.js'
20
- import { previewHost, MAX_SLOTS } from './preview/address.js'
20
+ import { previewHost, MAX_SLOTS, PREVIEW_DOMAIN } from './preview/address.js'
21
21
  import os from 'node:os'
22
22
  import { startApp as realStartApp, installStamp, freePort } from './preview/runner.js'
23
23
  import { Session } from './session.js'
@@ -226,7 +226,7 @@ export async function startRunner ({ c, slots, lastRequestAt = () => 0, log = ()
226
226
  const running = [...runners.values()].map((r) => ({ preview: r.id, branch: r.branch || mainKey(), slot: r.slot, state: r.app.state, output: r.app.output.slice(-2000) }))
227
227
  savePids()
228
228
  const next = JSON.stringify(running)
229
- if (changed || next !== said) { said = next; changed = false; control.setRunning(running, c.machine) }
229
+ if (changed || next !== said) { said = next; changed = false; control.setRunning(running, c.machine, c.domain || PREVIEW_DOMAIN) }
230
230
  }
231
231
 
232
232
  /** Tells the API the machine is up, and whether anyone is looking: a preview open in an app, or a page asked for lately. */
package/src/previews.js CHANGED
@@ -8,6 +8,7 @@
8
8
  // (`running: [{ preview, branch, slot, state, output }]`, with `machine`). The machine has no
9
9
  // name there, so nobody lists it as a person.
10
10
  import { validBranchKey } from './branchdocs.js'
11
+ import { previewHost } from './preview/address.js'
11
12
 
12
13
  export const PREVIEW_KINDS = ['app', 'link']
13
14
  export const MAX_PREVIEWS = 12
@@ -126,7 +127,9 @@ export function previewsView ({ previews = [], states = [], clientID = null } =
126
127
  if (!s || typeof s !== 'object') continue
127
128
  if (s.kind === 'preview') {
128
129
  const machine = typeof s.machine === 'string' && /^[0-9a-f]{8,24}$/.test(s.machine) ? s.machine : ''
129
- for (const r of cleanRunning(s.running)) running.push({ ...r, machine })
130
+ // Its address, when the machine says where previews are served (a wrong one reads as none).
131
+ const at = (slot) => { try { return machine && typeof s.domain === 'string' && s.domain ? `https://${previewHost(machine, slot, s.domain)}` : '' } catch { return '' } }
132
+ for (const r of cleanRunning(s.running)) running.push({ ...r, machine, ...(at(r.slot) ? { address: at(r.slot) } : {}) })
130
133
  continue
131
134
  }
132
135
  const l = typeof s.name === 'string' && s.name ? cleanLooking(s.preview) : null
@@ -154,3 +157,29 @@ export function branchChoices (branches = [], tasks = []) {
154
157
  }
155
158
  return out
156
159
  }
160
+
161
+ export const PREVIEWS_DESCRIPTION = 'The codebase\'s previews (its app running on a cloud machine, and links), each with who has it open and, for every branch that is running or failed, its state, its address and the last of what it printed. Read it to tell someone where a change can be looked at, or to see why an app did not start. A preview runs only while a person has it open in Quilt: you cannot start one.'
162
+
163
+ /**
164
+ * What quilt_previews answers, in words: each preview, who is looking, and every branch the
165
+ * codebase's preview machine runs or failed to start. `previews`: previewsView's answer.
166
+ */
167
+ export function describePreviews (previews = []) {
168
+ if (!previews.length) return 'This codebase has no previews. A codebase with a `dev` script in its package.json gets one called App by itself; a person adds others from the sidebar in Quilt.'
169
+ const lines = ['Previews of this codebase. An app\'s preview runs on a cloud machine only while a person has it open in Quilt, on the branch they pick there.']
170
+ for (const p of previews) {
171
+ if (p.kind === 'link') { lines.push('', `${p.name} (${p.id}): a link, ${p.url}`); continue }
172
+ lines.push('', `${p.name} (${p.id}): ${p.command ? `runs \`${p.command}\`` : 'runs the dev script'}${p.folder ? ` in ${p.folder}` : ''}`)
173
+ const looking = (p.looking || []).map((l) => `${l.name}${l.branch ? ` on ${l.branch}` : ''}`)
174
+ if (looking.length) lines.push(` Open now: ${looking.join(', ')}.`)
175
+ if (!(p.running || []).length) { lines.push(looking.length ? ' Starting: the machine has not said anything yet.' : ' Not running: nobody has it open.'); continue }
176
+ for (const r of p.running) {
177
+ const out = String(r.output || '').trim().split('\n').slice(-25).map((l) => ` ${l}`).join('\n')
178
+ if (r.state === 'running') lines.push(` ${r.branch}: running${r.address ? ` at ${r.address}` : ''}`)
179
+ else if (r.state === 'failed') lines.push(` ${r.branch}: it did not start. The last of what it printed:`, out || ' (nothing)')
180
+ else lines.push(` ${r.branch}: starting.${out ? ' So far it printed:' : ''}`, ...(out ? [out] : []))
181
+ }
182
+ }
183
+ if (previews.some((p) => (p.running || []).some((r) => r.address))) lines.push('', 'An address opens for the codebase\'s members from the preview\'s page in Quilt, which hands the browser a ticket; on its own it answers "Open this preview from Quilt".')
184
+ return lines.join('\n')
185
+ }
package/src/relay-mcp.js CHANGED
@@ -43,6 +43,7 @@ import { HELD_MAP, readHeld, findHeld, settleHeld, renderHeld, renderOwnHeld, ow
43
43
  import { applyMine, LiveRules } from './live-merge.js'
44
44
  import { readBasesOf } from './read-bases.js'
45
45
  import { TRANSCRIPT_DESCRIPTION, JOIN_DESCRIPTION, SAY_DESCRIPTION, MAX_LINE, renderLines, readLines, inVoice, transcribeSetting, voiceStatusLines, callAgents, liveCallOf, setAgentLeft, notInCall, agentSays, agentsJoinCalls } from './voice.js'
46
+ import { PREVIEWS_DESCRIPTION, previewList, previewsView, describePreviews, hasDevScript } from './previews.js'
46
47
 
47
48
  const FEED_CAP = 300
48
49
  const ACTIVITY_CAP = 300
@@ -625,6 +626,13 @@ function sessionTools (server, ctx) {
625
626
  return text([note, renderInbox(withContext(open, seen, { names: [me], agent: true }), { me: [me] })].filter(Boolean).join('\n\n') || 'Nothing new for you.')
626
627
  })
627
628
 
629
+ // Previews (previews.js): read from the codebase's shared document and the preview machine's presence.
630
+ tool('quilt_previews', { description: PREVIEWS_DESCRIPTION, inputSchema: {} }, (args, { room, doc, files }) => {
631
+ const dev = files.get('package.json')
632
+ const list = previewList(doc.getMap('previews').toJSON(), { hasDev: !!dev && hasDevScript(dev.toString()) })
633
+ return text(describePreviews(previewsView({ previews: list, states: [...room.awareness.getStates()] })))
634
+ })
635
+
628
636
  tool('quilt_voice_transcript', {
629
637
  description: TRANSCRIPT_DESCRIPTION,
630
638
  inputSchema: {
package/src/session.js CHANGED
@@ -53,7 +53,7 @@ import { HELD_MAP, readHeld, findHeld, settleHeld, renderHeld, versionsOf, versi
53
53
  import { RELAY_NAME as RELAY_BY, isRelay } from './ui/chat.js'
54
54
  import { cleanTyping, TYPING_MS, AGENT_TYPING_MS } from './ui/chat.js'
55
55
  import { DEFAULT_KEY, validBranchKey } from './branchdocs.js'
56
- import { cleanPreview, previewId, previewList, previewsView, branchChoices, hasDevScript, cleanLooking, cleanRunning, APP_ID, MAX_PREVIEWS } from './previews.js'
56
+ import { cleanPreview, previewId, previewList, previewsView, branchChoices, hasDevScript, cleanLooking, cleanRunning, describePreviews, APP_ID, MAX_PREVIEWS } from './previews.js'
57
57
  import { headKey, headName, branchTip, busy as gitBusy, leftoverLock, indexStamp, filesAt, blobAt, treeState, watchGit, SETTLE_MS as GIT_SETTLE_MS, STALE_LOCK_MS, upstreamOf, fetchUpstream, aheadBehind, changesBetween, fastForward, stage, hasBranch, switchBranch, defaultRemote, remoteBranch, follow, adoptRepo, originUrl } from './gitstate.js'
58
58
  import { shareableRemote, repoLabel } from './repo-ref.js'
59
59
  import { cleanVoice, cleanDmVoice, dmVoiceView, dmCallers, newCallId, voiceView, inVoice, transcribeSetting, setTranscribe, addLine, readLines, MAX_IN_CALL, CALL_FULL, callAgents, setAgentLeft, notInCall, agentSays, markCallForAgents, namedAgents, callPing, spokenReply, AGENT_REPLY_MS } from './voice.js'
@@ -4208,6 +4208,9 @@ export class Session extends EventEmitter {
4208
4208
  return previewsView({ previews: previewList(this.previewDefs.toJSON(), { hasDev: this.hasDevScript() }), states, clientID: this.doc.clientID })
4209
4209
  }
4210
4210
 
4211
+ /** quilt_previews, in words: each preview, who has it open, and what the machine runs of it. */
4212
+ previewsText () { return describePreviews(this.previews()) }
4213
+
4211
4214
  /** The branches a preview can show: main, then each ticket with a branch, by its title. */
4212
4215
  branchChoices () { return branchChoices(this.branchList, this.taskList()) }
4213
4216
 
@@ -4250,9 +4253,10 @@ export class Session extends EventEmitter {
4250
4253
  }
4251
4254
 
4252
4255
  /** The preview machine's own: what it runs, for everyone's presence ([{ preview, branch, slot, state, output }]). */
4253
- setRunning (running, machine = '') {
4256
+ setRunning (running, machine = '', domain = '') {
4254
4257
  if (!this.preview || !this.conn || !this.conn.awareness.getLocalState()) return
4255
4258
  this.conn.awareness.setLocalStateField('machine', String(machine))
4259
+ this.conn.awareness.setLocalStateField('domain', String(domain))
4256
4260
  this.conn.awareness.setLocalStateField('running', cleanRunning(running))
4257
4261
  }
4258
4262
 
@@ -47,6 +47,7 @@ export function agentGuide ({ apiUrl = 'https://api.heyquilt.com', via = 'both'
47
47
  '### Start here',
48
48
  '- `quilt_status`: who is in the codebase, what each is doing and the open tasks. Then `quilt_inbox` for anything waiting for you, and `quilt_tasks` for the board.',
49
49
  '- `quilt_project_rules`: the codebase\'s rules for AI and its design system (AGENTS.md, CLAUDE.md, Cursor rules, DESIGN.md), the same for every tool. Read them before your first change.',
50
+ '- `quilt_previews`: the codebase\'s previews (its app running on a cloud machine, and links): who has one open, each running branch\'s address, and what an app printed when it did not start.',
50
51
  `- \`quilt_share\` when you start on something (what you were asked and your plan) and again when you finish (what you did, the files you changed), so everyone can follow.${cli ? ` With the CLI, \`quilt_set_focus\` (or \`quilt focus <what>\`) sets your status line, and \`quilt_set_work\` "working" when you start (it shows you stitching on the loom) and "done" when you finish tells people when it is safe to commit.` : ''}`,
51
52
  '',
52
53
  '### Who is in a codebase',