taskcarry 0.3.2__py3-none-any.whl
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.
- taskcarry/__init__.py +3 -0
- taskcarry/__main__.py +4 -0
- taskcarry/adapter_contracts.py +166 -0
- taskcarry/agy_turns.py +282 -0
- taskcarry/api.py +111 -0
- taskcarry/board.py +313 -0
- taskcarry/board_assets/board.css +1087 -0
- taskcarry/board_assets/board.js +1187 -0
- taskcarry/board_assets/browse.js +214 -0
- taskcarry/board_assets/index.html +43 -0
- taskcarry/board_assets/taskcarry-icon.ico +0 -0
- taskcarry/board_assets/taskcarry-mark.svg +28 -0
- taskcarry/board_data.py +466 -0
- taskcarry/chat_joins.py +157 -0
- taskcarry/cli.py +119 -0
- taskcarry/codex_capture.py +184 -0
- taskcarry/codex_host.py +293 -0
- taskcarry/collaboration_exchange.py +316 -0
- taskcarry/connection.py +159 -0
- taskcarry/continuity.py +300 -0
- taskcarry/contracts.py +165 -0
- taskcarry/conversation_capture.py +669 -0
- taskcarry/core.py +896 -0
- taskcarry/cycle_contracts.py +73 -0
- taskcarry/discovery.py +434 -0
- taskcarry/discovery_contracts.py +52 -0
- taskcarry/exchange_contracts.py +67 -0
- taskcarry/exchange_endpoint.py +377 -0
- taskcarry/exchange_packets.py +142 -0
- taskcarry/experience_contracts.py +129 -0
- taskcarry/experience_exchange.py +214 -0
- taskcarry/experience_notes.py +433 -0
- taskcarry/experience_storage.py +125 -0
- taskcarry/experience_tools.py +26 -0
- taskcarry/feishu/__init__.py +1 -0
- taskcarry/feishu/display.py +122 -0
- taskcarry/feishu/project_watch.py +145 -0
- taskcarry/feishu/review_sets.py +80 -0
- taskcarry/feishu/sender.py +42 -0
- taskcarry/feishu/subscription.py +193 -0
- taskcarry/feishu/windows_agent.py +287 -0
- taskcarry/feishu/windows_secret.py +34 -0
- taskcarry/gitops.py +170 -0
- taskcarry/governance.py +88 -0
- taskcarry/governance_cycle.py +775 -0
- taskcarry/identification.py +82 -0
- taskcarry/integration.py +663 -0
- taskcarry/maintenance.py +118 -0
- taskcarry/mcp.py +183 -0
- taskcarry/member_join.py +184 -0
- taskcarry/member_routing.py +145 -0
- taskcarry/onboarding.py +272 -0
- taskcarry/onboarding_complete.py +252 -0
- taskcarry/path_batches.py +19 -0
- taskcarry/preservation.py +257 -0
- taskcarry/project_collaboration.py +453 -0
- taskcarry/project_history.py +166 -0
- taskcarry/project_identity.py +51 -0
- taskcarry/project_recovery.py +824 -0
- taskcarry/recovery_contracts.py +25 -0
- taskcarry/recovery_files.py +153 -0
- taskcarry/recovery_git.py +234 -0
- taskcarry/remote_capture.py +89 -0
- taskcarry/remote_transfer.py +356 -0
- taskcarry/role_connection.py +215 -0
- taskcarry/setup.py +597 -0
- taskcarry/shared_workbench.py +480 -0
- taskcarry/skill_data/taskcarry-experience-recovery/SKILL.md +37 -0
- taskcarry/skill_data/taskcarry-governance-reconcile/SKILL.md +47 -0
- taskcarry/skill_data/taskcarry-governance-reconcile/references/daily-governance.md +72 -0
- taskcarry/skill_data/taskcarry-project-setup/SKILL.md +48 -0
- taskcarry/skill_data/taskcarry-project-setup/references/onboarding.md +198 -0
- taskcarry/skill_data/taskcarry-task-delivery/SKILL.md +32 -0
- taskcarry/skill_data/taskcarry-task-delivery/references/conditional-experience.md +93 -0
- taskcarry/skill_data/taskcarry-task-delivery/references/worker-channel.md +41 -0
- taskcarry/source_review_set.py +80 -0
- taskcarry/state_format.py +47 -0
- taskcarry/store.py +472 -0
- taskcarry/task_context.py +141 -0
- taskcarry/text_handback.py +98 -0
- taskcarry/transfer_contracts.py +18 -0
- taskcarry/updates.py +351 -0
- taskcarry/workbench.py +625 -0
- taskcarry/workbench_contracts.py +32 -0
- taskcarry/workbuddy_capture.py +451 -0
- taskcarry/workbuddy_setup.py +212 -0
- taskcarry/worker_channel.py +859 -0
- taskcarry/worker_contracts.py +190 -0
- taskcarry/worker_storage.py +60 -0
- taskcarry/worker_tools.py +111 -0
- taskcarry-0.3.2.dist-info/METADATA +203 -0
- taskcarry-0.3.2.dist-info/RECORD +105 -0
- taskcarry-0.3.2.dist-info/WHEEL +5 -0
- taskcarry-0.3.2.dist-info/entry_points.txt +5 -0
- taskcarry-0.3.2.dist-info/licenses/LICENSE +21 -0
- taskcarry-0.3.2.dist-info/licenses/LICENSE_SCOPE.md +31 -0
- taskcarry-0.3.2.dist-info/top_level.txt +2 -0
- taskcarry_https/__init__.py +1 -0
- taskcarry_https/consent.py +207 -0
- taskcarry_https/reader.py +132 -0
- taskcarry_https/review.py +116 -0
- taskcarry_https/server.py +163 -0
- taskcarry_https/team.py +335 -0
- taskcarry_https/team_host.py +109 -0
- taskcarry_https/web_host.py +82 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
taskcarry/__init__.py,sha256=KM5ZXl0w_WaB45Ir9hFNsOOGRj_z13S0ib-Ag0in40o,87
|
|
2
|
+
taskcarry/__main__.py,sha256=MHKZ_ae3fSLGTLUUMOx15fWdeOnJSHhq-zslRP5F5Lc,79
|
|
3
|
+
taskcarry/adapter_contracts.py,sha256=hHemFQ5qztitlRtP3w6gWFmOvtTpQKM9gxGJ89jgR-A,4445
|
|
4
|
+
taskcarry/agy_turns.py,sha256=HxCmF0x-tdkFALZcXexZCNBLszrnB8epoEMPKSutMvg,12243
|
|
5
|
+
taskcarry/api.py,sha256=mtE0HPehuNgGErRwgiVnbzzWdRQD4Pa55s3MRRYsBHE,5708
|
|
6
|
+
taskcarry/board.py,sha256=Ig12hjvaLd-868ZGi7VC4qqnNuiFBwTfbJGdou28MOA,15920
|
|
7
|
+
taskcarry/board_data.py,sha256=tDF4lrK9BQlCl2ZhHoB8xIAWgFjqeY7jPBSllmGpSBs,27696
|
|
8
|
+
taskcarry/chat_joins.py,sha256=biwr70weu8KAqyESMjUtfcxRiHrCtZ01zeKq65E6-N4,8842
|
|
9
|
+
taskcarry/cli.py,sha256=Ws7JoiPnxTl4YrRuv8d87-ebIRlh4k8b4DNVrGAJyZ8,6814
|
|
10
|
+
taskcarry/codex_capture.py,sha256=qa3AHdwLHQe2EMtRxtchn7YnD7GTCunbzmeH5jlgsoI,8482
|
|
11
|
+
taskcarry/codex_host.py,sha256=bMeKdVI2XSo1xeGBVA3jYJvVu6mpHR4puE7C8Z9By7Y,14649
|
|
12
|
+
taskcarry/collaboration_exchange.py,sha256=wgsFn2mprUmwP_mAlaZ8z0Uzmnxvd9IVLyUJtdVoTms,22262
|
|
13
|
+
taskcarry/connection.py,sha256=wxG2zyaNu-Hu5NO5meMqutfCNW4Gv2rdeZXjGCGQp1I,10869
|
|
14
|
+
taskcarry/continuity.py,sha256=JGfOLbMWrb4QlZL9XX73EFL7g6b18RdX3zUOdsOkAoE,19148
|
|
15
|
+
taskcarry/contracts.py,sha256=0nRdv8z6G9OO50cMUeJUgmHEW8XOft6KMkEqyLHKr3I,12044
|
|
16
|
+
taskcarry/conversation_capture.py,sha256=-zmR6m1yv26niv7vHO8cvScZz7B4KGsWEmz1GYRT0oo,35998
|
|
17
|
+
taskcarry/core.py,sha256=NjWMfMSa-g8reWfs_csxbNQY3vKGeD77dpwCmiz9nfQ,58614
|
|
18
|
+
taskcarry/cycle_contracts.py,sha256=_d3r_yMbJe338QL9hvzBA1FnYmkjb3g0-qb5Iy55Z4Q,6519
|
|
19
|
+
taskcarry/discovery.py,sha256=NTe28Dnbm4S63UytcptbEmK-Q-quLAw8WyB2VRWcv6w,25251
|
|
20
|
+
taskcarry/discovery_contracts.py,sha256=w-0lIuqskF7HotzWSXzhB3TKtGed-e7mMSlcwxXCkCQ,3837
|
|
21
|
+
taskcarry/exchange_contracts.py,sha256=l1QH8wnIufsyKr2dEghI98pGptpdtC3CKEsRvq9e7uw,4634
|
|
22
|
+
taskcarry/exchange_endpoint.py,sha256=RJPEBdnWuhm1TcGLAUeYIseknLsid0DxfGLF6zp6Dn0,27383
|
|
23
|
+
taskcarry/exchange_packets.py,sha256=2Nk7LznFT9M8xcCN27nv6RdRRP7aYdksI0rcYjobzBY,7414
|
|
24
|
+
taskcarry/experience_contracts.py,sha256=S7X-6P53nRb3_PY2JoTg8RbX-4KILYP-k2KF6e1ddjw,7387
|
|
25
|
+
taskcarry/experience_exchange.py,sha256=vjmJW4_mwUuPRwZ4kya-8jkAF8lclEACdbAQVBzC-rE,14745
|
|
26
|
+
taskcarry/experience_notes.py,sha256=gMzP-VgY9Yx9Liou8IMoSCZ3hP70SXg3pfVutcjorF4,25525
|
|
27
|
+
taskcarry/experience_storage.py,sha256=f5YG4cHGYgb0hSC0XzG-pE1918TRaEXi-EN32DuaGio,7297
|
|
28
|
+
taskcarry/experience_tools.py,sha256=GxuxBLUiZFbaSgKDD2KKG-49Nxj4qnkAe6tg3bSakVc,3338
|
|
29
|
+
taskcarry/gitops.py,sha256=xcXPmBEWE8yCdAWlVLIKCiXP8xMpaf4vkU-iUEm3PlQ,7829
|
|
30
|
+
taskcarry/governance.py,sha256=PhAboVH01-AkZz2bG8-JYo9GwxYVbtRR6mboXUG0cYE,5306
|
|
31
|
+
taskcarry/governance_cycle.py,sha256=1FRwDXk13U7oghEjO8zsXXnvxM1Utqezk9JwjdHyeE8,48053
|
|
32
|
+
taskcarry/identification.py,sha256=ilYUk2x67n4ot-_86rYJbBqcbg9yNLZJ7F_JWJtu-CY,4293
|
|
33
|
+
taskcarry/integration.py,sha256=qYQdeZowyQsRbFxwrrw2HeoD8KTTDtjGDB1jTSY8xQg,45149
|
|
34
|
+
taskcarry/maintenance.py,sha256=rUKoclg8GWyADhP1Qy74jpIkChpkGzZnBCAYDT9WX18,6983
|
|
35
|
+
taskcarry/mcp.py,sha256=BOxYcx4jkMjGi9o0LrUxs8LbRwyG---RVozQhAdNU4Y,11563
|
|
36
|
+
taskcarry/member_join.py,sha256=P8wkxdyP4lnGVUtDwpbKioxyUwh3w1tRi9uq3z2toLU,10858
|
|
37
|
+
taskcarry/member_routing.py,sha256=xCq6PctI5CeaD5-MuWmhA5F3zIkK8RIJ1Fpo3963SHw,7195
|
|
38
|
+
taskcarry/onboarding.py,sha256=5CZzRWc5-_ZaQ-w_KRytayNPw8wYqCmOyJgl2g3Yhw0,18943
|
|
39
|
+
taskcarry/onboarding_complete.py,sha256=1EkBmVhRMDgWFAdWYptuCYGP43G6_sTVhImCqMamWIY,17705
|
|
40
|
+
taskcarry/path_batches.py,sha256=bNvncfl7YcX2ien0lsuAeknknYqDOq4r9vNmuNqOGrs,673
|
|
41
|
+
taskcarry/preservation.py,sha256=lN2wAva8QgS-bF29dV1VN61zQYlXL3VbHUt_kuEZkM8,15459
|
|
42
|
+
taskcarry/project_collaboration.py,sha256=h1xPCxJ_yZDWZjs49BS6cdkLmU-lMMN2dMpi_Hmyyyk,27495
|
|
43
|
+
taskcarry/project_history.py,sha256=MIeU_37p5pO7-W6mAP9TaGI2Qv7ZvibPEqtkXxHJllI,8120
|
|
44
|
+
taskcarry/project_identity.py,sha256=4KYZa5QbpDGFf-5AY5g57vIHia_YWjtTdwyxwnnP_VU,2902
|
|
45
|
+
taskcarry/project_recovery.py,sha256=M8pNd7t8GZrWQszuzPqzExivHnPEytlD1uoJPWuT0GM,59924
|
|
46
|
+
taskcarry/recovery_contracts.py,sha256=MIpLjPNC2Fre8bflTeQdRFCm6TV8VmbhH4dVPMUOYhM,1762
|
|
47
|
+
taskcarry/recovery_files.py,sha256=ySAo0dpY_XpCU1a1LkdCarn8q7X6ZnsXHDQQiktaSVo,5680
|
|
48
|
+
taskcarry/recovery_git.py,sha256=m-ETCyY4feZKM4xGHpoOL7DdSy4ah0624Dvc6Krsjto,13830
|
|
49
|
+
taskcarry/remote_capture.py,sha256=iz2hl2S69BCfmK706dvDQ5F2p1tYlr0wGoVpivNXvG4,5034
|
|
50
|
+
taskcarry/remote_transfer.py,sha256=mie1c3Is0SIE0GoWQ93oGNv-_Lo8DLSsyXJgb7WokFE,23074
|
|
51
|
+
taskcarry/role_connection.py,sha256=gvgUBBA_ThtAlfnPlqrUX_gKfY3WfqUeyyNS7-u-sNQ,15293
|
|
52
|
+
taskcarry/setup.py,sha256=sfFqIhXMQIUImePb5u5ldqchiZtbJ8wgnW_IO3YwGhk,34194
|
|
53
|
+
taskcarry/shared_workbench.py,sha256=z2UjUOIA_CFz2vmK-Wapqc4o3_BLsujQ5IUv1clLAK0,33065
|
|
54
|
+
taskcarry/source_review_set.py,sha256=t8tGDUq9Y_-qWhO5A_qQE6iBiCAAam0o2F8HqPcu9Bs,4661
|
|
55
|
+
taskcarry/state_format.py,sha256=KojU1MsbbIlu-98NTRGTq4T8duR3X3lR1b3d8iXUzUE,2628
|
|
56
|
+
taskcarry/store.py,sha256=nr5-Uv8TbdCQA04xKmpSE2VhC5XHAjfy-qYs70RFyEE,25618
|
|
57
|
+
taskcarry/task_context.py,sha256=Yca2l4_PsM7Pw7alQ2h5L7NhFrSQbTteM_UxGheHYbs,9107
|
|
58
|
+
taskcarry/text_handback.py,sha256=P8fblRk4lx4z5RyxynB99uTcjJHUqh7VxLVGadSRTvY,6124
|
|
59
|
+
taskcarry/transfer_contracts.py,sha256=9wHW9_MLlHmM5fHj2xNJJ-9d8XeG_F8ULVqGjTAot7A,1735
|
|
60
|
+
taskcarry/updates.py,sha256=F6FW8DlFlPTxMbOJ4N5uaJ83HuYvqMaAL5KLP8kuVmc,21901
|
|
61
|
+
taskcarry/workbench.py,sha256=Cnv0LUCPmhFfqM-oxQnSq3d5Xs_JdReuFb4NLdVpbng,37945
|
|
62
|
+
taskcarry/workbench_contracts.py,sha256=E1PeSTefyMZGnIPZF1KyCQzLZSW0wfo_Xv8v3zIz6BI,2507
|
|
63
|
+
taskcarry/workbuddy_capture.py,sha256=ys4mZohnVGYbfoa2lrau7xfiePQlHJ8Ova7unqW5IBo,19718
|
|
64
|
+
taskcarry/workbuddy_setup.py,sha256=iO_WKpip9gnDwZEoAOq3mKk3GMrUcNOMveMwKu6B7wg,11025
|
|
65
|
+
taskcarry/worker_channel.py,sha256=QAL9NqReWRkJuVRWThWH2aIGBtVrcouVhU-IlTCzfS4,53305
|
|
66
|
+
taskcarry/worker_contracts.py,sha256=BWxBBZI25_hmmmPBUJ_7nkaQIy5TaiVsLw91iRhpA68,10842
|
|
67
|
+
taskcarry/worker_storage.py,sha256=6NjrZkt07jaD-IERNMGccIf48LsJXCN2WqiTEaiXGwQ,3289
|
|
68
|
+
taskcarry/worker_tools.py,sha256=a9YkLOKWgR9U-3cxgBbQTy4kJkPPw4nL7QSKAntjhDI,12487
|
|
69
|
+
taskcarry/board_assets/board.css,sha256=RpqlEQk2myrYMtlpNCsruZvjkZxWpva6h_8ua33AMXo,23310
|
|
70
|
+
taskcarry/board_assets/board.js,sha256=HdTmFNmHLW1VRxfhtjxdxVGrxYlzVQYgv4E5wMsNQX4,45755
|
|
71
|
+
taskcarry/board_assets/browse.js,sha256=DH-KHVbc913os86UPYCmVgCdZ1EOUrF7tk_lgp-Q-bw,11019
|
|
72
|
+
taskcarry/board_assets/index.html,sha256=wdrwjCZmJuvu3Kd3LYUddFrgbcXPewGUpX9VUVCMrIM,2664
|
|
73
|
+
taskcarry/board_assets/taskcarry-icon.ico,sha256=8u2ZcqGVDv6E3alqZqrTUJzNVtQAv9UQgE2L-lEojdg,55956
|
|
74
|
+
taskcarry/board_assets/taskcarry-mark.svg,sha256=MGOtIrxZ5_z3dAn-KWQ3XlHQ6QwWX3iwIi9xWKfkcUs,2331
|
|
75
|
+
taskcarry/feishu/__init__.py,sha256=sO2GRBtLg0Uf73R4aYXf5XlWbooRcvP_vGr6SEs7T4c,49
|
|
76
|
+
taskcarry/feishu/display.py,sha256=U3ibeNbF_Y4PClXy0RW2ovem66PzEAaLL42eKA9eXvg,5619
|
|
77
|
+
taskcarry/feishu/project_watch.py,sha256=BXcAp5g4lNrtOU5Cxgn7LrLVwwTgJbDIpQ1Xsa2lYic,8138
|
|
78
|
+
taskcarry/feishu/review_sets.py,sha256=BS4eHTMgDm7jfnZHbCXTS0uIwhvTiaBzH2iEdFopPhM,4618
|
|
79
|
+
taskcarry/feishu/sender.py,sha256=pmRck1XKLlIggUjYulW7HUgb3BsUc7MhUkHz8r0aAyw,1857
|
|
80
|
+
taskcarry/feishu/subscription.py,sha256=UzOKzHLbwFOu6TM4KhLOj83i0fwG2-TUMOHy8-o5Zfw,9703
|
|
81
|
+
taskcarry/feishu/windows_agent.py,sha256=RPGeDg0cok_3ifVnUv5AvzRC2puZ5bngXV-8GLL3kBA,12456
|
|
82
|
+
taskcarry/feishu/windows_secret.py,sha256=hahHO9cy3vAchV3tKfsr4MLtVbg7q2nm_ew_mvCS0J0,1536
|
|
83
|
+
taskcarry/skill_data/taskcarry-experience-recovery/SKILL.md,sha256=-7eQAu0mqfSjM8uDCC605h9Kn6o2LZoUpUD44kaJNnY,7251
|
|
84
|
+
taskcarry/skill_data/taskcarry-governance-reconcile/SKILL.md,sha256=mZnoT3PXwoA726q_Tkq6R9L2p6Nnm2Of2fUkz9sPS3g,10271
|
|
85
|
+
taskcarry/skill_data/taskcarry-governance-reconcile/references/daily-governance.md,sha256=FurlCUCKLSqaGmIiUwH7Kt6QjBwqWsZos7WK3P6QyAI,21366
|
|
86
|
+
taskcarry/skill_data/taskcarry-project-setup/SKILL.md,sha256=pZbFKTaA2Gv6-wyt-PkHyK4V06KwDBP0JEcbasktxNY,12663
|
|
87
|
+
taskcarry/skill_data/taskcarry-project-setup/references/onboarding.md,sha256=AfO0ybtiFc0-dtr1BI0e1IrtA8wXLEEuR-1E3neF3pI,47219
|
|
88
|
+
taskcarry/skill_data/taskcarry-task-delivery/SKILL.md,sha256=i1bmnKkxZGF0VBrWeP5bj2nQNpE1JXdHHN-BKQmlGMo,5597
|
|
89
|
+
taskcarry/skill_data/taskcarry-task-delivery/references/conditional-experience.md,sha256=0GAwDSg83_nsY6byTRbdSYTr6qBwRKOoMi_YKbPa4_w,5570
|
|
90
|
+
taskcarry/skill_data/taskcarry-task-delivery/references/worker-channel.md,sha256=PwERuGVuc0Ot8gNtANbodPTkji52R6395fgbbI2YCew,7318
|
|
91
|
+
taskcarry-0.3.2.dist-info/licenses/LICENSE,sha256=l_0WizWus5MortHh6TTC7N3SgqhXrMcBMdkveR5veQE,1079
|
|
92
|
+
taskcarry-0.3.2.dist-info/licenses/LICENSE_SCOPE.md,sha256=N9VuC2qmhMNHeHz9b4ZrZ5J1JkbN0ThQeYHiIDZhxlk,2854
|
|
93
|
+
taskcarry_https/__init__.py,sha256=if2O8ed-GQr3ShsyBCD9lMhTyr2rKvUwyUN_TJU4riQ,56
|
|
94
|
+
taskcarry_https/consent.py,sha256=83D2qf6nIjjAk1hya6QCZb7vCdIfeSHenMXnmF7llqg,12462
|
|
95
|
+
taskcarry_https/reader.py,sha256=vdVdc4u3wzcuyNYYzTv3Grcg6eFX2a8jxweoQ7TVuM8,5790
|
|
96
|
+
taskcarry_https/review.py,sha256=KU1F1H5i5Xo16N8yeeeI_wgpO6sxBWaiG5FFD8qUuN4,6038
|
|
97
|
+
taskcarry_https/server.py,sha256=VSkP2JgGjRHK4RiFuL4SiE3OQW3RjXh3tvQ2P5W31e8,8550
|
|
98
|
+
taskcarry_https/team.py,sha256=dRNnTAFbpbkRvYCW2lr-ExwKouMZBkNcmATbfgTZ1aY,19132
|
|
99
|
+
taskcarry_https/team_host.py,sha256=RHcUUbovp2DJ7lw8QTIUc6JEBfzChtpXhNuegQ8Hy0E,5367
|
|
100
|
+
taskcarry_https/web_host.py,sha256=XYFMWwPCdImB1aMIQJUHGPvhfoRx-JwAr66gRA2gOeo,4033
|
|
101
|
+
taskcarry-0.3.2.dist-info/METADATA,sha256=1XqL8LC3ckBUxUyXQz8srfRwnRKNunTc6wI2LEXPLhc,29925
|
|
102
|
+
taskcarry-0.3.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
103
|
+
taskcarry-0.3.2.dist-info/entry_points.txt,sha256=rvVs3v7gnyx51IvgTlTyvgR0B61pg94B6t5KostYdiw,105
|
|
104
|
+
taskcarry-0.3.2.dist-info/top_level.txt,sha256=Y5eac3PbGlnE4HxWBwBavqaXCNZcYeHNDyAE2lDSLqE,26
|
|
105
|
+
taskcarry-0.3.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 TaskCarry contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# License scope / 许可范围 / 授權範圍
|
|
2
|
+
|
|
3
|
+
## English
|
|
4
|
+
|
|
5
|
+
The [MIT license](LICENSE) covers the TaskCarry code, documentation, templates, diagrams, and synthetic examples distributed in this public repository, except where a file identifies another license. You may use, modify, distribute, and commercially reuse that material under the license terms.
|
|
6
|
+
|
|
7
|
+
Using TaskCarry does not license or publish the projects you manage with it. Your project files, task records, private conversations, and local backups remain separate from this public distribution. A general design inspired by practical experience does not grant rights to the underlying private material.
|
|
8
|
+
|
|
9
|
+
Python, Git, AI hosts, and external services retain their own licenses and terms. A link does not grant redistribution rights. Contributors must identify the origin and license of third-party material they propose to include.
|
|
10
|
+
|
|
11
|
+
The public implementation is included here; its documented core features do not require a hidden private module. A separately distributed implementation is not covered merely because it offers a compatible interface.
|
|
12
|
+
|
|
13
|
+
## 简体中文
|
|
14
|
+
|
|
15
|
+
[MIT 许可](LICENSE)适用于本公开仓库发行的 TaskCarry 代码、文档、模板、图示与虚构示例,另行注明许可的文件除外。你可以依条款使用、修改、分发和商业复用这些内容。
|
|
16
|
+
|
|
17
|
+
使用 TaskCarry 不会使你管理的项目获得公开许可或被发布。项目文件、任务记录、私人对话和本地备份,与本公开发行内容分开。根据实际经验形成通用设计,不代表获得背后私有材料的使用权。
|
|
18
|
+
|
|
19
|
+
Python、Git、AI 宿主和外部服务各自适用原有许可与条款。提供链接不等于获得再分发权。贡献者拟加入第三方材料时,需要说明来源和许可。
|
|
20
|
+
|
|
21
|
+
本仓库包含公开实现,文档列出的核心功能不依赖隐藏的私有模块。单独发行的其他实现,不会仅因接口兼容就自动进入本许可范围。
|
|
22
|
+
|
|
23
|
+
## 繁體中文
|
|
24
|
+
|
|
25
|
+
[MIT 授權](LICENSE)適用於本公開儲存庫發行的 TaskCarry 程式碼、文件、範本、圖示與虛構範例,另行註明授權的檔案除外。你可以依條款使用、修改、散布與商業複用這些內容。
|
|
26
|
+
|
|
27
|
+
使用 TaskCarry 不會使你管理的專案取得公開授權或被發布。專案檔案、任務記錄、私人對話與本機備份,與本公開發行內容分開。根據實際經驗形成通用設計,不代表取得背後私有素材的使用權。
|
|
28
|
+
|
|
29
|
+
Python、Git、AI 宿主與外部服務各自適用原有授權與條款。提供連結不等於取得再散布權。貢獻者擬加入第三方素材時,需要說明來源與授權。
|
|
30
|
+
|
|
31
|
+
本儲存庫包含公開實作,文件列出的核心功能不依賴隱藏的私有模組。個別發行的其他實作,不會僅因介面相容就自動納入本授權範圍。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Optional Streamable HTTP connector for TaskCarry."""
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"""Ephemeral owner consent for one invitation, using the MCP SDK OAuth handlers."""
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from html import escape
|
|
4
|
+
import re
|
|
5
|
+
import secrets
|
|
6
|
+
import time
|
|
7
|
+
from urllib.parse import urlsplit
|
|
8
|
+
|
|
9
|
+
from mcp.server.auth.provider import (
|
|
10
|
+
AccessToken, AuthorizationCode, AuthorizeError, RegistrationError, TokenError, construct_redirect_uri,
|
|
11
|
+
)
|
|
12
|
+
from mcp.shared.auth import OAuthClientInformationFull, OAuthClientMetadata, OAuthToken
|
|
13
|
+
from pydantic import ValidationError
|
|
14
|
+
from starlette.responses import HTMLResponse, JSONResponse, PlainTextResponse, RedirectResponse
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
GOOGLE_REDIRECT = re.compile(
|
|
18
|
+
r"https://oauth-redirect(?:-sandbox|-test)?\.googleusercontent\.com/(?:a|r)/[A-Za-z0-9_~:-][A-Za-z0-9_~.:-]{0,350}\Z"
|
|
19
|
+
)
|
|
20
|
+
NO_STORE = {"Cache-Control": "no-store", "Referrer-Policy": "no-referrer"}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class Pending:
|
|
25
|
+
client_id: str
|
|
26
|
+
params: object
|
|
27
|
+
expires_at: float
|
|
28
|
+
failures: int = 0
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class InvitationOAuth:
|
|
32
|
+
"""The SDK validates client authentication, the exact callback, PKCE and bearer audience."""
|
|
33
|
+
|
|
34
|
+
def __init__(self, origin, invitation, owner_code, test_redirect=None):
|
|
35
|
+
parsed = urlsplit(origin)
|
|
36
|
+
if parsed.path or parsed.query or parsed.fragment or parsed.username or parsed.password or not parsed.hostname:
|
|
37
|
+
raise ValueError("Expected a canonical HTTPS origin.")
|
|
38
|
+
if parsed.scheme != "https" and not (parsed.scheme == "http" and parsed.hostname == "127.0.0.1"):
|
|
39
|
+
raise ValueError("Only loopback tests may use HTTP.")
|
|
40
|
+
if test_redirect and not (parsed.hostname == "127.0.0.1" and
|
|
41
|
+
re.fullmatch(r"http://127\.0\.0\.1:\d{1,5}/callback", test_redirect)):
|
|
42
|
+
raise ValueError("Local test callback is only available on a loopback issuer.")
|
|
43
|
+
if len(owner_code) < 20:
|
|
44
|
+
raise ValueError("Owner approval requires a randomly generated invitation code.")
|
|
45
|
+
self.origin = origin
|
|
46
|
+
self.resource = origin + "/mcp"
|
|
47
|
+
self.invitation = invitation
|
|
48
|
+
self.scope = invitation.oauth_scope
|
|
49
|
+
self.test_redirect = test_redirect
|
|
50
|
+
self.owner_code = owner_code
|
|
51
|
+
self.approved_redirect = None
|
|
52
|
+
self.clients = {}
|
|
53
|
+
self.pending = {}
|
|
54
|
+
self.codes = {}
|
|
55
|
+
self.tokens = {}
|
|
56
|
+
|
|
57
|
+
def _prune(self):
|
|
58
|
+
now = time.time()
|
|
59
|
+
for entries in (self.pending, self.codes, self.tokens):
|
|
60
|
+
for key in [key for key, value in entries.items() if value.expires_at <= now]:
|
|
61
|
+
del entries[key]
|
|
62
|
+
|
|
63
|
+
async def get_client(self, client_id):
|
|
64
|
+
return self.clients.get(client_id)
|
|
65
|
+
|
|
66
|
+
async def register_client(self, client_info):
|
|
67
|
+
redirects = [str(url) for url in client_info.redirect_uris or []]
|
|
68
|
+
if not redirects or len(redirects) > 8 or not all(
|
|
69
|
+
GOOGLE_REDIRECT.fullmatch(url) or url == self.test_redirect for url in redirects):
|
|
70
|
+
raise RegistrationError("invalid_redirect_uri", "Use an authorized client callback.")
|
|
71
|
+
if len(self.clients) >= 128 or time.time() >= self.invitation.expires_at:
|
|
72
|
+
raise RegistrationError("invalid_client_metadata", "This temporary invitation is unavailable.")
|
|
73
|
+
self.clients[client_info.client_id] = client_info
|
|
74
|
+
|
|
75
|
+
async def register(self, request):
|
|
76
|
+
# The general SDK registration handler requires requesting refresh tokens.
|
|
77
|
+
# A short-lived invitation also accepts clients requesting only a code.
|
|
78
|
+
try:
|
|
79
|
+
metadata = OAuthClientMetadata.model_validate(await request.json())
|
|
80
|
+
method = metadata.token_endpoint_auth_method or "client_secret_post"
|
|
81
|
+
if (method not in {"none", "client_secret_basic", "client_secret_post"}
|
|
82
|
+
or set(metadata.grant_types) not in ({"authorization_code"}, {"authorization_code", "refresh_token"})
|
|
83
|
+
or metadata.response_types != ["code"] or (metadata.scope or self.scope).split() != [self.scope]):
|
|
84
|
+
raise RegistrationError("invalid_client_metadata")
|
|
85
|
+
secret = None if method == "none" else secrets.token_urlsafe(36)
|
|
86
|
+
client = OAuthClientInformationFull(
|
|
87
|
+
client_id=secrets.token_urlsafe(24), client_secret=secret, client_id_issued_at=int(time.time()),
|
|
88
|
+
client_secret_expires_at=self.invitation.expires_at if secret else None, token_endpoint_auth_method=method,
|
|
89
|
+
redirect_uris=metadata.redirect_uris, grant_types=["authorization_code"], response_types=["code"],
|
|
90
|
+
client_name=(metadata.client_name or "")[:96], scope=self.scope,
|
|
91
|
+
)
|
|
92
|
+
await self.register_client(client)
|
|
93
|
+
except (ValidationError, ValueError, RecursionError):
|
|
94
|
+
return JSONResponse({"error": "invalid_client_metadata"}, status_code=400, headers=NO_STORE)
|
|
95
|
+
except RegistrationError as exc:
|
|
96
|
+
return JSONResponse({"error": exc.error}, status_code=400, headers=NO_STORE)
|
|
97
|
+
return JSONResponse(client.model_dump(mode="json", exclude_none=True), status_code=201, headers=NO_STORE)
|
|
98
|
+
|
|
99
|
+
async def authorize(self, client, params):
|
|
100
|
+
self._prune()
|
|
101
|
+
if params.resource not in (None, self.resource) or set(params.scopes or [self.scope]) != {self.scope}:
|
|
102
|
+
raise AuthorizeError("access_denied", "Use the resource and scope granted by this invitation.")
|
|
103
|
+
if not re.fullmatch(r"[A-Za-z0-9_-]{43}", params.code_challenge):
|
|
104
|
+
raise AuthorizeError("invalid_request", "A valid S256 PKCE challenge is required.")
|
|
105
|
+
if (time.time() >= self.invitation.expires_at or len(self.pending) >= 128 or
|
|
106
|
+
self.approved_redirect not in (None, str(params.redirect_uri))):
|
|
107
|
+
raise AuthorizeError("access_denied", "This invitation is unavailable for this client.")
|
|
108
|
+
ticket = secrets.token_urlsafe(32)
|
|
109
|
+
self.pending[ticket] = Pending(client.client_id, params, min(time.time() + 600, self.invitation.expires_at))
|
|
110
|
+
return self.origin + "/consent/" + ticket
|
|
111
|
+
|
|
112
|
+
async def consent(self, request):
|
|
113
|
+
ticket = request.path_params["ticket"]
|
|
114
|
+
entry = None
|
|
115
|
+
if request.method == "POST":
|
|
116
|
+
if request.headers.get("origin") not in (None, self.origin):
|
|
117
|
+
return PlainTextResponse("Invalid origin.", status_code=403, headers=NO_STORE)
|
|
118
|
+
form = await request.form()
|
|
119
|
+
entry = str(form.get("owner_code", "")).strip()
|
|
120
|
+
# Check and consume the live ticket after reading the body; a double
|
|
121
|
+
# click cannot issue a second code while the first POST is in flight.
|
|
122
|
+
self._prune()
|
|
123
|
+
row = self.pending.get(ticket)
|
|
124
|
+
if row is None or self.approved_redirect not in (None, str(row.params.redirect_uri)):
|
|
125
|
+
return PlainTextResponse("这个授权页面已结束。若刚点过「允许」,请回原应用查看连接状态。"
|
|
126
|
+
"若仍未连接,请从原应用重新发起连接。", status_code=403, headers=NO_STORE)
|
|
127
|
+
notice = ""
|
|
128
|
+
if entry is not None:
|
|
129
|
+
if secrets.compare_digest(entry.encode(), self.owner_code.encode()):
|
|
130
|
+
self.approved_redirect = str(row.params.redirect_uri)
|
|
131
|
+
del self.pending[ticket]
|
|
132
|
+
code = secrets.token_urlsafe(36)
|
|
133
|
+
self.codes[code] = AuthorizationCode(
|
|
134
|
+
code=code, scopes=[self.scope], expires_at=min(time.time() + 120, self.invitation.expires_at),
|
|
135
|
+
client_id=row.client_id, code_challenge=row.params.code_challenge,
|
|
136
|
+
redirect_uri=row.params.redirect_uri, redirect_uri_provided_explicitly=row.params.redirect_uri_provided_explicitly,
|
|
137
|
+
subject=self.invitation.binding_id, resource=self.resource,
|
|
138
|
+
)
|
|
139
|
+
callback = construct_redirect_uri(self.approved_redirect, code=code, state=row.params.state)
|
|
140
|
+
if request.headers.get("sec-fetch-mode") == "navigate" or "text/html" in request.headers.get("accept", "").lower():
|
|
141
|
+
# Finish the form navigation here. The registered relay can
|
|
142
|
+
# then redirect a normal top-level GET to the application.
|
|
143
|
+
target = escape(callback, quote=True)
|
|
144
|
+
return_label = "返回 Gemini" if GOOGLE_REDIRECT.fullmatch(self.approved_redirect) else "返回应用"
|
|
145
|
+
return HTMLResponse(
|
|
146
|
+
'<!doctype html><html lang="zh-CN"><head><meta charset="utf-8">'
|
|
147
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">'
|
|
148
|
+
f'<meta http-equiv="refresh" content="0;url={target}"><title>{return_label}</title>'
|
|
149
|
+
f'</head><body><h1>授权已确认</h1><p>正在{return_label}完成连接。</p>'
|
|
150
|
+
f'<p>如果没有自动跳转,请点<a href="{target}" rel="noreferrer">{return_label}</a>。</p>'
|
|
151
|
+
'</body></html>',
|
|
152
|
+
headers={**NO_STORE, "X-Content-Type-Options": "nosniff",
|
|
153
|
+
"Content-Security-Policy": "default-src 'none'; base-uri 'none'; "
|
|
154
|
+
"frame-ancestors 'none'; form-action 'none'"},
|
|
155
|
+
)
|
|
156
|
+
return RedirectResponse(callback, status_code=303, headers=NO_STORE)
|
|
157
|
+
row.failures += 1
|
|
158
|
+
if row.failures >= 5:
|
|
159
|
+
del self.pending[ticket]
|
|
160
|
+
return PlainTextResponse("请从自定义应用重新连接。", status_code=403, headers=NO_STORE)
|
|
161
|
+
notice = "<p>确认码不匹配,请从本机邀请卡重新复制,并在本页重试。</p>"
|
|
162
|
+
sources = "".join(f"<li>{escape(item.title)} · v{item.revision}(固定版本)</li>"
|
|
163
|
+
for item in self.invitation.sources)
|
|
164
|
+
callback_host = urlsplit(str(row.params.redirect_uri)).netloc
|
|
165
|
+
csp = f"default-src 'none'; form-action 'self' {urlsplit(str(row.params.redirect_uri)).scheme}://{callback_host}; frame-ancestors 'none'; base-uri 'none'"
|
|
166
|
+
# Browsers send Origin: null on a form POST from a no-referrer document.
|
|
167
|
+
# Keep the origin for this form's own POST and omit referrers to other sites.
|
|
168
|
+
form_headers = {**NO_STORE, "Referrer-Policy": "same-origin",
|
|
169
|
+
"Content-Security-Policy": csp, "X-Content-Type-Options": "nosniff"}
|
|
170
|
+
return HTMLResponse(
|
|
171
|
+
"<!doctype html><html lang=zh-CN><meta charset=utf-8><title>TaskCarry 项目邀请</title>"
|
|
172
|
+
f"<h1>{escape(self.invitation.consent_title)}</h1><p>项目 {escape(self.invitation.project_name)}</p>"
|
|
173
|
+
f"<p>岗位 {escape(self.invitation.role_label)} · {escape(self.invitation.consent_access)}</p><ul>{sources}</ul>{notice}"
|
|
174
|
+
"<form method=post><label>输入本机邀请卡上的确认码 "
|
|
175
|
+
"<input type=password name=owner_code required autocomplete=off></label> "
|
|
176
|
+
f'<button type="submit">{escape(self.invitation.consent_button)}</button></form></html>',
|
|
177
|
+
headers=form_headers,
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
async def load_authorization_code(self, client, authorization_code):
|
|
181
|
+
self._prune()
|
|
182
|
+
code = self.codes.get(authorization_code)
|
|
183
|
+
return code if code and code.client_id == client.client_id else None
|
|
184
|
+
|
|
185
|
+
async def exchange_authorization_code(self, client, authorization_code):
|
|
186
|
+
self._prune()
|
|
187
|
+
code = self.codes.pop(authorization_code.code, None)
|
|
188
|
+
if not code or code.client_id != client.client_id:
|
|
189
|
+
raise TokenError("invalid_grant", "Request a new authorization code.")
|
|
190
|
+
expiry = self.invitation.expires_at
|
|
191
|
+
token = secrets.token_urlsafe(40)
|
|
192
|
+
self.tokens[token] = AccessToken(token=token, client_id=client.client_id, scopes=[self.scope],
|
|
193
|
+
expires_at=expiry, subject=code.subject, resource=self.resource)
|
|
194
|
+
return OAuthToken(access_token=token, token_type="Bearer", scope=self.scope, expires_in=max(0, expiry - int(time.time())))
|
|
195
|
+
|
|
196
|
+
async def load_refresh_token(self, client, refresh_token):
|
|
197
|
+
return None
|
|
198
|
+
|
|
199
|
+
async def exchange_refresh_token(self, client, refresh_token, scopes):
|
|
200
|
+
raise TokenError("invalid_grant", "Reconnect to this time-limited invitation.")
|
|
201
|
+
|
|
202
|
+
async def load_access_token(self, token):
|
|
203
|
+
self._prune()
|
|
204
|
+
return self.tokens.get(token)
|
|
205
|
+
|
|
206
|
+
async def revoke_token(self, token):
|
|
207
|
+
self.tokens.pop(token.token, None)
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""Serve only the frozen references described by one locally issued reader invitation."""
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import re
|
|
5
|
+
import time
|
|
6
|
+
|
|
7
|
+
from taskcarry.api import invoke
|
|
8
|
+
from taskcarry.store import GovernanceError
|
|
9
|
+
from taskcarry.worker_channel import Caller
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class InvitationUnavailable(ValueError):
|
|
13
|
+
"""Safe to return to the remote reader; contains no internal object identifier."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class MembershipInactive(InvitationUnavailable):
|
|
17
|
+
"""The project no longer authorizes this binding to work."""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass(frozen=True)
|
|
21
|
+
class SharedText:
|
|
22
|
+
title: str
|
|
23
|
+
reference_id: str
|
|
24
|
+
revision: int
|
|
25
|
+
content_sha256: str
|
|
26
|
+
|
|
27
|
+
def reference(self):
|
|
28
|
+
return {"reference_id": self.reference_id, "revision": self.revision,
|
|
29
|
+
"content_sha256": self.content_sha256}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass(frozen=True)
|
|
33
|
+
class ReaderInvitation:
|
|
34
|
+
role_ceiling = "reader"
|
|
35
|
+
oauth_scope = "project.read"
|
|
36
|
+
service_name = "TaskCarry Project Reader"
|
|
37
|
+
consent_title = "授权读取项目资料"
|
|
38
|
+
consent_access = "只读所列资料"
|
|
39
|
+
consent_button = "同意读取并返回"
|
|
40
|
+
control: Path
|
|
41
|
+
project_id: str
|
|
42
|
+
project_name: str
|
|
43
|
+
binding_id: str
|
|
44
|
+
binding_revision: int
|
|
45
|
+
role_label: str
|
|
46
|
+
task_id: str
|
|
47
|
+
workspace_id: str
|
|
48
|
+
expires_at: int
|
|
49
|
+
sources: tuple[SharedText, ...]
|
|
50
|
+
|
|
51
|
+
def __post_init__(self):
|
|
52
|
+
if not self.control.is_absolute() or not self.sources or len(self.sources) > 16:
|
|
53
|
+
raise ValueError("Select a project and one to sixteen frozen text references.")
|
|
54
|
+
if len({item.reference_id for item in self.sources}) != len(self.sources):
|
|
55
|
+
raise ValueError("Duplicate reference in invitation.")
|
|
56
|
+
for item in self.sources:
|
|
57
|
+
if not item.title or item.revision < 1 or not re.fullmatch(r"[0-9a-f]{64}", item.content_sha256):
|
|
58
|
+
raise ValueError("Each reference needs a title, positive revision and SHA-256.")
|
|
59
|
+
|
|
60
|
+
def access_active(self):
|
|
61
|
+
return time.time() < self.expires_at
|
|
62
|
+
|
|
63
|
+
def _call(self, action, arguments):
|
|
64
|
+
if not self.access_active():
|
|
65
|
+
raise InvitationUnavailable("This invitation has expired.")
|
|
66
|
+
caller = self._caller()
|
|
67
|
+
try:
|
|
68
|
+
return invoke(self.control, action, arguments, caller=caller)
|
|
69
|
+
except GovernanceError as exc:
|
|
70
|
+
if exc.code == "WORKER_BINDING_INACTIVE":
|
|
71
|
+
raise MembershipInactive("Your project membership is inactive.") from None
|
|
72
|
+
if exc.code in {"WORKER_BASIS_CHANGED", "WORKER_TASK_CHANGED", "WORKER_REVISION_CONFLICT"}:
|
|
73
|
+
raise InvitationUnavailable("The assignment or draft revision changed. Read your assignment and latest submission.") from None
|
|
74
|
+
if exc.code in {"FILE_TOO_LARGE", "INVALID_ARGUMENT"} and action == "worker_submit_text":
|
|
75
|
+
raise InvitationUnavailable("Submit nonempty UTF-8 Markdown up to 12 KiB, with its current revision and task version.") from None
|
|
76
|
+
raise InvitationUnavailable("The requested invitation or source is unavailable.") from None
|
|
77
|
+
|
|
78
|
+
def _caller(self):
|
|
79
|
+
return Caller(self.binding_id, self.role_ceiling, self.project_id)
|
|
80
|
+
|
|
81
|
+
def _matches_role(self, role):
|
|
82
|
+
return role["binding_revision"] == self.binding_revision and role["effective_role"] == self.role_ceiling
|
|
83
|
+
|
|
84
|
+
def check_member(self):
|
|
85
|
+
# This frozen invitation is invalidated by any change of assignment. A
|
|
86
|
+
# fresh grant may reuse the same hostname and client configuration.
|
|
87
|
+
page = {"section": "role", "limit": 20}
|
|
88
|
+
while True:
|
|
89
|
+
role = self._call("worker_brief", page)
|
|
90
|
+
if not self._matches_role(role):
|
|
91
|
+
break
|
|
92
|
+
if any(item["task_id"] == self.task_id and item["workspace_id"] == self.workspace_id for item in role["items"]):
|
|
93
|
+
return role
|
|
94
|
+
if not role["next_cursor"]:
|
|
95
|
+
break
|
|
96
|
+
page["cursor"] = role["next_cursor"]
|
|
97
|
+
raise InvitationUnavailable("This invitation has changed. Ask the project manager for its current version.")
|
|
98
|
+
|
|
99
|
+
def assignment(self):
|
|
100
|
+
role = self.check_member()
|
|
101
|
+
directory = []
|
|
102
|
+
for item in self.sources:
|
|
103
|
+
# A revoked source also disappears from listings. The list is short
|
|
104
|
+
# and local; no global project counts or alternate IDs escape here.
|
|
105
|
+
try:
|
|
106
|
+
self._read(item, None, 256)
|
|
107
|
+
except InvitationUnavailable:
|
|
108
|
+
continue
|
|
109
|
+
directory.append({"title": item.title, "version_policy": "pinned", **item.reference()})
|
|
110
|
+
result = {"project": self.project_name, "role": self.role_label, "task_id": self.task_id,
|
|
111
|
+
"access": self.role_ceiling, "sources": directory}
|
|
112
|
+
if role.get("conversation_sharing"):
|
|
113
|
+
result["conversation_sharing"] = role["conversation_sharing"]
|
|
114
|
+
return result
|
|
115
|
+
|
|
116
|
+
def _read(self, item, cursor, budget):
|
|
117
|
+
args = {"reference": item.reference(), "max_bytes": budget}
|
|
118
|
+
if cursor is not None:
|
|
119
|
+
args["cursor"] = cursor
|
|
120
|
+
result = self._call("source_read", args)
|
|
121
|
+
if result.get("binary") or "text" not in result:
|
|
122
|
+
raise InvitationUnavailable("The requested invitation or source is unavailable.")
|
|
123
|
+
return result
|
|
124
|
+
|
|
125
|
+
def read(self, reference_id, cursor=None):
|
|
126
|
+
self.check_member()
|
|
127
|
+
item = next((source for source in self.sources if source.reference_id == reference_id), None)
|
|
128
|
+
if item is None:
|
|
129
|
+
raise InvitationUnavailable("The requested invitation or source is unavailable.")
|
|
130
|
+
result = self._read(item, cursor, 4096)
|
|
131
|
+
return {"title": item.title, **item.reference(), "text": result["text"],
|
|
132
|
+
"complete": result["complete"], "next_cursor": result["next_cursor"]}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"""One separately authorized web worker, with a single project review slot."""
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
import re
|
|
4
|
+
|
|
5
|
+
from taskcarry.worker_channel import Caller, fingerprint
|
|
6
|
+
|
|
7
|
+
from .reader import InvitationUnavailable, ReaderInvitation
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass(frozen=True)
|
|
11
|
+
class ReviewInvitation(ReaderInvitation):
|
|
12
|
+
draft_reference_id: str
|
|
13
|
+
handback_id: str
|
|
14
|
+
instructions: str
|
|
15
|
+
include_project_map: bool = False
|
|
16
|
+
|
|
17
|
+
role_ceiling = "worker"
|
|
18
|
+
service_name = "TaskCarry Project Reviewer"
|
|
19
|
+
consent_title = "授权项目协作与交稿"
|
|
20
|
+
consent_button = "同意读取和交稿并返回"
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def oauth_scope(self):
|
|
24
|
+
return "project.review.overview" if self.include_project_map else "project.review"
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def consent_access(self):
|
|
28
|
+
notice = "可读取下列指定资料,将本岗位的一份稿件及修订交给项目成员评审,并读回管家意见"
|
|
29
|
+
if self.include_project_map:
|
|
30
|
+
notice += "。另可查阅获准工作线的岗位、职责与当前阶段"
|
|
31
|
+
return notice
|
|
32
|
+
|
|
33
|
+
def __post_init__(self):
|
|
34
|
+
super().__post_init__()
|
|
35
|
+
if not all(re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9_.-]{0,99}", key)
|
|
36
|
+
for key in (self.draft_reference_id, self.handback_id)):
|
|
37
|
+
raise ValueError("Review invitations require exact output identities.")
|
|
38
|
+
if self.draft_reference_id in {source.reference_id for source in self.sources}:
|
|
39
|
+
raise ValueError("Select a separate output slot for the reviewer's draft.")
|
|
40
|
+
if not self.instructions.strip() or len(self.instructions.encode('utf-8')) > 2000:
|
|
41
|
+
raise ValueError("Provide a concise assignment approved for this worker.")
|
|
42
|
+
|
|
43
|
+
def _caller(self):
|
|
44
|
+
# Check the frozen revision inside each native transaction as well as at discovery.
|
|
45
|
+
return Caller(self.binding_id, self.role_ceiling, self.project_id, self.binding_revision)
|
|
46
|
+
|
|
47
|
+
def _matches_role(self, role):
|
|
48
|
+
refs = sorted((source.reference() for source in self.sources), key=lambda item: (item["reference_id"], item["revision"]))
|
|
49
|
+
return super()._matches_role(role) and role.get("source_scope") == {
|
|
50
|
+
"mode": "selected_versions", "references_fingerprint": fingerprint(refs), "share_project": True}
|
|
51
|
+
|
|
52
|
+
def assignment(self):
|
|
53
|
+
result = super().assignment()
|
|
54
|
+
task = self._call("worker_brief", {"section": "tasks", "task_id": self.task_id, "limit": 1})
|
|
55
|
+
if task["binding_revision"] != self.binding_revision or not task["items"]:
|
|
56
|
+
raise InvitationUnavailable("Read the current invitation from the project manager.")
|
|
57
|
+
return {**result, "instructions": self.instructions, "project_overview_available": self.include_project_map,
|
|
58
|
+
"draft_reference_id": self.draft_reference_id,
|
|
59
|
+
"handback_id": self.handback_id, "task_version": task["items"][0]["task_fingerprint"]}
|
|
60
|
+
|
|
61
|
+
def project_map(self, cursor=None):
|
|
62
|
+
if not self.include_project_map:
|
|
63
|
+
raise InvitationUnavailable("The project overview was not granted.")
|
|
64
|
+
self.check_member()
|
|
65
|
+
args = {"section": "project_map", "limit": 8}
|
|
66
|
+
if cursor is not None:
|
|
67
|
+
args["cursor"] = cursor
|
|
68
|
+
result = self._call("worker_brief", args)
|
|
69
|
+
return {"project": result["project_name"], "workstreams": result["items"],
|
|
70
|
+
"next_cursor": result["next_cursor"]}
|
|
71
|
+
|
|
72
|
+
def submit(self, text, expected_revision, task_version, display_title=None):
|
|
73
|
+
self.check_member()
|
|
74
|
+
# The trusted invitation selects every identity; the remote caller only
|
|
75
|
+
# chooses its actual prose and the version it is revising.
|
|
76
|
+
args = {"mode": "plan", "reference_id": self.draft_reference_id, "handback_id": self.handback_id,
|
|
77
|
+
"task_id": self.task_id, "workspace_id": self.workspace_id, "text": text,
|
|
78
|
+
"expected_revision": expected_revision,
|
|
79
|
+
"basis": {"binding_revision": self.binding_revision, "task_fingerprint": task_version}}
|
|
80
|
+
if display_title is not None:
|
|
81
|
+
args["display_title"] = display_title
|
|
82
|
+
plan = self._call("worker_submit_text", args)
|
|
83
|
+
result = self._call("worker_submit_text", {"mode": "execute", "plan_id": plan["plan_id"]})
|
|
84
|
+
return {key: result[key] for key in ("handback_id", "revision", "reference", "size", "state", "business_accepted")}
|
|
85
|
+
|
|
86
|
+
def _entry(self, section):
|
|
87
|
+
args = {"section": section, "task_id": self.task_id, "limit": 8}
|
|
88
|
+
while True:
|
|
89
|
+
page = self._call("worker_brief", args)
|
|
90
|
+
if page["binding_revision"] != self.binding_revision:
|
|
91
|
+
raise InvitationUnavailable("This invitation has changed.")
|
|
92
|
+
for row in page["items"]:
|
|
93
|
+
if row["handback_id"] == self.handback_id:
|
|
94
|
+
return row
|
|
95
|
+
if not page["next_cursor"]:
|
|
96
|
+
return None
|
|
97
|
+
args["cursor"] = page["next_cursor"]
|
|
98
|
+
|
|
99
|
+
def submission_status(self):
|
|
100
|
+
self.check_member()
|
|
101
|
+
row = self._entry("handbacks")
|
|
102
|
+
if row is None:
|
|
103
|
+
return {"state": "not_submitted", "revision": 0}
|
|
104
|
+
if (row["binding_id"] != self.binding_id or row["workspace_id"] != self.workspace_id
|
|
105
|
+
or row["kind"] != "document" or len(row.get("sources", [])) != 1
|
|
106
|
+
or row["sources"][0]["reference_id"] != self.draft_reference_id):
|
|
107
|
+
raise InvitationUnavailable("The assigned draft slot is unavailable.")
|
|
108
|
+
decision = self._entry("dispositions")
|
|
109
|
+
# The author needs the exact review round even if a newer version is pending.
|
|
110
|
+
review = None
|
|
111
|
+
if decision:
|
|
112
|
+
review = {key: decision[key] for key in ("handback_revision", "verdict")}
|
|
113
|
+
review["summary"] = decision.get("summary")
|
|
114
|
+
review["details_omitted"] = decision.get("details_omitted", False)
|
|
115
|
+
return {"handback_id": self.handback_id, "revision": row["revision"], "state": row["state"],
|
|
116
|
+
"reference": row["sources"][0], "last_review": review}
|