heyquilt 0.3.182 → 0.3.184
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/README.md +101 -97
- package/RELEASES.md +14 -0
- package/bin/quilt.js +32 -32
- package/desktop/main.js +1 -1
- package/package.json +1 -1
- package/src/account.js +17 -2
- package/src/admit-policy.js +2 -2
- package/src/agent-join.js +3 -3
- package/src/agent-task-workflow.js +14 -14
- package/src/ai-vm.js +1 -1
- package/src/api/agent-placement.js +2 -2
- package/src/api/audit.js +1 -1
- package/src/api/file-paths.js +1 -1
- package/src/api/file-store.js +1 -1
- package/src/api/invite-email.js +4 -4
- package/src/api/join-text.js +5 -5
- package/src/api/memory-store.js +22 -1
- package/src/api/notify.js +7 -7
- package/src/api/permissions.js +1 -1
- package/src/api/routes/agent-wake.js +1 -1
- package/src/api/routes/agents.js +2 -2
- package/src/api/routes/ai-vm.js +5 -5
- package/src/api/routes/connections.js +66 -25
- package/src/api/routes/grants.js +2 -2
- package/src/api/routes/mail.js +10 -10
- package/src/api/routes/relay.js +1 -1
- package/src/api/routes/secrets.js +11 -11
- package/src/api/routes/session-invites.js +5 -5
- package/src/api/routes/sessions.js +3 -3
- package/src/api/routes/workspace-agents.js +14 -14
- package/src/api/routes/workspace-chat.js +77 -0
- package/src/api/routes/workspace-files.js +12 -12
- package/src/api/routes/workspace-invites.js +5 -5
- package/src/api/routes/workspaces.js +11 -11
- package/src/api/secrets-access.js +1 -1
- package/src/api/server.js +5 -4
- package/src/api/supabase-store.js +25 -1
- package/src/api/team-access.js +1 -1
- package/src/api/workspace-access.js +1 -1
- package/src/api/workspace-reach.js +3 -3
- package/src/app-tools.js +11 -11
- package/src/autowork.js +4 -4
- package/src/branch-view.js +1 -1
- package/src/catchup.js +5 -5
- package/src/chat-links.js +18 -18
- package/src/connection.js +11 -11
- package/src/control.js +5 -5
- package/src/conversation.js +1 -1
- package/src/doctor.js +2 -2
- package/src/duties.js +1 -1
- package/src/fsutil.js +1 -1
- package/src/held.js +4 -4
- package/src/hooks.js +3 -3
- package/src/hosted-client.js +2 -2
- package/src/identity.js +1 -1
- package/src/inbox.js +1 -1
- package/src/key-cli.js +1 -1
- package/src/mail-tools.js +11 -11
- package/src/mcp-proxy.js +1 -1
- package/src/mcp.js +59 -59
- package/src/new-session.js +6 -6
- package/src/project-rules.js +2 -2
- package/src/relay-ask.js +2 -2
- package/src/relay-cluster.js +3 -3
- package/src/relay-live-write.js +3 -3
- package/src/relay-mcp.js +56 -56
- package/src/relay-prune.js +1 -1
- package/src/relay-turn-sync.js +1 -1
- package/src/secret-import.js +1 -1
- package/src/secret-names.js +6 -6
- package/src/secret-run.js +3 -3
- package/src/server.js +41 -41
- package/src/session-access.js +3 -3
- package/src/session-name.js +1 -1
- package/src/session.js +50 -50
- package/src/setup.js +7 -7
- package/src/status.js +2 -2
- package/src/tasks.js +1 -1
- package/src/turn-sync.js +4 -4
- package/src/ui/account-sessions.js +2 -2
- package/src/ui/agent-env-key.js +1 -1
- package/src/ui/agent-guide.js +35 -35
- package/src/ui/agent-kinds.js +8 -8
- package/src/ui/agent-place.js +16 -16
- package/src/ui/agents-table.js +6 -6
- package/src/ui/app.css +345 -0
- package/src/ui/app.js +28 -13
- package/src/ui/board.js +2 -2
- package/src/ui/catchup.js +5 -5
- package/src/ui/changes-seen.js +2 -2
- package/src/ui/changes.js +3 -3
- package/src/ui/cloud-ai.js +12 -12
- package/src/ui/common.js +1 -1
- package/src/ui/connections.js +48 -8
- package/src/ui/diffview.js +2 -2
- package/src/ui/feed.js +1 -1
- package/src/ui/feedback.js +4 -4
- package/src/ui/files.js +120 -14
- package/src/ui/fileview.js +3 -3
- package/src/ui/git-rule.js +3 -3
- package/src/ui/home.js +97 -47
- package/src/ui/index.html +1 -1
- package/src/ui/invite.js +8 -8
- package/src/ui/invites.js +3 -3
- package/src/ui/new-session.js +3 -3
- package/src/ui/prail-model.js +22 -0
- package/src/ui/prail.js +43 -0
- package/src/ui/project-board.js +359 -0
- package/src/ui/project-channel.js +93 -0
- package/src/ui/project-model.js +224 -0
- package/src/ui/project-pop.js +451 -0
- package/src/ui/projects.js +464 -0
- package/src/ui/sandbox-keys.js +3 -3
- package/src/ui/secrets-view.js +5 -5
- package/src/ui/session-words.js +2 -2
- package/src/ui/session.js +174 -47
- package/src/ui/tree.js +3 -3
- package/src/ui/voice.js +6 -6
- package/src/ui/workspaces.js +23 -23
- package/src/ui-server.js +88 -27
- package/src/update-check.js +2 -2
- package/src/voice.js +7 -7
- package/src/wake-tool.js +1 -1
- package/src/webhooks.js +1 -1
- package/src/workspace-cli.js +12 -12
- package/src/workspace-tools.js +33 -33
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
|
|
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
|
|
80
|
-
'Join a
|
|
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
|
|
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
|
|
93
|
-
'You can be in several
|
|
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
|
|
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
|
|
102
|
-
'browser and share a folder or join one from an invite link, then try again. (This link is theirs and works for every
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
301
|
-
if (a && a.role === 'viewer') lines.push('You may only view this
|
|
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
|
|
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
|
|
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
|
|
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
|
|
406
|
-
files: z.array(z.string()).max(20).optional().describe('
|
|
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
|
|
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('
|
|
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
|
|
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
|
|
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
|
|
680
|
-
'no need to poll quilt_inbox. One webhook per agent, for every
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
945
|
-
'Steps: plan (the folder\'s files and their sha1s: what to upload, pull, remove and keep aside), push (their contents), pull (the
|
|
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}
|
|
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: `
|
|
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: `
|
|
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
|
|
1200
|
-
} catch (e) { return `Your
|
|
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
|
|
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
|
|
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}
|
|
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
|
|
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 ? `,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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) }
|
package/src/relay-prune.js
CHANGED
|
@@ -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
|
|
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 }
|
package/src/relay-turn-sync.js
CHANGED
|
@@ -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
|
|
399
|
+
const who = by || 'the codebase'
|
|
400
400
|
const me = ctx.me
|
|
401
401
|
const tail = after ? ` ${after}` : ''
|
|
402
402
|
if (c.gone) {
|
package/src/secret-import.js
CHANGED
|
@@ -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
|
|
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
|
|
package/src/secret-names.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
16
|
-
return `${head}\n\nThe
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|