heyquilt 0.3.154 → 0.3.155
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 +13 -0
- package/bin/quilt.js +4 -0
- package/package.json +1 -1
- package/src/api/audit.js +13 -2
- package/src/api/composio.js +139 -0
- package/src/api/memory-store.js +47 -0
- package/src/api/routes/connections.js +311 -0
- package/src/api/routes/sessions.js +9 -1
- package/src/api/routes/workspaces.js +43 -3
- package/src/api/server.js +14 -3
- package/src/api/supabase-store.js +43 -0
- package/src/app-tools.js +107 -0
- package/src/control.js +28 -0
- package/src/mcp.js +7 -0
- package/src/presence.js +2 -1
- package/src/relay-mcp.js +14 -0
- package/src/server.js +37 -2
- package/src/ui/agent-guide.js +4 -0
- package/src/ui/app.css +572 -2
- package/src/ui/app.js +42 -23
- package/src/ui/board.js +17 -7
- package/src/ui/common.js +2 -0
- package/src/ui/connections.js +215 -0
- package/src/ui/feed.js +23 -8
- package/src/ui/files.js +65 -20
- package/src/ui/home-view.js +170 -0
- package/src/ui/home.js +95 -6
- package/src/ui/loom-model.js +11 -8
- package/src/ui/loom.css +182 -2
- package/src/ui/loom.js +132 -55
- package/src/ui/palette.js +75 -0
- package/src/ui/people-view.js +116 -0
- package/src/ui/session.js +1026 -69
- package/src/ui/signin.js +1 -0
- package/src/ui/workspaces.js +7 -1
- package/src/ui-server.js +76 -4
package/src/ui/signin.js
CHANGED
|
@@ -18,6 +18,7 @@ function screen (inner) {
|
|
|
18
18
|
export function renderSignIn (message = '', onSignedIn = () => window.location.reload()) {
|
|
19
19
|
screen(`
|
|
20
20
|
<h1>Sign in to Quilt</h1>
|
|
21
|
+
<p class="signin-lead">Your sessions, files and agents, in one place. Signing in opens heyquilt.com in your browser, where you approve this computer.</p>
|
|
21
22
|
${message ? `<p class="signin-note">${esc(message)}</p>` : ''}
|
|
22
23
|
<button class="btn primary signin-btn" id="signin-go">Sign in</button>
|
|
23
24
|
<p class="hint">New to Quilt? <a href="${SIGNUP}" target="_blank" rel="noopener">Create an account</a></p>
|
package/src/ui/workspaces.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// (Sessions, Files, People & agents, Settings). Sessions stay in session.js; the file library
|
|
3
3
|
// (the Files section, All files and uploads) is files.js.
|
|
4
4
|
import { mountSecrets } from './secrets.js'
|
|
5
|
+
import { mountConnections } from './connections.js'
|
|
5
6
|
import { I, state, $, esc, basename, toast, api, ask, avatar, colorFor, ago, bytes, COLORS, loadingHtml } from './common.js'
|
|
6
7
|
import { filesSectionHtml, bindFilesSection } from './files.js'
|
|
7
8
|
import { memberMiniHtml, memberMenuItems, openAgentMenu } from './agent-place.js'
|
|
@@ -277,6 +278,7 @@ export function workspacePageHtml () {
|
|
|
277
278
|
</section>
|
|
278
279
|
${filesSectionHtml(d)}
|
|
279
280
|
${state.secretsOn ? '<section class="sec ws-secrets" data-ws-secrets></section>' : ''}
|
|
281
|
+
${state.connectionsOn ? '<section class="sec ws-connections"><h3>Connections</h3><div data-ws-connections></div></section>' : ''}
|
|
280
282
|
</div>
|
|
281
283
|
</div>
|
|
282
284
|
</div>`
|
|
@@ -367,7 +369,8 @@ export function bindWorkspacePage (root, { go, rerender, newSessionDialog, invit
|
|
|
367
369
|
if (!d || d.workspace.id !== String(state.view).slice(3)) return
|
|
368
370
|
const id = d.workspace.id
|
|
369
371
|
const reload = async () => { await openWorkspace(id); await loadWorkspaces(); rerender() }
|
|
370
|
-
root.querySelector('[data-ws-back]')
|
|
372
|
+
const back = root.querySelector('[data-ws-back]')
|
|
373
|
+
if (back) back.onclick = (e) => { e.preventDefault(); go('home') }
|
|
371
374
|
root.querySelectorAll('[data-go]').forEach((b) => { b.onclick = () => go(b.dataset.go) })
|
|
372
375
|
root.querySelector('[data-new-session-in]')?.addEventListener('click', () => newSessionDialog(id))
|
|
373
376
|
root.querySelector('[data-invite-ws]')?.addEventListener('click', () => inviteDialog(id))
|
|
@@ -378,6 +381,9 @@ export function bindWorkspacePage (root, { go, rerender, newSessionDialog, invit
|
|
|
378
381
|
// Secrets: the workspace's, with its team's above (secrets.js); .env files come from its sessions on this computer.
|
|
379
382
|
const sec = root.querySelector('[data-ws-secrets]')
|
|
380
383
|
if (sec) mountSecrets(sec, { type: 'workspace', id, importFrom: { workspaceId: id } })
|
|
384
|
+
// Apps every session in the workspace can use (connections.js).
|
|
385
|
+
const conns = root.querySelector('[data-ws-connections]')
|
|
386
|
+
if (conns) mountConnections(conns, { type: 'workspace', id })
|
|
381
387
|
}
|
|
382
388
|
|
|
383
389
|
/** "1.2 GB of 5.0 GB used · 34 files", from the workspace's usage; nothing without one. */
|
package/src/ui-server.js
CHANGED
|
@@ -32,7 +32,7 @@ import { currentVersion, localReleases, latestRelease, compareVersions, download
|
|
|
32
32
|
import { createReporter } from './report.js'
|
|
33
33
|
import { queryHistory } from './history.js'
|
|
34
34
|
import { contentDisposition } from './api/file-paths.js'
|
|
35
|
-
import { getSecrets, putSecretSettings, setSecretWho, deleteSecret, secretUses, saveSecrets, secretAsks, answerAsk } from './secrets-client.js'
|
|
35
|
+
import { apiCall, getSecrets, putSecretSettings, setSecretWho, deleteSecret, secretUses, saveSecrets, secretAsks, answerAsk } from './secrets-client.js'
|
|
36
36
|
import { envFilesIn, knownEnvFile, envValues } from './secret-import.js'
|
|
37
37
|
import { appWorkspaces } from './app-workspaces.js'
|
|
38
38
|
import { guessTool } from './tool-guess.js'
|
|
@@ -215,6 +215,10 @@ export const STATIC = {
|
|
|
215
215
|
'/sandbox-keys-model.js': ['sandbox-keys-model.js', 'text/javascript; charset=utf-8'],
|
|
216
216
|
'/secrets.js': ['secrets.js', 'text/javascript; charset=utf-8'],
|
|
217
217
|
'/secrets-view.js': ['secrets-view.js', 'text/javascript; charset=utf-8'],
|
|
218
|
+
'/connections.js': ['connections.js', 'text/javascript; charset=utf-8'],
|
|
219
|
+
'/home-view.js': ['home-view.js', 'text/javascript; charset=utf-8'],
|
|
220
|
+
'/people-view.js': ['people-view.js', 'text/javascript; charset=utf-8'],
|
|
221
|
+
'/palette.js': ['palette.js', 'text/javascript; charset=utf-8'],
|
|
218
222
|
'/secret-rules.js': ['secret-rules.js', 'text/javascript; charset=utf-8'],
|
|
219
223
|
'/voice.js': ['voice.js', 'text/javascript; charset=utf-8'],
|
|
220
224
|
'/voice-model.js': ['voice-model.js', 'text/javascript; charset=utf-8'],
|
|
@@ -233,6 +237,8 @@ const CSP = [
|
|
|
233
237
|
"style-src 'self' 'unsafe-inline'",
|
|
234
238
|
"img-src 'self' data: https: https://www.google.com https://*.gstatic.com",
|
|
235
239
|
"font-src 'self'",
|
|
240
|
+
// The Preview tab shows the session's links (a dev server, staging, production) in a sandboxed frame.
|
|
241
|
+
"frame-src http: https:",
|
|
236
242
|
"connect-src 'self'",
|
|
237
243
|
"object-src 'none'",
|
|
238
244
|
"base-uri 'none'",
|
|
@@ -949,6 +955,27 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
|
|
|
949
955
|
throw httpError(404, 'not found')
|
|
950
956
|
})
|
|
951
957
|
}
|
|
958
|
+
// App connections (src/ui/connections.js): through the accounts API, which holds Composio's key.
|
|
959
|
+
async function connectionsRoute (method, url, body) {
|
|
960
|
+
const p = url.pathname
|
|
961
|
+
const enc = (v) => encodeURIComponent(String(v))
|
|
962
|
+
return asAccount(async (token) => {
|
|
963
|
+
const c = secretsApi(token)
|
|
964
|
+
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')}`)
|
|
965
|
+
const sc = p.match(/^\/api\/connections\/(org|workspace|session)\/([^/]+)(?:\/([0-9a-f-]{36}))?$/i)
|
|
966
|
+
if (sc && SECRET_SCOPE_ID[sc[1]].test(decodeURIComponent(sc[2]))) {
|
|
967
|
+
const base = `/v1/connections/${sc[1]}/${enc(decodeURIComponent(sc[2]))}`
|
|
968
|
+
if (!sc[3] && method === 'GET') return apiCall(c, 'GET', base)
|
|
969
|
+
if (!sc[3] && method === 'POST') return apiCall(c, 'POST', base, { app: String(body.app || ''), ...(body.who ? { who: String(body.who) } : {}) })
|
|
970
|
+
if (sc[3] && method === 'PATCH') return apiCall(c, 'PATCH', `${base}/${sc[3]}`, { who: String(body.who || '') })
|
|
971
|
+
if (sc[3] && method === 'DELETE') return apiCall(c, 'DELETE', `${base}/${sc[3]}`)
|
|
972
|
+
}
|
|
973
|
+
const calls = p.match(/^\/api\/app-calls\/([A-Za-z0-9_-]{1,64})(?:\/([0-9a-f-]{36}))?$/i)
|
|
974
|
+
if (calls && !calls[2] && method === 'GET') return apiCall(c, 'GET', `/v1/sessions/${enc(calls[1])}/app-calls${url.searchParams.get('waiting') === '1' ? '?waiting=1' : ''}`)
|
|
975
|
+
if (calls && calls[2] && method === 'POST') return apiCall(c, 'POST', `/v1/sessions/${enc(calls[1])}/app-calls/${calls[2]}`, { allow: body.allow === true }, 90_000)
|
|
976
|
+
throw httpError(404, 'not found')
|
|
977
|
+
})
|
|
978
|
+
}
|
|
952
979
|
/** The folders whose .env files a card may import: one session's, or a workspace's sessions' on this computer. */
|
|
953
980
|
const envDirs = (b) => {
|
|
954
981
|
if (b && b.sessionId) { const r = runs.get(String(b.sessionId)); return r ? [r.run.dir] : [] }
|
|
@@ -963,8 +990,8 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
|
|
|
963
990
|
try {
|
|
964
991
|
const res = await fetch(`${apiUrl()}/v1/features`, { signal: AbortSignal.timeout(5000) })
|
|
965
992
|
const f = res.ok ? await res.json() : {}
|
|
966
|
-
return { secrets: !!f.secrets, workspaces: !!f.workspaces && appWorkspaces() }
|
|
967
|
-
} catch { return { secrets: false, workspaces: false } }
|
|
993
|
+
return { secrets: !!f.secrets, connections: !!f.connections, workspaces: !!f.workspaces && appWorkspaces() }
|
|
994
|
+
} catch { return { secrets: false, connections: false, workspaces: false } }
|
|
968
995
|
},
|
|
969
996
|
'POST /api/secrets/env-scan': (b) => {
|
|
970
997
|
const dirs = envDirs(b)
|
|
@@ -1003,6 +1030,22 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
|
|
|
1003
1030
|
'GET /api/orgs': () => asAccount(async (token) => ({ orgs: await listOrgs({ token }) })),
|
|
1004
1031
|
'POST /api/workspaces': (b) => asAccount(async (token) => ({ workspace: await createWorkspace({ token, name: String(b.name || ''), description: String(b.description || ''), color: String(b.color || ''), org: b.org ? String(b.org) : undefined }) })),
|
|
1005
1032
|
'GET /api/workspaces/:id': (b, id) => asAccount(async (token) => ({ ...(await getWorkspace({ token, id: needWorkspaceId(id) })), ...ofWorkspace(id) })),
|
|
1033
|
+
// The workspace's home (plans/app-redesign.md): AI time from the accounts API, merges onto main from Seam for
|
|
1034
|
+
// the workspace's sessions open on this computer, and its links (previews).
|
|
1035
|
+
'GET /api/workspaces/:id/insights': (b, id) => asAccount(async (token) => {
|
|
1036
|
+
const wid = needWorkspaceId(id)
|
|
1037
|
+
const ai = await apiCall({ api: apiUrl(), token }, 'GET', `/v1/workspaces/${encodeURIComponent(wid)}/insights?days=14`)
|
|
1038
|
+
const since = Date.now() - 14 * 24 * 60 * 60 * 1000
|
|
1039
|
+
const merges = []
|
|
1040
|
+
for (const [key, r] of runs) {
|
|
1041
|
+
const sm = summary(key)
|
|
1042
|
+
if (!sm || sm.workspace !== wid || !r.run.session.seamMerges) continue
|
|
1043
|
+
try { for (const at of await r.run.session.seamMerges({ since })) merges.push({ room: r.run.session.room, at }) } catch {} // one session's Seam not answering leaves its merges out
|
|
1044
|
+
}
|
|
1045
|
+
return { ...ai, merges }
|
|
1046
|
+
}),
|
|
1047
|
+
'POST /api/workspaces/:id/links': (b, id) => asAccount((token) => apiCall({ api: apiUrl(), token }, 'POST', `/v1/workspaces/${encodeURIComponent(needWorkspaceId(id))}/links`, { name: String(b.name || ''), url: String(b.url || ''), room: b.room ? String(b.room) : null, note: String(b.note || '') })),
|
|
1048
|
+
'POST /api/workspaces/:id/links/:lid/remove': (b, id, url, lid) => asAccount(async (token) => { await apiCall({ api: apiUrl(), token }, 'DELETE', `/v1/workspaces/${encodeURIComponent(needWorkspaceId(id))}/links/${encodeURIComponent(String(lid))}`); return { ok: true } }),
|
|
1006
1049
|
'POST /api/workspaces/:id/update': (b, id) => asAccount(async (token) => ({ workspace: await updateWorkspace({ token, id: needWorkspaceId(id), patch: { name: b.name, description: b.description, color: b.color, archived: b.archived } }) })),
|
|
1007
1050
|
'POST /api/workspaces/:id/delete': (b, id) => asAccount(async (token) => { await deleteWorkspace({ token, id: needWorkspaceId(id) }); return { ok: true } }),
|
|
1008
1051
|
'POST /api/workspaces/:id/members': (b, id) => asAccount(async (token) => ({ member: await putWorkspaceMember({ token, id: needWorkspaceId(id), account: String(b.account || ''), access: String(b.access || ''), sessions: b.sessions === undefined ? undefined : String(b.sessions) }) })),
|
|
@@ -1095,6 +1138,12 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
|
|
|
1095
1138
|
'POST /api/sessions/:id/focus': (b, id) => { get(id).setFocus(b.text); return { ok: true } },
|
|
1096
1139
|
// Voice (voice.js): the call as this app sees it, and our part in it, from the app window, which does the audio.
|
|
1097
1140
|
'GET /api/sessions/:id/voice': (b, id) => get(id).voice(),
|
|
1141
|
+
// The Calls tab (dm06): the session's calls from their transcripts, newest first, each with its opening lines.
|
|
1142
|
+
'GET /api/sessions/:id/calls': (b, id) => {
|
|
1143
|
+
const { lines, calls } = get(id).voiceTranscript({ limit: 1000 })
|
|
1144
|
+
return { calls: calls.reverse().slice(0, 50).map((c) => ({ ...c, opening: lines.filter((l) => l.call === c.call).slice(0, 3).map((l) => ({ by: l.by, text: l.text })) })) }
|
|
1145
|
+
},
|
|
1146
|
+
'GET /api/sessions/:id/calls/:call': (b, id, url, call) => ({ lines: get(id).voiceTranscript({ call, limit: 1000 }).lines }),
|
|
1098
1147
|
'POST /api/sessions/:id/voice': (b, id) => get(id).setVoice(b.in === false ? null : { muted: b.muted === true, sig: b.sig, transcribing: b.transcribing === true, sharing: b.sharing === true, agents: b.agents === true }),
|
|
1099
1148
|
'POST /api/sessions/:id/voice/transcribe': (b, id) => get(id).setVoiceTranscribe(b.on === true),
|
|
1100
1149
|
'POST /api/sessions/:id/voice/clip': (b, id) => voiceClip(get(id), b),
|
|
@@ -1166,6 +1215,8 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
|
|
|
1166
1215
|
'GET /api/sessions/:id/search': (b, id, url) => get(id).quiltSearch(String(url.searchParams.get('q') || '')),
|
|
1167
1216
|
// In a session that moved into Seam: the square panel's Commit and Merge onto main, as this member (control.js seamTool).
|
|
1168
1217
|
'POST /api/sessions/:id/seam': (b, id) => squareTool(get(id), b),
|
|
1218
|
+
'GET /api/sessions/:id/github': (b, id) => seamGithub(get(id), {}),
|
|
1219
|
+
'POST /api/sessions/:id/github': (b, id) => seamGithub(get(id), b),
|
|
1169
1220
|
'GET /api/sessions/:id/file': (b, id, url) => {
|
|
1170
1221
|
const f = get(id).readShared(url.searchParams.get('path'))
|
|
1171
1222
|
if (!f) throw httpError(404, 'That file is not in this session.')
|
|
@@ -1329,6 +1380,13 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
|
|
|
1329
1380
|
return json(404, { error: 'not found' })
|
|
1330
1381
|
}
|
|
1331
1382
|
|
|
1383
|
+
// App connections: /api/connections/…, and an app call waiting for a person (/api/app-calls/<room>[/<id>]).
|
|
1384
|
+
if (url.pathname.startsWith('/api/connections/') || url.pathname.startsWith('/api/app-calls/')) {
|
|
1385
|
+
let raw = ''
|
|
1386
|
+
for await (const chunk of req) raw += chunk
|
|
1387
|
+
return json(200, await connectionsRoute(req.method, url, raw ? JSON.parse(raw) : {}))
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1332
1390
|
let pathKey = url.pathname
|
|
1333
1391
|
.replace(/^\/api\/sessions\/[a-f0-9]+/, '/api/sessions/:id')
|
|
1334
1392
|
.replace(/^\/api\/workspaces\/[^/]+/, '/api/workspaces/:id')
|
|
@@ -1344,6 +1402,12 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
|
|
|
1344
1402
|
// A workspace's invite, the same way.
|
|
1345
1403
|
const iid = (url.pathname.match(/^\/api\/workspaces\/[^/]+\/invites\/([^/]+)\//) || [])[1]
|
|
1346
1404
|
if (iid) pathKey = pathKey.replace(/^(\/api\/workspaces\/:id\/invites)\/[^/]+/, '$1/:iid')
|
|
1405
|
+
// A workspace's link (a preview), the same way.
|
|
1406
|
+
const lid = (url.pathname.match(/^\/api\/workspaces\/[^/]+\/links\/([^/]+)\//) || [])[1]
|
|
1407
|
+
if (lid) pathKey = pathKey.replace(/^(\/api\/workspaces\/:id\/links)\/[^/]+/, '$1/:lid')
|
|
1408
|
+
// A call's transcript (the Calls tab), by the call's id.
|
|
1409
|
+
const cid = (url.pathname.match(/^\/api\/sessions\/[a-f0-9]+\/calls\/([^/]+)$/) || [])[1]
|
|
1410
|
+
if (cid) pathKey = pathKey.replace(/^(\/api\/sessions\/:id\/calls)\/[^/]+$/, '$1/:call')
|
|
1347
1411
|
const key = `${req.method} ${pathKey}`
|
|
1348
1412
|
const handler = api[key]
|
|
1349
1413
|
if (!handler) {
|
|
@@ -1355,7 +1419,7 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
|
|
|
1355
1419
|
const body = raw ? JSON.parse(raw) : {}
|
|
1356
1420
|
const startedAt = Date.now()
|
|
1357
1421
|
try {
|
|
1358
|
-
const out = await handler(body, sid, url, fid || aid || iid)
|
|
1422
|
+
const out = await handler(body, sid, url, fid || aid || iid || lid || (cid && decodeURIComponent(cid)))
|
|
1359
1423
|
// A reply that streams (an agent's speech): straight through as it comes.
|
|
1360
1424
|
if (out && out[STREAMED]) {
|
|
1361
1425
|
res.writeHead(200, { 'content-type': out.type, 'cache-control': 'no-store' })
|
|
@@ -1577,6 +1641,14 @@ export function underJoinDir (joinDir, name, message = INVALID_INVITE) {
|
|
|
1577
1641
|
* commits first), as this member through Seam's own tools; or open_square, for a folder whose branch has
|
|
1578
1642
|
* none (Session.openSquareHere). The answer as { text }, a refusal as a 400.
|
|
1579
1643
|
*/
|
|
1644
|
+
/** Session settings' GitHub card: Seam's GitHub (the Seam app's installations, and the quilt's export to a repository). */
|
|
1645
|
+
async function seamGithub (s, b) {
|
|
1646
|
+
if (!s.seamGithub) return { quilt: false }
|
|
1647
|
+
const repo = b && typeof b.repo === 'string' ? b.repo.trim() : ''
|
|
1648
|
+
if (repo && !(/^[\w.-]+\/[\w.-]+$/.test(repo) && /^\d+$/.test(String(b.installation || '')))) throw httpError(400, 'Pick a repository the Seam app reaches.')
|
|
1649
|
+
try { return await s.seamGithub(repo ? { repo, installation: String(b.installation) } : b && b.disconnect ? { disconnect: true } : {}) } catch (err) { throw httpError(err.status || 502, err.message) }
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1580
1652
|
export async function squareTool (s, b) {
|
|
1581
1653
|
const tool = String((b && b.tool) || '')
|
|
1582
1654
|
if (tool === 'open_square') {
|