@termhub/agent 0.4.3 → 0.4.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.
Files changed (2) hide show
  1. package/dist/cli.js +14 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -102,6 +102,7 @@ var channel = z2.number().int().min(1).max(4294967295);
102
102
  var rpcId = z2.string().min(1).max(64);
103
103
  var closedReason = z2.enum(["cli_missing", "run_failed", "killed", "missing_session", "cli_rejected"]);
104
104
  var CAPABILITY_CLAUDE = "claude";
105
+ var CAPABILITY_CLAUDE_SYSTEM_PROMPT = "claude.system_prompt";
105
106
  var helloMessage = z2.object({
106
107
  type: z2.literal("hello"),
107
108
  protocol: z2.number().int().min(1),
@@ -144,7 +145,10 @@ var claudeOpenParams = z2.object({
144
145
  // opening a channel to the user's own machine is exactly the trust boundary this grant
145
146
  // belongs at, so there is no separate, later place to hand it over.
146
147
  token: z2.string(),
147
- model: z2.string().nullable().optional()
148
+ model: z2.string().nullable().optional(),
149
+ // Project chats only: the server-composed focus text forwarded onto the CLI's argv (see
150
+ // `CAPABILITY_CLAUDE_SYSTEM_PROMPT`). Absent for the account-wide chat, whose argv must not change.
151
+ append_system_prompt: z2.string().max(4e3).nullable().optional()
148
152
  });
149
153
  var openPty = z2.object({ type: z2.literal("open"), ch: channel, kind: z2.literal("pty"), params: ptyOpenParams });
150
154
  var openClaude = z2.object({ type: z2.literal("open"), ch: channel, kind: z2.literal("claude"), params: claudeOpenParams });
@@ -1191,7 +1195,11 @@ function buildClaudeArgs(spec) {
1191
1195
  "mcp__termhub__*",
1192
1196
  "--disallowed-tools",
1193
1197
  DISALLOWED_TOOLS,
1194
- ...spec.model ? ["--model", spec.model] : []
1198
+ ...spec.model ? ["--model", spec.model] : [],
1199
+ // Last, and only when set: the account-wide chat's argv stays exactly what it was. It is our own
1200
+ // server-composed text (a project's name, key and paths), never the user's prompt, which still
1201
+ // travels on stdin only.
1202
+ ...spec.append_system_prompt ? ["--append-system-prompt", spec.append_system_prompt] : []
1195
1203
  ];
1196
1204
  }
1197
1205
  function mcpConfig(url, token) {
@@ -1251,7 +1259,8 @@ function createClaudeManager(deps) {
1251
1259
  session_id: params.session_id,
1252
1260
  resume: params.resume,
1253
1261
  mcp_config_path: mcpConfigPath,
1254
- model: params.model ?? null
1262
+ model: params.model ?? null,
1263
+ append_system_prompt: params.append_system_prompt ?? null
1255
1264
  });
1256
1265
  let child;
1257
1266
  try {
@@ -2027,7 +2036,7 @@ async function status3() {
2027
2036
  }
2028
2037
 
2029
2038
  // src/version.ts
2030
- var AGENT_VERSION = "0.4.3";
2039
+ var AGENT_VERSION = "0.4.4";
2031
2040
 
2032
2041
  // src/rpc/update.ts
2033
2042
  var PACKAGE = "@termhub/agent";
@@ -2116,7 +2125,7 @@ function detectOs(platform = process.platform) {
2116
2125
  if (platform === "linux") return "linux";
2117
2126
  return null;
2118
2127
  }
2119
- var CAPABILITIES = [CAPABILITY_CLAUDE];
2128
+ var CAPABILITIES = [CAPABILITY_CLAUDE, CAPABILITY_CLAUDE_SYSTEM_PROMPT];
2120
2129
  async function buildHello(osName) {
2121
2130
  let tools = [];
2122
2131
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@termhub/agent",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Agente do termhub: conecta esta máquina ao servidor por WebSocket de saída (sem SSH) e expõe os terminais tmux no navegador.",
5
5
  "license": "MIT",
6
6
  "private": false,