@reserendipity/dsh-superagent 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/NOTICE +50 -0
- package/README.md +206 -2
- package/cordis.patch.yml +214 -0
- package/examples/profile.cordis.patch.yml +31 -0
- package/lib/client.js +7695 -0
- package/lib/feishu-Dvj-1eJf.js +1325 -0
- package/lib/feishu-watch.d.ts +125 -0
- package/lib/feishu-watch.js +2 -0
- package/lib/github-pull-DRiuuSs8.js +597 -0
- package/lib/github-watch.d.ts +2 -0
- package/lib/github-watch.js +836 -0
- package/lib/host-BIWKSB5j.js +124 -0
- package/lib/inbox-watch.d.ts +43 -0
- package/lib/inbox-watch.js +343 -0
- package/lib/index.d.ts +369 -0
- package/lib/index.js +13654 -0
- package/lib/instance-status-Cqaju-dw.js +87 -0
- package/lib/instances-view.d.ts +164 -0
- package/lib/instances-view.js +258 -0
- package/lib/intake-TNIkqilh.d.ts +735 -0
- package/lib/kind--8woUEex.d.ts +1019 -0
- package/lib/poll-Bm5EYA2c.js +819 -0
- package/lib/schemas-MhNERx8d.js +4484 -0
- package/lib/schemas-lx-F2nnt.d.ts +2134 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +159 -4
- package/prompts/admission.md +68 -0
- package/prompts/cli.md +17 -0
- package/prompts/dispatch.md +59 -0
- package/prompts/handoff-orchestrator.md +4 -0
- package/prompts/handoff-worker.md +7 -0
- package/prompts/handoff.md +6 -0
- package/prompts/orchestrator.md +16 -0
- package/prompts/presets/brief/communication.md +4 -0
- package/prompts/presets/brief/delivery.md +3 -0
- package/prompts/presets/brief/scope.md +4 -0
- package/prompts/presets/evidence/communication.md +6 -0
- package/prompts/presets/evidence/delivery.md +4 -0
- package/prompts/presets/evidence/scope.md +5 -0
- package/prompts/presets/result/communication.md +4 -0
- package/prompts/presets/result/delivery.md +3 -0
- package/prompts/presets/result/scope.md +5 -0
- package/prompts/replies.md +35 -0
- package/prompts/shared.md +9 -0
- package/prompts/subscriptions.md +13 -0
- package/prompts/team/communication.md +101 -0
- package/prompts/team/delivery.md +35 -0
- package/prompts/team/scope.md +26 -0
- package/prompts/work.md +49 -0
- package/prompts/worker.md +10 -0
- package/schema/declarative-settings.example.json +26 -0
- package/schema/declarative-settings.schema.json +348 -0
- package/skills/README.md +14 -0
- package/skills/dsh-superagent-feishu/SKILL.md +12 -0
- package/skills/dsh-superagent-github/SKILL.md +14 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { $ as settled, A as MandateBasis, B as TicketEndBy, C as Decision, D as Follow, E as Execution, F as Thread, G as followupOwners, H as TicketOutcome, I as ThreadFact, J as latestReport, K as isoTime, L as ThreadFacts, M as ReportState, N as Strength, O as FollowupRecords, P as Text, Q as runningAssignment, R as ThreadRef, S as ChannelRef, T as Evaluation, U as Trigger, V as TicketInput, W as TriggerDisposition, X as reached, Y as liveTicket, Z as readUntil, _ as ActorRef, a as DomainEvent, at as ReasonCode, b as AssignmentState, c as GateResult, ct as Config, d as Policy, et as threadKey, f as ReplyStatus, g as AcceptMode, h as SourceScope, i as Candidate, it as Reason, j as PolicyEffect, k as Mandate, l as OutboundMessage, lt as Deployment, m as ScopeResult, n as AssessmentOutcome, nt as waitsForPerson, o as DomainEvents, ot as reasonText, p as Repositories, q as latestAssignment, r as Assessor, rt as REASONS, s as Executor, st as said, t as ReceiveResult, tt as ticketOutcome, u as Outbox, ut as DeploymentConfig, v as AdmissionCell, w as DecisionKind, x as Attention, y as Assignment, z as Ticket } from "./intake-TNIkqilh.js";
|
|
2
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
//#region src/core/part.d.ts
|
|
4
|
+
interface EngineOptions {
|
|
5
|
+
repo: Repositories;
|
|
6
|
+
policy: () => Policy;
|
|
7
|
+
/** Decides whether a Source listens to a trigger; one it does not listen to is stored with a `filtered` disposition. */
|
|
8
|
+
scope: SourceScope;
|
|
9
|
+
assessor: Assessor;
|
|
10
|
+
executor: Executor;
|
|
11
|
+
outbox: Outbox;
|
|
12
|
+
prepareTicket?: (ticket: Ticket, outcome: Extract<AssessmentOutcome, {
|
|
13
|
+
kind: 'accept';
|
|
14
|
+
}>) => Ticket;
|
|
15
|
+
now?: () => string;
|
|
16
|
+
emit?: (event: DomainEvent) => void;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/core/replies.d.ts
|
|
20
|
+
/**
|
|
21
|
+
* A message for a Channel, by purpose: an Executor's acknowledgement of a person's request it works on, the answer to a
|
|
22
|
+
* person's question once the worker reported it, the result of a ticket that is `ready`, `completed`, `merged`, or `dropped`,
|
|
23
|
+
* or the ticket's current `question` for a person (`attention`). When `ticketId` is omitted, the ticket that `triggerId` reached is used.
|
|
24
|
+
*/
|
|
25
|
+
type ReplyRequest = {
|
|
26
|
+
purpose: 'acknowledgement';
|
|
27
|
+
ticketId: string;
|
|
28
|
+
triggerId: string;
|
|
29
|
+
text: string;
|
|
30
|
+
} | {
|
|
31
|
+
purpose: 'answer' | 'result' | 'attention';
|
|
32
|
+
ticketId?: string;
|
|
33
|
+
triggerId?: string;
|
|
34
|
+
question?: string;
|
|
35
|
+
text: string;
|
|
36
|
+
};
|
|
37
|
+
/** A queued message: its id, whether it went out, and whether an earlier request had queued it already. */
|
|
38
|
+
interface Reply {
|
|
39
|
+
id: string;
|
|
40
|
+
status: ReplyStatus;
|
|
41
|
+
reused: boolean;
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/core/assignments.d.ts
|
|
45
|
+
/** What an Assignment reports: a worker's report, or the Executor's own (`waiting` after an idle turn, `failed` after an error). */
|
|
46
|
+
interface WorkerReport {
|
|
47
|
+
state: ReportState;
|
|
48
|
+
summary: string;
|
|
49
|
+
/** Open question for a person: a string asks it, `null` clears an open one, and `undefined` keeps the current one. */
|
|
50
|
+
question?: string | null;
|
|
51
|
+
/** The person's message whose request raised the question; routes the question to the channel where it was written. */
|
|
52
|
+
askedBy?: string;
|
|
53
|
+
/** The person's question this report answers, which the worker thereby takes up; authorizes the main Session to send an answer reply. */
|
|
54
|
+
answers?: string;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/core/evals.d.ts
|
|
58
|
+
/** An outcome for the Eval that holds a Trigger; `evalId` names the Eval it was judged for, so a later Eval refuses it. */
|
|
59
|
+
type Outcome = AssessmentOutcome & {
|
|
60
|
+
evalId?: string;
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/core/engine.d.ts
|
|
64
|
+
/**
|
|
65
|
+
* Single transactional entry point for mutating Triggers, Threads, Decisions, Tickets, and Assignments.
|
|
66
|
+
* Coordinates Intake, Evals, Tickets, Assignments, and Replies inside synchronous repository transactions while queuing side
|
|
67
|
+
* effects through ports. Callers receive role-scoped `Pick` interfaces rather than the full engine.
|
|
68
|
+
*/
|
|
69
|
+
declare class Engine {
|
|
70
|
+
private readonly options;
|
|
71
|
+
private readonly repo;
|
|
72
|
+
private readonly replies;
|
|
73
|
+
private readonly tickets;
|
|
74
|
+
private readonly assignments;
|
|
75
|
+
private readonly evals;
|
|
76
|
+
private readonly intake;
|
|
77
|
+
constructor(options: EngineOptions);
|
|
78
|
+
/**
|
|
79
|
+
* A Source's request to take in a Trigger: store it once, fan it out to the tickets that subscribe to its Threads (to an
|
|
80
|
+
* ended one only a person's message, which resumes it at once unless processing is paused, and to none a person stopped),
|
|
81
|
+
* and queue it for Eval on its primary Thread unless a ticket's worker decides it (see `followupOwners`).
|
|
82
|
+
* Triggers that arrive while an Eval of that Thread runs wait together for the next one.
|
|
83
|
+
*/
|
|
84
|
+
receive(trigger: Trigger): ReceiveResult;
|
|
85
|
+
/**
|
|
86
|
+
* A Source's request to make an open ticket follow one of its Threads, such as a pull request's, `own` when the ticket
|
|
87
|
+
* opened it: the ticket subscribes to it, and a ready report ends it only once `followsDone` holds (see `Tickets.followsDone`).
|
|
88
|
+
* @throws UserError when the ticket is unknown or has ended.
|
|
89
|
+
*/
|
|
90
|
+
bindThread(ticketId: string, thread: ThreadRef, own: boolean): Ticket;
|
|
91
|
+
/**
|
|
92
|
+
* A Source's fact that a Thread closed, such as its pull request's merge, at the time it happened. An open ticket that
|
|
93
|
+
* follows it ends once it is done with the Threads it follows, unless work resumed since the close has not finished, or
|
|
94
|
+
* its worker took up a person's message the ticket decides after its latest report.
|
|
95
|
+
*/
|
|
96
|
+
threadClosed(thread: ThreadRef, outcome: 'merged' | 'closed', at: string): void;
|
|
97
|
+
/**
|
|
98
|
+
* Requeues overdue Evals up to `REQUEUES` times before recording `unavailable` (undelivered Evals never expire), starts the
|
|
99
|
+
* Evals of Threads whose queued Triggers wait, and resumes ended tickets a person's message reached while processing was
|
|
100
|
+
* paused. While processing is paused, nothing expires: each Eval in progress notes when the pause began, and its deadline
|
|
101
|
+
* moves forward by the pause's length once processing resumes. Each Eval and each ticket update takes one transaction.
|
|
102
|
+
*/
|
|
103
|
+
evaluateDue(): void;
|
|
104
|
+
/** The candidate of the Eval that holds a Trigger, as its assessor sees it; undefined while no Eval holds it. */
|
|
105
|
+
candidate(triggerId: string): Candidate | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Decide a Trigger: the Eval that holds it, or a direct Eval of it alone when none does, such as a person's explicit
|
|
108
|
+
* request the main Session routes. A proactive candidate is accepted only in `auto` mode with enabled rules its assessment
|
|
109
|
+
* matched, and a Trigger that already started a ticket returns that ticket's Decision. An invalid stop is recorded as
|
|
110
|
+
* `ignore`; one judged under an older Policy as `unavailable`.
|
|
111
|
+
* @throws UserError when the Trigger is unknown or not admissible, `outcome.evalId` names an Eval that has finished, a
|
|
112
|
+
* ticket's worker still decides the Trigger and the outcome is not a stop, or an inferred candidate is accepted outside `auto`
|
|
113
|
+
* mode or without enabled matching rules.
|
|
114
|
+
*/
|
|
115
|
+
decide(triggerId: string, outcome: Outcome): Decision;
|
|
116
|
+
/**
|
|
117
|
+
* Attach a Trigger to a ticket that the message points at: the ticket follows the Trigger's Threads and receives it as an
|
|
118
|
+
* Input with the routing note, and the Eval that holds the Trigger ends, since the ticket has it now; the other Triggers of
|
|
119
|
+
* its batch wait for a fresh Eval. A note for an Input the worker already received goes out as a new Input, and so does a
|
|
120
|
+
* message the ticket let go, read for context only, or had before it ended. An ended ticket resumes under its Mandate, at
|
|
121
|
+
* once unless processing is paused.
|
|
122
|
+
* @throws UserError for a ticket a person stopped, which withdrew its Mandate, or one whose Mandate the Policy no longer holds.
|
|
123
|
+
*/
|
|
124
|
+
attach(ticketId: string, triggerId: string, note?: string): Ticket;
|
|
125
|
+
/**
|
|
126
|
+
* Ask a running worker that waits in `waiting` state for its status; any other worker is left alone.
|
|
127
|
+
* @returns whether the worker was asked.
|
|
128
|
+
* @throws UserError when the ticket is unknown.
|
|
129
|
+
*/
|
|
130
|
+
requestStatus(ticketId: string): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Queue a message for the Channel its purpose names: an acknowledgement or an answer goes where the person's message was
|
|
133
|
+
* written, attention where the message that raised the question was, else, like a result, to the conversation the ticket
|
|
134
|
+
* started in. A message queued before is not queued again (see `Replies.reply`).
|
|
135
|
+
* @throws UserError when the ticket or trigger is unknown or the purpose's rule refuses it, such as a result of a ticket that
|
|
136
|
+
* is not ready, completed, merged, or dropped.
|
|
137
|
+
*/
|
|
138
|
+
reply(request: ReplyRequest): Reply;
|
|
139
|
+
/** The assessor delivered an Eval's candidate to its Session: the Eval's deadline counts from now. */
|
|
140
|
+
candidateDelivered(evalId: string): void;
|
|
141
|
+
/**
|
|
142
|
+
* Queue a stored Trigger for a fresh Eval, such as a person's replay; returns false while an Eval holds it.
|
|
143
|
+
* @throws UserError when the trigger is unknown.
|
|
144
|
+
*/
|
|
145
|
+
reevaluate(triggerId: string): boolean;
|
|
146
|
+
/**
|
|
147
|
+
* A person dismisses the problem an unavailable Decision shows: the overview lists it no more.
|
|
148
|
+
* @throws UserError for a Decision that is unknown or not unavailable.
|
|
149
|
+
*/
|
|
150
|
+
dismiss(decisionId: string): Decision;
|
|
151
|
+
/**
|
|
152
|
+
* Drop every ticket's Subscription to a Thread, until a new Decision subscribes one again.
|
|
153
|
+
* @returns whether a Subscription was dropped.
|
|
154
|
+
*/
|
|
155
|
+
unsubscribe(thread: string): boolean;
|
|
156
|
+
/**
|
|
157
|
+
* A person stops a ticket, which withdraws its Mandate: it ends and receives nothing more.
|
|
158
|
+
* @throws UserError when the ticket is unknown.
|
|
159
|
+
*/
|
|
160
|
+
stopTicket(ticketId: string, reason?: string): Ticket;
|
|
161
|
+
/**
|
|
162
|
+
* A person retries a ticket whose worker reported failed or blocked (or whose input delivery failed): the stalled
|
|
163
|
+
* Assignment ends and a new one starts under the same Mandate.
|
|
164
|
+
* @throws UserError when the ticket is unknown, has ended, or is not retryable.
|
|
165
|
+
*/
|
|
166
|
+
retryTicket(ticketId: string): Ticket;
|
|
167
|
+
/**
|
|
168
|
+
* The Executor's fact that an Assignment runs; the Inputs that wait for it go out.
|
|
169
|
+
* @throws UserError when the ticket is unknown.
|
|
170
|
+
*/
|
|
171
|
+
assignmentStarted(ticketId: string, assignmentId: string): void;
|
|
172
|
+
/**
|
|
173
|
+
* The Executor's fact that Inputs reached the Assignment that runs the ticket, which clears a failed delivery. A fact about
|
|
174
|
+
* an Assignment that no longer runs is dropped. Its worker reads each once its Session takes it into a step (`inputsRead`).
|
|
175
|
+
*/
|
|
176
|
+
inputsDelivered(ticketId: string, assignmentId: string, inputIds: string[]): void;
|
|
177
|
+
/**
|
|
178
|
+
* The Executor's fact that the worker's Session of an open ticket took the messages that carried Inputs into a step, from
|
|
179
|
+
* which its model reads them: a report or the end of a turn after that counts them as read at the ticket's end.
|
|
180
|
+
* @throws UserError when the ticket is unknown.
|
|
181
|
+
*/
|
|
182
|
+
inputsRead(ticketId: string, inputIds: string[]): void;
|
|
183
|
+
/** The Executor's fact that a turn of the worker of the Assignment that runs the ticket ended, after a report too. */
|
|
184
|
+
turnEnded(ticketId: string, assignmentId: string): void;
|
|
185
|
+
/** The Executor's fact that delivering Inputs to the Assignment that runs the ticket failed; the ticket shows it until a delivery succeeds. */
|
|
186
|
+
deliveryFailed(ticketId: string, assignmentId: string, error: string): void;
|
|
187
|
+
/**
|
|
188
|
+
* A worker's request, through its Executor, to mark a Thread attached to its ticket unrelated, for `reason`: only that
|
|
189
|
+
* ticket's Subscription drops, until a new Decision subscribes it again.
|
|
190
|
+
* @throws UserError when the ticket is unknown, or for the Thread the ticket started on, one a Source bound it to (such as
|
|
191
|
+
* its pull request's), or one it does not follow.
|
|
192
|
+
*/
|
|
193
|
+
markUnrelated(ticketId: string, thread: string, reason: string): void;
|
|
194
|
+
/**
|
|
195
|
+
* An Executor's Subscription to a Thread it found related, for context: see `Tickets.followForContext` and `Thread.context`.
|
|
196
|
+
* @returns false when the ticket already follows the Thread.
|
|
197
|
+
* @throws UserError when the ticket is unknown or has ended.
|
|
198
|
+
*/
|
|
199
|
+
followForContext(ticketId: string, thread: ThreadRef): boolean;
|
|
200
|
+
/**
|
|
201
|
+
* A fact the main Session gives an open ticket's Executor: see `Tickets.note`.
|
|
202
|
+
* @throws UserError when the ticket is unknown or has ended.
|
|
203
|
+
*/
|
|
204
|
+
note(ticketId: string, text: string): Ticket;
|
|
205
|
+
/**
|
|
206
|
+
* An Executor's hand-back of a message that reached its ticket but asks for more than it: see `Evals.handback`.
|
|
207
|
+
* @returns whether it was queued for Eval: false while another ticket still decides it, and for one this ticket did not decide (see `Evals.handback`).
|
|
208
|
+
* @throws UserError when the ticket or trigger is unknown, the trigger did not reach the ticket, or the ticket already handed it back.
|
|
209
|
+
*/
|
|
210
|
+
handback(ticketId: string, triggerId: string, reason: string): boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Record a report on an open ticket's current Assignment. Its question for a person (`attention`) is asked, kept, or
|
|
213
|
+
* cleared (`null` or a `ready` report), and a replaced attention question whose reply has not been sent yet is withdrawn
|
|
214
|
+
* from the outbox. A `blocked` or `failed` report holds back automated inputs until a human message arrives. A `dropped`
|
|
215
|
+
* report ends the ticket, and a `ready` report ends it: `completed` without followed Threads, else with the `followsDone`
|
|
216
|
+
* outcome once `followsDone` holds.
|
|
217
|
+
* @throws UserError for an unknown or ended ticket, an ended assignment, a question that comes with a ready result or an
|
|
218
|
+
* answer, or a question or answer that names a message that is not a person's or did not reach the ticket.
|
|
219
|
+
*/
|
|
220
|
+
report(ticketId: string, report: WorkerReport): Ticket;
|
|
221
|
+
/**
|
|
222
|
+
* Handles an assignment that was running when the host stopped: restarts it with a recovery note unless its latest report is
|
|
223
|
+
* `waiting`, `ready`, `blocked`, or `failed` and no Input reached its worker after that report, in which case it keeps its
|
|
224
|
+
* Session and state and gets the Inputs that wait for it.
|
|
225
|
+
*/
|
|
226
|
+
assignmentInterrupted(ticketId: string, assignmentId: string): void;
|
|
227
|
+
/**
|
|
228
|
+
* The Policy changed: each open ticket in `effects` is told how the change bears on it, and Evals in progress start again
|
|
229
|
+
* under the new version.
|
|
230
|
+
*/
|
|
231
|
+
policyChanged(from: string, to: string, effects?: ReadonlyMap<string, PolicyEffect>): void;
|
|
232
|
+
}
|
|
233
|
+
/** What Sources ask and tell the Engine. */
|
|
234
|
+
type EngineForSources = Pick<Engine, 'receive' | 'bindThread' | 'threadClosed'>;
|
|
235
|
+
/** What the main Session asks of the Engine. */
|
|
236
|
+
type EngineForMainSession = Pick<Engine, 'candidate' | 'candidateDelivered' | 'decide' | 'attach' | 'reply' | 'requestStatus' | 'note'>;
|
|
237
|
+
/** What people ask of the Engine, through the panel or the main Session. */
|
|
238
|
+
type EngineForPeople = Pick<Engine, 'stopTicket' | 'retryTicket' | 'reevaluate' | 'unsubscribe' | 'dismiss'>;
|
|
239
|
+
/** What Settings tells the Engine. */
|
|
240
|
+
type EngineForSettings = Pick<Engine, 'policyChanged'>;
|
|
241
|
+
/** What the Executor tells the Engine, and what its workers ask of it. */
|
|
242
|
+
type EngineForExecutor = Pick<Engine, 'assignmentStarted' | 'inputsDelivered' | 'inputsRead' | 'turnEnded' | 'deliveryFailed' | 'assignmentInterrupted' | 'report' | 'markUnrelated' | 'handback' | 'followForContext' | 'reply'>;
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/core/errors.d.ts
|
|
245
|
+
/** User-facing error codes mapped to their category ('missing' or 'refused') and English message template. */
|
|
246
|
+
declare const USER_ERRORS: {
|
|
247
|
+
readonly unknownTicket: readonly ["missing", "Unknown ticket"];
|
|
248
|
+
readonly unknownProblem: readonly ["missing", "Unavailable Eval not found"];
|
|
249
|
+
readonly unknownTrigger: readonly ["missing", "Unknown trigger"];
|
|
250
|
+
readonly unknownAssignment: readonly ["missing", "Unknown assignment"];
|
|
251
|
+
readonly unknownBlock: readonly ["missing", "Unknown settings block: {block}"];
|
|
252
|
+
readonly unknownPromptRevision: readonly ["missing", "Unknown prompt revision {revision}"];
|
|
253
|
+
readonly unknownPromptPart: readonly ["refused", "Unknown built-in prompt part {part}"];
|
|
254
|
+
readonly ticketEnded: readonly ["refused", "Ticket has ended"];
|
|
255
|
+
readonly assignmentEnded: readonly ["refused", "Assignment has ended; a newer assignment owns this ticket"];
|
|
256
|
+
readonly evalFinished: readonly ["refused", "Eval {eval} has finished or a later eval replaced it; decide the trigger's current eval"];
|
|
257
|
+
readonly notAdmissible: readonly ["refused", "Trigger is not admissible: {reason}"];
|
|
258
|
+
readonly notExplicit: readonly ["refused", "An accept through orchestrator_route is for explicit requests from allowed senders; assess proactive candidates with orchestrator_eval and orchestrator_eval_decide"];
|
|
259
|
+
readonly ticketStopped: readonly ["refused", "A person stopped this ticket; new work needs an accept through orchestrator_route"];
|
|
260
|
+
readonly mandateRevoked: readonly ["refused", "The current policy no longer holds this ticket's mandate; new work needs an accept through orchestrator_route"];
|
|
261
|
+
readonly notRetryable: readonly ["refused", "Only an open ticket can be retried, and only when its worker last reported failed or blocked and no person has sent a message since, or when delivering an Input to its worker failed"];
|
|
262
|
+
readonly sourceThread: readonly ["refused", "This is the thread the ticket started on; it stays subscribed"];
|
|
263
|
+
readonly followedThread: readonly ["refused", "This thread is the ticket's own, such as its pull request's; it stays subscribed"];
|
|
264
|
+
readonly notFollowing: readonly ["refused", "This ticket does not follow that thread"];
|
|
265
|
+
readonly questionWithResult: readonly ["refused", "A question for a person cannot also be a ready result or an answer; report it separately"];
|
|
266
|
+
readonly askerWithoutQuestion: readonly ["refused", "The message that raised a question needs the question it raised"];
|
|
267
|
+
readonly notAsker: readonly ["refused", "A question must name the person's message that raised it, which reached this ticket"];
|
|
268
|
+
readonly notAnswerable: readonly ["refused", "An answer must name the person's question it answers, which reached this ticket"];
|
|
269
|
+
readonly ackEnded: readonly ["refused", "Ticket ended; do not acknowledge historical requests"];
|
|
270
|
+
readonly notReached: readonly ["refused", "Trigger does not belong to this worker"];
|
|
271
|
+
readonly handedBack: readonly ["refused", "This ticket handed that trigger back already"];
|
|
272
|
+
readonly handedBackHere: readonly ["refused", "The worker of this ticket handed that trigger back as beyond it: accept it as new work, attach it to another ticket, or ignore it"];
|
|
273
|
+
readonly workerDecides: readonly ["refused", "This message reached ticket {tickets} on its thread: its worker decides whether it belongs there and hands back what does not, which then arrives as a candidate. Only a stop goes through orchestrator_route, with kind stop"];
|
|
274
|
+
readonly ackNoChannel: readonly ["refused", "Acknowledgement requires an assigned human source message"];
|
|
275
|
+
readonly ackNotPerson: readonly ["refused", "Use the original human trigger, not a bot, CI or worker report"];
|
|
276
|
+
readonly notReady: readonly ["refused", "Ticket is not ready for delivery. Keep progress internal and wait for a verified ready report; do not relabel progress as an answer or send it through another channel."];
|
|
277
|
+
readonly notAttention: readonly ["refused", "Attention requires the ticket's current attention question in human_action. Routine unfinished work stays internal."];
|
|
278
|
+
readonly notQuestion: readonly ["refused", "An answer must target the original human question, not a worker report or automated trigger"];
|
|
279
|
+
readonly noAnswer: readonly ["refused", "No worker answer is ready for this human trigger. Wait for the worker's report, or request one with orchestrator_ticket_request_status, which acts only on a worker that reported waiting; ordinary progress cannot be relabelled as an answer."];
|
|
280
|
+
readonly noChannel: readonly ["refused", "No reply channel for this ticket or trigger"];
|
|
281
|
+
readonly panelOnlyEnvironment: readonly ["refused", "The execution environment (ticket directory, prepare command, blocked commands) can only be changed in the management panel"];
|
|
282
|
+
readonly panelOnlyAccounts: readonly ["refused", "Source fields that setup reads, such as account CLIs, can only be changed in the management panel"];
|
|
283
|
+
readonly setupComplete: readonly ["refused", "Setup is complete"];
|
|
284
|
+
readonly modelUnavailable: readonly ["refused", "The {block} model is not available: {error}"];
|
|
285
|
+
readonly promptTooLong: readonly ["refused", "Prompt configuration exceeds {limit} characters"];
|
|
286
|
+
readonly promptPlaceholders: readonly ["refused", "The “{part}” template must keep {placeholders}, which the system fills in"];
|
|
287
|
+
readonly promptPartEmpty: readonly ["refused", "The “{part}” part cannot be empty; reset it to follow its built-in text"];
|
|
288
|
+
readonly sourceNotInstalled: readonly ["refused", "The {source} Source kind is not installed"];
|
|
289
|
+
readonly noLabels: readonly ["refused", "This Source has no names to refresh"];
|
|
290
|
+
readonly nothingToSync: readonly ["refused", "The {source} Source's part of the Policy has nothing to sync from, or the Source is off or waiting for setup"];
|
|
291
|
+
};
|
|
292
|
+
type UserErrorCode = keyof typeof USER_ERRORS;
|
|
293
|
+
/**
|
|
294
|
+
* Structured error thrown by Engine parts and application services when a caller request is invalid or references missing state.
|
|
295
|
+
* Tool handlers and HTTP routes inspect its code and missing flag to return appropriate status responses, while the web panel localizes the code.
|
|
296
|
+
*/
|
|
297
|
+
declare class UserError extends Error {
|
|
298
|
+
readonly code: UserErrorCode;
|
|
299
|
+
readonly values: Record<string, string>;
|
|
300
|
+
readonly missing: boolean;
|
|
301
|
+
constructor(code: UserErrorCode, values?: Record<string, string>);
|
|
302
|
+
}
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/core/memory.d.ts
|
|
305
|
+
/**
|
|
306
|
+
* In-memory implementation of the Repositories port backed by cloned Map entries so caller mutations do not affect stored state.
|
|
307
|
+
* Provides snapshot-based atomic rollback and matches the ordering semantics of the SQLite store for Engine tests.
|
|
308
|
+
*/
|
|
309
|
+
declare class MemoryRepositories implements Repositories {
|
|
310
|
+
private readonly triggerRows;
|
|
311
|
+
private readonly dispositions;
|
|
312
|
+
private readonly threadRows;
|
|
313
|
+
private readonly ticketRows;
|
|
314
|
+
private readonly decisionRows;
|
|
315
|
+
atomic<T>(work: () => T): T;
|
|
316
|
+
readonly triggers: {
|
|
317
|
+
get: (id: string) => Trigger | undefined;
|
|
318
|
+
save: (trigger: Trigger) => void;
|
|
319
|
+
disposition: (id: string) => TriggerDisposition | undefined;
|
|
320
|
+
saveDisposition: (id: string, value: TriggerDisposition) => void;
|
|
321
|
+
};
|
|
322
|
+
readonly threads: {
|
|
323
|
+
get: (key: string) => Thread | undefined;
|
|
324
|
+
save: (thread: Thread) => void;
|
|
325
|
+
list: () => Thread[];
|
|
326
|
+
active: () => Thread[];
|
|
327
|
+
};
|
|
328
|
+
readonly tickets: {
|
|
329
|
+
get: (id: string) => Ticket | undefined;
|
|
330
|
+
save: (ticket: Ticket) => void;
|
|
331
|
+
/** Newest first, matching the SQLite Store's order. */
|
|
332
|
+
list: () => Ticket[];
|
|
333
|
+
open: () => Ticket[];
|
|
334
|
+
active: () => Ticket[];
|
|
335
|
+
};
|
|
336
|
+
readonly decisions: {
|
|
337
|
+
get: (id: string) => Decision | undefined;
|
|
338
|
+
save: (decision: Decision) => void;
|
|
339
|
+
byThread: (key: string) => Decision[];
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region src/core/stage.d.ts
|
|
344
|
+
/** High-level execution stage of a ticket: waiting on a person, actively working or queued, idle between turns, or ended. */
|
|
345
|
+
type TicketStage = {
|
|
346
|
+
stage: 'person';
|
|
347
|
+
action: 'delivery' | 'answer' | 'review' | 'blocked' | 'failed';
|
|
348
|
+
} | {
|
|
349
|
+
stage: 'working';
|
|
350
|
+
action?: 'queued';
|
|
351
|
+
} | {
|
|
352
|
+
stage: 'idle';
|
|
353
|
+
} | {
|
|
354
|
+
stage: 'ended';
|
|
355
|
+
};
|
|
356
|
+
/** Classifies a ticket's stage; the rules follow the table in docs/003 in order, where the first matching row wins. */
|
|
357
|
+
declare function ticketStage(ticket: Ticket): TicketStage;
|
|
358
|
+
/** True when an open ticket is stalled on a blocked/failed report without a newer human follow-up, or has a failed input delivery. */
|
|
359
|
+
declare function canRetry(ticket: Ticket): boolean;
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/core/ids.d.ts
|
|
362
|
+
declare function key(...values: string[]): string;
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/index.d.ts
|
|
365
|
+
declare const name = "dsh-superagent";
|
|
366
|
+
declare const inject: string[];
|
|
367
|
+
declare function apply(ctx: Context, config: DeploymentConfig): Promise<void>;
|
|
368
|
+
//#endregion
|
|
369
|
+
export { AcceptMode, ActorRef, AdmissionCell, AssessmentOutcome, Assessor, Assignment, AssignmentState, Attention, Candidate, ChannelRef, Config, Decision, DecisionKind, type Deployment, type DeploymentConfig, DomainEvent, DomainEvents, Engine, type EngineForExecutor, type EngineForMainSession, type EngineForPeople, type EngineForSettings, type EngineForSources, type EngineOptions, Evaluation, Execution, Executor, Follow, FollowupRecords, GateResult, Mandate, MandateBasis, MemoryRepositories, OutboundMessage, Outbox, type Outcome, Policy, PolicyEffect, REASONS, type Reason, type ReasonCode, type ReceiveResult, type Reply, type ReplyRequest, ReplyStatus, ReportState, Repositories, ScopeResult, SourceScope, Strength, Text, Thread, ThreadFact, ThreadFacts, ThreadRef, Ticket, TicketEndBy, TicketInput, TicketOutcome, type TicketStage, Trigger, TriggerDisposition, USER_ERRORS, UserError, type UserErrorCode, type WorkerReport, apply, canRetry, followupOwners, inject, isoTime, key, latestAssignment, latestReport, liveTicket, name, reached, readUntil, reasonText, runningAssignment, said, settled, threadKey, ticketOutcome, ticketStage, waitsForPerson };
|