doer-agent 0.5.2 → 0.5.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/agent-codex-cli.js +1 -1
- package/dist/agent-session-rpc.js +35 -12
- package/dist/agent-settings.js +1 -125
- package/dist/agent-skill-rpc.js +1 -1
- package/package.json +2 -2
package/dist/agent-codex-cli.js
CHANGED
|
@@ -22,7 +22,7 @@ export function stripAnsi(value) {
|
|
|
22
22
|
}
|
|
23
23
|
export function normalizeCodexModel(value) {
|
|
24
24
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
25
|
-
return normalized || "gpt-5.
|
|
25
|
+
return normalized || "gpt-5.5";
|
|
26
26
|
}
|
|
27
27
|
export function buildManagedCodexArgs(args) {
|
|
28
28
|
const promptArgs = ["--", args.prompt];
|
|
@@ -13,6 +13,7 @@ const SESSION_RPC_BLOB_KEYS = new Set([
|
|
|
13
13
|
"bytes",
|
|
14
14
|
"data",
|
|
15
15
|
]);
|
|
16
|
+
const SESSION_RPC_MAX_STRING_CHARS = 512;
|
|
16
17
|
function getSessionsRootPath(workspaceRoot) {
|
|
17
18
|
return path.join(workspaceRoot, ".codex", "sessions");
|
|
18
19
|
}
|
|
@@ -89,9 +90,16 @@ function buildInlineBlobMarker(value) {
|
|
|
89
90
|
}
|
|
90
91
|
return "[inline blob omitted]";
|
|
91
92
|
}
|
|
93
|
+
function truncateSessionRpcString(value) {
|
|
94
|
+
if (value.length <= SESSION_RPC_MAX_STRING_CHARS) {
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
const omittedChars = value.length - SESSION_RPC_MAX_STRING_CHARS;
|
|
98
|
+
return `${value.slice(0, SESSION_RPC_MAX_STRING_CHARS)}\n[truncated ${omittedChars} chars for session RPC]`;
|
|
99
|
+
}
|
|
92
100
|
function sanitizeSessionRpcPayload(value) {
|
|
93
101
|
if (typeof value === "string") {
|
|
94
|
-
return value;
|
|
102
|
+
return truncateSessionRpcString(value);
|
|
95
103
|
}
|
|
96
104
|
if (Array.isArray(value)) {
|
|
97
105
|
return value.map((entry) => sanitizeSessionRpcPayload(entry));
|
|
@@ -112,22 +120,41 @@ function sanitizeSessionRpcPayload(value) {
|
|
|
112
120
|
function sanitizeSessionRpcRawLine(line) {
|
|
113
121
|
const trimmed = line.trim();
|
|
114
122
|
if (!trimmed.startsWith("{")) {
|
|
115
|
-
return line;
|
|
123
|
+
return truncateSessionRpcString(line);
|
|
116
124
|
}
|
|
117
125
|
try {
|
|
118
126
|
const parsed = JSON.parse(line);
|
|
119
127
|
if (!isObjectRecord(parsed)) {
|
|
120
|
-
return line;
|
|
128
|
+
return truncateSessionRpcString(line);
|
|
121
129
|
}
|
|
122
130
|
if (parsed.type === "compacted" || parsed.type === "turn_context" || parsed.type === "session_meta") {
|
|
123
|
-
return
|
|
131
|
+
return JSON.stringify({
|
|
132
|
+
...parsed,
|
|
133
|
+
payload: sanitizeSessionRpcPayload(parsed.payload),
|
|
134
|
+
});
|
|
124
135
|
}
|
|
125
|
-
if (!isObjectRecord(parsed.payload)
|
|
126
|
-
return
|
|
136
|
+
if (!isObjectRecord(parsed.payload)) {
|
|
137
|
+
return JSON.stringify({
|
|
138
|
+
...parsed,
|
|
139
|
+
payload: sanitizeSessionRpcPayload(parsed.payload),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
if (parsed.type !== "response_item") {
|
|
143
|
+
return JSON.stringify({
|
|
144
|
+
...parsed,
|
|
145
|
+
payload: sanitizeSessionRpcPayload(parsed.payload),
|
|
146
|
+
});
|
|
127
147
|
}
|
|
128
148
|
const payloadType = typeof parsed.payload.type === "string" ? parsed.payload.type : "";
|
|
129
149
|
if (payloadType === "message" || payloadType === "reasoning") {
|
|
130
|
-
return
|
|
150
|
+
return JSON.stringify({
|
|
151
|
+
...parsed,
|
|
152
|
+
payload: {
|
|
153
|
+
type: payloadType,
|
|
154
|
+
status: typeof parsed.payload.status === "string" ? parsed.payload.status : "completed",
|
|
155
|
+
message: `[${payloadType} payload omitted for session RPC pagination]`,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
131
158
|
}
|
|
132
159
|
return JSON.stringify({
|
|
133
160
|
...parsed,
|
|
@@ -135,7 +162,7 @@ function sanitizeSessionRpcRawLine(line) {
|
|
|
135
162
|
});
|
|
136
163
|
}
|
|
137
164
|
catch {
|
|
138
|
-
return line;
|
|
165
|
+
return truncateSessionRpcString(line);
|
|
139
166
|
}
|
|
140
167
|
}
|
|
141
168
|
function toTrimmedStringOrNull(value) {
|
|
@@ -523,10 +550,6 @@ async function getAgentSessionRawRows(args) {
|
|
|
523
550
|
for (const line of lines) {
|
|
524
551
|
if (line.trim()) {
|
|
525
552
|
const sanitized = sanitizeSessionRpcRawLine(line);
|
|
526
|
-
if (!sanitized) {
|
|
527
|
-
lineNumber += 1;
|
|
528
|
-
continue;
|
|
529
|
-
}
|
|
530
553
|
rawRows.push({
|
|
531
554
|
id: lineNumber,
|
|
532
555
|
raw: sanitized,
|
package/dist/agent-settings.js
CHANGED
|
@@ -15,7 +15,7 @@ export function createDefaultAgentSettingsConfig() {
|
|
|
15
15
|
personality: "pragmatic",
|
|
16
16
|
},
|
|
17
17
|
codex: {
|
|
18
|
-
model: "gpt-5.
|
|
18
|
+
model: "gpt-5.5",
|
|
19
19
|
authMode: "api_key",
|
|
20
20
|
},
|
|
21
21
|
realtime: {
|
|
@@ -34,28 +34,6 @@ export function createDefaultAgentSettingsConfig() {
|
|
|
34
34
|
oauthLogin: null,
|
|
35
35
|
oauthScope: null,
|
|
36
36
|
},
|
|
37
|
-
jira: {
|
|
38
|
-
baseUrl: null,
|
|
39
|
-
email: null,
|
|
40
|
-
enabled: false,
|
|
41
|
-
apiToken: null,
|
|
42
|
-
},
|
|
43
|
-
notion: {
|
|
44
|
-
baseUrl: "https://api.notion.com",
|
|
45
|
-
version: "2022-06-28",
|
|
46
|
-
enabled: false,
|
|
47
|
-
apiToken: null,
|
|
48
|
-
},
|
|
49
|
-
slack: {
|
|
50
|
-
baseUrl: "https://slack.com/api",
|
|
51
|
-
enabled: false,
|
|
52
|
-
botToken: null,
|
|
53
|
-
},
|
|
54
|
-
figma: {
|
|
55
|
-
baseUrl: "https://api.figma.com",
|
|
56
|
-
enabled: false,
|
|
57
|
-
apiToken: null,
|
|
58
|
-
},
|
|
59
37
|
env: {
|
|
60
38
|
variables: [],
|
|
61
39
|
},
|
|
@@ -216,10 +194,6 @@ export function normalizeAgentSettingsConfig(value, fallback) {
|
|
|
216
194
|
const codex = raw.codex && typeof raw.codex === "object" ? raw.codex : {};
|
|
217
195
|
const realtime = raw.realtime && typeof raw.realtime === "object" ? raw.realtime : {};
|
|
218
196
|
const git = raw.git && typeof raw.git === "object" ? raw.git : {};
|
|
219
|
-
const jira = raw.jira && typeof raw.jira === "object" ? raw.jira : {};
|
|
220
|
-
const notion = raw.notion && typeof raw.notion === "object" ? raw.notion : {};
|
|
221
|
-
const slack = raw.slack && typeof raw.slack === "object" ? raw.slack : {};
|
|
222
|
-
const figma = raw.figma && typeof raw.figma === "object" ? raw.figma : {};
|
|
223
197
|
const env = raw.env && typeof raw.env === "object" ? raw.env : null;
|
|
224
198
|
const databases = raw.databases && typeof raw.databases === "object" ? raw.databases : null;
|
|
225
199
|
return {
|
|
@@ -246,28 +220,6 @@ export function normalizeAgentSettingsConfig(value, fallback) {
|
|
|
246
220
|
oauthLogin: git.oauthLogin === null ? null : normalizeNullableString(git.oauthLogin) ?? base.git.oauthLogin,
|
|
247
221
|
oauthScope: git.oauthScope === null ? null : normalizeNullableString(git.oauthScope) ?? base.git.oauthScope,
|
|
248
222
|
},
|
|
249
|
-
jira: {
|
|
250
|
-
baseUrl: jira.baseUrl === null ? null : normalizeNullableString(jira.baseUrl) ?? base.jira.baseUrl,
|
|
251
|
-
email: jira.email === null ? null : normalizeNullableString(jira.email) ?? base.jira.email,
|
|
252
|
-
enabled: typeof jira.enabled === "boolean" ? jira.enabled : base.jira.enabled,
|
|
253
|
-
apiToken: jira.apiToken === null ? null : normalizeNullableString(jira.apiToken) ?? base.jira.apiToken,
|
|
254
|
-
},
|
|
255
|
-
notion: {
|
|
256
|
-
baseUrl: notion.baseUrl === null ? null : normalizeNullableString(notion.baseUrl) ?? base.notion.baseUrl,
|
|
257
|
-
version: notion.version === null ? null : normalizeNullableString(notion.version) ?? base.notion.version,
|
|
258
|
-
enabled: typeof notion.enabled === "boolean" ? notion.enabled : base.notion.enabled,
|
|
259
|
-
apiToken: notion.apiToken === null ? null : normalizeNullableString(notion.apiToken) ?? base.notion.apiToken,
|
|
260
|
-
},
|
|
261
|
-
slack: {
|
|
262
|
-
baseUrl: slack.baseUrl === null ? null : normalizeNullableString(slack.baseUrl) ?? base.slack.baseUrl,
|
|
263
|
-
enabled: typeof slack.enabled === "boolean" ? slack.enabled : base.slack.enabled,
|
|
264
|
-
botToken: slack.botToken === null ? null : normalizeNullableString(slack.botToken) ?? base.slack.botToken,
|
|
265
|
-
},
|
|
266
|
-
figma: {
|
|
267
|
-
baseUrl: figma.baseUrl === null ? null : normalizeNullableString(figma.baseUrl) ?? base.figma.baseUrl,
|
|
268
|
-
enabled: typeof figma.enabled === "boolean" ? figma.enabled : base.figma.enabled,
|
|
269
|
-
apiToken: figma.apiToken === null ? null : normalizeNullableString(figma.apiToken) ?? base.figma.apiToken,
|
|
270
|
-
},
|
|
271
223
|
env: normalizeAgentEnvironmentSettings(env, base.env),
|
|
272
224
|
databases: normalizeAgentDatabaseSettings(databases, base.databases),
|
|
273
225
|
};
|
|
@@ -320,10 +272,6 @@ function toMaskedSecret(value) {
|
|
|
320
272
|
export async function toAgentSettingsPublic(args) {
|
|
321
273
|
const realtimeKey = toMaskedSecret(args.config.realtime.apiKey);
|
|
322
274
|
const gitOauth = toMaskedSecret(args.config.git.oauthToken);
|
|
323
|
-
const jiraToken = toMaskedSecret(args.config.jira.apiToken);
|
|
324
|
-
const notionToken = toMaskedSecret(args.config.notion.apiToken);
|
|
325
|
-
const slackToken = toMaskedSecret(args.config.slack.botToken);
|
|
326
|
-
const figmaToken = toMaskedSecret(args.config.figma.apiToken);
|
|
327
275
|
const customInstructions = await readAgentModelInstructions(args.workspaceRoot);
|
|
328
276
|
return {
|
|
329
277
|
general: {
|
|
@@ -357,36 +305,6 @@ export async function toAgentSettingsPublic(args) {
|
|
|
357
305
|
oauthLogin: args.config.git.oauthLogin,
|
|
358
306
|
oauthScope: args.config.git.oauthScope,
|
|
359
307
|
},
|
|
360
|
-
jira: {
|
|
361
|
-
baseUrl: args.config.jira.baseUrl,
|
|
362
|
-
email: args.config.jira.email,
|
|
363
|
-
enabled: args.config.jira.enabled,
|
|
364
|
-
hasApiToken: jiraToken.has,
|
|
365
|
-
apiTokenMasked: jiraToken.masked,
|
|
366
|
-
apiTokenLength: jiraToken.length,
|
|
367
|
-
},
|
|
368
|
-
notion: {
|
|
369
|
-
baseUrl: args.config.notion.baseUrl,
|
|
370
|
-
version: args.config.notion.version,
|
|
371
|
-
enabled: args.config.notion.enabled,
|
|
372
|
-
hasApiToken: notionToken.has,
|
|
373
|
-
apiTokenMasked: notionToken.masked,
|
|
374
|
-
apiTokenLength: notionToken.length,
|
|
375
|
-
},
|
|
376
|
-
slack: {
|
|
377
|
-
baseUrl: args.config.slack.baseUrl,
|
|
378
|
-
enabled: args.config.slack.enabled,
|
|
379
|
-
hasBotToken: slackToken.has,
|
|
380
|
-
botTokenMasked: slackToken.masked,
|
|
381
|
-
botTokenLength: slackToken.length,
|
|
382
|
-
},
|
|
383
|
-
figma: {
|
|
384
|
-
baseUrl: args.config.figma.baseUrl,
|
|
385
|
-
enabled: args.config.figma.enabled,
|
|
386
|
-
hasApiToken: figmaToken.has,
|
|
387
|
-
apiTokenMasked: figmaToken.masked,
|
|
388
|
-
apiTokenLength: figmaToken.length,
|
|
389
|
-
},
|
|
390
308
|
env: {
|
|
391
309
|
variables: args.config.env.variables.map((variable) => ({
|
|
392
310
|
key: variable.key,
|
|
@@ -449,20 +367,6 @@ export function normalizeAgentSettingsPatch(value) {
|
|
|
449
367
|
move("gitOauthToken", "git", "oauthToken");
|
|
450
368
|
move("gitOauthLogin", "git", "oauthLogin");
|
|
451
369
|
move("gitOauthScope", "git", "oauthScope");
|
|
452
|
-
move("jiraBaseUrl", "jira", "baseUrl");
|
|
453
|
-
move("jiraEmail", "jira", "email");
|
|
454
|
-
move("jiraEnabled", "jira", "enabled");
|
|
455
|
-
move("jiraApiToken", "jira", "apiToken");
|
|
456
|
-
move("notionBaseUrl", "notion", "baseUrl");
|
|
457
|
-
move("notionVersion", "notion", "version");
|
|
458
|
-
move("notionEnabled", "notion", "enabled");
|
|
459
|
-
move("notionApiToken", "notion", "apiToken");
|
|
460
|
-
move("slackBaseUrl", "slack", "baseUrl");
|
|
461
|
-
move("slackEnabled", "slack", "enabled");
|
|
462
|
-
move("slackBotToken", "slack", "botToken");
|
|
463
|
-
move("figmaBaseUrl", "figma", "baseUrl");
|
|
464
|
-
move("figmaEnabled", "figma", "enabled");
|
|
465
|
-
move("figmaApiToken", "figma", "apiToken");
|
|
466
370
|
move("environmentVariables", "env", "variables");
|
|
467
371
|
return patch;
|
|
468
372
|
}
|
|
@@ -486,34 +390,6 @@ export function buildAgentSettingsEnvPatch(config) {
|
|
|
486
390
|
if (config.git.oauthScope)
|
|
487
391
|
envPatch.DOER_GIT_OAUTH_SCOPE = config.git.oauthScope;
|
|
488
392
|
}
|
|
489
|
-
if (config.jira.enabled) {
|
|
490
|
-
if (config.jira.baseUrl)
|
|
491
|
-
envPatch.JIRA_BASE_URL = config.jira.baseUrl;
|
|
492
|
-
if (config.jira.email)
|
|
493
|
-
envPatch.JIRA_EMAIL = config.jira.email;
|
|
494
|
-
if (config.jira.apiToken)
|
|
495
|
-
envPatch.JIRA_API_TOKEN = config.jira.apiToken;
|
|
496
|
-
}
|
|
497
|
-
if (config.notion.enabled) {
|
|
498
|
-
if (config.notion.baseUrl)
|
|
499
|
-
envPatch.NOTION_BASE_URL = config.notion.baseUrl;
|
|
500
|
-
if (config.notion.version)
|
|
501
|
-
envPatch.NOTION_VERSION = config.notion.version;
|
|
502
|
-
if (config.notion.apiToken)
|
|
503
|
-
envPatch.NOTION_API_TOKEN = config.notion.apiToken;
|
|
504
|
-
}
|
|
505
|
-
if (config.slack.enabled) {
|
|
506
|
-
if (config.slack.baseUrl)
|
|
507
|
-
envPatch.SLACK_BASE_URL = config.slack.baseUrl;
|
|
508
|
-
if (config.slack.botToken)
|
|
509
|
-
envPatch.SLACK_BOT_TOKEN = config.slack.botToken;
|
|
510
|
-
}
|
|
511
|
-
if (config.figma.enabled) {
|
|
512
|
-
if (config.figma.baseUrl)
|
|
513
|
-
envPatch.FIGMA_BASE_URL = config.figma.baseUrl;
|
|
514
|
-
if (config.figma.apiToken)
|
|
515
|
-
envPatch.FIGMA_API_TOKEN = config.figma.apiToken;
|
|
516
|
-
}
|
|
517
393
|
for (const variable of config.env.variables) {
|
|
518
394
|
envPatch[variable.key] = variable.value;
|
|
519
395
|
}
|
package/dist/agent-skill-rpc.js
CHANGED
|
@@ -74,7 +74,7 @@ async function generateSkillViaCodex(args) {
|
|
|
74
74
|
const localAgentSettings = await args.readAgentSettingsConfig({ workspaceRoot: args.workspaceRoot });
|
|
75
75
|
const envPatch = args.buildAgentSettingsEnvPatch(localAgentSettings);
|
|
76
76
|
const prompt = buildSkillGeneratorPrompt(args.userPrompt);
|
|
77
|
-
const result = await args.runLocalCodexCli(buildSkillGeneratorCodexArgs(prompt, localAgentSettings.codex.model || "gpt-5.
|
|
77
|
+
const result = await args.runLocalCodexCli(buildSkillGeneratorCodexArgs(prompt, localAgentSettings.codex.model || "gpt-5.5"), 120_000, envPatch);
|
|
78
78
|
if (result.timedOut) {
|
|
79
79
|
throw new Error("Codex timed out while generating the skill");
|
|
80
80
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doer-agent",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Reverse-polling agent runtime for doer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/agent.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
28
|
-
"@openai/codex-sdk": "^0.
|
|
28
|
+
"@openai/codex-sdk": "^0.128.0",
|
|
29
29
|
"mysql2": "^3.22.2",
|
|
30
30
|
"nats": "^2.29.3",
|
|
31
31
|
"pg": "^8.16.3",
|