@ycodium-ai/agent-codex 0.2.4688 → 0.2.5029

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 +52 -4
  2. package/package.json +4 -4
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 = 128;
5
+ var PLUGIN_API_VERSION = 143;
6
6
 
7
7
  // src/index.ts
8
8
  import {
@@ -4620,6 +4620,31 @@ function elicitationOptions(params) {
4620
4620
  { decision: "accept", label: "Approve", displayKind: "standard" }
4621
4621
  ];
4622
4622
  }
4623
+ var ELICITATION_COVERED_PARAMS = [
4624
+ "threadId",
4625
+ "turnId",
4626
+ "elicitationId",
4627
+ "serverName",
4628
+ "appName",
4629
+ "mode",
4630
+ "message",
4631
+ "_meta"
4632
+ ];
4633
+ function describeRequestedAccess(described) {
4634
+ const lines = [
4635
+ ...described.read.length > 0 ? [`read ${described.read.join(", ")}`] : [],
4636
+ ...described.write.length > 0 ? [`write ${described.write.join(", ")}`] : [],
4637
+ ...described.network ? ["network"] : []
4638
+ ];
4639
+ return lines.length > 0 ? lines.join("\n") : void 0;
4640
+ }
4641
+ function statementOf(fields2) {
4642
+ return {
4643
+ ...fields2.justification ? { justification: fields2.justification } : {},
4644
+ ...fields2.command ? { command: fields2.command } : {},
4645
+ ...fields2.coveredArgs.length > 0 ? { coveredArgs: fields2.coveredArgs } : {}
4646
+ };
4647
+ }
4623
4648
  function mapServerRequestToEvents(input) {
4624
4649
  const requestId = input.requestId;
4625
4650
  if (input.method === "item/tool/requestUserInput") {
@@ -4650,17 +4675,25 @@ function mapServerRequestToEvents(input) {
4650
4675
  if (appName) payload["appName"] = appName;
4651
4676
  if (described.message) payload["detail"] = described.message;
4652
4677
  payload["args"] = input.params;
4678
+ const params = isRecord2(input.params) ? input.params : {};
4679
+ payload["statement"] = statementOf({
4680
+ coveredArgs: ELICITATION_COVERED_PARAMS.filter((name) => params[name] !== void 0)
4681
+ });
4653
4682
  } else if (input.method === "item/permissions/requestApproval") {
4654
4683
  const described = describePermissionsApproval(input.params);
4655
- const paths = [...described.read, ...described.write];
4656
- const detail = described.reason ?? (paths.length > 0 ? paths.join(", ") : void 0);
4684
+ const detail = describeRequestedAccess(described) ?? described.reason;
4657
4685
  if (detail) payload["detail"] = detail;
4658
- payload["args"] = {
4686
+ const args = {
4659
4687
  ...described.reason ? { reason: described.reason } : {},
4660
4688
  ...described.read.length > 0 ? { read: described.read.join(", ") } : {},
4661
4689
  ...described.write.length > 0 ? { write: described.write.join(", ") } : {},
4662
4690
  ...described.network ? { network: "true" } : {}
4663
4691
  };
4692
+ payload["args"] = args;
4693
+ payload["statement"] = statementOf({
4694
+ justification: described.reason,
4695
+ coveredArgs: Object.keys(args)
4696
+ });
4664
4697
  } else if (input.method === "item/fileChange/requestApproval" || input.method.includes("applyPatch")) {
4665
4698
  const described = describeFileChangeApproval(input.params);
4666
4699
  if (described.detail) payload["detail"] = described.detail;
@@ -4670,6 +4703,13 @@ function mapServerRequestToEvents(input) {
4670
4703
  ...described.reason ? { reason: described.reason } : {},
4671
4704
  ...described.grantRoot ? { grantRoot: described.grantRoot } : {}
4672
4705
  };
4706
+ payload["statement"] = statementOf({
4707
+ justification: described.reason,
4708
+ coveredArgs: [
4709
+ ...described.callId ? ["callId"] : [],
4710
+ ...described.reason ? ["reason"] : []
4711
+ ]
4712
+ });
4673
4713
  } else {
4674
4714
  const described = describeCommandApproval(input.params);
4675
4715
  const detail = described.command || described.reason;
@@ -4679,6 +4719,14 @@ function mapServerRequestToEvents(input) {
4679
4719
  ...described.cwd ? { cwd: described.cwd } : {},
4680
4720
  ...described.reason ? { reason: described.reason } : {}
4681
4721
  };
4722
+ payload["statement"] = statementOf({
4723
+ justification: described.reason,
4724
+ command: described.command,
4725
+ coveredArgs: [
4726
+ ...described.command ? ["command"] : [],
4727
+ ...described.reason ? ["reason"] : []
4728
+ ]
4729
+ });
4682
4730
  }
4683
4731
  return [
4684
4732
  baseEvent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-codex",
3
- "version": "0.2.4688",
3
+ "version": "0.2.5029",
4
4
  "description": "Codex executor: Codex CLI over the app-server JSON-RPC protocol.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -29,9 +29,9 @@
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.4688",
33
- "ycodium-jsonl-stream": "0.0.0",
34
- "ycodium-executor-testing": "0.0.0"
32
+ "ycodium-executor-testing": "0.0.0",
33
+ "@ycodium-ai/plugin-api": "0.2.5029",
34
+ "ycodium-jsonl-stream": "0.0.0"
35
35
  },
36
36
  "ycodium": {
37
37
  "plugin": "./dist/index.js",