@messenger-agent/claude-agent 0.29.0 → 0.30.0-alpha.0
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/config.js +1 -1
- package/dist/platform-instructions.js +7 -7
- package/package.json +2 -2
package/dist/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as C,readFileSync as S}from"node:fs";import{tmpdir as v}from"node:os";import{join as r}from"node:path";import{parse as U}from"yaml";import{z as e}from"zod";import{normalizeOptional as o,parseAgentAuthConfig as h,parseAgentWorkspacesConfig as M,parseGitInitConfig as I,resolveAgentBridgeUrls as j}from"@messenger-agent/shared/agent-config";import{logger as c,normalizeLogLevel as y,setLogFile as k,setLogLevel as T}from"@messenger-agent/shared/logger";import{deriveScheduleServiceConfig as A}from"@messenger-agent/shared/schedule-tools";const L=e.object({server:e.string().optional(),log_level:e.string().optional(),port:e.coerce.number().int().positive().optional(),auth_tokens:e.record(e.string(),e.string()).optional(),workspaces:e.array(e.object({id:e.string().optional(),name:e.string().optional(),path:e.string().optional()})).optional(),file_uploads:e.object({temp_dir:e.string().optional()}).optional(),data_dir:e.string().optional(),claude:e.object({port:e.coerce.number().int().positive().optional(),data_dir:e.string().optional(),file_uploads:e.object({temp_dir:e.string().optional()}).optional(),api_key:e.string().optional(),base_url:e.string().optional(),default_model:e.string().optional(),max_turns:e.coerce.number().int().positive().optional(),ask_timeout_ms:e.coerce.number().int().positive().optional(),session_idle_timeout_ms:e.coerce.number().int().positive().optional()}).optional(),schedule:e.object({enabled:e.boolean().optional()}).optional(),gitlab:e.object({ca_cert_path:e.string().optional(),host:e.string().optional()}).optional(),git:e.object({co_authors:e.array(e.string()).optional()}).optional(),tunnel:e.object({enabled:e.boolean().optional(),server_url:e.string().optional(),tunnel_id:e.string().optional(),token:e.string().optional(),reconnect_initial_ms:e.number().int().positive().optional(),reconnect_max_ms:e.number().int().positive().optional(),heartbeat_interval_ms:e.number().int().positive().optional()}).optional()}).loose();function x(){const n=process.env.AGENT_CONFIG_PATH??"./agent-config.yaml";if(!C(n)){const l="/data",b=r(l,"logs","claude-agent.log");return T("info"),k(b),c.warn(`Config file not found at ${n}`),{configPath:n,logLevel:"info",logFile:b,port:3e3,fileUploads:{tempDir:r(v(),"claude-agent-uploads")},dataDir:l,claude:{askTimeoutMs:432e5,sessionIdleTimeoutMs:36e5},schedule:{enabled:!0},tunnel:{enabled:!1,reconnectInitialMs:1e3,reconnectMaxMs:3e4,heartbeatIntervalMs:3e4},...h({}),...M({}),...I({})}}let s;try{s=U(S(n,"utf-8"))}catch(l){c.error(`Failed to parse config file at ${n}:`,l),s={}}const i=L.safeParse(s??{});i.success||c.error(`Invalid config format at ${n}:`,i.error.issues);const t=i.success?i.data:{},p=y(t.log_level),d=o(t.claude?.data_dir)??o(t.data_dir)??"/data",u=r(d,"logs","claude-agent.log"),a=t.tunnel?.enabled??!1,_=o(t.tunnel?.token),m=j(t.server),g=o(t.claude?.api_key)??(a?_:void 0),f=o(t.claude?.base_url)??(a?m.llm:void 0);return T(p),k(u),{configPath:n,logLevel:p,logFile:u,port:t.claude?.port??t.port??3e3,fileUploads:{tempDir:o(t.claude?.file_uploads?.temp_dir)??o(t.file_uploads?.temp_dir)??r(v(),"claude-agent-uploads")},dataDir:d,claude:{apiKey:g,baseUrl:f,defaultModel:o(t.claude?.default_model),maxTurns:t.claude?.max_turns,askTimeoutMs:Number.parseInt(process.env.CLAUDE_ASK_TIMEOUT_MS??"",10)||t.claude?.ask_timeout_ms||432e5,sessionIdleTimeoutMs:Number.parseInt(process.env.CLAUDE_SESSION_IDLE_TIMEOUT_MS??"",10)||t.claude?.session_idle_timeout_ms||36e5},schedule:{enabled:t.schedule?.enabled??!0,...A(f,g)},tunnel:{enabled:a,serverUrl:o(t.tunnel?.server_url)??(a?m.tunnel:void 0),tunnelId:o(t.tunnel?.tunnel_id),token:_,reconnectInitialMs:t.tunnel?.reconnect_initial_ms??1e3,reconnectMaxMs:t.tunnel?.reconnect_max_ms??3e4,heartbeatIntervalMs:t.tunnel?.heartbeat_interval_ms??3e4},...h(t),...M(t),...I(t)}}const K=x();export{K as appConfig};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{existsSync as r,readFileSync as i}from"node:fs";import{fileURLToPath as
|
|
2
|
-
`),
|
|
3
|
-
`),
|
|
4
|
-
`);function
|
|
5
|
-
${
|
|
6
|
-
`:""}${
|
|
1
|
+
import{existsSync as r,readFileSync as i}from"node:fs";import{fileURLToPath as s}from"node:url";import{logger as c}from"@messenger-agent/shared/logger";const d=[s(new URL("./assets/codex-home/AGENTS.md",import.meta.url)),s(new URL("../../../assets/codex-home/AGENTS.md",import.meta.url)),"/app/assets/codex-home/AGENTS.md"],m=["search_managed_tasks","get_managed_task","create_managed_task","update_managed_task","apply_managed_task_patch","delete_managed_task"],l=["## Claude Managed Task Tools","","When the user asks to create, update, inspect, continue, summarize, or delete managed tasks, use the managed task MCP tools. The available tool basenames are: "+m.map(e=>`\`${e}\``).join(", ")+". Claude may expose them with an MCP namespace such as `mcp__managed_tasks__<tool>`.",""].join(`
|
|
2
|
+
`),u=["## Response Style","","Do not use emoji in responses.","Use Markdown headings, bold, and italic formatting sparingly.","Other Markdown formatting, such as lists, inline code, links, and code blocks, may be used as needed.",""].join(`
|
|
3
|
+
`),p=["## Schedule Tool","","Use the single schedule MCP tool to prepare create/update proposals or list, inspect, pause, resume, and cancel schedules in the current trusted Matrix context. Select the action inside `input.action`; never ask for or invent a Room ID, actor ID, source event, or service credential. Every create and update must include a Matrix Markdown mention in `message` and at least one Agent MXID in `mentionUserIds`; `mentionUserIds` must exactly match the MXIDs targeted by the message mentions. A successful create/update result is a proposal awaiting one explicit Messenger confirmation, not an active schedule. Do not ask for a chat reply or invoke another confirmation tool.",""].join(`
|
|
4
|
+
`);function g(e,o=!1){const a=`${l}
|
|
5
|
+
${o?`${p}
|
|
6
|
+
`:""}${u}`,t=[e??process.env.CLAUDE_MEMORY_TEMPLATE_PATH,...d].find(n=>!!(n&&r(n)));return t?`${i(t,"utf-8").trimEnd()}
|
|
7
7
|
|
|
8
|
-
${a}`:(c.warn("Claude platform instructions template not found"),a)}export{
|
|
8
|
+
${a}`:(c.warn("Claude platform instructions template not found"),a)}export{g as loadClaudePlatformInstructions};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@messenger-agent/claude-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"ws": "^8.21.0",
|
|
20
20
|
"yaml": "^2.9.0",
|
|
21
21
|
"zod": "^4.4.3",
|
|
22
|
-
"@messenger-agent/shared": "0.
|
|
22
|
+
"@messenger-agent/shared": "0.30.0-alpha.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/ws": "^8.18.1"
|