@agentclientprotocol/codex-acp 2.5.1-preview.1 → 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.
- package/dist/index.js +30 -14
- 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.
|
|
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
|
|
47063
|
-
const
|
|
47064
|
-
|
|
47065
|
-
|
|
47066
|
-
|
|
47067
|
-
|
|
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
|
-
|
|
47075
|
-
|
|
47076
|
-
|
|
47077
|
-
|
|
47078
|
-
|
|
47079
|
-
|
|
47080
|
-
|
|
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;
|