doer-agent 0.5.2 → 0.5.4
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 +28 -11
- 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,12 +90,19 @@ function buildInlineBlobMarker(value) {
|
|
|
89
90
|
}
|
|
90
91
|
return "[inline blob omitted]";
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
if (
|
|
93
|
+
function truncateSessionRpcString(value) {
|
|
94
|
+
if (value.length <= SESSION_RPC_MAX_STRING_CHARS) {
|
|
94
95
|
return value;
|
|
95
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
|
+
}
|
|
100
|
+
function sanitizeSessionRpcPayload(value, options = {}) {
|
|
101
|
+
if (typeof value === "string") {
|
|
102
|
+
return options.truncateStrings ? truncateSessionRpcString(value) : value;
|
|
103
|
+
}
|
|
96
104
|
if (Array.isArray(value)) {
|
|
97
|
-
return value.map((entry) => sanitizeSessionRpcPayload(entry));
|
|
105
|
+
return value.map((entry) => sanitizeSessionRpcPayload(entry, options));
|
|
98
106
|
}
|
|
99
107
|
if (!isObjectRecord(value)) {
|
|
100
108
|
return value;
|
|
@@ -105,7 +113,7 @@ function sanitizeSessionRpcPayload(value) {
|
|
|
105
113
|
sanitized[key] = buildInlineBlobMarker(entry);
|
|
106
114
|
continue;
|
|
107
115
|
}
|
|
108
|
-
sanitized[key] = sanitizeSessionRpcPayload(entry);
|
|
116
|
+
sanitized[key] = sanitizeSessionRpcPayload(entry, options);
|
|
109
117
|
}
|
|
110
118
|
return sanitized;
|
|
111
119
|
}
|
|
@@ -120,14 +128,27 @@ function sanitizeSessionRpcRawLine(line) {
|
|
|
120
128
|
return 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, { truncateStrings: true }),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (!isObjectRecord(parsed.payload)) {
|
|
137
|
+
return line;
|
|
124
138
|
}
|
|
125
|
-
if (
|
|
139
|
+
if (parsed.type !== "response_item") {
|
|
126
140
|
return line;
|
|
127
141
|
}
|
|
128
142
|
const payloadType = typeof parsed.payload.type === "string" ? parsed.payload.type : "";
|
|
129
143
|
if (payloadType === "message" || payloadType === "reasoning") {
|
|
130
|
-
return
|
|
144
|
+
return JSON.stringify({
|
|
145
|
+
...parsed,
|
|
146
|
+
payload: {
|
|
147
|
+
type: payloadType,
|
|
148
|
+
status: typeof parsed.payload.status === "string" ? parsed.payload.status : "completed",
|
|
149
|
+
message: `[${payloadType} payload omitted for session RPC pagination]`,
|
|
150
|
+
},
|
|
151
|
+
});
|
|
131
152
|
}
|
|
132
153
|
return JSON.stringify({
|
|
133
154
|
...parsed,
|
|
@@ -523,10 +544,6 @@ async function getAgentSessionRawRows(args) {
|
|
|
523
544
|
for (const line of lines) {
|
|
524
545
|
if (line.trim()) {
|
|
525
546
|
const sanitized = sanitizeSessionRpcRawLine(line);
|
|
526
|
-
if (!sanitized) {
|
|
527
|
-
lineNumber += 1;
|
|
528
|
-
continue;
|
|
529
|
-
}
|
|
530
547
|
rawRows.push({
|
|
531
548
|
id: lineNumber,
|
|
532
549
|
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.4",
|
|
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",
|