@ycodium-ai/agent-codex 0.2.2588 → 0.2.2634

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 +43 -9
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1584,6 +1584,28 @@ function toUserInputQuestions(params) {
1584
1584
  }
1585
1585
  return mapped.length > 0 ? mapped : void 0;
1586
1586
  }
1587
+ function toAsyncQuestions(params) {
1588
+ if (!isRecord3(params)) return void 0;
1589
+ const item = isRecord3(params["item"]) ? params["item"] : params;
1590
+ if (item["delivery"] !== "async" || !Array.isArray(item["questions"])) return void 0;
1591
+ const mapped = [];
1592
+ item["questions"].forEach((question, index) => {
1593
+ if (!isRecord3(question)) return;
1594
+ const title = trimText(question["title"]);
1595
+ if (!title) return;
1596
+ const labels = Array.isArray(question["options"]) ? question["options"] : [];
1597
+ const options = labels.map((label) => trimText(label)).filter((label) => label !== void 0).map((label) => ({ label, description: "" }));
1598
+ mapped.push({
1599
+ id: `q${index}`,
1600
+ header: title,
1601
+ question: title,
1602
+ options,
1603
+ allowFreeform: true,
1604
+ multiSelect: false
1605
+ });
1606
+ });
1607
+ return mapped.length > 0 ? mapped : void 0;
1608
+ }
1587
1609
  function toCodexUserInputAnswers(answers) {
1588
1610
  if (!isRecord3(answers)) return void 0;
1589
1611
  const out = {};
@@ -2171,19 +2193,31 @@ function mapNotificationToEvents(input) {
2171
2193
  if (canonical === "unknown") return [];
2172
2194
  const rawStatus = itemStatusOf(params);
2173
2195
  const status = rawStatus === "failed" || rawStatus === "declined" ? rawStatus : "completed";
2196
+ const completed = baseEvent({
2197
+ type: "item.completed",
2198
+ threadId,
2199
+ turnId,
2200
+ itemId,
2201
+ payload: {
2202
+ itemType: canonical,
2203
+ status,
2204
+ ...itemTitle(params) ? { title: itemTitle(params) } : {},
2205
+ ...itemDetail(params) ? { detail: itemDetail(params) } : {},
2206
+ ...params !== void 0 ? { data: params } : {}
2207
+ },
2208
+ method,
2209
+ providerInstanceId
2210
+ });
2211
+ const asyncQuestions = canonical === "assistant_message" && itemId ? toAsyncQuestions(params) : void 0;
2212
+ if (!asyncQuestions) return [completed];
2174
2213
  return [
2214
+ completed,
2175
2215
  baseEvent({
2176
- type: "item.completed",
2216
+ type: "user-input.requested",
2177
2217
  threadId,
2178
2218
  turnId,
2179
- itemId,
2180
- payload: {
2181
- itemType: canonical,
2182
- status,
2183
- ...itemTitle(params) ? { title: itemTitle(params) } : {},
2184
- ...itemDetail(params) ? { detail: itemDetail(params) } : {},
2185
- ...params !== void 0 ? { data: params } : {}
2186
- },
2219
+ requestId: `codex-async:${itemId}`,
2220
+ payload: { questions: asyncQuestions, responseMode: "message" },
2187
2221
  method,
2188
2222
  providerInstanceId
2189
2223
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-codex",
3
- "version": "0.2.2588",
3
+ "version": "0.2.2634",
4
4
  "description": "Codex executor: Codex CLI over the app-server JSON-RPC protocol.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -29,7 +29,7 @@
29
29
  "tailwindcss": "^4.0.0",
30
30
  "typescript": "~6.0.3",
31
31
  "vite-plus": "0.2.2",
32
- "@ycodium-ai/plugin-api": "0.2.2588",
32
+ "@ycodium-ai/plugin-api": "0.2.2634",
33
33
  "ycodium-executor-testing": "0.0.0"
34
34
  },
35
35
  "ycodium": {