@shgroup/dsh-serenity-hooks 1.139.4 → 1.139.5

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/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-serenity-hooks",
3
- "version": "1.139.4",
3
+ "version": "1.139.5",
4
4
  "main": "lib/index.js",
5
5
  "description": "宁静号 ACC harness(Native Cordis 插件):给 DSH 装一个「AI 工作区」——13 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/localstore/container_admin/browser_slot;另两个 im-bridge/diagram 按条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表 + 浏览器槽位管理(≤20 个独立 profile 的 Chrome 槽位,带占用归属与异常时向所属会话反向注入提醒)。轨迹声明 = 轨迹目录下的 trajectory.json(约束面 + 旧标识 uid + CRO 机器绑定 cro.host;旧名 trajectory-constraint.json / skiff.json 仍在读取族里);轨迹提示词 = 轨迹目录下的 PROMPT.md(一条轨迹「是谁、按什么章程工作」,所有轨迹通用,追加在容器层与质量层之后,不替换它们)。适配 DSH 0.1.7-rc.1 / 0.2.0-rc.1 / 0.2.1-rc.1(三档,deepseek-ai/deepseek-harness)。",
6
6
  "engines": {
@@ -713,9 +713,10 @@ function namingTitleFor(active, summary) {
713
713
  * @param expectedPrefix 我们这一轮本该生成的标题前缀(`namingTitleFor` 去掉概括部分)
714
714
  * @returns true = 跳过重命名(保留用户的名字);false = 可以写
715
715
  */
716
- function shouldKeepUserTitle(currentTitle, expectedPrefix) {
716
+ function shouldKeepUserTitle(currentTitle, expectedPrefix, sourceKind) {
717
717
  if (typeof currentTitle !== "string" || currentTitle.trim() === "") return false;
718
718
  if (expectedPrefix === "") return false;
719
+ if (sourceKind === "fallback" || sourceKind === "provider") return false;
719
720
  const t = currentTitle.trim();
720
721
  if (t === expectedPrefix) return false;
721
722
  return !t.startsWith(`${expectedPrefix}-`);
@@ -733,9 +734,12 @@ function readCurrentTitle(titles, session) {
733
734
  if (!titles || typeof titles.get !== "function") return { state: "unreadable" };
734
735
  try {
735
736
  const snap = titles.get(session);
737
+ const title = typeof snap?.title === "string" ? snap.title : void 0;
738
+ const kind = (snap?.source)?.kind;
736
739
  return {
737
740
  state: "ok",
738
- title: typeof snap?.title === "string" ? snap.title : void 0
741
+ title,
742
+ ...typeof kind === "string" ? { sourceKind: kind } : {}
739
743
  };
740
744
  } catch {
741
745
  return { state: "unreadable" };
@@ -235,7 +235,7 @@ async function listCccs(ctx, opts = {}) {
235
235
  if (typeof defaultRoot === "string" && defaultRoot !== "" && !c.roots.includes(defaultRoot)) c.roots.unshift(defaultRoot);
236
236
  let rolesOf = null;
237
237
  if (opts.withRoles === true) {
238
- const { listTrajectoryConstraints } = await import("./profile-B6H_mm98.js").then((n) => n.a);
238
+ const { listTrajectoryConstraints } = await import("./profile-Vw1zbdts.js").then((n) => n.a);
239
239
  rolesOf = (root) => {
240
240
  try {
241
241
  return listTrajectoryConstraints(root).map((p) => p.code);
@@ -1,7 +1,7 @@
1
- import { l as hostInjected, r as cccRootForCwd, u as hostService } from "./ccc-roots-bcRvqzqJ.js";
1
+ import { l as hostInjected, r as cccRootForCwd, u as hostService } from "./ccc-roots-BiScEed8.js";
2
2
  import { d as readCccName$1, n as SAFE_MODE_MARKER, o as isSafeModeOn, r as classifyPath, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS, u as readBlacklist } from "./ccc-DSMqTrRU.js";
3
- import { L as isoLocal, g as listActiveTrajectories } from "./bind-file-BU-qo8W4.js";
4
- import { S as ACC_VERSION, o as getRestrictDiagnostics } from "./guards-BNaxez2a.js";
3
+ import { L as isoLocal, g as listActiveTrajectories } from "./bind-file-C2VRuwAQ.js";
4
+ import { S as ACC_VERSION, o as getRestrictDiagnostics } from "./guards-BuIUwt2B.js";
5
5
  import { basename, dirname, join, relative, resolve } from "node:path";
6
6
  import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
7
7
  import { execFile, execFileSync, spawnSync } from "node:child_process";
@@ -1,7 +1,7 @@
1
- import { r as cccRootForCwd } from "./ccc-roots-bcRvqzqJ.js";
1
+ import { r as cccRootForCwd } from "./ccc-roots-BiScEed8.js";
2
2
  import { c as matchBlacklist, d as readCccName, g as resolveInside, h as readUtf8, l as pathInside, o as isSafeModeOn, u as readBlacklist } from "./ccc-DSMqTrRU.js";
3
3
  import { c as readWeixinSettings, o as readImSettings } from "./route-BGKbuE3M.js";
4
- import { l as trajectoryCodeForSession, u as trajectoryConstraintForSession } from "./profile-B6H_mm98.js";
4
+ import { l as trajectoryCodeForSession, u as trajectoryConstraintForSession } from "./profile-Vw1zbdts.js";
5
5
  import { REGISTERED_TOOLS } from "./invariant.js";
6
6
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
7
7
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
package/lib/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import { i as __toESM, n as __exportAll } from "./rolldown-runtime-B4iAMlE-.js";
2
- import { d as hostSessions, f as hostSettings, i as cccRootForExec, m as hostWebServer, n as agentCwdFor, o as listCccs, p as hostWeb, r as cccRootForCwd, t as NO_CCC_FROM_AGENT_CWD, u as hostService } from "./ccc-roots-bcRvqzqJ.js";
2
+ import { d as hostSessions, f as hostSettings, i as cccRootForExec, m as hostWebServer, n as agentCwdFor, o as listCccs, p as hostWeb, r as cccRootForCwd, t as NO_CCC_FROM_AGENT_CWD, u as hostService } from "./ccc-roots-BiScEed8.js";
3
3
  import { a as findSerenityRoot$1, d as readCccName, g as resolveInside, l as pathInside, m as readUserQuotesEnabled, p as readTrajectorySubscriptions, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS } from "./ccc-DSMqTrRU.js";
4
- import { A as summarize, C as readTrajectoryUid, D as setActiveSessionInfo, E as sessionsRoot, L as isoLocal, M as useSession, N as TRAJECTORY_FILENAME, O as shouldKeepUserTitle, P as TRAJECTORY_LEGACY_FILENAMES, R as localFileStamp, S as readCurrentTitle, T as sessionEvents, _ as listSessions, b as parseTrajectoryCode, c as UID_FILENAME, d as createSession, j as trajectoryDescOf, k as showSession, l as archiveSession, m as getActiveSessionInfo, o as COGNITIVE_TRAJECTORY_ACTIONS, p as findSession, u as clearActiveSessionInfo, v as namingTitleFor, w as resolveSessionByTitle, y as parseSessionContextFromEvents } from "./bind-file-BU-qo8W4.js";
4
+ import { A as summarize, C as readTrajectoryUid, D as setActiveSessionInfo, E as sessionsRoot, L as isoLocal, M as useSession, N as TRAJECTORY_FILENAME, O as shouldKeepUserTitle, P as TRAJECTORY_LEGACY_FILENAMES, R as localFileStamp, S as readCurrentTitle, T as sessionEvents, _ as listSessions, b as parseTrajectoryCode, c as UID_FILENAME, d as createSession, j as trajectoryDescOf, k as showSession, l as archiveSession, m as getActiveSessionInfo, o as COGNITIVE_TRAJECTORY_ACTIONS, p as findSession, u as clearActiveSessionInfo, v as namingTitleFor, w as resolveSessionByTitle, y as parseSessionContextFromEvents } from "./bind-file-C2VRuwAQ.js";
5
5
  import { _ as readStore, a as readFeishuCredential, c as readWeixinSettings, d as weixinInboundDir, f as weixinSessionIdForTrajectory, i as matchWeixinRoute, m as checkLocalstoreGitCompliance, n as extractWeixinText, p as LOCALSTORE_SCOPES, r as hasVoiceItem, s as readWeixinCredential, t as extractWeixinMedia, u as sanitizeFileName$1, v as runLocalStore } from "./route-BGKbuE3M.js";
6
- import { C as findPackageRoot, S as ACC_VERSION, _ as constraintCognitiveTrajectory, d as imChannelIds, f as isImWiredTrajectory, h as TRAJECTORY_CONSTRAINT_HINT, i as forgetNonCccToolVisibility, l as syncToolVisibility, m as runImBridge, p as registerImChannel, s as registerGuards, u as forgetToolVisibility, v as constraintSystemPromptSource, x as resolveConstraintSystemPrompt } from "./guards-BNaxez2a.js";
7
- import { a as setSafeMode, c as ACC_CATALOG, d as findEntry, f as loadMsmEntries, g as setWeixinSendEndpoint, h as docsPointer, i as readDshVersion, l as CCC_CONFIG_REFERENCE, m as runMsmAsync, n as summarizeHostContract, o as listOpencodeSkillDirs, p as runMsm, r as getStatus, s as loadOpencodeSkill, t as hostContractReport } from "./contract-Cj2msyTr.js";
8
- import { c as replacesDefaultIdentity, i as listTrajectoryConstraints, l as trajectoryCodeForSession, n as findDirNameByCode, o as readTrajectoryConstraintAt, r as isTrajectoryConstrained, s as readTrajectoryConstraintByCode, t as TRAJECTORY_CONSTRAINT_FILENAME } from "./profile-B6H_mm98.js";
9
- import { A as TRAJECTORY_PROMPT_FILENAME, C as recordToolUsage, D as buildResourceNameSuffix, E as buildResourceIndex, O as isSafeSkillName, S as verifyTotpCode, T as SKILL_ONTOLOGY_FILE, _ as projectKnownWorkspaces, a as trajectoryConstraintFor, b as FACE_PORTS, c as trajectoryWorkspaceMdPath, d as splitModel, f as registerCognitiveTrajectorySkillSection, g as migrateLegacyLocalstore, h as applyWirePatch, i as getTrajectoryAgent, j as hasTrajectoryPrompt, k as truncateContent, l as unregisterTrajectorySession, m as registerEntrySkillSectionGlobal, n as deliverToTrajectory, o as trajectoryConstraintMsmGate, p as registerEntrySkillSection, r as ensureWorkspacePromptSection, s as trajectoryConstraintParticipates, t as createTrajectoryAgent, u as workspaceCognitiveTrajectoryLine, v as readAdvancedSettings, w as REFERENCE_DIR, x as MECHANISM_PORTS, y as toWire } from "./session-CVLuxABj.js";
10
- import { d as readLastBound, f as resolveSessionCognitiveTrajectoryLabel, i as toMessage, l as findTrajectoryOfSession, n as deliver, o as PLUGIN_SOURCE, r as makeInjection, s as appendBound, u as listBoundSessionIds } from "./injection-DGN8AyPT.js";
11
- import { c as withRouteDisposal, d as CARRIER_OPENING_MARK, f as WAKE_CATCH_UP_MS, i as sendToCognitiveTrajectory, l as buildCroSnapshot, n as registerWakeScheduler, o as registerCroTurnTracking, p as addWake, s as registerDisposer, t as createAndBindTarget } from "./scheduler-DeRr-7uf.js";
12
- import { i as hostAliveProbe, n as readSimpleSettings, r as registerSettingsSection } from "./settings-e3pTbQ4_.js";
13
- import { a as ACK_PREFIX, c as eventToken, i as resolveSessionMdPath, l as DEFAULT_FAKE_INITIAL_MESSAGES, o as ASSISTANT_PREFIX, r as registerRebuildTurnHook, s as LOG_FILE_REL, t as buildRebuildAnchor, u as registerBootstrap } from "./rebuild-DRVxdLeL.js";
14
- import { i as subscriptionStats, n as registerTrajectorySubscriptions, r as subscriptionEval, t as defaultSubscriptionDeps } from "./subscriptions-CsHUgUeY.js";
6
+ import { C as findPackageRoot, S as ACC_VERSION, _ as constraintCognitiveTrajectory, d as imChannelIds, f as isImWiredTrajectory, h as TRAJECTORY_CONSTRAINT_HINT, i as forgetNonCccToolVisibility, l as syncToolVisibility, m as runImBridge, p as registerImChannel, s as registerGuards, u as forgetToolVisibility, v as constraintSystemPromptSource, x as resolveConstraintSystemPrompt } from "./guards-BuIUwt2B.js";
7
+ import { a as setSafeMode, c as ACC_CATALOG, d as findEntry, f as loadMsmEntries, g as setWeixinSendEndpoint, h as docsPointer, i as readDshVersion, l as CCC_CONFIG_REFERENCE, m as runMsmAsync, n as summarizeHostContract, o as listOpencodeSkillDirs, p as runMsm, r as getStatus, s as loadOpencodeSkill, t as hostContractReport } from "./contract-BDRflYbM.js";
8
+ import { c as replacesDefaultIdentity, i as listTrajectoryConstraints, l as trajectoryCodeForSession, n as findDirNameByCode, o as readTrajectoryConstraintAt, r as isTrajectoryConstrained, s as readTrajectoryConstraintByCode, t as TRAJECTORY_CONSTRAINT_FILENAME } from "./profile-Vw1zbdts.js";
9
+ import { A as TRAJECTORY_PROMPT_FILENAME, C as recordToolUsage, D as buildResourceNameSuffix, E as buildResourceIndex, O as isSafeSkillName, S as verifyTotpCode, T as SKILL_ONTOLOGY_FILE, _ as projectKnownWorkspaces, a as trajectoryConstraintFor, b as FACE_PORTS, c as trajectoryWorkspaceMdPath, d as splitModel, f as registerCognitiveTrajectorySkillSection, g as migrateLegacyLocalstore, h as applyWirePatch, i as getTrajectoryAgent, j as hasTrajectoryPrompt, k as truncateContent, l as unregisterTrajectorySession, m as registerEntrySkillSectionGlobal, n as deliverToTrajectory, o as trajectoryConstraintMsmGate, p as registerEntrySkillSection, r as ensureWorkspacePromptSection, s as trajectoryConstraintParticipates, t as createTrajectoryAgent, u as workspaceCognitiveTrajectoryLine, v as readAdvancedSettings, w as REFERENCE_DIR, x as MECHANISM_PORTS, y as toWire } from "./session-COWVxBrx.js";
10
+ import { d as readLastBound, f as resolveSessionCognitiveTrajectoryLabel, i as toMessage, l as findTrajectoryOfSession, n as deliver, o as PLUGIN_SOURCE, r as makeInjection, s as appendBound, u as listBoundSessionIds } from "./injection-D74-pSfA.js";
11
+ import { c as withRouteDisposal, d as CARRIER_OPENING_MARK, f as WAKE_CATCH_UP_MS, i as sendToCognitiveTrajectory, l as buildCroSnapshot, n as registerWakeScheduler, o as registerCroTurnTracking, p as addWake, s as registerDisposer, t as createAndBindTarget } from "./scheduler-Bdc2UY9V.js";
12
+ import { i as hostAliveProbe, n as readSimpleSettings, r as registerSettingsSection } from "./settings-DhMcTgYN.js";
13
+ import { a as ACK_PREFIX, c as eventToken, i as resolveSessionMdPath, l as DEFAULT_FAKE_INITIAL_MESSAGES, o as ASSISTANT_PREFIX, r as registerRebuildTurnHook, s as LOG_FILE_REL, t as buildRebuildAnchor, u as registerBootstrap } from "./rebuild-D61iR-K7.js";
14
+ import { i as subscriptionStats, n as registerTrajectorySubscriptions, r as subscriptionEval, t as defaultSubscriptionDeps } from "./subscriptions-CB_eC37Q.js";
15
15
  import { c as sendTextMessage, i as getUpdates, l as sendTyping, n as downloadMedia, o as markdownToPlainText, r as getConfig, s as sendFileMessage, t as TypingStatus, u as sniffImageExt } from "./ilink-CsZ-f64q.js";
16
16
  import { a as registerImAccountImpl, i as normalizeAccountChannel, n as getImAccountImpl, r as imAccountChannels } from "./accounts-BHQbakUh.js";
17
17
  import { createRequire } from "node:module";
@@ -512,7 +512,7 @@ const KIT_ACTIONS = [
512
512
  async function runKit(root, args, hostCtx) {
513
513
  switch (args.action) {
514
514
  case "health": {
515
- const { containerStatus } = await import("./observation-D1llub54.js");
515
+ const { containerStatus } = await import("./observation-CZc2zerb.js");
516
516
  const s = containerStatus({
517
517
  root,
518
518
  hostCtx
@@ -558,7 +558,7 @@ async function runKit(root, args, hostCtx) {
558
558
  }
559
559
  case "diag": {
560
560
  if (hostCtx === void 0) throw new Error("diag requires the plugin context (live session data unavailable without it)");
561
- const { runDiag, renderDiag } = await import("./service-BVPfj2rn.js");
561
+ const { runDiag, renderDiag } = await import("./service-BXb4EQpw.js");
562
562
  return renderDiag(await runDiag(hostCtx, root ?? ""));
563
563
  }
564
564
  default: throw new Error(`Unknown action: ${args.action}`);
@@ -6417,7 +6417,7 @@ function renameDshSessionOnUse(deps, session, titles, active, summary) {
6417
6417
  const title = namingTitleFor(active, summary);
6418
6418
  const prefix = namingTitleFor(active);
6419
6419
  const read = readCurrentTitle(titles, session);
6420
- if (read.state === "ok" && shouldKeepUserTitle(read.title, prefix)) return {
6420
+ if (read.state === "ok" && shouldKeepUserTitle(read.title, prefix, read.sourceKind)) return {
6421
6421
  ok: true,
6422
6422
  title: read.title ?? "",
6423
6423
  kept: true
@@ -6706,7 +6706,7 @@ function createCognitiveTrajectoryTool(ctx) {
6706
6706
  } catch {}
6707
6707
  }
6708
6708
  }
6709
- const { queueRebuild } = await import("./rebuild-DRVxdLeL.js").then((n) => n.n);
6709
+ const { queueRebuild } = await import("./rebuild-D61iR-K7.js").then((n) => n.n);
6710
6710
  const result = await queueRebuild(ctx, {
6711
6711
  root,
6712
6712
  note: args.note,
@@ -9982,7 +9982,7 @@ function registerStatusApi(ctx, opts = {}) {
9982
9982
  });
9983
9983
  }
9984
9984
  const { saveWeixinRoutes } = await import("./route-BGKbuE3M.js").then((n) => n.l);
9985
- const { findDirNameByCode } = await import("./profile-B6H_mm98.js").then((n) => n.a);
9985
+ const { findDirNameByCode } = await import("./profile-Vw1zbdts.js").then((n) => n.a);
9986
9986
  for (const r of routes) if (findDirNameByCode(root, r.trajectory) === null) {
9987
9987
  sendJson$2(res, 400, { error: `unknown trajectory: ${r.trajectory} (no such trajectory code in ${root})` });
9988
9988
  return;
@@ -14346,7 +14346,7 @@ const MEDIA_MAX_BYTES = 20971520;
14346
14346
  */
14347
14347
  async function resolveCccRootByAlias(ctx, alias) {
14348
14348
  try {
14349
- const { listCccs } = await import("./ccc-roots-bcRvqzqJ.js").then((n) => n.a);
14349
+ const { listCccs } = await import("./ccc-roots-BiScEed8.js").then((n) => n.a);
14350
14350
  const entries = await listCccs(ctx);
14351
14351
  const byName = entries.find((e) => e.name === alias);
14352
14352
  if (byName) return byName.root;
@@ -14414,7 +14414,7 @@ async function resolveInboundTarget(ctx, input) {
14414
14414
  });
14415
14415
  return null;
14416
14416
  }
14417
- const { findDirNameByCode } = await import("./profile-B6H_mm98.js").then((n) => n.a);
14417
+ const { findDirNameByCode } = await import("./profile-Vw1zbdts.js").then((n) => n.a);
14418
14418
  if (findDirNameByCode(root, target.role) === null) {
14419
14419
  const detail = `目标 CCC "${target.ccc}" 内没有编码为 "${target.role}" 的认知轨迹`;
14420
14420
  console.error(`[serenity-hooks] ✗ human-channel: ${detail}(account=${input.account} user=${input.user})—— 该消息**未投递**,请改订阅表里的目标编码`);
@@ -15424,7 +15424,7 @@ function syncHumanChannel(ctx) {
15424
15424
  (async () => {
15425
15425
  try {
15426
15426
  stopMachineLoops();
15427
- const { listCccs } = await import("./ccc-roots-bcRvqzqJ.js").then((n) => n.a);
15427
+ const { listCccs } = await import("./ccc-roots-BiScEed8.js").then((n) => n.a);
15428
15428
  for (const entry of await listCccs(ctx)) syncCccBridge(ctx, entry.root);
15429
15429
  } catch {}
15430
15430
  })();
@@ -15717,7 +15717,7 @@ function matchCcc(input, candidates) {
15717
15717
  }
15718
15718
  /** 组装候选列表(`ccc-roots.listCccs` 投影 + `.serenity` 名;动态 import 保持本模块静态依赖轻量) */
15719
15719
  async function collectCandidates(ctx) {
15720
- const { listCccs } = await import("./ccc-roots-bcRvqzqJ.js").then((n) => n.a);
15720
+ const { listCccs } = await import("./ccc-roots-BiScEed8.js").then((n) => n.a);
15721
15721
  const entries = await listCccs(ctx, { defaultRoot: process.cwd() });
15722
15722
  const seen = /* @__PURE__ */ new Set();
15723
15723
  const out = [];
@@ -1,5 +1,5 @@
1
- import { r as cccRootForCwd } from "./ccc-roots-bcRvqzqJ.js";
2
- import { E as sessionsRoot, T as sessionEvents, a as readBindDeclaration, b as parseTrajectoryCode, h as getLastActiveSessionInfo, i as listBindDeclarations, m as getActiveSessionInfo, n as findTrajectoryHolding, r as isBindUsable, t as claimBinding } from "./bind-file-BU-qo8W4.js";
1
+ import { r as cccRootForCwd } from "./ccc-roots-BiScEed8.js";
2
+ import { E as sessionsRoot, T as sessionEvents, a as readBindDeclaration, b as parseTrajectoryCode, h as getLastActiveSessionInfo, i as listBindDeclarations, m as getActiveSessionInfo, n as findTrajectoryHolding, r as isBindUsable, t as claimBinding } from "./bind-file-C2VRuwAQ.js";
3
3
  import { join } from "node:path";
4
4
  import { createUserMessage } from "@deepseek-ai/dsh-llm";
5
5
  //#region src/trajectory/bound.ts
@@ -1,7 +1,7 @@
1
1
  import { d as readCccName, i as findGitRoot, l as pathInside, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS } from "./ccc-DSMqTrRU.js";
2
- import { S as ACC_VERSION } from "./guards-BNaxez2a.js";
3
- import { i as readDshVersion, t as hostContractReport, u as checkRegistryQuality } from "./contract-Cj2msyTr.js";
4
- import { a as wakeSchedulerState, m as listWakes } from "./scheduler-DeRr-7uf.js";
2
+ import { S as ACC_VERSION } from "./guards-BuIUwt2B.js";
3
+ import { i as readDshVersion, t as hostContractReport, u as checkRegistryQuality } from "./contract-BDRflYbM.js";
4
+ import { a as wakeSchedulerState, m as listWakes } from "./scheduler-Bdc2UY9V.js";
5
5
  import { resolve } from "node:path";
6
6
  import { existsSync, readFileSync, statSync } from "node:fs";
7
7
  //#region src/surface/observation.ts
@@ -1,6 +1,6 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.js";
2
2
  import { g as resolveInside, h as readUtf8 } from "./ccc-DSMqTrRU.js";
3
- import { E as sessionsRoot, F as findTrajectoryFile, N as TRAJECTORY_FILENAME, b as parseTrajectoryCode, i as listBindDeclarations } from "./bind-file-BU-qo8W4.js";
3
+ import { E as sessionsRoot, F as findTrajectoryFile, N as TRAJECTORY_FILENAME, b as parseTrajectoryCode, i as listBindDeclarations } from "./bind-file-C2VRuwAQ.js";
4
4
  import { join } from "node:path";
5
5
  import { readdirSync } from "node:fs";
6
6
  //#region src/trajectory/policy/window.ts
@@ -1,9 +1,9 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.js";
2
- import { n as agentCwdFor, r as cccRootForCwd, u as hostService } from "./ccc-roots-bcRvqzqJ.js";
3
- import { L as isoLocal, O as shouldKeepUserTitle, S as readCurrentTitle, T as sessionEvents, b as parseTrajectoryCode, f as extractSessionMdPathFromText, m as getActiveSessionInfo, v as namingTitleFor, y as parseSessionContextFromEvents } from "./bind-file-BU-qo8W4.js";
4
- import { c as replacesDefaultIdentity } from "./profile-B6H_mm98.js";
5
- import { a as trajectoryConstraintFor } from "./session-CVLuxABj.js";
6
- import { a as ACC_MESSAGE_KIND, d as readLastBound, n as deliver, r as makeInjection, s as appendBound } from "./injection-DGN8AyPT.js";
2
+ import { n as agentCwdFor, r as cccRootForCwd, u as hostService } from "./ccc-roots-BiScEed8.js";
3
+ import { L as isoLocal, O as shouldKeepUserTitle, S as readCurrentTitle, T as sessionEvents, b as parseTrajectoryCode, f as extractSessionMdPathFromText, m as getActiveSessionInfo, v as namingTitleFor, y as parseSessionContextFromEvents } from "./bind-file-C2VRuwAQ.js";
4
+ import { c as replacesDefaultIdentity } from "./profile-Vw1zbdts.js";
5
+ import { a as trajectoryConstraintFor } from "./session-COWVxBrx.js";
6
+ import { a as ACC_MESSAGE_KIND, d as readLastBound, n as deliver, r as makeInjection, s as appendBound } from "./injection-D74-pSfA.js";
7
7
  import { basename, dirname, join, resolve } from "node:path";
8
8
  import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, writeFileSync } from "node:fs";
9
9
  import { deriveEventMessage } from "@deepseek-ai/dsh-session";
@@ -1104,7 +1104,7 @@ function renameAfterRebuild(ctx, agent, pending) {
1104
1104
  }
1105
1105
  const prefix = namingTitleFor(info);
1106
1106
  const read = readCurrentTitle(titles, agent.session);
1107
- if (read.state === "ok" && shouldKeepUserTitle(read.title, prefix)) {
1107
+ if (read.state === "ok" && shouldKeepUserTitle(read.title, prefix, read.sourceKind)) {
1108
1108
  console.log(`[serenity-hooks] rebuild 后保留用户自定义标题,不覆盖: ${read.title ?? ""}`);
1109
1109
  return;
1110
1110
  }
@@ -1,10 +1,10 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.js";
2
- import { c as hostAgents, o as listCccs, u as hostService } from "./ccc-roots-bcRvqzqJ.js";
2
+ import { c as hostAgents, o as listCccs, u as hostService } from "./ccc-roots-BiScEed8.js";
3
3
  import { g as resolveInside } from "./ccc-DSMqTrRU.js";
4
- import { B as localIdStamp, E as sessionsRoot, I as readTrajectoryFile, L as isoLocal, N as TRAJECTORY_FILENAME, O as shouldKeepUserTitle, S as readCurrentTitle, b as parseTrajectoryCode, j as trajectoryDescOf, p as findSession, v as namingTitleFor, z as localHuman } from "./bind-file-BU-qo8W4.js";
5
- import { c as carrierState, i as toMessage, n as deliver, r as makeInjection, s as appendBound, t as assertInjection, u as listBoundSessionIds } from "./injection-DGN8AyPT.js";
4
+ import { B as localIdStamp, E as sessionsRoot, I as readTrajectoryFile, L as isoLocal, N as TRAJECTORY_FILENAME, O as shouldKeepUserTitle, S as readCurrentTitle, b as parseTrajectoryCode, j as trajectoryDescOf, p as findSession, v as namingTitleFor, z as localHuman } from "./bind-file-C2VRuwAQ.js";
5
+ import { c as carrierState, i as toMessage, n as deliver, r as makeInjection, s as appendBound, t as assertInjection, u as listBoundSessionIds } from "./injection-D74-pSfA.js";
6
6
  import { i as sessionsRootDir, n as findSessionLog } from "./cleanup-CPl1SSaK.js";
7
- import { i as hostAliveProbe, n as readSimpleSettings } from "./settings-e3pTbQ4_.js";
7
+ import { i as hostAliveProbe, n as readSimpleSettings } from "./settings-DhMcTgYN.js";
8
8
  import { basename, dirname, join } from "node:path";
9
9
  import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
10
10
  import { spawn } from "node:child_process";
@@ -3284,7 +3284,7 @@ function renameCarrierTitle(ctx, agent, root, dirName) {
3284
3284
  };
3285
3285
  const prefix = namingTitleFor(info);
3286
3286
  const read = readCurrentTitle(titles, session);
3287
- if (read.state === "ok" && shouldKeepUserTitle(read.title, prefix)) return ", 保留用户标题";
3287
+ if (read.state === "ok" && shouldKeepUserTitle(read.title, prefix, read.sourceKind)) return ", 保留用户标题";
3288
3288
  titles.rename(session, namingTitleFor(info));
3289
3289
  return ", titled";
3290
3290
  } catch (err) {
@@ -1,10 +1,10 @@
1
- import { d as hostSessions, r as cccRootForCwd } from "./ccc-roots-bcRvqzqJ.js";
1
+ import { d as hostSessions, r as cccRootForCwd } from "./ccc-roots-BiScEed8.js";
2
2
  import { p as readTrajectorySubscriptions } from "./ccc-DSMqTrRU.js";
3
- import { L as isoLocal, T as sessionEvents } from "./bind-file-BU-qo8W4.js";
4
- import { f as WAKE_CATCH_UP_MS, u as listCroCognitiveTrajectories } from "./scheduler-DeRr-7uf.js";
5
- import { n as readSimpleSettings } from "./settings-e3pTbQ4_.js";
6
- import { i as subscriptionStats, r as subscriptionEval } from "./subscriptions-CsHUgUeY.js";
7
- import { containerClocks, containerWakes } from "./observation-D1llub54.js";
3
+ import { L as isoLocal, T as sessionEvents } from "./bind-file-C2VRuwAQ.js";
4
+ import { f as WAKE_CATCH_UP_MS, u as listCroCognitiveTrajectories } from "./scheduler-Bdc2UY9V.js";
5
+ import { n as readSimpleSettings } from "./settings-DhMcTgYN.js";
6
+ import { i as subscriptionStats, r as subscriptionEval } from "./subscriptions-CB_eC37Q.js";
7
+ import { containerClocks, containerWakes } from "./observation-CZc2zerb.js";
8
8
  //#region src/trajectory/live.ts
9
9
  /**
10
10
  * trajectory/live.ts — 进程内 live 会话取数 + 精简诊断
@@ -1,10 +1,10 @@
1
- import { c as hostAgents, n as agentCwdFor, r as cccRootForCwd, s as hostAgentDefaultModel } from "./ccc-roots-bcRvqzqJ.js";
1
+ import { c as hostAgents, n as agentCwdFor, r as cccRootForCwd, s as hostAgentDefaultModel } from "./ccc-roots-BiScEed8.js";
2
2
  import { f as readCognitiveTrajectorySkills, h as readUtf8, o as isSafeModeOn, u as readBlacklist } from "./ccc-DSMqTrRU.js";
3
- import { E as sessionsRoot, L as isoLocal, s as DEFAULT_SESSION_SCOPE, x as readActiveSessionMd } from "./bind-file-BU-qo8W4.js";
3
+ import { E as sessionsRoot, L as isoLocal, s as DEFAULT_SESSION_SCOPE, x as readActiveSessionMd } from "./bind-file-C2VRuwAQ.js";
4
4
  import { g as readGitTrack, h as localstorePath } from "./route-BGKbuE3M.js";
5
- import { S as ACC_VERSION, _ as constraintCognitiveTrajectory, b as profileMsmWhitelist, c as shellToolNameFor, g as buildTrajectoryBasePrompt, y as createProfilePromptReader } from "./guards-BNaxez2a.js";
6
- import { d as registerTrajectorySession$1, f as trajectoryDirNameForSession, o as readTrajectoryConstraintAt, p as unregisterTrajectorySession$1, u as trajectoryConstraintForSession } from "./profile-B6H_mm98.js";
7
- import { d as readLastBound, i as toMessage, r as makeInjection } from "./injection-DGN8AyPT.js";
5
+ import { S as ACC_VERSION, _ as constraintCognitiveTrajectory, b as profileMsmWhitelist, c as shellToolNameFor, g as buildTrajectoryBasePrompt, y as createProfilePromptReader } from "./guards-BuIUwt2B.js";
6
+ import { d as registerTrajectorySession$1, f as trajectoryDirNameForSession, o as readTrajectoryConstraintAt, p as unregisterTrajectorySession$1, u as trajectoryConstraintForSession } from "./profile-Vw1zbdts.js";
7
+ import { d as readLastBound, i as toMessage, r as makeInjection } from "./injection-D74-pSfA.js";
8
8
  import { basename, dirname, join, resolve } from "node:path";
9
9
  import { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, writeFileSync } from "node:fs";
10
10
  import { createHmac, randomBytes, randomUUID, scryptSync } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import { c as hostAgents, f as hostSettings, u as hostService } from "./ccc-roots-bcRvqzqJ.js";
1
+ import { c as hostAgents, f as hostSettings, u as hostService } from "./ccc-roots-BiScEed8.js";
2
2
  import { i as sessionsRootDir, r as hasSessionLogById } from "./cleanup-CPl1SSaK.js";
3
3
  //#region src/trajectory/alive.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
- import { r as cccRootForCwd } from "./ccc-roots-bcRvqzqJ.js";
1
+ import { r as cccRootForCwd } from "./ccc-roots-BiScEed8.js";
2
2
  import { p as readTrajectorySubscriptions } from "./ccc-DSMqTrRU.js";
3
- import { n as findTrajectoryHolding, z as localHuman } from "./bind-file-BU-qo8W4.js";
4
- import { s as registerDisposer } from "./scheduler-DeRr-7uf.js";
3
+ import { n as findTrajectoryHolding, z as localHuman } from "./bind-file-C2VRuwAQ.js";
4
+ import { s as registerDisposer } from "./scheduler-Bdc2UY9V.js";
5
5
  //#region src/trajectory/subscriptions.ts
6
6
  /**
7
7
  * trajectory/subscriptions.ts — 轨迹消息订阅(v1.107.0,owner 2026-11-01 令)
@@ -306,7 +306,7 @@ function defaultSubscriptionDeps(ctx) {
306
306
  readSubs: (root) => readTrajectorySubscriptions(root),
307
307
  dirForSession: (root, sessionId) => findTrajectoryHolding(`${root}/AGENT_SESSIONS`, sessionId),
308
308
  deliver: async (root, target, message) => {
309
- const { sendToCognitiveTrajectory } = await import("./scheduler-DeRr-7uf.js").then((n) => n.r);
309
+ const { sendToCognitiveTrajectory } = await import("./scheduler-Bdc2UY9V.js").then((n) => n.r);
310
310
  const res = await sendToCognitiveTrajectory(ctx, root, target, message, "trajectory-subscription");
311
311
  return {
312
312
  ok: res.ok,
@@ -63,6 +63,7 @@ export declare function renameDshSessionOnUse(deps: RenameOnUseDeps, session: un
63
63
  rename: (session: unknown, title: string) => unknown;
64
64
  get?: (session: unknown) => {
65
65
  title?: unknown;
66
+ source?: unknown;
66
67
  } | undefined;
67
68
  } | undefined, active: ActiveSessionInfo, summary?: string): {
68
69
  ok: true;
@@ -341,7 +341,7 @@ export declare function namingTitleFor(active: ActiveSessionInfo, summary?: stri
341
341
  * @param expectedPrefix 我们这一轮本该生成的标题前缀(`namingTitleFor` 去掉概括部分)
342
342
  * @returns true = 跳过重命名(保留用户的名字);false = 可以写
343
343
  */
344
- export declare function shouldKeepUserTitle(currentTitle: string | undefined, expectedPrefix: string): boolean;
344
+ export declare function shouldKeepUserTitle(currentTitle: string | undefined, expectedPrefix: string, sourceKind?: string): boolean;
345
345
  /**
346
346
  * 读会话当前标题;**读口本身缺失时返回 `null`**(= 结构上无法判断,与"读到空标题"分开)。
347
347
  *
@@ -354,12 +354,14 @@ export declare function shouldKeepUserTitle(currentTitle: string | undefined, ex
354
354
  export declare function readCurrentTitle(titles: {
355
355
  get?: (session: unknown) => {
356
356
  title?: unknown;
357
+ source?: unknown;
357
358
  } | undefined;
358
359
  } | undefined, session: unknown): {
359
360
  state: 'unreadable';
360
361
  } | {
361
362
  state: 'ok';
362
363
  title: string | undefined;
364
+ sourceKind?: string;
363
365
  };
364
366
  export declare function getActiveSessionInfo(scope: string): ActiveSessionInfo | null;
365
367
  export declare function getLastActiveSessionInfo(): ActiveSessionInfo | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shgroup/dsh-serenity-hooks",
3
- "version": "1.139.4",
3
+ "version": "1.139.5",
4
4
  "description": "宁静号 ACC harness(Native Cordis 插件)——给 DeepSeek Harness 装一个「AI 工作区」:13 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/localstore/container_admin/browser_slot;另两个 im-bridge/diagram 按条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫/对外输出守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表 + 浏览器槽位管理(≤20 个独立 profile 的 Chrome 槽位,带占用归属与异常时向所属会话反向注入提醒)。轨迹声明 = 轨迹目录下的 trajectory.json(约束面 + 旧标识 uid + CRO 机器绑定 cro.host;旧名 trajectory-constraint.json / skiff.json 仍在读取族里);轨迹提示词 = 轨迹目录下的 PROMPT.md(一条轨迹「是谁、按什么章程工作」,所有轨迹通用,追加在容器层与质量层之后,不替换它们)。适配 DSH 0.1.7-rc.1 / 0.2.0-rc.1 / 0.2.1-rc.1(三档)。",
5
5
  "license": "MIT",
6
6
  "repository": {