@ycodium-ai/agent-opencode 0.2.2938 → 0.2.2944

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 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -8202,6 +8202,34 @@ function toToolLifecycleItemType(toolName) {
8202
8202
  }
8203
8203
  return "dynamic_tool_call";
8204
8204
  }
8205
+ function openCodeToolStateFields(state) {
8206
+ const input = Object.keys(state.input).length > 0 ? { input: state.input } : {};
8207
+ switch (state.status) {
8208
+ case "pending":
8209
+ return {
8210
+ ...input,
8211
+ ...state.raw.length > 0 ? { argumentText: state.raw } : {}
8212
+ };
8213
+ case "running":
8214
+ return input;
8215
+ case "completed":
8216
+ return { ...input, output: state.output };
8217
+ case "error":
8218
+ return { ...input, output: state.error };
8219
+ default: {
8220
+ const unexpected = state;
8221
+ return unexpected;
8222
+ }
8223
+ }
8224
+ }
8225
+ function openCodeToolActivityData(part) {
8226
+ return {
8227
+ tool: part.tool,
8228
+ state: part.state.status,
8229
+ ...part.metadata ? { metadata: part.metadata } : {},
8230
+ ...openCodeToolStateFields(part.state)
8231
+ };
8232
+ }
8205
8233
  function detailFromToolPart(part) {
8206
8234
  switch (part.state.status) {
8207
8235
  case "completed":
@@ -8344,11 +8372,7 @@ function emitToolLifecycle(events, context, part) {
8344
8372
  itemType,
8345
8373
  title: part.tool,
8346
8374
  ...detail ? { detail } : {},
8347
- data: {
8348
- tool: part.tool,
8349
- state: part.state.status,
8350
- ...part.metadata ? { metadata: part.metadata } : {}
8351
- }
8375
+ data: openCodeToolActivityData(part)
8352
8376
  };
8353
8377
  const extra = { itemId };
8354
8378
  switch (part.state.status) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-opencode",
3
- "version": "0.2.2938",
3
+ "version": "0.2.2944",
4
4
  "description": "OpenCode executor: OpenCode CLI via @opencode-ai/sdk/v2.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -24,7 +24,7 @@
24
24
  "@types/node": "24.12.4",
25
25
  "esbuild": "0.28.1",
26
26
  "vite-plus": "0.2.2",
27
- "@ycodium-ai/plugin-api": "0.2.2938",
27
+ "@ycodium-ai/plugin-api": "0.2.2944",
28
28
  "ycodium-fetch-ports": "0.0.0",
29
29
  "ycodium-executor-testing": "0.0.0"
30
30
  },