@wowyuarm/dsh-agent-team 0.1.14 → 0.2.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.
Files changed (102) hide show
  1. package/README.md +8 -4
  2. package/README.zh.md +8 -4
  3. package/cordis.patch.yml +187 -2
  4. package/package.json +52 -51
  5. package/packages/agent-team/README.md +1 -1
  6. package/packages/agent-team/README.zh.md +1 -1
  7. package/packages/agent-team/lib/context-continuity-host.js +2 -3
  8. package/packages/agent-team/lib/context-projection.js +3 -3
  9. package/packages/agent-team/lib/context-source.js +39 -13
  10. package/packages/agent-team/lib/environment-check.js +102 -0
  11. package/packages/agent-team/lib/human-profile.js +110 -13
  12. package/packages/agent-team/lib/index.js +192 -100
  13. package/packages/agent-team/lib/installed-manifest.js +32 -0
  14. package/packages/agent-team/lib/ledger.js +35 -0
  15. package/packages/agent-team/lib/member-context.js +3 -3
  16. package/packages/agent-team/lib/member-time-context.js +3 -2
  17. package/packages/agent-team/lib/pressure-policy.js +18 -11
  18. package/packages/agent-team/lib/stored-session-reader.js +1 -2
  19. package/packages/agent-team/lib/typert.host.js +479 -260
  20. package/packages/agent-team/lib/typert.remote-client.d.ts +8 -3
  21. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  22. package/packages/agent-team/lib/typert.remote-client.js +375 -228
  23. package/packages/agent-team/lib/types/context-continuity-host.d.ts.map +1 -1
  24. package/packages/agent-team/lib/types/context-source.d.ts +49 -13
  25. package/packages/agent-team/lib/types/context-source.d.ts.map +1 -1
  26. package/packages/agent-team/lib/types/environment-check.d.ts +66 -0
  27. package/packages/agent-team/lib/types/environment-check.d.ts.map +1 -0
  28. package/packages/agent-team/lib/types/human-profile.d.ts +87 -21
  29. package/packages/agent-team/lib/types/human-profile.d.ts.map +1 -1
  30. package/packages/agent-team/lib/types/index.d.ts +85 -26
  31. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  32. package/packages/agent-team/lib/types/installed-manifest.d.ts +16 -0
  33. package/packages/agent-team/lib/types/installed-manifest.d.ts.map +1 -0
  34. package/packages/agent-team/lib/types/ledger.d.ts +12 -0
  35. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  36. package/packages/agent-team/lib/types/member-context.d.ts +14 -0
  37. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  38. package/packages/agent-team/lib/types/member-time-context.d.ts +15 -0
  39. package/packages/agent-team/lib/types/member-time-context.d.ts.map +1 -1
  40. package/packages/agent-team/lib/types/pressure-policy.d.ts +5 -1
  41. package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -1
  42. package/packages/agent-team/lib/types/stored-session-reader.d.ts +1 -2
  43. package/packages/agent-team/lib/types/stored-session-reader.d.ts.map +1 -1
  44. package/packages/agent-team/lib/types/types/entities.d.ts +1 -8
  45. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  46. package/packages/agent-team/lib/types/types/requests-results.d.ts +84 -0
  47. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  48. package/packages/client-agent-team/README.md +1 -1
  49. package/packages/client-agent-team/README.zh.md +1 -1
  50. package/packages/client-agent-team/lib/client.js +615 -275
  51. package/packages/client-agent-team/lib/client.js.map +1 -1
  52. package/packages/client-agent-team/lib/types/client/EnvironmentCheck.d.ts +18 -0
  53. package/packages/client-agent-team/lib/types/client/EnvironmentCheck.d.ts.map +1 -0
  54. package/packages/client-agent-team/lib/types/client/EnvironmentCheck.js +58 -0
  55. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts +3 -0
  56. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts.map +1 -1
  57. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.js +7 -4
  58. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +6 -11
  59. package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +3 -3
  60. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.js +4 -4
  61. package/packages/client-agent-team/lib/types/client/TeamComposer.js +3 -3
  62. package/packages/client-agent-team/lib/types/client/TeamFooterAction.js +2 -2
  63. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.js +3 -3
  64. package/packages/client-agent-team/lib/types/client/TeamMembersAction.js +2 -2
  65. package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -1
  66. package/packages/client-agent-team/lib/types/client/TeamMessage.js +1 -1
  67. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts +1 -1
  68. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts.map +1 -1
  69. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.js +2 -7
  70. package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts.map +1 -1
  71. package/packages/client-agent-team/lib/types/client/TeamRowMenu.js +2 -2
  72. package/packages/client-agent-team/lib/types/client/TeamSidebarSection.js +2 -2
  73. package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +3 -3
  74. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +3 -3
  75. package/packages/client-agent-team/lib/types/client/TeamWorkspaceSelector.js +2 -2
  76. package/packages/client-agent-team/lib/types/client/environment-check.d.ts +65 -0
  77. package/packages/client-agent-team/lib/types/client/environment-check.d.ts.map +1 -0
  78. package/packages/client-agent-team/lib/types/client/environment-check.js +78 -0
  79. package/packages/client-agent-team/lib/types/client/human-identity.d.ts +4 -8
  80. package/packages/client-agent-team/lib/types/client/human-identity.d.ts.map +1 -1
  81. package/packages/client-agent-team/lib/types/client/human-identity.js +0 -21
  82. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  83. package/packages/client-agent-team/lib/types/client/index.js +59 -49
  84. package/packages/client-agent-team/lib/types/client/locales.d.ts +18 -8
  85. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  86. package/packages/client-agent-team/lib/types/client/locales.js +21 -8
  87. package/packages/client-agent-team/lib/types/client/multi-menu-field.js +2 -2
  88. package/packages/client-agent-team/lib/types/client/slots.d.ts +1 -1
  89. package/packages/tool-agent-team/README.md +1 -1
  90. package/packages/tool-agent-team/README.zh.md +1 -1
  91. package/packages/tool-agent-team/lib/context-tools.js +106 -94
  92. package/packages/tool-agent-team/lib/index.js +17 -2
  93. package/packages/tool-agent-team/lib/types/context-tools.d.ts +16 -7
  94. package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -1
  95. package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
  96. package/packages/agent-team/lib/preset-roster.js +0 -15
  97. package/packages/agent-team/lib/session-remediation.js +0 -493
  98. package/packages/agent-team/lib/types/preset-roster.d.ts +0 -5
  99. package/packages/agent-team/lib/types/preset-roster.d.ts.map +0 -1
  100. package/packages/agent-team/lib/types/session-remediation.d.ts +0 -172
  101. package/packages/agent-team/lib/types/session-remediation.d.ts.map +0 -1
  102. package/packages/agent-team/preset/team-member/agent.cordis.yml +0 -166
@@ -27,6 +27,7 @@
27
27
  * @module @wowyuarm/dsh-agent-team/member-time-context
28
28
  */
29
29
  import { createUserMessage } from '@deepseek-ai/dsh-llm';
30
+ import { matchesProducerKind } from "./context-source.js";
30
31
  import { formatTeamDuration, formatTeamTimestamp } from "./time-format.js";
31
32
  import { advanceOwnedSessionEventCursor } from "./session-event-cursor.js";
32
33
  export const name = 'wowyuarm-agent-team-member-time-context';
@@ -49,7 +50,7 @@ export function applyClockEvent(state, event) {
49
50
  return state.openTurn === -1 ? state : { ...state, lastTurnInjectionTime: null, openTurn: -1 };
50
51
  case 'user/message': {
51
52
  const source = event.data.source;
52
- const injected = source.kind === 'plugin' && source.plugin === name;
53
+ const injected = matchesProducerKind(source.kind, name);
53
54
  const withMessage = state.lastMessageTime === event.time ? state : { ...state, lastMessageTime: event.time };
54
55
  if (!injected)
55
56
  return withMessage;
@@ -134,7 +135,7 @@ export function apply(ctx, config = {}) {
134
135
  const text = renderClockSnapshot({ now, turn, step, previous });
135
136
  const message = createUserMessage({
136
137
  content: [{ type: 'text', text }],
137
- source: { kind: 'plugin', plugin: name, form: 'snapshot', sections: [{ name, text }] },
138
+ source: { kind: name, form: 'snapshot', sections: [{ name, text }] },
138
139
  });
139
140
  return { kind: 'enter', messages: [...decision.messages, message] };
140
141
  }, { prepend: true });
@@ -16,7 +16,8 @@
16
16
  */
17
17
  import { CONTEXT_WINDOW_EXCEEDED_CODE } from '@deepseek-ai/dsh-llm';
18
18
  import { createUserMessage } from '@deepseek-ai/dsh-llm';
19
- import { AGENT_TEAM_PLUGIN_ID } from "./context-source.js";
19
+ import { contextPressureNoticeText as engineContextPressureNoticeText } from '@wowyuarm/dsh-context-continuity';
20
+ import { AGENT_TEAM_PLUGIN_ID, isAgentTeamSourceKind } from "./context-source.js";
20
21
  import { advanceOwnedSessionEventCursor } from "./session-event-cursor.js";
21
22
  /**
22
23
  * Stable summary of the one-shot rollover pressure notice. It is a durable
@@ -43,20 +44,26 @@ export const PRESSURE_NOTICE_FOLD = {
43
44
  return false;
44
45
  },
45
46
  };
46
- /** One pressure-notice text; concise, structured, and inside the reserve. */
47
+ /**
48
+ * One pressure-notice text. The wording is the engine's — the same sentence a
49
+ * fresh-context handoff is asked for through — so the notice and the rollover
50
+ * tool cannot drift apart; Team supplies only its own labels and input shape.
51
+ */
47
52
  export function contextPressureNoticeText(input) {
48
- const claims = input.activeClaims.length === 0 ? 'none' : input.activeClaims.join(', ');
49
- const jobs = input.runningJobs.length === 0 ? 'none' : `${input.runningJobs.length} running (collect or stop them before switching)`;
50
- return [
51
- `Context pressure: ${input.usageTokens} tokens measured; the handoff budget is ${input.handoffAt} and the hard limit is ${input.hardLimit}.`,
52
- `Active Claims: ${claims}. Owner jobs: ${jobs}.`,
53
- 'Finish the current atomic action, then call context_rollover with a handoff covering your objective, verified facts, and external side effects — a fresh context is the default path. Record anything durable in your private memory/notes first.',
54
- ].join(' ');
53
+ return engineContextPressureNoticeText({
54
+ usageTokens: input.usageTokens,
55
+ handoffAt: input.handoffAt,
56
+ hardLimit: input.hardLimit,
57
+ inHand: input.activeClaims,
58
+ jobs: input.runningJobs,
59
+ }, { inHandLabel: 'Active Claims', jobsLabel: 'Owner jobs' });
55
60
  }
56
61
  /** Whether one user message is this policy's one-shot pressure notice. */
57
62
  function isPressureNotice(message) {
63
+ // The source arrives untyped from the inbox; identity is matched by exact
64
+ // kind — the shape written now and the read-time conversion's V3 rename.
58
65
  const source = message.source;
59
- return source?.plugin === AGENT_TEAM_PLUGIN_ID
66
+ return isAgentTeamSourceKind(source?.kind)
60
67
  && source?.summary === CONTEXT_PRESSURE_NOTICE_SUMMARY;
61
68
  }
62
69
  export class PressurePolicyCoordinator {
@@ -134,7 +141,7 @@ export class PressurePolicyCoordinator {
134
141
  activeClaims: this.options.activeClaimLabels(member.memberId),
135
142
  runningJobs: this.options.runningJobLabels(member.memberId),
136
143
  }) }],
137
- source: { kind: 'plugin', plugin: AGENT_TEAM_PLUGIN_ID, form: 'notice', summary: CONTEXT_PRESSURE_NOTICE_SUMMARY },
144
+ source: { kind: AGENT_TEAM_PLUGIN_ID, form: 'notice', summary: CONTEXT_PRESSURE_NOTICE_SUMMARY },
138
145
  });
139
146
  try {
140
147
  agent.steer(notice);
@@ -8,8 +8,7 @@
8
8
  * format generation, or Harness error message text.
9
9
  *
10
10
  * The reader owns reading and classification only — not Member lifecycle,
11
- * Agent create/resume, UI, ledger, or remediation (which reads raw artifact
12
- * bytes through its own repair path).
11
+ * Agent create/resume, UI, or ledger.
13
12
  *
14
13
  * Classification notes: the shipped JSONL backend throws its
15
14
  * `corrupt session log` family as plain `Error`s, so corruption is detected by