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 AccountEnv(a *planv1.Account) []string
- func AccountLogin(a *planv1.Account, goos string) string
- func AccountStatus(provider planv1.Provider) []string
- func Active(wish *planv1.Wish) bool
- func ActiveWishes(ctx context.Context, r store.Reader) ([]*planv1.Wish, error)
- func AllMerged(tasks []*planv1.Task) bool
- func AllowServe(home, projectID, command string, revoke bool) ([]string, error)
- func AllowWatch(home, projectID, command string, revoke bool) ([]string, error)
- func AllowanceOf(wish *planv1.Wish, projectID string) planv1.Allowance
- func AnswerLine(q *planv1.Question, did string) string
- func ApprovedLine(q *planv1.Question, by string) string
- func Ask(ctx context.Context, tx *store.Tx, question *planv1.Question) error
- func AskedLine(q *planv1.Question, task string) string
- func AzimaBranchName(a *planv1.Task) string
- func AzimaDependenciesText(deps []AzimaDependency) string
- func AzimaMergeRunning(azima *planv1.Task, tasks []*planv1.Task, branch string) string
- func AzimaOf(t *planv1.Task, byID map[string]*planv1.Task) *planv1.Task
- func AzimaOrder(tasks []*planv1.Task) []*planv1.Task
- func AzimaPlaces(tasks []*planv1.Task) map[string]int
- func BatchEvents(events []*planv1.LeadEvent) []*planv1.LeadEvent
- func BuildGlobalBrief(ctx context.Context, r store.Reader, home string) (string, error)
- func BuildWishesBrief(ctx context.Context, r store.Reader, home string) (string, error)
- func CallerActor(ctx context.Context) string
- func CanIfrit(p planv1.Provider) bool
- func CanReadOnly(p planv1.Provider) bool
- func CanResume(p planv1.Provider) bool
- func CarryLead(ctx context.Context, s *store.Store) (*planv1.Lead, error)
- func ChangedLine(q *planv1.Question, was *planv1.Answer, did string) string
- func CheckedOutBranch(ctx context.Context, dir string) string
- func ChecksText(checks []*planv1.ProjectCheck) string
- func ChosenPlan(q *planv1.Question) *planv1.PlannedTask
- func CircleModels(ctx context.Context, providers []*planv1.CircleProvider, userHome, path string) []*planv1.CircleModel
- func CircleProviders(ctx context.Context, djinnHome, userHome, path string, leadDriven bool) []*planv1.CircleProvider
- func CleanContext(context string) string
- func CleanVersions(ctx context.Context, s *store.Store) error
- func CloserWord(c planv1.Closer) string
- func ClosesCycle(task *planv1.Task, deps []string, azima string, tasks []*planv1.Task) string
- func CompareCodes(a, b string) int
- func ConfigCache(home string) string
- func ConfigDir(home string, project *planv1.Project) string
- func ConfigReference(ctx context.Context, home string, project *planv1.Project) (string, error)
- func ContextWarnings(context string) []string
- func CountGate(ctx context.Context, tx *store.Tx, ev *planv1.TaskEvent) error
- func CutNeeds(text string) (rest, needs string, ok bool)
- func Decision(ctx context.Context, r store.Reader, wishID, ref string) (string, error)
- func DecisionPrompt(q *planv1.Question) string
- func DefaultCircleModel(p planv1.Provider) string
- func DefaultReference(ctx context.Context, dir string) (branch, ref string, err error)
- func DependencyAzimas(azima *planv1.Task, tasks []*planv1.Task) []*planv1.Task
- func Description(dir string) string
- func DeveloperSettingsFile(home, projectID string) string
- func DigestKeeps(e *planv1.LeadEvent) bool
- func DigestLine(e *planv1.LeadEvent, title string) string
- func DigestTitles(ctx context.Context, r store.Reader, events []*planv1.LeadEvent) map[string]string
- func DoneLine(t *planv1.WishTemplate, text string) string
- func DoneLineOf(done, text string) string
- func DoneWithProblems(t *planv1.Task) bool
- func Downloads() (string, error)
- func DrivenRules(projects []*planv1.Project, home string) string
- func EffectiveWishPushStrategy(ctx context.Context, r store.Reader, home string, wish *planv1.Wish) (planv1.PushStrategy, planv1.SettingSource, error)
- func EndLeadBatch(ctx context.Context, s *store.Store, b *planv1.LeadBatch, now time.Time) error
- func EnlightenLine(q *planv1.Question, note, worker string) string
- func Entities() []proto.Message
- func EventWishes(events []*planv1.LeadEvent) []string
- func FiledLine(wishID, from, text string) string
- func FillAzimas(tasks []*planv1.Task)
- func FillBabysit(watch string, number int, state string) string
- func FillPrompts(ctx context.Context, r store.Reader, tasks []*planv1.Task) error
- func FillTilasms(ctx context.Context, r store.Reader, tasks []*planv1.Task) error
- func FillTimes(ctx context.Context, s *store.Store, tasks []*planv1.Task, now time.Time) error
- func FindAccount(accounts []*planv1.Account, name string) *planv1.Account
- func FindUnknownFields(b []byte, m proto.Message) []string
- 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 HasUnfinishedParts(id string, tasks []*planv1.Task) bool
- func HoldIn(p *planv1.WishPush, branch string) *planv1.PushHold
- func HoldText(tilasm *planv1.Tilasm, h *planv1.TilasmHold) string
- func HoldsHome(dir string) bool
- func InboxFiledLine(wishID, source, text string) string
- func InboxFirstLine(source, text string) string
- func InstallQuestionsWord(q planv1.InstallQuestions) string
- func IntegrationBranchOf(wish *planv1.Wish, projectID string) string
- func Investigating(q *planv1.Question) bool
- func IsAntigravityModel(m string) bool
- func IsAzima(t *planv1.Task) bool
- func IsClaudeModel(m string) bool
- func IsCodexModel(m string) bool
- func IsDecision(text, code string) bool
- func IsMerge(t *planv1.Task) bool
- func IsMockupPlan(p *planv1.PlannedTask) bool
- func IterateLine(ctx context.Context, r store.Reader, q *planv1.Question, round *planv1.Round) string
- func Iterates(q *planv1.Question, choice planv1.Choice) *planv1.PlannedTask
- func Iterating(q *planv1.Question) *planv1.Round
- func Iterations(q *planv1.Question) int
- func JournalCommand(command string) string
- func JournalEntry(b *planv1.LeadBatch) string
- func JournalFailedCommand(command string) string
- func JournalNote(text string) string
- func JournalTokens(s string) int
- func KeepAzimaRecord(e, recorded *planv1.Azima)
- func KeepSourceRun(ctx context.Context, st *store.Store, s *Source, end time.Time, items int, ...) error
- func LaunchCommand(q *planv1.Question) string
- func LeadAgent(provider planv1.Provider) error
- func LeadFolder(home string) string
- func LeadJournal(ctx context.Context, r store.Reader, wishIDs []string, n int) ([]*planv1.LeadBatch, error)
- func LeadPacket(ctx context.Context, r store.Reader, home string, events []*planv1.LeadEvent, ...) (string, error)
- func LeadWatchRule() string
- func Linked(ctx context.Context, r store.Reader, l link.Link) (string, error)
- func LookAtConfig(ctx context.Context, st *store.Store, home string, project *planv1.Project, ...) error
- func MadeLine(wish *planv1.Wish, provisional bool) string
- func MergeHost(t *planv1.Task, byID map[string]*planv1.Task) string
- func MergeMainWord(m planv1.MergeMain) string
- func MergeRunning(wish *planv1.Wish, tasks []*planv1.Task, projectID string) string
- func MergeServes(t *planv1.Task, byID map[string]*planv1.Task) []string
- func MergedText(t *planv1.Task) string
- func MigrateCircle(home string)
- func MockupOption(q *planv1.Question, tilasmID string) *planv1.PlannedTask
- func MockupRounds(p *planv1.PlannedTask) int
- func NeedsWords(needs []*planv1.ProofNeed) string
- func NextQuestionCode(ctx context.Context, r store.Reader, wishID string) (string, error)
- func NextTaskNumber(ctx context.Context, r store.Reader, wishID, letter string) (string, error)
- func NormalizeCircleModel(model string) string
- func NoteEditedLine(q *planv1.Question) string
- func Paginate[T any](items []T, pageSize int32, pageToken string) ([]T, string, int32, error)
- func ParsePlan(text string) (*planv1.PlannedTask, error)
- func ParseSleep(ctx context.Context, tx *store.Tx, wishID string, texts []string, ...) ([]*planv1.SleepCondition, error)
- func PreviewWorkerDefaults(p planv1.Provider, model string) []*planv1.WorkerSeat
- func ProjectChanges(ctx context.Context, r store.Reader, projectID string) ([]*planv1.ConfigChange, error)
- func ProjectNamed(ctx context.Context, r store.Reader, name string) (*planv1.Project, error)
- func ProjectPushWord(p planv1.ProjectPush) string
- func ProverWord(p planv1.Prover, n *planv1.ProofNeed) string
- func Provers(needs string) (provers []planv1.Prover, reviewerName string)
- func ProviderForCircleModel(model string) planv1.Provider
- func ProviderLogin(provider planv1.Provider) string
- func PushHeld(hold *planv1.PushHold) bool
- func PushStateOf(wish *planv1.Wish, projectID string) *planv1.WishPush
- func PushStrategyWord(p planv1.PushStrategy) string
- func PutBlock(ctx context.Context, tx *store.Tx, m *planv1.BlockServicePutRequest) (*planv1.Block, error)
- func PutLeadBatch(ctx context.Context, s *store.Store, b *planv1.LeadBatch) error
- func QuestionWorkerOf(ctx context.Context, r store.Reader, q *planv1.Question, role planv1.TaskRole) (*planv1.Task, error)
- func QueueLeadEvent(ctx context.Context, s *store.Store, e *planv1.LeadEvent, now time.Time) error
- func Ranked(all []*planv1.Wish) []*planv1.Wish
- func ReadAccounts(home string) []*planv1.Account
- func ReadCircle(home string) []*planv1.WorkerSeat
- func ReadLeadSeat(home string) *planv1.LeadSeat
- func ReadPermissions(dir string) (*djinnv1.Permissions, []string, error)
- func ReadSettings(path string) (*planv1.ProjectSettings, error)
- func ReadSettingsWithWarnings(path string) (*planv1.ProjectSettings, []string, error)
- func ReadShownTheme(home string) uiv1.ShownTheme
- func ReadTaskItemNeeds(line string) (box, needs string, ok bool)
- func Ready(tasks []*planv1.Task, questions []*planv1.Question) bool
- func Recommended(q *planv1.Question) (planv1.Choice, bool)
- func RefCommit(ctx context.Context, dir, ref string) (string, error)
- func ReferenceName(ctx context.Context, home string, project *planv1.Project) (branch, ref string)
- func RefsStamp(folder string) string
- func RefuseAzimaDependencies(tasks, graph []*planv1.Task) error
- func RefuseStranding(wish *planv1.Wish, tasks []*planv1.Task, to planv1.PushStrategy) error
- func RefuseSwitchToAzima(tasks []*planv1.Task) error
- func ResetWarnedUnknownFields()
- func ResolveWish(ctx context.Context, r store.Reader, name string) (*planv1.Wish, error)
- func ResolveWishPushStrategy(wish *planv1.Wish, settings Settings) (planv1.PushStrategy, planv1.SettingSource)
- func ResolveWorkerSeat(home string, kind planv1.WorkerKind) (provider planv1.Provider, model string, explicit bool)
- func RevisionDetail(ctx context.Context, r store.Reader, q *planv1.Question) (string, error)
- func RoutedLine(q *planv1.Question) string
- func SameSeat(a, b *planv1.LeadSeat) bool
- func SaveDeveloperInstallQuestions(home, projectID string, questions planv1.InstallQuestions) error
- func SaveDeveloperMainBranch(home, projectID, branch string) error
- func SaveDeveloperPush(home, projectID string, push planv1.ProjectPush) error
- func SaveDeveloperPushStrategy(home, projectID string, strategy planv1.PushStrategy) error
- func SeatText(seat *planv1.LeadSeat, accounts []*planv1.Account) string
- func SendLine(tilasm *planv1.Tilasm, send *planv1.TilasmSend, ...) string
- func SetIntegrationBranch(wish *planv1.Wish, projectID, branch string)
- func SetLeadSettle(s *store.Store, quiet, most time.Duration)
- func SetShownTheme(home string, theme uiv1.ShownTheme) error
- func SetWatchInterval(d time.Duration) (restore func())
- func SettlePushHolds(p *planv1.WishPush)
- func Settled(t *planv1.Task) bool
- func Shelf(all []*planv1.Wish, state planv1.WishState) []*planv1.Wish
- func SleepAllHold(q *planv1.Question, tasks []*planv1.Task, now time.Time) bool
- func SleepHolds(c *planv1.SleepCondition, tasks []*planv1.Task, now time.Time) bool
- func SleepText(c *planv1.SleepCondition) string
- func SleepTexts(q *planv1.Question) string
- func Slug(s string, n int) string
- func StableBrief(home string, projects []*planv1.Project) string
- func StartLine() string
- func Status(err error) error
- func SweepTilasmTemp(home string) (removed, kept []string, err error)
- func TilasmContext(ctx context.Context, r store.Reader, home, wishID string, names []string) (string, error)
- func TilasmDir(home, id string) string
- func TilasmDirs(home, prompt string) []string
- func TilasmLink(id string) string
- func Tone(theme uiv1.ShownTheme) string
- func Tour(q *planv1.Question) int
- func UpdateWorkerDefaults(home string, p planv1.Provider, model string) ([]*planv1.WorkerSeat, error)
- func ValidWorkerProvider(p planv1.Provider) bool
- func ValidateProviderModel(p planv1.Provider, model string) error
- func ValidateQuestionModel(workerProvider, questionProvider planv1.Provider, model string) error
- func ValidateTaskModel(p planv1.Provider, model string) (string, error)
- func WaitingLine(n int) string
- func Waits(c *planv1.ConfigChange) bool
- func Wake(question *planv1.Question, now time.Time, byHand bool)
- func WarnUnknownField(path, field string) string
- func WhenWord(w planv1.CheckWhen) string
- func WhyLeadLaunches(q *planv1.Question, p *planv1.PlannedTask) string
- func WhyStale(p *planv1.PlannedTask, tasks []*planv1.Task) string
- func WishLead(w *planv1.Wish) *planv1.Lead
- func WithAzimas(tasks []*planv1.Task) []*planv1.Task
- func WithCaller(ctx context.Context, caller *WorkerCaller) context.Context
- func WokeLine(q *planv1.Question) string
- func WriteAfter(file string, codes []string) (bool, error)
- func WriteCode(file string, code string) (bool, error)
- func WriteDescription(file string, text string) (bool, error)
- func WriteStatus(file string, status string) (bool, error)
- func WriteTitle(file string, code string, title string) (bool, error)
- func WriteWish(file string, wish string) (bool, error)
- type AnswerHook
- type AzimaDependency
- type AzimaFile
- type Babysit
- 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 BranchHold
- type Brief
- type Config
- type DoneWhen
- type FetchRef
- type IfritWaits
- 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 IterateHook
- type LaunchPlan
- type LeadDrive
- func (d *LeadDrive) Batch() *planv1.LeadBatch
- func (d *LeadDrive) Fail(why string)
- func (d *LeadDrive) Failure() string
- func (d *LeadDrive) LeadLimit() *planv1.LeadLimit
- func (d *LeadDrive) Retried() <-chan struct{}
- func (d *LeadDrive) SetBatch(b *planv1.LeadBatch)
- func (d *LeadDrive) SetLimit(l *planv1.LeadLimit, why string)
- type LeadService
- func (s *LeadService) Accounts(_ context.Context, _ *connect.Request[planv1.LeadServiceAccountsRequest]) (*connect.Response[planv1.LeadServiceAccountsResponse], error)
- func (s *LeadService) AddAccount(ctx context.Context, req *connect.Request[planv1.LeadServiceAddAccountRequest]) (*connect.Response[planv1.LeadServiceAddAccountResponse], error)
- func (s *LeadService) Brief(ctx context.Context, req *connect.Request[planv1.LeadServiceBriefRequest]) (*connect.Response[planv1.LeadServiceBriefResponse], error)
- func (s *LeadService) Choose(ctx context.Context, req *connect.Request[planv1.LeadServiceChooseRequest]) (*connect.Response[planv1.LeadServiceChooseResponse], error)
- func (s *LeadService) Event(ctx context.Context, req *connect.Request[planv1.LeadServiceEventRequest]) (*connect.Response[planv1.LeadServiceEventResponse], error)
- func (s *LeadService) Get(ctx context.Context, req *connect.Request[planv1.LeadServiceGetRequest]) (*connect.Response[planv1.LeadServiceGetResponse], error)
- func (s *LeadService) GetCircle(ctx context.Context, _ *connect.Request[planv1.LeadServiceGetCircleRequest]) (*connect.Response[planv1.LeadServiceGetCircleResponse], error)
- func (s *LeadService) Journal(ctx context.Context, req *connect.Request[planv1.LeadServiceJournalRequest]) (*connect.Response[planv1.LeadServiceJournalResponse], error)
- func (s *LeadService) Move(ctx context.Context, req *connect.Request[planv1.LeadServiceMoveRequest]) (*connect.Response[planv1.LeadServiceMoveResponse], error)
- func (s *LeadService) Notes(ctx context.Context, req *connect.Request[planv1.LeadServiceNotesRequest]) (*connect.Response[planv1.LeadServiceNotesResponse], error)
- func (s *LeadService) RemoveAccount(ctx context.Context, ...) (*connect.Response[planv1.LeadServiceRemoveAccountResponse], error)
- func (s *LeadService) Resume(ctx context.Context, req *connect.Request[planv1.LeadServiceResumeRequest]) (*connect.Response[planv1.LeadServiceResumeResponse], error)
- func (s *LeadService) Say(ctx context.Context, req *connect.Request[planv1.LeadServiceSayRequest]) (*connect.Response[planv1.LeadServiceSayResponse], error)
- func (s *LeadService) Sessions(ctx context.Context, req *connect.Request[planv1.LeadServiceSessionsRequest]) (*connect.Response[planv1.LeadServiceSessionsResponse], error)
- func (s *LeadService) Set(ctx context.Context, req *connect.Request[planv1.LeadServiceSetRequest]) (*connect.Response[planv1.LeadServiceSetResponse], error)
- func (s *LeadService) SetCircle(ctx context.Context, req *connect.Request[planv1.LeadServiceSetCircleRequest]) (*connect.Response[planv1.LeadServiceSetCircleResponse], error)
- func (s *LeadService) Show(ctx context.Context, req *connect.Request[planv1.LeadServiceShowRequest]) (*connect.Response[planv1.LeadServiceShowResponse], error)
- func (s *LeadService) Tell(ctx context.Context, req *connect.Request[planv1.LeadServiceTellRequest]) (*connect.Response[planv1.LeadServiceTellResponse], error)
- func (s *LeadService) Watch(ctx context.Context, req *connect.Request[planv1.LeadServiceWatchRequest]) (*connect.Response[planv1.LeadServiceWatchResponse], 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 WithClock(now func() time.Time) Option
- func WithEnlightened(f func(context.Context, *planv1.Question, string)) Option
- func WithFillModels(f func(context.Context, []*planv1.Task)) Option
- func WithHome(home string) Option
- func WithIfritWaits(waits IfritWaits) Option
- func WithIterated(f IterateHook) Option
- func WithLanguage(language string) Option
- func WithLaunch(f LaunchPlan) Option
- func WithLeadBroadcaster(b *func()) Option
- func WithLeadFailed(err error) Option
- func WithLeads(l Leads) Option
- func WithLoad(load func() djinnv1.LoadNotch) Option
- func WithLoadBroadcaster(b *func(djinnv1.LoadNotch)) Option
- func WithOverlaps(overlaps Overlaps) Option
- func WithPages(p *Pages) Option
- func WithPublisher(p *Publisher) Option
- func WithPusher(p Pusher) 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 Overlaps
- type Pages
- type Projects
- func (p *Projects) Acknowledge(ctx context.Context, ...) (*connect.Response[planv1.ProjectServiceAcknowledgeResponse], error)
- func (p *Projects) Add(ctx context.Context, req *connect.Request[planv1.ProjectServiceAddRequest]) (*connect.Response[planv1.ProjectServiceAddResponse], error)
- func (p *Projects) Allow(ctx context.Context, req *connect.Request[planv1.ProjectServiceAllowRequest]) (*connect.Response[planv1.ProjectServiceAllowResponse], error)
- func (p *Projects) Branches(ctx context.Context, ...) (*connect.Response[planv1.ProjectServiceBranchesResponse], error)
- func (p *Projects) ForgetSync(ctx context.Context, ...) (*connect.Response[planv1.ProjectServiceForgetSyncResponse], error)
- func (p *Projects) List(ctx context.Context, _ *connect.Request[planv1.ProjectServiceListRequest]) (*connect.Response[planv1.ProjectServiceListResponse], error)
- func (p *Projects) Pull(ctx context.Context, req *connect.Request[planv1.ProjectServicePullRequest]) (*connect.Response[planv1.ProjectServicePullResponse], error)
- func (p *Projects) Push(ctx context.Context, req *connect.Request[planv1.ProjectServicePushRequest]) (*connect.Response[planv1.ProjectServicePushResponse], error)
- func (p *Projects) PushStrategy(ctx context.Context, ...) (*connect.Response[planv1.ProjectServicePushStrategyResponse], error)
- func (p *Projects) SetBranch(ctx context.Context, ...) (*connect.Response[planv1.ProjectServiceSetBranchResponse], error)
- func (p *Projects) SetPush(ctx context.Context, req *connect.Request[planv1.ProjectServiceSetPushRequest]) (*connect.Response[planv1.ProjectServiceSetPushResponse], error)
- func (p *Projects) Show(ctx context.Context, req *connect.Request[planv1.ProjectServiceShowRequest]) (*connect.Response[planv1.ProjectServiceShowResponse], error)
- type PublishBlockedError
- type Published
- type Publisher
- type Pusher
- 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) Get(ctx context.Context, req *connect.Request[planv1.QuestionServiceGetRequest]) (*connect.Response[planv1.QuestionServiceGetResponse], error)
- func (q *Questions) Later(ctx context.Context, req *connect.Request[planv1.QuestionServiceLaterRequest]) (*connect.Response[planv1.QuestionServiceLaterResponse], error)
- func (q *Questions) Launch(ctx context.Context, req *connect.Request[planv1.QuestionServiceLaunchRequest]) (*connect.Response[planv1.QuestionServiceLaunchResponse], error)
- func (q *Questions) List(ctx context.Context, req *connect.Request[planv1.QuestionServiceListRequest]) (*connect.Response[planv1.QuestionServiceListResponse], error)
- func (q *Questions) Move(ctx context.Context, req *connect.Request[planv1.QuestionServiceMoveRequest]) (*connect.Response[planv1.QuestionServiceMoveResponse], error)
- func (q *Questions) Revise(ctx context.Context, req *connect.Request[planv1.QuestionServiceReviseRequest]) (*connect.Response[planv1.QuestionServiceReviseResponse], error)
- func (q *Questions) Sleep(ctx context.Context, req *connect.Request[planv1.QuestionServiceSleepRequest]) (*connect.Response[planv1.QuestionServiceSleepResponse], error)
- func (q *Questions) Withdraw(ctx context.Context, ...) (*connect.Response[planv1.QuestionServiceWithdrawResponse], 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) CheckPublish(ctx context.Context, ...) (*connect.Response[planv1.TilasmServiceCheckPublishResponse], error)
- func (t *Tilasms) Comments(ctx context.Context, req *connect.Request[planv1.TilasmServiceCommentsRequest]) (*connect.Response[planv1.TilasmServiceCommentsResponse], error)
- func (t *Tilasms) ConfirmPublish(ctx context.Context, ...) (*connect.Response[planv1.TilasmServiceConfirmPublishResponse], error)
- func (t *Tilasms) DeleteComment(ctx context.Context, ...) (*connect.Response[planv1.TilasmServiceDeleteCommentResponse], error)
- func (t *Tilasms) Drafts(ctx context.Context, req *connect.Request[planv1.TilasmServiceDraftsRequest]) (*connect.Response[planv1.TilasmServiceDraftsResponse], error)
- 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) PlaceComments(ctx context.Context, ...) (*connect.Response[planv1.TilasmServicePlaceCommentsResponse], error)
- func (t *Tilasms) Publish(ctx context.Context, req *connect.Request[planv1.TilasmServicePublishRequest]) (*connect.Response[planv1.TilasmServicePublishResponse], error)
- func (t *Tilasms) Put(ctx context.Context, req *connect.Request[planv1.TilasmServicePutRequest]) (*connect.Response[planv1.TilasmServicePutResponse], error)
- func (t *Tilasms) PutComment(ctx context.Context, ...) (*connect.Response[planv1.TilasmServicePutCommentResponse], error)
- func (t *Tilasms) PutData(ctx context.Context, req *connect.Request[planv1.TilasmServicePutDataRequest]) (*connect.Response[planv1.TilasmServicePutDataResponse], error)
- func (t *Tilasms) Reply(ctx context.Context, req *connect.Request[planv1.TilasmServiceReplyRequest]) (*connect.Response[planv1.TilasmServiceReplyResponse], error)
- func (t *Tilasms) Restore(ctx context.Context, req *connect.Request[planv1.TilasmServiceRestoreRequest]) (*connect.Response[planv1.TilasmServiceRestoreResponse], error)
- func (t *Tilasms) SendComments(ctx context.Context, ...) (*connect.Response[planv1.TilasmServiceSendCommentsResponse], error)
- type Told
- type UnreadableSkillError
- type WishWorkers
- type Wishes
- func (w *Wishes) Activate(ctx context.Context, req *connect.Request[planv1.WishServiceActivateRequest]) (*connect.Response[planv1.WishServiceActivateResponse], error)
- func (w *Wishes) AddProject(ctx context.Context, req *connect.Request[planv1.WishServiceAddProjectRequest]) (*connect.Response[planv1.WishServiceAddProjectResponse], 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, was *planv1.Answer, did string)
- func (w *Wishes) Approved(ctx context.Context, q *planv1.Question)
- func (w *Wishes) Asked(ctx context.Context, q *planv1.Question)
- func (w *Wishes) Brief(ctx context.Context, req *connect.Request[planv1.WishServiceBriefRequest]) (*connect.Response[planv1.WishServiceBriefResponse], error)
- func (w *Wishes) ChangeLead()
- func (w *Wishes) ChangeLoad(notch djinnv1.LoadNotch)
- 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) Drive() *LeadDrive
- 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) Icon(ctx context.Context, req *connect.Request[planv1.WishServiceIconRequest]) (*connect.Response[planv1.WishServiceIconResponse], error)
- func (w *Wishes) Icons(_ context.Context, req *connect.Request[planv1.WishServiceIconsRequest]) (*connect.Response[planv1.WishServiceIconsResponse], 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) Iterated(ctx context.Context, q *planv1.Question, round *planv1.Round)
- func (w *Wishes) LeadEventsChanged() <-chan struct{}
- 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) NoteEdited(ctx context.Context, q *planv1.Question, was string)
- func (w *Wishes) Notify(ctx context.Context, e *planv1.LeadEvent) error
- func (w *Wishes) Pause(ctx context.Context, req *connect.Request[planv1.WishServicePauseRequest]) (*connect.Response[planv1.WishServicePauseResponse], error)
- func (w *Wishes) PushStrategy(ctx context.Context, ...) (*connect.Response[planv1.WishServicePushStrategyResponse], error)
- func (w *Wishes) Queued()
- func (w *Wishes) RemindLead()
- func (w *Wishes) Rename(ctx context.Context, req *connect.Request[planv1.WishServiceRenameRequest]) (*connect.Response[planv1.WishServiceRenameResponse], error)
- func (w *Wishes) Render(ctx context.Context, req *connect.Request[planv1.WishServiceRenderRequest]) (*connect.Response[planv1.WishServiceRenderResponse], error)
- func (w *Wishes) Reorder(ctx context.Context, req *connect.Request[planv1.WishServiceReorderRequest]) (*connect.Response[planv1.WishServiceReorderResponse], 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) 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) WaitLeadEvents(ctx context.Context) ([]*planv1.LeadEvent, 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)
- func (w *Wishes) Woke(ctx context.Context, q *planv1.Question)
- type WorkerCaller
Constants ¶
const ( ForgeGitHub = "github" ForgeGitLab = "gitlab" )
Forges a babysit declaration may name.
const ( // DrivenRulesVersion names the text of DrivenRules: every batch's session reads the version it got. DrivenRulesVersion = "6" // JournalMax is how many of the latest batches of its wishes a batch's prompt carries at most. JournalMax = 6 // JournalMaxTokens caps the lead's journal section of a batch's prompt in tokens (at 4 runes per token). JournalMaxTokens = 1200 // JournalCommandsMax is how many of a batch's commands the journal keeps, the first ones. JournalCommandsMax = 20 )
const ( // DefaultPageSize is the default number of items returned when page_size is not specified or <= 0. DefaultPageSize = 50 // MaxPageSize is the maximum allowed page size. MaxPageSize = 200 )
const ( DefaultMergeMain = planv1.MergeMain_MERGE_MAIN_RELEASE DefaultMergeMainEvery = time.Hour DefaultInstallQuestions = planv1.InstallQuestions_INSTALL_QUESTIONS_ALWAYS )
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 read and revise a question; and a cap, so that one never runs long.
const ( BlockingCap = 2 FreeCap = 3 )
The questions a worker may ask about its own task: blocking ones one at a time and BlockingCap in all, and FreeCap that do not block. The questions Djinn asks about the task (a move it proposes, its edit question) do not count.
const ArtifactModel = "claude-haiku-5-5"
ArtifactModel makes the calls of a publish: read the live version, read the page, publish it; nothing to write.
const ( // ArtifactTimeout is how long a publish may take, its wait for the paid gate left out. ArtifactTimeout = 5 * time.Minute )
The limits of a publish: a call that makes two tool calls, maybe three when the first publish again is refused.
const ConfigLookEvery = 5 * time.Minute
ConfigLookEvery is how often Djinn looks at the reference branch of each project.
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 DefaultMockupRounds = 3
DefaultMockupRounds is how many versions of its tilasm a mockup plan shows the developer when it names 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 DirectCommandsRule = "Run each `djinn` command alone, as one direct command: never a pipe (`|`), a chain " +
"(`&&`, `||`, `;`), a loop (`for`), a redirection (`>`, `<<`) nor a substitution (`$(...)`): any of them makes " +
"the developer approve the command by hand."
DirectCommandsRule is how a lead runs djinn: one direct command at a time. The first message of every lead says it, and the brief at its start, in its rules and at its end, where a tool that cuts a long output keeps it.
const DirectFlags = "Flags replace them: `djinn brief --wishes` for the wishes alone, `djinn lead notes a,b` or " +
"`--all` for several notes, `djinn task list --wish-id <wish> --short` for where the tasks stand, " +
"`djinn task watch <task> --last 5` for a task's final note (it returns at once, the task running or not), " +
"`djinn question get <question> --wish-id <wish>` for one question, its answer and note, " +
"`djinn question list --wish-id <wish> --open`."
DirectFlags are the flags that replace what a lead would pipe or loop over.
const HistoryHeader = "## Historique des versions pr\u00e9c\u00e9dentes"
HistoryHeader introduced the history of earlier versions Revise appended to a question's context until W114. A context holds its current version only now, the earlier ones live in the question's rounds: CleanContext cuts what a caller still pastes, and CleanVersions what questions stored before.
const IfritRule = "- **An ifrit for live iteration (Q11).** An ifrit is a worker that stays lit while the developer " +
"is in Djinn, listening between their requests without a slot or a token: `djinn task spawn <wish> --kind ifrit " +
"--title \"…\" --prompt \"…\"` (`--idle-minutes 60` when they say they leave to try it for an hour), in a project. " +
"Light one when the developer wants to iterate live (changes they judge by eye) or try a stack; never for work a " +
"task with its checks does alone. One lit per wish. While it burns, relay each of the developer's requests to it, " +
"short and concrete, with `djinn task send <ifrit> \"…\"`, instead of spawning tasks; ask a question about it with " +
"`--about <ifrit>`, which shows it in the ifrit's band; do not repeat its reply to the developer, who follows it in " +
"the window. When a task waits for a gate it holds, offer the developer to stop it (`djinn task stop`) or finish " +
"it. Out (the developer left Djinn, or Djinn restarted), a message would light it again: never send it one " +
"without the developer's word. Once the developer judges its work good, finish it, `djinn task done <ifrit> " +
"--note \"…\"`: its work integrates like a task's, through the commit checks (`djinn lead notes ifrit`).\n"
IfritRule is how the lead uses an ifrit (T51, decision Q11): a worker that stays lit while the developer is in Djinn, for live iteration only, one per wish, its requests relayed, finished once its work is good.
const InvestigationRule = "- **An investigation to align fast.** A study or an audit the developer and you need to decide " +
"(why the tests flake, what a change would cost, where a design stands) goes to an investigation: `djinn task " +
"spawn <wish> --kind investigation --title \"…\" --prompt \"…\"` (`--minutes 40`, `--max-budget-usd 15` past its " +
"25 minutes and $10). It goes before the planned work, takes a slot even on a full machine (it pauses a work " +
"task meanwhile, one or two at once per machine), starts on a red branch, reads and runs everything, and ends in a " +
"tilasm and a question to the developer; at its limit Djinn asks it to publish what it has. Djinn never merges " +
"its commits: anything that must merge, a prototype the developer judges by running it included, is work " +
"(`--feedback` when they wait for it), never an investigation. A design the developer reviews as a tilasm, " +
"version after version, is a mockup (`--kind mockup`, same frame, no hold applies): ask its question with a " +
"mockup option to iterate and a work option to build (`djinn lead notes planned-options`).\n"
InvestigationRule is how the lead uses an investigation (W213): a short study or audit, served first, that ends in a tilasm and a question and whose commits are never merged; a prototype is urgent work for feedback instead, and a design the developer reviews version after version is a mockup (W268).
const LeadAgyProjectID = "djinn-lead"
LeadAgyProjectID is the id of the Antigravity project Djinn writes for the lead session.
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 LeadTerminal = "lead"
LeadTerminal is the name of the terminal of the lead.
const LimitWait = 15 * time.Minute
LimitWait is how long the events of a lead that hit a limit wait before the same seat tries again, when the agent did not say when the limit resets.
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 MaxLeadSayRunes = 600
MaxLeadSayRunes is the longest text LeadService.Say puts in the window's bubble: a longer answer belongs in a report block that the bubble names.
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 QuestionShape = "A question's `--context` reads at a glance, in this order. First, every command the " +
"developer must run, in one fenced code block, in run order, a `# …` comment above each command saying what it " +
"prints and what to expect; fence it with `~~~` lines, which need no backtick (between double quotes, backticks " +
"run as a command). Then short Markdown: a one-line why; a few bullets of facts, each saying whether it is " +
"verified; the decision, with what each option changes and costs. No command, flag, path or hash inside a " +
"sentence: it goes in the code block (a branch or a commit as a `#` comment) or in a table. No wall of text: " +
"short paragraphs, lists, tables and code blocks, which the window renders. Short, too: outside the code block, " +
"at most 1200 characters, one screen of the window (a one-line why, up to six bullets, the options, the " +
"recommendation); the details the developer needs to choose with full light (an analysis, a comparison, a " +
"mockup, a design) go in a tilasm that lays out the possible choices, and the question links it " +
"(`djinn://tilasm/<id>`) instead of carrying them. `djinn question ask` and `djinn " +
"question revise` print a warning for each break of this shape: revise the context at once."
QuestionShape is the shape of a question's context, the same for every agent that asks or revises one: the lead reads it in its brief, a worker at the end of its first prompt, an investigator in its own. The developer, 13/10 (W575), got revisions whose commands to run were lost in a wall of text; 16/10 (W55), a question is never long, its details in a tilasm it links. ContextWarnings checks it.
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).
const UnreadTerminalRule = "The developer does not read your terminal: every question, doubt or choice you have goes " +
"into a question (`djinn question ask`) in the wish concerned, never only into your text; your terminal reply " +
"stays one short line at most."
UnreadTerminalRule is where a lead's words go (W234): the developer does not read the lead's terminal. The first message of every lead says it, and the brief at its start, in its rules and at its end, as DirectCommandsRule.
const WaitingQuestionRule = "An `asked` event says a worker asked with `--wait`: its task waits on the question once " +
"its turn ends, its slot free, and the answer continues it with the decision. Answer it yourself (`djinn question " +
"answer <question> <choice> --note \"…\"`) only when a decision the wish took or your plan settles it, naming " +
"that decision or plan in the note; revise it (`djinn question revise`) when the developer lacks what they need to " +
"choose; otherwise leave it to them: a new choice is theirs. Never spawn a task for its answer, nor continue its " +
"task by hand: Djinn does, once a slot is free."
WaitingQuestionRule is how a lead takes a worker's blocking question (the brief's rules, and a driven lead's).
Variables ¶
var AgyProjectsDir = func() (string, error) { if os.Getenv("DJINN_TEST") == "1" { if h := os.Getenv("DJINN_HOME"); h != "" { return filepath.Join(h, "agy-projects"), nil } return filepath.Join(os.TempDir(), "djinn-test-agy-projects"), nil } home, err := os.UserHomeDir() if err != nil { return "", err } return filepath.Join(home, ".gemini", "config", "projects"), nil }
AgyProjectsDir is the folder of Antigravity's projects, ~/.gemini/config/projects; tests override it.
var CircleProviderOrder = []planv1.Provider{ planv1.Provider_PROVIDER_CLAUDE, planv1.Provider_PROVIDER_CODEX, planv1.Provider_PROVIDER_ANTIGRAVITY, }
CircleProviderOrder is the display order of providers in the Summoning Circle.
var CircleRowOrder = []planv1.WorkerKind{ planv1.WorkerKind_WORKER_KIND_LEAD, planv1.WorkerKind_WORKER_KIND_INVESTIGATION, planv1.WorkerKind_WORKER_KIND_MOCKUP, planv1.WorkerKind_WORKER_KIND_IFRIT, planv1.WorkerKind_WORKER_KIND_WORK, planv1.WorkerKind_WORKER_KIND_CORRECTION, planv1.WorkerKind_WORKER_KIND_REVIEW, planv1.WorkerKind_WORKER_KIND_QUESTION, }
CircleRowOrder is the order of worker rows in the Summoning Circle (W400): Djinn (lead) first, then each kind of worker that calls a model.
var ConfigFolders = []string{".agents", filepath.Join(".claude", "skills")}
ConfigFolders are the folders of a project that hold its configuration as Djinn reads it: its settings, its permissions and its skills. Djinn extracts them from the reference branch's tree.
var ErrNoChoice = errors.New("the lead no longer shows this choice")
ErrNoChoice says that the lead's terminal no longer shows the choice the window showed: answered there, or changed.
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 ErrUpToDate = errors.New("nothing to push: the remote is up to date")
ErrUpToDate says that a push found nothing to push: the remote holds the branch already.
var LeadCommands = []string{
"djinn",
"git status",
"git log",
"git diff",
"git show",
"git branch",
}
LeadCommands are the safe commands a lead session is pre-authorized to run without prompting the developer: Djinn's own CLI and read-only Git commands.
var PermissionsFile = filepath.Join(".agents", "permissions.txtpb")
PermissionsFile is where a project declares, for every agent, what an agent may do in it: a djinn.v1.Permissions in text protobuf, under the .agents folder that Codex and Antigravity already read for skills.
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.
var WorkerCircleKinds = []planv1.WorkerKind{ planv1.WorkerKind_WORKER_KIND_WORK, planv1.WorkerKind_WORKER_KIND_INVESTIGATION, planv1.WorkerKind_WORKER_KIND_CORRECTION, planv1.WorkerKind_WORKER_KIND_REVIEW, planv1.WorkerKind_WORKER_KIND_QUESTION, }
WorkerCircleKinds are the worker seats updated by a bulk model change: work, investigations, corrections, reviews and enlighten workers (questions).
var WorkerGuard = connect.UnaryInterceptorFunc(func(next connect.UnaryFunc) connect.UnaryFunc { return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) { caller := CallerFromContext(ctx) if caller == nil { return next(ctx, req) } procedure := req.Spec().Procedure if procedure == planv1connect.WishServiceMakeProcedure { return nil, connect.NewError(connect.CodePermissionDenied, errors.New( "a worker cannot make a wish; to try a command by hand, start a Djinn of your own with its own data folder", )) } switch procedure { case planv1connect.QuestionServiceAskProcedure: if r, ok := req.Any().(*planv1.QuestionServiceAskRequest); ok { if r.WishId == "" { r.WishId = caller.WishID } else if r.WishId != caller.WishID { return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker cannot ask a question in wish %s (its task is in wish %s)", r.WishId, caller.WishID, )) } if r.TaskId == "" { r.TaskId = caller.TaskID } else if r.TaskId != caller.TaskID { return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker cannot ask a question for task %s (its own task is %s)", r.TaskId, caller.TaskID, )) } } return next(ctx, req) case planv1connect.QuestionServiceReviseProcedure: if r, ok := req.Any().(*planv1.QuestionServiceReviseRequest); ok { if r.WishId == "" { r.WishId = caller.WishID } else if r.WishId != caller.WishID { return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker cannot revise a question in wish %s (its task is in wish %s)", r.WishId, caller.WishID, )) } if r.TaskId == "" { r.TaskId = caller.TaskID } else if r.TaskId != caller.TaskID { return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker cannot revise a question for task %s (its own task is %s)", r.TaskId, caller.TaskID, )) } } return next(ctx, req) case planv1connect.BlockServicePutProcedure: if r, ok := req.Any().(*planv1.BlockServicePutRequest); ok { if r.WishId == "" { r.WishId = caller.WishID } else if r.WishId != caller.WishID { return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker cannot put a block in wish %s (its task is in wish %s)", r.WishId, caller.WishID, )) } if r.TaskId == "" { r.TaskId = caller.TaskID } else if r.TaskId != caller.TaskID { return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker cannot put a block for task %s (its own task is %s)", r.TaskId, caller.TaskID, )) } } return next(ctx, req) case planv1connect.TaskServiceUpdateProcedure: if r, ok := req.Any().(*planv1.TaskServiceUpdateRequest); ok { if r.TaskId == "" { r.TaskId = caller.TaskID } else if r.TaskId != caller.TaskID { return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker can only update its own task (%s)", caller.TaskID, )) } } return next(ctx, req) case planv1connect.ServeServiceRunProcedure, planv1connect.ServeServiceStopProcedure, planv1connect.ServeServiceListProcedure, planv1connect.ServeServiceLogsProcedure: if err := ownServes(req.Any(), caller); err != nil { return nil, err } return next(ctx, req) case planv1connect.TilasmServicePutProcedure: if r, ok := req.Any().(*planv1.TilasmServicePutRequest); ok { if r.Wish == "" { r.Wish = caller.WishID } else if r.Wish != caller.WishID { return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker cannot put a tilasm in wish %s (its task is in wish %s)", r.Wish, caller.WishID, )) } if r.Author == "" { r.Author = caller.TaskID } } return next(ctx, req) case planv1connect.TilasmServicePublishProcedure: if r, ok := req.Any().(*planv1.TilasmServicePublishRequest); ok { if r.Wish == "" { r.Wish = caller.WishID } else if r.Wish != caller.WishID { return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker cannot publish a tilasm of wish %s (its task is in wish %s)", r.Wish, caller.WishID, )) } } return next(ctx, req) } if isReadOnlyProcedure(procedure) { return next(ctx, req) } return nil, connect.NewError(connect.CodePermissionDenied, fmt.Errorf( "a worker cannot call %s; to try a command by hand, start a Djinn of your own with its own data folder", procedure, )) } })
WorkerGuard intercepts Connect RPC calls to enforce permissions for workers. A worker cannot make a wish, or execute mutating commands on wishes, tasks, or plans other than those permitted for workers (question ask, question revise, block put, task update of own task, tilasm put, tilasm publish in its wish).
Functions ¶
func AccountEnv ¶ added in v0.2.0
AccountEnv is what a session on account a adds to its environment: the agent's folder variable, and for Claude the variables that would win over its login, cleared. Nil for no account.
func AccountLogin ¶ added in v0.2.0
AccountLogin is the command line that signs account a in, in its folder, for the user's shell on goos: cmd.exe on Windows, a POSIX shell elsewhere.
func AccountStatus ¶ added in v0.2.0
AccountStatus are the arguments of the command that tells whether an agent is signed in, exiting 0 when it is and 1 when not; nil for an agent that documents none.
func ActiveWishes ¶
ActiveWishes returns the active wishes by rank: the first one has priority, and the scheduler serves them in this order.
func AllMerged ¶ added in v0.2.0
AllMerged tells whether every azima of a wish among tasks, drafts left out, has its work all in main (Azima.merged), one at least.
func AllowServe ¶ added in v0.2.0
AllowServe is AllowWatch for the commands an ifrit's serve runs (djinn serve run).
func AllowWatch ¶ added in v0.1.2
AllowWatch adds command to the watcher commands the developer allows in the project, in their settings file in home, or takes it back with revoke: the commands allowed then. Its words are joined by single spaces, as a watcher's command is compared.
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; or else that the lead turns it into tasks itself.
func ApprovedLine ¶ added in v0.1.1
ApprovedLine is the line that tells a lead the developer approved the answer by gave q (you, or a worker's code): the decision is theirs now.
func Ask ¶
Ask stores question, new, in tx with the next code of its wish. The caller journals the command that asks it.
func AskedLine ¶ added in v0.2.0
AskedLine is the line that tells a lead a worker asked q, a blocking question: its task waits for the answer once its turn ends.
func AzimaBranchName ¶ added in v0.1.1
AzimaBranchName is the branch of an azima under the per-azima push strategy: the one recorded when Djinn cut it or the developer named it (Azima.cut_from), else djinn/<code>-<slug of its title>, or djinn/<code>.
func AzimaDependenciesText ¶ added in v0.1.1
func AzimaDependenciesText(deps []AzimaDependency) string
AzimaDependenciesText says deps in a line: "T2 after T1; T3 after T1, T2".
func AzimaMergeRunning ¶ added in v0.1.1
AzimaMergeRunning says, in a phrase, what merges into branch, the own branch of azima among tasks, the tasks of its wish, now: a batch of work being merged into it, a correction or review worker of the azima bringing work into it, or one settling main's merge; "" when none does. While one runs, the azima's branch is not renamed under it.
func AzimaOf ¶ added in v0.1.1
AzimaOf is the azima t is part of among byID, the tasks of its wish by id, walking up part_of: t itself when it is an azima; nil when none.
func AzimaOrder ¶ added in v0.2.0
AzimaOrder returns the azimas among tasks in their rank (Task.rank): the ranked ones first, from rank 1, then those never ranked, a new one included, by code; a stable sort keeps the order of tasks between equals. Give it the tasks of one wish: the ranks of two wishes do not compare.
func AzimaPlaces ¶ added in v0.2.0
AzimaPlaces gives each azima among tasks, of every wish, its place among the azimas of its wish in their rank (AzimaOrder), from 0 for the first.
func BatchEvents ¶ added in v0.2.0
BatchEvents is the part of events one batch takes, the oldest.
func BuildGlobalBrief ¶ added in v0.1.1
BuildGlobalBrief writes the brief of all wishes in Djinn: how to run djinn, every active wish with its details, paused and granted wishes on one line each, then Djinn's rules once for all projects; at its end, a line per active wish again and how to run djinn, for an agent whose tool keeps only the end of a long output (Antigravity's).
func BuildWishesBrief ¶ added in v0.2.0
BuildWishesBrief is where the wishes stand, the global brief without the rules: djinn brief --wishes.
func CallerActor ¶ added in v0.1.1
CallerActor returns the actor name for the journal. If ctx has a WorkerCaller, its TaskID is returned; otherwise the local user actor is returned.
func CanIfrit ¶ added in v0.2.0
CanIfrit tells whether a provider can run an ifrit (keeps its input open between turns).
func CanReadOnly ¶ added in v0.1.1
CanReadOnly tells whether a provider can run a question worker (read-only).
func CanResume ¶ added in v0.1.1
CanResume reports whether a provider can resume an existing session.
func CarryLead ¶ added in v0.1.1
CarryLead records the one lead from the leads the wishes kept before it, once: only while no lead is recorded. The lead of the first active wish by rank wins, else that of the most recent wish. It returns the lead recorded, nil when there was nothing to carry.
func ChangedLine ¶ added in v0.1.2
ChangedLine is AnswerLine for an answer that replaces was, another choice: the line says the developer changed 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, or git did not answer within readGitTimeout.
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 ChosenPlan ¶ added in v0.2.0
func ChosenPlan(q *planv1.Question) *planv1.PlannedTask
ChosenPlan is the plan of the option q's answer chose; nil when it planned none.
func CircleModels ¶ added in v0.2.0
func CircleModels(ctx context.Context, providers []*planv1.CircleProvider, userHome, path string) []*planv1.CircleModel
CircleModels returns the models offered in the Summoning Circle for signed-in providers: from `agy models` where the agent CLI can report its models (intersected with the shared price table), and from internal/usage/prices.yaml for providers whose CLI has no model-listing command. Providers that are not signed in are never offered as choices.
func CircleProviders ¶ added in v0.2.0
func CircleProviders(ctx context.Context, djinnHome, userHome, path string, leadDriven bool) []*planv1.CircleProvider
CircleProviders returns the sign-in status, sign-in command, and lead capability for each provider on this machine.
func CleanContext ¶ added in v0.1.2
CleanContext strips the HistoryHeader section from a question's context, and all that follows it.
func CleanVersions ¶ added in v0.2.0
CleanVersions cuts from every stored question the history Revise appended to its context until W114, in its context and in its rounds' (CleanContext), each change journaled: run as djinn up opens the store, it changes nothing once done.
func CloserWord ¶
CloserWord names who marked a task done by hand.
func ClosesCycle ¶ added in v0.1.1
ClosesCycle tells whether task, waiting for deps and part of azima, would reach itself through tasks, following what each task depends on and the azima it is part of, and then says the cycle in codes ("W1 → W3 → W1"); "" when it would not.
func CompareCodes ¶
CompareCodes orders task codes as a person reads them: by letter, then by number, T2 before T10.
func ConfigCache ¶ added in v0.2.0
ConfigCache is where Djinn keeps the configuration it extracts from reference branches, in its data folder home: a folder per digest of the configuration folders' trees.
func ConfigDir ¶ added in v0.2.0
ConfigDir is the folder Djinn reads project's configuration in (ProjectConfig): empty when it has no folder here.
func ConfigReference ¶ added in v0.2.0
ConfigReference is the remote ref Djinn reads project's configuration from once it is fetched (refs/remotes/origin/main), as ProjectConfig finds it, home its data folder: empty outside Git, without a remote or without a branch to take.
func ContextWarnings ¶ added in v0.1.2
ContextWarnings says how context, a question's Markdown, breaks QuestionShape, a line per fault; none when it keeps it. Cheap guesses, not a parser: Djinn stores a context as given, and its author revises it.
func CountGate ¶ added in v0.2.0
CountGate counts ev, an event about to be written in tx, in the gate wait of its task. Djinn writes every event of a task through it (harness putEvents): the gate wait kept stays the sum of the task's gate events, which a task list then never reads (W283). A task from before it gets its count from the events written before ev.
func CutNeeds ¶ added in v0.1.1
CutNeeds splits a box's text from its needs: "(needs: …)", a parenthesis that opens on them, to its closing one. False when the box says none, or leaves the parenthesis open.
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 DecisionPrompt ¶ added in v0.2.0
DecisionPrompt is what continues, or is sent to, the worker that asked q, once q is answered, such as "Decision Q51: Keep the cache (B) - the note. Go on with your task." for option B with a note.
func DefaultCircleModel ¶ added in v0.2.0
DefaultCircleModel returns the default canonical model ID for a provider in the Summoning Circle.
func DefaultReference ¶ added in v0.2.0
DefaultReference is the reference branch of the repository holding dir when no main_branch names one, and the ref Djinn reads it from: the remote's default branch (its HEAD, as a clone records it), else main, else master; the remote's branch (refs/remotes/origin/main) when the repository has a remote that holds it, else the local one. Never the branch the copy has checked out (W227).
func DependencyAzimas ¶ added in v0.1.1
DependencyAzimas finds all unique azimas that azima (or its work tasks) depends on among tasks.
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 DigestKeeps ¶ added in v0.1.1
DigestKeeps tells whether a digest's line keeps the whole text of e, uncut.
func DigestLine ¶ added in v0.1.1
DigestLine is an event in a digest's line: its code and the short title of its wish (title, empty for an event of no wish), its kind, and its text in a few words.
func DigestTitles ¶ added in v0.2.0
func DigestTitles(ctx context.Context, r store.Reader, events []*planv1.LeadEvent) map[string]string
DigestTitles are the wishes of events by their short title, for the lines that name them: task and question codes are unique within a wish only (W74 was in two wishes at once). A wish deleted since is named by its identifier.
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 DoneLineOf ¶ added in v0.1.1
DoneLineOf is the first line of text that says done: a line that is done, or starts with it before a character that is not a letter nor a digit. Empty when none does, or done is.
func DoneWithProblems ¶ added in v0.1.1
DoneWithProblems tells a task whose worker ended done while its permissions refused some of its calls, with nobody to approve them (Task.refused): it may not have done its job. Nobody looked at it yet: a run again sets Task.refused anew, and marking it done (djinn task done, the developer or the lead) closes it as seen. Djinn proposes no grant while one is left: the lead heard of its refused calls and decides (Q273); the window shows a plain done.
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 DrivenRules ¶ added in v0.2.0
DrivenRules are the rules of the lead Djinn drives (decision Q31): shared with briefRules through leadRules so both modes read from one source, made for a session that takes one batch then ends. Every batch's session reads them apart from its message, the same text each time, so that its cache serves the next session. A change here is a new DrivenRulesVersion.
func EffectiveWishPushStrategy ¶ added in v0.1.1
func EffectiveWishPushStrategy(ctx context.Context, r store.Reader, home string, wish *planv1.Wish) (planv1.PushStrategy, planv1.SettingSource, error)
EffectiveWishPushStrategy resolves the effective push strategy for wish in store r with home folder home.
func EndLeadBatch ¶ added in v0.2.0
EndLeadBatch stores b as it ended. A batch done acknowledges its events still waiting for its session, as a watch would, in the same transaction; the events and batches older than leadEventsKept go.
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 EventWishes ¶ added in v0.2.0
EventWishes are the wishes events are about, in their order, each once.
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. In progress with a watcher as its only live work (onlyWatched: the babysit of its pull request), it is watching. 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 FillBabysit ¶ added in v0.1.1
FillBabysit fills the placeholders of a babysit's command line watch: {pr} and {mr} with number, {state} with the file state, each one word of it.
func FillPrompts ¶ added in v0.2.0
FillPrompts sets each task's Prompt from its last prompt event in r, and fills each watcher's request link.
func FillTilasms ¶
FillTilasms sets Task.tilasms on tasks: the codes of the tilasms of their wish that cite each, in code order.
func FillTimes ¶ added in v0.1.1
FillTimes computes on the server and sets the durations on tasks: - running: the worker's process ran and did not wait for a gate; - waiting_gate: while running, the time it waited for a gate to be granted; - paused: every gap between the first start and now or the end where the task was not running; - waiting_before_start: the wait before the first start (from planned/create_time to first start, or to now). An azima's time sums its parts' work times.
func FindAccount ¶ added in v0.2.0
FindAccount is the account called name among accounts; nil when none is.
func FindUnknownFields ¶ added in v0.1.1
FindUnknownFields returns all unknown field names in text protobuf b when unmarshaled into m.
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 HasUnfinishedParts ¶ added in v0.1.1
HasUnfinishedParts tells whether an azima has parts still to finish: work not finished, or an azima part of it not done.
func HoldIn ¶ added in v0.3.0
HoldIn is the hold of branch in p, to edit: a new one when it has none, which SettlePushHolds drops again unless the edit holds the push.
func HoldText ¶ added in v0.2.0
func HoldText(tilasm *planv1.Tilasm, h *planv1.TilasmHold) string
HoldText says why a tilasm takes no send, in a sentence: what a refused send answers.
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 InstallQuestionsWord ¶ added in v0.1.1
func InstallQuestionsWord(q planv1.InstallQuestions) string
InstallQuestionsWord is when Djinn asks to install builds, as the settings say it: always, when_needed, never.
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 or an iteration on its mockup (Iterating): it waits for the revision of its investigator, of its mockup task or of the lead, not for the developer.
func IsAntigravityModel ¶ added in v0.2.0
IsAntigravityModel reports whether m is a model identifier of Antigravity.
func IsClaudeModel ¶ added in v0.2.0
IsClaudeModel reports whether m is a model identifier of Claude.
func IsCodexModel ¶ added in v0.2.0
IsCodexModel reports whether m is a model identifier of Codex.
func IsDecision ¶ added in v0.2.0
IsDecision tells whether text is the decision of the question code given to its worker (DecisionPrompt).
func IsMockupPlan ¶ added in v0.2.0
func IsMockupPlan(p *planv1.PlannedTask) bool
IsMockupPlan tells whether the plan p plans a mockup.
func IterateLine ¶ added in v0.2.0
func IterateLine(ctx context.Context, r store.Reader, q *planv1.Question, round *planv1.Round) string
IterateLine is the line that tells a lead the developer iterates on q's mockup with round, and that no mockup task works on it: the command that spawns one.
func Iterates ¶ added in v0.2.0
Iterates is the mockup plan an answer choice to the open question q iterates with; nil when that answer is an answer: its plan is no mockup, or q shows its last version already (MockupRounds), or q is decided.
func Iterating ¶ added in v0.2.0
Iterating is q's iteration round under way: its last round, while q is open; nil otherwise.
func Iterations ¶ added in v0.2.0
Iterations is how many iteration rounds q went through.
func JournalCommand ¶ added in v0.2.0
JournalCommand is a command of the lead as the journal keeps it: one line, cut.
func JournalEntry ¶ added in v0.2.0
JournalEntry writes batch b of the lead's journal: when and who, the events it took, the commands it ran, the text that ended its turn and what it cost.
func JournalFailedCommand ¶ added in v0.2.0
JournalFailedCommand marks a command of the lead whose tool result failed, as the journal keeps it.
func JournalNote ¶ added in v0.2.0
JournalNote is the one line that ended a batch's turn, as the journal keeps it for the next leads.
func JournalTokens ¶ added in v0.2.0
JournalTokens estimates the tokens of a journal text at four runes per token, rounded up.
func KeepAzimaRecord ¶ added in v0.2.0
WithAzimas is tasks with Task.azima set on their azimas, as clones: the store's own messages stay as they are. KeepAzimaRecord copies into e, an azima's state as computed from its parts, what Djinn records of its branch and its pull request, as recorded stores it: the branch's sync, the pull request, main's state, its merge into main, and what its branch was cut from (from main, never from another's).
func KeepSourceRun ¶ added in v0.2.0
func KeepSourceRun(ctx context.Context, st *store.Store, s *Source, end time.Time, items int, failed error) error
KeepSourceRun keeps the run of the source s that ended at end, on this machine: how many items it printed, and why it failed, nil when it went well; a failed run counts the failures in a row, and when they began. A source no longer plugged in keeps nothing: its run ended as it was unplugged.
func LaunchCommand ¶ added in v0.2.0
LaunchCommand is the command that launches q's planned task, as it is.
func LeadAgent ¶ added in v0.2.0
LeadAgent says why the driven lead cannot run on provider; nil when it can. Claude, Codex and Antigravity take its rules as their own instructions and a folder to write in (docs/providers.md). The fake agent plays a script, for tests and trials.
func LeadFolder ¶ added in v0.2.0
LeadFolder is the folder a driven lead's sessions run in, in Djinn's data folder: no project's rules nor memory, and the plan files and tilasm folders the lead writes.
func LeadJournal ¶ added in v0.2.0
func LeadJournal(ctx context.Context, r store.Reader, wishIDs []string, n int) ([]*planv1.LeadBatch, error)
LeadJournal is the latest batches, at most n, oldest first: those about one of wishIDs, or every one when wishIDs is empty. A batch about no wish (a restart alone) belongs to every journal.
func LeadPacket ¶ added in v0.2.0
func LeadPacket( ctx context.Context, r store.Reader, home string, events []*planv1.LeadEvent, journal []*planv1.LeadBatch, attempt int32, ) (string, error)
LeadPacket is the first message of a batch's session (decision Q31): its events whole, the briefs of the wishes they are about, the active wishes in a line each, and the lead's journal, the latest batches of those wishes. home is Djinn's data folder. The rules go apart, the same for every batch (DrivenRules).
func LeadWatchRule ¶ added in v0.1.1
func LeadWatchRule() string
LeadWatchRule is the brief's rule on djinn lead watch, with how each agent runs it.
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 LookAtConfig ¶ added in v0.2.0
func LookAtConfig(ctx context.Context, st *store.Store, home string, project *planv1.Project, fetch FetchRef, now time.Time) error
LookAtConfig is one look of the watch at project's reference branch, home Djinn's data folder: it fetches the branch (fetch), then writes what it found. A failed fetch is kept on the ConfigWatch, and the look goes on with what the copy holds. Nothing for a project outside Git or without a remote.
func MadeLine ¶ added in v0.1.1
MadeLine is the line that tells the lead a wish was made from a request: it names it when its title is provisional, and plans it from its brief, which holds the request whole. Short enough for a digest's line.
func MergeHost ¶ added in v0.1.1
MergeHost is the task the merge t is shown and counted with: the first original task it serves that is part of the same azima as t (or, like t, of none); "" for any other task, or a merge that serves none there (a push or main branch correction).
func MergeMainWord ¶
MergeMainWord is when Djinn merges main, as the settings say it: release, commit, off.
func MergeRunning ¶ added in v0.1.1
MergeRunning says, in a phrase, what merges into wish's integration branch in the project projectID now: a batch of its work being merged and tested, a correction or review worker bringing work into it, or one settling main's merge; "" when none does. While one runs, the branch does not change under it.
func MergeServes ¶ added in v0.1.1
MergeServes are the original tasks the merge t serves, by id: the tasks it brings the work of, earlier merges among them followed back to tasks that are no merges, in order and once each. byID gives the tasks; one it lacks is left out.
func MergedText ¶ added in v0.2.0
MergedText says that the work of the azima t is all in its project's main branch (Azima.merged): "merged into main", main as the project names it; empty when it is not.
func MigrateCircle ¶ added in v0.2.0
func MigrateCircle(home string)
MigrateCircle reads any legacy per-project provider/model settings from projects/*/settings.txtpb in home once, seeds the Summoning Circle in settings.json for rows not yet configured, and drops those fields from the per-project developer files.
func MockupOption ¶ added in v0.2.0
func MockupOption(q *planv1.Question, tilasmID string) *planv1.PlannedTask
MockupOption is the mockup plan of the open question q that iterates on the tilasm tilasmID, within its rounds; nil when no option of q does.
func MockupRounds ¶ added in v0.2.0
func MockupRounds(p *planv1.PlannedTask) int
MockupRounds is how many versions of its tilasm the mockup plan p shows the developer, the first one included.
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 NextQuestionCode ¶ added in v0.1.1
NextQuestionCode is the code of a new question of the wish wishID: Q01, Q02… The number after the highest one its questions have or its retired codes had (Wish.retired_codes), so that a code is never given twice, deleted or moved.
func NextTaskNumber ¶ added in v0.1.1
NextTaskNumber is the code of a new task of the wish wishID lettered letter, W for work and T for an azima: the number after the highest one its tasks have or its deleted tasks had (Wish.retired_codes), so that a code is never given twice, deleted or not.
func NormalizeCircleModel ¶ added in v0.2.0
NormalizeCircleModel maps a human-readable model label or short alias to its canonical model ID.
func NoteEditedLine ¶ added in v0.1.2
NoteEditedLine is the line that tells a lead the developer changed the note of their answer to q, and only it.
func Paginate ¶ added in v0.1.1
Paginate slices items according to pageSize and pageToken. If pageSize <= 0, DefaultPageSize is used. If pageSize > MaxPageSize, MaxPageSize is used. If pageToken is empty, pagination starts at the beginning (offset 0). If pageToken is invalid, a connect error with CodeInvalidArgument is returned. Returns the sliced items, next_page_token (or "" if on the last page), total items count, and an error if any.
func ParsePlan ¶ added in v0.2.0
func ParsePlan(text string) (*planv1.PlannedTask, error)
ParsePlan reads the text of a plan: header lines "key: value", named as djinn task spawn's flags, up to the first blank line, then the prompt. after, blocks and tilasm repeat, or separate their names with commas. The names stay as written: fillPlan resolves them in the question's wish.
func ParseSleep ¶ added in v0.2.0
func ParseSleep(ctx context.Context, tx *store.Tx, wishID string, texts []string, now time.Time) ([]*planv1.SleepCondition, error)
ParseSleep reads the conditions a question of the wish wishID sleeps until, as djinn question sleep --until takes them (commas separate several in one text), at now: tasks by code or identifier, merged: requests, web addresses of requests, times and delays. Each names a task of the wish, or a time to come.
func PreviewWorkerDefaults ¶ added in v0.2.0
func PreviewWorkerDefaults(p planv1.Provider, model string) []*planv1.WorkerSeat
PreviewWorkerDefaults returns the Summoning Circle seats that UpdateWorkerDefaults sets for future spawns.
func ProjectChanges ¶ added in v0.2.0
func ProjectChanges(ctx context.Context, r store.Reader, projectID string) ([]*planv1.ConfigChange, error)
ProjectChanges are the entries of project's journal of configuration changes, the newest first.
func ProjectNamed ¶
ProjectNamed is the project of this name, case ignored, or of this identifier.
func ProjectPushWord ¶ added in v0.1.1
func ProjectPushWord(p planv1.ProjectPush) string
ProjectPushWord is when Djinn pushes, as the settings say it: standard, on_demand.
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 ProviderForCircleModel ¶ added in v0.2.0
ProviderForCircleModel infers the provider for a model ID or label; PROVIDER_UNSPECIFIED when unknown.
func ProviderLogin ¶ added in v0.2.0
ProviderLogin returns the terminal command that signs in provider on its default home folder.
func PushHeld ¶ added in v0.3.0
PushHeld tells whether hold, a branch's (WishPush.holds), holds its push: its push checks are red.
func PushStateOf ¶ added in v0.1.1
PushStateOf is the state of the push of wish in the project projectID; nil when none is recorded.
func PushStrategyWord ¶ added in v0.1.1
func PushStrategyWord(p planv1.PushStrategy) string
PushStrategyWord is how a wish integrates its work, as the settings say it: wish, azima.
func PutBlock ¶ added in v0.1.1
func PutBlock(ctx context.Context, tx *store.Tx, m *planv1.BlockServicePutRequest) (*planv1.Block, error)
PutBlock adds or changes the block m names, in tx. The caller journals the command.
func PutLeadBatch ¶ added in v0.2.0
PutLeadBatch stores b, journaled.
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 QueueLeadEvent ¶ added in v0.1.1
QueueLeadEvent stores e for the lead, with its id and its time: it waits there until a watch acknowledges it.
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 ReadAccounts ¶ added in v0.2.0
ReadAccounts are the accounts of the agents on this machine, from settings.json in home.
func ReadCircle ¶ added in v0.2.0
func ReadCircle(home string) []*planv1.WorkerSeat
ReadCircle returns the Summoning Circle rows in CircleRowOrder from settings.json in home after migrating any legacy per-project settings. The lead row always carries a concrete provider and model ID; every other row carries PROVIDER_UNSPECIFIED and "" when set to "Same as lead".
func ReadLeadSeat ¶ added in v0.2.0
ReadLeadSeat is where the lead Djinn drives runs, from settings.json in home: Claude, its default model and sign-in, unless the developer moved it.
func ReadPermissions ¶ added in v0.2.0
func ReadPermissions(dir string) (*djinnv1.Permissions, []string, error)
ReadPermissions reads the permissions a project declares in dir, and the fields of the file a newer Djinn knows, which are ignored. It returns nil, and no error, when the project declares none.
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 ReadSettingsWithWarnings ¶ added in v0.1.1
func ReadSettingsWithWarnings(path string) (*planv1.ProjectSettings, []string, error)
ReadSettingsWithWarnings 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. Any unknown fields are discarded, logged once as warnings, and returned in warnings.
func ReadShownTheme ¶ added in v0.2.0
func ReadShownTheme(home string) uiv1.ShownTheme
ReadShownTheme is the theme the window shows, as the last page said it, from settings.json in home; unspecified when none did.
func ReadTaskItemNeeds ¶ added in v0.1.1
ReadTaskItemNeeds parses an unchecked markdown task item ("- [ ] text (needs: ...)") and splits its box text from its needs. Returns false when the line is not an unchecked task item, is struck through, or has no needs.
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), none done with problems nobody looked at (DoneWithProblems), and no question is open. A draft azima is not counted in the wish's progress: it waits to be opened. 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 RefCommit ¶ added in v0.2.0
RefCommit is the commit that ref points at in the repository holding dir, memoized by RefsStamp.
func ReferenceName ¶ added in v0.2.0
ReferenceName is the reference branch of project, and the ref Djinn reads it from: the main_branch setting of the developer's file, else the team's, else DefaultReference; the remote's branch when the repository has a remote and it holds that branch, else the local one. "" for both when Djinn finds none. It reads no branch the developer's copy has checked out, nor its HEAD: the copy is theirs (W227).
func RefsStamp ¶ added in v0.2.0
RefsStamp stamps the configuration and the refs (heads and remotes) of the repository holding folder; empty outside Git, with reftable, or when config includes another file.
func RefuseAzimaDependencies ¶ added in v0.1.1
RefuseAzimaDependencies refuses graph, the tasks of a wish that pushes per azima as a change would leave them, when it makes an azima wait for another that it did not wait for among tasks, the wish's tasks as they are: an azima spawned or synced from its plan file with one after it, a dependency set, a task grouped into another azima. What a wish waited for before it was switched stays.
func RefuseStranding ¶ added in v0.1.1
RefuseStranding refuses switching wish to the push strategy to when work of it, among tasks, merged into a branch, would be left there, its further work going to another: per azima, the work of an azima merged into the wish's integration branch while the azima's own branch is another; per wish, work merged into an azima's branch other than the wish's integration branch. The work of an azima stays where it is once the azima adopts the branch it lives on (djinn task update <azima> --branch <branch>), which the refusal says. Work of no azima stays in the wish's branch.
func RefuseSwitchToAzima ¶ added in v0.1.1
RefuseSwitchToAzima refuses switching a wish to the per-azima push strategy while its azimas, among tasks, wait for each other, naming them in a line.
func ResetWarnedUnknownFields ¶ added in v0.1.1
func ResetWarnedUnknownFields()
ResetWarnedUnknownFields clears the deduplication map, for tests.
func ResolveWish ¶ added in v0.1.1
ResolveWish finds a wish by identifier, rank (e.g. W1, 1), or title.
func ResolveWishPushStrategy ¶ added in v0.1.1
func ResolveWishPushStrategy(wish *planv1.Wish, settings Settings) (planv1.PushStrategy, planv1.SettingSource)
ResolveWishPushStrategy resolves the push strategy and its source for a wish, falling back to the project settings.
func ResolveWorkerSeat ¶ added in v0.2.0
func ResolveWorkerSeat(home string, kind planv1.WorkerKind) (provider planv1.Provider, model string, explicit bool)
ResolveWorkerSeat returns the effective provider and canonical model ID for kind from the Summoning Circle in home. When the row is set to "Same as lead", it follows the lead's provider and model ID. explicit is true when the circle or lead seat has been configured in settings.json (or migrated from a per-project developer file).
func RevisionDetail ¶ added in v0.2.0
RevisionDetail is what the lead reads under the line of q's answer when Djinn left the plan of the chosen option to it: the question, the answer and its note, the plan, how each task it names stands now against when it was planned, why it no longer holds if it does not, and how to launch it. "" when the option planned nothing, or its task is launched.
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 SameSeat ¶ added in v0.2.0
SameSeat tells whether a and b run the lead on the same agent and account, whatever the model.
func SaveDeveloperInstallQuestions ¶ added in v0.1.1
func SaveDeveloperInstallQuestions(home, projectID string, questions planv1.InstallQuestions) error
SaveDeveloperInstallQuestions writes the developer's install questions setting into their settings file in home.
func SaveDeveloperMainBranch ¶ added in v0.2.0
SaveDeveloperMainBranch writes branch as the main_branch setting of the developer's settings file in home, or removes it when branch is empty: the team's file names the reference branch again, else Djinn finds it.
func SaveDeveloperPush ¶ added in v0.1.1
func SaveDeveloperPush(home, projectID string, push planv1.ProjectPush) error
SaveDeveloperPush writes the developer's push setting into their settings file in home.
func SaveDeveloperPushStrategy ¶ added in v0.1.1
func SaveDeveloperPushStrategy(home, projectID string, strategy planv1.PushStrategy) error
SaveDeveloperPushStrategy writes the developer's push strategy setting into their settings file in home.
func SeatText ¶ added in v0.2.0
SeatText names seat for a reader: "Codex, model gpt-5.5, account Work".
func SendLine ¶ added in v0.2.0
func SendLine(tilasm *planv1.Tilasm, send *planv1.TilasmSend, comments []*planv1.TilasmComment, question *planv1.Question) string
SendLine is what a send tells the lead, in a line a digest keeps whole: the version read, how many comments on what, the developer's choice, and the command that reads them. question is the open question that links the tilasm, or nil.
func SetIntegrationBranch ¶
SetIntegrationBranch records branch as wish's integration branch in the project projectID, in place of the one it had.
func SetLeadSettle ¶ added in v0.2.0
SetLeadSettle sets how long the lead's events of s settle before a watch or a batch takes them: quiet, max at most. Tests shorten it.
func SetShownTheme ¶ added in v0.2.0
func SetShownTheme(home string, theme uiv1.ShownTheme) error
SetShownTheme keeps theme as the one the window shows, in settings.json in home; it writes only a change.
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 SettlePushHolds ¶ added in v0.3.0
SettlePushHolds keeps the holds of p in shape after an edit: a hold that holds nothing more goes.
func Settled ¶ added in v0.2.0
Settled tells a task of work finished whose work is neither merging nor failed to merge: an azima waits for it no more.
func Shelf ¶ added in v0.2.0
Shelf returns the wishes of all in state, paused or granted, in their order: by place, then those set aside before Djinn recorded places, the oldest first.
func SleepAllHold ¶ added in v0.2.0
SleepAllHold tells whether every condition the question q sleeps until holds at now (SleepHolds).
func SleepHolds ¶ added in v0.2.0
SleepHolds tells whether the condition c holds at now, by tasks: every task of the question's wish, Task.azima set on the azimas (WithAzimas). A task gone counts as over: nothing is left to wait for.
func SleepText ¶ added in v0.2.0
func SleepText(c *planv1.SleepCondition) string
SleepText says a condition in a few words, for the brief and the lead's events: W12 over, W45's request merged, 2026-10-20 09:00.
func SleepTexts ¶ added in v0.2.0
SleepTexts says every condition of q's sleep, joined.
func Slug ¶ added in v0.1.1
Slug keeps lower-case letters and digits, joined by single dashes, at most n characters cut on a dash.
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 ¶
func StartLine() string
StartLine is how every new lead starts, whatever its agent: from the brief, which Djinn computes from the plan, each djinn command run alone so that none waits for the developer's approval, every question, doubt or choice in a question since the developer does not read its terminal.
func SweepTilasmTemp ¶ added in v0.2.0
SweepTilasmTemp tidies the tilasms' folder of home after a djinn up that a kill cut, before anything writes there: it removes the staging folders of tempDir, and returns the paths it removed. A folder of an import that went aside (the "replaced" prefix) holds a tilasm's previous files: one whose place is empty goes back to it; one whose place is taken stays, as the cut may have come before the import's transaction, and is returned in kept. Nothing else is touched.
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 TilasmDirs ¶ added in v0.2.0
TilasmDirs are the version folders of the tilasms a worker's first prompt gives it (TilasmContext), in Djinn's data folder home: the folders the worker reads besides its own (harness.Spec.ReadDirs).
func TilasmLink ¶
TilasmLink is the link that opens a tilasm in Djinn from anywhere: a block, a question, a terminal, a browser.
func Tone ¶ added in v0.2.0
func Tone(theme uiv1.ShownTheme) string
Tone is the Djinn's tone in theme: the solar Djinn's in light, the demon's in dark; empty when the theme is not known.
func Tour ¶ added in v0.2.0
Tour is the version of its mockup the question shows: 1 before any iteration, one more per iteration round.
func UpdateWorkerDefaults ¶ added in v0.2.0
func UpdateWorkerDefaults(home string, p planv1.Provider, model string) ([]*planv1.WorkerSeat, error)
UpdateWorkerDefaults writes the default provider and model for future spawns of work, investigations, corrections, reviews and enlighten workers to settings.json in home.
func ValidWorkerProvider ¶ added in v0.2.0
ValidWorkerProvider reports whether p is a provider a project's workers may run by default.
func ValidateProviderModel ¶ added in v0.2.0
ValidateProviderModel checks that model is empty (the provider's own default) or a well-formed model of provider p.
func ValidateQuestionModel ¶ added in v0.2.0
ValidateQuestionModel checks that model is empty or a valid model for the project's question workers.
func ValidateTaskModel ¶ added in v0.2.0
ValidateTaskModel normalizes a task's model (expanding human labels and short aliases such as "Gemini 4 Argon" or "argon") and checks that it is valid for provider p.
func WaitingLine ¶ added in v0.1.1
WaitingLine is the one line Djinn types in the lead's terminal when events wait and no watch of the lead does.
func Waits ¶ added in v0.2.0
func Waits(c *planv1.ConfigChange) bool
Waits tells whether the change c waits for your look: found by a look after the first, not yet marked seen, and a line of it asks.
func Wake ¶ added in v0.2.0
Wake wakes question, asleep, at now: by hand, or because its conditions hold. Its put-off date goes, so that it shows at the top of its wish's open questions (render.Woken).
func WarnUnknownField ¶ added in v0.1.1
WarnUnknownField formats a warning for an unknown field, logs it once per file and field, and returns the warning string.
func WhyLeadLaunches ¶ added in v0.2.0
func WhyLeadLaunches(q *planv1.Question, p *planv1.PlannedTask) string
WhyLeadLaunches says why the plan p of q's answer is left to the lead rather than launched with the answer: the answer has a note, or the plan comes after tasks or blocks some. "" when Djinn launches it at once.
func WhyStale ¶ added in v0.2.0
func WhyStale(p *planv1.PlannedTask, tasks []*planv1.Task) string
WhyStale says why the plan p no longer holds among tasks, its wish's: its azima is closed or gone, a task it comes after was cancelled or is gone, a task it blocks has started or is gone. "" when it holds.
func WishLead ¶ added in v0.1.1
WishLead is the lead a wish kept before the one lead, nil when it kept none.
func WithCaller ¶ added in v0.1.1
func WithCaller(ctx context.Context, caller *WorkerCaller) context.Context
WithCaller returns a context carrying the worker caller identity.
func WokeLine ¶ added in v0.2.0
WokeLine is the line that tells a lead the question q woke: its conditions held, or the developer woke it.
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.
func WriteCode ¶ added in v0.1.1
WriteCode updates an azima's code in its plan file's front matter and title heading. It tells whether the file changed.
func WriteDescription ¶ added in v0.1.1
WriteDescription writes the description of an azima into its plan file, after its title heading. It tells whether the file changed.
func WriteStatus ¶ added in v0.1.1
WriteStatus writes an azima's status ("open", "draft", etc.) into its plan file's front matter. It tells whether the file changed.
func WriteTitle ¶ added in v0.1.2
WriteTitle writes an azima's title into its plan file's heading, the first "# " line after its front matter: its code and the separator after it stay ("# T07 · The orchestrator"); a file without a heading gets one, code first. It tells whether the file changed.
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 AzimaDependency ¶ added in v0.1.1
AzimaDependency is an azima that waits for others, itself or through the work part of it (DependencyAzimas). Under the per-azima push strategy Djinn refuses it: each azima's branch is cut from main and lands there on its own, so none holds another's work.
func AzimaDependencies ¶ added in v0.1.1
func AzimaDependencies(tasks []*planv1.Task) []AzimaDependency
AzimaDependencies lists the azimas among tasks, every task of a wish, that wait for others, in the order of their codes.
type AzimaFile ¶
type AzimaFile struct {
// Path is the file, as its project names it: plan/8e8d3d76-orchestrator.md.
Path string
ID string
Code string
Wish string
Phase string
Status string
Title string
// Description is what the file holds after its title heading: its goal and body.
Description 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 (and 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.
func (AzimaFile) Closes ¶
Closes tells whether the file closes its azima: its status says done, or every box of its Done-when section is checked. A draft azima never closes.
type Babysit ¶ added in v0.1.1
type Babysit struct {
// Skill is the skill's name; Dir its folder.
Skill, Dir string
// Watch is the watcher's command line: {pr} and {mr} are the request's number, {state} a file of the watcher's
// own under Djinn's data folder.
Watch string
// DoneWhen is a watcher line that ends it, done; empty: its command's exit does.
DoneWhen string
// Restart starts the command again after each exit, until its done line.
Restart bool
// Forge is the forge the declaration is for, ForgeGitHub or ForgeGitLab; empty for any.
Forge string
}
Babysit is how a project babysits its pull or merge requests, as a skill of it declares it.
func ProjectBabysit ¶ added in v0.1.1
ProjectBabysit is the babysit declaration of the project's own skills for forge (ForgeGitHub, ForgeGitLab): the first by name that names this forge, else the first that names none. nil without one. A summoned skill does not count: its watcher would run in the folder of the project that holds it, not in the request's repository.
func ReadBabysit ¶ added in v0.1.1
ReadBabysit reads the babysit declaration of the skill in dir: nil without one, an error when it cannot be used.
func (*Babysit) Fill ¶ added in v0.1.1
Fill is the watcher's command line for the request number, its state in the file state.
type Blocks ¶
type Blocks struct {
planv1connect.UnimplementedBlockServiceHandler
Store *store.Store
}
Blocks implements BlockService.
type BranchHold ¶ added in v0.3.0
BranchHold is the hold of branch's push in a WishPush (WishPush.holds).
func PushHolds ¶ added in v0.3.0
func PushHolds(p *planv1.WishPush) []BranchHold
PushHolds are the holds of p, by branch name: each branch keeps its own (W37).
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 ¶
func BuildBrief(ctx context.Context, r store.Reader, home, wishID string, leads ...Leads) (Brief, error)
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 Config ¶ added in v0.2.0
type Config struct {
// Dir is the folder that holds them, laid out as the project's folder: the project's folder, or a folder of the
// cache.
Dir string
// Folder is the project's folder, where a file is fixed and the commands run.
Folder string
// Ref is the reference branch's ref Djinn read them from, short: origin/main; empty when Dir is Folder.
Ref string
// Commit is the commit Ref pointed at, in full; empty when Dir is Folder.
Commit string
// TeamBranch is the branch the team's file names in the default branch's tree, when Djinn took it as the
// reference branch; empty otherwise.
TeamBranch string
}
Config is where Djinn reads a project's configuration on this machine: its .agents/settings.txtpb, its .agents/permissions.txtpb and its skills. In Git, with a remote, Djinn reads them in the reference branch's tree at the last fetch, extracted into its cache by digest: a branch checked out in the project's folder does not change them. Outside Git, without a remote, or when the reference branch is not fetched, it reads them in the project's folder.
func ProjectConfig ¶ added in v0.2.0
ProjectConfig is where Djinn reads project's configuration on this machine (Config), home its data folder. Without home, a folder, Git, a remote, or a reference branch the repository holds, Djinn reads the project's folder; also when the extraction fails, which it logs.
func (Config) FromReference ¶ added in v0.2.0
FromReference tells whether Djinn reads the configuration in the reference branch's tree, not in the project's folder.
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 FetchRef ¶ added in v0.2.0
FetchRef fetches the remote ref (refs/remotes/origin/main) of the repository holding folder from its remote.
type IfritWaits ¶ added in v0.2.0
IfritWaits names, by the task of each lit ifrit, who waits for a gate it holds: "W15 (Its title): go tool task e2e, for stack". djinn up gives the gates' (gate.Gates.IfritWaits).
type Inbox ¶
type Inbox struct {
planv1connect.UnimplementedInboxServiceHandler
// Wishes routes an item: it files it, or makes its wish and starts its watcher.
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 IterateHook ¶ added in v0.2.0
IterateHook starts the mockup task of the iteration round, the last of q's, and returns its code; "" when none starts, which the lead hears of instead.
type LaunchPlan ¶ added in v0.2.0
type LaunchPlan func(ctx context.Context, q *planv1.Question, p *planv1.PlannedTask) (*planv1.Task, error)
LaunchPlan spawns the task p plans for the answered question q, its decision q, and records it in q's plan: the harness does it, once the plan holds.
type LeadDrive ¶ added in v0.2.0
type LeadDrive struct {
// contains filtered or unexported fields
}
LeadDrive is what Djinn knows of the lead it drives, in memory: shared by every service of a store, kept by the driver (harness.LeadDriver).
func DriveLead ¶ added in v0.2.0
DriveLead makes the lead of s's Djinn driven: LeadService runs no terminal for it. changed tells the window that the lead changed: a batch started, ended or failed.
func (*LeadDrive) Batch ¶ added in v0.2.0
Batch is the batch that runs, or else the last one; nil before the first.
func (*LeadDrive) Fail ¶ added in v0.2.0
Fail records why a batch failed twice: the window shows it beside Lead until a batch ends its turn.
func (*LeadDrive) Failure ¶ added in v0.2.0
Failure is why the last batch failed twice; empty when none did since a batch ended its turn.
func (*LeadDrive) LeadLimit ¶ added in v0.2.0
LeadLimit is the usage limit the lead Djinn drives hit, and where it may move, until a batch ends its turn or it moves; nil when none.
func (*LeadDrive) Retried ¶ added in v0.2.0
func (d *LeadDrive) Retried() <-chan struct{}
Retried is closed when the developer asks to try the waiting events again (Lead in the window, djinn lead resume).
type LeadService ¶ added in v0.1.1
LeadService implements planv1connect.LeadServiceHandler.
func (*LeadService) Accounts ¶ added in v0.2.0
func (s *LeadService) Accounts( _ context.Context, _ *connect.Request[planv1.LeadServiceAccountsRequest], ) (*connect.Response[planv1.LeadServiceAccountsResponse], error)
Accounts implements LeadService.Accounts.
func (*LeadService) AddAccount ¶ added in v0.2.0
func (s *LeadService) AddAccount( ctx context.Context, req *connect.Request[planv1.LeadServiceAddAccountRequest], ) (*connect.Response[planv1.LeadServiceAddAccountResponse], error)
AddAccount implements LeadService.AddAccount: the account is written to settings.json and its folder made; the agent signs in there itself, by the command it returns.
func (*LeadService) Brief ¶ added in v0.1.1
func (s *LeadService) Brief( ctx context.Context, req *connect.Request[planv1.LeadServiceBriefRequest], ) (*connect.Response[planv1.LeadServiceBriefResponse], error)
func (*LeadService) Choose ¶ added in v0.1.1
func (s *LeadService) Choose( ctx context.Context, req *connect.Request[planv1.LeadServiceChooseRequest], ) (*connect.Response[planv1.LeadServiceChooseResponse], error)
Choose answers the choice the lead's agent shows in its terminal, as its keys would: the window's answer to an approval. The lead's terminal never runs a shell (P9), so the keys go to the agent.
func (*LeadService) Event ¶ added in v0.2.0
func (s *LeadService) Event( ctx context.Context, req *connect.Request[planv1.LeadServiceEventRequest], ) (*connect.Response[planv1.LeadServiceEventResponse], error)
Event is one of the lead's events whole, as a driven lead's batch writes it: a digest names it when it cuts a note.
func (*LeadService) Get ¶ added in v0.1.1
func (s *LeadService) Get( ctx context.Context, req *connect.Request[planv1.LeadServiceGetRequest], ) (*connect.Response[planv1.LeadServiceGetResponse], error)
func (*LeadService) GetCircle ¶ added in v0.2.0
func (s *LeadService) GetCircle( ctx context.Context, _ *connect.Request[planv1.LeadServiceGetCircleRequest], ) (*connect.Response[planv1.LeadServiceGetCircleResponse], error)
GetCircle implements LeadService.GetCircle: returns the global Summoning Circle rows, signed-in providers, and available models for all worker kinds.
func (*LeadService) Journal ¶ added in v0.2.0
func (s *LeadService) Journal( ctx context.Context, req *connect.Request[planv1.LeadServiceJournalRequest], ) (*connect.Response[planv1.LeadServiceJournalResponse], error)
Journal prints the lead's journal: the latest batches, of a wish or of all.
func (*LeadService) Move ¶ added in v0.2.0
func (s *LeadService) Move( ctx context.Context, req *connect.Request[planv1.LeadServiceMoveRequest], ) (*connect.Response[planv1.LeadServiceMoveResponse], error)
Move implements LeadService.Move: the seat is written to settings.json, the command to the journal. The waiting events, if a batch failed or hit a limit, go to the new seat at once.
func (*LeadService) Notes ¶ added in v0.1.2
func (s *LeadService) Notes( ctx context.Context, req *connect.Request[planv1.LeadServiceNotesRequest], ) (*connect.Response[planv1.LeadServiceNotesResponse], error)
Notes is the index of the lead's notes, or notes whole: one, several named a,b, or all of them. They are built into djinn, read only.
func (*LeadService) RemoveAccount ¶ added in v0.2.0
func (s *LeadService) RemoveAccount( ctx context.Context, req *connect.Request[planv1.LeadServiceRemoveAccountRequest], ) (*connect.Response[planv1.LeadServiceRemoveAccountResponse], error)
RemoveAccount implements LeadService.RemoveAccount: Djinn forgets the account; its folder stays.
func (*LeadService) Resume ¶ added in v0.1.1
func (s *LeadService) Resume( ctx context.Context, req *connect.Request[planv1.LeadServiceResumeRequest], ) (*connect.Response[planv1.LeadServiceResumeResponse], error)
Resume starts the lead, or attaches to it, and keeps why it could not: the window shows it until Lead is clicked again.
func (*LeadService) Say ¶ added in v0.2.0
func (s *LeadService) Say( ctx context.Context, req *connect.Request[planv1.LeadServiceSayRequest], ) (*connect.Response[planv1.LeadServiceSayResponse], error)
Say puts a reply or a decision the lead took alone on the wish, as a block of kind "reply" or "decided" from the lead: the wish's stream brings it to the window's bubble held to the Lamp pill.
func (*LeadService) Sessions ¶ added in v0.2.0
func (s *LeadService) Sessions( ctx context.Context, req *connect.Request[planv1.LeadServiceSessionsRequest], ) (*connect.Response[planv1.LeadServiceSessionsResponse], error)
Sessions lists the batches of the lead Djinn drives with their local time, state, cost, session, error count and transcript path.
func (*LeadService) Set ¶ added in v0.1.1
func (s *LeadService) Set( ctx context.Context, req *connect.Request[planv1.LeadServiceSetRequest], ) (*connect.Response[planv1.LeadServiceSetResponse], error)
func (*LeadService) SetCircle ¶ added in v0.2.0
func (s *LeadService) SetCircle( ctx context.Context, req *connect.Request[planv1.LeadServiceSetCircleRequest], ) (*connect.Response[planv1.LeadServiceSetCircleResponse], error)
SetCircle implements LeadService.SetCircle: validates and stores one row of the global Summoning Circle in settings.json, keeping the lead seat in sync when WORKER_KIND_LEAD changes.
func (*LeadService) Show ¶ added in v0.2.0
func (s *LeadService) Show( ctx context.Context, req *connect.Request[planv1.LeadServiceShowRequest], ) (*connect.Response[planv1.LeadServiceShowResponse], error)
Show prints the readable conversation of one batch of the lead Djinn drives from its transcript, and with --resume the command to fork the session in plan mode.
func (*LeadService) Tell ¶ added in v0.1.1
func (s *LeadService) Tell( ctx context.Context, req *connect.Request[planv1.LeadServiceTellRequest], ) (*connect.Response[planv1.LeadServiceTellResponse], error)
Tell types what the developer writes in the lead's terminal, as their own words: the lead must run there, never a shell, where the text would run as a command. About a wish, the text starts by naming it. While Djinn drives the lead, the text is an event of its queue instead, for the next batch.
func (*LeadService) Watch ¶ added in v0.1.1
func (s *LeadService) Watch( ctx context.Context, req *connect.Request[planv1.LeadServiceWatchRequest], ) (*connect.Response[planv1.LeadServiceWatchResponse], error)
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
// SayText is Say for a text the person wrote: its line breaks stay line breaks for a program that takes a
// paste. It tells whether the text waits for the person, typing there or before a choice on screen.
SayText(name, text string) (waiting bool, err error)
// Running tells whether the terminal called name runs.
Running(name string) bool
// Exit is how the program of the terminal called name ended, kept until a program starts there again; nil while
// it runs, or when none ran.
Exit(name string) *planv1.LeadExit
// Command is the command line of the running terminal called name; nil when none runs.
Command(name string) []string
// Close hangs up the running terminal called name, as closing it in the window does; none runs, nothing.
Close(name string)
// Prompt is the choice the program of the terminal called name shows now, as read from its screen: an approval,
// a folder to trust. Nil when it shows none, or runs nothing.
Prompt(name string) *planv1.LeadPrompt
// Choose picks the option index (from 0) of the choice the terminal called name shows, as its keys would. It
// returns ErrNoChoice, typing nothing, when the screen no longer shows the choice of title, lines and options.
Choose(name, title string, lines, options []string, index int) error
}
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
// Approved, when set, is called with a question once the developer approved the answer the lead or a worker
// gave it: the only approval that tells the lead something (decision Q173).
Approved func(context.Context, *planv1.Question)
}
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 task takes one mark, reviewed, kept the same way on the task. 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 WithClock ¶ added in v0.1.1
WithClock gives the plan services their clock; tests set a fake one.
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 WithFillModels ¶ added in v0.1.1
WithFillModels sets the function that fills forecast models on tasks for Watch.
func WithHome ¶
WithHome gives the services Djinn's data folder: each developer's own settings of a project, and the tilasms' files.
func WithIfritWaits ¶ added in v0.2.0
func WithIfritWaits(waits IfritWaits) Option
WithIfritWaits tells the briefs who waits for the gates the lit ifrits hold.
func WithIterated ¶ added in v0.2.0
func WithIterated(f IterateHook) Option
WithIterated calls f with a question once an iteration round is stored on it: the harness starts its mockup task. With WithLeads, the wish's lead is told next when none started (Wishes.Iterated).
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 WithLaunch ¶ added in v0.2.0
func WithLaunch(f LaunchPlan) Option
WithLaunch gives QuestionService the harness that launches a question's planned task (Questions.Launch).
func WithLeadBroadcaster ¶ added in v0.1.1
func WithLeadBroadcaster(b *func()) Option
WithLeadBroadcaster gives the caller what tells the open Watch streams that the choice the lead shows in its terminal came, changed or went (Wishes.ChangeLead).
func WithLeadFailed ¶ added in v0.1.1
WithLeadFailed gives LeadService.Get why the lead could not start before the services ran, as djinn up resumes it: the window shows it beside Lead until Lead starts it.
func WithLoad ¶ added in v0.1.1
WithLoad gives the wishes Djinn's current load notch, for WishService.Watch.
func WithLoadBroadcaster ¶ added in v0.1.1
WithLoadBroadcaster gives the caller what notifies the open Watch streams of a load notch change.
func WithOverlaps ¶ added in v0.2.0
WithOverlaps gives a wish's brief its Overlaps section: the open tasks that touch the same files.
func WithPublisher ¶ added in v0.2.0
WithPublisher gives TilasmService.Publish what publishes a tilasm on claude.ai.
func WithPusher ¶ added in v0.1.1
WithPusher gives ProjectService the pusher for pushing and computing sync status.
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 Overlaps ¶ added in v0.2.0
Overlaps writes the Overlaps section of a wish's brief: the open tasks that touch the same files, read from their worktrees; empty when none do. djinn up gives the harness's (harness.Harness.OverlapsBrief).
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
Pusher Pusher
}
Projects implements ProjectService.
func (*Projects) Acknowledge ¶ added in v0.2.0
func (*Projects) Allow ¶ added in v0.1.2
func (p *Projects) Allow( ctx context.Context, req *connect.Request[planv1.ProjectServiceAllowRequest], ) (*connect.Response[planv1.ProjectServiceAllowResponse], error)
Allow shows the watcher and serve commands the developer allows in a project for themselves, or allows one, or takes one back: in their own settings file, never in the repository.
func (*Projects) Branches ¶ added in v0.1.1
func (p *Projects) Branches( ctx context.Context, req *connect.Request[planv1.ProjectServiceBranchesRequest], ) (*connect.Response[planv1.ProjectServiceBranchesResponse], error)
Branches lists the local branches of a project's repository, the latest commit first, without the branches of Djinn's tasks: where a wish's work may land.
func (*Projects) ForgetSync ¶ added in v0.2.0
func (p *Projects) ForgetSync( ctx context.Context, req *connect.Request[planv1.ProjectServiceForgetSyncRequest], ) (*connect.Response[planv1.ProjectServiceForgetSyncResponse], error)
ForgetSync forgets the sync of a branch with nothing to push: the project's syncs leave it out until it moves.
func (*Projects) Pull ¶ added in v0.2.0
func (p *Projects) Pull( ctx context.Context, req *connect.Request[planv1.ProjectServicePullRequest], ) (*connect.Response[planv1.ProjectServicePullResponse], error)
Pull brings a branch Djinn pushes, or every one, up to its remote's when it is behind it: a fast-forward only.
func (*Projects) PushStrategy ¶ added in v0.1.1
func (*Projects) SetBranch ¶ added in v0.2.0
func (p *Projects) SetBranch( ctx context.Context, req *connect.Request[planv1.ProjectServiceSetBranchRequest], ) (*connect.Response[planv1.ProjectServiceSetBranchResponse], error)
SetBranch writes the reference branch the developer chooses for a project as main_branch in their own settings file, or takes it back with unset: never in the repository. A branch the repository does not hold is refused.
type PublishBlockedError ¶ added in v0.2.0
type PublishBlockedError struct {
Block planv1.PublishBlock
Detail string
}
PublishBlockedError is why a publish cannot start on this machine.
func (*PublishBlockedError) Error ¶ added in v0.2.0
func (e *PublishBlockedError) Error() string
type Published ¶ added in v0.2.0
type Published struct {
URL string
Version int32 // The artifact's own version on claude.ai.
CostUSD float64
}
Published is what a publish did, read from the Artifact tool's result.
type Publisher ¶ added in v0.2.0
type Publisher struct {
// Home is Djinn's data folder: the accounts a signed-in Claude is looked for in.
Home string
// UserHome and Path are the user's home folder and the PATH claude is found on; empty: this process's.
UserHome, Path string
// Gate takes the paid gate for what, for the task taskID when a worker publishes (empty otherwise), and gives the
// release; nil: no gate.
Gate func(ctx context.Context, taskID, what string) (release func(), err error)
// Timeout is how long a publish may take; ArtifactTimeout by default.
Timeout time.Duration
// contains filtered or unexported fields
}
Publisher publishes tilasms on claude.ai with Claude Code, one short claude -p call each, and says whether it can.
func (*Publisher) Check ¶ added in v0.2.0
func (p *Publisher) Check(ctx context.Context) (block planv1.PublishBlock, detail string, env []string)
Check says whether tilasms can be published: claude installed, signed in, and offering the Artifact tool. The tool is looked for once per start, by a call cut at its first event, before any model call: it costs nothing. Installed and signed in are checked each time.
func (*Publisher) Publish ¶ added in v0.2.0
func (p *Publisher) Publish(ctx context.Context, taskID, code string, b *tilasm.Bundle, url string) (*Published, error)
Publish publishes the bundle b on claude.ai, at url when it has one, under the paid gate. The address comes from the Artifact tool's result, never from the model's words: a call that tells none failed.
type Pusher ¶ added in v0.1.1
type Pusher interface {
Push(ctx context.Context, wishID, projectID, branch string) (*planv1.IntegrationPush, error)
Syncs(ctx context.Context, project *planv1.Project) ([]*planv1.ProjectSync, error)
ForgetSync(ctx context.Context, project *planv1.Project, branch string) error
Pull(ctx context.Context, project *planv1.Project, branch string) ([]*planv1.BranchPull, error)
Reference(ctx context.Context, project *planv1.Project, name string) (branch, ref string, err error)
}
Pusher pushes a wish's branches, all or only one, computes how far each branch it pushes in a project is out of sync with its remote, forgets one that landed, pulls those behind their remote, and finds a project's reference branch: from name, its main_branch setting, the branch and the ref Djinn merges it from (refs/remotes/origin/main), or why the repository holds none.
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
// NoteEdited, when set, is called with a question whose answer kept its choice and changed its note only, with
// the note it had: the hooks do not run again, the lead hears of the note.
NoteEdited func(ctx context.Context, q *planv1.Question, was string)
// 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)
// Woke are called with a question woken by hand once it is stored (Sleep): the scheduler tells of the others.
Woke []func(ctx context.Context, q *planv1.Question)
// Asked are called with a question once it is stored: the lead hears of a blocking one (Wishes.Asked).
Asked []func(ctx context.Context, q *planv1.Question)
// 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
// Workers tells whether a task is running.
Workers WishWorkers
// LaunchPlan, when set, launches the task an answered question's option planned (Launch).
LaunchPlan LaunchPlan
// Iterated are called with a question once an iteration round is stored on it: the harness starts its mockup
// task, and says its code.
Iterated []IterateHook
// Wishes, when set, tells the lead of an iteration no mockup task took on.
Wishes *Wishes
}
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) Get ¶ added in v0.2.0
func (q *Questions) Get( ctx context.Context, req *connect.Request[planv1.QuestionServiceGetRequest], ) (*connect.Response[planv1.QuestionServiceGetResponse], error)
Get returns one question as it stands: its rounds keep who asked to investigate and why, not what each revision replaced, which can weigh many times the question.
func (*Questions) Later ¶ added in v0.2.0
func (q *Questions) Later( ctx context.Context, req *connect.Request[planv1.QuestionServiceLaterRequest], ) (*connect.Response[planv1.QuestionServiceLaterResponse], error)
Later puts an open question off for later, or back in its place with clear: its later_time is now, or unset.
func (*Questions) Launch ¶ added in v0.2.0
func (q *Questions) Launch( ctx context.Context, req *connect.Request[planv1.QuestionServiceLaunchRequest], ) (*connect.Response[planv1.QuestionServiceLaunchResponse], error)
Launch launches the task the chosen option of an answered question planned, as it is or with what the request gives in place of its own; refused when it is launched already, or no longer holds.
func (*Questions) Move ¶ added in v0.1.1
func (q *Questions) Move( ctx context.Context, req *connect.Request[planv1.QuestionServiceMoveRequest], ) (*connect.Response[planv1.QuestionServiceMoveResponse], error)
Move moves an open question to another wish, optionally along with tasks that name it as their decision.
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.
func (*Questions) Sleep ¶ added in v0.2.0
func (q *Questions) Sleep( ctx context.Context, req *connect.Request[planv1.QuestionServiceSleepRequest], ) (*connect.Response[planv1.QuestionServiceSleepResponse], error)
Sleep puts an open question to sleep until its conditions hold, or wakes it now: the lead hears of it (Woke).
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
TestOne string
// The checks Djinn runs before it merges 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
// EnlightenWorkers says whether Djinn starts an investigator after a request to investigate ("Enlighten me").
EnlightenWorkers bool
QuestionProvider planv1.Provider
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
Push planv1.ProjectPush
PushStrategy planv1.PushStrategy
InstallQuestions planv1.InstallQuestions
// Babysit says whether Djinn babysits the pull or merge request a task opens, with the project's babysit skill.
Babysit bool
// WatchCommands are the commands, or their starts, the developer lets a watcher run in the project besides those
// its .agents/permissions.txtpb lists: from their own file only.
WatchCommands []string
// ServeCommands are the commands, or their starts, the developer lets an ifrit's serve run in the project besides
// those its .agents/permissions.txtpb lists: from their own file only.
ServeCommands []string
// InstallBuilds says whether a build of the running Djinn's line, once pushed, installs by itself (W554).
InstallBuilds bool
Warnings []string
ProviderFrom, ModelFrom, BudgetFrom, BranchFrom, GeneratedFrom, GenerateFrom, SetupFrom planv1.SettingSource
ChecksFrom, AttemptsFrom, InstallFrom, TestOneFrom planv1.SettingSource
EnlightenWorkersFrom planv1.SettingSource
QuestionProviderFrom, QuestionModelFrom, QuestionBudgetFrom planv1.SettingSource
MainBranchFrom, MergeMainFrom, MergeMainEveryFrom, InstallReleasesFrom, PushFrom, PushStrategyFrom planv1.SettingSource
InstallQuestionsFrom, BabysitFrom, WatchCommandsFrom, InstallBuildsFrom planv1.SettingSource
ServeCommandsFrom 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, how a worker runs the commit checks and targeted tests (never push checks), 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) IfritChecksBrief ¶ added in v0.2.0
IfritChecksBrief is ChecksBrief for an ifrit's first prompt (T51): which checks Djinn runs and when, but an ifrit runs none of them after a change: Djinn runs the commit checks once the developer finishes it. "" for a project that sets none.
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 FindProjectSkill ¶ added in v0.2.0
FindProjectSkill is the skill name of project, case ignored, where Djinn reads its configuration (ProjectConfig), home its data folder.
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
// Home is Djinn's data folder, where it reads the projects' configuration (ConfigDir); empty: their folders.
Home string
}
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
// Summary says what it reads, in a sentence: metadata.djinn.source.summary, else the skill's description.
Summary 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
// Declined tells whether you said no to it on this machine: its project no longer asks whether to plug it in.
Declined bool
// Err says why the source cannot be used; nil when it can.
Err error
// Run is its last run on this machine; nil before its first.
Run *planv1.SourceRun
}
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 ¶
func Sources(ctx context.Context, r store.Reader, home string, projects []*planv1.Project) ([]*Source, error)
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
// Folder is its folder in its project's folder, where it is fixed: Dir, unless Djinn reads that project's
// configuration on its reference branch.
Folder 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.
func Templates ¶
func Templates(ctx context.Context, r store.Reader, home string, projects []*planv1.Project) ([]*Template, error)
Templates are the wish templates of the skills the projects use, their own then those they summon, in the projects' order then by name. A template that cannot be used is left out.
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
// Marks answers the question a launch without a comment approves; nil: such a launch is unavailable.
Marks *Marks
// Wake, when set, wakes the lead's watch once a send queued its event.
Wake func()
// Questions, when set, iterates on the question whose mockup option iterates on a tilasm its comments are sent
// on to iterate (Questions.iterated).
Questions *Questions
// Publisher publishes tilasms on claude.ai; nil: Publish is unavailable.
Publisher *Publisher
// contains filtered or unexported fields
}
Tilasms implements TilasmService.
func (*Tilasms) CheckPublish ¶ added in v0.2.0
func (t *Tilasms) CheckPublish( ctx context.Context, _ *connect.Request[planv1.TilasmServiceCheckPublishRequest], ) (*connect.Response[planv1.TilasmServiceCheckPublishResponse], error)
CheckPublish tells the window whether it shows the button that publishes a tilasm.
func (*Tilasms) ConfirmPublish ¶ added in v0.2.0
func (t *Tilasms) ConfirmPublish( ctx context.Context, req *connect.Request[planv1.TilasmServiceConfirmPublishRequest], ) (*connect.Response[planv1.TilasmServiceConfirmPublishResponse], error)
ConfirmPublish records the developer's go-ahead to publish a tilasm, from the window; a second one keeps the first.
func (*Tilasms) DeleteComment ¶ added in v0.2.0
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. An HTML page ends with the bridge's tag (bridgeTag), its other files are served as they are, and server.TilasmBridge serves the bridge.
func (*Tilasms) PlaceComments ¶ added in v0.2.0
func (*Tilasms) Publish ¶ added in v0.2.0
func (t *Tilasms) Publish( ctx context.Context, req *connect.Request[planv1.TilasmServicePublishRequest], ) (*connect.Response[planv1.TilasmServicePublishResponse], error)
Publish publishes a tilasm's latest version on claude.ai. Its first publish waits for the developer's go-ahead, given in the window (ConfirmPublish): the lead and the workers publish again what the developer let out, never more.
func (*Tilasms) PutComment ¶ added in v0.2.0
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.
func (*Tilasms) SendComments ¶ added in v0.2.0
type Told ¶
Told tells the wish's lead that q was answered, did saying what the hooks did with the answer; was is the answer it replaced, when the developer changed their choice, or nil.
type UnreadableSkillError ¶ added in v0.2.0
type UnreadableSkillError struct{ Err error }
UnreadableSkillError is why Djinn cannot read what a skill's SKILL.md declares for it: its metadata is not YAML, or its metadata.djinn is not what Djinn reads. Nothing of the skill counts for Djinn, neither template, source nor babysit: a problem of the project that holds it, not a source of the inbox. Another key of the front matter that breaks the YAML is only a warning: skillFront reads metadata apart.
func (*UnreadableSkillError) Error ¶ added in v0.2.0
func (e *UnreadableSkillError) Error() string
func (*UnreadableSkillError) Unwrap ¶ added in v0.2.0
func (e *UnreadableSkillError) Unwrap() error
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
HasRun(taskID string) bool
CloseOutrun(wishID, code string)
}
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
// Load reports Djinn's current load notch; nil where djinn up does not run machine monitoring.
Load func() djinnv1.LoadNotch
// FillModels fills forecast models on tasks for Watch.
FillModels func(context.Context, []*planv1.Task)
// Clock gives the wishes their time; nil uses time.Now.
Clock func() time.Time
// IfritWaits says who waits for the gates the lit ifrits hold, in the briefs; nil where djinn up runs no gates.
IfritWaits IfritWaits
// Overlaps writes a wish's Overlaps section, from its tasks' worktrees; nil where djinn up runs no tasks.
Overlaps Overlaps
// 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) AddProject ¶ added in v0.2.0
func (w *Wishes) AddProject( ctx context.Context, req *connect.Request[planv1.WishServiceAddProjectRequest], ) (*connect.Response[planv1.WishServiceAddProjectResponse], error)
AddProject adds a project, named or by identifier, to the wish, with its integration branch there as Make records one: the project's reference branch. A project already in the wish is refused.
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 that the developer answered q, in one line, with what Djinn did with the answer (did) when it settled it: an event in the lead's queue, which its watch hands out (decision Q191), never lost. Handlers calls it once the answer is stored, when it serves the leads; the answer stays in the brief whatever happens here. While no lead runs, the question is marked waiting for a lead, until the lead acknowledges it. was is the answer it replaced, when the developer changed their choice: the line says so. One answer is one event: the answer events of q that still wait for the lead give way to this one.
func (*Wishes) Approved ¶ added in v0.1.1
Approved tells the lead that the developer approved the answer the lead or a worker gave q: the decision is the developer's now. Marks calls it once the approval is stored, and only for such an answer (decision Q173).
func (*Wishes) Asked ¶ added in v0.2.0
Asked tells the lead of q's wish that a worker asked q, a blocking question (djinn question ask --wait). Questions calls it once q is stored.
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) ChangeLead ¶ added in v0.1.1
func (w *Wishes) ChangeLead()
ChangeLead tells the open Watch streams that the lead changed outside the store: the choice its agent shows in its terminal came, changed or went. The window reads the lead again (LeadService.Get), as for a lead stored.
func (*Wishes) ChangeLoad ¶ added in v0.1.1
ChangeLoad tells the open Watch streams that Djinn's load notch changed.
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, 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) Drive ¶ added in v0.2.0
Drive is the lead Djinn drives on w's store; nil when its lead runs in a terminal.
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) Icon ¶ added in v0.2.0
func (w *Wishes) Icon( ctx context.Context, req *connect.Request[planv1.WishServiceIconRequest], ) (*connect.Response[planv1.WishServiceIconResponse], error)
Icon sets the wish's icon, a name of the bank, in place of what it had; empty takes it back to its mark. A name outside the bank is refused, with how to find one.
func (*Wishes) Icons ¶ added in v0.2.0
func (w *Wishes) Icons( _ context.Context, req *connect.Request[planv1.WishServiceIconsRequest], ) (*connect.Response[planv1.WishServiceIconsResponse], error)
Icons lists the bank of wish icons, or the icons whose words hold every word searched.
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) Iterated ¶ added in v0.2.0
Iterated tells the lead of q's wish that the developer iterates on its mockup with round, and that no mockup task started: the lead iterates.
func (*Wishes) LeadEventsChanged ¶ added in v0.2.0
func (w *Wishes) LeadEventsChanged() <-chan struct{}
LeadEventsChanged is closed at the next event queued for the lead.
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) NoteEdited ¶ added in v0.1.2
NoteEdited tells the lead that the developer changed the note of their answer to q, which had the note was: the answer event of q that still waits for the lead takes the new note in its place; or else one event says it, which the next edits change in turn while it waits. However many times the note is saved, the lead reads it once.
func (*Wishes) Notify ¶ added in v0.1.1
Notify queues e for the lead, and wakes its watch. With none waiting, Djinn types one short line in the lead's terminal once the events settle: "Djinn: N events waiting, run djinn lead watch".
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) PushStrategy ¶ added in v0.1.1
func (w *Wishes) PushStrategy( ctx context.Context, req *connect.Request[planv1.WishServicePushStrategyRequest], ) (*connect.Response[planv1.WishServicePushStrategyResponse], error)
PushStrategy shows or sets the push strategy of a wish.
func (*Wishes) Queued ¶ added in v0.2.0
func (w *Wishes) Queued()
Queued wakes the lead's watch, as Notify does, for an event another service stored in a transaction of its own.
func (*Wishes) RemindLead ¶ added in v0.1.1
func (w *Wishes) RemindLead()
RemindLead types the line that says events wait, after a grace for the lead's watch to come back, when events wait and no watch does: djinn up calls it once it runs, so that a lead whose watch died with the last djinn up hears of what happened meanwhile, the restart first.
func (*Wishes) Rename ¶ added in v0.1.1
func (w *Wishes) Rename( ctx context.Context, req *connect.Request[planv1.WishServiceRenameRequest], ) (*connect.Response[planv1.WishServiceRenameResponse], error)
Rename sets the wish's title, in place of what it had.
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) Reorder ¶ added in v0.2.0
func (w *Wishes) Reorder( ctx context.Context, req *connect.Request[planv1.WishServiceReorderRequest], ) (*connect.Response[planv1.WishServiceReorderResponse], error)
Reorder moves a paused or granted wish to another place in the list of the wishes of its state, and shifts the others. It stays as it is: Move makes it active.
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, 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. ErrNoLead when there is none to tell.
func (*Wishes) WaitLeadEvents ¶ added in v0.2.0
WaitLeadEvents waits until events wait for the lead, then for them to settle as a watch does (2 seconds of quiet, 10 at most), and returns those waiting, oldest first.
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.
type WorkerCaller ¶ added in v0.1.1
WorkerCaller identifies a worker making a request through its task and wish.
func CallerFromContext ¶ added in v0.1.1
func CallerFromContext(ctx context.Context) *WorkerCaller
CallerFromContext returns the worker caller from ctx, or nil if none.
Source Files
¶
- artifact.go
- azimas.go
- babysit.go
- blocks.go
- brief.go
- caller.go
- carry.go
- config.go
- config_changes.go
- config_watch.go
- decisions.go
- drive.go
- exchange.go
- inbox.go
- integration.go
- iterate.go
- lead.go
- leadwatch.go
- marks.go
- merge.go
- newlead.go
- notices.go
- page.go
- paginate.go
- permissions.go
- plan.go
- plans.go
- proof.go
- remote.go
- rounds.go
- route.go
- seat.go
- settings.go
- shape.go
- shortname_other.go
- skills.go
- sleep.go
- tasks.go
- tell.go
- templates.go
- tilasm_comments.go
- tilasm_files.go
- tilasm_publish.go
- tilasm_reply.go
- tilasm_send.go
- tilasms.go
- times.go
- tone.go
- unknown.go
- wait.go
- watch.go
- wishes.go
- worktrees.go