heyquilt 0.3.175 → 0.3.176

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/src/setup.js CHANGED
@@ -50,6 +50,10 @@ ${TASK_WORKFLOW_MD}
50
50
  \`quilt_resolve_merge\`.
51
51
  Until you do, moving a task to QA or Done, \`quilt_set_work\` "done" and commits
52
52
  are refused. A conflict whose writer's AI is gone is handed to another AI.
53
+ In your own folder the clash is in the file itself: your save is not shared, and
54
+ the file has both versions of those lines between conflict markers
55
+ ("<<<<<<< mine", "=======", ">>>>>>> session"). Edit them to what they should
56
+ be, delete the marker lines and save: it is shared then.
53
57
  - Your unfinished work is boxed: in a folder that is a git repository, a file you
54
58
  change stays in a box until you commit it. Everyone sees the change, but it is only
55
59
  in your folder, so nobody else's git can commit it. Committing it (or putting it
@@ -86,6 +90,10 @@ ${TASK_WORKFLOW_MD}
86
90
  work (it comes back a moment later), a git conflict pauses this folder until
87
91
  you resolve it and \`git add\` it, and checking out another branch moves this
88
92
  folder to that branch's work in the session (the old branch keeps its own).
93
+ If git refuses a checkout because local changes would be overwritten, those
94
+ are the session's uncommitted work, which the session keeps: switch with
95
+ \`git checkout -f <branch>\` (or \`git stash && git checkout <branch>\` in one
96
+ command; a stash on its own is put back a moment later).
89
97
  Deleting a file deletes it for everyone.
90
98
  - If git refuses to pull because untracked files would be overwritten, those
91
99
  files came from the session: \`quilt_status\` lists them under "Pulling" and
package/src/status.js CHANGED
@@ -88,6 +88,8 @@ export function renderStatus (st, { asAi = false, mentionYours = false } = {}) {
88
88
  if (!act.length) out.push('_Nothing yet._')
89
89
  for (const a of act) {
90
90
  const who = a.by === st.me.name ? 'you' : a.by
91
+ // A folder that moved to another branch (a checkout in git) has no path to show.
92
+ if (a.kind === 'switched') { out.push(`- ${ago(a.ts)}: ${who} switched to \`${a.branch}\``); continue }
91
93
  out.push(`- ${ago(a.ts)}: ${who} ${a.kind} \`${a.path}\`${a.detail ? ` (${a.detail})` : ''}`)
92
94
  }
93
95
  out.push('')
@@ -81,7 +81,7 @@ export function agentGuide ({ apiUrl = 'https://api.heyquilt.com', via = 'both'
81
81
  '',
82
82
  '### Files',
83
83
  // quilt_set_work is a tool only the CLI has: an agent over HTTP is not told of it.
84
- '- Nobody holds files: edit any file you may change; edits merge as they arrive. If your change clashes with someone\'s on the same lines, Quilt holds your lines and tells you at the top of your next Quilt answer: resolve it at once with `quilt_resolve_merge`. Until you do, moving a task to QA or Done' + (cli ? ', `quilt_set_work` "done"' : '') + ' and commits are refused; a conflict whose writer\'s AI is gone is handed to another AI in the session, which is woken for it.',
84
+ '- Nobody holds files: edit any file you may change; edits merge as they arrive. If your change clashes with someone\'s on the same lines, Quilt holds your lines and tells you at the top of your next Quilt answer: resolve it at once with `quilt_resolve_merge`. Until you do, moving a task to QA or Done' + (cli ? ', `quilt_set_work` "done"' : '') + ' and commits are refused; a conflict whose writer\'s AI is gone is handed to another AI in the session, which is woken for it.' + (cli ? ' In your own folder the clash is in the file itself: your save is not shared, and the file has both versions of those lines between conflict markers ("<<<<<<< mine", "=======", ">>>>>>> session"). Edit them to what they should be, delete the marker lines and save: it is shared then.' : ''),
85
85
  cliOnly('- Call `quilt_before_edit` with the paths before you change files: it shows what people said about them in chat and who else changed them lately. It never refuses'),
86
86
  http ? `- ${both ? 'Over HTTP: ' : ''}\`quilt_list_files\`, \`quilt_read_file\`, then \`quilt_write_file\` with the version the read ended with as \`base\` (your write is merged against what you read).` : null,
87
87
  `- Your unfinished work is boxed: ${cli && http ? 'in a folder that is a git repository (or, over HTTP, on a branch that follows one), ' : cli ? 'in a folder that is a git repository, ' : 'on a branch that follows a git repository, '}a file you change stays in a box until you commit it. Everyone sees the change, but it is in nobody else's folder, so nobody else's git can commit it. Committing it (or putting it back) opens the box by itself; finishing does not.`,
@@ -101,6 +101,7 @@ export function agentGuide ({ apiUrl = 'https://api.heyquilt.com', via = 'both'
101
101
  cli ? `- ${both ? 'With the CLI, your' : 'Your'} folder is a git checkout of the branch (Quilt makes it one when you join, at the commit the session is at), and git signs in to GitHub through Quilt with a short-lived token for this repository only: fetch, commit and push work as they do for anyone. Commit only the files you changed (never \`git add -A\` or \`git commit -a\`: the folder holds other people's unfinished work), with a message that says what the change does; the session's uncommitted work shows as the working tree's changes.` : null,
102
102
  cli ? `- ${both ? 'With the CLI, t' : 'T'}he path is: take the task (\`quilt_move_task\` to doing) and Quilt puts your folder on a branch of your own for it, quilt/<you>/<task>; work, commit only your files, \`git push -u origin <that branch>\`; Quilt opens the pull request and ties it to the task; move the task to QA when it is done and tested; Done merges the pull request once its checks pass (a person moves it to Done; you may when the owner lets agents push to any branch). Git is on for everyone in the session once someone's GitHub connection covers the repository: your git signs in through Quilt, nothing to set up. Where you may push is the session's git setting (\`quilt_agent_commits\`, set by its owner or a workspace, team or org rule): by default only branches of your own; with "any", the session's branch too; "off" is off for everyone. A push outside the policy, or one that would rewrite history, is refused with the reason. Quilt never hands you a GitHub token (\`quilt git-token\` prints none): git is all you need. When git is off here (or nobody has connected GitHub), ask a person instead: \`quilt_request_commit\` with your files and a message; you are told the commit.` : null,
103
103
  http ? `- ${both ? 'Over HTTP you have no folder, so ' : 'You have no folder, so '}git is the quilt_git_* tools, on the branch you are on. Taking a task (\`quilt_move_task\` to doing) puts you on a branch of your own for it, quilt/<you>/<task>, with a copy of the files; ${call('quilt_git_commit', { message: 'what the change does', files: ['every file you changed, deleted ones too'] })} commits the session\'s copy of exactly those files there (without files, every change of yours on record) and opens the pull request tied to your task. The session\'s branch itself is open to agents only when the owner lets agents push to any branch. \`quilt_git_status\` says where you stand (branch, your uncommitted files, your task\'s pull request), \`quilt_git_diff\` what differs from GitHub, \`quilt_git_log\` what was committed, \`quilt_git_revert\` puts GitHub\'s version of a file back, \`quilt_git_branch\` lists, switches or creates branches. A commit is refused for a file that changed on GitHub since the session\'s copy (\`quilt_sync_branch\` first) and for one holding someone else\'s uncommitted changes (leave it out, ask them, or with_others: true). \`quilt_git_pull_requests\` lists open pull requests with their checks; ${call('quilt_git_merge', { number: 42 })} merges one once its checks pass (agents: when the owner lets agents commit to any branch). When git is off here, ask a person with \`quilt_request_commit\`.` : null,
104
+ cli ? `- ${both ? 'With the CLI: s' : 'S'}witching branches moves your folder to that branch's work in the session, and the branch you left keeps its own. Your folder also holds everyone's uncommitted work on the branch you are on, so git may refuse a checkout ("local changes would be overwritten"): switch with \`git checkout -f <branch>\`. Nothing is lost, because the session keeps that work on the branch you leave. A \`git stash\` on its own is put back a moment later.` : null,
104
105
  '- A task of yours can\'t move to QA while its files aren\'t in git; Done merges its pull request (refused while checks fail or run, and, unless the owner lets agents push anywhere, a person\'s to do). A pull request merged on GitHub by hand moves its task to Done by itself. Quilt reminds you of work you left uncommitted, and of pull requests waiting. Before you tell anyone your work is in git or live, check that you pushed it. `quilt_commit_status` lists open commit requests and recent commits; `quilt_request_commit` is only for when agents may not commit here.',
105
106
  '- Anything pushed or merged on GitHub reaches the session within seconds (Quilt\'s GitHub app tells it), merged with the session\'s uncommitted work; a branch you pushed comes back without a conflict. There is nothing to pull by hand. Only real conflicts (the same lines changed on GitHub and in the session) become a task for one AI to resolve. Quilt never rewrites or force-pushes history, and neither should you.',
106
107
  cli ? `- ${both ? 'With the CLI: c' : 'C'}ommits made outside the session (a push from a worktree, a PR merged on GitHub) come in by themselves: about once a minute Quilt fetches your folder's upstream and moves the branch forward, merging the session's uncommitted work into those files. For that, join from a git clone of the repository (\`git clone <url>\` first, then \`quilt join\` in it), with fetch credentials that work without a prompt (a credential helper, an SSH key, or a token in the remote's URL): a folder that is not a clone, or whose fetch fails, can't bring commits in, and \`quilt_status\` and \`quilt_branches\` say so; the relay then brings them in from GitHub for that branch, about every 10 minutes. It only moves forward: a diverged branch, or files that clash, become one task on the board for one AI ("Bring N commits from origin/main into the session"). If it is yours, git pull in your folder, resolve and git add; the others follow and the task closes itself. If it is someone else's, leave those files to them.` : null,