soltask 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,311 @@
1
+ import type { AgentView, ChannelView, ColumnId, ColumnInfo, DraftDelivery, PersonView, Priority, ReasonInfo, ReasonType, TaskKindId, TaskKindInfo, TaskReason, TaskSummary, TemplateId, TemplateInfo } from "./types.js";
2
+ export declare const COLUMNS: readonly ColumnInfo[];
3
+ export declare const OPEN_COLUMNS: readonly ColumnId[];
4
+ export declare const PRIORITIES: readonly Priority[];
5
+ export declare const TEMPLATES: {
6
+ readonly brainstorm: {
7
+ readonly id: "brainstorm";
8
+ readonly name: "Brainstorm";
9
+ readonly icon: "i-bulb";
10
+ readonly channel: "brainstorm";
11
+ readonly entry: "brainstorm-lead";
12
+ readonly budget: 120;
13
+ readonly blurb: "Brainstorm Lead's team frames the idea, debates it, and writes a brief. You decide whether to keep it.";
14
+ readonly approver: "You, the requester: the thread's first author is the only person Machine Agent counts.";
15
+ readonly outcome: "Machine Agent saves the session in docs/brainstorms/ through a merge request it opens and merges. Nothing deploys.";
16
+ readonly stages: readonly [readonly ["sent", "Sent", "queued"], readonly ["frame", "Frame", "working"], readonly ["r1", "Round 1", "working"], readonly ["r2", "Debate", "working"], readonly ["r3", "Challenge", "working"], readonly ["brief", "Brief", "working"], readonly ["card", "Save card", "needs"], readonly ["saving", "Saving", "shipping"], readonly ["saved", "Saved", "done"]];
17
+ readonly on: {
18
+ readonly frame: "frame";
19
+ readonly r1: "r1";
20
+ readonly r2: "r2";
21
+ readonly r3: "r3";
22
+ readonly stop: "brief";
23
+ readonly brief: "brief";
24
+ readonly card: "card";
25
+ readonly saving: "saving";
26
+ readonly saved: "saved";
27
+ readonly reject: "brief";
28
+ readonly revise: "brief";
29
+ };
30
+ readonly stall: {
31
+ readonly stages: readonly ["frame", "r1", "r2", "r3"];
32
+ readonly minutes: 20;
33
+ readonly nudge: "brainstorm-lead";
34
+ readonly nudgeName: "Brainstorm Lead";
35
+ };
36
+ };
37
+ readonly agent: {
38
+ readonly id: "agent";
39
+ readonly name: "Request an agent";
40
+ readonly icon: "i-rocket";
41
+ readonly channel: "general";
42
+ readonly entry: "agent-lead";
43
+ readonly blurb: "Agent Lead has it built and reviewed, you say publish, an owner or admin approves Infra Gate's card, and it deploys.";
44
+ readonly approver: "An owner or admin of the channel approves Infra Gate's card; HIGH risk means read the diff first.";
45
+ readonly outcome: "Infra Gate merges the approved commit, waits for plan, and applies infrastructure changes.";
46
+ readonly stages: readonly [readonly ["sent", "Sent", "queued"], readonly ["scope", "Scope", "working"], readonly ["build", "Build", "working"], readonly ["review", "Review", "working"], readonly ["describe", "Your go", "working"], readonly ["publish", "Publish", "working"], readonly ["card", "Approval card", "needs"], readonly ["merge", "Merge + plan", "shipping"], readonly ["apply", "Apply", "shipping"], readonly ["deployed", "Deployed", "done"]];
47
+ readonly on: {
48
+ readonly ask: "scope";
49
+ readonly person: null;
50
+ readonly mr: "build";
51
+ readonly "review-asked": "review";
52
+ readonly "review-pass": "review";
53
+ readonly "review-blocked": "build";
54
+ readonly describe: "describe";
55
+ readonly publish: "publish";
56
+ readonly "publish-request": "publish";
57
+ readonly card: "card";
58
+ readonly counted: "merge";
59
+ readonly merged: "merge";
60
+ readonly applying: "apply";
61
+ readonly deployed: "deployed";
62
+ readonly rework: "build";
63
+ readonly "card-rejected": "build";
64
+ };
65
+ };
66
+ readonly bug: {
67
+ readonly id: "bug";
68
+ readonly name: "Report a bug";
69
+ readonly icon: "i-bug";
70
+ readonly channel: "bug-hunt";
71
+ readonly entry: "repro-agent";
72
+ readonly blurb: "Repro Agent reproduces it in a browser; Hackathon Agent drafts one bug-fix run; people approve the run.";
73
+ readonly approver: "The people on the run's approval card (owners and admins of the channel).";
74
+ readonly outcome: "The fix team builds it in #bug-fix and reports back once verified live.";
75
+ readonly stages: readonly [readonly ["sent", "Sent", "queued"], readonly ["repro", "Reproduce", "working"], readonly ["draft", "Draft the run", "working"], readonly ["card", "Run card", "needs"], readonly ["fix", "Fix in #bug-fix", "working"], readonly ["verified", "Verified live", "done"]];
76
+ readonly on: {
77
+ readonly reproduced: "draft";
78
+ readonly mr: "draft";
79
+ readonly card: "card";
80
+ readonly merged: "fix";
81
+ readonly verified: "verified";
82
+ readonly "not-reproduced": "repro";
83
+ };
84
+ };
85
+ readonly canon: {
86
+ readonly id: "canon";
87
+ readonly name: "Canon rule";
88
+ readonly icon: "i-scroll";
89
+ readonly channel: "canon";
90
+ readonly entry: "canon-lead";
91
+ readonly blurb: "Canon Lead researches it, BA or Tech Agent drafts it, reviewers check every head, and people ratify it.";
92
+ readonly approver: "The proposer approves; a HIGH change needs a second person.";
93
+ readonly outcome: "Machine Agent merges the ratified head; its publisher lane publishes the document.";
94
+ readonly stages: readonly [readonly ["sent", "Sent", "queued"], readonly ["frame", "Frame", "working"], readonly ["rounds", "Rounds", "working"], readonly ["draft", "Draft MR", "working"], readonly ["reviews", "Reviews", "working"], readonly ["card", "Ratify card", "needs"], readonly ["merge", "Merge", "shipping"], readonly ["published", "Published", "done"]];
95
+ readonly on: {
96
+ readonly frame: "frame";
97
+ readonly r1: "rounds";
98
+ readonly r2: "rounds";
99
+ readonly "canon-brief": "rounds";
100
+ readonly mr: "draft";
101
+ readonly draft: "draft";
102
+ readonly "review-pass": "reviews";
103
+ readonly "review-blocked": "draft";
104
+ readonly card: "card";
105
+ readonly merged: "merge";
106
+ readonly published: "published";
107
+ };
108
+ };
109
+ readonly hackathons: {
110
+ readonly id: "hackathons";
111
+ readonly name: "Hackathons";
112
+ readonly icon: "i-rocket";
113
+ readonly channel: "hackathons";
114
+ readonly entry: "hackathon-lead";
115
+ readonly blurb: "Hackathon Lead researches the run and hands the preview to the BA or Tech Agent named in the request.";
116
+ readonly approver: "The people on the run's approval card.";
117
+ readonly outcome: "Machine Agent hands an approved run to #implementation.";
118
+ readonly stages: readonly [readonly ["sent", "Sent", "queued"], readonly ["research", "Research", "working"], readonly ["draft", "Draft and review", "working"], readonly ["card", "Run card", "needs"], readonly ["merge", "Freeze and merge", "shipping"], readonly ["handoff", "Handed off", "done"]];
119
+ readonly on: {
120
+ readonly frame: "research";
121
+ readonly r1: "research";
122
+ readonly r2: "research";
123
+ readonly draft: "draft";
124
+ readonly mr: "draft";
125
+ readonly card: "card";
126
+ readonly merged: "merge";
127
+ readonly handed: "handoff";
128
+ readonly "card-rejected": "draft";
129
+ };
130
+ };
131
+ readonly plan: {
132
+ readonly id: "plan";
133
+ readonly name: "Rollout plan";
134
+ readonly icon: "i-map";
135
+ readonly channel: "plan";
136
+ readonly entry: "plan-agent";
137
+ readonly blurb: "Plan Agent drafts steps from the repository and maintains #plan's roadmap canvas. People act on the steps.";
138
+ readonly approver: "Nobody approves a plan; a blocked step needs the person it names.";
139
+ readonly outcome: "The plan's bar turns green on the canvas and stays for 7 days.";
140
+ readonly stages: readonly [readonly ["sent", "Sent", "queued"], readonly ["drafted", "Drafted", "working"], readonly ["now", "In progress", "working"], readonly ["done", "Done", "done"]];
141
+ readonly on: {
142
+ readonly "plan-todo": "drafted";
143
+ readonly "plan-now": "now";
144
+ readonly "plan-blocked": "now";
145
+ readonly "plan-done": "done";
146
+ };
147
+ };
148
+ readonly discovery: {
149
+ readonly id: "discovery";
150
+ readonly name: "Discovery cycle";
151
+ readonly icon: "i-compass";
152
+ readonly channel: "discovery";
153
+ readonly entry: "discovery-lead";
154
+ readonly budget: 48;
155
+ readonly blurb: "Every four hours Discovery Lead opens a cycle that ends in one sourced proposal for a person to decide on.";
156
+ readonly approver: "Any person in the channel: reply accepted, rejected, or done with a reason.";
157
+ readonly outcome: "The decision becomes the proposal's status; Discovery Critic holds rejected ideas to new evidence.";
158
+ readonly stages: readonly [readonly ["cycle", "Cycle", "working"], readonly ["scan", "Scan + audit", "working"], readonly ["shortlist", "Shortlist", "working"], readonly ["debate", "Debate", "working"], readonly ["draft", "Draft", "working"], readonly ["proposal", "Proposal", "needs"], readonly ["decided", "Decided", "done"]];
159
+ readonly on: {
160
+ readonly cycle: "cycle";
161
+ readonly scan: "scan";
162
+ readonly shortlist: "shortlist";
163
+ readonly stake: "debate";
164
+ readonly draft: "draft";
165
+ readonly proposal: "proposal";
166
+ readonly decide: "decided";
167
+ };
168
+ };
169
+ readonly ask: {
170
+ readonly id: "ask";
171
+ readonly name: "Ask an agent";
172
+ readonly icon: "i-msg";
173
+ readonly channel: null;
174
+ readonly entry: null;
175
+ readonly blurb: "A direct question to one agent: Monitor Agent about an incident, Infra Operator about a pipeline, or Canon Agent about rules.";
176
+ readonly approver: "Nobody: the answer is the result.";
177
+ readonly outcome: "Done when the agent has answered and stays quiet for 15 minutes, or when you mark it answered.";
178
+ readonly stages: readonly [readonly ["sent", "Sent", "queued"], readonly ["answering", "Answering", "working"], readonly ["answered", "Answered", "done"]];
179
+ readonly on: {
180
+ readonly agent: "answering";
181
+ readonly ask: "answering";
182
+ readonly resolved: "answered";
183
+ };
184
+ readonly quiet: {
185
+ readonly from: "answering";
186
+ readonly to: "answered";
187
+ readonly hours: 0.25;
188
+ };
189
+ };
190
+ readonly requirement: {
191
+ readonly id: "requirement";
192
+ readonly name: "Requirement";
193
+ readonly icon: "i-file";
194
+ readonly channel: "requirements";
195
+ readonly entry: "requirement-lead";
196
+ readonly blurb: "Requirement Lead and its critics shape a feature request; the requester approves the gate card before handoff.";
197
+ readonly approver: "The requester.";
198
+ readonly outcome: "An approved requirement is handed to #canon.";
199
+ readonly stages: readonly [readonly ["sent", "Sent", "queued"], readonly ["shape", "Shape", "working"], readonly ["card", "Requirement card", "needs"], readonly ["handoff", "Hand-off", "shipping"], readonly ["canon", "In #canon", "done"]];
200
+ readonly on: {
201
+ readonly agent: "shape";
202
+ readonly card: "card";
203
+ readonly handed: "canon";
204
+ };
205
+ };
206
+ readonly fixrun: {
207
+ readonly id: "fixrun";
208
+ readonly name: "Fix run";
209
+ readonly icon: "i-merge";
210
+ readonly channel: "bug-fix";
211
+ readonly entry: "lead-agent";
212
+ readonly blurb: "Lead Agent coordinates Architect, Coder, and QA Agents on one bug-fix run; merges require level-based approvals.";
213
+ readonly approver: "MEDIUM needs one owner or admin; HIGH needs two different people.";
214
+ readonly outcome: "The fix lane merges, reports back, and the reporter hears the result.";
215
+ readonly stages: readonly [readonly ["sent", "Started", "working"], readonly ["design", "Design", "working"], readonly ["code", "Code", "working"], readonly ["qa", "QA", "working"], readonly ["card", "Merge review", "needs"], readonly ["merge", "Merge", "shipping"], readonly ["done", "Done", "done"]];
216
+ readonly on: {
217
+ readonly agent: null;
218
+ readonly design: "design";
219
+ readonly mr: "code";
220
+ readonly "qa-pass": "qa";
221
+ readonly card: "card";
222
+ readonly merged: "merge";
223
+ readonly verified: "done";
224
+ };
225
+ };
226
+ };
227
+ export declare const PUBLIC_TEMPLATES: readonly TemplateId[];
228
+ export declare const TASK_KINDS: Readonly<Record<TaskKindId, TaskKindInfo>>;
229
+ export declare const REASONS: Readonly<Record<ReasonType, ReasonInfo>>;
230
+ /** True when a channel's `people:` rule allows a person to open a new task thread with that agent. */
231
+ export declare function canStart(rule: string): boolean;
232
+ /** Infers the workflow template for an entry agent in a channel slug. */
233
+ export declare function templateOf(entry: string, slug: string): TemplateId;
234
+ export declare const HACKATHON_DRAFTER_HINT = "Mention one drafter in your message, @BA Agent or @Tech Agent.";
235
+ /** Named drafter IDs mentioned in a hackathon request (`@BA Agent` -> `ba-agent`, `@Tech Agent` -> `tech-agent`). */
236
+ export declare function hackathonDrafters(message: string): string[];
237
+ export type AgentStatusKind = "down" | "working" | "idle" | "away" | "key";
238
+ export interface AgentStatus {
239
+ kind: AgentStatusKind;
240
+ label: string;
241
+ }
242
+ /** Summarizes an agent's live operational state from presence, active tasks, and agent kind. */
243
+ export declare function agentStatus(agent: Pick<AgentView, "presence" | "tasks" | "kind">): AgentStatus;
244
+ /** Splits stored draft markdown into first-line title and trimmed body. */
245
+ export declare function splitDraftBody(text?: string): {
246
+ title: string;
247
+ body: string;
248
+ };
249
+ /** Generates a 16-character base64url draft ID matching `/^[\w-]{16}$/`. */
250
+ export declare function generateDraftId(): string;
251
+ /**
252
+ * Resolves a task reference (`INF-8`, full 64-hex `root`, or unique >=8-char hex prefix) against a task list.
253
+ */
254
+ export declare function resolveTaskRef(ref: string, tasks: readonly TaskSummary[]): TaskSummary;
255
+ /** Resolves a channel by UUID or slug (with or without leading `#`). */
256
+ export declare function resolveChannel(selector: string, channels: readonly ChannelView[]): ChannelView;
257
+ /** Resolves an agent by ID, display name (case-insensitive, optional leading `@`), or 64-hex pubkey. */
258
+ export declare function resolveAgent(selector: string, agents: readonly AgentView[]): AgentView;
259
+ export type ActionPostKind = "approve" | "reject" | "reply" | "publish" | "change" | "accepted" | "rejected" | "done" | "nudge" | "retry" | "unblocked";
260
+ export interface NameResolver {
261
+ name(idOrPubkey: string): string;
262
+ pubkeyOf(community: string, idOrPubkey: string): string | undefined;
263
+ }
264
+ /** Builds a `NameResolver` from a community's agents and people lists. */
265
+ export declare function createNameResolver(agents: readonly AgentView[], people?: readonly PersonView[], community?: string): NameResolver;
266
+ export interface ComposedActionPost {
267
+ kind: ActionPostKind;
268
+ endpoint: "approve" | "reject" | "messages";
269
+ text: string;
270
+ to: string;
271
+ needsText: boolean;
272
+ mentions: string[];
273
+ cardId?: string;
274
+ unavailable?: string;
275
+ }
276
+ /**
277
+ * Composes the exact message or gate payload for a task action, mirroring the board UI's confirmation composer.
278
+ */
279
+ export declare function composeActionPost(kind: ActionPostKind, task: Pick<TaskSummary, "community" | "root">, reason: TaskReason, names: NameResolver, text?: string): ComposedActionPost;
280
+ export interface PreflightNewTaskInput {
281
+ community: string;
282
+ title: string;
283
+ body?: string;
284
+ kind?: TaskKindId;
285
+ channel?: string;
286
+ entry?: string;
287
+ channels: readonly ChannelView[];
288
+ agents: readonly AgentView[];
289
+ tasks?: readonly TaskSummary[];
290
+ delivery?: DraftDelivery;
291
+ }
292
+ export interface PreflightEntry {
293
+ id: string;
294
+ name: string;
295
+ rule: string;
296
+ pubkey: string | null;
297
+ }
298
+ export interface PreflightNewTaskResult {
299
+ ok: boolean;
300
+ blockers: string[];
301
+ warnings: string[];
302
+ previewText: string;
303
+ channel: ChannelView | null;
304
+ entry: PreflightEntry | null;
305
+ template: TemplateInfo | null;
306
+ additionalMentions: string[];
307
+ }
308
+ /**
309
+ * Validates and previews a new task submission before sending, mirroring the board composer's preflight rules.
310
+ */
311
+ export declare function preflightNewTask(input: PreflightNewTaskInput): PreflightNewTaskResult;