From 6b76d3d03768d3ed59d6cccf197c037120a1bbe3 Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Fri, 18 Sep 2026 20:57:07 +0800 Subject: [PATCH 1/7] refactor(todos): complete User updates through canonical terminal authority Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- loopx/chat_actions.py | 3 + loopx/chat_todo_actions.py | 25 ++- loopx/cli_commands/todo_registration.py | 4 +- .../coordination/local_authority_runtime.ts | 12 +- .../coordination/todo_terminal_lifecycle.ts | 118 +++++++++--- .../control_plane/coordination/todo_update.ts | 172 ++++-------------- .../coordination/todo_update_admission.ts | 21 ++- .../coordination/todo_update_intent.ts | 160 ++++++++++++++++ .../presentation/action_review_plan.ts | 6 +- .../todos/completion_validation.py | 66 +++++++ .../control_plane/todos/native_update_plan.ts | 8 +- .../todos/provider_terminal_lifecycle.py | 66 +------ loopx/control_plane/todos/provider_update.py | 43 ++++- loopx/control_plane/todos/update_intent.py | 6 +- loopx/todos.py | 5 +- 15 files changed, 477 insertions(+), 238 deletions(-) create mode 100644 loopx/control_plane/coordination/todo_update_intent.ts diff --git a/loopx/chat_actions.py b/loopx/chat_actions.py index 878476f4bf..abaf41c425 100644 --- a/loopx/chat_actions.py +++ b/loopx/chat_actions.py @@ -1191,6 +1191,9 @@ def preview(self, request: Mapping[str, Any]) -> dict[str, Any]: action_kind == "monitor.update" and normalized.get("operation") not in {"stop", "run_now"} ) canonical_update_basis = self._canonical_update_basis(normalized["goal_id"]) if reviewed_edit else None + if action_kind == "todo.update" and normalized.get("operation") == "complete": + canonical_update_basis = self._canonical_update_basis(normalized["goal_id"], + user_completion_todo_id=normalized["todo_id"]) if action_kind == "todo.update" or normalized.get("operation") != "run_now": run = self._run_todo_update if action_kind == "todo.update" else self._run_monitor_update canonical_preview = run(normalized, dry_run=True, basis=canonical_update_basis) diff --git a/loopx/chat_todo_actions.py b/loopx/chat_todo_actions.py index 4d86c8537d..57d41ee7d4 100644 --- a/loopx/chat_todo_actions.py +++ b/loopx/chat_todo_actions.py @@ -21,7 +21,7 @@ def _run_todo_update( ) -> dict[str, Any]: goal_id = str(parameters["goal_id"]) operation = str(parameters.get("operation") or "edit") - if operation == "complete": + if operation == "complete" and basis is None: return complete_goal_todo( registry_path=self.registry_path, goal_id=goal_id, @@ -34,7 +34,9 @@ def _run_todo_update( dry_run=dry_run, ) status = parameters.get("status") - if operation == "block": + if operation == "complete": + status = "done" + elif operation == "block": status = "blocked" elif operation == "defer": status = "deferred" @@ -44,6 +46,8 @@ def _run_todo_update( todo_id=str(parameters["todo_id"]), text=parameters.get("text"), status=status, + **({"role": "user", "no_followup": bool(parameters.get("no_followup", True))} + if operation == "complete" else {}), note=parameters.get("note"), claimed_by=( parameters.get("agent_id") if operation == "reassign" else None @@ -70,7 +74,9 @@ def _reviewed_update_options( "update_expected_registry_sha256": basis["registry_sha256"], } - def _canonical_update_basis(self, goal_id: str) -> dict[str, Any] | None: + def _canonical_update_basis( + self, goal_id: str, *, user_completion_todo_id: str | None = None, + ) -> dict[str, Any] | None: registry_sha256 = self._registry_fingerprint() authority = read_canonical_todos_if_promoted( runtime_root=effective_runtime_root(self.registry_path, None), @@ -80,6 +86,13 @@ def _canonical_update_basis(self, goal_id: str) -> dict[str, Any] | None: raise ValueError("Todo authority registration changed while reading; retry") if authority is None: return None + # Select the User completion transport from this same preview revision. + # The TS transaction rechecks role and authority; this is not admission. + if user_completion_todo_id is not None and not any( + todo.get("todo_id") == user_completion_todo_id and todo.get("role") == "user" + for todo in authority["todos"] + ): + return None return { "schema_version": "loopx_chat_canonical_update_basis_v0", "provider_revision": authority["provider_revision"], @@ -117,6 +130,11 @@ def _apply_reviewed_todo_edit( details={"operation_id": operation_id, "reason_code": error.code}, ) return {"proposal": failed, "turn": None} + if result.get("ok") is not True: + failed = self.store.mark_failed(proposal_id, error_code="canonical_update_validation_failed", + message="Completion validation did not pass. The Todo was not completed; retry after resolving the validation failure.", + details={"operation_id": operation_id, "reason_code": result.get("reason_code")}) + return {"proposal": failed, "turn": None} original = result.get("original_receipt") or result todo_id = _opaque(result.get("todo_id"), field="todo_id") self.store.save_checkpoint(proposal_id, step="canonical_update", receipt={ @@ -133,6 +151,7 @@ def _apply_reviewed_todo_edit( operation = parameters.get("operation", "edit") outcome = ({"pause": "monitor_paused", "resume": "monitor_resumed", "edit": "monitor_updated"}[operation] if proposal["action_kind"] == "monitor.update" else + "todo_completed" if operation == "complete" else "todo_updated" if original.get("changed") else "todo_unchanged") stored = self.store.apply(proposal_id, current_state_fingerprint=str(proposal["expected_state_fingerprint"]), receipt={ diff --git a/loopx/cli_commands/todo_registration.py b/loopx/cli_commands/todo_registration.py index dac8c53bfa..a9d51172e9 100644 --- a/loopx/cli_commands/todo_registration.py +++ b/loopx/cli_commands/todo_registration.py @@ -67,9 +67,9 @@ def register_todo_command( todo_parser.add_argument("--todo-id", help="Structured todo id from status/quota, such as todo_ab12cd34ef56.") todo_parser.add_argument( "--update-operation-id", - help=("For promoted text/note or nonterminal planning update, reuse this operation id after a lost response; " + help=("For promoted text/note, planning or User completion update, reuse this operation id after a lost response; " "changed intent is rejected. Planning supports status, evidence, reason, resume conditions and successor links; " - "leased status changes remain unsupported."), + "User status=done uses terminal validation and lease release; other leased status changes remain unsupported."), ) todo_parser.add_argument( "--update-expected-provider-revision", diff --git a/loopx/control_plane/coordination/local_authority_runtime.ts b/loopx/control_plane/coordination/local_authority_runtime.ts index ea84267f27..9ade2350c2 100644 --- a/loopx/control_plane/coordination/local_authority_runtime.ts +++ b/loopx/control_plane/coordination/local_authority_runtime.ts @@ -66,6 +66,7 @@ import { COORDINATION_TODO_UPDATE_REQUEST_SCHEMA, COORDINATION_TODO_PLANNING_UPDATE_REQUEST_SCHEMA, COORDINATION_TODO_REVIEWED_UPDATE_REQUEST_SCHEMA, + COORDINATION_TODO_COMPLETION_UPDATE_REQUEST_SCHEMA, COORDINATION_TODO_UPDATE_RESULT_SCHEMA, executeCoordinationTodoUpdate, } from "./todo_update.ts"; @@ -830,7 +831,8 @@ export async function updateLocalCoordinationTodo( const input = requireJsonObject(value, "local coordination Todo update request"); if (input.schema_version !== COORDINATION_TODO_UPDATE_REQUEST_SCHEMA && input.schema_version !== COORDINATION_TODO_PLANNING_UPDATE_REQUEST_SCHEMA && - input.schema_version !== COORDINATION_TODO_REVIEWED_UPDATE_REQUEST_SCHEMA) { + input.schema_version !== COORDINATION_TODO_REVIEWED_UPDATE_REQUEST_SCHEMA && + input.schema_version !== COORDINATION_TODO_COMPLETION_UPDATE_REQUEST_SCHEMA) { throw new TypeError("local coordination Todo update request schema mismatch"); } const planningIntent = input.planning_intent == null ? undefined : @@ -839,7 +841,12 @@ export async function updateLocalCoordinationTodo( input.schema_version === COORDINATION_TODO_UPDATE_REQUEST_SCHEMA) { throw new TypeError("planning_intent requires the v1 Todo update request"); } - const reviewed = input.schema_version === COORDINATION_TODO_REVIEWED_UPDATE_REQUEST_SCHEMA; + const completionUpdate = input.schema_version === COORDINATION_TODO_COMPLETION_UPDATE_REQUEST_SCHEMA; + if (!completionUpdate && Object.hasOwn(input, "completion")) { + throw new TypeError("Todo completion payload requires request v3"); + } + if (completionUpdate && input.completion == null) throw new TypeError("Todo completion update requires its completion payload"); + const reviewed = completionUpdate || input.schema_version === COORDINATION_TODO_REVIEWED_UPDATE_REQUEST_SCHEMA; if (!reviewed && ["lifecycle_grants", "authority_reason", "registry_source", "expected_provider_revision", "expected_registry_sha256"].some(field => Object.hasOwn(input, field))) { throw new TypeError("Todo update admission and revision fields require request v2"); @@ -878,6 +885,7 @@ export async function updateLocalCoordinationTodo( lease_expected_version: optionalNonNegativeSafeInteger(input.lease_expected_version, "lease_expected_version"), patch: requireJsonObject(input.patch, "Todo update patch"), planning_intent: planningIntent, + ...(completionUpdate ? {completion: requireJsonObject(input.completion, "Todo completion payload")} : {}), clear_fields: input.clear_fields.map((field) => claimAgentValue(field, "clear field")), dry_run: input.dry_run as boolean, now: claimObservedAt(input.observed_at), diff --git a/loopx/control_plane/coordination/todo_terminal_lifecycle.ts b/loopx/control_plane/coordination/todo_terminal_lifecycle.ts index fea2bdc471..173d50d044 100644 --- a/loopx/control_plane/coordination/todo_terminal_lifecycle.ts +++ b/loopx/control_plane/coordination/todo_terminal_lifecycle.ts @@ -1,4 +1,6 @@ import {AUTHORITY_SOURCE_CHANGED, uncheckedAuthoritySource, type AuthoritySourceCheck} from "./authority_source.ts"; +import {normalizeTodoUpdateInput, prepareUpdatedTodo, type CoordinationTodoUpdateInput, type TodoCompletionEdit} from "./todo_update_intent.ts"; +import {todoUpdateAdmissionRejection} from "./todo_update_admission.ts"; import { createHash } from "node:crypto"; import {acceptanceWorkGuard, acceptanceCompletionRequirements, validateAcceptanceCompletion, acceptanceRequire, type AcceptanceCompletionRequirements} from "../goals/acceptance_contract.ts"; @@ -72,6 +74,7 @@ type TodoRole = typeof TODO_ROLES[number]; type CompletionIdentitySource = typeof COMPLETION_IDENTITY_SOURCES[number]; export interface CoordinationTodoTerminalLifecycleInput { + readonly user_update?: TodoCompletionEdit; readonly goal_id: string; readonly todo_id: string; readonly expected_role: TodoRole | null; @@ -269,6 +272,9 @@ function validateSuccessorSemantics( function normalizeTerminalInput( raw: CoordinationTodoTerminalLifecycleInput, ): CoordinationTodoTerminalLifecycleInput { + if (raw.user_update !== undefined && raw.command !== "complete") { + throw new AuthorityStoreProtocolError("User completion update requires complete"); + } const registeredAgents = normalizeRegisteredTodoAgents(raw.registered_agents); if (!Array.isArray(raw.successor_intents)) { throw new AuthorityStoreProtocolError("successor_intents must be an array"); @@ -371,6 +377,12 @@ function terminalRequestSha(input: CoordinationTodoTerminalLifecycleInput): stri todo_id: input.todo_id, expected_role: input.expected_role, command: input.command, + ...(input.user_update === undefined ? {} : {user_update: { + patch: input.user_update.patch, clear_fields: input.user_update.clear_fields, + planning_intent: input.user_update.planning_intent ?? {}, + expected_provider_revision: input.user_update.expected_provider_revision ?? null, + expected_registry_sha256: input.user_update.expected_registry_sha256 ?? null, + }}), actor_agent_id: input.actor_agent_id, authority_reason: input.authority_reason, decision_outcome: input.decision_outcome, @@ -384,7 +396,7 @@ function terminalRequestSha(input: CoordinationTodoTerminalLifecycleInput): stri successor_intents: input.successor_intents, clear_claim: input.clear_claim, completion_policy_request: completionPolicyIdentity, - validation_declaration_sha256: input.validation_declaration === null + validation_declaration_sha256: input.user_update !== undefined || input.validation_declaration === null ? null : canonicalAuthoritySha256(input.validation_declaration), dry_run: input.dry_run, }); @@ -721,6 +733,29 @@ export async function executeCoordinationTodoTerminalLifecycle( error instanceof Error ? error.message : "invalid Todo terminal lifecycle request", ); } + let update: CoordinationTodoUpdateInput | undefined; + if (input.user_update !== undefined) { + try { + const edit = canonicalAuthorityObject(input.user_update, "User completion edit"); + if (Object.keys(edit).some(field => !["patch", "clear_fields", "planning_intent", + "expected_provider_revision", "expected_registry_sha256", "validation_source_provider_revision"].includes(field))) { + throw new AuthorityStoreProtocolError("User completion edit cannot carry authority facts"); + } + update = normalizeTodoUpdateInput({ + goal_id: input.goal_id, todo_id: input.todo_id, expected_role: input.expected_role, + actor_agent_id: input.actor_agent_id, registered_agents: input.registered_agents, + lifecycle_grants: input.lifecycle_grants, authority_reason: input.authority_reason, + operation_id: input.operation_id, lease_idempotency_key: input.lease_idempotency_key, + lease_expected_version: input.lease_expected_version, dry_run: input.dry_run, now: input.now, + ...input.user_update, completion: {}, + }); + if (input.user_update.validation_source_provider_revision !== undefined) { + requireAuthorityStoreId(input.user_update.validation_source_provider_revision, "completion source provider revision"); + } + } catch (error) { + return terminalFailure("invalid_coordination_todo_update", error instanceof Error ? error.message : "Invalid User completion edit"); + } + } const requestSha = terminalRequestSha(input); // Unlike `todo_claim`, this replay needs no post-replay acceptance re-check. // A claim receipt grants work going forward, so replaying one after its @@ -742,6 +777,16 @@ export async function executeCoordinationTodoTerminalLifecycle( changed: false, }; } + if (update !== undefined) { + const basis = input.user_update?.validation_source_provider_revision; + if ((update.expected_provider_revision !== undefined && update.expected_provider_revision !== head.provider_revision) || + (basis != null && basis !== head.provider_revision)) { + return terminalFailure("provider_revision_mismatch", "Todo changed during completion review or validation; reread and retry"); + } + if ((input.validation_receipt !== null || input.goal_acceptance_validation_receipts != null) && basis == null) { + return terminalFailure("completion_validation_source_required", "Completion validation requires its issued provider revision"); + } + } let projection: ReturnType; let readModel: JsonObject; try { @@ -753,7 +798,7 @@ export async function executeCoordinationTodoTerminalLifecycle( error instanceof Error ? error.message : "invalid coordination projection", ); } - const todo = projection.todos.get(input.todo_id); + let todo = projection.todos.get(input.todo_id); if (todo === undefined) { return terminalFailure("todo_not_found", "Todo is missing from the canonical provider head", { todo_id: input.todo_id, @@ -775,13 +820,33 @@ export async function executeCoordinationTodoTerminalLifecycle( "decision_rejection", ); } + const authorityTodo = todo; + let edit: ReturnType | null = null; + if (update !== undefined) { + try { + if (todo.role !== "user") throw new AuthorityStoreProtocolError( + "agent todo completion must use complete_goal_todo (loopx todo complete)"); + const rejection = todoUpdateAdmissionRejection(head.head, todo, projection.leases, update, "user_completion"); + if (rejection !== null) return terminalFailure(rejection.code, rejection.reason, {}, "decision_rejection"); + edit = prepareUpdatedTodo(todo, update, head.head, "user_completion"); + // A combined binding/owner edit must not erase the original restrictions + // or move the completed record outside the actor's authority. + const candidate = {...edit.next, status: todo.status, done: todo.done}; + const nextRejection = todoUpdateAdmissionRejection(head.head, candidate, projection.leases, update, "user_completion"); + if (nextRejection !== null) return terminalFailure(nextRejection.code, nextRejection.reason, {}, "decision_rejection"); + todo = candidate; + } catch (error) { + return terminalFailure("invalid_coordination_todo_update", + error instanceof Error ? error.message : "Invalid User completion update"); + } + } const handoffMode = typeof head.head.handoff_mode === "string" ? head.head.handoff_mode : "legacy"; if (!["legacy", "soft_claim", "hard_lease"].includes(handoffMode)) { return terminalFailure("invalid_handoff_mode", "canonical projection has an invalid handoff mode"); } - const decisionTarget = typeof todo.unblocks_todo_id === "string" - ? projection.todos.get(todo.unblocks_todo_id) : undefined; + const decisionTarget = typeof authorityTodo.unblocks_todo_id === "string" + ? projection.todos.get(authorityTodo.unblocks_todo_id) : undefined; let authority: CoordinationTodoTerminalDecisionResult; try { authority = evaluateCoordinationTodoTerminalDecision({ @@ -790,7 +855,7 @@ export async function executeCoordinationTodoTerminalLifecycle( handoff_mode: handoffMode, registered_agents: input.registered_agents, lifecycle_grants: input.lifecycle_grants, - todo: todoFact(todo), + todo: todoFact(authorityTodo), decision_target: decisionTarget === undefined ? null : todoFact(decisionTarget), lease: leaseFact(projection.leases.get(input.todo_id), input.now), actor_agent_id: input.actor_agent_id, @@ -820,19 +885,23 @@ export async function executeCoordinationTodoTerminalLifecycle( // entry reaches `terminalTarget`, which writes `status: "done", done: true`, // so the guard follows that write instead of one command name. A future // terminal command then inherits it rather than silently bypassing it. - const acceptance = acceptanceWorkGuard(head.head, input.goal_id, input.todo_id); + const completionHead = edit === null ? head.head : prepareCoordinationProjectionCommit({ + goal_id: input.goal_id, operation_id: input.operation_id, expected_provider_revision: head.provider_revision, + projection: head.head, mutations: [{kind: "todo_upsert", todo, clear_fields: edit.clearFields}], + }).next_projection; + const acceptance = acceptanceWorkGuard(completionHead, input.goal_id, input.todo_id); if (acceptance !== null && !acceptance.allowed) { return terminalFailure(String(acceptance.reason_code), `${String(acceptance.reason)} Inspect Goal acceptance and ask the owner to configure or rebind this Todo.`, {goal_acceptance_guard: acceptance}, "decision_rejection"); } - const acceptanceRequirements = acceptanceCompletionRequirements(head.head, input.goal_id, input.todo_id); + const acceptanceRequirements = acceptanceCompletionRequirements(completionHead, input.goal_id, input.todo_id); const acceptanceBinding = acceptanceRequirements === null ? null : acceptanceSourceBinding(input, acceptanceRequirements, head.provider_revision); let acceptanceEvidence: JsonObject | null = null; if (acceptanceRequirements !== null && acceptanceBinding !== null && input.goal_acceptance_validation_receipts != null) { try { - acceptanceEvidence = acceptanceCompletionEvidence(head.head, input, acceptanceRequirements, acceptanceBinding); + acceptanceEvidence = acceptanceCompletionEvidence(completionHead, input, acceptanceRequirements, acceptanceBinding); } catch (error) { return terminalFailure("goal_acceptance_validation_rejected", error instanceof Error ? error.message : "Acceptance completion validation failed.", {}, "decision_rejection"); @@ -842,11 +911,25 @@ export async function executeCoordinationTodoTerminalLifecycle( "This terminal operation has no applicable acceptance validation requirements.", {}, "decision_rejection"); } + // Link admission precedes effects: an invalid successor cannot justify + // running a caller command, even if the command itself would succeed. + for (const successorId of input.linked_successor_todo_ids) { + if (successorId === input.todo_id) { + return terminalFailure("todo_successor_cycle", "Todo cannot name itself as a successor"); + } + if (!projection.todos.has(successorId)) { + return terminalFailure( + "todo_successor_not_found", + "linked successor Todo is missing from the canonical provider head", + {todo_id: successorId}, + ); + } + } let completion: ReturnType | null = null; if (input.command === "complete") { const validationRequired = todo.completion_validation_required === true; const validationSha256 = todo.completion_validation_sha256; - if (validationRequired) { + if (validationRequired && (update === undefined || authorityTodo.status !== "done")) { if (typeof validationSha256 !== "string" || !/^[a-f0-9]{64}$/u.test(validationSha256)) { return terminalFailure( "completion_validation_identity_missing", @@ -865,7 +948,7 @@ export async function executeCoordinationTodoTerminalLifecycle( "private completion validation declaration does not match canonical authority", ); } - } else if (input.validation_declaration !== null) { + } else if (!validationRequired && input.validation_declaration !== null) { return terminalFailure( "completion_validation_declaration_forbidden", "Todo without canonical validation authority cannot execute a private declaration", @@ -942,7 +1025,7 @@ export async function executeCoordinationTodoTerminalLifecycle( ); } - if (authority.outcome === "no_change") { + if (authority.outcome === "no_change" && (edit === null || !edit.changed)) { if (input.successor_intents.length > 0) { return terminalFailure( "todo_terminal_successor_intent_after_completion", @@ -955,6 +1038,7 @@ export async function executeCoordinationTodoTerminalLifecycle( ? todo.successor_todo_ids.map((value, index) => requireAuthorityStoreId(value, `todo.successor_todo_ids[${index}]`)) : []; + if (!await authoritySourcesCurrent()) return sourceChanged(); return commitTerminalResult(store, input, requestSha, head, { todo_id: input.todo_id, command: input.command, @@ -1018,15 +1102,6 @@ export async function executeCoordinationTodoTerminalLifecycle( ...input.linked_successor_todo_ids, ...generatedSuccessorIds, ])]; - for (const successorId of input.linked_successor_todo_ids) { - if (!projection.todos.has(successorId)) { - return terminalFailure( - "todo_successor_not_found", - "linked successor Todo is missing from the canonical provider head", - {todo_id: successorId}, - ); - } - } for (const successorId of successorIds) { if (successorId === input.todo_id) { return terminalFailure("todo_successor_cycle", "Todo cannot name itself as a successor"); @@ -1094,7 +1169,8 @@ export async function executeCoordinationTodoTerminalLifecycle( const currentLease = projection.leases.get(input.todo_id); const released = releasedLease(currentLease, authority, input); const target = terminalTarget(todo, input, completion, successorIds); - const changed = authority.outcome === "apply"; + if (edit !== null) target.clear_fields = [...new Set([...edit.clearFields, ...target.clear_fields])]; + const changed = authority.outcome === "apply" || edit?.changed === true; const result: JsonObject = { todo_id: input.todo_id, command: input.command, diff --git a/loopx/control_plane/coordination/todo_update.ts b/loopx/control_plane/coordination/todo_update.ts index 29e6c9bb41..ff3c5b8be0 100644 --- a/loopx/control_plane/coordination/todo_update.ts +++ b/loopx/control_plane/coordination/todo_update.ts @@ -1,25 +1,20 @@ import {AUTHORITY_SOURCE_CHANGED, uncheckedAuthoritySource, type AuthoritySourceCheck} from "./authority_source.ts"; import type { JsonObject } from "../effect_program.ts"; import {acceptanceWorkGuard} from "../goals/acceptance_contract.ts"; -import { TODO_OWNERSHIP_INTENT_FIELDS } from "../todos/authoring_scope.ts"; import type { AuthorityStore, AuthorityStoreCommit } from "./authority_store.ts"; import { AuthorityStoreProtocolError, - canonicalAuthorityBytes, canonicalAuthorityObject, canonicalAuthoritySha256, requireAuthorityStoreId, } from "./authority_store_codec.ts"; -import {canonicalTodoRecord} from "./todo_presentation.ts"; import { indexCoordinationProjection, prepareCoordinationProjectionCommit, validateCoordinationTodoReadModel, } from "./coordination_projection.ts"; -import { normalizeRegisteredTodoAgents, normalizeTodoAgent } from "./todo_agents.ts"; import {todoUpdateAdmissionRejection} from "./todo_update_admission.ts"; -import { normalizeNativePlanningIntent, planNativeTodoUpdate } from "../todos/native_update_plan.ts"; import { CoordinationCommandReceipt } from "./command_receipt.ts"; export const COORDINATION_TODO_UPDATE_REQUEST_SCHEMA = @@ -35,27 +30,11 @@ export const COORDINATION_TODO_UPDATE_RESULT_SCHEMA = export const COORDINATION_TODO_UPDATE_RECEIPT_SCHEMA = "loopx_coordination_todo_update_receipt_v0"; -const UPDATE_FIELDS = new Set(["text", "note"]); - -export interface CoordinationTodoUpdateInput { - readonly goal_id: string; - readonly todo_id: string; - readonly expected_role: string | null; - readonly actor_agent_id: string | null; - readonly registered_agents: readonly string[]; - readonly operation_id: string; - readonly expected_provider_revision?: string; - readonly expected_registry_sha256?: string; - readonly lifecycle_grants?: readonly JsonObject[]; - readonly authority_reason?: string | null; - readonly patch: JsonObject; - readonly clear_fields: readonly string[]; - readonly dry_run: boolean; - readonly now: Date; - readonly lease_idempotency_key?: string | null; - readonly lease_expected_version?: number | null; - readonly planning_intent?: JsonObject; -} +export const COORDINATION_TODO_COMPLETION_UPDATE_REQUEST_SCHEMA = + "loopx_local_coordination_todo_update_request_v3"; +export type {CoordinationTodoUpdateInput} from "./todo_update_intent.ts"; +import {normalizeTodoUpdateInput, prepareUpdatedTodo, type CoordinationTodoUpdateInput} from "./todo_update_intent.ts"; +import {executeCoordinationTodoTerminalLifecycle} from "./todo_terminal_lifecycle.ts"; export type CoordinationTodoUpdateResult = JsonObject & { readonly schema_version: typeof COORDINATION_TODO_UPDATE_RESULT_SCHEMA; @@ -71,61 +50,6 @@ function isFailure(value: JsonObject): value is CoordinationTodoUpdateResult { value.status === "failed"; } -function normalizeInput(raw: CoordinationTodoUpdateInput): CoordinationTodoUpdateInput { - if (raw.expected_provider_revision !== undefined) { - requireAuthorityStoreId(raw.expected_provider_revision, "expected_provider_revision"); - } - if (raw.expected_registry_sha256 !== undefined && !/^[a-f0-9]{64}$/u.test(raw.expected_registry_sha256)) { - throw new AuthorityStoreProtocolError("expected_registry_sha256 must be a SHA-256 digest"); - } - if (raw.authority_reason != null && typeof raw.authority_reason !== "string") { - throw new AuthorityStoreProtocolError("authority_reason must be a string"); - } - const planningIntent = normalizeNativePlanningIntent(raw.planning_intent); - const key = raw.lease_idempotency_key ?? null; - const version = raw.lease_expected_version ?? null; - if (key !== null && (typeof key !== "string" || !key.trim() || key !== key.trim())) { - throw new AuthorityStoreProtocolError("lease_idempotency_key must be a non-empty unpadded string"); - } - if (version !== null && (!Number.isSafeInteger(version) || version < 0)) { - throw new AuthorityStoreProtocolError("lease_expected_version must be a non-negative safe integer"); - } - const patch = canonicalAuthorityObject(raw.patch, "Todo update patch"); - const clearFields = raw.clear_fields.map((field, index) => - requireAuthorityStoreId(field, `clear_fields[${index}]`)); - if (Object.keys(patch).length + clearFields.length + Object.keys(planningIntent).length === 0) { - throw new AuthorityStoreProtocolError("Todo update requires a non-empty patch"); - } - if (new Set(clearFields).size !== clearFields.length) { - throw new AuthorityStoreProtocolError("clear_fields must be unique"); - } - const unsupported = [...Object.keys(patch), ...clearFields] - .find((field) => !UPDATE_FIELDS.has(field)); - if (unsupported !== undefined) { - throw new AuthorityStoreProtocolError(`Todo update does not own field ${unsupported}`); - } - if (Object.keys(patch).some((field) => clearFields.includes(field))) { - throw new AuthorityStoreProtocolError("Todo update cannot patch and clear the same field"); - } - if (raw.expected_role !== null && !["agent", "user"].includes(raw.expected_role)) { - throw new AuthorityStoreProtocolError("expected_role must be agent or user"); - } - if (typeof raw.dry_run !== "boolean") { - throw new AuthorityStoreProtocolError("dry_run must be a boolean"); - } - if (!(raw.now instanceof Date) || Number.isNaN(raw.now.valueOf())) { - throw new AuthorityStoreProtocolError("now must be a valid Date"); - } - return {...raw, planning_intent: planningIntent, lease_idempotency_key: key, lease_expected_version: version, - goal_id: requireAuthorityStoreId(raw.goal_id, "goal id"), - todo_id: requireAuthorityStoreId(raw.todo_id, "todo id"), - operation_id: requireAuthorityStoreId(raw.operation_id, "operation id"), - actor_agent_id: raw.actor_agent_id === null ? null : - normalizeTodoAgent(raw.actor_agent_id, "actor_agent_id"), - registered_agents: normalizeRegisteredTodoAgents(raw.registered_agents), - patch, clear_fields: clearFields}; -} - function updateReceipt(input: CoordinationTodoUpdateInput, requestSha: string) { return new CoordinationCommandReceipt({result_schema: COORDINATION_TODO_UPDATE_RESULT_SCHEMA, identity: {schema_version: COORDINATION_TODO_UPDATE_RECEIPT_SCHEMA, @@ -172,65 +96,45 @@ function loadUpdateTarget( } } -function prepareUpdatedTodo( - todo: JsonObject, input: CoordinationTodoUpdateInput, head: JsonObject, -): {next: JsonObject; changed: boolean; clearFields: string[]} | CoordinationTodoUpdateResult { - const next: JsonObject = {...todo, ...input.patch}; - for (const field of input.clear_fields) delete next[field]; - // Preserve the public planner's legacy metadata semantics. Raw copy edits - // already carry actor attribution, while planning-only updates historically - // leave last_actor_agent_id untouched. - const rawCopyChanged = Object.entries(input.patch).some(([field, value]) => - !Object.hasOwn(todo, field) || !canonicalAuthorityBytes(todo[field]).equals(canonicalAuthorityBytes(value))) || - input.clear_fields.some(field => Object.hasOwn(todo, field)); - if (rawCopyChanged || TODO_OWNERSHIP_INTENT_FIELDS.some(field => Object.hasOwn(input.planning_intent ?? {}, field))) { - next.last_actor_agent_id = input.actor_agent_id; - } - next.updated_at = input.now.toISOString().replace(/\.\d{3}Z$/u, "Z"); - const clearFields = new Set(input.clear_fields); - try { - if (Object.keys(input.planning_intent ?? {}).length) { - const updates = planNativeTodoUpdate(todo, input.planning_intent!, head, - input.actor_agent_id, input.registered_agents, String(next.updated_at)); - for (const [field, value] of Object.entries(updates)) { - // Markdown compatibility omits empty scalar metadata. Treat an - // explicit empty planning scalar as a clear in the canonical record as - // well; omission and clear are no longer conflated by the planner. - if (value === null || value === "") { delete next[field]; clearFields.add(field); } - else next[field] = value; - } - next.done = next.status === "done" || next.status === "deferred"; - } - canonicalTodoRecord(next, "updated Todo"); - } catch (error) { - return failure("invalid_coordination_todo_update", - error instanceof Error ? error.message : "invalid updated Todo"); - } - const changedBeforeAudit = {...next}; - delete changedBeforeAudit.last_actor_agent_id; - delete changedBeforeAudit.updated_at; - const originalBeforeAudit = {...todo}; - delete originalBeforeAudit.last_actor_agent_id; - delete originalBeforeAudit.updated_at; - const changed = !canonicalAuthorityBytes(changedBeforeAudit).equals( - canonicalAuthorityBytes(originalBeforeAudit)); - if (!changed) { - next.last_actor_agent_id = todo.last_actor_agent_id; - next.updated_at = todo.updated_at; - } - return {next, changed, clearFields: [...clearFields]}; -} - /** Update mutable Todo metadata from the canonical provider head. */ export async function executeCoordinationTodoUpdate( store: AuthorityStore, rawInput: CoordinationTodoUpdateInput, authoritySourcesCurrent: AuthoritySourceCheck = uncheckedAuthoritySource, ): Promise { let input: CoordinationTodoUpdateInput; - try { input = normalizeInput(rawInput); } catch (error) { + try { input = normalizeTodoUpdateInput(rawInput); } catch (error) { return failure("invalid_coordination_todo_update", error instanceof Error ? error.message : "invalid Todo update"); } + if (input.completion !== undefined) { + const completion = input.completion; + const object = (field: string) => completion[field] == null ? null : + canonicalAuthorityObject(completion[field], field); + const intent = input.planning_intent!; + const result = await executeCoordinationTodoTerminalLifecycle(store, { + goal_id: input.goal_id, todo_id: input.todo_id, expected_role: input.expected_role as "user" | "agent" | null, + command: "complete", actor_agent_id: input.actor_agent_id, registered_agents: input.registered_agents, + lifecycle_grants: input.lifecycle_grants ?? [], authority_reason: input.authority_reason ?? null, + decision_outcome: null, operation_id: input.operation_id, + lease_idempotency_key: input.lease_idempotency_key ?? null, lease_expected_version: input.lease_expected_version ?? null, + allow_user_gate_auto_acquire: input.lease_idempotency_key == null && input.lease_expected_version == null, requested_no_followup: intent.no_followup === true, + requested_completion_turn_key: null, requested_completion_identity_source: null, + linked_successor_todo_ids: (intent.successor_todo_ids ?? []) as string[], successor_intents: [], + note: null, evidence: null, reason: null, clear_claim: intent.clear_claim === true, + validation_declaration: object("validation_declaration"), validation_receipt: object("validation_receipt"), + completion_policy_request: object("completion_policy_request"), + goal_acceptance_source_binding: object("goal_acceptance_source_binding"), + goal_acceptance_validation_receipts: completion.goal_acceptance_validation_receipts, + dry_run: input.dry_run, now: input.now, user_update: { + patch: input.patch, clear_fields: input.clear_fields, planning_intent: intent, + ...(input.expected_provider_revision === undefined ? {} : {expected_provider_revision: input.expected_provider_revision}), + ...(input.expected_registry_sha256 === undefined ? {} : {expected_registry_sha256: input.expected_registry_sha256}), + ...(completion.source_provider_revision == null ? {} : { + validation_source_provider_revision: requireAuthorityStoreId(completion.source_provider_revision, "completion source provider revision")}), + }, + }, authoritySourcesCurrent); + return {...result, schema_version: COORDINATION_TODO_UPDATE_RESULT_SCHEMA}; + } const requestSha = updateRequestSha(input); const receipt = updateReceipt(input, requestSha); const replay = await receipt.read(store); @@ -261,8 +165,10 @@ export async function executeCoordinationTodoUpdate( if (isFailure(target)) return target; const rejected = todoUpdateAdmissionRejection(head.head, target.todo, target.leases, input); if (rejected !== null) return failure(rejected.code, rejected.reason); - const prepared = prepareUpdatedTodo(target.todo, input, head.head); - if (isFailure(prepared)) return prepared; + let prepared: ReturnType; + try { prepared = prepareUpdatedTodo(target.todo, input, head.head); } + catch (error) { return failure("invalid_coordination_todo_update", + error instanceof Error ? error.message : "invalid updated Todo"); } const {next, changed, clearFields} = prepared; const commit: AuthorityStoreCommit = changed ? prepareCoordinationProjectionCommit({ goal_id: input.goal_id, operation_id: input.operation_id, diff --git a/loopx/control_plane/coordination/todo_update_admission.ts b/loopx/control_plane/coordination/todo_update_admission.ts index a4b470a044..e06324518a 100644 --- a/loopx/control_plane/coordination/todo_update_admission.ts +++ b/loopx/control_plane/coordination/todo_update_admission.ts @@ -1,7 +1,8 @@ -/** Admission for nonterminal Todo edits. Grants may cross a claim owner; +/** Admission for Todo edits; terminal completion retains its own lease proof. + * Grants may cross a claim owner; * exclusions, bindings and execution lineage remain independent restrictions. */ import type {JsonObject} from "../effect_program.ts"; -import type {CoordinationTodoUpdateInput} from "./todo_update.ts"; +import type {CoordinationTodoUpdateInput} from "./todo_update_intent.ts"; import {TODO_WORK_REQUIREMENT_FIELDS} from "../todos/work_requirements.ts"; import {TODO_OWNERSHIP_INTENT_FIELDS} from "../todos/authoring_scope.ts"; import {evaluateCoordinationTodoMutationDecision, @@ -13,7 +14,7 @@ const reject = (code: string, reason: string): TodoUpdateRejection => ({code, re export function todoUpdateAdmissionRejection( head: JsonObject, todo: JsonObject, leases: ReadonlyMap, - input: CoordinationTodoUpdateInput, + input: CoordinationTodoUpdateInput, kind: "planning" | "user_completion" = "planning", ): TodoUpdateRejection | null { if (input.expected_role !== null && todo.role !== input.expected_role) { return reject("todo_role_mismatch", "Todo does not have the requested role"); @@ -21,7 +22,7 @@ export function todoUpdateAdmissionRejection( if (todo.archive_state !== "active") { return reject("todo_archived", "Todo update requires an active Todo"); } - if (todo.status === "done") { + if (todo.status === "done" && kind === "planning") { return reject("unsupported_todo_update_target", "native metadata update cannot complete a Todo; use the terminal lifecycle command"); } @@ -34,6 +35,10 @@ export function todoUpdateAdmissionRejection( const ownershipMutation = ["claimed_by", "clear_claim", "excluded_agents", "bound_agent", "goal_bound", "blocks_agent", "clear_blocks_agent", "global_gate", "clear_global_gate"] .some(field => Object.hasOwn(intent, field)); + if (kind === "user_completion" && (lease !== undefined || mode === "hard_lease") && ownershipMutation) { + return reject("update_lease_ownership_transition_unsupported", + "Ownership/exclusion edits require a lease lifecycle transaction; complete before changing the execution grant"); + } const authorityDecision = evaluateCoordinationTodoMutationDecision({ schema_version: COORDINATION_TODO_MUTATION_DECISION_REQUEST_SCHEMA, command: "update", handoff_mode: mode, registered_agents: input.registered_agents, @@ -81,6 +86,14 @@ export function todoUpdateAdmissionRejection( return reject("update_lease_ownership_transition_unsupported", "Ownership/exclusion edits require a lease lifecycle transaction; metadata update cannot rewrite an execution grant"); } + // Completion has its own terminal lease proof and atomic release. It still + // cannot rewrite an execution grant's ownership or work requirements. + if (kind === "user_completion") { + if (lease !== undefined && TODO_WORK_REQUIREMENT_FIELDS.some(field => Object.hasOwn(intent, field))) { + return reject("update_lease_requirements_transition_unsupported", "Complete leased work before changing its requirements"); + } + return null; + } if (lease !== undefined || mode === "hard_lease" || input.lease_idempotency_key != null || input.lease_expected_version != null) { try { diff --git a/loopx/control_plane/coordination/todo_update_intent.ts b/loopx/control_plane/coordination/todo_update_intent.ts new file mode 100644 index 0000000000..3a273bcb55 --- /dev/null +++ b/loopx/control_plane/coordination/todo_update_intent.ts @@ -0,0 +1,160 @@ +/** Canonical edit decoding and materialization shared by ordinary updates and + * User completion. Admission, validation effects and commits stay with callers. */ +import type {JsonObject} from "../effect_program.ts"; +import {AuthorityStoreProtocolError, canonicalAuthorityObject, canonicalAuthorityBytes, + requireAuthorityStoreId} from "./authority_store_codec.ts"; +import {normalizeRegisteredTodoAgents, normalizeTodoAgent} from "./todo_agents.ts"; +import {canonicalTodoRecord} from "./todo_presentation.ts"; +import {TODO_OWNERSHIP_INTENT_FIELDS, planTodoAuthoringScope, TODO_AUTHORING_SCOPE_REQUEST_SCHEMA} from "../todos/authoring_scope.ts"; +import {normalizeNativePlanningIntent, planNativeTodoUpdate} from "../todos/native_update_plan.ts"; +const UPDATE_FIELDS = new Set(["text", "note"]); + +export interface CoordinationTodoUpdateInput { + readonly goal_id: string; + readonly todo_id: string; + readonly expected_role: string | null; + readonly actor_agent_id: string | null; + readonly registered_agents: readonly string[]; + readonly operation_id: string; + readonly expected_provider_revision?: string; + readonly expected_registry_sha256?: string; + readonly lifecycle_grants?: readonly JsonObject[]; + readonly authority_reason?: string | null; + readonly patch: JsonObject; + readonly clear_fields: readonly string[]; + readonly dry_run: boolean; + readonly now: Date; + readonly lease_idempotency_key?: string | null; + readonly lease_expected_version?: number | null; + readonly planning_intent?: JsonObject; + readonly completion?: JsonObject; +} + +/** Only edit intent crosses into the terminal owner; actor/lease authority is + * carried once, in the enclosing terminal request. */ +export type TodoCompletionEdit = Pick & { + readonly validation_source_provider_revision?: string; +}; + +export function normalizeTodoUpdateInput(raw: CoordinationTodoUpdateInput): CoordinationTodoUpdateInput { + if (raw.expected_provider_revision !== undefined) { + requireAuthorityStoreId(raw.expected_provider_revision, "expected_provider_revision"); + } + if (raw.expected_registry_sha256 !== undefined && !/^[a-f0-9]{64}$/u.test(raw.expected_registry_sha256)) { + throw new AuthorityStoreProtocolError("expected_registry_sha256 must be a SHA-256 digest"); + } + if (raw.authority_reason != null && typeof raw.authority_reason !== "string") { + throw new AuthorityStoreProtocolError("authority_reason must be a string"); + } + const completion = raw.completion === undefined ? undefined : canonicalAuthorityObject(raw.completion, "Todo completion update payload"); + if (completion !== undefined) { + if (Object.keys(completion).some(field => ![ + "validation_declaration", "validation_receipt", "source_provider_revision", + "completion_policy_request", "goal_acceptance_source_binding", "goal_acceptance_validation_receipts", + ].includes(field))) throw new AuthorityStoreProtocolError("Unknown Todo completion update field"); + for (const field of ["validation_declaration", "validation_receipt", "completion_policy_request", "goal_acceptance_source_binding"]) { + if (completion[field] != null) canonicalAuthorityObject(completion[field], field); + } + if (completion.source_provider_revision != null) { + requireAuthorityStoreId(completion.source_provider_revision, "completion source provider revision"); + } + } + const planningIntent = normalizeNativePlanningIntent(raw.planning_intent); + if (completion !== undefined && typeof planningIntent.status === "string") { + planningIntent.status = planningIntent.status.toLowerCase(); + } + if (raw.completion !== undefined && planningIntent.status !== "done") { + throw new AuthorityStoreProtocolError("Completion payload requires status=done"); + } + const key = raw.lease_idempotency_key ?? null; + const version = raw.lease_expected_version ?? null; + if (key !== null && (typeof key !== "string" || !key.trim() || key !== key.trim())) { + throw new AuthorityStoreProtocolError("lease_idempotency_key must be a non-empty unpadded string"); + } + if (version !== null && (!Number.isSafeInteger(version) || version < 0)) { + throw new AuthorityStoreProtocolError("lease_expected_version must be a non-negative safe integer"); + } + const patch = canonicalAuthorityObject(raw.patch, "Todo update patch"); + const clearFields = raw.clear_fields.map((field, index) => + requireAuthorityStoreId(field, `clear_fields[${index}]`)); + if (Object.keys(patch).length + clearFields.length + Object.keys(planningIntent).length === 0) { + throw new AuthorityStoreProtocolError("Todo update requires a non-empty patch"); + } + if (new Set(clearFields).size !== clearFields.length) { + throw new AuthorityStoreProtocolError("clear_fields must be unique"); + } + const unsupported = [...Object.keys(patch), ...clearFields] + .find((field) => !UPDATE_FIELDS.has(field)); + if (unsupported !== undefined) { + throw new AuthorityStoreProtocolError(`Todo update does not own field ${unsupported}`); + } + if (Object.keys(patch).some((field) => clearFields.includes(field))) { + throw new AuthorityStoreProtocolError("Todo update cannot patch and clear the same field"); + } + if (raw.expected_role !== null && !["agent", "user"].includes(raw.expected_role)) { + throw new AuthorityStoreProtocolError("expected_role must be agent or user"); + } + if (typeof raw.dry_run !== "boolean") { + throw new AuthorityStoreProtocolError("dry_run must be a boolean"); + } + if (!(raw.now instanceof Date) || Number.isNaN(raw.now.valueOf())) { + throw new AuthorityStoreProtocolError("now must be a valid Date"); + } + return {...raw, ...(completion === undefined ? {} : {completion}), planning_intent: planningIntent, lease_idempotency_key: key, lease_expected_version: version, + goal_id: requireAuthorityStoreId(raw.goal_id, "goal id"), + todo_id: requireAuthorityStoreId(raw.todo_id, "todo id"), + operation_id: requireAuthorityStoreId(raw.operation_id, "operation id"), + actor_agent_id: raw.actor_agent_id === null ? null : + normalizeTodoAgent(raw.actor_agent_id, "actor_agent_id"), + registered_agents: normalizeRegisteredTodoAgents(raw.registered_agents), + patch, clear_fields: clearFields}; +} + +export function prepareUpdatedTodo( + todo: JsonObject, input: CoordinationTodoUpdateInput, head: JsonObject, kind: "planning" | "user_completion" = "planning", +): {next: JsonObject; changed: boolean; clearFields: string[]} { + const next: JsonObject = {...todo, ...input.patch}; + for (const field of input.clear_fields) delete next[field]; + // Preserve the public planner's legacy metadata semantics. Raw copy edits + // already carry actor attribution, while planning-only updates historically + // leave last_actor_agent_id untouched. + const rawCopyChanged = Object.entries(input.patch).some(([field, value]) => + !Object.hasOwn(todo, field) || !canonicalAuthorityBytes(todo[field]).equals(canonicalAuthorityBytes(value))) || + input.clear_fields.some(field => Object.hasOwn(todo, field)); + if (rawCopyChanged || TODO_OWNERSHIP_INTENT_FIELDS.some(field => Object.hasOwn(input.planning_intent ?? {}, field))) { + next.last_actor_agent_id = input.actor_agent_id; + } + next.updated_at = input.now.toISOString().replace(/\.\d{3}Z$/u, "Z"); + const clearFields = new Set(input.clear_fields); + if (Object.keys(input.planning_intent ?? {}).length) { + const updates = planNativeTodoUpdate(todo, input.planning_intent!, head, + input.actor_agent_id, input.registered_agents, String(next.updated_at), kind); + for (const [field, value] of Object.entries(updates)) { + // Markdown compatibility omits empty scalar metadata. Treat an + // explicit empty planning scalar as a clear in the canonical record as + // well; omission and clear are no longer conflated by the planner. + if (value === null || value === "") { delete next[field]; clearFields.add(field); } + else next[field] = value; + } + next.done = next.status === "done" || next.status === "deferred"; + } + if (kind === "user_completion" && (todo.status !== "done" || Object.hasOwn(input.planning_intent ?? {}, "task_class"))) { + planTodoAuthoringScope({schema_version: TODO_AUTHORING_SCOPE_REQUEST_SCHEMA, command: "class", role: "user", todo: next, + intent: {task_class: next.task_class, blocks_agent: next.blocks_agent ?? null, global_gate: next.global_gate ?? null}}); + } + canonicalTodoRecord(next, "updated Todo"); + const changedBeforeAudit = {...next}; + delete changedBeforeAudit.last_actor_agent_id; + delete changedBeforeAudit.updated_at; + const originalBeforeAudit = {...todo}; + delete originalBeforeAudit.last_actor_agent_id; + delete originalBeforeAudit.updated_at; + const changed = !canonicalAuthorityBytes(changedBeforeAudit).equals( + canonicalAuthorityBytes(originalBeforeAudit)); + if (!changed) { + next.last_actor_agent_id = todo.last_actor_agent_id; + next.updated_at = todo.updated_at; + } + return {next, changed, clearFields: [...clearFields]}; +} diff --git a/loopx/control_plane/presentation/action_review_plan.ts b/loopx/control_plane/presentation/action_review_plan.ts index 278714e58a..36d4230bde 100644 --- a/loopx/control_plane/presentation/action_review_plan.ts +++ b/loopx/control_plane/presentation/action_review_plan.ts @@ -326,11 +326,11 @@ export function compileActionReviewPlan(proposalValue: unknown): ActionReviewPla } const basis = objectValue(proposal.canonical_update_basis); const parameters = objectValue(proposal.normalized_parameters); - const isCanonicalEdit = basis?.schema_version === "loopx_chat_canonical_update_basis_v0" + const isCanonicalUpdate = basis?.schema_version === "loopx_chat_canonical_update_basis_v0" && textValue(basis.provider_revision) !== null && textValue(basis.registry_sha256) !== null - && ((proposal.action_kind === "todo.update" && parameters?.operation !== "complete") + && ((proposal.action_kind === "todo.update") || (proposal.action_kind === "monitor.update" && ["pause", "resume", "edit"].includes(String(parameters?.operation)))); - if (isCanonicalEdit && (proposal.status === "applying" || proposal.status === "failed")) { + if (isCanonicalUpdate && (proposal.status === "applying" || proposal.status === "failed")) { const failure = objectValue(proposal.failure); return {...finish({interaction: "review", canApply: true, reason: failure?.error_code === "canonical_update_projection_pending" diff --git a/loopx/control_plane/todos/completion_validation.py b/loopx/control_plane/todos/completion_validation.py index 7aea8a5aad..3a96d168ec 100644 --- a/loopx/control_plane/todos/completion_validation.py +++ b/loopx/control_plane/todos/completion_validation.py @@ -727,3 +727,69 @@ def locked_todo_completion_source( todo = dict(event_context["item"]) todo["role"] = event_context["role"] return None, todo, event_context + + +def execute_completion_validation_effects( + result: Mapping[str, Any], *, registry_path: Path, goal_id: str, + delivery_workspace: Mapping[str, Any] | None = None, + validation_workspace_path: Path | None = None, +) -> dict[str, Any]: + """Execute only the declared effects; the TS caller owns admission/resume.""" + updates: dict[str, Any] = {} + effect = result.get("validation_effect") + acceptance_effects = result.get("goal_acceptance_validation_effects") + if not isinstance(effect, Mapping) and not isinstance(acceptance_effects, list): + raise RuntimeError("Todo terminal validation effect shape mismatch") + if isinstance(effect, Mapping): + updates["validation_receipt"] = run_declared_completion_validation_effect( + effect=effect, + registry_path=registry_path, + goal_id=goal_id, + delivery_workspace=delivery_workspace, + validation_workspace_path=validation_workspace_path, + ) + if acceptance_effects is not None: + from ..goals.acceptance import run_goal_acceptance_validation_effect + + if not isinstance(acceptance_effects, list) or not acceptance_effects: + raise RuntimeError("Goal acceptance validation effects are missing") + source_binding = result.get("goal_acceptance_source_binding") + if not isinstance(source_binding, Mapping): + raise RuntimeError("Goal acceptance validation omitted its source basis") + receipts = [] + for row in acceptance_effects: + if not isinstance(row, Mapping) or not isinstance(row.get("effect"), Mapping): + raise RuntimeError("Goal acceptance validation effect shape mismatch") + receipt = run_goal_acceptance_validation_effect( + effect=row["effect"], registry_path=registry_path, goal_id=goal_id, + delivery_workspace=delivery_workspace, + validation_workspace_path=validation_workspace_path, + ) + receipts.append({"criterion_id": row.get("criterion_id"), "receipt": receipt}) + updates["goal_acceptance_source_binding"] = dict(source_binding) + updates["goal_acceptance_validation_receipts"] = receipts + return updates + + +def completion_validation_failure( + result: Mapping[str, Any], *, goal_id: str, todo_id: str, dry_run: bool +) -> dict[str, Any] | None: + if result.get("status") != "failed": + return None + if result.get("reason_code") not in { + "validation_declaration_invalid", + "validation_failed", + }: + return None + return { + "ok": False, + "dry_run": dry_run, + "completed": False, + "changed": False, + "goal_id": goal_id, + "todo_id": todo_id, + "validation_blocked_completion": True, + "reason": result.get("reason"), + "validation_failure": result.get("validation_failure"), + **dict(result), + } diff --git a/loopx/control_plane/todos/native_update_plan.ts b/loopx/control_plane/todos/native_update_plan.ts index f0cb21a143..f04fc3d996 100644 --- a/loopx/control_plane/todos/native_update_plan.ts +++ b/loopx/control_plane/todos/native_update_plan.ts @@ -69,14 +69,18 @@ export function normalizeNativePlanningIntent(value: unknown): JsonObject { } export function planNativeTodoUpdate(todo: JsonObject, intent: JsonObject, - head: JsonObject, actor: string | null, agents: readonly string[], updatedAt: string): JsonObject { + head: JsonObject, actor: string | null, agents: readonly string[], updatedAt: string, + kind: "planning" | "user_completion" = "planning"): JsonObject { + if (kind === "user_completion" && todo.role !== "user") { + throw new AuthorityStoreProtocolError("agent todo completion must use complete_goal_todo (loopx todo complete)"); + } validateTodoDecisionMetadata(todo, intent); const planned = planPublicTodoUpdate({schema_version: TODO_PUBLIC_UPDATE_REQUEST_SCHEMA, todo, intent, updated_at: updatedAt, context: {goal_id: head.goal_id, role: todo.role, actor_agent_id: actor, registered_agents: [...agents], items: head.todos, monitor_observation: null, enforce_monitor_boundedness: true}}); - if (planned.target_status === "done" || planned.monitor_poll_transition != null) { + if ((planned.target_status === "done" && kind === "planning") || planned.monitor_poll_transition != null) { throw new AuthorityStoreProtocolError("native planning update cannot complete work or commit a Monitor observation"); } return requireJsonObject(planned.metadata_updates, "Todo planning metadata updates"); diff --git a/loopx/control_plane/todos/provider_terminal_lifecycle.py b/loopx/control_plane/todos/provider_terminal_lifecycle.py index c445f8f331..f5014a611a 100644 --- a/loopx/control_plane/todos/provider_terminal_lifecycle.py +++ b/loopx/control_plane/todos/provider_terminal_lifecycle.py @@ -30,7 +30,8 @@ from .completion_transaction import require_completion_successor_todo_ids from .completion_validation import ( resolve_private_completion_validation_declaration, - run_declared_completion_validation_effect, + execute_completion_validation_effects, + completion_validation_failure, ) from .contract import resolve_next_user_task_class from .mutation_authority import todo_lifecycle_facts @@ -190,30 +191,6 @@ def _todo_by_id( ) -def _terminal_failure_payload( - result: Mapping[str, Any], *, goal_id: str, todo_id: str, dry_run: bool -) -> dict[str, Any] | None: - if result.get("status") != "failed": - return None - if result.get("reason_code") not in { - "validation_declaration_invalid", - "validation_failed", - }: - return None - return { - "ok": False, - "dry_run": dry_run, - "completed": False, - "changed": False, - "goal_id": goal_id, - "todo_id": todo_id, - "validation_blocked_completion": True, - "reason": result.get("reason"), - "validation_failure": result.get("validation_failure"), - **dict(result), - } - - def _projection_payload(value: Any) -> dict[str, Any]: if not isinstance(value, Mapping): raise LocalCoordinationAuthorityUnavailable( @@ -416,38 +393,11 @@ def terminal_canonical_todo_if_promoted( "coordination.local_authority.todo_terminal", request ) if isinstance(result, Mapping) and result.get("status") == "execute_validation": - effect = result.get("validation_effect") - acceptance_effects = result.get("goal_acceptance_validation_effects") - if not isinstance(effect, Mapping) and not isinstance(acceptance_effects, list): - raise RuntimeError("Todo terminal validation effect shape mismatch") - if isinstance(effect, Mapping): - request["validation_receipt"] = run_declared_completion_validation_effect( - effect=effect, - registry_path=registry_path, - goal_id=goal_id, - delivery_workspace=completion_delivery_workspace, - validation_workspace_path=completion_validation_workspace_path, - ) - if acceptance_effects is not None: - from ..goals.acceptance import run_goal_acceptance_validation_effect - - if not isinstance(acceptance_effects, list) or not acceptance_effects: - raise RuntimeError("Goal acceptance validation effects are missing") - source_binding = result.get("goal_acceptance_source_binding") - if not isinstance(source_binding, Mapping): - raise RuntimeError("Goal acceptance validation omitted its source basis") - receipts = [] - for row in acceptance_effects: - if not isinstance(row, Mapping) or not isinstance(row.get("effect"), Mapping): - raise RuntimeError("Goal acceptance validation effect shape mismatch") - receipt = run_goal_acceptance_validation_effect( - effect=row["effect"], registry_path=registry_path, goal_id=goal_id, - delivery_workspace=completion_delivery_workspace, - validation_workspace_path=completion_validation_workspace_path, - ) - receipts.append({"criterion_id": row.get("criterion_id"), "receipt": receipt}) - request["goal_acceptance_source_binding"] = dict(source_binding) - request["goal_acceptance_validation_receipts"] = receipts + request.update(execute_completion_validation_effects( + result, registry_path=registry_path, goal_id=goal_id, + delivery_workspace=completion_delivery_workspace, + validation_workspace_path=completion_validation_workspace_path, + )) result = effect_runtime_result( "coordination.local_authority.todo_terminal", request ) @@ -457,7 +407,7 @@ def terminal_canonical_todo_if_promoted( code="local_authority_todo_terminal_invalid_result", payload={"source_authority": "file_v0"}, ) - validation_failure = _terminal_failure_payload( + validation_failure = completion_validation_failure( result, goal_id=goal_id, todo_id=todo_id, dry_run=dry_run ) if validation_failure is not None: diff --git a/loopx/control_plane/todos/provider_update.py b/loopx/control_plane/todos/provider_update.py index 0a012cfdbd..8d529d9ecd 100644 --- a/loopx/control_plane/todos/provider_update.py +++ b/loopx/control_plane/todos/provider_update.py @@ -15,6 +15,7 @@ LOCAL_AUTHORITY_SOURCES, LocalCoordinationAuthorityUnavailable, local_authority_is_promoted, + read_canonical_todos_if_promoted, ) from ..effect_runtime import effect_runtime_result from .contract import compact_todo_text @@ -22,6 +23,12 @@ from .text import normalize_new_todo from .mutation_authority import todo_lifecycle_facts from ..coordination.authority_source_capture import authority_registry_source +from .completion_validation import ( + completion_validation_failure, + execute_completion_validation_effects, + resolve_private_completion_validation_declaration, +) +from .path_resolution import resolve_todo_state_path def update_canonical_todo_if_promoted( @@ -52,8 +59,24 @@ def update_canonical_todo_if_promoted( normalized_note = compact_todo_text(note) if normalized_note: patch["note"] = normalized_note - result = effect_runtime_result("coordination.local_authority.todo_update", { - "schema_version": "loopx_local_coordination_todo_update_request_v2", + completion = None + if str((planning_intent or {}).get("status", "")).strip().lower() == "done": + project, state_file = resolve_todo_state_path(registry_path=registry_path, goal_id=goal_id, + project=project, state_file=state_file, require_existing=False) + canonical = read_canonical_todos_if_promoted(runtime_root=runtime_root, goal_id=goal_id) + if canonical is None: + raise ValueError("Canonical authority changed during Todo completion update; retry") + target = next((todo for todo in canonical["todos"] if todo.get("todo_id") == todo_id), {}) + declaration = None + if target.get("status") != "done" and target.get("completion_validation_required") is True: + declaration = resolve_private_completion_validation_declaration( + canonical_todo=target, state_file=state_file, runtime_root=runtime_root, + registry_path=registry_path, goal_id=goal_id, todo_id=todo_id, role=role, + persist_if_resolved=not dry_run) + completion = {"validation_declaration": declaration} + request = { + "schema_version": ("loopx_local_coordination_todo_update_request_v3" if completion is not None + else "loopx_local_coordination_todo_update_request_v2"), "runtime_root": str(runtime_root.resolve()), "goal_id": goal_id, "todo_id": todo_id, "role": role, "actor_agent_id": actor_agent_id, "registered_agents": registered, "lifecycle_grants": grants, @@ -67,7 +90,21 @@ def update_canonical_todo_if_promoted( "patch": patch, "clear_fields": [], "dry_run": dry_run, "planning_intent": planning_intent or {}, "observed_at": now_local(), - }) + **({"completion": completion} if completion is not None else {}), + } + result = effect_runtime_result("coordination.local_authority.todo_update", request) + if isinstance(result, dict) and result.get("status") == "execute_validation": + if completion is None: + raise RuntimeError("Ordinary Todo update cannot issue completion validation") + completion["source_provider_revision"] = result["provider_revision"] + completion.update(execute_completion_validation_effects( + result, registry_path=registry_path, goal_id=goal_id)) + request["observed_at"] = now_local() + result = effect_runtime_result("coordination.local_authority.todo_update", request) + if isinstance(result, dict): + failure = completion_validation_failure(result, goal_id=goal_id, todo_id=todo_id, dry_run=dry_run) + if failure is not None: + return failure # Keep the public lookup-error contract, without a second pre-transaction read. if isinstance(result, dict) and result.get("status") == "failed": if result.get("reason_code") == "todo_not_found": diff --git a/loopx/control_plane/todos/update_intent.py b/loopx/control_plane/todos/update_intent.py index 823cdf4521..5d05ffae0d 100644 --- a/loopx/control_plane/todos/update_intent.py +++ b/loopx/control_plane/todos/update_intent.py @@ -90,11 +90,11 @@ def canonical_update_is_supported( note: str | None, intent: dict[str, Any], monitor_metadata: Any, - status: str | None, ) -> bool: """Whether an ordinary update can use the canonical transaction. - Terminal completion and monitor polling retain their effect-owned paths. + User completion is routed to the typed terminal owner; Monitor observations + retain their dedicated effect-owned path. Ordinary metadata is validated by the typed transaction, including rejection of unsupported fields; this transport must not duplicate its field catalog. They must not silently fall back to Markdown after authority promotion. @@ -102,8 +102,6 @@ def canonical_update_is_supported( if isinstance(monitor_metadata, MonitorPollObservation): return False - if status is not None and status.strip().lower() == "done": - return False # Empty notes are the long-standing compatibility spelling for omission; # routing them to the canonical adapter would produce an empty patch and a # less useful protocol error. Text still uses the normal non-empty text diff --git a/loopx/todos.py b/loopx/todos.py index 0b897e904b..aa806f8eb8 100644 --- a/loopx/todos.py +++ b/loopx/todos.py @@ -1130,8 +1130,8 @@ def update_goal_todo( return canonical_claim # Translate the compatibility-sized CLI signature exactly once. The # canonical transaction now owns ordinary role/binding/work-declaration - # edits as well as text/note corrections; monitor observations and terminal - # completion remain effect-owned and therefore stay off this route. + # edits as well as text/note corrections. User completion is dispatched to + # the terminal owner; Monitor observations retain their dedicated route. planning_intent = build_canonical_update_intent( status=status, evidence=evidence, reason=reason, task_class=task_class, action_kind=action_kind, task_domain=task_domain, @@ -1155,7 +1155,6 @@ def update_goal_todo( if not claim_only and canonical_update_is_supported( text=text, note=note, intent=planning_intent, monitor_metadata=monitor_metadata, - status=status, ): canonical_edit = update_canonical_todo_if_promoted( registry_path=registry_path, runtime_root=shadow_runtime_root, From 726cd36cfa938f004cf1ab4bc9903d3d1e819cbf Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Fri, 18 Sep 2026 20:57:18 +0800 Subject: [PATCH 2/7] test(todos): exercise completion fences and reviewed recovery across providers Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- .../typed-actions.mjs | 30 +-- .../test_native_user_completion_update.py | 215 ++++++++++++++++++ .../control_plane/test_todo_update_intent.py | 16 +- .../action_review_plan.test.ts | 8 +- .../authority_store_conformance.ts | 2 + .../todo_completion_update_runtime.test.ts | 30 +++ .../user_completion_update_conformance.ts | 144 ++++++++++++ tsconfig.control-plane.json | 1 + 8 files changed, 418 insertions(+), 28 deletions(-) create mode 100644 tests/control_plane/test_native_user_completion_update.py create mode 100644 tests/control_plane_ts/todo_completion_update_runtime.test.ts create mode 100644 tests/control_plane_ts/user_completion_update_conformance.ts diff --git a/examples/personal-workspace-browser/typed-actions.mjs b/examples/personal-workspace-browser/typed-actions.mjs index 07b327a962..3c0fda99d0 100644 --- a/examples/personal-workspace-browser/typed-actions.mjs +++ b/examples/personal-workspace-browser/typed-actions.mjs @@ -103,11 +103,11 @@ export const typedActionsScenario = { const operationUi = await openWorkspacePage(browser, url, { apiOptions: { initialActionProposals: [ - { + ...["edit", "complete"].map(operation => ({ schema_version: "loopx_chat_action_proposal_v1", - proposal_id: "reviewed-edit-recovery", action_kind: "todo.update", - summary: "Recover a committed Todo edit", status: "failed", - normalized_parameters: {goal_id: "product-release", todo_id: "todo_reviewed", operation: "edit", text: "Reviewed correction"}, + proposal_id: `reviewed-${operation}-recovery`, action_kind: "todo.update", + summary: `Recover a committed Todo ${operation}`, status: "failed", + normalized_parameters: {goal_id: "product-release", todo_id: "todo_reviewed", operation, note: "Reviewed observation"}, context: {kind: "goal", goal_id: "product-release"}, expected_state_fingerprint: "reviewed-basis", permission_classification: "durable_write", validation_evidence: ["Canonical dry-run validated the edit."], available_transitions: ["apply", "cancel"], @@ -115,7 +115,7 @@ export const typedActionsScenario = { provider_revision: "reviewed-revision", registry_sha256: "a".repeat(64), source_authority: "sqlite_v0"}, failure: {error_code: "canonical_update_projection_pending"}, receipt: null, stale: null, created_at: "2026-09-14T01:00:00Z", updated_at: "2026-09-14T01:00:01Z", - }, + })), operationProposal({ id: "operation-awaiting-confirmation", title: "Simulated order awaiting group confirmation", @@ -149,15 +149,17 @@ export const typedActionsScenario = { // A loaded failure must remain discoverable and retry its original id, // rather than being hidden or regenerated into a second business edit. - await page.locator(".personal-proposal-row", {hasText: "Recover a committed Todo edit"}).click(); - const recovery = page.locator('.personal-context-drawer[data-context-kind="proposal"]'); - await recovery.getByText("编辑已提交,展示尚未同步。重试此操作以恢复当前视图。", {exact: true}).waitFor({state: "visible"}); - const previewsBeforeRecovery = operationUi.api.actionPreviews.length; - await recovery.getByRole("button", {name: "重试原操作", exact: true}).click(); - await recovery.getByText("已应用,LoopX 状态将刷新。", {exact: true}).waitFor({state: "visible"}); - if (!operationUi.api.actionApplies.includes("reviewed-edit-recovery")) throw new Error("Recovery lost the original command identity"); - if (operationUi.api.actionPreviews.length !== previewsBeforeRecovery) throw new Error("Recovery created a replacement proposal"); - await page.getByRole("button", { name: /关闭详情/ }).click(); + for (const operation of ["edit", "complete"]) { + await page.locator(".personal-proposal-row", {hasText: `Recover a committed Todo ${operation}`}).click(); + const recovery = page.locator('.personal-context-drawer[data-context-kind="proposal"]'); + await recovery.getByText("编辑已提交,展示尚未同步。重试此操作以恢复当前视图。", {exact: true}).waitFor({state: "visible"}); + const previewsBeforeRecovery = operationUi.api.actionPreviews.length; + await recovery.getByRole("button", {name: "重试原操作", exact: true}).click(); + await recovery.getByText("已应用,LoopX 状态将刷新。", {exact: true}).waitFor({state: "visible"}); + if (!operationUi.api.actionApplies.includes(`reviewed-${operation}-recovery`)) throw new Error("Recovery lost the original command identity"); + if (operationUi.api.actionPreviews.length !== previewsBeforeRecovery) throw new Error("Recovery created a replacement proposal"); + await page.getByRole("button", { name: /关闭详情/ }).click(); + } const pendingResult = page.locator(".personal-proposal-row", { hasText: "Simulation result awaiting card readback", diff --git a/tests/control_plane/test_native_user_completion_update.py b/tests/control_plane/test_native_user_completion_update.py new file mode 100644 index 0000000000..71ff238a15 --- /dev/null +++ b/tests/control_plane/test_native_user_completion_update.py @@ -0,0 +1,215 @@ +"""The public update-done caller over real canonical providers and validation.""" +from __future__ import annotations + +import json +import subprocess +import sys +from pathlib import Path + +import pytest +from canonical_authority_fixture import initialize_canonical_authority + +from loopx.control_plane.coordination.runtime_shadow import build_todo_runtime_shadow_projection +from loopx.todos import add_goal_todo, list_goal_todos + + +def fixture(tmp_path: Path, provider: str, *, validation: str | None = None) -> tuple[Path, Path, str]: + project = tmp_path / "project" + project.mkdir() + state = project / "ACTIVE_GOAL_STATE.md" + state.write_text("# Goal\n\n## User Todo\n\n## Agent Todo\n\n## Completed Work Archive\n", encoding="utf-8") + registry = tmp_path / "registry.json" + registry.write_text(json.dumps({"schema_version": 1, "common_runtime_root": str(tmp_path / "runtime"), + "goals": [{"id": "goal-a", "status": "active", "repo": str(project), "state_file": state.name, + "coordination": {"registered_agents": ["agent-a"]}}]}), encoding="utf-8") + added = add_goal_todo(registry_path=registry, goal_id="goal-a", role="user", + text="Record the observed outcome", task_class="user_action", validation_command=validation) + todos = list_goal_todos(registry_path=registry, goal_id="goal-a")["todos"] + projection = build_todo_runtime_shadow_projection(goal_id="goal-a", todos=todos, handoff_mode="soft_claim") + initialize_canonical_authority(tmp_path / "runtime", "goal-a", projection, state_path=state, provider=provider) + return registry, state, str(added["todo_id"]) + + +def update(registry: Path, todo_id: str, *args: str, ok: bool = True) -> dict: + process = subprocess.run([sys.executable, "-m", "loopx.cli", "--format", "json", "--registry", str(registry), + "todo", "update", "--goal-id", "goal-a", "--todo-id", todo_id, + "--agent-id", "agent-a", "--status", "done", *args], capture_output=True, text=True, timeout=45) + assert process.stdout, process.stderr + result = json.loads(process.stdout) + assert (process.returncode == 0) is ok, (result, process.stderr) + return result + + +@pytest.mark.parametrize("provider", ["file", "sqlite"]) +def test_public_user_update_done_uses_canonical_transaction(tmp_path: Path, provider: str) -> None: + registry, state, todo_id = fixture(tmp_path, provider) + state.unlink() + result = update(registry, todo_id, "--text", "Observed outcome", "--note", "Reviewed", "--no-follow-up") + assert result["ok"] is True + assert result["source_authority"] == f"{provider}_v0" + assert result["legacy_fallback_used"] is False + todo = list_goal_todos(registry_path=registry, goal_id="goal-a")["todos"][0] + assert (todo["status"], todo["text"], todo["note"]) == ("done", "Observed outcome", "Reviewed") + assert state.is_file() + + +def validation_command(source: str) -> str: + import shlex + return shlex.join([sys.executable, "-c", source]) + + +@pytest.mark.parametrize("provider", ["file", "sqlite"]) +def test_validation_failure_preview_and_replay(tmp_path: Path, provider: str) -> None: + marker = tmp_path / "calls" + gate = tmp_path / "allow" + command = validation_command(f"from pathlib import Path; p=Path({str(marker)!r}); " + f"p.write_text(p.read_text()+'x' if p.exists() else 'x'); raise SystemExit(0 if Path({str(gate)!r}).exists() else 1)") + registry, state, todo_id = fixture(tmp_path, provider, validation=command) + before = list_goal_todos(registry_path=registry, goal_id="goal-a")["todos"] + preview = update(registry, todo_id, "--dry-run", "--note", "Validated") + assert preview["status"] == "planned" + assert not marker.exists() + failed = update(registry, todo_id, "--note", "Validated", ok=False) + assert failed["validation_blocked_completion"] is True + assert marker.read_text() == "x" + assert list_goal_todos(registry_path=registry, goal_id="goal-a")["todos"] == before + gate.touch() + first = update(registry, todo_id, "--note", "Validated", "--update-operation-id", "complete-observation") + assert first["status"] == "applied" + assert marker.read_text() == "xx" + completed = list_goal_todos(registry_path=registry, goal_id="goal-a")["todos"][0] + state.unlink() + from loopx.control_plane.todos.completion_validation_store import completion_validation_declaration_path + completion_validation_declaration_path(runtime_root=tmp_path / "runtime", goal_id="goal-a", todo_id=todo_id).unlink() + replay = update(registry, todo_id, "--note", "Validated", "--update-operation-id", "complete-observation") + assert replay["status"] == "replayed" + assert marker.read_text() == "xx" + annotation = update(registry, todo_id, "--note", "Later acknowledgement") + assert annotation["status"] == "applied" + after = list_goal_todos(registry_path=registry, goal_id="goal-a")["todos"][0] + assert after["note"] == "Later acknowledgement" + assert after["completed_at"] == completed["completed_at"] + assert marker.read_text() == "xx" + + +@pytest.mark.parametrize("provider", ["file", "sqlite"]) +def test_revocation_during_real_validation_cannot_commit(tmp_path: Path, provider: str) -> None: + registry_path = tmp_path / "registry.json" + command = validation_command("import json; from pathlib import Path; " + f"p=Path({str(registry_path)!r}); r=json.loads(p.read_text()); " + "r['goals'][0]['coordination']['registered_agents']=[]; p.write_text(json.dumps(r))") + registry, _state, todo_id = fixture(tmp_path, provider, validation=command) + result = update(registry, todo_id, ok=False) + assert result["error_code"] == "authority_source_changed" + assert list_goal_todos(registry_path=registry, goal_id="goal-a")["todos"][0]["status"] == "open" + + +@pytest.mark.parametrize("provider", ["file", "sqlite"]) +def test_invalid_input_and_permission_do_not_run_validation(tmp_path: Path, provider: str) -> None: + marker = tmp_path / "called" + registry, _state, todo_id = fixture(tmp_path, provider, validation=validation_command( + f"from pathlib import Path; Path({str(marker)!r}).touch()")) + invalid = update(registry, todo_id, "--successor-todo-id", "todo_missing", ok=False) + assert invalid["error_code"] == "todo_successor_not_found" + unauthorized = update(registry, todo_id, "--agent-id", "not-registered", ok=False) + assert unauthorized["error_code"] == "actor_not_registered" + assert not marker.exists() + + +@pytest.mark.parametrize("provider", ["file", "sqlite"]) +@pytest.mark.parametrize("failure_boundary", ["display", "action_receipt"]) +def test_reviewed_chat_completion_recovers_projection(tmp_path: Path, provider: str, monkeypatch: pytest.MonkeyPatch, failure_boundary: str) -> None: + from loopx.chat_action_store import ChatActionStore + from loopx.chat_actions import ChatActionService + from loopx.control_plane.todos import provider_projection + + registry, state, todo_id = fixture(tmp_path, provider) + service = ChatActionService(store=ChatActionStore(tmp_path / "actions"), registry_path=registry) + proposal = service.preview({"action_kind": "todo.update", "summary": "Record an observed outcome", + "normalized_parameters": {"goal_id": "goal-a", "todo_id": todo_id, + "agent_id": "agent-a", "operation": "complete", "note": "Reviewed observation"}, + "context": {}, "idempotency_key": "user-completion"}) + with monkeypatch.context() as patch: + def failed_projection(**kwargs): + raise OSError("Synthetic projection interruption") + if failure_boundary == "display": + patch.setattr(provider_projection, "project_current_canonical_todos", failed_projection) + failed = service.apply(proposal["proposal_id"])["proposal"] + assert failed["status"] == "failed" + assert failed["receipt"] is None + else: + def lost_response(*args, **kwargs): + raise ConnectionError("Synthetic response loss after canonical commit") + patch.setattr(service.store, "apply", lost_response) + with pytest.raises(ConnectionError): + service.apply(proposal["proposal_id"]) + assert list_goal_todos(registry_path=registry, goal_id="goal-a")["todos"][0]["status"] == "done" + state.unlink() + recovered = service.apply(proposal["proposal_id"])["proposal"] + assert recovered["status"] == "applied" + assert recovered["receipt"]["outcome"] == "todo_completed" + assert state.exists() + + +@pytest.mark.parametrize("provider", ["file", "sqlite"]) +def test_chat_user_validation_failure_never_creates_success_receipt(tmp_path: Path, provider: str) -> None: + from loopx.chat_action_store import ChatActionStore + from loopx.chat_actions import ChatActionService + + registry, _state, todo_id = fixture(tmp_path, provider, validation=validation_command("raise SystemExit(1)")) + service = ChatActionService(store=ChatActionStore(tmp_path / "actions"), registry_path=registry) + proposal = service.preview({"action_kind": "todo.update", "summary": "Record a validation outcome", + "normalized_parameters": {"goal_id": "goal-a", "todo_id": todo_id, "agent_id": "agent-a", + "operation": "complete", "note": "Owner acknowledgement"}, "context": {}, "idempotency_key": "validated-close"}) + failed = service.apply(proposal["proposal_id"])["proposal"] + assert failed["status"] == "failed" + assert failed["receipt"] is None + assert failed["failure"]["error_code"] == "canonical_update_validation_failed" + assert list_goal_todos(registry_path=registry, goal_id="goal-a")["todos"][0]["status"] == "open" + + +@pytest.mark.parametrize("provider", ["file", "sqlite"]) +@pytest.mark.parametrize("passed", [True, False]) +def test_packaged_chat_http_user_completion(tmp_path: Path, provider: str, passed: bool) -> None: + from http.client import HTTPConnection + from threading import Thread + from loopx.chat_action_store import ChatActionStore + from loopx.chat_actions import ChatActionService + from loopx.chat_server import ChatHTTPServer, ChatRequestHandler, default_chat_assets_dir + + registry, _state, todo_id = fixture(tmp_path, provider, + validation=validation_command(f"raise SystemExit({0 if passed else 1})")) + store = ChatActionStore(tmp_path / "actions") + server = ChatHTTPServer(("127.0.0.1", 0), ChatRequestHandler) + server.verbose = False + server.assets_dir = default_chat_assets_dir() + server.action_store = store + server.action_service = ChatActionService(store=store, registry_path=registry) + thread = Thread(target=server.serve_forever, daemon=True) + thread.start() + connection = HTTPConnection("127.0.0.1", server.server_address[1], timeout=45) + try: + connection.request("GET", "/chat") + response = connection.getresponse() + assert response.status == 200 + assert b" None: note=None, intent=supported, monitor_metadata=None, - status=None, ) # Declarative scope metadata now crosses the same typed planning @@ -46,32 +45,25 @@ def test_update_route_promotes_declarative_decision_metadata() -> None: note=None, intent=governance, monitor_metadata=None, - status=None, ) -def test_terminal_and_monitor_observations_stay_off_canonical_route() -> None: +def test_completion_intent_routes_to_canonical_but_monitor_observations_do_not() -> None: intent = build_canonical_update_intent(reason="ordinary") assert not canonical_update_is_supported( text=None, note=None, intent=intent, monitor_metadata=MonitorPollObservation(generated_at="2030-01-01T00:00:00Z", result_hash="observed", material_change=True), - status=None, ) - assert not canonical_update_is_supported( - text=None, - note=None, - intent=intent, - monitor_metadata=None, - status="done", + assert canonical_update_is_supported( + text=None, note=None, intent=build_canonical_update_intent(status="done"), monitor_metadata=None, ) assert not canonical_update_is_supported( text=None, note=" ", intent={}, monitor_metadata=None, - status=None, ) @@ -79,4 +71,4 @@ def test_configuration_field_admission_belongs_to_the_typed_transaction() -> Non # Even malformed/unknown fields must reach the rejecting TS decoder; # they cannot divert a promoted request into a Markdown business writer. assert canonical_update_is_supported(text=None, note=None, intent={}, - monitor_metadata={"material_change_generation": 99}, status=None) + monitor_metadata={"material_change_generation": 99}) diff --git a/tests/control_plane_ts/action_review_plan.test.ts b/tests/control_plane_ts/action_review_plan.test.ts index 690bc2c7d8..604532ab20 100644 --- a/tests/control_plane_ts/action_review_plan.test.ts +++ b/tests/control_plane_ts/action_review_plan.test.ts @@ -8,7 +8,7 @@ import { isStaleActionFailure, } from "../../loopx/control_plane/presentation/action_review_plan.ts"; -test("canonical edit recovery is visible without changing generic action authority", () => { +test("canonical update recovery includes User completion without changing generic action authority", () => { const proposal = {proposal_id: "reviewed", expected_state_fingerprint: "review-basis", action_kind: "todo.update", status: "failed", normalized_parameters: {operation: "edit"}, canonical_update_basis: {schema_version: "loopx_chat_canonical_update_basis_v0", @@ -19,8 +19,12 @@ test("canonical edit recovery is visible without changing generic action authori assert.equal(plan.canApply, true); assert.equal(plan.reason, "canonical_update_projection_pending"); assert.equal(compileActionReviewPlan({...proposal, status: "applying"}).retryOriginal, true); + const completedUpdate = compileActionReviewPlan({...proposal, normalized_parameters: {operation: "complete"}}); + assert.equal(completedUpdate.retryOriginal, true); + assert.equal(completedUpdate.canApply, true); + assert.equal(completedUpdate.interaction, "review"); for (const change of [{canonical_update_basis: undefined}, {action_kind: "operation.execute"}, - {normalized_parameters: {operation: "complete"}}, {status: "stale"}, {status: "gated"}, + {normalized_parameters: {operation: "complete"}, canonical_update_basis: undefined}, {status: "stale"}, {status: "gated"}, {status: "applied", receipt: {projection_verified: true}}]) { assert.equal(compileActionReviewPlan({...proposal, ...change}).retryOriginal, undefined); } diff --git a/tests/control_plane_ts/authority_store_conformance.ts b/tests/control_plane_ts/authority_store_conformance.ts index 56fe25d8d2..cae48387d1 100644 --- a/tests/control_plane_ts/authority_store_conformance.ts +++ b/tests/control_plane_ts/authority_store_conformance.ts @@ -1,3 +1,4 @@ +import {registerUserCompletionUpdateConformance} from "./user_completion_update_conformance.ts"; import {registerLeaseAcquisitionConformance} from "./lease_acquisition_conformance.ts"; import {registerClaimTransferConformance} from "./claim_transfer_conformance.ts"; import {registerLeasedMonitorConformance} from "./monitor_poll_lease_conformance.ts"; @@ -220,6 +221,7 @@ export function registerAuthorityStoreConformance( registerAuthorityScanConformance(providerName, factory); registerOwnershipObservationConformance(providerName, factory); registerNativePlanningUpdateConformance(providerName, factory); + registerUserCompletionUpdateConformance(providerName, factory); registerMonitorConfigurationConformance(providerName, factory); registerLeasedMonitorConformance(providerName, factory); registerCoordinationReceiptConformance(providerName, factory); diff --git a/tests/control_plane_ts/todo_completion_update_runtime.test.ts b/tests/control_plane_ts/todo_completion_update_runtime.test.ts new file mode 100644 index 0000000000..fc8275d6fb --- /dev/null +++ b/tests/control_plane_ts/todo_completion_update_runtime.test.ts @@ -0,0 +1,30 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import {updateLocalCoordinationTodo} from "../../loopx/control_plane/coordination/local_authority_runtime.ts"; +import {executeCoordinationTodoUpdate} from "../../loopx/control_plane/coordination/todo_update.ts"; +import type {AuthorityStore} from "../../loopx/control_plane/coordination/authority_store.ts"; + +for (const version of [0, 1, 2]) { + test(`update v${version} cannot silently ignore completion payload`, async () => { + let opened = false; + const result = await updateLocalCoordinationTodo({schema_version: `loopx_local_coordination_todo_update_request_v${version}`, + completion: {}}, {createStore: () => {opened = true; throw new Error("must not open provider");}}); + assert.equal(result.status, "failed"); + assert.match(String(result.reason), /completion payload requires request v3/); + assert.equal(opened, false); + }); +} +test("completion v3 requires an explicit effect envelope", async () => { + const result = await updateLocalCoordinationTodo({schema_version: "loopx_local_coordination_todo_update_request_v3"}); + assert.equal(result.status, "failed"); + assert.match(String(result.reason), /requires its completion payload/); +}); +test("malformed completion facts fail before any provider read", async () => { + const store = new Proxy({} as AuthorityStore, {get: () => {throw new Error("invalid intent reached provider");}}); + for (const completion of [{validation_receipt: []}, {unknown_field: true}, {source_provider_revision: 1}]) { + const result = await executeCoordinationTodoUpdate(store, {goal_id: "g", todo_id: "todo_a", expected_role: "user", + actor_agent_id: "agent-a", registered_agents: ["agent-a"], operation_id: "op", patch: {}, clear_fields: [], + planning_intent: {status: "done"}, completion, dry_run: false, now: new Date()}); + assert.equal(result.reason_code, "invalid_coordination_todo_update"); + } +}); diff --git a/tests/control_plane_ts/user_completion_update_conformance.ts b/tests/control_plane_ts/user_completion_update_conformance.ts new file mode 100644 index 0000000000..0c15d69fae --- /dev/null +++ b/tests/control_plane_ts/user_completion_update_conformance.ts @@ -0,0 +1,144 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import type {AuthorityStore} from "../../loopx/control_plane/coordination/authority_store.ts"; +import type {JsonObject} from "../../loopx/control_plane/effect_program.ts"; +import {executeCoordinationTodoUpdate, type CoordinationTodoUpdateInput} from "../../loopx/control_plane/coordination/todo_update.ts"; +import {canonicalAuthoritySha256} from "../../loopx/control_plane/coordination/authority_store_codec.ts"; +import {prepareCoordinationProjectionCommit} from "../../loopx/control_plane/coordination/coordination_projection.ts"; +import type {AuthorityStoreConformanceFactory} from "./authority_store_conformance.ts"; +import {authorityProjectionFixture} from "./authority_projection_fixture.ts"; +import {productionScaleCoordinationFixture, PRODUCTION_SCALE_VALIDATION_DECLARATION as declaration} from "./production_scale_coordination_fixture.ts"; + +async function loaded(store: AuthorityStore) { + const result = await store.loadAuthority(); + assert.equal(result.status, "loaded"); + if (result.status !== "loaded") throw new Error("fixture authority missing"); + return result; +} +const receipt = {schema_version: "issue_fix_validation_command_v0", command_label: declaration.validation_label, + passed: true, exit_code: 0, status: "passed", summary: "Synthetic validation passed", + stdout_captured: false, stderr_captured: false, local_path_captured: false}; + +export function registerUserCompletionUpdateConformance(provider: string, factory: AuthorityStoreConformanceFactory): void { + for (const schema of ["legacy", "native"] as const) { + test(`${provider}: User completion update validates, fences and recovers a complete ${schema} graph`, async t => { + const {store, contender} = await factory(t); + const goal = "user-completion"; + const fixture = productionScaleCoordinationFixture(goal, schema); + const todos = structuredClone(fixture.projection.todos) as JsonObject[]; + const target = todos.find(todo => todo.role === "user" && todo.status === "open" && !todo.decision_scope)!; + assert.ok(target); + Object.assign(target, {task_class: "user_gate", bound_agent: "agent-a", blocks_agent: "agent-a", + claimed_by: "agent-a", completion_validation_required: true, + completion_validation_sha256: canonicalAuthoritySha256(declaration)}); + const leases = structuredClone(fixture.projection.leases) as JsonObject[]; + const lease = {...leases.find(row => row.todo_id === fixture.completion_todo_id)!, + todo_id: target.todo_id, write_scopes: [], idempotency_key: "user-execution", version: 3, lease_epoch: 7}; + leases.push(lease); + const projection = authorityProjectionFixture(goal, todos, leases, schema, {handoff_mode: "hard_lease"}); + assert.equal((await store.commitAuthority({operation_id: "seed", expected_provider_revision: null, + next_projection: projection, events: [], receipts: []})).status, "applied"); + const before = await loaded(store); + const request: CoordinationTodoUpdateInput = {goal_id: goal, todo_id: String(target.todo_id), expected_role: "user", + actor_agent_id: "agent-a", registered_agents: fixture.registered_agents, lifecycle_grants: [], + operation_id: "user-update", patch: {text: "Validated owner observation", note: "Initial acknowledgement"}, + clear_fields: [], planning_intent: {status: "done", no_followup: true, reason: ""}, + lease_idempotency_key: "user-execution", lease_expected_version: 3, + completion: {validation_declaration: declaration}, dry_run: false, now: new Date("2026-09-18T06:00:00Z")}; + for (const [label, changes, code] of [ + ["wrong-actor", {actor_agent_id: "agent-b"}, "bound_agent_mismatch"], + ["stale-lease", {lease_expected_version: 2}, "version_mismatch"], + ["binding-launder", {planning_intent: {...request.planning_intent, bound_agent: "agent-b"}}, "update_lease_ownership_transition_unsupported"], + ["wrong-class", {planning_intent: {...request.planning_intent, task_class: "advancement_task"}}, "invalid_coordination_todo_update"], + ["agent-close", {todo_id: fixture.completion_todo_id, expected_role: "agent"}, "invalid_coordination_todo_update"], + ["missing-successor", {planning_intent: {...request.planning_intent, no_followup: false, successor_todo_ids: ["todo_missing"]}}, "todo_successor_not_found"], + ] as const) { + const result = await executeCoordinationTodoUpdate(store, {...request, ...changes, operation_id: label}); + // Successor topology must be rejected before effects too. + assert.equal(result.reason_code, code, JSON.stringify(result)); + assert.deepEqual(await loaded(store), before); + assert.equal((await store.readReceipt(label)).status, "missing"); + } + assert.equal((await executeCoordinationTodoUpdate(store, {...request, dry_run: true})).status, "planned"); + assert.deepEqual(await loaded(store), before); + let sourceChecks = 0; + assert.equal((await executeCoordinationTodoUpdate(store, request, async () => ++sourceChecks === 1)).reason_code, + "authority_source_changed"); + const effect = await executeCoordinationTodoUpdate(store, request); + assert.equal(effect.status, "execute_validation", JSON.stringify(effect)); + assert.deepEqual(await loaded(store), before); + const resume = {...request, completion: {...request.completion, + validation_receipt: receipt, source_provider_revision: effect.provider_revision}}; + assert.equal((await executeCoordinationTodoUpdate(store, {...resume, + completion: {...request.completion, validation_receipt: receipt}})).reason_code, "completion_validation_source_required"); + assert.equal((await executeCoordinationTodoUpdate(store, {...resume, + completion: {...resume.completion, validation_receipt: {...receipt, passed: false, exit_code: 1}}})).reason_code, "validation_failed"); + assert.equal((await executeCoordinationTodoUpdate(store, {...resume, now: new Date("2028-01-01T00:00:00Z")})).reason_code, + "handoff_mode_requires_lease"); + assert.deepEqual(await loaded(store), before); + // Another real provider instance changes an unrelated record while the host validates. + const other = todos.find(todo => todo.todo_id !== target.todo_id)!; + assert.equal((await contender.commitAuthority(prepareCoordinationProjectionCommit({goal_id: goal, + operation_id: "concurrent-edit", expected_provider_revision: before.provider_revision, + projection: before.head, mutations: [{kind: "todo_upsert", todo: {...other, note: "Concurrent observation"}}]}))).status, "applied"); + const advanced = await loaded(store); + assert.equal((await executeCoordinationTodoUpdate(store, resume)).reason_code, "provider_revision_mismatch"); + assert.deepEqual(await loaded(store), advanced); + const freshEffect = await executeCoordinationTodoUpdate(store, request); + const freshResume = {...resume, completion: {...resume.completion, source_provider_revision: freshEffect.provider_revision}}; + const applied = await executeCoordinationTodoUpdate(store, freshResume); + assert.equal(applied.status, "applied", JSON.stringify(applied)); + const after = await loaded(store); + const completed = (after.head.todos as JsonObject[]).find(todo => todo.todo_id === target.todo_id)!; + assert.equal(completed.status, "done"); + assert.equal(completed.text, request.patch.text); + const retired = (after.head.leases as JsonObject[]).find(row => row.todo_id === target.todo_id)!; + assert.deepEqual(retired, {...lease, status: "released", updated_at: "2026-09-18T06:00:00Z"}); + assert.equal(retired.status, "released"); + assert.equal(retired.version, 3); + assert.equal(retired.lease_epoch, 7); + assert.deepEqual((after.head.todos as JsonObject[]).filter(todo => todo.todo_id !== target.todo_id), + (advanced.head.todos as JsonObject[]).filter(todo => todo.todo_id !== target.todo_id)); + const original = await store.readReceipt(request.operation_id); + assert.equal((await executeCoordinationTodoUpdate(contender, freshResume, + async () => {throw new Error("history must precede current admission");})).status, "replayed"); + assert.deepEqual(await loaded(store), after); + assert.deepEqual(await store.readReceipt(request.operation_id), original); + assert.equal((await executeCoordinationTodoUpdate(store, {...freshResume, patch: {note: "Different intent"}})).reason_code, + "coordination_operation_identity_mismatch"); + const annotation = await executeCoordinationTodoUpdate(store, {...request, operation_id: "annotation", + patch: {note: "Later acknowledgement"}, lease_idempotency_key: null, lease_expected_version: null}); + assert.equal(annotation.status, "applied", JSON.stringify(annotation)); + const annotated = await loaded(store); + const annotatedTodo = (annotated.head.todos as JsonObject[]).find(todo => todo.todo_id === target.todo_id)!; + assert.equal(annotatedTodo.note, "Later acknowledgement"); + assert.equal(annotatedTodo.completed_at, completed.completed_at); + assert.deepEqual(annotated.head.leases, after.head.leases); + }); + } + test(`${provider}: User completion cannot turn update-only delegation into terminal authority`, async t => { + const {store} = await factory(t); + const projection = authorityProjectionFixture("delegated-completion", [{todo_id: "todo_user", role: "user", + task_class: "user_action", status: "open", done: false, archive_state: "active", text: "Record an outcome", + claimed_by: "agent-b"}], [], "native", {handoff_mode: "soft_claim"}); + await store.commitAuthority({operation_id: "seed", expected_provider_revision: null, next_projection: projection, events: [], receipts: []}); + const before = await loaded(store); + const request: CoordinationTodoUpdateInput = {goal_id: "delegated-completion", todo_id: "todo_user", expected_role: "user", + actor_agent_id: "agent-a", registered_agents: ["agent-a", "agent-b"], + lifecycle_grants: [{agent_id: "agent-a", actions: ["update"], requires_reason: true}], + authority_reason: "Reviewed correction", operation_id: "delegated", patch: {note: "Acknowledged"}, clear_fields: [], + planning_intent: {status: "done", clear_claim: true, no_followup: true}, completion: {}, dry_run: false, now: new Date("2026-09-18T06:00:00Z")}; + const denied = await executeCoordinationTodoUpdate(store, request); + assert.equal(denied.reason_code, "delegation_action_not_granted"); + assert.deepEqual(await loaded(store), before); + assert.equal((await store.readReceipt(request.operation_id)).status, "missing"); + const accepted = await executeCoordinationTodoUpdate(store, {...request, + lifecycle_grants: [{agent_id: "agent-a", actions: ["update", "complete"], requires_reason: true}]}); + assert.equal(accepted.status, "applied", JSON.stringify(accepted)); + const after = await loaded(store); + const todo = (after.head.todos as JsonObject[])[0]; + assert.equal(todo.status, "done"); + assert.equal(Object.hasOwn(todo, "claimed_by"), false); + }); + +} diff --git a/tsconfig.control-plane.json b/tsconfig.control-plane.json index bcf19da66a..12c246341e 100644 --- a/tsconfig.control-plane.json +++ b/tsconfig.control-plane.json @@ -96,6 +96,7 @@ "tests/control_plane_ts/coordination_projection.test.ts", "tests/control_plane_ts/coordination_state_contract.test.ts", "tests/control_plane_ts/local_authority_runtime.test.ts", + "tests/control_plane_ts/todo_completion_update_runtime.test.ts", "tests/control_plane_ts/local_archive_attempt.test.ts", "tests/control_plane_ts/local_authority_shadow_outbox.test.ts", "tests/control_plane_ts/authority_store_conformance.ts", From c46a394b7d8c74dd9a49a53fce4492c548136d98 Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Fri, 18 Sep 2026 20:58:27 +0800 Subject: [PATCH 3/7] docs(authority): record User completion caller closure and recovery Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- .../2026-09-18-user-completion-updates.md | 16 +++ ...026-09-18-user-completion-updates.zh-CN.md | 16 +++ ...shared-goal-authority-state-provider-v0.md | 4 +- ...-goal-authority-state-provider-v0.zh-CN.md | 4 +- .../typescript-control-plane-migration-v0.md | 12 +++ ...script-control-plane-migration-v0.zh-CN.md | 11 ++ .../canonical-todo-completion-update.md | 95 ++++++++++++++++++ .../canonical-user-completion/after.png | Bin 0 -> 35209 bytes .../canonical-user-completion/before.png | Bin 0 -> 100139 bytes 9 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-09-18-user-completion-updates.md create mode 100644 docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-09-18-user-completion-updates.zh-CN.md create mode 100644 docs/reference/canonical-todo-completion-update.md create mode 100644 docs/reference/images/canonical-user-completion/after.png create mode 100644 docs/reference/images/canonical-user-completion/before.png diff --git a/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-09-18-user-completion-updates.md b/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-09-18-user-completion-updates.md new file mode 100644 index 0000000000..0b52b33f7c --- /dev/null +++ b/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-09-18-user-completion-updates.md @@ -0,0 +1,16 @@ +# User completion updates join canonical transactions + +| Field | Evidence and boundary | +| --- | --- | +| Goal/source | #4574 R5; TS T1/T2; shared-authority local-default L2. A new local default must support actual callers before D2/D3 qualification or writer retirement. | +| Demonstrated gap | On fixed main `0d90d6f66`, public User `todo update --status done` executes a declared command and then fails the legacy writer fence on both File and SQLite. The canonical `complete` owner already exists; rebuilding its decisions in Python would duplicate authority. | +| Delivered operation | The existing update facade routes User completion to the TS terminal owner, sharing edit decoding/materialization and preserving combined metadata, original and candidate authority, completion policy, exact lease release, CAS, business receipt and projection intent. Agent update-done stays rejected. | +| Semantic corrections | Linked-successor existence/self-cycle admission precedes terminal validation effects. User validation resume binds the issued provider revision, retains the registry witness and refreshes time; expired explicit proof cannot reacquire. Update-only delegation cannot close another owner's Todo by clearing ownership. New annotations preserve completion time and do not rerun validation or require a retired private declaration. | +| Caller closure | The existing Chat User-completion action uses reviewed canonical basis and operation identity. Validation failure produces no success receipt; projection interruption and lost action response recover the original operation. The shared review plan and packaged frontend retain its retry button. CLI/API names and provider selectors do not change. | +| Reuse/retirement | Extract the actual edit decoder/materializer from ordinary update, reuse terminal admission/CAS/outbox and the existing public authoring rules. Share Python validation-effect execution and failure projection, deleting the terminal transport's duplicate blocks. Python adapters, private command execution and permanent Markdown rendering still have callers; no unused native-CLI framework is added. | +| Validation | Fixed-baseline real CLI counterexample; complete legacy/native synthetic graph across File, SQLite, NoKV and isolated PostgreSQL; fresh/expired/unauthorized/malformed/no-write cases, changed revision, immutable replay and delegation counterexamples. Source CLI/Chat, installed wheel/HTTP and packaged browser recovery exercise user entry points. A read-only frozen full-graph rehearsal preserves all pre-existing Todos/leases and compares complete heads across providers and baseline ordinary edits. | +| Remaining boundary | This closes one L2 operation, not every event/Monitor caller or executor-held external-effect fence. Existing D1 consumer work, SQLite D2 capacity/soak and D3 integrated cutover retain their owners. The already merged #4315 repair is reconciled rather than counted as new implementation. New-Goal defaults and existing-Goal cohort migration remain separate changes; native TS distribution is not a prerequisite. | +| Compatibility/rollback | Ordinary v0–v2 update requests and existing terminal receipt identity remain unchanged; they reject the new v3 completion envelope. Finish pending new-operation recovery before downgrading. Preserve historical receipts and projection/import/export responsibilities; never restore stale Markdown authority. | + +The [operation reference](../../../../reference/canonical-todo-completion-update.md) +records the public command, typed ownership and bounded retirement contract. diff --git a/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-09-18-user-completion-updates.zh-CN.md b/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-09-18-user-completion-updates.zh-CN.md new file mode 100644 index 0000000000..2412b41ba7 --- /dev/null +++ b/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-09-18-user-completion-updates.zh-CN.md @@ -0,0 +1,16 @@ +# 用户完成更新进入 canonical 事务 + +| 字段 | 证据与边界 | +| --- | --- | +| 目标/来源 | #4574 R5、TS T1/T2、shared-authority local-default L2。新的本地默认必须先覆盖实际 caller,再做 D2/D3 资格化和旧 writer 退出。 | +| 已复现缺口 | 固定 main `0d90d6f66` 上,用户 `todo update --status done` 在 File/SQLite 都先执行声明的验证命令,再因旧 writer fence 被拒绝。已有 canonical complete owner;在 Python 重建其决策会复制 authority。 | +| 交付操作 | 既有 update facade 将用户完成交给 TS terminal owner,共用编辑解码/物化,保留合并字段编辑、原始和候选权限、完成策略、精确租约释放、CAS、业务回执及投影意图。Agent update-done 仍拒绝。 | +| 语义修复 | terminal 的关联 successor 存在性/自环检查提前到验证效果之前。用户验证续提绑定签发时 provider revision,沿用 registry witness 并刷新时钟;过期显式证明不能重新获取租约。仅有 update 委托不能通过清除 owner 关闭他人的 Todo。完成后新备注保留完成时间,不重跑验证,也不依赖已退休的私有声明。 | +| 调用闭合 | 既有 Chat 用户完成动作使用审阅时 canonical basis 和操作身份。验证失败不产生成功回执;显示投影中断和 action 响应丢失均恢复原操作。共享 review plan 与打包前端保留重试按钮。CLI/API 名称及 provider 选择器不变。 | +| 复用/退出 | 从普通 update 提取实际编辑 decoder/materializer,复用 terminal 准入/CAS/outbox 和公开 authoring 规则;共用 Python 验证效果执行与失败投影,删除 terminal 传输层中的重复代码块。Python adapter、私有命令执行和永久 Markdown 渲染仍有 caller,不新增未使用的原生 CLI 框架。 | +| 验证 | 固定基线真实 CLI 反例;File、SQLite、NoKV、隔离 PostgreSQL 上完整 legacy/native 合成图;新鲜/过期/越权/畸形/不写入、revision 改变、不可变回放和委托反例。源码 CLI/Chat、安装后的 wheel/HTTP、打包浏览器恢复覆盖用户入口。只读冻结全图保留全部既有 Todo/lease,并比较 provider 完整 head 及基线普通编辑。 | +| 剩余边界 | 闭合一个 L2 操作,不代表全部 event/Monitor caller 或 executor-held 外部效果 fence 完成。D1 消费者、SQLite D2 容量/soak、D3 集成切换仍由原有 owner 推进;核对已合入 #4315 修复,不重复计算实现。新 Goal 默认与已有 Goal 分组迁移是独立变化,原生 TS 分发不是前置条件。 | +| 兼容/回滚 | 普通 v0–v2 update 请求及既有 terminal receipt 身份保持;旧 wire 拒绝 v3 完成 envelope。降级前处理新操作的待恢复投影,保留历史回执与投影/导入导出职责,不恢复陈旧 Markdown authority。 | + +[操作参考](../../../../reference/canonical-todo-completion-update.md)记录公开命令、 +类型化所有权及有界退出合同。 diff --git a/docs/architecture/rfcs/shared-goal-authority-state-provider-v0.md b/docs/architecture/rfcs/shared-goal-authority-state-provider-v0.md index 50b0c223d1..de7e65bd5f 100644 --- a/docs/architecture/rfcs/shared-goal-authority-state-provider-v0.md +++ b/docs/architecture/rfcs/shared-goal-authority-state-provider-v0.md @@ -3071,12 +3071,12 @@ or moving a helper is not by itself a package exit. | Wave / package | Reviewable delivery and TS ownership payoff | Dependencies and exit evidence | | --- | --- | --- | | A / L1: Monitor configuration (this slice) | Existing `todo update` config enters the TS planner/CAS/receipt; delete Python's duplicate intent field catalog. Separate authoring from observed hashes, times and generations. | Ordinary CLI/API, clear/omission, active lease proof, no-op/replay, failed display delivery, complete fixture and real providers. This does not complete delegated Chat or leased polling. | -| A / L2: Complete public mutation admission | Inventory actual CLI/Turn/Chat callers; close remaining effect-owned user decisions, delegated owner actions and Monitor lifecycle transitions with validated actor/grant facts. | Build on merged T1 owners, not a generic raw patch. Prove permission rejection and exact caller response; remove replaced Python admission and name every remaining unsupported command. | +| A / L2: Complete public mutation admission | User completion updates now share the TS edit/terminal transaction and reviewed Chat recovery. Continue the actual CLI/Turn/Chat inventory for remaining effect-owned decisions, delegated owner actions and Monitor lifecycle transitions; [caller contract](../../reference/canonical-todo-completion-update.md). | Build on merged T1 owners, not a generic raw patch. Prove permission rejection and exact caller response; remove replaced Python admission and name every remaining unsupported command. | | A / L3: Canonical lease lifecycle | Standalone acquire/takeover, atomic claim lease admission and maintenance reuse TS facts/decision/materialization and one provider opening fence. Explicit claimed-work transfer now commits source-authorized Todo ownership and the new lease generation together; canonical request types exclude legacy held-fence fields. Acquire success verifies current execution proof; canonical completion can recover missing display. | Full-head scope conflict, archived/ineffective holders, exact create-CAS retry, stale execution, process loss and real CLI/four-arm rehearsal are covered. [Operation and remaining callers](../../reference/canonical-lease-renew.md). Executor-held external-effect fences remain explicit work; D1–D3/default holds remain. | | B / L4: Leased Monitor poll and settlement | Current execution proof now binds CLI intent, observation/generation/independent-successor CAS and historical business receipt. Quota pending admission is frozen before the business write; recovery preserves that decision after lease retirement. | Existing L3 lease lifecycle, real File/SQLite/PostgreSQL, mixed fixtures, process death between business/quota commits, competing renewal and unchanged polling. [Operation and snapshot rehearsal](../../reference/protocols/quota-monitor-observation-receipt-v0.md). No lease lifecycle effects or quota spend; separate authorities stay separate. Event callers, wider L2 admission and D1–D3/default remain open. | | B / L5: Consumer and display closure | Reconcile #4316, audit Turn/quota/Dashboard/Chat source reads, and finish D1 freshness/recovery through the existing projection outbox. | CLI, Lark/Chat and packaged frontend read back their affected interactions; absent/stale display, empty canonical state, pending projection and data beyond UI limits. Delete post-promotion legacy fallbacks with each consumer. | | A–C / L6: Local durability qualification | Continue contributor-owned #4224/#4328 on the selected SQLite profile; reuse File/NoKV references and complete 7.2's ledger. | Capacity, real process/crash/restore/upgrade, retained receipts/scans, consumer lag, supported runtimes/OS and the separately authorized >=10-day synthetic soak. Missing measurements remain holds. | -| A–C / L7: Capture continuity | Resolve #4315 with source-correlated archive retirement and identical lease membership at bootstrap and later writers; activate its row/mutant and complete the mixed-writer/event-source matrix. | Real CLI/File capture, history retained, partial drain unqualified, crash/replay and a new lease after archive/rebootstrap. Keep the legacy migration window provable; T4 cannot be used to skip this row. | +| A–C / L7: Capture continuity | Reconcile the merged #4315 archive/lease-membership repair; qualify its ladder row/mutant and sustained mixed-writer/event-source matrix rather than reimplementing the closed defect. | Real CLI/File capture, history retained, partial drain unqualified, crash/replay and a new lease after archive/rebootstrap. Keep the legacy migration window provable; T4 cannot be used to skip this row. | | C / L8: Whole-Goal rehearsal and cohort migration | Integrate one exact revision/profile after L2–L7; drain capture, fence old writers, verify canonical readback and projection, then rehearse fenced export/rollback. | D3 evidence packet binds lineage, cursor, source digest, command coverage and profile. Existing Goal migration requires explicit cohort approval; no per-command split authority or stale Markdown revival. | | D / L9: New-Goal default and bounded retirement | A dedicated default-change PR makes new-Goal creation/onboarding choose the qualified local profile, including settings/readback, installer and packaged clients. Retire old business writers only as their final callers and migration window close. | L8's integrated product/rollback qualification; distinguish new Goal default from existing Goal migration. Publish compatibility/disable guidance, keep explicit provider choice, permanent rendering and validated import/export. T4 can continue after the default ships. | diff --git a/docs/architecture/rfcs/shared-goal-authority-state-provider-v0.zh-CN.md b/docs/architecture/rfcs/shared-goal-authority-state-provider-v0.zh-CN.md index 17a1330ce7..33c3aa55b6 100644 --- a/docs/architecture/rfcs/shared-goal-authority-state-provider-v0.zh-CN.md +++ b/docs/architecture/rfcs/shared-goal-authority-state-provider-v0.zh-CN.md @@ -2434,12 +2434,12 @@ canonical renew 候选,#4328 是 SQLite D2 首批测量/恢复候选;它 | 波次/PR 包 | 完整交付内容与 TS 归属收益 | 依赖与退出证据 | | --- | --- | --- | | A/L1:Monitor 配置(本切片) | 现有 `todo update` 配置进入 TS planner/CAS/receipt,删除 Python 重复 intent 字段表;区分配置与观察 hash、时间、代数。 | 普通 CLI/API、清除/省略、active lease proof、no-op/replay、展示失败恢复、完整 fixture 和真实 provider。不宣称完成委托 Chat 或 leased polling。 | -| A/L2:公共 mutation admission 闭合 | 盘点 CLI/Turn/Chat 实际 caller;以可信 actor/grant 事实闭合剩余 effect-owned 用户决策、委托 owner 动作和 Monitor lifecycle。 | 复用已合并 T1 owner,不开通通用 raw patch;验证权限拒绝和 caller 响应,删除替代的 Python admission,列全未支持命令。 | +| A/L2:公共 mutation admission 闭合 | 用户 completion update 已共用 TS 编辑/terminal 事务与 Chat 审阅后恢复;继续盘点剩余 effect-owned 决策、委托 owner 动作和 Monitor lifecycle 的 CLI/Turn/Chat caller。见[调用合同](../../reference/canonical-todo-completion-update.md)。 | 复用已合并 T1 owner,不开通通用 raw patch;验证权限拒绝和 caller 响应,删除替代的 Python admission,列全未支持命令。 | | A/L3:canonical lease 生命周期 | 独立 acquire/接管、原子 claim 的 lease 准入及维护复用 TS facts/decision/materializer 与同一 provider opening fence。显式联合交接由源持有者授权,一次提交 Todo 归属与新租约 generation;canonical 请求类型不再携带 legacy 持锁字段。Acquire 成功必须校验当前执行 proof;canonical 完成可恢复缺失展示。 | 已覆盖完整 head scope 冲突、归档/失效 holder、创建 CAS 原样重试、旧执行、进程中断、真实 CLI 与四臂演练。[操作及剩余 caller](../../reference/canonical-lease-renew.md)。跨外部 effect 的 executor 持锁 fence 仍为明确工作;保留 D1–D3/default hold。 | | B/L4:leased Monitor poll 与 settlement | 当前 execution proof 贯穿 CLI intent、观察/generation/独立 successor CAS 和历史业务回执;业务写入前冻结 quota 准入,租约结束后仍按原决策恢复结算。 | 既有 L3 lease lifecycle、真实 File/SQLite/PostgreSQL、混合 fixture、业务与 quota 间真实进程退出、并发 renewal 和 unchanged poll;见[操作与快照演练](../../reference/protocols/quota-monitor-observation-receipt-v0.md)。不操作 lease lifecycle、不消耗 quota,不把两个 authority 假装成同一事务。Event caller、更广 L2 准入及 D1–D3/default 仍开放。 | | B/L5:consumer 与展示闭合 | 核对 #4316,审计 Turn/quota/Dashboard/Chat 的来源,复用 projection outbox 完成 D1 新鲜度和恢复。 | 验证 CLI、Lark/Chat、打包 frontend 的受影响交互;缺失/陈旧展示、权威空状态、pending 投影及超过 UI 上限的数据。逐个删除晋升后的 legacy fallback。 | | A–C/L6:本地持久化资格 | 延续 contributor 认领的 #4224/#4328,在选定 SQLite profile 上补齐第 7.2 节 ledger,复用 File/NoKV 对照。 | capacity、真实进程/crash/restore/upgrade、历史 receipt/scan、consumer lag、支持的 runtime/OS,以及另行授权的 >=10 天合成 soak。缺项继续 hold。 | -| A–C/L7:capture 连续性 | 修复 #4315:归档的源事务明确退休 lease 引用,bootstrap 与后续 writer 使用一致成员范围;执行 row/mutant 和 mixed-writer/event-source 矩阵。 | 真实 CLI/File capture、保留历史、半完成 drain 不合格、crash/replay,以及归档/rebootstrap 后再申请 lease。不能借 T4 跳过迁移窗口证明。 | +| A–C/L7:capture 连续性 | 核对已合入的 #4315 归档/lease membership 修复,完成对应 ladder row/mutant 与持续 mixed-writer/event-source 矩阵;不重复实现已关闭缺陷。 | 真实 CLI/File capture、保留历史、半完成 drain 不合格、crash/replay,以及归档/rebootstrap 后再申请 lease。不能借 T4 跳过迁移窗口证明。 | | C/L8:整 Goal 演练与分组迁移 | L2–L7 后汇合一个精确 revision/profile;drain capture、fence 旧 writer、回读 canonical 与投影、演练 fenced export/rollback。 | D3 包绑定 lineage、cursor、source digest、命令覆盖和 profile;已有 Goal 分组迁移需明确批准,不能按命令拆 authority 或复活旧 Markdown。 | | D/L9:新 Goal 默认与有界退役 | 单独 default-change PR 让新建/onboarding 选择合格本地 profile,配齐 settings/readback、installer 和打包客户端;最后 caller 与迁移窗口退出才删除旧业务 writer。 | L8 整体产品/回滚资格;区分新 Goal 默认和已有 Goal 迁移。发布兼容/停用说明,保留显式 provider、永久 renderer 和合法 import/export。T4 可在默认启用后继续收尾。 | diff --git a/docs/architecture/rfcs/typescript-control-plane-migration-v0.md b/docs/architecture/rfcs/typescript-control-plane-migration-v0.md index f6c4edb618..bbd8e37082 100644 --- a/docs/architecture/rfcs/typescript-control-plane-migration-v0.md +++ b/docs/architecture/rfcs/typescript-control-plane-migration-v0.md @@ -571,6 +571,12 @@ the shared plan, not another per-agent checklist database. **T1 — close the public Todo update transaction.** +User completion updates now compose the canonical edit planner and terminal +transaction, including original/edited authority, source-bound validation, +lease release and reviewed Chat recovery. The Python transport shares effect +execution and failure projection. This closes one remaining public caller, +not all T1 callers or the legacy writer. See [operation and compatibility](../../reference/canonical-todo-completion-update.md). + The current ownership slice closes promoted claim transfer, claim clearing and executor-exclusion edits through this typed update planner. Normalization is part of request identity, so replay cannot restore a superseded claim. A @@ -1644,3 +1650,9 @@ Python semantic owner, the handler boundary becomes chatty, two consecutive PRs increase bridge/scaffolding without retiring a facade, or a transaction cannot meet its invariant/recovery/performance gates without weakening existing behavior. + +## Appendix A: Execution ledger + +Measured delivery records live in the [per-entry ledger](ledger/typescript-control-plane-migration-v0/). +Each entry names its delivered boundary and remaining acceptance gaps; the T1–T4 +checkpoints above remain the current migration plan. diff --git a/docs/architecture/rfcs/typescript-control-plane-migration-v0.zh-CN.md b/docs/architecture/rfcs/typescript-control-plane-migration-v0.zh-CN.md index 866c82186c..98d69fabd3 100644 --- a/docs/architecture/rfcs/typescript-control-plane-migration-v0.zh-CN.md +++ b/docs/architecture/rfcs/typescript-control-plane-migration-v0.zh-CN.md @@ -451,6 +451,12 @@ commit。#4121(SQLite 候选)和 #4101(投影 receipt 保留)是独立 **T1 — 闭合公开 Todo update 事务。** +用户 Todo 的 completion update 现组合 canonical 编辑 planner 与 terminal +事务,覆盖原始/编辑后权限、绑定来源的验证、租约释放及 Chat 审阅后恢复。 +Python 传输层共用效果执行和失败投影;这闭合一个剩余公共 caller,不代表 +所有 T1 caller 或旧 writer 已退出。见[操作与兼容边界](../../reference/canonical-todo-completion-update.md)。 + + 当前 ownership slice 已将 promoted 路径的 claim 转交、清除和执行排除编辑接入 typed update planner。规范化参与请求身份,因此重放不能恢复已被后续操作取代的 claim。带 lease 的 ownership 变化仍必须走 lifecycle,不是 metadata 授权;未 @@ -1318,3 +1324,8 @@ Rollback 恢复上一版本 artifact 与 fingerprint。在单独通过 state-sch 变得 chatty、连续两个 PR 增加 bridge/scaffolding 却没有退出 facade,或一笔 transaction 只能靠削弱既有行为才能通过 invariant/recovery/performance 门禁, 就停止或 replan。 + +## 附录 A:执行记录 + +实测交付记录存于[逐条 ledger](ledger/typescript-control-plane-migration-v0/)。 +每条记录说明已交付边界及剩余验收缺口;上方 T1–T4 检查点仍是当前迁移计划。 diff --git a/docs/reference/canonical-todo-completion-update.md b/docs/reference/canonical-todo-completion-update.md new file mode 100644 index 0000000000..17995889ba --- /dev/null +++ b/docs/reference/canonical-todo-completion-update.md @@ -0,0 +1,95 @@ +# Canonical User Todo completion updates + +A promoted local Goal routes `todo update --status done` for **User Todos** +through the TypeScript terminal transaction. File and SQLite use the same +semantic owner; PostgreSQL exercises it through the service-owned provider. +This does not select a default provider or promote an existing Goal. + +```sh +loopx todo update --goal-id example --todo-id todo_observation \ + --agent-id agent-a --status done --note 'Observed outcome verified' \ + --no-follow-up --update-operation-id observation-completion +``` + +Use the same operation id and intent after a lost response. A new annotation +uses a new id (omitting the id generates one). `--dry-run` validates and previews +without running declared validation, writing a receipt, or delivering a display. +Agent completion continues to require `loopx todo complete`. + +## One edit, one terminal transaction + +The update decoder, authoring planner and record materializer are shared with +ordinary edits. The terminal owner checks the **original** Todo's completion +authority and the edited record's update authority; clearing a claim or binding +cannot turn an update-only grant into a completion grant. Existing lease +ownership/requirement restrictions remain: an annotation cannot rewrite an +execution grant. Supplied lease proof must identify a current execution; +expired explicit proof does not enable automatic reacquisition. + +The transaction checks linked successors before issuing validation effects. +Self-links and missing successors fail without running a caller command. This +ordering also applies to the existing complete/supersede transaction. Completion +does not invent a decision outcome: use the explicit decision workflow when an +approval, rejection or cancellation must be recorded. + +A declared validation command runs in the host after TS admission. The resumed +update binds the issued provider revision, retains the registry source witness, +and refreshes the clock. Any intervening provider commit rejects that resume, +even an unrelated Todo edit. Retry re-reads and revalidates; validation itself +may have external effects. Registry witnessing is optimistic, not an atomic +cross-resource authorization transaction or an executor-held effect fence. + +Todo fields, completion state, lease release, projection intent and the business +receipt commit together. Release preserves the existing lease version and epoch. +Markdown is a display projection and is not required to admit a completion. +Private validation declarations remain in their private store; they are neither +imported from an untrusted display nor embedded in public completion receipts. + +## Recovery and callers + +- Historical replay precedes current source admission and returns the original + business receipt. Changed edit intent with the same operation id is rejected. +- An already completed User Todo can receive a new completion-update annotation + without rerunning validation or changing its completion timestamp. This does + not reopen the Todo or grant further execution authority. +- The existing Chat User-completion action uses its reviewed canonical revision + and proposal operation id. Failed validation produces a failed proposal with + no success receipt. Pending display delivery is retryable; a retry recovers + the canonical operation before checking present-day freshness, then projects + the current head. Agent completion keeps its existing dedicated route. +- CLI and Python use the same public facade. No frontend layout, action name, + status selector or provider setting is added. The shared typed review plan + now exposes the original-operation retry for canonical User completion too. + The existing completion button + and failed-proposal retry interaction remain the user entry points. + +The same synthetic pending-completion proposal on the packaged desktop surface: +[before: omitted from recoverable proposals](images/canonical-user-completion/before.png), +[after: the original-operation retry](images/canonical-user-completion/after.png). +These images use the repository's synthetic workspace fixture, not a live Goal. +No responsive layout changes are involved. + +The local update transport uses request v3 for the completion envelope. v0–v2 +reject that envelope instead of silently accepting only part of the intent. +Their ordinary update behavior and receipt encoding remain unchanged. The +provider-neutral terminal receipt includes the User edit identity only for this +new operation family; existing complete/supersede receipt identities remain valid. + +## Migration boundary + +Unpromoted Goals retain their existing Python Markdown/event adapters. The +shared host validation executor and failure projection replace duplicated +transport plumbing; the TS edit decoder/materializer is no longer owned only +by the ordinary update transaction. Permanent rendering and private command +execution still have real Python callers and are not retirement candidates. + +This closes the User completion-update caller within TS T1/T2 and local-default +L2. It does not close every Monitor/event caller, executor-held effect fencing, +D1 consumer recovery, SQLite D2 capacity/elapsed soak, or D3 whole-Goal cutover. +See the [local-default program](../architecture/rfcs/shared-goal-authority-state-provider-v0.md#execution-handoff-and-integration-order). + +Rollback the code before using the new caller, or finish/retry its outstanding +projection delivery before downgrading. Older binaries reject request v3 and +cannot recover this operation through the old update route. Existing durable +Todo/lease records, historical receipts and permanent import/export obligations +are not removed by this change; never revive stale Markdown as authority. diff --git a/docs/reference/images/canonical-user-completion/after.png b/docs/reference/images/canonical-user-completion/after.png new file mode 100644 index 0000000000000000000000000000000000000000..232b194bd7624c9f9a824076bf736958199585a8 GIT binary patch literal 35209 zcmcG#Ra9JE)GZi1!QCaeTW}9jKyY^n?(Uuh_XG$UAh^4`ySoJ|tZ;X!d%ioy|I%ah zLwDb=NqqMXZt*=VaHP~7-2Lty z=DROa;u_w6PSz0&a1WtK7plbKs#2=BZ8bOp=qG2Db=Nm1m33#6XTZzR-hM#h1C|PL z4>UZ$J@9!G0i7VeO-AhedSGHw>Gace+WGZ(t=Y@twN+?@EYk=c71atyON6Yb0vlBV zMq+ftZr?5y)#LxkLxjvyH*+Y!3j+gsb2uj!z*TKNl0Za4l985{mXX06`7_3gmHKG} z0Re#$=_lQA((VX!#Z$-Ko%;%lG4g#~ZLJ#W@8VrSkE8i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E@zAIJg7Z{0{>=u>L&wx|Rm`vcU#RSE AkN^Mx literal 0 HcmV?d00001 From b7ceed9d94a79560b258a96c2557745b03eb4398 Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Fri, 18 Sep 2026 22:53:57 +0800 Subject: [PATCH 4/7] test(authority): follow extracted update intent mutant Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- examples/shared-goal-authority-e2e/mutants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shared-goal-authority-e2e/mutants.py b/examples/shared-goal-authority-e2e/mutants.py index 5840188426..d2e2e8229e 100644 --- a/examples/shared-goal-authority-e2e/mutants.py +++ b/examples/shared-goal-authority-e2e/mutants.py @@ -96,7 +96,7 @@ def command(self) -> list[str]: 'resolve_runtime_root(registry, runtime_root_arg, registry_path=registry_path)', 'resolve_runtime_root(registry, runtime_root_arg)')),), 'tests/control_plane/test_shadow_observable_e2e.py::test_registry_relative_root_does_not_depend_on_callers_cwd[disabled]'), - Case('native_note_dropped', ((COORDINATION + 'todo_update.ts', replacement( + Case('native_note_dropped', ((COORDINATION + 'todo_update_intent.ts', replacement( ' const next: JsonObject = {...todo, ...input.patch};', ' const next: JsonObject = {...todo, ...input.patch};\n if ("note" in input.patch) next.note = todo.note;')),), 'tests/control_plane/test_shadow_observable_native_e2e.py::test_native_unclaimed_edit_and_explicit_note_clear[disabled]'), From 8e4a215c0e4f6a27976d5dcb2948cbc9af43c088 Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Fri, 18 Sep 2026 22:56:34 +0800 Subject: [PATCH 5/7] fix(authority): retain typed source fence after rebase Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- loopx/control_plane/coordination/todo_terminal_lifecycle.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/loopx/control_plane/coordination/todo_terminal_lifecycle.ts b/loopx/control_plane/coordination/todo_terminal_lifecycle.ts index 173d50d044..e874f27e14 100644 --- a/loopx/control_plane/coordination/todo_terminal_lifecycle.ts +++ b/loopx/control_plane/coordination/todo_terminal_lifecycle.ts @@ -1038,7 +1038,6 @@ export async function executeCoordinationTodoTerminalLifecycle( ? todo.successor_todo_ids.map((value, index) => requireAuthorityStoreId(value, `todo.successor_todo_ids[${index}]`)) : []; - if (!await authoritySourcesCurrent()) return sourceChanged(); return commitTerminalResult(store, input, requestSha, head, { todo_id: input.todo_id, command: input.command, From cbbbd496fa148d593d1bd78b2ea337a3a44e1962 Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Fri, 18 Sep 2026 23:13:49 +0800 Subject: [PATCH 6/7] build(chat): refresh canonical completion recovery bundle Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- loopx/web/chat/asset-retention.json | 6 +++--- .../{index-B1IdQhEI.js => index-W7hV3dj8.js} | 16 ++++++++-------- loopx/web/chat/index.html | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) rename loopx/web/chat/assets/{index-B1IdQhEI.js => index-W7hV3dj8.js} (91%) diff --git a/loopx/web/chat/asset-retention.json b/loopx/web/chat/asset-retention.json index 60978d62ec..40521ddf44 100644 --- a/loopx/web/chat/asset-retention.json +++ b/loopx/web/chat/asset-retention.json @@ -14,7 +14,7 @@ "assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2", "assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2", "assets/index-Cbgh0ZGA.css", - "assets/index-DNT2rfje.js" + "assets/index-W7hV3dj8.js" ], [ "assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2", @@ -28,8 +28,8 @@ "assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2", "assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2", "assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2", - "assets/index-B1IdQhEI.js", - "assets/index-Cbgh0ZGA.css" + "assets/index-Cbgh0ZGA.css", + "assets/index-DNT2rfje.js" ] ] } diff --git a/loopx/web/chat/assets/index-B1IdQhEI.js b/loopx/web/chat/assets/index-W7hV3dj8.js similarity index 91% rename from loopx/web/chat/assets/index-B1IdQhEI.js rename to loopx/web/chat/assets/index-W7hV3dj8.js index ab4e0f83af..a6927cdccf 100644 --- a/loopx/web/chat/assets/index-B1IdQhEI.js +++ b/loopx/web/chat/assets/index-W7hV3dj8.js @@ -11,7 +11,7 @@ Objective: Completion criteria: Execution boundary (optional): Related repository (optional): -Notification method (optional):`,"composer.createGoalHint":`Insert a Goal template to review before creation`,"composer.evidence":`Check what is proven`,"composer.globalProgress":`Summarize all Goal progress`,"composer.globalProgressPrompt":`Summarize the latest progress and blockers for all active Goals.`,"composer.globalTasks":`Ask about global priorities`,"composer.globalTasksPrompt":`Which Goals need me, and what should I handle first?`,"composer.goalMessageHint":`Your message is delivered to {agent} in this Goal session.`,"composer.goalRunningHint":`{agent} is running {count} tasks · your message enters this session as guidance without interrupting it`,"composer.goalPlaceholder":`Ask or guide {goal}…`,"composer.imageAnalysisPrompt":`Analyze these images in the context of the current Goal and tell me the next step.`,"composer.imageCountError":`You can add up to {count} images.`,"composer.imagePicker":`Image file picker`,"composer.imageReadError":`Could not read image {name}.`,"composer.imageReadGenericError":`Could not read the image.`,"composer.imageSizeError":`Each image must be {size} MB or smaller.`,"composer.imageTypeError":`PNG, JPEG, WebP, and GIF images are supported.`,"composer.imagesPending":`Images to send`,"composer.managerMessageHint":`Your message goes to the LoopX Manager across Goals for global questions or Goal creation.`,"composer.managerPlaceholder":`Ask the LoopX Manager, or describe a new Goal…`,"composer.monitor":`Configure scheduled check`,"composer.monitorGoalQuestion":`Which Goal should receive the scheduled check?`,"composer.monitorTemplate":`Add a scheduled check for the current Goal: +Notification method (optional):`,"composer.createGoalHint":`Insert a Goal template to review before creation`,"composer.evidence":`Check what is proven`,"composer.globalProgress":`Summarize all Goal progress`,"composer.globalProgressPrompt":`Summarize the latest progress and blockers for all active Goals.`,"composer.globalTasks":`Ask about global priorities`,"composer.globalTasksPrompt":`Which Goals need me, and what should I handle first?`,"composer.goalMessageHint":`Your message is delivered to {agent} in this Goal session.`,"composer.goalRunningHint":`{count} conversations are running in this Goal · your message goes to the current {agent} conversation`,"composer.goalPlaceholder":`Ask or guide {goal}…`,"composer.imageAnalysisPrompt":`Analyze these images in the context of the current Goal and tell me the next step.`,"composer.imageCountError":`You can add up to {count} images.`,"composer.imagePicker":`Image file picker`,"composer.imageReadError":`Could not read image {name}.`,"composer.imageReadGenericError":`Could not read the image.`,"composer.imageSizeError":`Each image must be {size} MB or smaller.`,"composer.imageTypeError":`PNG, JPEG, WebP, and GIF images are supported.`,"composer.imagesPending":`Images to send`,"composer.managerMessageHint":`Your message goes to the LoopX Manager across Goals for global questions or Goal creation.`,"composer.managerPlaceholder":`Ask the LoopX Manager, or describe a new Goal…`,"composer.monitor":`Configure scheduled check`,"composer.monitorGoalQuestion":`Which Goal should receive the scheduled check?`,"composer.monitorTemplate":`Add a scheduled check for the current Goal: Check target: Frequency (supports 30 minutes / 2 hours / daily): Every 2 hours Stop condition: Goal completes`,"composer.monitorShortcutTemplate":`Add a scheduled check for the current Goal: @@ -28,12 +28,12 @@ Notification: Only notify me when needed`,"composer.heartbeatTemplateWithoutGoal Goal: Frequency: Daily Stop condition: Goal completes -Notification: Only notify me when needed`,"composer.nextAction":`Ask what’s next`,"composer.nextActionPrompt":`What should I do next?`,"composer.send":`Send`,"composer.sendMessage":`Send a message to LoopX`,"composer.sendMessageHint":`Send message`,"composer.sentImageAlt":`Remove image {name}`,"conversation.agentPending":`Working…`,"conversation.close":`Close conversation receipt`,"conversation.convertHint":`Turn the Agent’s latest reply into a Task draft`,"conversation.full":`View full conversation`,"conversation.receipt":`Conversation receipt`,"conversation.replying":`Replying`,"conversation.title":`Manager conversation`,"conversation.toTask":`Convert to Task`,"digest.away":`Runs since your previous visit`,"digest.completed":`new completions`,"digest.failed":`new failed/interrupted runs`,"digest.needsYou":`currently need confirmation`,"feedback.applying":`Running: {title}`,"feedback.cancelFailed":`Cancel failed: {error}`,"feedback.completed":`Completed: {title}`,"feedback.executionFailed":`Execution failed: {error}`,"feedback.gateRequired":`Your confirmation is required: {summary}`,"feedback.notCompleted":`Not completed: {status}`,"feedback.goalRefreshFailed":`The Goal opened, but its latest state could not be refreshed. Use Refresh to try again.`,"feedback.preparingPreview":`Preparing confirmation preview: {title}`,"feedback.previewFailed":`Could not prepare the confirmation preview: {error}`,"feedback.sendFailed":`Send failed: {error}`,"feedback.sendGenericError":`Could not send the message. Try again later.`,"feedback.stale":`State changed, so nothing was applied. Generate a new confirmation preview.`,"feedback.taskDraftCreated":`Created a Task draft from the reply. Edit and send it to review the confirmation preview.`,"goal.defaultTitle":`New personal Goal`,"goal.initialTodo":`Work toward the completion criteria: {criteria}`,"goal.objectiveBoundary":`Execution boundary: {boundary}`,"goal.objectiveCompletion":`Completion criteria: {criteria}`,"drawer.advancedDiagnostics":`Advanced diagnostics`,"drawer.agentWorking":`Agent is continuing; the record updates automatically.`,"drawer.analysis":`Analyzing`,"drawer.apply":`Confirm and apply`,"drawer.applying":`Applying…`,"drawer.attentionBlocking":`Blocking an Agent`,"drawer.attentionWaiting":`Waiting for your decision`,"drawer.autoNotify":`Human-gate auto notifications`,"drawer.branch":`Branch`,"drawer.closeDetail":`Close details and return to {context}`,"drawer.connected":`Connected`,"drawer.correctionDescription":`The message keeps the current Goal, Todo, and Agent Session context.`,"drawer.correctionLabel":`Guide {agent}`,"drawer.correctionPlaceholder":`For example: focus on permission risks first and do not commit yet…`,"drawer.correctionSend":`Send guidance`,"drawer.correctionTextarea":`Enter guidance for Goal {goal}, Agent {agent}, Run {run}`,"drawer.copyRepository":`Copy repository identity`,"drawer.copyRepositoryDone":`Repository identity copied`,"drawer.copyRepositoryError":`Copy failed. Check browser clipboard permission.`,"drawer.copyRepositorySuccess":`Copied. You can paste it into another tool.`,"drawer.cost":`Cost 24h / 7d`,"drawer.costShort":`Cost`,"drawer.durationShort":`Duration`,"drawer.period24h":`24h`,"drawer.period7d":`7d`,"drawer.tokens":`Tokens 24h / 7d`,"drawer.tokensShort":`tokens`,"drawer.usageNotMeasured":`Not measured`,"drawer.currentGoal":`Current Goal`,"attentionDetail.title":`Request details`,"attentionDetail.request":`What is requested`,"attentionDetail.decision":`Decision requested`,"attentionDetail.unknownRequest":`Not specified; review the source before deciding`,"attentionDetail.open":`Open in current projection`,"attentionDetail.closed":`Closed`,"attentionDetail.deferred":`Deferred`,"attentionDetail.superseded":`Replaced`,"attentionDetail.unknown":`Status not provided`,"attentionDetail.unavailable":`The source has not confirmed this item; refresh before acting`,"attentionDetail.unknownReason":`The source has not provided a reason.`,"attentionDetail.targetTodo":`Linked Todo to unblock`,"attentionDetail.targetAgent":`Agent named by the request`,"attentionDetail.scope":`Declared decision scope`,"attentionDetail.notProvided":`Not provided`,"attentionDetail.replacement":`Replacement Todo`,"attentionDetail.openReplacement":`Open replacement`,"attentionDetail.boundary":`Reading this detail does not resolve a gate or grant authority. Available decisions require a fresh preview.`,"drawer.decisionDefaultEvidence":`No additional public-safe evidence is attached. The next step will still show a Preview first.`,"drawer.decisionDefaultReason":`This decision affects the next step of the current Todo.`,"drawer.decisionDefer":`Decide later`,"drawer.decisionMore":`More decisions`,"drawer.decisionReject":`Reject`,"drawer.decisionReview":`Review impact and decide`,"drawer.dependencies":`Dependencies`,"drawer.detailsAndActions":`Details & actions`,"drawer.duration":`Duration 24h / 7d`,"drawer.evidence":`Evidence`,"drawer.executionHistory":`Execution history`,"drawer.executionRecord":`Run record`,"drawer.executionRecordAndResult":`Execution & result`,"drawer.explainDecision":`Explain this decision`,"drawer.gateApproveHint":`Run one command in the terminal to complete approval:`,"drawer.gateRejectHint":`Replace approve with reject at the end to decline. This notice disappears after the command runs.`,"drawer.gateRequiresHost":`Host confirmation required`,"drawer.gateRequiresHostDescription":`This page cannot approve this protected permission change. Nothing was written by your click.`,"drawer.goalAutoRun":`Automatic runs for this Goal`,"drawer.goalChanges":`Pending changes for this Goal`,"drawer.goalDetails":`Goal details`,"drawer.group":`Group`,"drawer.inspectorFull":`Switch to full screen`,"drawer.inspectorFullView":`Full-screen view`,"drawer.inspectorHalf":`Switch to half screen`,"drawer.inspectorHalfView":`Half-screen view`,"drawer.lastNotification":`Latest notification`,"drawer.larkConfigure":`Configure Lark connection`,"drawer.larkConnect":`Connect Lark App`,"drawer.larkConnection":`Lark connection`,"drawer.larkNotConfigured":`Not configured`,"drawer.larkNotConfiguredDescription":`After setup, LoopX sends a Feishu notification when this Goal needs your confirmation.`,"drawer.managerChanges":`Pending Manager changes`,"drawer.moreActions":`More actions`,"drawer.moreRunActions":`More run actions`,"drawer.nextTransition":`Next transition`,"drawer.noExecutionHistory":`No execution history yet.`,"drawer.noRun":`Execution Session has not started`,"drawer.noRunDescription":`Run records will appear here after an Agent starts execution.`,"drawer.notAssigned":`Unassigned`,"drawer.notLinked":`Not linked`,"drawer.notSet":`Not set`,"drawer.outputDetails":`Output details`,"drawer.outputRecorded":`This output is recorded on the current Goal.`,"drawer.outputSafePreview":`Public-safe output preview`,"drawer.outputRun":`Run`,"drawer.outputTodo":`Todo`,"drawer.outputs":`Outputs from this run`,"drawer.previewUnavailable":`No public-safe inline preview is available for this output.`,"drawer.priority":`Priority`,"drawer.progress":`Progress`,"drawer.proposalApplied":`Applied. LoopX state will refresh.`,"drawer.proposalApplyFailed":`Apply failed. No changes were written.`,"drawer.proposalApplyFailedHint":`Refresh the Goal state and regenerate. If it still fails, keep this page open and inspect advanced diagnostics.`,"drawer.proposalClose":`Close`,"drawer.proposalDefer":`Later`,"drawer.proposalDeferred":`Deferred. You can apply it later or regenerate it.`,"drawer.proposalEnterGoal":`Open new Goal`,"drawer.proposalExplainer":`After confirmation, LoopX applies this change and shows the write result. Closing or canceling changes nothing.`,"drawer.proposalRecheck":`Recheck against latest state`,"drawer.proposalRegenerate":`Retry with latest state`,"drawer.proposalRejected":`Rejected. This change will not be written.`,"drawer.proposalStale":`Source state changed. Recheck against the latest state.`,"drawer.proposalViewGoal":`View updated Goal`,"drawer.reassign":`Reassign to`,"drawer.reassignSummary":`Reassign: {task}`,"drawer.reason":`Reason`,"drawer.recoveryDescription":`Local history is preserved. Choose a recovery path.`,"drawer.recoveryFailed":`Upstream Session recovery failed`,"drawer.recoveryNewSession":`Start a new Session with context`,"drawer.recoveryRetry":`Retry recovery`,"drawer.repositoryRole":`Execution workspace`,"drawer.repository":`Repository`,"drawer.replyMode":`Reply mode`,"drawer.subagentApplied":`Applied and verified against the shared Goal state.`,"drawer.subagentAppliedRefreshFailed":`Applied and verified. The status view could not refresh; retry the page refresh later.`,"drawer.subagentApplying":`Applying and verifying shared-state readback…`,"drawer.subagentApplyFailed":`Could not apply the sub-agent setting.`,"drawer.subagentChildLimit":`Current limit`,"drawer.subagentConfirmDisable":`Confirm turning off sub-agent execution`,"drawer.subagentConfirmEnable":`Confirm turning on sub-agent execution`,"drawer.subagentCurrentBoundary":`Current task-domain restriction`,"drawer.subagentDescription":`Allows the runtime to create temporary child agents for independent tasks only after Todo, quota, capability, and write-scope gates pass. It does not force parallel work or grant durable authority.`,"drawer.subagentDisable":`Preview turning off sub-agent execution`,"drawer.subagentDisableSummary":`New child-agent execution will be disabled for this Goal. Existing Todo ownership and execution records stay unchanged.`,"drawer.subagentDomainInvalid":`The selected task-domain restriction is invalid.`,"drawer.subagentDomainTodoCount":`{count} matching open Todos`,"drawer.subagentDomains":`Task-domain restriction (optional)`,"drawer.subagentDomainsEmpty":`No open advancement Todo declares task_domain. Leave this empty to keep child execution unrestricted by task domain.`,"drawer.subagentDomainsHint":`Leave every option clear to apply no task-domain filter. Selecting domains admits only matching typed Todos; all other execution gates still apply.`,"drawer.subagentDomainsUnrestricted":`No task-domain restriction`,"drawer.subagentEnable":`Preview turning on sub-agent execution`,"drawer.subagentLabel":`Per-Goal execution boundary`,"drawer.subagentModel":`Child model`,"drawer.subagentEffort":`Child reasoning effort`,"drawer.subagentModelDefault":`Host default`,"drawer.subagentLunaPreset":`Use Luna / max`,"drawer.subagentClearModel":`Clear model preference`,"drawer.subagentModelHint":`Use Preview configuration update to save this preference. It can be saved while execution is off; host support is checked at launch.`,"drawer.subagentModelRequired":`Choose a child model before setting reasoning effort.`,"drawer.subagentMaxChildren":`Maximum child agents`,"drawer.subagentNoChange":`The current Goal already matches this setting; nothing was written.`,"drawer.subagentPending":`Pending confirmation`,"drawer.subagentPreviewBoundary":`Preview configuration update`,"drawer.subagentPreviewFailed":`Could not create the sub-agent setting preview.`,"drawer.subagentPreviewing":`Checking the latest Goal state…`,"drawer.subagentPreviewReady":`Preview locked. Confirm to apply this Goal setting.`,"drawer.subagentPreviewSummary":`Allow up to {count} child agents. Task-domain restriction: {domains}.`,"drawer.subagentRemoteReadOnly":`This source is read only. Open the Goal on its host to change the setting.`,"drawer.subagentTitle":`Adaptive sub-agent execution`,"drawer.remoteDetailsDescription":`SSH sources expose public-safe status only and do not read connection settings from the source host.`,"drawer.remoteDetailsUnavailable":`Remote details are not projected`,"drawer.resumeNo":`No`,"drawer.resumeYes":`Yes`,"drawer.runDetails":`Execution Session`,"drawer.runInterrupt":`Interrupt this run`,"drawer.runLatest":`View latest execution`,"drawer.runNewSession":`Start new Session`,"drawer.runCloseSession":`Close Session`,"drawer.runRecordEmpty":`No run record yet. The Agent has not started this execution. Check waiting conditions or resume the Session under Details & actions.`,"drawer.runRecordProjected":`No step-by-step record is available. LoopX read {completed}/{total} projected steps{outputs}; inspect the Session under Details & actions.`,"drawer.runRecordProjectedOutputs":` and {count} outputs`,"drawer.runRoleAssistant":`Completed`,"drawer.runRoleSystem":`Needs review`,"drawer.runRoleUser":`Task received`,"drawer.runView":`Session views`,"drawer.scheduleAdd":`Add scheduled check`,"drawer.scheduleDefaultNotification":`Notify only when you are needed`,"drawer.scheduleDefaultStop":`Goal completes or owner stops it`,"drawer.scheduleDefaultTarget":`Wake according to this Goal’s LoopX schedule.`,"drawer.scheduleEdit":`Change to every 2 hours`,"drawer.scheduleLast":`Last run`,"drawer.scheduleLocalTimezone":`Local timezone`,"drawer.scheduleNext":`Next run`,"drawer.scheduleNeverRun":`Not run yet`,"drawer.scheduleNotification":`Notification`,"drawer.schedulePause":`Pause`,"drawer.schedulePending":`Waiting for schedule`,"drawer.scheduleResume":`Resume`,"drawer.scheduleRunNow":`Run now`,"drawer.scheduleStop":`Stop {kind}`,"drawer.scheduleStopCondition":`Stop condition`,"drawer.scheduleTimezone":`Timezone`,"drawer.sessionRecoverable":`Resumable`,"drawer.sessionStatus":`Session status`,"drawer.setupHeartbeat":`Set up Heartbeat`,"drawer.taskActions":`Pending Todo actions`,"drawer.taskAdvancement":`Advancement task`,"drawer.taskBlock":`Mark blocked`,"drawer.taskComplete":`Mark complete`,"drawer.taskCompletedNote":`This task is retained as a read-only record.`,"drawer.taskCompletedTitle":`Task completed`,"drawer.taskDefer":`Defer`,"drawer.taskDeferCondition":`Todo defer resume condition`,"drawer.taskDeferInvalid":`Unsupported condition format; use one of the deterministic conditions below.`,"drawer.taskDeferPlaceholder":`For example, resume_at:2026-09-14T09:00:00+08:00`,"drawer.taskDeferReview":`Review defer`,"drawer.taskDeferSupported":`Supports todo_done, pr_merged, capacity_available, and timezone-aware resume_at conditions.`,"drawer.taskDeferUntil":`Defer until`,"drawer.taskDetails":`Todo details`,"drawer.taskInfo":`Task information`,"drawer.taskManage":`Manage task`,"drawer.taskNextCompleted":`Create a follow-up task`,"drawer.taskNextOpen":`Advance or update status`,"drawer.taskOrdinary":`Task`,"drawer.taskStatusBlocked":`Blocked`,"drawer.taskStatusDeferred":`Deferred`,"drawer.resumeWhen":`Resume condition`,"drawer.resumeState":`Resume state`,"drawer.resumePending":`Waiting for condition`,"drawer.resumeReady":`Ready to resume`,"drawer.resumeReceipt":`Resume receipt`,"drawer.taskNextDeferred":`Wait for the resume condition, then reassess`,"drawer.taskNextResumeReady":`Resume condition met; awaiting lifecycle replan`,"drawer.taskStatusCompleted":`Completed`,"drawer.taskStatusOpen":`Ready`,"drawer.taskSuccessor":`Create follow-up Todo`,"drawer.taskSuccessorNote":`Owner marked this blocked while waiting for more context.`,"drawer.taskSuccessorSummary":`Create follow-up Todo: {task}`,"drawer.taskSuccessorText":`Follow-up work for {task}`,"drawer.taskType":`Task type`,"drawer.topic":`Topic`,"drawer.trigger":`Trigger`,"drawer.titleAttention":`Needs you`,"drawer.titleOutput":`Output details`,"drawer.titleProposalApplied":`Execution result`,"drawer.titleProposalConfirm":`Confirm execution`,"drawer.titleSchedule":`Scheduled check`,"drawer.unconfigured":`Not configured`,"drawer.workspaceCandidates":`Available workspaces`,"files.emptySummary":`Public-safe output`,"files.empty":`No files, outputs, or verified reports yet.`,"files.loadingReports":`Loading verified milestone reports…`,"files.reportDelta":`+{added} added · {changed} changed`,"files.reportAdded":`added`,"files.reportChanged":`changed`,"files.reportGeneration":`Generation`,"files.reportLoadFailed":`Could not load verified reports`,"files.reportPublication":`Publication`,"files.title":`Files & Outputs`,"files.verifiedReport":`Verified milestone report`,"header.agentUnavailable":`Unavailable`,"header.chatRuntime":`Chat`,"header.workAgentCount":`{count} work Agents`,"header.overview":`Overview`,"header.chat":`Chat`,"header.files":`Files`,"header.goalCapabilities":`Capability settings`,"header.goalCapabilitiesDescription":`Manage overrides and inherited machine defaults.`,"header.goalDetails":`Goal details`,"header.goalDetailsDescription":`Review status, usage, repository, notifications, and sessions.`,"header.goalSettings":`Goal settings`,"header.goalSettingsDescription":`Configure this Goal’s capabilities`,"header.goalNavigation":`Goal navigation`,"header.goalView":`Goal view`,"header.live":`Live`,"header.manager":`LoopX Manager`,"header.managerDescription":`Your personal workspace across Goals`,"header.managerRuntime":`{profile} · {sandbox}`,"header.managerRuntimeFallback":`Configuration invalid; fell back to {profile} · {sandbox}. Repair it in Machine capabilities.`,"header.managerExecutorKindIndividual":`individual CLI login`,"header.managerExecutorKindManaged":`operator credential`,"header.managerExecutorKindRegistered":`registered endpoint`,"header.managerExecutionUnavailable":`Selected {executor} cannot start here; this channel does not fall back to an individual CLI login.`,"header.managerExecutionUnavailableCredential":`Selected {executor} needs the operator credential {credential} before this channel can start it.`,"header.managerExecutionUnavailableRuntime":`Selected {executor} cannot start here because its runtime is not installed on this machine.`,"header.managerExecutionUnavailableEffort":`Selected {executor} rejected the configured reasoning effort; set a supported effort and reload.`,"header.managerEndpointStewardDefault":`Runs {executor}, the steward channel's shipped default. Select an executor explicitly to move it.`,"header.managerOverview":`Overview`,"header.managerView":`Manager view`,"header.openGoalNavigation":`Open Goal navigation`,"header.readOnlySourceDescription":`{source} is displayed read-only through an SSH tunnel`,"header.refresh":`Refresh status`,"header.refreshDone":`Updated just now`,"header.refreshFailed":`Refresh failed`,"header.refreshing":`Refreshing`,"header.selectAgent":`Select Agent`,"header.selectChatRuntime":`Select chat runtime`,"header.tasks":`Tasks`,"header.themeBrutal":`Switch to brutal theme`,"header.themePaper":`Switch to default theme`,"home.blockingSummary":`{count} are blocking an Agent.`,"home.completedGoals":`Completed Goals`,"home.empty":`Nothing here`,"startup.goalLoading":`Loading status…`,"startup.goalError":`Could not load status`,"startup.progress":`{loaded} of {total} active Goals loaded`,"startup.partial":`Goal states are updating. Counts are incomplete.`,"startup.independent":`Other Goals remain available while this Goal loads.`,"startup.error.timeout":`The request timed out. Retry when the local service is ready.`,"startup.error.network":`The connection was interrupted. Retry to reconnect.`,"startup.error.service":`The Goal status could not be read. Retry later; if the problem continues, check the status source.`,"startup.error.access":`The status source cannot access files or runtime directories required for this Goal. Check the permissions of the account running that source, then retry.`,"startup.error.revision":`The Goal directory changed during loading. Refresh to synchronize.`,"startup.error.scope":`This Goal is no longer available in the selected source. Refresh the directory.`,"startup.error.invalid":`The status response could not be read. Refresh or check for a LoopX update.`,"startup.retry":`Retry`,"startup.retryFailed":`Retry failed Goals`,"startup.failedCount":`{count} Goals could not be loaded. Ready Goals remain available.`,"home.greeting":`Hi, I’m your LoopX Manager`,"home.history":`History`,"home.lane.needsYou":`Needs you`,"home.lane.needsYouDescription":`Waiting for your decision, authorization, or context`,"home.lane.observing":`Observing`,"home.lane.observingDescription":`Monitoring continuously and notifying you when something changes`,"home.lane.running":`Running`,"home.lane.runningDescription":`Agents are making progress and reporting back`,"home.lane.scheduled":`Scheduled`,"home.lane.scheduledDescription":`Queued until its time or prerequisite arrives`,"home.noActivity":`No activity yet`,"home.noFirstActivity":`Waiting for first activity`,"home.noCompletedGoals":`No completed Goals yet`,"home.preservedState":`State is preserved and can be resumed`,"home.stopped":`Stopped`,"home.systemHealth":`System health: {summary}`,"home.taskCount":`{count} Tasks`,"home.todayAt":`Today {time}`,"home.waitingCount":`You have {count} items to handle.`,"home.workspace":`Goal workspace`,"lark.allMessages":`All messages in this topic`,"lark.allTopicMessages":`All topic messages`,"lark.agentIngress":`Agent ingress`,"lark.agentAppPermissions":`Every selected Agent needs a Lark App that is ready for group mentions and replies.`,"lark.agentApps":`Lark App per Agent`,"lark.agentAppsDescription":`The default App is preselected. Assign a different compatible App when an Agent needs its own bot identity.`,"lark.agentAppSelection":`Lark App for {agent}`,"lark.appCreated":`App created`,"lark.appCreateFailed":`Creation failed`,"lark.appLoading":`Loading available Lark Apps…`,"lark.appPermissions":`This App can send connection messages, but lacks the bot permissions required to receive group mentions or reply automatically. Enable im:message.group_at_msg:readonly, im:message.send_as_bot, and the im.message.receive_v1 event, publish a new version, then refresh.`,"lark.appProfile":`Lark App`,"lark.apps":`Lark Apps`,"lark.autoReplyUnavailable":`Auto reply unavailable`,"lark.autoReplyReady":`Auto reply ready`,"lark.bindGoal":`Bind to Goal`,"lark.cancel":`Cancel`,"lark.cardinality":`One Lark App · many Goals · one isolated route per Agent`,"lark.capture":`Capture`,"lark.captureAddressed":`Only messages that mention or reply to the App`,"lark.captureAll":`All messages in this Goal topic`,"lark.captureScope":`Capture scope`,"lark.captureScopeDescription":`Controls which Topic messages enter LoopX without expanding Agent permissions.`,"lark.closeConnection":`Close connection dialog`,"lark.closeCreate":`Close create dialog`,"lark.closeSettings":`Close Lark settings`,"lark.connect":`Connect`,"lark.connectAllAgents":`Connect every registered Agent`,"lark.connectAllAgentsAction":`Connect {count} Agents`,"lark.connectAllAgentsDescription":`Create {count} isolated Agent Topics in one guided action. Send requests inside the matching Topic; each Agent keeps its own route and inbox.`,"lark.connectApp":`Connect Lark App`,"lark.connection":`Connection`,"lark.connections":`Connections`,"lark.configuration":`Lark configuration`,"lark.continueFeishu":`Continue in Feishu`,"lark.createAutomatically":`Create Goal topic automatically`,"lark.createAutomaticallyDescription":`A dedicated, Agent-labelled Topic will be created for every selected Agent.`,"lark.defaultAgentAppDescription":`Used to find the target group and as the default for every selected Agent. Per-Agent choices below override it.`,"lark.description":`Manage reusable Lark Apps and connect group chats to Goals through dedicated topics.`,"lark.editConnection":`Edit Lark Connection`,"lark.goalConnections":`{count} Goal connections`,"lark.goalTopicConnections":`Lark Goal Topic connections`,"lark.groupChat":`Group chat`,"lark.groupEmpty":`This bot has not joined a group that can be connected. Add it to a Feishu group first, then return to refresh or search.`,"lark.groupLoading":`Reading groups joined by this bot…`,"lark.groupSearch":`Search groups joined by this bot`,"lark.historyPermission":`Group-history permission (separate capability)`,"lark.health.contextCaptured":`Group context captured`,"lark.health.contextCapturedDetail":`The message is retained as non-authoritative context. It did not start or steer a Manager turn; send a direct @ mention or verified reply when action is required.`,"lark.health.eventProcessed":`{events} events processed, {replies} replies sent.`,"lark.health.eventUnverified":`Event subscription needs verification`,"lark.health.eventUnverifiedDetail":`The provider listener is ready, but no event has arrived. Enable im.message.receive_v1 and group mention permissions, publish a new version, then send a new @ mention inside this Agent Topic. Group-level messages fail closed when multiple Agent routes exist.`,"lark.health.ignoredSelf":`The bot’s own message was ignored to prevent duplicate replies.`,"lark.health.invalidRouting":`Invalid routing configuration`,"lark.health.invalidRoutingDetail":`The connection was safely disabled. Select a processing mode again and save.`,"lark.health.lastStatus":`Latest event status: {status}`,"lark.health.listening":`Listening`,"lark.health.messageContextPermission":`Message permission required`,"lark.health.messageContextPermissionDetail":`A message event arrived, but group context could not be read. Publish and authorize group message read access for this App.`,"lark.health.notAddressed":`Latest message did not directly @ the bot`,"lark.health.notAddressedDetail":`Listening is healthy. This connection only responds to direct @ mentions or replies to the bot.`,"lark.health.notStarted":`Listener not started`,"lark.health.notStartedDetail":`Refresh the connection or restart LoopX, then try again.`,"lark.health.processingFailed":`Message processing failed`,"lark.health.processingFailedDetail":`The message event arrived, but Agent processing failed. Review local diagnostics and retry.`,"lark.health.queued":`Queued in the Agent inbox`,"lark.health.queuedDetail":`The message will be processed asynchronously by {agent} without starting a general Chat Session.`,"lark.health.sourceDisconnected":`Event connection disconnected`,"lark.health.sourceDisconnectedDetail":`The event consumer exited unexpectedly. Check that the app profile uses Feishu for Feishu apps or Lark for international Lark, then inspect connection and subscription errors. LoopX is retrying; successful history queries do not prove live delivery.`,"lark.health.retrying":`Retrying listener`,"lark.health.retryingDetail":`Event listening was interrupted and LoopX is retrying automatically.`,"lark.health.routeAmbiguous":`Message matches multiple Goals`,"lark.health.routeAmbiguousDetail":`The same bot and group have multiple full-group capture connections. Use a separate bot for each Agent or keep only one full-group connection.`,"lark.health.routeMismatch":`Message did not match this Goal Topic`,"lark.health.routeMismatchDetail":`The event came from another group or Topic. Reconnect this Goal to the correct group, then send a new @ mention.`,"lark.health.routeUnavailable":`Message cannot be routed to the Goal`,"lark.health.routeUnavailableDetail":`Connection data is incomplete. Reconnect this Goal, then send a new @ mention.`,"lark.health.starting":`Starting`,"lark.health.startingDetail":`LoopX is starting message event listening for this App.`,"lark.health.unavailable":`Auto reply unavailable`,"lark.health.waiting":`Waiting`,"lark.incomingMessages":`Incoming messages`,"lark.ingressAsync":`Async inbox`,"lark.ingressAsyncDescription":`Write to the Agent private inbox for a later explicit drain.`,"lark.editPreservesIdentity":`Saving preserves this App, group and Topic. Old connections upgrade to the Agent inbox by default.`,"lark.conversationKind":`Connection purpose`,"lark.managerConversation":`Manager · live conversation`,"lark.workerConversation":`Worker Agent · background tasks`,"lark.managerConversationDescription":`The built-in manager responds as you chat and delegates long-running work to background Agents. Group and private conversations keep separate histories.`,"lark.ingressLegacy":`Upgrade available`,"lark.ingressLegacyDescription":`Save this connection to upgrade to the Agent inbox. Existing messages remain in the same Topic.`,"lark.ingressQueue":`Queuing`,"lark.ingressQueueDescription":`Enter the same Agent Session's bounded FIFO queue and run after the current Turn.`,"lark.ingressSteering":`Steering`,"lark.ingressSteeringDescription":`Deliver to the active Turn and reject safely when no exact active Turn exists.`,"lark.loading":`Loading Lark configuration…`,"lark.management":`Lark management`,"lark.openEventSettings":`Open Feishu event settings`,"lark.mentions":`Mentions`,"lark.mentionsOnly":`Mentions only`,"lark.needsMessagePermissions":`Needs message permissions`,"lark.needsSetup":`Needs setup`,"lark.newApp":`New Lark App`,"lark.noAgentConfigured":`No Agent configured`,"lark.noConnections":`No matching connections.`,"lark.noProfiles":`No lark-cli App profiles are available yet.`,"lark.profileName":`Profile name`,"lark.profileValidation":`Profile can contain only letters, numbers, periods, underscores, and hyphens.`,"lark.processing":`Processing`,"lark.region":`Region`,"lark.registerAnother":`+ Register another Lark App — Create through Feishu`,"lark.reopenFeishu":`Reopen Feishu`,"lark.settingsConfigure":`Configure {goal}`,"lark.settingsDisconnect":`Disconnect {goal}`,"lark.replyMode":`Reply mode`,"lark.replyModeDescription":`Replies are limited to the source Topic to prevent cross-group or cross-Goal delivery.`,"lark.reusableApps":`{count} reusable Apps`,"lark.reusableWorkspaceApp":`Reusable workspace App`,"lark.routesUnverified":`{count} Lark routes pending verification`,"lark.saveConnection":`Save connection`,"lark.searchConnections":`Search Lark connections`,"lark.searchPlaceholder":`Search Apps, groups, Goals, or topics`,"lark.setupCopy":`LoopX opens the official Feishu creation page through lark-cli. App credentials stay in the system Keychain; LoopX stores only the profile reference.`,"lark.someoneMentions":`Someone mentions the Agent`,"lark.targetAgent":`Target Agent`,"lark.targetAgentDescription":`Choose a registered Agent in this Goal. This connection delivers to one Agent; it does not broadcast or grant permissions. Steering and Queuing require that Agent's exact active Session.`,"lark.agentUnavailable":`{agent} · no longer available`,"lark.selectRegisteredAgent":`Select an available registered Agent before connecting. The previous Agent will not be replaced automatically.`,"lark.topicPreview":`Topic preview`,"lark.topicReply":`Topic reply`,"lark.trigger":`Trigger`,"lark.waitingFeishu":`Waiting for Feishu`,"lark.waitingFeishuDescription":`Complete Feishu authorization in the new window. This page updates automatically when it is ready.`,"lark.waitingLink":`Generating the official Feishu creation link…`,"lark.error.appCreate":`Lark App creation failed`,"lark.error.appRequired":`Select a Lark App profile.`,"lark.error.bind":`Connection failed`,"lark.error.bindPreview":`Connection preview failed`,"lark.error.configuration":`Could not load Lark configuration`,"lark.error.groupLookup":`Could not read groups joined by this bot. Check the bot status and try again.`,"lark.error.groupLoad":`Could not load group chats`,"lark.error.invalidApp":`The Lark App profile is unavailable or has not completed authorization.`,"lark.error.messagePermissions":`This App lacks the bot permissions required for automatic replies. Enable im:message.group_at_msg:readonly and im:message:send_as_bot, publish a new version, then refresh.`,"lark.error.provider":`The Feishu API call failed without a verified receipt. Try again later.`,"lark.error.setupPoll":`Could not read creation status`,"lark.error.setupStart":`Could not start Lark App creation`,"lark.error.cliExecutable":`The configured lark-cli was found but cannot run. Check the installation or launch arguments.`,"lark.error.cliMissing":`lark-cli was not found. Install lark-cli and restart LoopX.`,"lark.error.cliStart":`lark-cli failed to start. Check the installation and restart LoopX.`,"lark.error.disconnect":`Disconnect failed`,"notifications.autoNotify":`Send automatically when your confirmation is required`,"notifications.bind":`Bind notification group`,"notifications.bindConfirm":`Bind “{goal}” to “{target}”. LoopX will verify that the bot is in the group and send a confirmation message.`,"notifications.bindFailed":`Binding failed`,"notifications.bound":`Bound`,"notifications.confirmBind":`Confirm binding`,"notifications.description":`Send Goal changes that need your confirmation to a Feishu group. Bindings and automatic delivery use the existing channel.`,"notifications.disabled":`Disabled`,"notifications.group":`Notification group: {target}`,"notifications.loadFailed":`Could not load notification groups`,"notifications.noTargets":`No notification groups are available. Group delivery uses a private bot identity; configure one from the terminal first:`,"notifications.notBound":`Not bound`,"notifications.recent":`Latest {time}`,"notifications.sentCount":`{count} sent`,"notifications.settings":`Goal notification bindings`,"notifications.setupFailed":`Could not update settings`,"notifications.title":`Feishu group notifications`,"proposal.field.agentId":`Agent`,"proposal.field.cadence":`Frequency`,"proposal.field.completionCriteria":`Completion criteria`,"proposal.field.executionBoundary":`Execution boundary`,"proposal.field.goalId":`Goal ID`,"proposal.field.heartbeat":`Heartbeat`,"proposal.field.initialTodos":`Initial tasks`,"proposal.field.objective":`Objective`,"proposal.field.operation":`Operation`,"proposal.field.operationState":`Operation state`,"proposal.field.resultDelivery":`Result delivery`,"proposal.field.confirmationBoundary":`Confirmation boundary`,"proposal.field.expiresAt":`Expires at`,"proposal.field.permission":`Permission`,"proposal.field.reason":`Reason`,"proposal.field.stopCondition":`Stop condition`,"proposal.field.target":`Check target`,"proposal.field.timezone":`Timezone`,"proposal.field.title":`Title`,"proposal.field.workspace":`Execution workspace`,"actionReview.targetChanged":`The preview target does not match the requested Goal and operation. Generate a new preview.`,"actionReview.ready_stop":`Pausing is reversible. This validated preview can apply directly; completion still requires verified readback.`,"actionReview.resume_review":`Review before restoring automatic scheduling. Quota, gates and Todo constraints still apply.`,"actionReview.delete_review":`Review removal of this stopped Goal from the registries. Project files and history are preserved.`,"actionReview.action_review":`Review the target and impact before applying this proposal.`,"actionReview.protected_action":`This action needs explicit review. Confirmation cannot replace required authority.`,"actionReview.unknown_permission":`The permission classification is not recognized. Recheck the proposal before continuing.`,"actionReview.unknown_action":`This lifecycle operation is not recognized. Recheck the proposal before continuing.`,"actionReview.incomplete_proposal":`The preview is missing validation or an available apply transition. Generate a new preview.`,"actionReview.authority_gate":`A gate prevents execution. Resolve its requirements, then recheck the proposal.`,"actionReview.stale_proposal":`The source state changed. Generate a new preview; the previous decision no longer applies.`,"actionReview.apply_pending":`Execution is in progress. Wait for its result before retrying.`,"actionReview.readback_verified":`The action completed and its resulting state was verified.`,"actionReview.readback_unverified":`The action returned without verified readback. Completion is not confirmed; recheck the state.`,"actionReview.operation_group_confirmation":`This exact request can only be confirmed on its original card in the bound Feishu group. The Dashboard does not expose a local execution control.`,"actionReview.operation_result_delivery_pending":`The operation outcome was recorded, but the original group result card has not passed readback verification yet.`,"drawer.recoverEditResult":`Recover edit result`,"drawer.retryOriginal":`Retry original operation`,"actionReview.canonical_update_retry":`The edit is not yet verified. Retry this operation to recover its result.`,"actionReview.canonical_update_projection_pending":`The edit was committed; display delivery is pending. Retry this operation to restore the current view.`,"actionReview.apply_failed":`Execution did not complete. Check the failure and regenerate the preview before retrying.`,"actionReview.inactive_proposal":`This proposal is no longer ready to execute. Recheck it before continuing.`,"proposal.gate.default":`Host confirmation required`,"proposal.impact.default":`After confirmation, the canonical LoopX service will write the state change.`,"proposal.impact.goalCreate":`After confirmation, LoopX will create the Goal and its initial Todo, then let the selected Agent start the first run.`,"proposal.impact.lifecycleDelete":`After confirmation, this stopped Goal is removed from the source and global registries. Project files, history state, and backups are preserved.`,"proposal.impact.lifecycleResume":`After confirmation, the Goal becomes eligible for automatic scheduling and returns to Active Goals. Actual execution still follows quota, Gate, and Todo constraints.`,"proposal.impact.lifecycleStop":`After confirmation, automatic progress stops and the Goal moves to the collapsed Stopped list. History, Todos, and evidence remain available for resuming.`,"proposal.impact.protected":`This action must be completed through the protected LoopX write service.`,"proposal.impact.operation":`The exact terms are read-only here. Confirm or reject the same immutable request in the bound Feishu group; confirmation consumes one canonical claim.`,"proposal.primary.apply":`Confirm and apply`,"proposal.primary.goalCreate":`Create Goal and start first run`,"proposal.primary.lifecycleDelete":`Delete Goal`,"proposal.primary.lifecycleResume":`Resume Goal`,"proposal.primary.lifecycleStop":`Stop Goal`,"proposal.primary.todoStart":`Create task and start execution`,"proposal.primary.operationGroup":`Confirm in Feishu group`,"proposal.primary.operationResultPending":`Result card delivery pending`,"proposal.primary.operationResultVerified":`Verified result`,"proposal.resultDelivery.verified":`Verified in the original group card`,"proposal.resultDelivery.pending":`Pending verified return to the original group card`,"proposal.summary.goalCreate":`Create Goal: {title}`,"proposal.summary.heartbeat":`Set a Heartbeat for the current Goal`,"proposal.summary.lifecycleDelete":`Delete Goal: {title}`,"proposal.summary.lifecycleResume":`Resume Goal: {title}`,"proposal.summary.lifecycleStop":`Stop Goal: {title}`,"proposal.summary.monitor":`Create a scheduled check for the current Goal: {target}`,"proposal.teamPlan.gapReason.capabilityNotGranted":`Required capability not granted`,"proposal.teamPlan.gapReason.audienceNotAuthorized":`Required access not authorized`,"proposal.teamPlan.pending":`Pending`,"proposal.teamPlan.assignedHint":`Assignment recorded. See the Goal for execution progress.`,"proposal.teamPlan.recoveredHint":`No new tasks created. See the Goal for current progress.`,"proposal.teamPlan.originalPlan":`View original plan`,"proposal.teamPlan.viewResult":`View result`,"proposal.teamPlan.openGoal":`Open Goal`,"proposal.teamPlan.resultTitle":`Assignment result`,"proposal.teamPlan.retry":`Retry assignment`,"proposal.teamPlan.retryHint":`Retry this assignment to recover its result without duplicating tasks.`,"proposal.summary.teamPlan":`Assign {count} tasks for {goal}`,"proposal.impact.teamPlan":`Confirm to assign the ready tasks. Unavailable assignments stay pending.`,"proposal.primary.teamPlan":`Confirm assignment`,"proposal.field.laneGaps":`Unstaffed lanes`,"proposal.field.quotaEnvelope":`Quota envelope`,"proposal.teamPlan.acceptanceShort":`acceptance reference`,"proposal.teamPlan.advisory":`planning context; not enforced by this confirmation`,"proposal.teamPlan.appliedPartially":`{created} assigned · {gaps} pending`,"proposal.teamPlan.appliedAlreadyPresent":`Original assignment recovered`,"proposal.teamPlan.applied":`{count} tasks assigned`,"proposal.teamPlan.gapLane":`unstaffed`,"proposal.teamPlan.laneUnstaffed":`staffing gap, no first Todo`,"proposal.teamPlan.gapReason.agentNotRegistered":`the Agent is not registered for this Goal`,"proposal.teamPlan.gapReason.actionKindNotSupported":`this host does not ship that action kind`,"proposal.workspace.current":`Current local workspace (no Repository bound)`,"proposal.workspace.named":`{workspace} (execution environment only; does not bind a repository)`,"proposal.workspaceGate.agentImpact":`Bind an Agent identity, then recheck the original action. No Goal has been written.`,"proposal.workspaceGate.agentTitle":`Bind an Agent first`,"proposal.workspaceGate.defaultSummary":`Select the Goal workspace.`,"proposal.workspaceGate.selectionImpact":`After selecting a workspace, LoopX will show the confirmation preview again. The selection itself does not write state.`,"proposal.workspaceGate.selectionTitle":`Select Goal workspace`,"projection.agentAdvancingGoal":`Agent is advancing the current Goal`,"projection.agentIdle":`Nothing needs your attention`,"projection.agentNeedsDecision":`Agent is waiting for your decision`,"projection.agentPreparingNextStep":`Agent is preparing the next step`,"projection.agentStopped":`Stopped by you; history, Todos, and evidence are preserved`,"projection.agentWaitingExternal":`Waiting for an external condition`,"projection.confirmAgentDecision":`Confirm the permission or decision the Agent needs next`,"projection.events24h":`{count} events in the last 24 hours`,"projection.firstReadOnlyAdapterCheck":`Run the first read-only adapter check and save progress`,"projection.goalVerified":`Goal state, Todos, and registration information verified`,"projection.latestRun":`Latest run`,"projection.latestValidation":`Latest validation`,"projection.nextUpdatePending":`Waiting for LoopX to update the next step`,"projection.publicSafeProjection":`Public-safe status projection`,"projection.refreshState":`Refresh LoopX status and confirm the current progress is still valid`,"projection.runEvidenceAvailable":`Run evidence is available`,"projection.runRecorded":`The latest LoopX run is recorded`,"projection.statusRefreshNeeded":`LoopX status needs to be refreshed`,"projection.todoStatusUpdated":`Todo status updated; confirming the next step`,"projection.validationRecorded":`The latest validation is recorded`,"runs.completed":`Completed`,"runs.failed":`Needs review`,"runs.interrupted":`Interrupted`,"runs.queued":`Scheduled`,"runs.ready":`Ready`,"runs.resumeFailed":`Recovery failed`,"runs.running":`Running`,"runs.unknown":`Unknown`,"runs.waiting":`Waiting`,"schedule.active":`Running`,"schedule.heartbeat":`Goal Heartbeat`,"schedule.monitor":`Scheduled & continuous task`,"schedule.paused":`Paused`,"schedule.summary":`Continuously checked under LoopX scheduling constraints`,"schedule.defaultTarget":`Check the current Goal for blockers, progress, and new outputs`,"schedule.unsupportedCalendar":`Scheduled checks do not currently support an exact weekday or time. Use a fixed interval such as “Every 30 minutes,” “Every 2 hours,” or “Daily.” The draft was preserved and no confirmation preview was created.`,"source.add":`Add source`,"source.addConfigured":`Add read-only source`,"source.addMethod":`Source setup method`,"source.addSsh":`Add SSH source`,"source.closeForm":`Close source form`,"source.configured":`Configured SSH`,"source.configuredCount":`Local SSH Hosts · {count}`,"source.configuredGroup":`Configured SSH Hosts · {count} (select to add)`,"source.connected":`Connected`,"source.connecting":`Connecting`,"source.controlPlane":`Control plane source`,"source.copy":`Copy`,"source.copyCommand":`Copy SSH tunnel command`,"source.copyError":`Could not copy the command. Copy it manually below.`,"source.copied":`Copied`,"source.description":`All explicit Hosts are loaded, including Include files. Wildcards are not listed. Run the command first; LoopX never reads SSH keys or configuration details.`,"source.host":`Local SSH Host`,"source.hostEmpty":`No explicit SSH Hosts are available in ~/.ssh/config.`,"source.hostLoadError":`Could not read local SSH Hosts.`,"source.hostPlaceholder":`Enter or search for a Host`,"source.invalid":`The SSH source settings are invalid.`,"source.loadingHosts":`Loading…`,"source.localInteractive":`Local interactive`,"source.localPort":`Local port`,"source.manual":`Manual URL`,"source.manualDescription":`Remote sources always remain read-only projections and never inherit local write permissions.`,"source.name":`Name`,"source.namePlaceholder":`Remote development machine`,"source.notAvailable":`Unavailable`,"source.readOnly":`SSH tunnel · read only`,"source.readOnlyNoticeDescription":`You can view Goals, Tasks, evidence, and run status. Writes, guidance, and Agent sessions remain on the source host.`,"source.readOnlyNoticeTitle":`Remote read-only projection`,"source.readOnlyWriteError":`Remote SSH tunnel sources are read-only projections and cannot perform control-plane writes.`,"source.refreshHosts":`Reload SSH Hosts`,"source.remove":`Remove source {source}`,"source.removeCurrent":`Remove current source`,"source.select":`Select control plane source`,"source.selectHost":`Select a configured SSH Host.`,"source.statusUrl":`Local forwarded URL`,"source.tunnelCommandPending":`Select a Host to generate the tunnel command`,"machine.absent":`Not configured`,"machine.action.create":`Create machine policy`,"machine.action.delete":`Remove machine policy`,"machine.action.unchanged":`No write required`,"machine.action.update":`Update machine policy`,"machine.applied":`Machine policy applied and read back successfully.`,"machine.applyError":`Machine policy could not be applied.`,"machine.applyPreview":`Apply reviewed preview`,"machine.changedNamespaces":`Changed namespaces`,"machine.capabilityCatalog":`Machine capability catalog`,"machine.capabilityEmpty":`No machine-configurable capabilities are registered.`,"machine.configured":`Configured`,"machine.confirmRollback":`Confirm rollback`,"machine.currentRevision":`Current revision`,"machine.currentValue":`Current machine value`,"machine.description":`Browse the same capability catalog as Goal settings. Configure supported machine defaults here; Goal-only capabilities are labeled explicitly.`,"capabilities.rawJson":`Advanced: raw JSON`,"machine.goalOnly":`This capability currently supports Goal configuration only. Open a Goal’s capability settings to configure it; no machine-wide default is applied.`,"machine.desiredRevision":`Desired revision`,"machine.editorUnavailable":`No editor is installed for this namespace`,"machine.editorUnavailableDescription":`The namespace remains visible in the registry. Install or upgrade its Dashboard editor before changing it.`,"machine.editorMode":`Editor mode`,"machine.liveDefault":`Live default; Goal override wins`,"machine.liveDefaultDescription":`Goals without an explicit override read the current machine policy at the capability’s next decision point. Changes and removal affect those existing Goals immediately; an explicit Goal override stays pinned.`,"machine.credentialTitle":`Operator model credential`,"machine.credentialDescription":`The key and endpoint the steward channel and the managed host authenticate with on this machine. The key is stored in its own owner-only file, never in the machine configuration that is projected here, and it is never read back — only its fingerprint is.`,"machine.credentialApiKey":`API key`,"machine.credentialApiKeyPlaceholder":`Paste a key to store it; leave blank to keep the stored one`,"machine.credentialBaseUrl":`Endpoint base URL`,"machine.credentialBaseUrlPlaceholder":`https://endpoint.example/v1 (blank keeps the endpoint default)`,"machine.credentialStore":`Store credential`,"machine.credentialClearKey":`Clear stored key`,"machine.credentialClearUrl":`Clear stored endpoint`,"machine.credentialConfigured":`configured`,"machine.credentialAbsent":`not configured`,"machine.credentialInvalid":`unreadable — repair required`,"machine.credentialSourceMachine":`this machine's stored credential`,"machine.credentialSourceEnvironment":`the service environment`,"machine.credentialSourceUnset":`no source`,"machine.credentialFingerprint":`fingerprint`,"machine.credentialStored":`Credential stored. The next turn uses it; no restart is needed.`,"machine.credentialCleared":`Stored credential cleared.`,"machine.credentialError":`The credential could not be stored.`,"machine.credentialBoundary":`Storing a credential grants no authority: it does not select an executor, model, or reasoning effort.`,"machine.genericNamespaceDescription":`Edit this registered namespace as JSON. LoopX validates it with the capability-owned schema before previewing any write.`,"machine.jsonConfiguration":`Namespace configuration (JSON)`,"machine.jsonConfigurationHelp":`Only this namespace is updated. Other machine configuration is preserved, and Apply remains locked to the reviewed preview revision.`,"machine.jsonEditor":`JSON`,"machine.editJson":`Edit JSON`,"capabilities.jsonConfiguration":`Goal configuration (JSON)`,"capabilities.jsonHelp":`Edit registered fields for this Goal. Changes require a new preview before applying.`,"capabilities.jsonInvalid":`Enter a valid JSON object using only registered editable fields.`,"machine.backToForm":`Back to form`,"machine.jsonInvalid":`Enter one valid JSON object before previewing changes.`,"machine.loadError":`Machine configuration could not be loaded.`,"machine.invalidStoredConfiguration":`Stored machine configuration needs repair`,"machine.invalidStoredConfigurationDescription":`Stored values are hidden because they no longer match the installed contract. Review the affected capability, then Preview and Apply its replacement; unrelated namespaces remain unchanged.`,"machine.machinePolicy":`Machine policy`,"machine.namespaceCount":`Registered namespaces`,"machine.namespaces":`Configuration namespaces`,"machine.periodicReport":`Periodic reports`,"machine.periodicReportDescription":`Default report policy for every Goal without an explicit override. Goal scheduling and delivery consume the effective configuration.`,"machine.periodicReportActivation":`Enabled means automatic delivery at validated stage boundaries`,"machine.periodicReportActivationDescription":`This is not a weekly timer. When LoopX validates a Goal stage completion, an Agent prepares and freezes the report, then automatically delivers it through the configured Goal Channel. The enabled subscription is standing delivery authority; failures and route drift stop closed for repair.`,"machine.changeQualityActivation":`Qualification is a quality gate, not new authority`,"machine.changeQualityActivationDescription":`Goals that inherit this policy qualify their exact final diff. safe_fix allows at most one bounded fix pass inside existing write authority; this setting never grants file, permission, or merge authority.`,"machine.replanCadenceActivation":`Review cadence changes timing, not execution authority`,"machine.replanCadenceActivationDescription":`Goals without an explicit override read this threshold before the next review decision. It does not create Turns, spend quota, or grant authority.`,"machine.preview":`Review exact machine change`,"machine.previewChanges":`Preview changes`,"machine.previewError":`A machine-policy preview could not be created.`,"machine.previewLocked":`Apply is locked to this exact revision. If machine state changes, LoopX requires a new preview.`,"machine.previewRollback":`Preview rollback`,"machine.previewRemoval":`Preview removal`,"machine.profilePreset":`Profile preset`,"machine.profilePresetHelp":`A capability-owned preset, such as weekly-progress.`,"machine.registry":`Typed registry`,"machine.requiredFields":`Enable requires a profile preset, Goal Channel route, and valid timezone.`,"machine.revision":`Machine revision`,"machine.revisionLockedReady":`All changes require a preview and apply only while that exact machine revision remains current.`,"machine.rollbackAvailable":`Rollback is available for the last apply`,"machine.rollbackDescription":`Preview the stored prior revision before restoring it.`,"machine.rollbackError":`The rollback could not be completed.`,"machine.rollbackPreviewDescription":`The prior revision is ready to restore. Confirm to apply this rollback.`,"machine.rolledBack":`The prior machine policy was restored and verified.`,"machine.removed":`Machine policy removed and the resulting configuration read back successfully.`,"machine.routeRef":`Goal Channel route`,"machine.routeRefHelp":`Use a public route alias; credentials and provider identifiers never enter this form.`,"machine.timezone":`Timezone`,"machine.timezoneHelp":`Use an IANA timezone, for example Asia/Shanghai.`,"machine.title":`Machine configuration`,"machine.unchanged":`Machine policy already matches this preview; nothing was written.`,"machine.visualEditor":`Guided`,"capabilities.atomicOverride":`Goal override is atomic`,"capabilities.atomicOverrideDescription":`A complete Goal value wins over the machine default. LoopX never mixes individual fields across scopes.`,"capabilities.applyFailed":`Goal capability changes were not applied.`,"capabilities.applyPreview":`Apply preview`,"capabilities.catalog":`Goal capability catalog`,"capabilities.chooseGoal":`Choose a Goal before inspecting its capabilities.`,"capabilities.defaultValue":`Declared default`,"capabilities.description":`Inspect the capabilities available to this Goal and the exact scope of each setting.`,"capabilities.editorPrepared":`Typed editor contract available`,"capabilities.effectiveSource":`Effective source`,"capabilities.empty":`No capability descriptors are available for this Goal.`,"capabilities.fields":`Registered fields`,"capabilities.goalPolicy":`Goal capability policy`,"capabilities.goalScope":`Goal`,"capabilities.goalValue":`Current Goal value`,"capabilities.loadFailed":`Could not load Goal capabilities`,"capabilities.larkInboxNotificationDescription":`This switch controls automatic group messages for human gates. Incoming Lark events remain available when it is off.`,"capabilities.larkInboxNotificationSetting":`Human-gate group notifications`,"capabilities.loading":`Loading Goal capabilities…`,"capabilities.machineOnly":`This capability is configured only at machine scope.`,"capabilities.machineValue":`Live machine default`,"capabilities.machineScope":`Machine`,"capabilities.previewOnly":`Inspection is live. Goal writes remain unavailable until the revision-locked preview and apply path is connected.`,"capabilities.preview":`Revision-locked preview`,"capabilities.previewChanges":`Preview changes`,"capabilities.restoreInheritance":`Restore machine-default inheritance`,"capabilities.previewFailed":`Could not preview Goal capability changes.`,"capabilities.previewLocked":`Apply will re-check this exact plan revision and reject stale changes.`,"capabilities.partialWrite":`Goal value saved; shared projection needs reconciliation`,"capabilities.partialWriteDescription":`The source Goal configuration was written and read back. Its shared runtime projection did not synchronize, so do not submit the change again.`,"capabilities.refreshSource":`Refresh source value`,"capabilities.readOnly":`Read-only capability`,"capabilities.revisionLockedReady":`Changes require a preview and are applied only when its exact revision is still current.`,"capabilities.retry":`Retry`,"capabilities.source.capability_default":`Capability default`,"capabilities.source.goal_override":`Goal override`,"capabilities.source.machine_default":`Live machine default`,"capabilities.source.not_configured":`Not configured`,"capabilities.title":`Goal capabilities`,"settings.close":`Close settings`,"settings.appearance":`Appearance`,"settings.appearanceDescription":`Manage workspace display preferences in this browser.`,"settings.appearanceTabDescription":`Theme and display preferences`,"settings.capabilitiesTabDescription":`Capability overrides for this Goal`,"settings.back":`Back to workspace`,"settings.categories":`Settings categories`,"settings.description":`Manage workspace preferences and integrations.`,"settings.eyebrow":`Workspace preferences`,"settings.general":`General`,"settings.goalConnections":`Goal connections`,"settings.language":`Language`,"settings.modelProvider":`Model provider`,"settings.globalCapabilities":`Global capabilities`,"settings.languageDescription":`Choose the language used by the LoopX desktop workspace.`,"settings.languageEnglishDescription":`Use English for navigation, settings, and workspace controls.`,"settings.languageEnglish":`English`,"settings.languageSimplifiedChineseDescription":`Use Simplified Chinese for navigation, settings, and workspace controls.`,"settings.languageSimplifiedChinese":`Simplified Chinese`,"settings.languageStoredLocally":`This preference is stored only on this device.`,"settings.languageTabDescription":`Interface language for this device`,"settings.larkTabDescription":`Apps, group chats, and Goal Topic connections`,"settings.machineTabDescription":`Typed defaults shared by capabilities on this machine`,"settings.notifications":`Notifications`,"settings.open":`Settings`,"settings.themeDefault":`Paper`,"settings.themeDefaultDescription":`Calm and lightweight for long-running work.`,"settings.themeDescription":`Choose the workspace visual style. This preference is stored in the current browser.`,"settings.themeHighContrast":`High contrast`,"settings.themeHighContrastDescription":`Stronger borders and more prominent state blocks.`,"settings.themeLoopx":`LoopX standard`,"settings.themeLoopxDescription":`Precise monochrome surfaces, Geist type, and quiet hairline structure.`,"settings.title":`Settings`,"settings.workspaceDisplay":`Workspace display`,"settings.workspaceTheme":`Workspace theme`,"session.closeRecord":`Exit run record`,"session.details":`Session details`,"session.record":`Execution Session · Run record`,"session.recordDescription":`The timeline now shows messages and Turn records from this Session.`,"sidebar.createGoal":`Create Goal`,"sidebar.delete":`Delete`,"sidebar.deleteGoal":`Delete Goal`,"sidebar.manager":`LoopX Manager`,"sidebar.notifications":`Settings`,"sidebar.owner":`Personal workspace`,"sidebar.product":`Personal Agent workspace`,"sidebar.resume":`Resume`,"sidebar.resumeGoal":`Resume Goal`,"sidebar.stop":`Stop`,"tasks.historyLoading":`Loading history…`,"tasks.historyError":`History could not be loaded.`,"tasks.historyExpired":`History snapshot expired. Reload to continue.`,"tasks.historyRetry":`Reload`,"tasks.historyEnd":`End of completed history`,"tasks.historyMore":`Load more`,"tasks.historyLocalOnly":`Open this machine’s Dashboard to browse full history.`,"sidebar.sortGoals":`Reorder Goals`,"sidebar.dragGoal":`Drag to reorder, or use Reorder Goals`,"sidebar.moveUp":`Move {goal} up`,"sidebar.moveDown":`Move {goal} down`,"sidebar.goalMoved":`{goal} moved to position {position}`,"sidebar.orderNotSaved":`Order changed for this visit; browser storage is unavailable.`,"sidebar.stopGoal":`Stop Goal`,"sidebar.stopped":`Stopped`,"sidebar.stoppedLoading":`Loading stopped Goals`,"sidebar.stoppedLoadFailed":`Stopped Goals could not be loaded. Active Goals remain available.`,"sidebar.retryStopped":`Retry`,"state.completed":`Completed`,"state.needsRepair":`Needs repair`,"state.needsYou":`Needs you`,"state.quiet":`Quiet`,"state.running":`Running`,"state.stopped":`Stopped`,"state.waiting":`Waiting`,"tasks.blocked":`Blocked`,"tasks.agentLane":`Work Agent`,"tasks.agentLaneDescription":`Filter this Goal's projected work lanes`,"tasks.agentLaneFilter":`Filter by work Agent`,"tasks.allAgentLanes":`All Agents ({count})`,"tasks.chatAgentReplied":`Agent replied`,"tasks.chatPending":`Sent to Agent`,"tasks.chatPendingDescription":`Processing. Tasks update only after a task operation is confirmed.`,"tasks.chatRecent":`Recent conversation`,"tasks.chatUnchangedDescription":`This conversation did not directly change Tasks. Convert the reply to a Task draft and confirm it when execution is needed.`,"tasks.chatViewReply":`View reply`,"tasks.convertToTask":`Convert to Task`,"tasks.completed":`Completed`,"runs.discoveryPartial":`Some execution details are unavailable. Reconnecting; task summaries are not live execution status.`,"runs.discoveryOffline":`Execution service unavailable. Reconnecting; retained task summaries may be stale.`,"files.openConversation":`Go to conversation`,"files.exportSummary":`Export summary`,"tasks.viewDescription":`Decisions first, then work and recent completions`,"tasks.viewLabel":`Task view`,"tasks.listView":`List`,"tasks.boardView":`Board`,"tasks.completedSummary":`{count} tasks completed. Recent details are projected by the control plane when needed.`,"tasks.emptyCompleted":`No completed tasks yet.`,"tasks.emptyConfirm":`No tasks waiting for confirmation.`,"tasks.emptyRunning":`No queued or running tasks.`,"tasks.emptySchedules":`No scheduled tasks.`,"tasks.emptyGoal":`This Goal has no tasks yet. Describe the next step below and LoopX will show a confirmation preview first.`,"tasks.markComplete":`Mark complete: {name}`,"tasks.moreActions":`More actions: {name}`,"tasks.openExecution":`View execution: {name}`,"tasks.pending":`Pending`,"tasks.pendingAndRunning":`Queued / Running`,"tasks.scheduled":`Scheduled & continuous`,"tasks.sessionError":`Session issue`,"tasks.waiting":`Queued`,"tasks.waitingAge":`Waiting {age}`,"tasks.viewExecution":`View execution`,"tasks.viewResult":`View result`,"time.days":`{count} days`,"time.hours":`{count} hours`,"timeline.emptyGoal":`This Goal has no new activity`,"timeline.emptyGoalDescription":`Ask for progress or send new guidance.`,"timeline.emptyWorkspace":`Your workspace is quiet today`,"timeline.emptyWorkspaceDescription":`Describe a Goal to the LoopX Manager, or ask what deserves attention today.`,"timeline.gateHistory":`{count} historical Gates`,"timeline.pending":`Working…`,"returnDelivery.queued":`Return queued`,"returnDelivery.verifying":`Verifying delivery without resending`,"returnDelivery.delivered":`Delivered to the original audience`,"returnDelivery.reconciled":`Delivery verified after recovery`,"returnDelivery.unverified":`Delivery remains explicitly unverified`,"timeline.runCompleted":`{run}: completed`,"timeline.review":`Review`,"timeline.reviewAndConfirm":`Review and confirm`,"timeline.waitingConfirmation":`Needs your confirmation`},"zh-CN":{"acceptance.connected":`已连接`,"acceptance.mapped":`已建立项目映射`,"acceptance.refreshed":`已刷新状态`,"acceptance.inspected":`已检查适配器`,"acceptance.recorded":`已记录执行`,"acceptance.judged":`已记录反馈`,"acceptance.approved":`已记录批准`,"acceptance.ready":`已记录控制器就绪`,"acceptance.attentionSource":`当前状态`,"acceptance.visionSource":`Agent 验收条件`,"acceptance.todoSource":`任务状态`,"acceptance.runSource":`最新执行证据`,"acceptance.title":`验收观察`,"acceptance.unavailable":`验收观测不可用,Goal 是否达成仍未知。`,"acceptance.partial":`当前仅有部分观测。任务完成或缺口列表为空,都不能证明 Goal 已通过验收。`,"acceptance.gaps":`仍需补充的证据`,"acceptance.reasonUnknown":`来源未提供原因`,"acceptance.unknown":`未知`,"acceptance.required":`所需证据或条件`,"acceptance.observed":`观测时间`,"acceptance.noGaps":`现有观测中没有缺口,尚未评估完整验收条件。`,"acceptance.guards":`待处理的门禁决策`,"acceptance.noGuards":`现有观测中没有待处理的门禁决策。`,"acceptance.scope":`决策范围`,"acceptance.next":`当前状态给出的下一步`,"acceptance.historical_progress":`已记录的历史进展`,"acceptance.historical":`历史生命周期记录不授予权限,也不代表通过验收。`,"acceptance.missing":`未获取的来源:`,"acceptance.truncated":`仅展示前 12 条观测。`,"common.actions":`操作`,"common.agent":`Agent`,"common.allMessages":`所有消息`,"common.cancel":`取消`,"common.close":`关闭`,"common.closeActionReceipt":`关闭操作回执`,"common.confirm":`确认`,"common.export":`导出`,"common.failed":`失败`,"common.goal":`Goal`,"common.loading":`加载中…`,"common.none":`无`,"common.off":`关闭`,"common.on":`开启`,"common.open":`打开`,"common.owner":`Owner`,"common.readOnly":`只读`,"common.recently":`刚刚`,"common.status":`状态`,"common.task":`Task`,"common.you":`你`,"common.waiting":`等待中`,"composer.addImage":`添加图片`,"composer.agentProgress":`向 Agent 获取进度报告`,"composer.agentProgressPrompt":`请给我一份当前 Goal 的进度报告:已完成、执行中、阻塞和下一步。`,"composer.blockers":`看阻塞`,"composer.attachImageHint":`选择、粘贴或拖入图片`,"composer.clarifyDefer":`暂缓 Todo 需要可自动判断的恢复条件。请补充 todo_done:、pr_merged:[owner/repo]#、capacity_available: 或 resume_at:<带时区 RFC3339 时间>。`,"composer.clarifySingleAction":`这句话包含多个可能修改状态的操作。请一次描述一项操作,我会逐项展示确认预览。`,"composer.evidence":`查证据`,"composer.createGoal":`创建新 Goal`,"composer.createGoalDraft":`Goal 草稿`,"composer.createGoalDraftDescription":`补充内容后发送,LoopX 会先展示待确认操作。`,"composer.createGoalDraftLead":`我想创建一个长期 Goal:`,"composer.createGoalTemplate":`我想创建一个长期 Goal: +Notification: Only notify me when needed`,"composer.nextAction":`Ask what’s next`,"composer.nextActionPrompt":`What should I do next?`,"composer.send":`Send`,"composer.sendMessage":`Send a message to LoopX`,"composer.sendMessageHint":`Send message`,"composer.sentImageAlt":`Remove image {name}`,"conversation.agentPending":`Working…`,"conversation.close":`Close conversation receipt`,"conversation.convertHint":`Turn the Agent’s latest reply into a Task draft`,"conversation.full":`View full conversation`,"conversation.receipt":`Conversation receipt`,"conversation.replying":`Replying`,"conversation.title":`Manager conversation`,"conversation.toTask":`Convert to Task`,"digest.away":`Runs since your previous visit`,"digest.completed":`new completions`,"digest.failed":`new failed/interrupted runs`,"digest.needsYou":`currently need confirmation`,"feedback.applying":`Running: {title}`,"feedback.cancelFailed":`Cancel failed: {error}`,"feedback.completed":`Completed: {title}`,"feedback.executionFailed":`Execution failed: {error}`,"feedback.gateRequired":`Your confirmation is required: {summary}`,"feedback.notCompleted":`Not completed: {status}`,"feedback.goalRefreshFailed":`The Goal opened, but its latest state could not be refreshed. Use Refresh to try again.`,"feedback.preparingPreview":`Preparing confirmation preview: {title}`,"feedback.previewFailed":`Could not prepare the confirmation preview: {error}`,"feedback.sendFailed":`Send failed: {error}`,"feedback.sendGenericError":`Could not send the message. Try again later.`,"feedback.stale":`State changed, so nothing was applied. Generate a new confirmation preview.`,"feedback.taskDraftCreated":`Created a Task draft from the reply. Edit and send it to review the confirmation preview.`,"goal.defaultTitle":`New personal Goal`,"goal.initialTodo":`Work toward the completion criteria: {criteria}`,"goal.objectiveBoundary":`Execution boundary: {boundary}`,"goal.objectiveCompletion":`Completion criteria: {criteria}`,"drawer.advancedDiagnostics":`Advanced diagnostics`,"drawer.agentWorking":`Agent is continuing; the record updates automatically.`,"drawer.analysis":`Analyzing`,"drawer.apply":`Confirm and apply`,"drawer.applying":`Applying…`,"drawer.attentionBlocking":`Blocking an Agent`,"drawer.attentionWaiting":`Waiting for your decision`,"drawer.autoNotify":`Human-gate auto notifications`,"drawer.branch":`Branch`,"drawer.closeDetail":`Close details and return to {context}`,"drawer.connected":`Connected`,"drawer.correctionDescription":`The message keeps the current Goal, Todo, and Agent Session context.`,"drawer.correctionLabel":`Guide {agent}`,"drawer.correctionPlaceholder":`For example: focus on permission risks first and do not commit yet…`,"drawer.correctionSend":`Send guidance`,"drawer.correctionTextarea":`Enter guidance for Goal {goal}, Agent {agent}, Run {run}`,"drawer.copyRepository":`Copy repository identity`,"drawer.copyRepositoryDone":`Repository identity copied`,"drawer.copyRepositoryError":`Copy failed. Check browser clipboard permission.`,"drawer.copyRepositorySuccess":`Copied. You can paste it into another tool.`,"drawer.cost":`Cost 24h / 7d`,"drawer.costShort":`Cost`,"drawer.durationShort":`Duration`,"drawer.period24h":`24h`,"drawer.period7d":`7d`,"drawer.tokens":`Tokens 24h / 7d`,"drawer.tokensShort":`tokens`,"drawer.usageNotMeasured":`Not measured`,"drawer.currentGoal":`Current Goal`,"attentionDetail.title":`Request details`,"attentionDetail.request":`What is requested`,"attentionDetail.decision":`Decision requested`,"attentionDetail.unknownRequest":`Not specified; review the source before deciding`,"attentionDetail.open":`Open in current projection`,"attentionDetail.closed":`Closed`,"attentionDetail.deferred":`Deferred`,"attentionDetail.superseded":`Replaced`,"attentionDetail.unknown":`Status not provided`,"attentionDetail.unavailable":`The source has not confirmed this item; refresh before acting`,"attentionDetail.unknownReason":`The source has not provided a reason.`,"attentionDetail.targetTodo":`Linked Todo to unblock`,"attentionDetail.targetAgent":`Agent named by the request`,"attentionDetail.scope":`Declared decision scope`,"attentionDetail.notProvided":`Not provided`,"attentionDetail.replacement":`Replacement Todo`,"attentionDetail.openReplacement":`Open replacement`,"attentionDetail.boundary":`Reading this detail does not resolve a gate or grant authority. Available decisions require a fresh preview.`,"drawer.decisionDefaultEvidence":`No additional public-safe evidence is attached. The next step will still show a Preview first.`,"drawer.decisionDefaultReason":`This decision affects the next step of the current Todo.`,"drawer.decisionDefer":`Decide later`,"drawer.decisionMore":`More decisions`,"drawer.decisionReject":`Reject`,"drawer.decisionReview":`Review impact and decide`,"drawer.dependencies":`Dependencies`,"drawer.detailsAndActions":`Details & actions`,"drawer.duration":`Duration 24h / 7d`,"drawer.evidence":`Evidence`,"drawer.executionHistory":`Execution history`,"drawer.executionRecord":`Run record`,"drawer.executionRecordAndResult":`Execution & result`,"drawer.explainDecision":`Explain this decision`,"drawer.gateApproveHint":`Run one command in the terminal to complete approval:`,"drawer.gateRejectHint":`Replace approve with reject at the end to decline. This notice disappears after the command runs.`,"drawer.gateRequiresHost":`Host confirmation required`,"drawer.gateRequiresHostDescription":`This page cannot approve this protected permission change. Nothing was written by your click.`,"drawer.goalAutoRun":`Automatic runs for this Goal`,"drawer.goalChanges":`Pending changes for this Goal`,"drawer.goalDetails":`Goal details`,"drawer.group":`Group`,"drawer.inspectorFull":`Switch to full screen`,"drawer.inspectorFullView":`Full-screen view`,"drawer.inspectorHalf":`Switch to half screen`,"drawer.inspectorHalfView":`Half-screen view`,"drawer.lastNotification":`Latest notification`,"drawer.larkConfigure":`Configure Lark connection`,"drawer.larkConnect":`Connect Lark App`,"drawer.larkConnection":`Lark connection`,"drawer.larkNotConfigured":`Not configured`,"drawer.larkNotConfiguredDescription":`After setup, LoopX sends a Feishu notification when this Goal needs your confirmation.`,"drawer.managerChanges":`Pending Manager changes`,"drawer.moreActions":`More actions`,"drawer.moreRunActions":`More run actions`,"drawer.nextTransition":`Next transition`,"drawer.noExecutionHistory":`No execution history yet.`,"drawer.noRun":`Execution Session has not started`,"drawer.noRunDescription":`Run records will appear here after an Agent starts execution.`,"drawer.notAssigned":`Unassigned`,"drawer.notLinked":`Not linked`,"drawer.notSet":`Not set`,"drawer.outputDetails":`Output details`,"drawer.outputRecorded":`This output is recorded on the current Goal.`,"drawer.outputSafePreview":`Public-safe output preview`,"drawer.outputRun":`Run`,"drawer.outputTodo":`Todo`,"drawer.outputs":`Outputs from this run`,"drawer.previewUnavailable":`No public-safe inline preview is available for this output.`,"drawer.priority":`Priority`,"drawer.progress":`Progress`,"drawer.proposalApplied":`Applied. LoopX state will refresh.`,"drawer.proposalApplyFailed":`Apply failed. No changes were written.`,"drawer.proposalApplyFailedHint":`Refresh the Goal state and regenerate. If it still fails, keep this page open and inspect advanced diagnostics.`,"drawer.proposalClose":`Close`,"drawer.proposalDefer":`Later`,"drawer.proposalDeferred":`Deferred. You can apply it later or regenerate it.`,"drawer.proposalEnterGoal":`Open new Goal`,"drawer.proposalExplainer":`After confirmation, LoopX applies this change and shows the write result. Closing or canceling changes nothing.`,"drawer.proposalRecheck":`Recheck against latest state`,"drawer.proposalRegenerate":`Retry with latest state`,"drawer.proposalRejected":`Rejected. This change will not be written.`,"drawer.proposalStale":`Source state changed. Recheck against the latest state.`,"drawer.proposalViewGoal":`View updated Goal`,"drawer.reassign":`Reassign to`,"drawer.reassignSummary":`Reassign: {task}`,"drawer.reason":`Reason`,"drawer.recoveryDescription":`Local history is preserved. Choose a recovery path.`,"drawer.recoveryFailed":`Upstream Session recovery failed`,"drawer.recoveryNewSession":`Start a new Session with context`,"drawer.recoveryRetry":`Retry recovery`,"drawer.repositoryRole":`Execution workspace`,"drawer.repository":`Repository`,"drawer.replyMode":`Reply mode`,"drawer.subagentApplied":`Applied and verified against the shared Goal state.`,"drawer.subagentAppliedRefreshFailed":`Applied and verified. The status view could not refresh; retry the page refresh later.`,"drawer.subagentApplying":`Applying and verifying shared-state readback…`,"drawer.subagentApplyFailed":`Could not apply the sub-agent setting.`,"drawer.subagentChildLimit":`Current limit`,"drawer.subagentConfirmDisable":`Confirm turning off sub-agent execution`,"drawer.subagentConfirmEnable":`Confirm turning on sub-agent execution`,"drawer.subagentCurrentBoundary":`Current task-domain restriction`,"drawer.subagentDescription":`Allows the runtime to create temporary child agents for independent tasks only after Todo, quota, capability, and write-scope gates pass. It does not force parallel work or grant durable authority.`,"drawer.subagentDisable":`Preview turning off sub-agent execution`,"drawer.subagentDisableSummary":`New child-agent execution will be disabled for this Goal. Existing Todo ownership and execution records stay unchanged.`,"drawer.subagentDomainInvalid":`The selected task-domain restriction is invalid.`,"drawer.subagentDomainTodoCount":`{count} matching open Todos`,"drawer.subagentDomains":`Task-domain restriction (optional)`,"drawer.subagentDomainsEmpty":`No open advancement Todo declares task_domain. Leave this empty to keep child execution unrestricted by task domain.`,"drawer.subagentDomainsHint":`Leave every option clear to apply no task-domain filter. Selecting domains admits only matching typed Todos; all other execution gates still apply.`,"drawer.subagentDomainsUnrestricted":`No task-domain restriction`,"drawer.subagentEnable":`Preview turning on sub-agent execution`,"drawer.subagentLabel":`Per-Goal execution boundary`,"drawer.subagentModel":`Child model`,"drawer.subagentEffort":`Child reasoning effort`,"drawer.subagentModelDefault":`Host default`,"drawer.subagentLunaPreset":`Use Luna / max`,"drawer.subagentClearModel":`Clear model preference`,"drawer.subagentModelHint":`Use Preview configuration update to save this preference. It can be saved while execution is off; host support is checked at launch.`,"drawer.subagentModelRequired":`Choose a child model before setting reasoning effort.`,"drawer.subagentMaxChildren":`Maximum child agents`,"drawer.subagentNoChange":`The current Goal already matches this setting; nothing was written.`,"drawer.subagentPending":`Pending confirmation`,"drawer.subagentPreviewBoundary":`Preview configuration update`,"drawer.subagentPreviewFailed":`Could not create the sub-agent setting preview.`,"drawer.subagentPreviewing":`Checking the latest Goal state…`,"drawer.subagentPreviewReady":`Preview locked. Confirm to apply this Goal setting.`,"drawer.subagentPreviewSummary":`Allow up to {count} child agents. Task-domain restriction: {domains}.`,"drawer.subagentRemoteReadOnly":`This source is read only. Open the Goal on its host to change the setting.`,"drawer.subagentTitle":`Adaptive sub-agent execution`,"drawer.remoteDetailsDescription":`SSH sources expose public-safe status only and do not read connection settings from the source host.`,"drawer.remoteDetailsUnavailable":`Remote details are not projected`,"drawer.resumeNo":`No`,"drawer.resumeYes":`Yes`,"drawer.runDetails":`Execution Session`,"drawer.runInterrupt":`Interrupt this run`,"drawer.runLatest":`View latest execution`,"drawer.runNewSession":`Start new Session`,"drawer.runCloseSession":`Close Session`,"drawer.runRecordEmpty":`No run record yet. The Agent has not started this execution. Check waiting conditions or resume the Session under Details & actions.`,"drawer.runRecordProjected":`No step-by-step record is available. LoopX read {completed}/{total} projected steps{outputs}; inspect the Session under Details & actions.`,"drawer.runRecordProjectedOutputs":` and {count} outputs`,"drawer.runRoleAssistant":`Completed`,"drawer.runRoleSystem":`Needs review`,"drawer.runRoleUser":`Task received`,"drawer.runView":`Session views`,"drawer.scheduleAdd":`Add scheduled check`,"drawer.scheduleDefaultNotification":`Notify only when you are needed`,"drawer.scheduleDefaultStop":`Goal completes or owner stops it`,"drawer.scheduleDefaultTarget":`Wake according to this Goal’s LoopX schedule.`,"drawer.scheduleEdit":`Change to every 2 hours`,"drawer.scheduleLast":`Last run`,"drawer.scheduleLocalTimezone":`Local timezone`,"drawer.scheduleNext":`Next run`,"drawer.scheduleNeverRun":`Not run yet`,"drawer.scheduleNotification":`Notification`,"drawer.schedulePause":`Pause`,"drawer.schedulePending":`Waiting for schedule`,"drawer.scheduleResume":`Resume`,"drawer.scheduleRunNow":`Run now`,"drawer.scheduleStop":`Stop {kind}`,"drawer.scheduleStopCondition":`Stop condition`,"drawer.scheduleTimezone":`Timezone`,"drawer.sessionRecoverable":`Resumable`,"drawer.sessionStatus":`Session status`,"drawer.setupHeartbeat":`Set up Heartbeat`,"drawer.taskActions":`Pending Todo actions`,"drawer.taskAdvancement":`Advancement task`,"drawer.taskBlock":`Mark blocked`,"drawer.taskComplete":`Mark complete`,"drawer.taskCompletedNote":`This task is retained as a read-only record.`,"drawer.taskCompletedTitle":`Task completed`,"drawer.taskDefer":`Defer`,"drawer.taskDeferCondition":`Todo defer resume condition`,"drawer.taskDeferInvalid":`Unsupported condition format; use one of the deterministic conditions below.`,"drawer.taskDeferPlaceholder":`For example, resume_at:2026-09-14T09:00:00+08:00`,"drawer.taskDeferReview":`Review defer`,"drawer.taskDeferSupported":`Supports todo_done, pr_merged, capacity_available, and timezone-aware resume_at conditions.`,"drawer.taskDeferUntil":`Defer until`,"drawer.taskDetails":`Todo details`,"drawer.taskInfo":`Task information`,"drawer.taskManage":`Manage task`,"drawer.taskNextCompleted":`Create a follow-up task`,"drawer.taskNextOpen":`Advance or update status`,"drawer.taskOrdinary":`Task`,"drawer.taskStatusBlocked":`Blocked`,"drawer.taskStatusDeferred":`Deferred`,"drawer.resumeWhen":`Resume condition`,"drawer.resumeState":`Resume state`,"drawer.resumePending":`Waiting for condition`,"drawer.resumeReady":`Ready to resume`,"drawer.resumeReceipt":`Resume receipt`,"drawer.taskNextDeferred":`Wait for the resume condition, then reassess`,"drawer.taskNextResumeReady":`Resume condition met; awaiting lifecycle replan`,"drawer.taskStatusCompleted":`Completed`,"drawer.taskStatusOpen":`Ready`,"drawer.taskSuccessor":`Create follow-up Todo`,"drawer.taskSuccessorNote":`Owner marked this blocked while waiting for more context.`,"drawer.taskSuccessorSummary":`Create follow-up Todo: {task}`,"drawer.taskSuccessorText":`Follow-up work for {task}`,"drawer.taskType":`Task type`,"drawer.topic":`Topic`,"drawer.trigger":`Trigger`,"drawer.titleAttention":`Needs you`,"drawer.titleOutput":`Output details`,"drawer.titleProposalApplied":`Execution result`,"drawer.titleProposalConfirm":`Confirm execution`,"drawer.titleSchedule":`Scheduled check`,"drawer.unconfigured":`Not configured`,"drawer.workspaceCandidates":`Available workspaces`,"files.emptySummary":`Public-safe output`,"files.empty":`No files, outputs, or verified reports yet.`,"files.loadingReports":`Loading verified milestone reports…`,"files.reportDelta":`+{added} added · {changed} changed`,"files.reportAdded":`added`,"files.reportChanged":`changed`,"files.reportGeneration":`Generation`,"files.reportLoadFailed":`Could not load verified reports`,"files.reportPublication":`Publication`,"files.title":`Files & Outputs`,"files.verifiedReport":`Verified milestone report`,"header.agentUnavailable":`Unavailable`,"header.chatRuntime":`Chat`,"header.workAgentCount":`{count} work Agents`,"header.overview":`Overview`,"header.chat":`Chat`,"header.files":`Files`,"header.goalCapabilities":`Capability settings`,"header.goalCapabilitiesDescription":`Manage overrides and inherited machine defaults.`,"header.goalDetails":`Goal details`,"header.goalDetailsDescription":`Review status, usage, repository, notifications, and sessions.`,"header.goalSettings":`Goal settings`,"header.goalSettingsDescription":`Configure this Goal’s capabilities`,"header.goalNavigation":`Goal navigation`,"header.goalView":`Goal view`,"header.live":`Live`,"header.manager":`LoopX Manager`,"header.managerDescription":`Your personal workspace across Goals`,"header.managerRuntime":`{profile} · {sandbox}`,"header.managerRuntimeFallback":`Configuration invalid; fell back to {profile} · {sandbox}. Repair it in Machine capabilities.`,"header.managerExecutorKindIndividual":`individual CLI login`,"header.managerExecutorKindManaged":`operator credential`,"header.managerExecutorKindRegistered":`registered endpoint`,"header.managerExecutionUnavailable":`Selected {executor} cannot start here; this channel does not fall back to an individual CLI login.`,"header.managerExecutionUnavailableCredential":`Selected {executor} needs the operator credential {credential} before this channel can start it.`,"header.managerExecutionUnavailableRuntime":`Selected {executor} cannot start here because its runtime is not installed on this machine.`,"header.managerExecutionUnavailableEffort":`Selected {executor} rejected the configured reasoning effort; set a supported effort and reload.`,"header.managerEndpointStewardDefault":`Runs {executor}, the steward channel's shipped default. Select an executor explicitly to move it.`,"header.managerOverview":`Overview`,"header.managerView":`Manager view`,"header.openGoalNavigation":`Open Goal navigation`,"header.readOnlySourceDescription":`{source} is displayed read-only through an SSH tunnel`,"header.refresh":`Refresh status`,"header.refreshDone":`Updated just now`,"header.refreshFailed":`Refresh failed`,"header.refreshing":`Refreshing`,"header.selectAgent":`Select Agent`,"header.selectChatRuntime":`Select chat runtime`,"header.tasks":`Tasks`,"header.themeBrutal":`Switch to brutal theme`,"header.themePaper":`Switch to default theme`,"home.blockingSummary":`{count} are blocking an Agent.`,"home.completedGoals":`Completed Goals`,"home.empty":`Nothing here`,"startup.goalLoading":`Loading status…`,"startup.goalError":`Could not load status`,"startup.progress":`{loaded} of {total} active Goals loaded`,"startup.partial":`Goal states are updating. Counts are incomplete.`,"startup.independent":`Other Goals remain available while this Goal loads.`,"startup.error.timeout":`The request timed out. Retry when the local service is ready.`,"startup.error.network":`The connection was interrupted. Retry to reconnect.`,"startup.error.service":`The Goal status could not be read. Retry later; if the problem continues, check the status source.`,"startup.error.access":`The status source cannot access files or runtime directories required for this Goal. Check the permissions of the account running that source, then retry.`,"startup.error.revision":`The Goal directory changed during loading. Refresh to synchronize.`,"startup.error.scope":`This Goal is no longer available in the selected source. Refresh the directory.`,"startup.error.invalid":`The status response could not be read. Refresh or check for a LoopX update.`,"startup.retry":`Retry`,"startup.retryFailed":`Retry failed Goals`,"startup.failedCount":`{count} Goals could not be loaded. Ready Goals remain available.`,"home.greeting":`Hi, I’m your LoopX Manager`,"home.history":`History`,"home.lane.needsYou":`Needs you`,"home.lane.needsYouDescription":`Waiting for your decision, authorization, or context`,"home.lane.observing":`Observing`,"home.lane.observingDescription":`Monitoring continuously and notifying you when something changes`,"home.lane.running":`Running`,"home.lane.runningDescription":`Agents are making progress and reporting back`,"home.lane.scheduled":`Scheduled`,"home.lane.scheduledDescription":`Queued until its time or prerequisite arrives`,"home.noActivity":`No activity yet`,"home.noFirstActivity":`Waiting for first activity`,"home.noCompletedGoals":`No completed Goals yet`,"home.preservedState":`State is preserved and can be resumed`,"home.stopped":`Stopped`,"home.systemHealth":`System health: {summary}`,"home.taskCount":`{count} Tasks`,"home.todayAt":`Today {time}`,"home.waitingCount":`You have {count} items to handle.`,"home.workspace":`Goal workspace`,"lark.allMessages":`All messages in this topic`,"lark.allTopicMessages":`All topic messages`,"lark.agentIngress":`Agent ingress`,"lark.agentAppPermissions":`Every selected Agent needs a Lark App that is ready for group mentions and replies.`,"lark.agentApps":`Lark App per Agent`,"lark.agentAppsDescription":`The default App is preselected. Assign a different compatible App when an Agent needs its own bot identity.`,"lark.agentAppSelection":`Lark App for {agent}`,"lark.appCreated":`App created`,"lark.appCreateFailed":`Creation failed`,"lark.appLoading":`Loading available Lark Apps…`,"lark.appPermissions":`This App can send connection messages, but lacks the bot permissions required to receive group mentions or reply automatically. Enable im:message.group_at_msg:readonly, im:message.send_as_bot, and the im.message.receive_v1 event, publish a new version, then refresh.`,"lark.appProfile":`Lark App`,"lark.apps":`Lark Apps`,"lark.autoReplyUnavailable":`Auto reply unavailable`,"lark.autoReplyReady":`Auto reply ready`,"lark.bindGoal":`Bind to Goal`,"lark.cancel":`Cancel`,"lark.cardinality":`One Lark App · many Goals · one isolated route per Agent`,"lark.capture":`Capture`,"lark.captureAddressed":`Only messages that mention or reply to the App`,"lark.captureAll":`All messages in this Goal topic`,"lark.captureScope":`Capture scope`,"lark.captureScopeDescription":`Controls which Topic messages enter LoopX without expanding Agent permissions.`,"lark.closeConnection":`Close connection dialog`,"lark.closeCreate":`Close create dialog`,"lark.closeSettings":`Close Lark settings`,"lark.connect":`Connect`,"lark.connectAllAgents":`Connect every registered Agent`,"lark.connectAllAgentsAction":`Connect {count} Agents`,"lark.connectAllAgentsDescription":`Create {count} isolated Agent Topics in one guided action. Send requests inside the matching Topic; each Agent keeps its own route and inbox.`,"lark.connectApp":`Connect Lark App`,"lark.connection":`Connection`,"lark.connections":`Connections`,"lark.configuration":`Lark configuration`,"lark.continueFeishu":`Continue in Feishu`,"lark.createAutomatically":`Create Goal topic automatically`,"lark.createAutomaticallyDescription":`A dedicated, Agent-labelled Topic will be created for every selected Agent.`,"lark.defaultAgentAppDescription":`Used to find the target group and as the default for every selected Agent. Per-Agent choices below override it.`,"lark.description":`Manage reusable Lark Apps and connect group chats to Goals through dedicated topics.`,"lark.editConnection":`Edit Lark Connection`,"lark.goalConnections":`{count} Goal connections`,"lark.goalTopicConnections":`Lark Goal Topic connections`,"lark.groupChat":`Group chat`,"lark.groupEmpty":`This bot has not joined a group that can be connected. Add it to a Feishu group first, then return to refresh or search.`,"lark.groupLoading":`Reading groups joined by this bot…`,"lark.groupSearch":`Search groups joined by this bot`,"lark.historyPermission":`Group-history permission (separate capability)`,"lark.health.contextCaptured":`Group context captured`,"lark.health.contextCapturedDetail":`The message is retained as non-authoritative context. It did not start or steer a Manager turn; send a direct @ mention or verified reply when action is required.`,"lark.health.eventProcessed":`{events} events processed, {replies} replies sent.`,"lark.health.eventUnverified":`Event subscription needs verification`,"lark.health.eventUnverifiedDetail":`The provider listener is ready, but no event has arrived. Enable im.message.receive_v1 and group mention permissions, publish a new version, then send a new @ mention inside this Agent Topic. Group-level messages fail closed when multiple Agent routes exist.`,"lark.health.ignoredSelf":`The bot’s own message was ignored to prevent duplicate replies.`,"lark.health.invalidRouting":`Invalid routing configuration`,"lark.health.invalidRoutingDetail":`The connection was safely disabled. Select a processing mode again and save.`,"lark.health.lastStatus":`Latest event status: {status}`,"lark.health.listening":`Listening`,"lark.health.messageContextPermission":`Message permission required`,"lark.health.messageContextPermissionDetail":`A message event arrived, but group context could not be read. Publish and authorize group message read access for this App.`,"lark.health.notAddressed":`Latest message did not directly @ the bot`,"lark.health.notAddressedDetail":`Listening is healthy. This connection only responds to direct @ mentions or replies to the bot.`,"lark.health.notStarted":`Listener not started`,"lark.health.notStartedDetail":`Refresh the connection or restart LoopX, then try again.`,"lark.health.processingFailed":`Message processing failed`,"lark.health.processingFailedDetail":`The message event arrived, but Agent processing failed. Review local diagnostics and retry.`,"lark.health.queued":`Queued in the Agent inbox`,"lark.health.queuedDetail":`The message will be processed asynchronously by {agent} without starting a general Chat Session.`,"lark.health.sourceDisconnected":`Event connection disconnected`,"lark.health.sourceDisconnectedDetail":`The event consumer exited unexpectedly. Check that the app profile uses Feishu for Feishu apps or Lark for international Lark, then inspect connection and subscription errors. LoopX is retrying; successful history queries do not prove live delivery.`,"lark.health.retrying":`Retrying listener`,"lark.health.retryingDetail":`Event listening was interrupted and LoopX is retrying automatically.`,"lark.health.routeAmbiguous":`Message matches multiple Goals`,"lark.health.routeAmbiguousDetail":`The same bot and group have multiple full-group capture connections. Use a separate bot for each Agent or keep only one full-group connection.`,"lark.health.routeMismatch":`Message did not match this Goal Topic`,"lark.health.routeMismatchDetail":`The event came from another group or Topic. Reconnect this Goal to the correct group, then send a new @ mention.`,"lark.health.routeUnavailable":`Message cannot be routed to the Goal`,"lark.health.routeUnavailableDetail":`Connection data is incomplete. Reconnect this Goal, then send a new @ mention.`,"lark.health.starting":`Starting`,"lark.health.startingDetail":`LoopX is starting message event listening for this App.`,"lark.health.unavailable":`Auto reply unavailable`,"lark.health.waiting":`Waiting`,"lark.incomingMessages":`Incoming messages`,"lark.ingressAsync":`Async inbox`,"lark.ingressAsyncDescription":`Write to the Agent private inbox for a later explicit drain.`,"lark.editPreservesIdentity":`Saving preserves this App, group and Topic. Old connections upgrade to the Agent inbox by default.`,"lark.conversationKind":`Connection purpose`,"lark.managerConversation":`Manager · live conversation`,"lark.workerConversation":`Worker Agent · background tasks`,"lark.managerConversationDescription":`The built-in manager responds as you chat and delegates long-running work to background Agents. Group and private conversations keep separate histories.`,"lark.ingressLegacy":`Upgrade available`,"lark.ingressLegacyDescription":`Save this connection to upgrade to the Agent inbox. Existing messages remain in the same Topic.`,"lark.ingressQueue":`Queuing`,"lark.ingressQueueDescription":`Enter the same Agent Session's bounded FIFO queue and run after the current Turn.`,"lark.ingressSteering":`Steering`,"lark.ingressSteeringDescription":`Deliver to the active Turn and reject safely when no exact active Turn exists.`,"lark.loading":`Loading Lark configuration…`,"lark.management":`Lark management`,"lark.openEventSettings":`Open Feishu event settings`,"lark.mentions":`Mentions`,"lark.mentionsOnly":`Mentions only`,"lark.needsMessagePermissions":`Needs message permissions`,"lark.needsSetup":`Needs setup`,"lark.newApp":`New Lark App`,"lark.noAgentConfigured":`No Agent configured`,"lark.noConnections":`No matching connections.`,"lark.noProfiles":`No lark-cli App profiles are available yet.`,"lark.profileName":`Profile name`,"lark.profileValidation":`Profile can contain only letters, numbers, periods, underscores, and hyphens.`,"lark.processing":`Processing`,"lark.region":`Region`,"lark.registerAnother":`+ Register another Lark App — Create through Feishu`,"lark.reopenFeishu":`Reopen Feishu`,"lark.settingsConfigure":`Configure {goal}`,"lark.settingsDisconnect":`Disconnect {goal}`,"lark.replyMode":`Reply mode`,"lark.replyModeDescription":`Replies are limited to the source Topic to prevent cross-group or cross-Goal delivery.`,"lark.reusableApps":`{count} reusable Apps`,"lark.reusableWorkspaceApp":`Reusable workspace App`,"lark.routesUnverified":`{count} Lark routes pending verification`,"lark.saveConnection":`Save connection`,"lark.searchConnections":`Search Lark connections`,"lark.searchPlaceholder":`Search Apps, groups, Goals, or topics`,"lark.setupCopy":`LoopX opens the official Feishu creation page through lark-cli. App credentials stay in the system Keychain; LoopX stores only the profile reference.`,"lark.someoneMentions":`Someone mentions the Agent`,"lark.targetAgent":`Target Agent`,"lark.targetAgentDescription":`Choose a registered Agent in this Goal. This connection delivers to one Agent; it does not broadcast or grant permissions. Steering and Queuing require that Agent's exact active Session.`,"lark.agentUnavailable":`{agent} · no longer available`,"lark.selectRegisteredAgent":`Select an available registered Agent before connecting. The previous Agent will not be replaced automatically.`,"lark.topicPreview":`Topic preview`,"lark.topicReply":`Topic reply`,"lark.trigger":`Trigger`,"lark.waitingFeishu":`Waiting for Feishu`,"lark.waitingFeishuDescription":`Complete Feishu authorization in the new window. This page updates automatically when it is ready.`,"lark.waitingLink":`Generating the official Feishu creation link…`,"lark.error.appCreate":`Lark App creation failed`,"lark.error.appRequired":`Select a Lark App profile.`,"lark.error.bind":`Connection failed`,"lark.error.bindPreview":`Connection preview failed`,"lark.error.configuration":`Could not load Lark configuration`,"lark.error.groupLookup":`Could not read groups joined by this bot. Check the bot status and try again.`,"lark.error.groupLoad":`Could not load group chats`,"lark.error.invalidApp":`The Lark App profile is unavailable or has not completed authorization.`,"lark.error.messagePermissions":`This App lacks the bot permissions required for automatic replies. Enable im:message.group_at_msg:readonly and im:message:send_as_bot, publish a new version, then refresh.`,"lark.error.provider":`The Feishu API call failed without a verified receipt. Try again later.`,"lark.error.setupPoll":`Could not read creation status`,"lark.error.setupStart":`Could not start Lark App creation`,"lark.error.cliExecutable":`The configured lark-cli was found but cannot run. Check the installation or launch arguments.`,"lark.error.cliMissing":`lark-cli was not found. Install lark-cli and restart LoopX.`,"lark.error.cliStart":`lark-cli failed to start. Check the installation and restart LoopX.`,"lark.error.disconnect":`Disconnect failed`,"notifications.autoNotify":`Send automatically when your confirmation is required`,"notifications.bind":`Bind notification group`,"notifications.bindConfirm":`Bind “{goal}” to “{target}”. LoopX will verify that the bot is in the group and send a confirmation message.`,"notifications.bindFailed":`Binding failed`,"notifications.bound":`Bound`,"notifications.confirmBind":`Confirm binding`,"notifications.description":`Send Goal changes that need your confirmation to a Feishu group. Bindings and automatic delivery use the existing channel.`,"notifications.disabled":`Disabled`,"notifications.group":`Notification group: {target}`,"notifications.loadFailed":`Could not load notification groups`,"notifications.noTargets":`No notification groups are available. Group delivery uses a private bot identity; configure one from the terminal first:`,"notifications.notBound":`Not bound`,"notifications.recent":`Latest {time}`,"notifications.sentCount":`{count} sent`,"notifications.settings":`Goal notification bindings`,"notifications.setupFailed":`Could not update settings`,"notifications.title":`Feishu group notifications`,"proposal.field.agentId":`Agent`,"proposal.field.cadence":`Frequency`,"proposal.field.completionCriteria":`Completion criteria`,"proposal.field.executionBoundary":`Execution boundary`,"proposal.field.goalId":`Goal ID`,"proposal.field.heartbeat":`Heartbeat`,"proposal.field.initialTodos":`Initial tasks`,"proposal.field.objective":`Objective`,"proposal.field.operation":`Operation`,"proposal.field.operationState":`Operation state`,"proposal.field.resultDelivery":`Result delivery`,"proposal.field.confirmationBoundary":`Confirmation boundary`,"proposal.field.expiresAt":`Expires at`,"proposal.field.permission":`Permission`,"proposal.field.reason":`Reason`,"proposal.field.stopCondition":`Stop condition`,"proposal.field.target":`Check target`,"proposal.field.timezone":`Timezone`,"proposal.field.title":`Title`,"proposal.field.workspace":`Execution workspace`,"actionReview.targetChanged":`The preview target does not match the requested Goal and operation. Generate a new preview.`,"actionReview.ready_stop":`Pausing is reversible. This validated preview can apply directly; completion still requires verified readback.`,"actionReview.resume_review":`Review before restoring automatic scheduling. Quota, gates and Todo constraints still apply.`,"actionReview.delete_review":`Review removal of this stopped Goal from the registries. Project files and history are preserved.`,"actionReview.action_review":`Review the target and impact before applying this proposal.`,"actionReview.protected_action":`This action needs explicit review. Confirmation cannot replace required authority.`,"actionReview.unknown_permission":`The permission classification is not recognized. Recheck the proposal before continuing.`,"actionReview.unknown_action":`This lifecycle operation is not recognized. Recheck the proposal before continuing.`,"actionReview.incomplete_proposal":`The preview is missing validation or an available apply transition. Generate a new preview.`,"actionReview.authority_gate":`A gate prevents execution. Resolve its requirements, then recheck the proposal.`,"actionReview.stale_proposal":`The source state changed. Generate a new preview; the previous decision no longer applies.`,"actionReview.apply_pending":`Execution is in progress. Wait for its result before retrying.`,"actionReview.readback_verified":`The action completed and its resulting state was verified.`,"actionReview.readback_unverified":`The action returned without verified readback. Completion is not confirmed; recheck the state.`,"actionReview.operation_group_confirmation":`This exact request can only be confirmed on its original card in the bound Feishu group. The Dashboard does not expose a local execution control.`,"actionReview.operation_result_delivery_pending":`The operation outcome was recorded, but the original group result card has not passed readback verification yet.`,"drawer.recoverEditResult":`Recover edit result`,"drawer.retryOriginal":`Retry original operation`,"actionReview.canonical_update_retry":`The edit is not yet verified. Retry this operation to recover its result.`,"actionReview.canonical_update_projection_pending":`The edit was committed; display delivery is pending. Retry this operation to restore the current view.`,"actionReview.apply_failed":`Execution did not complete. Check the failure and regenerate the preview before retrying.`,"actionReview.inactive_proposal":`This proposal is no longer ready to execute. Recheck it before continuing.`,"proposal.gate.default":`Host confirmation required`,"proposal.impact.default":`After confirmation, the canonical LoopX service will write the state change.`,"proposal.impact.goalCreate":`After confirmation, LoopX will create the Goal and its initial Todo, then let the selected Agent start the first run.`,"proposal.impact.lifecycleDelete":`After confirmation, this stopped Goal is removed from the source and global registries. Project files, history state, and backups are preserved.`,"proposal.impact.lifecycleResume":`After confirmation, the Goal becomes eligible for automatic scheduling and returns to Active Goals. Actual execution still follows quota, Gate, and Todo constraints.`,"proposal.impact.lifecycleStop":`After confirmation, automatic progress stops and the Goal moves to the collapsed Stopped list. History, Todos, and evidence remain available for resuming.`,"proposal.impact.protected":`This action must be completed through the protected LoopX write service.`,"proposal.impact.operation":`The exact terms are read-only here. Confirm or reject the same immutable request in the bound Feishu group; confirmation consumes one canonical claim.`,"proposal.primary.apply":`Confirm and apply`,"proposal.primary.goalCreate":`Create Goal and start first run`,"proposal.primary.lifecycleDelete":`Delete Goal`,"proposal.primary.lifecycleResume":`Resume Goal`,"proposal.primary.lifecycleStop":`Stop Goal`,"proposal.primary.todoStart":`Create task and start execution`,"proposal.primary.operationGroup":`Confirm in Feishu group`,"proposal.primary.operationResultPending":`Result card delivery pending`,"proposal.primary.operationResultVerified":`Verified result`,"proposal.resultDelivery.verified":`Verified in the original group card`,"proposal.resultDelivery.pending":`Pending verified return to the original group card`,"proposal.summary.goalCreate":`Create Goal: {title}`,"proposal.summary.heartbeat":`Set a Heartbeat for the current Goal`,"proposal.summary.lifecycleDelete":`Delete Goal: {title}`,"proposal.summary.lifecycleResume":`Resume Goal: {title}`,"proposal.summary.lifecycleStop":`Stop Goal: {title}`,"proposal.summary.monitor":`Create a scheduled check for the current Goal: {target}`,"proposal.teamPlan.gapReason.capabilityNotGranted":`Required capability not granted`,"proposal.teamPlan.gapReason.audienceNotAuthorized":`Required access not authorized`,"proposal.teamPlan.pending":`Pending`,"proposal.teamPlan.assignedHint":`Assignment recorded. See the Goal for execution progress.`,"proposal.teamPlan.recoveredHint":`No new tasks created. See the Goal for current progress.`,"proposal.teamPlan.originalPlan":`View original plan`,"proposal.teamPlan.viewResult":`View result`,"proposal.teamPlan.openGoal":`Open Goal`,"proposal.teamPlan.resultTitle":`Assignment result`,"proposal.teamPlan.retry":`Retry assignment`,"proposal.teamPlan.retryHint":`Retry this assignment to recover its result without duplicating tasks.`,"proposal.summary.teamPlan":`Assign {count} tasks for {goal}`,"proposal.impact.teamPlan":`Confirm to assign the ready tasks. Unavailable assignments stay pending.`,"proposal.primary.teamPlan":`Confirm assignment`,"proposal.field.laneGaps":`Unstaffed lanes`,"proposal.field.quotaEnvelope":`Quota envelope`,"proposal.teamPlan.acceptanceShort":`acceptance reference`,"proposal.teamPlan.advisory":`planning context; not enforced by this confirmation`,"proposal.teamPlan.appliedPartially":`{created} assigned · {gaps} pending`,"proposal.teamPlan.appliedAlreadyPresent":`Original assignment recovered`,"proposal.teamPlan.applied":`{count} tasks assigned`,"proposal.teamPlan.gapLane":`unstaffed`,"proposal.teamPlan.laneUnstaffed":`staffing gap, no first Todo`,"proposal.teamPlan.gapReason.agentNotRegistered":`the Agent is not registered for this Goal`,"proposal.teamPlan.gapReason.actionKindNotSupported":`this host does not ship that action kind`,"proposal.workspace.current":`Current local workspace (no Repository bound)`,"proposal.workspace.named":`{workspace} (execution environment only; does not bind a repository)`,"proposal.workspaceGate.agentImpact":`Bind an Agent identity, then recheck the original action. No Goal has been written.`,"proposal.workspaceGate.agentTitle":`Bind an Agent first`,"proposal.workspaceGate.defaultSummary":`Select the Goal workspace.`,"proposal.workspaceGate.selectionImpact":`After selecting a workspace, LoopX will show the confirmation preview again. The selection itself does not write state.`,"proposal.workspaceGate.selectionTitle":`Select Goal workspace`,"projection.agentAdvancingGoal":`Agent is advancing the current Goal`,"projection.agentIdle":`Nothing needs your attention`,"projection.agentNeedsDecision":`Agent is waiting for your decision`,"projection.agentPreparingNextStep":`Agent is preparing the next step`,"projection.agentStopped":`Stopped by you; history, Todos, and evidence are preserved`,"projection.agentWaitingExternal":`Waiting for an external condition`,"projection.confirmAgentDecision":`Confirm the permission or decision the Agent needs next`,"projection.events24h":`{count} events in the last 24 hours`,"projection.firstReadOnlyAdapterCheck":`Run the first read-only adapter check and save progress`,"projection.goalVerified":`Goal state, Todos, and registration information verified`,"projection.latestRun":`Latest run`,"projection.latestValidation":`Latest validation`,"projection.nextUpdatePending":`Waiting for LoopX to update the next step`,"projection.publicSafeProjection":`Public-safe status projection`,"projection.refreshState":`Refresh LoopX status and confirm the current progress is still valid`,"projection.runEvidenceAvailable":`Run evidence is available`,"projection.runRecorded":`The latest LoopX run is recorded`,"projection.statusRefreshNeeded":`LoopX status needs to be refreshed`,"projection.todoStatusUpdated":`Todo status updated; confirming the next step`,"projection.validationRecorded":`The latest validation is recorded`,"runs.completed":`Completed`,"runs.failed":`Needs review`,"runs.interrupted":`Interrupted`,"runs.queued":`Scheduled`,"runs.ready":`Ready`,"runs.resumeFailed":`Recovery failed`,"runs.running":`Running`,"runs.unknown":`Unknown`,"runs.waiting":`Waiting`,"schedule.active":`Running`,"schedule.heartbeat":`Goal Heartbeat`,"schedule.monitor":`Scheduled & continuous task`,"schedule.paused":`Paused`,"schedule.summary":`Continuously checked under LoopX scheduling constraints`,"schedule.defaultTarget":`Check the current Goal for blockers, progress, and new outputs`,"schedule.unsupportedCalendar":`Scheduled checks do not currently support an exact weekday or time. Use a fixed interval such as “Every 30 minutes,” “Every 2 hours,” or “Daily.” The draft was preserved and no confirmation preview was created.`,"source.add":`Add source`,"source.addConfigured":`Add read-only source`,"source.addMethod":`Source setup method`,"source.addSsh":`Add SSH source`,"source.closeForm":`Close source form`,"source.configured":`Configured SSH`,"source.configuredCount":`Local SSH Hosts · {count}`,"source.configuredGroup":`Configured SSH Hosts · {count} (select to add)`,"source.connected":`Connected`,"source.connecting":`Connecting`,"source.controlPlane":`Control plane source`,"source.copy":`Copy`,"source.copyCommand":`Copy SSH tunnel command`,"source.copyError":`Could not copy the command. Copy it manually below.`,"source.copied":`Copied`,"source.description":`All explicit Hosts are loaded, including Include files. Wildcards are not listed. Run the command first; LoopX never reads SSH keys or configuration details.`,"source.host":`Local SSH Host`,"source.hostEmpty":`No explicit SSH Hosts are available in ~/.ssh/config.`,"source.hostLoadError":`Could not read local SSH Hosts.`,"source.hostPlaceholder":`Enter or search for a Host`,"source.invalid":`The SSH source settings are invalid.`,"source.loadingHosts":`Loading…`,"source.localInteractive":`Local interactive`,"source.localPort":`Local port`,"source.manual":`Manual URL`,"source.manualDescription":`Remote sources always remain read-only projections and never inherit local write permissions.`,"source.name":`Name`,"source.namePlaceholder":`Remote development machine`,"source.notAvailable":`Unavailable`,"source.readOnly":`SSH tunnel · read only`,"source.readOnlyNoticeDescription":`You can view Goals, Tasks, evidence, and run status. Writes, guidance, and Agent sessions remain on the source host.`,"source.readOnlyNoticeTitle":`Remote read-only projection`,"source.readOnlyWriteError":`Remote SSH tunnel sources are read-only projections and cannot perform control-plane writes.`,"source.refreshHosts":`Reload SSH Hosts`,"source.remove":`Remove source {source}`,"source.removeCurrent":`Remove current source`,"source.select":`Select control plane source`,"source.selectHost":`Select a configured SSH Host.`,"source.statusUrl":`Local forwarded URL`,"source.tunnelCommandPending":`Select a Host to generate the tunnel command`,"machine.absent":`Not configured`,"machine.action.create":`Create machine policy`,"machine.action.delete":`Remove machine policy`,"machine.action.unchanged":`No write required`,"machine.action.update":`Update machine policy`,"machine.applied":`Machine policy applied and read back successfully.`,"machine.applyError":`Machine policy could not be applied.`,"machine.applyPreview":`Apply reviewed preview`,"machine.changedNamespaces":`Changed namespaces`,"machine.capabilityCatalog":`Machine capability catalog`,"machine.capabilityEmpty":`No machine-configurable capabilities are registered.`,"machine.configured":`Configured`,"machine.confirmRollback":`Confirm rollback`,"machine.currentRevision":`Current revision`,"machine.currentValue":`Current machine value`,"machine.description":`Browse the same capability catalog as Goal settings. Configure supported machine defaults here; Goal-only capabilities are labeled explicitly.`,"capabilities.rawJson":`Advanced: raw JSON`,"machine.goalOnly":`This capability currently supports Goal configuration only. Open a Goal’s capability settings to configure it; no machine-wide default is applied.`,"machine.desiredRevision":`Desired revision`,"machine.editorUnavailable":`No editor is installed for this namespace`,"machine.editorUnavailableDescription":`The namespace remains visible in the registry. Install or upgrade its Dashboard editor before changing it.`,"machine.editorMode":`Editor mode`,"machine.liveDefault":`Live default; Goal override wins`,"machine.liveDefaultDescription":`Goals without an explicit override read the current machine policy at the capability’s next decision point. Changes and removal affect those existing Goals immediately; an explicit Goal override stays pinned.`,"machine.credentialTitle":`Operator model credential`,"machine.credentialDescription":`The key and endpoint the steward channel and the managed host authenticate with on this machine. The key is stored in its own owner-only file, never in the machine configuration that is projected here, and it is never read back — only its fingerprint is.`,"machine.credentialApiKey":`API key`,"machine.credentialApiKeyPlaceholder":`Paste a key to store it; leave blank to keep the stored one`,"machine.credentialBaseUrl":`Endpoint base URL`,"machine.credentialBaseUrlPlaceholder":`https://endpoint.example/v1 (blank keeps the endpoint default)`,"machine.credentialStore":`Store credential`,"machine.credentialClearKey":`Clear stored key`,"machine.credentialClearUrl":`Clear stored endpoint`,"machine.credentialConfigured":`configured`,"machine.credentialAbsent":`not configured`,"machine.credentialInvalid":`unreadable — repair required`,"machine.credentialSourceMachine":`this machine's stored credential`,"machine.credentialSourceEnvironment":`the service environment`,"machine.credentialSourceUnset":`no source`,"machine.credentialFingerprint":`fingerprint`,"machine.credentialStored":`Credential stored. The next turn uses it; no restart is needed.`,"machine.credentialCleared":`Stored credential cleared.`,"machine.credentialError":`The credential could not be stored.`,"machine.credentialBoundary":`Storing a credential grants no authority: it does not select an executor, model, or reasoning effort.`,"machine.genericNamespaceDescription":`Edit this registered namespace as JSON. LoopX validates it with the capability-owned schema before previewing any write.`,"machine.jsonConfiguration":`Namespace configuration (JSON)`,"machine.jsonConfigurationHelp":`Only this namespace is updated. Other machine configuration is preserved, and Apply remains locked to the reviewed preview revision.`,"machine.jsonEditor":`JSON`,"machine.editJson":`Edit JSON`,"capabilities.jsonConfiguration":`Goal configuration (JSON)`,"capabilities.jsonHelp":`Edit registered fields for this Goal. Changes require a new preview before applying.`,"capabilities.jsonInvalid":`Enter a valid JSON object using only registered editable fields.`,"machine.backToForm":`Back to form`,"machine.jsonInvalid":`Enter one valid JSON object before previewing changes.`,"machine.loadError":`Machine configuration could not be loaded.`,"machine.invalidStoredConfiguration":`Stored machine configuration needs repair`,"machine.invalidStoredConfigurationDescription":`Stored values are hidden because they no longer match the installed contract. Review the affected capability, then Preview and Apply its replacement; unrelated namespaces remain unchanged.`,"machine.machinePolicy":`Machine policy`,"machine.namespaceCount":`Registered namespaces`,"machine.namespaces":`Configuration namespaces`,"machine.periodicReport":`Periodic reports`,"machine.periodicReportDescription":`Default report policy for every Goal without an explicit override. Goal scheduling and delivery consume the effective configuration.`,"machine.periodicReportActivation":`Enabled means automatic delivery at validated stage boundaries`,"machine.periodicReportActivationDescription":`This is not a weekly timer. When LoopX validates a Goal stage completion, an Agent prepares and freezes the report, then automatically delivers it through the configured Goal Channel. The enabled subscription is standing delivery authority; failures and route drift stop closed for repair.`,"machine.changeQualityActivation":`Qualification is a quality gate, not new authority`,"machine.changeQualityActivationDescription":`Goals that inherit this policy qualify their exact final diff. safe_fix allows at most one bounded fix pass inside existing write authority; this setting never grants file, permission, or merge authority.`,"machine.replanCadenceActivation":`Review cadence changes timing, not execution authority`,"machine.replanCadenceActivationDescription":`Goals without an explicit override read this threshold before the next review decision. It does not create Turns, spend quota, or grant authority.`,"machine.preview":`Review exact machine change`,"machine.previewChanges":`Preview changes`,"machine.previewError":`A machine-policy preview could not be created.`,"machine.previewLocked":`Apply is locked to this exact revision. If machine state changes, LoopX requires a new preview.`,"machine.previewRollback":`Preview rollback`,"machine.previewRemoval":`Preview removal`,"machine.profilePreset":`Profile preset`,"machine.profilePresetHelp":`A capability-owned preset, such as weekly-progress.`,"machine.registry":`Typed registry`,"machine.requiredFields":`Enable requires a profile preset, Goal Channel route, and valid timezone.`,"machine.revision":`Machine revision`,"machine.revisionLockedReady":`All changes require a preview and apply only while that exact machine revision remains current.`,"machine.rollbackAvailable":`Rollback is available for the last apply`,"machine.rollbackDescription":`Preview the stored prior revision before restoring it.`,"machine.rollbackError":`The rollback could not be completed.`,"machine.rollbackPreviewDescription":`The prior revision is ready to restore. Confirm to apply this rollback.`,"machine.rolledBack":`The prior machine policy was restored and verified.`,"machine.removed":`Machine policy removed and the resulting configuration read back successfully.`,"machine.routeRef":`Goal Channel route`,"machine.routeRefHelp":`Use a public route alias; credentials and provider identifiers never enter this form.`,"machine.timezone":`Timezone`,"machine.timezoneHelp":`Use an IANA timezone, for example Asia/Shanghai.`,"machine.title":`Machine configuration`,"machine.unchanged":`Machine policy already matches this preview; nothing was written.`,"machine.visualEditor":`Guided`,"capabilities.atomicOverride":`Goal override is atomic`,"capabilities.atomicOverrideDescription":`A complete Goal value wins over the machine default. LoopX never mixes individual fields across scopes.`,"capabilities.applyFailed":`Goal capability changes were not applied.`,"capabilities.applyPreview":`Apply preview`,"capabilities.catalog":`Goal capability catalog`,"capabilities.chooseGoal":`Choose a Goal before inspecting its capabilities.`,"capabilities.defaultValue":`Declared default`,"capabilities.description":`Inspect the capabilities available to this Goal and the exact scope of each setting.`,"capabilities.editorPrepared":`Typed editor contract available`,"capabilities.effectiveSource":`Effective source`,"capabilities.empty":`No capability descriptors are available for this Goal.`,"capabilities.fields":`Registered fields`,"capabilities.goalPolicy":`Goal capability policy`,"capabilities.goalScope":`Goal`,"capabilities.goalValue":`Current Goal value`,"capabilities.loadFailed":`Could not load Goal capabilities`,"capabilities.larkInboxNotificationDescription":`This switch controls automatic group messages for human gates. Incoming Lark events remain available when it is off.`,"capabilities.larkInboxNotificationSetting":`Human-gate group notifications`,"capabilities.loading":`Loading Goal capabilities…`,"capabilities.machineOnly":`This capability is configured only at machine scope.`,"capabilities.machineValue":`Live machine default`,"capabilities.machineScope":`Machine`,"capabilities.previewOnly":`Inspection is live. Goal writes remain unavailable until the revision-locked preview and apply path is connected.`,"capabilities.preview":`Revision-locked preview`,"capabilities.previewChanges":`Preview changes`,"capabilities.restoreInheritance":`Restore machine-default inheritance`,"capabilities.previewFailed":`Could not preview Goal capability changes.`,"capabilities.previewLocked":`Apply will re-check this exact plan revision and reject stale changes.`,"capabilities.partialWrite":`Goal value saved; shared projection needs reconciliation`,"capabilities.partialWriteDescription":`The source Goal configuration was written and read back. Its shared runtime projection did not synchronize, so do not submit the change again.`,"capabilities.refreshSource":`Refresh source value`,"capabilities.readOnly":`Read-only capability`,"capabilities.revisionLockedReady":`Changes require a preview and are applied only when its exact revision is still current.`,"capabilities.retry":`Retry`,"capabilities.source.capability_default":`Capability default`,"capabilities.source.goal_override":`Goal override`,"capabilities.source.machine_default":`Live machine default`,"capabilities.source.not_configured":`Not configured`,"capabilities.title":`Goal capabilities`,"settings.close":`Close settings`,"settings.appearance":`Appearance`,"settings.appearanceDescription":`Manage workspace display preferences in this browser.`,"settings.appearanceTabDescription":`Theme and display preferences`,"settings.capabilitiesTabDescription":`Capability overrides for this Goal`,"settings.back":`Back to workspace`,"settings.categories":`Settings categories`,"settings.description":`Manage workspace preferences and integrations.`,"settings.eyebrow":`Workspace preferences`,"settings.general":`General`,"settings.goalConnections":`Goal connections`,"settings.language":`Language`,"settings.modelProvider":`Model provider`,"settings.globalCapabilities":`Global capabilities`,"settings.languageDescription":`Choose the language used by the LoopX desktop workspace.`,"settings.languageEnglishDescription":`Use English for navigation, settings, and workspace controls.`,"settings.languageEnglish":`English`,"settings.languageSimplifiedChineseDescription":`Use Simplified Chinese for navigation, settings, and workspace controls.`,"settings.languageSimplifiedChinese":`Simplified Chinese`,"settings.languageStoredLocally":`This preference is stored only on this device.`,"settings.languageTabDescription":`Interface language for this device`,"settings.larkTabDescription":`Apps, group chats, and Goal Topic connections`,"settings.machineTabDescription":`Typed defaults shared by capabilities on this machine`,"settings.notifications":`Notifications`,"settings.open":`Settings`,"settings.themeDefault":`Paper`,"settings.themeDefaultDescription":`Calm and lightweight for long-running work.`,"settings.themeDescription":`Choose the workspace visual style. This preference is stored in the current browser.`,"settings.themeHighContrast":`High contrast`,"settings.themeHighContrastDescription":`Stronger borders and more prominent state blocks.`,"settings.themeLoopx":`LoopX standard`,"settings.themeLoopxDescription":`Precise monochrome surfaces, Geist type, and quiet hairline structure.`,"settings.title":`Settings`,"settings.workspaceDisplay":`Workspace display`,"settings.workspaceTheme":`Workspace theme`,"session.closeRecord":`Exit run record`,"session.details":`Session details`,"session.record":`Execution Session · Run record`,"session.recordDescription":`The timeline now shows messages and Turn records from this Session.`,"sidebar.createGoal":`Create Goal`,"sidebar.delete":`Delete`,"sidebar.deleteGoal":`Delete Goal`,"sidebar.manager":`LoopX Manager`,"sidebar.notifications":`Settings`,"sidebar.owner":`Personal workspace`,"sidebar.product":`Personal Agent workspace`,"sidebar.resume":`Resume`,"sidebar.resumeGoal":`Resume Goal`,"sidebar.stop":`Stop`,"tasks.historyLoading":`Loading history…`,"tasks.historyError":`History could not be loaded.`,"tasks.historyExpired":`History snapshot expired. Reload to continue.`,"tasks.historyRetry":`Reload`,"tasks.historyEnd":`End of completed history`,"tasks.historyMore":`Load more`,"tasks.historyLocalOnly":`Open this machine’s Dashboard to browse full history.`,"sidebar.sortGoals":`Reorder Goals`,"sidebar.dragGoal":`Drag to reorder, or use Reorder Goals`,"sidebar.moveUp":`Move {goal} up`,"sidebar.moveDown":`Move {goal} down`,"sidebar.goalMoved":`{goal} moved to position {position}`,"sidebar.orderNotSaved":`Order changed for this visit; browser storage is unavailable.`,"sidebar.stopGoal":`Stop Goal`,"sidebar.stopped":`Stopped`,"sidebar.stoppedLoading":`Loading stopped Goals`,"sidebar.stoppedLoadFailed":`Stopped Goals could not be loaded. Active Goals remain available.`,"sidebar.retryStopped":`Retry`,"state.completed":`Completed`,"state.needsRepair":`Needs repair`,"state.needsYou":`Needs you`,"state.quiet":`Quiet`,"state.running":`Running`,"state.stopped":`Stopped`,"state.waiting":`Waiting`,"tasks.blocked":`Blocked`,"tasks.agentLane":`Work Agent`,"tasks.agentLaneDescription":`Filter this Goal's projected work lanes`,"tasks.agentLaneFilter":`Filter by work Agent`,"tasks.allAgentLanes":`All Agents ({count})`,"tasks.chatAgentReplied":`New conversation reply`,"tasks.chatPending":`Conversation in progress`,"tasks.chatReturn":`Collaboration receipt`,"tasks.chatPendingDescription":`Processing. Tasks update only after a task operation is confirmed.`,"tasks.chatRecent":`Recent conversation`,"tasks.chatUnchangedDescription":`This conversation did not directly change Tasks. Convert the reply to a Task draft and confirm it when execution is needed.`,"tasks.chatViewReply":`View reply`,"tasks.convertToTask":`Convert to Task`,"tasks.completed":`Completed`,"runs.discoveryPartial":`Some execution details are unavailable. Reconnecting; task summaries are not live execution status.`,"runs.discoveryOffline":`Execution service unavailable. Reconnecting; retained task summaries may be stale.`,"files.openConversation":`Go to conversation`,"files.exportSummary":`Export summary`,"tasks.viewDescription":`Decisions first, then work and recent completions`,"tasks.viewLabel":`Task view`,"tasks.listView":`List`,"tasks.boardView":`Board`,"tasks.completedSummary":`{count} tasks completed. Recent details are projected by the control plane when needed.`,"tasks.emptyCompleted":`No completed tasks yet.`,"tasks.emptyConfirm":`No tasks waiting for confirmation.`,"tasks.emptyRunning":`No queued or running tasks.`,"tasks.emptySchedules":`No scheduled tasks.`,"tasks.emptyGoal":`This Goal has no tasks yet. Describe the next step below and LoopX will show a confirmation preview first.`,"tasks.markComplete":`Mark complete: {name}`,"tasks.moreActions":`More actions: {name}`,"tasks.openExecution":`View execution: {name}`,"tasks.pending":`Pending`,"tasks.pendingAndRunning":`Queued / Running`,"tasks.scheduled":`Scheduled & continuous`,"tasks.sessionError":`Session issue`,"tasks.waiting":`Queued`,"tasks.waitingAge":`Waiting {age}`,"tasks.viewExecution":`View execution`,"tasks.viewResult":`View result`,"time.days":`{count} days`,"time.hours":`{count} hours`,"timeline.emptyGoal":`This Goal has no new activity`,"timeline.emptyGoalDescription":`Ask for progress or send new guidance.`,"timeline.emptyWorkspace":`Your workspace is quiet today`,"timeline.emptyWorkspaceDescription":`Describe a Goal to the LoopX Manager, or ask what deserves attention today.`,"timeline.gateHistory":`{count} historical Gates`,"timeline.pending":`Working…`,"returnDelivery.queued":`Return queued`,"returnDelivery.verifying":`Verifying delivery without resending`,"returnDelivery.delivered":`Delivered to the original audience`,"returnDelivery.reconciled":`Delivery verified after recovery`,"returnDelivery.unverified":`Delivery remains explicitly unverified`,"timeline.runCompleted":`{run}: completed`,"timeline.review":`Review`,"timeline.reviewAndConfirm":`Review and confirm`,"timeline.waitingConfirmation":`Needs your confirmation`},"zh-CN":{"acceptance.connected":`已连接`,"acceptance.mapped":`已建立项目映射`,"acceptance.refreshed":`已刷新状态`,"acceptance.inspected":`已检查适配器`,"acceptance.recorded":`已记录执行`,"acceptance.judged":`已记录反馈`,"acceptance.approved":`已记录批准`,"acceptance.ready":`已记录控制器就绪`,"acceptance.attentionSource":`当前状态`,"acceptance.visionSource":`Agent 验收条件`,"acceptance.todoSource":`任务状态`,"acceptance.runSource":`最新执行证据`,"acceptance.title":`验收观察`,"acceptance.unavailable":`验收观测不可用,Goal 是否达成仍未知。`,"acceptance.partial":`当前仅有部分观测。任务完成或缺口列表为空,都不能证明 Goal 已通过验收。`,"acceptance.gaps":`仍需补充的证据`,"acceptance.reasonUnknown":`来源未提供原因`,"acceptance.unknown":`未知`,"acceptance.required":`所需证据或条件`,"acceptance.observed":`观测时间`,"acceptance.noGaps":`现有观测中没有缺口,尚未评估完整验收条件。`,"acceptance.guards":`待处理的门禁决策`,"acceptance.noGuards":`现有观测中没有待处理的门禁决策。`,"acceptance.scope":`决策范围`,"acceptance.next":`当前状态给出的下一步`,"acceptance.historical_progress":`已记录的历史进展`,"acceptance.historical":`历史生命周期记录不授予权限,也不代表通过验收。`,"acceptance.missing":`未获取的来源:`,"acceptance.truncated":`仅展示前 12 条观测。`,"common.actions":`操作`,"common.agent":`Agent`,"common.allMessages":`所有消息`,"common.cancel":`取消`,"common.close":`关闭`,"common.closeActionReceipt":`关闭操作回执`,"common.confirm":`确认`,"common.export":`导出`,"common.failed":`失败`,"common.goal":`Goal`,"common.loading":`加载中…`,"common.none":`无`,"common.off":`关闭`,"common.on":`开启`,"common.open":`打开`,"common.owner":`Owner`,"common.readOnly":`只读`,"common.recently":`刚刚`,"common.status":`状态`,"common.task":`Task`,"common.you":`你`,"common.waiting":`等待中`,"composer.addImage":`添加图片`,"composer.agentProgress":`向 Agent 获取进度报告`,"composer.agentProgressPrompt":`请给我一份当前 Goal 的进度报告:已完成、执行中、阻塞和下一步。`,"composer.blockers":`看阻塞`,"composer.attachImageHint":`选择、粘贴或拖入图片`,"composer.clarifyDefer":`暂缓 Todo 需要可自动判断的恢复条件。请补充 todo_done:、pr_merged:[owner/repo]#、capacity_available: 或 resume_at:<带时区 RFC3339 时间>。`,"composer.clarifySingleAction":`这句话包含多个可能修改状态的操作。请一次描述一项操作,我会逐项展示确认预览。`,"composer.evidence":`查证据`,"composer.createGoal":`创建新 Goal`,"composer.createGoalDraft":`Goal 草稿`,"composer.createGoalDraftDescription":`补充内容后发送,LoopX 会先展示待确认操作。`,"composer.createGoalDraftLead":`我想创建一个长期 Goal:`,"composer.createGoalTemplate":`我想创建一个长期 Goal: 目标: 完成标准: 执行边界(可选): 关联仓库(可选): -通知方式(可选):`,"composer.createGoalHint":`填入 Goal 模板草稿,检查后再创建`,"composer.globalProgress":`汇总所有 Goal 进展`,"composer.globalProgressPrompt":`请帮我汇总所有活跃 Goal 的最新进展与阻塞。`,"composer.globalTasks":`询问全局待办`,"composer.globalTasksPrompt":`有哪些 Goal 正在等我?我现在该优先处理什么?`,"composer.goalMessageHint":`你的消息由 {agent} 在本 Goal 的会话中接收`,"composer.goalRunningHint":`{agent} 正在执行 {count} 个任务 · 你的消息作为纠偏进入本会话,不会打断执行`,"composer.goalPlaceholder":`询问或纠偏 {goal}…`,"composer.imageAnalysisPrompt":`请结合这些图片分析当前 Goal,并告诉我下一步。`,"composer.imageCountError":`最多添加 {count} 张图片。`,"composer.imagePicker":`图片文件选择器`,"composer.imageReadError":`无法读取图片 {name}`,"composer.imageReadGenericError":`图片读取失败。`,"composer.imageSizeError":`单张图片不能超过 {size}MB。`,"composer.imageTypeError":`支持 PNG、JPEG、WebP 和 GIF 图片。`,"composer.imagesPending":`待发送图片`,"composer.managerMessageHint":`你的消息由 LoopX 管家跨 Goal 接收,支持全局询问与创建 Goal`,"composer.managerPlaceholder":`问问 LoopX 管家,或描述一个新 Goal…`,"composer.monitor":`配置定时检查`,"composer.monitorGoalQuestion":`为哪个 Goal 添加定时检查?`,"composer.monitorTemplate":`为当前 Goal 添加定时检查: +通知方式(可选):`,"composer.createGoalHint":`填入 Goal 模板草稿,检查后再创建`,"composer.globalProgress":`汇总所有 Goal 进展`,"composer.globalProgressPrompt":`请帮我汇总所有活跃 Goal 的最新进展与阻塞。`,"composer.globalTasks":`询问全局待办`,"composer.globalTasksPrompt":`有哪些 Goal 正在等我?我现在该优先处理什么?`,"composer.goalMessageHint":`你的消息由 {agent} 在本 Goal 的会话中接收`,"composer.goalRunningHint":`本项目有 {count} 段会话正在运行 · 消息发往当前 {agent} 对话`,"composer.goalPlaceholder":`询问或纠偏 {goal}…`,"composer.imageAnalysisPrompt":`请结合这些图片分析当前 Goal,并告诉我下一步。`,"composer.imageCountError":`最多添加 {count} 张图片。`,"composer.imagePicker":`图片文件选择器`,"composer.imageReadError":`无法读取图片 {name}`,"composer.imageReadGenericError":`图片读取失败。`,"composer.imageSizeError":`单张图片不能超过 {size}MB。`,"composer.imageTypeError":`支持 PNG、JPEG、WebP 和 GIF 图片。`,"composer.imagesPending":`待发送图片`,"composer.managerMessageHint":`你的消息由 LoopX 管家跨 Goal 接收,支持全局询问与创建 Goal`,"composer.managerPlaceholder":`问问 LoopX 管家,或描述一个新 Goal…`,"composer.monitor":`配置定时检查`,"composer.monitorGoalQuestion":`为哪个 Goal 添加定时检查?`,"composer.monitorTemplate":`为当前 Goal 添加定时检查: 检查内容: 频率(支持 30 分钟 / 2 小时 / 每天):每 2 小时 停止条件:Goal 完成`,"composer.monitorShortcutTemplate":`为当前 Goal 添加定时检查: @@ -50,7 +50,7 @@ Goal: Goal: 频率:每天 停止条件:Goal 完成 -通知:仅在需要我时`,"composer.nextAction":`询问下一步`,"composer.nextActionPrompt":`我现在该做什么?`,"composer.send":`发送`,"composer.sendMessage":`向 LoopX 发送消息`,"composer.sendMessageHint":`发送消息`,"composer.sentImageAlt":`移除图片 {name}`,"conversation.agentPending":`正在整理…`,"conversation.close":`关闭对话回执`,"conversation.convertHint":`将 Agent 最新回复转为 Task 草稿`,"conversation.full":`查看完整对话`,"conversation.receipt":`对话回执`,"conversation.replying":`正在回复`,"conversation.title":`管家对话`,"conversation.toTask":`转为 Task`,"digest.away":`自上次访问以来的运行记录`,"digest.completed":`新增完成运行`,"digest.failed":`新增失败或中断`,"digest.needsYou":`当前待确认`,"feedback.applying":`正在执行:{title}`,"feedback.cancelFailed":`取消失败:{error}`,"feedback.completed":`已完成:{title}`,"feedback.executionFailed":`执行失败:{error}`,"feedback.gateRequired":`需要你确认:{summary}`,"feedback.notCompleted":`操作未完成:{status}`,"feedback.goalRefreshFailed":`已打开 Goal,但暂时无法刷新最新状态。请点击刷新重试。`,"feedback.preparingPreview":`正在准备确认预览:{title}`,"feedback.previewFailed":`无法准备确认预览:{error}`,"feedback.sendFailed":`发送失败:{error}`,"feedback.sendGenericError":`消息发送失败,请稍后重试。`,"feedback.stale":`状态已变化,操作未执行,请重新生成确认预览。`,"feedback.taskDraftCreated":`已根据回复生成 Task 草稿。编辑后发送,LoopX 会先展示确认预览。`,"goal.defaultTitle":`新的个人 Goal`,"goal.initialTodo":`按完成标准推进:{criteria}`,"goal.objectiveBoundary":`执行边界:{boundary}`,"goal.objectiveCompletion":`完成标准:{criteria}`,"drawer.advancedDiagnostics":`高级诊断`,"drawer.agentWorking":`Agent 正在继续执行,记录会自动更新。`,"drawer.analysis":`正在分析`,"drawer.apply":`确认并应用`,"drawer.applying":`正在应用…`,"drawer.attentionBlocking":`正在阻塞 Agent`,"drawer.attentionWaiting":`等待你的决定`,"drawer.autoNotify":`Human-gate 自动通知`,"drawer.branch":`分支`,"drawer.closeDetail":`关闭详情:返回{context}`,"drawer.connected":`已连接`,"drawer.correctionDescription":`消息会沿用当前 Goal、Todo 与 Agent Session 上下文。`,"drawer.correctionLabel":`与 {agent} 纠偏`,"drawer.correctionPlaceholder":`例如:先关注权限风险,暂时不要提交…`,"drawer.correctionSend":`发送纠偏`,"drawer.correctionTextarea":`输入纠偏信息:Goal {goal},Agent {agent},Run {run}`,"drawer.copyRepository":`复制仓库标识`,"drawer.copyRepositoryDone":`已复制仓库标识`,"drawer.copyRepositoryError":`复制失败,请检查浏览器剪贴板权限。`,"drawer.copyRepositorySuccess":`已复制,可粘贴到其他工具。`,"drawer.cost":`成本 24h / 7d`,"drawer.costShort":`成本`,"drawer.durationShort":`时长`,"drawer.period24h":`24 小时`,"drawer.period7d":`7 天`,"drawer.tokens":`Token 24 小时 / 7 天`,"drawer.tokensShort":`Token`,"drawer.usageNotMeasured":`未采集`,"drawer.currentGoal":`当前 Goal`,"attentionDetail.title":`事项说明`,"attentionDetail.request":`需要你做什么`,"attentionDetail.decision":`需要作出决定`,"attentionDetail.unknownRequest":`来源未明确,请先查看来源再判断`,"attentionDetail.open":`当前投影中待处理`,"attentionDetail.closed":`已关闭`,"attentionDetail.deferred":`已推迟`,"attentionDetail.superseded":`已被替代`,"attentionDetail.unknown":`来源未提供状态`,"attentionDetail.unavailable":`来源尚未确认当前事项,请刷新后再操作`,"attentionDetail.unknownReason":`来源尚未提供原因。`,"attentionDetail.targetTodo":`关联的待解锁 Todo`,"attentionDetail.targetAgent":`事项指定的 Agent`,"attentionDetail.scope":`声明的决策范围`,"attentionDetail.notProvided":`来源未提供`,"attentionDetail.replacement":`替代 Todo`,"attentionDetail.openReplacement":`打开替代事项`,"attentionDetail.boundary":`阅读详情不会关闭 gate 或授予权限;作出决定前仍需新的操作预览。`,"drawer.decisionDefaultEvidence":`当前状态没有附加公开安全证据;下一步仍会先展示 Preview。`,"drawer.decisionDefaultReason":`该决定会影响当前 Todo 的下一步执行。`,"drawer.decisionDefer":`稍后决定`,"drawer.decisionMore":`更多决定`,"drawer.decisionReject":`拒绝`,"drawer.decisionReview":`查看影响并决定`,"drawer.dependencies":`依赖`,"drawer.detailsAndActions":`详情与操作`,"drawer.duration":`运行时长 24h / 7d`,"drawer.evidence":`证据`,"drawer.executionHistory":`执行历史`,"drawer.executionRecord":`运行记录`,"drawer.executionRecordAndResult":`执行过程与结果`,"drawer.explainDecision":`解释此决定`,"drawer.gateApproveHint":`在终端执行一条命令即可完成审批:`,"drawer.gateRejectHint":`不同意就把末尾的 approve 换成 reject。执行后这条提醒会自动消失。`,"drawer.gateRequiresHost":`需要宿主确认`,"drawer.gateRequiresHostDescription":`页面无权直接批准这类权限变更,你的点击没有写入任何内容。`,"drawer.goalAutoRun":`当前 Goal 的自动运行`,"drawer.goalChanges":`当前 Goal 的待确认变更`,"drawer.goalDetails":`Goal 详情`,"drawer.group":`群聊`,"drawer.inspectorFull":`切换到全屏`,"drawer.inspectorFullView":`全屏查看`,"drawer.inspectorHalf":`切换到半屏`,"drawer.inspectorHalfView":`半屏查看`,"drawer.lastNotification":`最近通知`,"drawer.larkConfigure":`管理 Lark connection`,"drawer.larkConnect":`连接 Lark App`,"drawer.larkConnection":`Lark connection`,"drawer.larkNotConfigured":`未配置`,"drawer.larkNotConfiguredDescription":`配置后,当这个 Goal 出现需要你确认的变更时,会自动发飞书通知。`,"drawer.managerChanges":`管家待确认变更`,"drawer.moreActions":`更多操作`,"drawer.moreRunActions":`更多运行操作`,"drawer.nextTransition":`下一转换`,"drawer.noExecutionHistory":`暂无执行记录。`,"drawer.noRun":`尚未启动执行 Session`,"drawer.noRunDescription":`Agent 开始执行后,运行记录会稳定显示在这里。`,"drawer.notAssigned":`未分配`,"drawer.notLinked":`未关联`,"drawer.notSet":`未设置`,"drawer.outputDetails":`产出详情`,"drawer.outputRecorded":`该产出已记录到当前 Goal。`,"drawer.outputSafePreview":`公开安全产出预览`,"drawer.outputRun":`Run`,"drawer.outputTodo":`Todo`,"drawer.outputs":`本次运行产出`,"drawer.previewUnavailable":`此产出没有可用的公开安全内联预览。`,"drawer.priority":`优先级`,"drawer.progress":`进度`,"drawer.proposalApplied":`已应用,LoopX 状态将刷新。`,"drawer.proposalApplyFailed":`应用失败,没有写入任何变更。`,"drawer.proposalApplyFailedHint":`请刷新 Goal 状态后重新生成;若仍失败,可保留此页并查看高级诊断。`,"drawer.proposalClose":`关闭`,"drawer.proposalDefer":`稍后`,"drawer.proposalDeferred":`已暂缓,可稍后继续应用或重新生成。`,"drawer.proposalEnterGoal":`进入新 Goal`,"drawer.proposalExplainer":`确认后,LoopX 会执行这项变更并显示写入结果。关闭或取消不会修改任何状态。`,"drawer.proposalRecheck":`按最新状态重新检查`,"drawer.proposalRegenerate":`基于最新状态重试`,"drawer.proposalRejected":`已拒绝,这项变更不会写入。`,"drawer.proposalStale":`来源状态已变化,请按最新状态重新检查。`,"drawer.proposalViewGoal":`查看更新后的 Goal`,"drawer.reassign":`改派给`,"drawer.reassignSummary":`重新分配:{task}`,"drawer.reason":`原因`,"drawer.recoveryDescription":`本地历史已经保留,请选择恢复路径。`,"drawer.recoveryFailed":`上游 Session 恢复失败`,"drawer.recoveryNewSession":`携带上下文开始新 Session`,"drawer.recoveryRetry":`重试恢复`,"drawer.repositoryRole":`执行工作区`,"drawer.repository":`仓库`,"drawer.replyMode":`回复方式`,"drawer.subagentApplied":`已写入,并通过共享 Goal 状态读回校验。`,"drawer.subagentAppliedRefreshFailed":`已写入并通过共享 Goal 状态读回;状态投影刷新失败,可稍后手动刷新。`,"drawer.subagentApplying":`正在写入并校验共享状态读回…`,"drawer.subagentApplyFailed":`子代理设置写入失败。`,"drawer.subagentChildLimit":`当前上限`,"drawer.subagentConfirmDisable":`确认关闭子代理执行`,"drawer.subagentConfirmEnable":`确认开启子代理执行`,"drawer.subagentCurrentBoundary":`当前任务领域限制`,"drawer.subagentDescription":`仅在 Todo、配额、能力和写入范围门禁全部通过后,允许运行时为相互独立的任务临时创建子代理;不会强制并行,也不会授予持久权限。`,"drawer.subagentDisable":`预览关闭子代理执行`,"drawer.subagentDisableSummary":`这个 Goal 将不再创建新的子代理;现有 Todo 归属和执行记录不受影响。`,"drawer.subagentDomainInvalid":`所选任务领域限制无效。`,"drawer.subagentDomainTodoCount":`匹配 {count} 个开放 Todo`,"drawer.subagentDomains":`任务领域限制(可选)`,"drawer.subagentDomainsEmpty":`当前没有开放的 advancement Todo 声明 task_domain;保持为空即可不按任务领域限制子代理执行。`,"drawer.subagentDomainsHint":`全部不选表示不按任务领域过滤;选择后只放行匹配且已声明领域的 Todo,其他执行门禁始终生效。`,"drawer.subagentDomainsUnrestricted":`不限制任务领域`,"drawer.subagentEnable":`预览开启子代理执行`,"drawer.subagentLabel":`Per-Goal 执行边界`,"drawer.subagentModel":`子 Agent 模型`,"drawer.subagentEffort":`子 Agent 推理档位`,"drawer.subagentModelDefault":`宿主默认`,"drawer.subagentLunaPreset":`使用 Luna / max`,"drawer.subagentClearModel":`清除模型偏好`,"drawer.subagentModelHint":`填写后通过“预览配置调整”保存,执行关闭时也可保存偏好;启动时须核验宿主支持情况。`,"drawer.subagentModelRequired":`设置推理档位前请先指定子 Agent 模型。`,"drawer.subagentMaxChildren":`最多子代理数`,"drawer.subagentNoChange":`当前 Goal 已是这个设置,没有写入任何内容。`,"drawer.subagentPending":`待确认`,"drawer.subagentPreviewBoundary":`预览配置调整`,"drawer.subagentPreviewFailed":`无法生成子代理设置预览。`,"drawer.subagentPreviewing":`正在核对最新 Goal 状态…`,"drawer.subagentPreviewReady":`预览已锁定,确认后才会写入这个 Goal。`,"drawer.subagentPreviewSummary":`最多允许创建 {count} 个子代理;任务领域限制:{domains}。`,"drawer.subagentRemoteReadOnly":`当前来源只读,请在 Goal 所在主机上修改。`,"drawer.subagentTitle":`自适应子代理执行`,"drawer.remoteDetailsDescription":`SSH 来源只展示公开安全状态,不读取来源主机上的连接配置。`,"drawer.remoteDetailsUnavailable":`远端详情未投影`,"drawer.resumeNo":`否`,"drawer.resumeYes":`是`,"drawer.runDetails":`执行 Session`,"drawer.runInterrupt":`中断本次运行`,"drawer.runLatest":`查看最近执行过程`,"drawer.runNewSession":`开始新 Session`,"drawer.runCloseSession":`关闭 Session`,"drawer.runRecordEmpty":`还没有运行记录。Agent 尚未开始这次执行;请在“详情与操作”查看等待条件或恢复 Session。`,"drawer.runRecordProjected":`当前没有可展示的逐步运行记录。LoopX 已读取到 {completed}/{total} 的投影进度{outputs};请在“详情与操作”检查 Session 状态。`,"drawer.runRecordProjectedOutputs":`和 {count} 项产出`,"drawer.runRoleAssistant":`已完成`,"drawer.runRoleSystem":`需检查`,"drawer.runRoleUser":`收到任务`,"drawer.runView":`Session 视图`,"drawer.scheduleAdd":`添加定时检查`,"drawer.scheduleDefaultNotification":`仅在需要你时通知`,"drawer.scheduleDefaultStop":`Goal 完成或 owner 停止`,"drawer.scheduleDefaultTarget":`由 LoopX 调度器按 Goal 配置唤醒。`,"drawer.scheduleEdit":`改为每 2 小时`,"drawer.scheduleLast":`上次执行`,"drawer.scheduleLocalTimezone":`本地时区`,"drawer.scheduleNext":`下次执行`,"drawer.scheduleNeverRun":`尚未执行`,"drawer.scheduleNotification":`通知`,"drawer.schedulePause":`暂停`,"drawer.schedulePending":`等待调度`,"drawer.scheduleResume":`恢复`,"drawer.scheduleRunNow":`立即运行`,"drawer.scheduleStop":`停止{kind}`,"drawer.scheduleStopCondition":`停止条件`,"drawer.scheduleTimezone":`时区`,"drawer.sessionRecoverable":`可恢复`,"drawer.sessionStatus":`会话状态`,"drawer.setupHeartbeat":`设置 Heartbeat`,"drawer.taskActions":`Todo 待确认操作`,"drawer.taskAdvancement":`推进任务`,"drawer.taskBlock":`标记阻塞`,"drawer.taskComplete":`标记完成`,"drawer.taskCompletedNote":`该任务保留为只读记录。`,"drawer.taskCompletedTitle":`任务已完成`,"drawer.taskDefer":`暂缓`,"drawer.taskDeferCondition":`Todo 暂缓恢复条件`,"drawer.taskDeferInvalid":`条件格式不受支持;请使用下列可判定条件。`,"drawer.taskDeferPlaceholder":`例如 resume_at:2026-09-14T09:00:00+08:00`,"drawer.taskDeferReview":`检查暂缓`,"drawer.taskDeferSupported":`支持 todo_done、pr_merged、capacity_available 与带时区的 resume_at 条件。`,"drawer.taskDeferUntil":`暂缓至`,"drawer.taskDetails":`Todo 详情`,"drawer.taskInfo":`任务信息`,"drawer.taskManage":`管理任务`,"drawer.taskNextCompleted":`可创建后续任务`,"drawer.taskNextOpen":`推进或更新状态`,"drawer.taskOrdinary":`普通任务`,"drawer.taskStatusBlocked":`受阻`,"drawer.taskStatusDeferred":`已延期`,"drawer.resumeWhen":`恢复条件`,"drawer.resumeState":`恢复状态`,"drawer.resumePending":`等待条件满足`,"drawer.resumeReady":`可恢复`,"drawer.resumeReceipt":`恢复回执`,"drawer.taskNextDeferred":`等待恢复条件满足后重新评估`,"drawer.taskNextResumeReady":`恢复条件已满足,等待生命周期重新规划`,"drawer.taskStatusCompleted":`已完成`,"drawer.taskStatusOpen":`待执行`,"drawer.taskSuccessor":`创建后续 Todo`,"drawer.taskSuccessorNote":`Owner 标记为阻塞,等待补充上下文。`,"drawer.taskSuccessorSummary":`创建后续 Todo:{task}`,"drawer.taskSuccessorText":`{task} 的后续工作`,"drawer.taskType":`任务类型`,"drawer.topic":`Topic`,"drawer.trigger":`触发方式`,"drawer.titleAttention":`需要你`,"drawer.titleOutput":`产出详情`,"drawer.titleProposalApplied":`执行结果`,"drawer.titleProposalConfirm":`确认执行`,"drawer.titleSchedule":`定时检查`,"drawer.unconfigured":`未配置`,"drawer.workspaceCandidates":`可选择的工作区`,"files.emptySummary":`公开安全产出`,"files.empty":`还没有文件、产出或已验证的阶段周报。`,"files.loadingReports":`正在加载已验证的阶段周报…`,"files.reportDelta":`+{added} 新增 · {changed} 变化`,"files.reportAdded":`新增`,"files.reportChanged":`变化`,"files.reportGeneration":`生成批次`,"files.reportLoadFailed":`无法加载已验证周报`,"files.reportPublication":`发布批次`,"files.title":`Files & Outputs`,"files.verifiedReport":`已验证阶段周报`,"header.agentUnavailable":`不可用`,"header.chatRuntime":`Chat`,"header.workAgentCount":`{count} 个工作 Agent`,"header.overview":`概览`,"header.chat":`对话`,"header.files":`成果`,"header.goalCapabilities":`能力配置`,"header.goalCapabilitiesDescription":`管理 Goal override 与继承的本机默认值。`,"header.goalDetails":`Goal 详情`,"header.goalDetailsDescription":`查看状态、用量、仓库、通知与 Session。`,"header.goalSettings":`Goal 设置`,"header.goalSettingsDescription":`配置此 Goal 的能力`,"header.goalNavigation":`Goal 导航`,"header.goalView":`Goal 视图`,"header.live":`实时`,"header.manager":`LoopX 管家`,"header.managerDescription":`跨 Goal 的个人工作入口`,"header.managerRuntime":`{profile} · {sandbox}`,"header.managerRuntimeFallback":`配置无效,已回退到 {profile} · {sandbox};请在机器能力设置中修复。`,"header.managerExecutorKindIndividual":`个人 CLI 登录`,"header.managerExecutorKindManaged":`operator 凭据`,"header.managerExecutorKindRegistered":`注册端点`,"header.managerExecutionUnavailable":`所选执行器 {executor} 无法在本机启动;该通道不会回落到个人 CLI 登录。`,"header.managerExecutionUnavailableCredential":`所选执行器 {executor} 需要 operator 凭据 {credential},配置后该通道才能启动它。`,"header.managerExecutionUnavailableRuntime":`所选执行器 {executor} 无法在本机启动:本机未安装其 runtime。`,"header.managerExecutionUnavailableEffort":`所选执行器 {executor} 拒绝了当前配置的推理档位;请改为受支持的档位后刷新。`,"header.managerEndpointStewardDefault":`当前运行 {executor},管家通道的出货默认值;如需改指请显式选择执行器。`,"header.managerOverview":`总览`,"header.managerView":`管家视图`,"header.openGoalNavigation":`打开 Goal 导航`,"header.readOnlySourceDescription":`{source} 通过 SSH 隧道只读展示`,"header.refresh":`刷新状态`,"header.refreshDone":`刚刚更新`,"header.refreshFailed":`刷新失败`,"header.refreshing":`刷新中`,"header.selectAgent":`选择 Agent`,"header.selectChatRuntime":`选择聊天 Runtime`,"header.tasks":`任务`,"header.themeBrutal":`切换到野兽主题`,"header.themePaper":`切换到默认主题`,"home.blockingSummary":`其中 {count} 项正在阻塞 Agent。`,"home.completedGoals":`已完成的 Goal`,"home.empty":`当前没有`,"startup.goalLoading":`正在加载状态…`,"startup.goalError":`状态加载失败`,"startup.progress":`已加载 {loaded} / {total} 个活跃 Goal`,"startup.partial":`Goal 状态正在逐个更新,当前统计尚不完整。`,"startup.independent":`此 Goal 的加载不会阻塞其他 Goal,你可以先查看已加载的内容。`,"startup.error.timeout":`读取超时,可在本地服务就绪后重试。`,"startup.error.network":`连接中断,请重试以重新连接。`,"startup.error.service":`Goal 状态读取失败。请稍后重试;若问题持续,请检查状态来源。`,"startup.error.access":`状态来源无法访问此 Goal 所需的文件或运行时目录。请检查该来源运行账户的访问权限,修复后重试。`,"startup.error.revision":`加载期间 Goal 目录发生变化,请刷新以同步。`,"startup.error.scope":`该 Goal 已不在当前来源中,请刷新目录。`,"startup.error.invalid":`无法解析状态响应,请刷新或检查 LoopX 更新。`,"startup.retry":`重试`,"startup.retryFailed":`重试失败的 Goal`,"startup.failedCount":`{count} 个 Goal 加载失败,已加载的 Goal 可继续使用。`,"home.greeting":`你好,我是 LoopX 管家`,"home.history":`历史`,"home.lane.needsYou":`需要你`,"home.lane.needsYouDescription":`等待你的决定、授权或补充信息`,"home.lane.observing":`观察中`,"home.lane.observingDescription":`持续监控,出现变化时再提醒你`,"home.lane.running":`执行中`,"home.lane.runningDescription":`Agent 正在推进并持续回传进展`,"home.lane.scheduled":`已安排`,"home.lane.scheduledDescription":`已经安排,等待时间或前置条件`,"home.noActivity":`尚无活动`,"home.noFirstActivity":`等待首次活动`,"home.noCompletedGoals":`还没有已完成的 Goal`,"home.preservedState":`保留状态,可随时恢复`,"home.stopped":`已停止`,"home.systemHealth":`系统健康:{summary}`,"home.taskCount":`{count} 个 Task`,"home.todayAt":`今天 {time}`,"home.waitingCount":`你有 {count} 项需要处理。`,"home.workspace":`Goal 工作区`,"lark.allMessages":`此 Topic 中的所有消息`,"lark.allTopicMessages":`所有 Topic 消息`,"lark.agentIngress":`Agent 入站方式`,"lark.agentAppPermissions":`每个选中的 Agent 都需要一个已具备群聊提及和回复能力的 Lark App。`,"lark.agentApps":`每个 Agent 的 Lark App`,"lark.agentAppsDescription":`默认使用上方 App;需要独立机器人身份时,可为 Agent 选择另一个兼容 App。`,"lark.agentAppSelection":`{agent} 的 Lark App`,"lark.appCreated":`App 已创建`,"lark.appCreateFailed":`创建失败`,"lark.appLoading":`正在加载可用的 Lark Apps…`,"lark.appPermissions":`该 App 能发送建联消息,但缺少接收群聊 @ 消息或自动回复所需的机器人权限。请开启 im:message.group_at_msg:readonly、im:message.send_as_bot 和事件 im.message.receive_v1,发布新版后刷新。`,"lark.appProfile":`Lark App`,"lark.apps":`Lark Apps`,"lark.autoReplyUnavailable":`自动回复暂不可用`,"lark.autoReplyReady":`自动回复可用`,"lark.bindGoal":`绑定到 Goal`,"lark.cancel":`取消`,"lark.cardinality":`一个 Lark App · 多个 Goal · 每个 Agent 一条隔离路由`,"lark.capture":`接收范围`,"lark.captureAddressed":`仅接收提及 App 或回复 App 的消息`,"lark.captureAll":`接收此 Goal Topic 中的所有消息`,"lark.captureScope":`接收范围`,"lark.captureScopeDescription":`决定哪些 Topic 消息会进入 LoopX;不会扩大 Agent 权限。`,"lark.closeConnection":`关闭连接弹窗`,"lark.closeCreate":`关闭创建弹窗`,"lark.closeSettings":`关闭 Lark 设置`,"lark.connect":`连接`,"lark.connectAllAgents":`连接全部已注册 Agent`,"lark.connectAllAgentsAction":`一键连接 {count} 个 Agent`,"lark.connectAllAgentsDescription":`一次引导创建 {count} 个隔离的 Agent Topic;请在对应 Topic 内发送请求,每个 Agent 保留独立路由和收件箱。`,"lark.connectApp":`连接 Lark App`,"lark.connection":`连接`,"lark.connections":`连接`,"lark.configuration":`Lark 配置`,"lark.continueFeishu":`在飞书中继续`,"lark.createAutomatically":`自动创建 Goal Topic`,"lark.createAutomaticallyDescription":`将为每个选中的 Agent 创建带 Agent 标识的专属 Topic。`,"lark.defaultAgentAppDescription":`用于查找目标群聊,并作为所有选中 Agent 的默认 App;下方的逐 Agent 选择可覆盖它。`,"lark.description":`管理可复用的 Lark App,并用独立 Topic 将群聊连接到 Goal。`,"lark.editConnection":`编辑 Lark 连接`,"lark.goalConnections":`{count} 个 Goal 连接`,"lark.goalTopicConnections":`Lark Goal Topic 连接`,"lark.groupChat":`群聊`,"lark.groupEmpty":`该机器人尚未加入可连接的群。请先在飞书群设置中添加这个机器人,再回来刷新或搜索。`,"lark.groupLoading":`正在读取该机器人已加入的群…`,"lark.groupSearch":`搜索该机器人已加入的群`,"lark.historyPermission":`历史补读权限(独立能力)`,"lark.health.contextCaptured":`已捕获群聊上下文`,"lark.health.contextCapturedDetail":`该消息仅作为非权威上下文保留,不会启动或引导管家 Turn;需要执行时请直接 @ 机器人或回复机器人的消息。`,"lark.health.eventProcessed":`已处理 {events} 条事件,成功回复 {replies} 条。`,"lark.health.eventUnverified":`事件订阅待验证`,"lark.health.eventUnverifiedDetail":`Provider listener 已就绪,但尚未收到消息事件。请启用 im.message.receive_v1、开通群聊 @ 消息权限并发布新版,然后在这个 Agent Topic 内发送新的 @ 消息;存在多条 Agent 路由时,群顶层消息会 fail closed。`,"lark.health.ignoredSelf":`已忽略机器人自身发送的消息,避免重复回复。`,"lark.health.invalidRouting":`路由配置无效`,"lark.health.invalidRoutingDetail":`连接已安全停用,请重新选择处理方式并保存。`,"lark.health.lastStatus":`最近事件状态:{status}`,"lark.health.listening":`监听中`,"lark.health.messageContextPermission":`消息权限不足`,"lark.health.messageContextPermissionDetail":`已收到消息事件,但无法读取群消息上下文。请发布并授权该 App 的群消息读取权限。`,"lark.health.notAddressed":`最近消息未直接 @ 机器人`,"lark.health.notAddressedDetail":`监听正常;当前连接只响应直接 @ 机器人或对机器人的回复。`,"lark.health.notStarted":`监听未启动`,"lark.health.notStartedDetail":`请刷新连接或重新启动 LoopX 后再试。`,"lark.health.processingFailed":`消息处理失败`,"lark.health.processingFailedDetail":`已收到消息事件,但 Agent 处理失败。请查看本地诊断后重试。`,"lark.health.queued":`已进入 Agent 收件箱`,"lark.health.queuedDetail":`消息由 {agent} 异步处理,不会启动通用 Chat Session。`,"lark.health.sourceDisconnected":`实时消息连接断开`,"lark.health.sourceDisconnectedDetail":`消息监听进程意外退出。请核对应用档案的平台:飞书应用选飞书,国际版 Lark 应用选 Lark,再检查连接及订阅错误。LoopX 正在重试;历史消息能读取,不代表能实时收消息。`,"lark.health.retrying":`监听重试中`,"lark.health.retryingDetail":`事件监听暂时中断,LoopX 正在自动重试。`,"lark.health.routeAmbiguous":`消息匹配多个 Goal`,"lark.health.routeAmbiguousDetail":`同一 Bot 和群聊存在多个完整群捕获连接。请让每个 Agent 使用独立 Bot,或只保留一个完整群连接。`,"lark.health.routeMismatch":`消息未匹配当前 Goal Topic`,"lark.health.routeMismatchDetail":`事件来自其他群聊或 Topic。请重新选择群聊并连接该 Goal,然后发送一条新的 @ 消息。`,"lark.health.routeUnavailable":`消息无法路由到 Goal`,"lark.health.routeUnavailableDetail":`当前连接信息不完整。请重新连接该 Goal 后再发送一条新的 @ 消息。`,"lark.health.starting":`正在启动`,"lark.health.startingDetail":`LoopX 正在启动该 App 的消息事件监听。`,"lark.health.unavailable":`自动回复不可用`,"lark.health.waiting":`等待处理`,"lark.incomingMessages":`接收消息`,"lark.ingressAsync":`异步收件箱`,"lark.ingressAsyncDescription":`写入 Agent 私有收件箱,等待后续显式处理。`,"lark.editPreservesIdentity":`保存会保留此 App、群和 Topic;旧连接默认升级为 Agent 异步收件箱。`,"lark.conversationKind":`连接用途`,"lark.managerConversation":`管家 · 同步对话`,"lark.workerConversation":`工作 Agent · 后台任务`,"lark.managerConversationDescription":`内置管家即时回应对话,长任务交给后台 Agent。群聊与私聊分别保存上下文。`,"lark.ingressLegacy":`待升级`,"lark.ingressLegacyDescription":`保存连接即可升级为 Agent 异步收件箱,已有消息保留在原 Topic 中。`,"lark.ingressQueue":`排队`,"lark.ingressQueueDescription":`进入同一 Agent Session 的有界 FIFO 队列,当前 Turn 完成后处理。`,"lark.ingressSteering":`实时引导`,"lark.ingressSteeringDescription":`投到当前活跃 Turn;没有精确活跃 Turn 时安全拒绝。`,"lark.loading":`加载 Lark 配置…`,"lark.management":`Lark 管理`,"lark.openEventSettings":`查看飞书事件配置`,"lark.mentions":`提及机器人`,"lark.mentionsOnly":`仅提及消息`,"lark.needsMessagePermissions":`需要消息权限`,"lark.needsSetup":`需要设置`,"lark.newApp":`新建 Lark App`,"lark.noAgentConfigured":`未配置 Agent`,"lark.noConnections":`暂无匹配的连接。`,"lark.noProfiles":`还没有可用的 lark-cli App profile。`,"lark.profileName":`Profile 名称`,"lark.profileValidation":`Profile 只能包含字母、数字、点、下划线和连字符。`,"lark.processing":`处理方式`,"lark.region":`区域`,"lark.registerAnother":`+ 注册另一个 Lark App — 通过飞书创建`,"lark.reopenFeishu":`重新打开飞书`,"lark.settingsConfigure":`配置 {goal}`,"lark.settingsDisconnect":`解绑 {goal}`,"lark.replyMode":`回复方式`,"lark.replyModeDescription":`当前只支持在来源 Topic 内回复,避免跨群或跨 Goal 投递。`,"lark.reusableApps":`{count} 个可复用 App`,"lark.reusableWorkspaceApp":`可复用工作区 App`,"lark.routesUnverified":`{count} 条 Lark 路由尚未验证`,"lark.saveConnection":`保存连接`,"lark.searchConnections":`搜索 Lark 连接`,"lark.searchPlaceholder":`搜索 App、群、Goal 或 Topic`,"lark.setupCopy":`LoopX 将通过 lark-cli 打开飞书官方创建页面。应用凭证保存在系统 Keychain,LoopX 只保留 profile 引用。`,"lark.someoneMentions":`有人提及 Agent`,"lark.targetAgent":`目标 Agent`,"lark.targetAgentDescription":`选择该 Goal 内已注册的 Agent。此连接只投递给一个 Agent,不广播、不授予新权限。实时引导与排队需要该 Agent 的精确活跃 Session。`,"lark.agentUnavailable":`{agent} · 已不可用`,"lark.selectRegisteredAgent":`请先选择可用的已注册 Agent;不会自动替换原先的接收者。`,"lark.topicPreview":`Topic 预览`,"lark.topicReply":`Topic 回复`,"lark.trigger":`触发方式`,"lark.waitingFeishu":`等待飞书完成创建`,"lark.waitingFeishuDescription":`请在新窗口中完成飞书授权,完成后会自动回到这里。`,"lark.waitingLink":`正在生成飞书官方创建链接…`,"lark.error.appCreate":`Lark App 创建失败`,"lark.error.appRequired":`请选择一个 Lark App profile。`,"lark.error.bind":`绑定失败`,"lark.error.bindPreview":`绑定预览失败`,"lark.error.configuration":`Lark 配置加载失败`,"lark.error.groupLookup":`无法读取该机器人已加入的群。请检查机器人状态后重试。`,"lark.error.groupLoad":`群聊加载失败`,"lark.error.invalidApp":`Lark App profile 不可用或尚未完成授权。`,"lark.error.messagePermissions":`该 App 缺少自动回复所需的机器人权限。请开启 im:message.group_at_msg:readonly 和 im:message:send_as_bot,发布新版后回来刷新重试。`,"lark.error.provider":`飞书 API 调用失败,且没有生成已验证回执。请稍后重试。`,"lark.error.setupPoll":`创建状态查询失败`,"lark.error.setupStart":`无法启动 Lark App 创建流程`,"lark.error.cliExecutable":`已找到配置的 lark-cli,但当前无法执行。请检查安装或启动参数。`,"lark.error.cliMissing":`未发现 lark-cli。请先安装 lark-cli,然后重新启动 LoopX。`,"lark.error.cliStart":`lark-cli 启动失败。请检查安装状态,然后重新启动 LoopX。`,"lark.error.disconnect":`解绑失败`,"notifications.autoNotify":`需要你确认时自动推送到群里`,"notifications.bind":`绑定到通知群`,"notifications.bindConfirm":`将把「{goal}」绑定到通知群「{target}」,绑定时会验证机器人在群内并发送一条确认消息。`,"notifications.bindFailed":`绑定失败`,"notifications.bound":`已绑定`,"notifications.confirmBind":`确认绑定`,"notifications.description":`把 Goal 里需要你确认的变更推送到飞书群。绑定和开关在这里完成,推送逻辑沿用现有通道。`,"notifications.disabled":`已停用`,"notifications.group":`通知群:{target}`,"notifications.loadFailed":`通知群列表加载失败`,"notifications.noTargets":`还没有可用的通知群。通知群涉及机器人私有身份,请先在终端配置一次:`,"notifications.notBound":`未绑定`,"notifications.recent":`最近 {time}`,"notifications.sentCount":`已发送 {count} 条`,"notifications.settings":`Goal 通知绑定`,"notifications.setupFailed":`设置失败`,"notifications.title":`飞书群通知`,"proposal.field.agentId":`Agent`,"proposal.field.cadence":`频率`,"proposal.field.completionCriteria":`完成标准`,"proposal.field.executionBoundary":`执行边界`,"proposal.field.goalId":`Goal ID`,"proposal.field.heartbeat":`Heartbeat`,"proposal.field.initialTodos":`首个任务`,"proposal.field.objective":`目标`,"proposal.field.operation":`操作`,"proposal.field.operationState":`操作状态`,"proposal.field.resultDelivery":`结果回传`,"proposal.field.confirmationBoundary":`确认边界`,"proposal.field.expiresAt":`过期时间`,"proposal.field.permission":`权限`,"proposal.field.reason":`原因`,"proposal.field.stopCondition":`停止条件`,"proposal.field.target":`检查内容`,"proposal.field.timezone":`时区`,"proposal.field.title":`标题`,"proposal.field.workspace":`执行工作区`,"actionReview.targetChanged":`预览目标与请求的 Goal 或操作不一致,请重新生成预览。`,"actionReview.ready_stop":`暂停可恢复。此预览已通过检查,可直接执行;完成仍需要读回验证。`,"actionReview.resume_review":`恢复自动调度前需要确认。实际执行仍受额度、Gate 和 Todo 约束。`,"actionReview.delete_review":`请确认从注册表移除这个已停止 Goal。项目文件与历史记录会保留。`,"actionReview.action_review":`执行前请检查此提案的目标与影响。`,"actionReview.protected_action":`此操作需要明确审阅。确认不能替代所需授权。`,"actionReview.unknown_permission":`无法识别权限分类。请重新检查提案后再继续。`,"actionReview.unknown_action":`无法识别此生命周期操作。请重新检查提案后再继续。`,"actionReview.incomplete_proposal":`预览缺少验证信息或可执行转换。请重新生成预览。`,"actionReview.authority_gate":`Gate 阻止执行。请满足其要求后重新检查提案。`,"actionReview.stale_proposal":`来源状态已变化。请重新生成预览,原决定不再适用。`,"actionReview.apply_pending":`正在执行,请等待读回结果后再重试。`,"actionReview.readback_verified":`操作已完成,结果状态已通过读回验证。`,"actionReview.readback_unverified":`操作返回但未通过读回验证。尚不能确认完成,请重新检查状态。`,"actionReview.operation_group_confirmation":`这份精确请求只能在已绑定飞书群的原始卡片确认;Dashboard 不提供本地执行入口。`,"actionReview.operation_result_delivery_pending":`操作结果已经记录,但原群结果卡尚未通过回读核验。`,"drawer.recoverEditResult":`恢复编辑结果`,"drawer.retryOriginal":`重试原操作`,"actionReview.canonical_update_retry":`编辑结果尚未确认。重试此操作以恢复原结果。`,"actionReview.canonical_update_projection_pending":`编辑已提交,展示尚未同步。重试此操作以恢复当前视图。`,"actionReview.apply_failed":`执行未完成。请检查失败原因并重新生成预览后再试。`,"actionReview.inactive_proposal":`此提案当前不可执行。请重新检查后再继续。`,"proposal.gate.default":`需要宿主确认`,"proposal.impact.default":`确认后会调用规范 LoopX 服务写入状态。`,"proposal.impact.goalCreate":`确认后会创建 Goal 和首个 Todo,并让选定 Agent 开始首轮推进。`,"proposal.impact.lifecycleDelete":`确认后会从 source registry 和 global registry 移除这个已停止 Goal;项目文件、历史状态文件和备份不会被删除。`,"proposal.impact.lifecycleResume":`确认后会恢复 Goal 的自动调度资格并移回 Active Goals;实际执行仍受 quota、Gate 和 Todo 约束。`,"proposal.impact.lifecycleStop":`确认后会停止自动推进,并将 Goal 移入折叠的「已停止」列表;历史、Todo 和证据都会保留,可随时恢复。`,"proposal.impact.protected":`该操作需要通过受保护的 LoopX 写入服务完成。`,"proposal.impact.operation":`这里仅展示同一份不可变条款。请在已绑定的飞书群确认或拒绝;确认只会消费一个规范 claim。`,"proposal.primary.apply":`确认并应用`,"proposal.primary.goalCreate":`创建 Goal 并开始首轮`,"proposal.primary.lifecycleDelete":`删除 Goal`,"proposal.primary.lifecycleResume":`恢复 Goal`,"proposal.primary.lifecycleStop":`停止 Goal`,"proposal.primary.todoStart":`创建任务并开始执行`,"proposal.primary.operationGroup":`前往飞书群确认`,"proposal.primary.operationResultPending":`结果卡回传待恢复`,"proposal.primary.operationResultVerified":`结果已核验`,"proposal.resultDelivery.verified":`已在原群卡片完成回读核验`,"proposal.resultDelivery.pending":`等待回传并核验原群卡片`,"proposal.summary.goalCreate":`创建 Goal:{title}`,"proposal.summary.heartbeat":`为当前 Goal 设置 Heartbeat`,"proposal.summary.lifecycleDelete":`删除 Goal:{title}`,"proposal.summary.lifecycleResume":`恢复 Goal:{title}`,"proposal.summary.lifecycleStop":`停止 Goal:{title}`,"proposal.summary.monitor":`为当前 Goal 创建定时检查:{target}`,"proposal.teamPlan.gapReason.capabilityNotGranted":`尚未授予所需能力`,"proposal.teamPlan.gapReason.audienceNotAuthorized":`尚未获得所需访问权限`,"proposal.teamPlan.pending":`待安排`,"proposal.teamPlan.assignedHint":`分配已记录,执行进度请查看目标。`,"proposal.teamPlan.recoveredHint":`未新增任务,当前进度请查看目标。`,"proposal.teamPlan.originalPlan":`查看原计划`,"proposal.teamPlan.viewResult":`查看结果`,"proposal.teamPlan.openGoal":`打开目标`,"proposal.teamPlan.resultTitle":`分配结果`,"proposal.teamPlan.retry":`重试分配`,"proposal.teamPlan.retryHint":`重试会恢复本次分配结果,不会重复创建任务。`,"proposal.summary.teamPlan":`为 {goal} 分配 {count} 项任务`,"proposal.impact.teamPlan":`确认后分配可安排的任务,其余保留为待安排。`,"proposal.primary.teamPlan":`确认分配`,"proposal.field.laneGaps":`未配齐的 lane`,"proposal.field.quotaEnvelope":`配额包络`,"proposal.teamPlan.acceptanceShort":`验收参考`,"proposal.teamPlan.advisory":`计划参考;本次确认不执行该约束`,"proposal.teamPlan.appliedPartially":`已分配 {created} 项,{gaps} 项待安排`,"proposal.teamPlan.appliedAlreadyPresent":`已恢复原分配结果`,"proposal.teamPlan.applied":`已分配 {count} 项任务`,"proposal.teamPlan.gapLane":`待安排`,"proposal.teamPlan.laneUnstaffed":`待安排,尚无任务`,"proposal.teamPlan.gapReason.agentNotRegistered":`尚未加入此目标`,"proposal.teamPlan.gapReason.actionKindNotSupported":`当前环境不支持此任务类型`,"proposal.workspace.current":`当前本地工作区(未绑定 Repository)`,"proposal.workspace.named":`{workspace}(仅提供执行环境,不会自动关联仓库)`,"proposal.workspaceGate.agentImpact":`先完成 Agent 身份绑定,再重新检查原操作;当前没有写入 Goal。`,"proposal.workspaceGate.agentTitle":`先绑定 Agent`,"proposal.workspaceGate.defaultSummary":`请选择 Goal 所属工作区。`,"proposal.workspaceGate.selectionImpact":`选择工作区后会重新展示待确认操作,选择本身不会写入状态。`,"proposal.workspaceGate.selectionTitle":`选择 Goal 工作区`,"projection.agentAdvancingGoal":`Agent 正在推进当前 Goal`,"projection.agentIdle":`暂无需要你处理`,"projection.agentNeedsDecision":`Agent 等待你的决定`,"projection.agentPreparingNextStep":`Agent 正在整理下一步`,"projection.agentStopped":`已由你停止;历史、Todo 和证据仍保留`,"projection.agentWaitingExternal":`正在等待外部条件`,"projection.confirmAgentDecision":`请确认 Agent 下一步需要的权限或决策`,"projection.events24h":`24 小时内 {count} 个事件`,"projection.firstReadOnlyAdapterCheck":`执行首次只读适配检查并保存进度`,"projection.goalVerified":`Goal 状态、Todo 与注册信息已验证`,"projection.latestRun":`最近运行`,"projection.latestValidation":`最近验证`,"projection.nextUpdatePending":`等待 LoopX 更新下一步`,"projection.publicSafeProjection":`公开安全状态投影`,"projection.refreshState":`刷新 LoopX 状态,确认当前进度仍然有效`,"projection.runEvidenceAvailable":`存在可查看的运行证据`,"projection.runRecorded":`最近一次 LoopX 运行已经记录`,"projection.statusRefreshNeeded":`LoopX 状态需要刷新`,"projection.todoStatusUpdated":`Todo 状态已经更新,正在确认下一步`,"projection.validationRecorded":`最近验证已经记录`,"runs.completed":`已完成`,"runs.failed":`需检查`,"runs.interrupted":`已中断`,"runs.queued":`已安排`,"runs.ready":`可继续`,"runs.resumeFailed":`恢复失败`,"runs.running":`执行中`,"runs.unknown":`状态未知`,"runs.waiting":`等待条件`,"schedule.active":`执行中`,"schedule.heartbeat":`Goal Heartbeat`,"schedule.monitor":`定时与持续任务`,"schedule.paused":`已暂停`,"schedule.summary":`按 LoopX 调度约束持续检查`,"schedule.defaultTarget":`检查当前 Goal 的阻塞、进度与新产出`,"schedule.unsupportedCalendar":`当前定时检查不支持精确到星期或时刻的日历计划。请改用固定间隔,例如“每 30 分钟”“每 2 小时”或“每天”;草稿已保留,没有生成待确认操作。`,"source.add":`添加来源`,"source.addConfigured":`添加只读来源`,"source.addMethod":`来源添加方式`,"source.addSsh":`添加 SSH 隧道来源`,"source.closeForm":`关闭来源表单`,"source.configured":`已配置 SSH`,"source.configuredCount":`本机 SSH Host · {count} 个`,"source.configuredGroup":`已配置 SSH Host · {count}(点击快速添加)`,"source.connected":`已连接`,"source.connecting":`连接中`,"source.controlPlane":`控制面来源`,"source.copy":`复制`,"source.copyCommand":`复制 SSH 隧道命令`,"source.copyError":`无法复制命令,请手动复制下方命令。`,"source.copied":`已复制`,"source.description":`已读取全部显式 Host(含 Include);通配规则不会作为具体来源。先运行命令,LoopX 不读取密钥或配置细节。`,"source.host":`本机 SSH Host`,"source.hostEmpty":`~/.ssh/config 中没有可直接选择的显式 Host。`,"source.hostLoadError":`无法读取本机 SSH Host。`,"source.hostPlaceholder":`输入或搜索 Host`,"source.invalid":`SSH 来源参数无效。`,"source.loadingHosts":`正在读取…`,"source.localInteractive":`本机交互`,"source.localPort":`本地端口`,"source.manual":`手动 URL`,"source.manualDescription":`远端来源始终按只读投影处理,不继承本机写权限。`,"source.name":`名称`,"source.namePlaceholder":`远程开发机`,"source.notAvailable":`不可用`,"source.readOnly":`SSH 隧道 · 只读`,"source.readOnlyNoticeDescription":`你可以查看 Goal、Task、证据与运行状态;写入、纠偏和 Agent 会话仍留在来源主机。`,"source.readOnlyNoticeTitle":`远端只读投影`,"source.readOnlyWriteError":`远端 SSH 隧道来源是只读投影,不能执行控制面写入。`,"source.refreshHosts":`重新读取 SSH Host`,"source.remove":`移除来源 {source}`,"source.removeCurrent":`移除当前来源`,"source.select":`选择控制面来源`,"source.selectHost":`请选择已配置的 SSH Host。`,"source.statusUrl":`本地转发 URL`,"source.tunnelCommandPending":`选择 Host 后生成隧道命令`,"machine.absent":`尚未配置`,"machine.action.create":`创建机器策略`,"machine.action.delete":`移除机器策略`,"machine.action.unchanged":`无需写入`,"machine.action.update":`更新机器策略`,"machine.applied":`机器策略已应用,并通过回读校验。`,"machine.applyError":`无法应用机器策略。`,"machine.applyPreview":`应用已审阅预览`,"machine.changedNamespaces":`变更的 Namespace`,"machine.capabilityCatalog":`机器能力目录`,"machine.capabilityEmpty":`当前没有注册可在机器作用域配置的能力。`,"machine.configured":`已配置`,"machine.confirmRollback":`确认回滚`,"machine.currentRevision":`当前 Revision`,"machine.currentValue":`当前机器值`,"machine.description":`与 Goal 设置共用能力目录。在这里管理受支持的机器默认值;仅支持 Goal 配置的能力会明确标注。`,"capabilities.rawJson":`高级:原始 JSON`,"machine.goalOnly":`此能力目前仅支持 Goal 级配置。请打开具体 Goal 的能力设置进行配置;这里不会设置机器级默认值。`,"machine.desiredRevision":`目标 Revision`,"machine.editorUnavailable":`当前版本未安装此 Namespace 的编辑器`,"machine.editorUnavailableDescription":`它仍会显示在 Registry 中;安装或升级对应的 Dashboard 编辑器后才能修改。`,"machine.editorMode":`编辑模式`,"machine.liveDefault":`实时默认值;Goal 显式覆盖优先`,"machine.liveDefaultDescription":`没有显式覆盖的 Goal 会在该能力下一次决策时读取当前机器策略。修改或移除策略会立即影响这些已有 Goal;显式 Goal 覆盖保持固定。`,"machine.credentialTitle":`操作者模型凭据`,"machine.credentialDescription":`管家通道与托管宿主在本机认证用的 key 与 endpoint。key 单独存放于仅属主可读的文件,不会进入这里展示的机器配置,也不会被回读——回读的是它的指纹。`,"machine.credentialApiKey":`API key`,"machine.credentialApiKeyPlaceholder":`粘贴 key 以保存;留空则保留已存的 key`,"machine.credentialBaseUrl":`Endpoint base URL`,"machine.credentialBaseUrlPlaceholder":`https://endpoint.example/v1(留空则使用 endpoint 默认值)`,"machine.credentialStore":`保存凭据`,"machine.credentialClearKey":`清除已存 key`,"machine.credentialClearUrl":`清除已存 endpoint`,"machine.credentialConfigured":`已配置`,"machine.credentialAbsent":`未配置`,"machine.credentialInvalid":`无法读取——需要修复`,"machine.credentialSourceMachine":`本机已存凭据`,"machine.credentialSourceEnvironment":`服务环境变量`,"machine.credentialSourceUnset":`无来源`,"machine.credentialFingerprint":`指纹`,"machine.credentialStored":`凭据已保存。下一轮即生效,无需重启。`,"machine.credentialCleared":`已清除本机存储的凭据。`,"machine.credentialError":`凭据保存失败。`,"machine.credentialBoundary":`保存凭据不授予任何权限:它不会选择执行器、模型或推理强度。`,"machine.genericNamespaceDescription":`使用 JSON 编辑这个已注册 Namespace。LoopX 会先按 capability 自己拥有的 schema 校验,再允许预览写入。`,"machine.jsonConfiguration":`Namespace 配置(JSON)`,"machine.jsonConfigurationHelp":`只更新当前 Namespace;其他机器配置会保留,Apply 仍锁定到已审阅的 Preview Revision。`,"machine.jsonEditor":`JSON`,"machine.editJson":`编辑 JSON`,"capabilities.jsonConfiguration":`Goal 配置(JSON)`,"capabilities.jsonHelp":`仅编辑当前 Goal 的已注册字段。修改后需重新预览才能应用。`,"capabilities.jsonInvalid":`请输入合法的 JSON 对象,且仅包含已注册的可编辑字段。`,"machine.backToForm":`返回表单`,"machine.jsonInvalid":`请先填写一个合法的 JSON object,再预览变更。`,"machine.loadError":`无法读取机器配置。`,"machine.invalidStoredConfiguration":`已保存的机器配置需要修复`,"machine.invalidStoredConfigurationDescription":`已保存值不再符合当前契约,因此不会在这里显示。请检查已定位的能力,并通过“预览”和“应用”替换它;无关 namespace 保持不变。`,"machine.machinePolicy":`机器策略`,"machine.namespaceCount":`已注册 Namespace`,"machine.namespaces":`配置 Namespace`,"machine.periodicReport":`周期报告`,"machine.periodicReportDescription":`为所有未显式覆盖的 Goal 提供默认报告策略;Goal 调度与发送消费解析后的有效配置。`,"machine.periodicReportActivation":`开启后将在已验证的阶段节点自动投递`,"machine.periodicReportActivationDescription":`这不是每周定时器。当 LoopX 验证 Goal 已完成一个阶段时,Agent 会生成并冻结报告,随后通过配置的 Goal Channel 自动发送。启用此订阅即授予持续投递权;发送失败或路由漂移会 fail closed 并进入修复。`,"machine.changeQualityActivation":`质量验证是质量门禁,不是新增授权`,"machine.changeQualityActivationDescription":`继承该策略的 Goal 会验证最终精确 diff。safe_fix 只允许在既有写入权限内执行至多一次有界修复;此设置不会授予文件、权限或合并权。`,"machine.replanCadenceActivation":`复核周期只改变时机,不改变执行权限`,"machine.replanCadenceActivationDescription":`没有显式覆盖的 Goal 会在下一次复核决策前读取此阈值;它不会创建 Turn、消耗配额或授予权限。`,"machine.preview":`审阅机器配置变更`,"machine.previewChanges":`预览变更`,"machine.previewError":`无法生成机器策略预览。`,"machine.previewLocked":`应用操作锁定到当前 Revision;若机器状态变化,LoopX 会要求重新预览。`,"machine.previewRollback":`预览回滚`,"machine.previewRemoval":`预览移除`,"machine.profilePreset":`Profile preset`,"machine.profilePresetHelp":`由 capability 管理的 preset,例如 weekly-progress。`,"machine.registry":`Typed Registry`,"machine.requiredFields":`开启后必须填写 profile preset、Goal Channel route 与有效时区。`,"machine.revision":`机器 Revision`,"machine.revisionLockedReady":`所有变更必须先预览;只有对应的机器 Revision 仍然有效时才会应用。`,"machine.rollbackAvailable":`可回滚上一次应用`,"machine.rollbackDescription":`先预览已保存的前一 Revision,再决定是否恢复。`,"machine.rollbackError":`无法完成回滚。`,"machine.rollbackPreviewDescription":`前一 Revision 已准备恢复,请确认执行本次回滚。`,"machine.rolledBack":`已恢复前一版机器策略,并通过校验。`,"machine.removed":`机器策略已移除,并通过回读校验。`,"machine.routeRef":`Goal Channel route`,"machine.routeRefHelp":`只填写公开 route alias;凭据与 provider identifier 不会进入此表单。`,"machine.timezone":`时区`,"machine.timezoneHelp":`填写 IANA 时区,例如 Asia/Shanghai。`,"machine.title":`机器配置`,"machine.unchanged":`机器策略已与预览一致,本次没有写入。`,"machine.visualEditor":`引导式`,"capabilities.atomicOverride":`Goal override 按完整配置生效`,"capabilities.atomicOverrideDescription":`Goal 的完整配置优先于机器默认值;LoopX 不会在两个作用域之间逐字段拼接。`,"capabilities.applyFailed":`Goal 能力变更未写入。`,"capabilities.applyPreview":`应用此预览`,"capabilities.catalog":`Goal 能力目录`,"capabilities.chooseGoal":`请先选择一个 Goal,再查看它的能力配置。`,"capabilities.defaultValue":`声明的默认值`,"capabilities.description":`查看当前 Goal 可用的能力,以及每项配置的准确作用域。`,"capabilities.editorPrepared":`已注册 typed editor contract`,"capabilities.effectiveSource":`当前生效来源`,"capabilities.empty":`当前 Goal 没有可用的能力描述。`,"capabilities.fields":`已注册字段`,"capabilities.goalPolicy":`Goal 能力策略`,"capabilities.goalScope":`Goal`,"capabilities.goalValue":`当前 Goal 值`,"capabilities.loadFailed":`无法加载 Goal 能力`,"capabilities.larkInboxNotificationDescription":`此开关只控制遇到人工 Gate 时是否自动发群消息;关闭后仍会保留飞书事件收件箱能力。`,"capabilities.larkInboxNotificationSetting":`Gate 群通知`,"capabilities.loading":`正在加载 Goal 能力…`,"capabilities.machineOnly":`此能力只能在机器作用域配置。`,"capabilities.machineValue":`实时机器默认值`,"capabilities.machineScope":`机器`,"capabilities.previewOnly":`当前读取结果来自真实配置;在 revision-locked preview/apply 路径接通前,Dashboard 不会提供 Goal 写入控件。`,"capabilities.preview":`锁定 revision 的变更预览`,"capabilities.previewChanges":`预览变更`,"capabilities.restoreInheritance":`恢复继承机器默认值`,"capabilities.previewFailed":`无法预览 Goal 能力变更。`,"capabilities.previewLocked":`应用时会重新校验这一个 plan revision;过期变更将被拒绝。`,"capabilities.partialWrite":`Goal 值已保存;共享投影仍需修复`,"capabilities.partialWriteDescription":`源 Goal 配置已经写入并回读,但共享 runtime 投影尚未同步;请勿重复提交本次变更。`,"capabilities.refreshSource":`刷新源配置`,"capabilities.readOnly":`只读能力`,"capabilities.revisionLockedReady":`所有变更必须先预览;只有对应的精确 revision 仍然有效时才会写入。`,"capabilities.retry":`重试`,"capabilities.source.capability_default":`能力默认值`,"capabilities.source.goal_override":`Goal override`,"capabilities.source.machine_default":`实时机器默认值`,"capabilities.source.not_configured":`未配置`,"capabilities.title":`Goal 能力`,"settings.close":`关闭设置`,"settings.appearance":`外观`,"settings.appearanceDescription":`管理当前浏览器里的工作区显示偏好。`,"settings.appearanceTabDescription":`主题和显示偏好`,"settings.capabilitiesTabDescription":`当前 Goal 的能力覆盖配置`,"settings.back":`返回工作区`,"settings.categories":`设置分类`,"settings.description":`管理工作区偏好与集成。`,"settings.eyebrow":`工作区偏好`,"settings.general":`通用`,"settings.goalConnections":`Goal 连接`,"settings.language":`语言`,"settings.modelProvider":`模型 Provider 配置`,"settings.globalCapabilities":`全局能力配置`,"settings.languageDescription":`选择 LoopX Desktop 工作区使用的界面语言。`,"settings.languageEnglishDescription":`使用英文显示导航、设置和工作区控件。`,"settings.languageEnglish":`English`,"settings.languageSimplifiedChineseDescription":`使用简体中文显示导航、设置和工作区控件。`,"settings.languageSimplifiedChinese":`简体中文`,"settings.languageStoredLocally":`此偏好仅保存在当前设备。`,"settings.languageTabDescription":`当前设备的界面语言`,"settings.larkTabDescription":`App、群聊和 Goal Topic 连接`,"settings.machineTabDescription":`本机各 Capability 共享的 typed defaults`,"settings.notifications":`通知`,"settings.open":`设置`,"settings.themeDefault":`纸张`,"settings.themeDefaultDescription":`安静、轻量,适合长期查看。`,"settings.themeDescription":`选择工作区的视觉风格。设置会保存在当前浏览器本地。`,"settings.themeHighContrast":`高对比`,"settings.themeHighContrastDescription":`更强边框和更醒目的状态块。`,"settings.themeLoopx":`LoopX 标准`,"settings.themeLoopxDescription":`精确的黑白界面、Geist 字体与安静的细线结构。`,"settings.title":`设置`,"settings.workspaceDisplay":`工作区显示`,"settings.workspaceTheme":`工作区主题`,"session.closeRecord":`退出运行记录`,"session.details":`Session 详情`,"session.record":`执行 Session · 运行记录`,"session.recordDescription":`当前时间线已切换到这次 Session 的消息与 Turn 记录。`,"sidebar.createGoal":`创建 Goal`,"sidebar.delete":`删除`,"sidebar.deleteGoal":`删除 Goal`,"sidebar.manager":`LoopX 管家`,"sidebar.notifications":`设置`,"sidebar.owner":`个人工作区`,"sidebar.product":`个人 Agent 工作区`,"sidebar.resume":`恢复`,"sidebar.resumeGoal":`恢复 Goal`,"sidebar.stop":`停止`,"tasks.historyLoading":`正在加载历史…`,"tasks.historyError":`历史加载失败,已显示的内容仍可查看。`,"tasks.historyExpired":`历史快照已过期,重新加载后可继续查看。`,"tasks.historyRetry":`重新加载`,"tasks.historyEnd":`已显示全部完成记录`,"tasks.historyMore":`加载更多`,"tasks.historyLocalOnly":`请打开这台机器的 Dashboard 查看完整历史。`,"sidebar.sortGoals":`调整 Goal 顺序`,"sidebar.dragGoal":`拖拽调整顺序,或使用列表排序按钮`,"sidebar.moveUp":`上移 {goal}`,"sidebar.moveDown":`下移 {goal}`,"sidebar.goalMoved":`{goal} 已移至第 {position} 位`,"sidebar.orderNotSaved":`顺序已在本次页面生效;浏览器存储不可用,无法保存。`,"sidebar.stopGoal":`停止 Goal`,"sidebar.stopped":`已停止`,"sidebar.stoppedLoading":`正在加载已停止 Goal`,"sidebar.stoppedLoadFailed":`已停止 Goal 加载失败,其他 Goal 仍可使用。`,"sidebar.retryStopped":`重试`,"state.completed":`已完成`,"state.needsRepair":`需修复`,"state.needsYou":`等你`,"state.quiet":`安静运行`,"state.running":`推进中`,"state.stopped":`已停止`,"state.waiting":`等待条件`,"tasks.blocked":`受阻`,"tasks.agentLane":`工作 Agent`,"tasks.agentLaneDescription":`筛选这个 Goal 下的工作泳道`,"tasks.agentLaneFilter":`按工作 Agent 筛选`,"tasks.allAgentLanes":`全部 Agent({count})`,"tasks.chatAgentReplied":`Agent 已回复`,"tasks.chatPending":`已发送给 Agent`,"tasks.chatPendingDescription":`正在处理;只有经过确认的任务操作才会更新 Tasks。`,"tasks.chatRecent":`最近对话`,"tasks.chatUnchangedDescription":`本次对话没有直接修改 Tasks。需要执行时,可先转成 Task 草稿并确认。`,"tasks.chatViewReply":`查看回复`,"tasks.convertToTask":`转为 Task`,"tasks.completed":`已完成`,"runs.discoveryPartial":`部分执行详情暂不可用,正在重连;任务摘要不代表实时执行状态。`,"runs.discoveryOffline":`执行服务暂不可用,正在重连;保留的任务摘要可能已过时。`,"files.openConversation":`前往会话`,"files.exportSummary":`导出摘要`,"tasks.viewDescription":`先处理待确认,再查看工作与完成记录`,"tasks.viewLabel":`任务视图`,"tasks.listView":`列表`,"tasks.boardView":`看板`,"tasks.completedSummary":`已完成 {count} 项,近期完成明细由控制面按需投影。`,"tasks.emptyCompleted":`还没有完成的任务。`,"tasks.emptyConfirm":`没有待确认的任务。`,"tasks.emptyRunning":`没有待执行或进行中的任务。`,"tasks.emptySchedules":`没有定时任务。`,"tasks.emptyGoal":`这个 Goal 还没有任务。用下面的输入框描述下一步,LoopX 会先展示待确认操作。`,"tasks.markComplete":`标记完成:{name}`,"tasks.moreActions":`更多操作:{name}`,"tasks.openExecution":`查看执行过程:{name}`,"tasks.pending":`待处理`,"tasks.pendingAndRunning":`待执行 / 进行中`,"tasks.scheduled":`定时与持续`,"tasks.sessionError":`Session 异常`,"tasks.waiting":`待执行`,"tasks.waitingAge":`已等待 {age}`,"tasks.viewExecution":`查看执行过程`,"tasks.viewResult":`查看结果`,"time.days":`{count} 天`,"time.hours":`{count} 小时`,"timeline.emptyGoal":`这个 Goal 还没有新动态`,"timeline.emptyGoalDescription":`你可以直接询问进度或下发新的纠偏信息。`,"timeline.emptyWorkspace":`今天的工作区很安静`,"timeline.emptyWorkspaceDescription":`向 LoopX 管家描述一个 Goal,或询问今天最值得关注的事情。`,"timeline.gateHistory":`{count} 项历史 Gate`,"timeline.pending":`正在整理…`,"returnDelivery.queued":`结论等待回传`,"returnDelivery.verifying":`正在核验送达,不会重复发送`,"returnDelivery.delivered":`已送达原受众`,"returnDelivery.reconciled":`恢复后已核验送达`,"returnDelivery.unverified":`送达仍明确未核验`,"timeline.runCompleted":`{run}:已完成`,"timeline.review":`查看处理方式`,"timeline.reviewAndConfirm":`查看并确认`,"timeline.waitingConfirmation":`待你确认`}};function Gi(e,t){return t?Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,String(n)),e):e}function Ki(){try{return window.localStorage.getItem(`loopx-pw-locale`)===`en`?`en`:`zh-CN`}catch{return`zh-CN`}}function qi({children:e}){let[t,n]=(0,z.useState)(Ki);function r(e){n(e);try{window.localStorage.setItem(Ui,e)}catch{}}(0,z.useEffect)(()=>{document.documentElement.lang=t},[t]);let i=(0,z.useMemo)(()=>({locale:t,setLocale:r,t:(e,n)=>Gi(Wi[t][e],n)}),[t]);return(0,B.jsx)(Hi.Provider,{value:i,children:e})}function Ji(){let e=(0,z.useContext)(Hi);if(!e)throw Error(`useWorkspaceI18n must be used within WorkspaceI18nProvider`);return e}function Yi(e,t){let n={安静运行:`state.quiet`,等你:`state.needsYou`,等待条件:`state.waiting`,推进中:`state.running`,需修复:`state.needsRepair`,已完成:`state.completed`,已停止:`state.stopped`}[e];return n?Wi[t][n]:e}function Xi(e,t){let n={busy:`runs.running`,completed:`runs.completed`,failed:`runs.failed`,queued:`runs.queued`,ready:`runs.ready`,resume_failed:`runs.resumeFailed`,running:`runs.running`,waiting:`runs.waiting`};return e?n[e]?t(n[e]):e:t(`runs.unknown`)}function Zi(e,t){if(!e)return null;let n=new Date(e).getTime();if(Number.isNaN(n))return null;let r=Date.now()-n;if(r<36e5)return null;let i=Math.floor(r/864e5);return i>=1?t(`time.days`,{count:i}):t(`time.hours`,{count:Math.floor(r/36e5)})}var Qi;function H(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;en?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var $i=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ea=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Qi=globalThis).__zod_globalConfig??(Qi.__zod_globalConfig={});var ta=globalThis.__zod_globalConfig;function na(e){return e&&Object.assign(ta,e),ta}function ra(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ia(e,t){return typeof t==`bigint`?t.toString():t}function aa(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function oa(e){return e==null}function sa(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ca(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){};function ga(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var _a=aa(()=>{if(ta.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function va(e){if(ga(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ga(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ya(e){return va(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ba=new Set([`string`,`number`,`symbol`]);function xa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Sa(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ca(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var wa={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ta(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Sa(e,fa(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return da(this,`shape`,e),e},checks:[]}))}function Ea(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Sa(e,fa(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return da(this,`shape`,r),r},checks:[]}))}function Da(e,t){if(!va(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Sa(e,fa(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return da(this,`shape`,n),n}}))}function Oa(e,t){if(!va(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Sa(e,fa(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return da(this,`shape`,n),n}}))}function ka(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Sa(e,fa(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return da(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Aa(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Sa(t,fa(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return da(this,`shape`,i),i},checks:[]}))}function ja(e,t,n){return Sa(t,fa(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return da(this,`shape`,i),i}}))}function Ma(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Fa(e){return typeof e==`string`?e:e?.message}function Ia(e,t,n){let r=e.message?e.message:Fa(e.inst?._zod.def?.error?.(e))??Fa(t?.error?.(e))??Fa(n.customError?.(e))??Fa(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function La(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ra(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var za=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ia,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ba=H(`$ZodError`,za),Va=H(`$ZodError`,za,{Parent:Error});function Ha(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ua(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new $i;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Ia(e,a,na())));throw ha(t,i?.callee),t}return o.value},Ga=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Ia(e,a,na())));throw ha(t,i?.callee),t}return o.value},Ka=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new $i;return a.issues.length?{success:!1,error:new(e??Ba)(a.issues.map(e=>Ia(e,i,na())))}:{success:!0,data:a.value}},qa=Ka(Va),Ja=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Ia(e,i,na())))}:{success:!0,data:a.value}},Ya=Ja(Va),Xa=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Wa(e)(t,n,i)},Za=e=>(t,n,r)=>Wa(e)(t,n,r),Qa=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ga(e)(t,n,i)},$a=e=>async(t,n,r)=>Ga(e)(t,n,r),eo=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ka(e)(t,n,i)},to=e=>(t,n,r)=>Ka(e)(t,n,r),no=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ja(e)(t,n,i)},ro=e=>async(t,n,r)=>Ja(e)(t,n,r),io=/^[cC][0-9a-z]{6,}$/,ao=/^[0-9a-z]+$/,oo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,so=/^[0-9a-vA-V]{20}$/,co=/^[A-Za-z0-9]{27}$/,lo=/^[a-zA-Z0-9_-]{21}$/,uo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,fo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,po=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,mo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ho=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function go(){return new RegExp(ho,`u`)}var _o=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,yo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,bo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,So=/^[A-Za-z0-9_-]*$/,Co=/^https?$/,wo=/^\+[1-9]\d{6,14}$/,To=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Eo=RegExp(`^${To}$`);function Do(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Oo(e){return RegExp(`^${Do(e)}$`)}function ko(e){let t=Do({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${To}T(?:${r})$`)}var Ao=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},jo=/^-?\d+$/,Mo=/^-?\d+(?:\.\d+)?$/,No=/^(?:true|false)$/i,Po=/^null$/i,Fo=/^[^A-Z]*$/,Io=/^[^a-z]*$/,Lo=H(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ro={number:`number`,bigint:`bigint`,object:`date`},zo=H(`$ZodCheckLessThan`,(e,t)=>{Lo.init(e,t);let n=Ro[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{Lo.init(e,t);let n=Ro[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vo=H(`$ZodCheckMultipleOf`,(e,t)=>{Lo.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ca(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ho=H(`$ZodCheckNumberFormat`,(e,t)=>{Lo.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=wa[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=jo)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Uo=H(`$ZodCheckMaxLength`,(e,t)=>{var n;Lo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!oa(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value;if(r.length<=t.maximum)return;let i=La(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wo=H(`$ZodCheckMinLength`,(e,t)=>{var n;Lo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!oa(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=La(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Go=H(`$ZodCheckLengthEquals`,(e,t)=>{var n;Lo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!oa(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=La(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ko=H(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Lo.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),qo=H(`$ZodCheckRegex`,(e,t)=>{Ko.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jo=H(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Fo,Ko.init(e,t)}),Yo=H(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Io,Ko.init(e,t)}),Xo=H(`$ZodCheckIncludes`,(e,t)=>{Lo.init(e,t);let n=xa(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Zo=H(`$ZodCheckStartsWith`,(e,t)=>{Lo.init(e,t);let n=RegExp(`^${xa(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Qo=H(`$ZodCheckEndsWith`,(e,t)=>{Lo.init(e,t);let n=RegExp(`.*${xa(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),$o=H(`$ZodCheckOverwrite`,(e,t)=>{Lo.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),es=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` +通知:仅在需要我时`,"composer.nextAction":`询问下一步`,"composer.nextActionPrompt":`我现在该做什么?`,"composer.send":`发送`,"composer.sendMessage":`向 LoopX 发送消息`,"composer.sendMessageHint":`发送消息`,"composer.sentImageAlt":`移除图片 {name}`,"conversation.agentPending":`正在整理…`,"conversation.close":`关闭对话回执`,"conversation.convertHint":`将 Agent 最新回复转为 Task 草稿`,"conversation.full":`查看完整对话`,"conversation.receipt":`对话回执`,"conversation.replying":`正在回复`,"conversation.title":`管家对话`,"conversation.toTask":`转为 Task`,"digest.away":`自上次访问以来的运行记录`,"digest.completed":`新增完成运行`,"digest.failed":`新增失败或中断`,"digest.needsYou":`当前待确认`,"feedback.applying":`正在执行:{title}`,"feedback.cancelFailed":`取消失败:{error}`,"feedback.completed":`已完成:{title}`,"feedback.executionFailed":`执行失败:{error}`,"feedback.gateRequired":`需要你确认:{summary}`,"feedback.notCompleted":`操作未完成:{status}`,"feedback.goalRefreshFailed":`已打开 Goal,但暂时无法刷新最新状态。请点击刷新重试。`,"feedback.preparingPreview":`正在准备确认预览:{title}`,"feedback.previewFailed":`无法准备确认预览:{error}`,"feedback.sendFailed":`发送失败:{error}`,"feedback.sendGenericError":`消息发送失败,请稍后重试。`,"feedback.stale":`状态已变化,操作未执行,请重新生成确认预览。`,"feedback.taskDraftCreated":`已根据回复生成 Task 草稿。编辑后发送,LoopX 会先展示确认预览。`,"goal.defaultTitle":`新的个人 Goal`,"goal.initialTodo":`按完成标准推进:{criteria}`,"goal.objectiveBoundary":`执行边界:{boundary}`,"goal.objectiveCompletion":`完成标准:{criteria}`,"drawer.advancedDiagnostics":`高级诊断`,"drawer.agentWorking":`Agent 正在继续执行,记录会自动更新。`,"drawer.analysis":`正在分析`,"drawer.apply":`确认并应用`,"drawer.applying":`正在应用…`,"drawer.attentionBlocking":`正在阻塞 Agent`,"drawer.attentionWaiting":`等待你的决定`,"drawer.autoNotify":`Human-gate 自动通知`,"drawer.branch":`分支`,"drawer.closeDetail":`关闭详情:返回{context}`,"drawer.connected":`已连接`,"drawer.correctionDescription":`消息会沿用当前 Goal、Todo 与 Agent Session 上下文。`,"drawer.correctionLabel":`与 {agent} 纠偏`,"drawer.correctionPlaceholder":`例如:先关注权限风险,暂时不要提交…`,"drawer.correctionSend":`发送纠偏`,"drawer.correctionTextarea":`输入纠偏信息:Goal {goal},Agent {agent},Run {run}`,"drawer.copyRepository":`复制仓库标识`,"drawer.copyRepositoryDone":`已复制仓库标识`,"drawer.copyRepositoryError":`复制失败,请检查浏览器剪贴板权限。`,"drawer.copyRepositorySuccess":`已复制,可粘贴到其他工具。`,"drawer.cost":`成本 24h / 7d`,"drawer.costShort":`成本`,"drawer.durationShort":`时长`,"drawer.period24h":`24 小时`,"drawer.period7d":`7 天`,"drawer.tokens":`Token 24 小时 / 7 天`,"drawer.tokensShort":`Token`,"drawer.usageNotMeasured":`未采集`,"drawer.currentGoal":`当前 Goal`,"attentionDetail.title":`事项说明`,"attentionDetail.request":`需要你做什么`,"attentionDetail.decision":`需要作出决定`,"attentionDetail.unknownRequest":`来源未明确,请先查看来源再判断`,"attentionDetail.open":`当前投影中待处理`,"attentionDetail.closed":`已关闭`,"attentionDetail.deferred":`已推迟`,"attentionDetail.superseded":`已被替代`,"attentionDetail.unknown":`来源未提供状态`,"attentionDetail.unavailable":`来源尚未确认当前事项,请刷新后再操作`,"attentionDetail.unknownReason":`来源尚未提供原因。`,"attentionDetail.targetTodo":`关联的待解锁 Todo`,"attentionDetail.targetAgent":`事项指定的 Agent`,"attentionDetail.scope":`声明的决策范围`,"attentionDetail.notProvided":`来源未提供`,"attentionDetail.replacement":`替代 Todo`,"attentionDetail.openReplacement":`打开替代事项`,"attentionDetail.boundary":`阅读详情不会关闭 gate 或授予权限;作出决定前仍需新的操作预览。`,"drawer.decisionDefaultEvidence":`当前状态没有附加公开安全证据;下一步仍会先展示 Preview。`,"drawer.decisionDefaultReason":`该决定会影响当前 Todo 的下一步执行。`,"drawer.decisionDefer":`稍后决定`,"drawer.decisionMore":`更多决定`,"drawer.decisionReject":`拒绝`,"drawer.decisionReview":`查看影响并决定`,"drawer.dependencies":`依赖`,"drawer.detailsAndActions":`详情与操作`,"drawer.duration":`运行时长 24h / 7d`,"drawer.evidence":`证据`,"drawer.executionHistory":`执行历史`,"drawer.executionRecord":`运行记录`,"drawer.executionRecordAndResult":`执行过程与结果`,"drawer.explainDecision":`解释此决定`,"drawer.gateApproveHint":`在终端执行一条命令即可完成审批:`,"drawer.gateRejectHint":`不同意就把末尾的 approve 换成 reject。执行后这条提醒会自动消失。`,"drawer.gateRequiresHost":`需要宿主确认`,"drawer.gateRequiresHostDescription":`页面无权直接批准这类权限变更,你的点击没有写入任何内容。`,"drawer.goalAutoRun":`当前 Goal 的自动运行`,"drawer.goalChanges":`当前 Goal 的待确认变更`,"drawer.goalDetails":`Goal 详情`,"drawer.group":`群聊`,"drawer.inspectorFull":`切换到全屏`,"drawer.inspectorFullView":`全屏查看`,"drawer.inspectorHalf":`切换到半屏`,"drawer.inspectorHalfView":`半屏查看`,"drawer.lastNotification":`最近通知`,"drawer.larkConfigure":`管理 Lark connection`,"drawer.larkConnect":`连接 Lark App`,"drawer.larkConnection":`Lark connection`,"drawer.larkNotConfigured":`未配置`,"drawer.larkNotConfiguredDescription":`配置后,当这个 Goal 出现需要你确认的变更时,会自动发飞书通知。`,"drawer.managerChanges":`管家待确认变更`,"drawer.moreActions":`更多操作`,"drawer.moreRunActions":`更多运行操作`,"drawer.nextTransition":`下一转换`,"drawer.noExecutionHistory":`暂无执行记录。`,"drawer.noRun":`尚未启动执行 Session`,"drawer.noRunDescription":`Agent 开始执行后,运行记录会稳定显示在这里。`,"drawer.notAssigned":`未分配`,"drawer.notLinked":`未关联`,"drawer.notSet":`未设置`,"drawer.outputDetails":`产出详情`,"drawer.outputRecorded":`该产出已记录到当前 Goal。`,"drawer.outputSafePreview":`公开安全产出预览`,"drawer.outputRun":`Run`,"drawer.outputTodo":`Todo`,"drawer.outputs":`本次运行产出`,"drawer.previewUnavailable":`此产出没有可用的公开安全内联预览。`,"drawer.priority":`优先级`,"drawer.progress":`进度`,"drawer.proposalApplied":`已应用,LoopX 状态将刷新。`,"drawer.proposalApplyFailed":`应用失败,没有写入任何变更。`,"drawer.proposalApplyFailedHint":`请刷新 Goal 状态后重新生成;若仍失败,可保留此页并查看高级诊断。`,"drawer.proposalClose":`关闭`,"drawer.proposalDefer":`稍后`,"drawer.proposalDeferred":`已暂缓,可稍后继续应用或重新生成。`,"drawer.proposalEnterGoal":`进入新 Goal`,"drawer.proposalExplainer":`确认后,LoopX 会执行这项变更并显示写入结果。关闭或取消不会修改任何状态。`,"drawer.proposalRecheck":`按最新状态重新检查`,"drawer.proposalRegenerate":`基于最新状态重试`,"drawer.proposalRejected":`已拒绝,这项变更不会写入。`,"drawer.proposalStale":`来源状态已变化,请按最新状态重新检查。`,"drawer.proposalViewGoal":`查看更新后的 Goal`,"drawer.reassign":`改派给`,"drawer.reassignSummary":`重新分配:{task}`,"drawer.reason":`原因`,"drawer.recoveryDescription":`本地历史已经保留,请选择恢复路径。`,"drawer.recoveryFailed":`上游 Session 恢复失败`,"drawer.recoveryNewSession":`携带上下文开始新 Session`,"drawer.recoveryRetry":`重试恢复`,"drawer.repositoryRole":`执行工作区`,"drawer.repository":`仓库`,"drawer.replyMode":`回复方式`,"drawer.subagentApplied":`已写入,并通过共享 Goal 状态读回校验。`,"drawer.subagentAppliedRefreshFailed":`已写入并通过共享 Goal 状态读回;状态投影刷新失败,可稍后手动刷新。`,"drawer.subagentApplying":`正在写入并校验共享状态读回…`,"drawer.subagentApplyFailed":`子代理设置写入失败。`,"drawer.subagentChildLimit":`当前上限`,"drawer.subagentConfirmDisable":`确认关闭子代理执行`,"drawer.subagentConfirmEnable":`确认开启子代理执行`,"drawer.subagentCurrentBoundary":`当前任务领域限制`,"drawer.subagentDescription":`仅在 Todo、配额、能力和写入范围门禁全部通过后,允许运行时为相互独立的任务临时创建子代理;不会强制并行,也不会授予持久权限。`,"drawer.subagentDisable":`预览关闭子代理执行`,"drawer.subagentDisableSummary":`这个 Goal 将不再创建新的子代理;现有 Todo 归属和执行记录不受影响。`,"drawer.subagentDomainInvalid":`所选任务领域限制无效。`,"drawer.subagentDomainTodoCount":`匹配 {count} 个开放 Todo`,"drawer.subagentDomains":`任务领域限制(可选)`,"drawer.subagentDomainsEmpty":`当前没有开放的 advancement Todo 声明 task_domain;保持为空即可不按任务领域限制子代理执行。`,"drawer.subagentDomainsHint":`全部不选表示不按任务领域过滤;选择后只放行匹配且已声明领域的 Todo,其他执行门禁始终生效。`,"drawer.subagentDomainsUnrestricted":`不限制任务领域`,"drawer.subagentEnable":`预览开启子代理执行`,"drawer.subagentLabel":`Per-Goal 执行边界`,"drawer.subagentModel":`子 Agent 模型`,"drawer.subagentEffort":`子 Agent 推理档位`,"drawer.subagentModelDefault":`宿主默认`,"drawer.subagentLunaPreset":`使用 Luna / max`,"drawer.subagentClearModel":`清除模型偏好`,"drawer.subagentModelHint":`填写后通过“预览配置调整”保存,执行关闭时也可保存偏好;启动时须核验宿主支持情况。`,"drawer.subagentModelRequired":`设置推理档位前请先指定子 Agent 模型。`,"drawer.subagentMaxChildren":`最多子代理数`,"drawer.subagentNoChange":`当前 Goal 已是这个设置,没有写入任何内容。`,"drawer.subagentPending":`待确认`,"drawer.subagentPreviewBoundary":`预览配置调整`,"drawer.subagentPreviewFailed":`无法生成子代理设置预览。`,"drawer.subagentPreviewing":`正在核对最新 Goal 状态…`,"drawer.subagentPreviewReady":`预览已锁定,确认后才会写入这个 Goal。`,"drawer.subagentPreviewSummary":`最多允许创建 {count} 个子代理;任务领域限制:{domains}。`,"drawer.subagentRemoteReadOnly":`当前来源只读,请在 Goal 所在主机上修改。`,"drawer.subagentTitle":`自适应子代理执行`,"drawer.remoteDetailsDescription":`SSH 来源只展示公开安全状态,不读取来源主机上的连接配置。`,"drawer.remoteDetailsUnavailable":`远端详情未投影`,"drawer.resumeNo":`否`,"drawer.resumeYes":`是`,"drawer.runDetails":`执行 Session`,"drawer.runInterrupt":`中断本次运行`,"drawer.runLatest":`查看最近执行过程`,"drawer.runNewSession":`开始新 Session`,"drawer.runCloseSession":`关闭 Session`,"drawer.runRecordEmpty":`还没有运行记录。Agent 尚未开始这次执行;请在“详情与操作”查看等待条件或恢复 Session。`,"drawer.runRecordProjected":`当前没有可展示的逐步运行记录。LoopX 已读取到 {completed}/{total} 的投影进度{outputs};请在“详情与操作”检查 Session 状态。`,"drawer.runRecordProjectedOutputs":`和 {count} 项产出`,"drawer.runRoleAssistant":`已完成`,"drawer.runRoleSystem":`需检查`,"drawer.runRoleUser":`收到任务`,"drawer.runView":`Session 视图`,"drawer.scheduleAdd":`添加定时检查`,"drawer.scheduleDefaultNotification":`仅在需要你时通知`,"drawer.scheduleDefaultStop":`Goal 完成或 owner 停止`,"drawer.scheduleDefaultTarget":`由 LoopX 调度器按 Goal 配置唤醒。`,"drawer.scheduleEdit":`改为每 2 小时`,"drawer.scheduleLast":`上次执行`,"drawer.scheduleLocalTimezone":`本地时区`,"drawer.scheduleNext":`下次执行`,"drawer.scheduleNeverRun":`尚未执行`,"drawer.scheduleNotification":`通知`,"drawer.schedulePause":`暂停`,"drawer.schedulePending":`等待调度`,"drawer.scheduleResume":`恢复`,"drawer.scheduleRunNow":`立即运行`,"drawer.scheduleStop":`停止{kind}`,"drawer.scheduleStopCondition":`停止条件`,"drawer.scheduleTimezone":`时区`,"drawer.sessionRecoverable":`可恢复`,"drawer.sessionStatus":`会话状态`,"drawer.setupHeartbeat":`设置 Heartbeat`,"drawer.taskActions":`Todo 待确认操作`,"drawer.taskAdvancement":`推进任务`,"drawer.taskBlock":`标记阻塞`,"drawer.taskComplete":`标记完成`,"drawer.taskCompletedNote":`该任务保留为只读记录。`,"drawer.taskCompletedTitle":`任务已完成`,"drawer.taskDefer":`暂缓`,"drawer.taskDeferCondition":`Todo 暂缓恢复条件`,"drawer.taskDeferInvalid":`条件格式不受支持;请使用下列可判定条件。`,"drawer.taskDeferPlaceholder":`例如 resume_at:2026-09-14T09:00:00+08:00`,"drawer.taskDeferReview":`检查暂缓`,"drawer.taskDeferSupported":`支持 todo_done、pr_merged、capacity_available 与带时区的 resume_at 条件。`,"drawer.taskDeferUntil":`暂缓至`,"drawer.taskDetails":`Todo 详情`,"drawer.taskInfo":`任务信息`,"drawer.taskManage":`管理任务`,"drawer.taskNextCompleted":`可创建后续任务`,"drawer.taskNextOpen":`推进或更新状态`,"drawer.taskOrdinary":`普通任务`,"drawer.taskStatusBlocked":`受阻`,"drawer.taskStatusDeferred":`已延期`,"drawer.resumeWhen":`恢复条件`,"drawer.resumeState":`恢复状态`,"drawer.resumePending":`等待条件满足`,"drawer.resumeReady":`可恢复`,"drawer.resumeReceipt":`恢复回执`,"drawer.taskNextDeferred":`等待恢复条件满足后重新评估`,"drawer.taskNextResumeReady":`恢复条件已满足,等待生命周期重新规划`,"drawer.taskStatusCompleted":`已完成`,"drawer.taskStatusOpen":`待执行`,"drawer.taskSuccessor":`创建后续 Todo`,"drawer.taskSuccessorNote":`Owner 标记为阻塞,等待补充上下文。`,"drawer.taskSuccessorSummary":`创建后续 Todo:{task}`,"drawer.taskSuccessorText":`{task} 的后续工作`,"drawer.taskType":`任务类型`,"drawer.topic":`Topic`,"drawer.trigger":`触发方式`,"drawer.titleAttention":`需要你`,"drawer.titleOutput":`产出详情`,"drawer.titleProposalApplied":`执行结果`,"drawer.titleProposalConfirm":`确认执行`,"drawer.titleSchedule":`定时检查`,"drawer.unconfigured":`未配置`,"drawer.workspaceCandidates":`可选择的工作区`,"files.emptySummary":`公开安全产出`,"files.empty":`还没有文件、产出或已验证的阶段周报。`,"files.loadingReports":`正在加载已验证的阶段周报…`,"files.reportDelta":`+{added} 新增 · {changed} 变化`,"files.reportAdded":`新增`,"files.reportChanged":`变化`,"files.reportGeneration":`生成批次`,"files.reportLoadFailed":`无法加载已验证周报`,"files.reportPublication":`发布批次`,"files.title":`Files & Outputs`,"files.verifiedReport":`已验证阶段周报`,"header.agentUnavailable":`不可用`,"header.chatRuntime":`Chat`,"header.workAgentCount":`{count} 个工作 Agent`,"header.overview":`概览`,"header.chat":`对话`,"header.files":`成果`,"header.goalCapabilities":`能力配置`,"header.goalCapabilitiesDescription":`管理 Goal override 与继承的本机默认值。`,"header.goalDetails":`Goal 详情`,"header.goalDetailsDescription":`查看状态、用量、仓库、通知与 Session。`,"header.goalSettings":`Goal 设置`,"header.goalSettingsDescription":`配置此 Goal 的能力`,"header.goalNavigation":`Goal 导航`,"header.goalView":`Goal 视图`,"header.live":`实时`,"header.manager":`LoopX 管家`,"header.managerDescription":`跨 Goal 的个人工作入口`,"header.managerRuntime":`{profile} · {sandbox}`,"header.managerRuntimeFallback":`配置无效,已回退到 {profile} · {sandbox};请在机器能力设置中修复。`,"header.managerExecutorKindIndividual":`个人 CLI 登录`,"header.managerExecutorKindManaged":`operator 凭据`,"header.managerExecutorKindRegistered":`注册端点`,"header.managerExecutionUnavailable":`所选执行器 {executor} 无法在本机启动;该通道不会回落到个人 CLI 登录。`,"header.managerExecutionUnavailableCredential":`所选执行器 {executor} 需要 operator 凭据 {credential},配置后该通道才能启动它。`,"header.managerExecutionUnavailableRuntime":`所选执行器 {executor} 无法在本机启动:本机未安装其 runtime。`,"header.managerExecutionUnavailableEffort":`所选执行器 {executor} 拒绝了当前配置的推理档位;请改为受支持的档位后刷新。`,"header.managerEndpointStewardDefault":`当前运行 {executor},管家通道的出货默认值;如需改指请显式选择执行器。`,"header.managerOverview":`总览`,"header.managerView":`管家视图`,"header.openGoalNavigation":`打开 Goal 导航`,"header.readOnlySourceDescription":`{source} 通过 SSH 隧道只读展示`,"header.refresh":`刷新状态`,"header.refreshDone":`刚刚更新`,"header.refreshFailed":`刷新失败`,"header.refreshing":`刷新中`,"header.selectAgent":`选择 Agent`,"header.selectChatRuntime":`选择聊天 Runtime`,"header.tasks":`任务`,"header.themeBrutal":`切换到野兽主题`,"header.themePaper":`切换到默认主题`,"home.blockingSummary":`其中 {count} 项正在阻塞 Agent。`,"home.completedGoals":`已完成的 Goal`,"home.empty":`当前没有`,"startup.goalLoading":`正在加载状态…`,"startup.goalError":`状态加载失败`,"startup.progress":`已加载 {loaded} / {total} 个活跃 Goal`,"startup.partial":`Goal 状态正在逐个更新,当前统计尚不完整。`,"startup.independent":`此 Goal 的加载不会阻塞其他 Goal,你可以先查看已加载的内容。`,"startup.error.timeout":`读取超时,可在本地服务就绪后重试。`,"startup.error.network":`连接中断,请重试以重新连接。`,"startup.error.service":`Goal 状态读取失败。请稍后重试;若问题持续,请检查状态来源。`,"startup.error.access":`状态来源无法访问此 Goal 所需的文件或运行时目录。请检查该来源运行账户的访问权限,修复后重试。`,"startup.error.revision":`加载期间 Goal 目录发生变化,请刷新以同步。`,"startup.error.scope":`该 Goal 已不在当前来源中,请刷新目录。`,"startup.error.invalid":`无法解析状态响应,请刷新或检查 LoopX 更新。`,"startup.retry":`重试`,"startup.retryFailed":`重试失败的 Goal`,"startup.failedCount":`{count} 个 Goal 加载失败,已加载的 Goal 可继续使用。`,"home.greeting":`你好,我是 LoopX 管家`,"home.history":`历史`,"home.lane.needsYou":`需要你`,"home.lane.needsYouDescription":`等待你的决定、授权或补充信息`,"home.lane.observing":`观察中`,"home.lane.observingDescription":`持续监控,出现变化时再提醒你`,"home.lane.running":`执行中`,"home.lane.runningDescription":`Agent 正在推进并持续回传进展`,"home.lane.scheduled":`已安排`,"home.lane.scheduledDescription":`已经安排,等待时间或前置条件`,"home.noActivity":`尚无活动`,"home.noFirstActivity":`等待首次活动`,"home.noCompletedGoals":`还没有已完成的 Goal`,"home.preservedState":`保留状态,可随时恢复`,"home.stopped":`已停止`,"home.systemHealth":`系统健康:{summary}`,"home.taskCount":`{count} 个 Task`,"home.todayAt":`今天 {time}`,"home.waitingCount":`你有 {count} 项需要处理。`,"home.workspace":`Goal 工作区`,"lark.allMessages":`此 Topic 中的所有消息`,"lark.allTopicMessages":`所有 Topic 消息`,"lark.agentIngress":`Agent 入站方式`,"lark.agentAppPermissions":`每个选中的 Agent 都需要一个已具备群聊提及和回复能力的 Lark App。`,"lark.agentApps":`每个 Agent 的 Lark App`,"lark.agentAppsDescription":`默认使用上方 App;需要独立机器人身份时,可为 Agent 选择另一个兼容 App。`,"lark.agentAppSelection":`{agent} 的 Lark App`,"lark.appCreated":`App 已创建`,"lark.appCreateFailed":`创建失败`,"lark.appLoading":`正在加载可用的 Lark Apps…`,"lark.appPermissions":`该 App 能发送建联消息,但缺少接收群聊 @ 消息或自动回复所需的机器人权限。请开启 im:message.group_at_msg:readonly、im:message.send_as_bot 和事件 im.message.receive_v1,发布新版后刷新。`,"lark.appProfile":`Lark App`,"lark.apps":`Lark Apps`,"lark.autoReplyUnavailable":`自动回复暂不可用`,"lark.autoReplyReady":`自动回复可用`,"lark.bindGoal":`绑定到 Goal`,"lark.cancel":`取消`,"lark.cardinality":`一个 Lark App · 多个 Goal · 每个 Agent 一条隔离路由`,"lark.capture":`接收范围`,"lark.captureAddressed":`仅接收提及 App 或回复 App 的消息`,"lark.captureAll":`接收此 Goal Topic 中的所有消息`,"lark.captureScope":`接收范围`,"lark.captureScopeDescription":`决定哪些 Topic 消息会进入 LoopX;不会扩大 Agent 权限。`,"lark.closeConnection":`关闭连接弹窗`,"lark.closeCreate":`关闭创建弹窗`,"lark.closeSettings":`关闭 Lark 设置`,"lark.connect":`连接`,"lark.connectAllAgents":`连接全部已注册 Agent`,"lark.connectAllAgentsAction":`一键连接 {count} 个 Agent`,"lark.connectAllAgentsDescription":`一次引导创建 {count} 个隔离的 Agent Topic;请在对应 Topic 内发送请求,每个 Agent 保留独立路由和收件箱。`,"lark.connectApp":`连接 Lark App`,"lark.connection":`连接`,"lark.connections":`连接`,"lark.configuration":`Lark 配置`,"lark.continueFeishu":`在飞书中继续`,"lark.createAutomatically":`自动创建 Goal Topic`,"lark.createAutomaticallyDescription":`将为每个选中的 Agent 创建带 Agent 标识的专属 Topic。`,"lark.defaultAgentAppDescription":`用于查找目标群聊,并作为所有选中 Agent 的默认 App;下方的逐 Agent 选择可覆盖它。`,"lark.description":`管理可复用的 Lark App,并用独立 Topic 将群聊连接到 Goal。`,"lark.editConnection":`编辑 Lark 连接`,"lark.goalConnections":`{count} 个 Goal 连接`,"lark.goalTopicConnections":`Lark Goal Topic 连接`,"lark.groupChat":`群聊`,"lark.groupEmpty":`该机器人尚未加入可连接的群。请先在飞书群设置中添加这个机器人,再回来刷新或搜索。`,"lark.groupLoading":`正在读取该机器人已加入的群…`,"lark.groupSearch":`搜索该机器人已加入的群`,"lark.historyPermission":`历史补读权限(独立能力)`,"lark.health.contextCaptured":`已捕获群聊上下文`,"lark.health.contextCapturedDetail":`该消息仅作为非权威上下文保留,不会启动或引导管家 Turn;需要执行时请直接 @ 机器人或回复机器人的消息。`,"lark.health.eventProcessed":`已处理 {events} 条事件,成功回复 {replies} 条。`,"lark.health.eventUnverified":`事件订阅待验证`,"lark.health.eventUnverifiedDetail":`Provider listener 已就绪,但尚未收到消息事件。请启用 im.message.receive_v1、开通群聊 @ 消息权限并发布新版,然后在这个 Agent Topic 内发送新的 @ 消息;存在多条 Agent 路由时,群顶层消息会 fail closed。`,"lark.health.ignoredSelf":`已忽略机器人自身发送的消息,避免重复回复。`,"lark.health.invalidRouting":`路由配置无效`,"lark.health.invalidRoutingDetail":`连接已安全停用,请重新选择处理方式并保存。`,"lark.health.lastStatus":`最近事件状态:{status}`,"lark.health.listening":`监听中`,"lark.health.messageContextPermission":`消息权限不足`,"lark.health.messageContextPermissionDetail":`已收到消息事件,但无法读取群消息上下文。请发布并授权该 App 的群消息读取权限。`,"lark.health.notAddressed":`最近消息未直接 @ 机器人`,"lark.health.notAddressedDetail":`监听正常;当前连接只响应直接 @ 机器人或对机器人的回复。`,"lark.health.notStarted":`监听未启动`,"lark.health.notStartedDetail":`请刷新连接或重新启动 LoopX 后再试。`,"lark.health.processingFailed":`消息处理失败`,"lark.health.processingFailedDetail":`已收到消息事件,但 Agent 处理失败。请查看本地诊断后重试。`,"lark.health.queued":`已进入 Agent 收件箱`,"lark.health.queuedDetail":`消息由 {agent} 异步处理,不会启动通用 Chat Session。`,"lark.health.sourceDisconnected":`实时消息连接断开`,"lark.health.sourceDisconnectedDetail":`消息监听进程意外退出。请核对应用档案的平台:飞书应用选飞书,国际版 Lark 应用选 Lark,再检查连接及订阅错误。LoopX 正在重试;历史消息能读取,不代表能实时收消息。`,"lark.health.retrying":`监听重试中`,"lark.health.retryingDetail":`事件监听暂时中断,LoopX 正在自动重试。`,"lark.health.routeAmbiguous":`消息匹配多个 Goal`,"lark.health.routeAmbiguousDetail":`同一 Bot 和群聊存在多个完整群捕获连接。请让每个 Agent 使用独立 Bot,或只保留一个完整群连接。`,"lark.health.routeMismatch":`消息未匹配当前 Goal Topic`,"lark.health.routeMismatchDetail":`事件来自其他群聊或 Topic。请重新选择群聊并连接该 Goal,然后发送一条新的 @ 消息。`,"lark.health.routeUnavailable":`消息无法路由到 Goal`,"lark.health.routeUnavailableDetail":`当前连接信息不完整。请重新连接该 Goal 后再发送一条新的 @ 消息。`,"lark.health.starting":`正在启动`,"lark.health.startingDetail":`LoopX 正在启动该 App 的消息事件监听。`,"lark.health.unavailable":`自动回复不可用`,"lark.health.waiting":`等待处理`,"lark.incomingMessages":`接收消息`,"lark.ingressAsync":`异步收件箱`,"lark.ingressAsyncDescription":`写入 Agent 私有收件箱,等待后续显式处理。`,"lark.editPreservesIdentity":`保存会保留此 App、群和 Topic;旧连接默认升级为 Agent 异步收件箱。`,"lark.conversationKind":`连接用途`,"lark.managerConversation":`管家 · 同步对话`,"lark.workerConversation":`工作 Agent · 后台任务`,"lark.managerConversationDescription":`内置管家即时回应对话,长任务交给后台 Agent。群聊与私聊分别保存上下文。`,"lark.ingressLegacy":`待升级`,"lark.ingressLegacyDescription":`保存连接即可升级为 Agent 异步收件箱,已有消息保留在原 Topic 中。`,"lark.ingressQueue":`排队`,"lark.ingressQueueDescription":`进入同一 Agent Session 的有界 FIFO 队列,当前 Turn 完成后处理。`,"lark.ingressSteering":`实时引导`,"lark.ingressSteeringDescription":`投到当前活跃 Turn;没有精确活跃 Turn 时安全拒绝。`,"lark.loading":`加载 Lark 配置…`,"lark.management":`Lark 管理`,"lark.openEventSettings":`查看飞书事件配置`,"lark.mentions":`提及机器人`,"lark.mentionsOnly":`仅提及消息`,"lark.needsMessagePermissions":`需要消息权限`,"lark.needsSetup":`需要设置`,"lark.newApp":`新建 Lark App`,"lark.noAgentConfigured":`未配置 Agent`,"lark.noConnections":`暂无匹配的连接。`,"lark.noProfiles":`还没有可用的 lark-cli App profile。`,"lark.profileName":`Profile 名称`,"lark.profileValidation":`Profile 只能包含字母、数字、点、下划线和连字符。`,"lark.processing":`处理方式`,"lark.region":`区域`,"lark.registerAnother":`+ 注册另一个 Lark App — 通过飞书创建`,"lark.reopenFeishu":`重新打开飞书`,"lark.settingsConfigure":`配置 {goal}`,"lark.settingsDisconnect":`解绑 {goal}`,"lark.replyMode":`回复方式`,"lark.replyModeDescription":`当前只支持在来源 Topic 内回复,避免跨群或跨 Goal 投递。`,"lark.reusableApps":`{count} 个可复用 App`,"lark.reusableWorkspaceApp":`可复用工作区 App`,"lark.routesUnverified":`{count} 条 Lark 路由尚未验证`,"lark.saveConnection":`保存连接`,"lark.searchConnections":`搜索 Lark 连接`,"lark.searchPlaceholder":`搜索 App、群、Goal 或 Topic`,"lark.setupCopy":`LoopX 将通过 lark-cli 打开飞书官方创建页面。应用凭证保存在系统 Keychain,LoopX 只保留 profile 引用。`,"lark.someoneMentions":`有人提及 Agent`,"lark.targetAgent":`目标 Agent`,"lark.targetAgentDescription":`选择该 Goal 内已注册的 Agent。此连接只投递给一个 Agent,不广播、不授予新权限。实时引导与排队需要该 Agent 的精确活跃 Session。`,"lark.agentUnavailable":`{agent} · 已不可用`,"lark.selectRegisteredAgent":`请先选择可用的已注册 Agent;不会自动替换原先的接收者。`,"lark.topicPreview":`Topic 预览`,"lark.topicReply":`Topic 回复`,"lark.trigger":`触发方式`,"lark.waitingFeishu":`等待飞书完成创建`,"lark.waitingFeishuDescription":`请在新窗口中完成飞书授权,完成后会自动回到这里。`,"lark.waitingLink":`正在生成飞书官方创建链接…`,"lark.error.appCreate":`Lark App 创建失败`,"lark.error.appRequired":`请选择一个 Lark App profile。`,"lark.error.bind":`绑定失败`,"lark.error.bindPreview":`绑定预览失败`,"lark.error.configuration":`Lark 配置加载失败`,"lark.error.groupLookup":`无法读取该机器人已加入的群。请检查机器人状态后重试。`,"lark.error.groupLoad":`群聊加载失败`,"lark.error.invalidApp":`Lark App profile 不可用或尚未完成授权。`,"lark.error.messagePermissions":`该 App 缺少自动回复所需的机器人权限。请开启 im:message.group_at_msg:readonly 和 im:message:send_as_bot,发布新版后回来刷新重试。`,"lark.error.provider":`飞书 API 调用失败,且没有生成已验证回执。请稍后重试。`,"lark.error.setupPoll":`创建状态查询失败`,"lark.error.setupStart":`无法启动 Lark App 创建流程`,"lark.error.cliExecutable":`已找到配置的 lark-cli,但当前无法执行。请检查安装或启动参数。`,"lark.error.cliMissing":`未发现 lark-cli。请先安装 lark-cli,然后重新启动 LoopX。`,"lark.error.cliStart":`lark-cli 启动失败。请检查安装状态,然后重新启动 LoopX。`,"lark.error.disconnect":`解绑失败`,"notifications.autoNotify":`需要你确认时自动推送到群里`,"notifications.bind":`绑定到通知群`,"notifications.bindConfirm":`将把「{goal}」绑定到通知群「{target}」,绑定时会验证机器人在群内并发送一条确认消息。`,"notifications.bindFailed":`绑定失败`,"notifications.bound":`已绑定`,"notifications.confirmBind":`确认绑定`,"notifications.description":`把 Goal 里需要你确认的变更推送到飞书群。绑定和开关在这里完成,推送逻辑沿用现有通道。`,"notifications.disabled":`已停用`,"notifications.group":`通知群:{target}`,"notifications.loadFailed":`通知群列表加载失败`,"notifications.noTargets":`还没有可用的通知群。通知群涉及机器人私有身份,请先在终端配置一次:`,"notifications.notBound":`未绑定`,"notifications.recent":`最近 {time}`,"notifications.sentCount":`已发送 {count} 条`,"notifications.settings":`Goal 通知绑定`,"notifications.setupFailed":`设置失败`,"notifications.title":`飞书群通知`,"proposal.field.agentId":`Agent`,"proposal.field.cadence":`频率`,"proposal.field.completionCriteria":`完成标准`,"proposal.field.executionBoundary":`执行边界`,"proposal.field.goalId":`Goal ID`,"proposal.field.heartbeat":`Heartbeat`,"proposal.field.initialTodos":`首个任务`,"proposal.field.objective":`目标`,"proposal.field.operation":`操作`,"proposal.field.operationState":`操作状态`,"proposal.field.resultDelivery":`结果回传`,"proposal.field.confirmationBoundary":`确认边界`,"proposal.field.expiresAt":`过期时间`,"proposal.field.permission":`权限`,"proposal.field.reason":`原因`,"proposal.field.stopCondition":`停止条件`,"proposal.field.target":`检查内容`,"proposal.field.timezone":`时区`,"proposal.field.title":`标题`,"proposal.field.workspace":`执行工作区`,"actionReview.targetChanged":`预览目标与请求的 Goal 或操作不一致,请重新生成预览。`,"actionReview.ready_stop":`暂停可恢复。此预览已通过检查,可直接执行;完成仍需要读回验证。`,"actionReview.resume_review":`恢复自动调度前需要确认。实际执行仍受额度、Gate 和 Todo 约束。`,"actionReview.delete_review":`请确认从注册表移除这个已停止 Goal。项目文件与历史记录会保留。`,"actionReview.action_review":`执行前请检查此提案的目标与影响。`,"actionReview.protected_action":`此操作需要明确审阅。确认不能替代所需授权。`,"actionReview.unknown_permission":`无法识别权限分类。请重新检查提案后再继续。`,"actionReview.unknown_action":`无法识别此生命周期操作。请重新检查提案后再继续。`,"actionReview.incomplete_proposal":`预览缺少验证信息或可执行转换。请重新生成预览。`,"actionReview.authority_gate":`Gate 阻止执行。请满足其要求后重新检查提案。`,"actionReview.stale_proposal":`来源状态已变化。请重新生成预览,原决定不再适用。`,"actionReview.apply_pending":`正在执行,请等待读回结果后再重试。`,"actionReview.readback_verified":`操作已完成,结果状态已通过读回验证。`,"actionReview.readback_unverified":`操作返回但未通过读回验证。尚不能确认完成,请重新检查状态。`,"actionReview.operation_group_confirmation":`这份精确请求只能在已绑定飞书群的原始卡片确认;Dashboard 不提供本地执行入口。`,"actionReview.operation_result_delivery_pending":`操作结果已经记录,但原群结果卡尚未通过回读核验。`,"drawer.recoverEditResult":`恢复编辑结果`,"drawer.retryOriginal":`重试原操作`,"actionReview.canonical_update_retry":`编辑结果尚未确认。重试此操作以恢复原结果。`,"actionReview.canonical_update_projection_pending":`编辑已提交,展示尚未同步。重试此操作以恢复当前视图。`,"actionReview.apply_failed":`执行未完成。请检查失败原因并重新生成预览后再试。`,"actionReview.inactive_proposal":`此提案当前不可执行。请重新检查后再继续。`,"proposal.gate.default":`需要宿主确认`,"proposal.impact.default":`确认后会调用规范 LoopX 服务写入状态。`,"proposal.impact.goalCreate":`确认后会创建 Goal 和首个 Todo,并让选定 Agent 开始首轮推进。`,"proposal.impact.lifecycleDelete":`确认后会从 source registry 和 global registry 移除这个已停止 Goal;项目文件、历史状态文件和备份不会被删除。`,"proposal.impact.lifecycleResume":`确认后会恢复 Goal 的自动调度资格并移回 Active Goals;实际执行仍受 quota、Gate 和 Todo 约束。`,"proposal.impact.lifecycleStop":`确认后会停止自动推进,并将 Goal 移入折叠的「已停止」列表;历史、Todo 和证据都会保留,可随时恢复。`,"proposal.impact.protected":`该操作需要通过受保护的 LoopX 写入服务完成。`,"proposal.impact.operation":`这里仅展示同一份不可变条款。请在已绑定的飞书群确认或拒绝;确认只会消费一个规范 claim。`,"proposal.primary.apply":`确认并应用`,"proposal.primary.goalCreate":`创建 Goal 并开始首轮`,"proposal.primary.lifecycleDelete":`删除 Goal`,"proposal.primary.lifecycleResume":`恢复 Goal`,"proposal.primary.lifecycleStop":`停止 Goal`,"proposal.primary.todoStart":`创建任务并开始执行`,"proposal.primary.operationGroup":`前往飞书群确认`,"proposal.primary.operationResultPending":`结果卡回传待恢复`,"proposal.primary.operationResultVerified":`结果已核验`,"proposal.resultDelivery.verified":`已在原群卡片完成回读核验`,"proposal.resultDelivery.pending":`等待回传并核验原群卡片`,"proposal.summary.goalCreate":`创建 Goal:{title}`,"proposal.summary.heartbeat":`为当前 Goal 设置 Heartbeat`,"proposal.summary.lifecycleDelete":`删除 Goal:{title}`,"proposal.summary.lifecycleResume":`恢复 Goal:{title}`,"proposal.summary.lifecycleStop":`停止 Goal:{title}`,"proposal.summary.monitor":`为当前 Goal 创建定时检查:{target}`,"proposal.teamPlan.gapReason.capabilityNotGranted":`尚未授予所需能力`,"proposal.teamPlan.gapReason.audienceNotAuthorized":`尚未获得所需访问权限`,"proposal.teamPlan.pending":`待安排`,"proposal.teamPlan.assignedHint":`分配已记录,执行进度请查看目标。`,"proposal.teamPlan.recoveredHint":`未新增任务,当前进度请查看目标。`,"proposal.teamPlan.originalPlan":`查看原计划`,"proposal.teamPlan.viewResult":`查看结果`,"proposal.teamPlan.openGoal":`打开目标`,"proposal.teamPlan.resultTitle":`分配结果`,"proposal.teamPlan.retry":`重试分配`,"proposal.teamPlan.retryHint":`重试会恢复本次分配结果,不会重复创建任务。`,"proposal.summary.teamPlan":`为 {goal} 分配 {count} 项任务`,"proposal.impact.teamPlan":`确认后分配可安排的任务,其余保留为待安排。`,"proposal.primary.teamPlan":`确认分配`,"proposal.field.laneGaps":`未配齐的 lane`,"proposal.field.quotaEnvelope":`配额包络`,"proposal.teamPlan.acceptanceShort":`验收参考`,"proposal.teamPlan.advisory":`计划参考;本次确认不执行该约束`,"proposal.teamPlan.appliedPartially":`已分配 {created} 项,{gaps} 项待安排`,"proposal.teamPlan.appliedAlreadyPresent":`已恢复原分配结果`,"proposal.teamPlan.applied":`已分配 {count} 项任务`,"proposal.teamPlan.gapLane":`待安排`,"proposal.teamPlan.laneUnstaffed":`待安排,尚无任务`,"proposal.teamPlan.gapReason.agentNotRegistered":`尚未加入此目标`,"proposal.teamPlan.gapReason.actionKindNotSupported":`当前环境不支持此任务类型`,"proposal.workspace.current":`当前本地工作区(未绑定 Repository)`,"proposal.workspace.named":`{workspace}(仅提供执行环境,不会自动关联仓库)`,"proposal.workspaceGate.agentImpact":`先完成 Agent 身份绑定,再重新检查原操作;当前没有写入 Goal。`,"proposal.workspaceGate.agentTitle":`先绑定 Agent`,"proposal.workspaceGate.defaultSummary":`请选择 Goal 所属工作区。`,"proposal.workspaceGate.selectionImpact":`选择工作区后会重新展示待确认操作,选择本身不会写入状态。`,"proposal.workspaceGate.selectionTitle":`选择 Goal 工作区`,"projection.agentAdvancingGoal":`Agent 正在推进当前 Goal`,"projection.agentIdle":`暂无需要你处理`,"projection.agentNeedsDecision":`Agent 等待你的决定`,"projection.agentPreparingNextStep":`Agent 正在整理下一步`,"projection.agentStopped":`已由你停止;历史、Todo 和证据仍保留`,"projection.agentWaitingExternal":`正在等待外部条件`,"projection.confirmAgentDecision":`请确认 Agent 下一步需要的权限或决策`,"projection.events24h":`24 小时内 {count} 个事件`,"projection.firstReadOnlyAdapterCheck":`执行首次只读适配检查并保存进度`,"projection.goalVerified":`Goal 状态、Todo 与注册信息已验证`,"projection.latestRun":`最近运行`,"projection.latestValidation":`最近验证`,"projection.nextUpdatePending":`等待 LoopX 更新下一步`,"projection.publicSafeProjection":`公开安全状态投影`,"projection.refreshState":`刷新 LoopX 状态,确认当前进度仍然有效`,"projection.runEvidenceAvailable":`存在可查看的运行证据`,"projection.runRecorded":`最近一次 LoopX 运行已经记录`,"projection.statusRefreshNeeded":`LoopX 状态需要刷新`,"projection.todoStatusUpdated":`Todo 状态已经更新,正在确认下一步`,"projection.validationRecorded":`最近验证已经记录`,"runs.completed":`已完成`,"runs.failed":`需检查`,"runs.interrupted":`已中断`,"runs.queued":`已安排`,"runs.ready":`可继续`,"runs.resumeFailed":`恢复失败`,"runs.running":`执行中`,"runs.unknown":`状态未知`,"runs.waiting":`等待条件`,"schedule.active":`执行中`,"schedule.heartbeat":`Goal Heartbeat`,"schedule.monitor":`定时与持续任务`,"schedule.paused":`已暂停`,"schedule.summary":`按 LoopX 调度约束持续检查`,"schedule.defaultTarget":`检查当前 Goal 的阻塞、进度与新产出`,"schedule.unsupportedCalendar":`当前定时检查不支持精确到星期或时刻的日历计划。请改用固定间隔,例如“每 30 分钟”“每 2 小时”或“每天”;草稿已保留,没有生成待确认操作。`,"source.add":`添加来源`,"source.addConfigured":`添加只读来源`,"source.addMethod":`来源添加方式`,"source.addSsh":`添加 SSH 隧道来源`,"source.closeForm":`关闭来源表单`,"source.configured":`已配置 SSH`,"source.configuredCount":`本机 SSH Host · {count} 个`,"source.configuredGroup":`已配置 SSH Host · {count}(点击快速添加)`,"source.connected":`已连接`,"source.connecting":`连接中`,"source.controlPlane":`控制面来源`,"source.copy":`复制`,"source.copyCommand":`复制 SSH 隧道命令`,"source.copyError":`无法复制命令,请手动复制下方命令。`,"source.copied":`已复制`,"source.description":`已读取全部显式 Host(含 Include);通配规则不会作为具体来源。先运行命令,LoopX 不读取密钥或配置细节。`,"source.host":`本机 SSH Host`,"source.hostEmpty":`~/.ssh/config 中没有可直接选择的显式 Host。`,"source.hostLoadError":`无法读取本机 SSH Host。`,"source.hostPlaceholder":`输入或搜索 Host`,"source.invalid":`SSH 来源参数无效。`,"source.loadingHosts":`正在读取…`,"source.localInteractive":`本机交互`,"source.localPort":`本地端口`,"source.manual":`手动 URL`,"source.manualDescription":`远端来源始终按只读投影处理,不继承本机写权限。`,"source.name":`名称`,"source.namePlaceholder":`远程开发机`,"source.notAvailable":`不可用`,"source.readOnly":`SSH 隧道 · 只读`,"source.readOnlyNoticeDescription":`你可以查看 Goal、Task、证据与运行状态;写入、纠偏和 Agent 会话仍留在来源主机。`,"source.readOnlyNoticeTitle":`远端只读投影`,"source.readOnlyWriteError":`远端 SSH 隧道来源是只读投影,不能执行控制面写入。`,"source.refreshHosts":`重新读取 SSH Host`,"source.remove":`移除来源 {source}`,"source.removeCurrent":`移除当前来源`,"source.select":`选择控制面来源`,"source.selectHost":`请选择已配置的 SSH Host。`,"source.statusUrl":`本地转发 URL`,"source.tunnelCommandPending":`选择 Host 后生成隧道命令`,"machine.absent":`尚未配置`,"machine.action.create":`创建机器策略`,"machine.action.delete":`移除机器策略`,"machine.action.unchanged":`无需写入`,"machine.action.update":`更新机器策略`,"machine.applied":`机器策略已应用,并通过回读校验。`,"machine.applyError":`无法应用机器策略。`,"machine.applyPreview":`应用已审阅预览`,"machine.changedNamespaces":`变更的 Namespace`,"machine.capabilityCatalog":`机器能力目录`,"machine.capabilityEmpty":`当前没有注册可在机器作用域配置的能力。`,"machine.configured":`已配置`,"machine.confirmRollback":`确认回滚`,"machine.currentRevision":`当前 Revision`,"machine.currentValue":`当前机器值`,"machine.description":`与 Goal 设置共用能力目录。在这里管理受支持的机器默认值;仅支持 Goal 配置的能力会明确标注。`,"capabilities.rawJson":`高级:原始 JSON`,"machine.goalOnly":`此能力目前仅支持 Goal 级配置。请打开具体 Goal 的能力设置进行配置;这里不会设置机器级默认值。`,"machine.desiredRevision":`目标 Revision`,"machine.editorUnavailable":`当前版本未安装此 Namespace 的编辑器`,"machine.editorUnavailableDescription":`它仍会显示在 Registry 中;安装或升级对应的 Dashboard 编辑器后才能修改。`,"machine.editorMode":`编辑模式`,"machine.liveDefault":`实时默认值;Goal 显式覆盖优先`,"machine.liveDefaultDescription":`没有显式覆盖的 Goal 会在该能力下一次决策时读取当前机器策略。修改或移除策略会立即影响这些已有 Goal;显式 Goal 覆盖保持固定。`,"machine.credentialTitle":`操作者模型凭据`,"machine.credentialDescription":`管家通道与托管宿主在本机认证用的 key 与 endpoint。key 单独存放于仅属主可读的文件,不会进入这里展示的机器配置,也不会被回读——回读的是它的指纹。`,"machine.credentialApiKey":`API key`,"machine.credentialApiKeyPlaceholder":`粘贴 key 以保存;留空则保留已存的 key`,"machine.credentialBaseUrl":`Endpoint base URL`,"machine.credentialBaseUrlPlaceholder":`https://endpoint.example/v1(留空则使用 endpoint 默认值)`,"machine.credentialStore":`保存凭据`,"machine.credentialClearKey":`清除已存 key`,"machine.credentialClearUrl":`清除已存 endpoint`,"machine.credentialConfigured":`已配置`,"machine.credentialAbsent":`未配置`,"machine.credentialInvalid":`无法读取——需要修复`,"machine.credentialSourceMachine":`本机已存凭据`,"machine.credentialSourceEnvironment":`服务环境变量`,"machine.credentialSourceUnset":`无来源`,"machine.credentialFingerprint":`指纹`,"machine.credentialStored":`凭据已保存。下一轮即生效,无需重启。`,"machine.credentialCleared":`已清除本机存储的凭据。`,"machine.credentialError":`凭据保存失败。`,"machine.credentialBoundary":`保存凭据不授予任何权限:它不会选择执行器、模型或推理强度。`,"machine.genericNamespaceDescription":`使用 JSON 编辑这个已注册 Namespace。LoopX 会先按 capability 自己拥有的 schema 校验,再允许预览写入。`,"machine.jsonConfiguration":`Namespace 配置(JSON)`,"machine.jsonConfigurationHelp":`只更新当前 Namespace;其他机器配置会保留,Apply 仍锁定到已审阅的 Preview Revision。`,"machine.jsonEditor":`JSON`,"machine.editJson":`编辑 JSON`,"capabilities.jsonConfiguration":`Goal 配置(JSON)`,"capabilities.jsonHelp":`仅编辑当前 Goal 的已注册字段。修改后需重新预览才能应用。`,"capabilities.jsonInvalid":`请输入合法的 JSON 对象,且仅包含已注册的可编辑字段。`,"machine.backToForm":`返回表单`,"machine.jsonInvalid":`请先填写一个合法的 JSON object,再预览变更。`,"machine.loadError":`无法读取机器配置。`,"machine.invalidStoredConfiguration":`已保存的机器配置需要修复`,"machine.invalidStoredConfigurationDescription":`已保存值不再符合当前契约,因此不会在这里显示。请检查已定位的能力,并通过“预览”和“应用”替换它;无关 namespace 保持不变。`,"machine.machinePolicy":`机器策略`,"machine.namespaceCount":`已注册 Namespace`,"machine.namespaces":`配置 Namespace`,"machine.periodicReport":`周期报告`,"machine.periodicReportDescription":`为所有未显式覆盖的 Goal 提供默认报告策略;Goal 调度与发送消费解析后的有效配置。`,"machine.periodicReportActivation":`开启后将在已验证的阶段节点自动投递`,"machine.periodicReportActivationDescription":`这不是每周定时器。当 LoopX 验证 Goal 已完成一个阶段时,Agent 会生成并冻结报告,随后通过配置的 Goal Channel 自动发送。启用此订阅即授予持续投递权;发送失败或路由漂移会 fail closed 并进入修复。`,"machine.changeQualityActivation":`质量验证是质量门禁,不是新增授权`,"machine.changeQualityActivationDescription":`继承该策略的 Goal 会验证最终精确 diff。safe_fix 只允许在既有写入权限内执行至多一次有界修复;此设置不会授予文件、权限或合并权。`,"machine.replanCadenceActivation":`复核周期只改变时机,不改变执行权限`,"machine.replanCadenceActivationDescription":`没有显式覆盖的 Goal 会在下一次复核决策前读取此阈值;它不会创建 Turn、消耗配额或授予权限。`,"machine.preview":`审阅机器配置变更`,"machine.previewChanges":`预览变更`,"machine.previewError":`无法生成机器策略预览。`,"machine.previewLocked":`应用操作锁定到当前 Revision;若机器状态变化,LoopX 会要求重新预览。`,"machine.previewRollback":`预览回滚`,"machine.previewRemoval":`预览移除`,"machine.profilePreset":`Profile preset`,"machine.profilePresetHelp":`由 capability 管理的 preset,例如 weekly-progress。`,"machine.registry":`Typed Registry`,"machine.requiredFields":`开启后必须填写 profile preset、Goal Channel route 与有效时区。`,"machine.revision":`机器 Revision`,"machine.revisionLockedReady":`所有变更必须先预览;只有对应的机器 Revision 仍然有效时才会应用。`,"machine.rollbackAvailable":`可回滚上一次应用`,"machine.rollbackDescription":`先预览已保存的前一 Revision,再决定是否恢复。`,"machine.rollbackError":`无法完成回滚。`,"machine.rollbackPreviewDescription":`前一 Revision 已准备恢复,请确认执行本次回滚。`,"machine.rolledBack":`已恢复前一版机器策略,并通过校验。`,"machine.removed":`机器策略已移除,并通过回读校验。`,"machine.routeRef":`Goal Channel route`,"machine.routeRefHelp":`只填写公开 route alias;凭据与 provider identifier 不会进入此表单。`,"machine.timezone":`时区`,"machine.timezoneHelp":`填写 IANA 时区,例如 Asia/Shanghai。`,"machine.title":`机器配置`,"machine.unchanged":`机器策略已与预览一致,本次没有写入。`,"machine.visualEditor":`引导式`,"capabilities.atomicOverride":`Goal override 按完整配置生效`,"capabilities.atomicOverrideDescription":`Goal 的完整配置优先于机器默认值;LoopX 不会在两个作用域之间逐字段拼接。`,"capabilities.applyFailed":`Goal 能力变更未写入。`,"capabilities.applyPreview":`应用此预览`,"capabilities.catalog":`Goal 能力目录`,"capabilities.chooseGoal":`请先选择一个 Goal,再查看它的能力配置。`,"capabilities.defaultValue":`声明的默认值`,"capabilities.description":`查看当前 Goal 可用的能力,以及每项配置的准确作用域。`,"capabilities.editorPrepared":`已注册 typed editor contract`,"capabilities.effectiveSource":`当前生效来源`,"capabilities.empty":`当前 Goal 没有可用的能力描述。`,"capabilities.fields":`已注册字段`,"capabilities.goalPolicy":`Goal 能力策略`,"capabilities.goalScope":`Goal`,"capabilities.goalValue":`当前 Goal 值`,"capabilities.loadFailed":`无法加载 Goal 能力`,"capabilities.larkInboxNotificationDescription":`此开关只控制遇到人工 Gate 时是否自动发群消息;关闭后仍会保留飞书事件收件箱能力。`,"capabilities.larkInboxNotificationSetting":`Gate 群通知`,"capabilities.loading":`正在加载 Goal 能力…`,"capabilities.machineOnly":`此能力只能在机器作用域配置。`,"capabilities.machineValue":`实时机器默认值`,"capabilities.machineScope":`机器`,"capabilities.previewOnly":`当前读取结果来自真实配置;在 revision-locked preview/apply 路径接通前,Dashboard 不会提供 Goal 写入控件。`,"capabilities.preview":`锁定 revision 的变更预览`,"capabilities.previewChanges":`预览变更`,"capabilities.restoreInheritance":`恢复继承机器默认值`,"capabilities.previewFailed":`无法预览 Goal 能力变更。`,"capabilities.previewLocked":`应用时会重新校验这一个 plan revision;过期变更将被拒绝。`,"capabilities.partialWrite":`Goal 值已保存;共享投影仍需修复`,"capabilities.partialWriteDescription":`源 Goal 配置已经写入并回读,但共享 runtime 投影尚未同步;请勿重复提交本次变更。`,"capabilities.refreshSource":`刷新源配置`,"capabilities.readOnly":`只读能力`,"capabilities.revisionLockedReady":`所有变更必须先预览;只有对应的精确 revision 仍然有效时才会写入。`,"capabilities.retry":`重试`,"capabilities.source.capability_default":`能力默认值`,"capabilities.source.goal_override":`Goal override`,"capabilities.source.machine_default":`实时机器默认值`,"capabilities.source.not_configured":`未配置`,"capabilities.title":`Goal 能力`,"settings.close":`关闭设置`,"settings.appearance":`外观`,"settings.appearanceDescription":`管理当前浏览器里的工作区显示偏好。`,"settings.appearanceTabDescription":`主题和显示偏好`,"settings.capabilitiesTabDescription":`当前 Goal 的能力覆盖配置`,"settings.back":`返回工作区`,"settings.categories":`设置分类`,"settings.description":`管理工作区偏好与集成。`,"settings.eyebrow":`工作区偏好`,"settings.general":`通用`,"settings.goalConnections":`Goal 连接`,"settings.language":`语言`,"settings.modelProvider":`模型 Provider 配置`,"settings.globalCapabilities":`全局能力配置`,"settings.languageDescription":`选择 LoopX Desktop 工作区使用的界面语言。`,"settings.languageEnglishDescription":`使用英文显示导航、设置和工作区控件。`,"settings.languageEnglish":`English`,"settings.languageSimplifiedChineseDescription":`使用简体中文显示导航、设置和工作区控件。`,"settings.languageSimplifiedChinese":`简体中文`,"settings.languageStoredLocally":`此偏好仅保存在当前设备。`,"settings.languageTabDescription":`当前设备的界面语言`,"settings.larkTabDescription":`App、群聊和 Goal Topic 连接`,"settings.machineTabDescription":`本机各 Capability 共享的 typed defaults`,"settings.notifications":`通知`,"settings.open":`设置`,"settings.themeDefault":`纸张`,"settings.themeDefaultDescription":`安静、轻量,适合长期查看。`,"settings.themeDescription":`选择工作区的视觉风格。设置会保存在当前浏览器本地。`,"settings.themeHighContrast":`高对比`,"settings.themeHighContrastDescription":`更强边框和更醒目的状态块。`,"settings.themeLoopx":`LoopX 标准`,"settings.themeLoopxDescription":`精确的黑白界面、Geist 字体与安静的细线结构。`,"settings.title":`设置`,"settings.workspaceDisplay":`工作区显示`,"settings.workspaceTheme":`工作区主题`,"session.closeRecord":`退出运行记录`,"session.details":`Session 详情`,"session.record":`执行 Session · 运行记录`,"session.recordDescription":`当前时间线已切换到这次 Session 的消息与 Turn 记录。`,"sidebar.createGoal":`创建 Goal`,"sidebar.delete":`删除`,"sidebar.deleteGoal":`删除 Goal`,"sidebar.manager":`LoopX 管家`,"sidebar.notifications":`设置`,"sidebar.owner":`个人工作区`,"sidebar.product":`个人 Agent 工作区`,"sidebar.resume":`恢复`,"sidebar.resumeGoal":`恢复 Goal`,"sidebar.stop":`停止`,"tasks.historyLoading":`正在加载历史…`,"tasks.historyError":`历史加载失败,已显示的内容仍可查看。`,"tasks.historyExpired":`历史快照已过期,重新加载后可继续查看。`,"tasks.historyRetry":`重新加载`,"tasks.historyEnd":`已显示全部完成记录`,"tasks.historyMore":`加载更多`,"tasks.historyLocalOnly":`请打开这台机器的 Dashboard 查看完整历史。`,"sidebar.sortGoals":`调整 Goal 顺序`,"sidebar.dragGoal":`拖拽调整顺序,或使用列表排序按钮`,"sidebar.moveUp":`上移 {goal}`,"sidebar.moveDown":`下移 {goal}`,"sidebar.goalMoved":`{goal} 已移至第 {position} 位`,"sidebar.orderNotSaved":`顺序已在本次页面生效;浏览器存储不可用,无法保存。`,"sidebar.stopGoal":`停止 Goal`,"sidebar.stopped":`已停止`,"sidebar.stoppedLoading":`正在加载已停止 Goal`,"sidebar.stoppedLoadFailed":`已停止 Goal 加载失败,其他 Goal 仍可使用。`,"sidebar.retryStopped":`重试`,"state.completed":`已完成`,"state.needsRepair":`需修复`,"state.needsYou":`等你`,"state.quiet":`安静运行`,"state.running":`推进中`,"state.stopped":`已停止`,"state.waiting":`等待条件`,"tasks.blocked":`受阻`,"tasks.agentLane":`工作 Agent`,"tasks.agentLaneDescription":`筛选这个 Goal 下的工作泳道`,"tasks.agentLaneFilter":`按工作 Agent 筛选`,"tasks.allAgentLanes":`全部 Agent({count})`,"tasks.chatAgentReplied":`对话有新回复`,"tasks.chatPending":`对话处理中`,"tasks.chatReturn":`协作回执`,"tasks.chatPendingDescription":`正在处理;只有经过确认的任务操作才会更新 Tasks。`,"tasks.chatRecent":`最近对话`,"tasks.chatUnchangedDescription":`本次对话没有直接修改 Tasks。需要执行时,可先转成 Task 草稿并确认。`,"tasks.chatViewReply":`查看回复`,"tasks.convertToTask":`转为 Task`,"tasks.completed":`已完成`,"runs.discoveryPartial":`部分执行详情暂不可用,正在重连;任务摘要不代表实时执行状态。`,"runs.discoveryOffline":`执行服务暂不可用,正在重连;保留的任务摘要可能已过时。`,"files.openConversation":`前往会话`,"files.exportSummary":`导出摘要`,"tasks.viewDescription":`先处理待确认,再查看工作与完成记录`,"tasks.viewLabel":`任务视图`,"tasks.listView":`列表`,"tasks.boardView":`看板`,"tasks.completedSummary":`已完成 {count} 项,近期完成明细由控制面按需投影。`,"tasks.emptyCompleted":`还没有完成的任务。`,"tasks.emptyConfirm":`没有待确认的任务。`,"tasks.emptyRunning":`没有待执行或进行中的任务。`,"tasks.emptySchedules":`没有定时任务。`,"tasks.emptyGoal":`这个 Goal 还没有任务。用下面的输入框描述下一步,LoopX 会先展示待确认操作。`,"tasks.markComplete":`标记完成:{name}`,"tasks.moreActions":`更多操作:{name}`,"tasks.openExecution":`查看执行过程:{name}`,"tasks.pending":`待处理`,"tasks.pendingAndRunning":`待执行 / 进行中`,"tasks.scheduled":`定时与持续`,"tasks.sessionError":`Session 异常`,"tasks.waiting":`待执行`,"tasks.waitingAge":`已等待 {age}`,"tasks.viewExecution":`查看执行过程`,"tasks.viewResult":`查看结果`,"time.days":`{count} 天`,"time.hours":`{count} 小时`,"timeline.emptyGoal":`这个 Goal 还没有新动态`,"timeline.emptyGoalDescription":`你可以直接询问进度或下发新的纠偏信息。`,"timeline.emptyWorkspace":`今天的工作区很安静`,"timeline.emptyWorkspaceDescription":`向 LoopX 管家描述一个 Goal,或询问今天最值得关注的事情。`,"timeline.gateHistory":`{count} 项历史 Gate`,"timeline.pending":`正在整理…`,"returnDelivery.queued":`结论等待回传`,"returnDelivery.verifying":`正在核验送达,不会重复发送`,"returnDelivery.delivered":`已送达原受众`,"returnDelivery.reconciled":`恢复后已核验送达`,"returnDelivery.unverified":`送达仍明确未核验`,"timeline.runCompleted":`{run}:已完成`,"timeline.review":`查看处理方式`,"timeline.reviewAndConfirm":`查看并确认`,"timeline.waitingConfirmation":`待你确认`}};function Gi(e,t){return t?Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,String(n)),e):e}function Ki(){try{return window.localStorage.getItem(`loopx-pw-locale`)===`en`?`en`:`zh-CN`}catch{return`zh-CN`}}function qi({children:e}){let[t,n]=(0,z.useState)(Ki);function r(e){n(e);try{window.localStorage.setItem(Ui,e)}catch{}}(0,z.useEffect)(()=>{document.documentElement.lang=t},[t]);let i=(0,z.useMemo)(()=>({locale:t,setLocale:r,t:(e,n)=>Gi(Wi[t][e],n)}),[t]);return(0,B.jsx)(Hi.Provider,{value:i,children:e})}function Ji(){let e=(0,z.useContext)(Hi);if(!e)throw Error(`useWorkspaceI18n must be used within WorkspaceI18nProvider`);return e}function Yi(e,t){let n={安静运行:`state.quiet`,等你:`state.needsYou`,等待条件:`state.waiting`,推进中:`state.running`,需修复:`state.needsRepair`,已完成:`state.completed`,已停止:`state.stopped`}[e];return n?Wi[t][n]:e}function Xi(e,t){let n={busy:`runs.running`,completed:`runs.completed`,failed:`runs.failed`,queued:`runs.queued`,ready:`runs.ready`,resume_failed:`runs.resumeFailed`,running:`runs.running`,waiting:`runs.waiting`};return e?n[e]?t(n[e]):e:t(`runs.unknown`)}function Zi(e,t){if(!e)return null;let n=new Date(e).getTime();if(Number.isNaN(n))return null;let r=Date.now()-n;if(r<36e5)return null;let i=Math.floor(r/864e5);return i>=1?t(`time.days`,{count:i}):t(`time.hours`,{count:Math.floor(r/36e5)})}var Qi;function H(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;en?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var $i=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ea=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Qi=globalThis).__zod_globalConfig??(Qi.__zod_globalConfig={});var ta=globalThis.__zod_globalConfig;function na(e){return e&&Object.assign(ta,e),ta}function ra(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ia(e,t){return typeof t==`bigint`?t.toString():t}function aa(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function oa(e){return e==null}function sa(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ca(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){};function ga(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var _a=aa(()=>{if(ta.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function va(e){if(ga(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ga(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ya(e){return va(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ba=new Set([`string`,`number`,`symbol`]);function xa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Sa(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ca(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var wa={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ta(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Sa(e,fa(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return da(this,`shape`,e),e},checks:[]}))}function Ea(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Sa(e,fa(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return da(this,`shape`,r),r},checks:[]}))}function Da(e,t){if(!va(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Sa(e,fa(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return da(this,`shape`,n),n}}))}function Oa(e,t){if(!va(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Sa(e,fa(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return da(this,`shape`,n),n}}))}function ka(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Sa(e,fa(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return da(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Aa(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Sa(t,fa(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return da(this,`shape`,i),i},checks:[]}))}function ja(e,t,n){return Sa(t,fa(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return da(this,`shape`,i),i}}))}function Ma(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Fa(e){return typeof e==`string`?e:e?.message}function Ia(e,t,n){let r=e.message?e.message:Fa(e.inst?._zod.def?.error?.(e))??Fa(t?.error?.(e))??Fa(n.customError?.(e))??Fa(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function La(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ra(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var za=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ia,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ba=H(`$ZodError`,za),Va=H(`$ZodError`,za,{Parent:Error});function Ha(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ua(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new $i;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Ia(e,a,na())));throw ha(t,i?.callee),t}return o.value},Ga=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Ia(e,a,na())));throw ha(t,i?.callee),t}return o.value},Ka=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new $i;return a.issues.length?{success:!1,error:new(e??Ba)(a.issues.map(e=>Ia(e,i,na())))}:{success:!0,data:a.value}},qa=Ka(Va),Ja=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Ia(e,i,na())))}:{success:!0,data:a.value}},Ya=Ja(Va),Xa=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Wa(e)(t,n,i)},Za=e=>(t,n,r)=>Wa(e)(t,n,r),Qa=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ga(e)(t,n,i)},$a=e=>async(t,n,r)=>Ga(e)(t,n,r),eo=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ka(e)(t,n,i)},to=e=>(t,n,r)=>Ka(e)(t,n,r),no=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ja(e)(t,n,i)},ro=e=>async(t,n,r)=>Ja(e)(t,n,r),io=/^[cC][0-9a-z]{6,}$/,ao=/^[0-9a-z]+$/,oo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,so=/^[0-9a-vA-V]{20}$/,co=/^[A-Za-z0-9]{27}$/,lo=/^[a-zA-Z0-9_-]{21}$/,uo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,fo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,po=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,mo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ho=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function go(){return new RegExp(ho,`u`)}var _o=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,yo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,bo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,So=/^[A-Za-z0-9_-]*$/,Co=/^https?$/,wo=/^\+[1-9]\d{6,14}$/,To=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Eo=RegExp(`^${To}$`);function Do(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Oo(e){return RegExp(`^${Do(e)}$`)}function ko(e){let t=Do({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${To}T(?:${r})$`)}var Ao=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},jo=/^-?\d+$/,Mo=/^-?\d+(?:\.\d+)?$/,No=/^(?:true|false)$/i,Po=/^null$/i,Fo=/^[^A-Z]*$/,Io=/^[^a-z]*$/,Lo=H(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ro={number:`number`,bigint:`bigint`,object:`date`},zo=H(`$ZodCheckLessThan`,(e,t)=>{Lo.init(e,t);let n=Ro[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{Lo.init(e,t);let n=Ro[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vo=H(`$ZodCheckMultipleOf`,(e,t)=>{Lo.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ca(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ho=H(`$ZodCheckNumberFormat`,(e,t)=>{Lo.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=wa[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=jo)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Uo=H(`$ZodCheckMaxLength`,(e,t)=>{var n;Lo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!oa(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value;if(r.length<=t.maximum)return;let i=La(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wo=H(`$ZodCheckMinLength`,(e,t)=>{var n;Lo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!oa(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=La(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Go=H(`$ZodCheckLengthEquals`,(e,t)=>{var n;Lo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!oa(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=La(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ko=H(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Lo.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),qo=H(`$ZodCheckRegex`,(e,t)=>{Ko.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jo=H(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Fo,Ko.init(e,t)}),Yo=H(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Io,Ko.init(e,t)}),Xo=H(`$ZodCheckIncludes`,(e,t)=>{Lo.init(e,t);let n=xa(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Zo=H(`$ZodCheckStartsWith`,(e,t)=>{Lo.init(e,t);let n=RegExp(`^${xa(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Qo=H(`$ZodCheckEndsWith`,(e,t)=>{Lo.init(e,t);let n=RegExp(`.*${xa(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),$o=H(`$ZodCheckOverwrite`,(e,t)=>{Lo.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),es=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(` `))}},ts={major:4,minor:4,patch:3},ns=H(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ts;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Ma(e),i;for(let a of t){if(a._zod.def.when){if(Na(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new $i;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Ma(e,t))});else{if(e.issues.length===t)continue;r||=Ma(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Ma(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new $i;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new $i;return o.then(e=>t(e,r,a))}return t(o,r,a)}}ua(e,`~standard`,()=>({validate:t=>{try{let n=qa(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ya(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),rs=H(`$ZodString`,(e,t)=>{ns.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ao(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),is=H(`$ZodStringFormat`,(e,t)=>{Ko.init(e,t),rs.init(e,t)}),as=H(`$ZodGUID`,(e,t)=>{t.pattern??=fo,is.init(e,t)}),os=H(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=po(e)}else t.pattern??=po();is.init(e,t)}),ss=H(`$ZodEmail`,(e,t)=>{t.pattern??=mo,is.init(e,t)}),cs=H(`$ZodURL`,(e,t)=>{is.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Co.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ls=H(`$ZodEmoji`,(e,t)=>{t.pattern??=go(),is.init(e,t)}),us=H(`$ZodNanoID`,(e,t)=>{t.pattern??=lo,is.init(e,t)}),ds=H(`$ZodCUID`,(e,t)=>{t.pattern??=io,is.init(e,t)}),fs=H(`$ZodCUID2`,(e,t)=>{t.pattern??=ao,is.init(e,t)}),ps=H(`$ZodULID`,(e,t)=>{t.pattern??=oo,is.init(e,t)}),ms=H(`$ZodXID`,(e,t)=>{t.pattern??=so,is.init(e,t)}),hs=H(`$ZodKSUID`,(e,t)=>{t.pattern??=co,is.init(e,t)}),gs=H(`$ZodISODateTime`,(e,t)=>{t.pattern??=ko(t),is.init(e,t)}),_s=H(`$ZodISODate`,(e,t)=>{t.pattern??=Eo,is.init(e,t)}),vs=H(`$ZodISOTime`,(e,t)=>{t.pattern??=Oo(t),is.init(e,t)}),ys=H(`$ZodISODuration`,(e,t)=>{t.pattern??=uo,is.init(e,t)}),bs=H(`$ZodIPv4`,(e,t)=>{t.pattern??=_o,is.init(e,t),e._zod.bag.format=`ipv4`}),xs=H(`$ZodIPv6`,(e,t)=>{t.pattern??=vo,is.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Ss=H(`$ZodCIDRv4`,(e,t)=>{t.pattern??=yo,is.init(e,t)}),Cs=H(`$ZodCIDRv6`,(e,t)=>{t.pattern??=bo,is.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function ws(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Ts=H(`$ZodBase64`,(e,t)=>{t.pattern??=xo,is.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{ws(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Es(e){if(!So.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ws(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Ds=H(`$ZodBase64URL`,(e,t)=>{t.pattern??=So,is.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Es(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Os=H(`$ZodE164`,(e,t)=>{t.pattern??=wo,is.init(e,t)});function ks(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var As=H(`$ZodJWT`,(e,t)=>{is.init(e,t),e._zod.check=n=>{ks(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),js=H(`$ZodNumber`,(e,t)=>{ns.init(e,t),e._zod.pattern=e._zod.bag.pattern??Mo,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Ms=H(`$ZodNumberFormat`,(e,t)=>{Ho.init(e,t),js.init(e,t)}),Ns=H(`$ZodBoolean`,(e,t)=>{ns.init(e,t),e._zod.pattern=No,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Ps=H(`$ZodNull`,(e,t)=>{ns.init(e,t),e._zod.pattern=Po,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Fs=H(`$ZodUnknown`,(e,t)=>{ns.init(e,t),e._zod.parse=e=>e}),Is=H(`$ZodNever`,(e,t)=>{ns.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ls(e,t,n){e.issues.length&&t.issues.push(...Pa(n,e.issues)),t.value[n]=e.value}var Rs=H(`$ZodArray`,(e,t)=>{ns.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;eLs(t,n,e))):Ls(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function zs(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Pa(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Bs(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Ca(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Vs(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>zs(e,n,i,t,u,d))):zs(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Hs=H(`$ZodObject`,(e,t)=>{if(ns.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=aa(()=>Bs(t));ua(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=ga,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>zs(n,t,e,s,r,i))):zs(a,t,e,s,r,i)}return i?Vs(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Us=H(`$ZodObjectJIT`,(e,t)=>{Hs.init(e,t);let n=e._zod.parse,r=aa(()=>Bs(t)),i=e=>{let t=new es([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=pa(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=pa(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(` if (${n}.issues.length) { @@ -121,15 +121,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. `);for(;i>=0;){let e=l.slice(0,i);l=l.slice(i+2);let n=ng(e);n&&(n.event_id&&(r=n.event_id),t(n),a=[`turn.completed`,`turn.interrupted`,`turn.failed`].includes(n.kind)),i=l.indexOf(` -`)}if(e||a)break}i=a?i:i+1}catch(e){if(n?.aborted||(i+=1,i>=4))throw e;await new Promise(e=>globalThis.setTimeout(e,250*2**(i-1)))}}if(!a)throw new Ih(`Agent 事件流连接已断开。`,{reconnect_attempts:i})}async function ig(e,t){return qh(`/api/chat/sessions/${e}/turns/${t}/interrupt`,{method:`POST`,body:`{}`})}async function ag(e,t,n={}){let r=await tg(e,t,n.clientTurnId??crypto.randomUUID(),n.attachments);return n.onPhase?.(`turn.accepted`,r.turn_id),og(e,r.turn_id,r.events_url,n)}async function og(e,t,n,r={}){let i=null,a={failure:null,interrupted:null};try{await rg(n,e=>{r.onPhase?.(e.kind,t),(e.kind===`answer.delta`||e.kind===`assistant.delta`)&&r.onDelta?.(String(e.payload.text??``)),e.kind===`agent.phase`&&r.onActivity?.(String(e.payload.label??`Agent 正在处理`)),e.kind===`turn.completed`&&(i=e.payload.response),e.kind===`turn.failed`&&(a.failure=e.payload),e.kind===`turn.interrupted`&&(a.interrupted=e.payload)},r.signal)}catch(i){throw i instanceof Ih&&!r.signal?.aborted?new Ih(i.message,{...i.payload,events_url:n,reconnectable:!0,session_id:e,turn_id:t}):i}if(a.failure)throw new Ih(String(a.failure.message||`Agent 回合失败。`),a.failure);if(a.interrupted)throw new Ih(`Agent 回合已中断。`,{...a.interrupted,error_code:`turn_interrupted`,session_id:e,turn_id:t});return{response:Ah.parse(i),sessionId:e,turnId:t}}async function sg(e,t,n={}){return og(e,t,`/api/chat/sessions/${e}/turns/${t}/events`,n)}async function cg(e){let t=jh.parse(await qh(`/api/chat/sessions/${e}`,{keepalive:!0,method:`DELETE`}));if(t.session_id!==e)throw new Ih(`Agent 会话关闭回执与本次请求不一致。`,{session_id:t.session_id});return t}async function lg(e){return qh(`/api/chat/sessions/${e}/resume`,{method:`POST`,body:`{}`})}function ug(e){return{goal_id:e.goalId,enabled:e.enabled,...e.modelConfig===void 0?{}:{model_config:e.modelConfig},...e.enabled?{max_children:e.maxChildren,allowed_domains:e.allowedDomains}:{}}}function dg(e,t){let n=e.after.orchestration,r=[...new Set(t.allowedDomains)],i=e.feature_summary.multi_subagent===`enabled`;if(!(e.goal_id===t.goalId&&i===t.enabled&&(t.modelConfig===void 0||JSON.stringify(n.model_config??null)===JSON.stringify(t.modelConfig))&&(t.enabled?n.max_children===t.maxChildren&&JSON.stringify(n.allowed_domains)===JSON.stringify(r):n.spawn_allowed===!1&&n.max_children===0)))throw new Ih(`Goal 子代理配置回执与本次请求不一致,界面已停止更新。`,{after:e.after,goal_id:e.goal_id});return e}async function fg(e){let t=Ph.parse(await qh(`/api/chat/goal-subagents/dry-run`,{method:`POST`,body:JSON.stringify(ug(e))}));if(!t.dry_run||t.execute||t.written)throw new Ih(`Goal 子代理预览返回了非预览回执,已停止进入确认状态。`,{result:t});return dg(t,e)}async function pg(e,t){let n=Ph.parse(await qh(`/api/chat/goal-subagents/apply`,{method:`POST`,body:JSON.stringify({...ug(e),preview_id:t})}));if(n.preview_id!==t||n.dry_run||!n.execute)throw new Ih(`Goal 子代理写入回执与本次确认不一致,界面已停止更新。`,{result:n});if(n.changed&&(!n.written||!n.global_sync.executed||!n.global_sync.readback.verified))throw new Ih(`Goal 子代理设置未通过共享状态读回验证。`,{result:n});return dg(n,e)}var mg=J({ok:X(!0),targets:q(J({enabled:K(),provider:W(),target_name:W()}))});async function hg(){return mg.parse(await qh(`/api/chat/goal-channel/targets`)).targets}var gg=J({ok:K(),blocker:W().optional(),public_summary:W().optional(),status:W().optional()});async function _g(e){return gg.parse(await qh(`/api/chat/goal-channel/setup`,{method:`POST`,body:JSON.stringify({execute:e.execute,goal_id:e.goalId,target:e.target})}))}async function vg(e){return gg.parse(await qh(`/api/chat/goal-channel/configure`,{method:`POST`,body:JSON.stringify({auto_notify_human_gates:e.autoNotify,goal_id:e.goalId})}))}var yg=J({schema_version:X(`periodic_report_schedule_v0`),schedule_id:W(),rrule:W(),timezone:W()});J({schema_version:X(`periodic_report_machine_defaults_v0`),enabled:K(),inheritance:X(`live_machine_default`),profile_preset:W().optional(),route_ref:W().optional(),timezone:W(),schedule:yg.nullable().optional()});var bg=J({schema_version:X(`loopx_machine_configuration_v0`),namespaces:yd(W(),yd(W(),ad()))}),xg=J({namespace:W(),title:W(),description:W(),schema_versions:q(W()).min(1),configuration_template:yd(W(),ad()),template_status:Y([`ready`,`schema_only`])}),Sg=J({schema_version:X(`machine_configuration_catalog_v0`),namespaces:q(xg)}),Cg=J({key:W(),label:W(),description:W(),input_kind:Y([`boolean`,`number`,`select`,`string_list`,`text`,`periodic_report_schedule`]),nullable:K().optional(),required:K(),minimum:G().int().optional(),maximum:G().int().optional(),options:q(W()).optional()}),wg=J({schema_version:X(`capability_configuration_editor_v0`),editable:K(),supported_scopes:q(Y([`goal`,`machine`])),writable_scopes:q(Y([`goal`,`machine`])),fields:q(Cg),read_only_reason:W().optional()}),Tg=J({schema_version:X(`capability_configuration_catalog_v0`),capabilities:q(J({capability_id:W(),display_name:W(),description:W(),available_scopes:q(Y([`goal`,`machine`])),machine_namespace:W().optional(),goal_feature_id:W().optional(),effective_value_policy:X(`goal_override_over_live_machine_default`).optional(),availability:W().optional(),default:yd(W(),ad()).optional(),current:yd(W(),ad()).optional(),machine_current:yd(W(),ad()).optional(),effective_configuration:J({schema_version:X(`capability_configuration_resolution_v0`),capability_id:W(),source:Y([`goal_override`,`machine_default`,`capability_default`,`not_configured`]),configuration:yd(W(),ad()).nullable(),inherited:K(),goal_override_present:K(),machine_default_present:K(),effective_revision:W()}).optional(),documentation:yd(W(),ad()).optional(),context_contribution:J({supported_phases:q(Y([`before_plan`,`before_delegate`,`after_delegate_result`])),target:X(`coordinator`),activation:X(`with_capability`),receipt_required:X(!0)}).optional(),configuration_editor:wg}))}),Eg=J({ok:X(!0),schema_version:X(`goal_configuration_inspection_v0`),status:X(`configured`),goal_id:W(),revision:W(),available_capabilities:q(W()),capability_catalog:Tg}),Dg=J({ok:X(!0),goal_id:W(),capability_id:W(),changed_fields:q(W()),goal_configuration:yd(W(),ad()).nullable(),capability_catalog:Tg}),Og=Dg.extend({schema_version:X(`goal_configuration_update_plan_v0`),status:X(`preview`),action:Y([`create`,`update`,`delete`,`unchanged`]),current_revision:W(),desired_revision:W(),base_revision:W(),plan_revision:W(),writes_required:G().int().nonnegative()}),kg=dd([Dg.extend({schema_version:X(`goal_configuration_transaction_v0`),status:Y([`applied`,`unchanged`]),plan_revision:W(),applied_revision:W(),readback_verified:X(!0)}),J({ok:X(!1),schema_version:X(`goal_configuration_transaction_v0`),status:X(`partial_write`),goal_id:W(),capability_id:W(),plan_revision:W(),applied_revision:W().nullable(),source_written:X(!0),shared_sync_pending:X(!0),readback_verified:K(),changed_fields:q(W()),goal_configuration:yd(W(),ad()).nullable(),capability_catalog:Tg,error:W(),recommended_action:W()})]),Ag=J({ok:X(!0),available_namespaces:q(W()),namespace_catalog:Sg.optional().default({schema_version:`machine_configuration_catalog_v0`,namespaces:[]}),capability_catalog:Tg,changed_namespaces:q(W()).optional().default([]),invalid_namespaces:q(W()).optional().default([]),machine_configuration:bg.nullable().optional()}),jg=Ag.extend({schema_version:X(`machine_configuration_inspection_v0`),status:Y([`configured`,`absent`,`invalid`]),revision:W()}),Mg=Ag.extend({schema_version:X(`machine_configuration_update_plan_v0`),status:X(`preview`),action:Y([`create`,`update`,`delete`,`unchanged`]),current_revision:W(),desired_revision:W(),plan_revision:W(),writes_required:G().int().nonnegative(),machine_configuration:bg.nullable()}),Ng=Ag.extend({schema_version:X(`machine_configuration_transaction_v0`),status:Y([`applied`,`unchanged`]),plan_revision:W(),transaction_id:W().nullable(),readback_verified:X(!0),rollback_available:K(),applied_revision:W().optional(),prior_revision:W().optional()}),Pg=Ag.extend({schema_version:X(`machine_configuration_rollback_plan_v0`),status:X(`preview`),action:Y([`delete`,`restore`,`unchanged`,`blocked`]),reason:W(),transaction_id:W(),plan_revision:W(),rollback_allowed:K(),writes_required:G().int().nonnegative()}),Fg=Ag.extend({schema_version:X(`machine_configuration_rollback_receipt_v0`),status:Y([`rolled_back`,`unchanged`]),transaction_id:W(),plan_revision:W(),rollback_id:W().nullable(),readback_verified:X(!0)}),Ig=J({configured:K(),source:Y([`machine_store`,`service_environment`,`unset`]),env_var:W().optional(),fingerprint:W().nullable().optional(),value:W().nullable().optional(),blocked_by:W().optional()}),Lg=J({ok:X(!0),schema_version:X(`operator_provider_credential_projection_v0`),action:W().optional(),store_ref:W(),store_revision:W(),record_present:K(),status:Y([`configured`,`absent`,`invalid`]),repair:W(),provider_key:Ig,base_url:Ig});async function Rg(){return Lg.parse(await qh(`/api/chat/operator-credential`))}async function zg(e){return Lg.parse(await qh(`/api/chat/operator-credential`,{method:`POST`,body:JSON.stringify(e)}))}async function Bg(){return jg.parse(await qh(`/api/chat/machine-configuration`))}async function Vg(e){let t=new URLSearchParams({goal_id:e});return Eg.parse(await qh(`/api/chat/goal-configuration?${t.toString()}`))}async function Hg(e,t,n){return Og.parse(await qh(`/api/chat/goal-configuration/preview`,{method:`POST`,body:JSON.stringify({goal_id:e,capability_id:t,configuration:n})}))}async function Ug(e,t,n,r){return kg.parse(await qh(`/api/chat/goal-configuration/apply`,{method:`POST`,body:JSON.stringify({goal_id:e,capability_id:t,configuration:n,expected_plan_revision:r})}))}async function Wg(e,t){return Mg.parse(await qh(`/api/chat/machine-configuration/preview`,{method:`POST`,body:JSON.stringify({namespace:e,namespace_configuration:t})}))}async function Gg(e,t,n){return Ng.parse(await qh(`/api/chat/machine-configuration/apply`,{method:`POST`,body:JSON.stringify({expected_plan_revision:n,namespace:e,namespace_configuration:t})}))}async function Kg(e){return Mg.parse(await qh(`/api/chat/machine-configuration/preview`,{method:`POST`,body:JSON.stringify({namespace:e,operation:`remove`})}))}async function qg(e,t){return Ng.parse(await qh(`/api/chat/machine-configuration/apply`,{method:`POST`,body:JSON.stringify({expected_plan_revision:t,namespace:e,operation:`remove`})}))}async function Jg(e){return Pg.parse(await qh(`/api/chat/machine-configuration/rollback`,{method:`POST`,body:JSON.stringify({execute:!1,transaction_id:e})}))}async function Yg(e,t){return Fg.parse(await qh(`/api/chat/machine-configuration/rollback`,{method:`POST`,body:JSON.stringify({execute:!0,expected_plan_revision:t,transaction_id:e})}))}var Xg=J({ok:X(!0),goals:q(J({goal_id:W(),repository:J({branch:W(),identity:W(),label:W(),read_only:X(!0)})}))});async function Zg(){return Xg.parse(await qh(`/api/chat/goals/contexts`)).goals}var Qg=J({ok:X(!0),apps:q(J({active:K(),app_ref:W(),brand:W(),health_error_code:W().nullable().default(null),label:W(),ready:K(),reply_ready:K().default(!1)}))});async function $g(){return Qg.parse(await qh(`/api/chat/lark/apps`)).apps}var e_=J({ok:X(!0),app_ref:W(),error:W().nullable(),setup_id:W(),status:Y([`starting`,`waiting_for_feishu`,`ready`,`failed`,`cancelled`]),verification_url:W().url().nullable()});async function t_(e){return e_.parse(await qh(`/api/chat/lark/app-setups`,{method:`POST`,body:JSON.stringify({app_ref:e.appRef,brand:e.brand})}))}async function n_(e){return e_.parse(await qh(`/api/chat/lark/app-setups/${encodeURIComponent(e)}`))}async function r_(e){return e_.parse(await qh(`/api/chat/lark/app-setups/${encodeURIComponent(e)}`,{method:`DELETE`}))}var i_=[`invalid_event`,`binding_unavailable`,`chat_mismatch`,`topic_mismatch`,`route_ambiguous`,`self_message`,`invalid_routing_state`,`not_addressed`],a_=J({ok:X(!0),chats:q(J({chat_id:W(),chat_name:W()}))});async function o_(e,t){let n=new URLSearchParams({app_ref:e});return t&&n.set(`query`,t),a_.parse(await qh(`/api/chat/lark/chats?${n.toString()}`)).chats}var s_=J({ok:X(!0),connections:q(J({conversation_kind:Y([`goal`,`manager`]).default(`goal`),agent_id:W().nullable().default(null),connection_id:W(),app_label:W(),app_ref:W(),capture_scope:Y([`addressed_only`,`configured_chat_all`]).default(`addressed_only`),chat_name:W(),enabled:K(),goal_id:W(),goal_title:W(),health_error_code:W().nullable().default(null),history_permission_guidance:J({action:X(`enable_application_scopes_and_publish`),api_document_url:W().url(),capability:X(`group_history_pagination`),identity:X(`bot`),required_scopes:_d([X(`im:message.group_msg`),X(`im:message.group_msg.include_bot:read`)]),schema_version:X(`lark_bot_group_history_permission_guidance_v0`)}).nullable().default(null),incoming_mode:Y([`mentions`,`all`]),ingress_mode:Y([`live_steering`,`session_queue`,`async_inbox`,`direct_session`]).default(`async_inbox`),event_count:G().int().nonnegative().default(0),last_event_reason:Y(i_).nullable().default(null).catch(null),last_event_status:W().nullable().default(null),listener_error_code:W().nullable().default(null),listener_status:Y([`starting`,`listening`,`retrying`,`stopped`]).nullable().default(null),replied_count:G().int().nonnegative().default(0),reply_ready:K().default(!1),reply_mode:X(`topic_reply`),session_bound:K().default(!1),target_ref:W(),topic_name:W(),topic_setup_required:K()}))});async function c_(){return s_.parse(await qh(`/api/chat/lark/connections`)).connections}async function l_(e){return gg.parse(await qh(`/api/chat/lark/connections`,{method:`POST`,body:JSON.stringify({...e.agentBindings?{agent_bindings:e.agentBindings.map(e=>({agent_id:e.agentId,app_ref:e.appRef}))}:{},...e.agentId?{agent_id:e.agentId}:{},...e.appRef?{app_ref:e.appRef}:{},...e.connectionId?{connection_id:e.connectionId}:{},conversation_kind:e.conversationKind??`goal`,capture_scope:e.captureScope,chat_id:e.chatId,chat_name:e.chatName,execute:e.execute,goal_id:e.goalId,incoming_mode:e.incomingMode,ingress_mode:e.ingressMode,reply_mode:e.replyMode})}))}async function u_(e,t){let n=new URLSearchParams({goal_id:e,connection_id:t});return gg.parse(await qh(`/api/chat/lark/connections?${n.toString()}`,{method:`DELETE`}))}function d_(e){return{loadedUrl:null,projectionRevision:0,requestedUrl:e,selectionRevision:0,requestGeneration:0}}function f_(e,t){return e.selectionRevision+=1,e.requestedUrl=t,e.selectionRevision}function p_(e,t,n){if(n.background)return e.requestedUrl!==null||e.loadedUrl!==t?null:(e.requestGeneration+=1,{background:!0,projectionRevision:e.projectionRevision,selectionRevision:e.selectionRevision,url:t,generation:e.requestGeneration});let r=n.selectionRevision??e.selectionRevision+1;return n.selectionRevision!==void 0&&e.selectionRevision!==r?null:(e.selectionRevision=r,e.projectionRevision+=1,e.requestedUrl=t,e.requestGeneration+=1,{background:!1,projectionRevision:e.projectionRevision,selectionRevision:r,url:t,generation:e.requestGeneration})}function m_(e,t){return t.generation===e.requestGeneration&&e.projectionRevision===t.projectionRevision&&e.selectionRevision===t.selectionRevision}function h_(e,t){return m_(e,t)&&(!t.background||e.requestedUrl===null&&e.loadedUrl===t.url)}function g_(e,t,n){return t.get(e)===n}function __(e,t,n,r){return e.filter(e=>g_(r(e),n,t))}function v_(e,t,n){let r=new Set,i=[];for(let a of[...e,...t]){let e=n(a);e==null||r.has(e)||(r.add(e),i.push(a))}return i}var y_=[`runs_24h`,`runs_7d`,`quota_spend_slots_24h`,`quota_spend_slots_7d`,`automation_run_count_24h`,`automation_run_count_7d`,`progress_signal_run_count_24h`,`progress_signal_run_count_7d`],b_=[`input_tokens_24h`,`input_tokens_7d`,`output_tokens_24h`,`output_tokens_7d`,`cache_tokens_24h`,`cache_tokens_7d`,`cost_usd_24h`,`cost_usd_7d`,`duration_ms_24h`,`duration_ms_7d`],x_=[`accounting`,`decision`,`evidence`,`state`,`work`],S_={accounting:0,decision:0,evidence:0,state:0,work:0},C_={runs_24h:0,runs_7d:0,quota_spend_slots_24h:0,quota_spend_slots_7d:0,automation_run_count_24h:0,automation_run_count_7d:0,progress_signal_run_count_24h:0,progress_signal_run_count_7d:0};function w_(e,t){let n={...e};for(let r of y_)n[r]=(Number(e[r])||0)+(Number(t[r])||0);for(let r of b_)(e[r]!==void 0||t[r]!==void 0)&&(n[r]=(e[r]??0)+(t[r]??0));return n}function T_(e,t){return!e.length||t<=0?e:e.map(e=>({...e,project_share_24h:Math.round((Number(e.runs_24h)||0)/t*1e3)/1e3}))}function E_(e,t){let n={...e};for(let r of x_)n[r]=(e[r]??0)+(t[r]??0);return n}function D_(e){let t={events_24h:0,events_7d:0,by_class_24h:{...S_},by_class_7d:{...S_}};for(let n of e)t.events_24h+=n.events_24h,t.events_7d+=n.events_7d,t.by_class_24h=E_(t.by_class_24h,n.by_class_24h),t.by_class_7d=E_(t.by_class_7d,n.by_class_7d);return t}function O_(e,t,n){if(!e&&!t)return null;let r=__(e?.goals??[],`active`,n,e=>e.goal_id),i=__(t?.goals??[],`stopped`,n,e=>e.goal_id),a=v_(r,i,e=>e.goal_id),o=D_(r),s=D_(i),c={events_24h:o.events_24h+s.events_24h,events_7d:o.events_7d+s.events_7d,by_class_24h:E_(o.by_class_24h,s.by_class_24h),by_class_7d:E_(o.by_class_7d,s.by_class_7d)};return{...e??t,goals:a,sample_run_count:(e?.sample_run_count??0)+(t?.sample_run_count??0),totals:c}}function k_(e,t,n){if(!e&&!t)return null;let r=v_([...__(e?.items??[],`active`,n,e=>e.goal_id),...__(t?.items??[],`stopped`,n,e=>e.goal_id)],[],e=>`${e.goal_id}:${e.decision_kind??``}:${e.decision_at??``}`),i={decision_count:(e?.summary.decision_count??0)+(t?.summary.decision_count??0),stale_count:r.filter(e=>e.stale_by_age).length,rebase_required_count:(e?.summary.rebase_required_count??0)+(t?.summary.rebase_required_count??0),fresh_count:(e?.summary.fresh_count??0)+(t?.summary.fresh_count??0)};return{...e??t,items:r,sample_run_count:(e?.sample_run_count??0)+(t?.sample_run_count??0),summary:i}}function A_(e,t){return v_([...e,...t].sort((e,t)=>t.generated_at.localeCompare(e.generated_at)),[],e=>`${e.goal_id}:${e.generated_at}:${e.classification??``}`)}function j_(e,t,n){let r=v_(__(e.items,`active`,n,e=>e.goal_id),__(t.items,`stopped`,n,e=>e.goal_id),e=>e.goal_id);return{...e,item_count:r.length,items:r,needs_controller:r.filter(e=>e.waiting_on===`controller`).length,needs_codex:r.filter(e=>e.waiting_on===`codex`).length,needs_user_or_controller:r.filter(e=>[`user_or_controller`,`controller`].includes(e.waiting_on)).length,watching_external_evidence:r.filter(e=>e.waiting_on===`external_evidence`).length}}function M_(e){let t=e.todo_id?.trim()||``;return t?`${e.goal_id}:${t}`:`${e.goal_id}:synthetic:${e.role??``}:${e.index??``}:${e.text??``}`}function N_(e){let t={...C_};for(let n of e){for(let e of y_)t[e]+=Number(n[e])||0;for(let e of b_)n[e]!==void 0&&(t[e]=(t[e]??0)+n[e])}return t}function P_(e,t,n){if(!e&&!t)return null;let r=__(e?.items??[],`active`,n,e=>e.goal_id),i=__(t?.items??[],`stopped`,n,e=>e.goal_id),a=v_(r,i,M_);return{...e??t,current_projected_count:r.length+i.length,items:a,rollout_event_count:a.reduce((e,t)=>e+(t.event_count??0),0),total_count:a.length}}function F_(e,t,n){if(!e&&!t)return null;let r=__(e?.goals??[],`active`,n,e=>e.goal_id),i=__(t?.goals??[],`stopped`,n,e=>e.goal_id),a=v_(r,i,e=>e.goal_id),o=w_(N_(r),N_(i));return{...e??t,goals:T_(a,Number(o.runs_24h)||0),sample_run_count:(e?.sample_run_count??0)+(t?.sample_run_count??0),totals:o}}function I_(e,t,n){if(!e&&!t)return null;let r=(e?.agents??[]).filter(e=>e.goal_ids.some(e=>g_(e,n,`active`))||(e.current_todo?.goal_id?g_(e.current_todo.goal_id,n,`active`):!1)),i=(t?.agents??[]).filter(e=>e.goal_ids.some(e=>g_(e,n,`stopped`))||(e.current_todo?.goal_id?g_(e.current_todo.goal_id,n,`stopped`):!1)),a=v_(r,i,e=>e.agent_id).map(e=>{let t=i.find(t=>t.agent_id===e.agent_id);return t?{...e,goal_ids:Array.from(new Set([...e.goal_ids??[],...t.goal_ids]))}:e});return{...e??t,agents:a,source_summary:(e??t)?.source_summary?{...(e??t).source_summary,projected_agent_count:a.length,registered_agent_count:new Set(a.map(e=>e.agent_id)).size}:(e??t)?.source_summary}}function L_(e,t,n){if(!e&&!t)return null;let r=v_(__(e?.goals??[],`active`,n,e=>e.goal_id),__(t?.goals??[],`stopped`,n,e=>e.goal_id),e=>e.goal_id);return{...e??t,goals:r}}function R_(e,t){let n=t.goal_projection?.scope;if(n!==`active`&&n!==`stopped`)return t;let r=n,i=t.run_history.goals,a=e.run_history.goals,o=v_(r===`active`?i:a.filter(e=>e.activation_state!==`stopped`),r===`stopped`?i:a.filter(e=>e.activation_state===`stopped`),e=>e.id),s=new Map(o.map(e=>[e.id,e.activation_state])),c=r===`active`?t:e,l=r===`stopped`?t:e,u=e.goal_projection?.registry_revision??null,d=t.goal_projection?.registry_revision??null,f=u===null||d===null||u===d;return{...e,agent_management_projection:I_(c.agent_management_projection,l.agent_management_projection,s),attention_queue:j_(c.attention_queue,l.attention_queue,s),decision_freshness_summary:k_(c.decision_freshness_summary,l.decision_freshness_summary,s),event_ledger_summary:O_(c.event_ledger_summary,l.event_ledger_summary,s),goal_channel_notification_projection:L_(c.goal_channel_notification_projection,l.goal_channel_notification_projection,s),goal_projection:{schema_version:`loopx_goal_projection_scope_v0`,...t.goal_projection,complete:f,projected_goal_count:o.length,registry_goal_count:t.goal_projection?.registry_goal_count??0,scope:`all`},run_history:{...e.run_history,goal_count:o.length,goals:o,recent_runs:A_(c.run_history.recent_runs,l.run_history.recent_runs),run_count:c.run_history.run_count+l.run_history.run_count},todo_index:P_(c.todo_index,l.todo_index,s),usage_summary:F_(c.usage_summary,l.usage_summary,s)}}function z_(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e==`boolean`?`${e}`:e===0?`0`:e,H_=B_,U_=(e,t)=>n=>{if(t?.variants==null)return H_(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=V_(t)||V_(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return H_(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},W_=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),K_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),q_=`-`,J_=[],Y_=`arbitrary..`,X_=e=>{let t=$_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Q_(e);let n=e.split(q_);return Z_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?W_(i,t):t:i||J_}return n[e]||J_}}},Z_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Z_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(q_):e.slice(t).join(q_),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Y_+r:void 0})(),$_=e=>{let{theme:t,classGroups:n}=e;return ev(n,t)},ev=(e,t)=>{let n=K_();for(let r in e){let i=e[r];tv(i,n,r,t)}return n},tv=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){rv(e,t,n);return}if(typeof e==`function`){iv(e,t,n,r);return}av(e,t,n,r)},rv=(e,t,n)=>{let r=e===``?t:ov(t,e);r.classGroupId=n},iv=(e,t,n,r)=>{if(sv(e)){tv(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(G_(n,e))},av=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(q_),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,cv=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},lv=`!`,uv=`:`,dv=[],fv=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),pv=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return fv(t,l,c,u)};if(t){let e=t+uv,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):fv(dv,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},mv=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},hv=e=>({cache:cv(e.cacheSize),parseClassName:pv(e),sortModifiers:mv(e),postfixLookupClassGroupIds:gv(e),...X_(e)}),gv=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(_v),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+lv:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},yv=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=hv(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=vv(e,n);return i(e,a),a};return a=o,(...e)=>a(yv(...e))},Sv=[],Cv=e=>{let t=t=>t[e]||Sv;return t.isThemeGetter=!0,t},wv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Tv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ev=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Dv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ov=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,kv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Av=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mv=e=>Ev.test(e),Nv=e=>!!e&&!Number.isNaN(Number(e)),Pv=e=>!!e&&Number.isInteger(Number(e)),Fv=e=>e.endsWith(`%`)&&Nv(e.slice(0,-1)),Iv=e=>Dv.test(e),Lv=()=>!0,Rv=e=>Ov.test(e)&&!kv.test(e),zv=()=>!1,Bv=e=>Av.test(e),Vv=e=>jv.test(e),Hv=e=>!Q(e)&&!$(e),Uv=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Wv=e=>ay(e,ly,zv),Q=e=>wv.test(e),Gv=e=>ay(e,uy,Rv),Kv=e=>ay(e,dy,Nv),qv=e=>ay(e,py,Lv),Jv=e=>ay(e,fy,zv),Yv=e=>ay(e,sy,zv),Xv=e=>ay(e,cy,Vv),Zv=e=>ay(e,my,Bv),$=e=>Tv.test(e),Qv=e=>oy(e,uy),$v=e=>oy(e,fy),ey=e=>oy(e,sy),ty=e=>oy(e,ly),ny=e=>oy(e,cy),ry=e=>oy(e,my,!0),iy=e=>oy(e,py,!0),ay=(e,t,n)=>{let r=wv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},oy=(e,t,n=!1)=>{let r=Tv.exec(e);return r?r[1]?t(r[1]):n:!1},sy=e=>e===`position`||e===`percentage`,cy=e=>e===`image`||e===`url`,ly=e=>e===`length`||e===`size`||e===`bg-size`,uy=e=>e===`length`,dy=e=>e===`number`,fy=e=>e===`family-name`,py=e=>e===`number`||e===`weight`,my=e=>e===`shadow`,hy=xv(()=>{let e=Cv(`color`),t=Cv(`font`),n=Cv(`text`),r=Cv(`font-weight`),i=Cv(`tracking`),a=Cv(`leading`),o=Cv(`breakpoint`),s=Cv(`container`),c=Cv(`spacing`),l=Cv(`radius`),u=Cv(`shadow`),d=Cv(`inset-shadow`),f=Cv(`text-shadow`),p=Cv(`drop-shadow`),m=Cv(`blur`),h=Cv(`perspective`),g=Cv(`aspect`),_=Cv(`ease`),v=Cv(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[Mv,`full`,`auto`,...w()],E=()=>[Pv,`none`,`subgrid`,$,Q],D=()=>[`auto`,{span:[`full`,Pv,$,Q]},Pv,$,Q],O=()=>[Pv,`auto`,$,Q],k=()=>[`auto`,`min`,`max`,`fr`,$,Q],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],te=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[Mv,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[Mv,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[Mv,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,$,Q],P=()=>[...b(),ey,Yv,{position:[$,Q]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,ty,Wv,{size:[$,Q]}],ae=()=>[Fv,Qv,Gv],F=()=>[``,`none`,`full`,l,$,Q],oe=()=>[``,Nv,Qv,Gv],I=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],L=()=>[Nv,Fv,ey,Yv],ce=()=>[``,`none`,m,$,Q],le=()=>[`none`,Nv,$,Q],ue=()=>[`none`,Nv,$,Q],de=()=>[Nv,$,Q],fe=()=>[Mv,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Iv],breakpoint:[Iv],color:[Lv],container:[Iv],"drop-shadow":[Iv],ease:[`in`,`out`,`in-out`],font:[Hv],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Iv],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Iv],shadow:[Iv],spacing:[`px`,Nv],text:[Iv],"text-shadow":[Iv],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Mv,Q,$,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,$,Q]}],"container-named":[Uv],columns:[{columns:[Nv,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Pv,`auto`,$,Q]}],basis:[{basis:[Mv,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Nv,Mv,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,Nv,$,Q]}],shrink:[{shrink:[``,Nv,$,Q]}],order:[{order:[Pv,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...te(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...te()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...te(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...te(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...te(),`baseline`]}],"place-self":[{"place-self":[`auto`,...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...M()]}],"min-inline-size":[{"min-inline":[`auto`,...M()]}],"max-inline-size":[{"max-inline":[`none`,...M()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,Qv,Gv]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,iy,qv]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Fv,Q]}],"font-family":[{font:[$v,Jv,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[Nv,`none`,$,Kv]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...I(),`wavy`]}],"text-decoration-thickness":[{decoration:[Nv,`from-font`,`auto`,$,Gv]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Nv,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Pv,$,Q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Pv,$,Q],radial:[``,$,Q],conic:[Pv,$,Q]},ny,Xv]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...I(),`hidden`,`none`]}],"divide-style":[{divide:[...I(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...I(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Nv,$,Q]}],"outline-w":[{outline:[``,Nv,Qv,Gv]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,ry,Zv]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,ry,Zv]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Nv,Gv]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,ry,Zv]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Nv,$,Q]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Nv]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Nv]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:ce()}],brightness:[{brightness:[Nv,$,Q]}],contrast:[{contrast:[Nv,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ry,Zv]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,Nv,$,Q]}],"hue-rotate":[{"hue-rotate":[Nv,$,Q]}],invert:[{invert:[``,Nv,$,Q]}],saturate:[{saturate:[Nv,$,Q]}],sepia:[{sepia:[``,Nv,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Nv,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[Nv,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Nv,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Nv,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,Nv,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[Nv,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[Nv,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Nv,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Nv,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[Nv,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Pv,$,Q]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[Nv,Qv,Gv,Kv]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function gy(...e){return hy(B_(e))}var _y=U_(`inline-flex h-9 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md border px-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-zinc-500`,{variants:{variant:{primary:`border-slate-900 bg-slate-950 text-white hover:bg-slate-800 dark:border-zinc-100 dark:bg-zinc-50 dark:text-zinc-950 dark:hover:bg-zinc-200`,secondary:`border-slate-200 bg-white text-slate-900 hover:bg-slate-50 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-100 dark:hover:bg-zinc-900`,ghost:`border-transparent bg-transparent text-slate-700 hover:bg-slate-100 dark:text-zinc-300 dark:hover:bg-zinc-900`},size:{sm:`h-8 px-2 text-xs`,md:`h-9 px-3 text-sm`,icon:`h-9 w-9 px-0`}},defaultVariants:{variant:`secondary`,size:`md`}});function vy({className:e,variant:t,size:n,...r}){return(0,B.jsx)(`button`,{className:gy(_y({variant:t,size:n}),e),type:`button`,...r})}function yy({className:e,...t}){return(0,B.jsx)(`section`,{className:gy(`rounded-lg border border-slate-200/80 bg-white/95 text-slate-950 shadow-[0_1px_2px_rgba(15,23,42,0.04)] dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50`,e),...t})}function by({className:e,...t}){return(0,B.jsx)(`div`,{className:gy(`p-4 pt-0`,e),...t})}var xy=[`codex`,`claude`,`kiro`,`trae`,`coco`,`openai`,`anthropic`],Sy=new Set([`acp`,`status_projection`]);function Cy(e){let t=e.trim().toLowerCase().replace(/_/gu,`-`);for(let e of xy)if(t===e||t.startsWith(`${e}-`))return e;return t}function wy(e,t){let n=t?.trim().toLowerCase()??``;return n.length>0&&!Sy.has(n)?Cy(n):Cy(e)}var Ty={"zh-CN":{title:`交办说明`,context:`背景与补充`,constraints:`约束`,inputs:`输入材料`,acceptance:`验收要求`,return:`需要回传`,supplied:`已提供给接收方`,pending:`等待接收方读取`,decision:`接收方判断`,unknown:`尚未记录`,unavailable:`暂时无法读取`,adopt:`已采纳`,defer:`已暂缓`,reject:`未采纳`,no_change:`无需调整`,result:`结论已保存`,delivered:`结论已回传`,details:`查看交办内容`},en:{title:`Delegation brief`,context:`Context & corrections`,constraints:`Constraints`,inputs:`Inputs`,acceptance:`Acceptance`,return:`Expected return`,supplied:`Supplied to receiver`,pending:`Awaiting receiver read`,decision:`Receiver decision`,unknown:`Not recorded`,unavailable:`Readback unavailable`,adopt:`Adopted`,defer:`Deferred`,reject:`Rejected`,no_change:`No change needed`,result:`Conclusion saved`,delivered:`Conclusion returned`,details:`View delegation details`}};function Ey({request:e}){let{locale:t}=Ji();if(!e)return null;let n=Ty[t],r=e.brief,i=e.decision,a=e.returns.find(e=>e.phase===`conclusion`);return(0,B.jsxs)(`section`,{className:`personal-collaboration`,"aria-label":n.title,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:r.purpose}),(0,B.jsx)(`span`,{children:e.agent_id})]}),(0,B.jsxs)(`p`,{className:`personal-collaboration-status`,children:[(0,B.jsx)(`span`,{children:e.read_status===`supplied`?n.supplied:e.read_status===`unavailable`?n.unavailable:n.pending}),(0,B.jsxs)(`span`,{children:[n.decision,`: `,n[i]??(e.decision===`unavailable`?n.unavailable:n.unknown)]}),a?(0,B.jsx)(`span`,{children:a.status===`delivered`?n.delivered:n.result}):null]}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:n.details}),(0,B.jsx)(`h4`,{children:n.context}),(0,B.jsx)(`p`,{children:r.context}),r.constraints.length?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:n.constraints}),(0,B.jsx)(`ul`,{children:r.constraints.map((e,t)=>(0,B.jsx)(`li`,{children:e},t))})]}):null,r.inputs.length?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:n.inputs}),(0,B.jsx)(`ul`,{children:r.inputs.map((e,t)=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`code`,{children:e.ref}),` — `,e.description,e.sha256?(0,B.jsxs)(`small`,{children:[`sha256:`,e.sha256]}):null]},t))})]}):null,(0,B.jsx)(`h4`,{children:n.acceptance}),(0,B.jsx)(`ul`,{children:r.acceptance.map((e,t)=>(0,B.jsx)(`li`,{children:e},t))}),(0,B.jsx)(`h4`,{children:n.return}),(0,B.jsx)(`p`,{children:r.return_requirement})]})]})}var Dy={stop:`ready_stop`,resume:`resume_review`,delete:`delete_review`};function Oy(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function ky(e){return typeof e==`string`&&e.trim().length>0?e:null}function Ay(e,t=240){let n=typeof e==`string`?e.replace(/\s+/g,` `).trim():``;return n.length>t?`${n.slice(0,t-1)}…`:n}function jy(e){let t=Oy(e)??{},n=Ay(t.agent_id,80)||`unknown-agent`,r=Ay(t.acceptance,200);if(t.staffing===`gap`){let e=Oy(t.declined_first_todo)??{};return[`${n} · gap`,Ay(t.gap_reason_code,80),Ay(e.text,200)].filter(Boolean).join(` · `)}let i=Oy(t.first_todo)??{};return[`${n} · ready`,Ay(i.priority,8),Ay(i.action_kind,40),Ay(i.text,240),r?`acceptance: ${r}`:``].filter(Boolean).join(` · `)}function My(e){let t=Oy(e)??{};return Object.entries(t).map(([e,t])=>`${e}: ${typeof t==`object`&&t?JSON.stringify(t):String(t)}`).join(` · `)}function Ny(e){let t=Oy(e);if(t?.action_kind!==`team.plan`||t.status!==`preview_ready`&&t.status!==`deferred`)return;let n=Oy(Oy(t.normalized_parameters)?.plan);if(!n||n.kind!==`steward_team_plan_preview`||n.applies!==!1)return;let r=ky(t.proposal_id),i=ky(t.expected_state_fingerprint),a=ky(n.goal_id);if(!r||!i||!a)return;let o=Array.isArray(n.lanes)?n.lanes:[],s=Array.isArray(n.gaps)?n.gaps:[],c=[{key:`goal`,value:a},{key:`objective`,value:Ay(n.objective)},...o.map((e,t)=>({key:`lane_${t+1}`,value:jy(e)})),...s.length>0?[{key:`lane_gaps`,value:s.map(e=>{let t=Oy(e)??{};return[Ay(t.lane_id,80),Ay(t.reason_code,80)].filter(Boolean).join(`: `)}).filter(Boolean).join(` · `)}]:[],{key:`quota_envelope`,value:My(n.quota_envelope)},{key:`stop_condition`,value:Ay(n.stop_condition)}].filter(e=>e.value.length>0);return{schemaVersion:`review_card_frame_v0`,actionKind:`team.plan`,proposalId:r,stateFingerprint:i,kind:`confirmation`,attentionKind:`authority`,interactionMode:`confirm_reject`,decisions:[`confirm`,`reject`],titleKey:`team_plan_preview`,subtitleKey:`preview_only_no_lane_exists`,confirmLabelKey:`confirm_team_plan`,rejectLabelKey:`reject_team_plan`,warningKey:`confirming_creates_each_ready_lane_first_todo`,focus:`${a} · ${o.length} lane${o.length===1?``:`s`}`,fields:c}}function Py(e){let t=Oy(e.projection);if(t?.schema_version!==`loopx_operation_projection_v0`)return null;let n=ky(t.title),r=ky(t.subtitle),i=ky(t.focus),a=ky(t.warning);if(!n||!r||!i||!a||!Array.isArray(t.fields))return null;let o=[];for(let e of t.fields){let t=Oy(e),n=ky(t?.label),r=ky(t?.value);if(!n||!r)return null;o.push({label:n,value:r})}return{title:n,subtitle:r,focus:i,fields:o,warning:a}}function Fy(e){let t=Oy(e);if(t?.action_kind!==`operation.execute`)return;let n=Oy(t.normalized_parameters),r=Oy(t.operation);if(!n||r?.schema_version!==`loopx_operation_envelope_v0`)return;let i=ky(r.operation_id),a=ky(r.confirmation_digest),o=ky(r.expires_at),s=Py(n);if(!i||!a||!o||!s||i!==t.proposal_id)return;let c=r.lifecycle_state;if(c!==`awaiting_confirmation`&&c!==`claimed`&&c!==`outcome_observed`)return;let l={schemaVersion:`operation_review_frame_v0`,operationId:i,confirmationDigest:a,lifecycleState:c,simulated:Oy(n.projection).simulated===!0,expiresAt:o,content:s};if(c===`awaiting_confirmation`)return{...l,kind:`confirmation`,attentionKind:`authority`,interactionMode:`confirm_reject`,decisions:[`confirm`,`reject`]};if(c===`claimed`)return{...l,kind:`pending`,attentionKind:`progress`,interactionMode:`inform`};let u=Oy(r.outcome);if(!u)return;let d=u.outcome===`rejected_by_operator`,f=u.simulation===!0||l.simulated;return{...l,kind:`result`,attentionKind:`progress`,interactionMode:`inform`,resultKind:d?`rejected`:f?`simulation_completed`:`completed`,resultDeliveryVerified:Oy(r.result_delivery)!==null,summary:ky(u.summary)??``}}function Iy(e){let t=Oy(e)??{},n={schemaVersion:`action_review_plan_v0`,proposalId:typeof t.proposal_id==`string`?t.proposal_id:``,sourceFingerprint:typeof t.expected_state_fingerprint==`string`?t.expected_state_fingerprint:``},r=Fy(t),i=Ny(t),a=e=>({...n,...e,...r?{operationFrame:r}:{},...i?{reviewCardFrame:i}:{}}),o=(e,t)=>a({interaction:e,reason:t,canApply:!1}),s=t.action_kind===`goal.lifecycle`;if(s&&t.gate!=null||t.status===`gated`)return o(`gated`,`authority_gate`);if(s&&t.stale!=null||t.status===`stale`)return o(`refresh`,`stale_proposal`);if(t.status===`applied`)return Oy(t.receipt)?.projection_verified===!0&&(t.action_kind!==`operation.execute`||Oy(Oy(t.operation)?.result_delivery)!==null)?o(`completed`,`readback_verified`):o(`repair`,`readback_unverified`);let c=Oy(t.canonical_update_basis),l=Oy(t.normalized_parameters);if(c?.schema_version===`loopx_chat_canonical_update_basis_v0`&&ky(c.provider_revision)!==null&&ky(c.registry_sha256)!==null&&(t.action_kind===`todo.update`&&l?.operation!==`complete`||t.action_kind===`monitor.update`&&[`pause`,`resume`,`edit`].includes(String(l?.operation)))&&(t.status===`applying`||t.status===`failed`))return{...a({interaction:`review`,canApply:!0,reason:Oy(t.failure)?.error_code===`canonical_update_projection_pending`?`canonical_update_projection_pending`:`canonical_update_retry`}),retryOriginal:!0};if(t.status===`applying`)return o(`pending`,`apply_pending`);if(t.status===`failed`||t.error!=null)return o(`repair`,`apply_failed`);if(t.status!==`preview_ready`&&t.status!==`deferred`)return o(`inactive`,`inactive_proposal`);let u=(e,t=!0)=>a({interaction:`review`,reason:e,canApply:t});if(t.action_kind!==`goal.lifecycle`)return u(t.permission_classification===`protected`?`protected_action`:`action_review`);let d=t.validation_evidence,f=t.available_transitions;if(!(ky(t.proposal_id)!==null&&ky(t.expected_state_fingerprint)!==null&&Array.isArray(d)&&d.length>0&&d.every(e=>ky(e)!==null)&&Array.isArray(f)&&f.includes(`apply`)))return o(`refresh`,`incomplete_proposal`);let p=Oy(t.context),m=l?.operation,h=ky(l?.goal_id);if(!h||p?.goal_id!=null&&p.goal_id!==h)return o(`refresh`,`incomplete_proposal`);if(m!==`stop`&&m!==`resume`&&m!==`delete`)return u(`unknown_action`,!1);if(t.permission_classification===`protected`)return u(`protected_action`);if(t.permission_classification!==`durable_write`)return u(`unknown_permission`,!1);let g=Dy[m];return g===`ready_stop`&&t.status===`preview_ready`?a({interaction:`direct`,reason:g,canApply:!0}):u(g===`ready_stop`?`action_review`:g)}function Ly(e){return e.error_code===`action_stale`||e.error_code===`action_conflict`||Oy(e.proposal)?.status===`stale`}function Ry(e){return typeof e==`object`&&e?e:{}}function zy(e){return typeof e==`string`?e:``}function By(e,t){let n=Ry(e.plan),r=[],i=zy(e.goal_id)||zy(n.goal_id);i&&r.push({key:`goal_id`,label:t(`proposal.field.goalId`),value:i});let a=zy(n.objective);a&&r.push({key:`objective`,label:t(`proposal.field.objective`),value:a}),(Array.isArray(n.lanes)?n.lanes:[]).forEach((e,n)=>{let i=Ry(e),a=zy(i.lane_id)||`lane-${n+1}`,o=zy(i.agent_id),s=zy(i.acceptance);if(zy(i.staffing)===`gap`){let e=Ry(i.declined_first_todo);r.push({key:`lane_${a}`,label:o||a,value:[t(`proposal.teamPlan.gapLane`),Gy(zy(i.gap_reason_code),t),zy(e.text)].filter(Boolean).join(` · `)});return}let c=Ry(i.first_todo),l=[zy(c.priority),zy(c.action_kind),zy(c.text)].filter(Boolean).join(` · `);r.push({key:`lane_${a}`,label:o||a,value:[l||t(`proposal.teamPlan.laneUnstaffed`),s?`${t(`proposal.teamPlan.acceptanceShort`)}: ${s}`:``].filter(Boolean).join(` · `)})});let o=Ry(n.quota_envelope),s=Object.entries(o);s.length>0&&r.push({key:`quota_envelope`,label:t(`proposal.field.quotaEnvelope`),value:s.map(([e,t])=>`${e}: ${String(t??``)}`).join(` · `)+` · ${t(`proposal.teamPlan.advisory`)}`});let c=zy(n.stop_condition);return c&&r.push({key:`stop_condition`,label:t(`proposal.field.stopCondition`),value:`${c} · ${t(`proposal.teamPlan.advisory`)}`}),r}function Vy(e){let t=Ry(e.plan);return Array.isArray(t.lanes)?t.lanes.length:0}function Hy(e){let t=Ry(e.plan);return zy(e.goal_id)||zy(t.goal_id)}function Uy(e,t){let n=Ry(e),r=Ry(t.plan),i=(Array.isArray(r.lanes)?r.lanes:[]).map(Ry);return(Array.isArray(n.lanes)?n.lanes:[]).map(e=>{let t=Ry(e),n=zy(t.lane_id),r=i.find(e=>e.lane_id===n);return{laneId:n,agentId:zy(t.agent_id),task:zy(Ry(r?.first_todo).text)||n}}).filter(e=>e.laneId.length>0)}function Wy(e,t={}){let n=Ry(e),r=Ry(t.plan),i=(Array.isArray(r.lanes)?r.lanes:[]).map(Ry);return(Array.isArray(n.gap_lanes)?n.gap_lanes:[]).map(e=>{let t=Ry(e);return{laneId:zy(t.lane_id),agentId:zy(t.agent_id),reasonCode:zy(t.reason_code),task:zy(Ry(i.find(e=>e.lane_id===t.lane_id)?.declined_first_todo).text)}}).filter(e=>e.laneId.length>0)}function Gy(e,t){return e===`agent_not_registered`?t(`proposal.teamPlan.gapReason.agentNotRegistered`):e===`action_kind_not_supported`?t(`proposal.teamPlan.gapReason.actionKindNotSupported`):e===`capability_not_granted`?t(`proposal.teamPlan.gapReason.capabilityNotGranted`):e===`audience_not_authorized`?t(`proposal.teamPlan.gapReason.audienceNotAuthorized`):e}function Ky(e){let t=Ry(e),n=zy(t.outcome),r=Array.isArray(t.lanes)?t.lanes.length:0,i=typeof t.gap_count==`number`?t.gap_count:0;return n===`team_plan_partially_applied`?{kind:`partially_applied`,created:r,gaps:i}:n===`team_plan_lanes_already_present`||n===`team_plan_commit_recovered`?{kind:`already_present`,created:r,gaps:i}:n===`team_plan_applied`?{kind:`applied`,created:r,gaps:i}:null}function qy(e,t){return e?.kind===`partially_applied`?t(`proposal.teamPlan.appliedPartially`,{created:String(e.created),gaps:String(e.gaps)}):e?.kind===`already_present`?t(`proposal.teamPlan.appliedAlreadyPresent`):t(e?.kind===`applied`?`proposal.teamPlan.applied`:`drawer.proposalApplied`,{count:e?.created??0})}function Jy(e){return{blockingTodoCount:e.blockingTodoCount,goalNotifications:e.goalNotifications,goals:e.goals,openUserTodoCount:e.openUserTodoCount,systemHealth:e.systemHealth,attentionHistory:e.attentionHistory,userTodos:e.userTodos,workers:e.workers}}function Yy(e,t){return e.goals.find(e=>e.goalId===t)?.title??t}function Xy(e){return e.activationState===`stopped`||e.state===`已停止`?`stopped`:e.state===`已完成`?`history`:e.needsYou||e.state===`等你`?`needs_you`:e.state===`推进中`||e.state===`需修复`?`running`:e.state===`安静运行`?`observing`:`scheduled`}function Zy(e){let t=e;return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Qy(e){return`$${e.toFixed(2)}`}function $y(e){let t=e;return t>=36e5?`${(t/36e5).toFixed(1)}h`:t>=6e4?`${(t/6e4).toFixed(1)}m`:t>=1e3?`${Math.round(t/1e3)}s`:`${t}ms`}function eb(e,t,n){return e==null?t:n(e)}function tb(e){return!!(e&&[e.tokens24h,e.tokens7d,e.costUsd24h,e.costUsd7d,e.durationMs24h,e.durationMs7d].some(e=>e!=null))}function nb(e,t){if(!tb(e))return null;let n=(e,n,r,i)=>{let a=[n==null?null:`${Zy(n)} ${t.tokens}`,r==null?null:`${t.cost}: ${Qy(r)}`,i==null?null:`${t.duration}: ${$y(i)}`].filter(e=>e!==null);return a.length?`${e} ${a.join(` · `)}`:null};return n(t.period7d,e.tokens7d,e.costUsd7d,e.durationMs7d)??n(t.period24h,e.tokens24h,e.costUsd24h,e.durationMs24h)}function rb({ariaLabel:e,className:t,icon:n,onChange:r,options:i,prefixLabel:a,value:o}){let s=(0,z.useId)(),c=(0,z.useRef)(null),l=(0,z.useRef)(null),u=(0,z.useRef)(new Map),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)(o),h=i.find(e=>e.value===o)??i[0],g=i.filter(e=>!e.disabled);(0,z.useEffect)(()=>{if(!d)return;let e=e=>{c.current?.contains(e.target)||f(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[d]),(0,z.useEffect)(()=>{d&&u.current.get(p)?.focus()},[p,d]);function _(e){m(e)}function v(e=`selected`){let t=e===`last`?g.at(-1):g[0],n=e===`selected`&&h&&!h.disabled?h:t;n&&(f(!0),_(n.value))}function y({restoreFocus:e=!1}={}){f(!1),e&&l.current?.focus()}function b(e){e.disabled||(r(e.value),y({restoreFocus:!0}))}function x(e){if(!g.length)return;let t=g.findIndex(e=>e.value===p),n=t<0?0:(t+e+g.length)%g.length;_(g[n].value)}function S(e){e.key===`ArrowDown`||e.key===`Enter`||e.key===` `?(e.preventDefault(),v(`selected`)):e.key===`ArrowUp`&&(e.preventDefault(),v(`last`))}function C(e,t){if(e.key===`ArrowDown`)e.preventDefault(),x(1);else if(e.key===`ArrowUp`)e.preventDefault(),x(-1);else if(e.key===`Home`)e.preventDefault(),g[0]&&_(g[0].value);else if(e.key===`End`){e.preventDefault();let t=g.at(-1);t&&_(t.value)}else e.key===`Enter`||e.key===` `?(e.preventDefault(),b(t)):e.key===`Escape`?(e.preventDefault(),y({restoreFocus:!0})):e.key===`Tab`&&y()}let w;return(0,B.jsxs)(`div`,{className:`personal-select${t?` ${t}`:``}`,ref:c,children:[(0,B.jsxs)(`button`,{"aria-controls":s,"aria-expanded":d,"aria-haspopup":`listbox`,"aria-label":e,className:`personal-select-trigger`,"data-value":o,onClick:()=>d?y():v(),onKeyDown:S,ref:l,role:`combobox`,type:`button`,children:[n?(0,B.jsx)(`span`,{className:`personal-select-icon`,children:n}):null,(0,B.jsxs)(`span`,{className:`personal-select-value`,children:[a?(0,B.jsx)(`small`,{children:a}):null,(0,B.jsx)(`span`,{children:h?.label??o})]}),(0,B.jsx)(sm,{"aria-hidden":!0,className:d?`is-open`:void 0,size:14})]}),d?(0,B.jsx)(`div`,{"aria-label":e,className:`personal-select-listbox`,id:s,role:`listbox`,children:i.map(e=>{let t=e.group&&e.group!==w;return w=e.group,(0,B.jsxs)(`div`,{className:`personal-select-option-wrap`,children:[t?(0,B.jsx)(`div`,{className:`personal-select-group-label`,children:e.group}):null,(0,B.jsxs)(`button`,{"aria-disabled":e.disabled||void 0,"aria-selected":e.value===o,className:`personal-select-option`,disabled:e.disabled,id:`${s}-${e.value.replace(/[^a-z0-9_-]/gi,`-`)}`,onClick:()=>b(e),onFocus:()=>m(e.value),onKeyDown:t=>C(t,e),ref:t=>{t?u.current.set(e.value,t):u.current.delete(e.value)},role:`option`,tabIndex:e.value===p?0:-1,type:`button`,children:[(0,B.jsx)(`span`,{children:e.label}),e.value===o?(0,B.jsx)(om,{"aria-hidden":!0,size:15}):null]})]},e.value)})}):null]})}function ib({agents:e,managerChannelBinding:t,managerChatOpen:n,managerRuntime:r,mobileNavigationOpen:i,onOpenGoalCapabilities:a,onOpenManagerChat:o,onRefresh:s,onOpenNavigation:c,onSelectGoalTab:l,onSelectAgent:u,onReturnManagerHome:d,refreshState:f,readOnlySourceLabel:p,selectedAgentId:m,selectedGoal:h,selectedGoalTab:g}){let{locale:_,t:v}=Ji(),y=h?nb(h.usage,{cost:v(`drawer.costShort`),duration:v(`drawer.durationShort`),period24h:v(`drawer.period24h`),period7d:v(`drawer.period7d`),tokens:v(`drawer.tokensShort`)}):null,b=t?t.executor_kind===`individual`?v(`header.managerExecutorKindIndividual`):t.executor_kind===`managed`?v(`header.managerExecutorKindManaged`):v(`header.managerExecutorKindRegistered`):null,x=t?.available===!1,S=t?.available===!1?t.unavailable_reason:null,C=S===`operator_credential_unconfigured`?`header.managerExecutionUnavailableCredential`:S===`dsh_runtime_unavailable`?`header.managerExecutionUnavailableRuntime`:S===`invalid_reasoning_effort`?`header.managerExecutionUnavailableEffort`:`header.managerExecutionUnavailable`,w=t&&t.executor_endpoint_source===`product_default`&&t.executor_endpoint_default_reason===`steward_channel_default`?`header.managerEndpointStewardDefault`:null,T=p?(0,B.jsxs)(`span`,{className:`personal-read-only-source`,title:v(`header.readOnlySourceDescription`,{source:p}),children:[(0,B.jsx)(ym,{size:15}),p,(0,B.jsx)(`small`,{children:v(`common.readOnly`)})]}):(0,B.jsx)(rb,{ariaLabel:v(`header.selectChatRuntime`),className:`personal-agent-select`,icon:(0,B.jsx)(rm,{size:16}),onChange:u,options:e.map(e=>({disabled:!e.available,label:`${e.label}${e.available?``:` · ${v(`header.agentUnavailable`)}`}`,value:e.agentId})),prefixLabel:v(`header.chatRuntime`),value:m});return(0,B.jsxs)(`header`,{className:`personal-channel-header`,"data-goal-selected":!!h,children:[(0,B.jsx)(`button`,{"aria-expanded":i??!1,"aria-label":v(`header.openGoalNavigation`),className:`personal-icon-button personal-mobile-menu`,onClick:c,type:`button`,children:(0,B.jsx)(Mm,{size:18})}),(0,B.jsxs)(`div`,{className:`personal-channel-title`,children:[(0,B.jsx)(`h1`,{children:h?.title??v(`header.manager`)}),!h&&r?(0,B.jsx)(`p`,{children:r.status===`ready`?v(`header.managerRuntime`,{profile:r.runtime_profile,sandbox:r.sandbox}):v(`header.managerRuntimeFallback`,{profile:r.runtime_profile,sandbox:r.sandbox})}):null,!h&&t?(0,B.jsxs)(`p`,{className:`personal-manager-execution`,children:[(0,B.jsxs)(`span`,{className:x?`personal-execution-chip is-unavailable`:`personal-execution-chip`,children:[(0,B.jsx)(`span`,{className:`personal-execution-chip-endpoint`,children:t.executor_endpoint}),b?(0,B.jsx)(`span`,{className:`personal-execution-chip-kind`,children:b}):null,(0,B.jsx)(`span`,{className:`personal-execution-chip-model`,children:t.model})]}),x?(0,B.jsx)(`span`,{className:`personal-execution-note`,children:v(C,{executor:t.executor_endpoint,credential:t.credential_env_var})}):null,w?(0,B.jsx)(`span`,{className:`personal-execution-rule-note`,children:v(w,{executor:t.executor_endpoint})}):null]}):null,h?(0,B.jsx)(`p`,{children:h.loadState?v(h.loadState===`error`?`startup.goalError`:`startup.goalLoading`):`${h.agentLaneCount&&h.agentLaneCount>1?v(`header.workAgentCount`,{count:h.agentLaneCount}):h.agentLabel??h.agentId} · ${h.loadState?v(h.loadState===`error`?`startup.goalError`:`startup.goalLoading`):Yi(h.state,_)}${y?` · ${y}`:``} · ${h.nextSentence}`}):null]}),h?(0,B.jsxs)(`div`,{className:`personal-goal-navigation`,children:[(0,B.jsxs)(`nav`,{"aria-label":v(`header.goalView`),className:`personal-goal-tabs`,children:[(0,B.jsx)(`button`,{"aria-current":g===`overview`?`page`:void 0,onClick:()=>l(`overview`),type:`button`,children:v(`header.overview`)}),(0,B.jsx)(`button`,{"aria-current":g===`tasks`?`page`:void 0,onClick:()=>l(`tasks`),type:`button`,children:v(`header.tasks`)}),(0,B.jsx)(`button`,{"aria-current":g===`chat`?`page`:void 0,onClick:()=>l(`chat`),type:`button`,children:v(`header.chat`)}),(0,B.jsx)(`button`,{"aria-current":g===`files`?`page`:void 0,onClick:()=>l(`files`),type:`button`,children:v(`header.files`)})]}),T]}):(0,B.jsxs)(`nav`,{"aria-label":v(`header.managerView`),className:`personal-goal-tabs`,children:[(0,B.jsx)(`button`,{"aria-current":n?void 0:`page`,onClick:d,type:`button`,children:v(`header.managerOverview`)}),(0,B.jsx)(`button`,{"aria-current":n?`page`:void 0,onClick:o,type:`button`,children:v(`header.chat`)})]}),(0,B.jsxs)(`div`,{className:`personal-channel-actions`,children:[h&&a?(0,B.jsx)(`button`,{"aria-label":v(`header.goalSettings`),title:v(`header.goalSettingsDescription`),className:`personal-icon-button personal-goal-settings-action`,onClick:a,type:`button`,children:(0,B.jsx)(Qm,{"aria-hidden":!0,size:17})}):null,h?null:T,(0,B.jsxs)(`span`,{className:`personal-live-indicator`,children:[(0,B.jsx)(`i`,{}),v(`header.live`)]}),s?(0,B.jsxs)(`span`,{className:`personal-refresh-control is-${f??`idle`}`,children:[f===`loading`?(0,B.jsx)(`small`,{children:v(`header.refreshing`)}):f===`done`?(0,B.jsx)(`small`,{children:v(`header.refreshDone`)}):f===`error`?(0,B.jsx)(`small`,{children:v(`header.refreshFailed`)}):null,(0,B.jsx)(`button`,{"aria-label":v(f===`loading`?`header.refreshing`:`header.refresh`),className:`personal-icon-button`,disabled:f===`loading`,onClick:s,type:`button`,children:(0,B.jsx)(Um,{className:f===`loading`?`is-spinning`:void 0,size:17})})]}):null]})]})}function ab({attention:e,onSelect:t}){let{t:n}=Ji(),r=Zi(e.updatedAt,n);return(0,B.jsxs)(`button`,{className:`personal-timeline-row personal-attention-row`,"data-testid":`personal-browse-row`,onClick:t,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-row-icon is-attention`,children:(0,B.jsx)(um,{size:18})}),(0,B.jsxs)(`span`,{className:`personal-row-copy`,children:[(0,B.jsxs)(`small`,{children:[e.goalTitle??e.goalId,` · `,n(`home.lane.needsYou`),r?` · ${n(`tasks.waitingAge`,{age:r})}`:``]}),(0,B.jsx)(`strong`,{children:e.text})]}),(0,B.jsx)(`span`,{className:`personal-priority-dot is-${e.priority??(e.blocking?`high`:`medium`)}`}),(0,B.jsx)(`span`,{className:`personal-row-status ${e.blocking?`is-blocking`:`is-pending`}`,children:e.blocking?n(`tasks.blocked`):n(`tasks.pending`)}),(0,B.jsx)(cm,{size:17})]})}var ob=/(`[^`\n]+`)|(\*\*[^*\n]+(\*[^*\n]*)?\*\*)|(\[[^\]\n]{1,120}\]\(https?:\/\/[^)\s]+\))/g;function sb(e,t){let n=[],r=0,i=0;for(let a of e.matchAll(ob)){let o=a.index??0;o>r&&n.push(e.slice(r,o));let s=a[0],c=`${t}-i${i++}`;if(s.startsWith("`"))n.push((0,B.jsx)(`code`,{className:`personal-md-code`,children:s.slice(1,-1)},c));else if(s.startsWith(`**`))n.push((0,B.jsx)(`strong`,{children:s.slice(2,-2)},c));else{let e=s.indexOf(`](`),t=s.slice(1,e),r=s.slice(e+2,-1);n.push((0,B.jsx)(`a`,{className:`personal-md-link`,href:r,rel:`noreferrer`,target:`_blank`,children:t},c))}r=o+s.length}return r=4))throw e;await new Promise(e=>globalThis.setTimeout(e,250*2**(i-1)))}}if(!a)throw new Ih(`Agent 事件流连接已断开。`,{reconnect_attempts:i})}async function ig(e,t){return qh(`/api/chat/sessions/${e}/turns/${t}/interrupt`,{method:`POST`,body:`{}`})}async function ag(e,t,n={}){let r=await tg(e,t,n.clientTurnId??crypto.randomUUID(),n.attachments);return n.onPhase?.(`turn.accepted`,r.turn_id),og(e,r.turn_id,r.events_url,n)}async function og(e,t,n,r={}){let i=null,a={failure:null,interrupted:null};try{await rg(n,e=>{r.onPhase?.(e.kind,t),(e.kind===`answer.delta`||e.kind===`assistant.delta`)&&r.onDelta?.(String(e.payload.text??``)),e.kind===`agent.phase`&&r.onActivity?.(String(e.payload.label??`Agent 正在处理`)),e.kind===`turn.completed`&&(i=e.payload.response),e.kind===`turn.failed`&&(a.failure=e.payload),e.kind===`turn.interrupted`&&(a.interrupted=e.payload)},r.signal)}catch(i){throw i instanceof Ih&&!r.signal?.aborted?new Ih(i.message,{...i.payload,events_url:n,reconnectable:!0,session_id:e,turn_id:t}):i}if(a.failure)throw new Ih(String(a.failure.message||`Agent 回合失败。`),a.failure);if(a.interrupted)throw new Ih(`Agent 回合已中断。`,{...a.interrupted,error_code:`turn_interrupted`,session_id:e,turn_id:t});return{response:Ah.parse(i),sessionId:e,turnId:t}}async function sg(e,t,n={}){return og(e,t,`/api/chat/sessions/${e}/turns/${t}/events`,n)}async function cg(e){let t=jh.parse(await qh(`/api/chat/sessions/${e}`,{keepalive:!0,method:`DELETE`}));if(t.session_id!==e)throw new Ih(`Agent 会话关闭回执与本次请求不一致。`,{session_id:t.session_id});return t}async function lg(e){return qh(`/api/chat/sessions/${e}/resume`,{method:`POST`,body:`{}`})}function ug(e){return{goal_id:e.goalId,enabled:e.enabled,...e.modelConfig===void 0?{}:{model_config:e.modelConfig},...e.enabled?{max_children:e.maxChildren,allowed_domains:e.allowedDomains}:{}}}function dg(e,t){let n=e.after.orchestration,r=[...new Set(t.allowedDomains)],i=e.feature_summary.multi_subagent===`enabled`;if(!(e.goal_id===t.goalId&&i===t.enabled&&(t.modelConfig===void 0||JSON.stringify(n.model_config??null)===JSON.stringify(t.modelConfig))&&(t.enabled?n.max_children===t.maxChildren&&JSON.stringify(n.allowed_domains)===JSON.stringify(r):n.spawn_allowed===!1&&n.max_children===0)))throw new Ih(`Goal 子代理配置回执与本次请求不一致,界面已停止更新。`,{after:e.after,goal_id:e.goal_id});return e}async function fg(e){let t=Ph.parse(await qh(`/api/chat/goal-subagents/dry-run`,{method:`POST`,body:JSON.stringify(ug(e))}));if(!t.dry_run||t.execute||t.written)throw new Ih(`Goal 子代理预览返回了非预览回执,已停止进入确认状态。`,{result:t});return dg(t,e)}async function pg(e,t){let n=Ph.parse(await qh(`/api/chat/goal-subagents/apply`,{method:`POST`,body:JSON.stringify({...ug(e),preview_id:t})}));if(n.preview_id!==t||n.dry_run||!n.execute)throw new Ih(`Goal 子代理写入回执与本次确认不一致,界面已停止更新。`,{result:n});if(n.changed&&(!n.written||!n.global_sync.executed||!n.global_sync.readback.verified))throw new Ih(`Goal 子代理设置未通过共享状态读回验证。`,{result:n});return dg(n,e)}var mg=J({ok:X(!0),targets:q(J({enabled:K(),provider:W(),target_name:W()}))});async function hg(){return mg.parse(await qh(`/api/chat/goal-channel/targets`)).targets}var gg=J({ok:K(),blocker:W().optional(),public_summary:W().optional(),status:W().optional()});async function _g(e){return gg.parse(await qh(`/api/chat/goal-channel/setup`,{method:`POST`,body:JSON.stringify({execute:e.execute,goal_id:e.goalId,target:e.target})}))}async function vg(e){return gg.parse(await qh(`/api/chat/goal-channel/configure`,{method:`POST`,body:JSON.stringify({auto_notify_human_gates:e.autoNotify,goal_id:e.goalId})}))}var yg=J({schema_version:X(`periodic_report_schedule_v0`),schedule_id:W(),rrule:W(),timezone:W()});J({schema_version:X(`periodic_report_machine_defaults_v0`),enabled:K(),inheritance:X(`live_machine_default`),profile_preset:W().optional(),route_ref:W().optional(),timezone:W(),schedule:yg.nullable().optional()});var bg=J({schema_version:X(`loopx_machine_configuration_v0`),namespaces:yd(W(),yd(W(),ad()))}),xg=J({namespace:W(),title:W(),description:W(),schema_versions:q(W()).min(1),configuration_template:yd(W(),ad()),template_status:Y([`ready`,`schema_only`])}),Sg=J({schema_version:X(`machine_configuration_catalog_v0`),namespaces:q(xg)}),Cg=J({key:W(),label:W(),description:W(),input_kind:Y([`boolean`,`number`,`select`,`string_list`,`text`,`periodic_report_schedule`]),nullable:K().optional(),required:K(),minimum:G().int().optional(),maximum:G().int().optional(),options:q(W()).optional()}),wg=J({schema_version:X(`capability_configuration_editor_v0`),editable:K(),supported_scopes:q(Y([`goal`,`machine`])),writable_scopes:q(Y([`goal`,`machine`])),fields:q(Cg),read_only_reason:W().optional()}),Tg=J({schema_version:X(`capability_configuration_catalog_v0`),capabilities:q(J({capability_id:W(),display_name:W(),description:W(),available_scopes:q(Y([`goal`,`machine`])),machine_namespace:W().optional(),goal_feature_id:W().optional(),effective_value_policy:X(`goal_override_over_live_machine_default`).optional(),availability:W().optional(),default:yd(W(),ad()).optional(),current:yd(W(),ad()).optional(),machine_current:yd(W(),ad()).optional(),effective_configuration:J({schema_version:X(`capability_configuration_resolution_v0`),capability_id:W(),source:Y([`goal_override`,`machine_default`,`capability_default`,`not_configured`]),configuration:yd(W(),ad()).nullable(),inherited:K(),goal_override_present:K(),machine_default_present:K(),effective_revision:W()}).optional(),documentation:yd(W(),ad()).optional(),context_contribution:J({supported_phases:q(Y([`before_plan`,`before_delegate`,`after_delegate_result`])),target:X(`coordinator`),activation:X(`with_capability`),receipt_required:X(!0)}).optional(),configuration_editor:wg}))}),Eg=J({ok:X(!0),schema_version:X(`goal_configuration_inspection_v0`),status:X(`configured`),goal_id:W(),revision:W(),available_capabilities:q(W()),capability_catalog:Tg}),Dg=J({ok:X(!0),goal_id:W(),capability_id:W(),changed_fields:q(W()),goal_configuration:yd(W(),ad()).nullable(),capability_catalog:Tg}),Og=Dg.extend({schema_version:X(`goal_configuration_update_plan_v0`),status:X(`preview`),action:Y([`create`,`update`,`delete`,`unchanged`]),current_revision:W(),desired_revision:W(),base_revision:W(),plan_revision:W(),writes_required:G().int().nonnegative()}),kg=dd([Dg.extend({schema_version:X(`goal_configuration_transaction_v0`),status:Y([`applied`,`unchanged`]),plan_revision:W(),applied_revision:W(),readback_verified:X(!0)}),J({ok:X(!1),schema_version:X(`goal_configuration_transaction_v0`),status:X(`partial_write`),goal_id:W(),capability_id:W(),plan_revision:W(),applied_revision:W().nullable(),source_written:X(!0),shared_sync_pending:X(!0),readback_verified:K(),changed_fields:q(W()),goal_configuration:yd(W(),ad()).nullable(),capability_catalog:Tg,error:W(),recommended_action:W()})]),Ag=J({ok:X(!0),available_namespaces:q(W()),namespace_catalog:Sg.optional().default({schema_version:`machine_configuration_catalog_v0`,namespaces:[]}),capability_catalog:Tg,changed_namespaces:q(W()).optional().default([]),invalid_namespaces:q(W()).optional().default([]),machine_configuration:bg.nullable().optional()}),jg=Ag.extend({schema_version:X(`machine_configuration_inspection_v0`),status:Y([`configured`,`absent`,`invalid`]),revision:W()}),Mg=Ag.extend({schema_version:X(`machine_configuration_update_plan_v0`),status:X(`preview`),action:Y([`create`,`update`,`delete`,`unchanged`]),current_revision:W(),desired_revision:W(),plan_revision:W(),writes_required:G().int().nonnegative(),machine_configuration:bg.nullable()}),Ng=Ag.extend({schema_version:X(`machine_configuration_transaction_v0`),status:Y([`applied`,`unchanged`]),plan_revision:W(),transaction_id:W().nullable(),readback_verified:X(!0),rollback_available:K(),applied_revision:W().optional(),prior_revision:W().optional()}),Pg=Ag.extend({schema_version:X(`machine_configuration_rollback_plan_v0`),status:X(`preview`),action:Y([`delete`,`restore`,`unchanged`,`blocked`]),reason:W(),transaction_id:W(),plan_revision:W(),rollback_allowed:K(),writes_required:G().int().nonnegative()}),Fg=Ag.extend({schema_version:X(`machine_configuration_rollback_receipt_v0`),status:Y([`rolled_back`,`unchanged`]),transaction_id:W(),plan_revision:W(),rollback_id:W().nullable(),readback_verified:X(!0)}),Ig=J({configured:K(),source:Y([`machine_store`,`service_environment`,`unset`]),env_var:W().optional(),fingerprint:W().nullable().optional(),value:W().nullable().optional(),blocked_by:W().optional()}),Lg=J({ok:X(!0),schema_version:X(`operator_provider_credential_projection_v0`),action:W().optional(),store_ref:W(),store_revision:W(),record_present:K(),status:Y([`configured`,`absent`,`invalid`]),repair:W(),provider_key:Ig,base_url:Ig});async function Rg(){return Lg.parse(await qh(`/api/chat/operator-credential`))}async function zg(e){return Lg.parse(await qh(`/api/chat/operator-credential`,{method:`POST`,body:JSON.stringify(e)}))}async function Bg(){return jg.parse(await qh(`/api/chat/machine-configuration`))}async function Vg(e){let t=new URLSearchParams({goal_id:e});return Eg.parse(await qh(`/api/chat/goal-configuration?${t.toString()}`))}async function Hg(e,t,n){return Og.parse(await qh(`/api/chat/goal-configuration/preview`,{method:`POST`,body:JSON.stringify({goal_id:e,capability_id:t,configuration:n})}))}async function Ug(e,t,n,r){return kg.parse(await qh(`/api/chat/goal-configuration/apply`,{method:`POST`,body:JSON.stringify({goal_id:e,capability_id:t,configuration:n,expected_plan_revision:r})}))}async function Wg(e,t){return Mg.parse(await qh(`/api/chat/machine-configuration/preview`,{method:`POST`,body:JSON.stringify({namespace:e,namespace_configuration:t})}))}async function Gg(e,t,n){return Ng.parse(await qh(`/api/chat/machine-configuration/apply`,{method:`POST`,body:JSON.stringify({expected_plan_revision:n,namespace:e,namespace_configuration:t})}))}async function Kg(e){return Mg.parse(await qh(`/api/chat/machine-configuration/preview`,{method:`POST`,body:JSON.stringify({namespace:e,operation:`remove`})}))}async function qg(e,t){return Ng.parse(await qh(`/api/chat/machine-configuration/apply`,{method:`POST`,body:JSON.stringify({expected_plan_revision:t,namespace:e,operation:`remove`})}))}async function Jg(e){return Pg.parse(await qh(`/api/chat/machine-configuration/rollback`,{method:`POST`,body:JSON.stringify({execute:!1,transaction_id:e})}))}async function Yg(e,t){return Fg.parse(await qh(`/api/chat/machine-configuration/rollback`,{method:`POST`,body:JSON.stringify({execute:!0,expected_plan_revision:t,transaction_id:e})}))}var Xg=J({ok:X(!0),goals:q(J({goal_id:W(),repository:J({branch:W(),identity:W(),label:W(),read_only:X(!0)})}))});async function Zg(){return Xg.parse(await qh(`/api/chat/goals/contexts`)).goals}var Qg=J({ok:X(!0),apps:q(J({active:K(),app_ref:W(),brand:W(),health_error_code:W().nullable().default(null),label:W(),ready:K(),reply_ready:K().default(!1)}))});async function $g(){return Qg.parse(await qh(`/api/chat/lark/apps`)).apps}var e_=J({ok:X(!0),app_ref:W(),error:W().nullable(),setup_id:W(),status:Y([`starting`,`waiting_for_feishu`,`ready`,`failed`,`cancelled`]),verification_url:W().url().nullable()});async function t_(e){return e_.parse(await qh(`/api/chat/lark/app-setups`,{method:`POST`,body:JSON.stringify({app_ref:e.appRef,brand:e.brand})}))}async function n_(e){return e_.parse(await qh(`/api/chat/lark/app-setups/${encodeURIComponent(e)}`))}async function r_(e){return e_.parse(await qh(`/api/chat/lark/app-setups/${encodeURIComponent(e)}`,{method:`DELETE`}))}var i_=[`invalid_event`,`binding_unavailable`,`chat_mismatch`,`topic_mismatch`,`route_ambiguous`,`self_message`,`invalid_routing_state`,`not_addressed`],a_=J({ok:X(!0),chats:q(J({chat_id:W(),chat_name:W()}))});async function o_(e,t){let n=new URLSearchParams({app_ref:e});return t&&n.set(`query`,t),a_.parse(await qh(`/api/chat/lark/chats?${n.toString()}`)).chats}var s_=J({ok:X(!0),connections:q(J({conversation_kind:Y([`goal`,`manager`]).default(`goal`),agent_id:W().nullable().default(null),connection_id:W(),app_label:W(),app_ref:W(),capture_scope:Y([`addressed_only`,`configured_chat_all`]).default(`addressed_only`),chat_name:W(),enabled:K(),goal_id:W(),goal_title:W(),health_error_code:W().nullable().default(null),history_permission_guidance:J({action:X(`enable_application_scopes_and_publish`),api_document_url:W().url(),capability:X(`group_history_pagination`),identity:X(`bot`),required_scopes:_d([X(`im:message.group_msg`),X(`im:message.group_msg.include_bot:read`)]),schema_version:X(`lark_bot_group_history_permission_guidance_v0`)}).nullable().default(null),incoming_mode:Y([`mentions`,`all`]),ingress_mode:Y([`live_steering`,`session_queue`,`async_inbox`,`direct_session`]).default(`async_inbox`),event_count:G().int().nonnegative().default(0),last_event_reason:Y(i_).nullable().default(null).catch(null),last_event_status:W().nullable().default(null),listener_error_code:W().nullable().default(null),listener_status:Y([`starting`,`listening`,`retrying`,`stopped`]).nullable().default(null),replied_count:G().int().nonnegative().default(0),reply_ready:K().default(!1),reply_mode:X(`topic_reply`),session_bound:K().default(!1),target_ref:W(),topic_name:W(),topic_setup_required:K()}))});async function c_(){return s_.parse(await qh(`/api/chat/lark/connections`)).connections}async function l_(e){return gg.parse(await qh(`/api/chat/lark/connections`,{method:`POST`,body:JSON.stringify({...e.agentBindings?{agent_bindings:e.agentBindings.map(e=>({agent_id:e.agentId,app_ref:e.appRef}))}:{},...e.agentId?{agent_id:e.agentId}:{},...e.appRef?{app_ref:e.appRef}:{},...e.connectionId?{connection_id:e.connectionId}:{},conversation_kind:e.conversationKind??`goal`,capture_scope:e.captureScope,chat_id:e.chatId,chat_name:e.chatName,execute:e.execute,goal_id:e.goalId,incoming_mode:e.incomingMode,ingress_mode:e.ingressMode,reply_mode:e.replyMode})}))}async function u_(e,t){let n=new URLSearchParams({goal_id:e,connection_id:t});return gg.parse(await qh(`/api/chat/lark/connections?${n.toString()}`,{method:`DELETE`}))}function d_(e){return{loadedUrl:null,projectionRevision:0,requestedUrl:e,selectionRevision:0,requestGeneration:0}}function f_(e,t){return e.selectionRevision+=1,e.requestedUrl=t,e.selectionRevision}function p_(e,t,n){if(n.background)return e.requestedUrl!==null||e.loadedUrl!==t?null:(e.requestGeneration+=1,{background:!0,projectionRevision:e.projectionRevision,selectionRevision:e.selectionRevision,url:t,generation:e.requestGeneration});let r=n.selectionRevision??e.selectionRevision+1;return n.selectionRevision!==void 0&&e.selectionRevision!==r?null:(e.selectionRevision=r,e.projectionRevision+=1,e.requestedUrl=t,e.requestGeneration+=1,{background:!1,projectionRevision:e.projectionRevision,selectionRevision:r,url:t,generation:e.requestGeneration})}function m_(e,t){return t.generation===e.requestGeneration&&e.projectionRevision===t.projectionRevision&&e.selectionRevision===t.selectionRevision}function h_(e,t){return m_(e,t)&&(!t.background||e.requestedUrl===null&&e.loadedUrl===t.url)}function g_(e,t,n){return t.get(e)===n}function __(e,t,n,r){return e.filter(e=>g_(r(e),n,t))}function v_(e,t,n){let r=new Set,i=[];for(let a of[...e,...t]){let e=n(a);e==null||r.has(e)||(r.add(e),i.push(a))}return i}var y_=[`runs_24h`,`runs_7d`,`quota_spend_slots_24h`,`quota_spend_slots_7d`,`automation_run_count_24h`,`automation_run_count_7d`,`progress_signal_run_count_24h`,`progress_signal_run_count_7d`],b_=[`input_tokens_24h`,`input_tokens_7d`,`output_tokens_24h`,`output_tokens_7d`,`cache_tokens_24h`,`cache_tokens_7d`,`cost_usd_24h`,`cost_usd_7d`,`duration_ms_24h`,`duration_ms_7d`],x_=[`accounting`,`decision`,`evidence`,`state`,`work`],S_={accounting:0,decision:0,evidence:0,state:0,work:0},C_={runs_24h:0,runs_7d:0,quota_spend_slots_24h:0,quota_spend_slots_7d:0,automation_run_count_24h:0,automation_run_count_7d:0,progress_signal_run_count_24h:0,progress_signal_run_count_7d:0};function w_(e,t){let n={...e};for(let r of y_)n[r]=(Number(e[r])||0)+(Number(t[r])||0);for(let r of b_)(e[r]!==void 0||t[r]!==void 0)&&(n[r]=(e[r]??0)+(t[r]??0));return n}function T_(e,t){return!e.length||t<=0?e:e.map(e=>({...e,project_share_24h:Math.round((Number(e.runs_24h)||0)/t*1e3)/1e3}))}function E_(e,t){let n={...e};for(let r of x_)n[r]=(e[r]??0)+(t[r]??0);return n}function D_(e){let t={events_24h:0,events_7d:0,by_class_24h:{...S_},by_class_7d:{...S_}};for(let n of e)t.events_24h+=n.events_24h,t.events_7d+=n.events_7d,t.by_class_24h=E_(t.by_class_24h,n.by_class_24h),t.by_class_7d=E_(t.by_class_7d,n.by_class_7d);return t}function O_(e,t,n){if(!e&&!t)return null;let r=__(e?.goals??[],`active`,n,e=>e.goal_id),i=__(t?.goals??[],`stopped`,n,e=>e.goal_id),a=v_(r,i,e=>e.goal_id),o=D_(r),s=D_(i),c={events_24h:o.events_24h+s.events_24h,events_7d:o.events_7d+s.events_7d,by_class_24h:E_(o.by_class_24h,s.by_class_24h),by_class_7d:E_(o.by_class_7d,s.by_class_7d)};return{...e??t,goals:a,sample_run_count:(e?.sample_run_count??0)+(t?.sample_run_count??0),totals:c}}function k_(e,t,n){if(!e&&!t)return null;let r=v_([...__(e?.items??[],`active`,n,e=>e.goal_id),...__(t?.items??[],`stopped`,n,e=>e.goal_id)],[],e=>`${e.goal_id}:${e.decision_kind??``}:${e.decision_at??``}`),i={decision_count:(e?.summary.decision_count??0)+(t?.summary.decision_count??0),stale_count:r.filter(e=>e.stale_by_age).length,rebase_required_count:(e?.summary.rebase_required_count??0)+(t?.summary.rebase_required_count??0),fresh_count:(e?.summary.fresh_count??0)+(t?.summary.fresh_count??0)};return{...e??t,items:r,sample_run_count:(e?.sample_run_count??0)+(t?.sample_run_count??0),summary:i}}function A_(e,t){return v_([...e,...t].sort((e,t)=>t.generated_at.localeCompare(e.generated_at)),[],e=>`${e.goal_id}:${e.generated_at}:${e.classification??``}`)}function j_(e,t,n){let r=v_(__(e.items,`active`,n,e=>e.goal_id),__(t.items,`stopped`,n,e=>e.goal_id),e=>e.goal_id);return{...e,item_count:r.length,items:r,needs_controller:r.filter(e=>e.waiting_on===`controller`).length,needs_codex:r.filter(e=>e.waiting_on===`codex`).length,needs_user_or_controller:r.filter(e=>[`user_or_controller`,`controller`].includes(e.waiting_on)).length,watching_external_evidence:r.filter(e=>e.waiting_on===`external_evidence`).length}}function M_(e){let t=e.todo_id?.trim()||``;return t?`${e.goal_id}:${t}`:`${e.goal_id}:synthetic:${e.role??``}:${e.index??``}:${e.text??``}`}function N_(e){let t={...C_};for(let n of e){for(let e of y_)t[e]+=Number(n[e])||0;for(let e of b_)n[e]!==void 0&&(t[e]=(t[e]??0)+n[e])}return t}function P_(e,t,n){if(!e&&!t)return null;let r=__(e?.items??[],`active`,n,e=>e.goal_id),i=__(t?.items??[],`stopped`,n,e=>e.goal_id),a=v_(r,i,M_);return{...e??t,current_projected_count:r.length+i.length,items:a,rollout_event_count:a.reduce((e,t)=>e+(t.event_count??0),0),total_count:a.length}}function F_(e,t,n){if(!e&&!t)return null;let r=__(e?.goals??[],`active`,n,e=>e.goal_id),i=__(t?.goals??[],`stopped`,n,e=>e.goal_id),a=v_(r,i,e=>e.goal_id),o=w_(N_(r),N_(i));return{...e??t,goals:T_(a,Number(o.runs_24h)||0),sample_run_count:(e?.sample_run_count??0)+(t?.sample_run_count??0),totals:o}}function I_(e,t,n){if(!e&&!t)return null;let r=(e?.agents??[]).filter(e=>e.goal_ids.some(e=>g_(e,n,`active`))||(e.current_todo?.goal_id?g_(e.current_todo.goal_id,n,`active`):!1)),i=(t?.agents??[]).filter(e=>e.goal_ids.some(e=>g_(e,n,`stopped`))||(e.current_todo?.goal_id?g_(e.current_todo.goal_id,n,`stopped`):!1)),a=v_(r,i,e=>e.agent_id).map(e=>{let t=i.find(t=>t.agent_id===e.agent_id);return t?{...e,goal_ids:Array.from(new Set([...e.goal_ids??[],...t.goal_ids]))}:e});return{...e??t,agents:a,source_summary:(e??t)?.source_summary?{...(e??t).source_summary,projected_agent_count:a.length,registered_agent_count:new Set(a.map(e=>e.agent_id)).size}:(e??t)?.source_summary}}function L_(e,t,n){if(!e&&!t)return null;let r=v_(__(e?.goals??[],`active`,n,e=>e.goal_id),__(t?.goals??[],`stopped`,n,e=>e.goal_id),e=>e.goal_id);return{...e??t,goals:r}}function R_(e,t){let n=t.goal_projection?.scope;if(n!==`active`&&n!==`stopped`)return t;let r=n,i=t.run_history.goals,a=e.run_history.goals,o=v_(r===`active`?i:a.filter(e=>e.activation_state!==`stopped`),r===`stopped`?i:a.filter(e=>e.activation_state===`stopped`),e=>e.id),s=new Map(o.map(e=>[e.id,e.activation_state])),c=r===`active`?t:e,l=r===`stopped`?t:e,u=e.goal_projection?.registry_revision??null,d=t.goal_projection?.registry_revision??null,f=u===null||d===null||u===d;return{...e,agent_management_projection:I_(c.agent_management_projection,l.agent_management_projection,s),attention_queue:j_(c.attention_queue,l.attention_queue,s),decision_freshness_summary:k_(c.decision_freshness_summary,l.decision_freshness_summary,s),event_ledger_summary:O_(c.event_ledger_summary,l.event_ledger_summary,s),goal_channel_notification_projection:L_(c.goal_channel_notification_projection,l.goal_channel_notification_projection,s),goal_projection:{schema_version:`loopx_goal_projection_scope_v0`,...t.goal_projection,complete:f,projected_goal_count:o.length,registry_goal_count:t.goal_projection?.registry_goal_count??0,scope:`all`},run_history:{...e.run_history,goal_count:o.length,goals:o,recent_runs:A_(c.run_history.recent_runs,l.run_history.recent_runs),run_count:c.run_history.run_count+l.run_history.run_count},todo_index:P_(c.todo_index,l.todo_index,s),usage_summary:F_(c.usage_summary,l.usage_summary,s)}}function z_(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e==`boolean`?`${e}`:e===0?`0`:e,H_=B_,U_=(e,t)=>n=>{if(t?.variants==null)return H_(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=V_(t)||V_(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return H_(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},W_=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),K_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),q_=`-`,J_=[],Y_=`arbitrary..`,X_=e=>{let t=$_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Q_(e);let n=e.split(q_);return Z_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?W_(i,t):t:i||J_}return n[e]||J_}}},Z_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Z_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(q_):e.slice(t).join(q_),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Y_+r:void 0})(),$_=e=>{let{theme:t,classGroups:n}=e;return ev(n,t)},ev=(e,t)=>{let n=K_();for(let r in e){let i=e[r];tv(i,n,r,t)}return n},tv=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){rv(e,t,n);return}if(typeof e==`function`){iv(e,t,n,r);return}av(e,t,n,r)},rv=(e,t,n)=>{let r=e===``?t:ov(t,e);r.classGroupId=n},iv=(e,t,n,r)=>{if(sv(e)){tv(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(G_(n,e))},av=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(q_),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,cv=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},lv=`!`,uv=`:`,dv=[],fv=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),pv=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return fv(t,l,c,u)};if(t){let e=t+uv,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):fv(dv,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},mv=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},hv=e=>({cache:cv(e.cacheSize),parseClassName:pv(e),sortModifiers:mv(e),postfixLookupClassGroupIds:gv(e),...X_(e)}),gv=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(_v),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+lv:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},yv=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=hv(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=vv(e,n);return i(e,a),a};return a=o,(...e)=>a(yv(...e))},Sv=[],Cv=e=>{let t=t=>t[e]||Sv;return t.isThemeGetter=!0,t},wv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Tv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ev=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Dv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ov=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,kv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Av=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mv=e=>Ev.test(e),Nv=e=>!!e&&!Number.isNaN(Number(e)),Pv=e=>!!e&&Number.isInteger(Number(e)),Fv=e=>e.endsWith(`%`)&&Nv(e.slice(0,-1)),Iv=e=>Dv.test(e),Lv=()=>!0,Rv=e=>Ov.test(e)&&!kv.test(e),zv=()=>!1,Bv=e=>Av.test(e),Vv=e=>jv.test(e),Hv=e=>!Q(e)&&!$(e),Uv=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Wv=e=>ay(e,ly,zv),Q=e=>wv.test(e),Gv=e=>ay(e,uy,Rv),Kv=e=>ay(e,dy,Nv),qv=e=>ay(e,py,Lv),Jv=e=>ay(e,fy,zv),Yv=e=>ay(e,sy,zv),Xv=e=>ay(e,cy,Vv),Zv=e=>ay(e,my,Bv),$=e=>Tv.test(e),Qv=e=>oy(e,uy),$v=e=>oy(e,fy),ey=e=>oy(e,sy),ty=e=>oy(e,ly),ny=e=>oy(e,cy),ry=e=>oy(e,my,!0),iy=e=>oy(e,py,!0),ay=(e,t,n)=>{let r=wv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},oy=(e,t,n=!1)=>{let r=Tv.exec(e);return r?r[1]?t(r[1]):n:!1},sy=e=>e===`position`||e===`percentage`,cy=e=>e===`image`||e===`url`,ly=e=>e===`length`||e===`size`||e===`bg-size`,uy=e=>e===`length`,dy=e=>e===`number`,fy=e=>e===`family-name`,py=e=>e===`number`||e===`weight`,my=e=>e===`shadow`,hy=xv(()=>{let e=Cv(`color`),t=Cv(`font`),n=Cv(`text`),r=Cv(`font-weight`),i=Cv(`tracking`),a=Cv(`leading`),o=Cv(`breakpoint`),s=Cv(`container`),c=Cv(`spacing`),l=Cv(`radius`),u=Cv(`shadow`),d=Cv(`inset-shadow`),f=Cv(`text-shadow`),p=Cv(`drop-shadow`),m=Cv(`blur`),h=Cv(`perspective`),g=Cv(`aspect`),_=Cv(`ease`),v=Cv(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[Mv,`full`,`auto`,...w()],E=()=>[Pv,`none`,`subgrid`,$,Q],D=()=>[`auto`,{span:[`full`,Pv,$,Q]},Pv,$,Q],O=()=>[Pv,`auto`,$,Q],k=()=>[`auto`,`min`,`max`,`fr`,$,Q],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],te=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[Mv,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[Mv,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[Mv,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,$,Q],P=()=>[...b(),ey,Yv,{position:[$,Q]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,ty,Wv,{size:[$,Q]}],ae=()=>[Fv,Qv,Gv],F=()=>[``,`none`,`full`,l,$,Q],oe=()=>[``,Nv,Qv,Gv],I=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],L=()=>[Nv,Fv,ey,Yv],ce=()=>[``,`none`,m,$,Q],le=()=>[`none`,Nv,$,Q],ue=()=>[`none`,Nv,$,Q],de=()=>[Nv,$,Q],fe=()=>[Mv,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Iv],breakpoint:[Iv],color:[Lv],container:[Iv],"drop-shadow":[Iv],ease:[`in`,`out`,`in-out`],font:[Hv],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Iv],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Iv],shadow:[Iv],spacing:[`px`,Nv],text:[Iv],"text-shadow":[Iv],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Mv,Q,$,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,$,Q]}],"container-named":[Uv],columns:[{columns:[Nv,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Pv,`auto`,$,Q]}],basis:[{basis:[Mv,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Nv,Mv,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,Nv,$,Q]}],shrink:[{shrink:[``,Nv,$,Q]}],order:[{order:[Pv,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...te(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...te()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...te(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...te(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...te(),`baseline`]}],"place-self":[{"place-self":[`auto`,...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...M()]}],"min-inline-size":[{"min-inline":[`auto`,...M()]}],"max-inline-size":[{"max-inline":[`none`,...M()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,Qv,Gv]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,iy,qv]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Fv,Q]}],"font-family":[{font:[$v,Jv,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[Nv,`none`,$,Kv]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...I(),`wavy`]}],"text-decoration-thickness":[{decoration:[Nv,`from-font`,`auto`,$,Gv]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Nv,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Pv,$,Q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Pv,$,Q],radial:[``,$,Q],conic:[Pv,$,Q]},ny,Xv]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...I(),`hidden`,`none`]}],"divide-style":[{divide:[...I(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...I(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Nv,$,Q]}],"outline-w":[{outline:[``,Nv,Qv,Gv]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,ry,Zv]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,ry,Zv]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Nv,Gv]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,ry,Zv]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Nv,$,Q]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Nv]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Nv]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:ce()}],brightness:[{brightness:[Nv,$,Q]}],contrast:[{contrast:[Nv,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ry,Zv]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,Nv,$,Q]}],"hue-rotate":[{"hue-rotate":[Nv,$,Q]}],invert:[{invert:[``,Nv,$,Q]}],saturate:[{saturate:[Nv,$,Q]}],sepia:[{sepia:[``,Nv,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Nv,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[Nv,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Nv,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Nv,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,Nv,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[Nv,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[Nv,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Nv,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Nv,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[Nv,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Pv,$,Q]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[Nv,Qv,Gv,Kv]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function gy(...e){return hy(B_(e))}var _y=U_(`inline-flex h-9 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md border px-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-zinc-500`,{variants:{variant:{primary:`border-slate-900 bg-slate-950 text-white hover:bg-slate-800 dark:border-zinc-100 dark:bg-zinc-50 dark:text-zinc-950 dark:hover:bg-zinc-200`,secondary:`border-slate-200 bg-white text-slate-900 hover:bg-slate-50 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-100 dark:hover:bg-zinc-900`,ghost:`border-transparent bg-transparent text-slate-700 hover:bg-slate-100 dark:text-zinc-300 dark:hover:bg-zinc-900`},size:{sm:`h-8 px-2 text-xs`,md:`h-9 px-3 text-sm`,icon:`h-9 w-9 px-0`}},defaultVariants:{variant:`secondary`,size:`md`}});function vy({className:e,variant:t,size:n,...r}){return(0,B.jsx)(`button`,{className:gy(_y({variant:t,size:n}),e),type:`button`,...r})}function yy({className:e,...t}){return(0,B.jsx)(`section`,{className:gy(`rounded-lg border border-slate-200/80 bg-white/95 text-slate-950 shadow-[0_1px_2px_rgba(15,23,42,0.04)] dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50`,e),...t})}function by({className:e,...t}){return(0,B.jsx)(`div`,{className:gy(`p-4 pt-0`,e),...t})}var xy=[`codex`,`claude`,`kiro`,`trae`,`coco`,`openai`,`anthropic`],Sy=new Set([`acp`,`status_projection`]);function Cy(e){let t=e.trim().toLowerCase().replace(/_/gu,`-`);for(let e of xy)if(t===e||t.startsWith(`${e}-`))return e;return t}function wy(e,t){let n=t?.trim().toLowerCase()??``;return n.length>0&&!Sy.has(n)?Cy(n):Cy(e)}var Ty={"zh-CN":{title:`交办说明`,context:`背景与补充`,constraints:`约束`,inputs:`输入材料`,acceptance:`验收要求`,return:`需要回传`,supplied:`已提供给接收方`,pending:`等待接收方读取`,decision:`接收方判断`,unknown:`尚未记录`,unavailable:`暂时无法读取`,adopt:`已采纳`,defer:`已暂缓`,reject:`未采纳`,no_change:`无需调整`,result:`结论已保存`,delivered:`结论已回传`,details:`查看交办内容`},en:{title:`Delegation brief`,context:`Context & corrections`,constraints:`Constraints`,inputs:`Inputs`,acceptance:`Acceptance`,return:`Expected return`,supplied:`Supplied to receiver`,pending:`Awaiting receiver read`,decision:`Receiver decision`,unknown:`Not recorded`,unavailable:`Readback unavailable`,adopt:`Adopted`,defer:`Deferred`,reject:`Rejected`,no_change:`No change needed`,result:`Conclusion saved`,delivered:`Conclusion returned`,details:`View delegation details`}};function Ey({request:e}){let{locale:t}=Ji();if(!e)return null;let n=Ty[t],r=e.brief,i=e.decision,a=e.returns.find(e=>e.phase===`conclusion`);return(0,B.jsxs)(`section`,{className:`personal-collaboration`,"aria-label":n.title,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:r.purpose}),(0,B.jsx)(`span`,{children:e.agent_id})]}),(0,B.jsxs)(`p`,{className:`personal-collaboration-status`,children:[(0,B.jsx)(`span`,{children:e.read_status===`supplied`?n.supplied:e.read_status===`unavailable`?n.unavailable:n.pending}),(0,B.jsxs)(`span`,{children:[n.decision,`: `,n[i]??(e.decision===`unavailable`?n.unavailable:n.unknown)]}),a?(0,B.jsx)(`span`,{children:a.status===`delivered`?n.delivered:n.result}):null]}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:n.details}),(0,B.jsx)(`h4`,{children:n.context}),(0,B.jsx)(`p`,{children:r.context}),r.constraints.length?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:n.constraints}),(0,B.jsx)(`ul`,{children:r.constraints.map((e,t)=>(0,B.jsx)(`li`,{children:e},t))})]}):null,r.inputs.length?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:n.inputs}),(0,B.jsx)(`ul`,{children:r.inputs.map((e,t)=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`code`,{children:e.ref}),` — `,e.description,e.sha256?(0,B.jsxs)(`small`,{children:[`sha256:`,e.sha256]}):null]},t))})]}):null,(0,B.jsx)(`h4`,{children:n.acceptance}),(0,B.jsx)(`ul`,{children:r.acceptance.map((e,t)=>(0,B.jsx)(`li`,{children:e},t))}),(0,B.jsx)(`h4`,{children:n.return}),(0,B.jsx)(`p`,{children:r.return_requirement})]})]})}var Dy={stop:`ready_stop`,resume:`resume_review`,delete:`delete_review`};function Oy(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function ky(e){return typeof e==`string`&&e.trim().length>0?e:null}function Ay(e,t=240){let n=typeof e==`string`?e.replace(/\s+/g,` `).trim():``;return n.length>t?`${n.slice(0,t-1)}…`:n}function jy(e){let t=Oy(e)??{},n=Ay(t.agent_id,80)||`unknown-agent`,r=Ay(t.acceptance,200);if(t.staffing===`gap`){let e=Oy(t.declined_first_todo)??{};return[`${n} · gap`,Ay(t.gap_reason_code,80),Ay(e.text,200)].filter(Boolean).join(` · `)}let i=Oy(t.first_todo)??{};return[`${n} · ready`,Ay(i.priority,8),Ay(i.action_kind,40),Ay(i.text,240),r?`acceptance: ${r}`:``].filter(Boolean).join(` · `)}function My(e){let t=Oy(e)??{};return Object.entries(t).map(([e,t])=>`${e}: ${typeof t==`object`&&t?JSON.stringify(t):String(t)}`).join(` · `)}function Ny(e){let t=Oy(e);if(t?.action_kind!==`team.plan`||t.status!==`preview_ready`&&t.status!==`deferred`)return;let n=Oy(Oy(t.normalized_parameters)?.plan);if(!n||n.kind!==`steward_team_plan_preview`||n.applies!==!1)return;let r=ky(t.proposal_id),i=ky(t.expected_state_fingerprint),a=ky(n.goal_id);if(!r||!i||!a)return;let o=Array.isArray(n.lanes)?n.lanes:[],s=Array.isArray(n.gaps)?n.gaps:[],c=[{key:`goal`,value:a},{key:`objective`,value:Ay(n.objective)},...o.map((e,t)=>({key:`lane_${t+1}`,value:jy(e)})),...s.length>0?[{key:`lane_gaps`,value:s.map(e=>{let t=Oy(e)??{};return[Ay(t.lane_id,80),Ay(t.reason_code,80)].filter(Boolean).join(`: `)}).filter(Boolean).join(` · `)}]:[],{key:`quota_envelope`,value:My(n.quota_envelope)},{key:`stop_condition`,value:Ay(n.stop_condition)}].filter(e=>e.value.length>0);return{schemaVersion:`review_card_frame_v0`,actionKind:`team.plan`,proposalId:r,stateFingerprint:i,kind:`confirmation`,attentionKind:`authority`,interactionMode:`confirm_reject`,decisions:[`confirm`,`reject`],titleKey:`team_plan_preview`,subtitleKey:`preview_only_no_lane_exists`,confirmLabelKey:`confirm_team_plan`,rejectLabelKey:`reject_team_plan`,warningKey:`confirming_creates_each_ready_lane_first_todo`,focus:`${a} · ${o.length} lane${o.length===1?``:`s`}`,fields:c}}function Py(e){let t=Oy(e.projection);if(t?.schema_version!==`loopx_operation_projection_v0`)return null;let n=ky(t.title),r=ky(t.subtitle),i=ky(t.focus),a=ky(t.warning);if(!n||!r||!i||!a||!Array.isArray(t.fields))return null;let o=[];for(let e of t.fields){let t=Oy(e),n=ky(t?.label),r=ky(t?.value);if(!n||!r)return null;o.push({label:n,value:r})}return{title:n,subtitle:r,focus:i,fields:o,warning:a}}function Fy(e){let t=Oy(e);if(t?.action_kind!==`operation.execute`)return;let n=Oy(t.normalized_parameters),r=Oy(t.operation);if(!n||r?.schema_version!==`loopx_operation_envelope_v0`)return;let i=ky(r.operation_id),a=ky(r.confirmation_digest),o=ky(r.expires_at),s=Py(n);if(!i||!a||!o||!s||i!==t.proposal_id)return;let c=r.lifecycle_state;if(c!==`awaiting_confirmation`&&c!==`claimed`&&c!==`outcome_observed`)return;let l={schemaVersion:`operation_review_frame_v0`,operationId:i,confirmationDigest:a,lifecycleState:c,simulated:Oy(n.projection).simulated===!0,expiresAt:o,content:s};if(c===`awaiting_confirmation`)return{...l,kind:`confirmation`,attentionKind:`authority`,interactionMode:`confirm_reject`,decisions:[`confirm`,`reject`]};if(c===`claimed`)return{...l,kind:`pending`,attentionKind:`progress`,interactionMode:`inform`};let u=Oy(r.outcome);if(!u)return;let d=u.outcome===`rejected_by_operator`,f=u.simulation===!0||l.simulated;return{...l,kind:`result`,attentionKind:`progress`,interactionMode:`inform`,resultKind:d?`rejected`:f?`simulation_completed`:`completed`,resultDeliveryVerified:Oy(r.result_delivery)!==null,summary:ky(u.summary)??``}}function Iy(e){let t=Oy(e)??{},n={schemaVersion:`action_review_plan_v0`,proposalId:typeof t.proposal_id==`string`?t.proposal_id:``,sourceFingerprint:typeof t.expected_state_fingerprint==`string`?t.expected_state_fingerprint:``},r=Fy(t),i=Ny(t),a=e=>({...n,...e,...r?{operationFrame:r}:{},...i?{reviewCardFrame:i}:{}}),o=(e,t)=>a({interaction:e,reason:t,canApply:!1}),s=t.action_kind===`goal.lifecycle`;if(s&&t.gate!=null||t.status===`gated`)return o(`gated`,`authority_gate`);if(s&&t.stale!=null||t.status===`stale`)return o(`refresh`,`stale_proposal`);if(t.status===`applied`)return Oy(t.receipt)?.projection_verified===!0&&(t.action_kind!==`operation.execute`||Oy(Oy(t.operation)?.result_delivery)!==null)?o(`completed`,`readback_verified`):o(`repair`,`readback_unverified`);let c=Oy(t.canonical_update_basis),l=Oy(t.normalized_parameters);if(c?.schema_version===`loopx_chat_canonical_update_basis_v0`&&ky(c.provider_revision)!==null&&ky(c.registry_sha256)!==null&&(t.action_kind===`todo.update`||t.action_kind===`monitor.update`&&[`pause`,`resume`,`edit`].includes(String(l?.operation)))&&(t.status===`applying`||t.status===`failed`))return{...a({interaction:`review`,canApply:!0,reason:Oy(t.failure)?.error_code===`canonical_update_projection_pending`?`canonical_update_projection_pending`:`canonical_update_retry`}),retryOriginal:!0};if(t.status===`applying`)return o(`pending`,`apply_pending`);if(t.status===`failed`||t.error!=null)return o(`repair`,`apply_failed`);if(t.status!==`preview_ready`&&t.status!==`deferred`)return o(`inactive`,`inactive_proposal`);let u=(e,t=!0)=>a({interaction:`review`,reason:e,canApply:t});if(t.action_kind!==`goal.lifecycle`)return u(t.permission_classification===`protected`?`protected_action`:`action_review`);let d=t.validation_evidence,f=t.available_transitions;if(!(ky(t.proposal_id)!==null&&ky(t.expected_state_fingerprint)!==null&&Array.isArray(d)&&d.length>0&&d.every(e=>ky(e)!==null)&&Array.isArray(f)&&f.includes(`apply`)))return o(`refresh`,`incomplete_proposal`);let p=Oy(t.context),m=l?.operation,h=ky(l?.goal_id);if(!h||p?.goal_id!=null&&p.goal_id!==h)return o(`refresh`,`incomplete_proposal`);if(m!==`stop`&&m!==`resume`&&m!==`delete`)return u(`unknown_action`,!1);if(t.permission_classification===`protected`)return u(`protected_action`);if(t.permission_classification!==`durable_write`)return u(`unknown_permission`,!1);let g=Dy[m];return g===`ready_stop`&&t.status===`preview_ready`?a({interaction:`direct`,reason:g,canApply:!0}):u(g===`ready_stop`?`action_review`:g)}function Ly(e){return e.error_code===`action_stale`||e.error_code===`action_conflict`||Oy(e.proposal)?.status===`stale`}function Ry(e){return typeof e==`object`&&e?e:{}}function zy(e){return typeof e==`string`?e:``}function By(e,t){let n=Ry(e.plan),r=[],i=zy(e.goal_id)||zy(n.goal_id);i&&r.push({key:`goal_id`,label:t(`proposal.field.goalId`),value:i});let a=zy(n.objective);a&&r.push({key:`objective`,label:t(`proposal.field.objective`),value:a}),(Array.isArray(n.lanes)?n.lanes:[]).forEach((e,n)=>{let i=Ry(e),a=zy(i.lane_id)||`lane-${n+1}`,o=zy(i.agent_id),s=zy(i.acceptance);if(zy(i.staffing)===`gap`){let e=Ry(i.declined_first_todo);r.push({key:`lane_${a}`,label:o||a,value:[t(`proposal.teamPlan.gapLane`),Gy(zy(i.gap_reason_code),t),zy(e.text)].filter(Boolean).join(` · `)});return}let c=Ry(i.first_todo),l=[zy(c.priority),zy(c.action_kind),zy(c.text)].filter(Boolean).join(` · `);r.push({key:`lane_${a}`,label:o||a,value:[l||t(`proposal.teamPlan.laneUnstaffed`),s?`${t(`proposal.teamPlan.acceptanceShort`)}: ${s}`:``].filter(Boolean).join(` · `)})});let o=Ry(n.quota_envelope),s=Object.entries(o);s.length>0&&r.push({key:`quota_envelope`,label:t(`proposal.field.quotaEnvelope`),value:s.map(([e,t])=>`${e}: ${String(t??``)}`).join(` · `)+` · ${t(`proposal.teamPlan.advisory`)}`});let c=zy(n.stop_condition);return c&&r.push({key:`stop_condition`,label:t(`proposal.field.stopCondition`),value:`${c} · ${t(`proposal.teamPlan.advisory`)}`}),r}function Vy(e){let t=Ry(e.plan);return Array.isArray(t.lanes)?t.lanes.length:0}function Hy(e){let t=Ry(e.plan);return zy(e.goal_id)||zy(t.goal_id)}function Uy(e,t){let n=Ry(e),r=Ry(t.plan),i=(Array.isArray(r.lanes)?r.lanes:[]).map(Ry);return(Array.isArray(n.lanes)?n.lanes:[]).map(e=>{let t=Ry(e),n=zy(t.lane_id),r=i.find(e=>e.lane_id===n);return{laneId:n,agentId:zy(t.agent_id),task:zy(Ry(r?.first_todo).text)||n}}).filter(e=>e.laneId.length>0)}function Wy(e,t={}){let n=Ry(e),r=Ry(t.plan),i=(Array.isArray(r.lanes)?r.lanes:[]).map(Ry);return(Array.isArray(n.gap_lanes)?n.gap_lanes:[]).map(e=>{let t=Ry(e);return{laneId:zy(t.lane_id),agentId:zy(t.agent_id),reasonCode:zy(t.reason_code),task:zy(Ry(i.find(e=>e.lane_id===t.lane_id)?.declined_first_todo).text)}}).filter(e=>e.laneId.length>0)}function Gy(e,t){return e===`agent_not_registered`?t(`proposal.teamPlan.gapReason.agentNotRegistered`):e===`action_kind_not_supported`?t(`proposal.teamPlan.gapReason.actionKindNotSupported`):e===`capability_not_granted`?t(`proposal.teamPlan.gapReason.capabilityNotGranted`):e===`audience_not_authorized`?t(`proposal.teamPlan.gapReason.audienceNotAuthorized`):e}function Ky(e){let t=Ry(e),n=zy(t.outcome),r=Array.isArray(t.lanes)?t.lanes.length:0,i=typeof t.gap_count==`number`?t.gap_count:0;return n===`team_plan_partially_applied`?{kind:`partially_applied`,created:r,gaps:i}:n===`team_plan_lanes_already_present`||n===`team_plan_commit_recovered`?{kind:`already_present`,created:r,gaps:i}:n===`team_plan_applied`?{kind:`applied`,created:r,gaps:i}:null}function qy(e,t){return e?.kind===`partially_applied`?t(`proposal.teamPlan.appliedPartially`,{created:String(e.created),gaps:String(e.gaps)}):e?.kind===`already_present`?t(`proposal.teamPlan.appliedAlreadyPresent`):t(e?.kind===`applied`?`proposal.teamPlan.applied`:`drawer.proposalApplied`,{count:e?.created??0})}function Jy(e){return{blockingTodoCount:e.blockingTodoCount,goalNotifications:e.goalNotifications,goals:e.goals,openUserTodoCount:e.openUserTodoCount,systemHealth:e.systemHealth,attentionHistory:e.attentionHistory,userTodos:e.userTodos,workers:e.workers}}function Yy(e,t){return e.goals.find(e=>e.goalId===t)?.title??t}function Xy(e){return e.activationState===`stopped`||e.state===`已停止`?`stopped`:e.state===`已完成`?`history`:e.needsYou||e.state===`等你`?`needs_you`:e.state===`推进中`||e.state===`需修复`?`running`:e.state===`安静运行`?`observing`:`scheduled`}function Zy(e){let t=e;return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Qy(e){return`$${e.toFixed(2)}`}function $y(e){let t=e;return t>=36e5?`${(t/36e5).toFixed(1)}h`:t>=6e4?`${(t/6e4).toFixed(1)}m`:t>=1e3?`${Math.round(t/1e3)}s`:`${t}ms`}function eb(e,t,n){return e==null?t:n(e)}function tb(e){return!!(e&&[e.tokens24h,e.tokens7d,e.costUsd24h,e.costUsd7d,e.durationMs24h,e.durationMs7d].some(e=>e!=null))}function nb(e,t){if(!tb(e))return null;let n=(e,n,r,i)=>{let a=[n==null?null:`${Zy(n)} ${t.tokens}`,r==null?null:`${t.cost}: ${Qy(r)}`,i==null?null:`${t.duration}: ${$y(i)}`].filter(e=>e!==null);return a.length?`${e} ${a.join(` · `)}`:null};return n(t.period7d,e.tokens7d,e.costUsd7d,e.durationMs7d)??n(t.period24h,e.tokens24h,e.costUsd24h,e.durationMs24h)}function rb({ariaLabel:e,className:t,icon:n,onChange:r,options:i,prefixLabel:a,value:o}){let s=(0,z.useId)(),c=(0,z.useRef)(null),l=(0,z.useRef)(null),u=(0,z.useRef)(new Map),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)(o),h=i.find(e=>e.value===o)??i[0],g=i.filter(e=>!e.disabled);(0,z.useEffect)(()=>{if(!d)return;let e=e=>{c.current?.contains(e.target)||f(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[d]),(0,z.useEffect)(()=>{d&&u.current.get(p)?.focus()},[p,d]);function _(e){m(e)}function v(e=`selected`){let t=e===`last`?g.at(-1):g[0],n=e===`selected`&&h&&!h.disabled?h:t;n&&(f(!0),_(n.value))}function y({restoreFocus:e=!1}={}){f(!1),e&&l.current?.focus()}function b(e){e.disabled||(r(e.value),y({restoreFocus:!0}))}function x(e){if(!g.length)return;let t=g.findIndex(e=>e.value===p),n=t<0?0:(t+e+g.length)%g.length;_(g[n].value)}function S(e){e.key===`ArrowDown`||e.key===`Enter`||e.key===` `?(e.preventDefault(),v(`selected`)):e.key===`ArrowUp`&&(e.preventDefault(),v(`last`))}function C(e,t){if(e.key===`ArrowDown`)e.preventDefault(),x(1);else if(e.key===`ArrowUp`)e.preventDefault(),x(-1);else if(e.key===`Home`)e.preventDefault(),g[0]&&_(g[0].value);else if(e.key===`End`){e.preventDefault();let t=g.at(-1);t&&_(t.value)}else e.key===`Enter`||e.key===` `?(e.preventDefault(),b(t)):e.key===`Escape`?(e.preventDefault(),y({restoreFocus:!0})):e.key===`Tab`&&y()}let w;return(0,B.jsxs)(`div`,{className:`personal-select${t?` ${t}`:``}`,ref:c,children:[(0,B.jsxs)(`button`,{"aria-controls":s,"aria-expanded":d,"aria-haspopup":`listbox`,"aria-label":e,className:`personal-select-trigger`,"data-value":o,onClick:()=>d?y():v(),onKeyDown:S,ref:l,role:`combobox`,type:`button`,children:[n?(0,B.jsx)(`span`,{className:`personal-select-icon`,children:n}):null,(0,B.jsxs)(`span`,{className:`personal-select-value`,children:[a?(0,B.jsx)(`small`,{children:a}):null,(0,B.jsx)(`span`,{children:h?.label??o})]}),(0,B.jsx)(sm,{"aria-hidden":!0,className:d?`is-open`:void 0,size:14})]}),d?(0,B.jsx)(`div`,{"aria-label":e,className:`personal-select-listbox`,id:s,role:`listbox`,children:i.map(e=>{let t=e.group&&e.group!==w;return w=e.group,(0,B.jsxs)(`div`,{className:`personal-select-option-wrap`,children:[t?(0,B.jsx)(`div`,{className:`personal-select-group-label`,children:e.group}):null,(0,B.jsxs)(`button`,{"aria-disabled":e.disabled||void 0,"aria-selected":e.value===o,className:`personal-select-option`,disabled:e.disabled,id:`${s}-${e.value.replace(/[^a-z0-9_-]/gi,`-`)}`,onClick:()=>b(e),onFocus:()=>m(e.value),onKeyDown:t=>C(t,e),ref:t=>{t?u.current.set(e.value,t):u.current.delete(e.value)},role:`option`,tabIndex:e.value===p?0:-1,type:`button`,children:[(0,B.jsx)(`span`,{children:e.label}),e.value===o?(0,B.jsx)(om,{"aria-hidden":!0,size:15}):null]})]},e.value)})}):null]})}function ib({agents:e,managerChannelBinding:t,managerChatOpen:n,managerRuntime:r,mobileNavigationOpen:i,onOpenGoalCapabilities:a,onOpenManagerChat:o,onRefresh:s,onOpenNavigation:c,onSelectGoalTab:l,onSelectAgent:u,onReturnManagerHome:d,refreshState:f,readOnlySourceLabel:p,selectedAgentId:m,selectedGoal:h,selectedGoalTab:g}){let{locale:_,t:v}=Ji(),y=h?nb(h.usage,{cost:v(`drawer.costShort`),duration:v(`drawer.durationShort`),period24h:v(`drawer.period24h`),period7d:v(`drawer.period7d`),tokens:v(`drawer.tokensShort`)}):null,b=t?t.executor_kind===`individual`?v(`header.managerExecutorKindIndividual`):t.executor_kind===`managed`?v(`header.managerExecutorKindManaged`):v(`header.managerExecutorKindRegistered`):null,x=t?.available===!1,S=t?.available===!1?t.unavailable_reason:null,C=S===`operator_credential_unconfigured`?`header.managerExecutionUnavailableCredential`:S===`dsh_runtime_unavailable`?`header.managerExecutionUnavailableRuntime`:S===`invalid_reasoning_effort`?`header.managerExecutionUnavailableEffort`:`header.managerExecutionUnavailable`,w=t&&t.executor_endpoint_source===`product_default`&&t.executor_endpoint_default_reason===`steward_channel_default`?`header.managerEndpointStewardDefault`:null,T=p?(0,B.jsxs)(`span`,{className:`personal-read-only-source`,title:v(`header.readOnlySourceDescription`,{source:p}),children:[(0,B.jsx)(ym,{size:15}),p,(0,B.jsx)(`small`,{children:v(`common.readOnly`)})]}):(0,B.jsx)(rb,{ariaLabel:v(`header.selectChatRuntime`),className:`personal-agent-select`,icon:(0,B.jsx)(rm,{size:16}),onChange:u,options:e.map(e=>({disabled:!e.available,label:`${e.label}${e.available?``:` · ${v(`header.agentUnavailable`)}`}`,value:e.agentId})),prefixLabel:v(`header.chatRuntime`),value:m});return(0,B.jsxs)(`header`,{className:`personal-channel-header`,"data-goal-selected":!!h,children:[(0,B.jsx)(`button`,{"aria-expanded":i??!1,"aria-label":v(`header.openGoalNavigation`),className:`personal-icon-button personal-mobile-menu`,onClick:c,type:`button`,children:(0,B.jsx)(Mm,{size:18})}),(0,B.jsxs)(`div`,{className:`personal-channel-title`,children:[(0,B.jsx)(`h1`,{children:h?.title??v(`header.manager`)}),!h&&r?(0,B.jsx)(`p`,{children:r.status===`ready`?v(`header.managerRuntime`,{profile:r.runtime_profile,sandbox:r.sandbox}):v(`header.managerRuntimeFallback`,{profile:r.runtime_profile,sandbox:r.sandbox})}):null,!h&&t?(0,B.jsxs)(`p`,{className:`personal-manager-execution`,children:[(0,B.jsxs)(`span`,{className:x?`personal-execution-chip is-unavailable`:`personal-execution-chip`,children:[(0,B.jsx)(`span`,{className:`personal-execution-chip-endpoint`,children:t.executor_endpoint}),b?(0,B.jsx)(`span`,{className:`personal-execution-chip-kind`,children:b}):null,(0,B.jsx)(`span`,{className:`personal-execution-chip-model`,children:t.model})]}),x?(0,B.jsx)(`span`,{className:`personal-execution-note`,children:v(C,{executor:t.executor_endpoint,credential:t.credential_env_var})}):null,w?(0,B.jsx)(`span`,{className:`personal-execution-rule-note`,children:v(w,{executor:t.executor_endpoint})}):null]}):null,h?(0,B.jsx)(`p`,{children:h.loadState?v(h.loadState===`error`?`startup.goalError`:`startup.goalLoading`):`${h.agentLaneCount&&h.agentLaneCount>1?v(`header.workAgentCount`,{count:h.agentLaneCount}):h.agentLabel??h.agentId} · ${h.loadState?v(h.loadState===`error`?`startup.goalError`:`startup.goalLoading`):Yi(h.state,_)}${y?` · ${y}`:``} · ${h.nextSentence}`}):null]}),h?(0,B.jsxs)(`div`,{className:`personal-goal-navigation`,children:[(0,B.jsxs)(`nav`,{"aria-label":v(`header.goalView`),className:`personal-goal-tabs`,children:[(0,B.jsx)(`button`,{"aria-current":g===`overview`?`page`:void 0,onClick:()=>l(`overview`),type:`button`,children:v(`header.overview`)}),(0,B.jsx)(`button`,{"aria-current":g===`tasks`?`page`:void 0,onClick:()=>l(`tasks`),type:`button`,children:v(`header.tasks`)}),(0,B.jsx)(`button`,{"aria-current":g===`chat`?`page`:void 0,onClick:()=>l(`chat`),type:`button`,children:v(`header.chat`)}),(0,B.jsx)(`button`,{"aria-current":g===`files`?`page`:void 0,onClick:()=>l(`files`),type:`button`,children:v(`header.files`)})]}),T]}):(0,B.jsxs)(`nav`,{"aria-label":v(`header.managerView`),className:`personal-goal-tabs`,children:[(0,B.jsx)(`button`,{"aria-current":n?void 0:`page`,onClick:d,type:`button`,children:v(`header.managerOverview`)}),(0,B.jsx)(`button`,{"aria-current":n?`page`:void 0,onClick:o,type:`button`,children:v(`header.chat`)})]}),(0,B.jsxs)(`div`,{className:`personal-channel-actions`,children:[h&&a?(0,B.jsx)(`button`,{"aria-label":v(`header.goalSettings`),title:v(`header.goalSettingsDescription`),className:`personal-icon-button personal-goal-settings-action`,onClick:a,type:`button`,children:(0,B.jsx)(Qm,{"aria-hidden":!0,size:17})}):null,h?null:T,(0,B.jsxs)(`span`,{className:`personal-live-indicator`,children:[(0,B.jsx)(`i`,{}),v(`header.live`)]}),s?(0,B.jsxs)(`span`,{className:`personal-refresh-control is-${f??`idle`}`,children:[f===`loading`?(0,B.jsx)(`small`,{children:v(`header.refreshing`)}):f===`done`?(0,B.jsx)(`small`,{children:v(`header.refreshDone`)}):f===`error`?(0,B.jsx)(`small`,{children:v(`header.refreshFailed`)}):null,(0,B.jsx)(`button`,{"aria-label":v(f===`loading`?`header.refreshing`:`header.refresh`),className:`personal-icon-button`,disabled:f===`loading`,onClick:s,type:`button`,children:(0,B.jsx)(Um,{className:f===`loading`?`is-spinning`:void 0,size:17})})]}):null]})]})}function ab({attention:e,onSelect:t}){let{t:n}=Ji(),r=Zi(e.updatedAt,n);return(0,B.jsxs)(`button`,{className:`personal-timeline-row personal-attention-row`,"data-testid":`personal-browse-row`,onClick:t,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-row-icon is-attention`,children:(0,B.jsx)(um,{size:18})}),(0,B.jsxs)(`span`,{className:`personal-row-copy`,children:[(0,B.jsxs)(`small`,{children:[e.goalTitle??e.goalId,` · `,n(`home.lane.needsYou`),r?` · ${n(`tasks.waitingAge`,{age:r})}`:``]}),(0,B.jsx)(`strong`,{children:e.text})]}),(0,B.jsx)(`span`,{className:`personal-priority-dot is-${e.priority??(e.blocking?`high`:`medium`)}`}),(0,B.jsx)(`span`,{className:`personal-row-status ${e.blocking?`is-blocking`:`is-pending`}`,children:e.blocking?n(`tasks.blocked`):n(`tasks.pending`)}),(0,B.jsx)(cm,{size:17})]})}var ob=/(`[^`\n]+`)|(\*\*[^*\n]+(\*[^*\n]*)?\*\*)|(\[[^\]\n]{1,120}\]\(https?:\/\/[^)\s]+\))/g;function sb(e,t){let n=[],r=0,i=0;for(let a of e.matchAll(ob)){let o=a.index??0;o>r&&n.push(e.slice(r,o));let s=a[0],c=`${t}-i${i++}`;if(s.startsWith("`"))n.push((0,B.jsx)(`code`,{className:`personal-md-code`,children:s.slice(1,-1)},c));else if(s.startsWith(`**`))n.push((0,B.jsx)(`strong`,{children:s.slice(2,-2)},c));else{let e=s.indexOf(`](`),t=s.slice(1,e),r=s.slice(e+2,-1);n.push((0,B.jsx)(`a`,{className:`personal-md-link`,href:r,rel:`noreferrer`,target:`_blank`,children:t},c))}r=o+s.length}return r{r.length>0&&(n.push({type:`paragraph`,lines:r}),r=[])},a=0;for(;a{let n=`b${t}`;if(e.type===`code`)return(0,B.jsx)(`pre`,{className:`personal-md-pre`,children:(0,B.jsx)(`code`,{children:e.text})},n);if(e.type===`heading`)return(0,B.jsx)(`p`,{className:`personal-md-heading is-h${e.level}`,children:sb(e.text,n)},n);if(e.type===`list`){let t=e.items.map((e,t)=>(0,B.jsx)(`li`,{children:sb(e,`${n}-${t}`)},`${n}-${t}`));return e.ordered?(0,B.jsx)(`ol`,{className:`personal-md-list`,children:t},n):(0,B.jsx)(`ul`,{className:`personal-md-list`,children:t},n)}return(0,B.jsx)(`p`,{children:e.lines.map((e,t)=>(0,B.jsxs)(z.Fragment,{children:[t>0?(0,B.jsx)(`br`,{}):null,sb(e,`${n}-${t}`)]},`${n}-${t}`))},n)})})}function fb({onSelect:e,output:t}){let{t:n}=Ji(),r=t.kind===`report`?Sm:xm;return(0,B.jsxs)(`button`,{className:`personal-timeline-row personal-output-row`,"data-output-kind":t.kind,"data-testid":`personal-browse-row`,onClick:e,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-row-icon is-output`,children:(0,B.jsx)(r,{size:18})}),(0,B.jsxs)(`span`,{className:`personal-row-copy`,children:[(0,B.jsxs)(`small`,{children:[t.goalTitle??t.goalId,` · `,t.agentLabel??`LoopX`]}),(0,B.jsx)(`strong`,{children:t.title}),t.summary?(0,B.jsx)(`span`,{children:t.summary}):null,t.report?(0,B.jsxs)(`small`,{children:[n(`files.reportDelta`,{added:t.report.addedCount,changed:t.report.changedCount}),` · `,n(`files.verifiedReport`)]}):null]}),t.createdAt?(0,B.jsx)(`time`,{children:t.createdAt}):null,(0,B.jsx)(cm,{size:17})]})}var pb={completed:`runs.completed`,failed:`runs.failed`,interrupted:`runs.interrupted`,queued:`runs.queued`,running:`runs.running`,waiting:`runs.waiting`};function mb({onSelect:e,run:t}){let{t:n}=Ji(),r=t.totalSteps>0?Math.min(100,t.completedSteps/t.totalSteps*100):0;return(0,B.jsxs)(`button`,{"aria-label":`${n(`tasks.viewExecution`)}:${t.title}`,className:`personal-timeline-row personal-run-row`,"data-testid":`personal-browse-row`,onClick:e,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-row-icon is-run`,children:(0,B.jsx)(rm,{size:18})}),(0,B.jsxs)(`span`,{className:`personal-run-identity`,children:[(0,B.jsx)(`small`,{children:t.goalTitle}),(0,B.jsx)(`strong`,{children:t.agentLabel})]}),(0,B.jsxs)(`span`,{className:`personal-row-copy`,children:[(0,B.jsx)(`strong`,{children:t.title}),(0,B.jsx)(`small`,{children:t.latestActivity})]}),(0,B.jsxs)(`span`,{className:`personal-run-progress`,"aria-label":`${t.completedSteps}/${t.totalSteps}`,children:[(0,B.jsxs)(`small`,{children:[t.completedSteps,`/`,t.totalSteps]}),(0,B.jsx)(`i`,{children:(0,B.jsx)(`b`,{style:{width:`${r}%`}})})]}),(0,B.jsxs)(`span`,{className:`personal-row-status is-${t.status}`,children:[t.status===`running`?(0,B.jsx)(Am,{className:`personal-spin`,size:14}):null,n(pb[t.status])]}),t.sessionId?(0,B.jsx)(`span`,{className:`personal-run-open-label`,children:n(`tasks.viewExecution`)}):null,(0,B.jsx)(cm,{size:17})]})}function hb({onSelect:e,schedule:t}){let{t:n}=Ji(),r=t.scheduleKind===`heartbeat`;return(0,B.jsxs)(`button`,{"aria-label":`${r?`Heartbeat`:n(`tasks.scheduled`)}:${t.label};${t.status??`active`}`,className:`personal-schedule-row`,onClick:e,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-schedule-icon`,children:r?(0,B.jsx)(Hm,{size:17}):(0,B.jsx)(am,{size:17})}),(0,B.jsxs)(`span`,{className:`personal-schedule-copy`,children:[(0,B.jsx)(`small`,{children:n(r?`schedule.heartbeat`:`schedule.monitor`)}),(0,B.jsx)(`strong`,{children:t.label}),(0,B.jsx)(`p`,{children:t.schedule??n(`schedule.summary`)})]}),(0,B.jsx)(`span`,{className:`personal-schedule-status is-${t.status??`active`}`,children:t.status===`paused`?n(`schedule.paused`):n(`schedule.active`)}),(0,B.jsx)(cm,{size:16})]})}function gb({delivery:e}){let{t}=Ji();if(!e)return null;let n=e.status===`delivered`?e.verification===`reconciled_after_restart`?t(`returnDelivery.reconciled`):t(`returnDelivery.delivered`):e.status===`verification_required`?t(`returnDelivery.verifying`):e.status===`explicit_unverified`?t(`returnDelivery.unverified`):t(`returnDelivery.queued`),r=e.status===`delivered`?`delivered`:e.status===`verification_required`?`verification_required`:e.status===`explicit_unverified`?`explicit_unverified`:`queued`;return(0,B.jsx)(`small`,{className:`personal-return-delivery is-${r}`,role:`status`,children:n})}function _b({items:e,onSelect:t,selectedGoal:n}){let{t:r}=Ji();if(e.length===0)return(0,B.jsxs)(`div`,{className:`personal-timeline-empty`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)($m,{size:20})}),(0,B.jsx)(`strong`,{children:r(n?`timeline.emptyGoal`:`timeline.emptyWorkspace`)}),(0,B.jsx)(`p`,{children:r(n?`timeline.emptyGoalDescription`:`timeline.emptyWorkspaceDescription`)})]});let i=[...e].reverse().find(e=>e.kind===`message`&&e.message.role!==`user`||e.kind===`proposal`&&[`applied`,`stale`,`error`,`gated`].includes(e.proposal.status)||e.kind===`run`&&e.run.status===`completed`),a=i?.kind===`message`?`${i.message.agentLabel??r(`header.manager`)}:${i.message.pending?r(`timeline.pending`):i.message.text}`:i?.kind===`proposal`?`${i.proposal.title}:${i.proposal.status}`:i?.kind===`run`?r(`timeline.runCompleted`,{run:i.run.title}):``,o=e.filter(e=>e.kind===`proposal`&&e.proposal.status===`gated`),s=e.filter(e=>e.kind!==`proposal`),c=e.filter(e=>e.kind===`proposal`&&e.proposal.status!==`gated`);function l(e){return e.kind===`attention`?(0,B.jsx)(ab,{attention:e.attention,onSelect:()=>t({item:e.attention,kind:`attention`})},e.id):e.kind===`run`?(0,B.jsx)(mb,{onSelect:()=>t({item:e.run,kind:`run`}),run:e.run},e.id):e.kind===`output`?(0,B.jsx)(fb,{onSelect:()=>t({item:e.output,kind:`output`}),output:e.output},e.id):e.kind===`schedule`?(0,B.jsx)(hb,{onSelect:()=>t({item:e.schedule,kind:`schedule`}),schedule:e.schedule},e.id):e.kind===`proposal`?(0,B.jsxs)(`button`,{className:`personal-proposal-row is-${e.proposal.status}`,onClick:()=>t({item:e.proposal,kind:`proposal`}),type:`button`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)($m,{size:17})}),(0,B.jsxs)(`span`,{children:[(0,B.jsxs)(`small`,{children:[e.proposal.actionKind,` · `,e.proposal.status]}),(0,B.jsx)(`strong`,{children:e.proposal.title}),(0,B.jsx)(`p`,{children:e.proposal.impact})]}),(0,B.jsx)(`b`,{children:e.proposal.status===`gated`&&e.proposal.actionKind!==`operation.execute`?r(`timeline.review`):e.proposal.primaryLabel??r(`timeline.reviewAndConfirm`)})]},e.id):(0,B.jsxs)(`article`,{className:`personal-message is-${e.message.role}`,children:[e.message.role===`user`?null:(0,B.jsx)(`span`,{className:`personal-message-avatar`,children:(0,B.jsx)(rm,{size:17})}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:e.message.role===`user`?r(`common.you`):e.message.agentLabel??r(`header.manager`)}),e.message.time?(0,B.jsx)(`time`,{children:e.message.time}):null]}),e.message.attachments?.length?(0,B.jsx)(`div`,{className:`personal-message-images`,children:e.message.attachments.map(e=>(0,B.jsx)(`img`,{alt:e.name,src:e.dataUrl},e.id))}):null,e.message.role===`user`?(0,B.jsx)(`p`,{children:e.message.text}):(0,B.jsx)(db,{text:e.message.text}),e.message.pending?(0,B.jsx)(`span`,{className:`personal-message-pending`,children:r(`timeline.pending`)}):null,(0,B.jsx)(Ey,{request:e.message.collaboration}),(0,B.jsx)(gb,{delivery:e.message.returnDelivery})]})]},e.id)}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{"aria-atomic":`true`,"aria-live":`polite`,className:`personal-live-region`,role:`status`,children:a}),(0,B.jsxs)(`div`,{className:`personal-channel-timeline`,children:[s.map(l),o.length?(0,B.jsxs)(`details`,{className:`personal-gated-summary`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{children:(0,B.jsx)($m,{size:16})}),(0,B.jsx)(`strong`,{children:r(`timeline.waitingConfirmation`)}),(0,B.jsx)(`small`,{children:r(`timeline.gateHistory`,{count:o.length})})]}),(0,B.jsx)(`div`,{children:o.map(l)})]}):null,c.map(l)]})]})}function vb({goal:e}){let{t,locale:n}=Ji(),r=n===`zh-CN`?{checkpoint_satisfied:`检查点满足`,checkpoint_fresh:`检查点有效`,path_outcome_valid:`路径决策有效`,evidence_refs_present:`证据引用齐全`,final_outcome_claim_present:`最终成果声明齐全`,no_reported_outcome_gap:`无已报告成果缺口`}:{checkpoint_satisfied:`Checkpoint satisfied`,checkpoint_fresh:`Checkpoint current`,path_outcome_valid:`Valid path decision`,evidence_refs_present:`Evidence refs present`,final_outcome_claim_present:`Final outcome claim present`,no_reported_outcome_gap:`No reported outcome gap`},i={connected:t(`acceptance.connected`),mapped:t(`acceptance.mapped`),refreshed:t(`acceptance.refreshed`),adapter_inspected:t(`acceptance.inspected`),run_recorded:t(`acceptance.recorded`),reward_judged:t(`acceptance.judged`),operator_approved:t(`acceptance.approved`),controller_ready:t(`acceptance.ready`),attention_queue:t(`acceptance.attentionSource`),agent_vision:t(`acceptance.visionSource`),todo_projection:t(`acceptance.todoSource`),current_run:t(`acceptance.runSource`)},a=e=>i[e]??t(`acceptance.unknown`),o=e.acceptanceObservation,s=e.loadState||!o||o.goal_id!==e.goalId||o.coverage===`unavailable`;return(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-acceptance`,"aria-label":t(`acceptance.title`),children:[(0,B.jsxs)(`div`,{className:`personal-detail-card-title`,children:[(0,B.jsx)(`h3`,{children:t(`acceptance.title`)}),(0,B.jsx)(`em`,{children:t(`common.readOnly`)})]}),(0,B.jsx)(`p`,{role:`status`,children:t(s?`acceptance.unavailable`:`acceptance.partial`)}),!s&&o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:t(`acceptance.gaps`)}),o.acceptance_gaps.length?o.acceptance_gaps.map((e,i)=>(0,B.jsxs)(`div`,{className:`personal-acceptance-observation`,children:[(0,B.jsx)(`p`,{children:e.reason??t(`acceptance.reasonUnknown`)}),e.resolution_hint?(0,B.jsx)(`p`,{children:e.resolution_hint}):null,e.component_checks?(0,B.jsx)(`div`,{children:Object.entries(e.component_checks).map(([e,t])=>(0,B.jsxs)(`p`,{children:[r[e],`: `,n===`zh-CN`?t?`通过`:`未通过`:t?`Passed`:`Failed`]},e))}):null,(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`common.owner`)}),(0,B.jsx)(`dd`,{children:e.owner??t(`acceptance.unknown`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`acceptance.required`)}),(0,B.jsx)(`dd`,{children:e.evidence_required??t(`acceptance.unknown`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`acceptance.observed`)}),(0,B.jsx)(`dd`,{children:e.observed_at??t(`acceptance.unknown`)})]})]})]},`${e.kind}:${e.owner}:${i}`)):(0,B.jsx)(`p`,{children:t(`acceptance.noGaps`)}),(0,B.jsx)(`h4`,{children:t(`acceptance.guards`)}),o.guards.length?o.guards.map((e,n)=>(0,B.jsxs)(`div`,{className:`personal-acceptance-observation`,children:[(0,B.jsx)(`p`,{children:e.reason??t(`acceptance.reasonUnknown`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`common.owner`)}),(0,B.jsx)(`dd`,{children:e.owner??t(`acceptance.unknown`)})]}),e.blocks_agent?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`common.agent`)}),(0,B.jsx)(`dd`,{children:e.blocks_agent})]}):null,e.todo_id?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`common.task`)}),(0,B.jsx)(`dd`,{children:e.todo_id})]}):null,(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`acceptance.required`)}),(0,B.jsx)(`dd`,{children:e.evidence_required??t(`acceptance.unknown`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`acceptance.scope`)}),(0,B.jsx)(`dd`,{children:e.decision_scope??t(`acceptance.unknown`)})]})]})]},`${e.todo_id}:${n}`)):(0,B.jsx)(`p`,{children:t(`acceptance.noGuards`)}),(0,B.jsx)(`h4`,{children:t(`acceptance.next`)}),(0,B.jsx)(`p`,{children:o.next_action??t(`acceptance.unknown`)}),(0,B.jsxs)(`details`,{children:[(0,B.jsxs)(`summary`,{children:[t(`acceptance.historical_progress`),` · `,o.historical_progress.length]}),(0,B.jsx)(`p`,{children:t(`acceptance.historical`)}),o.historical_progress.map(e=>(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`strong`,{children:a(e.kind)}),` · `,e.observed_at??t(`acceptance.unknown`),` `,e.evidence_refs.join(`, `)]},e.kind))]}),o.missing_sources.length?(0,B.jsxs)(`p`,{children:[t(`acceptance.missing`),` `,o.missing_sources.map(a).join(`, `)]}):null,o.truncated?(0,B.jsx)(`p`,{children:t(`acceptance.truncated`)}):null]}):null]})}function yb({item:e,successor:t,onSelect:n}){let{t:r}=Ji(),i=e.details;return(0,B.jsxs)(`section`,{className:`personal-detail-card`,"aria-label":r(`attentionDetail.title`),children:[(0,B.jsx)(`h3`,{children:r(`attentionDetail.title`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`attentionDetail.request`)}),(0,B.jsx)(`dd`,{children:r(i?.interaction===`decision`?`attentionDetail.decision`:`attentionDetail.unknownRequest`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`common.status`)}),(0,B.jsx)(`dd`,{children:r(`attentionDetail.${i?.lifecycle??`unknown`}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`drawer.reason`)}),(0,B.jsx)(`dd`,{children:i?.reason??e.explanation??r(`attentionDetail.unknownReason`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Todo`}),(0,B.jsx)(`dd`,{children:e.todoId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`attentionDetail.targetTodo`)}),(0,B.jsx)(`dd`,{children:i?.unblocksTodoId??r(`attentionDetail.notProvided`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`attentionDetail.targetAgent`)}),(0,B.jsx)(`dd`,{children:i?.blocksAgent??r(`attentionDetail.notProvided`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`attentionDetail.scope`)}),(0,B.jsx)(`dd`,{children:i?.decisionScope?`${i.decisionScope.kind} · ${i.decisionScope.granularity} · ${i.decisionScope.scopeKey}`:r(`attentionDetail.notProvided`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`drawer.evidence`)}),(0,B.jsx)(`dd`,{children:i?.evidence??e.evidence??r(`drawer.decisionDefaultEvidence`)})]})]}),i?.supersededBy?(0,B.jsxs)(`p`,{children:[r(`attentionDetail.replacement`),`: `,i.supersededBy]}):null,t&&n?(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>n(t),type:`button`,children:r(`attentionDetail.openReplacement`)}):null,(0,B.jsx)(`p`,{children:r(`attentionDetail.boundary`)})]})}function bb({proposal:e,t}){let n=e.teamPlanOutcome?.kind===`already_present`;return(0,B.jsxs)(`section`,{className:`personal-proposal-card personal-team-plan-result`,children:[(0,B.jsx)(`h3`,{children:qy(e.teamPlanOutcome??null,t)}),(0,B.jsxs)(`dl`,{className:`personal-team-plan-assignments`,children:[e.teamPlanAssignments?.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.agentId||e.laneId}),(0,B.jsx)(`dd`,{children:e.task})]},e.laneId)),e.teamPlanGapLanes?.map(e=>(0,B.jsxs)(`div`,{className:`is-pending`,children:[(0,B.jsx)(`dt`,{children:e.agentId||e.laneId}),(0,B.jsxs)(`dd`,{children:[e.task||e.laneId,(0,B.jsx)(`br`,{}),(0,B.jsxs)(`small`,{children:[t(`proposal.teamPlan.pending`),` · `,Gy(e.reasonCode,t)]})]})]},e.laneId))]}),(0,B.jsx)(`p`,{children:t(n?`proposal.teamPlan.recoveredHint`:`proposal.teamPlan.assignedHint`)}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:t(`proposal.teamPlan.originalPlan`)}),(0,B.jsx)(`dl`,{children:e.fields.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.label}),(0,B.jsx)(`dd`,{children:e.value})]},e.key))})]})]})}function xb(e){return e.replace(/\s+/gu,` `).trim()}function Sb(e,t){let n=RegExp(`(?:不要|不需要|无需|禁止|别|暂不|do not\\b|don't\\b|without\\b).{0,10}(?:${t.source})`,`iu`),r=RegExp(`(?:${t.source}).{0,10}(?:不要|不需要|无需|禁止|关闭)`,`iu`),i=RegExp(`disable\\b.{0,10}(?:${t.source})|(?:turn|switch|set)\\b.{0,10}(?:${t.source}).{0,10}\\boff\\b|(?:${t.source})\\s+(?:is\\s+)?disabled\\b`,`iu`);return n.test(e)||r.test(e)||i.test(e)}function Cb(e){return/(我现在该做什么|下一步|哪些\s*Goal\s*在等我|需要我|谁在等我|Agent\s*在做什么|当前进度|总结(?:今天)?进展)/iu.test(e)}function wb(e){let t=/(怎么|如何|为什么|给.*建议|分析一下|解释|只读)/u.test(e),n=/(解决一下|修复一下|处理一下|执行一下|改一下|跑(?:一下)?测试|rebase|push|提交|推送)/iu.test(e);return!t&&n&&/(帮我|请|给我|直接|现在|开始|bytedcli|codebase|git|rebase|push|提交|推送)/iu.test(e)}function Tb(e){return xb(e).toLowerCase().match(/(?:^|[\s,,;;:((:]|到|至)(?todo_done:todo_[a-z0-9_-]{3,64}|pr_merged:(?:(?:[a-z0-9_.-]{1,80})\/(?:[a-z0-9_.-]{1,100}))?#[1-9][0-9]{0,8}|capacity_available:[a-z][a-z0-9_:-]{0,63}|resume_at:[1-9][0-9]{3}-[0-9]{2}-[0-9]{2}t[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,3})?(?:z|[+-][0-9]{2}:[0-9]{2}))(?=$|[\s,,。;;))])/iu)?.groups?.condition??null}function Eb(e,t){let n=xb(e),r=[],i=t.agents.find(e=>{let t=n.toLowerCase();return t.includes(e.agentId.toLowerCase())||t.includes(e.label.toLowerCase())}),a=t.todos.find(e=>n.includes(e.todoId)||n.includes(e.text)),o=/(刚刚|已经|已)(?:经)?\s*(新增|创建|添加)(?:的)?\s*(todo|待办|任务)/iu.test(n),s=!!t.goalId&&!Sb(n,/heartbeat|心跳/iu)&&/(heartbeat|心跳|每天推进|持续推进|daily progress)/iu.test(n);if(!t.goalId&&!Sb(n,/goal|目标/iu)&&/(创建|新建|设置|create|start|set up).{0,24}(goal|目标)/iu.test(n)&&r.push({actionKind:`goal.create`,confidence:.97,normalizedParameters:{heartbeat_enabled:!Sb(n,/heartbeat|心跳/iu)&&/(heartbeat|心跳|每天推进|持续推进|daily progress)/iu.test(n)}}),t.goalId&&s&&r.push({actionKind:`heartbeat.bind`,confidence:.96,normalizedParameters:{goal_id:t.goalId}}),t.goalId&&!s&&!Sb(n,/定时|监控|监测|持续观察|scheduled check|monitor/iu)&&/(定时|监控|监测|每.{0,8}(分钟|小时|天)|持续观察|scheduled check|monitor|every.{0,12}(minute|hour|day)|daily)/iu.test(n)&&r.push({actionKind:`monitor.create`,confidence:.94,normalizedParameters:{goal_id:t.goalId}}),t.goalId&&i&&!Sb(n,/绑定|负责|接管|管理/iu)&&/((让|交给).{0,20}(管理|负责|接管).{0,8}(goal|目标)|(绑定).{0,12}(goal|目标)|(goal|目标).{0,12}(交给|绑定|负责|接管))/iu.test(n)&&r.push({actionKind:`agent.bind`,confidence:.96,normalizedParameters:{agent_id:i.agentId,goal_id:t.goalId}}),t.goalId&&!o&&!Sb(n,RegExp(`todo|待办|任务`,`iu`))&&/(创建|新建|新增|添加|加一个|记一个).{0,16}(todo|待办|任务)|(todo|待办|任务).{0,12}(创建|新建|新增|添加)|(?:create|add)(?:\s+(?:a|an|new))?\s+(?:todo|task)|(?:todo|task).{0,12}(?:create|add)/iu.test(n)&&r.push({actionKind:`todo.create`,confidence:.94,normalizedParameters:{goal_id:t.goalId}}),t.goalId&&wb(n)&&r.push({actionKind:`todo.create`,confidence:.9,normalizedParameters:{goal_id:t.goalId,start_execution:!0}}),t.goalId&&a){let e=!Sb(n,/完成|做完|关闭/u)&&/完成|做完|关闭/u.test(n)?`complete`:!Sb(n,/阻塞|卡住/u)&&/阻塞|卡住/u.test(n)?`block`:!Sb(n,/暂缓|稍后|推迟/u)&&/暂缓|稍后|推迟/u.test(n)?`defer`:i&&!Sb(n,/交给|分配给|改派/u)&&/交给|分配给|改派/u.test(n)?`reassign`:null;if(e){let i=e===`defer`?Tb(n):null;if(e===`defer`&&!i)return{actionKind:`todo.update`,confidence:.97,missingFields:[`resume_when`],normalizedParameters:{goal_id:t.goalId,operation:e,todo_id:a.todoId},route:`clarify`};r.push({actionKind:`todo.update`,confidence:.97,normalizedParameters:{goal_id:t.goalId,operation:e,...i?{resume_when:i}:{},todo_id:a.todoId}})}}let c=[...new Map(r.map(e=>[e.actionKind,e])).values()];return c.length>1?{actionKind:null,confidence:.4,missingFields:[`single_intent`],normalizedParameters:{},route:`clarify`}:c.length===1?{...c[0],missingFields:[],route:`typed_action`}:!t.goalId&&Cb(n)?{actionKind:null,confidence:.98,missingFields:[],normalizedParameters:{},route:`projection`}:{actionKind:null,confidence:.75,missingFields:[],normalizedParameters:{},route:`agent_chat`}}function Db(e,t,n){if(!e)return{};if(!t.trim())return{modelConfig:null};let r={model:t.trim()};return n&&(r.reasoning_effort=n),{modelConfig:r}}var Ob=[`a[href]`,`button:not([disabled])`,`textarea:not([disabled])`,`select:not([disabled])`,`input:not([disabled])`,`[tabindex]:not([tabindex='-1'])`].join(`,`),kb=[{key:`drawer.taskBlock`,operation:`block`},{key:`drawer.taskSuccessor`,operation:`successor_create`}],Ab=[{key:`drawer.decisionReject`,resolution:`reject`},{key:`drawer.decisionDefer`,resolution:`defer`}],jb=Array.from({length:32},(e,t)=>t+1),Mb=/^[a-z][a-z0-9_.-]{0,63}$/u;function Nb(e){let t=String(e??``).trim().toLowerCase();return Mb.test(t)?t:null}function Pb(e,t){return e.enabled===t.enabled&&e.maxChildren===t.maxChildren&&JSON.stringify(e.modelConfig??null)===JSON.stringify(t.modelConfig??null)&&[...e.allowedDomains].sort((e,t)=>e.localeCompare(t)).join(`\0`)===[...t.allowedDomains].sort((e,t)=>e.localeCompare(t)).join(`\0`)}function Fb({agents:e,attentionHistory:t=[],onSelectAttention:n,callbacks:r,goalNotifications:i=[],goals:a=[],inspectorExpanded:o=!1,larkConnections:s=[],onClose:c,onToggleInspectorSize:l,readOnly:u=!1,runs:d=[],selection:f}){let{locale:p,t:m}=Ji(),[h,g]=(0,z.useState)(``),[_,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)(`idle`),[x,S]=(0,z.useState)(`record`),[C,w]=(0,z.useState)([]),[T,E]=(0,z.useState)(null),[D,O]=(0,z.useState)(2),[k,ee]=(0,z.useState)(``),[te,A]=(0,z.useState)(``),[j,M]=(0,z.useState)(`idle`),[ne,N]=(0,z.useState)(null),[P,re]=(0,z.useState)(null),ie=(0,z.useRef)(null),ae=(0,z.useRef)(null),[F,oe]=(0,z.useState)(e.find(e=>e.available)?.agentId??`codex`),[I,se]=(0,z.useState)(``),L=(0,z.useRef)(null),ce=(0,z.useRef)(null),le=(0,z.useRef)(null),ue=(0,z.useRef)(null),de=f.kind===`run`?`run:${f.item.runId}`:f.kind===`proposal`?`proposal:${f.item.previewId}`:f.kind===`todo`?`todo:${f.item.todoId}`:f.kind===`attention`?`attention:${f.item.todoId}`:f.kind===`output`?`output:${f.item.outputId}`:f.kind===`schedule`?`schedule:${f.item.scheduleId}`:`goal:${f.item.goalId}`;(0,z.useEffect)(()=>{b(`idle`),v(!1),S(`record`),se(``);let e=f.kind===`goal`?f.item.subagentExecution:void 0;w(e?.allowedDomains??[]),ee(e?.modelConfig?.model??``),A(e?.modelConfig?.reasoning_effort??``),O(e?.maxChildren?Math.min(e.maxChildren,32):2),E(null),M(`idle`),N(null),re(null),ie.current=e??null,ae.current=null},[de]);let fe=f.kind===`goal`?f.item.subagentExecution:void 0;(0,z.useEffect)(()=>{let e=ie.current,t=fe?!e||!Pb(e,fe):e!==null;if(ie.current=fe??null,!P){t&&fe&&(w(fe.allowedDomains),ee(fe.modelConfig?.model??``),A(fe.modelConfig?.reasoning_effort??``),O(fe.maxChildren||2),E(null),M(`idle`),N(null));return}let n=ae.current;(!fe||Pb(P,fe)||n&&!Pb(n,fe))&&(fe&&(w(fe.allowedDomains),ee(fe.modelConfig?.model??``),A(fe.modelConfig?.reasoning_effort??``),O(fe.maxChildren||2)),ae.current=null,re(null))},[fe,P]),(0,z.useEffect)(()=>{let e=document.activeElement;e instanceof HTMLElement&&!ce.current?.contains(e)&&(le.current=e);let t=window.requestAnimationFrame(()=>ue.current?.focus());return()=>window.cancelAnimationFrame(t)},[de]);let pe=(0,z.useCallback)(()=>{let e=le.current;c(),window.requestAnimationFrame(()=>e?.focus())},[c]);(0,z.useEffect)(()=>{function e(e){if(e.key===`Escape`){e.preventDefault(),pe();return}if(e.key===`Tab`&&f.kind!==`todo`){let t=Array.from(ce.current?.querySelectorAll(Ob)??[]).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`);if(t.length===0)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())}}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[pe,f.kind]);let me=f.kind===`attention`?m(`drawer.titleAttention`):f.kind===`todo`?m(`drawer.taskDetails`):f.kind===`run`?m(`drawer.runDetails`):f.kind===`output`?m(`drawer.titleOutput`):f.kind===`proposal`&&f.item.actionKind===`team.plan`&&f.item.status===`applied`?m(`proposal.teamPlan.resultTitle`):f.kind===`proposal`?m(f.item.reviewPlan?.retryOriginal?`drawer.recoverEditResult`:f.item.status===`applied`?`drawer.titleProposalApplied`:`drawer.titleProposalConfirm`):f.kind===`schedule`?f.item.scheduleKind===`heartbeat`?`Heartbeat`:m(`drawer.titleSchedule`):m(`drawer.goalDetails`),he=f.kind===`proposal`?f.item.goalId??`manager`:f.item.goalId,ge=f.kind===`attention`?f.item.goalTitle??m(`drawer.currentGoal`):f.kind===`todo`||f.kind===`run`?f.item.goalTitle:f.kind===`output`?f.item.goalTitle??m(`drawer.currentGoal`):f.kind===`goal`?f.item.title:f.kind===`schedule`?m(`drawer.goalAutoRun`):f.kind===`proposal`&&f.item.status===`applied`&&f.item.actionKind===`team.plan`?f.item.goalId??m(`drawer.currentGoal`):f.item.goalId?m(`drawer.goalChanges`):m(`drawer.managerChanges`),_e=f.kind===`goal`?d.find(e=>e.goalId===f.item.goalId&&!!e.sessionId)??d.find(e=>e.goalId===f.item.goalId):null,ve=f.kind===`run`&&(f.item.completedSteps>0||!!f.item.latestActivity||!!f.item.outputs?.length),ye=f.kind===`attention`?Zi(f.item.updatedAt,m):null,be=Tb(I);async function xe(){f.kind!==`run`||!h.trim()||(await r.onCorrectRun?.(f.item,h.trim()),g(``))}async function Se(e,t,n,i){if(t===`successor_create`){await r.onPreviewAction?.({actionKind:`todo.create`,context:{goal_id:e.goalId,kind:`todo`,todo_id:e.todoId},idempotencyKey:`workspace-todo-successor-${e.todoId}-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e.goalId,text:m(`drawer.taskSuccessorText`,{task:e.text})},summary:m(`drawer.taskSuccessorSummary`,{task:e.text})});return}await r.onPreviewAction?.({actionKind:`todo.update`,context:{goal_id:e.goalId,kind:`todo`,todo_id:e.todoId},idempotencyKey:`workspace-todo-${e.todoId}-${t}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:e.claimedBy??F,goal_id:e.goalId,operation:t,...t===`block`?{note:m(`drawer.taskSuccessorNote`)}:{},...t===`defer`&&i?{resume_when:i}:{},todo_id:e.todoId},summary:`${n}:${e.text}`})}async function Ce(e,t,n){u||!Xd(e)||await r.onPreviewAction?.({actionKind:`gate.resolve`,context:{goal_id:e.goalId,kind:`todo`,todo_id:e.todoId},idempotencyKey:`workspace-decision-${e.todoId}-${t}-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e.goalId,decision:t,todo_id:e.todoId},summary:`${n}:${e.text}`})}let we=f.kind===`goal`?P??f.item.subagentExecution??{allowedDomains:[],domainCandidates:[],enabled:!1,maxChildren:0}:{allowedDomains:[],domainCandidates:[],enabled:!1,maxChildren:0},Te=j===`previewing`||j===`applying`,Ee=(()=>{if(f.kind!==`goal`)return[];let e=new Map;for(let t of we.allowedDomains){let n=Nb(t);n&&e.set(n,{matchingTodoCount:0,value:n})}if(we.domainCandidates)for(let t of we.domainCandidates){let n=Nb(t.domain);if(!n)continue;let r=e.get(n);e.set(n,{matchingTodoCount:(r?.matchingTodoCount??0)+t.matchingTodoCount,value:n})}else for(let t of f.item.agentTodos){if(t.done||t.taskClass!==`advancement_task`)continue;let n=Nb(t.taskDomain);if(!n)continue;let r=e.get(n);e.set(n,{matchingTodoCount:(r?.matchingTodoCount??0)+1,value:n})}return[...e.values()]})();function De(){w(we.allowedDomains),ee(we.modelConfig?.model??``),A(we.modelConfig?.reasoning_effort??``),O(we.maxChildren||2),E(null),M(`idle`),N(null)}function Oe(){let e=[...new Set(C.map(e=>Nb(e)))];return e.every(e=>!!e)?e:null}function ke(e,t){w(n=>t?[...n,e].filter((e,t,n)=>n.indexOf(e)===t):n.filter(t=>t!==e)),N(null),M(`idle`),E(null)}async function Ae(e,t=e){if(f.kind!==`goal`||!r.onPreviewGoalSubagentConfiguration)return;let n=e?Oe():[];if(t&&!k.trim()&&te){M(`error`),E(m(`drawer.subagentModelRequired`));return}if(e&&!n){M(`error`),E(m(`drawer.subagentDomainInvalid`)),N(null);return}let i={allowedDomains:n??[],enabled:e,goalId:f.item.goalId,maxChildren:e?D:0,...Db(t,k,te)};M(`previewing`),E(m(`drawer.subagentPreviewing`)),N(null);try{let e=await r.onPreviewGoalSubagentConfiguration(i);if(!e.changed){ae.current=fe??null,re({...e.configuration,domainCandidates:we.domainCandidates}),w(e.configuration.allowedDomains),ee(e.configuration.modelConfig?.model??``),A(e.configuration.modelConfig?.reasoning_effort??``),O(e.configuration.maxChildren||2),M(`success`),E(m(`drawer.subagentNoChange`));return}N({...i,changed:e.changed,previewId:e.previewId}),M(`ready`),E(m(`drawer.subagentPreviewReady`))}catch(e){M(`error`),E(e instanceof Error?e.message:m(`drawer.subagentPreviewFailed`))}}async function je(){if(!(!ne||!r.onApplyGoalSubagentConfiguration)){M(`applying`),E(m(`drawer.subagentApplying`));try{let e=await r.onApplyGoalSubagentConfiguration({allowedDomains:ne.allowedDomains,enabled:ne.enabled,goalId:ne.goalId,maxChildren:ne.maxChildren,modelConfig:ne.modelConfig,previewId:ne.previewId});ae.current=fe??null,re({...e,domainCandidates:we.domainCandidates}),w(e.allowedDomains),ee(e.modelConfig?.model??``),A(e.modelConfig?.reasoning_effort??``),O(e.maxChildren||2),M(`success`),E(m(`drawer.subagentApplied`)),N(null);try{await r.onRefresh?.()}catch{M(`warning`),E(m(`drawer.subagentAppliedRefreshFailed`))}}catch(e){M(`error`),E(e instanceof Error?e.message:m(`drawer.subagentApplyFailed`))}}}return(0,B.jsxs)(`div`,{"aria-labelledby":`personal-drawer-title`,"aria-modal":f.kind===`todo`?void 0:`true`,className:`personal-context-drawer`,"data-context-kind":f.kind,ref:ce,role:`dialog`,children:[(0,B.jsxs)(`header`,{className:`personal-drawer-header${f.kind===`todo`?` is-task-inspector`:``}`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{id:`personal-drawer-title`,ref:ue,tabIndex:-1,children:me}),(0,B.jsx)(`p`,{children:ge})]}),(0,B.jsxs)(`div`,{className:`personal-drawer-header-actions`,children:[f.kind===`todo`&&l?(0,B.jsx)(`button`,{"aria-label":m(o?`drawer.inspectorHalf`:`drawer.inspectorFull`),className:`personal-icon-button personal-inspector-size`,onClick:l,title:m(o?`drawer.inspectorHalfView`:`drawer.inspectorFullView`),type:`button`,children:o?(0,B.jsx)(Fm,{size:17}):(0,B.jsx)(jm,{size:17})}):null,(0,B.jsxs)(`button`,{"aria-label":m(`drawer.closeDetail`,{context:ge}),className:`personal-icon-button personal-drawer-close`,onClick:pe,ref:L,type:`button`,children:[(0,B.jsx)(Zp,{className:`personal-mobile-back`,size:18}),(0,B.jsx)(oh,{className:`personal-desktop-close`,size:18})]})]})]}),(0,B.jsxs)(`div`,{className:`personal-drawer-body`,children:[f.kind===`attention`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card is-attention`,children:[(0,B.jsx)(`small`,{children:f.item.blocking?m(`drawer.attentionBlocking`):m(`drawer.attentionWaiting`)}),(0,B.jsx)(`h3`,{children:f.item.text}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle??f.item.goalId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.priority`)}),(0,B.jsx)(`dd`,{children:f.item.priority??`medium`})]}),ye?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`common.waiting`)}),(0,B.jsx)(`dd`,{children:m(`tasks.waitingAge`,{age:ye})})]}):null]})]}),(0,B.jsx)(yb,{item:f.item,onSelect:n,successor:Yd(f.item,t)}),!u&&Xd(f.item)?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void Ce(f.item,`approve`,m(`common.confirm`)),type:`button`,children:[(0,B.jsx)(om,{size:17}),m(`drawer.decisionReview`)]}),(0,B.jsxs)(`details`,{className:`personal-compact-menu`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(_m,{size:17}),m(`drawer.decisionMore`)]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{onClick:()=>void r.onExplainDecision?.(f.item),type:`button`,children:[(0,B.jsx)(Nm,{size:16}),m(`drawer.explainDecision`)]}),Ab.map(e=>(0,B.jsx)(`button`,{onClick:()=>void Ce(f.item,e.resolution,m(e.key)),type:`button`,children:m(e.key)},e.resolution))]})]})]}):null]}):null,f.kind===`todo`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-task-inspector-summary`,children:[(0,B.jsxs)(`div`,{className:`personal-task-inspector-status`,children:[(0,B.jsxs)(`span`,{className:f.item.done?`is-done`:f.item.status===`blocked`?`is-blocked`:`is-open`,children:[(0,B.jsx)(`i`,{}),f.item.done?m(`drawer.taskStatusCompleted`):f.item.status===`deferred`?m(`drawer.taskStatusDeferred`):f.item.status===`blocked`?m(`drawer.taskStatusBlocked`):m(`drawer.taskStatusOpen`)]}),f.item.priority?(0,B.jsx)(`span`,{children:f.item.priority}):null,(0,B.jsx)(`span`,{children:f.item.taskClass===`advancement_task`?m(`drawer.taskAdvancement`):f.item.taskClass??m(`drawer.taskOrdinary`)})]}),(0,B.jsx)(`h3`,{children:f.item.text})]}),(0,B.jsxs)(`section`,{"aria-label":m(`drawer.taskInfo`),className:`personal-task-inspector-fields`,children:[(0,B.jsx)(`h4`,{children:m(`drawer.taskInfo`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`common.owner`)}),(0,B.jsx)(`dd`,{children:f.item.ownerLabel??f.item.claimedBy??m(`drawer.notAssigned`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`common.status`)}),(0,B.jsx)(`dd`,{children:f.item.done?m(`drawer.taskStatusCompleted`):f.item.status===`deferred`?m(`drawer.taskStatusDeferred`):f.item.status===`blocked`?m(`drawer.taskStatusBlocked`):m(`drawer.taskStatusOpen`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.priority`)}),(0,B.jsx)(`dd`,{children:f.item.priority??m(`drawer.notSet`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.dependencies`)}),(0,B.jsx)(`dd`,{children:f.item.dependencies?.join(` · `)||m(`common.none`)})]}),f.item.status===`deferred`||f.item.resumeWhen?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.resumeWhen`)}),(0,B.jsx)(`dd`,{children:f.item.resumeWhen||m(`drawer.notSet`)})]}):null,f.item.resumeWhen?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.resumeState`)}),(0,B.jsx)(`dd`,{children:f.item.resumeReady?m(`drawer.resumeReady`):m(`drawer.resumePending`)})]}):null,f.item.resumeReceiptId?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.resumeReceipt`)}),(0,B.jsx)(`dd`,{children:f.item.resumeReceiptId})]}):null,(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.nextTransition`)}),(0,B.jsx)(`dd`,{children:f.item.nextTransition??(f.item.done?m(`drawer.taskNextCompleted`):f.item.resumeReady?m(`drawer.taskNextResumeReady`):f.item.status===`deferred`?m(`drawer.taskNextDeferred`):m(`drawer.taskNextOpen`))})]})]})]}),!u&&!f.item.done?(0,B.jsxs)(`div`,{className:`personal-task-inspector-actions`,"aria-label":m(`drawer.taskActions`),children:[(0,B.jsxs)(`details`,{className:`personal-task-management`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(_m,{size:16}),m(`drawer.taskManage`)]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:m(`drawer.reassign`)}),(0,B.jsxs)(`label`,{className:`personal-inline-agent-select`,children:[m(`drawer.reassign`),(0,B.jsx)(`select`,{"aria-label":m(`drawer.reassign`),onChange:e=>oe(e.target.value),value:F,children:e.filter(e=>e.available).map(e=>(0,B.jsx)(`option`,{value:e.agentId,children:e.label},e.agentId))}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onPreviewAction?.({actionKind:`todo.update`,context:{goal_id:f.item.goalId,kind:`todo`,todo_id:f.item.todoId},idempotencyKey:`workspace-todo-${f.item.todoId}-reassign-${F}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:F,goal_id:f.item.goalId,operation:`reassign`,todo_id:f.item.todoId},summary:m(`drawer.reassignSummary`,{task:f.item.text})}),type:`button`,children:m(`timeline.review`)})]}),(0,B.jsx)(`strong`,{children:m(`drawer.taskDeferUntil`)}),(0,B.jsxs)(`label`,{className:`personal-inline-agent-select personal-inline-resume-when`,children:[m(`drawer.taskDeferUntil`),(0,B.jsx)(`input`,{"aria-label":m(`drawer.taskDeferCondition`),"aria-invalid":!!I.trim()&&!be,onChange:e=>se(e.target.value),placeholder:m(`drawer.taskDeferPlaceholder`),value:I}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,disabled:!be,onClick:()=>void Se(f.item,`defer`,m(`drawer.taskDefer`),be??void 0),type:`button`,children:m(`drawer.taskDeferReview`)}),(0,B.jsx)(`small`,{children:I.trim()&&!be?m(`drawer.taskDeferInvalid`):m(`drawer.taskDeferSupported`)})]}),(0,B.jsx)(`div`,{className:`personal-task-management-secondary`,children:kb.map(e=>(0,B.jsx)(`button`,{onClick:()=>void Se(f.item,e.operation,m(e.key)),type:`button`,children:m(e.key)},e.operation))})]})]}),(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void Se(f.item,`complete`,m(`drawer.taskComplete`)),type:`button`,children:[(0,B.jsx)(om,{size:17}),m(`drawer.taskComplete`)]})]}):null,f.item.done?(0,B.jsxs)(`div`,{className:`personal-task-completed-note`,children:[(0,B.jsx)(om,{size:16}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:m(`drawer.taskCompletedTitle`)}),(0,B.jsx)(`small`,{children:m(`drawer.taskCompletedNote`)})]})]}):null]}):null,f.kind===`goal`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card`,children:[(0,B.jsx)(`small`,{children:Yi(f.item.state,p)}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.agentSentence}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.tokens`)}),(0,B.jsxs)(`dd`,{children:[eb(f.item.usage?.tokens24h,m(`drawer.usageNotMeasured`),Zy),` / `,eb(f.item.usage?.tokens7d,m(`drawer.usageNotMeasured`),Zy)]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.cost`)}),(0,B.jsxs)(`dd`,{children:[eb(f.item.usage?.costUsd24h,m(`drawer.usageNotMeasured`),Qy),` / `,eb(f.item.usage?.costUsd7d,m(`drawer.usageNotMeasured`),Qy)]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.duration`)}),(0,B.jsxs)(`dd`,{children:[eb(f.item.usage?.durationMs24h,m(`drawer.usageNotMeasured`),$y),` / `,eb(f.item.usage?.durationMs7d,m(`drawer.usageNotMeasured`),$y)]})]})]})]}),(0,B.jsx)(vb,{goal:f.item}),(()=>{let e=i.find(e=>e.goalId===f.item.goalId),t=s.find(e=>e.goal_id===f.item.goalId);return(0,B.jsxs)(B.Fragment,{children:[f.item.repository?(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-repository`,children:[(0,B.jsxs)(`div`,{className:`personal-detail-card-title`,children:[(0,B.jsx)(`small`,{children:m(`drawer.repository`)}),(0,B.jsx)(`em`,{children:m(`common.readOnly`)})]}),(0,B.jsxs)(`h3`,{children:[(0,B.jsx)(Cm,{size:16}),f.item.repository.label]}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.branch`)}),(0,B.jsx)(`dd`,{children:f.item.repository.branch||`detached`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Role`}),(0,B.jsx)(`dd`,{children:m(`drawer.repositoryRole`)})]})]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>{let e=navigator.clipboard?.writeText(f.item.repository?.identity??``);if(!e){b(`error`);return}e.then(()=>b(`copied`)).catch(()=>b(`error`))},type:`button`,children:[(0,B.jsx)(mm,{size:15}),m(y===`copied`?`drawer.copyRepositoryDone`:`drawer.copyRepository`)]}),y===`error`?(0,B.jsx)(`p`,{className:`personal-copy-feedback is-error`,role:`status`,children:m(`drawer.copyRepositoryError`)}):y===`copied`?(0,B.jsx)(`p`,{className:`personal-copy-feedback`,role:`status`,children:m(`drawer.copyRepositorySuccess`)}):null]}):null,u?(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-notification`,children:[(0,B.jsx)(`small`,{children:m(`drawer.larkConnection`)}),(0,B.jsx)(`h3`,{children:m(`drawer.remoteDetailsUnavailable`)}),(0,B.jsx)(`p`,{children:m(`drawer.remoteDetailsDescription`)})]}):(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-notification`,children:[(0,B.jsx)(`small`,{children:m(`drawer.larkConnection`)}),t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h3`,{children:[t.app_label,(0,B.jsx)(`span`,{className:`personal-connection-status`,children:m(`drawer.connected`)})]}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.group`)}),(0,B.jsx)(`dd`,{children:t.chat_name})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.topic`)}),(0,B.jsxs)(`dd`,{children:[`# `,t.topic_name]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.trigger`)}),(0,B.jsx)(`dd`,{children:t.incoming_mode===`mentions`?m(`lark.someoneMentions`):m(`lark.allMessages`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.replyMode`)}),(0,B.jsx)(`dd`,{children:m(`lark.topicReply`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.autoNotify`)}),(0,B.jsx)(`dd`,{children:e?.humanGateAutoNotifyEnabled?m(`common.on`):m(`common.off`)})]}),e?.lastNotifiedAt?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.lastNotification`)}),(0,B.jsx)(`dd`,{children:e.lastNotifiedAt})]}):null]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:m(`drawer.larkNotConfigured`)}),(0,B.jsx)(`p`,{children:m(`drawer.larkNotConfiguredDescription`)})]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>r.onOpenNotificationSettings?.(f.item.goalId),type:`button`,children:[(0,B.jsx)(nm,{size:16}),m(t?`drawer.larkConfigure`:`drawer.larkConnect`)]})]})]})})(),(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-session`,children:[(0,B.jsx)(`small`,{children:m(`drawer.runDetails`)}),_e?.sessionId?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:Xi(_e.sessionStatus??_e.status,m)}),(0,B.jsx)(`p`,{children:_e.title}),r.onOpenRunSession?(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void r.onOpenRunSession?.(_e),type:`button`,children:[(0,B.jsx)(Bm,{size:16}),m(`drawer.runLatest`)]}):null]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:m(`drawer.noRun`)}),(0,B.jsx)(`p`,{children:m(`drawer.noRunDescription`)})]})]}),u?null:(0,B.jsxs)(`div`,{className:`personal-drawer-action-grid`,children:[(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>r.onRequestScheduleConfig?.(`heartbeat`,f.item.goalId),type:`button`,children:[(0,B.jsx)(Hm,{size:16}),m(`drawer.setupHeartbeat`)]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>r.onRequestScheduleConfig?.(`monitor`,f.item.goalId),type:`button`,children:[(0,B.jsx)(am,{size:16}),m(`drawer.scheduleAdd`)]})]}),f.item.subagentExecution?(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-subagents`,children:[(0,B.jsxs)(`div`,{className:`personal-subagent-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`small`,{children:m(`drawer.subagentLabel`)}),(0,B.jsxs)(`h3`,{children:[(0,B.jsx)(rm,{size:16}),m(`drawer.subagentTitle`)]})]}),(0,B.jsxs)(`button`,{"aria-checked":we.enabled,"aria-label":m(ne&&j===`ready`?`drawer.subagentPending`:we.enabled?`drawer.subagentDisable`:`drawer.subagentEnable`),className:`personal-subagent-switch`,"data-pending":ne&&j===`ready`?`true`:void 0,disabled:u||Te||!!ne||!r.onPreviewGoalSubagentConfiguration,onClick:()=>void Ae(!we.enabled),role:`switch`,type:`button`,children:[(0,B.jsx)(`span`,{}),m(ne&&j===`ready`?`drawer.subagentPending`:we.enabled?`common.on`:`common.off`)]})]}),(0,B.jsx)(`p`,{children:m(`drawer.subagentDescription`)}),ne&&j===`ready`?(0,B.jsxs)(`div`,{className:`personal-subagent-preview`,children:[(0,B.jsx)(`strong`,{children:m(ne.enabled?`drawer.subagentConfirmEnable`:`drawer.subagentConfirmDisable`)}),(0,B.jsx)(`p`,{children:ne.enabled?m(`drawer.subagentPreviewSummary`,{count:ne.maxChildren,domains:ne.allowedDomains.join(` · `)||m(`drawer.subagentDomainsUnrestricted`)}):m(`drawer.subagentDisableSummary`)}),ne.modelConfig===void 0?null:(0,B.jsxs)(`p`,{children:[m(`drawer.subagentModel`),`: `,ne.modelConfig?.model||m(`drawer.subagentModelDefault`),` · `,ne.modelConfig?.reasoning_effort||m(`drawer.subagentModelDefault`)]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`button`,{className:`personal-primary-action`,onClick:()=>void je(),type:`button`,children:m(`common.confirm`)}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:De,type:`button`,children:m(`common.cancel`)})]})]}):null,T?(0,B.jsxs)(`p`,{className:`personal-subagent-feedback is-${j}`,role:`status`,children:[j===`previewing`||j===`applying`?(0,B.jsx)(Wm,{className:`personal-spin`,size:13}):null,T]}):null,(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.subagentModel`)}),(0,B.jsx)(`dd`,{children:we.modelConfig?.model||m(`drawer.subagentModelDefault`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.subagentEffort`)}),(0,B.jsx)(`dd`,{children:we.modelConfig?.reasoning_effort||m(`drawer.subagentModelDefault`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.subagentCurrentBoundary`)}),(0,B.jsx)(`dd`,{children:we.allowedDomains.join(` · `)||m(`drawer.subagentDomainsUnrestricted`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.subagentChildLimit`)}),(0,B.jsx)(`dd`,{children:we.maxChildren||0})]})]}),u?(0,B.jsx)(`p`,{className:`personal-subagent-read-only`,children:m(`drawer.subagentRemoteReadOnly`)}):(0,B.jsxs)(`div`,{className:`personal-subagent-fields`,children:[(0,B.jsxs)(`fieldset`,{className:`personal-subagent-domain-picker`,disabled:Te,children:[(0,B.jsx)(`legend`,{children:m(`drawer.subagentDomains`)}),Ee.length>0?(0,B.jsx)(`div`,{className:`personal-subagent-domain-options`,children:Ee.map(e=>{let t=C.includes(e.value);return(0,B.jsxs)(`label`,{className:`personal-subagent-domain-option${t?` is-selected`:``}`,children:[(0,B.jsx)(`input`,{"aria-label":e.value,checked:t,onChange:t=>ke(e.value,t.target.checked),type:`checkbox`}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.value}),(0,B.jsx)(`small`,{children:m(`drawer.subagentDomainTodoCount`,{count:e.matchingTodoCount})})]})]},e.value)})}):(0,B.jsx)(`p`,{className:`personal-subagent-domain-empty`,children:m(`drawer.subagentDomainsEmpty`)}),(0,B.jsx)(`small`,{children:m(`drawer.subagentDomainsHint`)})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:m(`drawer.subagentModel`)}),(0,B.jsx)(`input`,{"aria-label":m(`drawer.subagentModel`),disabled:Te,value:k,placeholder:`gpt-5.6-luna`,onChange:e=>{ee(e.target.value),N(null),M(`idle`),E(null)}})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:m(`drawer.subagentEffort`)}),(0,B.jsxs)(`select`,{"aria-label":m(`drawer.subagentEffort`),disabled:Te,value:te,onChange:e=>{A(e.target.value),N(null),M(`idle`),E(null)},children:[(0,B.jsx)(`option`,{value:``,children:m(`drawer.subagentModelDefault`)}),[`none`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`,`ultra`].map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,disabled:Te,type:`button`,onClick:()=>{ee(`gpt-5.6-luna`),A(`max`),N(null),M(`idle`),E(null)},children:m(`drawer.subagentLunaPreset`)}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,disabled:Te,type:`button`,onClick:()=>{ee(``),A(``),N(null),M(`idle`),E(null)},children:m(`drawer.subagentClearModel`)}),(0,B.jsx)(`p`,{children:m(`drawer.subagentModelHint`)}),(0,B.jsxs)(`label`,{className:`personal-subagent-limit-field`,children:[(0,B.jsx)(`span`,{children:m(`drawer.subagentMaxChildren`)}),(0,B.jsx)(`select`,{"aria-label":m(`drawer.subagentMaxChildren`),disabled:Te,onChange:e=>{O(Number(e.target.value)),N(null),M(`idle`),E(null)},value:D,children:jb.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,disabled:Te,onClick:()=>void Ae(we.enabled,!0),type:`button`,children:m(`drawer.subagentPreviewBoundary`)})]})]}):null]}):null,f.kind===`run`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{"aria-label":m(`drawer.runView`),className:`personal-run-drawer-tabs`,role:`tablist`,children:[(0,B.jsx)(`button`,{"aria-selected":x===`record`,onClick:()=>S(`record`),role:`tab`,type:`button`,children:m(`drawer.executionRecordAndResult`)}),(0,B.jsx)(`button`,{"aria-selected":x===`details`,onClick:()=>S(`details`),role:`tab`,type:`button`,children:m(`drawer.detailsAndActions`)})]}),x===`record`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card personal-session-summary`,children:[(0,B.jsxs)(`small`,{children:[f.item.agentLabel,` · `,Xi(f.item.sessionStatus??f.item.status,m)]}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.latestActivity}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.progress`)}),(0,B.jsxs)(`dd`,{children:[f.item.completedSteps,`/`,f.item.totalSteps]})]})]})]}),(0,B.jsxs)(`section`,{"aria-label":m(`drawer.executionRecord`),className:`personal-session-message-record`,children:[(0,B.jsx)(`h3`,{children:m(`drawer.executionRecord`)}),f.item.sessionMessages?.length?(0,B.jsx)(`ol`,{children:f.item.sessionMessages.map(e=>(0,B.jsxs)(`li`,{className:`is-${e.role}`,children:[(0,B.jsx)(`i`,{}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:e.role===`user`?m(`drawer.runRoleUser`):e.role===`assistant`?m(`drawer.runRoleAssistant`):m(`drawer.runRoleSystem`)}),e.createdAt?(0,B.jsx)(`time`,{children:new Date(e.createdAt).toLocaleTimeString(p,{hour:`2-digit`,minute:`2-digit`,hour12:!1})}):null]}),(0,B.jsx)(`p`,{children:e.text})]})]},e.messageId))}):(0,B.jsx)(`p`,{className:`personal-session-empty`,children:ve?m(`drawer.runRecordProjected`,{completed:f.item.completedSteps,outputs:f.item.outputs?.length?m(`drawer.runRecordProjectedOutputs`,{count:f.item.outputs.length}):``,total:f.item.totalSteps}):m(`drawer.runRecordEmpty`)}),f.item.status===`running`?(0,B.jsxs)(`div`,{className:`personal-session-active-step`,children:[(0,B.jsx)(`i`,{}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:m(`drawer.analysis`)}),(0,B.jsx)(`small`,{children:m(`drawer.agentWorking`)})]})]}):null]}),f.item.outputs?.length?(0,B.jsxs)(`section`,{className:`personal-execution-history`,"aria-labelledby":`personal-run-outputs-title`,children:[(0,B.jsx)(`h3`,{id:`personal-run-outputs-title`,children:m(`drawer.outputs`)}),(0,B.jsx)(`ol`,{children:f.item.outputs.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`small`,{children:e.createdAt??e.kind??m(`files.emptySummary`)})]})},e.outputId))})]}):null]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card`,children:[(0,B.jsxs)(`small`,{children:[f.item.agentLabel,` · `,Xi(f.item.status,m)]}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.latestActivity}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.progress`)}),(0,B.jsxs)(`dd`,{children:[f.item.completedSteps,`/`,f.item.totalSteps]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.sessionStatus`)}),(0,B.jsx)(`dd`,{children:Xi(f.item.sessionStatus??f.item.status,m)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.sessionRecoverable`)}),(0,B.jsx)(`dd`,{children:f.item.resumable===!1?m(`drawer.resumeNo`):m(`drawer.resumeYes`)})]})]})]}),f.item.sessionStatus===`resume_failed`&&!u?(0,B.jsxs)(`section`,{className:`personal-recovery-panel`,"aria-label":m(`drawer.recoveryFailed`),children:[(0,B.jsx)(`strong`,{children:m(`drawer.recoveryFailed`)}),(0,B.jsx)(`p`,{children:m(`drawer.recoveryDescription`)}),(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void r.onRetryResumeRun?.(f.item),type:`button`,children:[(0,B.jsx)(Wm,{size:16}),m(`drawer.recoveryRetry`)]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onStartNewRunSession?.(f.item),type:`button`,children:[(0,B.jsx)(Bm,{size:16}),m(`drawer.recoveryNewSession`)]})]}):null,u?null:(0,B.jsxs)(`section`,{className:`personal-correction-panel`,children:[(0,B.jsx)(`header`,{children:(0,B.jsxs)(`span`,{children:[(0,B.jsx)(rm,{size:16}),m(`drawer.correctionLabel`,{agent:f.item.agentLabel})]})}),(0,B.jsx)(`p`,{children:m(`drawer.correctionDescription`)}),(0,B.jsxs)(`div`,{className:`personal-correction-composer`,children:[(0,B.jsx)(`textarea`,{"aria-label":m(`drawer.correctionTextarea`,{agent:f.item.agentLabel,goal:f.item.goalTitle,run:f.item.title}),onChange:e=>g(e.target.value),placeholder:m(`drawer.correctionPlaceholder`),rows:3,value:h}),(0,B.jsx)(`button`,{"aria-label":m(`drawer.correctionSend`),disabled:!h.trim(),onClick:()=>void xe(),type:`button`,children:(0,B.jsx)(qm,{size:16})})]})]}),u?null:(0,B.jsxs)(`details`,{className:`personal-compact-menu personal-run-more`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(_m,{size:17}),m(`drawer.moreRunActions`)]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{disabled:!f.item.canInterrupt,onClick:()=>void r.onInterruptRun?.(f.item),type:`button`,children:[(0,B.jsx)(zm,{size:16}),m(`drawer.runInterrupt`)]}),(0,B.jsxs)(`button`,{disabled:f.item.resumable===!1,onClick:()=>void r.onRetryResumeRun?.(f.item),type:`button`,children:[(0,B.jsx)(Wm,{size:16}),m(`drawer.recoveryRetry`)]}),(0,B.jsxs)(`button`,{onClick:()=>void r.onStartNewRunSession?.(f.item),type:`button`,children:[(0,B.jsx)(Bm,{size:16}),m(`drawer.runNewSession`)]}),(0,B.jsxs)(`button`,{onClick:()=>void r.onCloseRunSession?.(f.item),type:`button`,children:[(0,B.jsx)(eh,{size:16}),m(`drawer.runCloseSession`)]})]})]})]})]}):null,f.kind===`output`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card`,children:[(0,B.jsx)(`small`,{children:f.item.kind??`output`}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.summary??m(`drawer.outputRecorded`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle??f.item.goalId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.outputTodo`)}),(0,B.jsx)(`dd`,{children:f.item.todoId??m(`drawer.notLinked`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.outputRun`)}),(0,B.jsx)(`dd`,{children:f.item.runId??m(`drawer.notLinked`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Agent`}),(0,B.jsx)(`dd`,{children:f.item.agentLabel??f.item.agentId??`LoopX`})]})]})]}),f.item.report?(0,B.jsxs)(`section`,{className:`personal-report-detail`,"data-testid":`personal-periodic-report-detail`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsxs)(`strong`,{children:[`+`,f.item.report.addedCount]}),m(`files.reportAdded`)]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:f.item.report.changedCount}),m(`files.reportChanged`)]})]}),(0,B.jsxs)(`p`,{children:[f.item.report.periodStartAt,` → `,f.item.report.periodEndAt]}),(0,B.jsx)(`ol`,{children:f.item.report.items.map(e=>(0,B.jsxs)(`li`,{"data-change-kind":e.changeKind,children:[(0,B.jsxs)(`small`,{children:[e.changeKind,` · `,e.status]}),(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`p`,{children:e.summary})]},e.sourceRef))}),(0,B.jsxs)(`footer`,{children:[(0,B.jsxs)(`span`,{children:[m(`files.reportPublication`),`: `,f.item.report.publicationId]}),(0,B.jsxs)(`span`,{children:[m(`files.reportGeneration`),`: `,f.item.report.generationId]})]})]}):null,f.item.safePreview?(0,B.jsx)(`pre`,{"aria-label":m(`drawer.outputSafePreview`),className:`personal-safe-preview`,children:f.item.safePreview}):(0,B.jsx)(`p`,{className:`personal-preview-unavailable`,children:m(`drawer.previewUnavailable`)}),(0,B.jsxs)(`div`,{className:`personal-drawer-action-grid`,children:[(0,B.jsxs)(`button`,{className:`personal-primary-action`,disabled:!r.onOpenOutput,onClick:()=>{r.onOpenOutput?.(f.item),c()},type:`button`,children:[(0,B.jsx)(vm,{size:16}),m(`files.openConversation`)]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,disabled:!r.onExportOutput,onClick:()=>void r.onExportOutput?.(f.item),type:`button`,children:[(0,B.jsx)(gm,{size:16}),m(`files.exportSummary`)]})]})]}):null,f.kind===`proposal`?(0,B.jsxs)(B.Fragment,{children:[f.item.actionKind===`team.plan`&&f.item.status===`applied`?(0,B.jsx)(bb,{proposal:f.item,t:m}):(0,B.jsxs)(`section`,{className:`personal-proposal-card`,children:[(0,B.jsxs)(`small`,{children:[f.item.actionKind,` · `,f.item.status]}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.impact}),f.item.reviewPlan&&!f.item.reviewPlan.retryOriginal&&f.item.actionKind!==`team.plan`?(0,B.jsx)(`p`,{className:`personal-proposal-explainer`,"data-action-review":f.item.reviewPlan.interaction,children:f.item.actionKind===`operation.execute`&&f.item.status===`gated`?m(`actionReview.operation_group_confirmation`):f.item.actionKind===`operation.execute`&&f.item.reviewPlan.reason===`readback_unverified`?m(`actionReview.operation_result_delivery_pending`):m(`actionReview.${f.item.reviewPlan.reason}`)}):null,f.item.status===`ready`&&f.item.actionKind!==`team.plan`?(0,B.jsx)(`p`,{className:`personal-proposal-explainer`,children:m(`drawer.proposalExplainer`)}):null,(0,B.jsx)(`dl`,{children:f.item.fields.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.label}),(0,B.jsx)(`dd`,{children:e.value})]},e.key))})]}),f.item.status===`applied`&&f.item.actionKind!==`team.plan`?(0,B.jsxs)(`p`,{className:`personal-proposal-state ${f.item.actionKind===`operation.execute`&&f.item.reviewPlan?.reason===`readback_unverified`?`is-gated`:`is-applied`}`,children:[(0,B.jsx)(om,{size:16}),f.item.actionKind===`operation.execute`?f.item.primaryLabel:m(`drawer.proposalApplied`)]}):null,f.item.status===`applied`&&f.item.actionKind!==`operation.execute`&&f.item.goalId?(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>{let e=f.item.goalId;c(),r.onOpenGoal?.(e)},type:`button`,children:[(0,B.jsx)(vm,{size:16}),f.item.actionKind===`goal.create`?m(`drawer.proposalEnterGoal`):m(f.item.actionKind===`team.plan`?`proposal.teamPlan.openGoal`:`drawer.proposalViewGoal`)]}):null,f.item.status===`stale`?(0,B.jsx)(`p`,{className:`personal-proposal-state is-stale`,children:m(`drawer.proposalStale`)}):null,f.item.status===`error`&&!f.item.reviewPlan?.retryOriginal?(0,B.jsxs)(`div`,{className:`personal-proposal-state is-error`,children:[(0,B.jsx)(`span`,{children:f.item.reviewPlan?.reason===`readback_unverified`?m(`actionReview.readback_unverified`):m(`drawer.proposalApplyFailed`)}),f.item.errorMessage?(0,B.jsx)(`small`,{children:f.item.errorMessage}):null,(0,B.jsx)(`small`,{children:m(f.item.actionKind===`team.plan`?`proposal.teamPlan.retryHint`:`drawer.proposalApplyFailedHint`)})]}):null,f.item.status===`rejected`?(0,B.jsx)(`p`,{className:`personal-proposal-state is-error`,children:m(`drawer.proposalRejected`)}):null,f.item.status===`deferred`?(0,B.jsx)(`p`,{className:`personal-proposal-state is-gated`,children:m(`drawer.proposalDeferred`)}):null,f.item.status===`gated`?(0,B.jsxs)(`div`,{className:`personal-proposal-state is-gated`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:f.item.actionKind===`operation.execute`?f.item.primaryLabel:m(`drawer.gateRequiresHost`)}),f.item.actionKind===`operation.execute`?f.item.impact:m(`drawer.gateRequiresHostDescription`)]}),f.item.gate?.nextAction?(0,B.jsx)(`small`,{children:f.item.gate.nextAction}):null]}):null,f.item.status===`gated`&&f.item.actionKind===`gate.resolve`?(()=>{let e=e=>f.item.fields.find(t=>t.key===e)?.value,t=e(`goal_id`),n=e(`todo_id`);return!t||!n?null:(0,B.jsxs)(`section`,{className:`personal-detail-card personal-gate-cli-hint`,children:[(0,B.jsx)(`small`,{children:m(`drawer.gateApproveHint`)}),(0,B.jsxs)(`code`,{children:[`loopx todo complete --goal-id `,t,` --todo-id `,n,` --decision-outcome approve`]}),(0,B.jsx)(`small`,{children:m(`drawer.gateRejectHint`)})]})})():null,!u&&f.item.workspaceCandidates?.length?(0,B.jsx)(`div`,{className:`personal-workspace-candidates`,"aria-label":m(`drawer.workspaceCandidates`),children:f.item.workspaceCandidates.map(e=>(0,B.jsxs)(`button`,{onClick:()=>void r.onSelectWorkspaceCandidate?.(f.item,e.workspaceRef),type:`button`,children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`small`,{children:e.workspaceRef})]},e.workspaceRef))}):null,!u&&f.item.actionKind!==`operation.execute`&&f.item.status===`error`?(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void(f.item.actionKind===`team.plan`||f.item.reviewPlan?.retryOriginal?r.onApplyProposal?.(f.item):r.onTransitionProposal?.(f.item,`regenerate`)),type:`button`,children:[(0,B.jsx)(Wm,{size:17}),m(f.item.reviewPlan?.retryOriginal?`drawer.retryOriginal`:f.item.actionKind===`team.plan`?`proposal.teamPlan.retry`:`drawer.proposalRegenerate`)]}):!u&&f.item.actionKind!==`operation.execute`&&f.item.status!==`gated`&&(f.item.actionKind!==`team.plan`||f.item.status!==`applied`)?(0,B.jsxs)(`button`,{className:`personal-primary-action`,disabled:![`ready`,`deferred`].includes(f.item.status)||f.item.reviewPlan?.canApply===!1,onClick:()=>void r.onApplyProposal?.(f.item),type:`button`,children:[(0,B.jsx)(om,{size:17}),f.item.status===`applying`?m(`drawer.applying`):f.item.primaryLabel??m(`drawer.apply`)]}):null,!u&&f.item.actionKind!==`operation.execute`&&([`stale`,`gated`,`rejected`].includes(f.item.status)||f.item.status===`ready`&&f.item.reviewPlan?.canApply===!1)?(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onTransitionProposal?.(f.item,`regenerate`),type:`button`,children:[(0,B.jsx)(Wm,{size:16}),m(`drawer.proposalRecheck`)]}):null,!u&&f.item.actionKind!==`operation.execute`&&[`ready`,`gated`].includes(f.item.status)?(0,B.jsxs)(`div`,{className:`personal-drawer-action-grid`,children:[(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onTransitionProposal?.(f.item,`defer`),type:`button`,children:m(`drawer.proposalDefer`)}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onTransitionProposal?.(f.item,`reject`),type:`button`,children:m(`drawer.decisionReject`)})]}):null,[`applied`,`applying`].includes(f.item.status)?null:(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:c,type:`button`,children:m(`drawer.proposalClose`)})]}):null,f.kind===`schedule`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card`,children:[(0,B.jsxs)(`small`,{children:[f.item.scheduleKind===`heartbeat`?`Goal Heartbeat`:`continuous_monitor`,` · `,f.item.status??`active`]}),(0,B.jsx)(`h3`,{children:f.item.label}),(0,B.jsx)(`p`,{children:f.item.target??f.item.schedule??m(`drawer.scheduleDefaultTarget`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleTimezone`)}),(0,B.jsx)(`dd`,{children:f.item.timezone??m(`drawer.scheduleLocalTimezone`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleNext`)}),(0,B.jsx)(`dd`,{children:f.item.nextRunAt??m(`drawer.schedulePending`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleLast`)}),(0,B.jsx)(`dd`,{children:f.item.previousRunAt??m(`drawer.scheduleNeverRun`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleNotification`)}),(0,B.jsx)(`dd`,{children:f.item.notificationRule??m(`drawer.scheduleDefaultNotification`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleStopCondition`)}),(0,B.jsx)(`dd`,{children:f.item.stopCondition??m(`drawer.scheduleDefaultStop`)})]})]})]}),!u&&f.item.scheduleKind===`monitor`?(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void r.onUpdateSchedule?.(f.item,`run_now`),type:`button`,children:[(0,B.jsx)(Bm,{size:16}),m(`drawer.scheduleRunNow`)]}):null,u?null:(0,B.jsxs)(`div`,{className:`personal-drawer-action-grid`,children:[(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onUpdateSchedule?.(f.item,f.item.status===`paused`?`resume`:`pause`),type:`button`,children:[f.item.status===`paused`?(0,B.jsx)(Bm,{size:16}):(0,B.jsx)(zm,{size:16}),f.item.status===`paused`?m(`drawer.scheduleResume`):m(`drawer.schedulePause`)]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onUpdateSchedule?.(f.item,`edit`),type:`button`,children:[(0,B.jsx)(am,{size:16}),m(`drawer.scheduleEdit`)]})]}),u?null:(0,B.jsxs)(`button`,{className:`personal-danger-action`,onClick:()=>void r.onUpdateSchedule?.(f.item,`stop`),type:`button`,children:[(0,B.jsx)(eh,{size:16}),m(`drawer.scheduleStop`,{kind:f.item.scheduleKind===`heartbeat`?` Heartbeat`:m(`drawer.titleSchedule`)})]}),(0,B.jsxs)(`section`,{className:`personal-execution-history`,"aria-labelledby":`personal-execution-history-title`,children:[(0,B.jsx)(`h3`,{id:`personal-execution-history-title`,children:m(`drawer.executionHistory`)}),f.item.executionHistory?.length?(0,B.jsx)(`ol`,{children:f.item.executionHistory.map((e,t)=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`small`,{children:e.timestamp})]}),(0,B.jsx)(`em`,{className:`is-${e.status}`,children:e.status})]},`${e.timestamp}:${e.runId??t}`))}):(0,B.jsx)(`p`,{children:m(`drawer.noExecutionHistory`)})]})]}):null,f.kind===`run`||f.kind===`proposal`||f.kind===`schedule`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{"aria-expanded":_,className:`personal-diagnostics-trigger`,onClick:()=>v(e=>!e),type:`button`,children:[(0,B.jsx)(`span`,{children:m(`drawer.advancedDiagnostics`)}),(0,B.jsx)(sm,{className:_?`is-open`:``,size:16})]}),_?(0,B.jsxs)(`div`,{className:`personal-diagnostics`,children:[(0,B.jsxs)(`code`,{children:[`goal_id: `,he]}),(0,B.jsxs)(`code`,{children:[`kind: `,f.kind]}),f.kind===`run`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`code`,{children:[`session_id: `,f.item.sessionId??m(`drawer.notLinked`)]}),(0,B.jsxs)(`code`,{children:[`turn_id: `,f.item.turnId??m(`common.none`)]}),(0,B.jsxs)(`code`,{children:[`adapter: `,f.item.agentId]}),(0,B.jsxs)(`code`,{children:[`status: `,f.item.sessionStatus??f.item.status]})]}):f.kind===`proposal`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`code`,{children:[`action: `,f.item.actionKind]}),(0,B.jsxs)(`code`,{children:[`status: `,f.item.status]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`code`,{children:[`schedule_id: `,f.item.scheduleId]}),(0,B.jsxs)(`code`,{children:[`status: `,f.item.status??`active`]})]})]}):null]}):null]})]})}var Ib=[`checking`,`connecting`,`downloading`,`installing_app`,`installing_runtime`],Lb={desktop_status_unavailable:[`无法读取 App 更新状态。请重启 App 后再试;若仍失败,请重新安装最新 App。`,`Cannot read the App update status. Restart the App; if this persists, reinstall the latest App.`],update_feed_unavailable:[`此通道的更新源尚未就绪或暂时不可用。可稍后重新检查,当前版本仍可继续使用。`,`This channel's update feed is not ready or temporarily unavailable. Check again later; you can keep using this version.`],update_feed_invalid:[`更新源格式异常。请稍后重新检查。`,`The update feed is invalid. Check again later.`],update_platform_unavailable:[`此通道尚无适用于本机的更新包。`,`This channel has no update package for this platform.`],update_check_timeout:[`检查更新超时。请稍后重试。`,`The update check timed out. Try again later.`],update_network_failed:[`无法连接更新服务器。请检查网络后重试。`,`Cannot reach the update server. Check your connection and retry.`],update_download_or_signature_failed:[`更新包下载或签名校验失败,尚未安装。请重新检查更新。`,`Download or signature verification failed; the update was not installed. Check for updates again.`]};function Rb(e,t=`update_failed`){return{phase:`error`,details:{code:typeof e==`string`&&Object.hasOwn(Lb,e)?e:t}}}function zb(){let{locale:e}=Ji(),t=e===`zh-CN`,[n,r]=(0,z.useState)(!1),i=(0,z.useRef)(null),[a,o]=(0,z.useState)(`stable`),[s,c]=(0,z.useState)({phase:`idle`}),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1),p=(0,z.useRef)(!1),m=window.__TAURI__?.core.invoke,h=Ib.includes(s.phase);(0,z.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>r(e.matches(`:popover-open`));return e.addEventListener(`toggle`,t),()=>e.removeEventListener(`toggle`,t)},[]),(0,z.useEffect)(()=>{if(!m)return;let e=!0;return m(`desktop_update_status`).then(t=>{if(!e)return;u(t.app_version),f(t.rollback_available===!0),t.state?.phase&&c(t.state);let n=t.state?.details?.channel??(t.app_version.includes(`-main.`)?`main`:`stable`);o(n),t.state?.phase||m(`desktop_update`,{action:`check`,channel:n}).then(t=>{e&&c(t)}).catch(t=>{e&&c(Rb(t))})}).catch(()=>{e&&c(Rb(null,`desktop_status_unavailable`))}),()=>{e=!1}},[m]),(0,z.useEffect)(()=>{if(!m||!h)return;let e=window.setInterval(()=>{m(`desktop_update_status`).then(e=>{e.state?.phase&&c(e.state)}).catch(()=>{})},1e3);return()=>window.clearInterval(e)},[m,h]);async function g(e){if(!(!m||p.current)){p.current=!0,c({phase:e===`check`?`checking`:e===`repair`?`installing_runtime`:`downloading`});try{if(!l){let e=await m(`desktop_update_status`);u(e.app_version),f(e.rollback_available===!0)}c(await m(`desktop_update`,{action:e,channel:a}))}catch(e){c(Rb(e,l?`update_failed`:`desktop_status_unavailable`))}finally{p.current=!1}}}let _={service_error:t?`运行时已安装,但服务尚未连接。可重试更新、修复或恢复上版。`:`Runtime installed, but services are unavailable. Retry updates, repair, or restore the previous version.`,runtime_pairing_required:t?`本机 CLI 运行时与 App 自带运行时不一致。回到 App 启动界面可「更新 App 与运行时」或「回退 CLI」。`:`This host's CLI runtime and the App's bundled runtime differ. On the App boot screen, update both or use the App's runtime.`,idle:t?`App 会检查可用更新,不会自动安装。`:`Updates are checked automatically, never installed without confirmation.`,runtime_required:t?`请完成匹配组件安装,或检查 App 更新。`:`Install matching components or check for an App update.`,connecting:t?`正在连接更新后的服务…`:`Connecting to updated services…`,checking:t?`正在检查更新…`:`Checking for updates…`,available:t?`新版本已就绪,一次更新 App 与匹配的运行时。`:`Update the App and its matching runtime together.`,up_to_date:t?`当前通道暂无更新。`:`No newer update on this channel.`,downloading:t?`正在下载并校验签名…`:`Downloading and verifying signature…`,installing_app:t?`正在安装 App,请保持窗口打开。`:`Installing the App. Keep this window open.`,installing_runtime:t?`正在安装匹配的运行时,请稍候…`:`Installing the matching runtime…`,restart_required:t?`重启后将自动完成运行时安装与服务连接。`:`Restart to finish runtime installation and reconnect services.`,ready:t?`更新完成,服务已就绪。`:`Update completed; services are ready.`,error:Lb[s.details?.code??``]?.[+!t]??(t?`更新未完成。请重试;启动失败可尝试修复当前版本。`:`Update incomplete. Retry; repair this version if startup fails.`)},v=h?t?`正在更新…`:`Updating…`:s.phase===`available`?t?`有可用更新`:`Update available`:s.phase===`restart_required`?t?`重启完成更新`:`Restart to finish`:s.phase===`error`?t?`更新需重试`:`Retry update`:t?`更新 LoopX`:`Update LoopX`;return(0,B.jsxs)(`div`,{className:`personal-desktop-update`,children:[(0,B.jsxs)(`button`,{className:`personal-update-trigger`,type:`button`,"aria-expanded":n,"aria-controls":`desktop-update-panel`,onClick:e=>{i.current?.style.setProperty(`bottom`,`${window.innerHeight-e.currentTarget.getBoundingClientRect().top+8}px`),i.current?.togglePopover()},children:[(0,B.jsx)(gm,{size:16,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:v}),(0,B.jsx)(lm,{size:14,"aria-hidden":`true`})]}),(0,B.jsxs)(`section`,{ref:i,popover:`auto`,id:`desktop-update-panel`,className:`personal-update-panel`,"aria-label":t?`LoopX 更新`:`LoopX updates`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:t?`LoopX 更新`:`LoopX updates`}),(0,B.jsx)(`button`,{type:`button`,"aria-label":t?`关闭更新面板`:`Close updates`,onClick:()=>i.current?.hidePopover(),children:(0,B.jsx)(oh,{size:16,"aria-hidden":`true`})})]}),(0,B.jsxs)(`small`,{children:[l,` · `,a===`main`?t?`main 预览版`:`main preview`:t?`稳定版`:`Stable`]}),s.details?.version?(0,B.jsxs)(`p`,{children:[t?`目标版本:`:`Target: `,s.details.version]}):null,(0,B.jsxs)(`p`,{role:`status`,"aria-live":`polite`,children:[h?(0,B.jsx)(Um,{className:`is-spinning`,size:14,"aria-hidden":`true`}):null,_[s.phase]]}),s.phase===`downloading`&&s.details?.total?(0,B.jsx)(`progress`,{"aria-label":t?`下载进度`:`Download progress`,max:s.details.total,value:s.details.received??0}):null,m?(0,B.jsx)(`div`,{className:`personal-update-actions`,children:s.phase===`restart_required`?(0,B.jsx)(`button`,{type:`button`,onClick:()=>void g(`restart`),children:t?`重启完成更新`:`Restart to finish`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>void g(`check`),children:t?`检查更新`:`Check for updates`}),s.phase===`available`?(0,B.jsx)(`button`,{type:`button`,onClick:()=>void g(`apply`),children:t?`更新并准备重启`:`Install update`}):null]})}):(0,B.jsx)(`p`,{children:t?`请在 LoopX App 中更新;浏览器自身无需安装包。`:`Update from the LoopX App; the browser needs no installer.`}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:t?`高级选项`:`Advanced options`}),(0,B.jsxs)(`label`,{children:[t?`更新通道`:`Update channel`,(0,B.jsxs)(`select`,{disabled:h||s.phase===`restart_required`,value:a,onChange:e=>{o(e.target.value),c({phase:`idle`})},children:[(0,B.jsx)(`option`,{value:`stable`,children:t?`稳定版(推荐)`:`Stable (recommended)`}),(0,B.jsx)(`option`,{value:`main`,children:t?`main 预览版`:`main preview`})]})]}),(0,B.jsx)(`p`,{children:t?`App 与匹配的 CLI 一起更新,服务可能短暂断开。不删除 Goal 数据。`:`Updates the App and matching CLI. Services may briefly disconnect. Goal data is not deleted.`}),m?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{children:t?`启动失败时,可重装当前 App 随附的运行时。`:`If startup fails, reinstall this App's bundled runtime.`}),(0,B.jsx)(`button`,{disabled:h||s.phase===`restart_required`,type:`button`,onClick:()=>void g(`repair`),children:t?`修复当前版本`:`Repair this version`})]}):null,m&&d?(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:t?`恢复上个版本`:`Restore previous version`}),(0,B.jsx)(`p`,{children:t?`将恢复已保留的 App 和它的运行时,需要重启。`:`Restore the retained App and its runtime, then restart.`}),(0,B.jsx)(`button`,{disabled:h,type:`button`,onClick:()=>void g(`rollback`),children:t?`确认恢复上版`:`Restore previous version`})]}):null]})]})]})}var Bb=e=>`loopx-sidebar-goal-order-v1:${encodeURIComponent(e)}`;function Vb(e){try{let t=JSON.parse(e??`null`);return Array.isArray(t)&&t.every(e=>typeof e==`string`)?[...new Set(t)]:[]}catch{return[]}}function Hb(e,t){let n=new Map(t.map((e,t)=>[e,t]));return[...e].sort((e,t)=>(n.get(e.goalId)??1/0)-(n.get(t.goalId)??1/0))}function Ub(e,t,n,r,i){if(n===r||!t.includes(n)||!t.includes(r))return e;let a=[...new Set([...e,...t])].filter(e=>e!==n);return a.splice(a.indexOf(r)+Number(i),0,n),a}function Wb(e,t){let n=Bb(t),[r,i]=(0,z.useState)(()=>{try{return Vb(localStorage.getItem(n))}catch{return[]}}),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(null),[l,u]=(0,z.useState)(null),d=(0,z.useRef)(null),f=(0,z.useRef)(!1),p=Hb(e,r),m=p.map(e=>e.goalId);function h(t,a,s){let l=Ub(r,m,t,a,s);if(l===r)return;i(l);let u=Hb(e,l),d=u.findIndex(e=>e.goalId===t),f=u[d];f&&c({title:f.title,position:d+1});try{localStorage.setItem(n,JSON.stringify(l)),o(!1)}catch{o(!0)}}function g(){d.current=null,u(null)}return{sorted:p,target:l,saveFailed:a,lastMoved:s,move:h,moveBy(e,t){let n=p[m.indexOf(e)+t];n&&h(e,n.goalId,t===1)},pointerProps:e=>({onPointerDown(t){f.current=!1,t.pointerType===`mouse`&&t.button===0&&(d.current={id:e,x:t.clientX,y:t.clientY,dragging:!1},t.currentTarget.setPointerCapture(t.pointerId))},onPointerMove(e){let t=d.current;if(!t||!t.dragging&&Math.hypot(e.clientX-t.x,e.clientY-t.y)<6)return;t.dragging=!0,f.current=!0;let n=document.elementFromPoint(e.clientX,e.clientY)?.closest(`[data-reorder-goal]`),r=e.currentTarget.closest(`.personal-goal-list`),i=n?.dataset.reorderGoal;if(!n||!i||!r?.contains(n)||i===t.id){u(null);return}let a=n.getBoundingClientRect();u({id:i,after:e.clientY>a.top+a.height/2})},onPointerUp(){d.current?.dragging&&l&&h(d.current.id,l.id,l.after),g()},onPointerCancel:g,onLostPointerCapture:g,onKeyDown(e){e.key===`Escape`&&g()},onClickCapture(e){f.current&&=(e.preventDefault(),e.stopPropagation(),!1)}})}}var Gb=`/ssh-hosts`,Kb=/^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/;function qb(e){return typeof e==`string`&&Kb.test(e.trim())}function Jb(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`SSH Host 列表响应无效。`);let t=e;if(t.ok!==!0||t.schema_version!==`ssh_host_catalog_v0`||!Array.isArray(t.hosts))throw Error(`SSH Host 列表协议不兼容,请更新本机 LoopX 服务。`);let n=new Set;return{hosts:t.hosts.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=String(e.alias??``).trim();return!qb(t)||n.has(t)?[]:(n.add(t),[{alias:t}])}),schemaVersion:`ssh_host_catalog_v0`}}async function Yb(e=fetch,t=Gb){let n=await e(t,{cache:`no-store`});if(!n.ok)throw Error(`无法读取本机 SSH Host(HTTP ${n.status})。`);return Jb(await n.json())}function Xb(e,t){let n=e.trim();if(!qb(n))return{error:`请选择有效的 SSH Host。`};let r=Number(t);return!Number.isInteger(r)||r<1024||r>65535?{error:`本地端口必须是 1024–65535 之间的整数。`}:{command:`ssh -N -L ${r}:127.0.0.1:8766 ${n}`,hostAlias:n,label:n,statusUrl:`http://127.0.0.1:${r}/status.json`}}var Zb=`/api/ssh-source/ensure`,Qb=`/api/ssh-source/goal-lifecycle`;async function $b(e,t){let n=await fetch(Zb,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({host_alias:e,local_port:Number(t)})}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error??`无法建立 SSH 隧道来源。`);if(!r?.ok)throw Error(`无法建立 SSH 隧道来源。`);return r}async function ex(e,t,n,r,i=fetch){let a=await i(Qb,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({goal_id:t,host_alias:e,operation:n,reason:r})}),o=await a.json().catch(()=>null);if(!a.ok)throw Error(o?.error??`无法更新远端 Goal 生命周期。`);if(!o?.ok||o.schema_version!==`loopx_remote_goal_lifecycle_v1`||o.goal_id!==t||o.host_alias!==e||o.operation!==n||o.activation_state!==(n===`stop`?`stopped`:`active`)||o.projection_verified!==!0)throw Error(`远端 Goal 生命周期回读未验证。`);return o}function tx({activeSource:e,connectionState:t,errorMessage:n,onAdd:r,onConfiguredHostsLoaded:i,onRemove:a,onSelect:o,sources:s}){let{t:c}=Ji(),[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(null),[p,m]=(0,z.useState)(`configured`),[h,g]=(0,z.useState)([]),[_,v]=(0,z.useState)(null),[y,b]=(0,z.useState)(!1),[x,S]=(0,z.useState)(!1),[C,w]=(0,z.useState)(``),[T,E]=(0,z.useState)(``),[D,O]=(0,z.useState)(`8876`),[k,ee]=(0,z.useState)(``),te=`configured:`,A=[...s.map(e=>({label:e.label,value:e.id})),...h.filter(e=>!s.some(t=>t.label===e.alias)).map(e=>({group:c(`source.configuredGroup`,{count:h.length}),label:e.alias,value:`${te}${e.alias}`}))],j=(0,z.useMemo)(()=>h.some(e=>e.alias===C)?Xb(C,D):{error:c(`source.selectHost`)},[h,C,D,c]);(0,z.useEffect)(()=>{M()},[]);async function M(){b(!0),v(null);try{let e=await Yb();g(e.hosts),i?.(e.hosts.map(e=>e.alias)),w(t=>t||e.hosts[0]?.alias||``),e.hosts.length||v(c(`source.hostEmpty`))}catch(e){v(e instanceof Error?e.message:c(`source.hostLoadError`))}finally{b(!1)}}function ne(){u(!0),m(`configured`),f(null),M()}function N(){u(!1),m(`configured`),v(null),S(!1),w(``),f(null),E(``),O(`8876`),ee(``)}function P(){let e=r({label:T,statusUrl:k});if(e.error){f(e.error);return}N()}function re(){if(`error`in j){f(j.error??c(`source.invalid`));return}let e=r({ensureTunnel:!0,hostAlias:j.hostAlias,label:j.label,statusUrl:j.statusUrl});if(e.error){f(e.error);return}N()}function ie(e){let t=new Set;for(let e of s)try{t.add(new URL(e.statusUrl).port)}catch{}let n=`8877`;for(let e=8877;e<9077;e+=1)if(!t.has(String(e))){n=String(e);break}let i=Xb(e,n);if(`error`in i){f(i.error??c(`source.invalid`));return}let a=r({ensureTunnel:!0,hostAlias:i.hostAlias,label:i.label,statusUrl:i.statusUrl});a.error?f(a.error):f(null),O(n)}async function ae(){if(`error`in j){f(j.error??c(`source.invalid`));return}try{await navigator.clipboard.writeText(j.command),S(!0),f(null)}catch{f(c(`source.copyError`))}}return(0,B.jsxs)(`section`,{"aria-label":c(`source.controlPlane`),className:`personal-status-source`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`span`,{children:`Control plane`}),(0,B.jsx)(`button`,{"aria-label":c(`source.addSsh`),onClick:ne,title:c(`source.add`),type:`button`,children:(0,B.jsx)(Vm,{size:14})})]}),(0,B.jsx)(rb,{ariaLabel:c(`source.select`),className:`personal-status-source-select`,icon:(0,B.jsx)(Ym,{size:15}),onChange:e=>{if(e.startsWith(te)){ie(e.slice(11));return}o(e)},options:A,value:e.id}),(0,B.jsxs)(`div`,{className:`personal-status-source-meta`,children:[(0,B.jsxs)(`span`,{className:`is-${t}`,children:[(0,B.jsx)(`i`,{}),c(t===`loading`?`source.connecting`:t===`error`?`source.notAvailable`:`source.connected`)]}),(0,B.jsx)(`small`,{children:e.readOnly?c(`source.readOnly`):c(`source.localInteractive`)}),e.kind===`ssh_tunnel`?(0,B.jsx)(`button`,{"aria-label":c(`source.remove`,{source:e.label}),onClick:()=>a(e.id),title:c(`source.removeCurrent`),type:`button`,children:(0,B.jsx)(rh,{size:12})}):null]}),n?(0,B.jsx)(`p`,{className:`personal-status-source-error`,role:`alert`,children:n}):null,l?(0,B.jsxs)(`div`,{className:`personal-status-source-form`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:c(`source.addSsh`)}),(0,B.jsx)(`button`,{"aria-label":c(`source.closeForm`),onClick:N,type:`button`,children:(0,B.jsx)(oh,{size:13})})]}),(0,B.jsxs)(`div`,{"aria-label":c(`source.addMethod`),className:`personal-status-source-modes`,role:`tablist`,children:[(0,B.jsx)(`button`,{"aria-selected":p===`configured`,onClick:()=>{m(`configured`),f(null)},role:`tab`,type:`button`,children:c(`source.configured`)}),(0,B.jsx)(`button`,{"aria-selected":p===`manual`,onClick:()=>{m(`manual`),f(null)},role:`tab`,type:`button`,children:c(`source.manual`)})]}),p===`configured`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:c(`source.configuredCount`,{count:h.length})}),(0,B.jsxs)(`span`,{className:`personal-status-source-field-row`,children:[(0,B.jsx)(`input`,{"aria-label":c(`source.host`),disabled:y||!h.length,list:`loopx-configured-ssh-hosts`,onChange:e=>{w(e.target.value),S(!1)},placeholder:c(y?`source.loadingHosts`:`source.hostPlaceholder`),value:C}),(0,B.jsx)(`datalist`,{id:`loopx-configured-ssh-hosts`,children:h.map(e=>(0,B.jsx)(`option`,{value:e.alias},e.alias))}),(0,B.jsx)(`button`,{"aria-label":c(`source.refreshHosts`),disabled:y,onClick:()=>void M(),title:c(`source.refreshHosts`),type:`button`,children:(0,B.jsx)(Gm,{size:13})})]})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:c(`source.localPort`)}),(0,B.jsx)(`input`,{"aria-label":c(`source.localPort`),inputMode:`numeric`,onChange:e=>{O(e.target.value),S(!1)},value:D})]}),(0,B.jsxs)(`div`,{className:`personal-status-source-command`,children:[(0,B.jsx)(`code`,{children:`error`in j?c(`source.tunnelCommandPending`):j.command}),(0,B.jsxs)(`button`,{"aria-label":c(`source.copyCommand`),disabled:`error`in j,onClick:()=>void ae(),type:`button`,children:[(0,B.jsx)(mm,{size:12}),c(x?`source.copied`:`source.copy`)]})]}),_?(0,B.jsx)(`p`,{className:`is-error`,children:_}):null,(0,B.jsx)(`p`,{children:c(`source.description`)}),(0,B.jsx)(`button`,{className:`personal-status-source-add`,disabled:`error`in j,onClick:re,type:`button`,children:c(`source.addConfigured`)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:c(`source.name`)}),(0,B.jsx)(`input`,{autoFocus:!0,maxLength:48,onChange:e=>E(e.target.value),placeholder:c(`source.namePlaceholder`),value:T})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:c(`source.statusUrl`)}),(0,B.jsx)(`input`,{onChange:e=>ee(e.target.value),placeholder:`http://127.0.0.1:8876/status.json`,value:k})]}),(0,B.jsx)(`p`,{children:(0,B.jsx)(`code`,{children:`ssh -N -L 8876:127.0.0.1:8766 `})}),(0,B.jsx)(`p`,{children:c(`source.manualDescription`)}),(0,B.jsx)(`button`,{className:`personal-status-source-add`,onClick:P,type:`button`,children:c(`source.addConfigured`)})]}),d?(0,B.jsx)(`p`,{className:`is-error`,role:`alert`,children:d}):null]}):null]})}var nx={需修复:`is-danger`,等你:`is-warning`,等待条件:`is-info`,推进中:`is-success`,安静运行:`is-quiet`,已完成:`is-quiet`,已停止:`is-stopped`};function rx({attentionCount:e,goals:t,goalArchiveLoadState:n={error:null,phase:`ready`},lifecycleBusyGoalIds:r,goalLifecycleOperations:i,onRequestGoalCreate:a,onOpenSettings:o,onRetryGoalArchive:s,onRequestGoalLifecycle:c,onSelectGoal:l,selectedGoalId:u,statusSourceControl:d}){let{locale:f,t:p}=Ji(),[m,h]=(0,z.useState)(!1),g=Wb(t.filter(e=>e.activationState!==`stopped`),d?.activeSource.statusUrl??`/status.json`),_=g.sorted,v=t.filter(e=>e.activationState===`stopped`),y=e=>!!c&&(!i||i.includes(e)),b=(e,t)=>(0,B.jsxs)(`div`,{className:`personal-goal-row${g.target?.id===e.goalId?g.target.after?` is-drop-after`:` is-drop-before`:``}`,"data-reorder-goal":t?void 0:e.goalId,"data-load-error":e.loadError,children:[(0,B.jsxs)(`button`,{...t?{}:g.pointerProps(e.goalId),title:t?void 0:p(`sidebar.dragGoal`),"aria-current":u===e.goalId?`page`:void 0,className:`personal-goal-link`,onClick:()=>l(e.goalId),type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-goal-state-dot ${e.loadState?``:nx[e.state]}`}),(0,B.jsxs)(`span`,{className:`personal-goal-link-copy`,children:[(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsxs)(`small`,{children:[e.loadState&&(!t||u===e.goalId)?p(e.loadState===`error`?`startup.goalError`:`startup.goalLoading`):Yi(e.state,f),e.needsYou&&!t?` · ${p(`home.lane.needsYou`)}`:``]})]}),(0,B.jsx)(cm,{size:15})]}),!t&&m?(0,B.jsxs)(`div`,{className:`personal-goal-move-actions`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":p(`sidebar.moveUp`,{goal:e.title}),disabled:_[0]?.goalId===e.goalId,onClick:()=>g.moveBy(e.goalId,-1),children:(0,B.jsx)(em,{"aria-hidden":`true`,size:13})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":p(`sidebar.moveDown`,{goal:e.title}),disabled:_.at(-1)?.goalId===e.goalId,onClick:()=>g.moveBy(e.goalId,1),children:(0,B.jsx)(Xp,{"aria-hidden":`true`,size:13})})]}):null,c&&y(t?`resume`:`stop`)?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{"aria-label":`${p(t?`sidebar.resume`:`sidebar.stop`)} ${e.title}`,"aria-busy":r?.has(e.goalId)||void 0,className:`personal-goal-lifecycle${r?.has(e.goalId)?` is-pending`:``}`,disabled:r?.has(e.goalId),onClick:()=>c(e,t?`resume`:`stop`),title:p(t?`sidebar.resumeGoal`:`sidebar.stopGoal`),type:`button`,children:r?.has(e.goalId)?(0,B.jsx)(Am,{size:13}):t?(0,B.jsx)(Wm,{size:13}):(0,B.jsx)(zm,{size:13})}),t&&y(`delete`)?(0,B.jsx)(`button`,{"aria-label":`${p(`sidebar.delete`)} ${e.title}`,className:`personal-goal-lifecycle personal-goal-delete`,onClick:()=>c(e,`delete`),title:p(`sidebar.deleteGoal`),type:`button`,children:(0,B.jsx)(rh,{size:13})}):null]}):null]},e.goalId);return(0,B.jsxs)(`div`,{className:`personal-goal-directory`,children:[(0,B.jsxs)(`div`,{className:`personal-sidebar-brand`,children:[(0,B.jsx)(`span`,{className:`personal-brand-mark`,children:(0,B.jsx)(rm,{size:18})}),(0,B.jsx)(`span`,{children:(0,B.jsx)(`strong`,{children:`LoopX`})})]}),d?(0,B.jsx)(tx,{...d}):null,(0,B.jsxs)(`nav`,{"aria-label":p(`home.workspace`),className:`personal-sidebar-nav`,children:[(0,B.jsxs)(`button`,{"aria-current":u===null?`page`:void 0,className:`personal-manager-link`,onClick:()=>l(null),type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-manager-icon`,children:(0,B.jsx)(rm,{size:17})}),(0,B.jsx)(`span`,{children:p(`sidebar.manager`)}),e>0?(0,B.jsx)(`span`,{className:`personal-sidebar-count`,children:e}):null,(0,B.jsx)(cm,{size:15})]}),(0,B.jsxs)(`div`,{className:`personal-sidebar-section-title`,children:[(0,B.jsx)(`span`,{children:`Goals`}),(0,B.jsxs)(`span`,{className:`personal-sidebar-title-actions`,children:[(0,B.jsx)(`small`,{children:_.length}),(0,B.jsx)(`button`,{"aria-label":p(`sidebar.sortGoals`),title:p(`sidebar.sortGoals`),"aria-pressed":m,onClick:()=>h(!m),type:`button`,children:(0,B.jsx)($p,{"aria-hidden":`true`,size:15})}),a?(0,B.jsx)(`button`,{"aria-label":p(`sidebar.createGoal`),onClick:a,type:`button`,children:(0,B.jsx)(Vm,{size:15})}):null]})]}),g.saveFailed?(0,B.jsx)(`p`,{role:`status`,children:p(`sidebar.orderNotSaved`)}):null,(0,B.jsx)(`span`,{className:`personal-sr-only`,role:`status`,children:g.lastMoved?p(`sidebar.goalMoved`,{goal:g.lastMoved.title,position:g.lastMoved.position}):``}),(0,B.jsx)(`div`,{className:`personal-goal-list`,children:_.map(e=>b(e,!1))}),v.length||n.phase===`loading`||n.phase===`error`?(0,B.jsxs)(`details`,{className:`personal-stopped-goals`,open:n.phase===`error`||void 0,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(sm,{size:13}),(0,B.jsx)(`span`,{children:p(`sidebar.stopped`)}),n.phase===`loading`?(0,B.jsx)(Am,{"aria-label":p(`sidebar.stoppedLoading`),className:`is-spinning`,size:13}):(0,B.jsx)(`small`,{children:v.length})]}),(0,B.jsxs)(`div`,{className:`personal-goal-list is-stopped`,children:[n.phase===`error`?(0,B.jsxs)(`div`,{className:`personal-stopped-goal-error`,role:`alert`,children:[(0,B.jsx)(`span`,{children:p(`sidebar.stoppedLoadFailed`)}),s?(0,B.jsx)(`button`,{onClick:s,type:`button`,children:p(`sidebar.retryStopped`)}):null]}):null,v.map(e=>b(e,!0))]})]}):null]}),(0,B.jsxs)(`div`,{className:`personal-sidebar-footer`,children:[(0,B.jsx)(zb,{}),o?(0,B.jsxs)(`button`,{"aria-label":p(`settings.open`),className:`personal-sidebar-utility`,onClick:o,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-sidebar-utility-icon`,children:(0,B.jsx)(Xm,{size:17})}),(0,B.jsx)(`span`,{className:`personal-sidebar-utility-copy`,children:(0,B.jsx)(`strong`,{children:p(`settings.open`)})}),(0,B.jsx)(cm,{"aria-hidden":`true`,size:15})]}):null]})]})}var ix=J({ok:X(!0),total:G().int().nonnegative(),next_cursor:W().nullable(),items:q(J({todo_id:W(),text:W(),claimed_by:W().nullable(),evidence:W().nullable(),priority:W().nullable(),task_class:W().nullable()})).max(40)});function ax({goal:e,agentId:t,seed:n,enabled:r,listView:i=!1,onSelect:a}){let{t:o}=Ji(),s=(0,z.useId)(),[c,l]=(0,z.useState)(!1),u=!i||c,d=i?96:148,[f,p]=(0,z.useState)(n),[m,h]=(0,z.useState)(t===`all`?e.doneTodoCount??n.length:n.length),[g,_]=(0,z.useState)(void 0),[v,y]=(0,z.useState)(!1),[b,x]=(0,z.useState)(!1),[S,C]=(0,z.useState)(!1),[w,T]=(0,z.useState)({top:0,height:600}),[E,D]=(0,z.useState)(null),O=(0,z.useRef)(null),k=(0,z.useRef)(null),[ee,te]=(0,z.useState)(0);(0,z.useEffect)(()=>{let e=O.current;if(!e)return;let t=new ResizeObserver(()=>T({top:e.scrollTop,height:e.clientHeight}));return t.observe(e),()=>{t.disconnect(),k.current?.abort()}},[]);let A=g===void 0||w.top+w.height>=f.length*d-d*2;(0,z.useEffect)(()=>{if(!r||!u||!A||g===null||b||k.current)return;let n=new AbortController;k.current=n,y(!0);let i=new URLSearchParams({goal_id:e.goalId});t!==`all`&&i.set(`agent_id`,t),g&&i.set(`cursor`,g),fetch(`/api/chat/completed-todos?${i}`,{signal:n.signal}).then(async e=>{if(e.status===409&&C(!0),!e.ok)throw Error(`history unavailable`);let t=ix.parse(await e.json());if(n.signal.aborted)return;let r=t.items.map(e=>({todoId:e.todo_id,text:e.text,claimedBy:e.claimed_by,evidence:e.evidence,priority:e.priority,taskClass:e.task_class,done:!0,status:`done`}));p(e=>g===void 0?r:[...e,...r.filter(t=>!e.some(e=>e.todoId===t.todoId))]),h(t.total),_(t.next_cursor)}).catch(()=>{n.signal.aborted||x(!0)}).finally(()=>{n.signal.aborted||(k.current=null,y(!1))})},[r,u,A,g,b,ee,e.goalId,t,v]),(0,z.useEffect)(()=>{O.current&&(O.current.scrollTop=0),T({top:0,height:O.current?.clientHeight??600}),D(null)},[i]);let j=Math.max(0,Math.floor(w.top/d)-3),M=Math.min(f.length,Math.ceil((w.top+w.height)/d)+3),ne=Array.from({length:Math.max(0,M-j)},(e,t)=>j+t);return E!==null&&El(e=>!e),children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,children:c?`▾`:`▸`}),` `,o(`tasks.completed`)]}):(0,B.jsxs)(`strong`,{children:[(0,B.jsx)(`i`,{"aria-hidden":`true`,className:`personal-kanban-dot tone-done`}),o(`tasks.completed`)]}),(0,B.jsx)(`span`,{children:m})]}),(0,B.jsxs)(`div`,{id:s,hidden:!u,"aria-label":o(`tasks.completed`),className:`personal-task-lane-scroll`,ref:O,role:`region`,tabIndex:0,onScroll:e=>T({top:e.currentTarget.scrollTop,height:e.currentTarget.clientHeight}),children:[(0,B.jsx)(`div`,{className:`personal-completed-window`,style:{height:f.length*d},children:ne.map(t=>{let n=f[t];return(0,B.jsx)(`div`,{className:`personal-task-card personal-completed-row`,style:{top:t*d,height:d},children:(0,B.jsxs)(`button`,{type:`button`,onFocus:()=>D(t),onBlur:()=>D(null),onClick:()=>a({kind:`todo`,item:{...n,goalId:e.goalId,goalTitle:e.title,ownerLabel:n.claimedBy??e.agentLabel??e.agentId}}),children:[(0,B.jsx)(`span`,{className:`is-done`,children:`✓`}),(0,B.jsx)(`strong`,{children:n.text}),(0,B.jsx)(`small`,{children:n.claimedBy??e.agentLabel??e.agentId})]})},n.todoId)})}),(0,B.jsx)(`div`,{className:`personal-completed-footer`,role:`status`,children:v?o(`tasks.historyLoading`):b?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{children:o(S?`tasks.historyExpired`:`tasks.historyError`)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{S&&(_(void 0),O.current&&(O.current.scrollTop=0)),C(!1),x(!1),te(e=>e+1)},children:o(`tasks.historyRetry`)})]}):r?g===null?o(`tasks.historyEnd`):(0,B.jsx)(`button`,{type:`button`,onClick:()=>{O.current&&(O.current.scrollTop=f.length*d)},children:o(`tasks.historyMore`)}):o(`tasks.historyLocalOnly`)})]})]})}function ox({children:e,count:t,label:n,tone:r,listView:i=!1}){let a=(0,z.useId)(),o=(0,z.useRef)(null),s=(0,z.useRef)([]),c=(0,z.useRef)(null),[l,u]=(0,z.useState)({after:!1,before:!1}),d=(0,z.useCallback)(()=>{let e=o.current;if(!e)return;let t={after:Math.max(0,e.scrollHeight-e.clientHeight)-e.scrollTop>1,before:e.scrollTop>1};u(e=>e.after===t.after&&e.before===t.before?e:t)},[]);return(0,z.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(d);return c.current=t,t.observe(e),e.addEventListener(`scroll`,d,{passive:!0}),d(),()=>{t.disconnect(),c.current=null,s.current=[],e.removeEventListener(`scroll`,d)}},[i,d]),(0,z.useEffect)(()=>{let e=o.current,t=c.current;if(!e||!t)return;for(let e of s.current)t.unobserve(e);let n=Array.from(e.children).filter(e=>e instanceof HTMLElement);for(let e of n)t.observe(e);s.current=n,d()},[e,t,i,d]),i?!t&&r!==`done`?null:(0,B.jsxs)(`details`,{className:`personal-task-group tone-${r}`,open:!0,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(sm,{size:16}),(0,B.jsx)(`strong`,{children:n}),(0,B.jsx)(`span`,{children:t})]}),(0,B.jsx)(`div`,{className:`personal-task-list-rows`,children:e})]}):(0,B.jsxs)(`section`,{className:`personal-object-list personal-task-lane`,children:[(0,B.jsxs)(`header`,{id:a,children:[(0,B.jsxs)(`strong`,{children:[(0,B.jsx)(`i`,{"aria-hidden":`true`,className:`personal-kanban-dot tone-${r}`}),n]}),(0,B.jsx)(`span`,{children:t})]}),(0,B.jsx)(`div`,{"aria-labelledby":a,className:`personal-task-lane-scroll${l.before?` has-overflow-before`:``}${l.after?` has-overflow-after`:``}`,ref:o,role:`region`,tabIndex:t>0?0:-1,children:e})]})}function sx({historyEnabled:e=!1,goal:t,items:n,onDraftTaskFromMessage:r,onOpenChat:i,onQuickComplete:a,quickCompletingTodoIds:o,onSelect:s,selectedTodoId:c=null,userTodos:l}){let{t:u}=Ji(),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)({goalId:``,laneId:`all`}),h=(0,z.useRef)(null);(0,z.useEffect)(()=>{if(!c)return;let e=window.requestAnimationFrame(()=>h.current?.scrollIntoView({block:`nearest`,inline:`nearest`}));return()=>window.cancelAnimationFrame(e)},[c]);let g=l.filter(e=>e.goalId===t.goalId).map(e=>({...e,goalTitle:t.title})),_=e=>e.priority===`P0`?0:e.priority===`P1`?1:e.priority===`P2`?2:3,v=(0,z.useMemo)(()=>{let e=new Map((t.agentLanes??[]).map(e=>[e.agentId,e]));for(let n of t.agentTodos)n.claimedBy&&!e.has(n.claimedBy)&&e.set(n.claimedBy,{agentId:n.claimedBy,label:n.claimedBy});return[...e.values()]},[t.agentLanes,t.agentTodos]),y=p.goalId===t.goalId&&v.some(e=>e.agentId===p.laneId)?p.laneId:`all`,b=e=>y===`all`||e===y,x=t.agentTodos.filter(e=>e.taskClass!==`continuous_monitor`&&!e.done).filter(e=>b(e.claimedBy)).sort((e,t)=>_(e)-_(t)),S=t.agentTodos.filter(e=>e.taskClass!==`continuous_monitor`&&e.done).filter(e=>b(e.claimedBy)),C=n.filter(e=>e.kind===`schedule`&&b(e.schedule.agentId)),w=n.filter(e=>e.kind===`run`&&!!e.run.todoId&&b(e.run.agentId)),T=!g.length&&!x.length&&!S.length&&!C.length,E=n.filter(e=>e.kind===`message`&&(e.message.role===`user`||e.message.role===`assistant`)),D=E.reduce((e,t,n)=>t.message.role===`user`?n:e,-1),O=D>=0?E[D]?.message:null,k=D>=0?E.slice(D+1).reverse().find(e=>e.message.role===`assistant`)?.message:null,ee=D>=0&&E.slice(D+1).some(e=>e.message.role===`assistant`&&e.message.pending);return(0,B.jsxs)(`section`,{"aria-label":u(`header.tasks`),className:`personal-task-board${d?` is-list-view`:``}`,children:[(0,B.jsxs)(`header`,{className:`personal-task-view-toolbar`,children:[(0,B.jsx)(`div`,{children:(0,B.jsx)(`strong`,{children:u(`header.tasks`)})}),(0,B.jsxs)(`div`,{className:`personal-task-view-switch`,role:`group`,"aria-label":u(`tasks.viewLabel`),children:[(0,B.jsx)(`button`,{type:`button`,"aria-pressed":d,onClick:()=>f(!0),children:u(`tasks.listView`)}),(0,B.jsx)(`button`,{type:`button`,"aria-pressed":!d,onClick:()=>f(!1),children:u(`tasks.boardView`)})]})]}),v.length>1?(0,B.jsxs)(`section`,{"aria-label":u(`tasks.agentLaneFilter`),className:`personal-task-lane-filter`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(rm,{size:15}),(0,B.jsx)(`span`,{children:(0,B.jsx)(`strong`,{children:u(`tasks.agentLane`)})})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{className:`sr-only`,children:u(`tasks.agentLaneFilter`)}),(0,B.jsxs)(`select`,{"aria-label":u(`tasks.agentLaneFilter`),onChange:e=>m({goalId:t.goalId,laneId:e.target.value}),value:y,children:[(0,B.jsx)(`option`,{value:`all`,children:u(`tasks.allAgentLanes`,{count:v.length})}),v.map(e=>(0,B.jsx)(`option`,{value:e.agentId,children:e.label},e.agentId))]}),(0,B.jsx)(sm,{"aria-hidden":!0,size:14})]})]}):null,O?(0,B.jsxs)(`section`,{"aria-label":u(`tasks.chatRecent`),className:`personal-task-chat-receipt`,children:[(0,B.jsx)(`span`,{className:`personal-task-chat-icon`,children:(0,B.jsx)(Pm,{size:18})}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:u(ee?`tasks.chatPending`:k?`tasks.chatAgentReplied`:`tasks.chatRecent`)}),(0,B.jsx)(`small`,{children:t.agentLabel??t.agentId})]}),(0,B.jsxs)(`p`,{className:`is-user`,children:[(0,B.jsx)(`b`,{children:u(`common.you`)}),O.text]}),k&&!k.pending?(0,B.jsxs)(`p`,{className:`is-assistant`,children:[(0,B.jsx)(`b`,{children:u(`common.agent`)}),k.text]}):null,(0,B.jsx)(`small`,{children:u(ee?`tasks.chatPendingDescription`:`tasks.chatUnchangedDescription`)})]}),(0,B.jsxs)(`footer`,{children:[(0,B.jsxs)(`button`,{onClick:i,type:`button`,children:[(0,B.jsx)(Pm,{size:14}),u(`tasks.chatViewReply`)]}),k&&!ee&&r?(0,B.jsxs)(`button`,{onClick:()=>r(k.text),type:`button`,children:[(0,B.jsx)(km,{size:14}),u(`tasks.convertToTask`)]}):null]})]}):null,(0,B.jsxs)(`div`,{className:d?`personal-task-grouped-list`:`personal-task-kanban`,children:[(0,B.jsxs)(ox,{listView:d,count:g.length,label:u(`timeline.waitingConfirmation`),tone:`attention`,children:[g.map(e=>{let t=Zi(e.updatedAt,u);return(0,B.jsxs)(`button`,{onClick:()=>s({item:e,kind:`attention`}),type:`button`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`is-attention`,children:`!`}),(0,B.jsx)(`strong`,{children:e.text}),(0,B.jsxs)(`small`,{children:[(0,B.jsx)(`span`,{className:`personal-row-status ${e.blocking?`is-blocking`:`is-pending`}`,children:e.blocking?u(`tasks.blocked`):u(`tasks.pending`)}),t?(0,B.jsx)(`span`,{className:`personal-task-age`,children:u(`tasks.waitingAge`,{age:t})}):null]})]},e.todoId)}),g.length?null:(0,B.jsx)(`p`,{className:`personal-task-empty`,children:u(`tasks.emptyConfirm`)})]}),(0,B.jsxs)(ox,{listView:d,count:x.length,label:u(`tasks.pendingAndRunning`),tone:`progress`,children:[x.map(e=>{let n={...e,goalId:t.goalId,goalTitle:t.title,ownerLabel:e.claimedBy??t.agentLabel??t.agentId},r=w.find(t=>t.run.todoId===e.todoId)?.run;return(0,B.jsxs)(`div`,{className:`personal-task-card${r?` has-session`:``}${c===e.todoId?` is-selected`:``}`,ref:c===e.todoId?e=>{h.current=e}:void 0,children:[(0,B.jsxs)(`button`,{"aria-pressed":c===e.todoId,onClick:()=>s({item:n,kind:`todo`}),type:`button`,children:[(0,B.jsx)(`span`,{children:`○`}),(0,B.jsx)(`strong`,{children:e.text}),(0,B.jsxs)(`small`,{children:[e.priority?(0,B.jsx)(`span`,{className:`personal-priority-badge is-${e.priority.toLowerCase()}`,children:e.priority}):null,e.status===`blocked`?(0,B.jsx)(`span`,{className:`personal-priority-badge is-blocked`,children:u(`tasks.blocked`)}):null,r?(0,B.jsx)(`span`,{className:`personal-task-session-status`,children:r.status===`running`||r.status===`queued`?u(`runs.running`):r.status===`failed`?u(`tasks.sessionError`):u(`common.waiting`)}):null,e.status===`deferred`?(0,B.jsx)(`span`,{className:`personal-task-session-status`,children:u(`drawer.taskStatusDeferred`)}):r?null:(0,B.jsx)(`span`,{className:`personal-task-session-status`,children:u(`tasks.waiting`)}),e.claimedBy??t.agentLabel??t.agentId]})]}),(0,B.jsxs)(`div`,{className:`personal-task-card-actions`,children:[r?(0,B.jsxs)(`button`,{className:`personal-task-session-link`,"aria-label":u(`tasks.openExecution`,{name:e.text}),onClick:()=>s({item:r,kind:`run`}),title:r.status===`completed`?u(`tasks.viewResult`):u(`tasks.viewExecution`),type:`button`,children:[(0,B.jsx)(vm,{size:14}),(0,B.jsx)(`span`,{children:r.status===`completed`?u(`tasks.viewResult`):u(`tasks.viewExecution`)})]}):null,a?(0,B.jsx)(`button`,{"aria-busy":o?.has(e.todoId)||void 0,"aria-label":u(`tasks.markComplete`,{name:e.text}),disabled:o?.has(e.todoId),onClick:()=>void a(n),title:u(`tasks.completed`),type:`button`,children:o?.has(e.todoId)?(0,B.jsx)(Am,{className:`personal-spin`,size:14}):(0,B.jsx)(om,{size:14})}):null,(0,B.jsx)(`button`,{"aria-label":u(`tasks.moreActions`,{name:e.text}),onClick:()=>s({item:n,kind:`todo`}),title:u(`common.actions`),type:`button`,children:(0,B.jsx)(_m,{size:14})})]})]},e.todoId)}),x.length?null:(0,B.jsx)(`p`,{className:`personal-task-empty`,children:u(`tasks.emptyRunning`)})]}),(0,B.jsxs)(ox,{listView:d,count:C.length,label:u(`tasks.scheduled`),tone:`schedule`,children:[C.map(e=>(0,B.jsxs)(`button`,{onClick:()=>s({item:e.schedule,kind:`schedule`}),type:`button`,children:[(0,B.jsx)(`span`,{children:`◷`}),(0,B.jsx)(`strong`,{children:e.schedule.label}),(0,B.jsx)(`small`,{children:e.schedule.status===`paused`?u(`schedule.paused`):u(`schedule.active`)})]},e.id)),C.length?null:(0,B.jsx)(`p`,{className:`personal-task-empty`,children:u(`tasks.emptySchedules`)})]}),(0,B.jsx)(ax,{goal:t,agentId:y,seed:S,enabled:e,listView:d,onSelect:s},`${t.goalId}:${y}:${e}`)]}),T?(0,B.jsx)(`p`,{className:`personal-task-empty`,children:u(`tasks.emptyGoal`)}):null]})}var cx=yd(W(),q(W())),lx=J({node_id:W().min(1),kind:Y([`deliverable`,`gate`,`gate_summary`,`lease`,`validation`,`repair`,`handoff`,`evidence`]),title:W(),state:Y([`open`,`ready`,`blocked`,`done`,`waiting`,`unknown`]),refs:cx,owner_agent:W().optional(),actor_agent:W().optional(),from_agent:W().optional(),to_agent:W().optional()}),ux=J({edge_id:W().min(1),from_node_id:W(),to_node_id:W(),relation:Y([`depends_on`,`blocks`,`validates`,`repairs`,`audits`,`continues`,`hands_off_to`,`supersedes`]),reason:W(),refs:cx.optional()}),dx=J({schema_version:X(`task_graph_projection_v0`),mode:X(`read_only`),goal_id:W(),generated_at:W().nullable(),truth_contract:J({projection_is_writable:X(!1),write_api:X(!1)}),limits:J({user_gate_node_limit:G().int().nonnegative(),user_gate_open_count:G().int().nonnegative(),user_gate_truncated_count:G().int().nonnegative(),source_truncated:K().optional(),predecessor_truncated:K().optional(),missing_predecessor_count:G().int().nonnegative().optional(),topology_complete:K().optional()}),nodes:q(lx),edges:q(ux)}).superRefine((e,t)=>{let n=new Set(e.nodes.map(e=>e.node_id)),r=new Set(e.edges.map(e=>e.edge_id));(n.size!==e.nodes.length||r.size!==e.edges.length||e.edges.some(e=>!n.has(e.from_node_id)||!n.has(e.to_node_id)))&&t.addIssue({code:`custom`,message:`Graph identities or endpoints are invalid`})}),fx=J({ok:X(!0),goal_id:W(),observed_at:W().datetime({offset:!0}),graph:dx.nullable(),acceptance:ef.nullable()});function px(e,t){let n=fx.parse(e);if(n.goal_id!==t||n.graph&&n.graph.goal_id!==t||n.acceptance&&n.acceptance.goal_id!==t)throw Error(`Review source does not match the selected Goal`);return n}async function mx(e,t){let n=new URLSearchParams({goal_id:e}),r=await fetch(`/api/chat/delivery-review?${n}`,{signal:t,cache:`no-store`});if(!r.ok)throw Error(`Review unavailable (${r.status})`);return px(await r.json(),e)}function hx(e,t,n,r){let i=new Set([r]);for(let t of e.edges)t.from_node_id===r&&i.add(t.to_node_id),t.to_node_id===r&&i.add(t.from_node_id);let a=t.trim().toLocaleLowerCase();return e.nodes.filter(e=>{let t=[e.title,e.owner_agent,e.actor_agent,e.from_agent,e.to_agent,...Object.values(e.refs).flat()].some(e=>e?.toLocaleLowerCase().includes(a)),r=n===`all`||n===`related`&&i.has(e.node_id)||n===`conditions`&&[`gate`,`gate_summary`,`lease`].includes(e.kind)||n===`evidence`&&[`evidence`,`validation`,`repair`,`handoff`].includes(e.kind);return t&&r})}function gx(e){let t=e.limits;return t.topology_complete!==!0||t.source_truncated===!0||t.predecessor_truncated===!0||(t.missing_predecessor_count??0)>0||t.user_gate_truncated_count>0}function _x(e){return[`gate`,`gate_summary`,`lease`].includes(e.kind)?0:e.kind===`deliverable`?1:2}function vx(e,t){let n=e=>String(e??t.unavailable).replace(/[\\`*_{}[\]<>|#]/g,`\\$&`).replace(/[\r\n]+/g,` `),r=[`# ${t.title}`,``,`Goal: ${n(e.goal_id)}`,`${t.observed}: ${n(e.observed_at)}`,``,t.scope,``,t.acceptanceBoundary,``,`## ${t.chain}`,``],i=e.graph;if(!i)r.push(t.noGraph);else{gx(i)&&r.push(t.incomplete,``),r.push("```json",JSON.stringify(i.limits,null,2),"```",``);for(let e of i.nodes)r.push(`- ${n(e.title)} · ${t.kind[e.kind]} · ${t.state[e.state]}${e.owner_agent?` · ${n(e.owner_agent)}`:``}`,` ${t.refs}: ${n(e.node_id)}; ${n(JSON.stringify(e.refs))}`),(e.from_agent||e.to_agent)&&r.push(` ${n(e.from_agent)} → ${n(e.to_agent)}`),e.actor_agent&&r.push(` actor: ${n(e.actor_agent)}`);let e=new Map(i.nodes.map(e=>[e.node_id,e.title]));r.push(``,`## ${t.relations}`,``);for(let a of i.edges)r.push(`- ${n(e.get(a.from_node_id))} → ${t.relation[a.relation]} → ${n(e.get(a.to_node_id))}: ${n(a.reason)} (${n(a.edge_id)})`,` ${t.refs}: ${n(JSON.stringify(a.refs??{}))}`)}r.push(``,`## ${t.acceptance}`,``);let a=e.acceptance;if(!a)r.push(t.unavailable);else{let e=a.coverage===`partial`;r.push(`${t.required}: ${e?a.acceptance_gaps.length:t.unavailable}`,`${t.guards}: ${e?a.guards.length:t.unavailable}`,``);for(let e of a.acceptance_gaps)r.push(`### ${n(e.evidence_required)}`,``,`${t.owner}: ${n(e.owner)}`,`${t.reason}: ${n(e.reason)}`,`${t.observed}: ${n(e.observed_at)}`,`${t.refs}: ${n(e.source)}`),e.resolution_hint&&r.push(n(e.resolution_hint)),e.component_checks&&r.push(`${t.checks}:`,"```json",JSON.stringify(e.component_checks,null,2),"```"),r.push(``);r.push(`### ${t.guards}`,``);for(let e of a.guards)r.push(`- ${n(e.reason)}`,` ${t.owner}: ${n(e.owner)}; ${t.required}: ${n(e.evidence_required)}`,` ${t.refs}: ${n(e.todo_id)}; ${n(e.blocks_agent)}; ${n(e.decision_scope)}`);r.push(``,`### ${t.historical}`,``);for(let e of a.historical_progress)r.push(`- ${n(e.kind)} · ${n(e.observed_at)} · ${n(e.source)} · ${n(e.evidence_refs.join(`, `))}`);r.push(``,`${t.observedScope}: ${n(a.coverage)}; truncated=${a.truncated}`,`${t.missingSources}: ${n(a.missing_sources.join(`, `))}`,`${t.next}: ${n(a.next_action)} (${n(a.next_action_source)})`)}let o=a?.goal_acceptance_contract;if(o?.enabled===!0){let i=t.contract;r.push(``,`## ${i.title}`,``,i.boundary,`${i.source}: ${n(e.goal_id)}`,`${i.revision}: ${o.revision}`,`${i.digest}: ${n(o.digest)}`,``,`### ${i.objective}`,n(o.objective||i.unknown),``,`### ${i.criteria}`),o.non_goals.length&&r.push(`${i.nonGoals}: ${n(o.non_goals.join(`; `))}`),o.criteria.length||r.push(i.noCriteria);for(let e of o.criteria)r.push(`- ${n(e.id)}: ${n(e.description)}`);r.push(``,`### ${i.tasks}`),o.tasks.length||r.push(i.noTasks);for(let e of o.tasks)r.push(`- ${n(e.todo_id)}: ${i.taskState[e.state]}`,` ${i.criteria}: ${n(e.criterion_ids.join(`, `)||i.unknown)}`),e.reason&&r.push(` ${n(e.reason)}`),e.applicable===!1&&r.push(` ${i.notApplicable}`);r.push(``,`### ${i.verification}`,i.verificationState[o.status]),o.held_todo_ids.length&&r.push(`${i.heldTasks}: ${n(o.held_todo_ids.join(`, `))}`),r.push(``,`### ${i.receipt}`);let a=o.verification;if(!a)r.push(i.unknown);else{r.push(i.receiptNote,`${i.operation}: ${n(a.operation_id)}`,`${i.revision}: ${a.contract_revision}`,`${i.digest}: ${n(a.contract_digest)}`,`${i.verificationScope}: ${n(a.todo_id??i.allCriteria)}`);for(let e of a.results)r.push(`- ${n(e.criterion_id)}: ${e.passed?i.passed:i.failed}; ${i.exitCode}: ${e.exit_code??i.unknown}`)}}return r.join(` +`)});continue}let o=e.match(/^\s{0,3}#{1,4}\s+(.*)$/);if(o){i();let t=e.trimStart().match(/^#+/)?.[0].length??1;n.push({type:`heading`,level:t,text:o[1].trim()}),a+=1;continue}if(cb.test(e)||lb.test(e)){i();let r=lb.test(e),o=r?lb:cb,s=[];for(;a{let n=`b${t}`;if(e.type===`code`)return(0,B.jsx)(`pre`,{className:`personal-md-pre`,children:(0,B.jsx)(`code`,{children:e.text})},n);if(e.type===`heading`)return(0,B.jsx)(`p`,{className:`personal-md-heading is-h${e.level}`,children:sb(e.text,n)},n);if(e.type===`list`){let t=e.items.map((e,t)=>(0,B.jsx)(`li`,{children:sb(e,`${n}-${t}`)},`${n}-${t}`));return e.ordered?(0,B.jsx)(`ol`,{className:`personal-md-list`,children:t},n):(0,B.jsx)(`ul`,{className:`personal-md-list`,children:t},n)}return(0,B.jsx)(`p`,{children:e.lines.map((e,t)=>(0,B.jsxs)(z.Fragment,{children:[t>0?(0,B.jsx)(`br`,{}):null,sb(e,`${n}-${t}`)]},`${n}-${t}`))},n)})})}function fb({onSelect:e,output:t}){let{t:n}=Ji(),r=t.kind===`report`?Sm:xm;return(0,B.jsxs)(`button`,{className:`personal-timeline-row personal-output-row`,"data-output-kind":t.kind,"data-testid":`personal-browse-row`,onClick:e,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-row-icon is-output`,children:(0,B.jsx)(r,{size:18})}),(0,B.jsxs)(`span`,{className:`personal-row-copy`,children:[(0,B.jsxs)(`small`,{children:[t.goalTitle??t.goalId,` · `,t.agentLabel??`LoopX`]}),(0,B.jsx)(`strong`,{children:t.title}),t.summary?(0,B.jsx)(`span`,{children:t.summary}):null,t.report?(0,B.jsxs)(`small`,{children:[n(`files.reportDelta`,{added:t.report.addedCount,changed:t.report.changedCount}),` · `,n(`files.verifiedReport`)]}):null]}),t.createdAt?(0,B.jsx)(`time`,{children:t.createdAt}):null,(0,B.jsx)(cm,{size:17})]})}var pb={completed:`runs.completed`,failed:`runs.failed`,interrupted:`runs.interrupted`,queued:`runs.queued`,running:`runs.running`,waiting:`runs.waiting`};function mb({onSelect:e,run:t}){let{t:n}=Ji(),r=t.totalSteps>0?Math.min(100,t.completedSteps/t.totalSteps*100):0;return(0,B.jsxs)(`button`,{"aria-label":`${n(`tasks.viewExecution`)}:${t.title}`,className:`personal-timeline-row personal-run-row`,"data-testid":`personal-browse-row`,onClick:e,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-row-icon is-run`,children:(0,B.jsx)(rm,{size:18})}),(0,B.jsxs)(`span`,{className:`personal-run-identity`,children:[(0,B.jsx)(`small`,{children:t.goalTitle}),(0,B.jsx)(`strong`,{children:t.agentLabel})]}),(0,B.jsxs)(`span`,{className:`personal-row-copy`,children:[(0,B.jsx)(`strong`,{children:t.title}),(0,B.jsx)(`small`,{children:t.latestActivity})]}),(0,B.jsxs)(`span`,{className:`personal-run-progress`,"aria-label":`${t.completedSteps}/${t.totalSteps}`,children:[(0,B.jsxs)(`small`,{children:[t.completedSteps,`/`,t.totalSteps]}),(0,B.jsx)(`i`,{children:(0,B.jsx)(`b`,{style:{width:`${r}%`}})})]}),(0,B.jsxs)(`span`,{className:`personal-row-status is-${t.status}`,children:[t.status===`running`?(0,B.jsx)(Am,{className:`personal-spin`,size:14}):null,n(pb[t.status])]}),t.sessionId?(0,B.jsx)(`span`,{className:`personal-run-open-label`,children:n(`tasks.viewExecution`)}):null,(0,B.jsx)(cm,{size:17})]})}function hb({onSelect:e,schedule:t}){let{t:n}=Ji(),r=t.scheduleKind===`heartbeat`;return(0,B.jsxs)(`button`,{"aria-label":`${r?`Heartbeat`:n(`tasks.scheduled`)}:${t.label};${t.status??`active`}`,className:`personal-schedule-row`,onClick:e,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-schedule-icon`,children:r?(0,B.jsx)(Hm,{size:17}):(0,B.jsx)(am,{size:17})}),(0,B.jsxs)(`span`,{className:`personal-schedule-copy`,children:[(0,B.jsx)(`small`,{children:n(r?`schedule.heartbeat`:`schedule.monitor`)}),(0,B.jsx)(`strong`,{children:t.label}),(0,B.jsx)(`p`,{children:t.schedule??n(`schedule.summary`)})]}),(0,B.jsx)(`span`,{className:`personal-schedule-status is-${t.status??`active`}`,children:t.status===`paused`?n(`schedule.paused`):n(`schedule.active`)}),(0,B.jsx)(cm,{size:16})]})}function gb({delivery:e}){let{t}=Ji();if(!e)return null;let n=e.status===`delivered`?e.verification===`reconciled_after_restart`?t(`returnDelivery.reconciled`):t(`returnDelivery.delivered`):e.status===`verification_required`?t(`returnDelivery.verifying`):e.status===`explicit_unverified`?t(`returnDelivery.unverified`):t(`returnDelivery.queued`),r=e.status===`delivered`?`delivered`:e.status===`verification_required`?`verification_required`:e.status===`explicit_unverified`?`explicit_unverified`:`queued`;return(0,B.jsx)(`small`,{className:`personal-return-delivery is-${r}`,role:`status`,children:n})}function _b({items:e,onSelect:t,selectedGoal:n}){let{t:r}=Ji();if(e.length===0)return(0,B.jsxs)(`div`,{className:`personal-timeline-empty`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)($m,{size:20})}),(0,B.jsx)(`strong`,{children:r(n?`timeline.emptyGoal`:`timeline.emptyWorkspace`)}),(0,B.jsx)(`p`,{children:r(n?`timeline.emptyGoalDescription`:`timeline.emptyWorkspaceDescription`)})]});let i=[...e].reverse().find(e=>e.kind===`message`&&e.message.role!==`user`||e.kind===`proposal`&&[`applied`,`stale`,`error`,`gated`].includes(e.proposal.status)||e.kind===`run`&&e.run.status===`completed`),a=i?.kind===`message`?`${i.message.agentLabel??r(`header.manager`)}:${i.message.pending?r(`timeline.pending`):i.message.text}`:i?.kind===`proposal`?`${i.proposal.title}:${i.proposal.status}`:i?.kind===`run`?r(`timeline.runCompleted`,{run:i.run.title}):``,o=e.filter(e=>e.kind===`proposal`&&e.proposal.status===`gated`),s=e.filter(e=>e.kind!==`proposal`),c=e.filter(e=>e.kind===`proposal`&&e.proposal.status!==`gated`);function l(e){return e.kind===`attention`?(0,B.jsx)(ab,{attention:e.attention,onSelect:()=>t({item:e.attention,kind:`attention`})},e.id):e.kind===`run`?(0,B.jsx)(mb,{onSelect:()=>t({item:e.run,kind:`run`}),run:e.run},e.id):e.kind===`output`?(0,B.jsx)(fb,{onSelect:()=>t({item:e.output,kind:`output`}),output:e.output},e.id):e.kind===`schedule`?(0,B.jsx)(hb,{onSelect:()=>t({item:e.schedule,kind:`schedule`}),schedule:e.schedule},e.id):e.kind===`proposal`?(0,B.jsxs)(`button`,{className:`personal-proposal-row is-${e.proposal.status}`,onClick:()=>t({item:e.proposal,kind:`proposal`}),type:`button`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)($m,{size:17})}),(0,B.jsxs)(`span`,{children:[(0,B.jsxs)(`small`,{children:[e.proposal.actionKind,` · `,e.proposal.status]}),(0,B.jsx)(`strong`,{children:e.proposal.title}),(0,B.jsx)(`p`,{children:e.proposal.impact})]}),(0,B.jsx)(`b`,{children:e.proposal.status===`gated`&&e.proposal.actionKind!==`operation.execute`?r(`timeline.review`):e.proposal.primaryLabel??r(`timeline.reviewAndConfirm`)})]},e.id):(0,B.jsxs)(`article`,{className:`personal-message is-${e.message.role}`,children:[e.message.role===`user`?null:(0,B.jsx)(`span`,{className:`personal-message-avatar`,children:(0,B.jsx)(rm,{size:17})}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:e.message.role===`user`?r(`common.you`):e.message.agentLabel??r(`header.manager`)}),e.message.time?(0,B.jsx)(`time`,{children:e.message.time}):null]}),e.message.attachments?.length?(0,B.jsx)(`div`,{className:`personal-message-images`,children:e.message.attachments.map(e=>(0,B.jsx)(`img`,{alt:e.name,src:e.dataUrl},e.id))}):null,e.message.role===`user`?(0,B.jsx)(`p`,{children:e.message.text}):(0,B.jsx)(db,{text:e.message.text}),e.message.pending?(0,B.jsx)(`span`,{className:`personal-message-pending`,children:r(`timeline.pending`)}):null,(0,B.jsx)(Ey,{request:e.message.collaboration}),(0,B.jsx)(gb,{delivery:e.message.returnDelivery})]})]},e.id)}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{"aria-atomic":`true`,"aria-live":`polite`,className:`personal-live-region`,role:`status`,children:a}),(0,B.jsxs)(`div`,{className:`personal-channel-timeline`,children:[s.map(l),o.length?(0,B.jsxs)(`details`,{className:`personal-gated-summary`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{children:(0,B.jsx)($m,{size:16})}),(0,B.jsx)(`strong`,{children:r(`timeline.waitingConfirmation`)}),(0,B.jsx)(`small`,{children:r(`timeline.gateHistory`,{count:o.length})})]}),(0,B.jsx)(`div`,{children:o.map(l)})]}):null,c.map(l)]})]})}function vb({goal:e}){let{t,locale:n}=Ji(),r=n===`zh-CN`?{checkpoint_satisfied:`检查点满足`,checkpoint_fresh:`检查点有效`,path_outcome_valid:`路径决策有效`,evidence_refs_present:`证据引用齐全`,final_outcome_claim_present:`最终成果声明齐全`,no_reported_outcome_gap:`无已报告成果缺口`}:{checkpoint_satisfied:`Checkpoint satisfied`,checkpoint_fresh:`Checkpoint current`,path_outcome_valid:`Valid path decision`,evidence_refs_present:`Evidence refs present`,final_outcome_claim_present:`Final outcome claim present`,no_reported_outcome_gap:`No reported outcome gap`},i={connected:t(`acceptance.connected`),mapped:t(`acceptance.mapped`),refreshed:t(`acceptance.refreshed`),adapter_inspected:t(`acceptance.inspected`),run_recorded:t(`acceptance.recorded`),reward_judged:t(`acceptance.judged`),operator_approved:t(`acceptance.approved`),controller_ready:t(`acceptance.ready`),attention_queue:t(`acceptance.attentionSource`),agent_vision:t(`acceptance.visionSource`),todo_projection:t(`acceptance.todoSource`),current_run:t(`acceptance.runSource`)},a=e=>i[e]??t(`acceptance.unknown`),o=e.acceptanceObservation,s=e.loadState||!o||o.goal_id!==e.goalId||o.coverage===`unavailable`;return(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-acceptance`,"aria-label":t(`acceptance.title`),children:[(0,B.jsxs)(`div`,{className:`personal-detail-card-title`,children:[(0,B.jsx)(`h3`,{children:t(`acceptance.title`)}),(0,B.jsx)(`em`,{children:t(`common.readOnly`)})]}),(0,B.jsx)(`p`,{role:`status`,children:t(s?`acceptance.unavailable`:`acceptance.partial`)}),!s&&o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:t(`acceptance.gaps`)}),o.acceptance_gaps.length?o.acceptance_gaps.map((e,i)=>(0,B.jsxs)(`div`,{className:`personal-acceptance-observation`,children:[(0,B.jsx)(`p`,{children:e.reason??t(`acceptance.reasonUnknown`)}),e.resolution_hint?(0,B.jsx)(`p`,{children:e.resolution_hint}):null,e.component_checks?(0,B.jsx)(`div`,{children:Object.entries(e.component_checks).map(([e,t])=>(0,B.jsxs)(`p`,{children:[r[e],`: `,n===`zh-CN`?t?`通过`:`未通过`:t?`Passed`:`Failed`]},e))}):null,(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`common.owner`)}),(0,B.jsx)(`dd`,{children:e.owner??t(`acceptance.unknown`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`acceptance.required`)}),(0,B.jsx)(`dd`,{children:e.evidence_required??t(`acceptance.unknown`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`acceptance.observed`)}),(0,B.jsx)(`dd`,{children:e.observed_at??t(`acceptance.unknown`)})]})]})]},`${e.kind}:${e.owner}:${i}`)):(0,B.jsx)(`p`,{children:t(`acceptance.noGaps`)}),(0,B.jsx)(`h4`,{children:t(`acceptance.guards`)}),o.guards.length?o.guards.map((e,n)=>(0,B.jsxs)(`div`,{className:`personal-acceptance-observation`,children:[(0,B.jsx)(`p`,{children:e.reason??t(`acceptance.reasonUnknown`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`common.owner`)}),(0,B.jsx)(`dd`,{children:e.owner??t(`acceptance.unknown`)})]}),e.blocks_agent?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`common.agent`)}),(0,B.jsx)(`dd`,{children:e.blocks_agent})]}):null,e.todo_id?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`common.task`)}),(0,B.jsx)(`dd`,{children:e.todo_id})]}):null,(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`acceptance.required`)}),(0,B.jsx)(`dd`,{children:e.evidence_required??t(`acceptance.unknown`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`acceptance.scope`)}),(0,B.jsx)(`dd`,{children:e.decision_scope??t(`acceptance.unknown`)})]})]})]},`${e.todo_id}:${n}`)):(0,B.jsx)(`p`,{children:t(`acceptance.noGuards`)}),(0,B.jsx)(`h4`,{children:t(`acceptance.next`)}),(0,B.jsx)(`p`,{children:o.next_action??t(`acceptance.unknown`)}),(0,B.jsxs)(`details`,{children:[(0,B.jsxs)(`summary`,{children:[t(`acceptance.historical_progress`),` · `,o.historical_progress.length]}),(0,B.jsx)(`p`,{children:t(`acceptance.historical`)}),o.historical_progress.map(e=>(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`strong`,{children:a(e.kind)}),` · `,e.observed_at??t(`acceptance.unknown`),` `,e.evidence_refs.join(`, `)]},e.kind))]}),o.missing_sources.length?(0,B.jsxs)(`p`,{children:[t(`acceptance.missing`),` `,o.missing_sources.map(a).join(`, `)]}):null,o.truncated?(0,B.jsx)(`p`,{children:t(`acceptance.truncated`)}):null]}):null]})}function yb({item:e,successor:t,onSelect:n}){let{t:r}=Ji(),i=e.details;return(0,B.jsxs)(`section`,{className:`personal-detail-card`,"aria-label":r(`attentionDetail.title`),children:[(0,B.jsx)(`h3`,{children:r(`attentionDetail.title`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`attentionDetail.request`)}),(0,B.jsx)(`dd`,{children:r(i?.interaction===`decision`?`attentionDetail.decision`:`attentionDetail.unknownRequest`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`common.status`)}),(0,B.jsx)(`dd`,{children:r(`attentionDetail.${i?.lifecycle??`unknown`}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`drawer.reason`)}),(0,B.jsx)(`dd`,{children:i?.reason??e.explanation??r(`attentionDetail.unknownReason`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Todo`}),(0,B.jsx)(`dd`,{children:e.todoId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`attentionDetail.targetTodo`)}),(0,B.jsx)(`dd`,{children:i?.unblocksTodoId??r(`attentionDetail.notProvided`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`attentionDetail.targetAgent`)}),(0,B.jsx)(`dd`,{children:i?.blocksAgent??r(`attentionDetail.notProvided`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`attentionDetail.scope`)}),(0,B.jsx)(`dd`,{children:i?.decisionScope?`${i.decisionScope.kind} · ${i.decisionScope.granularity} · ${i.decisionScope.scopeKey}`:r(`attentionDetail.notProvided`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`drawer.evidence`)}),(0,B.jsx)(`dd`,{children:i?.evidence??e.evidence??r(`drawer.decisionDefaultEvidence`)})]})]}),i?.supersededBy?(0,B.jsxs)(`p`,{children:[r(`attentionDetail.replacement`),`: `,i.supersededBy]}):null,t&&n?(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>n(t),type:`button`,children:r(`attentionDetail.openReplacement`)}):null,(0,B.jsx)(`p`,{children:r(`attentionDetail.boundary`)})]})}function bb({proposal:e,t}){let n=e.teamPlanOutcome?.kind===`already_present`;return(0,B.jsxs)(`section`,{className:`personal-proposal-card personal-team-plan-result`,children:[(0,B.jsx)(`h3`,{children:qy(e.teamPlanOutcome??null,t)}),(0,B.jsxs)(`dl`,{className:`personal-team-plan-assignments`,children:[e.teamPlanAssignments?.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.agentId||e.laneId}),(0,B.jsx)(`dd`,{children:e.task})]},e.laneId)),e.teamPlanGapLanes?.map(e=>(0,B.jsxs)(`div`,{className:`is-pending`,children:[(0,B.jsx)(`dt`,{children:e.agentId||e.laneId}),(0,B.jsxs)(`dd`,{children:[e.task||e.laneId,(0,B.jsx)(`br`,{}),(0,B.jsxs)(`small`,{children:[t(`proposal.teamPlan.pending`),` · `,Gy(e.reasonCode,t)]})]})]},e.laneId))]}),(0,B.jsx)(`p`,{children:t(n?`proposal.teamPlan.recoveredHint`:`proposal.teamPlan.assignedHint`)}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:t(`proposal.teamPlan.originalPlan`)}),(0,B.jsx)(`dl`,{children:e.fields.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.label}),(0,B.jsx)(`dd`,{children:e.value})]},e.key))})]})]})}function xb(e){return e.replace(/\s+/gu,` `).trim()}function Sb(e,t){let n=RegExp(`(?:不要|不需要|无需|禁止|别|暂不|do not\\b|don't\\b|without\\b).{0,10}(?:${t.source})`,`iu`),r=RegExp(`(?:${t.source}).{0,10}(?:不要|不需要|无需|禁止|关闭)`,`iu`),i=RegExp(`disable\\b.{0,10}(?:${t.source})|(?:turn|switch|set)\\b.{0,10}(?:${t.source}).{0,10}\\boff\\b|(?:${t.source})\\s+(?:is\\s+)?disabled\\b`,`iu`);return n.test(e)||r.test(e)||i.test(e)}function Cb(e){return/(我现在该做什么|下一步|哪些\s*Goal\s*在等我|需要我|谁在等我|Agent\s*在做什么|当前进度|总结(?:今天)?进展)/iu.test(e)}function wb(e){let t=/(怎么|如何|为什么|给.*建议|分析一下|解释|只读)/u.test(e),n=/(解决一下|修复一下|处理一下|执行一下|改一下|跑(?:一下)?测试|rebase|push|提交|推送)/iu.test(e);return!t&&n&&/(帮我|请|给我|直接|现在|开始|bytedcli|codebase|git|rebase|push|提交|推送)/iu.test(e)}function Tb(e){return xb(e).toLowerCase().match(/(?:^|[\s,,;;:((:]|到|至)(?todo_done:todo_[a-z0-9_-]{3,64}|pr_merged:(?:(?:[a-z0-9_.-]{1,80})\/(?:[a-z0-9_.-]{1,100}))?#[1-9][0-9]{0,8}|capacity_available:[a-z][a-z0-9_:-]{0,63}|resume_at:[1-9][0-9]{3}-[0-9]{2}-[0-9]{2}t[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,3})?(?:z|[+-][0-9]{2}:[0-9]{2}))(?=$|[\s,,。;;))])/iu)?.groups?.condition??null}function Eb(e,t){let n=xb(e),r=[],i=t.agents.find(e=>{let t=n.toLowerCase();return t.includes(e.agentId.toLowerCase())||t.includes(e.label.toLowerCase())}),a=t.todos.find(e=>n.includes(e.todoId)||n.includes(e.text)),o=/(刚刚|已经|已)(?:经)?\s*(新增|创建|添加)(?:的)?\s*(todo|待办|任务)/iu.test(n),s=!!t.goalId&&!Sb(n,/heartbeat|心跳/iu)&&/(heartbeat|心跳|每天推进|持续推进|daily progress)/iu.test(n);if(!t.goalId&&!Sb(n,/goal|目标/iu)&&/(创建|新建|设置|create|start|set up).{0,24}(goal|目标)/iu.test(n)&&r.push({actionKind:`goal.create`,confidence:.97,normalizedParameters:{heartbeat_enabled:!Sb(n,/heartbeat|心跳/iu)&&/(heartbeat|心跳|每天推进|持续推进|daily progress)/iu.test(n)}}),t.goalId&&s&&r.push({actionKind:`heartbeat.bind`,confidence:.96,normalizedParameters:{goal_id:t.goalId}}),t.goalId&&!s&&!Sb(n,/定时|监控|监测|持续观察|scheduled check|monitor/iu)&&/(定时|监控|监测|每.{0,8}(分钟|小时|天)|持续观察|scheduled check|monitor|every.{0,12}(minute|hour|day)|daily)/iu.test(n)&&r.push({actionKind:`monitor.create`,confidence:.94,normalizedParameters:{goal_id:t.goalId}}),t.goalId&&i&&!Sb(n,/绑定|负责|接管|管理/iu)&&/((让|交给).{0,20}(管理|负责|接管).{0,8}(goal|目标)|(绑定).{0,12}(goal|目标)|(goal|目标).{0,12}(交给|绑定|负责|接管))/iu.test(n)&&r.push({actionKind:`agent.bind`,confidence:.96,normalizedParameters:{agent_id:i.agentId,goal_id:t.goalId}}),t.goalId&&!o&&!Sb(n,RegExp(`todo|待办|任务`,`iu`))&&/(创建|新建|新增|添加|加一个|记一个).{0,16}(todo|待办|任务)|(todo|待办|任务).{0,12}(创建|新建|新增|添加)|(?:create|add)(?:\s+(?:a|an|new))?\s+(?:todo|task)|(?:todo|task).{0,12}(?:create|add)/iu.test(n)&&r.push({actionKind:`todo.create`,confidence:.94,normalizedParameters:{goal_id:t.goalId}}),t.goalId&&wb(n)&&r.push({actionKind:`todo.create`,confidence:.9,normalizedParameters:{goal_id:t.goalId,start_execution:!0}}),t.goalId&&a){let e=!Sb(n,/完成|做完|关闭/u)&&/完成|做完|关闭/u.test(n)?`complete`:!Sb(n,/阻塞|卡住/u)&&/阻塞|卡住/u.test(n)?`block`:!Sb(n,/暂缓|稍后|推迟/u)&&/暂缓|稍后|推迟/u.test(n)?`defer`:i&&!Sb(n,/交给|分配给|改派/u)&&/交给|分配给|改派/u.test(n)?`reassign`:null;if(e){let i=e===`defer`?Tb(n):null;if(e===`defer`&&!i)return{actionKind:`todo.update`,confidence:.97,missingFields:[`resume_when`],normalizedParameters:{goal_id:t.goalId,operation:e,todo_id:a.todoId},route:`clarify`};r.push({actionKind:`todo.update`,confidence:.97,normalizedParameters:{goal_id:t.goalId,operation:e,...i?{resume_when:i}:{},todo_id:a.todoId}})}}let c=[...new Map(r.map(e=>[e.actionKind,e])).values()];return c.length>1?{actionKind:null,confidence:.4,missingFields:[`single_intent`],normalizedParameters:{},route:`clarify`}:c.length===1?{...c[0],missingFields:[],route:`typed_action`}:!t.goalId&&Cb(n)?{actionKind:null,confidence:.98,missingFields:[],normalizedParameters:{},route:`projection`}:{actionKind:null,confidence:.75,missingFields:[],normalizedParameters:{},route:`agent_chat`}}function Db(e,t,n){if(!e)return{};if(!t.trim())return{modelConfig:null};let r={model:t.trim()};return n&&(r.reasoning_effort=n),{modelConfig:r}}var Ob=[`a[href]`,`button:not([disabled])`,`textarea:not([disabled])`,`select:not([disabled])`,`input:not([disabled])`,`[tabindex]:not([tabindex='-1'])`].join(`,`),kb=[{key:`drawer.taskBlock`,operation:`block`},{key:`drawer.taskSuccessor`,operation:`successor_create`}],Ab=[{key:`drawer.decisionReject`,resolution:`reject`},{key:`drawer.decisionDefer`,resolution:`defer`}],jb=Array.from({length:32},(e,t)=>t+1),Mb=/^[a-z][a-z0-9_.-]{0,63}$/u;function Nb(e){let t=String(e??``).trim().toLowerCase();return Mb.test(t)?t:null}function Pb(e,t){return e.enabled===t.enabled&&e.maxChildren===t.maxChildren&&JSON.stringify(e.modelConfig??null)===JSON.stringify(t.modelConfig??null)&&[...e.allowedDomains].sort((e,t)=>e.localeCompare(t)).join(`\0`)===[...t.allowedDomains].sort((e,t)=>e.localeCompare(t)).join(`\0`)}function Fb({agents:e,attentionHistory:t=[],onSelectAttention:n,callbacks:r,goalNotifications:i=[],goals:a=[],inspectorExpanded:o=!1,larkConnections:s=[],onClose:c,onToggleInspectorSize:l,readOnly:u=!1,runs:d=[],selection:f}){let{locale:p,t:m}=Ji(),[h,g]=(0,z.useState)(``),[_,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)(`idle`),[x,S]=(0,z.useState)(`record`),[C,w]=(0,z.useState)([]),[T,E]=(0,z.useState)(null),[D,O]=(0,z.useState)(2),[k,ee]=(0,z.useState)(``),[te,A]=(0,z.useState)(``),[j,M]=(0,z.useState)(`idle`),[ne,N]=(0,z.useState)(null),[P,re]=(0,z.useState)(null),ie=(0,z.useRef)(null),ae=(0,z.useRef)(null),[F,oe]=(0,z.useState)(e.find(e=>e.available)?.agentId??`codex`),[I,se]=(0,z.useState)(``),L=(0,z.useRef)(null),ce=(0,z.useRef)(null),le=(0,z.useRef)(null),ue=(0,z.useRef)(null),de=f.kind===`run`?`run:${f.item.runId}`:f.kind===`proposal`?`proposal:${f.item.previewId}`:f.kind===`todo`?`todo:${f.item.todoId}`:f.kind===`attention`?`attention:${f.item.todoId}`:f.kind===`output`?`output:${f.item.outputId}`:f.kind===`schedule`?`schedule:${f.item.scheduleId}`:`goal:${f.item.goalId}`;(0,z.useEffect)(()=>{b(`idle`),v(!1),S(`record`),se(``);let e=f.kind===`goal`?f.item.subagentExecution:void 0;w(e?.allowedDomains??[]),ee(e?.modelConfig?.model??``),A(e?.modelConfig?.reasoning_effort??``),O(e?.maxChildren?Math.min(e.maxChildren,32):2),E(null),M(`idle`),N(null),re(null),ie.current=e??null,ae.current=null},[de]);let fe=f.kind===`goal`?f.item.subagentExecution:void 0;(0,z.useEffect)(()=>{let e=ie.current,t=fe?!e||!Pb(e,fe):e!==null;if(ie.current=fe??null,!P){t&&fe&&(w(fe.allowedDomains),ee(fe.modelConfig?.model??``),A(fe.modelConfig?.reasoning_effort??``),O(fe.maxChildren||2),E(null),M(`idle`),N(null));return}let n=ae.current;(!fe||Pb(P,fe)||n&&!Pb(n,fe))&&(fe&&(w(fe.allowedDomains),ee(fe.modelConfig?.model??``),A(fe.modelConfig?.reasoning_effort??``),O(fe.maxChildren||2)),ae.current=null,re(null))},[fe,P]),(0,z.useEffect)(()=>{let e=document.activeElement;e instanceof HTMLElement&&!ce.current?.contains(e)&&(le.current=e);let t=window.requestAnimationFrame(()=>ue.current?.focus());return()=>window.cancelAnimationFrame(t)},[de]);let pe=(0,z.useCallback)(()=>{let e=le.current;c(),window.requestAnimationFrame(()=>e?.focus())},[c]);(0,z.useEffect)(()=>{function e(e){if(e.key===`Escape`){e.preventDefault(),pe();return}if(e.key===`Tab`&&f.kind!==`todo`){let t=Array.from(ce.current?.querySelectorAll(Ob)??[]).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`);if(t.length===0)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())}}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[pe,f.kind]);let me=f.kind===`attention`?m(`drawer.titleAttention`):f.kind===`todo`?m(`drawer.taskDetails`):f.kind===`run`?m(`drawer.runDetails`):f.kind===`output`?m(`drawer.titleOutput`):f.kind===`proposal`&&f.item.actionKind===`team.plan`&&f.item.status===`applied`?m(`proposal.teamPlan.resultTitle`):f.kind===`proposal`?m(f.item.reviewPlan?.retryOriginal?`drawer.recoverEditResult`:f.item.status===`applied`?`drawer.titleProposalApplied`:`drawer.titleProposalConfirm`):f.kind===`schedule`?f.item.scheduleKind===`heartbeat`?`Heartbeat`:m(`drawer.titleSchedule`):m(`drawer.goalDetails`),he=f.kind===`proposal`?f.item.goalId??`manager`:f.item.goalId,ge=f.kind===`attention`?f.item.goalTitle??m(`drawer.currentGoal`):f.kind===`todo`||f.kind===`run`?f.item.goalTitle:f.kind===`output`?f.item.goalTitle??m(`drawer.currentGoal`):f.kind===`goal`?f.item.title:f.kind===`schedule`?m(`drawer.goalAutoRun`):f.kind===`proposal`&&f.item.status===`applied`&&f.item.actionKind===`team.plan`?f.item.goalId??m(`drawer.currentGoal`):f.item.goalId?m(`drawer.goalChanges`):m(`drawer.managerChanges`),_e=f.kind===`goal`?d.find(e=>e.goalId===f.item.goalId&&!!e.sessionId)??d.find(e=>e.goalId===f.item.goalId):null,ve=f.kind===`run`&&(f.item.completedSteps>0||!!f.item.latestActivity||!!f.item.outputs?.length),ye=f.kind===`attention`?Zi(f.item.updatedAt,m):null,be=Tb(I);async function xe(){f.kind!==`run`||!h.trim()||(await r.onCorrectRun?.(f.item,h.trim()),g(``))}async function Se(e,t,n,i){if(t===`successor_create`){await r.onPreviewAction?.({actionKind:`todo.create`,context:{goal_id:e.goalId,kind:`todo`,todo_id:e.todoId},idempotencyKey:`workspace-todo-successor-${e.todoId}-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e.goalId,text:m(`drawer.taskSuccessorText`,{task:e.text})},summary:m(`drawer.taskSuccessorSummary`,{task:e.text})});return}await r.onPreviewAction?.({actionKind:`todo.update`,context:{goal_id:e.goalId,kind:`todo`,todo_id:e.todoId},idempotencyKey:`workspace-todo-${e.todoId}-${t}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:e.claimedBy??F,goal_id:e.goalId,operation:t,...t===`block`?{note:m(`drawer.taskSuccessorNote`)}:{},...t===`defer`&&i?{resume_when:i}:{},todo_id:e.todoId},summary:`${n}:${e.text}`})}async function Ce(e,t,n){u||!Xd(e)||await r.onPreviewAction?.({actionKind:`gate.resolve`,context:{goal_id:e.goalId,kind:`todo`,todo_id:e.todoId},idempotencyKey:`workspace-decision-${e.todoId}-${t}-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e.goalId,decision:t,todo_id:e.todoId},summary:`${n}:${e.text}`})}let we=f.kind===`goal`?P??f.item.subagentExecution??{allowedDomains:[],domainCandidates:[],enabled:!1,maxChildren:0}:{allowedDomains:[],domainCandidates:[],enabled:!1,maxChildren:0},Te=j===`previewing`||j===`applying`,Ee=(()=>{if(f.kind!==`goal`)return[];let e=new Map;for(let t of we.allowedDomains){let n=Nb(t);n&&e.set(n,{matchingTodoCount:0,value:n})}if(we.domainCandidates)for(let t of we.domainCandidates){let n=Nb(t.domain);if(!n)continue;let r=e.get(n);e.set(n,{matchingTodoCount:(r?.matchingTodoCount??0)+t.matchingTodoCount,value:n})}else for(let t of f.item.agentTodos){if(t.done||t.taskClass!==`advancement_task`)continue;let n=Nb(t.taskDomain);if(!n)continue;let r=e.get(n);e.set(n,{matchingTodoCount:(r?.matchingTodoCount??0)+1,value:n})}return[...e.values()]})();function De(){w(we.allowedDomains),ee(we.modelConfig?.model??``),A(we.modelConfig?.reasoning_effort??``),O(we.maxChildren||2),E(null),M(`idle`),N(null)}function Oe(){let e=[...new Set(C.map(e=>Nb(e)))];return e.every(e=>!!e)?e:null}function ke(e,t){w(n=>t?[...n,e].filter((e,t,n)=>n.indexOf(e)===t):n.filter(t=>t!==e)),N(null),M(`idle`),E(null)}async function Ae(e,t=e){if(f.kind!==`goal`||!r.onPreviewGoalSubagentConfiguration)return;let n=e?Oe():[];if(t&&!k.trim()&&te){M(`error`),E(m(`drawer.subagentModelRequired`));return}if(e&&!n){M(`error`),E(m(`drawer.subagentDomainInvalid`)),N(null);return}let i={allowedDomains:n??[],enabled:e,goalId:f.item.goalId,maxChildren:e?D:0,...Db(t,k,te)};M(`previewing`),E(m(`drawer.subagentPreviewing`)),N(null);try{let e=await r.onPreviewGoalSubagentConfiguration(i);if(!e.changed){ae.current=fe??null,re({...e.configuration,domainCandidates:we.domainCandidates}),w(e.configuration.allowedDomains),ee(e.configuration.modelConfig?.model??``),A(e.configuration.modelConfig?.reasoning_effort??``),O(e.configuration.maxChildren||2),M(`success`),E(m(`drawer.subagentNoChange`));return}N({...i,changed:e.changed,previewId:e.previewId}),M(`ready`),E(m(`drawer.subagentPreviewReady`))}catch(e){M(`error`),E(e instanceof Error?e.message:m(`drawer.subagentPreviewFailed`))}}async function je(){if(!(!ne||!r.onApplyGoalSubagentConfiguration)){M(`applying`),E(m(`drawer.subagentApplying`));try{let e=await r.onApplyGoalSubagentConfiguration({allowedDomains:ne.allowedDomains,enabled:ne.enabled,goalId:ne.goalId,maxChildren:ne.maxChildren,modelConfig:ne.modelConfig,previewId:ne.previewId});ae.current=fe??null,re({...e,domainCandidates:we.domainCandidates}),w(e.allowedDomains),ee(e.modelConfig?.model??``),A(e.modelConfig?.reasoning_effort??``),O(e.maxChildren||2),M(`success`),E(m(`drawer.subagentApplied`)),N(null);try{await r.onRefresh?.()}catch{M(`warning`),E(m(`drawer.subagentAppliedRefreshFailed`))}}catch(e){M(`error`),E(e instanceof Error?e.message:m(`drawer.subagentApplyFailed`))}}}return(0,B.jsxs)(`div`,{"aria-labelledby":`personal-drawer-title`,"aria-modal":f.kind===`todo`?void 0:`true`,className:`personal-context-drawer`,"data-context-kind":f.kind,ref:ce,role:`dialog`,children:[(0,B.jsxs)(`header`,{className:`personal-drawer-header${f.kind===`todo`?` is-task-inspector`:``}`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{id:`personal-drawer-title`,ref:ue,tabIndex:-1,children:me}),(0,B.jsx)(`p`,{children:ge})]}),(0,B.jsxs)(`div`,{className:`personal-drawer-header-actions`,children:[f.kind===`todo`&&l?(0,B.jsx)(`button`,{"aria-label":m(o?`drawer.inspectorHalf`:`drawer.inspectorFull`),className:`personal-icon-button personal-inspector-size`,onClick:l,title:m(o?`drawer.inspectorHalfView`:`drawer.inspectorFullView`),type:`button`,children:o?(0,B.jsx)(Fm,{size:17}):(0,B.jsx)(jm,{size:17})}):null,(0,B.jsxs)(`button`,{"aria-label":m(`drawer.closeDetail`,{context:ge}),className:`personal-icon-button personal-drawer-close`,onClick:pe,ref:L,type:`button`,children:[(0,B.jsx)(Zp,{className:`personal-mobile-back`,size:18}),(0,B.jsx)(oh,{className:`personal-desktop-close`,size:18})]})]})]}),(0,B.jsxs)(`div`,{className:`personal-drawer-body`,children:[f.kind===`attention`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card is-attention`,children:[(0,B.jsx)(`small`,{children:f.item.blocking?m(`drawer.attentionBlocking`):m(`drawer.attentionWaiting`)}),(0,B.jsx)(`h3`,{children:f.item.text}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle??f.item.goalId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.priority`)}),(0,B.jsx)(`dd`,{children:f.item.priority??`medium`})]}),ye?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`common.waiting`)}),(0,B.jsx)(`dd`,{children:m(`tasks.waitingAge`,{age:ye})})]}):null]})]}),(0,B.jsx)(yb,{item:f.item,onSelect:n,successor:Yd(f.item,t)}),!u&&Xd(f.item)?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void Ce(f.item,`approve`,m(`common.confirm`)),type:`button`,children:[(0,B.jsx)(om,{size:17}),m(`drawer.decisionReview`)]}),(0,B.jsxs)(`details`,{className:`personal-compact-menu`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(_m,{size:17}),m(`drawer.decisionMore`)]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{onClick:()=>void r.onExplainDecision?.(f.item),type:`button`,children:[(0,B.jsx)(Nm,{size:16}),m(`drawer.explainDecision`)]}),Ab.map(e=>(0,B.jsx)(`button`,{onClick:()=>void Ce(f.item,e.resolution,m(e.key)),type:`button`,children:m(e.key)},e.resolution))]})]})]}):null]}):null,f.kind===`todo`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-task-inspector-summary`,children:[(0,B.jsxs)(`div`,{className:`personal-task-inspector-status`,children:[(0,B.jsxs)(`span`,{className:f.item.done?`is-done`:f.item.status===`blocked`?`is-blocked`:`is-open`,children:[(0,B.jsx)(`i`,{}),f.item.done?m(`drawer.taskStatusCompleted`):f.item.status===`deferred`?m(`drawer.taskStatusDeferred`):f.item.status===`blocked`?m(`drawer.taskStatusBlocked`):m(`drawer.taskStatusOpen`)]}),f.item.priority?(0,B.jsx)(`span`,{children:f.item.priority}):null,(0,B.jsx)(`span`,{children:f.item.taskClass===`advancement_task`?m(`drawer.taskAdvancement`):f.item.taskClass??m(`drawer.taskOrdinary`)})]}),(0,B.jsx)(`h3`,{children:f.item.text})]}),(0,B.jsxs)(`section`,{"aria-label":m(`drawer.taskInfo`),className:`personal-task-inspector-fields`,children:[(0,B.jsx)(`h4`,{children:m(`drawer.taskInfo`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`common.owner`)}),(0,B.jsx)(`dd`,{children:f.item.ownerLabel??f.item.claimedBy??m(`drawer.notAssigned`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`common.status`)}),(0,B.jsx)(`dd`,{children:f.item.done?m(`drawer.taskStatusCompleted`):f.item.status===`deferred`?m(`drawer.taskStatusDeferred`):f.item.status===`blocked`?m(`drawer.taskStatusBlocked`):m(`drawer.taskStatusOpen`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.priority`)}),(0,B.jsx)(`dd`,{children:f.item.priority??m(`drawer.notSet`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.dependencies`)}),(0,B.jsx)(`dd`,{children:f.item.dependencies?.join(` · `)||m(`common.none`)})]}),f.item.status===`deferred`||f.item.resumeWhen?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.resumeWhen`)}),(0,B.jsx)(`dd`,{children:f.item.resumeWhen||m(`drawer.notSet`)})]}):null,f.item.resumeWhen?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.resumeState`)}),(0,B.jsx)(`dd`,{children:f.item.resumeReady?m(`drawer.resumeReady`):m(`drawer.resumePending`)})]}):null,f.item.resumeReceiptId?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.resumeReceipt`)}),(0,B.jsx)(`dd`,{children:f.item.resumeReceiptId})]}):null,(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.nextTransition`)}),(0,B.jsx)(`dd`,{children:f.item.nextTransition??(f.item.done?m(`drawer.taskNextCompleted`):f.item.resumeReady?m(`drawer.taskNextResumeReady`):f.item.status===`deferred`?m(`drawer.taskNextDeferred`):m(`drawer.taskNextOpen`))})]})]})]}),!u&&!f.item.done?(0,B.jsxs)(`div`,{className:`personal-task-inspector-actions`,"aria-label":m(`drawer.taskActions`),children:[(0,B.jsxs)(`details`,{className:`personal-task-management`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(_m,{size:16}),m(`drawer.taskManage`)]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:m(`drawer.reassign`)}),(0,B.jsxs)(`label`,{className:`personal-inline-agent-select`,children:[m(`drawer.reassign`),(0,B.jsx)(`select`,{"aria-label":m(`drawer.reassign`),onChange:e=>oe(e.target.value),value:F,children:e.filter(e=>e.available).map(e=>(0,B.jsx)(`option`,{value:e.agentId,children:e.label},e.agentId))}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onPreviewAction?.({actionKind:`todo.update`,context:{goal_id:f.item.goalId,kind:`todo`,todo_id:f.item.todoId},idempotencyKey:`workspace-todo-${f.item.todoId}-reassign-${F}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:F,goal_id:f.item.goalId,operation:`reassign`,todo_id:f.item.todoId},summary:m(`drawer.reassignSummary`,{task:f.item.text})}),type:`button`,children:m(`timeline.review`)})]}),(0,B.jsx)(`strong`,{children:m(`drawer.taskDeferUntil`)}),(0,B.jsxs)(`label`,{className:`personal-inline-agent-select personal-inline-resume-when`,children:[m(`drawer.taskDeferUntil`),(0,B.jsx)(`input`,{"aria-label":m(`drawer.taskDeferCondition`),"aria-invalid":!!I.trim()&&!be,onChange:e=>se(e.target.value),placeholder:m(`drawer.taskDeferPlaceholder`),value:I}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,disabled:!be,onClick:()=>void Se(f.item,`defer`,m(`drawer.taskDefer`),be??void 0),type:`button`,children:m(`drawer.taskDeferReview`)}),(0,B.jsx)(`small`,{children:I.trim()&&!be?m(`drawer.taskDeferInvalid`):m(`drawer.taskDeferSupported`)})]}),(0,B.jsx)(`div`,{className:`personal-task-management-secondary`,children:kb.map(e=>(0,B.jsx)(`button`,{onClick:()=>void Se(f.item,e.operation,m(e.key)),type:`button`,children:m(e.key)},e.operation))})]})]}),(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void Se(f.item,`complete`,m(`drawer.taskComplete`)),type:`button`,children:[(0,B.jsx)(om,{size:17}),m(`drawer.taskComplete`)]})]}):null,f.item.done?(0,B.jsxs)(`div`,{className:`personal-task-completed-note`,children:[(0,B.jsx)(om,{size:16}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:m(`drawer.taskCompletedTitle`)}),(0,B.jsx)(`small`,{children:m(`drawer.taskCompletedNote`)})]})]}):null]}):null,f.kind===`goal`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card`,children:[(0,B.jsx)(`small`,{children:Yi(f.item.state,p)}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.agentSentence}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.tokens`)}),(0,B.jsxs)(`dd`,{children:[eb(f.item.usage?.tokens24h,m(`drawer.usageNotMeasured`),Zy),` / `,eb(f.item.usage?.tokens7d,m(`drawer.usageNotMeasured`),Zy)]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.cost`)}),(0,B.jsxs)(`dd`,{children:[eb(f.item.usage?.costUsd24h,m(`drawer.usageNotMeasured`),Qy),` / `,eb(f.item.usage?.costUsd7d,m(`drawer.usageNotMeasured`),Qy)]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.duration`)}),(0,B.jsxs)(`dd`,{children:[eb(f.item.usage?.durationMs24h,m(`drawer.usageNotMeasured`),$y),` / `,eb(f.item.usage?.durationMs7d,m(`drawer.usageNotMeasured`),$y)]})]})]})]}),(0,B.jsx)(vb,{goal:f.item}),(()=>{let e=i.find(e=>e.goalId===f.item.goalId),t=s.find(e=>e.goal_id===f.item.goalId);return(0,B.jsxs)(B.Fragment,{children:[f.item.repository?(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-repository`,children:[(0,B.jsxs)(`div`,{className:`personal-detail-card-title`,children:[(0,B.jsx)(`small`,{children:m(`drawer.repository`)}),(0,B.jsx)(`em`,{children:m(`common.readOnly`)})]}),(0,B.jsxs)(`h3`,{children:[(0,B.jsx)(Cm,{size:16}),f.item.repository.label]}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.branch`)}),(0,B.jsx)(`dd`,{children:f.item.repository.branch||`detached`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Role`}),(0,B.jsx)(`dd`,{children:m(`drawer.repositoryRole`)})]})]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>{let e=navigator.clipboard?.writeText(f.item.repository?.identity??``);if(!e){b(`error`);return}e.then(()=>b(`copied`)).catch(()=>b(`error`))},type:`button`,children:[(0,B.jsx)(mm,{size:15}),m(y===`copied`?`drawer.copyRepositoryDone`:`drawer.copyRepository`)]}),y===`error`?(0,B.jsx)(`p`,{className:`personal-copy-feedback is-error`,role:`status`,children:m(`drawer.copyRepositoryError`)}):y===`copied`?(0,B.jsx)(`p`,{className:`personal-copy-feedback`,role:`status`,children:m(`drawer.copyRepositorySuccess`)}):null]}):null,u?(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-notification`,children:[(0,B.jsx)(`small`,{children:m(`drawer.larkConnection`)}),(0,B.jsx)(`h3`,{children:m(`drawer.remoteDetailsUnavailable`)}),(0,B.jsx)(`p`,{children:m(`drawer.remoteDetailsDescription`)})]}):(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-notification`,children:[(0,B.jsx)(`small`,{children:m(`drawer.larkConnection`)}),t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h3`,{children:[t.app_label,(0,B.jsx)(`span`,{className:`personal-connection-status`,children:m(`drawer.connected`)})]}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.group`)}),(0,B.jsx)(`dd`,{children:t.chat_name})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.topic`)}),(0,B.jsxs)(`dd`,{children:[`# `,t.topic_name]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.trigger`)}),(0,B.jsx)(`dd`,{children:t.incoming_mode===`mentions`?m(`lark.someoneMentions`):m(`lark.allMessages`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.replyMode`)}),(0,B.jsx)(`dd`,{children:m(`lark.topicReply`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.autoNotify`)}),(0,B.jsx)(`dd`,{children:e?.humanGateAutoNotifyEnabled?m(`common.on`):m(`common.off`)})]}),e?.lastNotifiedAt?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.lastNotification`)}),(0,B.jsx)(`dd`,{children:e.lastNotifiedAt})]}):null]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:m(`drawer.larkNotConfigured`)}),(0,B.jsx)(`p`,{children:m(`drawer.larkNotConfiguredDescription`)})]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>r.onOpenNotificationSettings?.(f.item.goalId),type:`button`,children:[(0,B.jsx)(nm,{size:16}),m(t?`drawer.larkConfigure`:`drawer.larkConnect`)]})]})]})})(),(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-session`,children:[(0,B.jsx)(`small`,{children:m(`drawer.runDetails`)}),_e?.sessionId?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:Xi(_e.sessionStatus??_e.status,m)}),(0,B.jsx)(`p`,{children:_e.title}),r.onOpenRunSession?(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void r.onOpenRunSession?.(_e),type:`button`,children:[(0,B.jsx)(Bm,{size:16}),m(`drawer.runLatest`)]}):null]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:m(`drawer.noRun`)}),(0,B.jsx)(`p`,{children:m(`drawer.noRunDescription`)})]})]}),u?null:(0,B.jsxs)(`div`,{className:`personal-drawer-action-grid`,children:[(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>r.onRequestScheduleConfig?.(`heartbeat`,f.item.goalId),type:`button`,children:[(0,B.jsx)(Hm,{size:16}),m(`drawer.setupHeartbeat`)]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>r.onRequestScheduleConfig?.(`monitor`,f.item.goalId),type:`button`,children:[(0,B.jsx)(am,{size:16}),m(`drawer.scheduleAdd`)]})]}),f.item.subagentExecution?(0,B.jsxs)(`section`,{className:`personal-detail-card personal-goal-subagents`,children:[(0,B.jsxs)(`div`,{className:`personal-subagent-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`small`,{children:m(`drawer.subagentLabel`)}),(0,B.jsxs)(`h3`,{children:[(0,B.jsx)(rm,{size:16}),m(`drawer.subagentTitle`)]})]}),(0,B.jsxs)(`button`,{"aria-checked":we.enabled,"aria-label":m(ne&&j===`ready`?`drawer.subagentPending`:we.enabled?`drawer.subagentDisable`:`drawer.subagentEnable`),className:`personal-subagent-switch`,"data-pending":ne&&j===`ready`?`true`:void 0,disabled:u||Te||!!ne||!r.onPreviewGoalSubagentConfiguration,onClick:()=>void Ae(!we.enabled),role:`switch`,type:`button`,children:[(0,B.jsx)(`span`,{}),m(ne&&j===`ready`?`drawer.subagentPending`:we.enabled?`common.on`:`common.off`)]})]}),(0,B.jsx)(`p`,{children:m(`drawer.subagentDescription`)}),ne&&j===`ready`?(0,B.jsxs)(`div`,{className:`personal-subagent-preview`,children:[(0,B.jsx)(`strong`,{children:m(ne.enabled?`drawer.subagentConfirmEnable`:`drawer.subagentConfirmDisable`)}),(0,B.jsx)(`p`,{children:ne.enabled?m(`drawer.subagentPreviewSummary`,{count:ne.maxChildren,domains:ne.allowedDomains.join(` · `)||m(`drawer.subagentDomainsUnrestricted`)}):m(`drawer.subagentDisableSummary`)}),ne.modelConfig===void 0?null:(0,B.jsxs)(`p`,{children:[m(`drawer.subagentModel`),`: `,ne.modelConfig?.model||m(`drawer.subagentModelDefault`),` · `,ne.modelConfig?.reasoning_effort||m(`drawer.subagentModelDefault`)]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`button`,{className:`personal-primary-action`,onClick:()=>void je(),type:`button`,children:m(`common.confirm`)}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:De,type:`button`,children:m(`common.cancel`)})]})]}):null,T?(0,B.jsxs)(`p`,{className:`personal-subagent-feedback is-${j}`,role:`status`,children:[j===`previewing`||j===`applying`?(0,B.jsx)(Wm,{className:`personal-spin`,size:13}):null,T]}):null,(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.subagentModel`)}),(0,B.jsx)(`dd`,{children:we.modelConfig?.model||m(`drawer.subagentModelDefault`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.subagentEffort`)}),(0,B.jsx)(`dd`,{children:we.modelConfig?.reasoning_effort||m(`drawer.subagentModelDefault`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.subagentCurrentBoundary`)}),(0,B.jsx)(`dd`,{children:we.allowedDomains.join(` · `)||m(`drawer.subagentDomainsUnrestricted`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.subagentChildLimit`)}),(0,B.jsx)(`dd`,{children:we.maxChildren||0})]})]}),u?(0,B.jsx)(`p`,{className:`personal-subagent-read-only`,children:m(`drawer.subagentRemoteReadOnly`)}):(0,B.jsxs)(`div`,{className:`personal-subagent-fields`,children:[(0,B.jsxs)(`fieldset`,{className:`personal-subagent-domain-picker`,disabled:Te,children:[(0,B.jsx)(`legend`,{children:m(`drawer.subagentDomains`)}),Ee.length>0?(0,B.jsx)(`div`,{className:`personal-subagent-domain-options`,children:Ee.map(e=>{let t=C.includes(e.value);return(0,B.jsxs)(`label`,{className:`personal-subagent-domain-option${t?` is-selected`:``}`,children:[(0,B.jsx)(`input`,{"aria-label":e.value,checked:t,onChange:t=>ke(e.value,t.target.checked),type:`checkbox`}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.value}),(0,B.jsx)(`small`,{children:m(`drawer.subagentDomainTodoCount`,{count:e.matchingTodoCount})})]})]},e.value)})}):(0,B.jsx)(`p`,{className:`personal-subagent-domain-empty`,children:m(`drawer.subagentDomainsEmpty`)}),(0,B.jsx)(`small`,{children:m(`drawer.subagentDomainsHint`)})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:m(`drawer.subagentModel`)}),(0,B.jsx)(`input`,{"aria-label":m(`drawer.subagentModel`),disabled:Te,value:k,placeholder:`gpt-5.6-luna`,onChange:e=>{ee(e.target.value),N(null),M(`idle`),E(null)}})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:m(`drawer.subagentEffort`)}),(0,B.jsxs)(`select`,{"aria-label":m(`drawer.subagentEffort`),disabled:Te,value:te,onChange:e=>{A(e.target.value),N(null),M(`idle`),E(null)},children:[(0,B.jsx)(`option`,{value:``,children:m(`drawer.subagentModelDefault`)}),[`none`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`,`ultra`].map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,disabled:Te,type:`button`,onClick:()=>{ee(`gpt-5.6-luna`),A(`max`),N(null),M(`idle`),E(null)},children:m(`drawer.subagentLunaPreset`)}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,disabled:Te,type:`button`,onClick:()=>{ee(``),A(``),N(null),M(`idle`),E(null)},children:m(`drawer.subagentClearModel`)}),(0,B.jsx)(`p`,{children:m(`drawer.subagentModelHint`)}),(0,B.jsxs)(`label`,{className:`personal-subagent-limit-field`,children:[(0,B.jsx)(`span`,{children:m(`drawer.subagentMaxChildren`)}),(0,B.jsx)(`select`,{"aria-label":m(`drawer.subagentMaxChildren`),disabled:Te,onChange:e=>{O(Number(e.target.value)),N(null),M(`idle`),E(null)},value:D,children:jb.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,disabled:Te,onClick:()=>void Ae(we.enabled,!0),type:`button`,children:m(`drawer.subagentPreviewBoundary`)})]})]}):null]}):null,f.kind===`run`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{"aria-label":m(`drawer.runView`),className:`personal-run-drawer-tabs`,role:`tablist`,children:[(0,B.jsx)(`button`,{"aria-selected":x===`record`,onClick:()=>S(`record`),role:`tab`,type:`button`,children:m(`drawer.executionRecordAndResult`)}),(0,B.jsx)(`button`,{"aria-selected":x===`details`,onClick:()=>S(`details`),role:`tab`,type:`button`,children:m(`drawer.detailsAndActions`)})]}),x===`record`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card personal-session-summary`,children:[(0,B.jsxs)(`small`,{children:[f.item.agentLabel,` · `,Xi(f.item.sessionStatus??f.item.status,m)]}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.latestActivity}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.progress`)}),(0,B.jsxs)(`dd`,{children:[f.item.completedSteps,`/`,f.item.totalSteps]})]})]})]}),(0,B.jsxs)(`section`,{"aria-label":m(`drawer.executionRecord`),className:`personal-session-message-record`,children:[(0,B.jsx)(`h3`,{children:m(`drawer.executionRecord`)}),f.item.sessionMessages?.length?(0,B.jsx)(`ol`,{children:f.item.sessionMessages.map(e=>(0,B.jsxs)(`li`,{className:`is-${e.role}`,children:[(0,B.jsx)(`i`,{}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:e.role===`user`?m(`drawer.runRoleUser`):e.role===`assistant`?m(`drawer.runRoleAssistant`):m(`drawer.runRoleSystem`)}),e.createdAt?(0,B.jsx)(`time`,{children:new Date(e.createdAt).toLocaleTimeString(p,{hour:`2-digit`,minute:`2-digit`,hour12:!1})}):null]}),(0,B.jsx)(`p`,{children:e.text})]})]},e.messageId))}):(0,B.jsx)(`p`,{className:`personal-session-empty`,children:ve?m(`drawer.runRecordProjected`,{completed:f.item.completedSteps,outputs:f.item.outputs?.length?m(`drawer.runRecordProjectedOutputs`,{count:f.item.outputs.length}):``,total:f.item.totalSteps}):m(`drawer.runRecordEmpty`)}),f.item.status===`running`?(0,B.jsxs)(`div`,{className:`personal-session-active-step`,children:[(0,B.jsx)(`i`,{}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:m(`drawer.analysis`)}),(0,B.jsx)(`small`,{children:m(`drawer.agentWorking`)})]})]}):null]}),f.item.outputs?.length?(0,B.jsxs)(`section`,{className:`personal-execution-history`,"aria-labelledby":`personal-run-outputs-title`,children:[(0,B.jsx)(`h3`,{id:`personal-run-outputs-title`,children:m(`drawer.outputs`)}),(0,B.jsx)(`ol`,{children:f.item.outputs.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`small`,{children:e.createdAt??e.kind??m(`files.emptySummary`)})]})},e.outputId))})]}):null]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card`,children:[(0,B.jsxs)(`small`,{children:[f.item.agentLabel,` · `,Xi(f.item.status,m)]}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.latestActivity}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.progress`)}),(0,B.jsxs)(`dd`,{children:[f.item.completedSteps,`/`,f.item.totalSteps]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.sessionStatus`)}),(0,B.jsx)(`dd`,{children:Xi(f.item.sessionStatus??f.item.status,m)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.sessionRecoverable`)}),(0,B.jsx)(`dd`,{children:f.item.resumable===!1?m(`drawer.resumeNo`):m(`drawer.resumeYes`)})]})]})]}),f.item.sessionStatus===`resume_failed`&&!u?(0,B.jsxs)(`section`,{className:`personal-recovery-panel`,"aria-label":m(`drawer.recoveryFailed`),children:[(0,B.jsx)(`strong`,{children:m(`drawer.recoveryFailed`)}),(0,B.jsx)(`p`,{children:m(`drawer.recoveryDescription`)}),(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void r.onRetryResumeRun?.(f.item),type:`button`,children:[(0,B.jsx)(Wm,{size:16}),m(`drawer.recoveryRetry`)]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onStartNewRunSession?.(f.item),type:`button`,children:[(0,B.jsx)(Bm,{size:16}),m(`drawer.recoveryNewSession`)]})]}):null,u?null:(0,B.jsxs)(`section`,{className:`personal-correction-panel`,children:[(0,B.jsx)(`header`,{children:(0,B.jsxs)(`span`,{children:[(0,B.jsx)(rm,{size:16}),m(`drawer.correctionLabel`,{agent:f.item.agentLabel})]})}),(0,B.jsx)(`p`,{children:m(`drawer.correctionDescription`)}),(0,B.jsxs)(`div`,{className:`personal-correction-composer`,children:[(0,B.jsx)(`textarea`,{"aria-label":m(`drawer.correctionTextarea`,{agent:f.item.agentLabel,goal:f.item.goalTitle,run:f.item.title}),onChange:e=>g(e.target.value),placeholder:m(`drawer.correctionPlaceholder`),rows:3,value:h}),(0,B.jsx)(`button`,{"aria-label":m(`drawer.correctionSend`),disabled:!h.trim(),onClick:()=>void xe(),type:`button`,children:(0,B.jsx)(qm,{size:16})})]})]}),u?null:(0,B.jsxs)(`details`,{className:`personal-compact-menu personal-run-more`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(_m,{size:17}),m(`drawer.moreRunActions`)]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{disabled:!f.item.canInterrupt,onClick:()=>void r.onInterruptRun?.(f.item),type:`button`,children:[(0,B.jsx)(zm,{size:16}),m(`drawer.runInterrupt`)]}),(0,B.jsxs)(`button`,{disabled:f.item.resumable===!1,onClick:()=>void r.onRetryResumeRun?.(f.item),type:`button`,children:[(0,B.jsx)(Wm,{size:16}),m(`drawer.recoveryRetry`)]}),(0,B.jsxs)(`button`,{onClick:()=>void r.onStartNewRunSession?.(f.item),type:`button`,children:[(0,B.jsx)(Bm,{size:16}),m(`drawer.runNewSession`)]}),(0,B.jsxs)(`button`,{onClick:()=>void r.onCloseRunSession?.(f.item),type:`button`,children:[(0,B.jsx)(eh,{size:16}),m(`drawer.runCloseSession`)]})]})]})]})]}):null,f.kind===`output`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card`,children:[(0,B.jsx)(`small`,{children:f.item.kind??`output`}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.summary??m(`drawer.outputRecorded`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Goal`}),(0,B.jsx)(`dd`,{children:f.item.goalTitle??f.item.goalId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.outputTodo`)}),(0,B.jsx)(`dd`,{children:f.item.todoId??m(`drawer.notLinked`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.outputRun`)}),(0,B.jsx)(`dd`,{children:f.item.runId??m(`drawer.notLinked`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Agent`}),(0,B.jsx)(`dd`,{children:f.item.agentLabel??f.item.agentId??`LoopX`})]})]})]}),f.item.report?(0,B.jsxs)(`section`,{className:`personal-report-detail`,"data-testid":`personal-periodic-report-detail`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsxs)(`strong`,{children:[`+`,f.item.report.addedCount]}),m(`files.reportAdded`)]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:f.item.report.changedCount}),m(`files.reportChanged`)]})]}),(0,B.jsxs)(`p`,{children:[f.item.report.periodStartAt,` → `,f.item.report.periodEndAt]}),(0,B.jsx)(`ol`,{children:f.item.report.items.map(e=>(0,B.jsxs)(`li`,{"data-change-kind":e.changeKind,children:[(0,B.jsxs)(`small`,{children:[e.changeKind,` · `,e.status]}),(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`p`,{children:e.summary})]},e.sourceRef))}),(0,B.jsxs)(`footer`,{children:[(0,B.jsxs)(`span`,{children:[m(`files.reportPublication`),`: `,f.item.report.publicationId]}),(0,B.jsxs)(`span`,{children:[m(`files.reportGeneration`),`: `,f.item.report.generationId]})]})]}):null,f.item.safePreview?(0,B.jsx)(`pre`,{"aria-label":m(`drawer.outputSafePreview`),className:`personal-safe-preview`,children:f.item.safePreview}):(0,B.jsx)(`p`,{className:`personal-preview-unavailable`,children:m(`drawer.previewUnavailable`)}),(0,B.jsxs)(`div`,{className:`personal-drawer-action-grid`,children:[(0,B.jsxs)(`button`,{className:`personal-primary-action`,disabled:!r.onOpenOutput,onClick:()=>{r.onOpenOutput?.(f.item),c()},type:`button`,children:[(0,B.jsx)(vm,{size:16}),m(`files.openConversation`)]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,disabled:!r.onExportOutput,onClick:()=>void r.onExportOutput?.(f.item),type:`button`,children:[(0,B.jsx)(gm,{size:16}),m(`files.exportSummary`)]})]})]}):null,f.kind===`proposal`?(0,B.jsxs)(B.Fragment,{children:[f.item.actionKind===`team.plan`&&f.item.status===`applied`?(0,B.jsx)(bb,{proposal:f.item,t:m}):(0,B.jsxs)(`section`,{className:`personal-proposal-card`,children:[(0,B.jsxs)(`small`,{children:[f.item.actionKind,` · `,f.item.status]}),(0,B.jsx)(`h3`,{children:f.item.title}),(0,B.jsx)(`p`,{children:f.item.impact}),f.item.reviewPlan&&!f.item.reviewPlan.retryOriginal&&f.item.actionKind!==`team.plan`?(0,B.jsx)(`p`,{className:`personal-proposal-explainer`,"data-action-review":f.item.reviewPlan.interaction,children:f.item.actionKind===`operation.execute`&&f.item.status===`gated`?m(`actionReview.operation_group_confirmation`):f.item.actionKind===`operation.execute`&&f.item.reviewPlan.reason===`readback_unverified`?m(`actionReview.operation_result_delivery_pending`):m(`actionReview.${f.item.reviewPlan.reason}`)}):null,f.item.status===`ready`&&f.item.actionKind!==`team.plan`?(0,B.jsx)(`p`,{className:`personal-proposal-explainer`,children:m(`drawer.proposalExplainer`)}):null,(0,B.jsx)(`dl`,{children:f.item.fields.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.label}),(0,B.jsx)(`dd`,{children:e.value})]},e.key))})]}),f.item.status===`applied`&&f.item.actionKind!==`team.plan`?(0,B.jsxs)(`p`,{className:`personal-proposal-state ${f.item.actionKind===`operation.execute`&&f.item.reviewPlan?.reason===`readback_unverified`?`is-gated`:`is-applied`}`,children:[(0,B.jsx)(om,{size:16}),f.item.actionKind===`operation.execute`?f.item.primaryLabel:m(`drawer.proposalApplied`)]}):null,f.item.status===`applied`&&f.item.actionKind!==`operation.execute`&&f.item.goalId?(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>{let e=f.item.goalId;c(),r.onOpenGoal?.(e)},type:`button`,children:[(0,B.jsx)(vm,{size:16}),f.item.actionKind===`goal.create`?m(`drawer.proposalEnterGoal`):m(f.item.actionKind===`team.plan`?`proposal.teamPlan.openGoal`:`drawer.proposalViewGoal`)]}):null,f.item.status===`stale`?(0,B.jsx)(`p`,{className:`personal-proposal-state is-stale`,children:m(`drawer.proposalStale`)}):null,f.item.status===`error`&&!f.item.reviewPlan?.retryOriginal?(0,B.jsxs)(`div`,{className:`personal-proposal-state is-error`,children:[(0,B.jsx)(`span`,{children:f.item.reviewPlan?.reason===`readback_unverified`?m(`actionReview.readback_unverified`):m(`drawer.proposalApplyFailed`)}),f.item.errorMessage?(0,B.jsx)(`small`,{children:f.item.errorMessage}):null,(0,B.jsx)(`small`,{children:m(f.item.actionKind===`team.plan`?`proposal.teamPlan.retryHint`:`drawer.proposalApplyFailedHint`)})]}):null,f.item.status===`rejected`?(0,B.jsx)(`p`,{className:`personal-proposal-state is-error`,children:m(`drawer.proposalRejected`)}):null,f.item.status===`deferred`?(0,B.jsx)(`p`,{className:`personal-proposal-state is-gated`,children:m(`drawer.proposalDeferred`)}):null,f.item.status===`gated`?(0,B.jsxs)(`div`,{className:`personal-proposal-state is-gated`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:f.item.actionKind===`operation.execute`?f.item.primaryLabel:m(`drawer.gateRequiresHost`)}),f.item.actionKind===`operation.execute`?f.item.impact:m(`drawer.gateRequiresHostDescription`)]}),f.item.gate?.nextAction?(0,B.jsx)(`small`,{children:f.item.gate.nextAction}):null]}):null,f.item.status===`gated`&&f.item.actionKind===`gate.resolve`?(()=>{let e=e=>f.item.fields.find(t=>t.key===e)?.value,t=e(`goal_id`),n=e(`todo_id`);return!t||!n?null:(0,B.jsxs)(`section`,{className:`personal-detail-card personal-gate-cli-hint`,children:[(0,B.jsx)(`small`,{children:m(`drawer.gateApproveHint`)}),(0,B.jsxs)(`code`,{children:[`loopx todo complete --goal-id `,t,` --todo-id `,n,` --decision-outcome approve`]}),(0,B.jsx)(`small`,{children:m(`drawer.gateRejectHint`)})]})})():null,!u&&f.item.workspaceCandidates?.length?(0,B.jsx)(`div`,{className:`personal-workspace-candidates`,"aria-label":m(`drawer.workspaceCandidates`),children:f.item.workspaceCandidates.map(e=>(0,B.jsxs)(`button`,{onClick:()=>void r.onSelectWorkspaceCandidate?.(f.item,e.workspaceRef),type:`button`,children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`small`,{children:e.workspaceRef})]},e.workspaceRef))}):null,!u&&f.item.actionKind!==`operation.execute`&&f.item.status===`error`?(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void(f.item.actionKind===`team.plan`||f.item.reviewPlan?.retryOriginal?r.onApplyProposal?.(f.item):r.onTransitionProposal?.(f.item,`regenerate`)),type:`button`,children:[(0,B.jsx)(Wm,{size:17}),m(f.item.reviewPlan?.retryOriginal?`drawer.retryOriginal`:f.item.actionKind===`team.plan`?`proposal.teamPlan.retry`:`drawer.proposalRegenerate`)]}):!u&&f.item.actionKind!==`operation.execute`&&f.item.status!==`gated`&&(f.item.actionKind!==`team.plan`||f.item.status!==`applied`)?(0,B.jsxs)(`button`,{className:`personal-primary-action`,disabled:![`ready`,`deferred`].includes(f.item.status)||f.item.reviewPlan?.canApply===!1,onClick:()=>void r.onApplyProposal?.(f.item),type:`button`,children:[(0,B.jsx)(om,{size:17}),f.item.status===`applying`?m(`drawer.applying`):f.item.primaryLabel??m(`drawer.apply`)]}):null,!u&&f.item.actionKind!==`operation.execute`&&([`stale`,`gated`,`rejected`].includes(f.item.status)||f.item.status===`ready`&&f.item.reviewPlan?.canApply===!1)?(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onTransitionProposal?.(f.item,`regenerate`),type:`button`,children:[(0,B.jsx)(Wm,{size:16}),m(`drawer.proposalRecheck`)]}):null,!u&&f.item.actionKind!==`operation.execute`&&[`ready`,`gated`].includes(f.item.status)?(0,B.jsxs)(`div`,{className:`personal-drawer-action-grid`,children:[(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onTransitionProposal?.(f.item,`defer`),type:`button`,children:m(`drawer.proposalDefer`)}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onTransitionProposal?.(f.item,`reject`),type:`button`,children:m(`drawer.decisionReject`)})]}):null,[`applied`,`applying`].includes(f.item.status)?null:(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:c,type:`button`,children:m(`drawer.proposalClose`)})]}):null,f.kind===`schedule`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`personal-detail-card`,children:[(0,B.jsxs)(`small`,{children:[f.item.scheduleKind===`heartbeat`?`Goal Heartbeat`:`continuous_monitor`,` · `,f.item.status??`active`]}),(0,B.jsx)(`h3`,{children:f.item.label}),(0,B.jsx)(`p`,{children:f.item.target??f.item.schedule??m(`drawer.scheduleDefaultTarget`)}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleTimezone`)}),(0,B.jsx)(`dd`,{children:f.item.timezone??m(`drawer.scheduleLocalTimezone`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleNext`)}),(0,B.jsx)(`dd`,{children:f.item.nextRunAt??m(`drawer.schedulePending`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleLast`)}),(0,B.jsx)(`dd`,{children:f.item.previousRunAt??m(`drawer.scheduleNeverRun`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleNotification`)}),(0,B.jsx)(`dd`,{children:f.item.notificationRule??m(`drawer.scheduleDefaultNotification`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:m(`drawer.scheduleStopCondition`)}),(0,B.jsx)(`dd`,{children:f.item.stopCondition??m(`drawer.scheduleDefaultStop`)})]})]})]}),!u&&f.item.scheduleKind===`monitor`?(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:()=>void r.onUpdateSchedule?.(f.item,`run_now`),type:`button`,children:[(0,B.jsx)(Bm,{size:16}),m(`drawer.scheduleRunNow`)]}):null,u?null:(0,B.jsxs)(`div`,{className:`personal-drawer-action-grid`,children:[(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onUpdateSchedule?.(f.item,f.item.status===`paused`?`resume`:`pause`),type:`button`,children:[f.item.status===`paused`?(0,B.jsx)(Bm,{size:16}):(0,B.jsx)(zm,{size:16}),f.item.status===`paused`?m(`drawer.scheduleResume`):m(`drawer.schedulePause`)]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,onClick:()=>void r.onUpdateSchedule?.(f.item,`edit`),type:`button`,children:[(0,B.jsx)(am,{size:16}),m(`drawer.scheduleEdit`)]})]}),u?null:(0,B.jsxs)(`button`,{className:`personal-danger-action`,onClick:()=>void r.onUpdateSchedule?.(f.item,`stop`),type:`button`,children:[(0,B.jsx)(eh,{size:16}),m(`drawer.scheduleStop`,{kind:f.item.scheduleKind===`heartbeat`?` Heartbeat`:m(`drawer.titleSchedule`)})]}),(0,B.jsxs)(`section`,{className:`personal-execution-history`,"aria-labelledby":`personal-execution-history-title`,children:[(0,B.jsx)(`h3`,{id:`personal-execution-history-title`,children:m(`drawer.executionHistory`)}),f.item.executionHistory?.length?(0,B.jsx)(`ol`,{children:f.item.executionHistory.map((e,t)=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`small`,{children:e.timestamp})]}),(0,B.jsx)(`em`,{className:`is-${e.status}`,children:e.status})]},`${e.timestamp}:${e.runId??t}`))}):(0,B.jsx)(`p`,{children:m(`drawer.noExecutionHistory`)})]})]}):null,f.kind===`run`||f.kind===`proposal`||f.kind===`schedule`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{"aria-expanded":_,className:`personal-diagnostics-trigger`,onClick:()=>v(e=>!e),type:`button`,children:[(0,B.jsx)(`span`,{children:m(`drawer.advancedDiagnostics`)}),(0,B.jsx)(sm,{className:_?`is-open`:``,size:16})]}),_?(0,B.jsxs)(`div`,{className:`personal-diagnostics`,children:[(0,B.jsxs)(`code`,{children:[`goal_id: `,he]}),(0,B.jsxs)(`code`,{children:[`kind: `,f.kind]}),f.kind===`run`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`code`,{children:[`session_id: `,f.item.sessionId??m(`drawer.notLinked`)]}),(0,B.jsxs)(`code`,{children:[`turn_id: `,f.item.turnId??m(`common.none`)]}),(0,B.jsxs)(`code`,{children:[`adapter: `,f.item.agentId]}),(0,B.jsxs)(`code`,{children:[`status: `,f.item.sessionStatus??f.item.status]})]}):f.kind===`proposal`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`code`,{children:[`action: `,f.item.actionKind]}),(0,B.jsxs)(`code`,{children:[`status: `,f.item.status]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`code`,{children:[`schedule_id: `,f.item.scheduleId]}),(0,B.jsxs)(`code`,{children:[`status: `,f.item.status??`active`]})]})]}):null]}):null]})]})}var Ib=[`checking`,`connecting`,`downloading`,`installing_app`,`installing_runtime`],Lb={desktop_status_unavailable:[`无法读取 App 更新状态。请重启 App 后再试;若仍失败,请重新安装最新 App。`,`Cannot read the App update status. Restart the App; if this persists, reinstall the latest App.`],update_feed_unavailable:[`此通道的更新源尚未就绪或暂时不可用。可稍后重新检查,当前版本仍可继续使用。`,`This channel's update feed is not ready or temporarily unavailable. Check again later; you can keep using this version.`],update_feed_invalid:[`更新源格式异常。请稍后重新检查。`,`The update feed is invalid. Check again later.`],update_platform_unavailable:[`此通道尚无适用于本机的更新包。`,`This channel has no update package for this platform.`],update_check_timeout:[`检查更新超时。请稍后重试。`,`The update check timed out. Try again later.`],update_network_failed:[`无法连接更新服务器。请检查网络后重试。`,`Cannot reach the update server. Check your connection and retry.`],update_download_or_signature_failed:[`更新包下载或签名校验失败,尚未安装。请重新检查更新。`,`Download or signature verification failed; the update was not installed. Check for updates again.`]};function Rb(e,t=`update_failed`){return{phase:`error`,details:{code:typeof e==`string`&&Object.hasOwn(Lb,e)?e:t}}}function zb(){let{locale:e}=Ji(),t=e===`zh-CN`,[n,r]=(0,z.useState)(!1),i=(0,z.useRef)(null),[a,o]=(0,z.useState)(`stable`),[s,c]=(0,z.useState)({phase:`idle`}),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1),p=(0,z.useRef)(!1),m=window.__TAURI__?.core.invoke,h=Ib.includes(s.phase);(0,z.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>r(e.matches(`:popover-open`));return e.addEventListener(`toggle`,t),()=>e.removeEventListener(`toggle`,t)},[]),(0,z.useEffect)(()=>{if(!m)return;let e=!0;return m(`desktop_update_status`).then(t=>{if(!e)return;u(t.app_version),f(t.rollback_available===!0),t.state?.phase&&c(t.state);let n=t.state?.details?.channel??(t.app_version.includes(`-main.`)?`main`:`stable`);o(n),t.state?.phase||m(`desktop_update`,{action:`check`,channel:n}).then(t=>{e&&c(t)}).catch(t=>{e&&c(Rb(t))})}).catch(()=>{e&&c(Rb(null,`desktop_status_unavailable`))}),()=>{e=!1}},[m]),(0,z.useEffect)(()=>{if(!m||!h)return;let e=window.setInterval(()=>{m(`desktop_update_status`).then(e=>{e.state?.phase&&c(e.state)}).catch(()=>{})},1e3);return()=>window.clearInterval(e)},[m,h]);async function g(e){if(!(!m||p.current)){p.current=!0,c({phase:e===`check`?`checking`:e===`repair`?`installing_runtime`:`downloading`});try{if(!l){let e=await m(`desktop_update_status`);u(e.app_version),f(e.rollback_available===!0)}c(await m(`desktop_update`,{action:e,channel:a}))}catch(e){c(Rb(e,l?`update_failed`:`desktop_status_unavailable`))}finally{p.current=!1}}}let _={service_error:t?`运行时已安装,但服务尚未连接。可重试更新、修复或恢复上版。`:`Runtime installed, but services are unavailable. Retry updates, repair, or restore the previous version.`,runtime_pairing_required:t?`本机 CLI 运行时与 App 自带运行时不一致。回到 App 启动界面可「更新 App 与运行时」或「回退 CLI」。`:`This host's CLI runtime and the App's bundled runtime differ. On the App boot screen, update both or use the App's runtime.`,idle:t?`App 会检查可用更新,不会自动安装。`:`Updates are checked automatically, never installed without confirmation.`,runtime_required:t?`请完成匹配组件安装,或检查 App 更新。`:`Install matching components or check for an App update.`,connecting:t?`正在连接更新后的服务…`:`Connecting to updated services…`,checking:t?`正在检查更新…`:`Checking for updates…`,available:t?`新版本已就绪,一次更新 App 与匹配的运行时。`:`Update the App and its matching runtime together.`,up_to_date:t?`当前通道暂无更新。`:`No newer update on this channel.`,downloading:t?`正在下载并校验签名…`:`Downloading and verifying signature…`,installing_app:t?`正在安装 App,请保持窗口打开。`:`Installing the App. Keep this window open.`,installing_runtime:t?`正在安装匹配的运行时,请稍候…`:`Installing the matching runtime…`,restart_required:t?`重启后将自动完成运行时安装与服务连接。`:`Restart to finish runtime installation and reconnect services.`,ready:t?`更新完成,服务已就绪。`:`Update completed; services are ready.`,error:Lb[s.details?.code??``]?.[+!t]??(t?`更新未完成。请重试;启动失败可尝试修复当前版本。`:`Update incomplete. Retry; repair this version if startup fails.`)},v=h?t?`正在更新…`:`Updating…`:s.phase===`available`?t?`有可用更新`:`Update available`:s.phase===`restart_required`?t?`重启完成更新`:`Restart to finish`:s.phase===`error`?t?`更新需重试`:`Retry update`:t?`更新 LoopX`:`Update LoopX`;return(0,B.jsxs)(`div`,{className:`personal-desktop-update`,children:[(0,B.jsxs)(`button`,{className:`personal-update-trigger`,type:`button`,"aria-expanded":n,"aria-controls":`desktop-update-panel`,onClick:e=>{i.current?.style.setProperty(`bottom`,`${window.innerHeight-e.currentTarget.getBoundingClientRect().top+8}px`),i.current?.togglePopover()},children:[(0,B.jsx)(gm,{size:16,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:v}),(0,B.jsx)(lm,{size:14,"aria-hidden":`true`})]}),(0,B.jsxs)(`section`,{ref:i,popover:`auto`,id:`desktop-update-panel`,className:`personal-update-panel`,"aria-label":t?`LoopX 更新`:`LoopX updates`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:t?`LoopX 更新`:`LoopX updates`}),(0,B.jsx)(`button`,{type:`button`,"aria-label":t?`关闭更新面板`:`Close updates`,onClick:()=>i.current?.hidePopover(),children:(0,B.jsx)(oh,{size:16,"aria-hidden":`true`})})]}),(0,B.jsxs)(`small`,{children:[l,` · `,a===`main`?t?`main 预览版`:`main preview`:t?`稳定版`:`Stable`]}),s.details?.version?(0,B.jsxs)(`p`,{children:[t?`目标版本:`:`Target: `,s.details.version]}):null,(0,B.jsxs)(`p`,{role:`status`,"aria-live":`polite`,children:[h?(0,B.jsx)(Um,{className:`is-spinning`,size:14,"aria-hidden":`true`}):null,_[s.phase]]}),s.phase===`downloading`&&s.details?.total?(0,B.jsx)(`progress`,{"aria-label":t?`下载进度`:`Download progress`,max:s.details.total,value:s.details.received??0}):null,m?(0,B.jsx)(`div`,{className:`personal-update-actions`,children:s.phase===`restart_required`?(0,B.jsx)(`button`,{type:`button`,onClick:()=>void g(`restart`),children:t?`重启完成更新`:`Restart to finish`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>void g(`check`),children:t?`检查更新`:`Check for updates`}),s.phase===`available`?(0,B.jsx)(`button`,{type:`button`,onClick:()=>void g(`apply`),children:t?`更新并准备重启`:`Install update`}):null]})}):(0,B.jsx)(`p`,{children:t?`请在 LoopX App 中更新;浏览器自身无需安装包。`:`Update from the LoopX App; the browser needs no installer.`}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:t?`高级选项`:`Advanced options`}),(0,B.jsxs)(`label`,{children:[t?`更新通道`:`Update channel`,(0,B.jsxs)(`select`,{disabled:h||s.phase===`restart_required`,value:a,onChange:e=>{o(e.target.value),c({phase:`idle`})},children:[(0,B.jsx)(`option`,{value:`stable`,children:t?`稳定版(推荐)`:`Stable (recommended)`}),(0,B.jsx)(`option`,{value:`main`,children:t?`main 预览版`:`main preview`})]})]}),(0,B.jsx)(`p`,{children:t?`App 与匹配的 CLI 一起更新,服务可能短暂断开。不删除 Goal 数据。`:`Updates the App and matching CLI. Services may briefly disconnect. Goal data is not deleted.`}),m?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{children:t?`启动失败时,可重装当前 App 随附的运行时。`:`If startup fails, reinstall this App's bundled runtime.`}),(0,B.jsx)(`button`,{disabled:h||s.phase===`restart_required`,type:`button`,onClick:()=>void g(`repair`),children:t?`修复当前版本`:`Repair this version`})]}):null,m&&d?(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:t?`恢复上个版本`:`Restore previous version`}),(0,B.jsx)(`p`,{children:t?`将恢复已保留的 App 和它的运行时,需要重启。`:`Restore the retained App and its runtime, then restart.`}),(0,B.jsx)(`button`,{disabled:h,type:`button`,onClick:()=>void g(`rollback`),children:t?`确认恢复上版`:`Restore previous version`})]}):null]})]})]})}var Bb=e=>`loopx-sidebar-goal-order-v1:${encodeURIComponent(e)}`;function Vb(e){try{let t=JSON.parse(e??`null`);return Array.isArray(t)&&t.every(e=>typeof e==`string`)?[...new Set(t)]:[]}catch{return[]}}function Hb(e,t){let n=new Map(t.map((e,t)=>[e,t]));return[...e].sort((e,t)=>(n.get(e.goalId)??1/0)-(n.get(t.goalId)??1/0))}function Ub(e,t,n,r,i){if(n===r||!t.includes(n)||!t.includes(r))return e;let a=[...new Set([...e,...t])].filter(e=>e!==n);return a.splice(a.indexOf(r)+Number(i),0,n),a}function Wb(e,t){let n=Bb(t),[r,i]=(0,z.useState)(()=>{try{return Vb(localStorage.getItem(n))}catch{return[]}}),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(null),[l,u]=(0,z.useState)(null),d=(0,z.useRef)(null),f=(0,z.useRef)(!1),p=Hb(e,r),m=p.map(e=>e.goalId);function h(t,a,s){let l=Ub(r,m,t,a,s);if(l===r)return;i(l);let u=Hb(e,l),d=u.findIndex(e=>e.goalId===t),f=u[d];f&&c({title:f.title,position:d+1});try{localStorage.setItem(n,JSON.stringify(l)),o(!1)}catch{o(!0)}}function g(){d.current=null,u(null)}return{sorted:p,target:l,saveFailed:a,lastMoved:s,move:h,moveBy(e,t){let n=p[m.indexOf(e)+t];n&&h(e,n.goalId,t===1)},pointerProps:e=>({onPointerDown(t){f.current=!1,t.pointerType===`mouse`&&t.button===0&&(d.current={id:e,x:t.clientX,y:t.clientY,dragging:!1},t.currentTarget.setPointerCapture(t.pointerId))},onPointerMove(e){let t=d.current;if(!t||!t.dragging&&Math.hypot(e.clientX-t.x,e.clientY-t.y)<6)return;t.dragging=!0,f.current=!0;let n=document.elementFromPoint(e.clientX,e.clientY)?.closest(`[data-reorder-goal]`),r=e.currentTarget.closest(`.personal-goal-list`),i=n?.dataset.reorderGoal;if(!n||!i||!r?.contains(n)||i===t.id){u(null);return}let a=n.getBoundingClientRect();u({id:i,after:e.clientY>a.top+a.height/2})},onPointerUp(){d.current?.dragging&&l&&h(d.current.id,l.id,l.after),g()},onPointerCancel:g,onLostPointerCapture:g,onKeyDown(e){e.key===`Escape`&&g()},onClickCapture(e){f.current&&=(e.preventDefault(),e.stopPropagation(),!1)}})}}var Gb=`/ssh-hosts`,Kb=/^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/;function qb(e){return typeof e==`string`&&Kb.test(e.trim())}function Jb(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`SSH Host 列表响应无效。`);let t=e;if(t.ok!==!0||t.schema_version!==`ssh_host_catalog_v0`||!Array.isArray(t.hosts))throw Error(`SSH Host 列表协议不兼容,请更新本机 LoopX 服务。`);let n=new Set;return{hosts:t.hosts.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=String(e.alias??``).trim();return!qb(t)||n.has(t)?[]:(n.add(t),[{alias:t}])}),schemaVersion:`ssh_host_catalog_v0`}}async function Yb(e=fetch,t=Gb){let n=await e(t,{cache:`no-store`});if(!n.ok)throw Error(`无法读取本机 SSH Host(HTTP ${n.status})。`);return Jb(await n.json())}function Xb(e,t){let n=e.trim();if(!qb(n))return{error:`请选择有效的 SSH Host。`};let r=Number(t);return!Number.isInteger(r)||r<1024||r>65535?{error:`本地端口必须是 1024–65535 之间的整数。`}:{command:`ssh -N -L ${r}:127.0.0.1:8766 ${n}`,hostAlias:n,label:n,statusUrl:`http://127.0.0.1:${r}/status.json`}}var Zb=`/api/ssh-source/ensure`,Qb=`/api/ssh-source/goal-lifecycle`;async function $b(e,t){let n=await fetch(Zb,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({host_alias:e,local_port:Number(t)})}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error??`无法建立 SSH 隧道来源。`);if(!r?.ok)throw Error(`无法建立 SSH 隧道来源。`);return r}async function ex(e,t,n,r,i=fetch){let a=await i(Qb,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({goal_id:t,host_alias:e,operation:n,reason:r})}),o=await a.json().catch(()=>null);if(!a.ok)throw Error(o?.error??`无法更新远端 Goal 生命周期。`);if(!o?.ok||o.schema_version!==`loopx_remote_goal_lifecycle_v1`||o.goal_id!==t||o.host_alias!==e||o.operation!==n||o.activation_state!==(n===`stop`?`stopped`:`active`)||o.projection_verified!==!0)throw Error(`远端 Goal 生命周期回读未验证。`);return o}function tx({activeSource:e,connectionState:t,errorMessage:n,onAdd:r,onConfiguredHostsLoaded:i,onRemove:a,onSelect:o,sources:s}){let{t:c}=Ji(),[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(null),[p,m]=(0,z.useState)(`configured`),[h,g]=(0,z.useState)([]),[_,v]=(0,z.useState)(null),[y,b]=(0,z.useState)(!1),[x,S]=(0,z.useState)(!1),[C,w]=(0,z.useState)(``),[T,E]=(0,z.useState)(``),[D,O]=(0,z.useState)(`8876`),[k,ee]=(0,z.useState)(``),te=`configured:`,A=[...s.map(e=>({label:e.label,value:e.id})),...h.filter(e=>!s.some(t=>t.label===e.alias)).map(e=>({group:c(`source.configuredGroup`,{count:h.length}),label:e.alias,value:`${te}${e.alias}`}))],j=(0,z.useMemo)(()=>h.some(e=>e.alias===C)?Xb(C,D):{error:c(`source.selectHost`)},[h,C,D,c]);(0,z.useEffect)(()=>{M()},[]);async function M(){b(!0),v(null);try{let e=await Yb();g(e.hosts),i?.(e.hosts.map(e=>e.alias)),w(t=>t||e.hosts[0]?.alias||``),e.hosts.length||v(c(`source.hostEmpty`))}catch(e){v(e instanceof Error?e.message:c(`source.hostLoadError`))}finally{b(!1)}}function ne(){u(!0),m(`configured`),f(null),M()}function N(){u(!1),m(`configured`),v(null),S(!1),w(``),f(null),E(``),O(`8876`),ee(``)}function P(){let e=r({label:T,statusUrl:k});if(e.error){f(e.error);return}N()}function re(){if(`error`in j){f(j.error??c(`source.invalid`));return}let e=r({ensureTunnel:!0,hostAlias:j.hostAlias,label:j.label,statusUrl:j.statusUrl});if(e.error){f(e.error);return}N()}function ie(e){let t=new Set;for(let e of s)try{t.add(new URL(e.statusUrl).port)}catch{}let n=`8877`;for(let e=8877;e<9077;e+=1)if(!t.has(String(e))){n=String(e);break}let i=Xb(e,n);if(`error`in i){f(i.error??c(`source.invalid`));return}let a=r({ensureTunnel:!0,hostAlias:i.hostAlias,label:i.label,statusUrl:i.statusUrl});a.error?f(a.error):f(null),O(n)}async function ae(){if(`error`in j){f(j.error??c(`source.invalid`));return}try{await navigator.clipboard.writeText(j.command),S(!0),f(null)}catch{f(c(`source.copyError`))}}return(0,B.jsxs)(`section`,{"aria-label":c(`source.controlPlane`),className:`personal-status-source`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`span`,{children:`Control plane`}),(0,B.jsx)(`button`,{"aria-label":c(`source.addSsh`),onClick:ne,title:c(`source.add`),type:`button`,children:(0,B.jsx)(Vm,{size:14})})]}),(0,B.jsx)(rb,{ariaLabel:c(`source.select`),className:`personal-status-source-select`,icon:(0,B.jsx)(Ym,{size:15}),onChange:e=>{if(e.startsWith(te)){ie(e.slice(11));return}o(e)},options:A,value:e.id}),(0,B.jsxs)(`div`,{className:`personal-status-source-meta`,children:[(0,B.jsxs)(`span`,{className:`is-${t}`,children:[(0,B.jsx)(`i`,{}),c(t===`loading`?`source.connecting`:t===`error`?`source.notAvailable`:`source.connected`)]}),(0,B.jsx)(`small`,{children:e.readOnly?c(`source.readOnly`):c(`source.localInteractive`)}),e.kind===`ssh_tunnel`?(0,B.jsx)(`button`,{"aria-label":c(`source.remove`,{source:e.label}),onClick:()=>a(e.id),title:c(`source.removeCurrent`),type:`button`,children:(0,B.jsx)(rh,{size:12})}):null]}),n?(0,B.jsx)(`p`,{className:`personal-status-source-error`,role:`alert`,children:n}):null,l?(0,B.jsxs)(`div`,{className:`personal-status-source-form`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:c(`source.addSsh`)}),(0,B.jsx)(`button`,{"aria-label":c(`source.closeForm`),onClick:N,type:`button`,children:(0,B.jsx)(oh,{size:13})})]}),(0,B.jsxs)(`div`,{"aria-label":c(`source.addMethod`),className:`personal-status-source-modes`,role:`tablist`,children:[(0,B.jsx)(`button`,{"aria-selected":p===`configured`,onClick:()=>{m(`configured`),f(null)},role:`tab`,type:`button`,children:c(`source.configured`)}),(0,B.jsx)(`button`,{"aria-selected":p===`manual`,onClick:()=>{m(`manual`),f(null)},role:`tab`,type:`button`,children:c(`source.manual`)})]}),p===`configured`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:c(`source.configuredCount`,{count:h.length})}),(0,B.jsxs)(`span`,{className:`personal-status-source-field-row`,children:[(0,B.jsx)(`input`,{"aria-label":c(`source.host`),disabled:y||!h.length,list:`loopx-configured-ssh-hosts`,onChange:e=>{w(e.target.value),S(!1)},placeholder:c(y?`source.loadingHosts`:`source.hostPlaceholder`),value:C}),(0,B.jsx)(`datalist`,{id:`loopx-configured-ssh-hosts`,children:h.map(e=>(0,B.jsx)(`option`,{value:e.alias},e.alias))}),(0,B.jsx)(`button`,{"aria-label":c(`source.refreshHosts`),disabled:y,onClick:()=>void M(),title:c(`source.refreshHosts`),type:`button`,children:(0,B.jsx)(Gm,{size:13})})]})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:c(`source.localPort`)}),(0,B.jsx)(`input`,{"aria-label":c(`source.localPort`),inputMode:`numeric`,onChange:e=>{O(e.target.value),S(!1)},value:D})]}),(0,B.jsxs)(`div`,{className:`personal-status-source-command`,children:[(0,B.jsx)(`code`,{children:`error`in j?c(`source.tunnelCommandPending`):j.command}),(0,B.jsxs)(`button`,{"aria-label":c(`source.copyCommand`),disabled:`error`in j,onClick:()=>void ae(),type:`button`,children:[(0,B.jsx)(mm,{size:12}),c(x?`source.copied`:`source.copy`)]})]}),_?(0,B.jsx)(`p`,{className:`is-error`,children:_}):null,(0,B.jsx)(`p`,{children:c(`source.description`)}),(0,B.jsx)(`button`,{className:`personal-status-source-add`,disabled:`error`in j,onClick:re,type:`button`,children:c(`source.addConfigured`)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:c(`source.name`)}),(0,B.jsx)(`input`,{autoFocus:!0,maxLength:48,onChange:e=>E(e.target.value),placeholder:c(`source.namePlaceholder`),value:T})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:c(`source.statusUrl`)}),(0,B.jsx)(`input`,{onChange:e=>ee(e.target.value),placeholder:`http://127.0.0.1:8876/status.json`,value:k})]}),(0,B.jsx)(`p`,{children:(0,B.jsx)(`code`,{children:`ssh -N -L 8876:127.0.0.1:8766 `})}),(0,B.jsx)(`p`,{children:c(`source.manualDescription`)}),(0,B.jsx)(`button`,{className:`personal-status-source-add`,onClick:P,type:`button`,children:c(`source.addConfigured`)})]}),d?(0,B.jsx)(`p`,{className:`is-error`,role:`alert`,children:d}):null]}):null]})}var nx={需修复:`is-danger`,等你:`is-warning`,等待条件:`is-info`,推进中:`is-success`,安静运行:`is-quiet`,已完成:`is-quiet`,已停止:`is-stopped`};function rx({attentionCount:e,goals:t,goalArchiveLoadState:n={error:null,phase:`ready`},lifecycleBusyGoalIds:r,goalLifecycleOperations:i,onRequestGoalCreate:a,onOpenSettings:o,onRetryGoalArchive:s,onRequestGoalLifecycle:c,onSelectGoal:l,selectedGoalId:u,statusSourceControl:d}){let{locale:f,t:p}=Ji(),[m,h]=(0,z.useState)(!1),g=Wb(t.filter(e=>e.activationState!==`stopped`),d?.activeSource.statusUrl??`/status.json`),_=g.sorted,v=t.filter(e=>e.activationState===`stopped`),y=e=>!!c&&(!i||i.includes(e)),b=(e,t)=>(0,B.jsxs)(`div`,{className:`personal-goal-row${g.target?.id===e.goalId?g.target.after?` is-drop-after`:` is-drop-before`:``}`,"data-reorder-goal":t?void 0:e.goalId,"data-load-error":e.loadError,children:[(0,B.jsxs)(`button`,{...t?{}:g.pointerProps(e.goalId),title:t?void 0:p(`sidebar.dragGoal`),"aria-current":u===e.goalId?`page`:void 0,className:`personal-goal-link`,onClick:()=>l(e.goalId),type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-goal-state-dot ${e.loadState?``:nx[e.state]}`}),(0,B.jsxs)(`span`,{className:`personal-goal-link-copy`,children:[(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsxs)(`small`,{children:[e.loadState&&(!t||u===e.goalId)?p(e.loadState===`error`?`startup.goalError`:`startup.goalLoading`):Yi(e.state,f),e.needsYou&&!t?` · ${p(`home.lane.needsYou`)}`:``]})]}),(0,B.jsx)(cm,{size:15})]}),!t&&m?(0,B.jsxs)(`div`,{className:`personal-goal-move-actions`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":p(`sidebar.moveUp`,{goal:e.title}),disabled:_[0]?.goalId===e.goalId,onClick:()=>g.moveBy(e.goalId,-1),children:(0,B.jsx)(em,{"aria-hidden":`true`,size:13})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":p(`sidebar.moveDown`,{goal:e.title}),disabled:_.at(-1)?.goalId===e.goalId,onClick:()=>g.moveBy(e.goalId,1),children:(0,B.jsx)(Xp,{"aria-hidden":`true`,size:13})})]}):null,c&&y(t?`resume`:`stop`)?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{"aria-label":`${p(t?`sidebar.resume`:`sidebar.stop`)} ${e.title}`,"aria-busy":r?.has(e.goalId)||void 0,className:`personal-goal-lifecycle${r?.has(e.goalId)?` is-pending`:``}`,disabled:r?.has(e.goalId),onClick:()=>c(e,t?`resume`:`stop`),title:p(t?`sidebar.resumeGoal`:`sidebar.stopGoal`),type:`button`,children:r?.has(e.goalId)?(0,B.jsx)(Am,{size:13}):t?(0,B.jsx)(Wm,{size:13}):(0,B.jsx)(zm,{size:13})}),t&&y(`delete`)?(0,B.jsx)(`button`,{"aria-label":`${p(`sidebar.delete`)} ${e.title}`,className:`personal-goal-lifecycle personal-goal-delete`,onClick:()=>c(e,`delete`),title:p(`sidebar.deleteGoal`),type:`button`,children:(0,B.jsx)(rh,{size:13})}):null]}):null]},e.goalId);return(0,B.jsxs)(`div`,{className:`personal-goal-directory`,children:[(0,B.jsxs)(`div`,{className:`personal-sidebar-brand`,children:[(0,B.jsx)(`span`,{className:`personal-brand-mark`,children:(0,B.jsx)(rm,{size:18})}),(0,B.jsx)(`span`,{children:(0,B.jsx)(`strong`,{children:`LoopX`})})]}),d?(0,B.jsx)(tx,{...d}):null,(0,B.jsxs)(`nav`,{"aria-label":p(`home.workspace`),className:`personal-sidebar-nav`,children:[(0,B.jsxs)(`button`,{"aria-current":u===null?`page`:void 0,className:`personal-manager-link`,onClick:()=>l(null),type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-manager-icon`,children:(0,B.jsx)(rm,{size:17})}),(0,B.jsx)(`span`,{children:p(`sidebar.manager`)}),e>0?(0,B.jsx)(`span`,{className:`personal-sidebar-count`,children:e}):null,(0,B.jsx)(cm,{size:15})]}),(0,B.jsxs)(`div`,{className:`personal-sidebar-section-title`,children:[(0,B.jsx)(`span`,{children:`Goals`}),(0,B.jsxs)(`span`,{className:`personal-sidebar-title-actions`,children:[(0,B.jsx)(`small`,{children:_.length}),(0,B.jsx)(`button`,{"aria-label":p(`sidebar.sortGoals`),title:p(`sidebar.sortGoals`),"aria-pressed":m,onClick:()=>h(!m),type:`button`,children:(0,B.jsx)($p,{"aria-hidden":`true`,size:15})}),a?(0,B.jsx)(`button`,{"aria-label":p(`sidebar.createGoal`),onClick:a,type:`button`,children:(0,B.jsx)(Vm,{size:15})}):null]})]}),g.saveFailed?(0,B.jsx)(`p`,{role:`status`,children:p(`sidebar.orderNotSaved`)}):null,(0,B.jsx)(`span`,{className:`personal-sr-only`,role:`status`,children:g.lastMoved?p(`sidebar.goalMoved`,{goal:g.lastMoved.title,position:g.lastMoved.position}):``}),(0,B.jsx)(`div`,{className:`personal-goal-list`,children:_.map(e=>b(e,!1))}),v.length||n.phase===`loading`||n.phase===`error`?(0,B.jsxs)(`details`,{className:`personal-stopped-goals`,open:n.phase===`error`||void 0,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(sm,{size:13}),(0,B.jsx)(`span`,{children:p(`sidebar.stopped`)}),n.phase===`loading`?(0,B.jsx)(Am,{"aria-label":p(`sidebar.stoppedLoading`),className:`is-spinning`,size:13}):(0,B.jsx)(`small`,{children:v.length})]}),(0,B.jsxs)(`div`,{className:`personal-goal-list is-stopped`,children:[n.phase===`error`?(0,B.jsxs)(`div`,{className:`personal-stopped-goal-error`,role:`alert`,children:[(0,B.jsx)(`span`,{children:p(`sidebar.stoppedLoadFailed`)}),s?(0,B.jsx)(`button`,{onClick:s,type:`button`,children:p(`sidebar.retryStopped`)}):null]}):null,v.map(e=>b(e,!0))]})]}):null]}),(0,B.jsxs)(`div`,{className:`personal-sidebar-footer`,children:[(0,B.jsx)(zb,{}),o?(0,B.jsxs)(`button`,{"aria-label":p(`settings.open`),className:`personal-sidebar-utility`,onClick:o,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-sidebar-utility-icon`,children:(0,B.jsx)(Xm,{size:17})}),(0,B.jsx)(`span`,{className:`personal-sidebar-utility-copy`,children:(0,B.jsx)(`strong`,{children:p(`settings.open`)})}),(0,B.jsx)(cm,{"aria-hidden":`true`,size:15})]}):null]})]})}var ix=J({ok:X(!0),total:G().int().nonnegative(),next_cursor:W().nullable(),items:q(J({todo_id:W(),text:W(),claimed_by:W().nullable(),evidence:W().nullable(),priority:W().nullable(),task_class:W().nullable()})).max(40)});function ax({goal:e,agentId:t,seed:n,enabled:r,listView:i=!1,onSelect:a}){let{t:o}=Ji(),s=(0,z.useId)(),[c,l]=(0,z.useState)(!1),u=!i||c,d=i?96:148,[f,p]=(0,z.useState)(n),[m,h]=(0,z.useState)(t===`all`?e.doneTodoCount??n.length:n.length),[g,_]=(0,z.useState)(void 0),[v,y]=(0,z.useState)(!1),[b,x]=(0,z.useState)(!1),[S,C]=(0,z.useState)(!1),[w,T]=(0,z.useState)({top:0,height:600}),[E,D]=(0,z.useState)(null),O=(0,z.useRef)(null),k=(0,z.useRef)(null),[ee,te]=(0,z.useState)(0);(0,z.useEffect)(()=>{let e=O.current;if(!e)return;let t=new ResizeObserver(()=>T({top:e.scrollTop,height:e.clientHeight}));return t.observe(e),()=>{t.disconnect(),k.current?.abort()}},[]);let A=g===void 0||w.top+w.height>=f.length*d-d*2;(0,z.useEffect)(()=>{if(!r||!u||!A||g===null||b||k.current)return;let n=new AbortController;k.current=n,y(!0);let i=new URLSearchParams({goal_id:e.goalId});t!==`all`&&i.set(`agent_id`,t),g&&i.set(`cursor`,g),fetch(`/api/chat/completed-todos?${i}`,{signal:n.signal}).then(async e=>{if(e.status===409&&C(!0),!e.ok)throw Error(`history unavailable`);let t=ix.parse(await e.json());if(n.signal.aborted)return;let r=t.items.map(e=>({todoId:e.todo_id,text:e.text,claimedBy:e.claimed_by,evidence:e.evidence,priority:e.priority,taskClass:e.task_class,done:!0,status:`done`}));p(e=>g===void 0?r:[...e,...r.filter(t=>!e.some(e=>e.todoId===t.todoId))]),h(t.total),_(t.next_cursor)}).catch(()=>{n.signal.aborted||x(!0)}).finally(()=>{n.signal.aborted||(k.current=null,y(!1))})},[r,u,A,g,b,ee,e.goalId,t,v]),(0,z.useEffect)(()=>{O.current&&(O.current.scrollTop=0),T({top:0,height:O.current?.clientHeight??600}),D(null)},[i]);let j=Math.max(0,Math.floor(w.top/d)-3),M=Math.min(f.length,Math.ceil((w.top+w.height)/d)+3),ne=Array.from({length:Math.max(0,M-j)},(e,t)=>j+t);return E!==null&&El(e=>!e),children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,children:c?`▾`:`▸`}),` `,o(`tasks.completed`)]}):(0,B.jsxs)(`strong`,{children:[(0,B.jsx)(`i`,{"aria-hidden":`true`,className:`personal-kanban-dot tone-done`}),o(`tasks.completed`)]}),(0,B.jsx)(`span`,{children:m})]}),(0,B.jsxs)(`div`,{id:s,hidden:!u,"aria-label":o(`tasks.completed`),className:`personal-task-lane-scroll`,ref:O,role:`region`,tabIndex:0,onScroll:e=>T({top:e.currentTarget.scrollTop,height:e.currentTarget.clientHeight}),children:[(0,B.jsx)(`div`,{className:`personal-completed-window`,style:{height:f.length*d},children:ne.map(t=>{let n=f[t];return(0,B.jsx)(`div`,{className:`personal-task-card personal-completed-row`,style:{top:t*d,height:d},children:(0,B.jsxs)(`button`,{type:`button`,onFocus:()=>D(t),onBlur:()=>D(null),onClick:()=>a({kind:`todo`,item:{...n,goalId:e.goalId,goalTitle:e.title,ownerLabel:n.claimedBy??e.agentLabel??e.agentId}}),children:[(0,B.jsx)(`span`,{className:`is-done`,children:`✓`}),(0,B.jsx)(`strong`,{children:n.text}),(0,B.jsx)(`small`,{children:n.claimedBy??e.agentLabel??e.agentId})]})},n.todoId)})}),(0,B.jsx)(`div`,{className:`personal-completed-footer`,role:`status`,children:v?o(`tasks.historyLoading`):b?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{children:o(S?`tasks.historyExpired`:`tasks.historyError`)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{S&&(_(void 0),O.current&&(O.current.scrollTop=0)),C(!1),x(!1),te(e=>e+1)},children:o(`tasks.historyRetry`)})]}):r?g===null?o(`tasks.historyEnd`):(0,B.jsx)(`button`,{type:`button`,onClick:()=>{O.current&&(O.current.scrollTop=f.length*d)},children:o(`tasks.historyMore`)}):o(`tasks.historyLocalOnly`)})]})]})}function ox({children:e,count:t,label:n,tone:r,listView:i=!1}){let a=(0,z.useId)(),o=(0,z.useRef)(null),s=(0,z.useRef)([]),c=(0,z.useRef)(null),[l,u]=(0,z.useState)({after:!1,before:!1}),d=(0,z.useCallback)(()=>{let e=o.current;if(!e)return;let t={after:Math.max(0,e.scrollHeight-e.clientHeight)-e.scrollTop>1,before:e.scrollTop>1};u(e=>e.after===t.after&&e.before===t.before?e:t)},[]);return(0,z.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(d);return c.current=t,t.observe(e),e.addEventListener(`scroll`,d,{passive:!0}),d(),()=>{t.disconnect(),c.current=null,s.current=[],e.removeEventListener(`scroll`,d)}},[i,d]),(0,z.useEffect)(()=>{let e=o.current,t=c.current;if(!e||!t)return;for(let e of s.current)t.unobserve(e);let n=Array.from(e.children).filter(e=>e instanceof HTMLElement);for(let e of n)t.observe(e);s.current=n,d()},[e,t,i,d]),i?!t&&r!==`done`?null:(0,B.jsxs)(`details`,{className:`personal-task-group tone-${r}`,open:!0,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(sm,{size:16}),(0,B.jsx)(`strong`,{children:n}),(0,B.jsx)(`span`,{children:t})]}),(0,B.jsx)(`div`,{className:`personal-task-list-rows`,children:e})]}):(0,B.jsxs)(`section`,{className:`personal-object-list personal-task-lane`,children:[(0,B.jsxs)(`header`,{id:a,children:[(0,B.jsxs)(`strong`,{children:[(0,B.jsx)(`i`,{"aria-hidden":`true`,className:`personal-kanban-dot tone-${r}`}),n]}),(0,B.jsx)(`span`,{children:t})]}),(0,B.jsx)(`div`,{"aria-labelledby":a,className:`personal-task-lane-scroll${l.before?` has-overflow-before`:``}${l.after?` has-overflow-after`:``}`,ref:o,role:`region`,tabIndex:t>0?0:-1,children:e})]})}function sx({historyEnabled:e=!1,goal:t,items:n,onDraftTaskFromMessage:r,onOpenChat:i,onQuickComplete:a,quickCompletingTodoIds:o,onSelect:s,selectedTodoId:c=null,userTodos:l}){let{t:u}=Ji(),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)({goalId:``,laneId:`all`}),h=(0,z.useRef)(null);(0,z.useEffect)(()=>{if(!c)return;let e=window.requestAnimationFrame(()=>h.current?.scrollIntoView({block:`nearest`,inline:`nearest`}));return()=>window.cancelAnimationFrame(e)},[c]);let g=l.filter(e=>e.goalId===t.goalId).map(e=>({...e,goalTitle:t.title})),_=e=>e.priority===`P0`?0:e.priority===`P1`?1:e.priority===`P2`?2:3,v=(0,z.useMemo)(()=>{let e=new Map((t.agentLanes??[]).map(e=>[e.agentId,e]));for(let n of t.agentTodos)n.claimedBy&&!e.has(n.claimedBy)&&e.set(n.claimedBy,{agentId:n.claimedBy,label:n.claimedBy});return[...e.values()]},[t.agentLanes,t.agentTodos]),y=p.goalId===t.goalId&&v.some(e=>e.agentId===p.laneId)?p.laneId:`all`,b=e=>y===`all`||e===y,x=t.agentTodos.filter(e=>e.taskClass!==`continuous_monitor`&&!e.done).filter(e=>b(e.claimedBy)).sort((e,t)=>_(e)-_(t)),S=t.agentTodos.filter(e=>e.taskClass!==`continuous_monitor`&&e.done).filter(e=>b(e.claimedBy)),C=n.filter(e=>e.kind===`schedule`&&b(e.schedule.agentId)),w=n.filter(e=>e.kind===`run`&&!!e.run.todoId&&b(e.run.agentId)),T=!g.length&&!x.length&&!S.length&&!C.length,E=n.filter(e=>e.kind===`message`&&(e.message.role===`user`||e.message.role===`assistant`)),D=E.reduce((e,t,n)=>t.message.role===`user`?n:e,-1),O=D>=0?E[D]?.message:null,k=D>=0?E.slice(D+1).reverse().find(e=>e.message.role===`assistant`)?.message:null,ee=D>=0&&E.slice(D+1).some(e=>e.message.role===`assistant`&&e.message.pending);return(0,B.jsxs)(`section`,{"aria-label":u(`header.tasks`),className:`personal-task-board${d?` is-list-view`:``}`,children:[(0,B.jsxs)(`header`,{className:`personal-task-view-toolbar`,children:[(0,B.jsx)(`div`,{children:(0,B.jsx)(`strong`,{children:u(`header.tasks`)})}),(0,B.jsxs)(`div`,{className:`personal-task-view-switch`,role:`group`,"aria-label":u(`tasks.viewLabel`),children:[(0,B.jsx)(`button`,{type:`button`,"aria-pressed":d,onClick:()=>f(!0),children:u(`tasks.listView`)}),(0,B.jsx)(`button`,{type:`button`,"aria-pressed":!d,onClick:()=>f(!1),children:u(`tasks.boardView`)})]})]}),v.length>1?(0,B.jsxs)(`section`,{"aria-label":u(`tasks.agentLaneFilter`),className:`personal-task-lane-filter`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(rm,{size:15}),(0,B.jsx)(`span`,{children:(0,B.jsx)(`strong`,{children:u(`tasks.agentLane`)})})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{className:`sr-only`,children:u(`tasks.agentLaneFilter`)}),(0,B.jsxs)(`select`,{"aria-label":u(`tasks.agentLaneFilter`),onChange:e=>m({goalId:t.goalId,laneId:e.target.value}),value:y,children:[(0,B.jsx)(`option`,{value:`all`,children:u(`tasks.allAgentLanes`,{count:v.length})}),v.map(e=>(0,B.jsx)(`option`,{value:e.agentId,children:e.label},e.agentId))]}),(0,B.jsx)(sm,{"aria-hidden":!0,size:14})]})]}):null,O?(0,B.jsxs)(`section`,{"aria-label":u(`tasks.chatRecent`),className:`personal-task-chat-receipt`,children:[(0,B.jsx)(`span`,{className:`personal-task-chat-icon`,children:(0,B.jsx)(Pm,{size:18})}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:u(ee?`tasks.chatPending`:k?`tasks.chatAgentReplied`:`tasks.chatRecent`)}),(0,B.jsx)(`small`,{children:k?.returnDelivery?u(`tasks.chatReturn`):k?.agentLabel})]}),(0,B.jsxs)(`p`,{className:`is-user`,children:[(0,B.jsx)(`b`,{children:u(`common.you`)}),O.text]}),k&&!k.pending?(0,B.jsxs)(`p`,{className:`is-assistant`,children:[(0,B.jsx)(`b`,{children:k.returnDelivery?u(`tasks.chatReturn`):k.agentLabel??u(`common.agent`)}),k.text]}):null,(0,B.jsx)(`small`,{children:u(ee?`tasks.chatPendingDescription`:`tasks.chatUnchangedDescription`)})]}),(0,B.jsxs)(`footer`,{children:[(0,B.jsxs)(`button`,{onClick:i,type:`button`,children:[(0,B.jsx)(Pm,{size:14}),u(`tasks.chatViewReply`)]}),k&&!ee&&r?(0,B.jsxs)(`button`,{onClick:()=>r(k.text),type:`button`,children:[(0,B.jsx)(km,{size:14}),u(`tasks.convertToTask`)]}):null]})]}):null,(0,B.jsxs)(`div`,{className:d?`personal-task-grouped-list`:`personal-task-kanban`,children:[(0,B.jsxs)(ox,{listView:d,count:g.length,label:u(`timeline.waitingConfirmation`),tone:`attention`,children:[g.map(e=>{let t=Zi(e.updatedAt,u);return(0,B.jsxs)(`button`,{onClick:()=>s({item:e,kind:`attention`}),type:`button`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`is-attention`,children:`!`}),(0,B.jsx)(`strong`,{children:e.text}),(0,B.jsxs)(`small`,{children:[(0,B.jsx)(`span`,{className:`personal-row-status ${e.blocking?`is-blocking`:`is-pending`}`,children:e.blocking?u(`tasks.blocked`):u(`tasks.pending`)}),t?(0,B.jsx)(`span`,{className:`personal-task-age`,children:u(`tasks.waitingAge`,{age:t})}):null]})]},e.todoId)}),g.length?null:(0,B.jsx)(`p`,{className:`personal-task-empty`,children:u(`tasks.emptyConfirm`)})]}),(0,B.jsxs)(ox,{listView:d,count:x.length,label:u(`tasks.pendingAndRunning`),tone:`progress`,children:[x.map(e=>{let n={...e,goalId:t.goalId,goalTitle:t.title,ownerLabel:e.claimedBy??t.agentLabel??t.agentId},r=w.find(t=>t.run.todoId===e.todoId)?.run;return(0,B.jsxs)(`div`,{className:`personal-task-card${r?` has-session`:``}${c===e.todoId?` is-selected`:``}`,ref:c===e.todoId?e=>{h.current=e}:void 0,children:[(0,B.jsxs)(`button`,{"aria-pressed":c===e.todoId,onClick:()=>s({item:n,kind:`todo`}),type:`button`,children:[(0,B.jsx)(`span`,{children:`○`}),(0,B.jsx)(`strong`,{children:e.text}),(0,B.jsxs)(`small`,{children:[e.priority?(0,B.jsx)(`span`,{className:`personal-priority-badge is-${e.priority.toLowerCase()}`,children:e.priority}):null,e.status===`blocked`?(0,B.jsx)(`span`,{className:`personal-priority-badge is-blocked`,children:u(`tasks.blocked`)}):null,r?(0,B.jsx)(`span`,{className:`personal-task-session-status`,children:r.status===`running`||r.status===`queued`?u(`runs.running`):r.status===`failed`?u(`tasks.sessionError`):u(`common.waiting`)}):null,e.status===`deferred`?(0,B.jsx)(`span`,{className:`personal-task-session-status`,children:u(`drawer.taskStatusDeferred`)}):r?null:(0,B.jsx)(`span`,{className:`personal-task-session-status`,children:u(`tasks.waiting`)}),e.claimedBy??t.agentLabel??t.agentId]})]}),(0,B.jsxs)(`div`,{className:`personal-task-card-actions`,children:[r?(0,B.jsxs)(`button`,{className:`personal-task-session-link`,"aria-label":u(`tasks.openExecution`,{name:e.text}),onClick:()=>s({item:r,kind:`run`}),title:r.status===`completed`?u(`tasks.viewResult`):u(`tasks.viewExecution`),type:`button`,children:[(0,B.jsx)(vm,{size:14}),(0,B.jsx)(`span`,{children:r.status===`completed`?u(`tasks.viewResult`):u(`tasks.viewExecution`)})]}):null,a?(0,B.jsx)(`button`,{"aria-busy":o?.has(e.todoId)||void 0,"aria-label":u(`tasks.markComplete`,{name:e.text}),disabled:o?.has(e.todoId),onClick:()=>void a(n),title:u(`tasks.completed`),type:`button`,children:o?.has(e.todoId)?(0,B.jsx)(Am,{className:`personal-spin`,size:14}):(0,B.jsx)(om,{size:14})}):null,(0,B.jsx)(`button`,{"aria-label":u(`tasks.moreActions`,{name:e.text}),onClick:()=>s({item:n,kind:`todo`}),title:u(`common.actions`),type:`button`,children:(0,B.jsx)(_m,{size:14})})]})]},e.todoId)}),x.length?null:(0,B.jsx)(`p`,{className:`personal-task-empty`,children:u(`tasks.emptyRunning`)})]}),(0,B.jsxs)(ox,{listView:d,count:C.length,label:u(`tasks.scheduled`),tone:`schedule`,children:[C.map(e=>(0,B.jsxs)(`button`,{onClick:()=>s({item:e.schedule,kind:`schedule`}),type:`button`,children:[(0,B.jsx)(`span`,{children:`◷`}),(0,B.jsx)(`strong`,{children:e.schedule.label}),(0,B.jsx)(`small`,{children:e.schedule.status===`paused`?u(`schedule.paused`):u(`schedule.active`)})]},e.id)),C.length?null:(0,B.jsx)(`p`,{className:`personal-task-empty`,children:u(`tasks.emptySchedules`)})]}),(0,B.jsx)(ax,{goal:t,agentId:y,seed:S,enabled:e,listView:d,onSelect:s},`${t.goalId}:${y}:${e}`)]}),T?(0,B.jsx)(`p`,{className:`personal-task-empty`,children:u(`tasks.emptyGoal`)}):null]})}var cx=yd(W(),q(W())),lx=J({node_id:W().min(1),kind:Y([`deliverable`,`gate`,`gate_summary`,`lease`,`validation`,`repair`,`handoff`,`evidence`]),title:W(),state:Y([`open`,`ready`,`blocked`,`done`,`waiting`,`unknown`]),refs:cx,owner_agent:W().optional(),actor_agent:W().optional(),from_agent:W().optional(),to_agent:W().optional()}),ux=J({edge_id:W().min(1),from_node_id:W(),to_node_id:W(),relation:Y([`depends_on`,`blocks`,`validates`,`repairs`,`audits`,`continues`,`hands_off_to`,`supersedes`]),reason:W(),refs:cx.optional()}),dx=J({schema_version:X(`task_graph_projection_v0`),mode:X(`read_only`),goal_id:W(),generated_at:W().nullable(),truth_contract:J({projection_is_writable:X(!1),write_api:X(!1)}),limits:J({user_gate_node_limit:G().int().nonnegative(),user_gate_open_count:G().int().nonnegative(),user_gate_truncated_count:G().int().nonnegative(),source_truncated:K().optional(),predecessor_truncated:K().optional(),missing_predecessor_count:G().int().nonnegative().optional(),topology_complete:K().optional()}),nodes:q(lx),edges:q(ux)}).superRefine((e,t)=>{let n=new Set(e.nodes.map(e=>e.node_id)),r=new Set(e.edges.map(e=>e.edge_id));(n.size!==e.nodes.length||r.size!==e.edges.length||e.edges.some(e=>!n.has(e.from_node_id)||!n.has(e.to_node_id)))&&t.addIssue({code:`custom`,message:`Graph identities or endpoints are invalid`})}),fx=J({ok:X(!0),goal_id:W(),observed_at:W().datetime({offset:!0}),graph:dx.nullable(),acceptance:ef.nullable()});function px(e,t){let n=fx.parse(e);if(n.goal_id!==t||n.graph&&n.graph.goal_id!==t||n.acceptance&&n.acceptance.goal_id!==t)throw Error(`Review source does not match the selected Goal`);return n}async function mx(e,t){let n=new URLSearchParams({goal_id:e}),r=await fetch(`/api/chat/delivery-review?${n}`,{signal:t,cache:`no-store`});if(!r.ok)throw Error(`Review unavailable (${r.status})`);return px(await r.json(),e)}function hx(e,t,n,r){let i=new Set([r]);for(let t of e.edges)t.from_node_id===r&&i.add(t.to_node_id),t.to_node_id===r&&i.add(t.from_node_id);let a=t.trim().toLocaleLowerCase();return e.nodes.filter(e=>{let t=[e.title,e.owner_agent,e.actor_agent,e.from_agent,e.to_agent,...Object.values(e.refs).flat()].some(e=>e?.toLocaleLowerCase().includes(a)),r=n===`all`||n===`related`&&i.has(e.node_id)||n===`conditions`&&[`gate`,`gate_summary`,`lease`].includes(e.kind)||n===`evidence`&&[`evidence`,`validation`,`repair`,`handoff`].includes(e.kind);return t&&r})}function gx(e){let t=e.limits;return t.topology_complete!==!0||t.source_truncated===!0||t.predecessor_truncated===!0||(t.missing_predecessor_count??0)>0||t.user_gate_truncated_count>0}function _x(e){return[`gate`,`gate_summary`,`lease`].includes(e.kind)?0:e.kind===`deliverable`?1:2}function vx(e,t){let n=e=>String(e??t.unavailable).replace(/[\\`*_{}[\]<>|#]/g,`\\$&`).replace(/[\r\n]+/g,` `),r=[`# ${t.title}`,``,`Goal: ${n(e.goal_id)}`,`${t.observed}: ${n(e.observed_at)}`,``,t.scope,``,t.acceptanceBoundary,``,`## ${t.chain}`,``],i=e.graph;if(!i)r.push(t.noGraph);else{gx(i)&&r.push(t.incomplete,``),r.push("```json",JSON.stringify(i.limits,null,2),"```",``);for(let e of i.nodes)r.push(`- ${n(e.title)} · ${t.kind[e.kind]} · ${t.state[e.state]}${e.owner_agent?` · ${n(e.owner_agent)}`:``}`,` ${t.refs}: ${n(e.node_id)}; ${n(JSON.stringify(e.refs))}`),(e.from_agent||e.to_agent)&&r.push(` ${n(e.from_agent)} → ${n(e.to_agent)}`),e.actor_agent&&r.push(` actor: ${n(e.actor_agent)}`);let e=new Map(i.nodes.map(e=>[e.node_id,e.title]));r.push(``,`## ${t.relations}`,``);for(let a of i.edges)r.push(`- ${n(e.get(a.from_node_id))} → ${t.relation[a.relation]} → ${n(e.get(a.to_node_id))}: ${n(a.reason)} (${n(a.edge_id)})`,` ${t.refs}: ${n(JSON.stringify(a.refs??{}))}`)}r.push(``,`## ${t.acceptance}`,``);let a=e.acceptance;if(!a)r.push(t.unavailable);else{let e=a.coverage===`partial`;r.push(`${t.required}: ${e?a.acceptance_gaps.length:t.unavailable}`,`${t.guards}: ${e?a.guards.length:t.unavailable}`,``);for(let e of a.acceptance_gaps)r.push(`### ${n(e.evidence_required)}`,``,`${t.owner}: ${n(e.owner)}`,`${t.reason}: ${n(e.reason)}`,`${t.observed}: ${n(e.observed_at)}`,`${t.refs}: ${n(e.source)}`),e.resolution_hint&&r.push(n(e.resolution_hint)),e.component_checks&&r.push(`${t.checks}:`,"```json",JSON.stringify(e.component_checks,null,2),"```"),r.push(``);r.push(`### ${t.guards}`,``);for(let e of a.guards)r.push(`- ${n(e.reason)}`,` ${t.owner}: ${n(e.owner)}; ${t.required}: ${n(e.evidence_required)}`,` ${t.refs}: ${n(e.todo_id)}; ${n(e.blocks_agent)}; ${n(e.decision_scope)}`);r.push(``,`### ${t.historical}`,``);for(let e of a.historical_progress)r.push(`- ${n(e.kind)} · ${n(e.observed_at)} · ${n(e.source)} · ${n(e.evidence_refs.join(`, `))}`);r.push(``,`${t.observedScope}: ${n(a.coverage)}; truncated=${a.truncated}`,`${t.missingSources}: ${n(a.missing_sources.join(`, `))}`,`${t.next}: ${n(a.next_action)} (${n(a.next_action_source)})`)}let o=a?.goal_acceptance_contract;if(o?.enabled===!0){let i=t.contract;r.push(``,`## ${i.title}`,``,i.boundary,`${i.source}: ${n(e.goal_id)}`,`${i.revision}: ${o.revision}`,`${i.digest}: ${n(o.digest)}`,``,`### ${i.objective}`,n(o.objective||i.unknown),``,`### ${i.criteria}`),o.non_goals.length&&r.push(`${i.nonGoals}: ${n(o.non_goals.join(`; `))}`),o.criteria.length||r.push(i.noCriteria);for(let e of o.criteria)r.push(`- ${n(e.id)}: ${n(e.description)}`);r.push(``,`### ${i.tasks}`),o.tasks.length||r.push(i.noTasks);for(let e of o.tasks)r.push(`- ${n(e.todo_id)}: ${i.taskState[e.state]}`,` ${i.criteria}: ${n(e.criterion_ids.join(`, `)||i.unknown)}`),e.reason&&r.push(` ${n(e.reason)}`),e.applicable===!1&&r.push(` ${i.notApplicable}`);r.push(``,`### ${i.verification}`,i.verificationState[o.status]),o.held_todo_ids.length&&r.push(`${i.heldTasks}: ${n(o.held_todo_ids.join(`, `))}`),r.push(``,`### ${i.receipt}`);let a=o.verification;if(!a)r.push(i.unknown);else{r.push(i.receiptNote,`${i.operation}: ${n(a.operation_id)}`,`${i.revision}: ${a.contract_revision}`,`${i.digest}: ${n(a.contract_digest)}`,`${i.verificationScope}: ${n(a.todo_id??i.allCriteria)}`);for(let e of a.results)r.push(`- ${n(e.criterion_id)}: ${e.passed?i.passed:i.failed}; ${i.exitCode}: ${e.exit_code??i.unknown}`)}}return r.join(` `)+` `}function yx({goalId:e,contract:t,copy:n,current:r}){if(t?.enabled!==!0)return null;let i=`loopx --format json goal-acceptance inspect --goal-id '${e.replace(/'/g,`'\\''`)}'`;return(0,B.jsxs)(`details`,{className:`delivery-acceptance-contract`,children:[(0,B.jsx)(`summary`,{children:n.title}),(0,B.jsxs)(`div`,{className:`delivery-acceptance-content`,children:[(0,B.jsx)(`p`,{children:n.boundary}),r?null:(0,B.jsx)(`p`,{role:`status`,className:`delivery-notice`,children:n.retained}),(0,B.jsxs)(`dl`,{className:`delivery-acceptance-source`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:n.source}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:e})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:n.revision}),(0,B.jsx)(`dd`,{children:t.revision})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:n.digest}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:t.digest})})]})]}),(0,B.jsx)(`h3`,{children:n.objective}),(0,B.jsx)(`p`,{children:t.objective||n.unknown}),t.non_goals.length?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:n.nonGoals}),(0,B.jsx)(`ul`,{children:t.non_goals.map((e,t)=>(0,B.jsx)(`li`,{children:e},t))})]}):null,(0,B.jsx)(`h3`,{children:n.criteria}),t.criteria.length?(0,B.jsx)(`ul`,{children:t.criteria.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`code`,{children:e.id}),` · `,e.description]},e.id))}):(0,B.jsx)(`p`,{children:n.noCriteria}),(0,B.jsx)(`h3`,{children:n.tasks}),t.tasks.length?(0,B.jsx)(`ul`,{className:`delivery-acceptance-tasks`,children:t.tasks.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`code`,{children:e.todo_id}),` · `,(0,B.jsx)(`strong`,{children:n.taskState[e.state]})]}),(0,B.jsxs)(`p`,{children:[n.criteria,`: `,e.criterion_ids.length?e.criterion_ids.join(`, `):n.unknown]}),e.applicable===!1?(0,B.jsx)(`p`,{children:n.notApplicable}):null,e.reason?(0,B.jsx)(`p`,{children:e.reason}):null]},e.todo_id))}):(0,B.jsx)(`p`,{children:n.noTasks}),(0,B.jsx)(`h3`,{children:n.verification}),(0,B.jsx)(`p`,{children:n.verificationState[t.status]}),t.held_todo_ids.length?(0,B.jsxs)(`p`,{children:[n.heldTasks,`: `,t.held_todo_ids.join(`, `)]}):null,(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:n.receipt}),t.verification?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{children:n.receiptNote}),(0,B.jsxs)(`dl`,{className:`delivery-acceptance-source`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:n.operation}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:t.verification.operation_id})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:n.revision}),(0,B.jsx)(`dd`,{children:t.verification.contract_revision})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:n.digest}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:t.verification.contract_digest})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:n.verificationScope}),(0,B.jsx)(`dd`,{children:t.verification.todo_id??n.allCriteria})]})]}),(0,B.jsx)(`ul`,{children:t.verification.results.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`code`,{children:e.criterion_id}),` · `,e.passed?n.passed:n.failed,` · `,n.exitCode,`: `,e.exit_code??n.unknown]},e.criterion_id))})]}):(0,B.jsx)(`p`,{children:n.unknown})]}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:n.help}),(0,B.jsx)(`p`,{children:n.guidance}),(0,B.jsx)(`p`,{children:(0,B.jsx)(`code`,{children:i})}),(0,B.jsx)(`p`,{children:(0,B.jsx)(`code`,{children:`loopx goal-acceptance --help`})}),(0,B.jsx)(`a`,{href:`https://github.com/huangruiteng/loopx/blob/main/docs/reference/goal-acceptance-observations.md#owner-authorized-contract-v0`,target:`_blank`,rel:`noreferrer`,children:n.guide})]})]})]})}var bx={en:{title:`Goal acceptance contract`,boundary:`Read-only owner contract. Task association and artifact checks are separate; neither automatically approves or completes the Goal.`,source:`Goal source`,revision:`Contract revision`,digest:`Contract digest`,objective:`Objective`,criteria:`Acceptance criteria`,nonGoals:`Outside scope`,tasks:`Task associations`,verification:`Artifact verification`,unknown:`Unknown`,noTasks:`No task associations reported. Coverage is unknown.`,noCriteria:`No acceptance criteria reported.`,retained:`Retained snapshot; refresh to read current acceptance facts.`,taskState:{ready:`Task association confirmed`,unbound:`Task association missing`,stale:`Task association stale`},verificationState:{unverified:`Artifact checks not verified`,accepted:`Artifact checks passed`,failed:`Artifact checks failed`,stale:`Artifact checks stale`,partial:`Task checks passed; Goal-wide verification unknown`,held:`Task associations require confirmation`},notApplicable:`Outside the current task gate`,heldTasks:`Tasks held`,receipt:`Recorded artifact checks`,receiptNote:`Recorded results use the revision below. The current contract status above accounts for stale checks and task holds.`,operation:`Verification reference`,verificationScope:`Verification scope`,allCriteria:`All contract criteria`,passed:`Passed`,failed:`Failed`,exitCode:`Exit code`,help:`Setup and readback`,guide:`Owner setup guide (v0)`,guidance:`The local Goal owner configures this contract through the CLI using configure --document and the inspected --expected-provider-revision. Changes and verification require --execute. Inspect before changing the contract; refresh this snapshot afterward. Disable with the current provider revision to hide this section.`},"zh-CN":{title:`Goal 验收合同`,boundary:`只读的所有者合同。任务关联与产物检查是独立事实,均不会自动批准或完成 Goal。`,source:`Goal 来源`,revision:`合同版本`,digest:`合同摘要`,objective:`目标`,criteria:`验收条件`,nonGoals:`范围之外`,tasks:`任务关联`,verification:`产物验证`,unknown:`未知`,noTasks:`未提供任务关联,覆盖范围未知。`,noCriteria:`未提供验收条件。`,retained:`当前保留旧快照,请刷新读取最新验收事实。`,taskState:{ready:`任务关联已确认`,unbound:`任务关联缺失`,stale:`任务关联已过期`},verificationState:{unverified:`产物检查未验证`,accepted:`产物检查通过`,failed:`产物检查失败`,stale:`产物检查已过期`,partial:`任务检查通过;Goal 整体验证未知`,held:`任务关联需要确认`},notApplicable:`不属于当前任务门禁范围`,heldTasks:`受阻任务`,receipt:`已记录的产物检查`,receiptNote:`记录对应下方版本。上方当前合同状态已考虑检查过期和任务阻塞。`,operation:`验证引用`,verificationScope:`验证范围`,allCriteria:`全部合同条件`,passed:`通过`,failed:`失败`,exitCode:`退出码`,help:`配置与读回`,guide:`所有者配置指南(v0)`,guidance:`本地 Goal 所有者通过 CLI 的 configure --document 配置合同,并提供 inspect 读到的 --expected-provider-revision。变更和验证都需要 --execute。变更前先检查合同,操作后刷新此快照;使用当前 provider revision 执行 disable 可隐藏本区块。`}},xx={en:{contract:bx.en,title:`Delivery & evidence`,scope:`Current work and a limited set of predecessors. Use Tasks for the full task inventory.`,observed:`Snapshot read`,chain:`Delivery chain`,relations:`Relationships`,acceptance:`Acceptance observations`,acceptanceBoundary:`Completed tasks and recorded evidence do not certify Goal acceptance.`,noGraph:`No delivery chain is available in this snapshot. This does not mean all work is complete.`,incomplete:`Some related information is missing or not expanded.`,unavailable:`Unknown`,refs:`Source references`,required:`Evidence still required`,guards:`Pending decisions`,next:`Next action`,owner:`Owner`,reason:`Reason`,historical:`Historical observations`,checks:`Component checks`,missingSources:`Missing sources`,observedScope:`Observation coverage`,kind:{deliverable:`Work`,gate:`Decision`,gate_summary:`Other decisions`,lease:`Ownership`,validation:`Validation`,repair:`Recovery`,handoff:`Handoff`,evidence:`Evidence`},state:{open:`Open`,ready:`Ready`,blocked:`Blocked`,done:`Done`,waiting:`Waiting`,unknown:`Unknown`},relation:{depends_on:`depends on`,blocks:`blocks`,validates:`validates / contextualizes`,repairs:`repairs`,audits:`audits`,continues:`continues`,hands_off_to:`hands off to`,supersedes:`supersedes`},refresh:`Refresh snapshot`,export:`Export delivery snapshot`,exported:`Snapshot downloaded`,loading:`Reading the current delivery chain…`,error:`The delivery snapshot could not be read. Refresh to retry.`,refreshError:`Refresh failed. The previous snapshot remains visible; refresh before opening linked work or exporting.`,changed:`Workspace facts changed after this snapshot. Refresh before opening linked work or exporting.`,search:`Search title, owner or reference`,all:`All nodes`,conditions:`Conditions & owners`,evidence:`Evidence & handoffs`,related:`Directly related`,map:`Map`,list:`List`,view:`Delivery chain layout`,filter:`Delivery chain focus`,visible:`Visible`,empty:`No nodes match these filters.`,reset:`Reset filters`,select:`Select a node to trace its relationships and open its source.`,work:`Work`,context:`Evidence & recovery`,details:`Selected item`,noRelations:`No relationships are recorded for this item.`,openTask:`Open task`,openGate:`Review decision`,openRun:`Open execution`,sourceUnavailable:`The linked item is not in the current workspace. Use its reference in the task board or CLI.`,omittedGates:`Decisions not expanded`,missing:`Missing predecessors`,clipped:`Expansion limited`,sourceClipped:`Source truncated`,yes:`Yes`,no:`No`,chainOnly:`Bounded chain`,exportFailed:`Download failed. Please retry.`},"zh-CN":{contract:bx[`zh-CN`],title:`交付与依据`,scope:`仅含当前工作及有限前序,完整任务清单见任务页。`,observed:`快照读取时间`,chain:`交付链`,relations:`关联关系`,acceptance:`验收观察`,acceptanceBoundary:`任务完成、已有证据均不等于 Goal 已通过验收。`,noGraph:`当前快照没有可展示的交付链,这不代表工作已经全部完成。`,incomplete:`部分关联信息缺失或未展开。`,unavailable:`未知`,refs:`来源引用`,required:`仍需补齐的证据`,guards:`待你处理`,next:`下一步`,owner:`负责人`,reason:`原因`,historical:`历史观察`,checks:`组成检查`,missingSources:`缺失来源`,observedScope:`观察范围`,kind:{deliverable:`工作`,gate:`决策`,gate_summary:`其他决策`,lease:`责任归属`,validation:`验证`,repair:`恢复`,handoff:`交接`,evidence:`证据`},state:{open:`待处理`,ready:`就绪`,blocked:`受阻`,done:`已完成`,waiting:`等待`,unknown:`未知`},relation:{depends_on:`依赖`,blocks:`阻塞`,validates:`验证 / 提供背景`,repairs:`修复`,audits:`复核`,continues:`延续`,hands_off_to:`交接给`,supersedes:`替代`},refresh:`刷新快照`,export:`导出交付快照`,exported:`快照已下载`,loading:`正在读取当前交付链…`,error:`交付快照读取失败,请刷新重试。`,refreshError:`刷新失败,当前保留上次快照;请刷新后再打开关联工作或导出。`,changed:`工作区状态已在此快照之后变化,请刷新后再打开关联工作或导出。`,search:`搜索标题、负责人或引用`,all:`全部节点`,conditions:`条件与责任`,evidence:`证据与交接`,related:`直接关联`,map:`关系图`,list:`列表`,view:`交付链布局`,filter:`交付链范围`,visible:`当前显示`,empty:`没有匹配当前筛选的节点。`,reset:`重置筛选`,select:`选择一个节点,追溯关联关系并打开来源。`,work:`工作`,context:`证据与恢复`,details:`选中事项`,noRelations:`当前快照未记录此事项的关联关系。`,openTask:`打开任务`,openGate:`查看决策`,openRun:`打开执行`,sourceUnavailable:`关联事项未出现在当前工作区,可使用其引用到任务看板或 CLI 查找。`,omittedGates:`未展开决策`,missing:`缺失前序`,clipped:`展开受限`,sourceClipped:`来源被裁剪`,yes:`是`,no:`否`,chainOnly:`当前局部链`,exportFailed:`下载失败,请重试。`}};function Sx({graph:e,nodes:t,selected:n,onSelect:r,copy:i}){let a=(0,z.useId)().replace(/:/g,``),o=[0,1,2].map(e=>t.filter(t=>_x(t)===e)),s=new Map(o.flatMap((e,t)=>e.map((e,n)=>[e.node_id,{x:t*320+12,y:n*124+48}]))),c=Math.max(1,...o.map(e=>e.length))*124+48;return(0,B.jsx)(`div`,{className:`delivery-map-scroll`,role:`region`,"aria-label":i.map,tabIndex:0,children:(0,B.jsxs)(`div`,{className:`delivery-map`,style:{height:c},children:[[i.conditions,i.work,i.context].map((e,t)=>(0,B.jsx)(`strong`,{className:`delivery-map-heading`,style:{left:t*320+12},children:e},e)),(0,B.jsxs)(`svg`,{"aria-hidden":`true`,width:`960`,height:c,children:[(0,B.jsx)(`defs`,{children:(0,B.jsx)(`marker`,{id:a,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,B.jsx)(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,fill:`currentColor`})})}),e.edges.map(e=>{let t=s.get(e.from_node_id),r=s.get(e.to_node_id);if(!t||!r)return null;let i=t.x{let t=s.get(e.node_id);return(0,B.jsxs)(`button`,{className:`delivery-map-node`,style:{left:t.x,top:t.y},"aria-pressed":n===e.node_id,onClick:()=>r(e.node_id),type:`button`,children:[(0,B.jsxs)(`span`,{children:[i.kind[e.kind],(0,B.jsx)(`em`,{"data-state":e.state,children:i.state[e.state]})]}),(0,B.jsx)(`strong`,{title:e.title,children:e.title}),(0,B.jsx)(`small`,{children:e.owner_agent??i.unavailable})]},e.node_id)})]})})}function Cx({goal:e,items:t,userTodos:n,onSelect:r,active:i}){let{locale:a}=Ji(),o=xx[a],[s,c]=(0,z.useState)({kind:`loading`}),[l,u]=(0,z.useState)(0),[d,f]=(0,z.useState)(``),[p,m]=(0,z.useState)(`all`),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)(()=>window.matchMedia(`(min-width: 1024px)`).matches),[y,b]=(0,z.useState)(``),x=(0,z.useRef)(null),S=n.filter(t=>t.goalId===e.goalId),C=JSON.stringify([e.agentTodos,e.acceptanceObservation,S]),w=(0,z.useRef)(C);w.current=C,(0,z.useEffect)(()=>{if(!i)return;let t=new AbortController,n=w.current;return c(e=>({...e,kind:`loading`})),b(``),mx(e.goalId,t.signal).then(e=>{t.signal.aborted||c({kind:`ready`,snapshot:e,sourceKey:n})}).catch(()=>{t.signal.aborted||c(e=>({...e,kind:`error`}))}),()=>t.abort()},[e.goalId,l,i]);let T=s.snapshot?.goal_id===e.goalId?s.snapshot:null,E=!!T&&s.sourceKey!==C,D=!!T&&s.kind===`ready`&&!E,O=T?.graph,k=O?.nodes.find(e=>e.node_id===h),ee=p===`related`&&!k?`all`:p,te=(0,z.useMemo)(()=>O?hx(O,d,ee,h):[],[O,d,ee,h]),A=O?.edges.filter(e=>e.from_node_id===h||e.to_node_id===h)??[],j=new Map(O?.nodes.map(e=>[e.node_id,e])),M=()=>{f(``),m(`all`)},ne=e=>{g(e),b(``),window.requestAnimationFrame(()=>x.current?.scrollIntoView({block:`nearest`}))};function N(n){let r=new Set(n.refs.todo_ids??[]),i=new Set(n.refs.gate_ids??[]),a=new Set(n.refs.run_ids??[]);return[...e.agentTodos.filter(e=>r.has(e.todoId)).map(t=>({kind:`todo`,item:{...t,goalId:e.goalId,goalTitle:e.title,ownerLabel:t.claimedBy}})),...S.filter(e=>i.has(e.todoId)||r.has(e.todoId)).map(e=>({kind:`attention`,item:e})),...t.filter(t=>t.kind===`run`&&t.run.goalId===e.goalId&&a.has(t.run.runId)).map(e=>({kind:`run`,item:e.run}))]}let P=k?N(k):[];function re(){if(!T||!D)return;let e;try{e=URL.createObjectURL(new Blob([vx(T,o)],{type:`text/markdown;charset=utf-8`}));let t=document.createElement(`a`);t.href=e,t.download=`loopx-delivery-review.md`,t.click(),b(o.exported)}catch{b(o.exportFailed)}finally{e&&window.setTimeout(()=>URL.revokeObjectURL(e),1e3)}}return(0,B.jsxs)(`section`,{className:`delivery-review`,"aria-label":o.title,children:[(0,B.jsxs)(`header`,{className:`delivery-review-toolbar`,children:[(0,B.jsx)(`h2`,{children:o.title}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{type:`button`,disabled:s.kind===`loading`,onClick:()=>u(e=>e+1),children:[(0,B.jsx)(Um,{size:15}),o.refresh]}),(0,B.jsxs)(`button`,{type:`button`,disabled:!D,onClick:re,children:[(0,B.jsx)(gm,{size:15}),o.export]})]})]}),y?(0,B.jsx)(`p`,{role:`status`,children:y}):null,T?(0,B.jsxs)(B.Fragment,{children:[s.kind===`ready`?null:(0,B.jsx)(`p`,{role:s.kind===`error`?`alert`:`status`,className:`delivery-notice`,children:s.kind===`error`?o.refreshError:o.loading}),(0,B.jsxs)(`p`,{className:`delivery-snapshot-time`,children:[o.observed,` · `,(0,B.jsx)(`time`,{dateTime:T.observed_at,children:new Date(T.observed_at).toLocaleString(a)})]}),E?(0,B.jsx)(`p`,{role:`alert`,className:`delivery-notice`,children:o.changed}):null,(0,B.jsxs)(`p`,{className:`delivery-boundary`,children:[o.scope,` `,o.acceptanceBoundary]}),O?(0,B.jsxs)(B.Fragment,{children:[gx(O)?(0,B.jsxs)(`details`,{className:`delivery-notice`,children:[(0,B.jsx)(`summary`,{children:o.incomplete}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:o.omittedGates}),(0,B.jsx)(`dd`,{children:O.limits.user_gate_truncated_count})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:o.missing}),(0,B.jsx)(`dd`,{children:O.limits.missing_predecessor_count??o.unavailable})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:o.clipped}),(0,B.jsx)(`dd`,{children:O.limits.predecessor_truncated===void 0?o.unavailable:O.limits.predecessor_truncated?o.yes:o.no})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:o.sourceClipped}),(0,B.jsx)(`dd`,{children:O.limits.source_truncated===void 0?o.unavailable:O.limits.source_truncated?o.yes:o.no})]})]})]}):null,(0,B.jsxs)(`section`,{className:`delivery-chain`,"aria-label":o.chain,children:[(0,B.jsxs)(`header`,{className:`delivery-chain-toolbar`,children:[(0,B.jsx)(`h3`,{children:o.chain}),(0,B.jsxs)(`span`,{children:[o.visible,` `,te.length,`/`,O.nodes.length]}),(0,B.jsxs)(`div`,{role:`group`,"aria-label":o.view,children:[(0,B.jsx)(`button`,{type:`button`,"aria-pressed":_,onClick:()=>v(!0),children:o.map}),(0,B.jsx)(`button`,{type:`button`,"aria-pressed":!_,onClick:()=>v(!1),children:o.list})]})]}),(0,B.jsxs)(`div`,{className:`delivery-filters`,children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(Km,{size:16}),(0,B.jsx)(`input`,{"aria-label":o.search,placeholder:o.search,value:d,onChange:e=>f(e.target.value)})]}),(0,B.jsxs)(`select`,{"aria-label":o.filter,value:ee,onChange:e=>m(e.target.value),children:[(0,B.jsx)(`option`,{value:`all`,children:o.all}),(0,B.jsx)(`option`,{value:`conditions`,children:o.conditions}),(0,B.jsx)(`option`,{value:`evidence`,children:o.evidence}),(0,B.jsx)(`option`,{value:`related`,disabled:!k,children:o.related})]}),(0,B.jsx)(`button`,{type:`button`,onClick:M,children:o.reset})]}),te.length?_?(0,B.jsx)(Sx,{graph:O,nodes:te,selected:h,onSelect:ne,copy:o}):(0,B.jsx)(`ul`,{className:`delivery-node-list`,children:te.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,"aria-pressed":h===e.node_id,onClick:()=>ne(e.node_id),children:[(0,B.jsx)(`span`,{children:o.kind[e.kind]}),(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`small`,{children:e.owner_agent??o.unavailable}),(0,B.jsx)(`em`,{"data-state":e.state,children:o.state[e.state]})]})},e.node_id))}):(0,B.jsx)(`p`,{className:`delivery-empty`,role:`status`,children:o.empty})]}),(0,B.jsx)(`section`,{className:`delivery-node-detail`,"aria-label":o.details,ref:x,children:k?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`header`,{children:[(0,B.jsxs)(`span`,{children:[o.kind[k.kind],` · `,o.state[k.state]]}),(0,B.jsx)(`h3`,{children:k.title}),k.owner_agent?(0,B.jsx)(`p`,{children:k.owner_agent}):null]}),k.from_agent||k.to_agent?(0,B.jsxs)(`p`,{children:[k.from_agent??o.unavailable,` → `,k.to_agent??o.unavailable]}):null,(0,B.jsx)(`div`,{className:`delivery-source-actions`,children:P.length?P.map((e,t)=>(0,B.jsxs)(`button`,{type:`button`,disabled:!D,onClick:()=>r(e),children:[(0,B.jsx)(vm,{size:15}),e.kind===`todo`?o.openTask:e.kind===`attention`?o.openGate:o.openRun]},`${e.kind}:${t}`)):(0,B.jsx)(`p`,{children:o.sourceUnavailable})}),(0,B.jsx)(`h4`,{children:o.relations}),A.length?(0,B.jsx)(`ul`,{className:`delivery-relations`,children:A.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`button`,{type:`button`,onClick:()=>ne(e.from_node_id),children:j.get(e.from_node_id).title}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(Qp,{size:13}),o.relation[e.relation],(0,B.jsx)(Qp,{size:13})]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>ne(e.to_node_id),children:j.get(e.to_node_id).title})]}),(0,B.jsx)(`p`,{children:e.reason})]},e.edge_id))}):(0,B.jsx)(`p`,{children:o.noRelations}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:o.refs}),(0,B.jsx)(`code`,{children:k.node_id}),Object.entries(k.refs).map(([e,t])=>(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`strong`,{children:e}),` `,t.join(`, `)]},e))]})]}):(0,B.jsx)(`p`,{children:o.select})})]}):(0,B.jsx)(`p`,{className:`delivery-notice`,children:o.noGraph})]}):(0,B.jsx)(`p`,{role:s.kind===`error`?`alert`:`status`,className:`delivery-notice`,children:s.kind===`error`?o.error:o.loading}),(0,B.jsx)(yx,{goalId:e.goalId,contract:T?.acceptance?.goal_acceptance_contract,copy:o.contract,current:D}),(0,B.jsx)(vb,{goal:T?{...e,acceptanceObservation:T.acceptance}:e})]})}function wx({active:e,goal:t,items:n,userTodos:r,readOnly:i,onOpenDetails:a,onSelect:o,onView:s}){let{t:c,locale:l}=Ji(),u=l===`zh-CN`?{progress:`当前进展`,attention:`需要你`,none:`当前没有已加载的待处理决定。`,details:`Goal 信息`,tasks:`查看任务`,outputs:`查看成果`,usage:`最近 24 小时`,execution:`执行记录`,remote:`此来源仅提供同步的状态与验收观察,交付链需要实时本机来源。`}:{progress:`Current progress`,attention:`Needs you`,none:`No pending decisions are loaded.`,details:`Goal information`,tasks:`View tasks`,outputs:`View outputs`,usage:`Last 24 hours`,execution:`Execution`,remote:`This source provides synchronized status and acceptance observations. The delivery chain requires the live local source.`},d=r.filter(e=>e.goalId===t.goalId),f=n.find(e=>e.kind===`run`&&e.run.goalId===t.goalId);return(0,B.jsxs)(`section`,{className:`goal-overview`,"aria-label":c(`header.overview`),children:[(0,B.jsxs)(`header`,{className:`goal-overview-heading`,children:[(0,B.jsx)(`h2`,{children:c(`header.overview`)}),(0,B.jsxs)(`button`,{onClick:a,type:`button`,children:[(0,B.jsx)(Tm,{size:15}),u.details]})]}),(0,B.jsxs)(`div`,{className:`goal-overview-summary`,children:[(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`h3`,{children:u.progress}),(0,B.jsx)(`span`,{children:Yi(t.state,l)})]}),(0,B.jsx)(`strong`,{children:t.nextSentence}),(0,B.jsx)(`p`,{children:t.agentSentence}),(0,B.jsxs)(`div`,{className:`goal-overview-links`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>s(`tasks`),children:[u.tasks,(0,B.jsx)(Qp,{size:14})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>s(`files`),children:[u.outputs,(0,B.jsx)(Qp,{size:14})]})]}),f?(0,B.jsxs)(`button`,{className:`goal-overview-run`,type:`button`,onClick:()=>o({kind:`run`,item:f.run}),children:[(0,B.jsxs)(`small`,{children:[u.execution,` · `,f.run.agentLabel]}),(0,B.jsx)(`strong`,{children:f.run.title}),(0,B.jsx)(Qp,{size:15})]}):null]}),(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`h3`,{children:u.attention}),(0,B.jsx)(`span`,{children:d.length})]}),d.length?(0,B.jsx)(`ul`,{children:d.slice(0,3).map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>o({kind:`attention`,item:e}),children:[(0,B.jsx)(`span`,{children:e.text}),(0,B.jsx)(Qp,{size:15})]})},e.todoId))}):(0,B.jsx)(`p`,{children:u.none}),d.length>3?(0,B.jsxs)(`button`,{type:`button`,onClick:()=>s(`tasks`),children:[u.tasks,` (`,d.length,`)`,(0,B.jsx)(Qp,{size:14})]}):null]})]}),(0,B.jsxs)(`dl`,{className:`goal-overview-usage`,"aria-label":u.usage,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`dt`,{children:[c(`drawer.tokensShort`),` · `,u.usage]}),(0,B.jsx)(`dd`,{children:eb(t.usage?.tokens24h,c(`drawer.usageNotMeasured`),Zy)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`dt`,{children:[c(`drawer.costShort`),` · `,u.usage]}),(0,B.jsx)(`dd`,{children:eb(t.usage?.costUsd24h,c(`drawer.usageNotMeasured`),Qy)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`dt`,{children:[c(`drawer.durationShort`),` · `,u.usage]}),(0,B.jsx)(`dd`,{children:eb(t.usage?.durationMs24h,c(`drawer.usageNotMeasured`),$y)})]})]}),i?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`goal-overview-source-note`,children:u.remote}),(0,B.jsx)(vb,{goal:t})]}):(0,B.jsx)(Cx,{active:e,goal:t,items:n,userTodos:r,onSelect:o})]})}function Tx({activeTab:e,panels:t,scrollRef:n}){let[r,i]=(0,z.useState)(()=>new Set([e])),a=(0,z.useRef)({});return(0,z.useEffect)(()=>i(t=>t.has(e)?t:new Set([...t,e])),[e]),(0,z.useLayoutEffect)(()=>{let t=n.current;if(!t)return;t.scrollTop=a.current[e]??0;let r=()=>{a.current[e]=t.scrollTop};return t.addEventListener(`scroll`,r,{passive:!0}),()=>t.removeEventListener(`scroll`,r)},[e,n]),Object.keys(t).map(n=>r.has(n)||n===e?(0,B.jsx)(`div`,{className:`personal-goal-view-panel`,"data-goal-panel":n,hidden:n!==e,children:t[n]},n):null)}function Ex(e,t){return{live_steering:{label:t(`lark.ingressSteering`),detail:t(`lark.ingressSteeringDescription`)},session_queue:{label:t(`lark.ingressQueue`),detail:t(`lark.ingressQueueDescription`)},async_inbox:{label:t(`lark.ingressAsync`),detail:t(`lark.ingressAsyncDescription`)},direct_session:{label:t(`lark.ingressLegacy`),detail:t(`lark.ingressLegacyDescription`)}}[e]}function Dx(e,t){return e.listener_status===`starting`?{label:t(`lark.health.starting`),detail:t(`lark.health.startingDetail`),state:`not_ready`}:e.listener_status===`retrying`&&e.listener_error_code===`lark_event_source_disconnected`?{label:t(`lark.health.sourceDisconnected`),detail:t(`lark.health.sourceDisconnectedDetail`),state:`not_ready`}:e.listener_status===`retrying`?{label:t(`lark.health.retrying`),detail:t(`lark.health.retryingDetail`),state:`not_ready`}:e.listener_status===`stopped`||e.listener_status===null?{label:t(`lark.health.notStarted`),detail:t(`lark.health.notStartedDetail`),state:`not_ready`}:e.last_event_status===`message_context_permission_required`?{label:t(`lark.health.messageContextPermission`),detail:t(`lark.health.messageContextPermissionDetail`),state:`not_ready`}:e.last_event_status===`processing_failed`?{label:t(`lark.health.processingFailed`),detail:t(`lark.health.processingFailedDetail`),state:`not_ready`}:e.health_error_code===`invalid_routing_state`?{label:t(`lark.health.invalidRouting`),detail:t(`lark.health.invalidRoutingDetail`),state:`not_ready`}:e.last_event_status===`queued_for_agent`?{label:t(`lark.health.queued`),detail:t(`lark.health.queuedDetail`,{agent:e.agent_id??t(`lark.targetAgent`)}),state:`ready`}:e.last_event_status===`context_only_captured`||e.last_event_status===`context_only_already_captured`?{label:t(`lark.health.contextCaptured`),detail:t(`lark.health.contextCapturedDetail`),state:`ready`}:e.last_event_status===`ignored`&&e.last_event_reason===`not_addressed`?{label:t(`lark.health.notAddressed`),detail:t(`lark.health.notAddressedDetail`),state:`ready`}:e.last_event_status===`ignored`&&e.last_event_reason===`self_message`?{label:t(`lark.health.listening`),detail:t(`lark.health.ignoredSelf`),state:`ready`}:e.health_error_code===`lark_event_route_mismatch`||[`chat_mismatch`,`topic_mismatch`,`route_ambiguous`].includes(e.last_event_reason??``)?{label:e.last_event_reason===`route_ambiguous`?t(`lark.health.routeAmbiguous`):t(`lark.health.routeMismatch`),detail:e.last_event_reason===`route_ambiguous`?t(`lark.health.routeAmbiguousDetail`):t(`lark.health.routeMismatchDetail`),state:`not_ready`}:[`invalid_event`,`binding_unavailable`].includes(e.last_event_reason??``)?{label:t(`lark.health.routeUnavailable`),detail:t(`lark.health.routeUnavailableDetail`),state:`not_ready`}:e.last_event_status===`replied_and_acknowledged`?{label:t(`lark.health.listening`),detail:t(`lark.health.eventProcessed`,{events:e.event_count,replies:e.replied_count}),state:`ready`}:e.health_error_code===`lark_event_delivery_unverified`||e.event_count===0?{label:t(`lark.health.eventUnverified`),detail:t(`lark.health.eventUnverifiedDetail`),state:`unverified`}:{label:e.reply_ready?t(`lark.health.listening`):t(`lark.health.unavailable`),detail:t(`lark.health.lastStatus`,{status:e.last_event_status??t(`lark.health.waiting`)}),state:e.reply_ready?`ready`:`not_ready`}}function Ox(e){return e.history_permission_guidance?.api_document_url??null}function kx(e,t,n){if(e instanceof Ih){let t=String(e.payload.error_code??``);return{lark_cli_not_installed:n(`lark.error.cliMissing`),lark_cli_not_executable:n(`lark.error.cliExecutable`),lark_cli_start_failed:n(`lark.error.cliStart`),lark_message_permissions_required:n(`lark.error.messagePermissions`),lark_app_required:n(`lark.error.appRequired`),invalid_lark_app:n(`lark.error.invalidApp`),lark_group_lookup_failed:n(`lark.error.groupLookup`),provider_api_failed:n(`lark.error.provider`)}[t]??e.message}return e instanceof Error?e.message:t}function Ax({embedded:e=!1,focusGoalConnection:t=!1,goals:n,initialGoalId:r,onChanged:i,onClose:a}){let{t:o}=Ji(),[s,c]=(0,z.useState)(`connections`),[l,u]=(0,z.useState)([]),[d,f]=(0,z.useState)([]),[p,m]=(0,z.useState)(!0),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)(``),[y,b]=(0,z.useState)(t),[x,S]=(0,z.useState)(``),[C,w]=(0,z.useState)(r??n[0]?.goalId??``),[T,E]=(0,z.useState)(``),[D,O]=(0,z.useState)([]),[k,ee]=(0,z.useState)(``),[te,A]=(0,z.useState)(!1),[j,M]=(0,z.useState)(null),[ne,N]=(0,z.useState)(`addressed_only`),[P,re]=(0,z.useState)(t&&r?`goal`:`manager`),[ie,ae]=(0,z.useState)(`async_inbox`),[F,oe]=(0,z.useState)(`topic_reply`),[I,se]=(0,z.useState)(``),[L,ce]=(0,z.useState)(!1),[le,ue]=(0,z.useState)({}),[de,fe]=(0,z.useState)(!1),[pe,me]=(0,z.useState)(null),[he,ge]=(0,z.useState)(null),[_e,ve]=(0,z.useState)(null),[ye,be]=(0,z.useState)(null),[xe,Se]=(0,z.useState)(!1),[Ce,we]=(0,z.useState)(`loopx-workspace-bot`),[Te,Ee]=(0,z.useState)(`feishu`),[De,Oe]=(0,z.useState)(null),[ke,Ae]=(0,z.useState)(!1),[je,R]=(0,z.useState)(null),Me=(0,z.useRef)(null),Ne=(0,z.useRef)(null),Pe=(0,z.useRef)(!1);async function Fe(){m(!0),g(null);try{let[e,t]=await Promise.all([$g(),c_()]);u(e),f(t),S(t=>t||e.find(e=>e.reply_ready)?.app_ref||e.find(e=>e.ready)?.app_ref||e[0]?.app_ref||``)}catch(e){g(kx(e,o(`lark.error.configuration`),o))}finally{m(!1)}}(0,z.useEffect)(()=>{Fe()},[]),(0,z.useEffect)(()=>{if(!t||p||Pe.current||!r)return;Pe.current=!0;let e=d.find(e=>e.goal_id===r);e?Je(e):qe(n.find(e=>e.goalId===r))},[d,t,n,r,p]),(0,z.useEffect)(()=>{if(!y||!x||_e){O([]),ee(``),A(!1),M(null);return}let e=!1;A(!0),M(null);let t=window.setTimeout(()=>{o_(x,T).then(t=>{e||(O(t),ee(e=>t.some(t=>t.chat_id===e)?e:t[0]?.chat_id??``))}).catch(t=>{e||(O([]),ee(``),M(kx(t,o(`lark.error.groupLoad`),o)))}).finally(()=>{e||A(!1)})},180);return()=>{e=!0,window.clearTimeout(t)}},[x,T,y,_e]),(0,z.useEffect)(()=>{if(!xe||!De||[`ready`,`failed`,`cancelled`].includes(De.status))return;let e=!1,t=window.setTimeout(()=>{n_(De.setup_id).then(async t=>{e||(Oe(t),t.verification_url&&Ne.current!==t.verification_url&&(Ne.current=t.verification_url,Me.current&&!Me.current.closed&&(Me.current.location.href=t.verification_url)),t.status===`ready`&&(await Fe(),S(t.app_ref),ue({}),Se(!1)),t.status===`failed`&&R(t.error??o(`lark.error.appCreate`)))}).catch(t=>{e||R(kx(t,o(`lark.error.setupPoll`),o))})},650);return()=>{e=!0,window.clearTimeout(t)}},[xe,De]);let Ie=n.find(e=>e.goalId===C),Le=Ie?.agentId?[{agentId:Ie.agentId,label:Ie.agentLabel??Ie.agentId}]:[],Re=Ie?.agentLanes?.length?Ie.agentLanes:Le,ze=Re.some(e=>e.agentId===I),Be=[];L?Be=Re.map(e=>({agentId:e.agentId,appRef:le[e.agentId]??x})):ze&&(Be=[{agentId:I,appRef:x}]);let V=Be.map(e=>e.agentId),Ve=!!_e||Be.length>0&&Be.every(e=>l.some(t=>t.app_ref===e.appRef&&t.reply_ready)),He=o(`lark.connect`);he?He=o(`lark.saveConnection`):L&&(He=o(`lark.connectAllAgentsAction`,{count:V.length}));let Ue=l.find(e=>e.app_ref===x),We=D.find(e=>e.chat_id===k),Ge=(0,z.useMemo)(()=>{let e=_.trim().toLocaleLowerCase();return e?d.filter(t=>[t.app_label,t.chat_name,t.goal_title,t.topic_name].some(t=>t.toLocaleLowerCase().includes(e))):d},[d,_]),Ke=(0,z.useMemo)(()=>d.filter(e=>Dx(e,o).state===`unverified`).length,[d,o]);function qe(e){let i=e??n.find(e=>e.goalId===r)??n[0];ge(null),ve(null),re(e||t?`goal`:`manager`),S(l.some(e=>e.app_ref===x)?x:l.find(e=>e.reply_ready)?.app_ref??l[0]?.app_ref??``),ee(``),w(i?.goalId??``),se(i?.agentId??``),ce(!1),ue({}),N(`addressed_only`),ae(`async_inbox`),oe(`topic_reply`),E(``),me(null),b(!0)}function Je(e){ge(e.goal_id),ve(e),re(e.conversation_kind??`goal`),S(e.app_ref),w(e.goal_id);let t=n.find(t=>t.goalId===e.goal_id),r=t?.agentLanes?.length?t.agentLanes:t?.agentId?[{agentId:t.agentId}]:[];se(e.agent_id??(r.length===1?r[0].agentId:``)),ce(!1),ue({}),N(e.capture_scope),ae(e.ingress_mode===`direct_session`?`async_inbox`:e.ingress_mode),oe(e.reply_mode),E(e.chat_name),me(null),b(!0)}function Ye(){Oe(null),R(null),Ne.current=null,Se(!0)}async function Xe(){if(!(ke||!/^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/.test(Ce))){Ae(!0),R(null),Ne.current=null,Me.current=window.open(window.location.href,`_blank`);try{let e=await t_({appRef:Ce,brand:Te});Oe(e)}catch(e){Me.current?.close(),R(kx(e,o(`lark.error.setupStart`),o))}finally{Ae(!1)}}}async function Ze(){let e=De;if(Se(!1),Me.current?.close(),e&&![`ready`,`failed`,`cancelled`].includes(e.status))try{await r_(e.setup_id)}catch{}}async function Qe(){if(!(!x||!C||!_e&&!We||P===`goal`&&V.length===0||de)){fe(!0),me(null);try{let e={...P===`manager`?{..._e?{connectionId:_e.connection_id}:{appRef:x,chatId:We.chat_id,chatName:We.chat_name}}:_e?{connectionId:_e.connection_id,agentId:I}:{agentBindings:Be,chatId:We.chat_id,chatName:We.chat_name},conversationKind:P,captureScope:P===`manager`?`addressed_only`:ne,goalId:C,incomingMode:ne===`configured_chat_all`?`all`:`mentions`,ingressMode:P===`manager`?`session_queue`:ie,replyMode:F},t=await l_({...e,execute:!1});if(!t.ok)throw new Ih(t.public_summary??t.blocker??o(`lark.error.bindPreview`),{error_code:t.blocker??`provider_api_failed`});let n=await l_({...e,execute:!0});if(!n.ok)throw new Ih(n.public_summary??n.blocker??o(`lark.error.bind`),{error_code:n.blocker??`provider_api_failed`});b(!1),await Fe(),i?.()}catch(e){me(kx(e,o(`lark.error.bind`),o))}finally{fe(!1)}}}async function $e(e,t){if(ye!==t){be(t);return}try{await u_(e,t),be(null),await Fe(),i?.()}catch(e){g(kx(e,o(`lark.error.disconnect`),o))}}return(0,B.jsxs)(`section`,{className:`personal-lark-settings${e?` is-embedded`:``}`,"aria-label":o(`lark.configuration`),children:[e?null:(0,B.jsxs)(`header`,{className:`personal-lark-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`small`,{children:o(`settings.goalConnections`)}),(0,B.jsx)(`h1`,{children:`Lark`})]}),(0,B.jsx)(`button`,{"aria-label":o(`lark.closeSettings`),className:`personal-icon-button`,onClick:a,type:`button`,children:(0,B.jsx)(oh,{size:18})})]}),(0,B.jsxs)(`nav`,{className:`personal-lark-tabs`,"aria-label":o(`lark.management`),children:[(0,B.jsxs)(`button`,{"aria-current":s===`apps`?`page`:void 0,onClick:()=>c(`apps`),type:`button`,children:[o(`lark.apps`),` `,(0,B.jsx)(`span`,{children:p?`…`:l.length})]}),(0,B.jsxs)(`button`,{"aria-current":s===`connections`?`page`:void 0,onClick:()=>c(`connections`),type:`button`,children:[o(`lark.connections`),` `,(0,B.jsx)(`span`,{children:p?`…`:d.length})]})]}),h?(0,B.jsx)(`p`,{className:`personal-notification-error`,children:h}):null,p?(0,B.jsxs)(`div`,{className:`personal-lark-loading`,children:[(0,B.jsx)(Am,{className:`is-spinning`,size:18}),o(`lark.loading`)]}):null,!p&&s===`apps`?(0,B.jsxs)(`div`,{className:`personal-lark-apps`,children:[(0,B.jsxs)(`div`,{className:`personal-lark-app-toolbar`,children:[(0,B.jsx)(`span`,{children:o(`lark.reusableApps`,{count:l.length})}),(0,B.jsxs)(`button`,{className:`personal-primary-action`,onClick:Ye,type:`button`,children:[(0,B.jsx)(Vm,{size:16}),o(`lark.newApp`)]})]}),(0,B.jsxs)(`div`,{className:`personal-lark-app-grid`,children:[l.map(e=>(0,B.jsxs)(`article`,{className:`personal-lark-app-card`,children:[(0,B.jsx)(`span`,{className:`personal-lark-app-avatar`,children:(0,B.jsx)(rm,{size:19})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsxs)(`small`,{children:[e.brand,` · lark-cli profile`]})]}),(0,B.jsx)(`em`,{className:e.reply_ready?`is-ready`:`is-off`,children:e.reply_ready?o(`lark.autoReplyReady`):e.ready?o(`lark.needsMessagePermissions`):o(`lark.needsSetup`)}),(0,B.jsxs)(`p`,{children:[o(`lark.goalConnections`,{count:d.filter(t=>t.app_ref===e.app_ref).length}),e.ready&&!e.reply_ready?` · ${o(`lark.autoReplyUnavailable`)}`:``]})]},e.app_ref)),l.length===0?(0,B.jsx)(`p`,{className:`personal-lark-empty`,children:o(`lark.noProfiles`)}):null]})]}):null,!p&&s===`connections`?(0,B.jsxs)(`div`,{className:`personal-lark-connections`,children:[Ke>0?(0,B.jsxs)(`p`,{className:`personal-lark-route-readiness`,role:`status`,children:[(0,B.jsx)(Pm,{size:15}),o(`lark.routesUnverified`,{count:Ke})]}):null,(0,B.jsxs)(`div`,{className:`personal-lark-toolbar`,children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(Km,{size:16}),(0,B.jsx)(`input`,{"aria-label":o(`lark.searchConnections`),onChange:e=>v(e.target.value),placeholder:o(`lark.searchPlaceholder`),type:`search`,value:_})]}),(0,B.jsxs)(`button`,{className:`personal-primary-action`,disabled:l.length===0||n.length===0,onClick:()=>qe(),type:`button`,children:[(0,B.jsx)(Vm,{size:16}),o(`lark.connectApp`)]})]}),(0,B.jsxs)(`div`,{className:`personal-lark-table`,role:`table`,"aria-label":o(`lark.goalTopicConnections`),children:[(0,B.jsxs)(`div`,{className:`personal-lark-table-head`,role:`row`,children:[(0,B.jsx)(`span`,{children:o(`lark.connection`)}),(0,B.jsx)(`span`,{children:o(`common.goal`)}),(0,B.jsx)(`span`,{children:o(`lark.capture`)}),(0,B.jsx)(`span`,{children:o(`lark.processing`)}),(0,B.jsx)(`span`,{children:o(`common.actions`)})]}),Ge.map(e=>{let t=Dx(e,o);return(0,B.jsxs)(`div`,{className:`personal-lark-table-row`,role:`row`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.chat_name}),(0,B.jsxs)(`small`,{children:[e.app_label,` · `,t.label]}),(0,B.jsx)(`small`,{children:t.detail}),t.state===`unverified`?(0,B.jsxs)(`a`,{href:`https://open.feishu.cn/document/server-docs/im-v1/message/events/receive?lang=zh-CN`,rel:`noreferrer`,target:`_blank`,children:[(0,B.jsx)(vm,{size:12}),o(`lark.openEventSettings`)]}):null,Ox(e)?(0,B.jsxs)(`a`,{href:Ox(e)??void 0,rel:`noreferrer`,target:`_blank`,children:[(0,B.jsx)(vm,{size:12}),o(`lark.historyPermission`)]}):null]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.goal_title}),(0,B.jsxs)(`small`,{children:[`# `,e.topic_name]})]}),(0,B.jsx)(`span`,{children:e.capture_scope===`addressed_only`?o(`lark.mentionsOnly`):o(`lark.allTopicMessages`)}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.conversation_kind===`manager`?o(`lark.managerConversation`):Ex(e.ingress_mode,o).label}),(0,B.jsx)(`small`,{children:e.conversation_kind===`manager`?o(`lark.managerConversationDescription`):e.agent_id??Ex(e.ingress_mode,o).detail})]}),(0,B.jsxs)(`span`,{className:`personal-lark-row-actions`,children:[(0,B.jsx)(`button`,{"aria-label":o(`lark.settingsConfigure`,{goal:e.goal_title}),onClick:()=>Je(e),type:`button`,children:(0,B.jsx)(Xm,{size:15})}),(0,B.jsxs)(`button`,{"aria-label":o(`lark.settingsDisconnect`,{goal:e.goal_title}),className:ye===e.connection_id?`is-confirm`:``,onClick:()=>void $e(e.goal_id,e.connection_id),type:`button`,children:[(0,B.jsx)(ah,{size:15}),ye===e.connection_id?o(`common.confirm`):null]})]})]},e.connection_id)}),Ge.length===0?(0,B.jsx)(`p`,{className:`personal-lark-empty`,children:o(`lark.noConnections`)}):null]})]}):null,y?(0,B.jsx)(`div`,{className:`personal-lark-modal-backdrop`,role:`presentation`,children:(0,B.jsxs)(`section`,{"aria-labelledby":`connect-lark-title`,"aria-modal":`true`,className:`personal-lark-modal`,role:`dialog`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`small`,{children:`Goal Topic connection`}),(0,B.jsx)(`h2`,{id:`connect-lark-title`,children:o(he?`lark.editConnection`:`lark.connectApp`)})]}),(0,B.jsx)(`button`,{"aria-label":o(`lark.closeConnection`),onClick:()=>b(!1),type:`button`,children:(0,B.jsx)(oh,{size:18})})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.conversationKind`)}),(0,B.jsxs)(`select`,{"aria-label":o(`lark.conversationKind`),disabled:!!_e,value:P,onChange:e=>re(e.target.value),children:[(0,B.jsx)(`option`,{value:`manager`,children:o(`lark.managerConversation`)}),(0,B.jsx)(`option`,{value:`goal`,children:o(`lark.workerConversation`)})]})]}),P===`manager`?(0,B.jsx)(`p`,{children:o(`lark.managerConversationDescription`)}):null,_e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.appProfile`)}),(0,B.jsx)(`div`,{children:_e.app_label})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.groupChat`)}),(0,B.jsx)(`div`,{children:_e.chat_name})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.bindGoal`)}),(0,B.jsx)(`div`,{children:_e.goal_title})]}),(0,B.jsx)(`small`,{children:o(`lark.editPreservesIdentity`)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.appProfile`)}),(0,B.jsx)(`select`,{"aria-label":o(`lark.appProfile`),disabled:p,onChange:e=>{e.target.value===`__register__`?Ye():(S(e.target.value),ue({}))},value:x,children:p?(0,B.jsx)(`option`,{value:``,children:o(`lark.appLoading`)}):(0,B.jsxs)(B.Fragment,{children:[l.map(e=>(0,B.jsxs)(`option`,{disabled:!e.ready,value:e.app_ref,children:[e.label,e.reply_ready?``:e.ready?` · ${o(`lark.needsMessagePermissions`)}`:` · ${o(`lark.needsSetup`)}`]},e.app_ref)),(0,B.jsx)(`option`,{value:`__register__`,children:o(`lark.registerAnother`)})]})}),(0,B.jsx)(`small`,{children:o(`lark.defaultAgentAppDescription`)})]}),Ue?.ready&&!Ue.reply_ready?(0,B.jsx)(`div`,{className:`personal-lark-group-state is-error`,role:`alert`,children:o(`lark.appPermissions`)}):null,(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.groupChat`)}),(0,B.jsx)(`input`,{"aria-label":o(`lark.groupSearch`),onChange:e=>E(e.target.value),placeholder:o(`lark.groupSearch`),type:`search`,value:T}),te?(0,B.jsxs)(`div`,{className:`personal-lark-group-state`,role:`status`,children:[(0,B.jsx)(Am,{className:`is-spinning`,size:15}),o(`lark.groupLoading`)]}):null,!te&&j?(0,B.jsx)(`div`,{className:`personal-lark-group-state is-error`,role:`alert`,children:j}):null,!te&&!j&&D.length===0?(0,B.jsx)(`div`,{className:`personal-lark-group-state`,role:`status`,children:o(`lark.groupEmpty`)}):null,!te&&!j&&D.length>0?(0,B.jsx)(`select`,{"aria-label":o(`lark.groupChat`),onChange:e=>ee(e.target.value),value:k,children:D.map(e=>(0,B.jsx)(`option`,{value:e.chat_id,children:e.chat_name},e.chat_id))}):null]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.bindGoal`)}),(0,B.jsx)(`select`,{"aria-label":o(`lark.bindGoal`),onChange:e=>{let t=e.target.value;w(t),se(n.find(e=>e.goalId===t)?.agentId??``),ue({})},value:C,children:n.map(e=>(0,B.jsx)(`option`,{value:e.goalId,children:e.title},e.goalId))})]})]}),(0,B.jsxs)(`label`,{className:`personal-lark-check`,children:[(0,B.jsx)(`input`,{checked:!0,readOnly:!0,type:`checkbox`}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:o(`lark.createAutomatically`)}),(0,B.jsx)(`small`,{children:o(`lark.createAutomaticallyDescription`)})]})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.topicPreview`)}),(0,B.jsxs)(`div`,{className:`personal-lark-topic-preview`,children:[(0,B.jsx)(Pm,{size:15}),`# `,Ie?.title??Ie?.goalId??`Goal`]})]}),P===`goal`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.captureScope`)}),(0,B.jsxs)(`select`,{"aria-label":o(`lark.captureScope`),disabled:_e?.ingress_mode===`direct_session`,onChange:e=>N(e.target.value),value:ne,children:[(0,B.jsx)(`option`,{value:`addressed_only`,children:o(`lark.captureAddressed`)}),(0,B.jsx)(`option`,{value:`configured_chat_all`,children:o(`lark.captureAll`)})]}),(0,B.jsx)(`small`,{children:o(`lark.captureScopeDescription`)})]}),(0,B.jsxs)(`fieldset`,{"aria-label":o(`lark.agentIngress`),className:`personal-lark-ingress`,children:[(0,B.jsx)(`legend`,{children:o(`lark.agentIngress`)}),(0,B.jsx)(`div`,{children:[`live_steering`,`session_queue`,`async_inbox`].map(e=>{let t=Ex(e,o);return(0,B.jsxs)(`label`,{className:ie===e?`is-active`:``,children:[(0,B.jsx)(`input`,{"aria-label":t.label,checked:ie===e,name:`lark-agent-ingress`,onChange:()=>ae(e),type:`radio`,value:e}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:t.label}),(0,B.jsx)(`small`,{children:t.detail})]})]},e)})})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.targetAgent`)}),(0,B.jsxs)(`select`,{"aria-label":o(`lark.targetAgent`),disabled:!!_e?.agent_id,onChange:e=>se(e.target.value),value:I,children:[ze?null:(0,B.jsx)(`option`,{disabled:!0,value:I,children:I?o(`lark.agentUnavailable`,{agent:I}):o(`lark.noAgentConfigured`)}),Re.map(e=>(0,B.jsx)(`option`,{value:e.agentId,children:e.label===e.agentId?e.agentId:`${e.label} · ${e.agentId}`},e.agentId))]}),(0,B.jsx)(`small`,{children:o(`lark.targetAgentDescription`)})]}),!he&&Re.length>1?(0,B.jsxs)(`label`,{"aria-label":o(`lark.connectAllAgents`),className:`personal-lark-check`,children:[(0,B.jsx)(`input`,{checked:L,onChange:e=>ce(e.target.checked),type:`checkbox`}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:o(`lark.connectAllAgents`)}),(0,B.jsx)(`small`,{children:o(`lark.connectAllAgentsDescription`,{count:Re.length})})]})]}):null,!he&&L&&Re.length>1?(0,B.jsxs)(`fieldset`,{"aria-label":o(`lark.agentApps`),className:`personal-lark-agent-apps`,children:[(0,B.jsx)(`legend`,{children:o(`lark.agentApps`)}),(0,B.jsx)(`small`,{children:o(`lark.agentAppsDescription`)}),(0,B.jsx)(`div`,{children:Re.map(e=>(0,B.jsxs)(`label`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`small`,{children:e.agentId})]}),(0,B.jsx)(`select`,{"aria-label":o(`lark.agentAppSelection`,{agent:e.label}),onChange:t=>ue(n=>({...n,[e.agentId]:t.target.value})),value:le[e.agentId]??x,children:l.map(e=>(0,B.jsxs)(`option`,{disabled:!e.ready,value:e.app_ref,children:[e.label,e.reply_ready?``:e.ready?` · ${o(`lark.needsMessagePermissions`)}`:` · ${o(`lark.needsSetup`)}`]},e.app_ref))})]},e.agentId))})]}):null,L&&Be.length>0&&!Ve?(0,B.jsx)(`div`,{className:`personal-lark-group-state is-error`,role:`alert`,children:o(`lark.agentAppPermissions`)}):null,V.length===0?(0,B.jsx)(`p`,{className:`personal-notification-error`,role:`alert`,children:o(`lark.selectRegisteredAgent`)}):null]}):null,(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.replyMode`)}),(0,B.jsx)(`select`,{"aria-label":o(`lark.replyMode`),onChange:e=>oe(e.target.value),value:F,children:(0,B.jsx)(`option`,{value:`topic_reply`,children:o(`lark.topicReply`)})}),(0,B.jsx)(`small`,{children:o(`lark.replyModeDescription`)})]}),(0,B.jsxs)(`p`,{className:`personal-lark-cardinality`,children:[(0,B.jsx)(om,{size:15}),o(`lark.cardinality`)]}),pe?(0,B.jsx)(`p`,{className:`personal-notification-error`,role:`alert`,children:pe}):null,(0,B.jsxs)(`footer`,{children:[(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>b(!1),type:`button`,children:o(`lark.cancel`)}),(0,B.jsxs)(`button`,{className:`personal-primary-action`,disabled:p||!x||!_e&&(!Ue?.reply_ready||!k)||P===`goal`&&(!Ve||V.length===0)||!C||de,onClick:()=>void Qe(),type:`button`,children:[de?(0,B.jsx)(Am,{className:`is-spinning`,size:15}):null,He]})]})]})}):null,xe?(0,B.jsx)(`div`,{className:`personal-lark-modal-backdrop is-setup`,role:`presentation`,children:(0,B.jsxs)(`section`,{"aria-labelledby":`new-lark-app-title`,"aria-modal":`true`,className:`personal-lark-modal personal-lark-setup-modal`,role:`dialog`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`small`,{children:o(`lark.reusableWorkspaceApp`)}),(0,B.jsx)(`h2`,{id:`new-lark-app-title`,children:o(`lark.newApp`)})]}),(0,B.jsx)(`button`,{"aria-label":o(`lark.closeCreate`),onClick:()=>void Ze(),type:`button`,children:(0,B.jsx)(oh,{size:18})})]}),De?(0,B.jsxs)(`div`,{className:`personal-lark-setup-progress`,children:[(0,B.jsx)(`span`,{className:`personal-lark-setup-icon is-${De.status}`,children:De.status===`ready`?(0,B.jsx)(om,{size:22}):(0,B.jsx)(Am,{className:De.status===`failed`?``:`is-spinning`,size:22})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:De.status===`ready`?o(`lark.appCreated`):De.status===`failed`?o(`lark.appCreateFailed`):o(`lark.waitingFeishu`)}),(0,B.jsx)(`p`,{children:De.status===`waiting_for_feishu`?o(`lark.waitingFeishuDescription`):De.status===`starting`?o(`lark.waitingLink`):De.error})]}),De.verification_url?(0,B.jsxs)(`a`,{href:De.verification_url,rel:`noreferrer`,target:`_blank`,children:[(0,B.jsx)(vm,{size:15}),o(`lark.reopenFeishu`)]}):null]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`personal-lark-setup-copy`,children:o(`lark.setupCopy`)}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.profileName`)}),(0,B.jsx)(`input`,{"aria-label":o(`lark.profileName`),autoComplete:`off`,onChange:e=>we(e.target.value),placeholder:`loopx-workspace-bot`,value:Ce})]}),(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:o(`lark.region`)}),(0,B.jsxs)(`select`,{"aria-label":o(`lark.region`),onChange:e=>Ee(e.target.value),value:Te,children:[(0,B.jsx)(`option`,{value:`feishu`,children:`Feishu`}),(0,B.jsx)(`option`,{value:`lark`,children:`Lark`})]})]}),Ce&&!/^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/.test(Ce)?(0,B.jsx)(`p`,{className:`personal-notification-error`,children:o(`lark.profileValidation`)}):null]}),je?(0,B.jsx)(`p`,{className:`personal-notification-error`,children:je}):null,(0,B.jsxs)(`footer`,{children:[(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:()=>void Ze(),type:`button`,children:o(`lark.cancel`)}),De?null:(0,B.jsxs)(`button`,{className:`personal-primary-action`,disabled:ke||!/^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/.test(Ce),onClick:()=>void Xe(),type:`button`,children:[ke?(0,B.jsx)(Am,{className:`is-spinning`,size:15}):(0,B.jsx)(vm,{size:15}),o(`lark.continueFeishu`)]})]})]})}):null]})}function jx(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function Mx(e,t,n){let r=jx(t),i=jx(n);return Object.fromEntries(e.fields.flatMap(({key:e,nullable:t})=>{let n=r[e],a=i[e];return Object.hasOwn(r,e)&&(n!=null||t&&n===null)?[[e,n]]:Object.hasOwn(i,e)&&a!=null?[[e,a]]:[]}))}function Nx(e,t){let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!=`object`||Array.isArray(n))return null;let r=new Set(e.fields.map(e=>e.key));return Object.keys(n).some(e=>!r.has(e))?null:n}function Px(e,t,n){let r={...e,[t]:n},i=e.schedule;return t===`timezone`&&i&&typeof i==`object`&&`schema_version`in i&&i.schema_version===`periodic_report_schedule_v0`&&(r.schedule={...i,timezone:n}),r}function Fx({id:e,value:t,timezone:n,onChange:r}){let{locale:i}=Ji(),a=i===`zh-CN`,o=t&&typeof t==`object`&&!Array.isArray(t)?t:null,s=String(o?.rrule??``).split(`;`).map(e=>e.split(`=`)),c=Object.fromEntries(s.filter(e=>e.length===2)),l=[`MO`,`TU`,`WE`,`TH`,`FR`,`SA`,`SU`],u=(e,t)=>e!==void 0&&/^\d+$/.test(e)&&Number(e)<=t,d=!o||o.schema_version===`periodic_report_schedule_v0`&&[`DAILY`,`WEEKLY`].includes(c.FREQ)&&o.timezone===n&&s.every(e=>e.length===2&&[`FREQ`,`BYDAY`,`BYHOUR`,`BYMINUTE`,`INTERVAL`].includes(e[0]))&&new Set(s.map(([e])=>e)).size===s.length&&u(c.BYHOUR,23)&&u(c.BYMINUTE??`0`,59)&&(c.FREQ===`WEEKLY`?l.includes(c.BYDAY):!c.BYDAY)&&(!c.INTERVAL||c.INTERVAL===`1`),f=a?[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`]:[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`];function p(e){let t={FREQ:`WEEKLY`,BYDAY:`MO`,BYHOUR:`9`,BYMINUTE:`0`,...c,...e};r?.({schema_version:`periodic_report_schedule_v0`,schedule_id:o?.schedule_id??`report-schedule`,timezone:n,rrule:[`FREQ=${t.FREQ}`,...t.FREQ===`WEEKLY`?[`BYDAY=${t.BYDAY}`]:[],`BYHOUR=${t.BYHOUR}`,`BYMINUTE=${t.BYMINUTE}`].join(`;`)})}return(0,B.jsxs)(`div`,{className:`personal-report-schedule`,children:[(0,B.jsxs)(`label`,{className:`is-boolean`,htmlFor:e,children:[(0,B.jsx)(`span`,{children:a?`按日历汇报`:`Calendar reports`}),(0,B.jsx)(`input`,{id:e,type:`checkbox`,role:`switch`,checked:!!o,disabled:!r,onChange:e=>e.target.checked?p({}):r?.(null)})]}),o?(0,B.jsxs)(B.Fragment,{children:[d?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{htmlFor:`${e}-frequency`,children:[(0,B.jsx)(`span`,{children:a?`频率`:`Frequency`}),(0,B.jsxs)(`select`,{id:`${e}-frequency`,value:c.FREQ,disabled:!r,onChange:e=>p({FREQ:e.target.value}),children:[(0,B.jsx)(`option`,{value:`DAILY`,children:a?`每天`:`Daily`}),(0,B.jsx)(`option`,{value:`WEEKLY`,children:a?`每周`:`Weekly`})]})]}),c.FREQ===`WEEKLY`&&(0,B.jsxs)(`label`,{htmlFor:`${e}-day`,children:[(0,B.jsx)(`span`,{children:a?`星期`:`Weekday`}),(0,B.jsx)(`select`,{id:`${e}-day`,value:c.BYDAY,disabled:!r,onChange:e=>p({BYDAY:e.target.value}),children:l.map((e,t)=>(0,B.jsx)(`option`,{value:e,children:f[t]},e))})]}),(0,B.jsxs)(`label`,{htmlFor:`${e}-time`,children:[(0,B.jsxs)(`span`,{children:[a?`当地时间`:`Local time`,` (`,n,`)`]}),(0,B.jsx)(`input`,{id:`${e}-time`,type:`time`,required:!0,disabled:!r,value:`${(c.BYHOUR??`9`).padStart(2,`0`)}:${(c.BYMINUTE??`0`).padStart(2,`0`)}`,onChange:e=>{if(!/^\d{2}:\d{2}$/.test(e.target.value))return;let[t,n]=e.target.value.split(`:`);p({BYHOUR:t,BYMINUTE:n})}})]})]}):(0,B.jsx)(`p`,{role:`alert`,children:a?`此计划需在 JSON 模式中编辑;当前内容已保留。`:`Edit this schedule in JSON mode; its current value is preserved.`}),(0,B.jsx)(`p`,{children:a?`由现有唤醒检查到期计划;实际送达以回执为准。`:`Existing wakes check the schedule; delivery is confirmed by its receipt.`})]}):(0,B.jsx)(`p`,{children:a?`未设置日历计划;保持阶段结束时汇报。`:`No calendar schedule; report at validated stage boundaries.`})]})}function Ix({copy:e,field:t,id:n,onChange:r,value:i,timezone:a}){let o=e[t.key]?.label??t.label,s=!r;if(t.input_kind===`periodic_report_schedule`)return(0,B.jsx)(Fx,{id:n,value:i,timezone:a,onChange:r?e=>r(t.key,e):void 0});if(t.input_kind===`boolean`)return(0,B.jsxs)(`label`,{className:`is-boolean`,htmlFor:n,children:[(0,B.jsx)(`span`,{children:o}),(0,B.jsx)(`input`,{checked:i===!0,id:n,onChange:r?e=>r(t.key,e.target.checked):void 0,readOnly:s,role:`switch`,type:`checkbox`})]});if(t.input_kind===`select`)return(0,B.jsxs)(`label`,{htmlFor:n,children:[(0,B.jsx)(`span`,{children:o}),(0,B.jsxs)(`select`,{id:n,onChange:r?e=>r(t.key,e.target.value):void 0,value:typeof i==`string`?i:``,children:[(0,B.jsx)(`option`,{value:``}),(t.options??[]).map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]});if(t.input_kind===`string_list`)return(0,B.jsxs)(`label`,{htmlFor:n,children:[(0,B.jsx)(`span`,{children:o}),(0,B.jsx)(`textarea`,{id:n,onChange:r?e=>r(t.key,e.target.value.split(/\r?\n/u).filter(Boolean)):void 0,readOnly:s,rows:4,value:Array.isArray(i)?i.join(` `):``})]});let c=t.input_kind===`number`;return(0,B.jsxs)(`label`,{htmlFor:n,children:[(0,B.jsx)(`span`,{children:o}),(0,B.jsx)(`input`,{id:n,max:t.maximum,min:t.minimum,onChange:r?e=>r(t.key,c?Number(e.target.value):e.target.value):void 0,readOnly:s,required:t.required,type:c?`number`:`text`,value:typeof i==`number`||typeof i==`string`?i:``})]})}function Lx({copy:e={},disabled:t=!1,editor:n,enabledAction:r,omitKeys:i=[],onChange:a,value:o}){let s=(0,z.useId)(),c=new Set(i);return(0,B.jsx)(`fieldset`,{className:`personal-capability-fields`,disabled:t,children:n.fields.filter(e=>!c.has(e.key)).map(t=>{let n=(0,B.jsx)(Ix,{copy:e,field:t,id:`${s}-${t.key.replace(/[^a-z0-9_-]/gi,`-`)}`,onChange:a,value:o[t.key],timezone:String(o.timezone??`UTC`)},t.key);return t.key===`enabled`&&t.input_kind===`boolean`?(0,B.jsxs)(`div`,{className:`personal-capability-enabled-row`,children:[n,r]},t.key):n})})}var Rx={en:{manager_runtime:{displayName:`Manager runtime`,description:`Selects the persistent host-tool profile used by owner manager conversations.`},steward_executor:{displayName:`Steward executor`,description:`Selects the executor, model, and reasoning effort the steward channel answers on for this machine, ahead of the Chat service environment.`},todo_replan_cadence:{displayName:`Goal review cadence`,description:`Configures the Goal review cadence.`},change_quality_qualification:{displayName:`Change quality qualification`,description:`Prepares a provider-neutral review packet, allows at most one policy-authorized safe-fix pass, and can require an exact-diff receipt.`},explore_graph:{displayName:`Explore Graph`,description:`Organizes bounded exploration as a typed evidence graph so branches, findings, and synthesis remain inspectable.`},explore_harness:{displayName:`Explore Harness`,description:`Selects a capability-owned planning and research harness profile for bounded multi-step exploration.`},lark_event_inbox:{displayName:`Lark event inbox`,description:`Receives provider events through a local-private inbox binding before LoopX projects them into governed work.`,readOnlyReason:`This capability requires a local-private inbox binding. Manage it in Lark settings or through the capability CLI.`},lark_kanban_heartbeat_sync:{displayName:`Lark Kanban heartbeat sync`,description:`Synchronizes accepted LoopX work state to the configured Lark Kanban heartbeat surface.`},local_authority_shadow:{displayName:`Local authority shadow`,description:`Observes post-commit Todo and task-lease state through the shared authority contract without taking write authority.`},multi_subagent:{displayName:`Adaptive child capacity`,description:`Sets bounded child-agent capacity and the public-safe responsibility domains in which parallel work may be delegated.`},peer_task_coordination:{displayName:`Registered-peer task coordination`,description:`Routes explicitly scoped peer-owned work to one registered coordinator without granting cross-owner mutation authority.`},periodic_report:{displayName:`Periodic reports`,description:`Turns validated Goal stage progress into a frozen report and automatically delivers it through the configured Goal Channel with exact readback.`},pull_request_review:{displayName:`Pull-request review`,description:`Ranks the public GitHub PR review queue with a machine-level default; it never grants GitHub, Todo, push, or merge authority.`},reward_memory:{displayName:`Reward Memory experiment`,description:`Configures a reviewed local-private provider binding for Goal-scoped Agent recall and evidence-backed outcome learning.`}},"zh-CN":{manager_runtime:{displayName:`管家 Runtime`,description:`选择管家会话持续生效的宿主工具模式。`},steward_executor:{displayName:`管家执行器`,description:`选择本机管家通道使用的执行器、模型与推理档位,优先级高于服务环境变量。`},todo_replan_cadence:{displayName:`Goal 复核周期`,description:`配置 Goal 的复核周期。`},change_quality_qualification:{displayName:`变更质量验证`,description:`生成与 Provider 无关的审阅包,最多允许一次策略授权的安全修复,并可要求精确 diff 回执。`},explore_graph:{displayName:`探索图谱`,description:`把有界探索组织为 typed 证据图,让探索分支、发现与综合结论都可检查、可追溯。`},explore_harness:{displayName:`探索 Harness`,description:`为有界的多步探索选择由能力负责的规划与研究 Harness profile。`},lark_event_inbox:{displayName:`飞书事件收件箱`,description:`通过本机私有收件箱接收 Provider 事件,再由 LoopX 将其投影为受治理的工作。`,readOnlyReason:`此能力依赖本机私有的收件箱绑定,请在飞书设置或 capability CLI 中管理。`},lark_kanban_heartbeat_sync:{displayName:`飞书看板心跳同步`,description:`把 LoopX 已接受的工作状态同步到配置好的飞书看板心跳界面。`},local_authority_shadow:{displayName:`本地 Authority 影子观测`,description:`通过共享 Authority contract 观测提交后的 Todo 与 task lease 状态,但不取得写入权。`},multi_subagent:{displayName:`自适应子 Agent 容量`,description:`限定子 Agent 容量与可公开的职责域,只有落在这些边界内的工作才能并行委派。`},peer_task_coordination:{displayName:`已注册 Peer 任务协调`,description:`把明确限定的 Peer 工作路由给一个已注册协调者,不授予跨 Owner 修改权限。`},periodic_report:{displayName:`周期报告`,description:`把经过验证的 Goal 阶段进展整理为冻结报告,并通过配置的 Goal Channel 自动发送和精确回读。`},pull_request_review:{displayName:`Pull-request Review`,description:`配置公开 GitHub PR 审阅队列的本机默认排序;不会授予 GitHub、Todo、push 或 merge 权限。`},reward_memory:{displayName:`Reward Memory 实验`,description:`为 Goal 内 Agent 的召回与证据化结果学习配置经过审阅的本机私有 Provider 绑定。`}}},zx={en:{runtime_profile:{label:`Runtime profile`,description:`Restricted keeps scoped LoopX reads only. Trusted owner enables normal host tools while protected operations retain separate checks.`},executor_endpoint:{label:`Steward executor`,description:`The executor this machine's steward channel answers on. The choice outranks the Chat service environment and the shipped default.`},executor_model:{label:`Model`,description:`Optional model for the selected executor. Leave blank to keep the executor's own default.`},executor_reasoning_effort:{label:`Reasoning effort`,description:`Optional reasoning effort for the selected executor. Leave blank to keep the executor's own default.`},completed_todos:{label:`Completed Todos between Goal reviews`,description:`Machine default or explicit Goal override, from 1 to 5.`},allowed_domains:{label:`Allowed responsibility domains`,description:`Enter one bounded, public-safe domain per line.`},coordinator_agent_id:{label:`Coordinator Agent`,description:`Use an already registered Agent id; leave blank to disable coordination.`},enabled:{label:`Enabled`},model:{label:`Child model`,description:`For example gpt-5.6-luna. Blank clears the child model preference.`},reasoning_effort:{label:`Child reasoning effort`,description:`For example max; the host must support this model and effort.`},max_children:{label:`Maximum children`,description:`Hard upper bound for concurrently delegated child work.`},profile:{label:`Planner profile`,description:`Select one registered Explore Harness profile.`},profile_preset:{label:`Report profile`,description:`Capability-owned report profile, such as weekly-progress.`},wait_for_ci:{label:`Wait for CI`,description:`Disable to use local validation without querying or waiting for CI. Merge authority is unchanged.`},review_priority:{label:`Review priority`,description:`Choose whether other developers' PRs or the authenticated reviewer's own PRs are ranked first.`},route_ref:{label:`Goal Channel route`,description:`Public route alias only; credentials and provider identifiers stay outside this form.`},safe_fix:{label:`Allow one bounded safe-fix pass`},strict_receipt:{label:`Require an exact-diff receipt`},timezone:{label:`Timezone`,description:`Use an IANA timezone, for example Asia/Shanghai.`},schedule:{label:`Calendar reports`,description:`Optional daily or weekly reports; no schedule preserves stage-only delivery.`},config_path:{label:`Local-private configuration path`,description:`Repo-relative ignored JSON under .loopx/config/. Leave blank to retain the current binding; the path is never returned.`},enabled_agents:{label:`Enabled Goal Agents`,description:`Enter one registered Goal-local Agent id per line. A private binding currently accepts exactly one Agent.`}},"zh-CN":{runtime_profile:{label:`运行模式`,description:`restricted 仅使用受限 LoopX 读取;trusted_owner 开放常规宿主工具,但受保护操作仍单独校验。`},executor_endpoint:{label:`管家执行器`,description:`本机管家通道使用的执行器;优先级高于 Chat 服务环境变量与出货默认值。`},executor_model:{label:`模型`,description:`所选执行器使用的模型,可留空;留空表示沿用执行器自身的默认模型。`},executor_reasoning_effort:{label:`推理档位`,description:`所选执行器使用的推理档位,可留空;留空表示沿用执行器自身的默认档位。`},completed_todos:{label:`两次 Goal 复核间的已完成 Todo 数`,description:`可设置 1–5;机器默认值可被 Goal 显式覆盖。`},allowed_domains:{label:`允许的职责域`,description:`每行填写一个有边界、可公开的职责域。`},coordinator_agent_id:{label:`协调 Agent`,description:`填写一个已经注册的 Agent ID;留空表示关闭协调。`},enabled:{label:`启用`},model:{label:`子 Agent 模型`,description:`例如 gpt-5.6-luna;留空清除模型偏好。`},reasoning_effort:{label:`子 Agent 推理档位`,description:`例如 max;宿主须支持所选模型与档位。`},max_children:{label:`最大子 Agent 数`,description:`可同时委派的子任务硬上限。`},profile:{label:`规划 Profile`,description:`选择一个已注册的 Explore Harness profile。`},profile_preset:{label:`报告 Profile`,description:`由该能力管理的报告 profile,例如 weekly-progress。`},wait_for_ci:{label:`等待 CI`,description:`关闭后使用本地验证,不查询或等待 CI;不改变合并权限。`},review_priority:{label:`审阅优先级`,description:`选择先排其他开发者的 PR,还是先排当前已认证审阅者自己的 PR。`},route_ref:{label:`Goal Channel 路由`,description:`只填写公开 route alias;凭据与 Provider 标识不会进入此表单。`},safe_fix:{label:`允许一次有界安全修复`},strict_receipt:{label:`要求精确 diff 回执`},timezone:{label:`时区`,description:`使用 IANA 时区,例如 Asia/Shanghai。`},schedule:{label:`日历汇报`,description:`可选每日或每周计划;未设置时保持阶段结束汇报。`},config_path:{label:`本机私有配置路径`,description:`填写 .loopx/config/ 下、相对仓库且被忽略的 JSON;留空保留当前绑定,路径不会被回传。`},enabled_agents:{label:`已启用的 Goal Agent`,description:`每行填写一个已注册的 Goal 内 Agent ID;私有绑定当前只接受一个 Agent。`}}};function Bx(e,t){let n=Rx[t][e.capability_id];return n?{...e,display_name:n.displayName,description:n.description,configuration_editor:{...e.configuration_editor,...n.readOnlyReason?{read_only_reason:n.readOnlyReason}:{}}}:e}function Vx(e){return zx[e]}Object.freeze(Object.keys(Rx.en).sort());function Hx(e,t){return e.available_scopes.includes(t)&&(t!==`machine`||!!e.machine_namespace)&&e.configuration_editor.editable&&e.configuration_editor.writable_scopes.includes(t)}function Ux({values:e,t}){return(0,B.jsxs)(`details`,{className:`personal-capability-raw-values`,children:[(0,B.jsx)(`summary`,{children:t(`capabilities.rawJson`)}),(0,B.jsx)(`div`,{className:`personal-capability-value-grid`,children:e.map(({label:e,value:t})=>(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`strong`,{children:e}),(0,B.jsx)(`pre`,{children:t?JSON.stringify(t,null,2):`—`})]},e))})]})}function Wx({source:e,t}){return e?(0,B.jsxs)(`p`,{className:`personal-capability-effective-source`,children:[(0,B.jsx)(Zm,{"aria-hidden":!0,size:15}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:t(`capabilities.effectiveSource`)}),t(`capabilities.source.${e}`)]})]}):null}function Gx({available:e,description:t,t:n}){return e?null:(0,B.jsxs)(`section`,{className:`personal-capability-editor-status is-read-only`,children:[(0,B.jsx)(ih,{"aria-hidden":!0,size:18}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:n(`capabilities.readOnly`)}),(0,B.jsx)(`p`,{children:t})]})]})}function Kx(e){return e.availability?.includes(`experimental`)?4:e.capability_id===`multi_subagent`?3:e.configuration_editor.writable_scopes.length===0||e.availability===`supported_explicit_opt_in`?2:e.availability===`supported_explicit_override`?0:1}function qx(e,t){return[...e].sort((e,n)=>{let r=Kx(e)-Kx(n);if(r!==0)return r;let i=Bx(e,t),a=Bx(n,t);return i.display_name.localeCompare(a.display_name,t)||e.capability_id.localeCompare(n.capability_id)})}function Jx({capabilities:e,locale:t,onSelect:n,scope:r,selectedCapabilityId:i,t:a}){return(0,B.jsx)(`nav`,{"aria-label":a(r===`goal`?`capabilities.catalog`:`machine.capabilityCatalog`),className:`personal-capability-list`,tabIndex:0,children:qx(e,t).map(e=>{let o=Bx(e,t);return(0,B.jsxs)(`button`,{"aria-current":i===o.capability_id?`page`:void 0,onClick:()=>n(o.capability_id),type:`button`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)(`strong`,{children:o.display_name})}),(0,B.jsx)(`em`,{children:a(o.available_scopes.includes(r)?r===`goal`?`capabilities.goalScope`:`capabilities.machineScope`:r===`machine`?`capabilities.goalScope`:`capabilities.machineScope`)})]},o.capability_id)})})}function Yx({capability:e,locale:t,source:n}){let{t:r}=Ji(),i=Bx(e,t);return(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`span`,{className:`personal-settings-icon`,children:(0,B.jsx)(Qm,{"aria-hidden":!0,size:18})}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`personal-capability-heading-row`,children:[(0,B.jsx)(`h2`,{children:i.display_name}),(0,B.jsx)(Wx,{source:n,t:r})]}),e.context_contribution&&(0,B.jsxs)(`details`,{className:`personal-capability-help`,"data-testid":`capability-context-phases`,children:[(0,B.jsx)(`summary`,{children:t===`zh-CN`?`主 Agent 协作指导`:`Coordinator workflow guidance`}),(0,B.jsx)(`p`,{children:t===`zh-CN`?`随能力开启。支持以下阶段;此处展示能力范围,不能证明某次运行已读取或采纳。`:`Enabled with this capability. These are supported phases, not proof that a run read or adopted the guidance.`}),(0,B.jsx)(`dl`,{children:e.context_contribution.supported_phases.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:(0,B.jsx)(`code`,{children:e})}),(0,B.jsx)(`dd`,{children:Xx[e][t===`zh-CN`?`zh`:`en`]})]},e))}),(0,B.jsx)(`p`,{children:t===`zh-CN`?`LoopX Turn 在请求与结果中提供上下文;原生工具入口由 LoopX skill 调用同一只读接口。执行与采纳需另看运行证据。`:`LoopX Turn includes context in requests and results. For native tools, the LoopX skill reads the same interface. Execution and adoption require run evidence.`})]}),(0,B.jsxs)(`details`,{className:`personal-capability-help`,children:[(0,B.jsx)(`summary`,{children:t===`zh-CN`?`配置说明`:`Configuration help`}),(0,B.jsx)(`p`,{children:i.description}),(0,B.jsx)(`dl`,{children:e.configuration_editor.fields.map(e=>{let n=Vx(t)[e.key],r=n?.description??e.description;return r?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:n?.label??e.label}),(0,B.jsx)(`dd`,{children:r})]},e.key):null})})]},e.capability_id)]})]})}var Xx={before_plan:{zh:`规划前:识别独立问题并保留主 Agent 的核验与整合职责。`,en:`Before planning: identify independent questions and retain coordinator validation and integration.`},before_delegate:{zh:`委派前:明确子任务边界、模型偏好及预期证据。`,en:`Before delegation: specify task boundaries, model preferences and expected evidence.`},after_delegate_result:{zh:`回收后:核验结果,说明采纳决定并关联计划与成果。`,en:`After results: validate evidence, explain acceptance and link plans and deliverables.`}};function Zx({callbacks:e,goalId:t,notification:n,onChanged:r}){let{t:i}=Ji(),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(null);async function l(n){if(e.onToggleGoalAutoNotify){o(!0),c(null);try{let a=await e.onToggleGoalAutoNotify({autoNotify:n,goalId:t});if(!a.ok){c(a.public_summary??a.blocker??i(`notifications.setupFailed`));return}r()}catch(e){c(e instanceof Error?e.message:i(`notifications.setupFailed`))}finally{o(!1)}}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`personal-notification-toggle`,children:[(0,B.jsx)(`input`,{checked:n?.humanGateAutoNotifyEnabled??!1,disabled:a||n?.configured!==!0||!e.onToggleGoalAutoNotify,onChange:e=>void l(e.target.checked),type:`checkbox`}),(0,B.jsx)(`span`,{children:i(`notifications.autoNotify`)}),a?(0,B.jsx)(Am,{"aria-hidden":!0,className:`is-spinning`,size:14}):null]}),s?(0,B.jsx)(`p`,{className:`personal-notification-error`,role:`alert`,children:s}):null]})}function Qx({goalId:e,onApplied:t,selected:n,t:r}){let[i,a]=(0,z.useState)({busy:null,draft:{},partialWrite:null,preview:null}),[o,s]=(0,z.useState)(null),[c,l]=(0,z.useState)(`guided`),[u,d]=(0,z.useState)(``),f=(0,z.useMemo)(()=>n?Nx(n.configuration_editor,u):null,[n,u]),p=c===`guided`||f!==null;(0,z.useEffect)(()=>{l(`guided`),d(``),a({busy:null,draft:Mx(n?.configuration_editor??{fields:[]},n?.current??n?.effective_configuration?.configuration??n?.default,n?.default),partialWrite:null,preview:null}),s(null)},[n]);async function m(t){if(!(!n||i.busy||!p)){a(e=>({...e,busy:`preview`,partialWrite:null})),s(null);try{let r=await Hg(e,n.capability_id,t);a(e=>({...e,preview:r}))}catch(e){s(e instanceof Error?e.message:r(`capabilities.previewFailed`))}finally{a(e=>({...e,busy:null}))}}}async function h(){if(!(!n||!i.preview||i.busy||!p)){a(e=>({...e,busy:`apply`})),s(null);try{let r=Mx(n.configuration_editor,i.draft,n.default),o=await Ug(e,n.capability_id,i.preview.action===`delete`?null:r,i.preview.plan_revision);a(e=>({...e,partialWrite:o.status===`partial_write`?o:null,preview:null})),o.status!==`partial_write`&&t()}catch(e){a(e=>({...e,preview:null})),s(e instanceof Error?e.message:r(`capabilities.applyFailed`))}finally{a(e=>({...e,busy:null}))}}}function g(e,t){a(r=>({...r,draft:n?.capability_id===`periodic_report`?Px(r.draft,e,t):{...r.draft,[e]:t},preview:null})),s(null)}function _(e){if(!n||i.busy)return;d(e);let t=Nx(n.configuration_editor,e);a(e=>({...e,preview:null,draft:t?Mx(n.configuration_editor,t,n.default):e.draft})),s(null)}function v(){i.busy||!p||(c===`guided`&&d(JSON.stringify(i.draft,null,2)),l(c===`guided`?`json`:`guided`),a(e=>({...e,preview:null})))}return{apply:h,changeDraft:g,changeJson:_,changeMode:v,editorMode:c,jsonDraft:u,jsonValid:p,error:o,mutation:i,preview:m}}function $x({mutationError:e,onApplied:t,partialWrite:n,preview:r}){let{t:i}=Ji();return(0,B.jsxs)(B.Fragment,{children:[e?(0,B.jsx)(`p`,{className:`personal-machine-error`,role:`alert`,children:e}):null,n?(0,B.jsxs)(`section`,{"aria-live":`polite`,className:`personal-capability-recovery`,children:[(0,B.jsx)(ih,{"aria-hidden":!0,size:18}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:i(`capabilities.partialWrite`)}),(0,B.jsx)(`p`,{children:i(`capabilities.partialWriteDescription`)}),(0,B.jsx)(`small`,{children:n.recommended_action})]}),(0,B.jsxs)(`button`,{onClick:t,type:`button`,children:[(0,B.jsx)(Um,{"aria-hidden":!0,size:15}),i(`capabilities.refreshSource`)]})]}):null,r?(0,B.jsxs)(`section`,{className:`personal-capability-preview`,"aria-label":i(`capabilities.preview`),children:[(0,B.jsx)(`strong`,{children:i(`capabilities.preview`)}),(0,B.jsx)(`span`,{children:i(`machine.action.${r.action}`)}),(0,B.jsx)(`small`,{children:i(`capabilities.previewLocked`)})]}):null]})}function eS({callbacks:e,catalog:t,goalId:n,notification:r,onApplied:i,onNotificationChanged:a}){let{locale:o,t:s}=Ji(),c=(0,z.useMemo)(()=>qx(t.capabilities,o),[t.capabilities,o]),[l,u]=(0,z.useState)(()=>c[0]?.capability_id??``),d=(0,z.useMemo)(()=>c.find(e=>e.capability_id===l)??c[0],[c,l]),f=(0,z.useMemo)(()=>d?Bx(d,o):void 0,[o,d]),{apply:p,changeDraft:m,changeJson:h,changeMode:g,editorMode:_,jsonDraft:v,jsonValid:y,error:b,mutation:x,preview:S}=Qx({goalId:n,onApplied:i,selected:f,t:s}),{busy:C,draft:w,partialWrite:T,preview:E}=x;if(!d||!f)return(0,B.jsx)(`p`,{className:`personal-capability-empty`,children:s(`capabilities.empty`)});let D=f.available_scopes.includes(`goal`),O=Hx(f,`goal`),k=f.configuration_editor.read_only_reason??s(D?`capabilities.previewOnly`:`capabilities.machineOnly`);async function ee(){if(!f||!O||C||!y)return;let e=Mx(f.configuration_editor,w,f.default);await S(e)}async function te(){!O||C||await S(null)}return(0,B.jsxs)(`div`,{className:`personal-capability-layout`,children:[(0,B.jsx)(Jx,{capabilities:t.capabilities,locale:o,onSelect:u,scope:`goal`,selectedCapabilityId:f.capability_id,t:s}),(0,B.jsxs)(`article`,{"aria-label":f.display_name,className:`personal-capability-detail`,tabIndex:0,children:[(0,B.jsx)(Yx,{capability:d,locale:o,source:f.effective_configuration?.source}),(0,B.jsx)(Gx,{available:O,t:s,description:k}),f.capability_id===`lark_event_inbox`?(0,B.jsxs)(`section`,{className:`personal-capability-linked-setting`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:s(`capabilities.larkInboxNotificationSetting`)}),(0,B.jsx)(`p`,{children:s(`capabilities.larkInboxNotificationDescription`)})]}),(0,B.jsx)(Zx,{callbacks:e,goalId:n,notification:r,onChanged:a})]}):null,O?(0,B.jsxs)(B.Fragment,{children:[_===`json`||!f.configuration_editor.fields.some(e=>e.key===`enabled`&&e.input_kind===`boolean`)?(0,B.jsx)(`div`,{className:`personal-capability-editor-mode`,children:(0,B.jsxs)(`button`,{disabled:!!C||!y,onClick:g,type:`button`,children:[(0,B.jsx)(pm,{"aria-hidden":!0,size:14}),s(_===`guided`?`machine.editJson`:`machine.backToForm`)]})}):null,_===`guided`?(0,B.jsx)(`section`,{className:`personal-capability-field-summary`,children:(0,B.jsx)(Lx,{disabled:!!C,copy:Vx(o),editor:f.configuration_editor,onChange:m,value:w,enabledAction:(0,B.jsxs)(`button`,{className:`personal-capability-edit-json`,onClick:g,type:`button`,children:[(0,B.jsx)(pm,{"aria-hidden":!0,size:14}),s(`machine.editJson`)]})})}):(0,B.jsxs)(`label`,{className:`personal-capability-json-editor`,htmlFor:`goal-configuration-json`,children:[(0,B.jsx)(`span`,{children:s(`capabilities.jsonConfiguration`)}),(0,B.jsx)(`textarea`,{id:`goal-configuration-json`,"aria-describedby":`goal-configuration-json-help`,disabled:!!C,onChange:e=>h(e.target.value),rows:12,spellCheck:!1,value:v}),(0,B.jsx)(`small`,{id:`goal-configuration-json-help`,children:s(`capabilities.jsonHelp`)}),y?null:(0,B.jsx)(`span`,{className:`personal-machine-validation`,role:`alert`,children:s(`capabilities.jsonInvalid`)})]})]}):null,(0,B.jsx)($x,{mutationError:b,onApplied:i,partialWrite:T,preview:E}),O?(0,B.jsxs)(`footer`,{className:`personal-capability-actions`,children:[f.current&&f.available_scopes.includes(`machine`)?(0,B.jsx)(`button`,{disabled:!!C||!y,onClick:()=>void te(),type:`button`,children:s(`capabilities.restoreInheritance`)}):null,(0,B.jsx)(`button`,{disabled:!!C||!y,onClick:()=>void ee(),type:`button`,children:s(C===`preview`?`common.loading`:`capabilities.previewChanges`)}),(0,B.jsx)(`button`,{className:`is-primary`,disabled:!!C||!E||!y,onClick:()=>void p(),type:`button`,children:s(C===`apply`?`common.loading`:`capabilities.applyPreview`)})]}):null,(0,B.jsx)(Ux,{values:[{label:s(`capabilities.goalValue`),value:f.current},{label:s(f.machine_current?`capabilities.machineValue`:`capabilities.defaultValue`),value:f.machine_current??f.default}],t:s},d.capability_id)]})]})}function tS({callbacks:e,goalId:t,notification:n,onChanged:r}){let{t:i}=Ji(),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(null),[l,u]=(0,z.useState)(!1);function d(){t&&(u(!0),c(null),Vg(t).then(o).catch(e=>c(e instanceof Error?e.message:i(`capabilities.loadFailed`))).finally(()=>u(!1)))}return(0,z.useEffect)(d,[t]),t?l&&!a?(0,B.jsxs)(`p`,{"aria-live":`polite`,className:`personal-capability-empty`,children:[(0,B.jsx)(Am,{className:`personal-spin`,size:18}),i(`capabilities.loading`)]}):s?(0,B.jsxs)(`section`,{className:`personal-capability-error`,role:`alert`,children:[(0,B.jsx)(ih,{"aria-hidden":!0,size:18}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:i(`capabilities.loadFailed`)}),(0,B.jsx)(`small`,{children:s})]}),(0,B.jsxs)(`button`,{onClick:d,type:`button`,children:[(0,B.jsx)(Um,{"aria-hidden":!0,size:15}),i(`capabilities.retry`)]})]}):a?(0,B.jsxs)(`section`,{className:`personal-capability-settings`,"data-revision":a.revision,children:[(0,B.jsxs)(`details`,{className:`personal-capability-scope-note`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(Zm,{"aria-hidden":!0,size:17}),i(`capabilities.atomicOverride`)]}),(0,B.jsx)(`p`,{children:i(`capabilities.atomicOverrideDescription`)})]}),(0,B.jsx)(eS,{callbacks:e,catalog:a.capability_catalog,goalId:t,notification:n,onApplied:d,onNotificationChanged:r})]}):null:(0,B.jsx)(`p`,{className:`personal-capability-empty`,children:i(`capabilities.chooseGoal`)})}function nS(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function rS(e,t){let n=t?.machine_namespace;return n?e?.machine_configuration?.namespaces[n]:void 0}function iS(e,t,n){return{...nS(e.default),...nS(t),...n}}function aS(e,t){for(let n of e.configuration_editor.fields){let e=t[n.key];if(n.required&&(e==null||e===``))return!1}return e.capability_id===`periodic_report`&&t.enabled===!0?!!(String(t.profile_preset??``).trim()&&String(t.route_ref??``).trim()&&String(t.timezone??``).trim()):!0}function oS(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:null}catch{return null}}function sS(e){return e?e===`absent`?e:e.replace(/^sha256:/,``).slice(0,12):`—`}function cS(){let{locale:e,t}=Ji(),[n,r]=(0,z.useState)(null),[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)({}),[c,l]=(0,z.useState)(`{}`),[u,d]=(0,z.useState)(`guided`),[f,p]=(0,z.useState)(null),[m,h]=(0,z.useState)(`upsert`),[g,_]=(0,z.useState)(null),[v,y]=(0,z.useState)(null),[b,x]=(0,z.useState)(`load`),[S,C]=(0,z.useState)(null),[w,T]=(0,z.useState)(null),E=(0,z.useMemo)(()=>qx(n?.capability_catalog.capabilities??[],e),[n,e]),D=n?.invalid_namespaces[0],O=E.find(e=>e.capability_id===i)??(D?E.find(e=>e.machine_namespace===D):void 0)??E.find(e=>Hx(e,`machine`))??E[0],k=O?Bx(O,e):void 0,ee=rS(n,k),te=!!(k?.machine_namespace&&ee),A=!!(k&&Hx(k,`machine`)),j=(0,z.useMemo)(()=>oS(c),[c]),M=k?u===`json`?j:iS(k,ee,o):null,ne=!!(k&&(u===`json`?j:aS(k,M??{})));async function N(){r(await Bg())}(0,z.useEffect)(()=>{let e=!0;return Bg().then(t=>{e&&r(t)}).catch(n=>{e&&C(n instanceof Error?n.message:t(`machine.loadError`))}).finally(()=>{e&&x(null)}),()=>{e=!1}},[t]),(0,z.useEffect)(()=>{if(!k)return;let e=rS(n,k),t=Mx(k.configuration_editor,e??k.default,k.default),r=iS(k,e,t);s(t),l(JSON.stringify(r,null,2)),d(A?`guided`:`json`),p(null),h(`upsert`),y(null)},[n,i,e]);function P(e,t){s(n=>k?.capability_id===`periodic_report`?Px(n,e,t):{...n,[e]:t}),p(null),h(`upsert`),C(null),T(null)}function re(e){if(k){if(e===`json`)l(JSON.stringify(iS(k,ee,o),null,2));else if(j)s(Mx(k.configuration_editor,j,k.default));else{C(t(`machine.jsonInvalid`));return}d(e),p(null),h(`upsert`),C(null)}}async function ie(){if(!(!A||!k?.machine_namespace||!M||!ne||b)){x(`preview`),C(null),T(null);try{h(`upsert`),p(await Wg(k.machine_namespace,M))}catch(e){C(e instanceof Error?e.message:t(`machine.previewError`))}finally{x(null)}}}async function ae(){if(!(!A||!k?.machine_namespace||!te||b)){x(`preview`),C(null),T(null);try{h(`remove`),p(await Kg(k.machine_namespace))}catch(e){C(e instanceof Error?e.message:t(`machine.previewError`))}finally{x(null)}}}async function F(){if(!A||!k?.machine_namespace||!f||b||m===`upsert`&&!M)return;x(`apply`),C(null);let e=m;try{let n=e===`remove`?await qg(k.machine_namespace,f.plan_revision):await Gg(k.machine_namespace,M,f.plan_revision);_(n),p(null),h(`upsert`),y(null),await N(),T(n.status===`applied`?t(e===`remove`?`machine.removed`:`machine.applied`):t(`machine.unchanged`))}catch(e){p(null),h(`upsert`),C(e instanceof Error?e.message:t(`machine.applyError`))}finally{x(null)}}async function oe(){if(!(!g?.transaction_id||b)){x(`rollback-preview`),C(null);try{y(await Jg(g.transaction_id))}catch(e){C(e instanceof Error?e.message:t(`machine.rollbackError`))}finally{x(null)}}}async function I(){if(!(!g?.transaction_id||!v||b)){x(`rollback`),C(null);try{await Yg(g.transaction_id,v.plan_revision),_(null),y(null),p(null),await N(),T(t(`machine.rolledBack`))}catch(e){y(null),C(e instanceof Error?e.message:t(`machine.rollbackError`))}finally{x(null)}}}return b===`load`?(0,B.jsx)(`div`,{className:`personal-machine-loading`,role:`status`,children:t(`common.loading`)}):k?(0,B.jsxs)(`section`,{className:`personal-capability-settings`,"data-revision":n?.revision,children:[(0,B.jsxs)(`details`,{className:`personal-capability-scope-note`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(Zm,{"aria-hidden":!0,size:17}),t(`machine.liveDefault`)]}),(0,B.jsx)(`p`,{children:t(`machine.liveDefaultDescription`)})]}),(0,B.jsxs)(`div`,{className:`personal-capability-body`,children:[n?.status===`invalid`?(0,B.jsxs)(`section`,{className:`personal-machine-error`,"data-testid":`machine-invalid-repair`,role:`alert`,children:[(0,B.jsx)(`strong`,{children:t(`machine.invalidStoredConfiguration`)}),(0,B.jsx)(`p`,{children:t(`machine.invalidStoredConfigurationDescription`)})]}):null,(0,B.jsxs)(`div`,{className:`personal-capability-layout`,children:[(0,B.jsx)(Jx,{capabilities:E,locale:e,onSelect:a,scope:`machine`,selectedCapabilityId:k.capability_id,t}),(0,B.jsxs)(`article`,{"aria-label":k.display_name,className:`personal-capability-detail`,tabIndex:0,children:[(0,B.jsx)(Yx,{capability:O,locale:e,source:k.available_scopes.includes(`machine`)?te?`machine_default`:`capability_default`:void 0}),(0,B.jsx)(Gx,{available:A,t,description:k.available_scopes.includes(`machine`)?t(`machine.editorUnavailableDescription`):t(`machine.goalOnly`)}),k.capability_id===`periodic_report`?(0,B.jsxs)(`section`,{className:`personal-capability-behavior-note`,children:[(0,B.jsx)(Zm,{"aria-hidden":!0,size:18}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:ee?.schedule?e===`zh-CN`?`日历与阶段汇报`:`Calendar and stage reports`:t(`machine.periodicReportActivation`)}),(0,B.jsx)(`p`,{children:ee?.schedule?ee.enabled===!0?e===`zh-CN`?`已配置日历计划,由现有唤醒检查;是否送达请核对报告回执。`:`A calendar schedule is configured and checked by existing wakes. Verify delivery in the report receipt.`:e===`zh-CN`?`日历计划已保存;启用此能力后才会检查和投递。`:`The schedule is saved; enable this capability to check and deliver reports.`:t(`machine.periodicReportActivationDescription`)})]})]}):null,k.capability_id===`change_quality_qualification`?(0,B.jsxs)(`section`,{className:`personal-capability-behavior-note`,children:[(0,B.jsx)(Zm,{"aria-hidden":!0,size:18}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:t(`machine.changeQualityActivation`)}),(0,B.jsx)(`p`,{children:t(`machine.changeQualityActivationDescription`)})]})]}):null,k.capability_id===`todo_replan_cadence`?(0,B.jsxs)(`section`,{className:`personal-capability-behavior-note`,children:[(0,B.jsx)(Zm,{"aria-hidden":!0,size:18}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:t(`machine.replanCadenceActivation`)}),(0,B.jsx)(`p`,{children:t(`machine.replanCadenceActivationDescription`)})]})]}):null,k.capability_id===`pull_request_review`?(0,B.jsxs)(`section`,{className:`personal-capability-behavior-note`,children:[(0,B.jsx)(Zm,{"aria-hidden":!0,size:18}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e===`zh-CN`?`只改变队列排序`:`Queue ordering only`}),(0,B.jsx)(`p`,{children:e===`zh-CN`?`默认先审阅其他开发者的 PR;选择 owner-first 才会优先当前已认证审阅者自己的 PR。此配置不会发布 review、写 Todo、push 或 merge。`:`The default reviews other developers' PRs first; choose owner-first only when the authenticated reviewer's own PRs should lead. This setting never posts a review, writes Todos, pushes, or merges.`})]})]}):null,A?(0,B.jsxs)(B.Fragment,{children:[u===`json`||!k.configuration_editor.fields.some(e=>e.key===`enabled`&&e.input_kind===`boolean`)?(0,B.jsx)(`div`,{className:`personal-capability-editor-mode`,children:(0,B.jsxs)(`button`,{onClick:()=>re(u===`guided`?`json`:`guided`),type:`button`,children:[(0,B.jsx)(pm,{"aria-hidden":!0,size:14}),t(u===`guided`?`machine.editJson`:`machine.backToForm`)]})}):null,u===`guided`?(0,B.jsxs)(`section`,{className:`personal-capability-field-summary`,children:[(0,B.jsx)(Lx,{copy:Vx(e),disabled:!!b,editor:k.configuration_editor,onChange:P,value:o,enabledAction:(0,B.jsxs)(`button`,{className:`personal-capability-edit-json`,onClick:()=>re(`json`),type:`button`,children:[(0,B.jsx)(pm,{"aria-hidden":!0,size:14}),t(`machine.editJson`)]})}),ne?null:(0,B.jsx)(`p`,{className:`personal-machine-validation`,role:`alert`,children:t(`machine.requiredFields`)})]}):(0,B.jsxs)(`label`,{className:`personal-capability-json-editor`,htmlFor:`machine-configuration-json`,children:[(0,B.jsx)(`span`,{children:t(`machine.jsonConfiguration`)}),(0,B.jsx)(`textarea`,{"aria-describedby":`machine-configuration-json-help`,disabled:!!b,id:`machine-configuration-json`,onChange:e=>{l(e.target.value),p(null),C(null)},rows:12,spellCheck:!1,value:c}),(0,B.jsx)(`small`,{id:`machine-configuration-json-help`,children:t(`machine.jsonConfigurationHelp`)}),j?null:(0,B.jsx)(`span`,{className:`personal-machine-validation`,role:`alert`,children:t(`machine.jsonInvalid`)})]})]}):null,S?(0,B.jsx)(`p`,{className:`personal-machine-error`,role:`alert`,children:S}):null,w?(0,B.jsxs)(`p`,{className:`personal-machine-notice`,role:`status`,"aria-live":`polite`,children:[(0,B.jsx)(om,{"aria-hidden":!0,size:16}),w]}):null,f?(0,B.jsxs)(`section`,{"aria-label":t(`machine.preview`),className:`personal-machine-preview`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:t(`machine.preview`)}),(0,B.jsx)(`span`,{children:t(`machine.action.${f.action}`)})]}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`machine.currentRevision`)}),(0,B.jsx)(`dd`,{title:f.current_revision,children:sS(f.current_revision)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`machine.desiredRevision`)}),(0,B.jsx)(`dd`,{title:f.desired_revision,children:sS(f.desired_revision)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t(`machine.changedNamespaces`)}),(0,B.jsx)(`dd`,{children:f.changed_namespaces.join(`, `)||t(`common.none`)})]})]}),(0,B.jsx)(`p`,{children:t(`machine.previewLocked`)})]}):null,g?.rollback_available&&g.transaction_id?(0,B.jsxs)(`section`,{className:`personal-machine-rollback`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:t(`machine.rollbackAvailable`)}),(0,B.jsx)(`p`,{children:t(v?`machine.rollbackPreviewDescription`:`machine.rollbackDescription`)})]}),(0,B.jsxs)(`button`,{className:`personal-secondary-action`,disabled:!!b||!!(v&&!v.rollback_allowed),onClick:()=>void(v?I():oe()),type:`button`,children:[(0,B.jsx)(Wm,{"aria-hidden":!0,size:15}),t(b===`rollback`||b===`rollback-preview`?`common.loading`:v?`machine.confirmRollback`:`machine.previewRollback`)]})]}):null,A?(0,B.jsxs)(`footer`,{className:`personal-capability-actions`,children:[te?(0,B.jsxs)(`button`,{className:`is-danger`,disabled:!!b,onClick:()=>void ae(),type:`button`,children:[(0,B.jsx)(rh,{"aria-hidden":!0,size:15}),t(`machine.previewRemoval`)]}):null,(0,B.jsx)(`button`,{disabled:!!b||!ne,onClick:()=>void ie(),type:`button`,children:t(b===`preview`?`common.loading`:`machine.previewChanges`)}),(0,B.jsx)(`button`,{className:`is-primary`,disabled:!!b||!f,onClick:()=>void F(),type:`button`,children:t(b===`apply`?`common.loading`:`machine.applyPreview`)})]}):null,k.available_scopes.includes(`machine`)?(0,B.jsx)(Ux,{values:[{label:t(`machine.currentValue`),value:ee},{label:t(`capabilities.defaultValue`),value:k.default}],t},k.capability_id):null]})]})]})]}):(0,B.jsx)(`p`,{className:`personal-capability-empty`,children:t(`machine.capabilityEmpty`)})}function lS(e,t){return t(e===`invalid`?`machine.credentialInvalid`:e===`configured`?`machine.credentialConfigured`:`machine.credentialAbsent`)}function uS(e,t){return t(e===`machine_store`?`machine.credentialSourceMachine`:e===`service_environment`?`machine.credentialSourceEnvironment`:`machine.credentialSourceUnset`)}function dS(){let{t:e}=Ji(),[t,n]=(0,z.useState)(null),[r,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(``),[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(null),[d,f]=(0,z.useState)(null),p=(0,z.useCallback)(async()=>{c(`load`);try{let e=await Rg();n(e),o(String(e.base_url.value??``))}catch(t){u(t instanceof Error?t.message:e(`machine.credentialError`))}finally{c(``)}},[e]);(0,z.useEffect)(()=>{p()},[p]);async function m(t,r){c(`store`),u(null),f(null);try{let e=await zg(t);n(e),o(String(e.base_url.value??``)),i(``),f(r)}catch(t){u(t instanceof Error?t.message:e(`machine.credentialError`))}finally{c(``)}}if(!t&&s===`load`)return(0,B.jsx)(`div`,{className:`personal-machine-loading`,role:`status`,children:e(`common.loading`)});let h=t?`${lS(t.provider_key.configured?`configured`:`absent`,e)} · ${uS(t.provider_key.source,e)}`:``,g=t?`${t.base_url.value??e(`machine.credentialAbsent`)} · ${uS(t.base_url.source,e)}`:``;return(0,B.jsxs)(`section`,{className:`personal-operator-credential`,"data-testid":`operator-credential-settings`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(Em,{"aria-hidden":!0,size:17}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e(`machine.credentialTitle`)}),(0,B.jsx)(`p`,{children:e(`machine.credentialDescription`)})]}),(0,B.jsx)(`span`,{className:`personal-operator-credential-status`,children:t?lS(t.status,e):e(`common.loading`)})]}),t?(0,B.jsxs)(`dl`,{className:`personal-operator-credential-readback`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`machine.credentialApiKey`)}),(0,B.jsx)(`dd`,{children:h})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`machine.credentialFingerprint`)}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:t.provider_key.fingerprint??e(`common.none`)})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`machine.credentialBaseUrl`)}),(0,B.jsx)(`dd`,{children:g})]})]}):null,t?.status===`invalid`&&t.repair?(0,B.jsx)(`p`,{className:`personal-machine-error`,role:`alert`,children:t.repair}):null,(0,B.jsxs)(`label`,{htmlFor:`operator-credential-api-key`,children:[(0,B.jsx)(`span`,{children:e(`machine.credentialApiKey`)}),(0,B.jsx)(`input`,{autoComplete:`off`,disabled:!!s,id:`operator-credential-api-key`,onChange:e=>i(e.target.value),placeholder:e(`machine.credentialApiKeyPlaceholder`),type:`password`,value:r})]}),(0,B.jsxs)(`label`,{htmlFor:`operator-credential-base-url`,children:[(0,B.jsx)(`span`,{children:e(`machine.credentialBaseUrl`)}),(0,B.jsx)(`input`,{autoComplete:`off`,disabled:!!s,id:`operator-credential-base-url`,onChange:e=>o(e.target.value),placeholder:e(`machine.credentialBaseUrlPlaceholder`),type:`text`,value:a})]}),l?(0,B.jsx)(`p`,{className:`personal-machine-error`,role:`alert`,children:l}):null,d?(0,B.jsxs)(`p`,{className:`personal-machine-notice`,role:`status`,"aria-live":`polite`,children:[(0,B.jsx)(om,{"aria-hidden":!0,size:16}),d]}):null,(0,B.jsxs)(`footer`,{className:`personal-operator-credential-actions`,children:[(0,B.jsx)(`button`,{className:`is-primary`,disabled:!!s||!r.trim()&&!a.trim(),onClick:()=>void m({...r.trim()?{provider_key:r}:{},...a.trim()?{base_url:a}:{}},e(`machine.credentialStored`)),type:`button`,children:e(s===`store`?`common.loading`:`machine.credentialStore`)}),(0,B.jsxs)(`button`,{disabled:!!s||t?.provider_key.configured!==!0,onClick:()=>void m({clear_provider_key:!0},e(`machine.credentialCleared`)),type:`button`,children:[(0,B.jsx)(rh,{"aria-hidden":!0,size:15}),e(`machine.credentialClearKey`)]}),(0,B.jsxs)(`button`,{disabled:!!s||t?.base_url.configured!==!0,onClick:()=>void m({clear_base_url:!0},e(`machine.credentialCleared`)),type:`button`,children:[(0,B.jsx)(rh,{"aria-hidden":!0,size:15}),e(`machine.credentialClearUrl`)]})]}),(0,B.jsxs)(`details`,{className:`personal-capability-scope-note`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(Zm,{"aria-hidden":!0,size:17}),e(`machine.credentialTitle`)]}),(0,B.jsx)(`p`,{children:e(`machine.credentialBoundary`)})]})]})}var fS={appearance:Lm,capabilities:Qm,language:Dm,lark:Xm,machine:Jm,provider:Em};function pS({callbacks:e,focusGoalConnection:t=!1,goals:n,initialGoalId:r,initialTab:i=`lark`,goalNotifications:a,onChanged:o,onClose:s,onThemeChange:c,theme:l}){let{locale:u,setLocale:d,t:f}=Ji(),[p,m]=(0,z.useState)(i),h=[...r?[{key:`capabilities`,label:f(`capabilities.title`)}]:[],{key:`provider`,label:f(`settings.modelProvider`)},{key:`machine`,label:f(`settings.globalCapabilities`)},{key:`lark`,label:`Lark`},{key:`appearance`,label:f(`settings.appearance`)},{key:`language`,label:f(`settings.language`)}],g=[{label:f(`settings.languageEnglish`),value:`en`},{label:f(`settings.languageSimplifiedChinese`),value:`zh-CN`}],_={appearance:{title:f(`settings.appearance`)},capabilities:{title:f(`capabilities.title`)},language:{title:f(`settings.language`)},lark:{title:`Lark`},machine:{title:f(`settings.globalCapabilities`)},provider:{title:f(`settings.modelProvider`)}}[p];return(0,B.jsxs)(`section`,{"aria-label":f(`settings.title`),className:`personal-settings-page`,"data-pw-theme":l,children:[(0,B.jsxs)(`aside`,{className:`personal-settings-sidebar`,children:[(0,B.jsxs)(`button`,{autoFocus:!0,className:`personal-settings-back`,onClick:s,type:`button`,children:[(0,B.jsx)(Zp,{size:17}),(0,B.jsx)(`span`,{children:f(`settings.back`)})]}),(0,B.jsxs)(`div`,{className:`personal-settings-title`,children:[(0,B.jsx)(`small`,{children:f(`settings.eyebrow`)}),(0,B.jsx)(`strong`,{children:f(`settings.title`)})]}),(0,B.jsx)(`nav`,{"aria-label":f(`settings.categories`),className:`personal-settings-tabs`,children:h.map(e=>{let t=fS[e.key];return(0,B.jsxs)(`button`,{"aria-current":p===e.key?`page`:void 0,onClick:()=>m(e.key),type:`button`,children:[(0,B.jsx)(t,{size:17}),(0,B.jsx)(`span`,{children:(0,B.jsx)(`strong`,{children:e.label})})]},e.key)})})]}),(0,B.jsxs)(`main`,{className:`personal-settings-body`,children:[(0,B.jsx)(`header`,{className:`personal-settings-header`,children:(0,B.jsx)(`div`,{children:(0,B.jsx)(`h1`,{children:_.title})})}),p===`lark`?(0,B.jsx)(Ax,{embedded:!0,focusGoalConnection:t,goals:n,initialGoalId:r,onChanged:o,onClose:s}):null,p===`provider`?(0,B.jsx)(`div`,{className:`personal-provider-settings`,children:(0,B.jsx)(dS,{})}):null,p===`machine`?(0,B.jsx)(cS,{}):null,p===`capabilities`?(0,B.jsx)(tS,{callbacks:e,goalId:r,notification:a.find(e=>e.goalId===r),onChanged:o}):null,p===`appearance`?(0,B.jsxs)(`section`,{className:`personal-detail-card personal-appearance-settings`,children:[(0,B.jsx)(`small`,{children:f(`settings.workspaceDisplay`)}),(0,B.jsx)(`h3`,{children:f(`settings.appearance`)}),(0,B.jsxs)(`div`,{className:`personal-settings-choice-group`,role:`radiogroup`,"aria-label":f(`settings.workspaceTheme`),children:[(0,B.jsxs)(`button`,{"aria-checked":l===`loopx`,onClick:()=>c(`loopx`),role:`radio`,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-settings-theme-swatch is-loopx`}),(0,B.jsx)(`strong`,{children:f(`settings.themeLoopx`)})]}),(0,B.jsxs)(`button`,{"aria-checked":l===`paper`,onClick:()=>c(`paper`),role:`radio`,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-settings-theme-swatch is-paper`}),(0,B.jsx)(`strong`,{children:f(`settings.themeDefault`)})]}),(0,B.jsxs)(`button`,{"aria-checked":l===`brutal`,onClick:()=>c(`brutal`),role:`radio`,type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-settings-theme-swatch is-brutal`}),(0,B.jsx)(`strong`,{children:f(`settings.themeHighContrast`)})]})]})]}):null,p===`language`?(0,B.jsxs)(`section`,{className:`personal-settings-card`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`span`,{className:`personal-settings-icon`,children:(0,B.jsx)(Dm,{size:18})}),(0,B.jsx)(`div`,{children:(0,B.jsx)(`h2`,{children:f(`settings.language`)})})]}),(0,B.jsx)(`div`,{"aria-label":f(`settings.language`),className:`personal-language-options`,role:`radiogroup`,children:g.map(e=>(0,B.jsxs)(`button`,{"aria-checked":u===e.value,className:u===e.value?`is-selected`:``,onClick:()=>d(e.value),role:`radio`,type:`button`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)(`strong`,{children:e.label})}),u===e.value?(0,B.jsx)(om,{"aria-hidden":!0,size:17}):null]},e.value))})]}):null]})]})}var mS=`loopx-pw-theme`,hS=`loopx`;function gS(){try{let e=window.localStorage.getItem(mS);return e===`loopx`||e===`paper`||e===`brutal`?e:hS}catch{return hS}}function _S(e){try{window.localStorage.setItem(mS,e)}catch{}}function vS({drawer:e,drawerMode:t=`panel`,drawerOpen:n,main:r,mobileSidebarOpen:i=!1,onCloseMobileSidebar:a,sidebar:o,theme:s=`loopx`}){let{t:c}=Ji(),l=(0,z.useRef)(null),u=(0,z.useRef)(null);return(0,z.useEffect)(()=>{if(!i)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=l.current?.querySelectorAll(`button:not([disabled]), a[href], select:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])`);e?.[0]?.focus();function t(t){if(t.key!==`Tab`||!e?.length)return;let n=e[0],r=e[e.length-1];t.shiftKey&&document.activeElement===n?(t.preventDefault(),r.focus()):!t.shiftKey&&document.activeElement===r&&(t.preventDefault(),n.focus())}return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t),u.current?.focus(),u.current=null}},[i]),(0,B.jsxs)(`section`,{className:`personal-workspace-shell${n?` has-drawer`:``}${n&&t.startsWith(`inspector`)?` has-task-inspector`:``}${t===`inspector-full`?` is-task-inspector-full`:``}${i?` mobile-sidebar-open`:``}`,"data-pw-theme":s,children:[i?(0,B.jsx)(`button`,{"aria-hidden":!0,className:`personal-sidebar-backdrop`,onClick:a,tabIndex:-1,type:`button`}):null,(0,B.jsx)(`aside`,{"aria-label":i?c(`header.goalNavigation`):void 0,"aria-modal":i?!0:void 0,className:`personal-workspace-sidebar`,"data-workspace-sidebar":!0,ref:l,role:i?`dialog`:void 0,children:(0,B.jsxs)(`div`,{className:`personal-workspace-sidebar-inner`,children:[i?(0,B.jsxs)(`button`,{className:`personal-sr-only`,onClick:a,type:`button`,children:[c(`common.close`),` `,c(`header.goalNavigation`)]}):null,o]})}),(0,B.jsx)(`main`,{"aria-hidden":i||void 0,className:`personal-workspace-main`,inert:i||void 0,children:r}),n?(0,B.jsx)(`aside`,{className:`personal-workspace-drawer`,"data-context-drawer":!0,"data-drawer-mode":t,children:e}):null]})}function yS(e){let t=e.match(/(?:下一步|建议|行动项|待办)[::\s]*([^\n]+)/u),n=t?t[1]:e;n=n.replace(/```[\s\S]*?```/g,``).replace(/`([^`]+)`/g,`$1`).replace(/\[([^\]]+)\]\([^)]+\)/g,`$1`).replace(/[#*~_>]/g,``).replace(/^[-*•\d+.\s]+/u,``).replace(/^(好的|没问题|收到|建议如下|任务如下|分析如下|结论[::])[\s,,::]*/u,``);let r=(n.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)[0]||n).replace(/\s+/gu,` `).trim();return Array.from(r).slice(0,120).join(``)}function bS(e){let t=new Map;return e.forEach(e=>{let n=e.fields.find(e=>e.key===`todo_id`)?.value??``,r=[e.actionKind,e.goalId??``,n,e.title].join(`:`);t.set(r,e)}),[...t.values()]}function xS(e,t,n){if(!e)return n(`home.noFirstActivity`);let r=new Date(e);if(Number.isNaN(r.getTime()))return e;let i=new Date,a=new Intl.DateTimeFormat(t,{hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(r);return r.toDateString()===i.toDateString()?n(`home.todayAt`,{time:a}):new Intl.DateTimeFormat(t,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(r)}function SS({goals:e,onSelectGoal:t,onRetry:n,systemHealth:r}){let{locale:i,t:a}=Ji(),o=e.filter(e=>e.activationState===`active`),s=o.filter(e=>e.loadState===`error`).length,c=[{key:`needs_you`,label:a(`home.lane.needsYou`)},{key:`running`,label:a(`home.lane.running`)},{key:`observing`,label:a(`home.lane.observing`)},{key:`scheduled`,label:a(`home.lane.scheduled`)}],l=Object.fromEntries(c.map(e=>[e.key,[]])),u=[],d=[];e.filter(e=>!e.loadState).forEach(e=>{let t=Xy(e);t===`history`?u.push(e):t===`stopped`?d.push(e):l[t].push(e)});let f=e=>(0,B.jsxs)(`button`,{className:`personal-home-goal-card`,"data-goal-state":e.loadState??e.state,"data-load-error":e.loadError,onClick:()=>t(e.goalId),type:`button`,children:[(0,B.jsxs)(`span`,{className:`personal-home-goal-meta`,children:[(0,B.jsx)(`i`,{}),e.agentLaneCount&&e.agentLaneCount>1?a(`header.workAgentCount`,{count:e.agentLaneCount}):e.agentLabel??e.agentId]}),(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`p`,{children:e.loadError?a(`startup.error.${e.loadError}`):e.needsYou??e.nextSentence}),(0,B.jsxs)(`footer`,{children:[(0,B.jsx)(`span`,{children:e.loadState?a(e.loadState===`error`?`startup.goalError`:`startup.goalLoading`):Yi(e.state,i)}),(0,B.jsx)(`small`,{title:e.latestActivity,children:e.loadState?``:e.latestActivity?xS(e.latestActivity,i,a):e.agentTodos.length?a(`home.taskCount`,{count:e.agentTodos.length}):a(`home.noActivity`)})]})]},e.goalId);return(0,B.jsxs)(`section`,{"aria-label":a(`home.workspace`),className:`personal-home-board`,children:[r&&(!r.ok||r.issues.length>0||r.freshnessWarning)?(0,B.jsxs)(`div`,{className:`personal-system-health-banner`,role:`alert`,children:[(0,B.jsxs)(`div`,{className:`personal-system-health-header`,children:[(0,B.jsx)(um,{size:15}),(0,B.jsx)(`strong`,{children:a(`home.systemHealth`,{summary:r.summary})}),r.freshnessWarning?(0,B.jsxs)(`small`,{children:[`(`,r.freshnessWarning,`)`]}):null]}),r.issues.length>0?(0,B.jsx)(`ul`,{className:`personal-system-health-issues`,children:r.issues.map((e,t)=>(0,B.jsx)(`li`,{children:e},t))}):null]}):null,o.some(e=>e.loadState)?(0,B.jsxs)(`section`,{className:`personal-home-lane`,"aria-live":`polite`,children:[(0,B.jsx)(`header`,{children:a(`startup.progress`,{loaded:o.filter(e=>!e.loadState).length,total:o.length})}),s?(0,B.jsxs)(`div`,{className:`personal-stopped-goal-error`,role:`status`,children:[(0,B.jsx)(`span`,{children:a(`startup.failedCount`,{count:s})}),(0,B.jsx)(`button`,{className:`min-h-11 rounded-md border px-3 py-2 text-sm`,onClick:n,type:`button`,children:a(`startup.retryFailed`)})]}):null,o.filter(e=>e.loadState).map(f)]}):null,(0,B.jsx)(`div`,{className:`personal-home-lanes`,children:c.map(e=>(0,B.jsxs)(`section`,{className:`personal-home-lane is-${e.key}`,"data-testid":`personal-home-lane-${e.key}`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`i`,{}),e.label]}),(0,B.jsx)(`b`,{children:l[e.key].length})]}),(0,B.jsx)(`div`,{className:`personal-home-lane-list`,children:l[e.key].length?l[e.key].map(f):(0,B.jsx)(`span`,{className:`personal-home-empty`,children:a(`home.empty`)})})]},e.key))}),(0,B.jsxs)(`details`,{className:`personal-home-history`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{children:a(`home.history`)}),(0,B.jsx)(`b`,{children:u.length}),(0,B.jsx)(`small`,{children:a(`home.completedGoals`)})]}),(0,B.jsx)(`div`,{children:u.length?u.map(f):(0,B.jsx)(`span`,{className:`personal-home-empty`,children:a(`home.noCompletedGoals`)})})]}),d.length?(0,B.jsxs)(`details`,{className:`personal-home-history is-stopped`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{children:a(`home.stopped`)}),(0,B.jsx)(`b`,{children:d.length}),(0,B.jsx)(`small`,{children:a(`home.preservedState`)})]}),(0,B.jsx)(`div`,{children:d.map(f)})]}):null]})}function CS({items:e,onSelect:t,reportState:n}){let{locale:r,t:i}=Ji();return(0,B.jsxs)(`section`,{className:`personal-object-list personal-files-list`,"data-testid":`personal-goal-outputs`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`strong`,{children:i(`files.title`)}),(0,B.jsx)(`span`,{children:e.length})]}),n?.loading?(0,B.jsxs)(`p`,{className:`personal-object-list-state`,role:`status`,children:[(0,B.jsx)(Um,{className:`is-spinning`,size:14}),i(`files.loadingReports`)]}):null,n?.error?(0,B.jsxs)(`p`,{className:`personal-object-list-state is-error`,role:`alert`,children:[(0,B.jsx)(um,{size:14}),i(`files.reportLoadFailed`),`: `,n.error]}):null,!n?.loading&&!n?.error&&e.length===0?(0,B.jsxs)(`p`,{className:`personal-object-list-state`,children:[(0,B.jsx)(Sm,{size:14}),i(`files.empty`)]}):null,e.map(e=>(0,B.jsxs)(`button`,{"data-output-kind":e.output.kind,onClick:()=>t({item:e.output,kind:`output`}),type:`button`,children:[(0,B.jsx)(`span`,{className:`personal-file-icon`,children:(0,B.jsx)(Sm,{size:16})}),(0,B.jsx)(`strong`,{children:e.output.title}),e.output.report?(0,B.jsx)(`em`,{children:i(`files.reportDelta`,{added:e.output.report.addedCount,changed:e.output.report.changedCount})}):null,(0,B.jsx)(`p`,{children:e.output.summary??e.output.safePreview??e.output.kind??i(`files.emptySummary`)}),(0,B.jsx)(`small`,{title:e.output.createdAt,children:[e.output.goalTitle,e.output.kind===`report`?i(`files.verifiedReport`):null,e.output.todoId?`${i(`common.task`)} ${e.output.todoId}`:null,xS(e.output.createdAt,r,i)].filter(Boolean).join(` · `)})]},e.id))]})}function wS({agentLabel:e,messages:t,onClose:n,onDraftTask:r,onOpenConversation:i,title:a}){let{t:o}=Ji(),s=t.reduce((e,t,n)=>t.role===`user`?n:e,0),c=t.slice(Math.max(0,s)).slice(-3),l=c.filter(e=>e.role===`assistant`&&!e.pending).at(-1);return(0,z.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),(0,B.jsxs)(`aside`,{"aria-label":o(`conversation.receipt`),className:`personal-manager-conversation-tray`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(rm,{size:16}),(0,B.jsx)(`strong`,{children:a??o(`conversation.title`)}),(0,B.jsx)(`small`,{children:t.at(-1)?.pending?o(`conversation.replying`):o(`common.recently`)})]}),(0,B.jsxs)(`div`,{className:`personal-manager-conversation-actions`,children:[r&&l?(0,B.jsxs)(`button`,{className:`personal-manager-conversation-btn`,onClick:()=>r(l.text),title:o(`conversation.convertHint`),type:`button`,children:[(0,B.jsx)(km,{size:13}),(0,B.jsx)(`span`,{children:o(`conversation.toTask`)})]}):null,(0,B.jsx)(`button`,{className:`personal-manager-conversation-link`,onClick:i,type:`button`,children:o(`conversation.full`)}),n?(0,B.jsx)(`button`,{"aria-label":o(`conversation.close`),className:`personal-manager-conversation-close`,onClick:n,title:o(`conversation.close`),type:`button`,children:(0,B.jsx)(oh,{size:14})}):null]})]}),(0,B.jsx)(`div`,{"aria-live":`polite`,className:`personal-manager-conversation-messages`,children:c.map(t=>(0,B.jsxs)(`article`,{className:`is-${t.role}`,children:[(0,B.jsx)(`strong`,{children:t.role===`user`?o(`common.you`):t.agentLabel??e??o(`header.manager`)}),(0,B.jsxs)(`div`,{className:`personal-manager-conversation-bubble`,children:[t.role===`user`?(0,B.jsx)(`p`,{children:t.text}):(0,B.jsx)(db,{text:t.text}),t.pending?(0,B.jsx)(`small`,{children:o(`conversation.agentPending`)}):null,(0,B.jsx)(Ey,{request:t.collaboration}),(0,B.jsx)(gb,{delivery:t.returnDelivery})]})]},t.id))})]})}function TS({onClose:e,onOpenDetails:t,run:n}){let{t:r}=Ji();return(0,B.jsxs)(`section`,{"aria-label":r(`session.record`),className:`personal-session-record`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(rm,{size:17}),r(`session.record`)]}),(0,B.jsx)(`button`,{"aria-label":r(`session.closeRecord`),onClick:e,type:`button`,children:(0,B.jsx)(oh,{size:15})})]}),(0,B.jsx)(`div`,{children:(0,B.jsx)(`strong`,{children:n.title})}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Agent`}),(0,B.jsx)(`dd`,{children:n.agentLabel})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r(`common.status`)}),(0,B.jsx)(`dd`,{children:Xi(n.sessionStatus??n.status,r)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Session`}),(0,B.jsx)(`dd`,{title:n.sessionId,children:n.sessionId})]})]}),(0,B.jsx)(`button`,{className:`personal-secondary-action`,onClick:t,type:`button`,children:r(`session.details`)})]})}function ES(e,t,n){let r=[];if(t===null)return e.userTodos.slice(0,4).forEach(t=>r.push({attention:{...t,goalTitle:t.goalTitle??Yy(e,t.goalId)},id:`attention:${t.todoId}`,kind:`attention`})),e.goals.filter(e=>Xy(e)===`running`).slice(0,4).forEach(e=>r.push({id:`run:${e.goalId}`,kind:`run`,run:{agentId:e.agentId,agentLabel:e.agentLabel??e.agentId,completedSteps:e.doneTodoCount??e.agentTodos.filter(e=>e.done).length,goalId:e.goalId,goalTitle:e.title,latestActivity:e.agentSentence,runId:`goal:${e.goalId}`,status:`running`,title:e.nextSentence,totalSteps:Math.max((e.doneTodoCount??0)+e.agentTodos.filter(e=>!e.done).length,1)}})),r;let i=e.goals.find(e=>e.goalId===t);if(!i)return r;if(i.needsYou){let t=e.userTodos.find(e=>e.goalId===i.goalId);r.push({attention:t?{...t,goalTitle:i.title}:{blocking:i.needsYouBlocking??!1,goalId:i.goalId,goalTitle:i.title,text:i.needsYou,todoId:`${i.goalId}:attention`},id:`attention:${i.goalId}`,kind:`attention`})}r.push({id:`run:${i.goalId}`,kind:`run`,run:{agentId:i.agentId,agentLabel:i.agentLabel??i.agentId,completedSteps:i.doneTodoCount??i.agentTodos.filter(e=>e.done).length,goalId:i.goalId,goalTitle:i.title,latestActivity:i.agentSentence,runId:`goal:${i.goalId}`,status:i.state===`推进中`?`running`:i.state===`需修复`?`failed`:`waiting`,title:i.nextSentence,totalSteps:Math.max((i.doneTodoCount??0)+i.agentTodos.filter(e=>!e.done).length,1)}}),i.agentTodos.filter(e=>e.taskClass===`continuous_monitor`).forEach(t=>{let a=e.timeline?.find(e=>e.kind===`run`&&e.run.goalId===i.goalId&&e.run.todoId===t.todoId&&!!e.run.sessionId);r.push({id:`schedule:${i.goalId}:${t.todoId}`,kind:`schedule`,schedule:{agentId:i.agentId,executionHistory:a?[{label:a.run.latestActivity||a.run.title,runId:a.run.runId,status:a.run.status===`waiting`||a.run.status===`queued`?`running`:a.run.status,timestamp:i.latestActivity||n(`common.recently`)}]:[],goalId:i.goalId,label:t.text,schedule:t.evidence??n(`schedule.summary`),scheduleId:t.todoId,scheduleKind:`monitor`,sessionId:a?.run.sessionId,status:t.done||t.status===`paused`?`paused`:`active`,stopCondition:n(`drawer.scheduleDefaultStop`),target:t.text,timezone:`Asia/Shanghai`}})});let a=e.timeline?.find(e=>e.kind===`proposal`&&e.proposal.actionKind===`heartbeat.bind`&&e.proposal.goalId===i.goalId);if(a){let e=e=>a.proposal.fields.find(t=>t.key===e)?.value;r.push({id:`schedule:${i.goalId}:heartbeat`,kind:`schedule`,schedule:{agentId:i.agentId,executionHistory:[],goalId:i.goalId,label:`${n(`schedule.heartbeat`)} · ${i.title}`,nextRunAt:n(`drawer.schedulePending`),notificationRule:n(`drawer.scheduleDefaultNotification`),schedule:e(`cadence`)??n(`schedule.summary`),scheduleId:`${i.goalId}:heartbeat`,scheduleKind:`heartbeat`,status:a.proposal.status===`applied`?`active`:`draft`,stopCondition:e(`stop_condition`)??n(`drawer.scheduleDefaultStop`),timezone:e(`timezone`)??`Asia/Shanghai`}})}return r}function DS(e){return e===`preview_ready`?`ready`:e===`cancelled`?`draft`:e===`failed`?`error`:e}function OS(e,t){let n={agent_id:t(`proposal.field.agentId`),cadence:t(`proposal.field.cadence`),completion_criteria:t(`proposal.field.completionCriteria`),execution_boundary:t(`proposal.field.executionBoundary`),goal_id:t(`proposal.field.goalId`),heartbeat:t(`proposal.field.heartbeat`),initial_todos:t(`proposal.field.initialTodos`),objective:t(`proposal.field.objective`),operation:t(`proposal.field.operation`),permission:t(`proposal.field.permission`),reason:t(`proposal.field.reason`),stop_condition:t(`proposal.field.stopCondition`),target:t(`proposal.field.target`),timezone:t(`proposal.field.timezone`),title:t(`proposal.field.title`),workspace_ref:t(`proposal.field.workspace`)},r=[`title`,`objective`,`completion_criteria`,`execution_boundary`,`permission`,`agent_id`,`workspace_ref`,`initial_todos`,`heartbeat`,`stop_condition`,`goal_id`];return Object.entries(e).sort(([e],[t])=>{let n=r.indexOf(e),i=r.indexOf(t);return(n<0?r.length:n)-(i<0?r.length:i)}).slice(0,10).map(([e,r])=>({key:e,label:n[e]??e.replaceAll(`_`,` `),value:e===`workspace_ref`?r===`current`?t(`proposal.workspace.current`):t(`proposal.workspace.named`,{workspace:String(r??`current`)}):Array.isArray(r)?r.join(` · `):typeof r==`object`&&r?JSON.stringify(r):String(r??`—`)}))}function kS(e,t,n){let r=t.operationFrame,i=r?.content.fields.map((e,t)=>({key:`projection:${t}`,label:e.label,value:e.value})).slice(0,8)??[];return[{key:`operation_state`,label:n(`proposal.field.operationState`),value:r?.lifecycleState??e.status},...r?.kind===`result`?[{key:`result_delivery`,label:n(`proposal.field.resultDelivery`),value:r.resultDeliveryVerified?n(`proposal.resultDelivery.verified`):n(`proposal.resultDelivery.pending`)}]:[],...i,...r?[{key:`warning`,label:n(`proposal.field.confirmationBoundary`),value:r.content.warning}]:[],...r?[{key:`expires_at`,label:n(`proposal.field.expiresAt`),value:r.expiresAt}]:[]].slice(0,10)}function AS(e){if(e.action_kind!==`goal.lifecycle`)return;let t=e.normalized_parameters.operation;return t===`stop`||t===`resume`||t===`delete`?t:void 0}function jS(e,t){let n=AS(e),r=Iy(e),i=typeof e.normalized_parameters.title==`string`?e.normalized_parameters.title:typeof e.normalized_parameters.goal_id==`string`?e.normalized_parameters.goal_id:``,a=typeof e.normalized_parameters.target==`string`?e.normalized_parameters.target:``,o=r.operationFrame,s=o?.content.title??e.summary,c=e.action_kind===`operation.execute`?s:e.action_kind===`team.plan`?e.status===`applied`?qy(Ky(e.receipt),t):t(`proposal.summary.teamPlan`,{goal:Hy(e.normalized_parameters),count:Vy(e.normalized_parameters)}):e.action_kind===`goal.create`?t(`proposal.summary.goalCreate`,{title:i}):e.action_kind===`heartbeat.bind`?t(`proposal.summary.heartbeat`):e.action_kind===`monitor.create`?t(`proposal.summary.monitor`,{target:a}):e.action_kind===`goal.lifecycle`&&n===`stop`?t(`proposal.summary.lifecycleStop`,{title:i}):e.action_kind===`goal.lifecycle`&&n===`delete`?t(`proposal.summary.lifecycleDelete`,{title:i}):e.action_kind===`goal.lifecycle`?t(`proposal.summary.lifecycleResume`,{title:i}):e.summary;return{actionKind:e.action_kind,reviewPlan:r,fields:e.action_kind===`operation.execute`?kS(e,r,t):e.action_kind===`team.plan`?By(e.normalized_parameters,t):OS(e.normalized_parameters,t),goalId:typeof e.normalized_parameters.goal_id==`string`?e.normalized_parameters.goal_id:void 0,impact:r.retryOriginal?t(`actionReview.${r.reason}`):e.action_kind===`operation.execute`?t(`proposal.impact.operation`):e.action_kind===`team.plan`?e.status===`applied`?t(`proposal.teamPlan.assignedHint`):t(`proposal.impact.teamPlan`):e.action_kind===`goal.create`?t(`proposal.impact.goalCreate`):e.action_kind===`goal.lifecycle`&&n===`stop`?t(`proposal.impact.lifecycleStop`):e.action_kind===`goal.lifecycle`&&n===`delete`?t(`proposal.impact.lifecycleDelete`):e.action_kind===`goal.lifecycle`?t(`proposal.impact.lifecycleResume`):e.permission_classification===`protected`?t(`proposal.impact.protected`):t(`proposal.impact.default`),previewId:e.proposal_id,lifecycleOperation:n,gate:e.gate?{kind:String(e.gate.kind??`protected_action`),nextAction:typeof e.gate.next_action==`string`?e.gate.next_action:void 0,summary:String(e.gate.summary??t(`proposal.gate.default`))}:void 0,primaryLabel:r.retryOriginal?t(`drawer.retryOriginal`):e.action_kind===`operation.execute`?o?.kind===`result`?o.resultDeliveryVerified?t(`proposal.primary.operationResultVerified`):t(`proposal.primary.operationResultPending`):t(`proposal.primary.operationGroup`):e.action_kind===`team.plan`?t(e.status===`applied`?`proposal.teamPlan.viewResult`:`proposal.primary.teamPlan`):e.action_kind===`goal.create`?t(`proposal.primary.goalCreate`):e.action_kind===`goal.lifecycle`&&n===`stop`?t(`proposal.primary.lifecycleStop`):e.action_kind===`goal.lifecycle`&&n===`delete`?t(`proposal.primary.lifecycleDelete`):e.action_kind===`goal.lifecycle`?t(`proposal.primary.lifecycleResume`):e.action_kind===`todo.create`&&e.normalized_parameters.start_execution===!0?t(`proposal.primary.todoStart`):t(`proposal.primary.apply`),status:r.retryOriginal||e.status===`applied`&&e.action_kind!==`operation.execute`&&r.interaction!==`completed`?`error`:DS(e.status),teamPlanOutcome:e.action_kind===`team.plan`?Ky(e.receipt)??void 0:void 0,teamPlanAssignments:e.action_kind===`team.plan`?Uy(e.receipt,e.normalized_parameters):void 0,teamPlanGapLanes:e.action_kind===`team.plan`?Wy(e.receipt,e.normalized_parameters):void 0,title:c}}function MS(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,42);if(t)return t;let n=2166136261;for(let t of e)n^=t.codePointAt(0)??0,n=Math.imul(n,16777619);return`goal-${(n>>>0).toString(36)}`}function NS(e,t){let n=e.match(/[「“"]([^」”"]{2,80})[」”"]/u)?.[1];return n?n.trim():e.replace(/^(请|帮我|我想|给我|创建|新建|设置|please|i want to|create|set up)+/iu,``).replace(/(一个|新的)?\s*(goal|目标)/giu,``).replace(/[,。!?].*$/u,``).trim().slice(0,80)||t(`goal.defaultTitle`)}function PS(e,t){for(let n of e.split(/\r?\n/u)){let e=n.trim();for(let n of t){let t=e.match(RegExp(`^${n.replace(/[.*+?^${}()|[\]\\]/gu,`\\$&`)}\\s*[::]\\s*(.*)$`,`iu`));if(t?.[1]?.trim())return t[1].trim()}}return``}function FS(e,t){let n=PS(e,[`目标`,`Objective`]),r=PS(e,[`完成标准`,`Completion criteria`]),i=PS(e,[`执行边界(可选)`,`执行边界`,`边界`,`Execution boundary (optional)`,`Execution boundary`,`Boundary`]),a=(n||NS(e,t)).split(/[。;;\n]/u)[0].trim().slice(0,80)||t(`goal.defaultTitle`),o=[n||a,r?t(`goal.objectiveCompletion`,{criteria:r}):``,i?t(`goal.objectiveBoundary`,{boundary:i}):``].filter(Boolean).join(` -`),s=/(只读|不调用外部工具|不修改(?:仓库|代码|状态)|read.?only|do not (?:call|use) external tools|do not modify (?:repositories|repository|code|state))/iu.test(i||e);return{completionCriteria:r,executionBoundary:i,initialTodos:r?[t(`goal.initialTodo`,{criteria:r})]:[],objective:o,permission:s?`read_only`:`workspace_write_on_confirmation`,title:a}}function IS(e){let t=e.match(/(?:每|every)\s*(\d{1,3})\s*(?:分钟|minutes?)/iu)?.[1];if(t)return`${t}m`;let n=e.match(/(?:每|every)\s*(\d{1,2})\s*(?:小时|hours?)/iu)?.[1];return n?`${n}h`:/每小时|every hour|hourly/iu.test(e)?`1h`:(/每天|每日|早上|上午|daily|every day/iu.test(e),`1d`)}function LS(e,t){return/(每周|星期|周[一二三四五六日天]|weekly|every\s+(?:mon|tues|wednes|thurs|fri|satur|sun)day|\d{1,2}\s*[::]\s*\d{2})/iu.test(e)?t(`schedule.unsupportedCalendar`):null}function RS(e,t){return PS(e,[`检查内容`,`监控内容`,`目标`,`Check target`,`Monitor target`,`Target`])||e.replace(/^(?:为当前 Goal |for the current Goal )?(?:添加|配置|创建|add|configure|create)?\s*(?:定时检查|监控|scheduled check|monitor)[::]?/iu,``).split(/\r?\n/u)[0].trim()||t(`schedule.defaultTarget`)}function zS(e){return/(mr|pr).{0,8}(合并|merge)/iu.test(e)?`pr_merged`:/发布完成|上线完成|release (?:is )?complete|deployment (?:is )?complete/iu.test(e)?`release_complete`:`goal_complete`}function BS(e,t){let n=e.toLowerCase();return t.find(e=>n.includes(e.agentId.toLowerCase())||n.includes(e.label.toLowerCase()))}function VS(e){let t=PS(e,[`标题`,`任务标题`,`Todo 标题`]),n=PS(e,[`内容`,`任务内容`,`Todo 内容`]);if(t)return[t,n].filter(Boolean).join(`:`).slice(0,400);let r=e.match(/[「“"]([^」”"]{2,200})[」”"]/u)?.[1];return r?r.trim():e.replace(/^(请|帮我|给我|为当前 Goal |新增|新建|创建|添加|加上|加一个|记一个)+/u,``).replace(/^(一个\s*)?(普通\s*)?(todo|待办|任务)(?:\s*到\s*Tasks?)?[::\s]*/iu,``).replace(/[。;;,,]\s*(?:不要|不需要|无需|禁止|别|暂不).{0,80}(?:heartbeat|心跳|定时|监控|执行).*$/iu,``).replace(/[,,]\s*(并且|然后|再)?\s*(交给|分配给|让).+$/u,``).replace(/\s*(交给|分配给|让)\s+.+$/u,``).trim().slice(0,400)||`推进当前 Goal 的下一项工作`}var HS=new Set([`image/png`,`image/jpeg`,`image/webp`,`image/gif`]),US=5242880,WS=4;function GS(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onerror=()=>r(Error(t(`composer.imageReadError`,{name:e.name}))),i.onload=()=>n({dataUrl:String(i.result??``),id:crypto.randomUUID(),mimeType:e.type,name:e.name,size:e.size}),i.readAsDataURL(e)})}function KS({agents:e=[{agentId:`codex`,available:!0,capability:`代码与项目执行`,label:`Codex`}],callbacks:t={},goalArchiveLoadState:n={error:null,phase:`ready`},managerChannelBinding:r,managerRuntime:i,model:a,readOnly:o=!1,selectedAgentId:s,selectedGoalId:c,statusSourceControl:l}){let{locale:u,t:d}=Ji(),[f,p]=(0,z.useState)(c??null),[m,h]=(0,z.useState)(s??e.find(e=>e.available)?.agentId??`codex`),[g,_]=(0,z.useState)(null),[v,y]=(0,z.useState)(!1),[b,x]=(0,z.useState)(null),[S,C]=(0,z.useState)({}),[w,T]=(0,z.useState)(`chat`),[E,D]=(0,z.useState)(!1),[O,k]=(0,z.useState)(!1),[ee,te]=(0,z.useState)(!1),[A,j]=(0,z.useState)(()=>{try{let e=window.sessionStorage.getItem(`loopx-pw-composer-drafts`),t=e?JSON.parse(e):{};return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}),[M,ne]=(0,z.useState)(!1),[N,P]=(0,z.useState)([]),[re,ie]=(0,z.useState)(null),[ae,F]=(0,z.useState)(null),[oe,I]=(0,z.useState)(()=>new Set),[se,L]=(0,z.useState)(()=>new Set),[ce,le]=(0,z.useState)(`idle`),[ue,de]=(0,z.useState)([]),[fe,pe]=(0,z.useState)([]),[me,he]=(0,z.useState)(!1),[ge,_e]=(0,z.useState)(gS),[ve,ye]=(0,z.useState)({}),[be,xe]=(0,z.useState)([]),Se=(0,z.useRef)(!1),Ce=(0,z.useRef)(NaN),we=(0,z.useRef)(null),Te=(0,z.useRef)(null),Ee=(0,z.useRef)(null),De=(0,z.useRef)(null),Oe=(0,z.useRef)(new Set),ke=(0,z.useRef)(new Set),[Ae,je]=(0,z.useState)(null),R=c===void 0?f:c,Me=s??m,Ne=`${R??`manager`}:${Me}`,Pe=A[Ne]??``;(0,z.useEffect)(()=>{P([]),ie(null)},[Ne]);function Fe(e,t){j(n=>{let r={...n};t?r[e]=t:delete r[e];try{window.sessionStorage.setItem(`loopx-pw-composer-drafts`,JSON.stringify(r))}catch{}return r})}function Ie(e){Fe(Ne,e)}function Le(e){return yh.find(t=>t.id===e)?.prompt??``}(0,z.useEffect)(()=>{let e=we.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,120)}px`)},[Pe]);let Re=(0,z.useMemo)(()=>a.goals.map(e=>{let t=ve[e.goalId];return t?{...e,repository:{branch:t.branch,identity:t.identity,label:t.label,readOnly:!0}}:e}),[ve,a.goals]),ze=(0,z.useMemo)(()=>Re.filter(e=>Xy(e)===`needs_you`).length,[Re]),Be=(0,z.useMemo)(()=>Re.filter(e=>Xy(e)===`needs_you`&&(e.needsYouBlocking||e.state===`等你`)).length,[Re]),V=Re.find(e=>e.goalId===R)??null;function Ve(e){Ee.current=document.activeElement instanceof HTMLElement?document.activeElement:null,he(!1),_(e)}function He(){_(null),window.requestAnimationFrame(()=>{let e=Ee.current;e?.isConnected&&e.getClientRects().length?e.focus({preventScroll:!0}):document.querySelector(`.personal-mobile-menu`)?.focus({preventScroll:!0})})}let Ue=g?.kind===`settings`,We=R,Ge=(0,z.useMemo)(()=>{let e=Object.values(S).filter(e=>e.actionKind===`heartbeat.bind`&&e.goalId&&e.status===`applied`).map(e=>({id:`schedule:${e.goalId}:heartbeat`,kind:`schedule`,schedule:{agentId:Me,executionHistory:[],goalId:e.goalId,label:e.title,nextRunAt:d(`drawer.schedulePending`),notificationRule:d(`drawer.scheduleDefaultNotification`),schedule:e.fields.find(e=>e.key===`cadence`)?.value??d(`schedule.summary`),scheduleId:`${e.goalId}:heartbeat`,scheduleKind:`heartbeat`,status:e.status===`applied`?`active`:`draft`,stopCondition:e.fields.find(e=>e.key===`stop_condition`)?.value??d(`drawer.scheduleDefaultStop`),timezone:e.fields.find(e=>e.key===`timezone`)?.value??`Asia/Shanghai`}})),t=[...ES(a,We,d),...a.timeline??[],...e,...bS(Object.values(S)).filter(e=>e.actionKind!==`heartbeat.bind`||e.status!==`applied`).map(e=>({id:`proposal:${e.previewId}`,kind:`proposal`,proposal:e}))];return[...new Map(t.map(e=>[e.id,e])).values()].filter(e=>e.kind!==`proposal`||![`stale`,`error`].includes(e.proposal.status)||e.proposal.reviewPlan?.retryOriginal===!0||ue.includes(e.proposal.previewId)).filter(e=>!R||e.kind===`message`?!0:e.kind===`proposal`?!e.proposal.goalId||e.proposal.goalId===R:e.kind===`attention`?e.attention.goalId===R:e.kind===`run`?e.run.goalId===R:e.kind===`schedule`?e.schedule.goalId===R:e.output.goalId===R)},[We,a,S,Me,R,ue,d]),Ke=(0,z.useMemo)(()=>b?Ge.filter(e=>e.kind===`message`?!0:e.kind===`run`?e.run.runId===b.runId:e.kind===`output`&&e.output.runId===b.runId):Ge,[b,Ge]);(0,z.useEffect)(()=>{if(!b)return;let e=Ge.find(e=>e.kind===`run`&&e.run.runId===b.runId);!e||e.kind!==`run`||JSON.stringify({completedSteps:b.completedSteps,latestActivity:b.latestActivity,messages:b.sessionMessages,sessionStatus:b.sessionStatus,status:b.status,totalSteps:b.totalSteps})!==JSON.stringify({completedSteps:e.run.completedSteps,latestActivity:e.run.latestActivity,messages:e.run.sessionMessages,sessionStatus:e.run.sessionStatus,status:e.run.status,totalSteps:e.run.totalSteps})&&x(e.run)},[b,Ge]);let qe=(0,z.useMemo)(()=>Ge.flatMap(e=>e.kind===`message`?[e.message]:[]),[Ge]),Je=(0,z.useMemo)(()=>V?Ge.flatMap(e=>e.kind===`message`?[e.message]:[]):[],[Ge,V]);(0,z.useEffect)(()=>{V||E||qe.some(e=>e.pending)&&k(!0)},[E,qe,V]),(0,z.useEffect)(()=>{!V||w===`chat`||Je.some(e=>e.pending)&&te(!0)},[Je,V,w]);let Ye=(0,z.useMemo)(()=>Ge.filter(e=>e.kind===`message`||e.kind===`proposal`&&(ue.includes(e.proposal.previewId)||fe.includes(e.proposal.previewId))),[Ge,ue,fe]),Xe=Ye[Ye.length-1],Ze=Xe?.kind===`message`?Xe.message.text.length:0;(0,z.useEffect)(()=>{if(!E||!Te.current)return;let e=window.requestAnimationFrame(()=>{Te.current&&(Te.current.scrollTop=Te.current.scrollHeight)});return()=>window.cancelAnimationFrame(e)},[Ye.length,E,Ze]);let Qe=(0,z.useMemo)(()=>{if(g?.kind===`settings`)return null;if(g?.kind===`attention`)return{kind:`attention`,item:Jd(g.item,a.attentionHistory??a.userTodos)};if(g?.kind===`goal`){let e=Re.find(e=>e.goalId===g.item.goalId);return e?{item:e,kind:`goal`}:g}if(g?.kind!==`run`)return g;let e=Ge.find(e=>e.kind===`run`&&e.run.runId===g.item.runId);return e?{item:e.run,kind:`run`}:g},[Ge,g,Re,a.attentionHistory,a.userTodos]);(0,z.useEffect)(()=>{if(o){ye({}),xe([]);return}let e=!1;return Promise.all([Zg(),c_()]).then(([t,n])=>{e||(ye(Object.fromEntries(t.map(e=>[e.goal_id,e.repository]))),xe(n))}).catch(()=>{}),()=>{e=!0}},[o]),(0,z.useEffect)(()=>{if(!me)return;function e(e){e.key===`Escape`&&he(!1)}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[me]),(0,z.useEffect)(()=>{if(R||!Ge.length)return;if(!Se.current){Se.current=!0;try{Ce.current=Date.parse(window.localStorage.getItem(`loopx-pw-last-visit`)??``),window.localStorage.setItem(`loopx-pw-last-visit`,new Date().toISOString())}catch{Ce.current=NaN}}let e=Ce.current,t=Ge.filter(e=>e.kind===`run`).map(e=>e.run),n=t=>{let n=Date.parse(t??``);return!Number.isNaN(e)&&!Number.isNaN(n)&&n>e},r={attention:ze,done:t.filter(e=>e.status===`completed`&&n(e.latestActivity)).length,failed:t.filter(e=>(e.status===`failed`||e.status===`interrupted`)&&n(e.latestActivity)).length};je(e=>e?.attention===r.attention&&e.done===r.done&&e.failed===r.failed?e:r)},[Ge,ze,R]),(0,z.useEffect)(()=>{if(o){C({});return}let e=!1;return Uh(R?{goalId:R}:{contextKind:`manager`}).then(t=>{if(e)return;let n=t.filter(e=>[`preview_ready`,`gated`,`deferred`,`applying`].includes(e.status)||Iy(e).retryOriginal===!0||e.action_kind===`operation.execute`&&e.status===`applied`).map(e=>jS(e,d)),r=Object.fromEntries(n.map(e=>[e.previewId,e]));C(e=>({...e,...r})),R||pe(n.map(e=>e.previewId))}).catch(()=>{}),()=>{e=!0}},[o,R,d]);async function $e(e,n={}){if(o)throw Error(d(`source.readOnlyWriteError`));let r;try{r=t.onPreviewAction?await t.onPreviewAction(e):jS(await Vh(e),d)}catch(t){if(!(t instanceof Ih)||t.payload.error_code!==`action_preview_gate`)throw t;let n=t.payload.gate&&typeof t.payload.gate==`object`?t.payload.gate:{},i=(Array.isArray(n.candidates)?n.candidates:[]).flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return typeof t.workspace_ref==`string`&&typeof t.label==`string`?[{label:t.label,workspaceRef:t.workspace_ref}]:[]}),a=String(n.kind??`workspace_selection_required`),o=a===`agent_binding_required`||a===`agent_identity_selection_required`;r={actionKind:e.actionKind,fields:i.map(e=>({key:`workspace_ref:${e.workspaceRef}`,label:e.label,value:e.workspaceRef})),gate:{kind:a,nextAction:typeof n.next_action==`string`?n.next_action:void 0,summary:String(n.summary??d(`proposal.workspaceGate.defaultSummary`))},impact:d(o?`proposal.workspaceGate.agentImpact`:`proposal.workspaceGate.selectionImpact`),previewId:`workspace-choice-${Date.now().toString(36)}`,sourceRequest:e,status:`gated`,title:d(o?`proposal.workspaceGate.agentTitle`:`proposal.workspaceGate.selectionTitle`),workspaceCandidates:i}}return de(e=>e.includes(r.previewId)?e:[...e,r.previewId]),C(e=>({...e,[r.previewId]:r})),n.select!==!1&&_({item:r,kind:`proposal`}),r}function et(){lt(null),Fe(`manager:${Me}`,d(`composer.createGoalTemplate`)),window.requestAnimationFrame(()=>we.current?.focus())}async function tt(e,n){he(!1);let r={delete:`Deleted from the owner workspace`,resume:`Resumed from the owner workspace`,stop:`Stopped from the owner workspace`},i={delete:d(`proposal.summary.lifecycleDelete`,{title:e.title}),resume:d(`proposal.summary.lifecycleResume`,{title:e.title}),stop:d(`proposal.summary.lifecycleStop`,{title:e.title})},a=null,o=!1;try{if(n===`stop`){if(Oe.current.has(e.goalId))return;Oe.current.add(e.goalId),I(new Set(Oe.current)),_(null),a={goalId:e.goalId,next:`stopped`,optimisticApplied:!0,previous:e.activationState},F(d(`feedback.applying`,{title:i.stop})),t.onGoalActivationStateChange?.(e.goalId,`stopped`)}if(t.onExecuteGoalLifecycle){if(n===`delete`)throw Error(`The selected status source does not authorize Goal deletion.`);let a=await t.onExecuteGoalLifecycle({goalId:e.goalId,operation:n,reason:r[n]});if(!a.projectionVerified)throw Error(`Goal lifecycle projection did not verify.`);o=!0,t.onGoalActivationStateChange?.(e.goalId,a.activationState),F(d(`feedback.completed`,{title:i[n]})),n===`stop`&<(null),await at([e.goalId]);return}let s=await $e({actionKind:`goal.lifecycle`,context:{kind:`goal_directory`,goal_id:e.goalId},idempotencyKey:`workspace-goal-${n}-${e.goalId}-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e.goalId,operation:n,reason:r[n]},summary:i[n]},{select:n!==`stop`});if(s.goalId!==e.goalId||s.lifecycleOperation!==n)throw _(null),Error(d(`actionReview.targetChanged`));n===`stop`&&(s.reviewPlan?.interaction===`direct`?(o=!0,await ot(s,{lifecycleProjection:a??void 0,presentation:`feedback`})):(a&&t.onGoalActivationStateChange?.(a.goalId,a.previous),F(s.gate?d(`feedback.gateRequired`,{summary:s.gate.summary}):d(`feedback.notCompleted`,{status:s.status})),_({item:s,kind:`proposal`})))}catch(e){a&&!o&&t.onGoalActivationStateChange?.(a.goalId,a.previous),F(d(`feedback.executionFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{n===`stop`&&(Oe.current.delete(e.goalId),I(new Set(Oe.current)))}}function nt(e,t){Ie(d(t?e===`heartbeat`?`composer.heartbeatTemplate`:`composer.monitorTemplate`:e===`heartbeat`?`composer.heartbeatTemplateWithoutGoal`:`composer.monitorTemplateWithoutGoal`)),_(null),window.requestAnimationFrame(()=>we.current?.focus())}async function rt(e,n,r=``){let i=await t.onRequestScheduleConfig?.(e,n);if(i){de(e=>e.includes(i.previewId)?e:[...e,i.previewId]),C(e=>({...e,[i.previewId]:i})),_({item:i,kind:`proposal`});return}if(!n){Ie(d(e===`heartbeat`?`composer.heartbeatGoalQuestion`:`composer.monitorGoalQuestion`));return}let a=Date.now().toString(36);await $e({actionKind:e===`heartbeat`?`heartbeat.bind`:`monitor.create`,context:{kind:`schedule`,goal_id:n},idempotencyKey:`workspace-${e}-${n}-${a}`,normalizedParameters:e===`heartbeat`?{agent_id:Me,cadence:IS(r),goal_id:n,stop_condition:zS(r),timezone:`Asia/Shanghai`}:{agent_id:Me,cadence:IS(r),goal_id:n,stop_condition:zS(r),target:RS(r,d),target_key:`goal-${n}`,timezone:`Asia/Shanghai`},summary:e===`heartbeat`?d(`proposal.summary.heartbeat`):d(`proposal.summary.monitor`,{target:RS(r,d)})})}async function it(e){if(!ke.current.has(e.todoId)){ke.current.add(e.todoId),L(new Set(ke.current)),F(d(`feedback.preparingPreview`,{title:e.text}));try{await $e({actionKind:`todo.update`,context:{goal_id:e.goalId,kind:`todo`,todo_id:e.todoId},idempotencyKey:`workspace-todo-${e.todoId}-complete-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e.goalId,operation:`complete`,todo_id:e.todoId},summary:d(`tasks.markComplete`,{name:e.text})}),F(null)}catch(e){F(d(`feedback.previewFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{ke.current.delete(e.todoId),L(new Set(ke.current))}}}function at(e){let n=t.onReconcileStatus,r=n?n({invalidateGoalIds:e}):t.onRefresh?.();return Promise.resolve(r).catch(()=>{F(d(`feedback.goalRefreshFailed`))})}async function ot(e,n={}){let r=e.actionKind===`team.plan`&&e.status===`error`&&[`apply_failed`,`readback_unverified`].includes(e.reviewPlan?.reason??``);if(e.reviewPlan&&!e.reviewPlan.canApply&&!r)return;let i=n.presentation!==`feedback`,o=e.actionKind===`goal.lifecycle`&&e.goalId&&(e.lifecycleOperation===`stop`||e.lifecycleOperation===`resume`)?{goalId:e.goalId,next:e.lifecycleOperation===`stop`?`stopped`:`active`,optimisticApplied:!1,previous:a.goals.find(t=>t.goalId===e.goalId)?.activationState??(e.lifecycleOperation===`stop`?`active`:`stopped`)}:null,s=n.lifecycleProjection??o;F(d(`feedback.applying`,{title:e.title}));let c={...e,reviewPlan:e.reviewPlan?{...e.reviewPlan,interaction:`pending`,reason:`apply_pending`,canApply:!1}:void 0,status:`applying`};C(t=>({...t,[e.previewId]:c})),i&&_({item:c,kind:`proposal`}),s&&!s.optimisticApplied&&t.onGoalActivationStateChange?.(s.goalId,s.next);try{if(t.onApplyProposal){await t.onApplyProposal(e);let n={...e,status:`applied`};C(t=>({...t,[e.previewId]:n})),i&&_({item:n,kind:`proposal`}),F(d(`feedback.completed`,{title:e.title})),e.actionKind===`goal.lifecycle`&&((e.lifecycleOperation===`stop`||e.lifecycleOperation===`delete`)&<(null),e.lifecycleOperation===`delete`&&e.goalId&&t.onGoalDeleted?.(e.goalId),at(e.goalId?[e.goalId]:void 0));return}let n=await Wh(e.previewId);if(n.proposal.proposal_id!==e.previewId||n.proposal.action_kind!==e.actionKind||e.actionKind===`goal.lifecycle`&&(n.proposal.normalized_parameters.goal_id!==e.goalId||AS(n.proposal)!==e.lifecycleOperation))throw new Ih(d(`actionReview.targetChanged`),{error_code:`action_response_mismatch`});let r=jS(n.proposal,d);if(C(t=>({...t,[e.previewId]:r})),i&&_({item:r,kind:`proposal`}),r.reviewPlan?.interaction!==`completed`){s&&t.onGoalActivationStateChange?.(s.goalId,s.previous),_({item:r,kind:`proposal`}),F(n.proposal.status===`stale`?d(`feedback.stale`):d(`actionReview.${r.reviewPlan.reason}`));return}F(d(`feedback.completed`,{title:r.title})),r.actionKind===`todo.create`&&await t.onRefresh?.(),r.actionKind===`goal.lifecycle`&&(r.lifecycleOperation===`stop`||r.lifecycleOperation===`delete`)&<(null),r.actionKind===`goal.lifecycle`&&r.lifecycleOperation===`delete`&&r.goalId&&t.onGoalDeleted?.(r.goalId),r.actionKind===`goal.lifecycle`&&at(r.goalId?[r.goalId]:void 0)}catch(n){if(s&&t.onGoalActivationStateChange?.(s.goalId,s.previous),n instanceof Ih&&n.payload.error_code===`protected_action`){let r=n.payload.gate,i=r&&typeof r==`object`?r:{},a={...e,reviewPlan:e.reviewPlan?{...e.reviewPlan,interaction:`gated`,reason:`authority_gate`,canApply:!1}:void 0,gate:{kind:String(i.kind??`protected_action`),nextAction:typeof i.next_action==`string`?i.next_action:void 0,summary:String(i.summary??n.message)},status:`gated`};C(t=>({...t,[e.previewId]:a})),_({item:a,kind:`proposal`}),F(d(`feedback.gateRequired`,{summary:a.gate.summary})),e.actionKind===`goal.create`&&e.goalId&&(t.onRefresh?.(),lt(e.goalId));return}let r=n instanceof Ih&&Ly(n.payload),i=n instanceof Ih&&n.payload.error_code===`action_response_mismatch`,a={...e,reviewPlan:e.reviewPlan?{...e.reviewPlan,interaction:r?`refresh`:`repair`,reason:i?`readback_unverified`:r?`stale_proposal`:`apply_failed`,canApply:!1}:void 0,errorMessage:n instanceof Error?n.message:String(n),status:r?`stale`:`error`};C(t=>({...t,[e.previewId]:a})),_({item:a,kind:`proposal`}),F(d(`feedback.executionFailed`,{error:a.errorMessage}))}}let st={...t,onOpenRunSession:async e=>{e.goalId!==R&<(e.goalId),T(`chat`),await t.onOpenRunSession?.(e),x(e),_(null)},onOpenGoal:e=>{lt(e),at([e])},onOpenGoalView:e=>{T(e),e===`chat`&&x(null),_(null)},onOpenOutput:e=>{e.goalId!==R&<(e.goalId),T(`files`),t.onOpenOutput?.(e)},onApplyProposal:ot,onCancelProposal:async e=>{_(null),C(t=>{let n={...t};return delete n[e.previewId],n});try{t.onCancelProposal?.(e),t.onCancelProposal||await Gh(e.previewId)}catch(t){C(t=>({...t,[e.previewId]:e})),F(d(`feedback.cancelFailed`,{error:t instanceof Error?t.message:String(t)}))}},onTransitionProposal:async(e,t)=>{let n=jS(await Kh(e.previewId,t),d);de(e=>e.includes(n.previewId)?e:[...e,n.previewId]),C(r=>{let i={...r};return t===`regenerate`&&delete i[e.previewId],i[n.previewId]=n,i}),_({item:n,kind:`proposal`})},onSelectWorkspaceCandidate:async(e,t)=>{e.sourceRequest&&(C(t=>{let n={...t};return delete n[e.previewId],n}),await $e({...e.sourceRequest,idempotencyKey:`${e.sourceRequest.idempotencyKey}-${t}`,normalizedParameters:{...e.sourceRequest.normalizedParameters,workspace_ref:t}}))},onPreviewAction:$e,onRequestScheduleConfig:(e,t)=>nt(e,t),onOpenNotificationSettings:e=>Ve({goalId:e,kind:`settings`,tab:`lark`}),onFetchNotificationTargets:()=>hg(),onSetupGoalChannel:e=>_g(e),onToggleGoalAutoNotify:e=>vg(e),onUpdateSchedule:async(e,t)=>{let n=Date.now().toString(36),r=e.scheduleKind===`heartbeat`;await $e({actionKind:r?`heartbeat.bind`:`monitor.update`,context:{kind:`schedule`,goal_id:e.goalId},idempotencyKey:`workspace-monitor-${e.scheduleId}-${t}-${n}`,normalizedParameters:{agent_id:e.agentId??Me,...!r&&t===`run_now`?{endpoint_id:Me}:{},...t===`edit`?{cadence:`2h`,...r?{timezone:e.timezone??`Asia/Shanghai`}:{}}:{},goal_id:e.goalId,operation:t,...!r&&t===`run_now`&&e.sessionId?{session_id:e.sessionId}:{},...r?{}:{todo_id:e.scheduleId}},summary:t===`pause`?`暂停自动运行:${e.label}`:t===`resume`?`恢复自动运行:${e.label}`:t===`run_now`?`立即运行:${e.label}`:t===`stop`?`停止自动运行:${e.label}`:`编辑自动运行生命周期:${e.label}`})}},ct=o?{onOpenGoal:st.onOpenGoal,onOpenGoalView:st.onOpenGoalView,onOpenOutput:st.onOpenOutput}:st;function lt(e){p(e),D(!1),k(!1),te(!1),x(null),_(null),T(`tasks`),he(!1),t.onSelectGoal?.(e)}function ut(e){h(e),t.onSelectAgent?.(e)}function dt(e){_e(e),_S(e)}async function ft(n){let r=n?[]:N,i=(n??Pe).trim()||(r.length?d(`composer.imageAnalysisPrompt`):``);if(!(!i||M)){n||(Ie(``),P([])),ie(null),ne(!0);try{if(r.length){R?w!==`chat`&&te(!0):k(!0);let e=await t.onSendMessage?.(i,Me,R,r);e&&await $e(e);return}let n=Eb(i,{agents:e.map(e=>({agentId:e.agentId,label:e.label})),goalId:R,todos:(V?.agentTodos??[]).map(e=>({text:e.text,todoId:e.todoId}))});if(n.route===`clarify`){Ie(i);let e=d(`composer.clarifySingleAction`);n.missingFields.includes(`resume_when`)&&(e=d(`composer.clarifyDefer`)),F(e);return}if(n.actionKind===`goal.create`){let e=FS(i,d),t=MS(e.title);await $e({actionKind:`goal.create`,context:{kind:`manager`,goal_id:null,natural_language:i},idempotencyKey:`workspace-goal-intent-${t}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:Me,completion_criteria:e.completionCriteria,execution_boundary:e.executionBoundary,goal_id:t,heartbeat:{cadence:IS(i),enabled:n.normalizedParameters.heartbeat_enabled===!0,timezone:`Asia/Shanghai`},initial_todos:e.initialTodos,objective:e.objective,permission:e.permission,stop_condition:zS(i),title:e.title,workspace_ref:`current`},summary:d(`proposal.summary.goalCreate`,{title:e.title})});return}if(R&&n.actionKind===`heartbeat.bind`){await rt(`heartbeat`,R,i);return}if(R&&n.actionKind===`monitor.create`){let e=LS(i,d);if(e){Ie(i),F(e);return}await rt(`monitor`,R,i);return}let a=BS(i,e);if(R&&a&&n.actionKind===`agent.bind`){await $e({actionKind:`agent.bind`,context:{kind:`goal`,goal_id:R,natural_language:i},idempotencyKey:`workspace-agent-bind-${R}-${a.agentId}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:a.agentId,goal_id:R},summary:`将 ${a.label} 绑定到 ${V?.title??R}`});return}if(R&&n.actionKind===`todo.create`){if(n.normalizedParameters.start_execution===!0){await $e({actionKind:`todo.create`,context:{kind:`goal`,goal_id:R,natural_language:i},idempotencyKey:`workspace-task-start-${R}-${Date.now().toString(36)}`,normalizedParameters:{endpoint_id:a?.agentId??Me,goal_id:R,start_execution:!0,text:i},summary:`交给 Agent 执行:${i.slice(0,120)}`});return}let e=a?.agentId??(/(交给|分配给|让).{0,24}(agent|codex|claude|kiro|kimi)/iu.test(i)?Me:null);await $e({actionKind:`todo.create`,context:{kind:`goal`,goal_id:R,natural_language:i},idempotencyKey:`workspace-todo-create-${R}-${Date.now().toString(36)}`,normalizedParameters:{...e?{endpoint_id:e}:{},goal_id:R,text:VS(i)},summary:`创建 Todo:${VS(i)}`});return}let o=V?.agentTodos.find(e=>i.includes(e.todoId)||i.includes(e.text)),s=typeof n.normalizedParameters.operation==`string`?n.normalizedParameters.operation:null;if(R&&o&&n.actionKind===`todo.update`&&s){await $e({actionKind:`todo.update`,context:{kind:`todo`,goal_id:R,todo_id:o.todoId,natural_language:i},idempotencyKey:`workspace-todo-update-${o.todoId}-${s}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:Me,...s===`reassign`&&a?{endpoint_id:a.agentId}:{},...s===`block`?{note:i}:{},...s===`defer`&&typeof n.normalizedParameters.resume_when==`string`?{resume_when:n.normalizedParameters.resume_when}:{},goal_id:R,operation:s,todo_id:o.todoId},summary:`更新 Todo:${o.text}`});return}R?w!==`chat`&&te(!0):k(!0);let c=await t.onSendMessage?.(i,Me,R);c&&await $e(c)}catch(e){n||(Ie(i),P(r));let t=e instanceof Error?e.message:d(`feedback.sendGenericError`);F(d(`feedback.sendFailed`,{error:t}))}finally{ne(!1)}}}let pt=e.find(e=>e.agentId===Me)?.label??Me,mt=!V&&Pe.startsWith(d(`composer.createGoalDraftLead`)),ht=Ge.filter(e=>e.kind===`run`&&!!e.run.sessionId&&!!e.run.canInterrupt&&(e.run.status===`running`||e.run.status===`queued`)).length;async function gt(e){if(!e?.length)return;let t=WS-N.length,n=Array.from(e).slice(0,Math.max(0,t)),r=n.find(e=>!HS.has(e.type)),i=n.find(e=>e.size>US);if(t<=0){ie(d(`composer.imageCountError`,{count:WS}));return}if(r){ie(d(`composer.imageTypeError`));return}if(i){ie(d(`composer.imageSizeError`,{size:US/1024/1024}));return}try{let t=await Promise.all(n.map(e=>GS(e,d)));P(e=>[...e,...t].slice(0,WS)),ie(e.length>n.length?d(`composer.imageCountError`,{count:WS}):null)}catch(e){ie(e instanceof Error?e.message:d(`composer.imageReadGenericError`))}finally{De.current&&(De.current.value=``)}}function _t(e){let t=Array.from(e.clipboardData.items).filter(e=>e.kind===`file`&&e.type.startsWith(`image/`)).flatMap(e=>{let t=e.getAsFile();return t?[t]:[]});t.length&&(e.preventDefault(),gt(t))}async function vt(){let e=await c_();xe(e)}async function yt(){await Promise.all([vt(),t.onRefresh?.()])}async function bt(){if(!(!t.onRefresh||ce===`loading`)){le(`loading`);try{await t.onRefresh(),le(`done`)}catch{le(`error`)}window.setTimeout(()=>le(`idle`),1800)}}let xt=Ue?(0,B.jsx)(pS,{callbacks:ct,focusGoalConnection:!!(g?.kind===`settings`&&g.goalId),goalNotifications:a.goalNotifications??[],goals:Re,initialGoalId:g?.kind===`settings`?g.goalId??R:R,initialTab:g?.kind===`settings`?g.tab??`lark`:`lark`,onChanged:()=>void yt(),onClose:He,onThemeChange:dt,theme:ge}):null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{hidden:Ue,children:(0,B.jsx)(vS,{drawer:Qe?(0,B.jsx)(Fb,{agents:e,attentionHistory:a.attentionHistory??a.userTodos,onSelectAttention:e=>_({kind:`attention`,item:e}),callbacks:ct,goalNotifications:a.goalNotifications??[],goals:Re,inspectorExpanded:v,larkConnections:o?[]:be,onClose:()=>{Qe.kind===`proposal`&&[`applied`,`rejected`].includes(Qe.item.status)&&(Qe.item.actionKind!==`heartbeat.bind`||Qe.item.status!==`applied`)&&C(e=>{let t={...e};return delete t[Qe.item.previewId],t}),y(!1),_(null)},onToggleInspectorSize:()=>y(e=>!e),readOnly:o,runs:Ge.flatMap(e=>e.kind===`run`?[e.run]:[]),selection:Qe}):null,drawerMode:Qe?.kind===`todo`?v?`inspector-full`:`inspector`:`panel`,drawerOpen:Qe!==null,mobileSidebarOpen:me,onCloseMobileSidebar:()=>he(!1),theme:ge,main:(0,B.jsxs)(`div`,{className:`personal-channel`,children:[(0,B.jsx)(ib,{agents:e,managerChatOpen:E,managerChannelBinding:r,managerRuntime:i,mobileNavigationOpen:me,onOpenGoalCapabilities:V&&!o?()=>Ve({goalId:V.goalId,kind:`settings`,tab:`capabilities`}):void 0,onRefresh:t.onRefresh?()=>void bt():void 0,onOpenNavigation:()=>he(!0),onOpenManagerChat:()=>{k(!1),D(!0)},onSelectGoalTab:e=>{T(e),e===`chat`&&(x(null),te(!1))},onSelectAgent:ut,onReturnManagerHome:()=>{D(!1),k(!1),window.requestAnimationFrame(()=>Te.current?.scrollTo({behavior:`smooth`,top:0}))},selectedAgentId:Me,refreshState:ce,readOnlySourceLabel:o?l?.activeSource.label:void 0,selectedGoal:V,selectedGoalTab:w}),(0,B.jsxs)(`div`,{className:`personal-channel-scroll`,"data-active-goal-view":V?w:void 0,ref:Te,children:[!V&&!E&&Ae&&Ae.done+Ae.failed+Ae.attention>0?(0,B.jsxs)(`section`,{className:`personal-digest-card`,"aria-label":d(`digest.away`),children:[(0,B.jsx)(`strong`,{children:d(`digest.away`)}),(0,B.jsxs)(`div`,{className:`personal-digest-stats`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{children:Ae.done}),d(`digest.completed`)]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{children:Ae.failed}),d(`digest.failed`)]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{children:Ae.attention}),d(`digest.needsYou`)]})]})]}):null,!V&&!E?(0,B.jsxs)(`section`,{className:`personal-manager-greeting`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)(rm,{size:20})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:d(`home.greeting`)}),(0,B.jsx)(`p`,{children:a.goals.some(e=>e.activationState===`active`&&e.loadState)?d(`startup.partial`):(0,B.jsxs)(B.Fragment,{children:[d(`home.waitingCount`,{count:ze}),` `,d(`home.blockingSummary`,{count:Be})]})})]})]}):null,V?.loadState?(0,B.jsx)(`section`,{className:`personal-manager-greeting`,role:`status`,"data-testid":`goal-status-loading`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:d(V.loadState===`error`?`startup.goalError`:`startup.goalLoading`)}),(0,B.jsx)(`p`,{children:d(V.loadError?`startup.error.${V.loadError}`:`startup.independent`)}),V.loadState===`error`?(0,B.jsx)(`button`,{className:`min-h-11 rounded-md border px-3 py-2 text-sm`,type:`button`,onClick:()=>void t.onRefresh?.(),children:d(`startup.retry`)}):null]})}):V?(0,B.jsx)(Tx,{activeTab:w,scrollRef:Te,panels:{overview:(0,B.jsx)(wx,{active:!Ue&&w===`overview`,goal:V,items:Ge,userTodos:a.userTodos,readOnly:o,onOpenDetails:()=>_({kind:`goal`,item:V}),onSelect:_,onView:T}),tasks:(0,B.jsx)(sx,{historyEnabled:!o,goal:V,items:Ge,onDraftTaskFromMessage:o?void 0:e=>{Ie(`创建一个 Task:${yS(e)}`),F(d(`feedback.taskDraftCreated`)),window.requestAnimationFrame(()=>we.current?.focus())},onOpenChat:()=>T(`chat`),onQuickComplete:o?void 0:it,onSelect:_,quickCompletingTodoIds:se,selectedTodoId:Qe?.kind===`todo`?Qe.item.todoId:null,userTodos:a.userTodos}),files:(0,B.jsx)(CS,{items:Ge.filter(e=>e.kind===`output`),onSelect:_,reportState:a.periodicReports}),chat:(0,B.jsxs)(B.Fragment,{children:[V&&b?.goalId===V.goalId?(0,B.jsx)(TS,{onClose:()=>x(null),onOpenDetails:()=>_({item:b,kind:`run`}),run:b}):null,(0,B.jsx)(_b,{items:Ke,onSelect:_,selectedGoal:V})]})}},`${l?.activeSource.statusUrl??`/status.json`}:${V.goalId}`):E?(0,B.jsx)(_b,{items:Ye,onSelect:_,selectedGoal:null}):(0,B.jsx)(SS,{goals:Re,onRetry:()=>void t.onRefresh?.(),onSelectGoal:lt,systemHealth:a.systemHealth})]}),(0,B.jsx)(`div`,{className:`personal-composer-wrap`,children:o?(0,B.jsxs)(`div`,{className:`personal-read-only-notice`,children:[(0,B.jsx)(`strong`,{children:d(`source.readOnlyNoticeTitle`)}),(0,B.jsx)(`span`,{children:d(`source.readOnlyNoticeDescription`)})]}):(0,B.jsxs)(B.Fragment,{children:[!V&&!E&&O&&qe.length?(0,B.jsx)(wS,{messages:qe,onClose:()=>k(!1),onOpenConversation:()=>{k(!1),D(!0)}}):null,V&&w!==`chat`&&ee&&Je.length?(0,B.jsx)(wS,{agentLabel:pt,messages:Je,onClose:()=>te(!1),onDraftTask:w===`tasks`?e=>{Ie(`创建一个 Task:${yS(e)}`),F(d(`feedback.taskDraftCreated`)),window.requestAnimationFrame(()=>we.current?.focus())}:void 0,onOpenConversation:()=>{te(!1),T(`chat`)},title:`${V.title} · ${pt}`}):null,ae?(0,B.jsxs)(`div`,{className:`personal-action-feedback`,role:`status`,children:[(0,B.jsx)(`span`,{children:ae}),(0,B.jsx)(`button`,{"aria-label":d(`common.closeActionReceipt`),onClick:()=>F(null),type:`button`,children:(0,B.jsx)(oh,{size:14})})]}):null,(0,B.jsx)(`p`,{className:`personal-composer-hint`,children:V?ht>0?d(`composer.goalRunningHint`,{agent:pt,count:ht}):d(`composer.goalMessageHint`,{agent:pt}):d(`composer.managerMessageHint`)}),V?(0,B.jsxs)(`div`,{className:`personal-quick-prompts`,children:[(0,B.jsxs)(`button`,{"aria-label":d(`composer.nextAction`),disabled:M,onClick:()=>void ft(d(`composer.nextActionPrompt`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(Nm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.nextAction`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.agentProgress`),disabled:M,onClick:()=>void ft(d(`composer.agentProgressPrompt`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(qm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.agentProgress`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.monitor`),disabled:M,onClick:()=>void ft(d(`composer.monitorShortcutTemplate`,{target:d(`schedule.defaultTarget`)})),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(am,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.monitor`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.blockers`),disabled:M||!Le(`gate`),onClick:()=>void ft(Le(`gate`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(um,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.blockers`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.evidence`),disabled:M||!Le(`evidence`),onClick:()=>void ft(Le(`evidence`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(Sm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.evidence`)})]})]}):(0,B.jsxs)(`div`,{className:`personal-quick-prompts`,children:[(0,B.jsxs)(`button`,{"aria-label":d(`composer.globalTasks`),disabled:M,onClick:()=>void ft(d(`composer.globalTasksPrompt`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(Nm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.globalTasks`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.globalProgress`),disabled:M,onClick:()=>void ft(d(`composer.globalProgressPrompt`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(qm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.globalProgress`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.createGoal`),onClick:et,title:d(`composer.createGoalHint`),type:`button`,children:[(0,B.jsx)(Vm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.createGoal`)})]})]}),mt?(0,B.jsxs)(`div`,{className:`personal-goal-draft-status`,role:`status`,children:[(0,B.jsx)(`strong`,{children:d(`composer.createGoalDraft`)}),(0,B.jsx)(`span`,{children:d(`composer.createGoalDraftDescription`)})]}):null,N.length?(0,B.jsx)(`div`,{className:`personal-composer-images`,"aria-label":d(`composer.imagesPending`),children:N.map(e=>(0,B.jsxs)(`figure`,{children:[(0,B.jsx)(`img`,{alt:e.name,src:e.dataUrl}),(0,B.jsx)(`button`,{"aria-label":d(`composer.sentImageAlt`,{name:e.name}),onClick:()=>P(t=>t.filter(t=>t.id!==e.id)),type:`button`,children:(0,B.jsx)(oh,{size:13})})]},e.id))}):null,re?(0,B.jsx)(`p`,{className:`personal-composer-error`,role:`alert`,children:re}):null,(0,B.jsxs)(`div`,{className:`personal-channel-composer`,onDragOver:e=>{[...e.dataTransfer.items].some(e=>e.kind===`file`&&e.type.startsWith(`image/`))&&e.preventDefault()},onDrop:e=>{let t=[...e.dataTransfer.files].filter(e=>e.type.startsWith(`image/`));t.length&&(e.preventDefault(),gt(t))},children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(rm,{size:17}),e.find(e=>e.agentId===Me)?.label??Me]}),(0,B.jsx)(`button`,{"aria-label":d(`composer.addImage`),className:`personal-composer-attach`,disabled:M||N.length>=WS,onClick:()=>De.current?.click(),title:d(`composer.attachImageHint`),type:`button`,children:(0,B.jsx)(Rm,{size:17})}),(0,B.jsx)(`input`,{accept:`image/png,image/jpeg,image/webp,image/gif`,"aria-label":d(`composer.imagePicker`),className:`personal-composer-file-input`,disabled:M||N.length>=WS,multiple:!0,onChange:e=>void gt(e.target.files),ref:De,type:`file`}),(0,B.jsx)(`textarea`,{"aria-label":d(`composer.sendMessage`),onChange:e=>Ie(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),ft())},onPaste:_t,placeholder:V?d(`composer.goalPlaceholder`,{goal:V.title}):d(`composer.managerPlaceholder`),ref:we,rows:1,value:Pe}),(0,B.jsx)(`button`,{"aria-label":d(mt?`composer.createGoal`:`composer.send`),disabled:!Pe.trim()&&N.length===0||M,onClick:()=>void ft(),title:d(mt?`composer.createGoalHint`:`composer.sendMessageHint`),type:`button`,children:(0,B.jsx)(qm,{size:18})})]})]})})]}),sidebar:(0,B.jsx)(rx,{attentionCount:ze,goals:Re,goalArchiveLoadState:n,goalLifecycleOperations:t.onExecuteGoalLifecycle?[`stop`,`resume`]:void 0,lifecycleBusyGoalIds:oe,onRequestGoalCreate:o?void 0:et,onRequestGoalLifecycle:o&&!t.onExecuteGoalLifecycle?void 0:(e,t)=>void tt(e,t),onRetryGoalArchive:t.onRetryGoalArchive||t.onRefresh?()=>void(t.onRetryGoalArchive??t.onRefresh)?.():void 0,onOpenSettings:o?void 0:()=>Ve({kind:`settings`}),onSelectGoal:lt,selectedGoalId:R,statusSourceControl:l},l?.activeSource.statusUrl??`/status.json`)})}),xt]})}function qS(e){return(e??``).replace(/\s+/gu,` `).trim()}function JS(e,t=120){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t-1).join(``)}…`}function YS(e,t,n){let r=qS(e);return!r||r===`暂无`?n?t(n):``:/refresh-state|latest_run|latest run-derived/iu.test(r)?t(`projection.refreshState`):/first read-only adapter tick|read-only adapter/iu.test(r)?t(`projection.firstReadOnlyAdapterCheck`):/todo update recorded for/iu.test(r)?t(`projection.todoStatusUpdated`):/^(loopx|python3|npm|git|run)\s|\s--[a-z0-9-]+|\b[a-z]+_[a-z_]+\b/iu.test(r)?t(n??`projection.agentPreparingNextStep`):JS(r)}function XS(e,t){return t({advancing:`projection.agentAdvancingGoal`,idle:`projection.agentIdle`,needs_you:`projection.agentNeedsDecision`,stopped:`projection.agentStopped`,waiting_external:`projection.agentWaitingExternal`}[e])}function ZS({eventCount:e,hasArtifact:t,hasLatestValidation:n},r){return{label:r(n?`projection.latestValidation`:`projection.latestRun`),metadata:e>0?r(`projection.events24h`,{count:e}):r(t?`projection.runEvidenceAvailable`:`projection.publicSafeProjection`)}}var QS=`/status.json`,$S=`loopx-status-source-catalog-v1`,eC={id:`local`,kind:`local`,label:`本机`,readOnly:!1,statusUrl:QS};function tC(e,t){let n=dh(e,t).source;if(!n||!n.isLoopback||n.isRelative)return{error:`SSH 隧道来源必须使用显式的 localhost、127.0.0.1 或 ::1 URL。`};let r=new URL(n.url,t);return[`http:`,`https:`].includes(r.protocol)?{url:r.toString()}:{error:`状态来源只支持 HTTP 或 HTTPS。`}}function nC(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return`ssh-${(t>>>0).toString(36)}`}function rC(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return null;let n=e;if(n.kind!==`ssh_tunnel`||typeof n.label!=`string`||typeof n.statusUrl!=`string`)return null;let r=n.label.trim(),i=tC(n.statusUrl,t);if(!r||r.length>48||!(`url`in i))return null;let a=qb(n.hostAlias)?n.hostAlias.trim():void 0;return{...a?{hostAlias:a}:{},id:nC(i.url),kind:`ssh_tunnel`,label:r,readOnly:!0,statusUrl:i.url}}function iC(){return{schemaVersion:1,sources:[eC]}}function aC(e,t){try{let n=e.getItem($S);if(!n)return iC();let r=JSON.parse(n);if(r.schemaVersion!==1||!Array.isArray(r.sources))return iC();let i=new Set([eC.statusUrl]);return{schemaVersion:1,sources:[eC,...r.sources.flatMap(e=>{let n=rC(e,t);return!n||i.has(n.statusUrl)?[]:(i.add(n.statusUrl),[n])})]}}catch{return iC()}}function oC(e,t){e.setItem($S,JSON.stringify({schemaVersion:1,sources:t.sources.filter(e=>e.kind===`ssh_tunnel`)}))}function sC(e,t){let n=new Set(t.filter(qb).map(e=>e.trim())),r=!1,i=e.sources.map(e=>e.kind!==`ssh_tunnel`||e.hostAlias||!n.has(e.label)?e:(r=!0,{...e,hostAlias:e.label}));return r?{...e,sources:i}:e}function cC(e,t,n){let r=t.label.trim();if(!r)return{error:`请填写来源名称。`};if(r.length>48)return{error:`来源名称不能超过 48 个字符。`};let i=tC(t.statusUrl,n);if(!(`url`in i))return i;if(e.sources.some(e=>e.statusUrl===i.url))return{error:`这个状态 URL 已经在来源目录中。`};if(t.hostAlias!==void 0&&!qb(t.hostAlias))return{error:`请选择有效的 SSH Host。`};let a=t.hostAlias?.trim(),o={...a?{hostAlias:a}:{},id:nC(i.url),kind:`ssh_tunnel`,label:r,readOnly:!0,statusUrl:i.url};return{catalog:{...e,sources:[...e.sources,o]},source:o}}function lC(e,t){return{...e,sources:e.sources.filter(e=>e.kind===`local`||e.id!==t)}}function uC(e,t,n){if(!t.trim()||dh(t,n).source?.isRelative)return eC;let r=t.trim();try{r=new URL(r,n).toString()}catch{return null}return e.sources.find(e=>e.statusUrl===r)??null}function dC(e,t,n){return uC(e,t,n)||(dh(t,n).source?.isRelative?eC:{id:`temporary`,kind:`ssh_tunnel`,label:`临时来源`,readOnly:!0,statusUrl:t.trim()})}function fC(e,t,n,r){return dC(e,t??n,r)}var pC={delete:`删除`,deploy:`部署`,merge:`合并`,payment:`付款`,release:`发布`};function mC(e,t,n){let r=t.replace(/\s+/gu,` `).trim().toLowerCase(),i=n.target.replace(/\s+/gu,` `).trim().toLowerCase();return!i||!r.includes(i)?null:{actionKind:`goal.update`,context:{goal_id:e,kind:`goal`,natural_language:t,semantic_proposal:{operation:n.operation,target:n.target}},idempotencyKey:`workspace-semantic-protected-${e}-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e,status:`operator_gate_requested`},summary:`请求受保护操作:${pC[n.operation]} · ${n.target}`}}var hC=QS;async function gC(e){let t=await fetch(e,{cache:`no-store`,signal:AbortSignal.timeout(3e4)});if(!t.ok)throw Error(`HTTP ${t.status} while loading ${e}`);return Ap(await t.json())}function _C(e,t){if(t?.controller_readiness?.decision_advisor_ready||t?.controller_readiness?.write_controller_ready)return`controller_ready`;if(t?.controller_readiness)return`controller_gated`;if(t?.human_reward)return`reward_judged`;if(t?.operator_gate?.decision===`approve`)return`operator_approved`;if(t?.operator_gate)return`operator_gated`;let n=e||t?.classification||``;return n===`connected_without_run`?`connected`:n===`read_only_project_map`||t?.project_map?`mapped`:n===`state_refreshed`?`refreshed`:n&&n!==`no_status`?`adapter_inspected`:`registered`}function vC(e,t){let n=new Map(t.map(e=>[e.goal_id,e])),r=new Set,i=e.map(e=>{r.add(e.id);let t=n.get(e.id),i=e.latest_runs[0],a=t?.lifecycle_phase??e.lifecycle_phase??i?.lifecycle_phase??_C(t?.status??i?.classification??e.status,i),o=t?.lifecycle_flags?.length?t.lifecycle_flags:e.lifecycle_flags?.length?e.lifecycle_flags:i?.lifecycle_flags?.length?i.lifecycle_flags:[a];return{goal:e,queueItem:t,latestRun:i,status:t?.status??i?.classification??e.status??`no_status`,waitingOn:t?.waiting_on??`clear`,severity:t?.severity??`clear`,lifecyclePhase:a,lifecycleFlags:o}});for(let e of t)r.has(e.goal_id)||i.push({goal:{activation_state:e.activation_state,id:e.goal_id,status:e.status,display_name:e.goal_id,latest_runs:[],lifecycle_flags:[e.lifecycle_phase??`registered`],registry_member:!0,legacy_runtime_goal:!1,index_exists:!1,raw_index_records:0,unique_runs:0},queueItem:e,status:e.status,waitingOn:e.waiting_on,severity:e.severity,lifecyclePhase:e.lifecycle_phase??`registered`,lifecycleFlags:e.lifecycle_flags??[`registered`]});return i}function yC(e){return(e??``).replace(/\s+/g,` `).trim()}function bC(e,t=132){let n=yC(e);return n.length<=t?n:`${n.slice(0,Math.max(0,t-1))}…`}function xC(e){let t=new Map;for(let n of e?.goals??[])t.set(n.goal_id,n);return t}function SC(e,t){return e===void 0||t===void 0?void 0:e+t}function CC(e,t){if(!e)return null;let n=t===`user`?e.queueItem?.project_asset?.user_todos:e.queueItem?.project_asset?.agent_todos;if(n?.items?.length)return{done_count:n.done??n.items.filter(e=>e.done).length,items:n.items,open_count:n.open??n.items.filter(e=>!e.done).length,total_count:n.total??n.items.length};let r=t===`user`?e.queueItem?.user_todos:e.queueItem?.agent_todos;return r?.items?.length?r:null}function wC(e){return e?.items.find(e=>!e.done)}function TC(e,t,n=`todos`){return e?.items?.length?{advancement_done_count:e.advancement_done_count??t?.advancement_done_count,done_count:e.done??e.items.filter(e=>e.done).length,items:e.items,open_count:e.open??e.items.filter(e=>!e.done).length,total_count:e.total??e.items.length}:t??null}function EC(e){return e?.queueItem?.project_asset?.quota?.state??e?.queueItem?.quota?.state??e?.goal.quota?.state??`waiting`}function DC(e,t,n){let r=[];for(let t of e){let e=CC(t,`agent`);for(let n of e?.items??[])r.push({goalId:t.goal.id,role:`agent`,todo:n})}let i=new Map;for(let e of r){let t=e.todo.claimed_by||`codex`,n=i.get(t)??[];n.push(e),i.set(t,n)}let a=new Map((n?.agents??[]).map(e=>[e.agent_id,e]));return Array.from(new Set([...i.keys(),...a.keys()])).map(e=>{let t=i.get(e)??[],n=a.get(e),r=Array.from(new Set([...t.map(e=>e.goalId),n?.current_todo?.goal_id,...n?.goal_ids??[]].filter(Boolean))),o=(t.filter(e=>!e.todo.done)[0]??t[0])?.goalId??n?.current_todo?.goal_id??r[0]??``,s=n?.last_activity_at??null;return{agentId:e,claimedTodos:t,currentTodo:n?.current_todo??null,evidenceRefs:[],goalIds:r,handoffNote:null,lastActivity:s,nextSafeAction:n?.next_action?.trim()||`Inspect status projection before taking work`,primaryGoalId:o,quotaHints:[],staleClaimHint:null,status:{label:`可用`,summary:`正常运行`,variant:`success`},workspaceRef:null}})}function OC(e){return e?.map(e=>({dataUrl:e.data_url,id:e.id,mimeType:e.mime_type,name:e.name,size:e.size}))}var kC=`loopx.personal-agent-selection.v1`;function AC(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(kC)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[0]==`string`&&typeof e[1]==`string`))}catch{return{}}}var jC={需修复:`danger`,等你:`warning`,等待条件:`info`,推进中:`success`,安静运行:`neutral`,已停止:`neutral`,已完成:`neutral`};function MC(e,t){return yC(t)||e.replace(/^loopx[-_]/i,`LoopX `).split(/[-_]+/).filter(Boolean).map((e,t)=>t===0?`${e.slice(0,1).toUpperCase()}${e.slice(1)}`:e).join(` `)}function NC(e){return e.split(/\r?\n/u).filter(e=>!/^\s*GOAL_(STATUS|PROGRESS)\s*:/u.test(e)).map(e=>/^\s*GOAL_EVIDENCE\s*:/u.test(e)?e.replace(/^\s*GOAL_EVIDENCE\s*:/u,`验证依据:`):/^\s*NEXT_ACTION\s*:/u.test(e)?e.replace(/^\s*NEXT_ACTION\s*:/u,`下一步:`):e).join(` +`),s=/(只读|不调用外部工具|不修改(?:仓库|代码|状态)|read.?only|do not (?:call|use) external tools|do not modify (?:repositories|repository|code|state))/iu.test(i||e);return{completionCriteria:r,executionBoundary:i,initialTodos:r?[t(`goal.initialTodo`,{criteria:r})]:[],objective:o,permission:s?`read_only`:`workspace_write_on_confirmation`,title:a}}function IS(e){let t=e.match(/(?:每|every)\s*(\d{1,3})\s*(?:分钟|minutes?)/iu)?.[1];if(t)return`${t}m`;let n=e.match(/(?:每|every)\s*(\d{1,2})\s*(?:小时|hours?)/iu)?.[1];return n?`${n}h`:/每小时|every hour|hourly/iu.test(e)?`1h`:(/每天|每日|早上|上午|daily|every day/iu.test(e),`1d`)}function LS(e,t){return/(每周|星期|周[一二三四五六日天]|weekly|every\s+(?:mon|tues|wednes|thurs|fri|satur|sun)day|\d{1,2}\s*[::]\s*\d{2})/iu.test(e)?t(`schedule.unsupportedCalendar`):null}function RS(e,t){return PS(e,[`检查内容`,`监控内容`,`目标`,`Check target`,`Monitor target`,`Target`])||e.replace(/^(?:为当前 Goal |for the current Goal )?(?:添加|配置|创建|add|configure|create)?\s*(?:定时检查|监控|scheduled check|monitor)[::]?/iu,``).split(/\r?\n/u)[0].trim()||t(`schedule.defaultTarget`)}function zS(e){return/(mr|pr).{0,8}(合并|merge)/iu.test(e)?`pr_merged`:/发布完成|上线完成|release (?:is )?complete|deployment (?:is )?complete/iu.test(e)?`release_complete`:`goal_complete`}function BS(e,t){let n=e.toLowerCase();return t.find(e=>n.includes(e.agentId.toLowerCase())||n.includes(e.label.toLowerCase()))}function VS(e){let t=PS(e,[`标题`,`任务标题`,`Todo 标题`]),n=PS(e,[`内容`,`任务内容`,`Todo 内容`]);if(t)return[t,n].filter(Boolean).join(`:`).slice(0,400);let r=e.match(/[「“"]([^」”"]{2,200})[」”"]/u)?.[1];return r?r.trim():e.replace(/^(请|帮我|给我|为当前 Goal |新增|新建|创建|添加|加上|加一个|记一个)+/u,``).replace(/^(一个\s*)?(普通\s*)?(todo|待办|任务)(?:\s*到\s*Tasks?)?[::\s]*/iu,``).replace(/[。;;,,]\s*(?:不要|不需要|无需|禁止|别|暂不).{0,80}(?:heartbeat|心跳|定时|监控|执行).*$/iu,``).replace(/[,,]\s*(并且|然后|再)?\s*(交给|分配给|让).+$/u,``).replace(/\s*(交给|分配给|让)\s+.+$/u,``).trim().slice(0,400)||`推进当前 Goal 的下一项工作`}var HS=new Set([`image/png`,`image/jpeg`,`image/webp`,`image/gif`]),US=5242880,WS=4;function GS(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onerror=()=>r(Error(t(`composer.imageReadError`,{name:e.name}))),i.onload=()=>n({dataUrl:String(i.result??``),id:crypto.randomUUID(),mimeType:e.type,name:e.name,size:e.size}),i.readAsDataURL(e)})}function KS({agents:e=[{agentId:`codex`,available:!0,capability:`代码与项目执行`,label:`Codex`}],callbacks:t={},goalArchiveLoadState:n={error:null,phase:`ready`},managerChannelBinding:r,managerRuntime:i,model:a,readOnly:o=!1,selectedAgentId:s,selectedGoalId:c,statusSourceControl:l}){let{locale:u,t:d}=Ji(),[f,p]=(0,z.useState)(c??null),[m,h]=(0,z.useState)(s??e.find(e=>e.available)?.agentId??`codex`),[g,_]=(0,z.useState)(null),[v,y]=(0,z.useState)(!1),[b,x]=(0,z.useState)(null),[S,C]=(0,z.useState)({}),[w,T]=(0,z.useState)(`chat`),[E,D]=(0,z.useState)(!1),[O,k]=(0,z.useState)(!1),[ee,te]=(0,z.useState)(!1),[A,j]=(0,z.useState)(()=>{try{let e=window.sessionStorage.getItem(`loopx-pw-composer-drafts`),t=e?JSON.parse(e):{};return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}),[M,ne]=(0,z.useState)(!1),[N,P]=(0,z.useState)([]),[re,ie]=(0,z.useState)(null),[ae,F]=(0,z.useState)(null),[oe,I]=(0,z.useState)(()=>new Set),[se,L]=(0,z.useState)(()=>new Set),[ce,le]=(0,z.useState)(`idle`),[ue,de]=(0,z.useState)([]),[fe,pe]=(0,z.useState)([]),[me,he]=(0,z.useState)(!1),[ge,_e]=(0,z.useState)(gS),[ve,ye]=(0,z.useState)({}),[be,xe]=(0,z.useState)([]),Se=(0,z.useRef)(!1),Ce=(0,z.useRef)(NaN),we=(0,z.useRef)(null),Te=(0,z.useRef)(null),Ee=(0,z.useRef)(null),De=(0,z.useRef)(null),Oe=(0,z.useRef)(new Set),ke=(0,z.useRef)(new Set),[Ae,je]=(0,z.useState)(null),R=c===void 0?f:c,Me=s??m,Ne=`${R??`manager`}:${Me}`,Pe=A[Ne]??``;(0,z.useEffect)(()=>{P([]),ie(null)},[Ne]);function Fe(e,t){j(n=>{let r={...n};t?r[e]=t:delete r[e];try{window.sessionStorage.setItem(`loopx-pw-composer-drafts`,JSON.stringify(r))}catch{}return r})}function Ie(e){Fe(Ne,e)}function Le(e){return yh.find(t=>t.id===e)?.prompt??``}(0,z.useEffect)(()=>{let e=we.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,120)}px`)},[Pe]);let Re=(0,z.useMemo)(()=>a.goals.map(e=>{let t=ve[e.goalId];return t?{...e,repository:{branch:t.branch,identity:t.identity,label:t.label,readOnly:!0}}:e}),[ve,a.goals]),ze=(0,z.useMemo)(()=>Re.filter(e=>Xy(e)===`needs_you`).length,[Re]),Be=(0,z.useMemo)(()=>Re.filter(e=>Xy(e)===`needs_you`&&(e.needsYouBlocking||e.state===`等你`)).length,[Re]),V=Re.find(e=>e.goalId===R)??null;function Ve(e){Ee.current=document.activeElement instanceof HTMLElement?document.activeElement:null,he(!1),_(e)}function He(){_(null),window.requestAnimationFrame(()=>{let e=Ee.current;e?.isConnected&&e.getClientRects().length?e.focus({preventScroll:!0}):document.querySelector(`.personal-mobile-menu`)?.focus({preventScroll:!0})})}let Ue=g?.kind===`settings`,We=R,Ge=(0,z.useMemo)(()=>{let e=Object.values(S).filter(e=>e.actionKind===`heartbeat.bind`&&e.goalId&&e.status===`applied`).map(e=>({id:`schedule:${e.goalId}:heartbeat`,kind:`schedule`,schedule:{agentId:Me,executionHistory:[],goalId:e.goalId,label:e.title,nextRunAt:d(`drawer.schedulePending`),notificationRule:d(`drawer.scheduleDefaultNotification`),schedule:e.fields.find(e=>e.key===`cadence`)?.value??d(`schedule.summary`),scheduleId:`${e.goalId}:heartbeat`,scheduleKind:`heartbeat`,status:e.status===`applied`?`active`:`draft`,stopCondition:e.fields.find(e=>e.key===`stop_condition`)?.value??d(`drawer.scheduleDefaultStop`),timezone:e.fields.find(e=>e.key===`timezone`)?.value??`Asia/Shanghai`}})),t=[...ES(a,We,d),...a.timeline??[],...e,...bS(Object.values(S)).filter(e=>e.actionKind!==`heartbeat.bind`||e.status!==`applied`).map(e=>({id:`proposal:${e.previewId}`,kind:`proposal`,proposal:e}))];return[...new Map(t.map(e=>[e.id,e])).values()].filter(e=>e.kind!==`proposal`||![`stale`,`error`].includes(e.proposal.status)||e.proposal.reviewPlan?.retryOriginal===!0||ue.includes(e.proposal.previewId)).filter(e=>!R||e.kind===`message`?!0:e.kind===`proposal`?!e.proposal.goalId||e.proposal.goalId===R:e.kind===`attention`?e.attention.goalId===R:e.kind===`run`?e.run.goalId===R:e.kind===`schedule`?e.schedule.goalId===R:e.output.goalId===R)},[We,a,S,Me,R,ue,d]),Ke=(0,z.useMemo)(()=>b?Ge.filter(e=>e.kind===`message`?!0:e.kind===`run`?e.run.runId===b.runId:e.kind===`output`&&e.output.runId===b.runId):Ge,[b,Ge]);(0,z.useEffect)(()=>{if(!b)return;let e=Ge.find(e=>e.kind===`run`&&e.run.runId===b.runId);!e||e.kind!==`run`||JSON.stringify({completedSteps:b.completedSteps,latestActivity:b.latestActivity,messages:b.sessionMessages,sessionStatus:b.sessionStatus,status:b.status,totalSteps:b.totalSteps})!==JSON.stringify({completedSteps:e.run.completedSteps,latestActivity:e.run.latestActivity,messages:e.run.sessionMessages,sessionStatus:e.run.sessionStatus,status:e.run.status,totalSteps:e.run.totalSteps})&&x(e.run)},[b,Ge]);let qe=(0,z.useMemo)(()=>Ge.flatMap(e=>e.kind===`message`?[e.message]:[]),[Ge]),Je=(0,z.useMemo)(()=>V?Ge.flatMap(e=>e.kind===`message`?[e.message]:[]):[],[Ge,V]);(0,z.useEffect)(()=>{V||E||qe.some(e=>e.pending)&&k(!0)},[E,qe,V]),(0,z.useEffect)(()=>{!V||w===`chat`||Je.some(e=>e.pending)&&te(!0)},[Je,V,w]);let Ye=(0,z.useMemo)(()=>Ge.filter(e=>e.kind===`message`||e.kind===`proposal`&&(ue.includes(e.proposal.previewId)||fe.includes(e.proposal.previewId))),[Ge,ue,fe]),Xe=Ye[Ye.length-1],Ze=Xe?.kind===`message`?Xe.message.text.length:0;(0,z.useEffect)(()=>{if(!E||!Te.current)return;let e=window.requestAnimationFrame(()=>{Te.current&&(Te.current.scrollTop=Te.current.scrollHeight)});return()=>window.cancelAnimationFrame(e)},[Ye.length,E,Ze]);let Qe=(0,z.useMemo)(()=>{if(g?.kind===`settings`)return null;if(g?.kind===`attention`)return{kind:`attention`,item:Jd(g.item,a.attentionHistory??a.userTodos)};if(g?.kind===`goal`){let e=Re.find(e=>e.goalId===g.item.goalId);return e?{item:e,kind:`goal`}:g}if(g?.kind!==`run`)return g;let e=Ge.find(e=>e.kind===`run`&&e.run.runId===g.item.runId);return e?{item:e.run,kind:`run`}:g},[Ge,g,Re,a.attentionHistory,a.userTodos]);(0,z.useEffect)(()=>{if(o){ye({}),xe([]);return}let e=!1;return Promise.all([Zg(),c_()]).then(([t,n])=>{e||(ye(Object.fromEntries(t.map(e=>[e.goal_id,e.repository]))),xe(n))}).catch(()=>{}),()=>{e=!0}},[o]),(0,z.useEffect)(()=>{if(!me)return;function e(e){e.key===`Escape`&&he(!1)}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[me]),(0,z.useEffect)(()=>{if(R||!Ge.length)return;if(!Se.current){Se.current=!0;try{Ce.current=Date.parse(window.localStorage.getItem(`loopx-pw-last-visit`)??``),window.localStorage.setItem(`loopx-pw-last-visit`,new Date().toISOString())}catch{Ce.current=NaN}}let e=Ce.current,t=Ge.filter(e=>e.kind===`run`).map(e=>e.run),n=t=>{let n=Date.parse(t??``);return!Number.isNaN(e)&&!Number.isNaN(n)&&n>e},r={attention:ze,done:t.filter(e=>e.status===`completed`&&n(e.latestActivity)).length,failed:t.filter(e=>(e.status===`failed`||e.status===`interrupted`)&&n(e.latestActivity)).length};je(e=>e?.attention===r.attention&&e.done===r.done&&e.failed===r.failed?e:r)},[Ge,ze,R]),(0,z.useEffect)(()=>{if(o){C({});return}let e=!1;return Uh(R?{goalId:R}:{contextKind:`manager`}).then(t=>{if(e)return;let n=t.filter(e=>[`preview_ready`,`gated`,`deferred`,`applying`].includes(e.status)||Iy(e).retryOriginal===!0||e.action_kind===`operation.execute`&&e.status===`applied`).map(e=>jS(e,d)),r=Object.fromEntries(n.map(e=>[e.previewId,e]));C(e=>({...e,...r})),R||pe(n.map(e=>e.previewId))}).catch(()=>{}),()=>{e=!0}},[o,R,d]);async function $e(e,n={}){if(o)throw Error(d(`source.readOnlyWriteError`));let r;try{r=t.onPreviewAction?await t.onPreviewAction(e):jS(await Vh(e),d)}catch(t){if(!(t instanceof Ih)||t.payload.error_code!==`action_preview_gate`)throw t;let n=t.payload.gate&&typeof t.payload.gate==`object`?t.payload.gate:{},i=(Array.isArray(n.candidates)?n.candidates:[]).flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return typeof t.workspace_ref==`string`&&typeof t.label==`string`?[{label:t.label,workspaceRef:t.workspace_ref}]:[]}),a=String(n.kind??`workspace_selection_required`),o=a===`agent_binding_required`||a===`agent_identity_selection_required`;r={actionKind:e.actionKind,fields:i.map(e=>({key:`workspace_ref:${e.workspaceRef}`,label:e.label,value:e.workspaceRef})),gate:{kind:a,nextAction:typeof n.next_action==`string`?n.next_action:void 0,summary:String(n.summary??d(`proposal.workspaceGate.defaultSummary`))},impact:d(o?`proposal.workspaceGate.agentImpact`:`proposal.workspaceGate.selectionImpact`),previewId:`workspace-choice-${Date.now().toString(36)}`,sourceRequest:e,status:`gated`,title:d(o?`proposal.workspaceGate.agentTitle`:`proposal.workspaceGate.selectionTitle`),workspaceCandidates:i}}return de(e=>e.includes(r.previewId)?e:[...e,r.previewId]),C(e=>({...e,[r.previewId]:r})),n.select!==!1&&_({item:r,kind:`proposal`}),r}function et(){ut(null),Fe(`manager:${Me}`,d(`composer.createGoalTemplate`)),window.requestAnimationFrame(()=>we.current?.focus())}async function tt(e,n){he(!1);let r={delete:`Deleted from the owner workspace`,resume:`Resumed from the owner workspace`,stop:`Stopped from the owner workspace`},i={delete:d(`proposal.summary.lifecycleDelete`,{title:e.title}),resume:d(`proposal.summary.lifecycleResume`,{title:e.title}),stop:d(`proposal.summary.lifecycleStop`,{title:e.title})},a=null,o=!1;try{if(n===`stop`){if(Oe.current.has(e.goalId))return;Oe.current.add(e.goalId),I(new Set(Oe.current)),_(null),a={goalId:e.goalId,next:`stopped`,optimisticApplied:!0,previous:e.activationState},F(d(`feedback.applying`,{title:i.stop})),t.onGoalActivationStateChange?.(e.goalId,`stopped`)}if(t.onExecuteGoalLifecycle){if(n===`delete`)throw Error(`The selected status source does not authorize Goal deletion.`);let a=await t.onExecuteGoalLifecycle({goalId:e.goalId,operation:n,reason:r[n]});if(!a.projectionVerified)throw Error(`Goal lifecycle projection did not verify.`);o=!0,t.onGoalActivationStateChange?.(e.goalId,a.activationState),F(d(`feedback.completed`,{title:i[n]})),n===`stop`&&ut(null),await at([e.goalId]);return}let s=await $e({actionKind:`goal.lifecycle`,context:{kind:`goal_directory`,goal_id:e.goalId},idempotencyKey:`workspace-goal-${n}-${e.goalId}-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e.goalId,operation:n,reason:r[n]},summary:i[n]},{select:n!==`stop`});if(s.goalId!==e.goalId||s.lifecycleOperation!==n)throw _(null),Error(d(`actionReview.targetChanged`));n===`stop`&&(s.reviewPlan?.interaction===`direct`?(o=!0,await ot(s,{lifecycleProjection:a??void 0,presentation:`feedback`})):(a&&t.onGoalActivationStateChange?.(a.goalId,a.previous),F(s.gate?d(`feedback.gateRequired`,{summary:s.gate.summary}):d(`feedback.notCompleted`,{status:s.status})),_({item:s,kind:`proposal`})))}catch(e){a&&!o&&t.onGoalActivationStateChange?.(a.goalId,a.previous),F(d(`feedback.executionFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{n===`stop`&&(Oe.current.delete(e.goalId),I(new Set(Oe.current)))}}function nt(e,t){Ie(d(t?e===`heartbeat`?`composer.heartbeatTemplate`:`composer.monitorTemplate`:e===`heartbeat`?`composer.heartbeatTemplateWithoutGoal`:`composer.monitorTemplateWithoutGoal`)),_(null),window.requestAnimationFrame(()=>we.current?.focus())}async function rt(e,n,r=``){let i=await t.onRequestScheduleConfig?.(e,n);if(i){de(e=>e.includes(i.previewId)?e:[...e,i.previewId]),C(e=>({...e,[i.previewId]:i})),_({item:i,kind:`proposal`});return}if(!n){Ie(d(e===`heartbeat`?`composer.heartbeatGoalQuestion`:`composer.monitorGoalQuestion`));return}let a=Date.now().toString(36);await $e({actionKind:e===`heartbeat`?`heartbeat.bind`:`monitor.create`,context:{kind:`schedule`,goal_id:n},idempotencyKey:`workspace-${e}-${n}-${a}`,normalizedParameters:e===`heartbeat`?{agent_id:Me,cadence:IS(r),goal_id:n,stop_condition:zS(r),timezone:`Asia/Shanghai`}:{agent_id:Me,cadence:IS(r),goal_id:n,stop_condition:zS(r),target:RS(r,d),target_key:`goal-${n}`,timezone:`Asia/Shanghai`},summary:e===`heartbeat`?d(`proposal.summary.heartbeat`):d(`proposal.summary.monitor`,{target:RS(r,d)})})}async function it(e){if(!ke.current.has(e.todoId)){ke.current.add(e.todoId),L(new Set(ke.current)),F(d(`feedback.preparingPreview`,{title:e.text}));try{await $e({actionKind:`todo.update`,context:{goal_id:e.goalId,kind:`todo`,todo_id:e.todoId},idempotencyKey:`workspace-todo-${e.todoId}-complete-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e.goalId,operation:`complete`,todo_id:e.todoId},summary:d(`tasks.markComplete`,{name:e.text})}),F(null)}catch(e){F(d(`feedback.previewFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{ke.current.delete(e.todoId),L(new Set(ke.current))}}}function at(e){let n=t.onReconcileStatus,r=n?n({invalidateGoalIds:e}):t.onRefresh?.();return Promise.resolve(r).catch(()=>{F(d(`feedback.goalRefreshFailed`))})}async function ot(e,n={}){let r=e.actionKind===`team.plan`&&e.status===`error`&&[`apply_failed`,`readback_unverified`].includes(e.reviewPlan?.reason??``);if(e.reviewPlan&&!e.reviewPlan.canApply&&!r)return;let i=n.presentation!==`feedback`,o=e.actionKind===`goal.lifecycle`&&e.goalId&&(e.lifecycleOperation===`stop`||e.lifecycleOperation===`resume`)?{goalId:e.goalId,next:e.lifecycleOperation===`stop`?`stopped`:`active`,optimisticApplied:!1,previous:a.goals.find(t=>t.goalId===e.goalId)?.activationState??(e.lifecycleOperation===`stop`?`active`:`stopped`)}:null,s=n.lifecycleProjection??o;F(d(`feedback.applying`,{title:e.title}));let c={...e,reviewPlan:e.reviewPlan?{...e.reviewPlan,interaction:`pending`,reason:`apply_pending`,canApply:!1}:void 0,status:`applying`};C(t=>({...t,[e.previewId]:c})),i&&_({item:c,kind:`proposal`}),s&&!s.optimisticApplied&&t.onGoalActivationStateChange?.(s.goalId,s.next);try{if(t.onApplyProposal){await t.onApplyProposal(e);let n={...e,status:`applied`};C(t=>({...t,[e.previewId]:n})),i&&_({item:n,kind:`proposal`}),F(d(`feedback.completed`,{title:e.title})),e.actionKind===`goal.lifecycle`&&((e.lifecycleOperation===`stop`||e.lifecycleOperation===`delete`)&&ut(null),e.lifecycleOperation===`delete`&&e.goalId&&t.onGoalDeleted?.(e.goalId),at(e.goalId?[e.goalId]:void 0));return}let n=await Wh(e.previewId);if(n.proposal.proposal_id!==e.previewId||n.proposal.action_kind!==e.actionKind||e.actionKind===`goal.lifecycle`&&(n.proposal.normalized_parameters.goal_id!==e.goalId||AS(n.proposal)!==e.lifecycleOperation))throw new Ih(d(`actionReview.targetChanged`),{error_code:`action_response_mismatch`});let r=jS(n.proposal,d);if(C(t=>({...t,[e.previewId]:r})),i&&_({item:r,kind:`proposal`}),r.reviewPlan?.interaction!==`completed`){s&&t.onGoalActivationStateChange?.(s.goalId,s.previous),_({item:r,kind:`proposal`}),F(n.proposal.status===`stale`?d(`feedback.stale`):d(`actionReview.${r.reviewPlan.reason}`));return}F(d(`feedback.completed`,{title:r.title})),r.actionKind===`todo.create`&&await t.onRefresh?.(),r.actionKind===`goal.lifecycle`&&(r.lifecycleOperation===`stop`||r.lifecycleOperation===`delete`)&&ut(null),r.actionKind===`goal.lifecycle`&&r.lifecycleOperation===`delete`&&r.goalId&&t.onGoalDeleted?.(r.goalId),r.actionKind===`goal.lifecycle`&&at(r.goalId?[r.goalId]:void 0)}catch(n){if(s&&t.onGoalActivationStateChange?.(s.goalId,s.previous),n instanceof Ih&&n.payload.error_code===`protected_action`){let r=n.payload.gate,i=r&&typeof r==`object`?r:{},a={...e,reviewPlan:e.reviewPlan?{...e.reviewPlan,interaction:`gated`,reason:`authority_gate`,canApply:!1}:void 0,gate:{kind:String(i.kind??`protected_action`),nextAction:typeof i.next_action==`string`?i.next_action:void 0,summary:String(i.summary??n.message)},status:`gated`};C(t=>({...t,[e.previewId]:a})),_({item:a,kind:`proposal`}),F(d(`feedback.gateRequired`,{summary:a.gate.summary})),e.actionKind===`goal.create`&&e.goalId&&(t.onRefresh?.(),ut(e.goalId));return}let r=n instanceof Ih&&Ly(n.payload),i=n instanceof Ih&&n.payload.error_code===`action_response_mismatch`,a={...e,reviewPlan:e.reviewPlan?{...e.reviewPlan,interaction:r?`refresh`:`repair`,reason:i?`readback_unverified`:r?`stale_proposal`:`apply_failed`,canApply:!1}:void 0,errorMessage:n instanceof Error?n.message:String(n),status:r?`stale`:`error`};C(t=>({...t,[e.previewId]:a})),_({item:a,kind:`proposal`}),F(d(`feedback.executionFailed`,{error:a.errorMessage}))}}function st(){T(`chat`),x(null),te(!1),window.requestAnimationFrame(()=>{let e=Te.current?.querySelectorAll(`.personal-message.is-assistant`);e?.item(e.length-1)?.scrollIntoView({block:`start`})})}let ct={...t,onOpenRunSession:async e=>{e.goalId!==R&&ut(e.goalId),T(`chat`),await t.onOpenRunSession?.(e),x(e),_(null)},onOpenGoal:e=>{ut(e),at([e])},onOpenGoalView:e=>{e===`chat`?st():T(e),_(null)},onOpenOutput:e=>{e.goalId!==R&&ut(e.goalId),T(`files`),t.onOpenOutput?.(e)},onApplyProposal:ot,onCancelProposal:async e=>{_(null),C(t=>{let n={...t};return delete n[e.previewId],n});try{t.onCancelProposal?.(e),t.onCancelProposal||await Gh(e.previewId)}catch(t){C(t=>({...t,[e.previewId]:e})),F(d(`feedback.cancelFailed`,{error:t instanceof Error?t.message:String(t)}))}},onTransitionProposal:async(e,t)=>{let n=jS(await Kh(e.previewId,t),d);de(e=>e.includes(n.previewId)?e:[...e,n.previewId]),C(r=>{let i={...r};return t===`regenerate`&&delete i[e.previewId],i[n.previewId]=n,i}),_({item:n,kind:`proposal`})},onSelectWorkspaceCandidate:async(e,t)=>{e.sourceRequest&&(C(t=>{let n={...t};return delete n[e.previewId],n}),await $e({...e.sourceRequest,idempotencyKey:`${e.sourceRequest.idempotencyKey}-${t}`,normalizedParameters:{...e.sourceRequest.normalizedParameters,workspace_ref:t}}))},onPreviewAction:$e,onRequestScheduleConfig:(e,t)=>nt(e,t),onOpenNotificationSettings:e=>Ve({goalId:e,kind:`settings`,tab:`lark`}),onFetchNotificationTargets:()=>hg(),onSetupGoalChannel:e=>_g(e),onToggleGoalAutoNotify:e=>vg(e),onUpdateSchedule:async(e,t)=>{let n=Date.now().toString(36),r=e.scheduleKind===`heartbeat`;await $e({actionKind:r?`heartbeat.bind`:`monitor.update`,context:{kind:`schedule`,goal_id:e.goalId},idempotencyKey:`workspace-monitor-${e.scheduleId}-${t}-${n}`,normalizedParameters:{agent_id:e.agentId??Me,...!r&&t===`run_now`?{endpoint_id:Me}:{},...t===`edit`?{cadence:`2h`,...r?{timezone:e.timezone??`Asia/Shanghai`}:{}}:{},goal_id:e.goalId,operation:t,...!r&&t===`run_now`&&e.sessionId?{session_id:e.sessionId}:{},...r?{}:{todo_id:e.scheduleId}},summary:t===`pause`?`暂停自动运行:${e.label}`:t===`resume`?`恢复自动运行:${e.label}`:t===`run_now`?`立即运行:${e.label}`:t===`stop`?`停止自动运行:${e.label}`:`编辑自动运行生命周期:${e.label}`})}},lt=o?{onOpenGoal:ct.onOpenGoal,onOpenGoalView:ct.onOpenGoalView,onOpenOutput:ct.onOpenOutput}:ct;function ut(e){p(e),D(!1),k(!1),te(!1),x(null),_(null),T(`tasks`),he(!1),t.onSelectGoal?.(e)}function dt(e){h(e),t.onSelectAgent?.(e)}function ft(e){_e(e),_S(e)}async function pt(n){let r=n?[]:N,i=(n??Pe).trim()||(r.length?d(`composer.imageAnalysisPrompt`):``);if(!(!i||M)){n||(Ie(``),P([])),ie(null),ne(!0);try{if(r.length){R?w!==`chat`&&te(!0):k(!0);let e=await t.onSendMessage?.(i,Me,R,r);e&&await $e(e);return}let n=Eb(i,{agents:e.map(e=>({agentId:e.agentId,label:e.label})),goalId:R,todos:(V?.agentTodos??[]).map(e=>({text:e.text,todoId:e.todoId}))});if(n.route===`clarify`){Ie(i);let e=d(`composer.clarifySingleAction`);n.missingFields.includes(`resume_when`)&&(e=d(`composer.clarifyDefer`)),F(e);return}if(n.actionKind===`goal.create`){let e=FS(i,d),t=MS(e.title);await $e({actionKind:`goal.create`,context:{kind:`manager`,goal_id:null,natural_language:i},idempotencyKey:`workspace-goal-intent-${t}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:Me,completion_criteria:e.completionCriteria,execution_boundary:e.executionBoundary,goal_id:t,heartbeat:{cadence:IS(i),enabled:n.normalizedParameters.heartbeat_enabled===!0,timezone:`Asia/Shanghai`},initial_todos:e.initialTodos,objective:e.objective,permission:e.permission,stop_condition:zS(i),title:e.title,workspace_ref:`current`},summary:d(`proposal.summary.goalCreate`,{title:e.title})});return}if(R&&n.actionKind===`heartbeat.bind`){await rt(`heartbeat`,R,i);return}if(R&&n.actionKind===`monitor.create`){let e=LS(i,d);if(e){Ie(i),F(e);return}await rt(`monitor`,R,i);return}let a=BS(i,e);if(R&&a&&n.actionKind===`agent.bind`){await $e({actionKind:`agent.bind`,context:{kind:`goal`,goal_id:R,natural_language:i},idempotencyKey:`workspace-agent-bind-${R}-${a.agentId}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:a.agentId,goal_id:R},summary:`将 ${a.label} 绑定到 ${V?.title??R}`});return}if(R&&n.actionKind===`todo.create`){if(n.normalizedParameters.start_execution===!0){await $e({actionKind:`todo.create`,context:{kind:`goal`,goal_id:R,natural_language:i},idempotencyKey:`workspace-task-start-${R}-${Date.now().toString(36)}`,normalizedParameters:{endpoint_id:a?.agentId??Me,goal_id:R,start_execution:!0,text:i},summary:`交给 Agent 执行:${i.slice(0,120)}`});return}let e=a?.agentId??(/(交给|分配给|让).{0,24}(agent|codex|claude|kiro|kimi)/iu.test(i)?Me:null);await $e({actionKind:`todo.create`,context:{kind:`goal`,goal_id:R,natural_language:i},idempotencyKey:`workspace-todo-create-${R}-${Date.now().toString(36)}`,normalizedParameters:{...e?{endpoint_id:e}:{},goal_id:R,text:VS(i)},summary:`创建 Todo:${VS(i)}`});return}let o=V?.agentTodos.find(e=>i.includes(e.todoId)||i.includes(e.text)),s=typeof n.normalizedParameters.operation==`string`?n.normalizedParameters.operation:null;if(R&&o&&n.actionKind===`todo.update`&&s){await $e({actionKind:`todo.update`,context:{kind:`todo`,goal_id:R,todo_id:o.todoId,natural_language:i},idempotencyKey:`workspace-todo-update-${o.todoId}-${s}-${Date.now().toString(36)}`,normalizedParameters:{agent_id:Me,...s===`reassign`&&a?{endpoint_id:a.agentId}:{},...s===`block`?{note:i}:{},...s===`defer`&&typeof n.normalizedParameters.resume_when==`string`?{resume_when:n.normalizedParameters.resume_when}:{},goal_id:R,operation:s,todo_id:o.todoId},summary:`更新 Todo:${o.text}`});return}R?w!==`chat`&&te(!0):k(!0);let c=await t.onSendMessage?.(i,Me,R);c&&await $e(c)}catch(e){n||(Ie(i),P(r));let t=e instanceof Error?e.message:d(`feedback.sendGenericError`);F(d(`feedback.sendFailed`,{error:t}))}finally{ne(!1)}}}let mt=e.find(e=>e.agentId===Me)?.label??Me,ht=!V&&Pe.startsWith(d(`composer.createGoalDraftLead`)),gt=Ge.filter(e=>e.kind===`run`&&!!e.run.sessionId&&!!e.run.canInterrupt&&(e.run.status===`running`||e.run.status===`queued`)).length;async function _t(e){if(!e?.length)return;let t=WS-N.length,n=Array.from(e).slice(0,Math.max(0,t)),r=n.find(e=>!HS.has(e.type)),i=n.find(e=>e.size>US);if(t<=0){ie(d(`composer.imageCountError`,{count:WS}));return}if(r){ie(d(`composer.imageTypeError`));return}if(i){ie(d(`composer.imageSizeError`,{size:US/1024/1024}));return}try{let t=await Promise.all(n.map(e=>GS(e,d)));P(e=>[...e,...t].slice(0,WS)),ie(e.length>n.length?d(`composer.imageCountError`,{count:WS}):null)}catch(e){ie(e instanceof Error?e.message:d(`composer.imageReadGenericError`))}finally{De.current&&(De.current.value=``)}}function vt(e){let t=Array.from(e.clipboardData.items).filter(e=>e.kind===`file`&&e.type.startsWith(`image/`)).flatMap(e=>{let t=e.getAsFile();return t?[t]:[]});t.length&&(e.preventDefault(),_t(t))}async function yt(){let e=await c_();xe(e)}async function bt(){await Promise.all([yt(),t.onRefresh?.()])}async function xt(){if(!(!t.onRefresh||ce===`loading`)){le(`loading`);try{await t.onRefresh(),le(`done`)}catch{le(`error`)}window.setTimeout(()=>le(`idle`),1800)}}let St=Ue?(0,B.jsx)(pS,{callbacks:lt,focusGoalConnection:!!(g?.kind===`settings`&&g.goalId),goalNotifications:a.goalNotifications??[],goals:Re,initialGoalId:g?.kind===`settings`?g.goalId??R:R,initialTab:g?.kind===`settings`?g.tab??`lark`:`lark`,onChanged:()=>void bt(),onClose:He,onThemeChange:ft,theme:ge}):null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{hidden:Ue,children:(0,B.jsx)(vS,{drawer:Qe?(0,B.jsx)(Fb,{agents:e,attentionHistory:a.attentionHistory??a.userTodos,onSelectAttention:e=>_({kind:`attention`,item:e}),callbacks:lt,goalNotifications:a.goalNotifications??[],goals:Re,inspectorExpanded:v,larkConnections:o?[]:be,onClose:()=>{Qe.kind===`proposal`&&[`applied`,`rejected`].includes(Qe.item.status)&&(Qe.item.actionKind!==`heartbeat.bind`||Qe.item.status!==`applied`)&&C(e=>{let t={...e};return delete t[Qe.item.previewId],t}),y(!1),_(null)},onToggleInspectorSize:()=>y(e=>!e),readOnly:o,runs:Ge.flatMap(e=>e.kind===`run`?[e.run]:[]),selection:Qe}):null,drawerMode:Qe?.kind===`todo`?v?`inspector-full`:`inspector`:`panel`,drawerOpen:Qe!==null,mobileSidebarOpen:me,onCloseMobileSidebar:()=>he(!1),theme:ge,main:(0,B.jsxs)(`div`,{className:`personal-channel`,children:[(0,B.jsx)(ib,{agents:e,managerChatOpen:E,managerChannelBinding:r,managerRuntime:i,mobileNavigationOpen:me,onOpenGoalCapabilities:V&&!o?()=>Ve({goalId:V.goalId,kind:`settings`,tab:`capabilities`}):void 0,onRefresh:t.onRefresh?()=>void xt():void 0,onOpenNavigation:()=>he(!0),onOpenManagerChat:()=>{k(!1),D(!0)},onSelectGoalTab:e=>{e===`chat`?st():T(e)},onSelectAgent:dt,onReturnManagerHome:()=>{D(!1),k(!1),window.requestAnimationFrame(()=>Te.current?.scrollTo({behavior:`smooth`,top:0}))},selectedAgentId:Me,refreshState:ce,readOnlySourceLabel:o?l?.activeSource.label:void 0,selectedGoal:V,selectedGoalTab:w}),(0,B.jsxs)(`div`,{className:`personal-channel-scroll`,"data-active-goal-view":V?w:void 0,ref:Te,children:[!V&&!E&&Ae&&Ae.done+Ae.failed+Ae.attention>0?(0,B.jsxs)(`section`,{className:`personal-digest-card`,"aria-label":d(`digest.away`),children:[(0,B.jsx)(`strong`,{children:d(`digest.away`)}),(0,B.jsxs)(`div`,{className:`personal-digest-stats`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{children:Ae.done}),d(`digest.completed`)]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{children:Ae.failed}),d(`digest.failed`)]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{children:Ae.attention}),d(`digest.needsYou`)]})]})]}):null,!V&&!E?(0,B.jsxs)(`section`,{className:`personal-manager-greeting`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)(rm,{size:20})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:d(`home.greeting`)}),(0,B.jsx)(`p`,{children:a.goals.some(e=>e.activationState===`active`&&e.loadState)?d(`startup.partial`):(0,B.jsxs)(B.Fragment,{children:[d(`home.waitingCount`,{count:ze}),` `,d(`home.blockingSummary`,{count:Be})]})})]})]}):null,V?.loadState?(0,B.jsx)(`section`,{className:`personal-manager-greeting`,role:`status`,"data-testid":`goal-status-loading`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:d(V.loadState===`error`?`startup.goalError`:`startup.goalLoading`)}),(0,B.jsx)(`p`,{children:d(V.loadError?`startup.error.${V.loadError}`:`startup.independent`)}),V.loadState===`error`?(0,B.jsx)(`button`,{className:`min-h-11 rounded-md border px-3 py-2 text-sm`,type:`button`,onClick:()=>void t.onRefresh?.(),children:d(`startup.retry`)}):null]})}):V?(0,B.jsx)(Tx,{activeTab:w,scrollRef:Te,panels:{overview:(0,B.jsx)(wx,{active:!Ue&&w===`overview`,goal:V,items:Ge,userTodos:a.userTodos,readOnly:o,onOpenDetails:()=>_({kind:`goal`,item:V}),onSelect:_,onView:T}),tasks:(0,B.jsx)(sx,{historyEnabled:!o,goal:V,items:Ge,onDraftTaskFromMessage:o?void 0:e=>{Ie(`创建一个 Task:${yS(e)}`),F(d(`feedback.taskDraftCreated`)),window.requestAnimationFrame(()=>we.current?.focus())},onOpenChat:st,onQuickComplete:o?void 0:it,onSelect:_,quickCompletingTodoIds:se,selectedTodoId:Qe?.kind===`todo`?Qe.item.todoId:null,userTodos:a.userTodos}),files:(0,B.jsx)(CS,{items:Ge.filter(e=>e.kind===`output`),onSelect:_,reportState:a.periodicReports}),chat:(0,B.jsxs)(B.Fragment,{children:[V&&b?.goalId===V.goalId?(0,B.jsx)(TS,{onClose:()=>x(null),onOpenDetails:()=>_({item:b,kind:`run`}),run:b}):null,(0,B.jsx)(_b,{items:Ke,onSelect:_,selectedGoal:V})]})}},`${l?.activeSource.statusUrl??`/status.json`}:${V.goalId}`):E?(0,B.jsx)(_b,{items:Ye,onSelect:_,selectedGoal:null}):(0,B.jsx)(SS,{goals:Re,onRetry:()=>void t.onRefresh?.(),onSelectGoal:ut,systemHealth:a.systemHealth})]}),(0,B.jsx)(`div`,{className:`personal-composer-wrap`,children:o?(0,B.jsxs)(`div`,{className:`personal-read-only-notice`,children:[(0,B.jsx)(`strong`,{children:d(`source.readOnlyNoticeTitle`)}),(0,B.jsx)(`span`,{children:d(`source.readOnlyNoticeDescription`)})]}):(0,B.jsxs)(B.Fragment,{children:[!V&&!E&&O&&qe.length?(0,B.jsx)(wS,{messages:qe,onClose:()=>k(!1),onOpenConversation:()=>{k(!1),D(!0)}}):null,V&&w!==`chat`&&ee&&Je.length?(0,B.jsx)(wS,{agentLabel:mt,messages:Je,onClose:()=>te(!1),onDraftTask:w===`tasks`?e=>{Ie(`创建一个 Task:${yS(e)}`),F(d(`feedback.taskDraftCreated`)),window.requestAnimationFrame(()=>we.current?.focus())}:void 0,onOpenConversation:st,title:`${V.title} · ${mt}`}):null,ae?(0,B.jsxs)(`div`,{className:`personal-action-feedback`,role:`status`,children:[(0,B.jsx)(`span`,{children:ae}),(0,B.jsx)(`button`,{"aria-label":d(`common.closeActionReceipt`),onClick:()=>F(null),type:`button`,children:(0,B.jsx)(oh,{size:14})})]}):null,(0,B.jsx)(`p`,{className:`personal-composer-hint`,children:V?gt>0?d(`composer.goalRunningHint`,{agent:mt,count:gt}):d(`composer.goalMessageHint`,{agent:mt}):d(`composer.managerMessageHint`)}),V?(0,B.jsxs)(`div`,{className:`personal-quick-prompts`,children:[(0,B.jsxs)(`button`,{"aria-label":d(`composer.nextAction`),disabled:M,onClick:()=>void pt(d(`composer.nextActionPrompt`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(Nm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.nextAction`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.agentProgress`),disabled:M,onClick:()=>void pt(d(`composer.agentProgressPrompt`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(qm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.agentProgress`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.monitor`),disabled:M,onClick:()=>void pt(d(`composer.monitorShortcutTemplate`,{target:d(`schedule.defaultTarget`)})),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(am,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.monitor`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.blockers`),disabled:M||!Le(`gate`),onClick:()=>void pt(Le(`gate`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(um,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.blockers`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.evidence`),disabled:M||!Le(`evidence`),onClick:()=>void pt(Le(`evidence`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(Sm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.evidence`)})]})]}):(0,B.jsxs)(`div`,{className:`personal-quick-prompts`,children:[(0,B.jsxs)(`button`,{"aria-label":d(`composer.globalTasks`),disabled:M,onClick:()=>void pt(d(`composer.globalTasksPrompt`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(Nm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.globalTasks`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.globalProgress`),disabled:M,onClick:()=>void pt(d(`composer.globalProgressPrompt`)),title:d(`composer.sendMessageHint`),type:`button`,children:[(0,B.jsx)(qm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.globalProgress`)})]}),(0,B.jsxs)(`button`,{"aria-label":d(`composer.createGoal`),onClick:et,title:d(`composer.createGoalHint`),type:`button`,children:[(0,B.jsx)(Vm,{size:13}),(0,B.jsx)(`span`,{children:d(`composer.createGoal`)})]})]}),ht?(0,B.jsxs)(`div`,{className:`personal-goal-draft-status`,role:`status`,children:[(0,B.jsx)(`strong`,{children:d(`composer.createGoalDraft`)}),(0,B.jsx)(`span`,{children:d(`composer.createGoalDraftDescription`)})]}):null,N.length?(0,B.jsx)(`div`,{className:`personal-composer-images`,"aria-label":d(`composer.imagesPending`),children:N.map(e=>(0,B.jsxs)(`figure`,{children:[(0,B.jsx)(`img`,{alt:e.name,src:e.dataUrl}),(0,B.jsx)(`button`,{"aria-label":d(`composer.sentImageAlt`,{name:e.name}),onClick:()=>P(t=>t.filter(t=>t.id!==e.id)),type:`button`,children:(0,B.jsx)(oh,{size:13})})]},e.id))}):null,re?(0,B.jsx)(`p`,{className:`personal-composer-error`,role:`alert`,children:re}):null,(0,B.jsxs)(`div`,{className:`personal-channel-composer`,onDragOver:e=>{[...e.dataTransfer.items].some(e=>e.kind===`file`&&e.type.startsWith(`image/`))&&e.preventDefault()},onDrop:e=>{let t=[...e.dataTransfer.files].filter(e=>e.type.startsWith(`image/`));t.length&&(e.preventDefault(),_t(t))},children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(rm,{size:17}),e.find(e=>e.agentId===Me)?.label??Me]}),(0,B.jsx)(`button`,{"aria-label":d(`composer.addImage`),className:`personal-composer-attach`,disabled:M||N.length>=WS,onClick:()=>De.current?.click(),title:d(`composer.attachImageHint`),type:`button`,children:(0,B.jsx)(Rm,{size:17})}),(0,B.jsx)(`input`,{accept:`image/png,image/jpeg,image/webp,image/gif`,"aria-label":d(`composer.imagePicker`),className:`personal-composer-file-input`,disabled:M||N.length>=WS,multiple:!0,onChange:e=>void _t(e.target.files),ref:De,type:`file`}),(0,B.jsx)(`textarea`,{"aria-label":d(`composer.sendMessage`),onChange:e=>Ie(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),pt())},onPaste:vt,placeholder:V?d(`composer.goalPlaceholder`,{goal:V.title}):d(`composer.managerPlaceholder`),ref:we,rows:1,value:Pe}),(0,B.jsx)(`button`,{"aria-label":d(ht?`composer.createGoal`:`composer.send`),disabled:!Pe.trim()&&N.length===0||M,onClick:()=>void pt(),title:d(ht?`composer.createGoalHint`:`composer.sendMessageHint`),type:`button`,children:(0,B.jsx)(qm,{size:18})})]})]})})]}),sidebar:(0,B.jsx)(rx,{attentionCount:ze,goals:Re,goalArchiveLoadState:n,goalLifecycleOperations:t.onExecuteGoalLifecycle?[`stop`,`resume`]:void 0,lifecycleBusyGoalIds:oe,onRequestGoalCreate:o?void 0:et,onRequestGoalLifecycle:o&&!t.onExecuteGoalLifecycle?void 0:(e,t)=>void tt(e,t),onRetryGoalArchive:t.onRetryGoalArchive||t.onRefresh?()=>void(t.onRetryGoalArchive??t.onRefresh)?.():void 0,onOpenSettings:o?void 0:()=>Ve({kind:`settings`}),onSelectGoal:ut,selectedGoalId:R,statusSourceControl:l},l?.activeSource.statusUrl??`/status.json`)})}),St]})}function qS(e){return(e??``).replace(/\s+/gu,` `).trim()}function JS(e,t=120){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t-1).join(``)}…`}function YS(e,t,n){let r=qS(e);return!r||r===`暂无`?n?t(n):``:/refresh-state|latest_run|latest run-derived/iu.test(r)?t(`projection.refreshState`):/first read-only adapter tick|read-only adapter/iu.test(r)?t(`projection.firstReadOnlyAdapterCheck`):/todo update recorded for/iu.test(r)?t(`projection.todoStatusUpdated`):/^(loopx|python3|npm|git|run)\s|\s--[a-z0-9-]+|\b[a-z]+_[a-z_]+\b/iu.test(r)?t(n??`projection.agentPreparingNextStep`):JS(r)}function XS(e,t){return t({advancing:`projection.agentAdvancingGoal`,idle:`projection.agentIdle`,needs_you:`projection.agentNeedsDecision`,stopped:`projection.agentStopped`,waiting_external:`projection.agentWaitingExternal`}[e])}function ZS({eventCount:e,hasArtifact:t,hasLatestValidation:n},r){return{label:r(n?`projection.latestValidation`:`projection.latestRun`),metadata:e>0?r(`projection.events24h`,{count:e}):r(t?`projection.runEvidenceAvailable`:`projection.publicSafeProjection`)}}var QS=`/status.json`,$S=`loopx-status-source-catalog-v1`,eC={id:`local`,kind:`local`,label:`本机`,readOnly:!1,statusUrl:QS};function tC(e,t){let n=dh(e,t).source;if(!n||!n.isLoopback||n.isRelative)return{error:`SSH 隧道来源必须使用显式的 localhost、127.0.0.1 或 ::1 URL。`};let r=new URL(n.url,t);return[`http:`,`https:`].includes(r.protocol)?{url:r.toString()}:{error:`状态来源只支持 HTTP 或 HTTPS。`}}function nC(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return`ssh-${(t>>>0).toString(36)}`}function rC(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return null;let n=e;if(n.kind!==`ssh_tunnel`||typeof n.label!=`string`||typeof n.statusUrl!=`string`)return null;let r=n.label.trim(),i=tC(n.statusUrl,t);if(!r||r.length>48||!(`url`in i))return null;let a=qb(n.hostAlias)?n.hostAlias.trim():void 0;return{...a?{hostAlias:a}:{},id:nC(i.url),kind:`ssh_tunnel`,label:r,readOnly:!0,statusUrl:i.url}}function iC(){return{schemaVersion:1,sources:[eC]}}function aC(e,t){try{let n=e.getItem($S);if(!n)return iC();let r=JSON.parse(n);if(r.schemaVersion!==1||!Array.isArray(r.sources))return iC();let i=new Set([eC.statusUrl]);return{schemaVersion:1,sources:[eC,...r.sources.flatMap(e=>{let n=rC(e,t);return!n||i.has(n.statusUrl)?[]:(i.add(n.statusUrl),[n])})]}}catch{return iC()}}function oC(e,t){e.setItem($S,JSON.stringify({schemaVersion:1,sources:t.sources.filter(e=>e.kind===`ssh_tunnel`)}))}function sC(e,t){let n=new Set(t.filter(qb).map(e=>e.trim())),r=!1,i=e.sources.map(e=>e.kind!==`ssh_tunnel`||e.hostAlias||!n.has(e.label)?e:(r=!0,{...e,hostAlias:e.label}));return r?{...e,sources:i}:e}function cC(e,t,n){let r=t.label.trim();if(!r)return{error:`请填写来源名称。`};if(r.length>48)return{error:`来源名称不能超过 48 个字符。`};let i=tC(t.statusUrl,n);if(!(`url`in i))return i;if(e.sources.some(e=>e.statusUrl===i.url))return{error:`这个状态 URL 已经在来源目录中。`};if(t.hostAlias!==void 0&&!qb(t.hostAlias))return{error:`请选择有效的 SSH Host。`};let a=t.hostAlias?.trim(),o={...a?{hostAlias:a}:{},id:nC(i.url),kind:`ssh_tunnel`,label:r,readOnly:!0,statusUrl:i.url};return{catalog:{...e,sources:[...e.sources,o]},source:o}}function lC(e,t){return{...e,sources:e.sources.filter(e=>e.kind===`local`||e.id!==t)}}function uC(e,t,n){if(!t.trim()||dh(t,n).source?.isRelative)return eC;let r=t.trim();try{r=new URL(r,n).toString()}catch{return null}return e.sources.find(e=>e.statusUrl===r)??null}function dC(e,t,n){return uC(e,t,n)||(dh(t,n).source?.isRelative?eC:{id:`temporary`,kind:`ssh_tunnel`,label:`临时来源`,readOnly:!0,statusUrl:t.trim()})}function fC(e,t,n,r){return dC(e,t??n,r)}var pC={delete:`删除`,deploy:`部署`,merge:`合并`,payment:`付款`,release:`发布`};function mC(e,t,n){let r=t.replace(/\s+/gu,` `).trim().toLowerCase(),i=n.target.replace(/\s+/gu,` `).trim().toLowerCase();return!i||!r.includes(i)?null:{actionKind:`goal.update`,context:{goal_id:e,kind:`goal`,natural_language:t,semantic_proposal:{operation:n.operation,target:n.target}},idempotencyKey:`workspace-semantic-protected-${e}-${Date.now().toString(36)}`,normalizedParameters:{goal_id:e,status:`operator_gate_requested`},summary:`请求受保护操作:${pC[n.operation]} · ${n.target}`}}var hC=QS;async function gC(e){let t=await fetch(e,{cache:`no-store`,signal:AbortSignal.timeout(3e4)});if(!t.ok)throw Error(`HTTP ${t.status} while loading ${e}`);return Ap(await t.json())}function _C(e,t){if(t?.controller_readiness?.decision_advisor_ready||t?.controller_readiness?.write_controller_ready)return`controller_ready`;if(t?.controller_readiness)return`controller_gated`;if(t?.human_reward)return`reward_judged`;if(t?.operator_gate?.decision===`approve`)return`operator_approved`;if(t?.operator_gate)return`operator_gated`;let n=e||t?.classification||``;return n===`connected_without_run`?`connected`:n===`read_only_project_map`||t?.project_map?`mapped`:n===`state_refreshed`?`refreshed`:n&&n!==`no_status`?`adapter_inspected`:`registered`}function vC(e,t){let n=new Map(t.map(e=>[e.goal_id,e])),r=new Set,i=e.map(e=>{r.add(e.id);let t=n.get(e.id),i=e.latest_runs[0],a=t?.lifecycle_phase??e.lifecycle_phase??i?.lifecycle_phase??_C(t?.status??i?.classification??e.status,i),o=t?.lifecycle_flags?.length?t.lifecycle_flags:e.lifecycle_flags?.length?e.lifecycle_flags:i?.lifecycle_flags?.length?i.lifecycle_flags:[a];return{goal:e,queueItem:t,latestRun:i,status:t?.status??i?.classification??e.status??`no_status`,waitingOn:t?.waiting_on??`clear`,severity:t?.severity??`clear`,lifecyclePhase:a,lifecycleFlags:o}});for(let e of t)r.has(e.goal_id)||i.push({goal:{activation_state:e.activation_state,id:e.goal_id,status:e.status,display_name:e.goal_id,latest_runs:[],lifecycle_flags:[e.lifecycle_phase??`registered`],registry_member:!0,legacy_runtime_goal:!1,index_exists:!1,raw_index_records:0,unique_runs:0},queueItem:e,status:e.status,waitingOn:e.waiting_on,severity:e.severity,lifecyclePhase:e.lifecycle_phase??`registered`,lifecycleFlags:e.lifecycle_flags??[`registered`]});return i}function yC(e){return(e??``).replace(/\s+/g,` `).trim()}function bC(e,t=132){let n=yC(e);return n.length<=t?n:`${n.slice(0,Math.max(0,t-1))}…`}function xC(e){let t=new Map;for(let n of e?.goals??[])t.set(n.goal_id,n);return t}function SC(e,t){return e===void 0||t===void 0?void 0:e+t}function CC(e,t){if(!e)return null;let n=t===`user`?e.queueItem?.project_asset?.user_todos:e.queueItem?.project_asset?.agent_todos;if(n?.items?.length)return{done_count:n.done??n.items.filter(e=>e.done).length,items:n.items,open_count:n.open??n.items.filter(e=>!e.done).length,total_count:n.total??n.items.length};let r=t===`user`?e.queueItem?.user_todos:e.queueItem?.agent_todos;return r?.items?.length?r:null}function wC(e){return e?.items.find(e=>!e.done)}function TC(e,t,n=`todos`){return e?.items?.length?{advancement_done_count:e.advancement_done_count??t?.advancement_done_count,done_count:e.done??e.items.filter(e=>e.done).length,items:e.items,open_count:e.open??e.items.filter(e=>!e.done).length,total_count:e.total??e.items.length}:t??null}function EC(e){return e?.queueItem?.project_asset?.quota?.state??e?.queueItem?.quota?.state??e?.goal.quota?.state??`waiting`}function DC(e,t,n){let r=[];for(let t of e){let e=CC(t,`agent`);for(let n of e?.items??[])r.push({goalId:t.goal.id,role:`agent`,todo:n})}let i=new Map;for(let e of r){let t=e.todo.claimed_by||`codex`,n=i.get(t)??[];n.push(e),i.set(t,n)}let a=new Map((n?.agents??[]).map(e=>[e.agent_id,e]));return Array.from(new Set([...i.keys(),...a.keys()])).map(e=>{let t=i.get(e)??[],n=a.get(e),r=Array.from(new Set([...t.map(e=>e.goalId),n?.current_todo?.goal_id,...n?.goal_ids??[]].filter(Boolean))),o=(t.filter(e=>!e.todo.done)[0]??t[0])?.goalId??n?.current_todo?.goal_id??r[0]??``,s=n?.last_activity_at??null;return{agentId:e,claimedTodos:t,currentTodo:n?.current_todo??null,evidenceRefs:[],goalIds:r,handoffNote:null,lastActivity:s,nextSafeAction:n?.next_action?.trim()||`Inspect status projection before taking work`,primaryGoalId:o,quotaHints:[],staleClaimHint:null,status:{label:`可用`,summary:`正常运行`,variant:`success`},workspaceRef:null}})}function OC(e){return e?.map(e=>({dataUrl:e.data_url,id:e.id,mimeType:e.mime_type,name:e.name,size:e.size}))}var kC=`loopx.personal-agent-selection.v1`;function AC(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(kC)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[0]==`string`&&typeof e[1]==`string`))}catch{return{}}}var jC={需修复:`danger`,等你:`warning`,等待条件:`info`,推进中:`success`,安静运行:`neutral`,已停止:`neutral`,已完成:`neutral`};function MC(e,t){return yC(t)||e.replace(/^loopx[-_]/i,`LoopX `).split(/[-_]+/).filter(Boolean).map((e,t)=>t===0?`${e.slice(0,1).toUpperCase()}${e.slice(1)}`:e).join(` `)}function NC(e){return e.split(/\r?\n/u).filter(e=>!/^\s*GOAL_(STATUS|PROGRESS)\s*:/u.test(e)).map(e=>/^\s*GOAL_EVIDENCE\s*:/u.test(e)?e.replace(/^\s*GOAL_EVIDENCE\s*:/u,`验证依据:`):/^\s*NEXT_ACTION\s*:/u.test(e)?e.replace(/^\s*NEXT_ACTION\s*:/u,`下一步:`):e).join(` `).trim()}function PC(e,t){return[`agent`,`assistant`].includes(e.trim().toLowerCase())&&t.trim().length>0}var FC=`已发现的项目 Agent`;function IC(e){switch(Cy(e)){case`codex`:return`Codex`;case`claude`:return`Claude Code`;case`kiro`:return`Kiro CLI`;case`trae`:return`Trae CLI Agent`;case`coco`:return`Coco Agent`;default:return MC(e)}}function LC(e,t){switch(wy(e,t)){case`codex`:return`代码与项目执行`;case`claude`:return`复杂分析与长任务`;case`openai`:case`anthropic`:return`管家问答 · 无工具`;case`kiro`:return`终端编码 · 原生 /goal 循环`;case`trae`:return`前端与交互实现`;case`coco`:return`通用任务`;default:return FC}}function RC(e,t){let n=e.project_asset;return t===`user`?TC(n?.user_todos,e.user_todos,`project_asset.user_todos`):TC(n?.agent_todos,e.agent_todos,`project_asset.agent_todos`)}function zC(e){return bC(e.title??e.text,112)}function BC(e){let t=e.resume_condition?.resume_receipt;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.receipt_id;return typeof n==`string`&&n.trim()?n.trim():null}function VC(e,t){return{resumeWhen:e.resume_when??null,resumeReady:e.resume_ready??null,resumeReceiptId:BC(e),claimedBy:e.claimed_by??null,done:e.status!==`deferred`&&e.done,evidence:e.evidence?bC(e.evidence,96):null,index:e.index,priority:e.priority??null,status:e.status??null,taskClass:e.task_class??null,taskDomain:e.task_domain??null,text:zC(e),todoId:e.todo_id?.trim()||`${t.goal.id}:agent:${e.index}`}}function HC(e){let t=e.queueItem?.agent_todos,n=t?.items??e.queueItem?.project_asset?.agent_todos?.items??[],r=new Map(n.map(t=>[t.todo_id?.trim()||`${e.goal.id}:agent:${t.index}`,t]));for(let n of t?.deferred_items??[]){let t=n.todo_id?.trim()||`${e.goal.id}:agent:${n.index}`;r.has(t)||r.set(t,n)}return[...r.values()]}function UC(e){return HC(e).map(t=>VC(t,e))}function WC(e,t,n){let r=new Map;for(let n of e.todo_index?.items??[]){if(n.goal_id!==t.goal.id||n.role!==`agent`)continue;let e=VC(n,t);r.set(e.todoId,e)}for(let e of n)r.has(e.todoId)||r.set(e.todoId,e);let i=new Map;for(let e of r.values()){if(e.done||e.taskClass!==`advancement_task`)continue;let t=e.taskDomain?.trim();t&&i.set(t,(i.get(t)??0)+1)}return[...i].map(([e,t])=>({domain:e,matchingTodoCount:t}))}function GC(e,t){return{claimedBy:e.claimed_by??null,done:e.status===`done`||e.status===`completed`,index:-1,priority:e.priority??null,status:e.status??null,taskClass:e.task_class??null,text:bC(e.title,112),todoId:e.todo_id?.trim()||`${t.goal.id}:agent:${e.claimed_by??`unknown`}:current`}}function KC(e,t,n){let r=new Map(e.map(e=>[e.todoId,e]));for(let e of t){let t=e.currentTodo;if(!t||t.goal_id!==n.goal.id)continue;let i=GC(t,n);r.has(i.todoId)||r.set(i.todoId,i)}return[...r.values()]}function qC(e){let t=e.queueItem?.project_asset?.agent_todos,n=e.queueItem?.agent_todos,r=HC(e),i=t?.advancement_done_count??n?.advancement_done_count??t?.done??n?.done_count??null,a=r.filter(e=>e.done&&e.status!==`deferred`).length,o=Math.max(i??0,a),s=new Set(r.map(e=>e.todo_id?.trim()).filter(e=>!!e)),c=(t?.recent_completed_advancement_items??[]).filter(e=>!e.todo_id?.trim()||!s.has(e.todo_id.trim())).map(t=>VC(t,e)),l=r.find(e=>!e.done);return{doneTodoCount:o,nextTodoText:yC(t?.next??``)||(l?yC(l.title??``)||yC(l.text??``):``)||null,recentCompleted:c}}function JC(e,t){let n=yC(e);return n?/\b(state_file|registry_goal|authority_sources|source_registry)\b|\b[a-z_]+\s+\d+\/\d+/i.test(n)?t(`projection.goalVerified`):YS(n,t,`projection.validationRecorded`):``}function YC(e,t=4){if(e.length<=t)return e;let n=e.findIndex(e=>!e.done);if(n<0)return e.slice(-t);let r=Math.max(0,Math.min(n-2,e.length-t));return e.slice(r,r+t)}function XC(e,t,n){let r=t.queueItem?.project_asset?.latest_validation,i=t.latestRun,a=e.event_ledger_summary?.goals.find(e=>e.goal_id===t.goal.id);if(!r&&!i&&!a)return null;let o=[JC(r?.summary,n),YS(i?.health_check,n),YS(i?.recommended_action,n)].find(e=>e!==``&&e!==`暂无`)??n(`projection.runRecorded`),s=ZS({eventCount:a?.events_24h??0,hasArtifact:!!(i?.json_exists||i?.markdown_exists),hasLatestValidation:!!r},n);return{generatedAt:r?.generated_at??i?.generated_at??a?.latest_event_at??``,label:s.label,metadata:s.metadata,runId:i?`${t.goal.id}:${i.generated_at}`:null,safePreview:[o,s.metadata].filter(Boolean).join(` -`),summary:o,todoId:t.queueItem?.project_asset?.agent_todos?.items.find(e=>!e.done)?.todo_id??null}}function ZC(e){return[e.status,e.goal.status,e.latestRun?.classification,e.lifecyclePhase].filter(Boolean).some(e=>/(^|[_\s-])(done|complete|completed|finished|terminal|closed|success)([_\s-]|$)/i.test(e??``))}function QC(e,t){return e.global_registry?.findings?.find(e=>e.severity===`high`&&(e.goal_id===t.goal.id||e.goal_ids.includes(t.goal.id)))}function $C(e){return[e.status,e.goal.status,e.latestRun?.classification,e.lifecyclePhase].filter(Boolean).some(e=>/(^|[_\s-])(failure|failed|error|broken|unhealthy|blocked[_\s-]?health|health[_\s-]?blocked)([_\s-]|$)/i.test(e??``))}function ew(e,t){let n=t.queueItem?.stale_latest_run_warning;return t.severity===`high`||!!QC(e,t)||!!(n?.requires_refresh_state||n?.severity===`high`)||$C(t)}function tw(e,t){let n=QC(e,t);return t.queueItem?.stale_latest_run_warning?.recommended_action??t.queueItem?.stale_latest_run_warning?.reason??n?.recommended_action??n?.message??t.queueItem?.recommended_action??t.latestRun?.recommended_action??null}function nw(e){let t=e.latestRun?.operator_gate,n=t?.decision?.trim().toLowerCase()??``,r=new Set([`approve`,`approved`,`reject`,`rejected`,`defer`,`deferred`,`cancel`,`cancelled`]),i=[e.queueItem?.recommended_action,e.latestRun?.recommended_action].filter(Boolean).join(` `),a=/(?:等待|需要)(?:用户|你|owner).{0,24}(?:批准|确认|授权|补充|选择|决定)|(?:批准|确认|授权).{0,16}(?:后|才能|方可)/i.test(i);return!!(t&&!r.has(n))||e.lifecyclePhase===`operator_gated`&&!r.has(n)||a}function rw(e,t){let n=e.latestRun?.operator_gate;return YS(n?.operator_question??n?.reason_summary??n?.follow_up??e.queueItem?.recommended_action??e.latestRun?.recommended_action,t,`projection.confirmAgentDecision`)}function iw(e,t){if(t.goal.activation_state===`stopped`)return`已停止`;let n=CC(t,`user`),r=CC(t,`agent`),i=!!wC(n),a=!!wC(r);return[`user_or_controller`,`controller`].includes(t.waitingOn)||i||nw(t)?`等你`:ew(e,t)?`需修复`:t.waitingOn===`external_evidence`?`等待条件`:EC(t)===`eligible`||a?`推进中`:ZC(t)?`已完成`:`安静运行`}function aw(e,t,n,r){if(n===`已停止`)return XS(`stopped`,r);if(n===`需修复`)return YS(tw(e,t),r,`projection.statusRefreshNeeded`);if(n===`等你`)return XS(`needs_you`,r);if(n===`推进中`){let e=[(CC(t,`agent`)?.items??[]).filter(e=>!e.done).flatMap(e=>[e.title,e.text]).map(e=>yC(e)).find(e=>e!==``&&e!==`暂无`),t.queueItem?.recommended_action,t.latestRun?.recommended_action].map(e=>yC(e)).find(e=>e!==``&&e!==`暂无`);return e?YS(e,r,`projection.agentAdvancingGoal`):XS(`advancing`,r)}return XS(n===`等待条件`?`waiting_external`:`idle`,r)}function ow(e,t){return t.some(t=>e.includes(t))}function sw(e,t,n){if(t.goals.some(e=>e.activationState===`active`&&e.loadState))return{text:`Goal 状态尚未全部加载,暂不能给出完整统计。可先打开已加载的 Goal,失败项可重试。`,lines:[]};if(ow(n,[`Agent`,`agent`,`推进`,`在做`])){let e=t.goals.filter(e=>![`安静运行`,`已完成`,`已停止`].includes(e.state)),n=(e.length>0?e:t.goals).slice(0,3);return n.length===0?{text:`当前状态里还没有 Goal 可供汇总。`,lines:[]}:{text:e.length>0?`Agent 当前关注这些 Goal:`:`当前 Goal 都比较安静:`,lines:n.map(e=>`${e.title} · ${e.state} · ${e.agentSentence}`)}}if(ow(n,[`现在`,`下一步`,`我该`,`该做什么`,`优先处理`])){let e=t.userTodos[0];if(e)return{text:e.blocking?`先处理「${MC(e.goalId)}」:${e.text}`:`当前最先处理「${MC(e.goalId)}」:${e.text}`,lines:[]};let n=t.goals.find(e=>e.state===`需修复`);if(n)return{text:`没有待办,但这个 Goal 需要先修复。`,lines:[`${n.title} · ${n.agentSentence}`]};let r=t.goals.find(e=>e.state===`推进中`);return r?{text:`目前不需要你介入,Agent 正在推进。`,lines:[`${r.title} · ${r.agentSentence}`]}:{text:`当前系统很安静,没有需要你立即处理的事项。`,lines:[]}}if(ow(n,[`等我`,`阻塞`,`需要我`,`全局待办`]))return t.userTodos.length===0?{text:`目前没有 Goal 在等你,开放用户待办为 0。`,lines:[]}:{text:`有 ${t.userTodos.length} 项开放用户待办,阻塞项优先:`,lines:t.userTodos.slice(0,3).map(e=>`${MC(e.goalId)} · ${e.blocking?`阻塞`:`待处理`} · ${e.text}`)};if(ow(n,[`状态`,`异常`,`修复`,`健康`])){let n=t.systemHealth?!t.systemHealth.ok:!e.ok||!e.contract?.ok||!e.global_registry?.ok||(e.global_registry?.summary?.high??0)>0,r=t.goals.filter(e=>e.state===`需修复`),i=r.slice(0,n?2:3).map(e=>`${e.title} · ${e.agentSentence}`);return n&&i.push(`全局状态、契约或注册表健康检查未通过,请进入管理页检查。`),i.length===0?{text:`当前没有发现 Goal 级或全局健康异常。`,lines:[]}:{text:r.length>0?`当前需要关注这些健康问题:`:`Goal 状态正常,但全局健康需要检查:`,lines:i}}return{text:`当前管家支持三类问题:下一步、等待你的事项、Agent 与健康状态。`,lines:[`问“我现在该做什么?”`,`问“哪些 Goal 在等我?”`,`问“Agent 在做什么?”或当前健康状态`]}}function cw(e,t,n,r=!1){let i=new Map(t.map(e=>[e.goal.id,e])),a=new Set(e.run_history.goals.filter(e=>e.activation_state===`stopped`).map(e=>e.id)),o=xC(e.usage_summary),s=DC(t,e.todo_index,e.agent_management_projection),c=e.attention_queue.items.flatMap((e,t)=>{if(a.has(e.goal_id))return[];let n=[`user_or_controller`,`controller`].includes(e.waiting_on);return(RC(e,`user`)?.items??[]).map((r,i)=>({projectedDone:r.done,details:Kd(r),actionKind:r.action_kind??null,blocking:n,goalId:e.goal_id,sourceOrder:t,taskClass:r.task_class??null,text:zC(r),todoId:r.todo_id?.trim()||`${e.goal_id}:user:${r.index}`,todoOrder:i,updatedAt:r.updated_at??null}))}),l=c.filter(e=>!e.projectedDone),u=new Set(l.map(e=>e.goalId)),d=t.flatMap((t,r)=>a.has(t.goal.id)||u.has(t.goal.id)||!nw(t)?[]:[{details:Kd({task_class:`user_gate`,status:`open`,note:t.latestRun?.operator_gate?.reason_summary}),actionKind:`gate.resolve`,blocking:!0,goalId:t.goal.id,sourceOrder:e.attention_queue.items.length+r,taskClass:`user_gate`,text:rw(t,n),todoId:`${t.goal.id}:operator-gate`,todoOrder:0,updatedAt:t.latestRun?.operator_gate?.recorded_at??t.latestRun?.generated_at??null}]),f=[...l,...d].sort((e,t)=>Number(t.blocking)-Number(e.blocking)||e.sourceOrder-t.sourceOrder||e.todoOrder-t.todoOrder),p=e.run_history.goals.flatMap(t=>{if(t.registry_member===!1)return[];let a=i.get(t.id);if(!a)return[];let c=iw(e,a),l=f.find(e=>e.goalId===t.id),u=l?.text??null,d=qC(a),p=t.coordination?.registered_agents??[],m=new Set(p),h=[...s.filter(e=>e.goalIds.includes(t.id)&&!/unassigned|unknown/i.test(e.agentId)&&(m.size===0||m.has(e.agentId))&&(e.currentTodo?.goal_id===t.id||e.claimedTodos.some(e=>e.goalId===t.id)))].sort((e,t)=>(t.lastActivity??``).localeCompare(e.lastActivity??``)),g=new Set(h.map(e=>e.agentId)),_=[...h.map(e=>({agentId:e.agentId,label:e.agentId,lastActivityAt:e.lastActivity,state:e.status.label})),...p.filter(e=>!g.has(e)).map(e=>({agentId:e,label:e,lastActivityAt:null,state:`registered`}))],v=h[0],y=KC(UC(a),h,a),b=[d.nextTodoText,a.queueItem?.recommended_action,a.latestRun?.recommended_action,aw(e,a,c,n)].map(e=>YS(e,n)).find(e=>e!==``&&e!==`暂无`)??n(`projection.nextUpdatePending`);return[{activationState:t.activation_state,agentId:v?.agentId??p[0]??`codex`,agentLaneCount:_.length,agentLanes:_,agentLabel:v?.agentId,agentSentence:aw(e,a,c,n),agentTodos:[...y,...d.recentCompleted],doneTodoCount:d.doneTodoCount,acceptanceObservation:t.acceptance_observation,goalId:t.id,latestActivity:a.latestRun?.generated_at??``,needsYou:u,needsYouActionKind:l?.actionKind??null,needsYouBlocking:l?.blocking??!1,needsYouTaskClass:l?.taskClass??null,needsYouTodoId:l?.todoId??null,nextSentence:b,runEvidence:XC(e,a,n),state:c,...r?{subagentExecution:{allowedDomains:t.spawn_policy?.allowed_domains??[],domainCandidates:WC(e,a,y),enabled:t.spawn_policy?.mode===`multi_subagent`&&t.spawn_policy.spawn_allowed===!0&&t.spawn_policy.max_children>0,maxChildren:t.spawn_policy?.max_children??0,modelConfig:t.spawn_policy?.model_config}}:{},title:MC(t.id,t.display_name),usage:(()=>{let e=o.get(t.id);return e?{costUsd24h:e.cost_usd_24h,costUsd7d:e.cost_usd_7d,durationMs24h:e.duration_ms_24h,durationMs7d:e.duration_ms_7d,tokens24h:SC(e.input_tokens_24h,e.output_tokens_24h),tokens7d:SC(e.input_tokens_7d,e.output_tokens_7d)}:null})()}]}),m=[];if(e.ok||m.push(`状态载荷未标记为正常 (payload.ok === false)`),e.contract&&!e.contract.ok){let t=e.contract.summary,n=t?`${t.errors} 项错误 / ${t.warnings} 项警告`:e.contract.errors?.[0]||`请检查控制面契约`;m.push(`契约检查未通过: ${n}`)}if(e.global_registry){e.global_registry.ok||m.push(`注册表状态异常: ${e.global_registry.summary.high} 项高危`);for(let t of e.global_registry.findings||[])t.severity===`high`&&m.push(`[${t.kind}] ${t.message}`)}let h=e.decision_freshness_summary?.summary?.stale_count?`${e.decision_freshness_summary.summary.stale_count} 项决策状态已过期`:null,g=m.length===0&&!h,_={ok:g,summary:g?`所有控制面契约与注册表检查均正常`:`发现 ${m.length+ +!!h} 项系统健康关注点`,issues:m,freshnessWarning:h};return{blockingTodoCount:f.filter(e=>e.blocking).length,goalNotifications:(e.goal_channel_notification_projection?.goals??[]).map(e=>({goalId:e.goal_id,configured:e.configured,enabled:e.enabled,humanGateAutoNotifyEnabled:e.human_gate_auto_notify_enabled,lastNotifiedAt:e.last_notified_at??null,receiptCount:e.receipt_count,targetRef:e.target_ref??null})),goals:p,openUserTodoCount:f.length,systemHealth:_,attentionHistory:[...c,...d],userTodos:f,visibleUserTodos:f.slice(0,5),workers:(e.agent_management_projection?.agents??[]).map(e=>({agentId:e.agent_id,currentTodoGoalId:e.current_todo?.goal_id??null,currentTodoText:e.current_todo?.title?bC(e.current_todo.title,96):null,lastActivityAt:e.last_activity_at??null,state:e.state??null}))}}function lw({goalArchiveLoadState:e,isLoading:t,onGoalActivationStateChange:n,onGoalDeleted:r,onSelectGoal:i,onReconcileStatus:a,onRefresh:o,onRetryGoalArchive:s,payload:c,progress:l,rows:u,selectedGoalId:d,statusSourceControl:f,theme:p,toggleTheme:m}){let h=f.activeSource.readOnly,g=f.activeSource.kind===`ssh_tunnel`?f.activeSource.hostAlias:void 0,{t:_}=Ji(),[v,y]=(0,z.useState)([]),[b,x]=(0,z.useState)(!1),[S,C]=(0,z.useState)(null),[w,T]=(0,z.useState)(null),E=(0,z.useMemo)(()=>{let e=cw(c,u,_,b);if(!l)return e;let t=Object.values(l.snapshots).map(e=>cw(e,vC(e.run_history.goals,e.attention_queue.items),_,b)),n=new Map(t.flatMap(e=>e.goals).map(e=>[e.goalId,e])),r=e.goals.map(e=>n.get(e.goalId)??{...e,loadError:l.errors[e.goalId],loadState:l.errors[e.goalId]?`error`:`loading`,agentId:``,agentSentence:``,nextSentence:``,subagentExecution:void 0}),i=t.flatMap(e=>e.userTodos),a=r.some(e=>e.activationState===`active`&&e.loadState),o=[...new Set(t.flatMap(e=>e.systemHealth?.issues??[]))];return{...e,goals:r,userTodos:i,attentionHistory:t.flatMap(e=>e.attentionHistory??e.userTodos),visibleUserTodos:i.slice(0,5),openUserTodoCount:i.length,blockingTodoCount:i.filter(e=>e.blocking).length,workers:[...new Map(t.flatMap(e=>e.workers??[]).map(e=>[e.agentId,e])).values()],goalNotifications:t.flatMap(e=>e.goalNotifications??[]),systemHealth:a||t.length===0?void 0:{ok:t.every(e=>e.systemHealth?.ok),issues:o,summary:o.length?`发现 ${o.length} 项系统健康关注点`:`状态检查已完成`,freshnessWarning:t.map(e=>e.systemHealth?.freshnessWarning).filter(Boolean).join(`;`)||null}}},[c,u,l,b,_]),D=E.goals.find(e=>e.goalId===d)??null,O=l?.snapshots[d]??c,[k,ee]=(0,z.useState)(null),[te,A]=(0,z.useState)(null),[j,M]=(0,z.useState)(!1),ne=E.goals.some(e=>e.activationState===`active`&&e.loadState===`loading`)?`loading`:E.goals.map(e=>`${e.goalId}:${e.agentId}`).join(`|`),N=D?.goalId??`manager`;E.goals.some(e=>e.activationState===`active`&&e.loadState)||(E.systemHealth?!E.systemHealth.ok:!c.ok)||E.openUserTodoCount>0&&`${E.openUserTodoCount}${E.blockingTodoCount}`;let P=v.length>0?v.map(e=>({agentId:e.agent_id,adapterKind:e.adapter_kind,available:e.available,capability:LC(e.agent_id,e.adapter_kind),interrupt:e.interrupt,label:e.display_name,location:e.location,resume:e.resume,source:e.source,statusLabel:e.available?`可用`:`需要配置`,streaming:e.streaming,toolCalls:e.tool_calls,trustScope:e.trust_scope})):[{agentId:`codex`,available:!0,capability:LC(`codex`),label:`Codex`,statusLabel:`正在检测`}],re=[...P,{agentId:`status-only`,available:!0,capability:`不调用模型`,adapterKind:`status_projection`,interrupt:!1,label:`仅查状态`,resume:!0,statusLabel:`只读`,streaming:!1,toolCalls:!1,trustScope:`read_only`}],ie=P.find(e=>e.label===`Codex`&&e.available)?.agentId??P.find(e=>e.available)?.agentId??`status-only`,ae=w?.executor_endpoint?.trim()??``,F=ae?P.find(e=>e.agentId===ae)?.agentId:void 0,oe=e=>e===`manager`?F??ie:ie,[I,se]=(0,z.useState)(AC),L=_h(re,I[N]??oe(N),ie),[ce,le]=(0,z.useState)(!1),[ue,de]=(0,z.useState)(!1),[fe,pe]=(0,z.useState)(`chat`),[me,he]=(0,z.useState)(``),[ge,_e]=(0,z.useState)({}),[ve,ye]=(0,z.useState)({}),[be,xe]=(0,z.useState)(null),[Se,Ce]=(0,z.useState)({}),[we,Te]=(0,z.useState)([]),[Ee,De]=(0,z.useState)(null),[Oe,ke]=(0,z.useState)({}),Ae=(0,z.useRef)(1),je=(0,z.useRef)(1),R=(0,z.useRef)(new Map),Me=(0,z.useRef)(new Set),Ne=(0,z.useRef)(new Map),Pe=(0,z.useRef)(new Map),Fe=(0,z.useRef)(new Set),Ie=(0,z.useRef)(new Set),Le=(0,z.useRef)(null),Re=(0,z.useRef)(null),ze=(0,z.useRef)(null),Be=(0,z.useRef)(null);(0,z.useRef)(null);let V=ge[N]??[];ve[N];let Ve=(e,t)=>e===`manager`?_(`header.manager`):t,He=D?E.userTodos.filter(e=>e.goalId===D.goalId):E.userTodos,Ue=D?.agentTodos??[];YC(Ue,D?.needsYou?3:4);let We=Ue.filter(e=>e.done).length,Ge=Ue.length>0?`${We}/${Ue.length}`:`暂无计划`;D&&({...E},He.filter(e=>e.blocking).length,He.length),(0,z.useEffect)(()=>{let e=uh(f.activeSource.statusUrl,window.location.href),t=e.source?mh(O,e.source):null;if(!D||!t?.indexUrl||!t.detailUrl){ee(null),A(null),M(!1);return}let{detailUrl:n,indexUrl:r}=t,i=!1;return ee(null),A(null),M(!0),hh(r,D.goalId).then(async e=>{let t=e.items[0]?.detail_ref;return t?gh(n,t):null}).then(e=>{i||ee(e)}).catch(e=>{i||A(jp(e))}).finally(()=>{i||M(!1)}),()=>{i=!0}},[O,D?.goalId,f.activeSource.statusUrl]);let Ke=D?void 0:Se[N]?.sessionId;(0,z.useEffect)(()=>{if(h||!Ke)return;let e=!1,t,n=async()=>{try{let t=await Zh(Ke);if(e)return;let n=t.messages.filter(e=>e.origin===`manager_followup`);_e(e=>{let r=e[N]??[],i=new Set(r.map(e=>e.sourceMessageId)),a=n.filter(e=>!i.has(e.message_id)),o=new Map(n.map(e=>[e.message_id,e.return_delivery])),s=new Map(t.messages.filter(e=>e.role!==`user`&&e.origin!==`manager_followup`).map(e=>[e.turn_id,e])),c=new Map(t.messages.map(e=>[e.message_id,e.collaboration])),l=!1,u=r.map(e=>{let t=e.sourceMessageId?o.get(e.sourceMessageId):void 0,n=e.sourceTurnId?s.get(e.sourceTurnId):void 0,r=e.sourceMessageId?c.get(e.sourceMessageId):n?.collaboration;return JSON.stringify(t)===JSON.stringify(e.returnDelivery)&&JSON.stringify(r)===JSON.stringify(e.collaboration)?e:(l=!0,{...e,sourceMessageId:e.sourceMessageId??n?.message_id,returnDelivery:t,collaboration:r})});return!a.length&&!l?e:{...e,[N]:[...u,...a.map(e=>({id:Ae.current++,sourceMessageId:e.message_id,role:`assistant`,agentLabel:Ve(N,L.label),sourceLabel:`管家交接回执`,text:NC(e.text),lines:[],returnDelivery:e.return_delivery}))]}})}catch{}finally{e||(t=setTimeout(n,3e3))}};return n(),()=>{e=!0,t&&clearTimeout(t)}},[h,Ke,N,L.label]);function qe(e,t){Ce(n=>{if(t===null){let t={...n};return delete t[e],t}return{...n,[e]:t}})}(0,z.useEffect)(()=>{if(h){y([]),x(!1),C(null),T(null);return}let e=!1;return Jh().then(t=>{if(!e){y(t.adapters??[]);let e=t.manager?.runtime;T(t.manager?.channel_binding??null),C(e?{schema_version:`manager_runtime_session_readback_v0`,runtime_profile:e.runtime_profile,configuration_revision:e.configuration_revision,status:e.status,sandbox:e.sandbox,standing_grant:e.standing_grant,tool_classes:e.tool_classes}:null),x(t.goal_subagent_configuration===`preview_locked`)}}).catch(()=>{e||x(!1)}),()=>{e=!0}},[h]),(0,z.useEffect)(()=>{try{window.localStorage.setItem(kC,JSON.stringify(I))}catch{}},[I]),(0,z.useEffect)(()=>{if(h||!L.available)return;let e=N,t=`${e}:${L.agentId}`,n=D?`goal`:`manager`,r=D?`goal.${D.goalId}`:`manager`,i=!1,a=null,o=null;return(async()=>{try{let s=await eg({agentId:n===`manager`?void 0:L.agentId,channelId:r,goalId:D?.goalId});if(i||(_e(t=>(t[e]?.length??0)>0?t:{...t,[e]:s.messages.map(t=>({sourceMessageId:t.message_id,agentLabel:t.role===`user`?void 0:Ve(e,L.label),attachments:OC(t.attachments),id:Ae.current++,lines:[],role:t.role===`user`?`user`:`assistant`,returnDelivery:t.return_delivery,collaboration:t.collaboration,sourceLabel:t.role===`user`?void 0:t.role===`error`?`本地会话记录`:e===`manager`?`恢复的${_(`header.manager`)}会话`:`恢复的 ${L.label} 会话`,text:t.role===`user`?t.text:NC(t.text)}))}),L.agentId===`status-only`))return;let c=s.sessions[0];if(o=c?.session_id??null,c&&!c.resumable){Me.current.add(t),qe(e,{agentId:L.agentId,resumable:!1,sessionId:c.session_id,status:`resume_failed`});return}let l=n===`manager`?``:D?.goalId??``;if(n===`goal`&&!l)return;let u=await Xh(l,n===`manager`?I[e]:L.agentId,`resume_latest`,n);if(i)return;n===`manager`&&u.session.manager_runtime&&C(u.session.manager_runtime),R.current.set(t,u.session_id);let d=s.snapshots.find(e=>e.session.session_id===u.session_id),f=d?.session.active_turn_id??``;if(qe(e,{agentId:u.agent_id||L.agentId,resumable:!0,sessionId:u.session_id,status:f?`running`:`ready`,turnId:f||void 0}),Me.current.delete(t),!f)return;let p=`${u.session_id}:${f}`;if(Ie.current.has(p))return;Ie.current.add(p),Ne.current.set(e,f),qe(e,{agentId:L.agentId,resumable:!0,sessionId:u.session_id,status:`running`,turnId:f}),xe(e),a=new AbortController,Pe.current.set(e,a);let m=``,h=Je(e,{activity:[`正在恢复进行中的 Agent 回合`],agentLabel:Ve(e,L.label),lines:[],pending:!0,sourceLabel:e===`manager`?`恢复的${_(`header.manager`)}会话`:`恢复的 ${L.label} 会话`,text:``});try{let t=await sg(u.session_id,f,{signal:a.signal,onDelta:t=>{m+=t,Ye(e,h,{text:m})},onActivity:t=>{_e(n=>({...n,[e]:(n[e]??[]).map(e=>e.id===h?{...e,activity:[...new Set([...e.activity??[],t])].slice(-6)}:e)}))}});if(i)return;Ye(e,h,{lines:t.response.gate?[t.response.gate.summary,t.response.gate.next_action].filter(Boolean).slice(0,2):[],pending:!1,text:t.response.message||m.trim()||`${Ve(e,L.label)} 已完成分析。`});let n=E.goals.find(e=>e.goalId===d?.session.goal_id)??D??E.goals[0]??null;if(n&&t.response.proposals.length>0){let r=t.response.proposals.filter(vh).map(e=>({goalId:n.goalId,id:je.current++,previewId:null,proposal:e,receiptLabel:null,state:`candidate`,statusMessage:null}));r.length>0&&ye(t=>({...t,[e]:[...t[e]??[],...r]}))}}catch(t){if(i)return;Ye(e,h,{activity:[],lines:[],pending:!1,reconnect:t instanceof Ih&&t.payload.reconnectable===!0,sourceLabel:`LoopX Chat 本地后端`,text:t instanceof Error?t.message:`无法恢复进行中的 Agent 回合。`})}finally{Ie.current.delete(p),Ne.current.get(e)===f&&Ne.current.delete(e),qe(e,{agentId:L.agentId,resumable:!0,sessionId:u.session_id,status:`ready`}),Pe.current.get(e)===a&&Pe.current.delete(e),i||xe(t=>t===e?null:t)}}catch(n){if(i)return;n instanceof Ih&&n.payload.error_code===`resume_failed`&&(Me.current.add(t),o&&qe(e,{agentId:L.agentId,resumable:!1,sessionId:o,status:`resume_failed`}))}})(),()=>{i=!0,a?.abort()}},[N,E.goals[0]?.goalId,h,D?.goalId,L.agentId,L.available,L.label,I]),(0,z.useEffect)(()=>{if(h||D||E.goals.length===0||ne===`loading`)return;let e=!1;return Promise.all(E.goals.filter(e=>!e.loadState).map(async e=>{let t=await Qh({agentId:e.agentId,channelId:`goal.${e.goalId}`,goalId:e.goalId});return{goalId:e.goalId,session:t.sessions[0]??null}})).then(t=>{e||Ce(e=>{let n={...e};for(let e of t)e.session&&(n[e.goalId]={agentId:e.session.agent_id,resumable:e.session.resumable,sessionId:e.session.session_id,status:e.session.active_turn_id?`running`:e.session.status,turnId:e.session.active_turn_id??void 0});return n})}).catch(()=>{}),()=>{e=!0}},[h,ne,D?.goalId]),(0,z.useEffect)(()=>{if(De(null),h){Te([]),ke({});return}if(!D){Te([]),ke({});return}let e=!1,t=0,n=0;Te([]),ke({});let r=async()=>{if(!e){if(document.hidden){t=window.setTimeout(()=>void r(),1e4);return}try{let t=await Qh({goalId:D.goalId});if(!e){let r=t.sessions.filter(e=>e.channel_id?.startsWith(`task.`));Te(r);let i=await Promise.allSettled(r.map(e=>Zh(e.session_id)));if(!e){let e=i.some(e=>e.status===`rejected`);n=e?n+1:0,De(e?`partial`:null),ke(Object.fromEntries(i.flatMap((e,t)=>e.status===`fulfilled`?[[r[t].session_id,e.value]]:[])))}}}catch{n+=1,e||De(`offline`)}e||(t=window.setTimeout(()=>void r(),Math.min(3e4,2e3*2**Math.min(n,4))))}};return r(),()=>{e=!0,window.clearTimeout(t)}},[h,D?.goalId]),(0,z.useEffect)(()=>{if(!ce)return;let e=window.requestAnimationFrame(()=>{Le.current?.querySelector(`[role="menuitem"]:not(:disabled)`)?.focus()});return()=>{window.cancelAnimationFrame(e),Re.current?.focus()}},[ce]),(0,z.useEffect)(()=>{if(!ue)return;let e=window.requestAnimationFrame(()=>ze.current?.focus());return()=>{window.cancelAnimationFrame(e),Be.current?.focus()}},[ue]),(0,z.useEffect)(()=>{if(!ce&&!ue)return;let e=e=>{e.key===`Escape`&&(le(!1),de(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ce,ue]);function Je(e,t){let n=Ae.current++;return _e(r=>({...r,[e]:[...r[e]??[],{...t,id:n,role:`assistant`}]})),n}function Ye(e,t,n){_e(r=>({...r,[e]:(r[e]??[]).map(e=>e.id===t?{...e,...n}:e)}))}async function Xe(e,t){let n=e.trim();if(!n)return;let r=t&&`goalId`in t?t.goalId??`manager`:N,i=r===`manager`?null:E.goals.find(e=>e.goalId===r)??null,a=t?.agentId?_h(re,t.agentId,ie):L,o=r===`manager`?E:i?{...E,blockingTodoCount:E.userTodos.filter(e=>e.goalId===i.goalId&&e.blocking).length,goals:[i],openUserTodoCount:E.userTodos.filter(e=>e.goalId===i.goalId).length,userTodos:E.userTodos.filter(e=>e.goalId===i.goalId),visibleUserTodos:E.userTodos.filter(e=>e.goalId===i.goalId)}:E,s=Ae.current++;if(_e(e=>({...e,[r]:[...e[r]??[],{attachments:t?.attachments,id:s,lines:[],role:`user`,text:n}]})),he(``),xe(r),a.agentId===`status-only`||!i&&r!==`manager`){let e=sw(O,o,n),t=a.agentId===`status-only`;Je(r,{agentLabel:t?`仅查状态`:`LoopX 管家`,lines:e.lines.slice(0,3),sourceLabel:t?`LoopX 状态投影 · 仅查状态`:`LoopX 状态投影`,text:e.text}),Yh({answer:[e.text,...e.lines.slice(0,3)].filter(Boolean).join(` +`),summary:o,todoId:t.queueItem?.project_asset?.agent_todos?.items.find(e=>!e.done)?.todo_id??null}}function ZC(e){return[e.status,e.goal.status,e.latestRun?.classification,e.lifecyclePhase].filter(Boolean).some(e=>/(^|[_\s-])(done|complete|completed|finished|terminal|closed|success)([_\s-]|$)/i.test(e??``))}function QC(e,t){return e.global_registry?.findings?.find(e=>e.severity===`high`&&(e.goal_id===t.goal.id||e.goal_ids.includes(t.goal.id)))}function $C(e){return[e.status,e.goal.status,e.latestRun?.classification,e.lifecyclePhase].filter(Boolean).some(e=>/(^|[_\s-])(failure|failed|error|broken|unhealthy|blocked[_\s-]?health|health[_\s-]?blocked)([_\s-]|$)/i.test(e??``))}function ew(e,t){let n=t.queueItem?.stale_latest_run_warning;return t.severity===`high`||!!QC(e,t)||!!(n?.requires_refresh_state||n?.severity===`high`)||$C(t)}function tw(e,t){let n=QC(e,t);return t.queueItem?.stale_latest_run_warning?.recommended_action??t.queueItem?.stale_latest_run_warning?.reason??n?.recommended_action??n?.message??t.queueItem?.recommended_action??t.latestRun?.recommended_action??null}function nw(e){let t=e.latestRun?.operator_gate,n=t?.decision?.trim().toLowerCase()??``,r=new Set([`approve`,`approved`,`reject`,`rejected`,`defer`,`deferred`,`cancel`,`cancelled`]),i=[e.queueItem?.recommended_action,e.latestRun?.recommended_action].filter(Boolean).join(` `),a=/(?:等待|需要)(?:用户|你|owner).{0,24}(?:批准|确认|授权|补充|选择|决定)|(?:批准|确认|授权).{0,16}(?:后|才能|方可)/i.test(i);return!!(t&&!r.has(n))||e.lifecyclePhase===`operator_gated`&&!r.has(n)||a}function rw(e,t){let n=e.latestRun?.operator_gate;return YS(n?.operator_question??n?.reason_summary??n?.follow_up??e.queueItem?.recommended_action??e.latestRun?.recommended_action,t,`projection.confirmAgentDecision`)}function iw(e,t){if(t.goal.activation_state===`stopped`)return`已停止`;let n=CC(t,`user`),r=CC(t,`agent`),i=!!wC(n),a=!!wC(r);return[`user_or_controller`,`controller`].includes(t.waitingOn)||i||nw(t)?`等你`:ew(e,t)?`需修复`:t.waitingOn===`external_evidence`?`等待条件`:EC(t)===`eligible`||a?`推进中`:ZC(t)?`已完成`:`安静运行`}function aw(e,t,n,r){if(n===`已停止`)return XS(`stopped`,r);if(n===`需修复`)return YS(tw(e,t),r,`projection.statusRefreshNeeded`);if(n===`等你`)return XS(`needs_you`,r);if(n===`推进中`){let e=[(CC(t,`agent`)?.items??[]).filter(e=>!e.done).flatMap(e=>[e.title,e.text]).map(e=>yC(e)).find(e=>e!==``&&e!==`暂无`),t.queueItem?.recommended_action,t.latestRun?.recommended_action].map(e=>yC(e)).find(e=>e!==``&&e!==`暂无`);return e?YS(e,r,`projection.agentAdvancingGoal`):XS(`advancing`,r)}return XS(n===`等待条件`?`waiting_external`:`idle`,r)}function ow(e,t){return t.some(t=>e.includes(t))}function sw(e,t,n){if(t.goals.some(e=>e.activationState===`active`&&e.loadState))return{text:`Goal 状态尚未全部加载,暂不能给出完整统计。可先打开已加载的 Goal,失败项可重试。`,lines:[]};if(ow(n,[`Agent`,`agent`,`推进`,`在做`])){let e=t.goals.filter(e=>![`安静运行`,`已完成`,`已停止`].includes(e.state)),n=(e.length>0?e:t.goals).slice(0,3);return n.length===0?{text:`当前状态里还没有 Goal 可供汇总。`,lines:[]}:{text:e.length>0?`Agent 当前关注这些 Goal:`:`当前 Goal 都比较安静:`,lines:n.map(e=>`${e.title} · ${e.state} · ${e.agentSentence}`)}}if(ow(n,[`现在`,`下一步`,`我该`,`该做什么`,`优先处理`])){let e=t.userTodos[0];if(e)return{text:e.blocking?`先处理「${MC(e.goalId)}」:${e.text}`:`当前最先处理「${MC(e.goalId)}」:${e.text}`,lines:[]};let n=t.goals.find(e=>e.state===`需修复`);if(n)return{text:`没有待办,但这个 Goal 需要先修复。`,lines:[`${n.title} · ${n.agentSentence}`]};let r=t.goals.find(e=>e.state===`推进中`);return r?{text:`目前不需要你介入,Agent 正在推进。`,lines:[`${r.title} · ${r.agentSentence}`]}:{text:`当前系统很安静,没有需要你立即处理的事项。`,lines:[]}}if(ow(n,[`等我`,`阻塞`,`需要我`,`全局待办`]))return t.userTodos.length===0?{text:`目前没有 Goal 在等你,开放用户待办为 0。`,lines:[]}:{text:`有 ${t.userTodos.length} 项开放用户待办,阻塞项优先:`,lines:t.userTodos.slice(0,3).map(e=>`${MC(e.goalId)} · ${e.blocking?`阻塞`:`待处理`} · ${e.text}`)};if(ow(n,[`状态`,`异常`,`修复`,`健康`])){let n=t.systemHealth?!t.systemHealth.ok:!e.ok||!e.contract?.ok||!e.global_registry?.ok||(e.global_registry?.summary?.high??0)>0,r=t.goals.filter(e=>e.state===`需修复`),i=r.slice(0,n?2:3).map(e=>`${e.title} · ${e.agentSentence}`);return n&&i.push(`全局状态、契约或注册表健康检查未通过,请进入管理页检查。`),i.length===0?{text:`当前没有发现 Goal 级或全局健康异常。`,lines:[]}:{text:r.length>0?`当前需要关注这些健康问题:`:`Goal 状态正常,但全局健康需要检查:`,lines:i}}return{text:`当前管家支持三类问题:下一步、等待你的事项、Agent 与健康状态。`,lines:[`问“我现在该做什么?”`,`问“哪些 Goal 在等我?”`,`问“Agent 在做什么?”或当前健康状态`]}}function cw(e,t,n,r=!1){let i=new Map(t.map(e=>[e.goal.id,e])),a=new Set(e.run_history.goals.filter(e=>e.activation_state===`stopped`).map(e=>e.id)),o=xC(e.usage_summary),s=DC(t,e.todo_index,e.agent_management_projection),c=e.attention_queue.items.flatMap((e,t)=>{if(a.has(e.goal_id))return[];let n=[`user_or_controller`,`controller`].includes(e.waiting_on);return(RC(e,`user`)?.items??[]).map((r,i)=>({projectedDone:r.done,details:Kd(r),actionKind:r.action_kind??null,blocking:n,goalId:e.goal_id,sourceOrder:t,taskClass:r.task_class??null,text:zC(r),todoId:r.todo_id?.trim()||`${e.goal_id}:user:${r.index}`,todoOrder:i,updatedAt:r.updated_at??null}))}),l=c.filter(e=>!e.projectedDone),u=new Set(l.map(e=>e.goalId)),d=t.flatMap((t,r)=>a.has(t.goal.id)||u.has(t.goal.id)||!nw(t)?[]:[{details:Kd({task_class:`user_gate`,status:`open`,note:t.latestRun?.operator_gate?.reason_summary}),actionKind:`gate.resolve`,blocking:!0,goalId:t.goal.id,sourceOrder:e.attention_queue.items.length+r,taskClass:`user_gate`,text:rw(t,n),todoId:`${t.goal.id}:operator-gate`,todoOrder:0,updatedAt:t.latestRun?.operator_gate?.recorded_at??t.latestRun?.generated_at??null}]),f=[...l,...d].sort((e,t)=>Number(t.blocking)-Number(e.blocking)||e.sourceOrder-t.sourceOrder||e.todoOrder-t.todoOrder),p=e.run_history.goals.flatMap(t=>{if(t.registry_member===!1)return[];let a=i.get(t.id);if(!a)return[];let c=iw(e,a),l=f.find(e=>e.goalId===t.id),u=l?.text??null,d=qC(a),p=t.coordination?.registered_agents??[],m=new Set(p),h=[...s.filter(e=>e.goalIds.includes(t.id)&&!/unassigned|unknown/i.test(e.agentId)&&(m.size===0||m.has(e.agentId))&&(e.currentTodo?.goal_id===t.id||e.claimedTodos.some(e=>e.goalId===t.id)))].sort((e,t)=>(t.lastActivity??``).localeCompare(e.lastActivity??``)),g=new Set(h.map(e=>e.agentId)),_=[...h.map(e=>({agentId:e.agentId,label:e.agentId,lastActivityAt:e.lastActivity,state:e.status.label})),...p.filter(e=>!g.has(e)).map(e=>({agentId:e,label:e,lastActivityAt:null,state:`registered`}))],v=h[0],y=KC(UC(a),h,a),b=[d.nextTodoText,a.queueItem?.recommended_action,a.latestRun?.recommended_action,aw(e,a,c,n)].map(e=>YS(e,n)).find(e=>e!==``&&e!==`暂无`)??n(`projection.nextUpdatePending`);return[{activationState:t.activation_state,agentId:v?.agentId??p[0]??`codex`,agentLaneCount:_.length,agentLanes:_,agentLabel:v?.agentId,agentSentence:aw(e,a,c,n),agentTodos:[...y,...d.recentCompleted],doneTodoCount:d.doneTodoCount,acceptanceObservation:t.acceptance_observation,goalId:t.id,latestActivity:a.latestRun?.generated_at??``,needsYou:u,needsYouActionKind:l?.actionKind??null,needsYouBlocking:l?.blocking??!1,needsYouTaskClass:l?.taskClass??null,needsYouTodoId:l?.todoId??null,nextSentence:b,runEvidence:XC(e,a,n),state:c,...r?{subagentExecution:{allowedDomains:t.spawn_policy?.allowed_domains??[],domainCandidates:WC(e,a,y),enabled:t.spawn_policy?.mode===`multi_subagent`&&t.spawn_policy.spawn_allowed===!0&&t.spawn_policy.max_children>0,maxChildren:t.spawn_policy?.max_children??0,modelConfig:t.spawn_policy?.model_config}}:{},title:MC(t.id,t.display_name),usage:(()=>{let e=o.get(t.id);return e?{costUsd24h:e.cost_usd_24h,costUsd7d:e.cost_usd_7d,durationMs24h:e.duration_ms_24h,durationMs7d:e.duration_ms_7d,tokens24h:SC(e.input_tokens_24h,e.output_tokens_24h),tokens7d:SC(e.input_tokens_7d,e.output_tokens_7d)}:null})()}]}),m=[];if(e.ok||m.push(`状态载荷未标记为正常 (payload.ok === false)`),e.contract&&!e.contract.ok){let t=e.contract.summary,n=t?`${t.errors} 项错误 / ${t.warnings} 项警告`:e.contract.errors?.[0]||`请检查控制面契约`;m.push(`契约检查未通过: ${n}`)}if(e.global_registry){e.global_registry.ok||m.push(`注册表状态异常: ${e.global_registry.summary.high} 项高危`);for(let t of e.global_registry.findings||[])t.severity===`high`&&m.push(`[${t.kind}] ${t.message}`)}let h=e.decision_freshness_summary?.summary?.stale_count?`${e.decision_freshness_summary.summary.stale_count} 项决策状态已过期`:null,g=m.length===0&&!h,_={ok:g,summary:g?`所有控制面契约与注册表检查均正常`:`发现 ${m.length+ +!!h} 项系统健康关注点`,issues:m,freshnessWarning:h};return{blockingTodoCount:f.filter(e=>e.blocking).length,goalNotifications:(e.goal_channel_notification_projection?.goals??[]).map(e=>({goalId:e.goal_id,configured:e.configured,enabled:e.enabled,humanGateAutoNotifyEnabled:e.human_gate_auto_notify_enabled,lastNotifiedAt:e.last_notified_at??null,receiptCount:e.receipt_count,targetRef:e.target_ref??null})),goals:p,openUserTodoCount:f.length,systemHealth:_,attentionHistory:[...c,...d],userTodos:f,visibleUserTodos:f.slice(0,5),workers:(e.agent_management_projection?.agents??[]).map(e=>({agentId:e.agent_id,currentTodoGoalId:e.current_todo?.goal_id??null,currentTodoText:e.current_todo?.title?bC(e.current_todo.title,96):null,lastActivityAt:e.last_activity_at??null,state:e.state??null}))}}function lw({goalArchiveLoadState:e,isLoading:t,onGoalActivationStateChange:n,onGoalDeleted:r,onSelectGoal:i,onReconcileStatus:a,onRefresh:o,onRetryGoalArchive:s,payload:c,progress:l,rows:u,selectedGoalId:d,statusSourceControl:f,theme:p,toggleTheme:m}){let h=f.activeSource.readOnly,g=f.activeSource.kind===`ssh_tunnel`?f.activeSource.hostAlias:void 0,{t:_}=Ji(),[v,y]=(0,z.useState)([]),[b,x]=(0,z.useState)(!1),[S,C]=(0,z.useState)(null),[w,T]=(0,z.useState)(null),E=(0,z.useMemo)(()=>{let e=cw(c,u,_,b);if(!l)return e;let t=Object.values(l.snapshots).map(e=>cw(e,vC(e.run_history.goals,e.attention_queue.items),_,b)),n=new Map(t.flatMap(e=>e.goals).map(e=>[e.goalId,e])),r=e.goals.map(e=>n.get(e.goalId)??{...e,loadError:l.errors[e.goalId],loadState:l.errors[e.goalId]?`error`:`loading`,agentId:``,agentSentence:``,nextSentence:``,subagentExecution:void 0}),i=t.flatMap(e=>e.userTodos),a=r.some(e=>e.activationState===`active`&&e.loadState),o=[...new Set(t.flatMap(e=>e.systemHealth?.issues??[]))];return{...e,goals:r,userTodos:i,attentionHistory:t.flatMap(e=>e.attentionHistory??e.userTodos),visibleUserTodos:i.slice(0,5),openUserTodoCount:i.length,blockingTodoCount:i.filter(e=>e.blocking).length,workers:[...new Map(t.flatMap(e=>e.workers??[]).map(e=>[e.agentId,e])).values()],goalNotifications:t.flatMap(e=>e.goalNotifications??[]),systemHealth:a||t.length===0?void 0:{ok:t.every(e=>e.systemHealth?.ok),issues:o,summary:o.length?`发现 ${o.length} 项系统健康关注点`:`状态检查已完成`,freshnessWarning:t.map(e=>e.systemHealth?.freshnessWarning).filter(Boolean).join(`;`)||null}}},[c,u,l,b,_]),D=E.goals.find(e=>e.goalId===d)??null,O=l?.snapshots[d]??c,[k,ee]=(0,z.useState)(null),[te,A]=(0,z.useState)(null),[j,M]=(0,z.useState)(!1),ne=E.goals.some(e=>e.activationState===`active`&&e.loadState===`loading`)?`loading`:E.goals.map(e=>`${e.goalId}:${e.agentId}`).join(`|`),N=D?.goalId??`manager`;E.goals.some(e=>e.activationState===`active`&&e.loadState)||(E.systemHealth?!E.systemHealth.ok:!c.ok)||E.openUserTodoCount>0&&`${E.openUserTodoCount}${E.blockingTodoCount}`;let P=v.length>0?v.map(e=>({agentId:e.agent_id,adapterKind:e.adapter_kind,available:e.available,capability:LC(e.agent_id,e.adapter_kind),interrupt:e.interrupt,label:e.display_name,location:e.location,resume:e.resume,source:e.source,statusLabel:e.available?`可用`:`需要配置`,streaming:e.streaming,toolCalls:e.tool_calls,trustScope:e.trust_scope})):[{agentId:`codex`,available:!0,capability:LC(`codex`),label:`Codex`,statusLabel:`正在检测`}],re=[...P,{agentId:`status-only`,available:!0,capability:`不调用模型`,adapterKind:`status_projection`,interrupt:!1,label:`仅查状态`,resume:!0,statusLabel:`只读`,streaming:!1,toolCalls:!1,trustScope:`read_only`}],ie=P.find(e=>e.label===`Codex`&&e.available)?.agentId??P.find(e=>e.available)?.agentId??`status-only`,ae=w?.executor_endpoint?.trim()??``,F=ae?P.find(e=>e.agentId===ae)?.agentId:void 0,oe=e=>e===`manager`?F??ie:ie,[I,se]=(0,z.useState)(AC),L=_h(re,I[N]??oe(N),ie),[ce,le]=(0,z.useState)(!1),[ue,de]=(0,z.useState)(!1),[fe,pe]=(0,z.useState)(`chat`),[me,he]=(0,z.useState)(``),[ge,_e]=(0,z.useState)({}),[ve,ye]=(0,z.useState)({}),[be,xe]=(0,z.useState)(null),[Se,Ce]=(0,z.useState)({}),[we,Te]=(0,z.useState)([]),[Ee,De]=(0,z.useState)(null),[Oe,ke]=(0,z.useState)({}),Ae=(0,z.useRef)(1),je=(0,z.useRef)(1),R=(0,z.useRef)(new Map),Me=(0,z.useRef)(new Set),Ne=(0,z.useRef)(new Map),Pe=(0,z.useRef)(new Map),Fe=(0,z.useRef)(new Set),Ie=(0,z.useRef)(new Set),Le=(0,z.useRef)(null),Re=(0,z.useRef)(null),ze=(0,z.useRef)(null),Be=(0,z.useRef)(null);(0,z.useRef)(null);let V=ge[N]??[];ve[N];let Ve=(e,t)=>e===`manager`?_(`header.manager`):t,He=D?E.userTodos.filter(e=>e.goalId===D.goalId):E.userTodos,Ue=D?.agentTodos??[];YC(Ue,D?.needsYou?3:4);let We=Ue.filter(e=>e.done).length,Ge=Ue.length>0?`${We}/${Ue.length}`:`暂无计划`;D&&({...E},He.filter(e=>e.blocking).length,He.length),(0,z.useEffect)(()=>{let e=uh(f.activeSource.statusUrl,window.location.href),t=e.source?mh(O,e.source):null;if(!D||!t?.indexUrl||!t.detailUrl){ee(null),A(null),M(!1);return}let{detailUrl:n,indexUrl:r}=t,i=!1;return ee(null),A(null),M(!0),hh(r,D.goalId).then(async e=>{let t=e.items[0]?.detail_ref;return t?gh(n,t):null}).then(e=>{i||ee(e)}).catch(e=>{i||A(jp(e))}).finally(()=>{i||M(!1)}),()=>{i=!0}},[O,D?.goalId,f.activeSource.statusUrl]);let Ke=Se[N]?.sessionId;(0,z.useEffect)(()=>{if(h||!Ke)return;let e=!1,t,n=async()=>{try{let t=await Zh(Ke);if(e)return;let n=t.messages.filter(e=>e.origin===`manager_followup`);_e(e=>{let r=e[N]??[],i=new Set(r.map(e=>e.sourceMessageId)),a=n.filter(e=>!i.has(e.message_id)),o=new Map(n.map(e=>[e.message_id,e.return_delivery])),s=new Map(t.messages.filter(e=>e.role!==`user`&&e.origin!==`manager_followup`).map(e=>[e.turn_id,e])),c=new Map(t.messages.map(e=>[e.message_id,e.collaboration])),l=!1,u=r.map(e=>{let t=e.sourceMessageId?o.get(e.sourceMessageId):void 0,n=e.sourceTurnId?s.get(e.sourceTurnId):void 0,r=e.sourceMessageId?c.get(e.sourceMessageId):n?.collaboration;return JSON.stringify(t)===JSON.stringify(e.returnDelivery)&&JSON.stringify(r)===JSON.stringify(e.collaboration)?e:(l=!0,{...e,sourceMessageId:e.sourceMessageId??n?.message_id,returnDelivery:t,collaboration:r})});return!a.length&&!l?e:{...e,[N]:[...u,...a.map(e=>({id:Ae.current++,sourceMessageId:e.message_id,role:`assistant`,agentLabel:`协作回执`,sourceLabel:`协作回执`,text:NC(e.text),lines:[],returnDelivery:e.return_delivery}))]}})}catch{}finally{e||(t=setTimeout(n,3e3))}};return n(),()=>{e=!0,t&&clearTimeout(t)}},[h,Ke,N,L.label]);function qe(e,t){Ce(n=>{if(t===null){let t={...n};return delete t[e],t}return{...n,[e]:t}})}(0,z.useEffect)(()=>{if(h){y([]),x(!1),C(null),T(null);return}let e=!1;return Jh().then(t=>{if(!e){y(t.adapters??[]);let e=t.manager?.runtime;T(t.manager?.channel_binding??null),C(e?{schema_version:`manager_runtime_session_readback_v0`,runtime_profile:e.runtime_profile,configuration_revision:e.configuration_revision,status:e.status,sandbox:e.sandbox,standing_grant:e.standing_grant,tool_classes:e.tool_classes}:null),x(t.goal_subagent_configuration===`preview_locked`)}}).catch(()=>{e||x(!1)}),()=>{e=!0}},[h]),(0,z.useEffect)(()=>{try{window.localStorage.setItem(kC,JSON.stringify(I))}catch{}},[I]),(0,z.useEffect)(()=>{if(h||!L.available)return;let e=N,t=`${e}:${L.agentId}`,n=D?`goal`:`manager`,r=D?`goal.${D.goalId}`:`manager`,i=!1,a=null,o=null;return(async()=>{try{let s=await eg({agentId:n===`manager`?void 0:L.agentId,channelId:r,goalId:D?.goalId});if(i||(_e(t=>(t[e]?.length??0)>0?t:{...t,[e]:s.messages.map(t=>({sourceMessageId:t.message_id,agentLabel:t.role===`user`?void 0:t.origin===`manager_followup`?`协作回执`:Ve(e,L.label),attachments:OC(t.attachments),id:Ae.current++,lines:[],role:t.role===`user`?`user`:`assistant`,returnDelivery:t.return_delivery,collaboration:t.collaboration,sourceLabel:t.role===`user`?void 0:t.role===`error`?`本地会话记录`:e===`manager`?`恢复的${_(`header.manager`)}会话`:`恢复的 ${L.label} 会话`,text:t.role===`user`?t.text:NC(t.text)}))}),L.agentId===`status-only`))return;let c=s.sessions[0];if(o=c?.session_id??null,c&&!c.resumable){Me.current.add(t),qe(e,{agentId:L.agentId,resumable:!1,sessionId:c.session_id,status:`resume_failed`});return}let l=n===`manager`?``:D?.goalId??``;if(n===`goal`&&!l)return;let u=await Xh(l,n===`manager`?I[e]:L.agentId,`resume_latest`,n);if(i)return;n===`manager`&&u.session.manager_runtime&&C(u.session.manager_runtime),R.current.set(t,u.session_id);let d=s.snapshots.find(e=>e.session.session_id===u.session_id),f=d?.session.active_turn_id??``;if(qe(e,{agentId:u.agent_id||L.agentId,resumable:!0,sessionId:u.session_id,status:f?`running`:`ready`,turnId:f||void 0}),Me.current.delete(t),!f)return;let p=`${u.session_id}:${f}`;if(Ie.current.has(p))return;Ie.current.add(p),Ne.current.set(e,f),qe(e,{agentId:L.agentId,resumable:!0,sessionId:u.session_id,status:`running`,turnId:f}),xe(e),a=new AbortController,Pe.current.set(e,a);let m=``,h=Je(e,{activity:[`正在恢复进行中的 Agent 回合`],agentLabel:Ve(e,L.label),lines:[],pending:!0,sourceLabel:e===`manager`?`恢复的${_(`header.manager`)}会话`:`恢复的 ${L.label} 会话`,text:``});try{let t=await sg(u.session_id,f,{signal:a.signal,onDelta:t=>{m+=t,Ye(e,h,{text:m})},onActivity:t=>{_e(n=>({...n,[e]:(n[e]??[]).map(e=>e.id===h?{...e,activity:[...new Set([...e.activity??[],t])].slice(-6)}:e)}))}});if(i)return;Ye(e,h,{lines:t.response.gate?[t.response.gate.summary,t.response.gate.next_action].filter(Boolean).slice(0,2):[],pending:!1,text:t.response.message||m.trim()||`${Ve(e,L.label)} 已完成分析。`});let n=E.goals.find(e=>e.goalId===d?.session.goal_id)??D??E.goals[0]??null;if(n&&t.response.proposals.length>0){let r=t.response.proposals.filter(vh).map(e=>({goalId:n.goalId,id:je.current++,previewId:null,proposal:e,receiptLabel:null,state:`candidate`,statusMessage:null}));r.length>0&&ye(t=>({...t,[e]:[...t[e]??[],...r]}))}}catch(t){if(i)return;Ye(e,h,{activity:[],lines:[],pending:!1,reconnect:t instanceof Ih&&t.payload.reconnectable===!0,sourceLabel:`LoopX Chat 本地后端`,text:t instanceof Error?t.message:`无法恢复进行中的 Agent 回合。`})}finally{Ie.current.delete(p),Ne.current.get(e)===f&&Ne.current.delete(e),qe(e,{agentId:L.agentId,resumable:!0,sessionId:u.session_id,status:`ready`}),Pe.current.get(e)===a&&Pe.current.delete(e),i||xe(t=>t===e?null:t)}}catch(n){if(i)return;n instanceof Ih&&n.payload.error_code===`resume_failed`&&(Me.current.add(t),o&&qe(e,{agentId:L.agentId,resumable:!1,sessionId:o,status:`resume_failed`}))}})(),()=>{i=!0,a?.abort()}},[N,E.goals[0]?.goalId,h,D?.goalId,L.agentId,L.available,L.label,I]),(0,z.useEffect)(()=>{if(h||D||E.goals.length===0||ne===`loading`)return;let e=!1;return Promise.all(E.goals.filter(e=>!e.loadState).map(async e=>{let t=await Qh({agentId:e.agentId,channelId:`goal.${e.goalId}`,goalId:e.goalId});return{goalId:e.goalId,session:t.sessions[0]??null}})).then(t=>{e||Ce(e=>{let n={...e};for(let e of t)e.session&&(n[e.goalId]={agentId:e.session.agent_id,resumable:e.session.resumable,sessionId:e.session.session_id,status:e.session.active_turn_id?`running`:e.session.status,turnId:e.session.active_turn_id??void 0});return n})}).catch(()=>{}),()=>{e=!0}},[h,ne,D?.goalId]),(0,z.useEffect)(()=>{if(De(null),h){Te([]),ke({});return}if(!D){Te([]),ke({});return}let e=!1,t=0,n=0;Te([]),ke({});let r=async()=>{if(!e){if(document.hidden){t=window.setTimeout(()=>void r(),1e4);return}try{let t=await Qh({goalId:D.goalId});if(!e){let r=t.sessions.filter(e=>e.channel_id?.startsWith(`task.`));Te(r);let i=await Promise.allSettled(r.map(e=>Zh(e.session_id)));if(!e){let e=i.some(e=>e.status===`rejected`);n=e?n+1:0,De(e?`partial`:null),ke(Object.fromEntries(i.flatMap((e,t)=>e.status===`fulfilled`?[[r[t].session_id,e.value]]:[])))}}}catch{n+=1,e||De(`offline`)}e||(t=window.setTimeout(()=>void r(),Math.min(3e4,2e3*2**Math.min(n,4))))}};return r(),()=>{e=!0,window.clearTimeout(t)}},[h,D?.goalId]),(0,z.useEffect)(()=>{if(!ce)return;let e=window.requestAnimationFrame(()=>{Le.current?.querySelector(`[role="menuitem"]:not(:disabled)`)?.focus()});return()=>{window.cancelAnimationFrame(e),Re.current?.focus()}},[ce]),(0,z.useEffect)(()=>{if(!ue)return;let e=window.requestAnimationFrame(()=>ze.current?.focus());return()=>{window.cancelAnimationFrame(e),Be.current?.focus()}},[ue]),(0,z.useEffect)(()=>{if(!ce&&!ue)return;let e=e=>{e.key===`Escape`&&(le(!1),de(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ce,ue]);function Je(e,t){let n=Ae.current++;return _e(r=>({...r,[e]:[...r[e]??[],{...t,id:n,role:`assistant`}]})),n}function Ye(e,t,n){_e(r=>({...r,[e]:(r[e]??[]).map(e=>e.id===t?{...e,...n}:e)}))}async function Xe(e,t){let n=e.trim();if(!n)return;let r=t&&`goalId`in t?t.goalId??`manager`:N,i=r===`manager`?null:E.goals.find(e=>e.goalId===r)??null,a=t?.agentId?_h(re,t.agentId,ie):L,o=r===`manager`?E:i?{...E,blockingTodoCount:E.userTodos.filter(e=>e.goalId===i.goalId&&e.blocking).length,goals:[i],openUserTodoCount:E.userTodos.filter(e=>e.goalId===i.goalId).length,userTodos:E.userTodos.filter(e=>e.goalId===i.goalId),visibleUserTodos:E.userTodos.filter(e=>e.goalId===i.goalId)}:E,s=Ae.current++;if(_e(e=>({...e,[r]:[...e[r]??[],{attachments:t?.attachments,id:s,lines:[],role:`user`,text:n}]})),he(``),xe(r),a.agentId===`status-only`||!i&&r!==`manager`){let e=sw(O,o,n),t=a.agentId===`status-only`;Je(r,{agentLabel:t?`仅查状态`:`LoopX 管家`,lines:e.lines.slice(0,3),sourceLabel:t?`LoopX 状态投影 · 仅查状态`:`LoopX 状态投影`,text:e.text}),Yh({answer:[e.text,...e.lines.slice(0,3)].filter(Boolean).join(` `),contextKind:r===`manager`?`manager`:`goal`,goalId:r===`manager`?void 0:r,question:n}).catch(()=>{}),xe(null);return}let c=`${r}:${a.agentId}`,l=null;try{let e=R.current.get(c);if(!e){let t=Me.current.has(c)?`new`:`resume_latest`,n=r===`manager`?I[r]:a.agentId,o=await Xh(r===`manager`?``:i.goalId,n,t,r===`manager`?`manager`:`goal`);r===`manager`&&o.session.manager_runtime&&C(o.session.manager_runtime),e=o.session_id,R.current.set(c,e),qe(r,{agentId:o.agent_id||a.agentId,resumable:!0,sessionId:e,status:`ready`}),Me.current.delete(c)}let o=``;l=Je(r,{activity:[r===`manager`?`正在连接管家`:`正在连接 Agent`],agentLabel:Ve(r,a.label),lines:[],pending:!0,sourceLabel:r===`manager`?`${_(`header.manager`)} · 跨 Goal`:`${a.label} Agent · ${MC(i.goalId)}`,text:``});let s=(await ag(e,n,{attachments:t?.attachments,signal:(()=>{let e=new AbortController;return Pe.current.set(r,e),e.signal})(),onDelta:e=>{o+=e,l!==null&&Ye(r,l,{text:o})},onActivity:e=>{l!==null&&_e(t=>({...t,[r]:(t[r]??[]).map(t=>t.id===l?{...t,activity:[...new Set([...t.activity??[],e])].slice(-6)}:t)}))},onPhase:(t,n)=>{l!==null&&Ye(r,l,{sourceTurnId:n}),Ne.current.set(r,n),qe(r,{agentId:a.agentId,resumable:!0,sessionId:e,status:`running`,turnId:n})}})).response;Ye(r,l,{lines:s.gate?[s.gate.summary,s.gate.next_action].filter(Boolean).slice(0,2):[],pending:!1,text:NC(s.message||o.trim())||`${Ve(r,a.label)} 已完成分析。`});let u=s.proposals.filter(vh);if(u.length>0&&!i&&Ye(r,l,{lines:[`请进入要修改的 Goal,预览并确认具体变更。`]}),u.length>0&&i){let e=u.map(e=>({goalId:i.goalId,id:je.current++,previewId:null,proposal:e,receiptLabel:null,state:`candidate`,statusMessage:null}));ye(t=>({...t,[r]:[...t[r]??[],...e]}))}if(r!==`manager`&&s.protected_action){let e=mC(r,n,s.protected_action);if(e)return e}}catch(e){if(Fe.current.delete(r)){let e={agentLabel:Ve(r,a.label),lines:[],pending:!1,sourceLabel:r===`manager`?`${_(`header.manager`)}会话`:`${a.label} 会话`,text:`已中断。你可以在当前会话继续发送消息。`};l===null?Je(r,e):Ye(r,l,e);return}let t=e instanceof Ih?e.payload:null;t&&bh(t)&&R.current.delete(c),t?.error_code===`resume_failed`&&(R.current.delete(c),Me.current.add(c),qe(r,{agentId:a.agentId,resumable:!1,sessionId:Se[r]?.sessionId??`resume-failed`,status:`resume_failed`}));let n=t?.gate,i=n&&typeof n==`object`?String(n.summary??``):``,o={agentLabel:Ve(r,a.label),lines:i?[i]:[],pending:!1,reconnect:t?.reconnectable===!0,sourceLabel:`LoopX Chat 本地后端`,text:t?.error_code===`resume_failed`?`原 ${Ve(r,a.label)} 会话无法恢复。本地历史已经保留,请在运行详情里选择“重试恢复”或“开始新 Session”。`:e instanceof Error?e.message:`${Ve(r,a.label)} 会话暂时不可用。`};l===null?Je(r,o):Ye(r,l,o)}finally{Ne.current.delete(r),Pe.current.delete(r);let e=R.current.get(c);e&&qe(r,{agentId:a.agentId,resumable:!0,sessionId:e,status:`ready`}),xe(e=>e===r?null:e)}}async function Ze(e){let t=e?.goalId??N,n=Se[t],r=e?.agentId??n?.agentId??L.agentId,i=`${t}:${r}`,a=e?.sessionId??n?.sessionId??R.current.get(i),o=e?.turnId??n?.turnId??Ne.current.get(t);if(!(!a||!o))try{Fe.current.add(t),await ig(a,o),Pe.current.get(t)?.abort()}catch(e){throw Fe.current.delete(t),e}finally{Ne.current.delete(t),qe(t,{agentId:r,resumable:!0,sessionId:a,status:`ready`}),Pe.current.delete(t),xe(e=>e===t?null:e)}}async function Qe(e){let t=e.goalId,n=`${t}:${e.agentId}`,r=e.sessionId??Se[t]?.sessionId??R.current.get(n);if(r)try{let i=await lg(r);R.current.set(n,r),Me.current.delete(n),qe(t,{agentId:e.agentId,resumable:i.session.resumable,sessionId:r,status:i.session.status})}catch{qe(t,{agentId:e.agentId,resumable:!1,sessionId:r,status:`resume_failed`})}}function $e(e){let t=`${e.goalId}:${e.agentId}`;R.current.delete(t),Me.current.add(t),qe(e.goalId,{agentId:e.agentId,resumable:!0,sessionId:`new-session-pending`,status:`ready`})}async function et(e){let t=`${e.goalId}:${e.agentId}`,n=e.sessionId??Se[e.goalId]?.sessionId??R.current.get(t);n&&n!==`new-session-pending`&&await cg(n),R.current.delete(t),Me.current.add(t),qe(e.goalId,null)}function tt(e){re.some(t=>t.agentId===e&&t.available)&&(se(t=>({...t,[N]:e})),le(!1))}function nt(){i(``),pe(`chat`)}function rt(e){i(e),pe(`chat`)}D&&jC[D.state],D&&(`${L.label}${D.state}`,Ue.length>0&&`${Ge}`,He.length>0&&`${He.length}`),D?.state===`需修复`||!D&&!c.ok?(D&&IC(D.agentId),D?.nextSentence,D?.agentSentence):D?.state===`等你`?(D.needsYouBlocking,D.needsYouBlocking,D.needsYou??D.nextSentence,D.needsYou):(D&&IC(D.agentId),D?.nextSentence);let it=[...!D&&Se.manager?.status===`resume_failed`?[{id:`run:manager:resume-failed`,kind:`run`,run:{agentId:Se.manager.agentId,agentLabel:IC(Se.manager.agentId),canInterrupt:!1,completedSteps:0,goalId:`manager`,goalTitle:`LoopX 管家`,latestActivity:`本地聊天记录已保留,点我查看恢复方式。`,resumable:!1,runId:`manager:resume-failed`,sessionId:Se.manager.sessionId,sessionStatus:`resume_failed`,status:`failed`,title:`上次会话需要恢复`,totalSteps:1,outputs:[]}}]:[],...D?we.map(e=>{let t=e.channel_id?.startsWith(`task.`)?e.channel_id.slice(5):void 0,n=D.agentTodos.find(e=>e.todoId===t),r=!!e.active_turn_id,i=Oe[e.session_id],a=i?.messages.some(e=>PC(e.role,e.text))===!0;return{id:`run:task:${e.session_id}`,kind:`run`,run:{agentId:e.agent_id,agentLabel:IC(e.agent_id),canInterrupt:r,completedSteps:n?.done||a?1:0,goalId:D.goalId,goalTitle:D.title,latestActivity:r?`Agent 正在执行,可进入 Session 查看过程或发送纠偏。`:a?`Agent 已返回结果,点击查看结果与完整运行记录。`:`执行 Session 已保留,可继续纠偏或恢复。`,resumable:e.resumable,runId:e.session_id,sessionId:e.session_id,sessionMessages:i?.messages.map(e=>({createdAt:e.created_at,messageId:e.message_id,role:e.role===`user`?`user`:PC(e.role,e.text)?`assistant`:`error`,text:e.role===`user`?e.text:NC(e.text)})),sessionStatus:a?`completed`:e.status,status:n?.done||a?`completed`:r?`running`:e.status===`resume_failed`?`failed`:`waiting`,title:n?.text??`Agent 执行任务`,todoId:t,totalSteps:1,turnId:e.active_turn_id??void 0}}}):[],...D?[{id:`run:${D.goalId}`,kind:`run`,run:{agentId:Se[D.goalId]?.agentId??D.agentId,agentLabel:IC(Se[D.goalId]?.agentId??D.agentId),canInterrupt:!!Se[D.goalId]?.turnId,completedSteps:D.agentTodos.filter(e=>e.done).length,goalId:D.goalId,goalTitle:D.title,latestActivity:D.agentSentence,resumable:Se[D.goalId]?.resumable??!0,runId:`goal:${D.goalId}`,sessionId:Se[D.goalId]?.sessionId,sessionStatus:Se[D.goalId]?.status,status:Se[D.goalId]?.turnId?`running`:D.state===`需修复`?`failed`:`waiting`,title:D.nextSentence,totalSteps:D.agentTodos.length||1,turnId:Se[D.goalId]?.turnId,outputs:D.runEvidence?[{createdAt:D.runEvidence.generatedAt,kind:`evidence`,outputId:`${D.goalId}:latest-evidence`,title:D.runEvidence.label}]:[]}}]:[],...V.map(e=>({id:`message:${e.id}`,kind:`message`,message:{agentLabel:e.agentLabel,attachments:e.attachments,id:String(e.id),pending:e.pending,returnDelivery:e.returnDelivery,collaboration:e.collaboration,role:e.role,text:e.text||(e.pending?`Agent 正在处理…`:e.lines.join(` `))}})),...(D?[D]:E.goals).flatMap(e=>e.runEvidence?[{id:`output:${e.goalId}:${e.runEvidence.generatedAt||`latest`}`,kind:`output`,output:{agentLabel:IC(e.agentId),createdAt:e.runEvidence.generatedAt,goalId:e.goalId,goalTitle:e.title,kind:`evidence`,outputId:`${e.goalId}:latest-evidence`,runId:e.runEvidence.runId??void 0,safePreview:e.runEvidence.safePreview,summary:e.runEvidence.summary,title:e.runEvidence.label,todoId:e.runEvidence.todoId??void 0}}]:[]),...D&&k?[{id:`output:${D.goalId}:report:${k.publication.publication_id}`,kind:`output`,output:{agentId:k.agent_id,agentLabel:IC(k.agent_id),createdAt:k.publication.delivered_at,goalId:D.goalId,goalTitle:D.title,kind:`report`,outputId:k.publication.publication_id,report:{addedCount:k.delta.added_count,changedCount:k.delta.changed_count,deliveredAt:k.publication.delivered_at,generationId:k.generation_id,items:k.delta.items.map(e=>({changeKind:e.change_kind,previousStatus:e.previous_status,sourceRef:e.source_ref,status:e.status,summary:e.summary,title:e.title})),periodEndAt:k.period_window.end_at,periodStartAt:k.period_window.start_at,predecessorPublicationId:k.publication.predecessor_publication_id,publicationId:k.publication.publication_id},safePreview:k.delta.items.map(e=>`${e.change_kind===`added`?`+`:`~`} ${e.title}\n${e.summary}`).join(` diff --git a/loopx/web/chat/index.html b/loopx/web/chat/index.html index 598f172b93..fb6a4b2190 100644 --- a/loopx/web/chat/index.html +++ b/loopx/web/chat/index.html @@ -18,7 +18,7 @@ content="LoopX 个人 Agent 工作区:在同一个频道里查看、纠偏并推进 Goal。" /> LoopX 个人 Agent 工作区 - + From 2058d381672e053f53fb193e5de637771aa5e2e1 Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Fri, 18 Sep 2026 23:51:06 +0800 Subject: [PATCH 7/7] fix(chat): preserve validation source rejection semantics Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- loopx/chat_todo_actions.py | 10 ++++++++++ loopx/control_plane/todos/provider_update.py | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/loopx/chat_todo_actions.py b/loopx/chat_todo_actions.py index 57d41ee7d4..12e4d78836 100644 --- a/loopx/chat_todo_actions.py +++ b/loopx/chat_todo_actions.py @@ -116,6 +116,16 @@ def _apply_reviewed_todo_edit( try: result = run(parameters, dry_run=False, basis=basis, operation_id=operation_id) except LocalCoordinationAuthorityUnavailable as error: + if (parameters.get("operation") == "complete" and error.code == "authority_source_changed" + and error.payload.get("completion_validation_executed") is True): + self.store.mark_failed( + proposal_id, error_code="canonical_update_validation_source_changed", + message="Todo authority registration changed during completion validation; retry", + details={"operation_id": operation_id, "reason_code": error.code}, + ) + raise ValueError( + "Todo authority registration changed during completion validation; retry" + ) from error if error.code in {"provider_revision_mismatch", "authority_source_changed", "provider_revision_conflict"}: # The native transaction first established that no matching # historical receipt exists. This is a rejected new edit. diff --git a/loopx/control_plane/todos/provider_update.py b/loopx/control_plane/todos/provider_update.py index 8d529d9ecd..241e2fb8a1 100644 --- a/loopx/control_plane/todos/provider_update.py +++ b/loopx/control_plane/todos/provider_update.py @@ -93,12 +93,14 @@ def update_canonical_todo_if_promoted( **({"completion": completion} if completion is not None else {}), } result = effect_runtime_result("coordination.local_authority.todo_update", request) + completion_validation_executed = False if isinstance(result, dict) and result.get("status") == "execute_validation": if completion is None: raise RuntimeError("Ordinary Todo update cannot issue completion validation") completion["source_provider_revision"] = result["provider_revision"] completion.update(execute_completion_validation_effects( result, registry_path=registry_path, goal_id=goal_id)) + completion_validation_executed = True request["observed_at"] = now_local() result = effect_runtime_result("coordination.local_authority.todo_update", request) if isinstance(result, dict): @@ -136,7 +138,9 @@ def update_canonical_todo_if_promoted( result.get("decision_read_from_provider") is not True or result.get("legacy_fallback_used") is not False ): - payload = result if isinstance(result, dict) else {} + payload = dict(result) if isinstance(result, dict) else {} + if completion_validation_executed: + payload["completion_validation_executed"] = True raise LocalCoordinationAuthorityUnavailable( str(payload.get("reason") or "canonical Todo update failed; reread before retry"), code=str(payload.get("reason_code") or payload.get("conflict_kind")