@saltpub/xiaojiu-agent-bridge 0.1.3 → 0.1.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/index.d.ts CHANGED
@@ -112,6 +112,8 @@ interface LogContext {
112
112
  traceId?: string;
113
113
  chatId?: string;
114
114
  msgId?: string;
115
+ /** Owning profile name; drives the `[profile#uid]` stdout tag in daemon mode. */
116
+ profile?: string;
115
117
  }
116
118
  type LogFields = Record<string, unknown>;
117
119
  declare function reportMetric(name: string, value: number, tags?: Record<string, string>): void;
package/dist/index.js CHANGED
@@ -499,7 +499,7 @@ function finalizeIfRunning(state) {
499
499
  // src/core/logger.ts
500
500
  import { AsyncLocalStorage } from "async_hooks";
501
501
  import { createWriteStream, mkdirSync } from "fs";
502
- import { open, readdir, rm, stat } from "fs/promises";
502
+ import { readdir, rename, rm, stat } from "fs/promises";
503
503
  import { join } from "path";
504
504
 
505
505
  // src/core/telemetry.ts
@@ -568,7 +568,7 @@ function sanitizeLogValue(key, value, options = EXTERNAL_SANITIZE) {
568
568
  const normalizedKey = key.startsWith("_") ? key.slice(1) : key;
569
569
  if (value === void 0) return void 0;
570
570
  if (RAW_PAYLOAD_KEYS.has(normalizedKey)) return "[REDACTED]";
571
- if (/token|secret|authorization/i.test(normalizedKey)) return "[REDACTED]";
571
+ if (/(?:token(?!s)|secret|authorization)/i.test(normalizedKey)) return "[REDACTED]";
572
572
  if (/attachment.*path|media.*path|^(cwd|cwdRealpath|path|absPath)$/i.test(normalizedKey)) {
573
573
  return "[REDACTED_PATH]";
574
574
  }
@@ -630,6 +630,7 @@ function redactResourceText(text) {
630
630
  "[REDACTED_RESOURCE]"
631
631
  );
632
632
  }
633
+ var DAEMON_LOG_MAX_BYTES = 10 * 1024 * 1024;
633
634
  function reportMetric(name, value, tags) {
634
635
  try {
635
636
  telemetry().recordMetric(name, value, sanitizeMetricTags(tags));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltpub/xiaojiu-agent-bridge",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Bridge Xiaojiu IM with local CLI coding agents",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.33.0",
@@ -111,11 +111,14 @@
111
111
  "schemaVersion": 1,
112
112
  "channel": "stable",
113
113
  "highlights": [
114
- "Harden npm update checks, terminal output, and semantic version handling.",
115
- "Keep release artifacts free of private repository metadata."
114
+ "`xiaojiu-agent-bridge update` 会展示 latest 的 What's new,并默认执行 `npm install -g`;`--check` 只检查不安装。发版时把 CHANGELOG Highlights 写入包内更新元数据。",
115
+ "daemon 日志行首新增 `[profile#uid]` 归属标记(非 TTY 启动时生效):`daemon-{stdout,stderr}.log` 中每行现在带 profile 与 `ps` 短 uid,同端口 join 进同一监听进程的其他 profile 按行各自归属;uid 注册完成前退化为 `[profile]`,TTY 输出不变",
116
+ "日志治理:修复 `inputTokens`/`outputTokens` 被误脱敏;修复 stdout 时长 `1m60s` 不进位;`run failed` 在 stdout 带单行错误原因;`flush.start` 记录 `parentTraceIds`/`msgIds` 接通 intake→flush 链路;trace 上下文字段重复时不再产生 `_chatId`/`_msgId` 冗余;agent 非 JSON 输出聚合成 `invalid-json`/`invalid-json-summary`;空闲 profile 的 `chats-fetched` 心跳只在数量变化时记录;GC 覆盖所有 profile 的 `logs/` 与 `logs/daemon/`,`daemon-*.log` 超 10 MiB 轮转单代 `.old`;daemon(非 TTY)输出带 `yy-mm-dd HH:mm:ss`(本地时区)前缀且控制台 token 落盘脱敏;`cardAction`/`owner_invalid` 等日志 token 统一 kebab-case 并加静态测试锁定;删除无调用方的 `readRecentLogs`/`sanitizeLogsForDoctor`。",
117
+ "`/config` 新增「思考强度」档位(跟随默认/低/中/高/超高/最大),按 agent 映射到各自机制:Claude 用 `MAX_THINKING_TOKENS` 环境变量(预算 1k/4k/16k/32k/64k),Codex 用 `model_reasoning_effort`,Pi/OMP 用原生 `--thinking` 参数,OpenCode 拼 `--model provider/id#variant`(档位按模型而异,模型不支持时该次运行会报错)。",
118
+ "引用回复和话题上下文里的图片/文件现在会按附件策略下载,并把本地路径注入 prompt 的 `<quoted_messages>` / `<topic_context>` 段,所有 coding agent(Claude、Codex、Pi、OpenCode、OMP)都能读取被引用的图片;Codex 额外把已接受的引用图片合并进原生 `images` 参数。嵌套引用只取一层。"
116
119
  ],
117
120
  "breakingChanges": [],
118
- "securityFix": true,
121
+ "securityFix": false,
119
122
  "requiresRestart": false
120
123
  }
121
124
  }