@ycodium-ai/agent-codex 0.2.5093 → 0.2.5177

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 +44 -26
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { definePlugin } from "@ycodium-ai/plugin-api";
3
3
 
4
4
  // ../../packages/plugin-api/src/version.ts
5
- var PLUGIN_API_VERSION = 147;
5
+ var PLUGIN_API_VERSION = 152;
6
6
 
7
7
  // src/index.ts
8
8
  import {
@@ -2402,6 +2402,21 @@ var codexProcessExitCategory = (session) => session !== void 0 && !session.stopR
2402
2402
 
2403
2403
  // src/rpc.ts
2404
2404
  import { lastStderrLines, redactStderrExcerpt } from "@ycodium-ai/plugin-api/process-stdin";
2405
+
2406
+ // ../../packages/ycodium-jsonl-stream/src/jsonObjectLine.ts
2407
+ function parseJsonObjectLine(line) {
2408
+ if (line.trim().length === 0) return void 0;
2409
+ let message;
2410
+ try {
2411
+ message = JSON.parse(line);
2412
+ } catch {
2413
+ return void 0;
2414
+ }
2415
+ if (!message || typeof message !== "object") return void 0;
2416
+ return message;
2417
+ }
2418
+
2419
+ // src/rpc.ts
2405
2420
  function createLineAssembler() {
2406
2421
  const fragments = [];
2407
2422
  return {
@@ -2469,15 +2484,8 @@ async function createCodexRpcClient(handle, handlers) {
2469
2484
  pending2.clear();
2470
2485
  };
2471
2486
  const dispatch = (line) => {
2472
- if (line.trim().length === 0) return;
2473
- let message;
2474
- try {
2475
- message = JSON.parse(line);
2476
- } catch {
2477
- return;
2478
- }
2479
- if (!message || typeof message !== "object") return;
2480
- const typed = message;
2487
+ const typed = parseJsonObjectLine(line);
2488
+ if (typed === void 0) return;
2481
2489
  const hasId = typeof typed.id === "number";
2482
2490
  const hasMethod = typeof typed.method === "string";
2483
2491
  if (hasId && hasMethod) {
@@ -3373,6 +3381,14 @@ function formatCoarseWait(waitMs) {
3373
3381
  return minutes === 0 ? `${String(hours)}h` : `${String(hours)}h ${String(minutes)}m`;
3374
3382
  }
3375
3383
 
3384
+ // ../../packages/ycodium-instance-config/src/tomlScalar.ts
3385
+ function readTomlScalar(raw) {
3386
+ const quoted = /^(["'])(.*?)\1/.exec(raw.trim());
3387
+ if (quoted?.[2] !== void 0) return quoted[2];
3388
+ const [beforeComment = ""] = raw.split("#");
3389
+ return beforeComment.trim();
3390
+ }
3391
+
3376
3392
  // src/usage/codexQuota.ts
3377
3393
  var asRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
3378
3394
  var asFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
@@ -3559,12 +3575,6 @@ var isOfficialUrl = (value) => {
3559
3575
  const parsed = URL.parse(value.trim());
3560
3576
  return parsed === null ? false : CODEX_OFFICIAL_HOSTS.has(parsed.hostname.toLowerCase());
3561
3577
  };
3562
- var readTomlScalar = (raw) => {
3563
- const quoted = /^(["'])(.*?)\1/.exec(raw.trim());
3564
- if (quoted?.[2] !== void 0) return quoted[2];
3565
- const [beforeComment = ""] = raw.split("#");
3566
- return beforeComment.trim();
3567
- };
3568
3578
  var TABLE_HEADER = /^\[\s*([^\][]+?)\s*\]\s*(?:#.*)?$/;
3569
3579
  var KEY_VALUE = /^([A-Za-z0-9_.\-"']+)\s*=\s*(.*)$/;
3570
3580
  var BASE_URL_KEYS = /* @__PURE__ */ new Set([
@@ -7480,6 +7490,20 @@ async function readAppendedJsonl(filePath, resumeFrom, openParser) {
7480
7490
 
7481
7491
  // ../../packages/ycodium-jsonl-stream/src/scanCache.ts
7482
7492
  import * as NodePath12 from "node:path";
7493
+ function decodeScanCacheTables(document, version) {
7494
+ if (typeof document !== "object" || document === null) return void 0;
7495
+ const root = document;
7496
+ if (root.version !== version) return void 0;
7497
+ if (!Array.isArray(root.models) || !Array.isArray(root.sessions)) return void 0;
7498
+ if (typeof root.files !== "object" || root.files === null) return void 0;
7499
+ if (!root.models.every((value) => typeof value === "string")) return void 0;
7500
+ if (!root.sessions.every((value) => typeof value === "string")) return void 0;
7501
+ return {
7502
+ models: root.models,
7503
+ sessions: root.sessions,
7504
+ files: root.files
7505
+ };
7506
+ }
7483
7507
  function createStringTable() {
7484
7508
  const values = [];
7485
7509
  const index = /* @__PURE__ */ new Map();
@@ -7574,15 +7598,9 @@ var decodeCodexState = (value) => {
7574
7598
  };
7575
7599
  var decodeScanCache = (document) => {
7576
7600
  const cache = /* @__PURE__ */ new Map();
7577
- if (typeof document !== "object" || document === null) return cache;
7578
- const root = document;
7579
- if (root.version !== CODEX_SCAN_CACHE_VERSION) return cache;
7580
- if (!isArray(root.models) || !isArray(root.sessions)) return cache;
7581
- if (typeof root.files !== "object" || root.files === null) return cache;
7582
- if (!root.models.every((value) => typeof value === "string")) return cache;
7583
- if (!root.sessions.every((value) => typeof value === "string")) return cache;
7584
- const models = root.models;
7585
- const sessions = root.sessions;
7601
+ const tables = decodeScanCacheTables(document, CODEX_SCAN_CACHE_VERSION);
7602
+ if (tables === void 0) return cache;
7603
+ const { models, sessions, files } = tables;
7586
7604
  const decodeRecords = (rows) => {
7587
7605
  const records = [];
7588
7606
  for (const row of rows) {
@@ -7607,7 +7625,7 @@ var decodeScanCache = (document) => {
7607
7625
  }
7608
7626
  return records;
7609
7627
  };
7610
- for (const [path, raw] of Object.entries(root.files)) {
7628
+ for (const [path, raw] of Object.entries(files)) {
7611
7629
  if (typeof raw !== "object" || raw === null) continue;
7612
7630
  const entry = raw;
7613
7631
  if (typeof entry.s !== "number" || typeof entry.m !== "number") continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-codex",
3
- "version": "0.2.5093",
3
+ "version": "0.2.5177",
4
4
  "description": "Codex executor: Codex CLI over the app-server JSON-RPC protocol.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -29,15 +29,15 @@
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.5093",
33
- "ycodium-instance-config": "0.0.0",
34
- "ycodium-duration-format": "0.0.0",
32
+ "@ycodium-ai/plugin-api": "0.2.5177",
35
33
  "ycodium-credential-account": "0.0.0",
36
34
  "ycodium-executor-testing": "0.0.0",
35
+ "ycodium-instance-config": "0.0.0",
36
+ "ycodium-duration-format": "0.0.0",
37
37
  "ycodium-jsonl-stream": "0.0.0",
38
38
  "ycodium-react-test-harness": "0.0.0",
39
- "ycodium-workspace-path": "0.0.0",
40
- "ycodium-text-generation": "0.0.0"
39
+ "ycodium-text-generation": "0.0.0",
40
+ "ycodium-workspace-path": "0.0.0"
41
41
  },
42
42
  "ycodium": {
43
43
  "plugin": "./dist/index.js",