@botbotgo/agent-harness 0.0.245 → 0.0.246

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.
@@ -1 +1 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.244";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.245";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.244";
1
+ export const AGENT_HARNESS_VERSION = "0.0.245";
@@ -158,6 +158,13 @@ export async function* streamHarnessRun(options) {
158
158
  }
159
159
  }
160
160
  await options.appendAssistantMessage(options.threadId, options.runId, assistantOutput);
161
+ const completedEvent = await options.setRunStateAndEmit(options.threadId, options.runId, 6, "completed", {
162
+ previousState: "running",
163
+ });
164
+ yield {
165
+ type: "event",
166
+ event: completedEvent,
167
+ };
161
168
  yield {
162
169
  type: "result",
163
170
  result: {
@@ -169,12 +176,6 @@ export async function* streamHarnessRun(options) {
169
176
  finalMessageText: assistantOutput,
170
177
  },
171
178
  };
172
- yield {
173
- type: "event",
174
- event: await options.setRunStateAndEmit(options.threadId, options.runId, 6, "completed", {
175
- previousState: "running",
176
- }),
177
- };
178
179
  }
179
180
  catch (error) {
180
181
  const shouldRetryAfterStreamingCompatibilityError = streamActivityObserved &&
@@ -251,6 +252,13 @@ export async function* streamHarnessRun(options) {
251
252
  if (Array.isArray(actual.contentBlocks) && actual.contentBlocks.length > 0) {
252
253
  yield createContentBlocksItem(options.threadId, options.runId, options.selectedAgentId, actual.contentBlocks);
253
254
  }
255
+ const terminalEvent = await options.setRunStateAndEmit(options.threadId, options.runId, 6, actual.state, {
256
+ previousState: "running",
257
+ });
258
+ yield {
259
+ type: "event",
260
+ event: terminalEvent,
261
+ };
254
262
  yield {
255
263
  type: "result",
256
264
  result: {
@@ -264,12 +272,6 @@ export async function* streamHarnessRun(options) {
264
272
  },
265
273
  },
266
274
  };
267
- yield {
268
- type: "event",
269
- event: await options.setRunStateAndEmit(options.threadId, options.runId, 6, actual.state, {
270
- previousState: "running",
271
- }),
272
- };
273
275
  return;
274
276
  }
275
277
  catch (invokeError) {
@@ -31,8 +31,17 @@ function readEventContext(event) {
31
31
  function containsSemanticHint(values, hint) {
32
32
  return values.some((value) => hint.test(value));
33
33
  }
34
+ function normalizeSemanticHint(value) {
35
+ return value
36
+ .replace(/([a-z0-9])([A-Z])/g, "$1 $2")
37
+ .replace(/[.:/]+/g, " ")
38
+ .replace(/[_-]+/g, " ")
39
+ .replace(/\s+/g, " ")
40
+ .trim()
41
+ .toLowerCase();
42
+ }
34
43
  function classifyStepCategory(context) {
35
- const hints = [context.name, context.runType, ...context.tags, ...context.ns].map((value) => value.toLowerCase());
44
+ const hints = [context.name, context.runType, ...context.tags, ...context.ns].map(normalizeSemanticHint);
36
45
  if (containsSemanticHint(hints, /\b(skill|skills)\b/)) {
37
46
  return "skill";
38
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.245",
3
+ "version": "0.0.246",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",