heyquilt 0.3.182 → 0.3.183

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.
Files changed (122) hide show
  1. package/README.md +101 -97
  2. package/RELEASES.md +8 -0
  3. package/bin/quilt.js +32 -32
  4. package/desktop/main.js +1 -1
  5. package/package.json +1 -1
  6. package/src/account.js +2 -2
  7. package/src/admit-policy.js +2 -2
  8. package/src/agent-join.js +3 -3
  9. package/src/agent-task-workflow.js +14 -14
  10. package/src/ai-vm.js +1 -1
  11. package/src/api/agent-placement.js +2 -2
  12. package/src/api/audit.js +1 -1
  13. package/src/api/file-paths.js +1 -1
  14. package/src/api/file-store.js +1 -1
  15. package/src/api/invite-email.js +4 -4
  16. package/src/api/join-text.js +5 -5
  17. package/src/api/notify.js +7 -7
  18. package/src/api/permissions.js +1 -1
  19. package/src/api/routes/agent-wake.js +1 -1
  20. package/src/api/routes/agents.js +2 -2
  21. package/src/api/routes/ai-vm.js +5 -5
  22. package/src/api/routes/connections.js +13 -13
  23. package/src/api/routes/grants.js +2 -2
  24. package/src/api/routes/mail.js +10 -10
  25. package/src/api/routes/relay.js +1 -1
  26. package/src/api/routes/secrets.js +11 -11
  27. package/src/api/routes/session-invites.js +5 -5
  28. package/src/api/routes/sessions.js +3 -3
  29. package/src/api/routes/workspace-agents.js +14 -14
  30. package/src/api/routes/workspace-files.js +12 -12
  31. package/src/api/routes/workspace-invites.js +5 -5
  32. package/src/api/routes/workspaces.js +11 -11
  33. package/src/api/secrets-access.js +1 -1
  34. package/src/api/server.js +3 -3
  35. package/src/api/team-access.js +1 -1
  36. package/src/api/workspace-access.js +1 -1
  37. package/src/api/workspace-reach.js +3 -3
  38. package/src/app-tools.js +10 -10
  39. package/src/autowork.js +4 -4
  40. package/src/branch-view.js +1 -1
  41. package/src/catchup.js +5 -5
  42. package/src/chat-links.js +18 -18
  43. package/src/connection.js +11 -11
  44. package/src/control.js +5 -5
  45. package/src/conversation.js +1 -1
  46. package/src/doctor.js +2 -2
  47. package/src/duties.js +1 -1
  48. package/src/fsutil.js +1 -1
  49. package/src/held.js +4 -4
  50. package/src/hooks.js +3 -3
  51. package/src/hosted-client.js +2 -2
  52. package/src/identity.js +1 -1
  53. package/src/inbox.js +1 -1
  54. package/src/key-cli.js +1 -1
  55. package/src/mail-tools.js +11 -11
  56. package/src/mcp-proxy.js +1 -1
  57. package/src/mcp.js +59 -59
  58. package/src/new-session.js +6 -6
  59. package/src/project-rules.js +2 -2
  60. package/src/relay-ask.js +2 -2
  61. package/src/relay-cluster.js +3 -3
  62. package/src/relay-live-write.js +3 -3
  63. package/src/relay-mcp.js +56 -56
  64. package/src/relay-prune.js +1 -1
  65. package/src/relay-turn-sync.js +1 -1
  66. package/src/secret-import.js +1 -1
  67. package/src/secret-names.js +6 -6
  68. package/src/secret-run.js +3 -3
  69. package/src/server.js +41 -41
  70. package/src/session-access.js +3 -3
  71. package/src/session-name.js +1 -1
  72. package/src/session.js +50 -50
  73. package/src/setup.js +7 -7
  74. package/src/status.js +2 -2
  75. package/src/tasks.js +1 -1
  76. package/src/turn-sync.js +4 -4
  77. package/src/ui/account-sessions.js +2 -2
  78. package/src/ui/agent-env-key.js +1 -1
  79. package/src/ui/agent-guide.js +35 -35
  80. package/src/ui/agent-kinds.js +8 -8
  81. package/src/ui/agent-place.js +16 -16
  82. package/src/ui/agents-table.js +6 -6
  83. package/src/ui/app.css +331 -0
  84. package/src/ui/app.js +28 -13
  85. package/src/ui/board.js +2 -2
  86. package/src/ui/catchup.js +5 -5
  87. package/src/ui/changes-seen.js +2 -2
  88. package/src/ui/changes.js +3 -3
  89. package/src/ui/cloud-ai.js +12 -12
  90. package/src/ui/common.js +1 -1
  91. package/src/ui/connections.js +1 -1
  92. package/src/ui/diffview.js +2 -2
  93. package/src/ui/feed.js +1 -1
  94. package/src/ui/feedback.js +4 -4
  95. package/src/ui/files.js +120 -14
  96. package/src/ui/fileview.js +3 -3
  97. package/src/ui/git-rule.js +3 -3
  98. package/src/ui/home.js +92 -47
  99. package/src/ui/index.html +1 -1
  100. package/src/ui/invite.js +8 -8
  101. package/src/ui/invites.js +3 -3
  102. package/src/ui/new-session.js +3 -3
  103. package/src/ui/prail-model.js +22 -0
  104. package/src/ui/prail.js +43 -0
  105. package/src/ui/project-board.js +359 -0
  106. package/src/ui/project-model.js +197 -0
  107. package/src/ui/project-pop.js +451 -0
  108. package/src/ui/projects.js +406 -0
  109. package/src/ui/sandbox-keys.js +3 -3
  110. package/src/ui/secrets-view.js +5 -5
  111. package/src/ui/session-words.js +2 -2
  112. package/src/ui/session.js +156 -43
  113. package/src/ui/tree.js +3 -3
  114. package/src/ui/voice.js +6 -6
  115. package/src/ui/workspaces.js +23 -23
  116. package/src/ui-server.js +78 -24
  117. package/src/update-check.js +2 -2
  118. package/src/voice.js +7 -7
  119. package/src/wake-tool.js +1 -1
  120. package/src/webhooks.js +1 -1
  121. package/src/workspace-cli.js +12 -12
  122. package/src/workspace-tools.js +33 -33
@@ -31,13 +31,13 @@ function named ({ source, repo, name }) {
31
31
  return r
32
32
  }
33
33
  const clean = String(name || '').replace(/\s+/g, ' ').trim().slice(0, MAX_NAME)
34
- if (!clean || !folderName(clean)) throw fail('Give the project a name.')
34
+ if (!clean || !folderName(clean)) throw fail('Give the codebase a name.')
35
35
  return { name: clean }
36
36
  }
37
37
 
38
38
  /** The folder a new session's project would go in when the person names none: under `base` (their folder for sessions). */
39
39
  export function whereFor ({ source, repo, name, base }) {
40
- if (source !== 'github' && source !== 'scratch') throw fail('Choose where the project comes from.')
40
+ if (source !== 'github' && source !== 'scratch') throw fail('Choose where the codebase comes from.')
41
41
  const n = named({ source, repo, name })
42
42
  return freeUnder(base, source === 'github' ? n.name : folderName(n.name))
43
43
  }
@@ -48,9 +48,9 @@ export function whereFor ({ source, repo, name, base }) {
48
48
  * whether it is there at all (`exists`). Throws with what to fix.
49
49
  */
50
50
  export function lookAt ({ source = 'folder', dir = '', repo = '', name = '', base }) {
51
- if (!SOURCES.includes(source)) throw fail('Choose where the project comes from.')
51
+ if (!SOURCES.includes(source)) throw fail('Choose where the codebase comes from.')
52
52
  if (source === 'folder') {
53
- if (!dir) throw fail('Choose a project folder.')
53
+ if (!dir) throw fail('Choose a folder.')
54
54
  let st = null
55
55
  try { st = fs.statSync(dir) } catch {}
56
56
  if (st && !st.isDirectory()) throw fail(`${dir} is a file, not a folder.`)
@@ -68,9 +68,9 @@ export function lookAt ({ source = 'folder', dir = '', repo = '', name = '', bas
68
68
  * be removed again if the session can't start. Throws with what to tell the person.
69
69
  */
70
70
  export async function prepareFolder ({ source = 'folder', dir = '', repo = '', name = '', brief = '', base, who = null }) {
71
- if (!SOURCES.includes(source)) throw fail('Choose where the project comes from.')
71
+ if (!SOURCES.includes(source)) throw fail('Choose where the codebase comes from.')
72
72
  if (source === 'folder') {
73
- if (!dir) throw fail('Choose a project folder.')
73
+ if (!dir) throw fail('Choose a folder.')
74
74
  let st = null
75
75
  try { st = fs.statSync(dir) } catch {}
76
76
  if (st && !st.isDirectory()) throw fail(`${dir} is a file, not a folder.`)
@@ -86,9 +86,9 @@ const depth = (p) => p.split('/').length
86
86
  /** The rules as one text for an agent. */
87
87
  export function renderRules (r) {
88
88
  if (!r.files.length && !r.design && !r.scoped.length) {
89
- return 'This project has no rules for AI yet (no AGENTS.md, CLAUDE.md or Cursor rules) and no design system file. Follow the code around what you change.'
89
+ return 'This codebase has no rules for AI yet (no AGENTS.md, CLAUDE.md or Cursor rules) and no design system file. Follow the code around what you change.'
90
90
  }
91
- const out = ['The project\'s rules for AI, the same for every tool. Folder AGENTS.md files apply to the files under that folder.', '']
91
+ const out = ['The codebase\'s rules for AI, the same for every tool. Folder AGENTS.md files apply to the files under that folder.', '']
92
92
  for (const f of r.files) out.push(`## ${f.path}`, '', f.text, '')
93
93
  if (r.scoped.length) {
94
94
  out.push('## Rules for some files only (Cursor)', '')
package/src/relay-ask.js CHANGED
@@ -55,7 +55,7 @@ function membersAnswer (room) {
55
55
  for (const h of room.hostedOnline()) people.add(h.name)
56
56
  const total = Object.keys(room.meta.members || {}).length + 1 // members, and the owner
57
57
  const names = [...people].sort()
58
- if (!names.length) return `Nobody is connected right now (${plural(total, 'member')} in the session).`
58
+ if (!names.length) return `Nobody is connected right now (${plural(total, 'member')} in the codebase).`
59
59
  return `${plural(names.length, 'member')} connected of ${total}: ${list(names)}.`
60
60
  }
61
61
 
@@ -86,7 +86,7 @@ export function unusedBranches (room, now = Date.now()) {
86
86
 
87
87
  /** Branch names that are never trimmed for being merged: the trunk itself, whatever the session calls its default. */
88
88
  function trimAnswer (room, asker, now) {
89
- if (!asker.mayTrim) return 'Only the session owner can trim branches.'
89
+ if (!asker.mayTrim) return 'Only the codebase\'s owner can trim branches.'
90
90
  const gone = unusedBranches(room, now)
91
91
  if (!gone.length) return 'Nothing to trim: every branch is in use or was used in the last day.'
92
92
  for (const k of gone) room.removeBranch(k, { save: false })
@@ -26,9 +26,9 @@ const ROOM_RE = /^[A-Za-z0-9_-]{1,64}$/
26
26
  const MACHINE_RE = /^[A-Za-z0-9_-]{1,64}$/
27
27
  // Files in the data folder that look like rooms (`<name>.json`) and aren't.
28
28
  export const NOT_ROOMS = new Set(['agent-links', 'hosted-agents', 'leases'])
29
- export const MOVING = 'This session is moving to another relay machine; try again in a moment'
30
- export const ELSEWHERE = 'This session lives on another relay machine; try again in a moment'
31
- export const NO_PLACEMENT = "The relay can't find which machine holds this session right now; try again in a moment"
29
+ export const MOVING = 'This codebase is moving to another relay machine; try again in a moment'
30
+ export const ELSEWHERE = 'This codebase lives on another relay machine; try again in a moment'
31
+ export const NO_PLACEMENT = "The relay can't find which machine holds this codebase right now; try again in a moment"
32
32
 
33
33
  /** Cluster settings, from options or the environment (Fly sets FLY_MACHINE_ID, FLY_REGION, FLY_APP_NAME). */
34
34
  export function clusterConfig (opts = {}, env = process.env) {
@@ -66,10 +66,10 @@ export function liveWrite (room, ws, req, { origin = WRITE_ORIGIN, now = Date.no
66
66
  const e = k === ws.branch ? room.store.get(k) : null
67
67
  if (!e) throw new Error(`you are not on ${key}`)
68
68
  const a = room.access.get(ws)
69
- if (!a || (a.state && a.state !== 'approved')) throw new Error('not in this session')
70
- if (a.role === 'viewer') throw new Error('You can only view this session; file changes are refused.')
69
+ if (!a || (a.state && a.state !== 'approved')) throw new Error('not in this codebase')
70
+ if (a.role === 'viewer') throw new Error('You can only view this codebase; file changes are refused.')
71
71
  const rel = String(req.path ?? '').trim().replace(/^\.\//, '')
72
- if (!isSafeRelPath(rel)) throw new Error('That is not a path inside the project.')
72
+ if (!isSafeRelPath(rel)) throw new Error('That is not a path inside the codebase.')
73
73
  if (typeof req.text !== 'string' || req.text.length > MAX_WRITE_TEXT) throw new Error('a live write is a text of at most 2 MiB')
74
74
  // What the relay would refuse or treat apart from a plain edit goes the old way: the folder edits the
75
75
  // text as before and the relay's checks (checkChange, read-only branches, size limits) apply as ever.
package/src/relay-mcp.js CHANGED
@@ -65,7 +65,7 @@ const AGENT = 'agent-mcp' // transaction origin
65
65
  const COLUMN_IDS_LIST = COLUMNS.map((c) => c.id)
66
66
 
67
67
  export const INSTRUCTIONS =
68
- 'You are in a live quilt session: other people, each with their own AI, are editing this same project right now, ' +
68
+ 'You are in a live quilt codebase: other people, each with their own AI, are editing it right now, ' +
69
69
  'and their changes appear in your files as they happen. ' +
70
70
  'When your user asks for something, call quilt_share with their request and a short plan before you start, and call it ' +
71
71
  'again with a short summary when you finish, so collaborators can follow along. ' +
@@ -76,33 +76,33 @@ export const INSTRUCTIONS =
76
76
  TASK_WORKFLOW
77
77
 
78
78
  export const HOSTED_INSTRUCTIONS =
79
- 'You are an AI agent in Quilt, where people and agents build one project together in real time. ' +
80
- 'Join a session with quilt_join_session and the invite link you were given; the session owner may have to let you in first ' +
79
+ 'You are an AI agent in Quilt, where people and agents build one codebase together in real time. ' +
80
+ 'Join a codebase with quilt_join_session and the invite link you were given; the codebase\'s owner may have to let you in first ' +
81
81
  '(quilt_session_info tells you). Then: quilt_status to see who is doing what, quilt_list_files and quilt_read_file to look ' +
82
82
  'around, quilt_write_file to change a file (read it right before, and give the version quilt_read_file ends with as base), quilt_share to ' +
83
83
  'tell everyone what you are doing, and quilt_message to talk. The shared task board is quilt_tasks, quilt_add_task, quilt_assign_task and quilt_move_task; quilt_task reads one in full with its comments, and quilt_comment_task leaves a work note or handoff on it. ' +
84
84
  'quilt_history tells you who changed which file, when, with the diff: read it for the files you are about to touch. ' +
85
- 'Nobody holds files: no write is refused because someone else is working on a file. Your write merges with what others changed elsewhere in it; if it clashes with someone\'s on the same lines, Quilt holds your lines and tells you: resolve it at once with quilt_resolve_merge. A conflict must not sit: until you resolve your own, moving a task to QA or Done is refused, and a conflict whose writer\'s AI is gone is handed to another AI in the session, which is woken for it. ' +
85
+ 'Nobody holds files: no write is refused because someone else is working on a file. Your write merges with what others changed elsewhere in it; if it clashes with someone\'s on the same lines, Quilt holds your lines and tells you: resolve it at once with quilt_resolve_merge. A conflict must not sit: until you resolve your own, moving a task to QA or Done is refused, and a conflict whose writer\'s AI is gone is handed to another AI in the codebase, which is woken for it. ' +
86
86
  'Read what people said about a file before you change it: quilt_read_messages, and each write tells you what was said about that file. ' +
87
87
  'This rule is enforced for agents: while someone who messaged or mentioned you waits for an answer, writes and task changes are refused until you answer with quilt_message. ' +
88
88
  PERSON_CHAT + ' ' +
89
89
  'Everyone sees your changes on their own disk within moments. ' +
90
90
  'Chat: ' + CHAT_RULES.replace(/^Send a chat message\. /, '') + ' A message that needs nothing back is settled with quilt_inbox (no_reply: [its id]), not answered. ' +
91
91
  'Mentions of you (@yourname), direct messages and tasks handed to you wait in quilt_inbox, each with the conversation before it with its sender; when a message refers to something earlier you do not have, read back with quilt_conversation before you answer, never guess. ' +
92
- WAKE_STEP + ' The ways for an agent over HTTP: a webhook (Quilt POSTs each event to your URL, from every session you are in; for a workspace agent, session.started too), email, a schedule, or your turns. ' +
93
- 'You can be in several sessions at once (quilt_join_session each): every tool then takes session: <id> (quilt_session_info lists them; a webhook event or inbox entry says which session it is from), and a call that names none is refused, so an answer never lands in the wrong session. ' +
92
+ WAKE_STEP + ' The ways for an agent over HTTP: a webhook (Quilt POSTs each event to your URL, from every codebase you are in; for a project\'s agent, session.started too), email, a schedule, or your turns. ' +
93
+ 'You can be in several codebases at once (quilt_join_session each): every tool then takes session: <id> (quilt_session_info lists them; a webhook event or inbox entry says which codebase it is from), and a call that names none is refused, so an answer never lands in the wrong codebase. ' +
94
94
  'You are connected over HTTP, so you show as online for 30 minutes after each tool call; while idle, people reach you in the way you chose with quilt_wake. ' +
95
95
  'HTTP is only for an agent with no computer. If you can run shell commands anywhere (a computer, a cloud machine, a sandbox), you must use the Quilt CLI there instead (`quilt agent join`, then `quilt join <invite> --agent <your name>`): files sync to disk and you show as live. ' +
96
- 'A session has a branch for each branch its members work on, each with its own files: your first call on files puts you on the busiest one. ' +
96
+ 'A codebase has a branch for each branch its members work on, each with its own files: your first call on files puts you on the busiest one. ' +
97
97
  MAIL_GUIDE + ' ' +
98
98
  APPS_GUIDE + ' ' +
99
99
  TASK_WORKFLOW
100
100
 
101
- const NOT_LINKED = 'Your user is not in a quilt session in their browser right now. Ask them to open quilt in their ' +
102
- 'browser and share a folder or join one from an invite link, then try again. (This link is theirs and works for every session.)'
101
+ const NOT_LINKED = 'Your user is not in a quilt codebase in their browser right now. Ask them to open quilt in their ' +
102
+ 'browser and share a folder or join one from an invite link, then try again. (This link is theirs and works for every codebase.)'
103
103
  const NOT_JOINED = 'You are not in a session. Call quilt_join_session with an invite link (https://join.heyquilt.com/<room>#<secret>).'
104
104
  // Every hosted tool takes `session`: which of the agent's sessions it is about (an agent can be in several at once).
105
- const SESSION_ARG = z.string().min(1).max(64).optional().describe('Which of your sessions this is about (the session id from quilt_session_info, or the `session` in a webhook event or inbox entry). Needed when you are in more than one.')
105
+ const SESSION_ARG = z.string().min(1).max(64).optional().describe('Which of your codebases this is about (its id from quilt_session_info, or the `session` in a webhook event or inbox entry). Needed when you are in more than one.')
106
106
  const WAITING = 'The session owner has not let you in yet. They see you on their list; call quilt_session_info to check again.'
107
107
  const DENIED = 'The session owner did not let you in. Ask them for a new invite and call quilt_join_session again.'
108
108
  const REMOVED = 'You are no longer in that session. Ask for a new invite and call quilt_join_session again.'
@@ -226,9 +226,9 @@ function sessionTools (server, ctx) {
226
226
  }, ({ image }) => text(ctx.updates.describe(image || (ctx.image ? ctx.image() : undefined))))
227
227
  }
228
228
  const me = ctx.me
229
- const writable = (room) => room.full ? 'This session is over its size limit, so nothing new can be saved.' : null
229
+ const writable = (room) => room.full ? 'This codebase is over its size limit, so nothing new can be saved.' : null
230
230
  // A branch over its own size limit takes no new files; the rest of the session carries on.
231
- const branchWritable = (room, branch) => branch && room.branchFull && room.branchFull(branch.key) ? `${branch.key} is over the session's size limit for one branch, so nothing new can be saved on it. Other branches still take changes. Start a fresh copy with \`git checkout -b <new name>\`: your changes since are kept in your folder.` : null
231
+ const branchWritable = (room, branch) => branch && room.branchFull && room.branchFull(branch.key) ? `${branch.key} is over the codebase's size limit for one branch, so nothing new can be saved on it. Other branches still take changes. Start a fresh copy with \`git checkout -b <new name>\`: your changes since are kept in your folder.` : null
232
232
  // Which branch a file answer is about, when the session has more than one.
233
233
  const onBranchNote = (room, branch) => branch && room.meta && Object.keys(room.meta.branches || {}).length > 1 ? ` on ${branch.key}` : ''
234
234
  const visible = (m) => m && m.id && (!m.to || m.to === me || m.by === me)
@@ -293,15 +293,15 @@ function sessionTools (server, ctx) {
293
293
  })
294
294
 
295
295
  tool('quilt_status', {
296
- description: 'See who else is in the live session, what they and their AIs are doing, recent file changes and recent messages. Call this before starting a task.',
296
+ description: 'See who else is in the live codebase, what they and their AIs are doing, recent file changes and recent messages. Call this before starting a task.',
297
297
  inputSchema: {}
298
298
  }, (_, { room, doc, chat, activity }) => {
299
299
  const a = ctx.access(room)
300
- const lines = [`You are ${me} in a live quilt session (room ${room.name}).`]
301
- if (a && a.role === 'viewer') lines.push('You may only view this session: reading and chat work, file changes are refused.')
300
+ const lines = [`You are ${me} in a live quilt codebase (room ${room.name}).`]
301
+ if (a && a.role === 'viewer') lines.push('You may only view this codebase: reading and chat work, file changes are refused.')
302
302
  else if (a && a.scopes && a.scopes.length) lines.push(`You may change files only in: ${a.scopes.join(', ')}.`)
303
303
  if (a && a.scopesExcept && a.scopesExcept.length && a.role !== 'viewer') lines.push(`You may not change files in: ${a.scopesExcept.join(', ')}.`)
304
- if (a && a.talk === false) lines.push("You may not post in this session: quilt_message and quilt_share are refused.")
304
+ if (a && a.talk === false) lines.push("You may not post in this codebase: quilt_message and quilt_share are refused.")
305
305
  lines.push('', '## People online')
306
306
  const ps = peers(room)
307
307
  if (!ps.length) lines.push('- Nobody else right now.')
@@ -357,13 +357,13 @@ function sessionTools (server, ctx) {
357
357
  }, ({ path: p, id: ref0, how }, { room, doc, fdoc, branch, files }) => {
358
358
  const map = doc.getMap(HELD_MAP)
359
359
  const ref = ref0 || cleanPath(p)
360
- if (!ref) return text(readHeld(map).filter((r) => r.state === 'open').map(describeHeld).join('\n\n') || 'There are no open held conflicts in this session.')
360
+ if (!ref) return text(readHeld(map).filter((r) => r.state === 'open').map(describeHeld).join('\n\n') || 'There are no open held conflicts in this codebase.')
361
361
  const rec = findHeld(map, ref)
362
362
  if (!rec) return fail(`There is no held conflict for ${ref}.`)
363
363
  if (!how) return text(describeHeld(rec))
364
364
  if (rec.state === 'resolved') return text(`${rec.path} (id ${rec.id}) was already resolved${rec.resolvedBy ? ` by ${rec.resolvedBy}` : ''}${rec.how ? ` ("${rec.how}")` : ''}. Nothing changed.`)
365
365
  const a = ctx.access(room)
366
- if (a && a.role === 'viewer') return fail('You can only view this session; resolving a conflict is refused.')
366
+ if (a && a.role === 'viewer') return fail('You can only view this codebase; resolving a conflict is refused.')
367
367
  // "mine": this agent's own held version, else the one asked first; "edited" with a held version of its
368
368
  // own: that write is what it wrote, so it goes in.
369
369
  const own = versionBy(rec, me, readerId(room))
@@ -402,8 +402,8 @@ function sessionTools (server, ctx) {
402
402
  inputSchema: {
403
403
  title: z.string().describe('What needs doing, in a few words'),
404
404
  assignee: z.string().optional().describe('Who should do it: a person\'s name, or "me". Omit to leave it unassigned.'),
405
- to_ai: z.boolean().optional().describe('Assign it to that person\'s AI instead of the person. You are an agent in this session: leave to_ai unset to assign a task to yourself.'),
406
- files: z.array(z.string()).max(20).optional().describe('Project files this task is about, relative paths such as src/app.js')
405
+ to_ai: z.boolean().optional().describe('Assign it to that person\'s AI instead of the person. You are an agent in this codebase: leave to_ai unset to assign a task to yourself.'),
406
+ files: z.array(z.string()).max(20).optional().describe('Files in the codebase this task is about, relative paths such as src/app.js')
407
407
  }
408
408
  }, ({ title, assignee, to_ai, files }, { room, doc }) => {
409
409
  { const w = waitRefusal(doc, 'quilt_add_task', room); if (w) return fail(w) }
@@ -434,7 +434,7 @@ function sessionTools (server, ctx) {
434
434
  return projectRules({ list, read: (p) => got.get(p) ?? null })
435
435
  }
436
436
  tool('quilt_move_task', {
437
- description: 'Move a task on the shared board. "doing" when you start it: you get a briefing (its files, recent changes to them, the project\'s checks). ' +
437
+ description: 'Move a task on the shared board. "doing" when you start it: you get a briefing (its files, recent changes to them, the codebase\'s checks). ' +
438
438
  '"qa" when you finish implementing and testing: requires `qaNotes` (what changed and how you self-validated); without it the move is refused. ' +
439
439
  '"done" after QA: requires `verified`, what you ran and what you saw; without it the move is refused.',
440
440
  inputSchema: {
@@ -551,7 +551,7 @@ function sessionTools (server, ctx) {
551
551
  inputSchema: {
552
552
  request: z.string().max(2000).optional().describe('What your user asked for, in a sentence (only when starting a new request)'),
553
553
  summary: z.string().max(4000).describe('Your plan, progress or result, in one to three sentences'),
554
- files: z.array(z.string().max(300)).max(30).optional().describe('Project files you changed, relative paths')
554
+ files: z.array(z.string().max(300)).max(30).optional().describe('Files you changed in the codebase, relative paths')
555
555
  }
556
556
  }, ({ request, summary, files: changed }, { room, doc, feed }) => {
557
557
  const err = writable(room)
@@ -575,7 +575,7 @@ function sessionTools (server, ctx) {
575
575
  feed.forEach((e, i) => { if (e && e.by === me) mine.push(i) })
576
576
  for (let k = mine.length - FEED_CAP - 1; k >= 0; k--) feed.delete(mine[k], 1)
577
577
  }, AGENT)
578
- return text(`Shared with the session.${ctx.warn(room)}`)
578
+ return text(`Shared with the codebase.${ctx.warn(room)}`)
579
579
  })
580
580
 
581
581
  tool('quilt_partner_feed', {
@@ -642,7 +642,7 @@ function sessionTools (server, ctx) {
642
642
  }, (args, { room, doc }) => {
643
643
  if (ctx.kind === 'human') return fail('People join calls in the Quilt app.')
644
644
  const call = liveCallOf(room.awareness)
645
- if (!call) return fail('There is no call going on in this session.')
645
+ if (!call) return fail('There is no call going on in this codebase.')
646
646
  setAgentLeft(doc, { call, name: me, leave: args.leave === true })
647
647
  if (args.leave === true) return text('You left the call. Come back with quilt_voice_join.')
648
648
  const why = notInCall(doc, { call, name: me, members: room.memberList ? room.memberList() : [] })
@@ -676,8 +676,8 @@ function sessionTools (server, ctx) {
676
676
  if (ctx.webhook) {
677
677
  // The agent's one webhook, for every session it is in (and its workspaces): no session needed to set it.
678
678
  server.registerTool('quilt_webhook_subscribe', {
679
- description: 'Be told as it happens, by an HTTP POST to a URL of yours, when you are mentioned in chat (@yourname), sent a direct message or handed a task, in any session you are in: ' +
680
- 'no need to poll quilt_inbox. One webhook per agent, for every session (calling again replaces it); for a workspace agent it also gets session.started from its workspaces. Each POST is JSON that names its session and workspace (answer with that session in `session`), signed with the secret ' +
679
+ description: 'Be told as it happens, by an HTTP POST to a URL of yours, when you are mentioned in chat (@yourname), sent a direct message or handed a task, in any codebase you are in: ' +
680
+ 'no need to poll quilt_inbox. One webhook per agent, for every codebase (calling again replaces it); for a project\'s agent it also gets session.started from its projects. Each POST is JSON that names its codebase and project (answer with that codebase in `session`), signed with the secret ' +
681
681
  '(x-quilt-signature: sha256=HMAC-SHA256(secret, "<x-quilt-timestamp>.<body>")); answer 2xx. Give a secret of your own or get one back (shown once).',
682
682
  inputSchema: {
683
683
  url: z.string().min(1).max(2000).describe('The https URL to POST to (a webhook trigger of your routine, for example)'),
@@ -712,7 +712,7 @@ function sessionTools (server, ctx) {
712
712
  inputSchema: {
713
713
  text: z.string().min(1).max(4000),
714
714
  to: z.string().optional().describe('Name of one person, for a direct message'),
715
- everyone: z.boolean().optional().describe('Only for a real announcement to the whole session: lets a message that @mentions nobody go out'),
715
+ everyone: z.boolean().optional().describe('Only for a real announcement to everyone in the codebase: lets a message that @mentions nobody go out'),
716
716
  re: z.string().max(40).optional().describe(RE_HELP),
717
717
  also: z.boolean().optional().describe('Only when their message was already answered and yours is about something different they need')
718
718
  }
@@ -736,7 +736,7 @@ function sessionTools (server, ctx) {
736
736
  })
737
737
 
738
738
  tool('quilt_read_messages', {
739
- description: 'Read recent chat messages in the session (including direct messages to you).',
739
+ description: 'Read recent chat messages in the codebase (including direct messages to you).',
740
740
  inputSchema: { limit: z.number().int().min(1).max(100).optional() }
741
741
  }, ({ limit }, { chat }) => {
742
742
  const msgs = chat.toArray().filter(visible).slice(-(limit || 20))
@@ -744,7 +744,7 @@ function sessionTools (server, ctx) {
744
744
  })
745
745
 
746
746
  tool('quilt_list_files', {
747
- description: 'List the shared project files.',
747
+ description: 'List the codebase\'s shared files.',
748
748
  inputSchema: { under: z.string().optional().describe('Only files under this folder') }
749
749
  }, async ({ under }, { room, files, blobs, branch }) => {
750
750
  const pre = under ? cleanPath(under).replace(/\/+$/, '') + '/' : ''
@@ -756,18 +756,18 @@ function sessionTools (server, ctx) {
756
756
  })
757
757
 
758
758
  tool('quilt_project_rules', {
759
- description: 'The project\'s rules for AI and its design system, the same whatever tool you run in: AGENTS.md (root and folders, else CLAUDE.md), Cursor rules that always apply, and DESIGN.md (or the file AGENTS.md names). Read it before your first change in a session.',
759
+ description: 'The codebase\'s rules for AI and its design system, the same whatever tool you run in: AGENTS.md (root and folders, else CLAUDE.md), Cursor rules that always apply, and DESIGN.md (or the file AGENTS.md names). Read it before your first change in a codebase.',
760
760
  inputSchema: {}
761
761
  }, async (args, { room, files, branch }) => {
762
762
  try { return text(renderRules(await rulesFor(room, branch, files))) } catch (err) { return fail(err.message) }
763
763
  })
764
764
 
765
765
  tool('quilt_read_file', {
766
- description: 'Read a shared project file as text, as it is right now. The answer ends with the version you read: give it to quilt_write_file as `base`, so your write is merged with whatever others changed since.',
766
+ description: 'Read one of the codebase\'s shared files as text, as it is right now. The answer ends with the version you read: give it to quilt_write_file as `base`, so your write is merged with whatever others changed since.',
767
767
  inputSchema: { path: z.string().min(1).max(500).describe('Relative path, e.g. src/app.ts') }
768
768
  }, async ({ path: p }, { room, files, blobs, branch }) => {
769
769
  const rel = cleanPath(p)
770
- if (!isSafeRelPath(rel)) return fail('That is not a path inside the project.')
770
+ if (!isSafeRelPath(rel)) return fail('That is not a path inside the codebase.')
771
771
  // What this agent read is its next write's base (read-bases.js): the version goes in a block of its own, never in the file's text.
772
772
  const shown = (s) => {
773
773
  const version = readBasesOf(room).note(readerId(room), branch ? branch.key : '', rel, s)
@@ -781,18 +781,18 @@ function sessionTools (server, ctx) {
781
781
  if (r.kind === 'text') return shown(r.text)
782
782
  if (r.kind === 'stored') return fail(`${rel} is a large file kept in storage (${r.blob.size} bytes); it can't be read here.`)
783
783
  if (r.kind === 'binary') return fail(`${rel} is a binary file (${r.buf.length} bytes); it can't be read as text.`)
784
- return fail(`There is no file called ${rel} in the session.`)
784
+ return fail(`There is no file called ${rel} in the codebase.`)
785
785
  }
786
786
  const t = files.get(rel)
787
787
  if (t) return shown(t.toString())
788
788
  const b = blobs.get(rel)
789
789
  if (b && b.stored) return fail(`${rel} is a large file kept in storage (${b.size} bytes); it can't be read here.`)
790
790
  if (b) return fail(`${rel} is a binary file (${Buffer.from(b.data || '', 'base64').length} bytes); it can't be read as text.`)
791
- return fail(`There is no file called ${rel} in the session.`)
791
+ return fail(`There is no file called ${rel} in the codebase.`)
792
792
  })
793
793
 
794
794
  tool('quilt_write_file', {
795
- description: 'Write a text file in the shared project (new or existing): everyone gets it on their disk within moments. ' +
795
+ description: 'Write a text file in the shared codebase (new or existing): everyone gets it on their disk within moments. ' +
796
796
  'Give the whole file and, as base, the version quilt_read_file gave you: your write is merged against what you read, so changes others made since, anywhere in the file, survive. ' +
797
797
  'Without base it is merged against the version you last read; a version Quilt no longer has is merged against the oldest one it has. Where someone changed the same lines first, the file keeps theirs and your lines are held for you to resolve (quilt_resolve_merge).',
798
798
  inputSchema: {
@@ -805,9 +805,9 @@ function sessionTools (server, ctx) {
805
805
  const err = writable(room) || branchWritable(room, branch)
806
806
  if (err) return fail(err)
807
807
  let rel = cleanPath(p)
808
- if (!isSafeRelPath(rel)) return fail('That is not a path inside the project.')
808
+ if (!isSafeRelPath(rel)) return fail('That is not a path inside the codebase.')
809
809
  const a = ctx.access(room)
810
- if (a && a.role === 'viewer') return fail('You can only view this session; file changes are refused.')
810
+ if (a && a.role === 'viewer') return fail('You can only view this codebase; file changes are refused.')
811
811
  // Every write is a live write (live-merge.js): merged against what this agent read, with the ways a clash is caught.
812
812
  const notices = []
813
813
  const rules = liveRules(room, files, notices, { folder: false })
@@ -871,7 +871,7 @@ function sessionTools (server, ctx) {
871
871
  if (known.from === 'unknown') notes.push(`Quilt no longer has the version ${version ? `you gave as base (${String(version).slice(0, 12)})` : 'you last read'}, so your write was merged against ${typeof known.text === 'string' && known.text !== cur ? 'the oldest version it still has' : 'the file as it is'}. Read the file again before your next write, and give its version as base.`)
872
872
  if (next !== content && !(merged && merged.held.length)) notes.push(`Others had changed ${rel} since you read it: their changes are kept alongside yours, so the file is not exactly what you wrote. Read it again before your next write.`)
873
873
  notes.push(...notices)
874
- return text(`${existed ? 'Updated' : 'Created'} ${rel}${onBranchNote(room, branch)}${detail ? ` (${detail} lines)` : ' (no change)'}. Everyone in the session has it now. (Version ${version2}: your next write's base.)${notes.length ? `\n\n${notes.join('\n\n')}` : ''}${context ? `\n\n${context}` : ''}`)
874
+ return text(`${existed ? 'Updated' : 'Created'} ${rel}${onBranchNote(room, branch)}${detail ? ` (${detail} lines)` : ' (no change)'}. Everyone in the codebase has it now. (Version ${version2}: your next write's base.)${notes.length ? `\n\n${notes.join('\n\n')}` : ''}${context ? `\n\n${context}` : ''}`)
875
875
  })
876
876
 
877
877
  // `quilt sync` (npx heyquilt sync): a sandboxed agent's folder in one shot, its sync state kept
@@ -882,7 +882,7 @@ function sessionTools (server, ctx) {
882
882
  inputSchema: {
883
883
  step: z.enum(['plan', 'push', 'pull', 'done']).describe('plan, then push, pull and done'),
884
884
  slot: z.string().min(8).max(64).describe('The slot in your QUILT_AGENT_KEY'),
885
- branch: z.string().max(200).optional().describe('plan: the folder\'s git branch; used when the session has it'),
885
+ branch: z.string().max(200).optional().describe('plan: the folder\'s git branch; used when the codebase has it'),
886
886
  files: z.record(z.string(), z.union([z.string(), z.object({ text: z.string().optional(), base64: z.string().optional(), deleted: z.boolean().optional(), mtime: z.number().optional() })])).optional().describe('plan and done: { path: sha1 }; push: { path: { text, mtime } | { base64, mtime } | { deleted: true } } (mtime: when the folder last changed it, ms)'),
887
887
  paths: z.array(z.string().max(1024)).max(10000).optional().describe('pull: the paths to fetch')
888
888
  }
@@ -919,7 +919,7 @@ function sessionTools (server, ctx) {
919
919
  origin: AGENT,
920
920
  globalRefusal: () => waitRefusal(doc, 'quilt_sync', room) || writable(room) || branchWritable(room, branch),
921
921
  pathRefusal: (rel) => {
922
- if (a && a.role === 'viewer') return { kind: 'aside', why: 'you can only view this session' }
922
+ if (a && a.role === 'viewer') return { kind: 'aside', why: 'you can only view this codebase' }
923
923
  const scope = a && changeRefusal(a, rel)
924
924
  if (scope) return { kind: 'aside', why: scope }
925
925
  return null // nobody holds files: only access keeps a write out
@@ -941,8 +941,8 @@ function sessionTools (server, ctx) {
941
941
  }
942
942
  }
943
943
 
944
- const SYNC_DESCRIPTION = 'For `quilt sync` (npx heyquilt sync), which syncs a sandboxed agent\'s folder with the session in one go: run that command rather than calling this yourself. ' +
945
- 'Steps: plan (the folder\'s files and their sha1s: what to upload, pull, remove and keep aside), push (their contents), pull (the session\'s versions), done (the folder\'s files after writing: the relay keeps them as this slot\'s checkpoint). Answers are JSON.'
944
+ const SYNC_DESCRIPTION = 'For `quilt sync` (npx heyquilt sync), which syncs a sandboxed agent\'s folder with the codebase in one go: run that command rather than calling this yourself. ' +
945
+ 'Steps: plan (the folder\'s files and their sha1s: what to upload, pull, remove and keep aside), push (their contents), pull (the codebase\'s versions), done (the folder\'s files after writing: the relay keeps them as this slot\'s checkpoint). Answers are JSON.'
946
946
 
947
947
  // The workspace library for hosted agents (see workspace-tools.js), offered only while the
948
948
  // accounts API says workspaces are on.
@@ -1099,17 +1099,17 @@ export async function handleHostedMcp ({ req, res, pass, relay, workspaces = nul
1099
1099
  if (one) res.setHeader('x-quilt-room', one); else res.removeHeader('x-quilt-room')
1100
1100
  }
1101
1101
  tellRoom()
1102
- const listSessions = (rooms) => `You are in ${rooms.length} sessions (${rooms.join(', ')}): say which this is about with session: <id>.`
1102
+ const listSessions = (rooms) => `You are in ${rooms.length} codebases (${rooms.join(', ')}): say which this is about with session: <id>.`
1103
1103
  /** The agent's record for the session a call names (or its only one), or why there is none. */
1104
1104
  const pick = (session) => {
1105
1105
  const h = relay.hosted.get(account)
1106
1106
  const rooms = allRooms(h)
1107
1107
  if (!rooms.length) return { error: NOT_JOINED }
1108
1108
  const name = session ? String(session).trim() : ''
1109
- if (name && elsewhere(h, name)) return { error: `Session ${name} is on another relay machine; call again with session: ${name} in a moment.` }
1109
+ if (name && elsewhere(h, name)) return { error: `Codebase ${name} is on another relay machine; call again with session: ${name} in a moment.` }
1110
1110
  if (name && !hostedIn(h, name)) return { error: `You are not in session ${name}. ${rooms.length === 1 ? `You are in ${rooms[0]}.` : listSessions(rooms)}` }
1111
1111
  if (!name && rooms.length > 1) return { error: listSessions(rooms) }
1112
- if (!name && elsewhere(h, rooms[0])) return { error: `Session ${rooms[0]} is on another relay machine; call again with session: ${rooms[0]}.` }
1112
+ if (!name && elsewhere(h, rooms[0])) return { error: `Codebase ${rooms[0]} is on another relay machine; call again with session: ${rooms[0]}.` }
1113
1113
  return { h, name: name || rooms[0] }
1114
1114
  }
1115
1115
  /** Forgets one session (ended, removed, denied); the entry, with its webhook, stays. */
@@ -1196,8 +1196,8 @@ export async function handleHostedMcp ({ req, res, pass, relay, workspaces = nul
1196
1196
  if (!workspaces || pass.kind !== 'agent') return ''
1197
1197
  try {
1198
1198
  await hostedWorkspaceAccess(workspaces).call('PUT', '/v1/agents/me/webhook', { url: sub.url, secret: sub.secret })
1199
- return 'Your workspaces send session.started there too (a session starting in a workspace that invites you, with its join link).'
1200
- } catch (e) { return `Your workspaces could not be told (${e.message}); session.started events will not reach it until quilt_webhook_subscribe succeeds.` }
1199
+ return 'Your projects send session.started there too (a codebase starting in a project that invites you, with its join link).'
1200
+ } catch (e) { return `Your projects could not be told (${e.message}); session.started events will not reach it until quilt_webhook_subscribe succeeds.` }
1201
1201
  },
1202
1202
  test: () => relay.webhooks.test(account, { to: me }),
1203
1203
  unsubscribe: async () => {
@@ -1216,7 +1216,7 @@ export async function handleHostedMcp ({ req, res, pass, relay, workspaces = nul
1216
1216
  }
1217
1217
 
1218
1218
  mcp.registerTool('quilt_join_session', {
1219
- description: 'Join a live quilt session from an invite link (https://join.heyquilt.com/<room>#<secret>). The session owner may have to let you in; call quilt_session_info to see when they have.',
1219
+ description: 'Join a live quilt codebase from an invite link (https://join.heyquilt.com/<room>#<secret>). The codebase\'s owner may have to let you in; call quilt_session_info to see when they have.',
1220
1220
  inputSchema: { invite: z.string().min(1).max(600).describe('The invite link, or the full "quilt join <link>" command') }
1221
1221
  }, ({ invite }) => {
1222
1222
  let inv
@@ -1225,7 +1225,7 @@ export async function handleHostedMcp ({ req, res, pass, relay, workspaces = nul
1225
1225
  const room = relay.getRoom(inv.room)
1226
1226
  if (!room) return fail(relay.refused(inv.room)[1])
1227
1227
  touched.add(room)
1228
- if (!room.exists) return fail("That session isn't running on the relay (yet). Ask the person who invited you to start it, then try again.")
1228
+ if (!room.exists) return fail("That codebase isn't running on the relay (yet). Ask the person who invited you to start it, then try again.")
1229
1229
  const auth = room.authorize(inv.secret, '')
1230
1230
  if (auth !== 'editor' && auth !== 'viewer') return fail('Wrong room secret: copy the whole invite link, including the part after #.')
1231
1231
  const a = room.hostedRequest(pass, auth)
@@ -1241,7 +1241,7 @@ export async function handleHostedMcp ({ req, res, pass, relay, workspaces = nul
1241
1241
  noteIndex({ add: inv.room })
1242
1242
  tellRoom(inv.room)
1243
1243
  const all = allRooms(h)
1244
- const also = all.length > 1 ? ` You are in ${all.length} sessions now (${all.join(', ')}): name this one with session: ${inv.room} in your calls.` : ''
1244
+ const also = all.length > 1 ? ` You are in ${all.length} codebases now (${all.join(', ')}): name this one with session: ${inv.room} in your calls.` : ''
1245
1245
  if (a.state === 'pending') return text(`Asked to join room ${inv.room} as ${auth === 'viewer' ? 'a viewer' : 'an editor'}. ${WAITING}${also}`)
1246
1246
  room.hostedActive(account)
1247
1247
  visitStart(room, a)
@@ -1249,7 +1249,7 @@ export async function handleHostedMcp ({ req, res, pass, relay, workspaces = nul
1249
1249
  })
1250
1250
 
1251
1251
  mcp.registerTool('quilt_session_info', {
1252
- description: 'The sessions you are in (their ids, for `session` in every other tool) and your access in each: waiting for the owner, or let in as an editor or viewer. With session, just that one.',
1252
+ description: 'The codebases you are in (their ids, for `session` in every other tool) and your access in each: waiting for the owner, or let in as an editor or viewer. With session, just that one.',
1253
1253
  inputSchema: { session: SESSION_ARG }
1254
1254
  }, ({ session } = {}) => {
1255
1255
  const h = relay.hosted.get(account)
@@ -1265,18 +1265,18 @@ export async function handleHostedMcp ({ req, res, pass, relay, workspaces = nul
1265
1265
  if (c.error) { lines.push(`Room ${name}: ${c.error}`); continue }
1266
1266
  const a = c.access
1267
1267
  const room = c.room
1268
- lines.push(`Room ${name}${room.meta.name ? ` (${room.meta.name})` : ''}${room.meta.workspace ? `, workspace ${room.meta.workspace}` : ''}: you are ${me}, ${a.owner ? 'the owner' : a.role === 'viewer' ? 'a viewer (no file changes)' : 'an editor'}${a.scopes && a.scopes.length ? `, limited to ${a.scopes.join(', ')}` : ''}${a.scopesExcept && a.scopesExcept.length ? `, not in ${a.scopesExcept.join(', ')}` : ''}${a.talk === false ? ', and you may not post' : ''}.`)
1268
+ lines.push(`Room ${name}${room.meta.name ? ` (${room.meta.name})` : ''}${room.meta.workspace ? `, project ${room.meta.workspace}` : ''}: you are ${me}, ${a.owner ? 'the owner' : a.role === 'viewer' ? 'a viewer (no file changes)' : 'an editor'}${a.scopes && a.scopes.length ? `, limited to ${a.scopes.join(', ')}` : ''}${a.scopesExcept && a.scopesExcept.length ? `, not in ${a.scopesExcept.join(', ')}` : ''}${a.talk === false ? ', and you may not post' : ''}.`)
1269
1269
  }
1270
- if (rooms.length > 1) lines.push('Name the session in every call (session: <id>); a webhook event or inbox entry says which it is from.')
1270
+ if (rooms.length > 1) lines.push('Name the codebase in every call (session: <id>); a webhook event or inbox entry says which it is from.')
1271
1271
  return text(lines.join('\n'))
1272
1272
  })
1273
1273
 
1274
1274
  mcp.registerTool('quilt_leave_session', {
1275
- description: 'Leave a session you are in (the others, and your webhook, stay).',
1275
+ description: 'Leave a codebase you are in (the others, and your webhook, stay).',
1276
1276
  inputSchema: { session: SESSION_ARG }
1277
1277
  }, ({ session }) => {
1278
1278
  const p = pick(session)
1279
- if (p.error) return p.error === NOT_JOINED ? text('You are not in a session.') : fail(p.error)
1279
+ if (p.error) return p.error === NOT_JOINED ? text('You are not in a codebase.') : fail(p.error)
1280
1280
  const { h, name } = p
1281
1281
  visitEnd(name, 'left')
1282
1282
  delete h.rooms[name]
@@ -1335,7 +1335,7 @@ export async function handleHostedMcp ({ req, res, pass, relay, workspaces = nul
1335
1335
  mcp.registerTool(name, { description: MAIL_DESCRIPTIONS[name], inputSchema: { ...MAIL_INPUTS[name], session: SESSION_ARG } }, async ({ session, ...args }) => {
1336
1336
  const c = current(session)
1337
1337
  if (c.error) return fail(c.error)
1338
- if (!secrets) return fail('Email for sessions is not switched on on this server yet.')
1338
+ if (!secrets) return fail('Email for codebases is not switched on on this server yet.')
1339
1339
  try {
1340
1340
  return text(await runMailTool(name, args, { call: hostedWorkspaceAccess(secrets).call, room: c.room.name, me }))
1341
1341
  } catch (e) { return fail(e.message) }
@@ -50,7 +50,7 @@ export function pruneNotice ({ merged = [], inactive = [], archived = [] }) {
50
50
  if (merged.length) parts.push(`${names(merged)} ${merged.length === 1 ? 'was' : 'were'} merged`)
51
51
  if (inactive.length) parts.push(`${names(inactive)} had no work for 7 days${archived.length ? ` (the relay keeps ${archived.length === 1 ? 'its' : 'their'} unsaved changes for 30 days)` : ''}`)
52
52
  if (!parts.length) return ''
53
- return `Removed from the session to save room: ${parts.join('; ')}. Checking a branch out again brings it back.`
53
+ return `Removed from the codebase to save room: ${parts.join('; ')}. Checking a branch out again brings it back.`
54
54
  }
55
55
 
56
56
  export { RELAY_BY }
@@ -396,7 +396,7 @@ function took (rel, c, r, out) {
396
396
  */
397
397
  function combine (rel, c, now, base, ctx, out, { id = null, after = '' } = {}) {
398
398
  const by = editorOf(rel, ctx) // before our write makes us the last editor
399
- const who = by || 'the session'
399
+ const who = by || 'the codebase'
400
400
  const me = ctx.me
401
401
  const tail = after ? ` ${after}` : ''
402
402
  if (c.gone) {
@@ -40,7 +40,7 @@ export function envFilesIn (dirs) {
40
40
  /** One of `files` (from envFilesIn) by its path, or an error: nothing else is ever read or deleted. */
41
41
  export function knownEnvFile (files, file) {
42
42
  const f = files.find((x) => x.path === String(file || ''))
43
- if (!f) throw Object.assign(new Error('That .env file is not in this session\'s folder any more.'), { status: 400 })
43
+ if (!f) throw Object.assign(new Error('That .env file is not in this codebase\'s folder any more.'), { status: 400 })
44
44
  return f
45
45
  }
46
46
 
@@ -2,9 +2,9 @@
2
2
  // Names, where each goes, who can use it, and the variables `quilt run` sets: never a value.
3
3
  import { LEVEL_WORDS } from './api/secrets-access.js'
4
4
 
5
- export const SECRET_NAMES_DESCRIPTION = "The session's secrets (API keys and the like), by name: each one's level (session, workspace or team), the one host it is sent to, who can use it, whether you can, and the environment variables `quilt run` sets for it. Never a value: nobody can read one back, you included. To use them, run the command that needs them through `quilt run -- <command>` (for example `quilt run -- npm run dev`): the command gets NAME=quilt and NAME's base URL, and its requests go through Quilt's vault, which adds the real key."
5
+ export const SECRET_NAMES_DESCRIPTION = "The codebase's secrets (API keys and the like), by name: each one's level (codebase, project or team), the one host it is sent to, who can use it, whether you can, and the environment variables `quilt run` sets for it. Never a value: nobody can read one back, you included. To use them, run the command that needs them through `quilt run -- <command>` (for example `quilt run -- npm run dev`): the command gets NAME=quilt and NAME's base URL, and its requests go through Quilt's vault, which adds the real key."
6
6
 
7
- export const RUN_GUIDE = 'Run commands that need the session\'s secrets through `quilt run -- <command>`, never with keys pasted into files, chat or .env: the command gets `NAME=quilt` and `<NAME>_BASE_URL` (STRIPE_KEY gives STRIPE_BASE_URL; known SDK variables like OPENAI_BASE_URL and ANTHROPIC_BASE_URL are set too), so point the code\'s base URL at that variable; Quilt\'s vault adds the real key on the way to its one service. `quilt_secret_names` lists the names. Nobody can read a value back, and you never need one.'
7
+ export const RUN_GUIDE = 'Run commands that need the codebase\'s secrets through `quilt run -- <command>`, never with keys pasted into files, chat or .env: the command gets `NAME=quilt` and `<NAME>_BASE_URL` (STRIPE_KEY gives STRIPE_BASE_URL; known SDK variables like OPENAI_BASE_URL and ANTHROPIC_BASE_URL are set too), so point the code\'s base URL at that variable; Quilt\'s vault adds the real key on the way to its one service. `quilt_secret_names` lists the names. Nobody can read a value back, and you never need one.'
8
8
 
9
9
  const WHO = { agents: 'agents and people', people: 'people only' }
10
10
 
@@ -12,15 +12,15 @@ const WHO = { agents: 'agents and people', people: 'people only' }
12
12
  export function describeSecretNames ({ names = [], kind = 'agent', hosted = false } = {}) {
13
13
  if (hosted) {
14
14
  const head = 'You are a hosted agent: you run no commands, so you can\'t use secrets. A person, or an agent with a computer or a sandbox, runs commands with them through `quilt run`.'
15
- if (!names.length) return `${head} This session has no secrets.`
16
- return `${head}\n\nThe session's secrets (names only):\n${names.map((n) => `- ${n.name} (${LEVEL_WORDS[n.level] || n.level}) → ${n.upstream}, ${WHO[n.who] || n.who}`).join('\n')}`
15
+ if (!names.length) return `${head} This codebase has no secrets.`
16
+ return `${head}\n\nThe codebase's secrets (names only):\n${names.map((n) => `- ${n.name} (${LEVEL_WORDS[n.level] || n.level}) → ${n.upstream}, ${WHO[n.who] || n.who}`).join('\n')}`
17
17
  }
18
- if (!names.length) return 'This session has no secrets. People add them in the Quilt app (Session settings → Secrets) or on heyquilt.com for a team; nobody pastes keys into files or chat.'
18
+ if (!names.length) return 'This codebase has no secrets. People add them in the Quilt app (Codebase settings → Secrets) or on heyquilt.com for a team; nobody pastes keys into files or chat.'
19
19
  const line = (n) => {
20
20
  const can = n.state === 'ready' ? 'You can use it.'
21
21
  : n.state === 'ask' ? 'Each run asks your person to allow it in the Quilt app (quilt run waits for them).'
22
22
  : `You can't: ${n.why || 'not for you'}.`
23
23
  return `- ${n.name} (${LEVEL_WORDS[n.level] || n.level}) → ${n.upstream}, ${WHO[n.who] || n.who}. ${can} quilt run sets ${n.env.map((v, i) => (i === 0 ? `${v}=quilt` : v)).join(', ')}.`
24
24
  }
25
- return `The session's secrets (names only: nobody can read a value back, you included):\n${names.map(line).join('\n')}\n\n${RUN_GUIDE}`
25
+ return `The codebase's secrets (names only: nobody can read a value back, you included):\n${names.map(line).join('\n')}\n\n${RUN_GUIDE}`
26
26
  }
package/src/secret-run.js CHANGED
@@ -8,11 +8,11 @@ import { ENV_KEY_NAME } from './ui/agent-env-key.js'
8
8
  import { createRun, waitRun, endRun } from './secrets-client.js'
9
9
 
10
10
  // `quilt git-token` printed a GitHub token, which put it in the terminal and the AI's context.
11
- export const GIT_TOKEN_GONE = 'quilt git-token no longer prints a token: Quilt never hands a value to a terminal or an AI. git signs in to GitHub through Quilt by itself (its credential helper), so fetch, commit and push as usual; Quilt opens the pull request for your task\'s branch. Keys your project needs go in the session\'s secrets and run through `quilt run -- <command>`.'
11
+ export const GIT_TOKEN_GONE = 'quilt git-token no longer prints a token: Quilt never hands a value to a terminal or an AI. git signs in to GitHub through Quilt by itself (its credential helper), so fetch, commit and push as usual; Quilt opens the pull request for your task\'s branch. Keys your code needs go in the codebase\'s secrets and run through `quilt run -- <command>`.'
12
12
 
13
13
  export const RUN_USAGE = `usage: quilt run -- <command> [args...]
14
14
 
15
- Runs a command with the session's secrets, without ever giving it a value. For each secret it
15
+ Runs a command with the codebase's secrets, without ever giving it a value. For each secret it
16
16
  may use, the command gets NAME=quilt and NAME's base URL (STRIPE_KEY gives STRIPE_BASE_URL, and
17
17
  known SDK variables like OPENAI_BASE_URL): its requests go to Quilt's vault, which adds the real
18
18
  credential and sends them on to that secret's one service. People-only secrets wait for the
@@ -61,7 +61,7 @@ export async function runWithSecrets ({ command, source, env = process.env, say
61
61
  if (ready.length) {
62
62
  Object.assign(childEnv, runEnv(ready, { vault: started.vault, token: started.token }))
63
63
  say(`quilt run: ${ready.map((s) => `${s.name} → ${s.upstream}`).join(', ')} (through Quilt's vault; the command never sees a value)`)
64
- } else if (!secrets.length) say('quilt run: this session has no secrets yet; running the command as it is')
64
+ } else if (!secrets.length) say('quilt run: this codebase has no secrets yet; running the command as it is')
65
65
  const runId = started.run && started.run.id
66
66
  const code = await new Promise((resolve) => {
67
67
  let child