@agentclientprotocol/codex-acp 2.5.1-preview.2 → 2.5.1-preview.3

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 +30 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -40575,7 +40575,7 @@ var package_default = {
40575
40575
  publishConfig: {
40576
40576
  access: "public"
40577
40577
  },
40578
- version: "2.5.1-preview.2",
40578
+ version: "2.5.1-preview.3",
40579
40579
  description: "",
40580
40580
  main: "dist/index.js",
40581
40581
  bin: {
@@ -47009,6 +47009,8 @@ function titleSource(text) {
47009
47009
  // src/PromptSuggestionGenerator.ts
47010
47010
  var PROMPT_SUGGESTIONS_META_KEY = "promptSuggestions";
47011
47011
  var SOURCE_MAX_CHARS = 4e3;
47012
+ var SUGGESTION_EFFORT = "low";
47013
+ var BASE_INSTRUCTIONS = "You are a text-only predictor. Never call tools or run commands. Answer only with the JSON object the user message asks for.";
47012
47014
  var OUTPUT_SCHEMA = {
47013
47015
  type: "object",
47014
47016
  properties: { suggestion: { type: "string" } },
@@ -47059,25 +47061,39 @@ var PromptSuggestionGenerator = class {
47059
47061
  }
47060
47062
  async generateAndPublish(generation, userText, agentText) {
47061
47063
  if (!userText.trim() || !agentText.trim()) return;
47062
- const { thread } = await this.client.threadStart({ cwd: this.cwd, ephemeral: true });
47063
- const result = await this.client.runTurn({
47064
- threadId: thread.id,
47065
- input: [{
47066
- type: "text",
47067
- text: `${SYSTEM_PROMPT2}
47064
+ const client = this.client;
47065
+ const { thread } = await client.threadStart({
47066
+ cwd: this.cwd,
47067
+ ephemeral: true,
47068
+ sandbox: "read-only",
47069
+ approvalPolicy: "never",
47070
+ baseInstructions: BASE_INSTRUCTIONS,
47071
+ config: { project_doc_max_bytes: 0 }
47072
+ });
47073
+ try {
47074
+ const result = await client.runTurn({
47075
+ threadId: thread.id,
47076
+ input: [{
47077
+ type: "text",
47078
+ text: `${SYSTEM_PROMPT2}
47068
47079
 
47069
47080
  Last user message:
47070
47081
  ${head(userText)}
47071
47082
 
47072
47083
  Last assistant reply:
47073
47084
  ${head(agentText)}`,
47074
- text_elements: []
47075
- }],
47076
- outputSchema: OUTPUT_SCHEMA,
47077
- model: TITLE_MODEL
47078
- });
47079
- if (generation !== this.generation) return;
47080
- await this.publishIfChanged(extractSuggestion(result.turn));
47085
+ text_elements: []
47086
+ }],
47087
+ outputSchema: OUTPUT_SCHEMA,
47088
+ model: TITLE_MODEL,
47089
+ effort: SUGGESTION_EFFORT
47090
+ });
47091
+ if (generation !== this.generation) return;
47092
+ await this.publishIfChanged(extractSuggestion(result.turn));
47093
+ } finally {
47094
+ await client.threadUnsubscribe({ threadId: thread.id }).catch(() => {
47095
+ });
47096
+ }
47081
47097
  }
47082
47098
  async publishIfChanged(text) {
47083
47099
  if (text === this.lastPublished) return;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "2.5.1-preview.2",
6
+ "version": "2.5.1-preview.3",
7
7
  "description": "",
8
8
  "main": "dist/index.js",
9
9
  "bin": {