@ycodium-ai/agent-codex 0.2.2898 → 0.2.2904

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 +50 -26
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1379,6 +1379,43 @@ function buildCodexDeveloperInstructions(interactionMode, runtime, browserToolsA
1379
1379
  // src/events.ts
1380
1380
  import * as NodeCrypto from "node:crypto";
1381
1381
 
1382
+ // src/codexArtifacts.ts
1383
+ function imageGenerationArtifacts(input) {
1384
+ if (input.itemType !== "imageGeneration" || input.status !== "completed") return [];
1385
+ if (!isRecord3(input.params)) return [];
1386
+ const item = isRecord3(input.params["item"]) ? input.params["item"] : input.params;
1387
+ const savedPath = item["savedPath"];
1388
+ if (typeof savedPath !== "string" || savedPath.trim().length === 0) return [];
1389
+ return [{ path: savedPath, ...input.itemId ? { toolCallId: input.itemId } : {} }];
1390
+ }
1391
+
1392
+ // src/codexItemTypes.ts
1393
+ function normalizeItemType(value) {
1394
+ if (!value) return "item";
1395
+ return value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[._/-]/g, " ").replace(/\s+/g, " ").trim().toLowerCase();
1396
+ }
1397
+ function toCanonicalItemType(raw) {
1398
+ const type = normalizeItemType(raw);
1399
+ if (type.includes("user")) return "user_message";
1400
+ if (type.includes("agent message") || type.includes("assistant")) return "assistant_message";
1401
+ if (type.includes("reasoning") || type.includes("thought")) return "reasoning";
1402
+ if (type.includes("plan") || type.includes("todo")) return "plan";
1403
+ if (type.includes("command")) return "command_execution";
1404
+ if (type.includes("file change") || type.includes("patch") || type.includes("edit")) {
1405
+ return "file_change";
1406
+ }
1407
+ if (type.includes("mcp")) return "mcp_tool_call";
1408
+ if (type.includes("dynamic tool")) return "dynamic_tool_call";
1409
+ if (type.includes("collab")) return "collab_agent_tool_call";
1410
+ if (type.includes("web search")) return "web_search";
1411
+ if (type.includes("image")) return "image_view";
1412
+ if (type.includes("review entered")) return "review_entered";
1413
+ if (type.includes("review exited")) return "review_exited";
1414
+ if (type.includes("compact")) return "context_compaction";
1415
+ if (type.includes("error")) return "error";
1416
+ return "unknown";
1417
+ }
1418
+
1382
1419
  // src/approvalMapping.ts
1383
1420
  function fileChangeEntries(params) {
1384
1421
  if (!isRecord3(params)) return [];
@@ -1899,31 +1936,6 @@ function nextEventId() {
1899
1936
  function nowIso2() {
1900
1937
  return (/* @__PURE__ */ new Date()).toISOString();
1901
1938
  }
1902
- function normalizeItemType(value) {
1903
- if (!value) return "item";
1904
- return value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[._/-]/g, " ").replace(/\s+/g, " ").trim().toLowerCase();
1905
- }
1906
- function toCanonicalItemType(raw) {
1907
- const type = normalizeItemType(raw);
1908
- if (type.includes("user")) return "user_message";
1909
- if (type.includes("agent message") || type.includes("assistant")) return "assistant_message";
1910
- if (type.includes("reasoning") || type.includes("thought")) return "reasoning";
1911
- if (type.includes("plan") || type.includes("todo")) return "plan";
1912
- if (type.includes("command")) return "command_execution";
1913
- if (type.includes("file change") || type.includes("patch") || type.includes("edit")) {
1914
- return "file_change";
1915
- }
1916
- if (type.includes("mcp")) return "mcp_tool_call";
1917
- if (type.includes("dynamic tool")) return "dynamic_tool_call";
1918
- if (type.includes("collab")) return "collab_agent_tool_call";
1919
- if (type.includes("web search")) return "web_search";
1920
- if (type.includes("image")) return "image_view";
1921
- if (type.includes("review entered")) return "review_entered";
1922
- if (type.includes("review exited")) return "review_exited";
1923
- if (type.includes("compact")) return "context_compaction";
1924
- if (type.includes("error")) return "error";
1925
- return "unknown";
1926
- }
1927
1939
  function itemIdOf(params) {
1928
1940
  if (!isRecord3(params)) return void 0;
1929
1941
  const item = isRecord3(params["item"]) ? params["item"] : params;
@@ -2636,8 +2648,20 @@ function mapNotificationToEvents(input) {
2636
2648
  method,
2637
2649
  providerInstanceId
2638
2650
  });
2651
+ const artifacts = imageGenerationArtifacts({ params, itemType: type, itemId, status });
2652
+ const produced = artifacts.length > 0 ? [
2653
+ baseEvent({
2654
+ type: "assistant.artifact.produced",
2655
+ threadId,
2656
+ turnId,
2657
+ itemId,
2658
+ payload: { artifacts },
2659
+ method,
2660
+ providerInstanceId
2661
+ })
2662
+ ] : [];
2639
2663
  const asyncQuestions = canonical === "assistant_message" && itemId ? toAsyncQuestions(params) : void 0;
2640
- if (!asyncQuestions) return [completed];
2664
+ if (!asyncQuestions) return [completed, ...produced];
2641
2665
  return [
2642
2666
  completed,
2643
2667
  baseEvent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-codex",
3
- "version": "0.2.2898",
3
+ "version": "0.2.2904",
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.2898",
32
+ "@ycodium-ai/plugin-api": "0.2.2904",
33
33
  "ycodium-executor-testing": "0.0.0"
34
34
  },
35
35
  "ycodium": {