@ycodium-ai/agent-acp 0.2.4351 → 0.2.4372

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/dist/index.js +29 -13
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  import { definePlugin } from "@ycodium-ai/plugin-api";
9
9
 
10
10
  // ../../packages/plugin-api/src/version.ts
11
- var PLUGIN_API_VERSION = 110;
11
+ var PLUGIN_API_VERSION = 112;
12
12
 
13
13
  // src/acpInstance.ts
14
14
  import * as NodeOS3 from "node:os";
@@ -27793,24 +27793,40 @@ function createExecutorUpdates({
27793
27793
  return;
27794
27794
  }
27795
27795
  };
27796
- const emitTaskEvents = (taskEvents) => {
27797
- for (const taskEvent of taskEvents ?? []) {
27796
+ const emitHookEvents = (hookEvents) => {
27797
+ for (const hookEvent of hookEvents ?? []) {
27798
+ if (hookEvent.type === "runtime.warning") {
27799
+ const message = hookEvent.payload.message.trim();
27800
+ if (message.length === 0) continue;
27801
+ emit({
27802
+ type: "runtime.warning",
27803
+ ...stamp(),
27804
+ provider: options.provider,
27805
+ threadId: options.threadId,
27806
+ ...hookEvent.turnId !== void 0 ? { turnId: hookEvent.turnId } : {},
27807
+ payload: {
27808
+ message,
27809
+ ...hookEvent.payload.detail !== void 0 ? { detail: hookEvent.payload.detail } : {}
27810
+ }
27811
+ });
27812
+ continue;
27813
+ }
27798
27814
  emit({
27799
- type: taskEvent.type,
27815
+ type: hookEvent.type,
27800
27816
  ...stamp(),
27801
27817
  provider: options.provider,
27802
27818
  threadId: options.threadId,
27803
- ...taskEvent.turnId !== void 0 ? { turnId: taskEvent.turnId } : {},
27804
- payload: taskEvent.payload
27819
+ ...hookEvent.turnId !== void 0 ? { turnId: hookEvent.turnId } : {},
27820
+ payload: hookEvent.payload
27805
27821
  });
27806
27822
  }
27807
27823
  };
27808
27824
  const toolSubagents = hooks.toolSubagents === void 0 ? void 0 : createToolSubagentTracker(hooks.toolSubagents);
27809
- const settleToolSubagents = (settlement, turnId) => emitTaskEvents(toolSubagents?.settle(settlement, turnId));
27825
+ const settleToolSubagents = (settlement, turnId) => emitHookEvents(toolSubagents?.settle(settlement, turnId));
27810
27826
  const settleSessionEnded = () => {
27811
27827
  settleToolSubagents("session-ended");
27812
- emitTaskEvents(subagentSessions?.settleSessionEnded());
27813
- emitTaskEvents(hooks.onSessionEnded?.());
27828
+ emitHookEvents(subagentSessions?.settleSessionEnded());
27829
+ emitHookEvents(hooks.onSessionEnded?.());
27814
27830
  };
27815
27831
  const observeContext = () => ({
27816
27832
  turnId: shared.activeTurnId,
@@ -27872,7 +27888,7 @@ function createExecutorUpdates({
27872
27888
  };
27873
27889
  const hookResult = call === void 0 ? void 0 : toolSubagents?.onToolCallUpdated(call) ?? hooks.onToolCallUpdated?.(call);
27874
27890
  const handledByHook = hookResult !== void 0 && "events" in hookResult && hookResult.handled === true;
27875
- emitTaskEvents(
27891
+ emitHookEvents(
27876
27892
  hookResult === void 0 ? [] : "events" in hookResult ? hookResult.events : hookResult
27877
27893
  );
27878
27894
  if (nextToolCall.status === "completed" && hookResult && "artifacts" in hookResult)
@@ -27969,7 +27985,7 @@ function createExecutorUpdates({
27969
27985
  };
27970
27986
  const receiveSessionUpdate = (params) => {
27971
27987
  const foreign = !shared.ownSessionIds.has(params.sessionId) && (shared.childSessions.has(params.sessionId) || shared.sessionOpensInFlight === 0 && shared.ownSessionIds.size > 0);
27972
- emitTaskEvents(
27988
+ emitHookEvents(
27973
27989
  subagentSessions?.observe(params, {
27974
27990
  turnId: shared.activeTurnId,
27975
27991
  foreign,
@@ -27979,7 +27995,7 @@ function createExecutorUpdates({
27979
27995
  );
27980
27996
  if (!shared.sessionLoadInFlight) {
27981
27997
  if (hooks.onSessionUpdate) {
27982
- emitTaskEvents(hooks.onSessionUpdate(params, { ...observeContext(), foreign }));
27998
+ emitHookEvents(hooks.onSessionUpdate(params, { ...observeContext(), foreign }));
27983
27999
  }
27984
28000
  }
27985
28001
  if (!foreign) handleSessionUpdate(params);
@@ -27987,7 +28003,7 @@ function createExecutorUpdates({
27987
28003
  const receiveExtensionNotification = (method, params) => {
27988
28004
  if (shared.sessionLoadInFlight || !hooks.onExtensionNotification) return;
27989
28005
  const result = hooks.onExtensionNotification(method, params, observeContext());
27990
- if (Array.isArray(result)) emitTaskEvents(result);
28006
+ if (Array.isArray(result)) emitHookEvents(result);
27991
28007
  };
27992
28008
  return {
27993
28009
  emitCompactionState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-acp",
3
- "version": "0.2.4351",
3
+ "version": "0.2.4372",
4
4
  "description": "Generic ACP executor: user-supplied CLI over Agent Client Protocol stdio.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -21,9 +21,9 @@
21
21
  "@types/node": "24.12.4",
22
22
  "esbuild": "0.28.1",
23
23
  "vite-plus": "0.2.2",
24
- "@ycodium-ai/plugin-api": "0.2.4351",
25
- "ycodium-executor-testing": "0.0.0",
26
- "ycodium-acp-executor": "0.2.4351"
24
+ "ycodium-acp-executor": "0.2.4372",
25
+ "@ycodium-ai/plugin-api": "0.2.4372",
26
+ "ycodium-executor-testing": "0.0.0"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",