canopy-ui 0.14.1 → 0.14.2
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/package.json
CHANGED
package/src/chat/protocol.ts
CHANGED
|
@@ -216,6 +216,11 @@ export interface TurnStatus {
|
|
|
216
216
|
/** When a settled turn finished — lets the kit drop a failure the
|
|
217
217
|
* conversation has since moved past. Absent on an older server. */
|
|
218
218
|
finished_at?: string | null;
|
|
219
|
+
/** What the conversation's host requires of the runner (e.g. `zdr`). Only
|
|
220
|
+
* set while queued, and only when the requirement is what blocks the turn
|
|
221
|
+
* (some runner would take it without one) — so render it as the reason.
|
|
222
|
+
* Absent on an older server. */
|
|
223
|
+
requires?: string[];
|
|
219
224
|
/** Nothing more will happen without someone asking for it. */
|
|
220
225
|
settled: boolean;
|
|
221
226
|
/** Nothing is moving and only a person can change that. The one question a
|
|
@@ -186,3 +186,15 @@ describe("turnNotice", () => {
|
|
|
186
186
|
expect(n?.tone).toBe("warn");
|
|
187
187
|
});
|
|
188
188
|
});
|
|
189
|
+
|
|
190
|
+
describe("turnNotice, when the conversation requires a runner flag", () => {
|
|
191
|
+
it("names the missing requirement when unrouted", () => {
|
|
192
|
+
const n = turnNotice(status({ state: "unrouted", stuck: true, runners: [], claimed_by: null, agent_slug: "ace", requires: ["zdr"] }));
|
|
193
|
+
expect(n?.text).toContain("ZDR runner");
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it("names it when its runners are offline", () => {
|
|
197
|
+
const n = turnNotice(status({ state: "waiting_runner", stuck: true, runners: ["cloud-1"], claimed_by: null, requires: ["zdr"] }));
|
|
198
|
+
expect(n?.text).toContain("ZDR");
|
|
199
|
+
});
|
|
200
|
+
});
|
package/src/chat/turnStatus.ts
CHANGED
|
@@ -114,14 +114,16 @@ export function turnNotice(
|
|
|
114
114
|
? { name: status.cloud_runner, id: status.cloud_runner_id }
|
|
115
115
|
: null;
|
|
116
116
|
const runners = status.runners.join(", ");
|
|
117
|
+
const need = status.requires?.length ? status.requires.map((r) => r.toUpperCase()).join(", ") : "";
|
|
117
118
|
switch (status.state) {
|
|
118
119
|
case "waiting_runner":
|
|
119
120
|
return {
|
|
120
121
|
tone: "warn",
|
|
121
122
|
// Names the box, because the fix is physical: go and open it.
|
|
122
|
-
text: runners
|
|
123
|
+
text: (runners
|
|
123
124
|
? `Queued — ${runners} is offline, so nothing is working on this yet. It runs when the runner is back.`
|
|
124
|
-
: "Queued — its runner is offline, so nothing is working on this yet."
|
|
125
|
+
: "Queued — its runner is offline, so nothing is working on this yet.")
|
|
126
|
+
+ (need ? ` It needs a ${need} runner.` : ""),
|
|
125
127
|
offer,
|
|
126
128
|
};
|
|
127
129
|
case "unrouted":
|
|
@@ -129,7 +131,9 @@ export function turnNotice(
|
|
|
129
131
|
tone: "error",
|
|
130
132
|
// The one state waiting cannot fix, and it has to READ differently
|
|
131
133
|
// from the one waiting can.
|
|
132
|
-
text:
|
|
134
|
+
text: need
|
|
135
|
+
? `Queued — this conversation needs a ${need} runner, and none of ${status.agent_slug ?? "its agent"}'s runners is declared ${need}.`
|
|
136
|
+
: status.agent_slug
|
|
133
137
|
? `Queued, but no runner is set up to run ${status.agent_slug} — nothing will pick this up until its routing is fixed.`
|
|
134
138
|
: "Queued, but no runner is set up to run this — nothing will pick it up until its routing is fixed.",
|
|
135
139
|
offer,
|