Documentation
¶
Overview ¶
Package plan implements the services of plan.v1 on the store: projects, wishes and questions. Tasks, which run workers, are served by the harness package.
Index ¶
- Constants
- Variables
- func Active(wish *planv1.Wish) bool
- func ActiveWishes(ctx context.Context, r store.Reader) ([]*planv1.Wish, error)
- func AllowanceOf(wish *planv1.Wish, projectID string) planv1.Allowance
- func AnswerLine(q *planv1.Question, worker, did string) string
- func Ask(ctx context.Context, tx *store.Tx, question *planv1.Question) error
- func CheckedOutBranch(ctx context.Context, dir string) string
- func ChecksText(checks []*planv1.ProjectCheck) string
- func CloserWord(c planv1.Closer) string
- func CompareCodes(a, b string) int
- func Decision(ctx context.Context, r store.Reader, wishID, ref string) (string, error)
- func Description(dir string) string
- func DeveloperSettingsFile(home, projectID string) string
- func DoneLine(t *planv1.WishTemplate, text string) string
- func Downloads() (string, error)
- func EnlightenLine(q *planv1.Question, note, worker string) string
- func Entities() []proto.Message
- func FiledLine(wishID, from, text string) string
- func FillAzimas(tasks []*planv1.Task)
- func FillTilasms(ctx context.Context, r store.Reader, tasks []*planv1.Task) error
- func Finished(t *planv1.Task) bool
- func FirstLine(from, text string) string
- func FirstProjectFolder(ctx context.Context, r store.Reader) (string, error)
- func GateCommand(c *planv1.ProjectCheck) string
- func GivenByAPerson(n *planv1.ProofNeed) bool
- func Handlers(s *store.Store, opts ...Option) map[string]http.Handler
- func HoldsHome(dir string) bool
- func InboxFiledLine(wishID, source, text string) string
- func InboxFirstLine(source, text string) string
- func IntegrationBranchOf(wish *planv1.Wish, projectID string) string
- func Investigating(q *planv1.Question) bool
- func IsAzima(t *planv1.Task) bool
- func LeadTerminal(wishID string) string
- func Linked(ctx context.Context, r store.Reader, l link.Link) (string, error)
- func MergeMainWord(m planv1.MergeMain) string
- func NeedsWords(needs []*planv1.ProofNeed) string
- func ProjectNamed(ctx context.Context, r store.Reader, name string) (*planv1.Project, error)
- func ProverWord(p planv1.Prover, n *planv1.ProofNeed) string
- func Provers(needs string) (provers []planv1.Prover, reviewerName string)
- func QuestionWorkerOf(ctx context.Context, r store.Reader, q *planv1.Question, role planv1.TaskRole) (*planv1.Task, error)
- func Ranked(all []*planv1.Wish) []*planv1.Wish
- func ReadSettings(path string) (*planv1.ProjectSettings, error)
- func Ready(tasks []*planv1.Task, questions []*planv1.Question) bool
- func Recommended(q *planv1.Question) (planv1.Choice, bool)
- func RoutedLine(q *planv1.Question) string
- func SetIntegrationBranch(wish *planv1.Wish, projectID, branch string)
- func SetWatchInterval(d time.Duration) (restore func())
- func StableBrief(home string, projects []*planv1.Project) string
- func StartLine(wishID string) string
- func Status(err error) error
- func TilasmContext(ctx context.Context, r store.Reader, home, wishID string, names []string) (string, error)
- func TilasmDir(home, id string) string
- func TilasmLink(id string) string
- func WhenWord(w planv1.CheckWhen) string
- func WithAzimas(tasks []*planv1.Task) []*planv1.Task
- func WriteAfter(file string, codes []string) (bool, error)
- type AnswerHook
- type AzimaFile
- type Blocks
- func (b *Blocks) Delete(ctx context.Context, req *connect.Request[planv1.BlockServiceDeleteRequest]) (*connect.Response[planv1.BlockServiceDeleteResponse], error)
- func (b *Blocks) List(ctx context.Context, req *connect.Request[planv1.BlockServiceListRequest]) (*connect.Response[planv1.BlockServiceListResponse], error)
- func (b *Blocks) Put(ctx context.Context, req *connect.Request[planv1.BlockServicePutRequest]) (*connect.Response[planv1.BlockServicePutResponse], error)
- type Brief
- type DoneWhen
- type Inbox
- func (in *Inbox) Dismiss(ctx context.Context, req *connect.Request[planv1.InboxServiceDismissRequest]) (*connect.Response[planv1.InboxServiceDismissResponse], error)
- func (in *Inbox) List(ctx context.Context, req *connect.Request[planv1.InboxServiceListRequest]) (*connect.Response[planv1.InboxServiceListResponse], error)
- func (in *Inbox) Plug(ctx context.Context, req *connect.Request[planv1.InboxServicePlugRequest]) (*connect.Response[planv1.InboxServicePlugResponse], error)
- func (in *Inbox) Receive(ctx context.Context, src *Source, text string) (*planv1.InboxItem, error)
- func (in *Inbox) Route(ctx context.Context, req *connect.Request[planv1.InboxServiceRouteRequest]) (*connect.Response[planv1.InboxServiceRouteResponse], error)
- func (in *Inbox) Sources(ctx context.Context, _ *connect.Request[planv1.InboxServiceSourcesRequest]) (*connect.Response[planv1.InboxServiceSourcesResponse], error)
- func (in *Inbox) Unplug(ctx context.Context, req *connect.Request[planv1.InboxServiceUnplugRequest]) (*connect.Response[planv1.InboxServiceUnplugResponse], error)
- type Leads
- type Marks
- func (m *Marks) List(ctx context.Context, req *connect.Request[planv1.MarkServiceListRequest]) (*connect.Response[planv1.MarkServiceListResponse], error)
- func (m *Marks) Put(ctx context.Context, req *connect.Request[planv1.MarkServicePutRequest]) (*connect.Response[planv1.MarkServicePutResponse], error)
- type Option
- func WithAnswered(f AnswerHook) Option
- func WithEnlightened(f func(context.Context, *planv1.Question, string)) Option
- func WithHome(home string) Option
- func WithLanguage(language string) Option
- func WithLeads(l Leads) Option
- func WithPages(p *Pages) Option
- func WithShowTilasm(show func(wishID, tilasmID string) bool) Option
- func WithTilasmURL(url func(id string) string) Option
- func WithWatchers(spawn SpawnWatcher) Option
- func WithWorkers(w WishWorkers) Option
- type Pages
- type Projects
- func (p *Projects) Add(ctx context.Context, req *connect.Request[planv1.ProjectServiceAddRequest]) (*connect.Response[planv1.ProjectServiceAddResponse], error)
- func (p *Projects) List(ctx context.Context, _ *connect.Request[planv1.ProjectServiceListRequest]) (*connect.Response[planv1.ProjectServiceListResponse], error)
- func (p *Projects) Show(ctx context.Context, req *connect.Request[planv1.ProjectServiceShowRequest]) (*connect.Response[planv1.ProjectServiceShowResponse], error)
- type Questions
- func (q *Questions) Answer(ctx context.Context, req *connect.Request[planv1.QuestionServiceAnswerRequest]) (*connect.Response[planv1.QuestionServiceAnswerResponse], error)
- func (q *Questions) Ask(ctx context.Context, req *connect.Request[planv1.QuestionServiceAskRequest]) (*connect.Response[planv1.QuestionServiceAskResponse], error)
- func (q *Questions) Enlighten(ctx context.Context, ...) (*connect.Response[planv1.QuestionServiceEnlightenResponse], error)
- func (q *Questions) List(ctx context.Context, req *connect.Request[planv1.QuestionServiceListRequest]) (*connect.Response[planv1.QuestionServiceListResponse], error)
- func (q *Questions) Revise(ctx context.Context, req *connect.Request[planv1.QuestionServiceReviseRequest]) (*connect.Response[planv1.QuestionServiceReviseResponse], error)
- type Settings
- type Settle
- type SkillDir
- type Skills
- func (k *Skills) List(ctx context.Context, req *connect.Request[planv1.SkillServiceListRequest]) (*connect.Response[planv1.SkillServiceListResponse], error)
- func (k *Skills) Summon(ctx context.Context, req *connect.Request[planv1.SkillServiceSummonRequest]) (*connect.Response[planv1.SkillServiceSummonResponse], error)
- func (k *Skills) Unsummon(ctx context.Context, req *connect.Request[planv1.SkillServiceUnsummonRequest]) (*connect.Response[planv1.SkillServiceUnsummonResponse], error)
- type Source
- type SpawnWatcher
- type Summoned
- type Template
- type Tilasms
- func (t *Tilasms) Export(ctx context.Context, req *connect.Request[planv1.TilasmServiceExportRequest]) (*connect.Response[planv1.TilasmServiceExportResponse], error)
- func (t *Tilasms) Files() http.Handler
- func (t *Tilasms) Get(ctx context.Context, req *connect.Request[planv1.TilasmServiceGetRequest]) (*connect.Response[planv1.TilasmServiceGetResponse], error)
- func (t *Tilasms) History(ctx context.Context, req *connect.Request[planv1.TilasmServiceHistoryRequest]) (*connect.Response[planv1.TilasmServiceHistoryResponse], error)
- func (t *Tilasms) Import(ctx context.Context, req *connect.Request[planv1.TilasmServiceImportRequest]) (*connect.Response[planv1.TilasmServiceImportResponse], error)
- func (t *Tilasms) List(ctx context.Context, req *connect.Request[planv1.TilasmServiceListRequest]) (*connect.Response[planv1.TilasmServiceListResponse], error)
- func (t *Tilasms) Open(ctx context.Context, req *connect.Request[planv1.TilasmServiceOpenRequest]) (*connect.Response[planv1.TilasmServiceOpenResponse], error)
- func (t *Tilasms) Put(ctx context.Context, req *connect.Request[planv1.TilasmServicePutRequest]) (*connect.Response[planv1.TilasmServicePutResponse], error)
- func (t *Tilasms) PutData(ctx context.Context, req *connect.Request[planv1.TilasmServicePutDataRequest]) (*connect.Response[planv1.TilasmServicePutDataResponse], error)
- func (t *Tilasms) Restore(ctx context.Context, req *connect.Request[planv1.TilasmServiceRestoreRequest]) (*connect.Response[planv1.TilasmServiceRestoreResponse], error)
- type Told
- type WishWorkers
- type Wishes
- func (w *Wishes) Activate(ctx context.Context, req *connect.Request[planv1.WishServiceActivateRequest]) (*connect.Response[planv1.WishServiceActivateResponse], error)
- func (w *Wishes) Allow(ctx context.Context, req *connect.Request[planv1.WishServiceAllowRequest]) (*connect.Response[planv1.WishServiceAllowResponse], error)
- func (w *Wishes) Answered(ctx context.Context, q *planv1.Question, did string)
- func (w *Wishes) Brief(ctx context.Context, req *connect.Request[planv1.WishServiceBriefRequest]) (*connect.Response[planv1.WishServiceBriefResponse], error)
- func (w *Wishes) Delete(ctx context.Context, req *connect.Request[planv1.WishServiceDeleteRequest]) (*connect.Response[planv1.WishServiceDeleteResponse], error)
- func (w *Wishes) Describe(ctx context.Context, req *connect.Request[planv1.WishServiceDescribeRequest]) (*connect.Response[planv1.WishServiceDescribeResponse], error)
- func (w *Wishes) Enlightened(ctx context.Context, q *planv1.Question, note string)
- func (w *Wishes) Export(ctx context.Context, req *connect.Request[planv1.WishServiceExportRequest]) (*connect.Response[planv1.WishServiceExportResponse], error)
- func (w *Wishes) Grant(ctx context.Context, req *connect.Request[planv1.WishServiceGrantRequest]) (*connect.Response[planv1.WishServiceGrantResponse], error)
- func (w *Wishes) Import(ctx context.Context, req *connect.Request[planv1.WishServiceImportRequest]) (*connect.Response[planv1.WishServiceImportResponse], error)
- func (w *Wishes) ImportData(ctx context.Context, req *connect.Request[planv1.WishServiceImportDataRequest]) (*connect.Response[planv1.WishServiceImportDataResponse], error)
- func (w *Wishes) List(ctx context.Context, _ *connect.Request[planv1.WishServiceListRequest]) (*connect.Response[planv1.WishServiceListResponse], error)
- func (w *Wishes) Make(ctx context.Context, req *connect.Request[planv1.WishServiceMakeRequest]) (*connect.Response[planv1.WishServiceMakeResponse], error)
- func (w *Wishes) Move(ctx context.Context, req *connect.Request[planv1.WishServiceMoveRequest]) (*connect.Response[planv1.WishServiceMoveResponse], error)
- func (w *Wishes) Pause(ctx context.Context, req *connect.Request[planv1.WishServicePauseRequest]) (*connect.Response[planv1.WishServicePauseResponse], error)
- func (w *Wishes) Render(ctx context.Context, req *connect.Request[planv1.WishServiceRenderRequest]) (*connect.Response[planv1.WishServiceRenderResponse], error)
- func (w *Wishes) Resume(ctx context.Context, req *connect.Request[planv1.WishServiceResumeRequest]) (*connect.Response[planv1.WishServiceResumeResponse], error)
- func (w *Wishes) Route(ctx context.Context, req *connect.Request[planv1.WishServiceRouteRequest]) (*connect.Response[planv1.WishServiceRouteResponse], error)
- func (w *Wishes) SetIntegration(ctx context.Context, ...) (*connect.Response[planv1.WishServiceSetIntegrationResponse], error)
- func (w *Wishes) SetLead(ctx context.Context, req *connect.Request[planv1.WishServiceSetLeadRequest]) (*connect.Response[planv1.WishServiceSetLeadResponse], error)
- func (w *Wishes) Snapshot(ctx context.Context, req *connect.Request[planv1.WishServiceSnapshotRequest]) (*connect.Response[planv1.WishServiceSnapshotResponse], error)
- func (w *Wishes) Sync(ctx context.Context, req *connect.Request[planv1.WishServiceSyncRequest]) (*connect.Response[planv1.WishServiceSyncResponse], error)
- func (w *Wishes) Tell(ctx context.Context, wishID, line string) error
- func (w *Wishes) Watch(ctx context.Context, req *connect.Request[planv1.WishServiceWatchRequest], ...) error
- func (w *Wishes) Watched(ctx context.Context, task *planv1.Task, text string) (done bool, err error)
Constants ¶
const ( DefaultMergeMain = planv1.MergeMain_MERGE_MAIN_RELEASE DefaultMergeMainEvery = time.Hour )
Defaults of keeping a wish's integration branch up with the project's main branch: merged at each release, main fetched at most hourly, and a release of Djinn installed by itself on main.
const ( DefaultQuestionModel = "sonnet" // for claude; another provider's own default DefaultQuestionBudgetUSD = 2.0 )
Defaults of the question workers: a cheaper model is enough to turn a decision into tasks, or to read and revise a question; and a cap, so that one never runs long.
const DefaultBranch = "{code}-{slug}-{uuid8}"
DefaultBranch is the branch template of a project whose files set none.
const DefaultCorrectionAttempts = 2
DefaultCorrectionAttempts is how many correction workers Djinn starts for a failed integration, one after the other, before it asks the person, in a project whose files set none.
const DefaultTilasmBytes = 50 << 20
DefaultTilasmBytes is the ceiling of a new tilasm, its files summed: material to read, not a store of videos.
const LeadFirstFile = "lead-first.md"
LeadFirstFile holds the first message of a new lead, in the wish's folder of Djinn's data folder, next to its page: the lead reads it there when the shell cannot carry it.
const MaxActive = 3
MaxActive is how many wishes are active at once, at most. A djinn grants three wishes: the limit guards the user's attention, not the machine, and no option changes it. There may be as many wishes as you like: the three first are active, the others wait paused, their workers stopped.
const PageFile = "page.html"
PageFile is the name of a wish's synced page.
const PagesDir = "wishes"
PagesDir is the folder of the synced pages in the data directory: one folder per wish, named by its id, holding page.html.
const PlanDir = "plan"
PlanDir is the folder of a project that holds its plan files.
const SkillFile = "SKILL.md"
SkillFile is the file that makes a folder a skill.
const ( // SourceEvery is the least time between two starts of a source's command, by default. SourceEvery = 5 * time.Minute )
How often a source runs.
const TilasmPolicy = "default-src 'none'; " +
"script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; " +
"style-src 'self' 'unsafe-inline'; " +
"img-src 'self' data: blob:; " +
"font-src 'self' data:; " +
"media-src 'self' data: blob:; " +
"worker-src 'self' blob:; " +
"frame-src 'self'; " +
"connect-src 'none'; " +
"object-src 'none'; " +
"base-uri 'self'; " +
"form-action 'none'; " +
"frame-ancestors 'self'; " +
"sandbox allow-scripts"
TilasmPolicy is the content security policy of a tilasm's files, sent with each. Its own scripts run, inline or from its files, and its styles, images, fonts and media load from its files or data: and blob: addresses. It reaches no network: connect-src 'none' refuses fetch, XMLHttpRequest, WebSocket and EventSource, default-src 'none' every other load from elsewhere, form-action 'none' a form. sandbox gives it an opaque origin even opened alone in a browser: it never shares Djinn's, so it reads neither Djinn's cookie nor its storage, and calls none of its services. Only Djinn's own pages may frame it.
A link the tilasm follows can still navigate its own frame away: a policy cannot forbid that. Each answer names the server's own origin beside 'self' (tilasmPolicy).
Variables ¶
var ErrNoLead = errors.New("this wish has no lead to tell")
ErrNoLead says that a wish has no lead to tell: no session is recorded for it, or its lead does not run and the wish is not active. What the lead missed waits in the wish's brief.
var ErrNoProject = errors.New("no project has a folder on this machine, and Djinn never starts a lead in your home " +
"folder: create a project first (djinn project add <folder>, or + beside Projects in the window)")
ErrNoProject says that no project has a folder on this machine: a lead has nowhere to start, and Djinn never starts one in the home folder.
var SettingsFile = filepath.Join(".agents", "settings.txtpb")
SettingsFile is where a project's repository keeps the settings its team shares: a plan.v1.ProjectSettings in text protobuf, next to the permissions in .agents.
var SkillFolders = []string{filepath.Join(".agents", "skills"), filepath.Join(".claude", "skills")}
SkillFolders are where a project keeps its skills, in this order: .agents/skills, which every agent reads, then .claude/skills. A name found in the first hides the same name in the second.
var Validate = connect.UnaryInterceptorFunc(func(next connect.UnaryFunc) connect.UnaryFunc { return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) { if m, ok := req.Any().(proto.Message); ok { if err := protovalidate.Validate(m); err != nil { return nil, connect.NewError(connect.CodeInvalidArgument, err) } } return next(ctx, req) } })
Validate checks every unary request against the rules of its proto, as the command line did before sending it.
Functions ¶
func ActiveWishes ¶
ActiveWishes returns the active wishes by rank: the first one has priority, and the scheduler serves them in this order.
func AllowanceOf ¶
AllowanceOf is the right wish allows its workers in the project projectID: ALLOWANCE_NONE when it allows none.
func AnswerLine ¶
AnswerLine is the line that tells a lead the answer to q: the choice, the option and the note, on one line; then what Djinn did with it, when did says it settled it; else the question worker that turns it into tasks, when worker names one, or else that the lead acts on it.
func Ask ¶
Ask stores question, new, in tx with the next code of its wish. The caller journals the command that asks it.
func CheckedOutBranch ¶
CheckedOutBranch is the branch the checkout in dir is on: "" when it is on none (a detached HEAD), or dir is not in Git.
func ChecksText ¶
func ChecksText(checks []*planv1.ProjectCheck) string
ChecksText lists checks on one line: "lint: go tool task lint (commit, push); test: go tool task test (push)".
func CloserWord ¶
CloserWord names who marked a task done by hand.
func CompareCodes ¶
CompareCodes orders task codes as a person reads them: by letter, then by number, T2 before T10.
func Decision ¶
Decision resolves the decision a task comes from, in wish wishID: an answered question by its code or its id, or a block of kind decision by its id. It returns what the task keeps: the question's code, or the block's id.
func Description ¶
Description is the description of the skill in dir, from the front matter of its SKILL.md: a line, or a folded block of indented lines; empty without one.
func DeveloperSettingsFile ¶
DeveloperSettingsFile is where the developer keeps their own settings of a project, in Djinn's data folder home.
func DoneLine ¶
func DoneLine(t *planv1.WishTemplate, text string) string
DoneLine is the first line of text that says the template's work is done: a line that is done_when, or starts with it before a character that is not a letter nor a digit. Empty when none does.
func Downloads ¶
Downloads returns the folder where files the user asked for land: the XDG download folder on Linux, which may have a translated name, else Downloads in the home folder, else the home folder itself.
func EnlightenLine ¶
EnlightenLine is the line that tells a lead the developer wants to know more before answering q: what they want to know, as they typed it, on one line; then the question worker that investigates, when worker names one, or else that the lead does.
func Entities ¶
Entities are the messages the store keeps: those of plan.v1, and what each command of a project costs.
func FiledLine ¶
FiledLine is the line that tells the lead of the wish wishID that a request was filed in it, from the wish from.
func FillAzimas ¶
FillAzimas sets Task.azima on the azimas among tasks, from the tasks of their wish among tasks: give it every task of the wishes read. An azima is done when its status is and none of its parts is still to finish: a part that runs or waits keeps it in progress, whatever its plan file says. It is in progress when one of its parts has a worker on it or is done, or an azima part of it is under way; open otherwise. Once every part is finished, its azimas done or to validate in their turn, it is to validate (AWAITING_PROOF): nothing is left for Djinn, and the person checks its plan file's boxes (Task.proof_needs say what each one needs) and validates it. It is ready when every task it depends on is done.
func FillTilasms ¶
FillTilasms sets Task.tilasms on tasks: the codes of the tilasms of their wish that cite each, in code order.
func Finished ¶
Finished tells a task of work finished: done, stopped on request, or cut short for good. Djinn resumes by itself every task it can (RESUMING), so one left interrupted (resumed as a fork, imported, its worktree gone) is history.
func FirstLine ¶
FirstLine is the first line of the lead of a wish made for a request: the request, and where it comes from.
func FirstProjectFolder ¶
FirstProjectFolder is the folder of the first of Djinn's projects, in the order the window lists them, that has one on this machine, outside the home folder's own. ErrNoProject when none has: where the window's terminal opens by default, and a new lead without a project of its own.
func GateCommand ¶
func GateCommand(c *planv1.ProjectCheck) string
GateCommand is how an agent runs a check of the project: through the gate of its name.
func GivenByAPerson ¶
GivenByAPerson tells whether a person can give the proof: its needs name a person or a review.
func HoldsHome ¶
HoldsHome reports whether dir is the user's home folder or a folder above it (/, /home, C:\): Djinn never runs a lead there. An agent started there asks whether to trust the whole home folder, and reaches all of it.
func InboxFiledLine ¶
InboxFiledLine is the line that tells the lead of the wish wishID that an inbox item was filed in it.
func InboxFirstLine ¶
InboxFirstLine is the first line of the lead of a wish made for an inbox item: the item, and its source.
func IntegrationBranchOf ¶
IntegrationBranchOf is the branch wish integrates its finished work into in the project projectID; "" when none is recorded.
func Investigating ¶
Investigating tells an open question whose last round is a request to investigate: it waits for the lead's revision, not for the developer.
func LeadTerminal ¶
LeadTerminal is the name of the terminal of a wish's lead.
func Linked ¶
Linked is the wish a link shows: the tilasm's, or the wish itself. One not on this machine is an error of code NotFound.
func MergeMainWord ¶
MergeMainWord is when Djinn merges main, as the settings say it: release, commit, off.
func NeedsWords ¶
NeedsWords says what an azima's proofs need, each giver once, in the order of the enum: "a Mac, Clément's review".
func ProjectNamed ¶
ProjectNamed is the project of this name, case ignored, or of this identifier.
func ProverWord ¶
ProverWord names who or what gives a proof, in the brief's words: "a Mac", "Clément's review".
func Provers ¶
Provers says who or what gives the proof a box needs, from the words of its needs, in the order of the enum: a Mac, a Windows machine, a review by a named person, a release, a real model, a person; something else when none of them is named. reviewer is the person whose review it needs ("Clément's review").
func QuestionWorkerOf ¶
func QuestionWorkerOf(ctx context.Context, r store.Reader, q *planv1.Question, role planv1.TaskRole) (*planv1.Task, error)
QuestionWorkerOf is the question worker of role that still works on q (Task.role): planned, running, paused, or one Djinn resumes; nil when none does.
func Ranked ¶
Ranked returns the active wishes of all by rank. A wish without a rank, made before ranks, comes after the ranked ones, the oldest first.
func ReadSettings ¶
func ReadSettings(path string) (*planv1.ProjectSettings, error)
ReadSettings reads the settings of the file at path: nil, and no error, when there is none. A file that holds something that looks like a secret is refused, comments included, without repeating it.
func Ready ¶
Ready tells whether Djinn proposes to grant a wish that has these tasks and questions: it has tasks, every one finished (done, stopped by the user, or cut short for good), and no question is open. A task waiting for an answer, failed, resuming, planned or running keeps it from being ready. Djinn only proposes: the user grants.
func Recommended ¶
Recommended is the choice a question's recommendation names, for a one-click approval. A question without options is answered yes. Otherwise the recommendation names an option by its letter first ("B: …", "**B**, because…"), or starts with the first word of one option only ("Yes: it is measured" for an option "Yes, pour it"). The window reads it the same way (recommendedChoice in src/data/format.ts).
func RoutedLine ¶
RoutedLine is the line that tells the lead of a route question's wish where the request went: it hands it over.
func SetIntegrationBranch ¶
SetIntegrationBranch records branch as wish's integration branch in the project projectID, in place of the one it had.
func SetWatchInterval ¶
SetWatchInterval sets the least time between two messages of a Watch stream, for tests and benchmarks, and returns what puts it back.
func StableBrief ¶
StableBrief is the part of a brief that changes rarely, for a wish on projects: Djinn's rules, then where each project keeps its own, and the checks Djinn runs on its work, as its settings say with Djinn's data folder home. It names the projects, never their folders.
func StartLine ¶
StartLine is how every new lead starts, whatever its agent: from the brief, which Djinn computes from the plan. A lead of another agent than the last one continues the wish from there, without its session.
func TilasmContext ¶
func TilasmContext(ctx context.Context, r store.Reader, home, wishID string, names []string) (string, error)
TilasmContext is what a worker's first prompt holds of the tilasms it is given (djinn task spawn --tilasm): for each, its code, title, link, what it explains, the folder of its latest version's files and the text of its page. names are codes (L01, any case) or identifiers of tilasms of the wish, repeated or separated by commas or spaces; home is Djinn's data folder. Empty for no name.
func TilasmDir ¶
TilasmDir is the folder of a tilasm in the data folder home: version n is in its folder v<n>.
func TilasmLink ¶
TilasmLink is the link that opens a tilasm in Djinn from anywhere: a block, a question, a terminal, a browser.
func WithAzimas ¶
WithAzimas is tasks with Task.azima set on their azimas, as clones: the store's own messages stay as they are.
func WriteAfter ¶
WriteAfter writes what an azima depends on, by code, into its plan file's front matter, as "after: T02 T05" after its status (or last); none removes the line. It tells whether the file changed: a file that says it already is left as it is.
Types ¶
type AnswerHook ¶
AnswerHook is called with a question once its answer is stored. It says what it did with the answer, for the wish's lead: "Djinn started W12: …"; "" when the answer is the lead's to act on.
type AzimaFile ¶
type AzimaFile struct {
// Path is the file, as its project names it: plan/8e8d3d76-orchestrator.md.
Path string
ID string
Code string
Phase string
Status string
Title string
// After is what the file says the azima depends on, by code.
After []string
// DoneWhen is what its Done-when sections say: their boxes, and what the unchecked ones need.
DoneWhen DoneWhen
}
AzimaFile is what a plan file says of its azima: its front matter, between two lines "---" at the top, and its title, the first heading after it ("# T07 · The orchestrator", the code left out).
func ReadAzimaFiles ¶
ReadAzimaFiles reads the plan files of a project's folder: plan/*.md with a front matter that gives a code, and their Done-when section. A file without one (the README) is not an azima's.
type Blocks ¶
type Blocks struct {
planv1connect.UnimplementedBlockServiceHandler
Store *store.Store
}
Blocks implements BlockService.
type Brief ¶
Brief is where a wish stands and how to lead it, written by Djinn from the store, without a model: every lead, of any agent, starts from it. Moving is where the wish stands. Stable changes rarely: Djinn's rules and the rules of the wish's projects.
func BuildBrief ¶
BuildBrief writes the brief of a wish from what r holds. home is Djinn's data folder: like the projects' folders and the home folder, it never shows. No secret: Djinn stores none, and a URL loses its credentials.
type DoneWhen ¶
type DoneWhen struct {
// Found: the file has a "## Done when" section.
Found bool
// How many of its boxes are checked, and how many are not, nested ones included.
Checked, Unchecked int
// What the unchecked boxes need, box by box, when every one of them says so or holds boxes that do: nothing is
// left for a worker. Nil while one unchecked box is work.
Needs []*planv1.ProofNeed
}
DoneWhen is what the Done-when section of a plan file says.
func ReadDoneWhen ¶
ReadDoneWhen reads the Done-when sections of a plan file's body: each from its heading to the next heading of its level or above. A file holds several when azimas were merged into it, one in each merged part ("### Done when" under "## From T03 · …"): their boxes count together. A box goes on over the lines indented under it; a box indented under another is nested in it; a box struck through is left out.
func (DoneWhen) AllChecked ¶
AllChecked tells whether every box of the section is checked: the azima is done, whatever the status line says.
type Inbox ¶
type Inbox struct {
planv1connect.UnimplementedInboxServiceHandler
// Wishes routes an item: it files it, or makes its wish and starts its watcher and lead.
Wishes *Wishes
}
Inbox implements InboxService, and receives what the sources print.
func (*Inbox) Receive ¶
Receive reads a paragraph a source printed: a new item, its route proposed without a model, unless the same item came already (new, routed or dismissed) or a wish holds its link. It returns the item made, nil when none. Nothing is made nor sent: the item waits for the developer's answer.
type Leads ¶
type Leads interface {
// Open runs line through the user's shell in the terminal called name, in dir, or attaches to that terminal if
// it runs; an empty line runs the shell itself, and an empty dir the home folder. It refuses to start a program
// while a terminal of another name runs a command line that holds exclusive. It returns the command line and
// the folder of the terminal.
Open(name, line, dir, exclusive string) (command []string, directory string, attached bool, err error)
// Show brings the window to the front, on the wish and the terminal.
Show(wishID, terminal string)
// Say types line into the running terminal called name, then Enter, once the person is not typing there. It
// returns at once; the lines go out in order.
Say(name, line string) error
// Close hangs up the running terminal called name, as closing it in the window does; none runs, nothing.
Close(name string)
}
Leads runs the terminal of a wish's lead and shows it in the window: djinn up provides it, on its terminals and its window.
type Marks ¶
type Marks struct {
planv1connect.UnimplementedMarkServiceHandler
Store *store.Store
// Answered are called with a question once an approval has answered it.
Answered []AnswerHook
// Told, when set, is called next, with what they did.
Told Told
// Settle, when set, acts on the answer an approval gives, as Questions.Settle.
Settle Settle
}
Marks implements MarkService. A mark lives on the question it marks, in its own list, one mark of each kind, so that it travels with it in an export. A block takes none: blocks are for agents, and what the developer must see is a question. Marks a block took before stay on it, and are listed no more.
type Option ¶
type Option func(*options)
Option sets what the plan services reach beyond the store.
func WithAnswered ¶
func WithAnswered(f AnswerHook) Option
WithAnswered calls f with a question once its answer is stored: the harness starts again the worker a yes allows to edit. With WithLeads, the wish's lead is told next (Wishes.Answered), with what f did.
func WithEnlightened ¶
WithEnlightened calls f with a question and the developer's note once a request to investigate it is stored: the harness starts its investigator. With WithLeads, the wish's lead is told next (Wishes.Enlightened).
func WithHome ¶
WithHome gives the services Djinn's data folder: each developer's own settings of a project, and the tilasms' files.
func WithLanguage ¶
WithLanguage writes the texts Djinn puts in the plan for the developer, such as the question that routes a request, in language; English by default.
func WithShowTilasm ¶
WithShowTilasm gives TilasmService.Open the window: show shows a tilasm in its wish's Tilasms tab, and tells whether a native window came to the front.
func WithTilasmURL ¶
WithTilasmURL gives TilasmService.Get the local http address of a tilasm's files, by its identifier; empty while Djinn serves no http.
func WithWatchers ¶
func WithWatchers(spawn SpawnWatcher) Option
WithWatchers lets a wish made from a template start its watcher.
func WithWorkers ¶
func WithWorkers(w WishWorkers) Option
WithWorkers gives the wishes their workers: a paused wish stops them (Wishes.Workers).
type Pages ¶
type Pages struct {
// Home is the data directory, left out of the pages, which hold the synced ones.
Home string
// Version of Djinn, shown on the pages.
Version string
// Language of the pages' own texts.
Language string
// Interval is the least time between two renders of the synced pages: pageInterval by default.
Interval time.Duration
// contains filtered or unexported fields
}
Pages renders the pages of wishes, and keeps the synced ones up to date: every committed change of a synced wish renders its page again, at most once an Interval. A page is synced while its file exists: djinn up takes back the pages it finds when it starts, and deleting a file stops it.
func NewPages ¶
NewPages returns the pages of the wishes in s, and starts listening to its changes. Run keeps them up to date.
type Projects ¶
type Projects struct {
planv1connect.UnimplementedProjectServiceHandler
Store *store.Store
// Home is Djinn's data folder, which holds the developer's own settings of each project; empty: none are read.
Home string
}
Projects implements ProjectService.
type Questions ¶
type Questions struct {
planv1connect.UnimplementedQuestionServiceHandler
Store *store.Store
// Answered are called with a question once its answer is stored.
Answered []AnswerHook
// Told, when set, is called next, with what they did.
Told Told
// Enlightened are called with a question once a request to investigate it is stored, with its note.
Enlightened []func(ctx context.Context, q *planv1.Question, note string)
// Settle, when set, acts on an answer in the transaction that stores it, and returns what follows once it is
// stored, if anything: a question that routes a request files it, or makes its wish.
Settle Settle
}
Questions implements QuestionService.
func (*Questions) Enlighten ¶
func (q *Questions) Enlighten( ctx context.Context, req *connect.Request[planv1.QuestionServiceEnlightenRequest], ) (*connect.Response[planv1.QuestionServiceEnlightenResponse], error)
Enlighten records a request to investigate an open question, with what to dig into.
func (*Questions) Revise ¶
func (q *Questions) Revise( ctx context.Context, req *connect.Request[planv1.QuestionServiceReviseRequest], ) (*connect.Response[planv1.QuestionServiceReviseResponse], error)
Revise changes an open question after investigating: what is given replaces the question's own, which the round keeps.
type Settings ¶
type Settings struct {
Provider planv1.Provider
Model string
MaxBudgetUSD float64
Branch string // a template: {code}, {slug}, {uuid8}
// How Djinn integrates the project's finished work (T07): the generated files as globs, the command that makes
// them, the one that makes a fresh worktree ready, and the one that installs its new build; empty when not set.
Generated []string
Generate, Setup, Install string
// The checks Djinn runs before it commits a task's work and before it pushes, in the order the file names them.
Checks []*planv1.ProjectCheck
// How many correction workers Djinn starts for a batch that conflicts in code or tests red, before it asks.
CorrectionAttempts int
// QuestionWorkers says whether Djinn starts a question worker after an answer or a request to investigate, with
// QuestionModel and QuestionBudgetUSD.
QuestionWorkers bool
QuestionModel string
QuestionBudgetUSD float64
// How Djinn keeps each wish's integration branch up with the project's main branch: the branch ("" for the
// remote's default), when it merges it, how often it fetches it at most; and whether a release of Djinn installs by
// itself while the person's checkout is on main.
MainBranch string
MergeMain planv1.MergeMain
MergeMainEvery time.Duration
InstallReleases bool
ProviderFrom, ModelFrom, BudgetFrom, BranchFrom, GeneratedFrom, GenerateFrom, SetupFrom planv1.SettingSource
ChecksFrom, AttemptsFrom, InstallFrom planv1.SettingSource
QuestionWorkersFrom, QuestionModelFrom, QuestionBudgetFrom planv1.SettingSource
MainBranchFrom, MergeMainFrom, MergeMainEveryFrom, InstallReleasesFrom planv1.SettingSource
}
Settings are a project's settings as its workers get them, each with where it comes from.
func LoadSettings ¶
LoadSettings reads the settings of project (nil outside any project): its repository's, then the developer's in Djinn's data folder home. A file that cannot be read is an error that names it.
func ResolveSettings ¶
func ResolveSettings(repo, dev *planv1.ProjectSettings) Settings
ResolveSettings merges the repository's settings and the developer's, either nil when there is none. The developer's win, setting by setting; a file that sets the provider sets the model with it, so that a model never goes to a provider it is not one of.
func (Settings) ChecksAt ¶
func (s Settings) ChecksAt(when planv1.CheckWhen) []*planv1.ProjectCheck
ChecksAt are the checks Djinn runs at when: before a commit, or before a push.
func (Settings) ChecksBrief ¶
ChecksBrief says, in a sentence or two, which checks Djinn runs on the project's work and when, and what a fresh worktree needs first; "" for a project that sets none. The lead's brief and each worker's first prompt carry it.
func (Settings) CommitGates ¶
CommitGates lists how an agent runs the commit checks, each through its gate: "`djinn gate run lint -- make lint`".
func (Settings) Integrates ¶
Integrates tells whether Djinn integrates the project's finished work by itself: once a check is set.
func (Settings) Rows ¶
func (s Settings) Rows() []*planv1.ProjectSetting
Rows are the settings as djinn project show lists them.
type Settle ¶
type Settle func(ctx context.Context, tx *store.Tx, q *planv1.Question) (func(context.Context), error)
Settle acts on the answer of q in tx, the transaction that stores it, and may change q before it is stored. It returns what follows once the answer is stored, if anything.
type SkillDir ¶
type SkillDir struct {
// Name is its folder's name.
Name string
// Dir is its folder, absolute.
Dir string
// Description is what it does, from its SKILL.md.
Description string
}
SkillDir is a skill found on this machine.
func ProjectSkills ¶
ProjectSkills are the skills held in the project folder dir, by name; none when dir is empty or has none.
type Skills ¶
type Skills struct {
planv1connect.UnimplementedSkillServiceHandler
Store *store.Store
}
Skills implements SkillService.
type Source ¶
type Source struct {
// Skill is the skill's name; Dir its folder.
Skill, Dir string
// HolderID is the project that holds the skill, Holder its name: the source is named <Holder>/<Skill>.
HolderID, Holder string
// ProjectID is the project that holds the skill or summons it: the command runs in its folder.
ProjectID string
// Watch is the command line, run without a shell.
Watch string
// Every is the least time between two starts of the command.
Every time.Duration
// Plugged tells whether the source is plugged in on this machine: only then does its command run.
Plugged bool
// Err says why the source cannot be used; nil when it can.
Err error
}
Source is the inbox source of a skill, read from its SKILL.md.
func ReadSource ¶
ReadSource reads the inbox source of the skill in dir: nil without one, an error when it cannot be used.
func Sources ¶
Sources are the inbox sources plugged in on this machine that can run, from the skills the projects use, in the projects' order then by name. A skill used by several projects runs once, in the first one's folder. A source that cannot be used is left out: djinn inbox sources says why. One not plugged in never runs.
type SpawnWatcher ¶
type SpawnWatcher func(ctx context.Context, wishID, projectID, title, watch string, restart bool) (code string, err error)
SpawnWatcher starts the watcher task of a wish, in the project projectID, on the command line watch, and gives its code. djinn up gives the harness's (harness.SpawnWatcher).
type Summoned ¶
type Summoned struct {
SkillDir
// Source is <project>/<skill>.
Source string
// ProjectID is the project that holds it.
ProjectID string
// Missing says why the skill cannot be found; empty when it is.
Missing string
}
Summoned is a skill a project summons, resolved on this machine: Missing says why it is not found.
type Template ¶
type Template struct {
// Skill is the skill's name; Dir its folder.
Skill, Dir string
// ProjectID is the project that holds the skill or summons it: the watcher runs in its folder.
ProjectID string
// Title is the new wish's title, Watch the watcher's command line, both with placeholders: {name} is the group
// name of Match. DoneWhen is a watcher line that means done.
Title, Watch, DoneWhen string
// Restart starts the watcher's command again after each exit, until its done line.
Restart bool
// Match picks the template for a request, and fills the placeholders with its named groups.
Match *regexp.Regexp
}
Template is the wish template of a skill, read from its SKILL.md.
func ReadTemplate ¶
ReadTemplate reads the wish template of the skill in dir: nil without one, an error when it cannot be used.
type Tilasms ¶
type Tilasms struct {
planv1connect.UnimplementedTilasmServiceHandler
Store *store.Store
// Home is Djinn's data folder: the tilasms' files are in its folder tilasms. Empty: the service is unavailable.
Home string
// MaxBytes is the ceiling of a new tilasm, in bytes; 0: DefaultTilasmBytes.
MaxBytes int64
// Show shows a tilasm in the window, in its wish's Tilasms tab, and tells whether a native window came to the
// front. Nil: Open is unavailable.
Show func(wishID, tilasmID string) bool
// URL is the local http address of a tilasm's latest version, by its identifier; empty, or nil, while Djinn serves
// no http.
URL func(id string) string
}
Tilasms implements TilasmService.
func (*Tilasms) Files ¶
Files serves the latest version of each tilasm at server.TilasmPrefix: /tilasm/<id>/ is its index.html, and its other files are under it, by their paths. Every answer carries tilasmPolicy. A folder serves its index.html, never a listing.
func (*Tilasms) PutData ¶
func (t *Tilasms) PutData( ctx context.Context, req *connect.Request[planv1.TilasmServicePutDataRequest], ) (*connect.Response[planv1.TilasmServicePutDataResponse], error)
PutData puts the files the window read: they are written to a temporary folder of the tilasms' folder, then put as a folder, or as a .zip, or imported when the .zip is a tilasm's export. The journal keeps the request without the files' contents, as a wish's import does.
type Told ¶
Told tells the wish's lead that q was answered, did saying what the hooks did with the answer.
type WishWorkers ¶
type WishWorkers interface {
Shelve(ctx context.Context, wishID string)
Wake()
// StopWish stops the wish's workers for good, and waits until they have ended.
StopWish(ctx context.Context, wishID string) error
}
WishWorkers reaches the workers of the wishes: djinn up gives the harness's. A paused wish's workers stop, and wait to resume with it; a wish active again wakes the scheduler, which starts them.
type Wishes ¶
type Wishes struct {
planv1connect.UnimplementedWishServiceHandler
Store *store.Store
// Leads runs the leads' terminals; nil where djinn up does not serve them, and Resume is then unavailable.
Leads Leads
// Pages renders the wishes' pages and keeps the synced ones up to date; nil where djinn up does not run them,
// and Sync is then unavailable.
Pages *Pages
// Language of the texts Djinn writes in the plan for the developer; English when empty.
Language string
// Watchers starts the watcher of a wish made from a template; nil where djinn up does not run tasks, and the
// lead is then told to start it.
Watchers SpawnWatcher
// Workers stops the workers of a paused wish, and wakes the scheduler for an active one; nil where djinn up does
// not run tasks.
Workers WishWorkers
// Home is Djinn's data folder, which holds the tilasms' files; empty: a wish with tilasms neither exports nor
// imports.
Home string
// contains filtered or unexported fields
}
Wishes implements WishService.
func (*Wishes) Activate ¶
func (w *Wishes) Activate( ctx context.Context, req *connect.Request[planv1.WishServiceActivateRequest], ) (*connect.Response[planv1.WishServiceActivateResponse], error)
Activate makes a paused or granted wish active again, last by rank. Three wishes being active, it takes the third place, and the third wish is paused: only the three first wishes are active.
func (*Wishes) Allow ¶
func (w *Wishes) Allow( ctx context.Context, req *connect.Request[planv1.WishServiceAllowRequest], ) (*connect.Response[planv1.WishServiceAllowResponse], error)
Allow gives the wish's workers a right in one of its projects, or takes it back with ALLOWANCE_NONE.
func (*Wishes) Answered ¶
Answered tells the lead of q's wish that the developer answered q, in one line, with what Djinn did with the answer (did) when it settled it. Handlers calls it once the answer is stored, when it serves the leads; the answer stays in the brief whatever happens here.
func (*Wishes) Brief ¶
func (w *Wishes) Brief( ctx context.Context, req *connect.Request[planv1.WishServiceBriefRequest], ) (*connect.Response[planv1.WishServiceBriefResponse], error)
Brief writes the brief of a wish.
func (*Wishes) Delete ¶
func (w *Wishes) Delete( ctx context.Context, req *connect.Request[planv1.WishServiceDeleteRequest], ) (*connect.Response[planv1.WishServiceDeleteResponse], error)
Delete deletes a wish and everything that belongs to it: its tasks and their events, its questions, its blocks. Its workers stop first: an active wish is paused, which the journal records, so that no task of it starts again. Once it is gone, its lead's terminal closes, and each task's worktree that holds no work is removed (cleanWorktree); the others stay, the response says why. Every branch stays. An inbox item routed to it forgets it.
func (*Wishes) Describe ¶
func (w *Wishes) Describe( ctx context.Context, req *connect.Request[planv1.WishServiceDescribeRequest], ) (*connect.Response[planv1.WishServiceDescribeResponse], error)
Describe sets the wish's description, in place of what it had; empty takes it back to the title.
func (*Wishes) Enlightened ¶
Enlightened tells the lead of q's wish that the developer wants to know more before answering q, with their note.
func (*Wishes) Export ¶
func (w *Wishes) Export( ctx context.Context, req *connect.Request[planv1.WishServiceExportRequest], ) (*connect.Response[planv1.WishServiceExportResponse], error)
Export writes the wish to a file.
func (*Wishes) Grant ¶
func (w *Wishes) Grant( ctx context.Context, req *connect.Request[planv1.WishServiceGrantRequest], ) (*connect.Response[planv1.WishServiceGrantResponse], error)
Grant grants a wish: the user says it is done. Djinn proposes it when the wish is ready, and never grants it itself; the user may grant it at any time.
func (*Wishes) Import ¶
func (w *Wishes) Import( ctx context.Context, req *connect.Request[planv1.WishServiceImportRequest], ) (*connect.Response[planv1.WishServiceImportResponse], error)
Import reads a wish from a file.
func (*Wishes) ImportData ¶
func (w *Wishes) ImportData( ctx context.Context, req *connect.Request[planv1.WishServiceImportDataRequest], ) (*connect.Response[planv1.WishServiceImportDataResponse], error)
ImportData reads a wish from the content of a file.
func (*Wishes) Move ¶
func (w *Wishes) Move( ctx context.Context, req *connect.Request[planv1.WishServiceMoveRequest], ) (*connect.Response[planv1.WishServiceMoveResponse], error)
Move gives a wish another rank, and shifts the others. A wish that is not active becomes active at that rank, the third at most; the wish it pushes past the third place is paused.
func (*Wishes) Pause ¶
func (w *Wishes) Pause( ctx context.Context, req *connect.Request[planv1.WishServicePauseRequest], ) (*connect.Response[planv1.WishServicePauseResponse], error)
Pause sets an active wish aside: it keeps everything, its workers stop until it is active again, and it leaves its place to another one.
func (*Wishes) Render ¶
func (w *Wishes) Render( ctx context.Context, req *connect.Request[planv1.WishServiceRenderRequest], ) (*connect.Response[planv1.WishServiceRenderResponse], error)
Render writes the page of a wish to a file.
func (*Wishes) Route ¶
func (w *Wishes) Route( ctx context.Context, req *connect.Request[planv1.WishServiceRouteRequest], ) (*connect.Response[planv1.WishServiceRouteResponse], error)
Route proposes where a request goes; with ask, it asks it as a question on the wish the request came to.
func (*Wishes) SetIntegration ¶
func (*Wishes) Snapshot ¶
func (w *Wishes) Snapshot( ctx context.Context, req *connect.Request[planv1.WishServiceSnapshotRequest], ) (*connect.Response[planv1.WishServiceSnapshotResponse], error)
Snapshot returns everything the wish holds, with the identifiers and folders of this machine.
func (*Wishes) Sync ¶
func (w *Wishes) Sync( ctx context.Context, req *connect.Request[planv1.WishServiceSyncRequest], ) (*connect.Response[planv1.WishServiceSyncResponse], error)
Sync renders the page of a wish in the data directory, and keeps it up to date while djinn up runs.
func (*Wishes) Tell ¶
Tell types line in the terminal of the lead of the wish wishID, then Enter, once the person is not typing there: the lead reads it as a message, and acts. A lead that does not run is reopened first, on its session, as Resume does, without bringing the window to the front; only an active wish's lead is reopened. ErrNoLead when there is none to tell.
func (*Wishes) Watch ¶
func (w *Wishes) Watch( ctx context.Context, req *connect.Request[planv1.WishServiceWatchRequest], stream *connect.ServerStream[planv1.WishServiceWatchResponse], ) error
Watch follows the changes of the wishes: a first message that names everything, then the changes, coalesced, with the tasks, questions and blocks that changed.
func (*Wishes) Watched ¶
func (w *Wishes) Watched(ctx context.Context, task *planv1.Task, text string) (done bool, err error)
Watched reads a paragraph the watcher task printed, and says whether it holds the done line of its wish's template: Djinn then asks the developer whether to grant the wish, once while the question is open. It never grants the wish itself. A wish granted already, or without a template, is left as it is.