heyquilt 0.3.154 → 0.3.156

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,26 @@ 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.156 — 2026-11-12
15
+
16
+ - **Every app you can connect.** Connections lists all 1,600+ apps Composio can connect for you, most used first, with categories, search, and Load more. Each says how you sign in: one click, or your own API key. **Add a connection** takes you to them.
17
+ - **Home, Files, People and Connections stay put.** Clicking their button again no longer jumps back to the session. To go back, pick the session in the session menu at the top.
18
+ - **Your dev server shows in Preview by itself.** Start the project's dev server in the session's folder and Preview lists it as "Your localhost:3000". Saved links (staging, production) are behind **Add a link**.
19
+ - **Tidier menus and Files.** The session menu and notifications look alike. An empty Files page says what goes there instead of showing a drop box.
20
+
21
+ ## 0.3.155 — 2026-11-12
22
+
23
+ A new look: one bar across the top instead of the sidebar, and the session's chat is the loom.
24
+
25
+ - **One bar across the top.** The workspace's name, **Home**, the session you're in (its menu lists every session and who is working in each), **Connections**, **Files**, notifications and the faces of who is working. The sidebar is gone; the rail on the left keeps your workspaces, search and settings. Home, Files, People and Connections are pages of the workspace: click the button again to go back to the session.
26
+ - **Chat is the loom.** A short card for each person at the top of their lane (what they're doing, a cube per thread, a message button with what's unread), what each AI did as cards in the lanes, and messages as lines across them. A message to you has **Reply**: answer right there, with files from your computer or the workspace. The composer says who it writes to, and **+** attaches a file or one of the workspace's files.
27
+ - **Someone's view.** Click a person's card and it becomes their view: their AI's threads as chips, what it did, and **Messages with** them, a thread only the two of you see.
28
+ - **The workspace's Home.** Its sessions with who is working in each, the links that matter (production, staging, a shared localhost) and charts of AI time and merges.
29
+ - **People, Files and ⌘K.** People shows Humans and AI as cards with search; Files shows the workspace's folders as cards; ⌘K (Ctrl+K) finds sessions, people, files and actions from anywhere.
30
+ - **Tasks, Preview and Calls.** The board's cards show who has each task and when their AI is on it; click one for its controls. **Preview** keeps the session's links beside the page itself. **Calls** lists the session's calls with who was in them and opens each transcript.
31
+ - **Connect apps for your agents.** The **Connections** button at the top connects Gmail, Slack, Notion, Linear, HubSpot and thousands more for the whole workspace (or the session, when it isn't in one). You sign in to the app in your browser; Quilt never sees the login. Every agent in that session or workspace can then use it, whatever AI tool it runs in.
32
+ - **Agents ask before they change anything.** An agent reads from a connected app at once. Before it sends, creates, changes or deletes anything there, a card in the session's chat asks a person to **Approve** or **Decline**, and an approved action runs once. Each app call is in the session's audit trail, and Connections lists what agents did.
33
+
14
34
  ## 0.3.154 — 2026-11-06
15
35
 
16
36
  - **Your sessions follow your account.** On a new computer, Home now lists the sessions you've been in that aren't on this computer yet. Click **Join here** and choose a folder, or pick the folder you already have the project in. You don't need an invite link: the session lets you back in because you're its owner or one of its members. Once you're in, the session's invite links come to this computer too. Anyone who was never in the session still needs an invite link.
package/bin/quilt.js CHANGED
@@ -221,6 +221,9 @@ async function apiCmd () {
221
221
  // Secrets: the vault (quilt-vault) and the secret it calls this API with; off when not set.
222
222
  vaultSecret: env.QUILT_VAULT_SECRET || '',
223
223
  vaultUrl: env.QUILT_VAULT_URL || 'https://vault.heyquilt.com',
224
+ // App connections: Composio's project key (plans/app-connections.md); off when not set.
225
+ composioKey: env.COMPOSIO_API_KEY || '',
226
+ ...(env.QUILT_APP_CALLS_PER_DAY ? { appCallsPerDay: Number(env.QUILT_APP_CALLS_PER_DAY) } : {}),
224
227
  // On Fly, this machine's id: with several API machines, one leads the cloud AI work (src/api/leader.js).
225
228
  machineId: env.FLY_MACHINE_ID || '',
226
229
  // Its own machines through Fly's Machines API (QUILT_API_FLY_TOKEN): more as load climbs, fewer as it drops (src/api/scaler.js).
@@ -263,6 +266,7 @@ async function apiCmd () {
263
266
  if (!env.RELAY_API_SECRET) console.log('RELAY_API_SECRET is not set: the relay cannot report sessions for the dashboard')
264
267
  if (!env.FLY_API_TOKEN || !env.AI_VM_APP || !env.AI_VM_IMAGE) console.log('FLY_API_TOKEN, AI_VM_APP or AI_VM_IMAGE is not set: people cannot connect a cloud AI')
265
268
  if (!env.QUILT_VAULT_SECRET) console.log('QUILT_VAULT_SECRET is not set: secrets are off')
269
+ if (!env.COMPOSIO_API_KEY) console.log('COMPOSIO_API_KEY is not set: app connections are off')
266
270
  if (env.FLY_MACHINE_ID && !env.QUILT_API_FLY_TOKEN) console.log('QUILT_API_FLY_TOKEN is not set: the API grows only within the machines it has')
267
271
  if (!env.CLOUDFLARE_TURN_KEY_ID || !env.CLOUDFLARE_TURN_KEY_TOKEN) console.log('CLOUDFLARE_TURN_KEY_ID or CLOUDFLARE_TURN_KEY_TOKEN is not set: calls connect directly only (STUN)')
268
272
  if (!env.CLOUDFLARE_ACCOUNT_ID || !env.CLOUDFLARE_AI_TOKEN) console.log('CLOUDFLARE_ACCOUNT_ID or CLOUDFLARE_AI_TOKEN is not set: call transcripts are off')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyquilt",
3
- "version": "0.3.154",
3
+ "version": "0.3.156",
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/api/audit.js CHANGED
@@ -36,14 +36,25 @@ export function endReasonOf (v, revokedAt) {
36
36
 
37
37
  /**
38
38
  * The trail: visits newest first, each with its actions oldest first.
39
- * `revoked` maps an agent account ('agent:<id>') to when its keys were revoked.
39
+ * `revoked` maps an agent account ('agent:<id>') to when its keys were revoked. `appCalls` (from
40
+ * the accounts API's app_calls) are what agents did in connected apps: each goes with the visit
41
+ * of whoever asked for it, as a 'tool' action ("app GMAIL_SEND_EMAIL on gmail: ran, approved by …").
40
42
  */
41
- export function auditTrail ({ visits, actions, revoked = new Map() }) {
43
+ export function auditTrail ({ visits, actions, revoked = new Map(), appCalls = [] }) {
42
44
  const byVisit = new Map()
43
45
  for (const a of actions) {
46
+ if (a.action === 'ai') continue // a minute of AI work: the workspace's AI time, not something the member did
44
47
  if (!byVisit.has(a.visitStartId)) byVisit.set(a.visitStartId, [])
45
48
  byVisit.get(a.visitStartId).push({ at: a.at, action: a.action, target: a.target || '' })
46
49
  }
50
+ for (const c of appCalls) {
51
+ const v = visits.find((x) => x.account === c.account && x.startedAt <= c.createdAt && (x.endedAt == null || x.endedAt >= c.createdAt))
52
+ if (!v) continue
53
+ if (!byVisit.has(v.eventStartId)) byVisit.set(v.eventStartId, [])
54
+ const list = byVisit.get(v.eventStartId)
55
+ list.push({ at: c.createdAt, action: 'tool', target: `app ${c.tool} on ${c.app}: ${c.state}${c.decidedByName ? `, ${c.state === 'declined' ? 'declined' : 'approved'} by ${c.decidedByName}` : ''}` })
56
+ list.sort((a, b) => a.at - b.at)
57
+ }
47
58
  return [...visits]
48
59
  .sort((a, b) => b.startedAt - a.startedAt)
49
60
  .map((v) => ({
@@ -0,0 +1,173 @@
1
+ // Composio (plans/app-connections.md): the apps agents use, through Composio's REST API with the
2
+ // project key (COMPOSIO_API_KEY), which only this API holds. Composio keeps every app's tokens;
3
+ // Quilt keeps which scope a connection belongs to and who may use it (routes/connections.js).
4
+ // Composio's own OAuth apps sign people in (Composio-managed auth): Quilt registers none.
5
+ import { HttpError } from './http.js'
6
+
7
+ export const COMPOSIO_API = 'https://backend.composio.dev/api/v3.1'
8
+ // How long the app catalog (1,700+ apps, a few pages from Composio) is kept before it's fetched again.
9
+ export const CATALOG_MS = 6 * 60 * 60 * 1000
10
+
11
+ // Composio tags each action with what it does; only reads run without a person's approval.
12
+ export const READ_TAG = 'readOnlyHint'
13
+ export const isReadOnly = (tool) => Array.isArray(tool && tool.tags) && tool.tags.includes(READ_TAG) && !tool.tags.includes('destructiveHint')
14
+
15
+ /** Composio's user id for a Quilt scope: one per team, workspace or session. */
16
+ export const composioUser = (type, id) => `quilt:${type}:${id}`
17
+
18
+ /**
19
+ * A client for one Composio project: { on, toolkits, toolkit, tools, tool, link, account, remove, execute }.
20
+ * `fetch` is injectable for tests; every call throws an HttpError with Composio's message.
21
+ */
22
+ export function composioClient ({ apiKey = '', base = COMPOSIO_API, fetch: fetchImpl = globalThis.fetch, log = () => {} } = {}) {
23
+ const at = String(base).replace(/\/+$/, '')
24
+ // Composio-managed auth config per app, made once and remembered (Composio keeps them too).
25
+ const authConfigs = new Map()
26
+
27
+ async function call (method, path, body) {
28
+ if (!apiKey) throw new HttpError(503, 'App connections are not switched on on this server yet.')
29
+ let res
30
+ try {
31
+ res = await fetchImpl(at + path, {
32
+ method,
33
+ headers: { 'x-api-key': apiKey, ...(body ? { 'content-type': 'application/json' } : {}) },
34
+ body: body ? JSON.stringify(body) : undefined,
35
+ signal: AbortSignal.timeout(60_000)
36
+ })
37
+ } catch (err) {
38
+ log(`composio ${method} ${path}: ${err.message}`)
39
+ throw new HttpError(502, 'Couldn\'t reach Composio, which connects apps. Try again in a moment.')
40
+ }
41
+ const data = await res.json().catch(() => null)
42
+ if (!res.ok) {
43
+ const msg = data && data.error && (data.error.message || data.error)
44
+ log(`composio ${method} ${path}: ${res.status} ${typeof msg === 'string' ? msg : ''}`)
45
+ throw new HttpError(res.status === 404 ? 404 : 502, `Composio: ${typeof msg === 'string' ? msg.slice(0, 300) : `answered ${res.status}`}`)
46
+ }
47
+ return data || {}
48
+ }
49
+
50
+ const q = (params) => {
51
+ const s = new URLSearchParams()
52
+ for (const [k, v] of Object.entries(params)) if (v !== undefined && v !== null && v !== '') s.set(k, String(v))
53
+ const t = s.toString()
54
+ return t ? `?${t}` : ''
55
+ }
56
+
57
+ /** An app as Quilt shows it: { slug, name, logo, managed, noAuth }. */
58
+ const appView = (t) => ({
59
+ slug: t.slug,
60
+ name: t.name || t.slug,
61
+ logo: (t.meta && t.meta.logo) || '',
62
+ description: (t.meta && t.meta.description) || '',
63
+ managed: Array.isArray(t.composio_managed_auth_schemes) && t.composio_managed_auth_schemes.length > 0,
64
+ schemes: Array.isArray(t.auth_schemes) ? t.auth_schemes : [],
65
+ noAuth: !!t.no_auth
66
+ })
67
+
68
+ /**
69
+ * An app in the catalog: appView with its categories and how one connects it (`how`: 'oneclick', Composio's own
70
+ * sign-in; 'key', the person's own API key or token; 'none', no sign-in), or how '' when it needs an OAuth app of ours.
71
+ */
72
+ const catalogView = (t) => {
73
+ const a = appView(t)
74
+ const how = a.noAuth ? 'none' : a.managed ? 'oneclick' : a.schemes.some((x) => !/^OAUTH[12]$/.test(x)) ? 'key' : ''
75
+ const categories = ((t.meta && t.meta.categories) || []).map((c) => ({ id: String(c.id || c.slug || c.name || c), name: String(c.name || c.id || c) })).filter((c) => c.id)
76
+ return { ...a, how, categories }
77
+ }
78
+
79
+ /** An action as agents see it: { slug, name, description, app, readOnly, input }. */
80
+ const toolView = (t) => ({
81
+ slug: t.slug,
82
+ name: t.name || t.slug,
83
+ description: String(t.description || '').slice(0, 1200),
84
+ app: t.toolkit && t.toolkit.slug,
85
+ readOnly: isReadOnly(t),
86
+ tags: (t.tags || []).filter((x) => /Hint$/.test(x)),
87
+ input: t.input_parameters || {}
88
+ })
89
+
90
+ /** The apps one can connect, most used first: [{ slug, name, logo, … }]. */
91
+ async function toolkits ({ search = '', limit = 60 } = {}) {
92
+ const r = await call('GET', `/toolkits${q({ search: String(search).slice(0, 100), sort_by: 'usage', limit: Math.min(200, Math.max(1, limit)) })}`)
93
+ return (r.items || []).filter((t) => !t.deprecated || !t.deprecated.is_deprecated).map(appView)
94
+ }
95
+
96
+ // The whole catalog, cached CATALOG_MS: every app that can be connected without an OAuth app of our own (one-click
97
+ // sign-in through Composio, the person's own API key or token, or none at all), most used first.
98
+ let catalogCache = { at: 0, apps: null, pending: null }
99
+ async function catalog () {
100
+ if (catalogCache.apps && Date.now() - catalogCache.at < CATALOG_MS) return catalogCache.apps
101
+ if (catalogCache.pending) return catalogCache.pending
102
+ catalogCache.pending = (async () => {
103
+ const items = []
104
+ let cursor = ''
105
+ do {
106
+ const r = await call('GET', `/toolkits${q({ sort_by: 'usage', limit: 1000, cursor })}`)
107
+ items.push(...(r.items || []))
108
+ cursor = r.next_cursor || ''
109
+ } while (cursor && items.length < 5000)
110
+ const apps = items.filter((t) => !t.deprecated || !t.deprecated.is_deprecated).map(catalogView).filter((a) => a.how && a.slug !== 'composio')
111
+ catalogCache = { at: Date.now(), apps, pending: null }
112
+ return apps
113
+ })().catch((err) => { catalogCache.pending = null; throw err })
114
+ return catalogCache.pending
115
+ }
116
+
117
+ async function toolkit (slug) {
118
+ return appView(await call('GET', `/toolkits/${encodeURIComponent(slug)}`))
119
+ }
120
+
121
+ /** An app's actions, best match first: [{ slug, name, description, readOnly, input }]. */
122
+ async function tools ({ app, query = '', limit = 20 } = {}) {
123
+ const r = await call('GET', `/tools${q({ toolkit_slug: app, query: String(query).slice(0, 200), limit: Math.min(100, Math.max(1, limit)) })}`)
124
+ return (r.items || []).filter((t) => !t.is_deprecated).map(toolView)
125
+ }
126
+
127
+ async function tool (slug) {
128
+ return toolView(await call('GET', `/tools/${encodeURIComponent(slug)}`))
129
+ }
130
+
131
+ /** The app's auth config: Composio-managed when Composio has one, else one that asks the person for their key. */
132
+ async function authConfigFor (app) {
133
+ if (authConfigs.has(app)) return authConfigs.get(app)
134
+ const found = await call('GET', `/auth_configs${q({ toolkit_slug: app, limit: 50 })}`)
135
+ const usable = (found.items || []).filter((a) => a.status !== 'DISABLED' && !a.is_disabled)
136
+ let id = (usable.find((a) => a.is_composio_managed) || usable[0])?.id
137
+ if (!id) {
138
+ const t = await toolkit(app)
139
+ if (t.noAuth) return null
140
+ const authConfig = t.managed ? { type: 'use_composio_managed_auth' } : { type: 'use_custom_auth', authScheme: t.schemes[0], credentials: {} }
141
+ if (!t.managed && !t.schemes.length) throw new HttpError(400, `${t.name} can't be connected here yet.`)
142
+ id = (await call('POST', '/auth_configs', { toolkit: { slug: app }, auth_config: authConfig })).auth_config.id
143
+ }
144
+ authConfigs.set(app, id)
145
+ return id
146
+ }
147
+
148
+ /** A Connect Link for `user` to sign in to `app`: { url, composioId, expiresAt }. */
149
+ async function link ({ user, app, callbackUrl }) {
150
+ const authConfigId = await authConfigFor(app)
151
+ if (!authConfigId) throw new HttpError(400, 'That app needs no sign-in: agents can use it without connecting it.')
152
+ const r = await call('POST', '/connected_accounts/link', { auth_config_id: authConfigId, user_id: user, callback_url: callbackUrl })
153
+ return { url: r.redirect_url, composioId: r.connected_account_id, expiresAt: r.expires_at ? Date.parse(r.expires_at) : null }
154
+ }
155
+
156
+ /** A connected account's state: { id, app, status } (status: INITIATED, ACTIVE, FAILED, EXPIRED, …). */
157
+ async function account (composioId) {
158
+ const r = await call('GET', `/connected_accounts/${encodeURIComponent(composioId)}`)
159
+ return { id: r.id, app: r.toolkit && r.toolkit.slug, status: r.status }
160
+ }
161
+
162
+ async function remove (composioId) {
163
+ try { await call('DELETE', `/connected_accounts/${encodeURIComponent(composioId)}`) } catch (err) { if (err.status !== 404) throw err }
164
+ }
165
+
166
+ /** Runs one action as `user` with that connected account: { ok, data, error }. */
167
+ async function execute ({ tool: slug, user, composioId, args }) {
168
+ const r = await call('POST', `/tools/execute/${encodeURIComponent(slug)}`, { user_id: user, ...(composioId ? { connected_account_id: composioId } : {}), arguments: args || {} })
169
+ return { ok: r.successful !== false && !r.error, data: r.data ?? null, error: r.error || null }
170
+ }
171
+
172
+ return { on: !!apiKey, toolkits, catalog, toolkit, tools, tool, link, account, remove, execute }
173
+ }
@@ -60,6 +60,9 @@ export function createMemoryStore ({ now = Date.now } = {}) {
60
60
  // Secrets (20261018000000_secrets.sql): only what the vault sealed.
61
61
  const seamLinks = new Map(); const secretRows = new Map(); const secretDataKeys = new Map(); const secretSettingsRows = new Map()
62
62
  const secretTickets = new Map(); const secretRuns = new Map(); const secretAsks = new Map(); const secretUses = []
63
+ // App connections (20261112000000_app_connections.sql).
64
+ const appConnections = new Map(); const appCalls = new Map()
65
+ const workspaceLinks = new Map() // 20261112100000_workspace_home.sql
63
66
  const scopeKey = (scopeType, scopeId) => `${scopeType}\n${scopeId}`
64
67
  // A secret as the API's routes see it: never its sealed value (secretSealed reads that, for the vault).
65
68
  const secretMeta = (r) => { if (!r) return null; const { sealedValue, ...rest } = copy(r); return rest }
@@ -577,6 +580,12 @@ export function createMemoryStore ({ now = Date.now } = {}) {
577
580
  },
578
581
  // Mirrors prune_activity.
579
582
  // What was done in a session in [from, to), oldest first, at most `limit` (actions_in_room).
583
+ async aiMinutes (rooms, since) {
584
+ return all(actions, (a) => a.action === 'ai' && rooms.includes(a.room) && a.at >= since).sort((a, b) => a.at - b.at).map((a) => ({ room: a.room, account: a.account, at: a.at }))
585
+ },
586
+ async listWorkspaceLinks (workspaceId) { return all(workspaceLinks, (l) => l.workspaceId === workspaceId).sort((a, b) => a.createdAt - b.createdAt).map(copy) },
587
+ async addWorkspaceLink (l) { const row = { id: uuid(), room: null, note: '', ...copy(l), createdAt: now() }; workspaceLinks.set(row.id, row); return copy(row) },
588
+ async deleteWorkspaceLink (workspaceId, id) { const l = workspaceLinks.get(id); if (l && l.workspaceId === workspaceId) workspaceLinks.delete(id) },
580
589
  async actionsInRoom (room, { from, to, limit }) {
581
590
  return all(actions, (a) => a.room === room && a.at >= from && a.at < to)
582
591
  .sort((a, b) => a.at - b.at).slice(0, limit).map(copy) // stable: ties keep arrival order
@@ -1282,6 +1291,44 @@ export function createMemoryStore ({ now = Date.now } = {}) {
1282
1291
  return secretUses.filter((u) => secretIds.includes(u.secretId)).sort((a, b) => b.at - a.at).slice(0, limit).map(copy)
1283
1292
  },
1284
1293
 
1294
+ // App connections (20261112000000_app_connections.sql): Composio holds the tokens.
1295
+ async addAppConnection (c) {
1296
+ if (all(appConnections, (r) => r.composioId === c.composioId).length) throw duplicate('connection')
1297
+ const row = { id: uuid(), appName: '', logo: '', status: 'pending', who: 'all', ...copy(c), createdAt: now(), updatedAt: now() }
1298
+ appConnections.set(row.id, row)
1299
+ return copy(row)
1300
+ },
1301
+ async appConnectionById (id) { return copy(appConnections.get(id)) },
1302
+ async appConnectionByComposioId (composioId) { return copy(all(appConnections, (r) => r.composioId === composioId)[0]) },
1303
+ async listAppConnections (scopeType, scopeId) { return all(appConnections, (r) => r.scopeType === scopeType && r.scopeId === scopeId).sort((a, b) => a.createdAt - b.createdAt).map(copy) },
1304
+ async updateAppConnection (id, patch) {
1305
+ const r = appConnections.get(id)
1306
+ if (!r) return null
1307
+ Object.assign(r, copy(patch), { updatedAt: now() })
1308
+ return copy(r)
1309
+ },
1310
+ async deleteAppConnection (id) {
1311
+ appConnections.delete(id)
1312
+ for (const c of appCalls.values()) if (c.connectionId === id) c.connectionId = null
1313
+ },
1314
+ async addAppCall (c) {
1315
+ const row = { id: uuid(), args: {}, readOnly: false, decidedBy: null, result: null, error: null, decidedAt: null, ranAt: null, ...copy(c), createdAt: now() }
1316
+ appCalls.set(row.id, row)
1317
+ return copy(row)
1318
+ },
1319
+ async appCallById (id) { return copy(appCalls.get(id)) },
1320
+ /** Changes a call only while it is in `from` (one of them, when a list): null when it moved on. */
1321
+ async updateAppCall (id, patch, { from = null } = {}) {
1322
+ const r = appCalls.get(id)
1323
+ if (!r || (from && ![].concat(from).includes(r.state))) return null
1324
+ Object.assign(r, copy(patch))
1325
+ return copy(r)
1326
+ },
1327
+ async listAppCalls (room, { states = null, limit = 50 } = {}) {
1328
+ return all(appCalls, (c) => c.room === room && (!states || states.includes(c.state))).sort((a, b) => b.createdAt - a.createdAt).slice(0, limit).map(copy)
1329
+ },
1330
+ async countAppCalls (capKey, since) { return all(appCalls, (c) => c.capKey === capKey && c.createdAt >= since).length },
1331
+
1285
1332
  // Test-only views (production reads the tables in the Supabase dashboard).
1286
1333
  listEvents () { return [...events.values()].map(copy) },
1287
1334
  listIssues () { return [...issues.values()].map(copy) },