feat(work): add signed task progress and durable status cards

This commit is contained in:
ex_tianzy
2026-11-12 15:18:21 +08:00
parent 2e0d5987c0
commit abe2550dd0
11 changed files with 439 additions and 2 deletions
+7 -1
View File
@@ -196,7 +196,7 @@ def validate_overlay(base, merged, candidate, router_key_required=True):
env = new[name]["environment"]
for key, value in old[name].get("environment", {}).items():
if key not in {"HN_CREDENTIAL_MODE","HN_ROUTER_ADMISSION_SECRET","HN_CREDENTIAL_KEYRING_FILE",
"HN_CREDENTIAL_PERMISSION_PROFILES","HN_CONNECTOR_INTERNAL_URL","HN_FEISHU_APP_ID","HN_OAUTH_ENABLED","HN_WORK_FILES_ENABLED"}:
"HN_CREDENTIAL_PERMISSION_PROFILES","HN_CONNECTOR_INTERNAL_URL","HN_FEISHU_APP_ID","HN_OAUTH_ENABLED","HN_WORK_FILES_ENABLED","HN_WORK_TASK_CARDS_ENABLED"}:
if env.get(key) != value:
raise DeployError("existing environment changed: "+key)
old_volumes = {v["target"]:v for v in old[name].get("volumes", [])}
@@ -375,6 +375,8 @@ def prepare_update(args):
raise DeployError('missing update source')
if getattr(args,'enable_work_files',False)and not (source/'relay/work_files.py').is_file():
raise DeployError('work files implementation missing from update source')
if getattr(args,'enable_task_cards',False)and not (source/'relay/task_cards.py').is_file():
raise DeployError('task cards implementation missing from update source')
output=output.resolve()
output.mkdir(mode=0o700)
os.chmod(output,0o700)
@@ -395,6 +397,9 @@ def prepare_update(args):
if getattr(args,'enable_work_files',False):
overlay['services']['connector']['environment']['HN_WORK_FILES_ENABLED']='true'
plan['work_files_enabled']=True
if getattr(args,'enable_task_cards',False):
overlay['services']['connector']['environment']['HN_WORK_TASK_CARDS_ENABLED']='true'
plan['work_task_cards_enabled']=True
write_json(output/'compose.broker.json',overlay)
for name in ('connector','router'):
rollback['services'][name]['image']=roles[name]['image']
@@ -714,6 +719,7 @@ def main():
update.add_argument("--source-root",default=str(Path(__file__).resolve().parents[1]))
update.add_argument("--output",required=True)
update.add_argument('--enable-work-files',action='store_true',help='Opt in after paired-client preparation; rollback retains the previous flag.')
update.add_argument('--enable-task-cards',action='store_true',help='Opt in to paired-client status cards; rollback retains the previous flag.')
permissions=sub.add_parser('update-permissions')
permissions.add_argument('--plan',required=True)
permissions.add_argument('--profiles',required=True)