@wowyuarm/dsh-agent-team 0.1.15 → 0.2.1

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 (99) hide show
  1. package/README.md +8 -4
  2. package/README.zh.md +8 -4
  3. package/cordis.patch.yml +26 -12
  4. package/package.json +52 -47
  5. package/packages/agent-team/lib/attachments.js +63 -4
  6. package/packages/agent-team/lib/compaction-engine.js +18 -0
  7. package/packages/agent-team/lib/context-continuity-host.js +198 -4
  8. package/packages/agent-team/lib/context-judge.js +150 -0
  9. package/packages/agent-team/lib/context-source.js +11 -6
  10. package/packages/agent-team/lib/environment-check.js +102 -0
  11. package/packages/agent-team/lib/human-profile.js +23 -37
  12. package/packages/agent-team/lib/index.js +510 -99
  13. package/packages/agent-team/lib/installed-manifest.js +32 -0
  14. package/packages/agent-team/lib/invariant.js +36 -12
  15. package/packages/agent-team/lib/ledger.js +37 -1
  16. package/packages/agent-team/lib/member-context.js +2 -4
  17. package/packages/agent-team/lib/member-runtime.js +2 -1
  18. package/packages/agent-team/lib/member-time-context.js +2 -4
  19. package/packages/agent-team/lib/recovery.js +53 -4
  20. package/packages/agent-team/lib/typert.host.js +225 -54
  21. package/packages/agent-team/lib/typert.remote-client.d.ts +5 -1
  22. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  23. package/packages/agent-team/lib/typert.remote-client.js +127 -39
  24. package/packages/agent-team/lib/types/attachments.d.ts +32 -2
  25. package/packages/agent-team/lib/types/attachments.d.ts.map +1 -1
  26. package/packages/agent-team/lib/types/compaction-engine.d.ts +19 -0
  27. package/packages/agent-team/lib/types/compaction-engine.d.ts.map +1 -0
  28. package/packages/agent-team/lib/types/context-continuity-host.d.ts +131 -4
  29. package/packages/agent-team/lib/types/context-continuity-host.d.ts.map +1 -1
  30. package/packages/agent-team/lib/types/context-judge.d.ts +82 -0
  31. package/packages/agent-team/lib/types/context-judge.d.ts.map +1 -0
  32. package/packages/agent-team/lib/types/context-source.d.ts +7 -4
  33. package/packages/agent-team/lib/types/context-source.d.ts.map +1 -1
  34. package/packages/agent-team/lib/types/environment-check.d.ts +66 -0
  35. package/packages/agent-team/lib/types/environment-check.d.ts.map +1 -0
  36. package/packages/agent-team/lib/types/human-profile.d.ts +21 -27
  37. package/packages/agent-team/lib/types/human-profile.d.ts.map +1 -1
  38. package/packages/agent-team/lib/types/index.d.ts +281 -18
  39. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  40. package/packages/agent-team/lib/types/installed-manifest.d.ts +16 -0
  41. package/packages/agent-team/lib/types/installed-manifest.d.ts.map +1 -0
  42. package/packages/agent-team/lib/types/invariant.d.ts +27 -5
  43. package/packages/agent-team/lib/types/invariant.d.ts.map +1 -1
  44. package/packages/agent-team/lib/types/ledger.d.ts +12 -0
  45. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  46. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  47. package/packages/agent-team/lib/types/member-runtime.d.ts +1 -1
  48. package/packages/agent-team/lib/types/member-runtime.d.ts.map +1 -1
  49. package/packages/agent-team/lib/types/member-time-context.d.ts.map +1 -1
  50. package/packages/agent-team/lib/types/recovery.d.ts +19 -6
  51. package/packages/agent-team/lib/types/recovery.d.ts.map +1 -1
  52. package/packages/agent-team/lib/types/types/entities.d.ts +1 -8
  53. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  54. package/packages/agent-team/lib/types/types/requests-results.d.ts +94 -2
  55. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  56. package/packages/agent-team/lib/types/types.d.ts +9 -0
  57. package/packages/agent-team/lib/types/types.d.ts.map +1 -1
  58. package/packages/client-agent-team/lib/client.js +1264 -383
  59. package/packages/client-agent-team/lib/client.js.map +1 -1
  60. package/packages/client-agent-team/lib/types/client/EnvironmentCheck.d.ts +18 -0
  61. package/packages/client-agent-team/lib/types/client/EnvironmentCheck.d.ts.map +1 -0
  62. package/packages/client-agent-team/lib/types/client/EnvironmentCheck.js +58 -0
  63. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +0 -5
  64. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts +1 -1
  65. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts.map +1 -1
  66. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.js +2 -7
  67. package/packages/client-agent-team/lib/types/client/TeamSettingsSection.d.ts +26 -0
  68. package/packages/client-agent-team/lib/types/client/TeamSettingsSection.d.ts.map +1 -0
  69. package/packages/client-agent-team/lib/types/client/TeamSettingsSection.js +195 -0
  70. package/packages/client-agent-team/lib/types/client/attachment-preview.d.ts +7 -11
  71. package/packages/client-agent-team/lib/types/client/attachment-preview.d.ts.map +1 -1
  72. package/packages/client-agent-team/lib/types/client/attachment-preview.js +13 -3
  73. package/packages/client-agent-team/lib/types/client/context-judge.d.ts +64 -0
  74. package/packages/client-agent-team/lib/types/client/context-judge.d.ts.map +1 -0
  75. package/packages/client-agent-team/lib/types/client/context-judge.js +78 -0
  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/index.d.ts.map +1 -1
  80. package/packages/client-agent-team/lib/types/client/index.js +84 -11
  81. package/packages/client-agent-team/lib/types/client/judge-form.d.ts +99 -0
  82. package/packages/client-agent-team/lib/types/client/judge-form.d.ts.map +1 -0
  83. package/packages/client-agent-team/lib/types/client/judge-form.js +208 -0
  84. package/packages/client-agent-team/lib/types/client/locales.d.ts +70 -14
  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 +76 -14
  87. package/packages/tool-agent-team/README.md +6 -3
  88. package/packages/tool-agent-team/README.zh.md +6 -3
  89. package/packages/tool-agent-team/lib/context-tools.js +148 -164
  90. package/packages/tool-agent-team/lib/index.js +17 -2
  91. package/packages/tool-agent-team/lib/types/context-tools.d.ts +32 -7
  92. package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -1
  93. package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
  94. package/packages/agent-team/lib/pressure-policy.js +0 -230
  95. package/packages/agent-team/lib/types/pressure-policy.d.ts +0 -130
  96. package/packages/agent-team/lib/types/pressure-policy.d.ts.map +0 -1
  97. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts +0 -15
  98. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts.map +0 -1
  99. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.js +0 -115
@@ -6,9 +6,11 @@
6
6
  * Team notices, and how a rollover's durable identity is named).
7
7
  *
8
8
  * The engine owns every mechanic this module does not state: the idle-boundary
9
- * swap, carried input, checkpoint continuations, crash repair. Team owns the
10
- * Member vocabulary and the ledger-backed lifecycle behind
11
- * {@link TeamContextContinuityOptions.executeTransition}.
9
+ * swap, carried input, checkpoint continuations, crash repair, and the
10
+ * context-pressure policy itself. Team owns the Member vocabulary and the
11
+ * ledger-backed lifecycle behind
12
+ * {@link TeamContextContinuityOptions.executeTransition}, and the per-Member
13
+ * readings the pressure policy asks for.
12
14
  *
13
15
  * The projection state this host hands the coordinator is the engine's own
14
16
  * (`ContextProjectionState`), read from the unit `context-projection.ts`
@@ -18,7 +20,8 @@
18
20
  import type { Agent } from '@deepseek-ai/dsh-agent';
19
21
  import type { SessionId } from '@deepseek-ai/dsh-session';
20
22
  import type { UserMessage } from '@deepseek-ai/dsh-llm';
21
- import { ContextContinuityCoordinator, ContextMessageCodec, type ContextContinuityHost, type ContextProjectionState, type ContextSubject, type RolloverIdentity, type TransitionPlan } from '@wowyuarm/dsh-context-continuity';
23
+ import { ContextContinuityCoordinator, ContextMessageCodec, type ContextContinuityHost, type ContextProjectionState, type ContextSubject, type PressureCompaction, type PressureGate, type PressureInHand, type PressureJudgement, type PressureLimits, type PressureLogSpan, type PressurePolicyHost, type PressureRelatedness, type PressureStepDecision, type PressureSurface, type RolloverIdentity, type TransitionPlan } from '@wowyuarm/dsh-context-continuity';
24
+ import z from '@deepseek-ai/schemastery';
22
25
  import type { AgentTeamAgentMember, AgentTeamMemberId } from './types.ts';
23
26
  /**
24
27
  * The one writer of context-continuity messages for Team. Section names are
@@ -81,4 +84,128 @@ export declare class TeamContextContinuityHost implements ContextContinuityHost<
81
84
  }
82
85
  /** Build the engine coordinator over Team's Member lifecycle. */
83
86
  export declare function createTeamContextManagement(options: TeamContextContinuityOptions): ContextContinuityCoordinator<AgentTeamMemberId>;
87
+ /**
88
+ * The long-gap gate as row configuration: every field is optional, so a
89
+ * deployment states only the thresholds it disagrees with and the engine's own
90
+ * default answers the rest. The three answer different questions — how large a
91
+ * context the gate applies to, what counts as a long gap, and how long one
92
+ * judgement may take before the step proceeds without one — and the last is the
93
+ * one that decides whether a configured judge is ever heard, because a judge
94
+ * whose own budget is longer than this deadline never answers in time.
95
+ *
96
+ * All three are volatile, and the engine is what makes that safe: it reads
97
+ * every field at the step it applies to, never at construction, so a Host that
98
+ * keeps one gate object and refreshes its fields in place changes the policy a
99
+ * running generation is judged by. `judgeTimeoutMs` is the field that needs it
100
+ * most — the deadline a judge can answer within is a property of the endpoint,
101
+ * not of the bundle, and a deployment that discovers its endpoint is slow must
102
+ * be able to raise it without editing a patch layer and restarting.
103
+ */
104
+ export declare const TEAM_PRESSURE_GATE_SCHEMA: z<Schemastery.ObjectS<NoInfer<{
105
+ tokens: z<number, number, "volatile">;
106
+ idleMs: z<number, number, "volatile">;
107
+ judgeTimeoutMs: z<number, number, "volatile">;
108
+ }>>, Schemastery.ObjectT<NoInfer<{
109
+ tokens: z<number, number, "volatile">;
110
+ idleMs: z<number, number, "volatile">;
111
+ judgeTimeoutMs: z<number, number, "volatile">;
112
+ }>>, "plain">;
113
+ export interface TeamPressurePolicyOptions {
114
+ /** Resolve the live Agent of one Member; absent means nothing to read. */
115
+ readonly agentForMember: (memberId: AgentTeamMemberId) => Agent | undefined;
116
+ /** Effective budgets for one Member's current route; undefined means unknown. */
117
+ readonly limitsForAgent: (agent: Agent) => PressureLimits | undefined | Promise<PressureLimits | undefined>;
118
+ /** The reduction capability in one Member's preset scope, or absent when it mounts none. */
119
+ readonly compactionForAgent: (agent: Agent) => PressureCompaction | undefined;
120
+ /** The model-visible active-Claim labels for one Member's notice. */
121
+ readonly activeClaimLabels: (memberId: AgentTeamMemberId) => readonly string[];
122
+ /** The model-visible running-job labels for one Member's notice. */
123
+ readonly runningJobLabels: (memberId: AgentTeamMemberId) => readonly string[];
124
+ /** The long-gap gate's thresholds; an omitted field keeps the engine's default. */
125
+ readonly gate?: PressureGate | undefined;
126
+ /**
127
+ * The relatedness judge in one Member's scope, when the deployment installed
128
+ * one. Absent — the member itself, or the whole deployment — switches the
129
+ * long-gap gate off; a missing judge is a deployment choice, never a failure.
130
+ */
131
+ readonly judgeForAgent?: ((agent: Agent) => PressureJudgement | undefined) | undefined;
132
+ /** Report a blocked request with a recoverable diagnostic. */
133
+ readonly failed: (memberId: AgentTeamMemberId, diagnostic: string) => void;
134
+ /** Log one engine diagnostic, attributable to the Member it names. */
135
+ readonly log: (message: string, memberId: AgentTeamMemberId) => void;
136
+ }
137
+ /**
138
+ * Team's `PressurePolicyHost`. Every member is resolved per Member at call
139
+ * time, because one policy serves every Member this Host runs. The readings
140
+ * that need the step's own argument are fed for exactly one policy call —
141
+ * {@link beginStep} to {@link endStep} — so a judgement is never made from a
142
+ * neighbour Member's messages.
143
+ */
144
+ export declare class TeamPressurePolicyHost implements PressurePolicyHost<AgentTeamMemberId> {
145
+ private readonly options;
146
+ readonly pluginId = "@wowyuarm/dsh-agent-team";
147
+ private readonly admitting;
148
+ constructor(options: TeamPressurePolicyOptions);
149
+ /** Record the input one step is admitting: the host's own pre-step argument. */
150
+ beginStep(memberId: AgentTeamMemberId, messages: readonly UserMessage[]): void;
151
+ /** Forget that input again: the view lives only while its policy call runs. */
152
+ endStep(memberId: AgentTeamMemberId): void;
153
+ limitsFor(memberId: AgentTeamMemberId): PressureLimits | undefined | Promise<PressureLimits | undefined>;
154
+ /**
155
+ * The Member's durable surface, for proving a reduction. Without a live Agent
156
+ * there is nothing to measure; the policy reaches this only for a Member whose
157
+ * limits resolved, which already requires one.
158
+ */
159
+ surfaceFor(memberId: AgentTeamMemberId): PressureSurface;
160
+ compactionFor(memberId: AgentTeamMemberId): PressureCompaction | undefined;
161
+ /**
162
+ * The Member's durable log, as the notice latch and the idle gap read it. The
163
+ * engine's contract asks for the span's own events and the inherited count
164
+ * beside them; the `ownEvents()` reader is what states that boundary today.
165
+ */
166
+ logSpanFor(memberId: AgentTeamMemberId): PressureLogSpan;
167
+ inHandFor(memberId: AgentTeamMemberId): PressureInHand;
168
+ /**
169
+ * The input this step is admitting, and the generation's earlier user input
170
+ * beside it. Both sides exclude Team's own notices: what the gate judges is
171
+ * what a human sent, and a rederived Team notification is neither the request
172
+ * being held nor evidence of what the request continues.
173
+ */
174
+ relatednessFor(memberId: AgentTeamMemberId): PressureRelatedness | undefined;
175
+ /**
176
+ * The generation's earlier human input, oldest first, without the messages
177
+ * this step is admitting: the judge is asked what the arriving request
178
+ * continues, so the arriving request is not also part of its own evidence.
179
+ */
180
+ private recentInput;
181
+ judgeFor(memberId: AgentTeamMemberId): PressureJudgement | undefined;
182
+ /**
183
+ * Steer one notice into the Member's running turn. A Member with no live
184
+ * Agent throws rather than reporting success: the caller holds a step on the
185
+ * strength of this call, and a held step whose instruction never arrived
186
+ * would stall the Member behind a message that does not exist.
187
+ */
188
+ steer(memberId: AgentTeamMemberId, notice: UserMessage): void;
189
+ failedFor(memberId: AgentTeamMemberId, diagnostic: string): void;
190
+ log(message: string, memberId: AgentTeamMemberId): void;
191
+ }
192
+ /**
193
+ * The engine's context-pressure policy over Team's Member lifecycle: the one
194
+ * place the two sides meet. It owns no decision of its own — the ordering, the
195
+ * notice latch, the fail-closed reduction proof and the long-gap gate are all
196
+ * the engine's — and adds only the step-scoped input view that only the host
197
+ * can have.
198
+ */
199
+ export declare class TeamPressurePolicy {
200
+ private readonly host;
201
+ private readonly policy;
202
+ constructor(options: TeamPressurePolicyOptions);
203
+ /** The pre-step decision for one Member, with the input that step claims. */
204
+ onPreStep(memberId: AgentTeamMemberId, messages: readonly UserMessage[], signal: AbortSignal): Promise<PressureStepDecision>;
205
+ onRequestError(memberId: AgentTeamMemberId, failure: {
206
+ readonly code?: string | undefined;
207
+ }, signal: AbortSignal): Promise<boolean>;
208
+ onAssistantMessage(memberId: AgentTeamMemberId): void;
209
+ dispose(): void;
210
+ }
84
211
  //# sourceMappingURL=context-continuity-host.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-continuity-host.d.ts","sourceRoot":"","sources":["../../src/context-continuity-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEvD,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,kCAAkC,CAAA;AAGzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAmC,MAAM,YAAY,CAAA;AAE1G;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,qBAI7B,CAAA;AAEF,MAAM,WAAW,4BAA4B;IAC3C,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,KAAK,GAAG,SAAS,CAAA;IAC3E,oDAAoD;IACpD,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,oBAAoB,GAA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EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAInI,kBAAkB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAIrD,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Team's relatedness judge: the long-gap gate's `jev` service, mounted by this
3
+ * bundle when a key resolves and left unmounted when none does.
4
+ *
5
+ * The key is the switch, so nothing here decides policy: a key in the Host
6
+ * row's `jev` config — or in the environment variable that config names —
7
+ * mounts the service, clearing it unmounts the service, and the gate asks
8
+ * whatever is mounted. A deployment that mounts its own `jev` row keeps
9
+ * working, because the judge is read as a service rather than as this mount.
10
+ *
11
+ * The mount also carries the one setting the two sides must agree on: jev's own
12
+ * call budget is derived from the gate's deadline, so a judge can never be
13
+ * configured to outlive the time the gate gives it — the mismatch that would
14
+ * otherwise leave every long-gap step ungated without a word.
15
+ * @module @wowyuarm/dsh-agent-team/context-judge
16
+ */
17
+ import type { Context } from '@deepseek-ai/cordis';
18
+ import { type JevPluginConfig } from '@wowyuarm/dsh-jev';
19
+ import type { PressureJudgement } from '@wowyuarm/dsh-context-continuity';
20
+ /** The Host row's `jev` config: where the judge's key, endpoint and model come from. */
21
+ export interface TeamContextJudgeConfig {
22
+ readonly apiKey?: string | undefined;
23
+ readonly apiKeyEnv?: string | undefined;
24
+ readonly model?: string | undefined;
25
+ readonly apiBase?: string | undefined;
26
+ }
27
+ /**
28
+ * The config one mount runs with. Exported because it is the whole contract
29
+ * between the gate's deadline and the judge's own budget, and a pure function
30
+ * is what a test can hold still.
31
+ */
32
+ export declare function judgeMountConfig(config: TeamContextJudgeConfig | undefined, key: string, envName: string, deadlineMs: number): JevPluginConfig;
33
+ /** The judge's status as the Team settings surface reads it. */
34
+ export interface TeamContextJudgeStatus {
35
+ /** Whether a judge is reachable for the next step. */
36
+ readonly enabled: boolean;
37
+ /** Why no judge is reachable; absent when one is. */
38
+ readonly reason?: 'no-key' | 'unavailable' | undefined;
39
+ /** Host-side diagnostic behind `unavailable`; never rendered as user copy. */
40
+ readonly detail?: string | undefined;
41
+ /** The environment variable this deployment reads the key from. */
42
+ readonly keyEnv: string;
43
+ }
44
+ /**
45
+ * One Host's judge: the service it mounted, the failure that kept one from
46
+ * mounting, and the reconciliation that keeps the two in step with the row.
47
+ */
48
+ export declare class TeamContextJudge {
49
+ private readonly ctx;
50
+ private readonly options;
51
+ private fiber;
52
+ private failure;
53
+ /** The mount the live fiber runs with, so an unchanged row does not restart it. */
54
+ private mounted;
55
+ constructor(ctx: Context, options: {
56
+ /** The Host row's live `jev` config. */
57
+ readonly config: () => TeamContextJudgeConfig | undefined;
58
+ /** The gate's effective judgement deadline, in milliseconds. */
59
+ readonly deadlineMs: () => number;
60
+ });
61
+ /**
62
+ * The judge a step may ask, or undefined when the deployment has none: this
63
+ * bundle's own mount first, then a service another row mounted.
64
+ */
65
+ judge(): PressureJudgement | undefined;
66
+ /** The environment variable this deployment reads the key from. */
67
+ keyEnv(): string;
68
+ /** Whether a key is resolvable right now, from the row or from its environment. */
69
+ private key;
70
+ /**
71
+ * Make the mount match the row: mount when a key resolves and none is
72
+ * mounted, re-configure a live mount whose settings changed, unmount when the
73
+ * key is gone. Called at init and on every volatile update of the row, so a
74
+ * key written in the Team settings surface takes effect without a restart.
75
+ */
76
+ sync(): Promise<void>;
77
+ /** Drop this bundle's mount, if it has one. */
78
+ private unmount;
79
+ /** What the Team settings surface states about the judge. */
80
+ status(): TeamContextJudgeStatus;
81
+ }
82
+ //# sourceMappingURL=context-judge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-judge.d.ts","sourceRoot":"","sources":["../../src/context-judge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAS,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAA4B,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,k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KAAK,IAAI,iBAAiB,GAAG,SAAS;IAItC,mEAAmE;IACnE,MAAM,IAAI,MAAM;IAKhB,mFAAmF;IACnF,OAAO,CAAC,GAAG;IAIX;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B3B,+CAA+C;YACjC,OAAO;IAOrB,6DAA6D;IAC7D,MAAM,IAAI,sBAAsB;CAUjC"}
@@ -51,14 +51,17 @@ export type AgentTeamMessageSource = Extract<MessageSource, {
51
51
  /** The kind the read-time conversion renames one producer's released V3 sources into. */
52
52
  export declare const v3RenamedSourceKind: <const P extends string>(producer: P) => `plugin:${P}`;
53
53
  /**
54
- * Whether one message source carries this plugin's own attribution. Both
55
- * identities are matched by exact kind equality — never by a `plugin:`
56
- * prefix test, which would claim third-party producers' rows as Team facts.
54
+ * Whether one source kind is a producer's own: the kind it writes now and the
55
+ * read-time conversion of its released V3 history. Both identities are matched
56
+ * by exact kind equality — never by a `plugin:` prefix test, which would claim
57
+ * third-party producers' rows as that producer's facts.
57
58
  */
59
+ export declare function matchesProducerKind(kind: string | undefined, producer: string): boolean;
60
+ /** Whether one message source carries this plugin's own attribution. */
58
61
  export declare function isAgentTeamSource(source: MessageSource): source is AgentTeamMessageSource;
59
62
  /**
60
63
  * Whether one source kind carries this plugin's attribution, for call sites
61
- * whose sources arrive untyped. Exact identities only, never a prefix test.
64
+ * whose sources arrive untyped.
62
65
  */
63
66
  export declare function isAgentTeamSourceKind(kind: string | undefined): boolean;
64
67
  /** Handoff snapshot section name carrying the model-authored prose. */
@@ -1 +1 @@
1
- {"version":3,"file":"context-source.d.ts","sourceRoot":"","sources":["../../src/context-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAE7G,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,6BAA6B,CAAA;A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C,eAAe,EAAE,MAAM,CAAA;IAChC,2EAA2E;IAC3E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACzC,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,CAAA;CACrD;AAsCD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,uBAAuB,GAAG,SAAS,CAwBnF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAKpF;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAE9D;AAED,4FAA4F;AAC5F,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAGrG;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAEtE;AAED;;oEAEoE;AACpE,eAAO,MAAM,wBAAwB,qBAAqB,CAAA;AAC1D,eAAO,MAAM,mBAAmB,gBAAgB,CAAA;AAChD,eAAO,MAAM,eAAe,YAAY,CAAA;AACxC,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AACpD,eAAO,MAAM,kBAAkB,8BAA8B,CAAA;AAC7D,eAAO,MAAM,qBAAqB,kBAAkB,CAAA"}
@@ -0,0 +1,66 @@
1
+ /** The one local environment check: how the running DSH compares to the line this bundle declares. */
2
+ import type { AgentTeamEnvironmentSupportRange, AgentTeamEnvironmentVerdict } from './types.ts';
3
+ /**
4
+ * What the settings page needs to state the environment.
5
+ *
6
+ * Deliberately not the wire type (`AgentTeamEnvironmentResult`): that one states
7
+ * every fact as optional, because a Transport may withhold any of them, while
8
+ * this is what the checker itself guarantees. `bundleVersion` is therefore
9
+ * required here and optional there, and the seam in `index.ts` is where the two
10
+ * meet.
11
+ */
12
+ export interface EnvironmentReport {
13
+ readonly verdict: AgentTeamEnvironmentVerdict;
14
+ /** Host-side diagnostic for an `undetermined` verdict; never rendered as user copy. */
15
+ readonly reason?: string | undefined;
16
+ /** Version of the bundle this Host runs from, or `'unknown'` when its manifest is unreadable. */
17
+ readonly bundleVersion: string;
18
+ /**
19
+ * The running DSH version — what the page states it is running. Omitted, not
20
+ * guessed, when it could not be read; it is a different fact from
21
+ * `certifiedDshVersion`, which is the line this bundle declares support for.
22
+ */
23
+ readonly dshVersion?: string | undefined;
24
+ /** Lower bound of the declared support range: the certified, actually-tested DSH line. */
25
+ readonly certifiedDshVersion?: string | undefined;
26
+ readonly supportRange?: AgentTeamEnvironmentSupportRange | undefined;
27
+ }
28
+ /**
29
+ * Read the support line from the installed manifest's DSH peers, or nothing.
30
+ *
31
+ * Every `@deepseek-ai/dsh-*` peer must carry exactly the same range, and it must
32
+ * be a `>=<lower> <upper>` series: the version line is the manifest's own claim
33
+ * and a partially drifted manifest cannot state one. `scripts/check-version-consistency.mjs`
34
+ * holds the same shape to the certified baseline, so a run of this bundle
35
+ * states the same line its README does. Returns `undefined` when the peers
36
+ * disagree or the shape is unreadable.
37
+ */
38
+ export declare function supportRangeOf(manifest: object): AgentTeamEnvironmentSupportRange | undefined;
39
+ /**
40
+ * Judge one already-resolved triple, so every branch is testable without an
41
+ * environment. The verdict comes from the Harness's own
42
+ * `evaluatePluginCompatibility` — the plugin manager decides installability with
43
+ * that same function, and prerelease ordering is exactly what a hand-written
44
+ * comparison gets wrong.
45
+ *
46
+ * @param manifest - the installed bundle's parsed manifest, the source of the declared support line.
47
+ * @param runtimeVersion - the running DSH version, or `'unknown'` when it could not be read.
48
+ * @param bundleVersion - the installed bundle version, or `'unknown'`.
49
+ * @param unavailable - why the running version is not known, recorded when it is `'unknown'`.
50
+ * @returns the report the settings page renders.
51
+ */
52
+ export declare function evaluateEnvironment(manifest: object, runtimeVersion: string, bundleVersion: string, unavailable?: string): EnvironmentReport;
53
+ /**
54
+ * Read this Host's own environment: the installed bundle version, the declared
55
+ * support line, and how the running DSH compares to it.
56
+ *
57
+ * The certified DSH version is the range's lower bound, never the newest cut
58
+ * tested against it: `docs/dsh-release-compatibility.md` §4 records a baseline
59
+ * inside the declared range without moving the peers, so every version spot
60
+ * keeps naming the bound. Reading it from anywhere else would reintroduce the
61
+ * hand-maintained constant this check exists to remove.
62
+ *
63
+ * @returns the report, with `verdict: 'undetermined'` for any fact not established.
64
+ */
65
+ export declare function reportEnvironment(): EnvironmentReport;
66
+ //# sourceMappingURL=environment-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-check.d.ts","sourceRoot":"","sources":["../../src/environment-check.ts"],"names":[],"mappings":"AAAA,sGAAsG;AAItG,OAAO,KAAK,EAAE,gCAAgC,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AAE/F;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAA;IAC7C,uFAAuF;IACvF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,iGAAiG;IACjG,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,0FAA0F;IAC1F,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjD,QAAQ,CAAC,YAAY,CAAC,EAAE,gCAAgC,GAAG,SAAS,CAAA;CACrE;AAQD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,gCAAgC,GAAG,SAAS,CAc7F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,GACnB,iBAAiB,CA0BnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,IAAI,iBAAiB,CAUrD"}
@@ -13,6 +13,12 @@ import z from '@deepseek-ai/schemastery';
13
13
  * - avatar bytes live under a persistent directory below; the profile holds
14
14
  * only the reference, never a data URL. The composer attachment cache is
15
15
  * TTL-bound and must not hold avatar bytes.
16
+ *
17
+ * The legacy-section adoption below is transitional: it exists for installs
18
+ * upgraded from a pre-rc.1 profile document, and retires — with
19
+ * `LEGACY_HUMAN_PROFILE_SECTION`, `parseLegacyHumanProfile`, and
20
+ * `planLegacyAdoption` — once such installs are no longer supported. Nothing
21
+ * else in the Host reads that document.
16
22
  */
17
23
  /**
18
24
  * Settings namespace of the Human profile: the Team Host row's id in
@@ -29,30 +35,18 @@ export declare const HUMAN_PROFILE_DEFAULT_NAME = "human";
29
35
  export declare const HUMAN_PROFILE_REPO_URL = "https://github.com/wowyuarm/dsh-agent-team";
30
36
  /**
31
37
  * Bundle version shown in the settings footnote, and the current side of the
32
- * update check: the version of the package THIS Host runs from — read from the
33
- * installed manifest, so a `link:` checkout under the development profile and a
34
- * registry tarball under stable each state their own truth. It is not a
35
- * hand-maintained string: the 0.1.14 bundle shipped with `0.1.13` written in
36
- * it, which made the footnote name the previous release and the update check
37
- * offer the release the user already had.
38
+ * update check: the version of the package THIS Host runs from — the installed
39
+ * manifest's, read once at load through `./installed-manifest.ts`, so a `link:`
40
+ * checkout under the development profile and a registry tarball under stable
41
+ * each state their own truth. It is not a hand-maintained string: the 0.1.14
42
+ * bundle shipped with `0.1.13` written in it, which made the footnote name the
43
+ * previous release and the update check offer the release the user already had.
38
44
  *
39
- * Resolved once at load, three levels above this module — `packages/agent-team/{src,lib}`
40
- * sits that deep in both layouts, the same relative positioning
41
- * `member-runtime.ts` uses to find `core-skills`. An unreadable or malformed
42
- * manifest degrades to `'unknown'`: the Remote's `version: string` contract
43
- * holds and the update comparison simply compares nothing. The footnote is
44
- * informational only and never gates behavior.
45
+ * An unreadable or malformed manifest degrades to `'unknown'`: the Remote's
46
+ * `version: string` contract holds and the update comparison simply compares
47
+ * nothing. The footnote is informational only and never gates behavior.
45
48
  */
46
49
  export declare const HUMAN_PROFILE_VERSION: string;
47
- export interface HumanProfile {
48
- readonly name: string;
49
- readonly avatarRef?: string;
50
- }
51
- /** Settings document shape: name with schema default, avatarRef as a plain reference. */
52
- export interface HumanProfileSettings {
53
- readonly name: string;
54
- readonly avatarRef?: string;
55
- }
56
50
  /**
57
51
  * Schemastery schema of the Human profile: the Team Host row's Config. Both
58
52
  * fields are volatile, which is what lets an edit reach the running Host
@@ -99,12 +93,12 @@ export declare function parseLegacyHumanProfile(yamlText: string): LegacyHumanPr
99
93
  * Decide what adoption may write: nothing unless the stored profile is still
100
94
  * the pristine default, so a value the Human re-entered after the upgrade
101
95
  * always wins, and never the legacy default name itself. The current profile
102
- * carries explicit `undefined` on `avatarRef` — the Host getter spreads a
103
- * settings read — and so is not `HumanProfile` under
104
- * exactOptionalPropertyTypes; taking that shape directly keeps the Host call
105
- * cast-free. The returned fields are exactly the ops the profile page would
106
- * have written; byte existence for `avatarRef` is the caller's I/O and must
107
- * already hold.
96
+ * carries explicit `undefined` on `avatarRef` — the Host getter spreads the
97
+ * live Config read — and that shape does not satisfy the optional-property
98
+ * form under exactOptionalPropertyTypes; taking it directly keeps the Host
99
+ * call cast-free. The returned fields are exactly the ops the profile page
100
+ * would have written; byte existence for `avatarRef` is the caller's I/O and
101
+ * must already hold.
108
102
  */
109
103
  export declare function planLegacyAdoption(current: {
110
104
  readonly name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"human-profile.d.ts","sourceRoot":"","sources":["../../src/human-profile.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAGxC;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,gCAA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