@webappwiz/arbor 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/reply.d.ts DELETED
@@ -1,102 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Fs } from "webappwiz/system";
3
- import type { Attachment } from "./attachments.js";
4
- import { type Question } from "./plan.js";
5
- import { type Replies, type ReplyState } from "./replies.js";
6
- import type { Todos } from "./todo.js";
7
- import type { WorktreeService } from "./worktree-service.js";
8
- export type { Attachment } from "./attachments.js";
9
- /** What answering, and reading an answer, work with. */
10
- export interface ReplyDeps {
11
- service: WorktreeService;
12
- fs: Fs;
13
- replies: Replies;
14
- }
15
- export interface ReplyInput {
16
- /** Words, alongside the picks or instead of them. */
17
- text: string;
18
- /**
19
- * The keys of the choices picked (`b`), for a question that offers them:
20
- * at most one for a `- (a)` question, any number for a `- [a]` one.
21
- */
22
- choices?: string[];
23
- /** Files of any kind to add. */
24
- files?: Attachment[];
25
- /**
26
- * Which files an earlier reply attached to keep, by path. Absent keeps
27
- * none: a new reply replaces the old one whole.
28
- */
29
- keep?: string[];
30
- }
31
- export interface Replied {
32
- task: string;
33
- /** The question as the plan asks it. */
34
- question: Question;
35
- /** The reply, waiting for its agent to claim it. */
36
- reply: ReplyState;
37
- }
38
- /**
39
- * Answers one of a task's questions, or follows up one whose answer its agent
40
- * has read. The reply waits under `.git/arbor/replies/<task>/` with its files,
41
- * not in the plan, and replaces any earlier one there, until the task's agent
42
- * claims it with `arbor replies` or `arbor wait --answered`. Until then it can
43
- * be changed or withdrawn; after, it is the agent's, and anything more is
44
- * another follow-up.
45
- *
46
- * Refuses a tree whose agent is in a live session. That agent is not reading
47
- * its inbox, it is waiting in its chat, which is where the answer belongs.
48
- */
49
- export declare function replyTo(deps: ReplyDeps, task: string, question: string, { text, choices, files, keep }: ReplyInput): Promise<Replied>;
50
- /**
51
- * Takes back a reply its agent has not claimed yet, files and all: the
52
- * question waits on a person again.
53
- */
54
- export declare function withdrawReply(deps: ReplyDeps, task: string, question: string): Promise<Replied>;
55
- /**
56
- * Holds a reply for a person editing it, so its agent cannot claim it
57
- * half-changed. The hold lapses on its own (`EDIT_MS`) if the person walks
58
- * away; saving or `releaseReply` ends it sooner. Refuses one its agent has
59
- * already claimed: that is the moment it stops being editable.
60
- */
61
- export declare function holdReply(deps: ReplyDeps, task: string, question: string): Promise<Replied>;
62
- /** Lets go of a reply a person was editing, leaving it as it was. */
63
- export declare function releaseReply({ replies }: {
64
- replies: Replies;
65
- }, task: string, question: string): Promise<void>;
66
- export interface Claimed {
67
- task: string;
68
- /**
69
- * The questions whose replies or follow-ups were claimed, as the plan now
70
- * reads them.
71
- */
72
- claimed: Question[];
73
- /** Questions with a reply a person is still editing: not yet readable. */
74
- editing: string[];
75
- /** Open questions with no reply at all. */
76
- unanswered: string[];
77
- }
78
- /**
79
- * What the task's agent does to read its replies: every one waiting and not
80
- * being edited is written into the plan after ` → `, where the agent reads
81
- * it, and from then on belongs to the agent. The files stay where they are,
82
- * named by path in the line, until the task goes.
83
- */
84
- export declare function claimReplies(deps: ReplyDeps, task: string): Promise<Claimed>;
85
- /** `arbor replies`: claims the task's replies and prints them. */
86
- export declare function readReplies(deps: ReplyDeps & {
87
- log: Logger;
88
- }, task: string): Promise<Claimed>;
89
- /** What claiming found: the replies now in the plan, and what still waits. */
90
- export declare function claimedListing({ task, claimed, editing, unanswered, }: Claimed): string;
91
- /** What a person says to approve a review: the task may land. */
92
- export declare const APPROVED = "Approved: merge it.";
93
- /** What a person says to a question they would rather not answer here. */
94
- export declare const SKIP = "Skip this: go ahead without it.";
95
- /**
96
- * Answers a question by setting it aside: it becomes a todo, its images
97
- * carried along since the tree they sit in goes when the task does, and the
98
- * reply tells the agent to leave it out of this task.
99
- */
100
- export declare function defer(deps: ReplyDeps & {
101
- todos: Todos;
102
- }, task: string, question: string): Promise<Replied>;