@wowyuarm/dsh-agent-team 0.1.7 → 0.1.9
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/package.json +2 -1
- package/packages/agent-team/README.md +5 -3
- package/packages/agent-team/README.zh.md +5 -3
- package/packages/agent-team/core-skills/member-skill-manager/SKILL.md +2 -0
- package/packages/agent-team/lib/attachments.js +14 -4
- package/packages/agent-team/lib/context-management.js +379 -0
- package/packages/agent-team/lib/context-projection.js +574 -0
- package/packages/agent-team/lib/context-source.js +72 -0
- package/packages/agent-team/lib/index.js +1258 -54
- package/packages/agent-team/lib/ledger.js +357 -26
- package/packages/agent-team/lib/member-context.js +7 -3
- package/packages/agent-team/lib/member-runtime.js +159 -4
- package/packages/agent-team/lib/pressure-policy.js +200 -0
- package/packages/agent-team/lib/progress-nudge.js +320 -0
- package/packages/agent-team/lib/spec.js +18 -0
- package/packages/agent-team/lib/typert.host.js +124 -42
- package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
- package/packages/agent-team/lib/typert.remote-client.js +39 -25
- package/packages/agent-team/lib/types/attachments.d.ts +1 -1
- package/packages/agent-team/lib/types/attachments.d.ts.map +1 -1
- package/packages/agent-team/lib/types/context-management.d.ts +142 -0
- package/packages/agent-team/lib/types/context-management.d.ts.map +1 -0
- package/packages/agent-team/lib/types/context-projection.d.ts +219 -0
- package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -0
- package/packages/agent-team/lib/types/context-source.d.ts +83 -0
- package/packages/agent-team/lib/types/context-source.d.ts.map +1 -0
- package/packages/agent-team/lib/types/index.d.ts +283 -2
- package/packages/agent-team/lib/types/index.d.ts.map +1 -1
- package/packages/agent-team/lib/types/ledger.d.ts +120 -7
- package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
- package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
- package/packages/agent-team/lib/types/member-runtime.d.ts +30 -2
- package/packages/agent-team/lib/types/member-runtime.d.ts.map +1 -1
- package/packages/agent-team/lib/types/pressure-policy.d.ts +106 -0
- package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -0
- package/packages/agent-team/lib/types/progress-nudge.d.ts +136 -0
- package/packages/agent-team/lib/types/progress-nudge.d.ts.map +1 -0
- package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
- package/packages/agent-team/lib/types/types/entities.d.ts +32 -1
- package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
- package/packages/agent-team/lib/types/types/operations.d.ts +38 -3
- package/packages/agent-team/lib/types/types/operations.d.ts.map +1 -1
- package/packages/agent-team/lib/types/types/requests-results.d.ts +54 -1
- package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
- package/packages/agent-team/preset/team-member/agent.cordis.yml +10 -2
- package/packages/client-agent-team/lib/client.js +283 -398
- package/packages/client-agent-team/lib/client.js.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +1 -2
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +61 -41
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +3 -7
- package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts +3 -1
- package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamComposer.js +37 -27
- package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamConversation.js +2 -2
- package/packages/client-agent-team/lib/types/client/TeamMemberAvatar.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberAvatar.js +3 -2
- package/packages/client-agent-team/lib/types/client/TeamMessage.js +5 -0
- package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts +2 -2
- package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamPresenceDot.js +4 -6
- package/packages/client-agent-team/lib/types/client/TeamStateDot.d.ts +14 -0
- package/packages/client-agent-team/lib/types/client/TeamStateDot.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamStateDot.js +15 -0
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts +1 -0
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +41 -16
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +2 -2
- package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/index.js +36 -78
- package/packages/client-agent-team/lib/types/client/locales.d.ts +0 -16
- package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/locales.js +0 -16
- package/packages/client-agent-team/lib/types/client/sidebar-drag.d.ts +1 -2
- package/packages/client-agent-team/lib/types/client/sidebar-drag.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/slots.d.ts +8 -1
- package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/task-refs.d.ts +7 -1
- package/packages/client-agent-team/lib/types/client/task-refs.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/task-refs.js +25 -3
- package/packages/client-agent-team/lib/types/client/team-formatters.d.ts +11 -10
- package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/team-formatters.js +14 -11
- package/packages/tool-agent-team/README.md +8 -5
- package/packages/tool-agent-team/README.zh.md +8 -5
- package/packages/tool-agent-team/lib/context-tools.js +179 -0
- package/packages/tool-agent-team/lib/index.js +144 -25
- package/packages/tool-agent-team/lib/types/context-tools.d.ts +16 -0
- package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -0
- package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
- package/packages/agent-team/lib/auto-compaction.js +0 -201
- package/packages/agent-team/lib/types/auto-compaction.d.ts +0 -47
- package/packages/agent-team/lib/types/auto-compaction.d.ts.map +0 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberDock.d.ts +0 -12
- package/packages/client-agent-team/lib/types/client/TeamMemberDock.d.ts.map +0 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberDock.js +0 -13
- package/packages/client-agent-team/lib/types/client/member-session-input.d.ts +0 -20
- package/packages/client-agent-team/lib/types/client/member-session-input.d.ts.map +0 -1
- package/packages/client-agent-team/lib/types/client/member-session-input.js +0 -110
|
@@ -4322,6 +4322,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4322
4322
|
]).readonly(),
|
|
4323
4323
|
"releasedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
4324
4324
|
"completedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
4325
|
+
"acceptedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
4325
4326
|
"activityRef": intersection(string(), unknown()).readonly(),
|
|
4326
4327
|
"taskRef": intersection(string(), unknown()).readonly(),
|
|
4327
4328
|
"threadRef": intersection(string(), unknown()).readonly(),
|
|
@@ -4605,6 +4606,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4605
4606
|
]).readonly(),
|
|
4606
4607
|
"releasedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
4607
4608
|
"completedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
4609
|
+
"acceptedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
4608
4610
|
"activityRef": intersection(string(), unknown()).readonly(),
|
|
4609
4611
|
"taskRef": intersection(string(), unknown()).readonly(),
|
|
4610
4612
|
"threadRef": intersection(string(), unknown()).readonly(),
|
|
@@ -4749,6 +4751,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4749
4751
|
]).readonly(),
|
|
4750
4752
|
"releasedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
4751
4753
|
"completedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
4754
|
+
"acceptedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
4752
4755
|
"activityRef": intersection(string(), unknown()).readonly(),
|
|
4753
4756
|
"taskRef": intersection(string(), unknown()).readonly(),
|
|
4754
4757
|
"threadRef": intersection(string(), unknown()).readonly(),
|
|
@@ -4795,7 +4798,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4795
4798
|
"threadRef": intersection(string(), unknown()).readonly(),
|
|
4796
4799
|
"messageRef": intersection(string(), unknown()).readonly(),
|
|
4797
4800
|
"sequence": number().readonly()
|
|
4798
|
-
})).readonly()
|
|
4801
|
+
})).readonly(),
|
|
4802
|
+
"contextAdvice": object({
|
|
4803
|
+
"usageTokens": union([_undefined(), number()]).readonly().optional(),
|
|
4804
|
+
"taskBoundaryThreshold": union([_undefined(), number()]).readonly().optional(),
|
|
4805
|
+
"handoffAt": union([_undefined(), number()]).readonly().optional(),
|
|
4806
|
+
"hardLimit": union([_undefined(), number()]).readonly().optional(),
|
|
4807
|
+
"action": union([
|
|
4808
|
+
literal("unavailable"),
|
|
4809
|
+
literal("keep"),
|
|
4810
|
+
literal("rollover"),
|
|
4811
|
+
literal("handoff-now")
|
|
4812
|
+
]).readonly(),
|
|
4813
|
+
"guidance": string().readonly()
|
|
4814
|
+
}).readonly().optional()
|
|
4799
4815
|
});
|
|
4800
4816
|
const _wowyuarm_dsh_agent_team_agentTeam_recoverMember_parameter_0$schema = object({
|
|
4801
4817
|
"requestId": intersection(string(), unknown()).readonly(),
|
|
@@ -5181,6 +5197,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5181
5197
|
]).readonly(),
|
|
5182
5198
|
"releasedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
5183
5199
|
"completedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
5200
|
+
"acceptedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
5184
5201
|
"activityRef": intersection(string(), unknown()).readonly(),
|
|
5185
5202
|
"taskRef": intersection(string(), unknown()).readonly(),
|
|
5186
5203
|
"threadRef": intersection(string(), unknown()).readonly(),
|
|
@@ -5220,13 +5237,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5220
5237
|
"taskRef": intersection(string(), unknown()).readonly().optional(),
|
|
5221
5238
|
"limit": number().readonly().optional()
|
|
5222
5239
|
});
|
|
5223
|
-
const _wowyuarm_dsh_agent_team_agentTeam_threadObservations_result$schema = object({
|
|
5224
|
-
"
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5240
|
+
const _wowyuarm_dsh_agent_team_agentTeam_threadObservations_result$schema = object({
|
|
5241
|
+
"items": array(object({
|
|
5242
|
+
"sequence": number().readonly(),
|
|
5243
|
+
"threadRef": intersection(string(), unknown()).readonly(),
|
|
5244
|
+
"taskRef": intersection(string(), unknown()).readonly().optional(),
|
|
5245
|
+
"memberId": intersection(string(), unknown()).readonly(),
|
|
5246
|
+
"action": union([literal("follow"), literal("unfollow")]).readonly()
|
|
5247
|
+
})).readonly(),
|
|
5248
|
+
"followers": array(intersection(string(), unknown())).readonly()
|
|
5249
|
+
});
|
|
5230
5250
|
const _wowyuarm_dsh_agent_team_agentTeam_updateChannel_parameter_0$schema = object({
|
|
5231
5251
|
"requestId": intersection(string(), unknown()).readonly(),
|
|
5232
5252
|
"workspaceId": intersection(string(), unknown()).readonly(),
|
|
@@ -5432,6 +5452,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5432
5452
|
]).readonly(),
|
|
5433
5453
|
"releasedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
5434
5454
|
"completedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
5455
|
+
"acceptedClaimRefs": union([_undefined(), array(intersection(string(), unknown()))]).readonly().optional(),
|
|
5435
5456
|
"activityRef": intersection(string(), unknown()).readonly(),
|
|
5436
5457
|
"taskRef": intersection(string(), unknown()).readonly(),
|
|
5437
5458
|
"threadRef": intersection(string(), unknown()).readonly(),
|
|
@@ -5490,7 +5511,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5490
5511
|
},
|
|
5491
5512
|
sourceLocation: {
|
|
5492
5513
|
"file": "packages/agent-team/src/index.ts",
|
|
5493
|
-
"line":
|
|
5514
|
+
"line": 616,
|
|
5494
5515
|
"column": 9
|
|
5495
5516
|
}
|
|
5496
5517
|
},
|
|
@@ -5517,7 +5538,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5517
5538
|
},
|
|
5518
5539
|
sourceLocation: {
|
|
5519
5540
|
"file": "packages/agent-team/src/index.ts",
|
|
5520
|
-
"line":
|
|
5541
|
+
"line": 606,
|
|
5521
5542
|
"column": 9
|
|
5522
5543
|
}
|
|
5523
5544
|
},
|
|
@@ -5544,7 +5565,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5544
5565
|
},
|
|
5545
5566
|
sourceLocation: {
|
|
5546
5567
|
"file": "packages/agent-team/src/index.ts",
|
|
5547
|
-
"line":
|
|
5568
|
+
"line": 987,
|
|
5548
5569
|
"column": 9
|
|
5549
5570
|
}
|
|
5550
5571
|
},
|
|
@@ -5571,7 +5592,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5571
5592
|
},
|
|
5572
5593
|
sourceLocation: {
|
|
5573
5594
|
"file": "packages/agent-team/src/index.ts",
|
|
5574
|
-
"line":
|
|
5595
|
+
"line": 1109,
|
|
5575
5596
|
"column": 9
|
|
5576
5597
|
}
|
|
5577
5598
|
},
|
|
@@ -5599,7 +5620,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5599
5620
|
},
|
|
5600
5621
|
sourceLocation: {
|
|
5601
5622
|
"file": "packages/agent-team/src/index.ts",
|
|
5602
|
-
"line":
|
|
5623
|
+
"line": 538,
|
|
5603
5624
|
"column": 9
|
|
5604
5625
|
}
|
|
5605
5626
|
},
|
|
@@ -5626,7 +5647,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5626
5647
|
},
|
|
5627
5648
|
sourceLocation: {
|
|
5628
5649
|
"file": "packages/agent-team/src/index.ts",
|
|
5629
|
-
"line":
|
|
5650
|
+
"line": 999,
|
|
5630
5651
|
"column": 9
|
|
5631
5652
|
}
|
|
5632
5653
|
},
|
|
@@ -5653,7 +5674,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5653
5674
|
},
|
|
5654
5675
|
sourceLocation: {
|
|
5655
5676
|
"file": "packages/agent-team/src/index.ts",
|
|
5656
|
-
"line":
|
|
5677
|
+
"line": 715,
|
|
5657
5678
|
"column": 9
|
|
5658
5679
|
}
|
|
5659
5680
|
},
|
|
@@ -5680,7 +5701,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5680
5701
|
},
|
|
5681
5702
|
sourceLocation: {
|
|
5682
5703
|
"file": "packages/agent-team/src/index.ts",
|
|
5683
|
-
"line":
|
|
5704
|
+
"line": 579,
|
|
5684
5705
|
"column": 9
|
|
5685
5706
|
}
|
|
5686
5707
|
},
|
|
@@ -5707,7 +5728,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5707
5728
|
},
|
|
5708
5729
|
sourceLocation: {
|
|
5709
5730
|
"file": "packages/agent-team/src/index.ts",
|
|
5710
|
-
"line":
|
|
5731
|
+
"line": 1095,
|
|
5711
5732
|
"column": 9
|
|
5712
5733
|
}
|
|
5713
5734
|
},
|
|
@@ -5734,7 +5755,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5734
5755
|
},
|
|
5735
5756
|
sourceLocation: {
|
|
5736
5757
|
"file": "packages/agent-team/src/index.ts",
|
|
5737
|
-
"line":
|
|
5758
|
+
"line": 1118,
|
|
5738
5759
|
"column": 3
|
|
5739
5760
|
}
|
|
5740
5761
|
},
|
|
@@ -5761,7 +5782,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5761
5782
|
},
|
|
5762
5783
|
sourceLocation: {
|
|
5763
5784
|
"file": "packages/agent-team/src/index.ts",
|
|
5764
|
-
"line":
|
|
5785
|
+
"line": 1019,
|
|
5765
5786
|
"column": 9
|
|
5766
5787
|
}
|
|
5767
5788
|
},
|
|
@@ -5789,7 +5810,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5789
5810
|
},
|
|
5790
5811
|
sourceLocation: {
|
|
5791
5812
|
"file": "packages/agent-team/src/index.ts",
|
|
5792
|
-
"line":
|
|
5813
|
+
"line": 529,
|
|
5793
5814
|
"column": 3
|
|
5794
5815
|
}
|
|
5795
5816
|
},
|
|
@@ -5816,7 +5837,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5816
5837
|
},
|
|
5817
5838
|
sourceLocation: {
|
|
5818
5839
|
"file": "packages/agent-team/src/index.ts",
|
|
5819
|
-
"line":
|
|
5840
|
+
"line": 1009,
|
|
5820
5841
|
"column": 9
|
|
5821
5842
|
}
|
|
5822
5843
|
},
|
|
@@ -5843,7 +5864,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5843
5864
|
},
|
|
5844
5865
|
sourceLocation: {
|
|
5845
5866
|
"file": "packages/agent-team/src/index.ts",
|
|
5846
|
-
"line":
|
|
5867
|
+
"line": 1082,
|
|
5847
5868
|
"column": 9
|
|
5848
5869
|
}
|
|
5849
5870
|
},
|
|
@@ -5870,7 +5891,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5870
5891
|
},
|
|
5871
5892
|
sourceLocation: {
|
|
5872
5893
|
"file": "packages/agent-team/src/index.ts",
|
|
5873
|
-
"line":
|
|
5894
|
+
"line": 1125,
|
|
5874
5895
|
"column": 9
|
|
5875
5896
|
}
|
|
5876
5897
|
},
|
|
@@ -5897,7 +5918,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5897
5918
|
},
|
|
5898
5919
|
sourceLocation: {
|
|
5899
5920
|
"file": "packages/agent-team/src/index.ts",
|
|
5900
|
-
"line":
|
|
5921
|
+
"line": 676,
|
|
5901
5922
|
"column": 9
|
|
5902
5923
|
}
|
|
5903
5924
|
},
|
|
@@ -5924,7 +5945,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5924
5945
|
},
|
|
5925
5946
|
sourceLocation: {
|
|
5926
5947
|
"file": "packages/agent-team/src/index.ts",
|
|
5927
|
-
"line":
|
|
5948
|
+
"line": 1030,
|
|
5928
5949
|
"column": 9
|
|
5929
5950
|
}
|
|
5930
5951
|
},
|
|
@@ -5951,7 +5972,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5951
5972
|
},
|
|
5952
5973
|
sourceLocation: {
|
|
5953
5974
|
"file": "packages/agent-team/src/index.ts",
|
|
5954
|
-
"line":
|
|
5975
|
+
"line": 1103,
|
|
5955
5976
|
"column": 9
|
|
5956
5977
|
}
|
|
5957
5978
|
},
|
|
@@ -5978,7 +5999,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5978
5999
|
},
|
|
5979
6000
|
sourceLocation: {
|
|
5980
6001
|
"file": "packages/agent-team/src/index.ts",
|
|
5981
|
-
"line":
|
|
6002
|
+
"line": 516,
|
|
5982
6003
|
"column": 3
|
|
5983
6004
|
}
|
|
5984
6005
|
},
|
|
@@ -6005,7 +6026,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6005
6026
|
},
|
|
6006
6027
|
sourceLocation: {
|
|
6007
6028
|
"file": "packages/agent-team/src/index.ts",
|
|
6008
|
-
"line":
|
|
6029
|
+
"line": 1039,
|
|
6009
6030
|
"column": 9
|
|
6010
6031
|
}
|
|
6011
6032
|
},
|
|
@@ -6032,7 +6053,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6032
6053
|
},
|
|
6033
6054
|
sourceLocation: {
|
|
6034
6055
|
"file": "packages/agent-team/src/index.ts",
|
|
6035
|
-
"line":
|
|
6056
|
+
"line": 1141,
|
|
6036
6057
|
"column": 3
|
|
6037
6058
|
}
|
|
6038
6059
|
},
|
|
@@ -6059,7 +6080,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6059
6080
|
},
|
|
6060
6081
|
sourceLocation: {
|
|
6061
6082
|
"file": "packages/agent-team/src/index.ts",
|
|
6062
|
-
"line":
|
|
6083
|
+
"line": 1134,
|
|
6063
6084
|
"column": 3
|
|
6064
6085
|
}
|
|
6065
6086
|
},
|
|
@@ -6086,7 +6107,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6086
6107
|
},
|
|
6087
6108
|
sourceLocation: {
|
|
6088
6109
|
"file": "packages/agent-team/src/index.ts",
|
|
6089
|
-
"line":
|
|
6110
|
+
"line": 591,
|
|
6090
6111
|
"column": 9
|
|
6091
6112
|
}
|
|
6092
6113
|
},
|
|
@@ -6113,7 +6134,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6113
6134
|
},
|
|
6114
6135
|
sourceLocation: {
|
|
6115
6136
|
"file": "packages/agent-team/src/index.ts",
|
|
6116
|
-
"line":
|
|
6137
|
+
"line": 927,
|
|
6117
6138
|
"column": 9
|
|
6118
6139
|
}
|
|
6119
6140
|
},
|
|
@@ -6140,7 +6161,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6140
6161
|
},
|
|
6141
6162
|
sourceLocation: {
|
|
6142
6163
|
"file": "packages/agent-team/src/index.ts",
|
|
6143
|
-
"line":
|
|
6164
|
+
"line": 1148,
|
|
6144
6165
|
"column": 3
|
|
6145
6166
|
}
|
|
6146
6167
|
}
|
|
@@ -6513,13 +6534,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6513
6534
|
};
|
|
6514
6535
|
//#endregion
|
|
6515
6536
|
//#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/team.module.css.mjs
|
|
6516
|
-
const css$
|
|
6517
|
-
const tagId$
|
|
6518
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
6537
|
+
const css$9 = ".YvAbSa_footerStack{flex:none;width:100%;height:42px;margin:8px 0 0;display:flex}.YvAbSa_footerAction,.YvAbSa_settingsAction{box-sizing:border-box;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:8px;width:calc(100% + 4px);height:42px;padding:0 10px 0 8px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}.YvAbSa_footerAction{margin:0 -2px}.YvAbSa_settingsAction{margin:4px -2px}.YvAbSa_footerAction:hover,.YvAbSa_footerAction:focus-visible,.YvAbSa_settingsAction:hover,.YvAbSa_settingsAction:focus-visible{background:var(--dsw-alias-interactive-bg-hover);outline:none}.YvAbSa_footerAction.YvAbSa_rail,.YvAbSa_settingsAction.YvAbSa_rail{border-radius:50%;justify-content:center;width:36px;height:36px;padding:0}.YvAbSa_footerAction.YvAbSa_rail{margin:0}.YvAbSa_settingsAction.YvAbSa_rail{margin:8px 0 10px}.YvAbSa_railStack{align-items:center;width:36px;height:36px;margin:0}";
|
|
6538
|
+
const tagId$9 = "@wowyuarm/dsh-agent-team/team.module.css";
|
|
6539
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$9) + "]") === null) {
|
|
6519
6540
|
const tag = document.createElement("style");
|
|
6520
6541
|
tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
|
|
6521
|
-
tag.dataset.pluginCss = tagId$
|
|
6522
|
-
tag.textContent = css$
|
|
6542
|
+
tag.dataset.pluginCss = tagId$9;
|
|
6543
|
+
tag.textContent = css$9;
|
|
6523
6544
|
document.head.appendChild(tag);
|
|
6524
6545
|
}
|
|
6525
6546
|
var team_module_css_default = {
|
|
@@ -6562,8 +6583,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6562
6583
|
}) });
|
|
6563
6584
|
}
|
|
6564
6585
|
//#endregion
|
|
6586
|
+
//#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/state-dot.module.css.mjs
|
|
6587
|
+
const css$8 = ".DalNWW_quiet{border-radius:50%;flex:none;display:inline-block;position:relative}.DalNWW_quiet[data-variant=todo]{border:1px solid var(--dsw-alias-label-tertiary)}.DalNWW_quiet[data-variant=quiet]{color:var(--dsw-alias-label-tertiary)}.DalNWW_quiet[data-variant=quiet]:before{content:\"\";opacity:.1;background:currentColor;border-radius:50%;position:absolute;inset:0}.DalNWW_quiet[data-variant=quiet]:after{content:\"\";background:currentColor;border-radius:50%;position:absolute;inset:20%}";
|
|
6588
|
+
const tagId$8 = "@wowyuarm/dsh-agent-team/state-dot.module.css";
|
|
6589
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$8) + "]") === null) {
|
|
6590
|
+
const tag = document.createElement("style");
|
|
6591
|
+
tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
|
|
6592
|
+
tag.dataset.pluginCss = tagId$8;
|
|
6593
|
+
tag.textContent = css$8;
|
|
6594
|
+
document.head.appendChild(tag);
|
|
6595
|
+
}
|
|
6596
|
+
var state_dot_module_css_default = { "quiet": "DalNWW_quiet" };
|
|
6597
|
+
//#endregion
|
|
6598
|
+
//#region src/client/TeamStateDot.tsx
|
|
6599
|
+
/**
|
|
6600
|
+
* Render the one shared Team status indicator. Native StateDot states pass
|
|
6601
|
+
* through; the quiet statuses mirror StateDot geometry locally so every
|
|
6602
|
+
* surface renders the same shape — todo a hollow ring (not started), quiet a
|
|
6603
|
+
* solid tertiary dot with the same 10% halo (closed, unavailable).
|
|
6604
|
+
*/
|
|
6605
|
+
function TeamStateDot({ state, size = 10 }) {
|
|
6606
|
+
if (state === "todo" || state === "quiet") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6607
|
+
className: state_dot_module_css_default.quiet,
|
|
6608
|
+
"data-variant": state,
|
|
6609
|
+
style: {
|
|
6610
|
+
width: size,
|
|
6611
|
+
height: size
|
|
6612
|
+
},
|
|
6613
|
+
"aria-hidden": "true"
|
|
6614
|
+
});
|
|
6615
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
6616
|
+
state,
|
|
6617
|
+
size
|
|
6618
|
+
});
|
|
6619
|
+
}
|
|
6620
|
+
//#endregion
|
|
6565
6621
|
//#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/presence.module.css.mjs
|
|
6566
|
-
const css$7 = ".-\\36 lQ-q_target{flex:0 0 14px;justify-content:center;align-items:center;display:inline-flex}
|
|
6622
|
+
const css$7 = ".-\\36 lQ-q_target{flex:0 0 14px;justify-content:center;align-items:center;display:inline-flex}";
|
|
6567
6623
|
const tagId$7 = "@wowyuarm/dsh-agent-team/presence.module.css";
|
|
6568
6624
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$7) + "]") === null) {
|
|
6569
6625
|
const tag = document.createElement("style");
|
|
@@ -6572,10 +6628,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6572
6628
|
tag.textContent = css$7;
|
|
6573
6629
|
document.head.appendChild(tag);
|
|
6574
6630
|
}
|
|
6575
|
-
var presence_module_css_default = {
|
|
6576
|
-
"target": "-6lQ-q_target",
|
|
6577
|
-
"unavailableDot": "-6lQ-q_unavailableDot"
|
|
6578
|
-
};
|
|
6631
|
+
var presence_module_css_default = { "target": "-6lQ-q_target" };
|
|
6579
6632
|
//#endregion
|
|
6580
6633
|
//#region src/client/TeamPresenceDot.tsx
|
|
6581
6634
|
function presenceLabel(status, t) {
|
|
@@ -6584,11 +6637,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6584
6637
|
}
|
|
6585
6638
|
/** Shared presence → indicator mapping for dots and avatar badges. */
|
|
6586
6639
|
function presenceDotState(presence) {
|
|
6587
|
-
return presence === "available" ? "done" : presence === "working" ? "ongoing" : presence === "error" ? "error" : "
|
|
6640
|
+
return presence === "available" ? "done" : presence === "working" ? "ongoing" : presence === "error" ? "error" : "quiet";
|
|
6588
6641
|
}
|
|
6589
6642
|
function TeamPresenceDot({ status, t }) {
|
|
6590
6643
|
const label = presenceLabel(status, t);
|
|
6591
|
-
const state = presenceDotState(status.presence);
|
|
6592
6644
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
6593
6645
|
label,
|
|
6594
6646
|
delayMs: 300,
|
|
@@ -6596,10 +6648,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6596
6648
|
className: presence_module_css_default.target,
|
|
6597
6649
|
role: "img",
|
|
6598
6650
|
"aria-label": label,
|
|
6599
|
-
children:
|
|
6600
|
-
className: presence_module_css_default.unavailableDot,
|
|
6601
|
-
"aria-hidden": "true"
|
|
6602
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state })
|
|
6651
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamStateDot, { state: presenceDotState(status.presence) })
|
|
6603
6652
|
})
|
|
6604
6653
|
});
|
|
6605
6654
|
}
|
|
@@ -6760,7 +6809,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6760
6809
|
const mintRequestId = () => crypto.randomUUID();
|
|
6761
6810
|
//#endregion
|
|
6762
6811
|
//#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/composer.module.css.mjs
|
|
6763
|
-
const css$5 = ".x9jGQq_root{padding:0 var(--dsh-composer-side-clearance,16px) 8px;flex-direction:column;align-items:center;display:flex}.x9jGQq_card{box-sizing:border-box;width:100%;max-width:var(--dsh-composer-card-max-width,780px);border:1px solid var(--dsw-alias-border-l2-darkmode-thin);background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-1));box-shadow:var(--dsw-shadow-lv2);border-radius:22px;flex-direction:column;gap:6px;padding:10px 0 0;display:flex;position:relative}.x9jGQq_inputArea{min-height:28px;position:relative}.x9jGQq_inputArea textarea{box-sizing:border-box;resize:none;width:100%;min-height:28px;max-height:336px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-primary));font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;background:0 0;border:0;outline:0;padding:4px 12px 0 16px;font-size:15px;line-height:24px;display:block;overflow-y:auto}.x9jGQq_inputArea textarea::placeholder{color:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary))}.
|
|
6812
|
+
const css$5 = ".x9jGQq_root{padding:0 var(--dsh-composer-side-clearance,16px) 8px;flex-direction:column;align-items:center;display:flex}.x9jGQq_card{box-sizing:border-box;width:100%;max-width:var(--dsh-composer-card-max-width,780px);border:1px solid var(--dsw-alias-border-l2-darkmode-thin);background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-1));box-shadow:var(--dsw-shadow-lv2);border-radius:22px;flex-direction:column;gap:6px;padding:10px 0 0;display:flex;position:relative}.x9jGQq_inputArea{min-height:28px;position:relative}.x9jGQq_inputArea textarea{box-sizing:border-box;resize:none;width:100%;min-height:28px;max-height:336px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-primary));font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;background:0 0;border:0;outline:0;padding:4px 12px 0 16px;font-size:15px;line-height:24px;display:block;overflow-y:auto}.x9jGQq_inputArea textarea::placeholder{color:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary))}.x9jGQq_inputArea textarea:disabled{cursor:not-allowed;opacity:.55}.x9jGQq_mentionMenu{z-index:10;border:1px solid var(--dsw-alias-border-inverted);background:var(--dsw-specific-menu);max-height:min(320px,40vh);box-shadow:var(--dsw-shadow-lv3);border-radius:12px;padding:4px;position:absolute;bottom:calc(100% + 12px);left:0;right:0;overflow-y:auto}.x9jGQq_mentionOption{width:100%;min-height:40px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-primary));cursor:pointer;text-align:left;background:0 0;border:0;border-radius:10px;grid-template-columns:16px minmax(0,auto) minmax(0,1fr);align-items:center;gap:8px;padding:8px 10px;font-size:14px;line-height:22px;display:grid}.x9jGQq_mentionOption:hover,.x9jGQq_mentionOption[aria-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.x9jGQq_mentionName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.x9jGQq_mentionAllDot{background:var(--dsw-alias-label-primary);border-radius:50%;justify-self:center;width:8px;height:8px}.x9jGQq_mentionDescription{min-width:0;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-tertiary));text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.x9jGQq_toolbar{justify-content:flex-end;align-items:center;gap:6px;min-height:34px;padding:2px 8px 6px;display:flex}.x9jGQq_asTaskOn[aria-pressed=true],.x9jGQq_asTaskOn[aria-pressed=true]:hover:not(:disabled){background:var(--dsw-alias-button-primary-fill);border-color:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.x9jGQq_attachButton{background:var(--dsw-specific-selector);color:var(--dsw-alias-label-primary);cursor:pointer;border:0;border-radius:999px;flex:none;place-items:center;width:28px;height:28px;margin-right:auto;display:grid}.x9jGQq_attachButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-solid)}.x9jGQq_attachButton:disabled{cursor:default;opacity:.5}.x9jGQq_attachButton:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,var(--dsw-specific-selector));outline-offset:1px}.x9jGQq_fileInput{display:none}.x9jGQq_fileChips{flex-wrap:wrap;gap:4px;margin:0;padding:4px 8px 0;list-style:none;display:flex}.x9jGQq_fileChip{background:var(--dsw-alias-interactive-bg-hover);border-radius:6px;align-items:center;gap:4px;max-width:100%;padding:2px 4px 2px 8px;display:inline-flex}.x9jGQq_fileChipSize{color:var(--dsw-alias-label-tertiary);margin-left:6px}.x9jGQq_imageChip{align-items:center;display:flex}.x9jGQq_imageChipPreview{border:1px solid var(--dsw-alias-border-l2);object-fit:cover;border-radius:4px;width:56px;height:40px}.x9jGQq_fileChipName{text-overflow:ellipsis;white-space:nowrap;max-width:220px;font-size:11px;line-height:16px;overflow:hidden}.x9jGQq_fileChipRemove{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;width:16px;height:16px;padding:0;font-size:12px;display:inline-flex}.x9jGQq_fileChipRemove:hover,.x9jGQq_fileChipRemove:focus-visible{color:var(--dsw-alias-label-primary);outline:none}.x9jGQq_sendButton{background:var(--dsw-alias-button-info-fill,var(--dsw-alias-button-primary-fill));color:#fff;cursor:pointer;border:0;border-radius:50%;justify-content:center;align-items:center;width:34px;height:34px;padding:0;transition:background-color .1s,opacity .1s;display:inline-flex}.x9jGQq_sendButton:hover:not(:disabled){background:var(--dsw-alias-button-info-hover,var(--dsw-alias-button-primary-hover))}.x9jGQq_sendButton:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.x9jGQq_sendButton:disabled{cursor:not-allowed;opacity:.4}.x9jGQq_confirmation{color:var(--dsw-alias-label-tertiary);align-self:stretch;margin:0;padding:0 16px;font-size:12px;line-height:18px}.x9jGQq_notifyRow{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-tertiary));overflow-wrap:anywhere;margin:0;padding:0 16px;font-size:12px;line-height:18px}.x9jGQq_error{color:var(--dsw-alias-state-error-primary);align-self:stretch;margin:0;padding:0 4px 2px;font-size:12px;line-height:18px}@media (width<=600px){.x9jGQq_mentionOption{grid-template-columns:16px minmax(0,1fr);min-height:36px;padding-block:6px}.x9jGQq_mentionDescription{display:none}}@media (prefers-reduced-motion:reduce){.x9jGQq_sendButton{transition:none}}";
|
|
6764
6813
|
const tagId$5 = "@wowyuarm/dsh-agent-team/composer.module.css";
|
|
6765
6814
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
|
|
6766
6815
|
const tag = document.createElement("style");
|
|
@@ -6784,14 +6833,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6784
6833
|
"imageChip": "x9jGQq_imageChip",
|
|
6785
6834
|
"imageChipPreview": "x9jGQq_imageChipPreview",
|
|
6786
6835
|
"inputArea": "x9jGQq_inputArea",
|
|
6787
|
-
"memberSessionCard": "x9jGQq_memberSessionCard",
|
|
6788
|
-
"memberSessionDock": "x9jGQq_memberSessionDock",
|
|
6789
|
-
"memberSessionHint": "x9jGQq_memberSessionHint",
|
|
6790
|
-
"memberSessionInputArea": "x9jGQq_memberSessionInputArea",
|
|
6791
|
-
"memberSessionPrimary": "x9jGQq_memberSessionPrimary",
|
|
6792
|
-
"memberSessionRoot": "x9jGQq_memberSessionRoot",
|
|
6793
|
-
"memberSessionStatus": "x9jGQq_memberSessionStatus",
|
|
6794
|
-
"memberSessionToolbar": "x9jGQq_memberSessionToolbar",
|
|
6795
6836
|
"mentionAllDot": "x9jGQq_mentionAllDot",
|
|
6796
6837
|
"mentionDescription": "x9jGQq_mentionDescription",
|
|
6797
6838
|
"mentionMenu": "x9jGQq_mentionMenu",
|
|
@@ -6828,6 +6869,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6828
6869
|
const normalized = query.toLocaleLowerCase();
|
|
6829
6870
|
return members.filter((status) => status.presence !== "unavailable" && status.member.state !== "inactive" && status.member.state !== "archived" && status.member.handle.toLocaleLowerCase().startsWith(normalized));
|
|
6830
6871
|
}
|
|
6872
|
+
/** Thread followers rank first: mentioning them delivers directly, while a non-follower enters the two-send invite flow. */
|
|
6873
|
+
function rankMentionCandidates(candidates, followers) {
|
|
6874
|
+
if (followers === void 0 || followers.size === 0) return candidates;
|
|
6875
|
+
return [...candidates].sort((left, right) => Number(followers.has(right.member.memberId)) - Number(followers.has(left.member.memberId)));
|
|
6876
|
+
}
|
|
6831
6877
|
/** Every member a manual handle pick could reach: the @all expansion snapshot. */
|
|
6832
6878
|
function allMentionMembers(members) {
|
|
6833
6879
|
return members.filter((status) => status.presence !== "unavailable" && status.member.state !== "inactive" && status.member.state !== "archived");
|
|
@@ -6846,15 +6892,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6846
6892
|
}
|
|
6847
6893
|
return url;
|
|
6848
6894
|
}
|
|
6849
|
-
function TeamComposer({ members, recipients, draft, pending, confirmation, error, onDraftChange, onRecipientsChange, onSubmit, placeholder, pendingFiles, onFilesChange, asTask, onAsTaskChange, t }) {
|
|
6895
|
+
function TeamComposer({ members, followerMemberIds, recipients, draft, pending, confirmation, error, onDraftChange, onRecipientsChange, onSubmit, placeholder, pendingFiles, onFilesChange, asTask, onAsTaskChange, t }) {
|
|
6850
6896
|
const inputRef = (0, react.useRef)(null);
|
|
6851
6897
|
const fileInputRef = (0, react.useRef)(null);
|
|
6852
6898
|
const rootRef = (0, react.useRef)(null);
|
|
6853
6899
|
const menuRef = (0, react.useRef)(null);
|
|
6900
|
+
const activeOptionRef = (0, react.useRef)(null);
|
|
6854
6901
|
const composingRef = (0, react.useRef)(false);
|
|
6855
6902
|
const [mention, setMention] = (0, react.useState)();
|
|
6856
6903
|
const [highlight, setHighlight] = (0, react.useState)(0);
|
|
6857
|
-
const memberCandidates = mention === void 0 ? [] : mentionCandidates(members, mention.query);
|
|
6904
|
+
const memberCandidates = mention === void 0 ? [] : rankMentionCandidates(mentionCandidates(members, mention.query), followerMemberIds);
|
|
6858
6905
|
const options = mention !== void 0 && "all".startsWith(mention.query.toLocaleLowerCase()) ? [{ kind: "all" }, ...memberCandidates.map((status) => ({
|
|
6859
6906
|
kind: "member",
|
|
6860
6907
|
status
|
|
@@ -6864,6 +6911,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6864
6911
|
}));
|
|
6865
6912
|
const menuOpen = mention !== void 0 && options.length > 0;
|
|
6866
6913
|
const activeOption = options[highlight];
|
|
6914
|
+
const activeOptionKey = activeOption === void 0 ? void 0 : activeOption.kind === "all" ? "all" : activeOption.status.member.memberId;
|
|
6867
6915
|
const allCount = allMentionMembers(members).length;
|
|
6868
6916
|
const listId = "team-mention-suggestions";
|
|
6869
6917
|
const menuMaxHeight = (0, _deepseek_ai_dsh_client_ui_primitives.useAnchoredMaxHeight)(menuRef, 320, menuOpen ? draft : null);
|
|
@@ -6883,6 +6931,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6883
6931
|
}
|
|
6884
6932
|
setHighlight((current) => Math.min(current, options.length - 1));
|
|
6885
6933
|
}, [mention, options.length]);
|
|
6934
|
+
(0, react.useLayoutEffect)(() => {
|
|
6935
|
+
if (!menuOpen) return;
|
|
6936
|
+
activeOptionRef.current?.scrollIntoView?.({ block: "nearest" });
|
|
6937
|
+
}, [
|
|
6938
|
+
menuOpen,
|
|
6939
|
+
highlight,
|
|
6940
|
+
activeOptionKey
|
|
6941
|
+
]);
|
|
6886
6942
|
(0, react.useEffect)(() => {
|
|
6887
6943
|
const active = document.activeElement;
|
|
6888
6944
|
if (active !== document.body && active?.closest("[aria-current=\"page\"]") === null) return;
|
|
@@ -6920,6 +6976,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6920
6976
|
pruneRecipients(nextDraft);
|
|
6921
6977
|
updateMention(nextDraft, event.target.selectionStart ?? nextDraft.length);
|
|
6922
6978
|
};
|
|
6979
|
+
const commitMention = (nextDraft, nextCaret, nextRecipients) => {
|
|
6980
|
+
onDraftChange(nextDraft);
|
|
6981
|
+
onRecipientsChange(nextRecipients);
|
|
6982
|
+
setMention(void 0);
|
|
6983
|
+
setHighlight(0);
|
|
6984
|
+
requestAnimationFrame(() => {
|
|
6985
|
+
const input = inputRef.current;
|
|
6986
|
+
if (input === null) return;
|
|
6987
|
+
input.focus({ preventScroll: true });
|
|
6988
|
+
input.setSelectionRange(nextCaret, nextCaret);
|
|
6989
|
+
});
|
|
6990
|
+
};
|
|
6923
6991
|
const selectOption = (option) => {
|
|
6924
6992
|
if (mention === void 0) return;
|
|
6925
6993
|
if (option.kind === "all") {
|
|
@@ -6927,33 +6995,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6927
6995
|
const nextCaret = mention.start + 5;
|
|
6928
6996
|
const nextRecipients = new Set(recipients);
|
|
6929
6997
|
for (const status of allMentionMembers(members)) nextRecipients.add(status.member.memberId);
|
|
6930
|
-
|
|
6931
|
-
onRecipientsChange(nextRecipients);
|
|
6932
|
-
setMention(void 0);
|
|
6933
|
-
setHighlight(0);
|
|
6934
|
-
requestAnimationFrame(() => {
|
|
6935
|
-
const input = inputRef.current;
|
|
6936
|
-
if (input === null) return;
|
|
6937
|
-
input.focus({ preventScroll: true });
|
|
6938
|
-
input.setSelectionRange(nextCaret, nextCaret);
|
|
6939
|
-
});
|
|
6998
|
+
commitMention(nextDraft, nextCaret, nextRecipients);
|
|
6940
6999
|
return;
|
|
6941
7000
|
}
|
|
6942
7001
|
const member = option.status;
|
|
6943
7002
|
const inserted = `@${member.member.handle} `;
|
|
6944
|
-
|
|
6945
|
-
const nextCaret = mention.start + inserted.length;
|
|
6946
|
-
const nextRecipients = new Set(recipients).add(member.member.memberId);
|
|
6947
|
-
onDraftChange(nextDraft);
|
|
6948
|
-
onRecipientsChange(nextRecipients);
|
|
6949
|
-
setMention(void 0);
|
|
6950
|
-
setHighlight(0);
|
|
6951
|
-
requestAnimationFrame(() => {
|
|
6952
|
-
const input = inputRef.current;
|
|
6953
|
-
if (input === null) return;
|
|
6954
|
-
input.focus({ preventScroll: true });
|
|
6955
|
-
input.setSelectionRange(nextCaret, nextCaret);
|
|
6956
|
-
});
|
|
7003
|
+
commitMention(`${draft.slice(0, mention.start)}${inserted}${draft.slice(mention.end)}`, mention.start + inserted.length, new Set(recipients).add(member.member.memberId));
|
|
6957
7004
|
};
|
|
6958
7005
|
const onPaste = (event) => {
|
|
6959
7006
|
if (pending || onFilesChange === void 0 || pendingFiles === void 0) return;
|
|
@@ -7027,6 +7074,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7027
7074
|
role: "option",
|
|
7028
7075
|
"aria-selected": selected,
|
|
7029
7076
|
className: composer_module_css_default.mentionOption,
|
|
7077
|
+
ref: selected ? activeOptionRef : void 0,
|
|
7030
7078
|
onMouseDown: (event) => {
|
|
7031
7079
|
event.preventDefault();
|
|
7032
7080
|
},
|
|
@@ -7053,6 +7101,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7053
7101
|
role: "option",
|
|
7054
7102
|
"aria-selected": selected,
|
|
7055
7103
|
className: composer_module_css_default.mentionOption,
|
|
7104
|
+
ref: selected ? activeOptionRef : void 0,
|
|
7056
7105
|
onMouseDown: (event) => {
|
|
7057
7106
|
event.preventDefault();
|
|
7058
7107
|
},
|
|
@@ -7231,15 +7280,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7231
7280
|
pending.delete(entry.taskRef);
|
|
7232
7281
|
emit();
|
|
7233
7282
|
};
|
|
7234
|
-
/**
|
|
7283
|
+
/** Compare refs by branded prefix plus hyphen-stripped UUID, so abbreviated spellings line up with their full form. */
|
|
7284
|
+
function refKeyOf(ref) {
|
|
7285
|
+
return ref.toLowerCase().replaceAll("-", "");
|
|
7286
|
+
}
|
|
7287
|
+
/**
|
|
7288
|
+
* Click-path Host lookup: remember every resolved entry and hand them back
|
|
7289
|
+
* for immediate navigation. The Host keeps `resolved` in the same order as
|
|
7290
|
+
* the input `taskRefs` (one entry per resolvable input, unknowns omitted);
|
|
7291
|
+
* the pairing walk below relies on that contract, so it must be preserved
|
|
7292
|
+
* together with this implementation.
|
|
7293
|
+
*/
|
|
7235
7294
|
const hostTaskRefLookup = (resolveTaskRefs, workspaceId) => async (taskRefs) => {
|
|
7236
7295
|
const result = await resolveTaskRefs({
|
|
7237
7296
|
workspaceId,
|
|
7238
7297
|
taskRefs
|
|
7239
7298
|
});
|
|
7240
7299
|
if (!result.ok) return [];
|
|
7241
|
-
|
|
7242
|
-
|
|
7300
|
+
const entries = result.value.resolved;
|
|
7301
|
+
let entryIndex = 0;
|
|
7302
|
+
for (const requested of taskRefs) {
|
|
7303
|
+
const entry = entries[entryIndex];
|
|
7304
|
+
if (entry === void 0 || !refKeyOf(entry.taskRef).startsWith(refKeyOf(requested))) continue;
|
|
7305
|
+
if (entry.taskRef !== requested) rememberResolvedTaskRef({
|
|
7306
|
+
...entry,
|
|
7307
|
+
taskRef: requested
|
|
7308
|
+
});
|
|
7309
|
+
rememberResolvedTaskRef(entry);
|
|
7310
|
+
entryIndex += 1;
|
|
7311
|
+
}
|
|
7312
|
+
return entries;
|
|
7243
7313
|
};
|
|
7244
7314
|
/** Resolve one Task ref through the Host and jump to its home Channel Thread. */
|
|
7245
7315
|
const jumpToTaskThread = (resolveTaskRefs, workspaceId, taskRef, selectThread) => {
|
|
@@ -7292,10 +7362,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7292
7362
|
}[state]);
|
|
7293
7363
|
}
|
|
7294
7364
|
/**
|
|
7295
|
-
* Status indicator
|
|
7296
|
-
* variants; every status renders a dot so
|
|
7297
|
-
* language — todo is a hollow ring (not started), closed a
|
|
7298
|
-
* (archived).
|
|
7365
|
+
* Status indicator for a Task status, the dot every Task surface renders.
|
|
7366
|
+
* Active states map to StateDot variants; every status renders a dot so they
|
|
7367
|
+
* share one shape language — todo is a hollow ring (not started), closed a
|
|
7368
|
+
* quiet gray dot (archived).
|
|
7299
7369
|
*/
|
|
7300
7370
|
function taskStatusDot(status) {
|
|
7301
7371
|
return {
|
|
@@ -7303,7 +7373,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7303
7373
|
in_progress: "ongoing",
|
|
7304
7374
|
in_review: "warning",
|
|
7305
7375
|
done: "done",
|
|
7306
|
-
closed: "
|
|
7376
|
+
closed: "quiet"
|
|
7307
7377
|
}[status];
|
|
7308
7378
|
}
|
|
7309
7379
|
/** One-line title snippet derived from the Task's root Message body. */
|
|
@@ -7317,7 +7387,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7317
7387
|
for (let index = 0; index < memberId.length; index += 1) hash = (hash * 31 + memberId.charCodeAt(index)) % 360;
|
|
7318
7388
|
return hash;
|
|
7319
7389
|
}
|
|
7320
|
-
const BRANDED_REF_PATTERN = /\b(task|channel|thread):{1,2}[0-9a-f]{
|
|
7390
|
+
const BRANDED_REF_PATTERN = /\b(task|channel|thread):{1,2}[0-9a-f]{6,}(?:-[0-9a-f]{1,})*\b/gi;
|
|
7321
7391
|
/**
|
|
7322
7392
|
* Canonical form of one matched ref: models occasionally double the colon or
|
|
7323
7393
|
* uppercase the UUID when citing a ref in prose, while Host lookups and
|
|
@@ -7328,11 +7398,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7328
7398
|
}
|
|
7329
7399
|
/**
|
|
7330
7400
|
* Split a literal text run into plain and branded-ref segments. The pattern
|
|
7331
|
-
* anchors on the fixed ref prefixes plus
|
|
7332
|
-
* containing a colon never linkifies; a doubled colon from
|
|
7333
|
-
* tolerated. Segment refs are always canonical, so resolution
|
|
7334
|
-
* work regardless of how the ref was spelled; text without any
|
|
7335
|
-
* back as one untouched segment.
|
|
7401
|
+
* anchors on the fixed ref prefixes plus a UUID shape (full or abbreviated),
|
|
7402
|
+
* so ordinary prose containing a colon never linkifies; a doubled colon from
|
|
7403
|
+
* model output is tolerated. Segment refs are always canonical, so resolution
|
|
7404
|
+
* and navigation work regardless of how the ref was spelled; text without any
|
|
7405
|
+
* ref comes back as one untouched segment.
|
|
7336
7406
|
*/
|
|
7337
7407
|
function splitBrandedRefs(text) {
|
|
7338
7408
|
const segments = [];
|
|
@@ -7809,6 +7879,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7809
7879
|
return splitBrandedRefs(text).map((segment, index) => {
|
|
7810
7880
|
if (segment.ref === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
|
|
7811
7881
|
const resolved = cachedResolvedTaskRef(segment.ref);
|
|
7882
|
+
if (segment.ref.startsWith("task:") && resolved === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
|
|
7812
7883
|
const label = resolved !== void 0 && segment.ref.startsWith("task:") ? taskLabel(resolved.taskNumber) : refLabel(segment.ref);
|
|
7813
7884
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7814
7885
|
type: "button",
|
|
@@ -8071,7 +8142,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8071
8142
|
}
|
|
8072
8143
|
//#endregion
|
|
8073
8144
|
//#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/channel.module.css.mjs
|
|
8074
|
-
const css$3 = ".MYaRJa_headerMeta{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:6px;margin-top:7px;font-size:12px;line-height:18px;display:flex}.MYaRJa_headerMeta span+span:before{content:\"·\";margin-right:6px}.MYaRJa_taskFooter{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);cursor:pointer;text-align:left;background:0 0;border-radius:999px;align-items:center;gap:6px;max-width:100%;margin:6px 0 0;padding:2px 10px;transition:background-color .12s,border-color .12s,color .12s;display:inline-flex}.MYaRJa_taskFooter:hover,.MYaRJa_taskFooter:focus-visible{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l3);color:var(--dsw-alias-label-primary)}.MYaRJa_taskFooter:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.MYaRJa_taskNumber{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600;line-height:18px}.MYaRJa_taskStatus,.MYaRJa_taskCount{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:18px}.MYaRJa_taskDot{flex:none;align-items:center;width:8px;display:inline-flex}.
|
|
8145
|
+
const css$3 = ".MYaRJa_headerMeta{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:6px;margin-top:7px;font-size:12px;line-height:18px;display:flex}.MYaRJa_headerMeta span+span:before{content:\"·\";margin-right:6px}.MYaRJa_taskFooter{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);cursor:pointer;text-align:left;background:0 0;border-radius:999px;align-items:center;gap:6px;max-width:100%;margin:6px 0 0;padding:2px 10px;transition:background-color .12s,border-color .12s,color .12s;display:inline-flex}.MYaRJa_taskFooter:hover,.MYaRJa_taskFooter:focus-visible{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l3);color:var(--dsw-alias-label-primary)}.MYaRJa_taskFooter:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.MYaRJa_taskNumber{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600;line-height:18px}.MYaRJa_taskStatus,.MYaRJa_taskCount{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:18px}.MYaRJa_taskDot{flex:none;align-items:center;width:8px;display:inline-flex}.MYaRJa_taskArrow{color:var(--dsw-alias-label-tertiary);align-items:center;transition:transform .12s;display:inline-flex}.MYaRJa_taskFooter:hover .MYaRJa_taskArrow,.MYaRJa_taskFooter:focus-visible .MYaRJa_taskArrow{transform:translate(2px)}.MYaRJa_memberList{gap:3px;display:grid}.MYaRJa_memberRow{border-radius:6px;grid-template-columns:14px minmax(0,1fr) auto;align-items:center;gap:0 8px;min-height:40px;padding:4px 6px;display:grid}.MYaRJa_memberRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.MYaRJa_memberCopy{min-width:0;display:grid}.MYaRJa_memberCopy strong{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:18px;overflow:hidden}.MYaRJa_memberCopy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:14px;overflow:hidden}.MYaRJa_memberAction{min-width:60px}.MYaRJa_memberError{color:var(--dsw-alias-state-error-primary);grid-column:2/-1;margin:2px 0;font-size:11px;line-height:16px}.MYaRJa_modalBody{max-height:min(65vh,520px);overflow-y:auto}@media (width<=600px){.MYaRJa_memberRow{grid-template-columns:14px minmax(0,1fr)}.MYaRJa_memberAction{grid-column:2;justify-self:start;margin-top:3px}}@media (prefers-reduced-motion:reduce){.MYaRJa_taskFooter,.MYaRJa_taskArrow{transition:none}.MYaRJa_taskFooter:hover .MYaRJa_taskArrow,.MYaRJa_taskFooter:focus-visible .MYaRJa_taskArrow{transform:none}}";
|
|
8075
8146
|
const tagId$3 = "@wowyuarm/dsh-agent-team/channel.module.css";
|
|
8076
8147
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
|
|
8077
8148
|
const tag = document.createElement("style");
|
|
@@ -8091,7 +8162,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8091
8162
|
"taskArrow": "MYaRJa_taskArrow",
|
|
8092
8163
|
"taskCount": "MYaRJa_taskCount",
|
|
8093
8164
|
"taskDot": "MYaRJa_taskDot",
|
|
8094
|
-
"taskDotQuiet": "MYaRJa_taskDotQuiet",
|
|
8095
8165
|
"taskFooter": "MYaRJa_taskFooter",
|
|
8096
8166
|
"taskNumber": "MYaRJa_taskNumber",
|
|
8097
8167
|
"taskStatus": "MYaRJa_taskStatus"
|
|
@@ -8563,16 +8633,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8563
8633
|
children: [
|
|
8564
8634
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8565
8635
|
className: channel_module_css_default.taskDot,
|
|
8566
|
-
children: ((
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
state: dot
|
|
8571
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8572
|
-
className: channel_module_css_default.taskDotQuiet,
|
|
8573
|
-
"data-variant": dot
|
|
8574
|
-
});
|
|
8575
|
-
})()
|
|
8636
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamStateDot, {
|
|
8637
|
+
size: 8,
|
|
8638
|
+
state: taskStatusDot(item.task.status)
|
|
8639
|
+
})
|
|
8576
8640
|
}),
|
|
8577
8641
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8578
8642
|
className: channel_module_css_default.taskNumber,
|
|
@@ -8673,7 +8737,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8673
8737
|
return new Map(facts.map((fact) => [factKey(fact.fact), fact]));
|
|
8674
8738
|
}
|
|
8675
8739
|
function TeamThreadPage(props) {
|
|
8676
|
-
const { workspaceId, channelRef, taskRef, threadRef, taskNumber, backToWorkspace, selectChannel, selectThread, resolveTaskRefs, putAttachment, loadChannels, readThread, loadThreadHistory, subscribeChanges, loadMembers, drafts, getAttachment, reply, changeTask, promoteThread, t } = props;
|
|
8740
|
+
const { workspaceId, channelRef, taskRef, threadRef, taskNumber, backToWorkspace, selectChannel, selectThread, resolveTaskRefs, putAttachment, loadChannels, readThread, loadThreadHistory, threadObservations, subscribeChanges, loadMembers, drafts, getAttachment, reply, changeTask, promoteThread, t } = props;
|
|
8677
8741
|
const threadRequest = {
|
|
8678
8742
|
threadRef,
|
|
8679
8743
|
...taskRef === void 0 ? {} : { taskRef }
|
|
@@ -8681,6 +8745,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8681
8745
|
const [projection, setProjection] = (0, react.useState)();
|
|
8682
8746
|
const [channelView, setChannelView] = (0, react.useState)();
|
|
8683
8747
|
const [members, setMembers] = (0, react.useState)([]);
|
|
8748
|
+
const [followerIds, setFollowerIds] = (0, react.useState)(() => /* @__PURE__ */ new Set());
|
|
8684
8749
|
const [currentFacts, setCurrentFacts] = (0, react.useState)([]);
|
|
8685
8750
|
const [olderFacts, setOlderFacts] = (0, react.useState)([]);
|
|
8686
8751
|
const [readFacts, setReadFacts] = (0, react.useState)([]);
|
|
@@ -8809,10 +8874,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8809
8874
|
});
|
|
8810
8875
|
if (additions.length === 0) return;
|
|
8811
8876
|
if (!timeline.isPinned()) setNewFactsCount((current) => current + additions.length);
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8877
|
+
await readCurrent(true);
|
|
8878
|
+
} catch {}
|
|
8879
|
+
};
|
|
8880
|
+
const refreshFollowers = async () => {
|
|
8881
|
+
try {
|
|
8882
|
+
const result = await threadObservations({
|
|
8883
|
+
workspaceId,
|
|
8884
|
+
...threadRequest
|
|
8885
|
+
});
|
|
8886
|
+
if (!mountedRef.current || !result.ok) return;
|
|
8887
|
+
setFollowerIds(new Set(result.value.followers));
|
|
8816
8888
|
} catch {}
|
|
8817
8889
|
};
|
|
8818
8890
|
(0, react.useEffect)(() => {
|
|
@@ -8821,6 +8893,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8821
8893
|
setProjection(void 0);
|
|
8822
8894
|
setChannelView(void 0);
|
|
8823
8895
|
setMembers([]);
|
|
8896
|
+
setFollowerIds(/* @__PURE__ */ new Set());
|
|
8824
8897
|
setCurrentFacts([]);
|
|
8825
8898
|
currentFactsRef.current = [];
|
|
8826
8899
|
setOlderFacts([]);
|
|
@@ -8835,15 +8908,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8835
8908
|
sequenceRef.current = sequence;
|
|
8836
8909
|
setLoading(true);
|
|
8837
8910
|
(async () => {
|
|
8838
|
-
const [read, history] = await Promise.all([
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8911
|
+
const [read, history, observations] = await Promise.all([
|
|
8912
|
+
readThread({
|
|
8913
|
+
requestId: readRequestIdRef.current,
|
|
8914
|
+
workspaceId,
|
|
8915
|
+
...threadRequest
|
|
8916
|
+
}),
|
|
8917
|
+
loadThreadHistory({
|
|
8918
|
+
workspaceId,
|
|
8919
|
+
...threadRequest,
|
|
8920
|
+
limit: 20
|
|
8921
|
+
}).catch(() => void 0),
|
|
8922
|
+
threadObservations({
|
|
8923
|
+
workspaceId,
|
|
8924
|
+
...threadRequest
|
|
8925
|
+
}).catch(() => void 0)
|
|
8926
|
+
]);
|
|
8847
8927
|
if (!mountedRef.current || sequence !== sequenceRef.current) return;
|
|
8848
8928
|
if (!read.ok) {
|
|
8849
8929
|
setError(read.error.message);
|
|
@@ -8861,6 +8941,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8861
8941
|
setHistoryCursor(history.value.cursor);
|
|
8862
8942
|
setHistoryHasMore(history.value.hasMore);
|
|
8863
8943
|
}
|
|
8944
|
+
if (observations !== void 0 && observations.ok) setFollowerIds(new Set(observations.value.followers));
|
|
8864
8945
|
setError(void 0);
|
|
8865
8946
|
setLoading(false);
|
|
8866
8947
|
await drainUnread();
|
|
@@ -8876,6 +8957,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8876
8957
|
return;
|
|
8877
8958
|
}
|
|
8878
8959
|
refreshPassiveFacts();
|
|
8960
|
+
refreshFollowers();
|
|
8879
8961
|
}), subscribeChanges({
|
|
8880
8962
|
kind: "workspace",
|
|
8881
8963
|
workspaceId
|
|
@@ -8905,6 +8987,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8905
8987
|
olderFacts,
|
|
8906
8988
|
timeline
|
|
8907
8989
|
]);
|
|
8990
|
+
const handleTimelineScroll = () => {
|
|
8991
|
+
timeline.onScroll();
|
|
8992
|
+
if (timeline.isPinned()) setNewFactsCount(0);
|
|
8993
|
+
};
|
|
8908
8994
|
const loadOlder = async () => {
|
|
8909
8995
|
if (historyHasMore === false && historyCursor === void 0) return;
|
|
8910
8996
|
const beforeSequence = historyCursor ?? minSequence(currentFactsRef.current);
|
|
@@ -9297,7 +9383,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9297
9383
|
className: conversation_module_css_default.headerCopy,
|
|
9298
9384
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9299
9385
|
className: thread_module_css_default.titleLine,
|
|
9300
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", { children: task === void 0 ? t("threadLabel") : t("taskLabel", { number: resolvedTaskNumber ?? "…" }) }), task !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.
|
|
9386
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", { children: task === void 0 ? t("threadLabel") : t("taskLabel", { number: resolvedTaskNumber ?? "…" }) }), task !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Pill, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamStateDot, {
|
|
9387
|
+
size: 8,
|
|
9388
|
+
state: taskStatusDot(task.status)
|
|
9389
|
+
}), formatTaskStatus(task.status, t)] })]
|
|
9301
9390
|
}), taskTitle !== void 0 && taskTitle !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9302
9391
|
className: thread_module_css_default.taskTitle,
|
|
9303
9392
|
title: taskTitle,
|
|
@@ -9455,7 +9544,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9455
9544
|
}),
|
|
9456
9545
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
9457
9546
|
ref: timeline.ref,
|
|
9458
|
-
onScroll:
|
|
9547
|
+
onScroll: handleTimelineScroll,
|
|
9459
9548
|
className: conversation_module_css_default.timeline,
|
|
9460
9549
|
"aria-label": t("timelineLabel"),
|
|
9461
9550
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -9521,7 +9610,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9521
9610
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9522
9611
|
type: "button",
|
|
9523
9612
|
className: thread_module_css_default.newUpdatesJump,
|
|
9524
|
-
onClick:
|
|
9613
|
+
onClick: () => {
|
|
9614
|
+
setNewFactsCount(0);
|
|
9615
|
+
timeline.scrollToBottom();
|
|
9616
|
+
},
|
|
9525
9617
|
children: t("newUpdatesJump", { count: newFactsCount })
|
|
9526
9618
|
})
|
|
9527
9619
|
})
|
|
@@ -9549,6 +9641,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9549
9641
|
})]
|
|
9550
9642
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamComposer, {
|
|
9551
9643
|
members: channelMembers,
|
|
9644
|
+
followerMemberIds: followerIds,
|
|
9552
9645
|
recipients,
|
|
9553
9646
|
draft,
|
|
9554
9647
|
pending,
|
|
@@ -9579,7 +9672,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9579
9672
|
}
|
|
9580
9673
|
//#endregion
|
|
9581
9674
|
//#region src/client/TeamConversation.tsx
|
|
9582
|
-
function TeamConversation({ t, useWorkspaces, navigation, drafts, putAttachment, getAttachment, loadChannels, readThread, loadThreadHistory, subscribeChanges, loadMembers, sendMessage, joinChannel, removeChannelMember, reply, changeTask, promoteThread, selectThread, selectChannel, backToWorkspace, backToChannels, resolveTaskRefs }) {
|
|
9675
|
+
function TeamConversation({ t, useWorkspaces, navigation, drafts, putAttachment, getAttachment, loadChannels, readThread, loadThreadHistory, threadObservations, subscribeChanges, loadMembers, sendMessage, joinChannel, removeChannelMember, reply, changeTask, promoteThread, selectThread, selectChannel, backToWorkspace, backToChannels, resolveTaskRefs }) {
|
|
9583
9676
|
const navigationState = (0, react.useSyncExternalStore)(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
|
|
9584
9677
|
const current = useWorkspaces((state) => state.items).find((workspace) => workspace.workspaceId === navigationState.workspaceId);
|
|
9585
9678
|
if (current !== void 0 && navigationState.threadRef !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamThreadPage, {
|
|
@@ -9598,6 +9691,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9598
9691
|
readThread,
|
|
9599
9692
|
loadChannels,
|
|
9600
9693
|
loadThreadHistory,
|
|
9694
|
+
threadObservations,
|
|
9601
9695
|
subscribeChanges,
|
|
9602
9696
|
loadMembers,
|
|
9603
9697
|
reply,
|
|
@@ -9861,10 +9955,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9861
9955
|
children: [status.member.handle.replace("@", "").slice(0, 1).toUpperCase(), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
9862
9956
|
className: sidebar_module_css_default.agentAvatarBadge,
|
|
9863
9957
|
"aria-hidden": "true",
|
|
9864
|
-
children:
|
|
9865
|
-
state,
|
|
9866
|
-
size: 8
|
|
9867
|
-
})
|
|
9958
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamStateDot, { state })
|
|
9868
9959
|
})]
|
|
9869
9960
|
})
|
|
9870
9961
|
});
|
|
@@ -10452,7 +10543,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10452
10543
|
}
|
|
10453
10544
|
//#endregion
|
|
10454
10545
|
//#region src/client/TeamAgentsPanel.tsx
|
|
10455
|
-
function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, addMember, updateMember, recoverMember,
|
|
10546
|
+
function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, addMember, updateMember, recoverMember, archiveMember, loadModels, memberSessionId, openMemberSession, onCreatingChange, t }) {
|
|
10456
10547
|
const [members, setMembers] = (0, react.useState)([]);
|
|
10457
10548
|
const [loading, setLoading] = (0, react.useState)(true);
|
|
10458
10549
|
const [error, setError] = (0, react.useState)();
|
|
@@ -10476,15 +10567,52 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10476
10567
|
onCommit: applyMove
|
|
10477
10568
|
});
|
|
10478
10569
|
const sectionOpen = useSidebarSectionOpen(workspaceId, "agents");
|
|
10570
|
+
const observedSessionIds = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
10571
|
+
const pendingFollows = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
10572
|
+
const seatSessionIdRef = (0, react.useRef)(memberSessionId);
|
|
10573
|
+
seatSessionIdRef.current = memberSessionId;
|
|
10574
|
+
const openMemberSessionRef = (0, react.useRef)(openMemberSession);
|
|
10575
|
+
openMemberSessionRef.current = openMemberSession;
|
|
10576
|
+
const followRollover = (0, react.useCallback)((statuses) => {
|
|
10577
|
+
for (const status of statuses) {
|
|
10578
|
+
const memberId = status.member.memberId;
|
|
10579
|
+
const observed = observedSessionIds.current.get(memberId);
|
|
10580
|
+
if (observed === void 0) {
|
|
10581
|
+
observedSessionIds.current.set(memberId, status.member.sessionId);
|
|
10582
|
+
continue;
|
|
10583
|
+
}
|
|
10584
|
+
if (observed !== status.member.sessionId) {
|
|
10585
|
+
observedSessionIds.current.set(memberId, status.member.sessionId);
|
|
10586
|
+
const seatSessionId = seatSessionIdRef.current;
|
|
10587
|
+
if (seatSessionId !== void 0 && observed === seatSessionId) pendingFollows.current.set(memberId, {
|
|
10588
|
+
previousSessionId: observed,
|
|
10589
|
+
nextSessionId: status.member.sessionId
|
|
10590
|
+
});
|
|
10591
|
+
else pendingFollows.current.delete(memberId);
|
|
10592
|
+
}
|
|
10593
|
+
const pending = pendingFollows.current.get(memberId);
|
|
10594
|
+
if (pending !== void 0 && pending.nextSessionId === status.member.sessionId && status.availability === "active") {
|
|
10595
|
+
const seatSessionId = seatSessionIdRef.current;
|
|
10596
|
+
pendingFollows.current.delete(memberId);
|
|
10597
|
+
if (seatSessionId !== void 0 && seatSessionId === pending.previousSessionId) openMemberSessionRef.current(pending.nextSessionId);
|
|
10598
|
+
}
|
|
10599
|
+
}
|
|
10600
|
+
}, []);
|
|
10479
10601
|
const refresh = (0, react.useCallback)(async () => {
|
|
10480
10602
|
setLoading(true);
|
|
10481
10603
|
const result = await loadMembers({ workspaceId });
|
|
10482
10604
|
if (result.ok) {
|
|
10483
|
-
|
|
10605
|
+
const next = result.value.filter((status) => status.member.state !== "inactive" && status.member.state !== "archived");
|
|
10606
|
+
setMembers(next);
|
|
10607
|
+
followRollover(next);
|
|
10484
10608
|
setError(void 0);
|
|
10485
10609
|
} else setError(result.error.message);
|
|
10486
10610
|
setLoading(false);
|
|
10487
|
-
}, [
|
|
10611
|
+
}, [
|
|
10612
|
+
loadMembers,
|
|
10613
|
+
workspaceId,
|
|
10614
|
+
followRollover
|
|
10615
|
+
]);
|
|
10488
10616
|
(0, react.useEffect)(() => {
|
|
10489
10617
|
refresh();
|
|
10490
10618
|
}, [refresh]);
|
|
@@ -10666,7 +10794,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10666
10794
|
...memberSessionId === void 0 ? {} : { current: status.member.sessionId === memberSessionId },
|
|
10667
10795
|
updateMember,
|
|
10668
10796
|
recoverMember,
|
|
10669
|
-
clearMemberContext,
|
|
10670
10797
|
archiveMember,
|
|
10671
10798
|
loadModels,
|
|
10672
10799
|
openMemberSession,
|
|
@@ -10700,10 +10827,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10700
10827
|
* conversation page, the avatar carries identity plus the presence badge, and
|
|
10701
10828
|
* the row menu opens the editor.
|
|
10702
10829
|
*/
|
|
10703
|
-
function AgentRow({ status, current, updateMember, recoverMember,
|
|
10830
|
+
function AgentRow({ status, current, updateMember, recoverMember, archiveMember, loadModels, openMemberSession, onUpdated, t }) {
|
|
10704
10831
|
const [menuOpen, setMenuOpen] = (0, react.useState)(false);
|
|
10705
10832
|
const [editing, setEditing] = (0, react.useState)(false);
|
|
10706
|
-
const [clearing, setClearing] = (0, react.useState)(false);
|
|
10707
10833
|
const [archiving, setArchiving] = (0, react.useState)(false);
|
|
10708
10834
|
const [rowAlert, setRowAlert] = (0, react.useState)();
|
|
10709
10835
|
const recover = async () => {
|
|
@@ -10728,25 +10854,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10728
10854
|
setRowAlert(t("restartFailed", { message: cause instanceof Error ? cause.message : String(cause) }));
|
|
10729
10855
|
}
|
|
10730
10856
|
};
|
|
10731
|
-
const clearContext = async () => {
|
|
10732
|
-
try {
|
|
10733
|
-
const result = await clearMemberContext({
|
|
10734
|
-
requestId: mintRequestId(),
|
|
10735
|
-
workspaceId: status.member.workspaceId,
|
|
10736
|
-
memberId: status.member.memberId
|
|
10737
|
-
});
|
|
10738
|
-
await onUpdated();
|
|
10739
|
-
if (!result.ok) {
|
|
10740
|
-
setRowAlert(t("clearContextFailed", { message: result.error.message }));
|
|
10741
|
-
return;
|
|
10742
|
-
}
|
|
10743
|
-
setRowAlert(void 0);
|
|
10744
|
-
if (current === true) openMemberSession(result.value.status.member.sessionId);
|
|
10745
|
-
} catch (cause) {
|
|
10746
|
-
setRowAlert(t("clearContextFailed", { message: cause instanceof Error ? cause.message : String(cause) }));
|
|
10747
|
-
}
|
|
10748
|
-
};
|
|
10749
|
-
const contextClearable = status.presence === "available" || status.presence === "error";
|
|
10750
10857
|
const archive = async () => {
|
|
10751
10858
|
try {
|
|
10752
10859
|
const result = await archiveMember({
|
|
@@ -10799,18 +10906,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10799
10906
|
label: t("restartAgent"),
|
|
10800
10907
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16, {})
|
|
10801
10908
|
}] : [],
|
|
10802
|
-
{
|
|
10803
|
-
id: "clear-context",
|
|
10804
|
-
label: t("clearContextAgent"),
|
|
10805
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconNewChatOutline16, {}),
|
|
10806
|
-
danger: true,
|
|
10807
|
-
disabled: !contextClearable
|
|
10808
|
-
},
|
|
10809
|
-
...!contextClearable ? [{
|
|
10810
|
-
type: "label",
|
|
10811
|
-
id: "clear-context-reason",
|
|
10812
|
-
text: status.presence === "working" ? t("clearContextWorkingReason") : t("clearContextUnavailableReason")
|
|
10813
|
-
}] : [],
|
|
10814
10909
|
{
|
|
10815
10910
|
id: "archive",
|
|
10816
10911
|
label: t("archiveAgent"),
|
|
@@ -10820,7 +10915,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10820
10915
|
],
|
|
10821
10916
|
onSelect: (id) => {
|
|
10822
10917
|
if (id === "edit") setEditing(true);
|
|
10823
|
-
else if (id === "clear-context") setClearing(true);
|
|
10824
10918
|
else if (id === "archive") setArchiving(true);
|
|
10825
10919
|
else recover();
|
|
10826
10920
|
},
|
|
@@ -10833,33 +10927,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10833
10927
|
role: "alert",
|
|
10834
10928
|
children: rowAlert
|
|
10835
10929
|
}),
|
|
10836
|
-
clearing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
10837
|
-
open: true,
|
|
10838
|
-
onClose: () => {
|
|
10839
|
-
setClearing(false);
|
|
10840
|
-
},
|
|
10841
|
-
title: t("clearContextTitle", { name: status.member.handle }),
|
|
10842
|
-
closeLabel: t("close"),
|
|
10843
|
-
contentClassName: create_module_css_default.dialogContent,
|
|
10844
|
-
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
10845
|
-
variant: "outline",
|
|
10846
|
-
onClick: () => {
|
|
10847
|
-
setClearing(false);
|
|
10848
|
-
},
|
|
10849
|
-
children: t("cancel")
|
|
10850
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
10851
|
-
variant: "primary",
|
|
10852
|
-
onClick: () => {
|
|
10853
|
-
setClearing(false);
|
|
10854
|
-
clearContext();
|
|
10855
|
-
},
|
|
10856
|
-
children: t("clearContextConfirm")
|
|
10857
|
-
})] }),
|
|
10858
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10859
|
-
className: create_module_css_default.error,
|
|
10860
|
-
children: t("clearContextNotice", { name: status.member.handle })
|
|
10861
|
-
})
|
|
10862
|
-
}),
|
|
10863
10930
|
archiving && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
10864
10931
|
open: true,
|
|
10865
10932
|
onClose: () => {
|
|
@@ -11503,7 +11570,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11503
11570
|
}
|
|
11504
11571
|
//#endregion
|
|
11505
11572
|
//#region src/client/TeamWorkspaceBrowser.tsx
|
|
11506
|
-
function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, archiveChannel, updateMember, recoverMember,
|
|
11573
|
+
function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, archiveChannel, updateMember, recoverMember, archiveMember, joinChannel, removeChannelMember, loadModels, openMemberSession }) {
|
|
11507
11574
|
const navigationState = (0, react.useSyncExternalStore)(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
|
|
11508
11575
|
const workspaces = useWorkspaces((state) => state.items);
|
|
11509
11576
|
const selected = navigationState.workspaceId;
|
|
@@ -11612,7 +11679,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11612
11679
|
addMember,
|
|
11613
11680
|
updateMember,
|
|
11614
11681
|
recoverMember,
|
|
11615
|
-
clearMemberContext,
|
|
11616
11682
|
archiveMember,
|
|
11617
11683
|
loadModels,
|
|
11618
11684
|
...navigationState.memberSessionId === void 0 ? {} : { memberSessionId: navigationState.memberSessionId },
|
|
@@ -11627,124 +11693,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11627
11693
|
});
|
|
11628
11694
|
}
|
|
11629
11695
|
//#endregion
|
|
11630
|
-
//#region src/client/TeamMemberDock.tsx
|
|
11631
|
-
/**
|
|
11632
|
-
* Team-owned strip above the shipped composer while a Member Session is
|
|
11633
|
-
* embedded. The shipped InputBar keeps the whole input surface (draft,
|
|
11634
|
-
* trigger menus, submit); this dock only carries what the shipped bar cannot
|
|
11635
|
-
* know — the Member-Session vocabulary hint and the Member turn's prompt
|
|
11636
|
-
* error, read through the standard useSession hook.
|
|
11637
|
-
*/
|
|
11638
|
-
function TeamMemberDock({ t, useSession }) {
|
|
11639
|
-
const promptError = useSession((state) => state.promptError ?? null);
|
|
11640
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11641
|
-
className: composer_module_css_default.memberSessionDock,
|
|
11642
|
-
"data-team-member-dock": "true",
|
|
11643
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11644
|
-
className: composer_module_css_default.memberSessionHint,
|
|
11645
|
-
children: t("memberSessionHint")
|
|
11646
|
-
}), promptError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11647
|
-
className: composer_module_css_default.memberSessionStatus,
|
|
11648
|
-
role: "alert",
|
|
11649
|
-
children: promptError.error.message
|
|
11650
|
-
})]
|
|
11651
|
-
});
|
|
11652
|
-
}
|
|
11653
|
-
//#endregion
|
|
11654
|
-
//#region src/client/member-session-input.ts
|
|
11655
|
-
const TEAM_COMMAND_SOURCE = "agent-team-command";
|
|
11656
|
-
const TEAM_MEMBER_SOURCE = "agent-team-member";
|
|
11657
|
-
/** Preserve the public Session command admission contract, not handler outcome. */
|
|
11658
|
-
async function admitTeamCompact(session) {
|
|
11659
|
-
const result = await session.command("/compact");
|
|
11660
|
-
if (!result.ok) throw new Error(`session.command failed: ${result.error.message}`);
|
|
11661
|
-
return result.value.matched ? { kind: "success" } : {
|
|
11662
|
-
kind: "error",
|
|
11663
|
-
text: "unknown command: /compact"
|
|
11664
|
-
};
|
|
11665
|
-
}
|
|
11666
|
-
/**
|
|
11667
|
-
* The two Team-only sources live in the shared public registry, but their
|
|
11668
|
-
* candidate plane is inert for every ordinary Session. The member source owns
|
|
11669
|
-
* its stable ref→label cache so serialization never falls back to guessing a
|
|
11670
|
-
* handle from plain text.
|
|
11671
|
-
*/
|
|
11672
|
-
function createTeamMemberSessionSources(options) {
|
|
11673
|
-
const labels = /* @__PURE__ */ new Map();
|
|
11674
|
-
return [{
|
|
11675
|
-
trigger: "/",
|
|
11676
|
-
name: TEAM_COMMAND_SOURCE,
|
|
11677
|
-
showGroupTitle: false,
|
|
11678
|
-
async candidates(session, { query }) {
|
|
11679
|
-
if (!options.isEmbeddedMemberSession(session.sessionId) || !"compact".startsWith(query.toLocaleLowerCase())) return [];
|
|
11680
|
-
return [{
|
|
11681
|
-
name: "/compact",
|
|
11682
|
-
description: "压缩当前 Session 上下文",
|
|
11683
|
-
value: "compact"
|
|
11684
|
-
}];
|
|
11685
|
-
},
|
|
11686
|
-
onPick({ candidate, session }) {
|
|
11687
|
-
if (candidate.value !== "compact" || !options.isEmbeddedMemberSession(session.sessionId)) return void 0;
|
|
11688
|
-
return { claim: {
|
|
11689
|
-
token: "/compact",
|
|
11690
|
-
submit: async () => options.executeCompact(session.sessionId)
|
|
11691
|
-
} };
|
|
11692
|
-
},
|
|
11693
|
-
async matchEnter(session, line) {
|
|
11694
|
-
if (!options.isEmbeddedMemberSession(session.sessionId)) return void 0;
|
|
11695
|
-
if (line.trim() !== "/compact") return void 0;
|
|
11696
|
-
return { claim: {
|
|
11697
|
-
token: "/compact",
|
|
11698
|
-
submit: async () => options.executeCompact(session.sessionId)
|
|
11699
|
-
} };
|
|
11700
|
-
}
|
|
11701
|
-
}, {
|
|
11702
|
-
trigger: "@",
|
|
11703
|
-
name: TEAM_MEMBER_SOURCE,
|
|
11704
|
-
showGroupTitle: false,
|
|
11705
|
-
async candidates(session, { query, signal }) {
|
|
11706
|
-
if (!options.isEmbeddedMemberSession(session.sessionId)) return [];
|
|
11707
|
-
const normalized = query.toLocaleLowerCase();
|
|
11708
|
-
const members = await options.members();
|
|
11709
|
-
if (signal.aborted) return [];
|
|
11710
|
-
return members.filter((status) => status.member.sessionId !== session.sessionId && status.member.state !== "inactive" && status.member.state !== "archived").filter((status) => status.member.handle.toLocaleLowerCase().startsWith(normalized)).map((status) => {
|
|
11711
|
-
labels.set(status.member.memberId, `@${status.member.handle}`);
|
|
11712
|
-
return {
|
|
11713
|
-
name: `@${status.member.handle}`,
|
|
11714
|
-
description: "引用成员 · 不会通知",
|
|
11715
|
-
value: String(status.member.memberId)
|
|
11716
|
-
};
|
|
11717
|
-
});
|
|
11718
|
-
},
|
|
11719
|
-
onPick({ candidate, session }) {
|
|
11720
|
-
if (!options.isEmbeddedMemberSession(session.sessionId) || candidate.value === void 0) return void 0;
|
|
11721
|
-
const ref = candidate.value;
|
|
11722
|
-
const label = labels.get(ref);
|
|
11723
|
-
if (label === void 0) return void 0;
|
|
11724
|
-
return { insert: {
|
|
11725
|
-
source: TEAM_MEMBER_SOURCE,
|
|
11726
|
-
label: label.slice(1),
|
|
11727
|
-
ref,
|
|
11728
|
-
clipboardText: label
|
|
11729
|
-
} };
|
|
11730
|
-
},
|
|
11731
|
-
codec: {
|
|
11732
|
-
clipboardText: (ref) => labels.get(ref) ?? `@${String(ref)}`,
|
|
11733
|
-
serialize: async (ref) => {
|
|
11734
|
-
const stable = String(ref);
|
|
11735
|
-
const label = labels.get(ref) ?? "";
|
|
11736
|
-
return `<team-member ref="${escapeAttribute(stable)}">${escapeText(label)}</team-member>`;
|
|
11737
|
-
}
|
|
11738
|
-
}
|
|
11739
|
-
}];
|
|
11740
|
-
}
|
|
11741
|
-
function escapeText(value) {
|
|
11742
|
-
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
11743
|
-
}
|
|
11744
|
-
function escapeAttribute(value) {
|
|
11745
|
-
return escapeText(value).replaceAll("\"", """).replaceAll("'", "'");
|
|
11746
|
-
}
|
|
11747
|
-
//#endregion
|
|
11748
11696
|
//#region src/client/locales.ts
|
|
11749
11697
|
const zh = {
|
|
11750
11698
|
team: "团队",
|
|
@@ -11760,7 +11708,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11760
11708
|
addAgent: "添加 Agent",
|
|
11761
11709
|
cancel: "取消",
|
|
11762
11710
|
close: "关闭",
|
|
11763
|
-
memberSessionHint: "成员会话:/compact 压缩上下文 · @成员 引用;普通消息直接发给该成员。",
|
|
11764
11711
|
copyCode: "复制",
|
|
11765
11712
|
copiedCode: "已复制",
|
|
11766
11713
|
markdownFootnotes: "脚注",
|
|
@@ -11790,13 +11737,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11790
11737
|
restartAgent: "重启",
|
|
11791
11738
|
restartStillUnavailable: "重启已执行,成员仍不可用:{diagnostic}",
|
|
11792
11739
|
restartFailed: "重启执行失败:{message}",
|
|
11793
|
-
clearContextAgent: "从全新上下文开始",
|
|
11794
|
-
clearContextWorkingReason: "成员正在工作中,完成后才能清空上下文",
|
|
11795
|
-
clearContextUnavailableReason: "成员当前不可用,恢复在线且空闲后才能清空上下文",
|
|
11796
|
-
clearContextTitle: "从全新上下文开始:{name}",
|
|
11797
|
-
clearContextNotice: "将结束 {name} 当前的会话上下文并从空白开始:旧对话会归档保留在会话记录中。{name} 的身份、私有记忆与 notes、频道和会话绑定都保持不变,后续协作从新上下文继续累积。",
|
|
11798
|
-
clearContextConfirm: "开始全新上下文",
|
|
11799
|
-
clearContextFailed: "清空上下文失败:{message}",
|
|
11800
11740
|
archiveAgent: "归档",
|
|
11801
11741
|
archiveAgentTitle: "归档 Agent:{name}",
|
|
11802
11742
|
archiveAgentNotice: "将把 {name} 从所有列表收起:会话与私有记忆保留在磁盘上、活跃 Claim 会释放,但暂无恢复入口。",
|
|
@@ -11916,7 +11856,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11916
11856
|
addAgent: "Add Agent",
|
|
11917
11857
|
cancel: "Cancel",
|
|
11918
11858
|
close: "Close",
|
|
11919
|
-
memberSessionHint: "Member session: /compact compresses context · @member inserts a reference; plain messages go straight to the member.",
|
|
11920
11859
|
copyCode: "Copy",
|
|
11921
11860
|
copiedCode: "Copied",
|
|
11922
11861
|
markdownFootnotes: "Footnotes",
|
|
@@ -11946,13 +11885,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11946
11885
|
restartAgent: "Restart",
|
|
11947
11886
|
restartStillUnavailable: "Restart ran, but the Member is still unavailable: {diagnostic}",
|
|
11948
11887
|
restartFailed: "Restart failed: {message}",
|
|
11949
|
-
clearContextAgent: "Start from new context",
|
|
11950
|
-
clearContextWorkingReason: "The Member is working; clear once the current turn ends",
|
|
11951
|
-
clearContextUnavailableReason: "The Member is unavailable; only an idle available Member can start from a new context",
|
|
11952
|
-
clearContextTitle: "Start from new context: {name}",
|
|
11953
|
-
clearContextNotice: "This ends {name}'s current session context and starts blank: the previous conversation is archived and stays in the session history. {name}'s identity, private memory and notes, channel and session bindings are untouched, and future collaboration accumulates from the new context.",
|
|
11954
|
-
clearContextConfirm: "Start from new context",
|
|
11955
|
-
clearContextFailed: "Failed to clear context: {message}",
|
|
11956
11888
|
archiveAgent: "Archive",
|
|
11957
11889
|
archiveAgentTitle: "Archive Agent: {name}",
|
|
11958
11890
|
archiveAgentNotice: "This hides {name} from every list: the session log and private memory stay on disk and active Claims release, but there is no restore entry point yet.",
|
|
@@ -12069,8 +12001,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12069
12001
|
"remote.session",
|
|
12070
12002
|
"sessions",
|
|
12071
12003
|
"connection",
|
|
12072
|
-
"conversation"
|
|
12073
|
-
"inputTriggers"
|
|
12004
|
+
"conversation"
|
|
12074
12005
|
];
|
|
12075
12006
|
function registerModeShadow(ctx, navigation, changes, drafts, name, component, extraInject) {
|
|
12076
12007
|
const openMemberSessionImpl = (sessionId) => {
|
|
@@ -12114,6 +12045,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12114
12045
|
...name === "conversation" ? {
|
|
12115
12046
|
readThread: (request) => ctx.remote.agentTeam.readThread(request),
|
|
12116
12047
|
loadThreadHistory: (request) => ctx.remote.agentTeam.threadHistory(request),
|
|
12048
|
+
threadObservations: (request) => ctx.remote.agentTeam.threadObservations(request),
|
|
12117
12049
|
sendMessage: (request) => ctx.remote.agentTeam.sendMessage(request),
|
|
12118
12050
|
putAttachment: (request) => ctx.remote.agentTeam.putAttachment(request),
|
|
12119
12051
|
getAttachment: (request) => ctx.remote.agentTeam.getAttachment(request),
|
|
@@ -12142,37 +12074,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12142
12074
|
};
|
|
12143
12075
|
});
|
|
12144
12076
|
}
|
|
12145
|
-
function registerMemberSessionDock(ctx, navigation) {
|
|
12146
|
-
ctx.slots.inject("conversation.input.dock", () => {
|
|
12147
|
-
let dispose;
|
|
12148
|
-
let registeredSessionId;
|
|
12149
|
-
const reconcile = () => {
|
|
12150
|
-
const memberSessionId = navigation.getSnapshot().memberSessionId;
|
|
12151
|
-
const active = navigation.getSnapshot().mode === "team" && memberSessionId !== void 0;
|
|
12152
|
-
if (dispose !== void 0 && (!active || registeredSessionId !== memberSessionId)) {
|
|
12153
|
-
dispose();
|
|
12154
|
-
dispose = void 0;
|
|
12155
|
-
registeredSessionId = void 0;
|
|
12156
|
-
}
|
|
12157
|
-
if (active && dispose === void 0) {
|
|
12158
|
-
registeredSessionId = memberSessionId;
|
|
12159
|
-
const sessions = ctx.sessions;
|
|
12160
|
-
dispose = ctx.slots.register({
|
|
12161
|
-
name: "conversation.input.dock",
|
|
12162
|
-
id: "agent-team-member",
|
|
12163
|
-
locale: NS,
|
|
12164
|
-
select: () => sessions.list.getSnapshot().current === memberSessionId ? {} : null
|
|
12165
|
-
}, TeamMemberDock);
|
|
12166
|
-
}
|
|
12167
|
-
};
|
|
12168
|
-
const offNavigation = navigation.subscribe(reconcile);
|
|
12169
|
-
reconcile();
|
|
12170
|
-
return () => {
|
|
12171
|
-
offNavigation();
|
|
12172
|
-
dispose?.();
|
|
12173
|
-
};
|
|
12174
|
-
});
|
|
12175
|
-
}
|
|
12176
12077
|
function applyUi(ctx) {
|
|
12177
12078
|
ctx.effect(() => ctx.locale.register(NS, {
|
|
12178
12079
|
zh,
|
|
@@ -12188,34 +12089,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12188
12089
|
disposeNavigation();
|
|
12189
12090
|
disposeDrafts();
|
|
12190
12091
|
}, "agent-team: navigation service");
|
|
12191
|
-
const changes = new TeamChangeStream((request, signal) => ctx.remote.agentTeam.changes(request, signal));
|
|
12192
|
-
const triggerSources = createTeamMemberSessionSources({
|
|
12193
|
-
isEmbeddedMemberSession: (sessionId) => {
|
|
12194
|
-
const snapshot = navigation.getSnapshot();
|
|
12195
|
-
return snapshot.mode === "team" && snapshot.memberSessionId === sessionId && snapshot.workspaceId !== void 0;
|
|
12196
|
-
},
|
|
12197
|
-
members: async () => {
|
|
12198
|
-
const workspaceId = navigation.getSnapshot().workspaceId;
|
|
12199
|
-
if (workspaceId === void 0) return [];
|
|
12200
|
-
const result = await ctx.remote.agentTeam.members({ workspaceId });
|
|
12201
|
-
return result.ok ? result.value : [];
|
|
12202
|
-
},
|
|
12203
|
-
executeCompact: async (sessionId) => {
|
|
12204
|
-
const actx = ctx.sessions.scope(sessionId);
|
|
12205
|
-
const session = actx === void 0 ? void 0 : ctx.sessions.sessionOf(actx);
|
|
12206
|
-
return session === void 0 ? {
|
|
12207
|
-
kind: "error",
|
|
12208
|
-
text: "current Member Session is unavailable"
|
|
12209
|
-
} : admitTeamCompact(session);
|
|
12210
|
-
}
|
|
12211
|
-
});
|
|
12212
|
-
const inputTriggers = ctx.get("inputTriggers");
|
|
12213
12092
|
ctx.effect(() => {
|
|
12214
|
-
|
|
12093
|
+
let previous = navigation.getSnapshot();
|
|
12094
|
+
const restore = () => {
|
|
12095
|
+
const snapshot = navigation.getSnapshot();
|
|
12096
|
+
const departed = previous.memberSessionId;
|
|
12097
|
+
const returnTo = previous.returnToSessionId;
|
|
12098
|
+
previous = snapshot;
|
|
12099
|
+
if (departed === void 0 || snapshot.memberSessionId !== void 0) return;
|
|
12100
|
+
const sessions = ctx.sessions;
|
|
12101
|
+
if (sessions.list.getSnapshot().current !== departed) return;
|
|
12102
|
+
if (returnTo !== void 0 && sessions.list.getSnapshot().byId[returnTo] !== void 0) sessions.open(returnTo);
|
|
12103
|
+
else sessions.clear();
|
|
12104
|
+
};
|
|
12105
|
+
const unsubscribe = navigation.subscribe(restore);
|
|
12215
12106
|
return () => {
|
|
12216
|
-
|
|
12107
|
+
unsubscribe();
|
|
12108
|
+
restore();
|
|
12217
12109
|
};
|
|
12218
|
-
}, "agent-team:
|
|
12110
|
+
}, "agent-team: member session restore");
|
|
12111
|
+
const changes = new TeamChangeStream((request, signal) => ctx.remote.agentTeam.changes(request, signal));
|
|
12219
12112
|
const loadMemberGroups = async () => {
|
|
12220
12113
|
const workspaces = ctx.workspaces.list.getSnapshot().items;
|
|
12221
12114
|
return (await Promise.all(workspaces.map(async (workspace) => {
|
|
@@ -12238,14 +12131,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12238
12131
|
navigation,
|
|
12239
12132
|
...navigation.actions(),
|
|
12240
12133
|
leaveTeam: () => {
|
|
12241
|
-
const snapshot = navigation.getSnapshot();
|
|
12242
|
-
if (snapshot.memberSessionId === void 0) {
|
|
12243
|
-
navigation.actions().leaveTeam();
|
|
12244
|
-
return;
|
|
12245
|
-
}
|
|
12246
|
-
const returnTo = snapshot.returnToSessionId;
|
|
12247
12134
|
navigation.actions().exitMemberSession();
|
|
12248
|
-
if (returnTo !== void 0) ctx.sessions.open(returnTo);
|
|
12249
12135
|
navigation.actions().leaveTeam();
|
|
12250
12136
|
},
|
|
12251
12137
|
loadMemberGroups
|
|
@@ -12253,7 +12139,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12253
12139
|
}, TeamFooterAction));
|
|
12254
12140
|
registerModeShadow(ctx, navigation, changes, drafts, "sidebar.workspaces", TeamWorkspaceBrowser);
|
|
12255
12141
|
registerModeShadow(ctx, navigation, changes, drafts, "conversation", TeamConversation);
|
|
12256
|
-
registerMemberSessionDock(ctx, navigation);
|
|
12257
12142
|
registerModeShadow(ctx, navigation, changes, drafts, "sidebar.settings", TeamSettings, () => ({ loadMemberGroups }));
|
|
12258
12143
|
}
|
|
12259
12144
|
async function apply(ctx) {
|