Repository navigation
Expand file tree
/
Copy pathtools_workspace.go
More file actions
46 lines (42 loc) · 2.3 KB
/
Copy pathtools_workspace.go
File metadata and controls
46 lines (42 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package session
// tools_workspace.go hands the belt the four verbs that act on the WORKSPACE'S
// OWN HISTORY — the files, as they were — rather than on the conversation.
//
// THEY ARE furrow's, AND furrow IS SOMEBODY ELSE'S PROGRAM. It is a separate
// tool (Agent-Field/furrow, Apache-2.0) written in another language, carried
// inside this binary and written out on first need, and the only thing this
// tree does with it is run its command line. internal/furrow owns every fact
// about that; this file owns one decision, which is whether the verbs are on
// the belt at all.
//
// AND THAT DECISION IS THE ABSENCE LAW, IN ITS SHARPEST FORM. A model told it
// can restore a workspace will plan a whole reply around being able to — it
// will offer to try something risky, promise the person their .env is
// recoverable, and only discover at the call that nothing is there. So a
// folder furrow is not watching — or the rare machine where the carried binary
// could not be written out at all — is handed NO VERB: [furrow.Tools] answers
// nil and this appends nothing. There is no second check to remember and no
// tool that exists in order to fail.
//
// WHY THE NAMES ARE `workspace_` AND NOT `rewind_`. codeaf already has a
// rewind, and it is an edit of the CONVERSATION that touches no file on disk
// (rewind.go). These four move bytes. Two families that both meant "put it
// back how it was" would be one word doing two jobs, and the first person to
// confuse them would lose work — so the two share no vocabulary at all.
import (
"context"
"github.com/Agent-Field/codeaf/internal/exec/bare"
"github.com/Agent-Field/codeaf/internal/furrow"
)
// workspaceTools is the family, or nothing.
//
// THE DETECTION IS PAID HERE AND NOT ON THE DRAW PATH. This runs once per belt
// assembly — a turn, not a frame — and internal/furrow keeps its own answer for
// a while behind that, so the cost is one short-lived subprocess per workspace
// per half-minute rather than one per question the screen asks. A seam that
// shelled out while a terminal was repainting would be the surface stopping to
// ask another program a question, which is the mistake host.go's standing seam
// already documents at length.
func (a *Agent) workspaceTools() []bare.Tool {
return furrow.Tools(context.Background(), a.config.Workspace)
}