aglio-worker 0.115.3 → 0.115.7

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.
Files changed (2) hide show
  1. package/agent.js +13 -6
  2. package/package.json +1 -1
package/agent.js CHANGED
@@ -71988,8 +71988,8 @@ var CARD_LABEL_COLORS = [
71988
71988
  var CARD_LABEL_COLOR_KEYS = CARD_LABEL_COLORS.map((color) => color.key);
71989
71989
  var DEFAULT_CARD_LABEL_COLOR = "green";
71990
71990
  var CARD_LABEL_NAME_MAX = 40;
71991
- var FALLBACK_COLOR = CARD_LABEL_COLORS[0];
71992
- var cardLabelColorSchema = external_exports.enum(CARD_LABEL_COLOR_KEYS);
71991
+ var HEX_COLOR2 = /^#[0-9a-f]{6}$/;
71992
+ var cardLabelColorSchema = external_exports.union([external_exports.enum(CARD_LABEL_COLOR_KEYS), external_exports.string().trim().toLowerCase().regex(HEX_COLOR2)]).default(DEFAULT_CARD_LABEL_COLOR);
71993
71993
  var cardLabelInputSchema = external_exports.object({
71994
71994
  name: external_exports.string().trim().max(CARD_LABEL_NAME_MAX).default(""),
71995
71995
  color: cardLabelColorSchema.default(DEFAULT_CARD_LABEL_COLOR)
@@ -87656,7 +87656,7 @@ async function runRemoteCardJob(deps) {
87656
87656
  deps.log?.("run events update failed", { error: errorText2(eventError) });
87657
87657
  });
87658
87658
  };
87659
- const appendChat = async (text, kind = "text", toolName, toolArgs) => {
87659
+ const appendChat = async (text, kind = "text", toolName, toolArgs, replace = false) => {
87660
87660
  if (!isChat && !isConsult) return;
87661
87661
  try {
87662
87662
  const messageId = await (isChat ? deps.api.appendPlanningMessage : deps.api.appendConsultMessage)({
@@ -87665,7 +87665,8 @@ async function runRemoteCardJob(deps) {
87665
87665
  text,
87666
87666
  kind,
87667
87667
  toolName: toolName ?? null,
87668
- toolArgs: toolArgs ?? null
87668
+ toolArgs: toolArgs ?? null,
87669
+ replace
87669
87670
  });
87670
87671
  if (kind === "text") chatMessageId = messageId;
87671
87672
  } catch (chatError) {
@@ -87758,7 +87759,9 @@ async function runRemoteCardJob(deps) {
87758
87759
  if (parsed.assistantText) {
87759
87760
  await flushThinking(true);
87760
87761
  const text = parsed.assistantText;
87761
- const duplicateFinal = Boolean(messageText && text && messageText.endsWith(text));
87762
+ const duplicateFinal = Boolean(
87763
+ messageText && text && (parsed.messageEnd || messageText.endsWith(text))
87764
+ );
87762
87765
  if (!duplicateFinal) {
87763
87766
  if (parsed.assistantDelta) {
87764
87767
  messageText += text;
@@ -87775,6 +87778,9 @@ async function runRemoteCardJob(deps) {
87775
87778
  if (parsed.messageEnd) {
87776
87779
  await flushAssistant(true);
87777
87780
  await flushThinking(true);
87781
+ if (chatMessageId && messageText && text && text !== messageText) {
87782
+ await appendChat(text, "text", null, null, true);
87783
+ }
87778
87784
  finalMessage = text || messageText;
87779
87785
  messageText = "";
87780
87786
  thinkingText = "";
@@ -88448,7 +88454,8 @@ async function appendRunMessage(config2, fetchImpl, signal, input2, _channel) {
88448
88454
  text: input2.text,
88449
88455
  kind: input2.kind ?? "text",
88450
88456
  toolName: input2.toolName ?? null,
88451
- toolArgs: input2.toolArgs ?? null
88457
+ toolArgs: input2.toolArgs ?? null,
88458
+ replace: input2.replace === true
88452
88459
  }),
88453
88460
  signal
88454
88461
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aglio-worker",
3
- "version": "0.115.3",
3
+ "version": "0.115.7",
4
4
  "description": "Host machine agent for Aglio: claims jobs over the API and starts aglio-runner containers.",
5
5
  "type": "module",
6
6
  "bin": {