deepseek-harness-humanity 0.9.71 → 0.9.73

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 (107) hide show
  1. package/CHANGELOG.md +1541 -1511
  2. package/lib/agent-scope.js +0 -45
  3. package/lib/client.js +3 -4302
  4. package/lib/clock.js +0 -62
  5. package/lib/config.js +0 -9
  6. package/lib/data-plane.js +0 -46
  7. package/lib/deps.js +0 -54
  8. package/lib/documents.js +0 -35
  9. package/lib/emotion/appraise.js +0 -111
  10. package/lib/emotion/constants.js +0 -271
  11. package/lib/emotion/dynamics.js +0 -82
  12. package/lib/emotion/echo.js +0 -28
  13. package/lib/emotion/index.js +1 -39
  14. package/lib/emotion/inject.js +0 -59
  15. package/lib/emotion/model.js +0 -53
  16. package/lib/emotion/render.js +0 -71
  17. package/lib/emotion/section.js +0 -31
  18. package/lib/emotion/sensitivity.js +0 -103
  19. package/lib/emotion/stance.js +0 -70
  20. package/lib/emotion/state.js +0 -231
  21. package/lib/emotion/store.js +0 -19
  22. package/lib/emotion/view.js +0 -45
  23. package/lib/evolution/capabilities.js +0 -55
  24. package/lib/evolution/constants.js +0 -83
  25. package/lib/evolution/delivery.js +0 -88
  26. package/lib/evolution/diary.js +0 -53
  27. package/lib/evolution/energy.js +0 -109
  28. package/lib/evolution/index.js +0 -731
  29. package/lib/evolution/lifecycle.js +0 -48
  30. package/lib/evolution/room.js +1 -297
  31. package/lib/evolution/section.js +0 -74
  32. package/lib/evolution/settle-plan.js +0 -46
  33. package/lib/evolution/state.js +0 -73
  34. package/lib/evolution/tell.js +0 -56
  35. package/lib/evolution/title.js +0 -35
  36. package/lib/evolution/tool-tell.js +0 -17
  37. package/lib/evolution/wake.js +0 -41
  38. package/lib/exclusion-guard.js +0 -12
  39. package/lib/index.js +0 -156
  40. package/lib/llm.js +0 -41
  41. package/lib/log.js +0 -26
  42. package/lib/memory/consolidate.js +0 -100
  43. package/lib/memory/constants.js +0 -203
  44. package/lib/memory/decay.js +0 -50
  45. package/lib/memory/disclosure.js +0 -20
  46. package/lib/memory/index.js +0 -31
  47. package/lib/memory/inject.js +0 -163
  48. package/lib/memory/model.js +0 -57
  49. package/lib/memory/parse.js +0 -28
  50. package/lib/memory/reaction.js +0 -33
  51. package/lib/memory/render.js +0 -81
  52. package/lib/memory/search.js +0 -88
  53. package/lib/memory/section-doc.js +0 -24
  54. package/lib/memory/section-runtime.js +0 -97
  55. package/lib/memory/section.js +0 -26
  56. package/lib/memory/store.js +0 -2
  57. package/lib/memory/tiers.js +0 -14
  58. package/lib/memory/tools.js +0 -36
  59. package/lib/memory/write.js +4 -90
  60. package/lib/migrate.js +0 -38
  61. package/lib/modules.js +0 -30
  62. package/lib/optional.js +0 -14
  63. package/lib/persona/conflicts.js +0 -53
  64. package/lib/persona/constants.js +0 -140
  65. package/lib/persona/document.js +0 -40
  66. package/lib/persona/drift.js +0 -57
  67. package/lib/persona/grow-queue.js +0 -57
  68. package/lib/persona/grow.js +0 -56
  69. package/lib/persona/history-retention.js +0 -34
  70. package/lib/persona/identity-layer.js +0 -28
  71. package/lib/persona/identity.js +0 -56
  72. package/lib/persona/index.js +1 -42
  73. package/lib/persona/init.js +0 -32
  74. package/lib/persona/migrations.js +0 -57
  75. package/lib/persona/model.js +0 -74
  76. package/lib/persona/normalize.js +0 -65
  77. package/lib/persona/persist.js +0 -26
  78. package/lib/persona/predicates.js +0 -13
  79. package/lib/persona/prompt-render.js +0 -38
  80. package/lib/persona/prompt-texts.js +0 -71
  81. package/lib/persona/prompt.js +0 -50
  82. package/lib/persona/render-character.js +0 -37
  83. package/lib/persona/render-content.js +0 -142
  84. package/lib/persona/render.js +0 -52
  85. package/lib/persona/section.js +0 -39
  86. package/lib/persona/tool-approval.js +0 -28
  87. package/lib/persona/tool-helpers.js +0 -57
  88. package/lib/persona/tool-result.js +0 -29
  89. package/lib/persona/tools.js +0 -54
  90. package/lib/persona/update.js +0 -32
  91. package/lib/persona/upgrade.js +0 -27
  92. package/lib/persona/validate-character.js +0 -45
  93. package/lib/persona/validate-identity.js +1 -48
  94. package/lib/persona/validate-loss.js +0 -23
  95. package/lib/persona/validate-mutable.js +0 -99
  96. package/lib/persona/validate.js +0 -22
  97. package/lib/plane-settings.js +0 -23
  98. package/lib/preset-compat.js +0 -38
  99. package/lib/presets.js +0 -47
  100. package/lib/prompt-filter.js +0 -6
  101. package/lib/settings.js +1 -79
  102. package/lib/store-open.js +1 -134
  103. package/lib/store-schema.js +0 -96
  104. package/lib/store.js +0 -9
  105. package/lib/text.js +0 -106
  106. package/lib/tools-seam.js +0 -7
  107. package/package.json +1 -1
@@ -1,13 +1,4 @@
1
- /**
2
- * 运行时父子标记的候选字段名。
3
- *
4
- * ⚠️ **DSH 0.1.5-rc.2 的 `Agent` 接口上没有这些字段**(父子关系由注册表的
5
- * `enter(agent, owner)` / `isOwnedBy()` 记录,不挂在 agent 对象上)。所以这一层是**前瞻性防御**:
6
- * 将来若在 agent 上暴露了归属字段,这里立刻就能用上。现在它实际不生效——不生效的后果由
7
- * 下面的二级判定兜住。
8
- */
9
1
  const PARENT_MARKERS = ['parent', 'parentAgent', 'owner', 'ownerAgent'];
10
- /** 主体是否自带"我是子代理"的运行时标记。 */
11
2
  function hasRuntimeParent(subject) {
12
3
  for (const key of PARENT_MARKERS) {
13
4
  const value = subject[key];
@@ -16,34 +7,11 @@ function hasRuntimeParent(subject) {
16
7
  }
17
8
  return false;
18
9
  }
19
- /**
20
- * 造一个"是否主 Agent"的判定函数。
21
- *
22
- * ### 三级判定(从强到弱,每级都能安全降级)
23
- *
24
- * 1. 主体自带运行时归属标记 ⇒ 子代理,不注入;
25
- * 2. `ctx.get('agents')` 读得到注册表 ⇒ 用 `roots()` **精确**判定(这是裁决 2 的正解);
26
- * 3. 两级都拿不到(服务未挂载 / 未激活)⇒ **退化为"有 agent 就注入"**,并只警告一次。
27
- * 取舍:这一支会让子代理也拿到内容(多一点 token),但绝不会像"声明 agents 依赖"那样
28
- * 把会话创建弄坏 —— **可用性优先于省 token**。
29
- *
30
- * ### ⛔ 绝不把 `agents` 声明成依赖
31
- *
32
- * 真机事故(2026-09-23):`ctx.inject(['agents', 'systemPrompt'], …)` 会把 `agents` 写进本插件
33
- * fiber 的依赖声明,而会话创建走另一个尚未激活的组合上下文,报
34
- * `cannot get required service "agents" in inactive context` ⇒ **每个会话都创建失败**。
35
- * 需要看注册表时一律用不声明依赖的 `ctx.get('agents')`(读不到就是 undefined,不抛)。
36
- *
37
- * @param ctx - 本插件的上下文。
38
- * @param log - 日志门面。
39
- * @returns 判定函数;同一个判定函数里的退化警告只记一次。
40
- */
41
10
  export function createMainAgentJudge(ctx, log) {
42
11
  let warnedDegraded = false;
43
12
  return (subject) => {
44
13
  if (hasRuntimeParent(subject))
45
14
  return false;
46
- // 只读查找:不声明依赖(读不到就是 undefined,不抛)。
47
15
  const agents = ctx.get('agents');
48
16
  if (agents !== undefined && typeof agents.roots === 'function') {
49
17
  return agents.roots().includes(subject);
@@ -55,25 +23,12 @@ export function createMainAgentJudge(ctx, log) {
55
23
  return true;
56
24
  };
57
25
  }
58
- /** 从系统提示词的装配上下文里取出主体(`assembleContextFor` 会同时给 `agent` 与 `scope`)。 */
59
26
  export function subjectOf(context) {
60
27
  if (context === undefined || context === null)
61
28
  return undefined;
62
29
  const subject = context.agent ?? context.scope;
63
30
  return subject !== null && typeof subject === 'object' ? subject : undefined;
64
31
  }
65
- /**
66
- * 读一个 agent 当前**实际运行**的 preset(同步)。
67
- *
68
- * 优先会话投影 `agentPreset`:它由会话头初始化、并随 `agent-preset/selected` 事件更新 ——
69
- * 真机实证(2026-09-25)会话头 meta 只记创建时的值,GUI 切换后 meta 不更新而投影更新,
70
- * 所以投影才是「此刻跑的是哪个预设」的真源;投影服务缺席时回退 meta(未切换过的会话两者一致)。
71
- *
72
- * 为什么放在这里而不是各自模块内部:净室 guard(拒绝工具)与情绪注入(只在沉浸生效)
73
- * 用的是**同一个事实**,各写一份迟早有一边先漂(与 `createMainAgentJudge` 同一条教训)。
74
- * @param agent - 工具调用 / pre-step 携带的 agent。
75
- * @param ctx - 本插件的上下文(用于现取投影服务)。
76
- */
77
32
  export function presetOfAgent(agent, ctx) {
78
33
  const session = agent?.session;
79
34
  if (session === undefined)