feat(webui): page and filter the task list on the server

This commit is contained in:
sam committed 2026-10-05 20:21:51 +11:00
1 parent 21ab0adaec
commit bdf4fa9730
15 files changed
+550 -384

No files matched your search

+317 -287
View File
@@ -6230,11 +6230,16 @@ func (x *ClearTerminalTasksResponse) GetCount() int64 {
return 0
}
// TasksRequest selects one page of tasks, most recently updated first. Empty
// statuses matches every status; after_id 0 starts at the newest task.
type TasksRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
Statuses []string `protobuf:"bytes,2,rep,name=statuses,proto3" json:"statuses,omitempty"`
AfterUpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=after_updated_at,json=afterUpdatedAt,proto3" json:"after_updated_at,omitempty"`
AfterId int64 `protobuf:"varint,4,opt,name=after_id,json=afterId,proto3" json:"after_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TasksRequest) Reset() {
@@ -6274,6 +6279,27 @@ func (x *TasksRequest) GetLimit() int64 {
return 0
}
func (x *TasksRequest) GetStatuses() []string {
if x != nil {
return x.Statuses
}
return nil
}
func (x *TasksRequest) GetAfterUpdatedAt() *timestamppb.Timestamp {
if x != nil {
return x.AfterUpdatedAt
}
return nil
}
func (x *TasksRequest) GetAfterId() int64 {
if x != nil {
return x.AfterId
}
return 0
}
type TasksResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"`
@@ -13730,9 +13756,12 @@ const file_state_v1_state_proto_rawDesc = "" +
"\x05tasks\x18\x01 \x03(\v2\x0e.state.v1.TaskR\x05tasks\"\x1b\n" +
"\x19ClearTerminalTasksRequest\"2\n" +
"\x1aClearTerminalTasksResponse\x12\x14\n" +
"\x05count\x18\x01 \x01(\x03R\x05count\"$\n" +
"\x05count\x18\x01 \x01(\x03R\x05count\"\xa1\x01\n" +
"\fTasksRequest\x12\x14\n" +
"\x05limit\x18\x01 \x01(\x03R\x05limit\"5\n" +
"\x05limit\x18\x01 \x01(\x03R\x05limit\x12\x1a\n" +
"\bstatuses\x18\x02 \x03(\tR\bstatuses\x12D\n" +
"\x10after_updated_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\x0eafterUpdatedAt\x12\x19\n" +
"\bafter_id\x18\x04 \x01(\x03R\aafterId\"5\n" +
"\rTasksResponse\x12$\n" +
"\x05tasks\x18\x01 \x03(\v2\x0e.state.v1.TaskR\x05tasks\"\x15\n" +
"\x13StatusCountsRequest\"\x95\x01\n" +
@@ -14574,287 +14603,288 @@ var file_state_v1_state_proto_depIdxs = []int32{
33, // 52: state.v1.OpenTaskByPRResponse.task:type_name -> state.v1.Task
33, // 53: state.v1.TaskByIDResponse.task:type_name -> state.v1.Task
33, // 54: state.v1.OpenPRsResponse.tasks:type_name -> state.v1.Task
33, // 55: state.v1.TasksResponse.tasks:type_name -> state.v1.Task
245, // 56: state.v1.StatusCountsResponse.counts:type_name -> state.v1.StatusCountsResponse.CountsEntry
34, // 57: state.v1.InsertEventRequest.event:type_name -> state.v1.Event
34, // 58: state.v1.EventsSinceResponse.events:type_name -> state.v1.Event
34, // 59: state.v1.TaskEventsResponse.events:type_name -> state.v1.Event
44, // 60: state.v1.WorkflowStatsResponse.stats:type_name -> state.v1.WorkflowStat
45, // 61: state.v1.StageStatsResponse.stats:type_name -> state.v1.StageStat
46, // 62: state.v1.TokensByDayResponse.tokens:type_name -> state.v1.DayTokens
246, // 63: state.v1.ConfigSnapshot.published_at:type_name -> google.protobuf.Timestamp
117, // 64: state.v1.PutConfigSnapshotRequest.snapshot:type_name -> state.v1.ConfigSnapshot
117, // 65: state.v1.GetConfigSnapshotResponse.snapshot:type_name -> state.v1.ConfigSnapshot
246, // 66: state.v1.ChannelStatus.observed_at:type_name -> google.protobuf.Timestamp
122, // 67: state.v1.PutChannelStatusRequest.channels:type_name -> state.v1.ChannelStatus
122, // 68: state.v1.ListChannelStatusResponse.channels:type_name -> state.v1.ChannelStatus
246, // 69: state.v1.ApplyStatus.reported_at:type_name -> google.protobuf.Timestamp
127, // 70: state.v1.PutApplyStatusRequest.status:type_name -> state.v1.ApplyStatus
127, // 71: state.v1.ListApplyStatusResponse.statuses:type_name -> state.v1.ApplyStatus
246, // 72: state.v1.Presence.started_at:type_name -> google.protobuf.Timestamp
246, // 73: state.v1.Presence.reported_at:type_name -> google.protobuf.Timestamp
246, // 74: state.v1.RecordCaptureRefusalRequest.refused_at:type_name -> google.protobuf.Timestamp
246, // 75: state.v1.ListCaptureRefusalsRequest.since:type_name -> google.protobuf.Timestamp
136, // 76: state.v1.ListCaptureRefusalsResponse.sources:type_name -> state.v1.CaptureRefusals
132, // 77: state.v1.PutPresenceRequest.presence:type_name -> state.v1.Presence
132, // 78: state.v1.ListPresenceResponse.presences:type_name -> state.v1.Presence
246, // 79: state.v1.TaskLogEntry.time:type_name -> google.protobuf.Timestamp
246, // 80: state.v1.ReadTaskLogRequest.since:type_name -> google.protobuf.Timestamp
246, // 81: state.v1.ReadTaskLogRequest.until:type_name -> google.protobuf.Timestamp
142, // 82: state.v1.ReadTaskLogResponse.entries:type_name -> state.v1.TaskLogEntry
35, // 83: state.v1.InsertCaptureRequest.capture:type_name -> state.v1.CapturedEvent
35, // 84: state.v1.StreamCapturesResponse.capture:type_name -> state.v1.CapturedEvent
40, // 85: state.v1.InsertMappingRequest.mapping:type_name -> state.v1.Mapping
40, // 86: state.v1.GetMappingResponse.mapping:type_name -> state.v1.Mapping
40, // 87: state.v1.ListMappingsResponse.mappings:type_name -> state.v1.Mapping
40, // 88: state.v1.UpdateMappingRequest.mapping:type_name -> state.v1.Mapping
38, // 89: state.v1.InsertEventTypeRequest.event_type:type_name -> state.v1.EventType
38, // 90: state.v1.UpdateEventTypeRequest.event_type:type_name -> state.v1.EventType
38, // 91: state.v1.ListEventTypesResponse.event_types:type_name -> state.v1.EventType
42, // 92: state.v1.InsertBindingRequest.binding:type_name -> state.v1.Binding
42, // 93: state.v1.GetBindingResponse.binding:type_name -> state.v1.Binding
42, // 94: state.v1.ListBindingsResponse.bindings:type_name -> state.v1.Binding
42, // 95: state.v1.UpdateBindingRequest.binding:type_name -> state.v1.Binding
43, // 96: state.v1.InsertSourceRequest.source:type_name -> state.v1.Source
43, // 97: state.v1.GetSourceResponse.source:type_name -> state.v1.Source
43, // 98: state.v1.ListSourcesResponse.sources:type_name -> state.v1.Source
42, // 99: state.v1.ArmedBindingsForSourceResponse.bindings:type_name -> state.v1.Binding
246, // 100: state.v1.Dispatch.dispatched_at:type_name -> google.protobuf.Timestamp
200, // 101: state.v1.ListDispatchesResponse.dispatches:type_name -> state.v1.Dispatch
35, // 102: state.v1.StreamUndispatchedCapturesResponse.capture:type_name -> state.v1.CapturedEvent
33, // 103: state.v1.EnqueueBindingTaskResponse.task:type_name -> state.v1.Task
33, // 104: state.v1.EnqueueCallTaskResponse.task:type_name -> state.v1.Task
215, // 105: state.v1.InstalledPackage.accepted_authority:type_name -> state.v1.PackageAuthority
214, // 106: state.v1.InstallPackageResponse.package:type_name -> state.v1.InstalledPackage
214, // 107: state.v1.GetInstalledPackageResponse.package:type_name -> state.v1.InstalledPackage
214, // 108: state.v1.ListInstalledPackagesResponse.packages:type_name -> state.v1.InstalledPackage
215, // 109: state.v1.AcceptPackageAuthorityRequest.accepted:type_name -> state.v1.PackageAuthority
214, // 110: state.v1.AcceptPackageAuthorityResponse.package:type_name -> state.v1.InstalledPackage
227, // 111: state.v1.AccessPrincipal.memberships:type_name -> state.v1.PrincipalMembership
228, // 112: state.v1.GetPrincipalResponse.principal:type_name -> state.v1.AccessPrincipal
230, // 113: state.v1.ListPoliciesResponse.policies:type_name -> state.v1.AccessPolicy
230, // 114: state.v1.PutPolicyRequest.policy:type_name -> state.v1.AccessPolicy
230, // 115: state.v1.DeletePolicyRequest.policy:type_name -> state.v1.AccessPolicy
246, // 116: state.v1.AccessDenial.at:type_name -> google.protobuf.Timestamp
239, // 117: state.v1.RecordDenialRequest.denial:type_name -> state.v1.AccessDenial
239, // 118: state.v1.ListDenialsResponse.denials:type_name -> state.v1.AccessDenial
216, // 119: state.v1.StateStoreService.InstallPackage:input_type -> state.v1.InstallPackageRequest
218, // 120: state.v1.StateStoreService.GetInstalledPackage:input_type -> state.v1.GetInstalledPackageRequest
220, // 121: state.v1.StateStoreService.ListInstalledPackages:input_type -> state.v1.ListInstalledPackagesRequest
222, // 122: state.v1.StateStoreService.AcceptPackageAuthority:input_type -> state.v1.AcceptPackageAuthorityRequest
224, // 123: state.v1.StateStoreService.RemoveInstalledPackage:input_type -> state.v1.RemoveInstalledPackageRequest
0, // 124: state.v1.StateStoreService.RegisterTaskGrant:input_type -> state.v1.RegisterTaskGrantRequest
2, // 125: state.v1.StateStoreService.RevokeTaskGrant:input_type -> state.v1.RevokeTaskGrantRequest
4, // 126: state.v1.StateStoreService.ResolveTaskGrant:input_type -> state.v1.ResolveTaskGrantRequest
8, // 127: state.v1.StateStoreService.ListIdentities:input_type -> state.v1.ListIdentitiesRequest
10, // 128: state.v1.StateStoreService.GetIdentity:input_type -> state.v1.GetIdentityRequest
12, // 129: state.v1.StateStoreService.CreateIdentity:input_type -> state.v1.CreateIdentityRequest
13, // 130: state.v1.StateStoreService.RenameIdentity:input_type -> state.v1.RenameIdentityRequest
14, // 131: state.v1.StateStoreService.SuspendIdentity:input_type -> state.v1.SuspendIdentityRequest
15, // 132: state.v1.StateStoreService.ReactivateIdentity:input_type -> state.v1.ReactivateIdentityRequest
16, // 133: state.v1.StateStoreService.RetireIdentity:input_type -> state.v1.RetireIdentityRequest
22, // 134: state.v1.StateStoreService.ResolveIdentitySubject:input_type -> state.v1.ResolveIdentitySubjectRequest
24, // 135: state.v1.StateStoreService.BindIdentitySubject:input_type -> state.v1.BindIdentitySubjectRequest
27, // 136: state.v1.StateStoreService.AddPersonalToken:input_type -> state.v1.AddPersonalTokenRequest
29, // 137: state.v1.StateStoreService.ListPersonalTokens:input_type -> state.v1.ListPersonalTokensRequest
31, // 138: state.v1.StateStoreService.RevokePersonalToken:input_type -> state.v1.RevokePersonalTokenRequest
47, // 139: state.v1.StateStoreService.EnqueueIssue:input_type -> state.v1.EnqueueIssueRequest
49, // 140: state.v1.StateStoreService.EnqueueChatTask:input_type -> state.v1.EnqueueChatTaskRequest
51, // 141: state.v1.StateStoreService.ClaimNext:input_type -> state.v1.ClaimNextRequest
53, // 142: state.v1.StateStoreService.ClaimByIssue:input_type -> state.v1.ClaimByIssueRequest
55, // 143: state.v1.StateStoreService.Transition:input_type -> state.v1.TransitionRequest
71, // 144: state.v1.StateStoreService.Update:input_type -> state.v1.UpdateRequest
57, // 145: state.v1.StateStoreService.StartStep:input_type -> state.v1.StartStepRequest
59, // 146: state.v1.StateStoreService.FinishStep:input_type -> state.v1.FinishStepRequest
61, // 147: state.v1.StateStoreService.CancelExecution:input_type -> state.v1.CancelExecutionRequest
64, // 148: state.v1.StateStoreService.ListSteps:input_type -> state.v1.ListStepsRequest
67, // 149: state.v1.StateStoreService.GetHarnessSecret:input_type -> state.v1.GetHarnessSecretRequest
69, // 150: state.v1.StateStoreService.PutHarnessSecret:input_type -> state.v1.PutHarnessSecretRequest
73, // 151: state.v1.StateStoreService.Requeue:input_type -> state.v1.RequeueRequest
75, // 152: state.v1.StateStoreService.ParkTask:input_type -> state.v1.ParkTaskRequest
77, // 153: state.v1.StateStoreService.RecoverStale:input_type -> state.v1.RecoverStaleRequest
79, // 154: state.v1.StateStoreService.ArchiveTask:input_type -> state.v1.ArchiveTaskRequest
81, // 155: state.v1.StateStoreService.RetryTask:input_type -> state.v1.RetryTaskRequest
83, // 156: state.v1.StateStoreService.RespondReviewGate:input_type -> state.v1.RespondReviewGateRequest
85, // 157: state.v1.StateStoreService.BeginRemediation:input_type -> state.v1.BeginRemediationRequest
87, // 158: state.v1.StateStoreService.UpdateReviewPayload:input_type -> state.v1.UpdateReviewPayloadRequest
89, // 159: state.v1.StateStoreService.SetReviewCursors:input_type -> state.v1.SetReviewCursorsRequest
91, // 160: state.v1.StateStoreService.TaskByIssue:input_type -> state.v1.TaskByIssueRequest
93, // 161: state.v1.StateStoreService.OpenTaskByPR:input_type -> state.v1.OpenTaskByPRRequest
95, // 162: state.v1.StateStoreService.TaskByID:input_type -> state.v1.TaskByIDRequest
97, // 163: state.v1.StateStoreService.OpenPRs:input_type -> state.v1.OpenPRsRequest
99, // 164: state.v1.StateStoreService.ClearTerminalTasks:input_type -> state.v1.ClearTerminalTasksRequest
101, // 165: state.v1.StateStoreService.Tasks:input_type -> state.v1.TasksRequest
103, // 166: state.v1.StateStoreService.StatusCounts:input_type -> state.v1.StatusCountsRequest
105, // 167: state.v1.StateStoreService.InsertEvent:input_type -> state.v1.InsertEventRequest
107, // 168: state.v1.StateStoreService.EventsSince:input_type -> state.v1.EventsSinceRequest
109, // 169: state.v1.StateStoreService.TaskEvents:input_type -> state.v1.TaskEventsRequest
111, // 170: state.v1.StateStoreService.WorkflowStats:input_type -> state.v1.WorkflowStatsRequest
113, // 171: state.v1.StateStoreService.StageStats:input_type -> state.v1.StageStatsRequest
115, // 172: state.v1.StateStoreService.TokensByDay:input_type -> state.v1.TokensByDayRequest
118, // 173: state.v1.StateStoreService.PutConfigSnapshot:input_type -> state.v1.PutConfigSnapshotRequest
120, // 174: state.v1.StateStoreService.GetConfigSnapshot:input_type -> state.v1.GetConfigSnapshotRequest
123, // 175: state.v1.StateStoreService.PutChannelStatus:input_type -> state.v1.PutChannelStatusRequest
125, // 176: state.v1.StateStoreService.ListChannelStatus:input_type -> state.v1.ListChannelStatusRequest
128, // 177: state.v1.StateStoreService.PutApplyStatus:input_type -> state.v1.PutApplyStatusRequest
130, // 178: state.v1.StateStoreService.ListApplyStatus:input_type -> state.v1.ListApplyStatusRequest
138, // 179: state.v1.StateStoreService.PutPresence:input_type -> state.v1.PutPresenceRequest
133, // 180: state.v1.StateStoreService.RecordCaptureRefusal:input_type -> state.v1.RecordCaptureRefusalRequest
135, // 181: state.v1.StateStoreService.ListCaptureRefusals:input_type -> state.v1.ListCaptureRefusalsRequest
140, // 182: state.v1.StateStoreService.ListPresence:input_type -> state.v1.ListPresenceRequest
143, // 183: state.v1.StateStoreService.ReadTaskLog:input_type -> state.v1.ReadTaskLogRequest
145, // 184: state.v1.StateStoreService.StreamTaskLogContent:input_type -> state.v1.StreamTaskLogContentRequest
147, // 185: state.v1.StateStoreService.InsertCapture:input_type -> state.v1.InsertCaptureRequest
149, // 186: state.v1.StateStoreService.StreamCaptures:input_type -> state.v1.StreamCapturesRequest
151, // 187: state.v1.StateStoreService.InsertMapping:input_type -> state.v1.InsertMappingRequest
153, // 188: state.v1.StateStoreService.GetMapping:input_type -> state.v1.GetMappingRequest
155, // 189: state.v1.StateStoreService.ListMappings:input_type -> state.v1.ListMappingsRequest
157, // 190: state.v1.StateStoreService.UpdateMapping:input_type -> state.v1.UpdateMappingRequest
159, // 191: state.v1.StateStoreService.DeleteMapping:input_type -> state.v1.DeleteMappingRequest
161, // 192: state.v1.StateStoreService.RecordMappingMatch:input_type -> state.v1.RecordMappingMatchRequest
163, // 193: state.v1.StateStoreService.InsertEventType:input_type -> state.v1.InsertEventTypeRequest
165, // 194: state.v1.StateStoreService.UpdateEventType:input_type -> state.v1.UpdateEventTypeRequest
167, // 195: state.v1.StateStoreService.DeleteEventType:input_type -> state.v1.DeleteEventTypeRequest
169, // 196: state.v1.StateStoreService.ListEventTypes:input_type -> state.v1.ListEventTypesRequest
171, // 197: state.v1.StateStoreService.InsertBinding:input_type -> state.v1.InsertBindingRequest
173, // 198: state.v1.StateStoreService.GetBinding:input_type -> state.v1.GetBindingRequest
175, // 199: state.v1.StateStoreService.ListBindings:input_type -> state.v1.ListBindingsRequest
199, // 200: state.v1.StateStoreService.ListDispatches:input_type -> state.v1.ListDispatchesRequest
177, // 201: state.v1.StateStoreService.UpdateBinding:input_type -> state.v1.UpdateBindingRequest
179, // 202: state.v1.StateStoreService.DeleteBinding:input_type -> state.v1.DeleteBindingRequest
181, // 203: state.v1.StateStoreService.ApproveBinding:input_type -> state.v1.ApproveBindingRequest
183, // 204: state.v1.StateStoreService.InsertSource:input_type -> state.v1.InsertSourceRequest
185, // 205: state.v1.StateStoreService.GetSource:input_type -> state.v1.GetSourceRequest
187, // 206: state.v1.StateStoreService.ListSources:input_type -> state.v1.ListSourcesRequest
189, // 207: state.v1.StateStoreService.SetSourceSigning:input_type -> state.v1.SetSourceSigningRequest
191, // 208: state.v1.StateStoreService.SetSourceSecret:input_type -> state.v1.SetSourceSecretRequest
193, // 209: state.v1.StateStoreService.ArmedBindingsForSource:input_type -> state.v1.ArmedBindingsForSourceRequest
195, // 210: state.v1.StateStoreService.RecordDispatch:input_type -> state.v1.RecordDispatchRequest
197, // 211: state.v1.StateStoreService.SetDispatchTask:input_type -> state.v1.SetDispatchTaskRequest
202, // 212: state.v1.StateStoreService.RecordPlaybookDispatch:input_type -> state.v1.RecordPlaybookDispatchRequest
204, // 213: state.v1.StateStoreService.DeletePlaybookDispatches:input_type -> state.v1.DeletePlaybookDispatchesRequest
206, // 214: state.v1.StateStoreService.StreamUndispatchedCaptures:input_type -> state.v1.StreamUndispatchedCapturesRequest
208, // 215: state.v1.StateStoreService.EnqueueBindingTask:input_type -> state.v1.EnqueueBindingTaskRequest
210, // 216: state.v1.StateStoreService.EnqueueCallTask:input_type -> state.v1.EnqueueCallTaskRequest
212, // 217: state.v1.StateStoreService.WorkflowCallStatus:input_type -> state.v1.WorkflowCallStatusRequest
226, // 218: state.v1.StateStoreService.GetPrincipal:input_type -> state.v1.GetPrincipalRequest
231, // 219: state.v1.StateStoreService.ListPolicies:input_type -> state.v1.ListPoliciesRequest
233, // 220: state.v1.StateStoreService.PutPolicy:input_type -> state.v1.PutPolicyRequest
235, // 221: state.v1.StateStoreService.DeletePolicy:input_type -> state.v1.DeletePolicyRequest
237, // 222: state.v1.StateStoreService.EnsureShippedOrgPolicies:input_type -> state.v1.EnsureShippedOrgPoliciesRequest
240, // 223: state.v1.StateStoreService.RecordDenial:input_type -> state.v1.RecordDenialRequest
242, // 224: state.v1.StateStoreService.ListDenials:input_type -> state.v1.ListDenialsRequest
217, // 225: state.v1.StateStoreService.InstallPackage:output_type -> state.v1.InstallPackageResponse
219, // 226: state.v1.StateStoreService.GetInstalledPackage:output_type -> state.v1.GetInstalledPackageResponse
221, // 227: state.v1.StateStoreService.ListInstalledPackages:output_type -> state.v1.ListInstalledPackagesResponse
223, // 228: state.v1.StateStoreService.AcceptPackageAuthority:output_type -> state.v1.AcceptPackageAuthorityResponse
225, // 229: state.v1.StateStoreService.RemoveInstalledPackage:output_type -> state.v1.RemoveInstalledPackageResponse
1, // 230: state.v1.StateStoreService.RegisterTaskGrant:output_type -> state.v1.RegisterTaskGrantResponse
3, // 231: state.v1.StateStoreService.RevokeTaskGrant:output_type -> state.v1.RevokeTaskGrantResponse
5, // 232: state.v1.StateStoreService.ResolveTaskGrant:output_type -> state.v1.ResolveTaskGrantResponse
9, // 233: state.v1.StateStoreService.ListIdentities:output_type -> state.v1.ListIdentitiesResponse
11, // 234: state.v1.StateStoreService.GetIdentity:output_type -> state.v1.GetIdentityResponse
17, // 235: state.v1.StateStoreService.CreateIdentity:output_type -> state.v1.CreateIdentityResponse
18, // 236: state.v1.StateStoreService.RenameIdentity:output_type -> state.v1.RenameIdentityResponse
19, // 237: state.v1.StateStoreService.SuspendIdentity:output_type -> state.v1.SuspendIdentityResponse
20, // 238: state.v1.StateStoreService.ReactivateIdentity:output_type -> state.v1.ReactivateIdentityResponse
21, // 239: state.v1.StateStoreService.RetireIdentity:output_type -> state.v1.RetireIdentityResponse
23, // 240: state.v1.StateStoreService.ResolveIdentitySubject:output_type -> state.v1.ResolveIdentitySubjectResponse
25, // 241: state.v1.StateStoreService.BindIdentitySubject:output_type -> state.v1.BindIdentitySubjectResponse
28, // 242: state.v1.StateStoreService.AddPersonalToken:output_type -> state.v1.AddPersonalTokenResponse
30, // 243: state.v1.StateStoreService.ListPersonalTokens:output_type -> state.v1.ListPersonalTokensResponse
32, // 244: state.v1.StateStoreService.RevokePersonalToken:output_type -> state.v1.RevokePersonalTokenResponse
48, // 245: state.v1.StateStoreService.EnqueueIssue:output_type -> state.v1.EnqueueIssueResponse
50, // 246: state.v1.StateStoreService.EnqueueChatTask:output_type -> state.v1.EnqueueChatTaskResponse
52, // 247: state.v1.StateStoreService.ClaimNext:output_type -> state.v1.ClaimNextResponse
54, // 248: state.v1.StateStoreService.ClaimByIssue:output_type -> state.v1.ClaimByIssueResponse
56, // 249: state.v1.StateStoreService.Transition:output_type -> state.v1.TransitionResponse
72, // 250: state.v1.StateStoreService.Update:output_type -> state.v1.UpdateResponse
58, // 251: state.v1.StateStoreService.StartStep:output_type -> state.v1.StartStepResponse
60, // 252: state.v1.StateStoreService.FinishStep:output_type -> state.v1.FinishStepResponse
62, // 253: state.v1.StateStoreService.CancelExecution:output_type -> state.v1.CancelExecutionResponse
65, // 254: state.v1.StateStoreService.ListSteps:output_type -> state.v1.ListStepsResponse
68, // 255: state.v1.StateStoreService.GetHarnessSecret:output_type -> state.v1.GetHarnessSecretResponse
70, // 256: state.v1.StateStoreService.PutHarnessSecret:output_type -> state.v1.PutHarnessSecretResponse
74, // 257: state.v1.StateStoreService.Requeue:output_type -> state.v1.RequeueResponse
76, // 258: state.v1.StateStoreService.ParkTask:output_type -> state.v1.ParkTaskResponse
78, // 259: state.v1.StateStoreService.RecoverStale:output_type -> state.v1.RecoverStaleResponse
80, // 260: state.v1.StateStoreService.ArchiveTask:output_type -> state.v1.ArchiveTaskResponse
82, // 261: state.v1.StateStoreService.RetryTask:output_type -> state.v1.RetryTaskResponse
84, // 262: state.v1.StateStoreService.RespondReviewGate:output_type -> state.v1.RespondReviewGateResponse
86, // 263: state.v1.StateStoreService.BeginRemediation:output_type -> state.v1.BeginRemediationResponse
88, // 264: state.v1.StateStoreService.UpdateReviewPayload:output_type -> state.v1.UpdateReviewPayloadResponse
90, // 265: state.v1.StateStoreService.SetReviewCursors:output_type -> state.v1.SetReviewCursorsResponse
92, // 266: state.v1.StateStoreService.TaskByIssue:output_type -> state.v1.TaskByIssueResponse
94, // 267: state.v1.StateStoreService.OpenTaskByPR:output_type -> state.v1.OpenTaskByPRResponse
96, // 268: state.v1.StateStoreService.TaskByID:output_type -> state.v1.TaskByIDResponse
98, // 269: state.v1.StateStoreService.OpenPRs:output_type -> state.v1.OpenPRsResponse
100, // 270: state.v1.StateStoreService.ClearTerminalTasks:output_type -> state.v1.ClearTerminalTasksResponse
102, // 271: state.v1.StateStoreService.Tasks:output_type -> state.v1.TasksResponse
104, // 272: state.v1.StateStoreService.StatusCounts:output_type -> state.v1.StatusCountsResponse
106, // 273: state.v1.StateStoreService.InsertEvent:output_type -> state.v1.InsertEventResponse
108, // 274: state.v1.StateStoreService.EventsSince:output_type -> state.v1.EventsSinceResponse
110, // 275: state.v1.StateStoreService.TaskEvents:output_type -> state.v1.TaskEventsResponse
112, // 276: state.v1.StateStoreService.WorkflowStats:output_type -> state.v1.WorkflowStatsResponse
114, // 277: state.v1.StateStoreService.StageStats:output_type -> state.v1.StageStatsResponse
116, // 278: state.v1.StateStoreService.TokensByDay:output_type -> state.v1.TokensByDayResponse
119, // 279: state.v1.StateStoreService.PutConfigSnapshot:output_type -> state.v1.PutConfigSnapshotResponse
121, // 280: state.v1.StateStoreService.GetConfigSnapshot:output_type -> state.v1.GetConfigSnapshotResponse
124, // 281: state.v1.StateStoreService.PutChannelStatus:output_type -> state.v1.PutChannelStatusResponse
126, // 282: state.v1.StateStoreService.ListChannelStatus:output_type -> state.v1.ListChannelStatusResponse
129, // 283: state.v1.StateStoreService.PutApplyStatus:output_type -> state.v1.PutApplyStatusResponse
131, // 284: state.v1.StateStoreService.ListApplyStatus:output_type -> state.v1.ListApplyStatusResponse
139, // 285: state.v1.StateStoreService.PutPresence:output_type -> state.v1.PutPresenceResponse
134, // 286: state.v1.StateStoreService.RecordCaptureRefusal:output_type -> state.v1.RecordCaptureRefusalResponse
137, // 287: state.v1.StateStoreService.ListCaptureRefusals:output_type -> state.v1.ListCaptureRefusalsResponse
141, // 288: state.v1.StateStoreService.ListPresence:output_type -> state.v1.ListPresenceResponse
144, // 289: state.v1.StateStoreService.ReadTaskLog:output_type -> state.v1.ReadTaskLogResponse
146, // 290: state.v1.StateStoreService.StreamTaskLogContent:output_type -> state.v1.StreamTaskLogContentResponse
148, // 291: state.v1.StateStoreService.InsertCapture:output_type -> state.v1.InsertCaptureResponse
150, // 292: state.v1.StateStoreService.StreamCaptures:output_type -> state.v1.StreamCapturesResponse
152, // 293: state.v1.StateStoreService.InsertMapping:output_type -> state.v1.InsertMappingResponse
154, // 294: state.v1.StateStoreService.GetMapping:output_type -> state.v1.GetMappingResponse
156, // 295: state.v1.StateStoreService.ListMappings:output_type -> state.v1.ListMappingsResponse
158, // 296: state.v1.StateStoreService.UpdateMapping:output_type -> state.v1.UpdateMappingResponse
160, // 297: state.v1.StateStoreService.DeleteMapping:output_type -> state.v1.DeleteMappingResponse
162, // 298: state.v1.StateStoreService.RecordMappingMatch:output_type -> state.v1.RecordMappingMatchResponse
164, // 299: state.v1.StateStoreService.InsertEventType:output_type -> state.v1.InsertEventTypeResponse
166, // 300: state.v1.StateStoreService.UpdateEventType:output_type -> state.v1.UpdateEventTypeResponse
168, // 301: state.v1.StateStoreService.DeleteEventType:output_type -> state.v1.DeleteEventTypeResponse
170, // 302: state.v1.StateStoreService.ListEventTypes:output_type -> state.v1.ListEventTypesResponse
172, // 303: state.v1.StateStoreService.InsertBinding:output_type -> state.v1.InsertBindingResponse
174, // 304: state.v1.StateStoreService.GetBinding:output_type -> state.v1.GetBindingResponse
176, // 305: state.v1.StateStoreService.ListBindings:output_type -> state.v1.ListBindingsResponse
201, // 306: state.v1.StateStoreService.ListDispatches:output_type -> state.v1.ListDispatchesResponse
178, // 307: state.v1.StateStoreService.UpdateBinding:output_type -> state.v1.UpdateBindingResponse
180, // 308: state.v1.StateStoreService.DeleteBinding:output_type -> state.v1.DeleteBindingResponse
182, // 309: state.v1.StateStoreService.ApproveBinding:output_type -> state.v1.ApproveBindingResponse
184, // 310: state.v1.StateStoreService.InsertSource:output_type -> state.v1.InsertSourceResponse
186, // 311: state.v1.StateStoreService.GetSource:output_type -> state.v1.GetSourceResponse
188, // 312: state.v1.StateStoreService.ListSources:output_type -> state.v1.ListSourcesResponse
190, // 313: state.v1.StateStoreService.SetSourceSigning:output_type -> state.v1.SetSourceSigningResponse
192, // 314: state.v1.StateStoreService.SetSourceSecret:output_type -> state.v1.SetSourceSecretResponse
194, // 315: state.v1.StateStoreService.ArmedBindingsForSource:output_type -> state.v1.ArmedBindingsForSourceResponse
196, // 316: state.v1.StateStoreService.RecordDispatch:output_type -> state.v1.RecordDispatchResponse
198, // 317: state.v1.StateStoreService.SetDispatchTask:output_type -> state.v1.SetDispatchTaskResponse
203, // 318: state.v1.StateStoreService.RecordPlaybookDispatch:output_type -> state.v1.RecordPlaybookDispatchResponse
205, // 319: state.v1.StateStoreService.DeletePlaybookDispatches:output_type -> state.v1.DeletePlaybookDispatchesResponse
207, // 320: state.v1.StateStoreService.StreamUndispatchedCaptures:output_type -> state.v1.StreamUndispatchedCapturesResponse
209, // 321: state.v1.StateStoreService.EnqueueBindingTask:output_type -> state.v1.EnqueueBindingTaskResponse
211, // 322: state.v1.StateStoreService.EnqueueCallTask:output_type -> state.v1.EnqueueCallTaskResponse
213, // 323: state.v1.StateStoreService.WorkflowCallStatus:output_type -> state.v1.WorkflowCallStatusResponse
229, // 324: state.v1.StateStoreService.GetPrincipal:output_type -> state.v1.GetPrincipalResponse
232, // 325: state.v1.StateStoreService.ListPolicies:output_type -> state.v1.ListPoliciesResponse
234, // 326: state.v1.StateStoreService.PutPolicy:output_type -> state.v1.PutPolicyResponse
236, // 327: state.v1.StateStoreService.DeletePolicy:output_type -> state.v1.DeletePolicyResponse
238, // 328: state.v1.StateStoreService.EnsureShippedOrgPolicies:output_type -> state.v1.EnsureShippedOrgPoliciesResponse
241, // 329: state.v1.StateStoreService.RecordDenial:output_type -> state.v1.RecordDenialResponse
243, // 330: state.v1.StateStoreService.ListDenials:output_type -> state.v1.ListDenialsResponse
225, // [225:331] is the sub-list for method output_type
119, // [119:225] is the sub-list for method input_type
119, // [119:119] is the sub-list for extension type_name
119, // [119:119] is the sub-list for extension extendee
0, // [0:119] is the sub-list for field type_name
246, // 55: state.v1.TasksRequest.after_updated_at:type_name -> google.protobuf.Timestamp
33, // 56: state.v1.TasksResponse.tasks:type_name -> state.v1.Task
245, // 57: state.v1.StatusCountsResponse.counts:type_name -> state.v1.StatusCountsResponse.CountsEntry
34, // 58: state.v1.InsertEventRequest.event:type_name -> state.v1.Event
34, // 59: state.v1.EventsSinceResponse.events:type_name -> state.v1.Event
34, // 60: state.v1.TaskEventsResponse.events:type_name -> state.v1.Event
44, // 61: state.v1.WorkflowStatsResponse.stats:type_name -> state.v1.WorkflowStat
45, // 62: state.v1.StageStatsResponse.stats:type_name -> state.v1.StageStat
46, // 63: state.v1.TokensByDayResponse.tokens:type_name -> state.v1.DayTokens
246, // 64: state.v1.ConfigSnapshot.published_at:type_name -> google.protobuf.Timestamp
117, // 65: state.v1.PutConfigSnapshotRequest.snapshot:type_name -> state.v1.ConfigSnapshot
117, // 66: state.v1.GetConfigSnapshotResponse.snapshot:type_name -> state.v1.ConfigSnapshot
246, // 67: state.v1.ChannelStatus.observed_at:type_name -> google.protobuf.Timestamp
122, // 68: state.v1.PutChannelStatusRequest.channels:type_name -> state.v1.ChannelStatus
122, // 69: state.v1.ListChannelStatusResponse.channels:type_name -> state.v1.ChannelStatus
246, // 70: state.v1.ApplyStatus.reported_at:type_name -> google.protobuf.Timestamp
127, // 71: state.v1.PutApplyStatusRequest.status:type_name -> state.v1.ApplyStatus
127, // 72: state.v1.ListApplyStatusResponse.statuses:type_name -> state.v1.ApplyStatus
246, // 73: state.v1.Presence.started_at:type_name -> google.protobuf.Timestamp
246, // 74: state.v1.Presence.reported_at:type_name -> google.protobuf.Timestamp
246, // 75: state.v1.RecordCaptureRefusalRequest.refused_at:type_name -> google.protobuf.Timestamp
246, // 76: state.v1.ListCaptureRefusalsRequest.since:type_name -> google.protobuf.Timestamp
136, // 77: state.v1.ListCaptureRefusalsResponse.sources:type_name -> state.v1.CaptureRefusals
132, // 78: state.v1.PutPresenceRequest.presence:type_name -> state.v1.Presence
132, // 79: state.v1.ListPresenceResponse.presences:type_name -> state.v1.Presence
246, // 80: state.v1.TaskLogEntry.time:type_name -> google.protobuf.Timestamp
246, // 81: state.v1.ReadTaskLogRequest.since:type_name -> google.protobuf.Timestamp
246, // 82: state.v1.ReadTaskLogRequest.until:type_name -> google.protobuf.Timestamp
142, // 83: state.v1.ReadTaskLogResponse.entries:type_name -> state.v1.TaskLogEntry
35, // 84: state.v1.InsertCaptureRequest.capture:type_name -> state.v1.CapturedEvent
35, // 85: state.v1.StreamCapturesResponse.capture:type_name -> state.v1.CapturedEvent
40, // 86: state.v1.InsertMappingRequest.mapping:type_name -> state.v1.Mapping
40, // 87: state.v1.GetMappingResponse.mapping:type_name -> state.v1.Mapping
40, // 88: state.v1.ListMappingsResponse.mappings:type_name -> state.v1.Mapping
40, // 89: state.v1.UpdateMappingRequest.mapping:type_name -> state.v1.Mapping
38, // 90: state.v1.InsertEventTypeRequest.event_type:type_name -> state.v1.EventType
38, // 91: state.v1.UpdateEventTypeRequest.event_type:type_name -> state.v1.EventType
38, // 92: state.v1.ListEventTypesResponse.event_types:type_name -> state.v1.EventType
42, // 93: state.v1.InsertBindingRequest.binding:type_name -> state.v1.Binding
42, // 94: state.v1.GetBindingResponse.binding:type_name -> state.v1.Binding
42, // 95: state.v1.ListBindingsResponse.bindings:type_name -> state.v1.Binding
42, // 96: state.v1.UpdateBindingRequest.binding:type_name -> state.v1.Binding
43, // 97: state.v1.InsertSourceRequest.source:type_name -> state.v1.Source
43, // 98: state.v1.GetSourceResponse.source:type_name -> state.v1.Source
43, // 99: state.v1.ListSourcesResponse.sources:type_name -> state.v1.Source
42, // 100: state.v1.ArmedBindingsForSourceResponse.bindings:type_name -> state.v1.Binding
246, // 101: state.v1.Dispatch.dispatched_at:type_name -> google.protobuf.Timestamp
200, // 102: state.v1.ListDispatchesResponse.dispatches:type_name -> state.v1.Dispatch
35, // 103: state.v1.StreamUndispatchedCapturesResponse.capture:type_name -> state.v1.CapturedEvent
33, // 104: state.v1.EnqueueBindingTaskResponse.task:type_name -> state.v1.Task
33, // 105: state.v1.EnqueueCallTaskResponse.task:type_name -> state.v1.Task
215, // 106: state.v1.InstalledPackage.accepted_authority:type_name -> state.v1.PackageAuthority
214, // 107: state.v1.InstallPackageResponse.package:type_name -> state.v1.InstalledPackage
214, // 108: state.v1.GetInstalledPackageResponse.package:type_name -> state.v1.InstalledPackage
214, // 109: state.v1.ListInstalledPackagesResponse.packages:type_name -> state.v1.InstalledPackage
215, // 110: state.v1.AcceptPackageAuthorityRequest.accepted:type_name -> state.v1.PackageAuthority
214, // 111: state.v1.AcceptPackageAuthorityResponse.package:type_name -> state.v1.InstalledPackage
227, // 112: state.v1.AccessPrincipal.memberships:type_name -> state.v1.PrincipalMembership
228, // 113: state.v1.GetPrincipalResponse.principal:type_name -> state.v1.AccessPrincipal
230, // 114: state.v1.ListPoliciesResponse.policies:type_name -> state.v1.AccessPolicy
230, // 115: state.v1.PutPolicyRequest.policy:type_name -> state.v1.AccessPolicy
230, // 116: state.v1.DeletePolicyRequest.policy:type_name -> state.v1.AccessPolicy
246, // 117: state.v1.AccessDenial.at:type_name -> google.protobuf.Timestamp
239, // 118: state.v1.RecordDenialRequest.denial:type_name -> state.v1.AccessDenial
239, // 119: state.v1.ListDenialsResponse.denials:type_name -> state.v1.AccessDenial
216, // 120: state.v1.StateStoreService.InstallPackage:input_type -> state.v1.InstallPackageRequest
218, // 121: state.v1.StateStoreService.GetInstalledPackage:input_type -> state.v1.GetInstalledPackageRequest
220, // 122: state.v1.StateStoreService.ListInstalledPackages:input_type -> state.v1.ListInstalledPackagesRequest
222, // 123: state.v1.StateStoreService.AcceptPackageAuthority:input_type -> state.v1.AcceptPackageAuthorityRequest
224, // 124: state.v1.StateStoreService.RemoveInstalledPackage:input_type -> state.v1.RemoveInstalledPackageRequest
0, // 125: state.v1.StateStoreService.RegisterTaskGrant:input_type -> state.v1.RegisterTaskGrantRequest
2, // 126: state.v1.StateStoreService.RevokeTaskGrant:input_type -> state.v1.RevokeTaskGrantRequest
4, // 127: state.v1.StateStoreService.ResolveTaskGrant:input_type -> state.v1.ResolveTaskGrantRequest
8, // 128: state.v1.StateStoreService.ListIdentities:input_type -> state.v1.ListIdentitiesRequest
10, // 129: state.v1.StateStoreService.GetIdentity:input_type -> state.v1.GetIdentityRequest
12, // 130: state.v1.StateStoreService.CreateIdentity:input_type -> state.v1.CreateIdentityRequest
13, // 131: state.v1.StateStoreService.RenameIdentity:input_type -> state.v1.RenameIdentityRequest
14, // 132: state.v1.StateStoreService.SuspendIdentity:input_type -> state.v1.SuspendIdentityRequest
15, // 133: state.v1.StateStoreService.ReactivateIdentity:input_type -> state.v1.ReactivateIdentityRequest
16, // 134: state.v1.StateStoreService.RetireIdentity:input_type -> state.v1.RetireIdentityRequest
22, // 135: state.v1.StateStoreService.ResolveIdentitySubject:input_type -> state.v1.ResolveIdentitySubjectRequest
24, // 136: state.v1.StateStoreService.BindIdentitySubject:input_type -> state.v1.BindIdentitySubjectRequest
27, // 137: state.v1.StateStoreService.AddPersonalToken:input_type -> state.v1.AddPersonalTokenRequest
29, // 138: state.v1.StateStoreService.ListPersonalTokens:input_type -> state.v1.ListPersonalTokensRequest
31, // 139: state.v1.StateStoreService.RevokePersonalToken:input_type -> state.v1.RevokePersonalTokenRequest
47, // 140: state.v1.StateStoreService.EnqueueIssue:input_type -> state.v1.EnqueueIssueRequest
49, // 141: state.v1.StateStoreService.EnqueueChatTask:input_type -> state.v1.EnqueueChatTaskRequest
51, // 142: state.v1.StateStoreService.ClaimNext:input_type -> state.v1.ClaimNextRequest
53, // 143: state.v1.StateStoreService.ClaimByIssue:input_type -> state.v1.ClaimByIssueRequest
55, // 144: state.v1.StateStoreService.Transition:input_type -> state.v1.TransitionRequest
71, // 145: state.v1.StateStoreService.Update:input_type -> state.v1.UpdateRequest
57, // 146: state.v1.StateStoreService.StartStep:input_type -> state.v1.StartStepRequest
59, // 147: state.v1.StateStoreService.FinishStep:input_type -> state.v1.FinishStepRequest
61, // 148: state.v1.StateStoreService.CancelExecution:input_type -> state.v1.CancelExecutionRequest
64, // 149: state.v1.StateStoreService.ListSteps:input_type -> state.v1.ListStepsRequest
67, // 150: state.v1.StateStoreService.GetHarnessSecret:input_type -> state.v1.GetHarnessSecretRequest
69, // 151: state.v1.StateStoreService.PutHarnessSecret:input_type -> state.v1.PutHarnessSecretRequest
73, // 152: state.v1.StateStoreService.Requeue:input_type -> state.v1.RequeueRequest
75, // 153: state.v1.StateStoreService.ParkTask:input_type -> state.v1.ParkTaskRequest
77, // 154: state.v1.StateStoreService.RecoverStale:input_type -> state.v1.RecoverStaleRequest
79, // 155: state.v1.StateStoreService.ArchiveTask:input_type -> state.v1.ArchiveTaskRequest
81, // 156: state.v1.StateStoreService.RetryTask:input_type -> state.v1.RetryTaskRequest
83, // 157: state.v1.StateStoreService.RespondReviewGate:input_type -> state.v1.RespondReviewGateRequest
85, // 158: state.v1.StateStoreService.BeginRemediation:input_type -> state.v1.BeginRemediationRequest
87, // 159: state.v1.StateStoreService.UpdateReviewPayload:input_type -> state.v1.UpdateReviewPayloadRequest
89, // 160: state.v1.StateStoreService.SetReviewCursors:input_type -> state.v1.SetReviewCursorsRequest
91, // 161: state.v1.StateStoreService.TaskByIssue:input_type -> state.v1.TaskByIssueRequest
93, // 162: state.v1.StateStoreService.OpenTaskByPR:input_type -> state.v1.OpenTaskByPRRequest
95, // 163: state.v1.StateStoreService.TaskByID:input_type -> state.v1.TaskByIDRequest
97, // 164: state.v1.StateStoreService.OpenPRs:input_type -> state.v1.OpenPRsRequest
99, // 165: state.v1.StateStoreService.ClearTerminalTasks:input_type -> state.v1.ClearTerminalTasksRequest
101, // 166: state.v1.StateStoreService.Tasks:input_type -> state.v1.TasksRequest
103, // 167: state.v1.StateStoreService.StatusCounts:input_type -> state.v1.StatusCountsRequest
105, // 168: state.v1.StateStoreService.InsertEvent:input_type -> state.v1.InsertEventRequest
107, // 169: state.v1.StateStoreService.EventsSince:input_type -> state.v1.EventsSinceRequest
109, // 170: state.v1.StateStoreService.TaskEvents:input_type -> state.v1.TaskEventsRequest
111, // 171: state.v1.StateStoreService.WorkflowStats:input_type -> state.v1.WorkflowStatsRequest
113, // 172: state.v1.StateStoreService.StageStats:input_type -> state.v1.StageStatsRequest
115, // 173: state.v1.StateStoreService.TokensByDay:input_type -> state.v1.TokensByDayRequest
118, // 174: state.v1.StateStoreService.PutConfigSnapshot:input_type -> state.v1.PutConfigSnapshotRequest
120, // 175: state.v1.StateStoreService.GetConfigSnapshot:input_type -> state.v1.GetConfigSnapshotRequest
123, // 176: state.v1.StateStoreService.PutChannelStatus:input_type -> state.v1.PutChannelStatusRequest
125, // 177: state.v1.StateStoreService.ListChannelStatus:input_type -> state.v1.ListChannelStatusRequest
128, // 178: state.v1.StateStoreService.PutApplyStatus:input_type -> state.v1.PutApplyStatusRequest
130, // 179: state.v1.StateStoreService.ListApplyStatus:input_type -> state.v1.ListApplyStatusRequest
138, // 180: state.v1.StateStoreService.PutPresence:input_type -> state.v1.PutPresenceRequest
133, // 181: state.v1.StateStoreService.RecordCaptureRefusal:input_type -> state.v1.RecordCaptureRefusalRequest
135, // 182: state.v1.StateStoreService.ListCaptureRefusals:input_type -> state.v1.ListCaptureRefusalsRequest
140, // 183: state.v1.StateStoreService.ListPresence:input_type -> state.v1.ListPresenceRequest
143, // 184: state.v1.StateStoreService.ReadTaskLog:input_type -> state.v1.ReadTaskLogRequest
145, // 185: state.v1.StateStoreService.StreamTaskLogContent:input_type -> state.v1.StreamTaskLogContentRequest
147, // 186: state.v1.StateStoreService.InsertCapture:input_type -> state.v1.InsertCaptureRequest
149, // 187: state.v1.StateStoreService.StreamCaptures:input_type -> state.v1.StreamCapturesRequest
151, // 188: state.v1.StateStoreService.InsertMapping:input_type -> state.v1.InsertMappingRequest
153, // 189: state.v1.StateStoreService.GetMapping:input_type -> state.v1.GetMappingRequest
155, // 190: state.v1.StateStoreService.ListMappings:input_type -> state.v1.ListMappingsRequest
157, // 191: state.v1.StateStoreService.UpdateMapping:input_type -> state.v1.UpdateMappingRequest
159, // 192: state.v1.StateStoreService.DeleteMapping:input_type -> state.v1.DeleteMappingRequest
161, // 193: state.v1.StateStoreService.RecordMappingMatch:input_type -> state.v1.RecordMappingMatchRequest
163, // 194: state.v1.StateStoreService.InsertEventType:input_type -> state.v1.InsertEventTypeRequest
165, // 195: state.v1.StateStoreService.UpdateEventType:input_type -> state.v1.UpdateEventTypeRequest
167, // 196: state.v1.StateStoreService.DeleteEventType:input_type -> state.v1.DeleteEventTypeRequest
169, // 197: state.v1.StateStoreService.ListEventTypes:input_type -> state.v1.ListEventTypesRequest
171, // 198: state.v1.StateStoreService.InsertBinding:input_type -> state.v1.InsertBindingRequest
173, // 199: state.v1.StateStoreService.GetBinding:input_type -> state.v1.GetBindingRequest
175, // 200: state.v1.StateStoreService.ListBindings:input_type -> state.v1.ListBindingsRequest
199, // 201: state.v1.StateStoreService.ListDispatches:input_type -> state.v1.ListDispatchesRequest
177, // 202: state.v1.StateStoreService.UpdateBinding:input_type -> state.v1.UpdateBindingRequest
179, // 203: state.v1.StateStoreService.DeleteBinding:input_type -> state.v1.DeleteBindingRequest
181, // 204: state.v1.StateStoreService.ApproveBinding:input_type -> state.v1.ApproveBindingRequest
183, // 205: state.v1.StateStoreService.InsertSource:input_type -> state.v1.InsertSourceRequest
185, // 206: state.v1.StateStoreService.GetSource:input_type -> state.v1.GetSourceRequest
187, // 207: state.v1.StateStoreService.ListSources:input_type -> state.v1.ListSourcesRequest
189, // 208: state.v1.StateStoreService.SetSourceSigning:input_type -> state.v1.SetSourceSigningRequest
191, // 209: state.v1.StateStoreService.SetSourceSecret:input_type -> state.v1.SetSourceSecretRequest
193, // 210: state.v1.StateStoreService.ArmedBindingsForSource:input_type -> state.v1.ArmedBindingsForSourceRequest
195, // 211: state.v1.StateStoreService.RecordDispatch:input_type -> state.v1.RecordDispatchRequest
197, // 212: state.v1.StateStoreService.SetDispatchTask:input_type -> state.v1.SetDispatchTaskRequest
202, // 213: state.v1.StateStoreService.RecordPlaybookDispatch:input_type -> state.v1.RecordPlaybookDispatchRequest
204, // 214: state.v1.StateStoreService.DeletePlaybookDispatches:input_type -> state.v1.DeletePlaybookDispatchesRequest
206, // 215: state.v1.StateStoreService.StreamUndispatchedCaptures:input_type -> state.v1.StreamUndispatchedCapturesRequest
208, // 216: state.v1.StateStoreService.EnqueueBindingTask:input_type -> state.v1.EnqueueBindingTaskRequest
210, // 217: state.v1.StateStoreService.EnqueueCallTask:input_type -> state.v1.EnqueueCallTaskRequest
212, // 218: state.v1.StateStoreService.WorkflowCallStatus:input_type -> state.v1.WorkflowCallStatusRequest
226, // 219: state.v1.StateStoreService.GetPrincipal:input_type -> state.v1.GetPrincipalRequest
231, // 220: state.v1.StateStoreService.ListPolicies:input_type -> state.v1.ListPoliciesRequest
233, // 221: state.v1.StateStoreService.PutPolicy:input_type -> state.v1.PutPolicyRequest
235, // 222: state.v1.StateStoreService.DeletePolicy:input_type -> state.v1.DeletePolicyRequest
237, // 223: state.v1.StateStoreService.EnsureShippedOrgPolicies:input_type -> state.v1.EnsureShippedOrgPoliciesRequest
240, // 224: state.v1.StateStoreService.RecordDenial:input_type -> state.v1.RecordDenialRequest
242, // 225: state.v1.StateStoreService.ListDenials:input_type -> state.v1.ListDenialsRequest
217, // 226: state.v1.StateStoreService.InstallPackage:output_type -> state.v1.InstallPackageResponse
219, // 227: state.v1.StateStoreService.GetInstalledPackage:output_type -> state.v1.GetInstalledPackageResponse
221, // 228: state.v1.StateStoreService.ListInstalledPackages:output_type -> state.v1.ListInstalledPackagesResponse
223, // 229: state.v1.StateStoreService.AcceptPackageAuthority:output_type -> state.v1.AcceptPackageAuthorityResponse
225, // 230: state.v1.StateStoreService.RemoveInstalledPackage:output_type -> state.v1.RemoveInstalledPackageResponse
1, // 231: state.v1.StateStoreService.RegisterTaskGrant:output_type -> state.v1.RegisterTaskGrantResponse
3, // 232: state.v1.StateStoreService.RevokeTaskGrant:output_type -> state.v1.RevokeTaskGrantResponse
5, // 233: state.v1.StateStoreService.ResolveTaskGrant:output_type -> state.v1.ResolveTaskGrantResponse
9, // 234: state.v1.StateStoreService.ListIdentities:output_type -> state.v1.ListIdentitiesResponse
11, // 235: state.v1.StateStoreService.GetIdentity:output_type -> state.v1.GetIdentityResponse
17, // 236: state.v1.StateStoreService.CreateIdentity:output_type -> state.v1.CreateIdentityResponse
18, // 237: state.v1.StateStoreService.RenameIdentity:output_type -> state.v1.RenameIdentityResponse
19, // 238: state.v1.StateStoreService.SuspendIdentity:output_type -> state.v1.SuspendIdentityResponse
20, // 239: state.v1.StateStoreService.ReactivateIdentity:output_type -> state.v1.ReactivateIdentityResponse
21, // 240: state.v1.StateStoreService.RetireIdentity:output_type -> state.v1.RetireIdentityResponse
23, // 241: state.v1.StateStoreService.ResolveIdentitySubject:output_type -> state.v1.ResolveIdentitySubjectResponse
25, // 242: state.v1.StateStoreService.BindIdentitySubject:output_type -> state.v1.BindIdentitySubjectResponse
28, // 243: state.v1.StateStoreService.AddPersonalToken:output_type -> state.v1.AddPersonalTokenResponse
30, // 244: state.v1.StateStoreService.ListPersonalTokens:output_type -> state.v1.ListPersonalTokensResponse
32, // 245: state.v1.StateStoreService.RevokePersonalToken:output_type -> state.v1.RevokePersonalTokenResponse
48, // 246: state.v1.StateStoreService.EnqueueIssue:output_type -> state.v1.EnqueueIssueResponse
50, // 247: state.v1.StateStoreService.EnqueueChatTask:output_type -> state.v1.EnqueueChatTaskResponse
52, // 248: state.v1.StateStoreService.ClaimNext:output_type -> state.v1.ClaimNextResponse
54, // 249: state.v1.StateStoreService.ClaimByIssue:output_type -> state.v1.ClaimByIssueResponse
56, // 250: state.v1.StateStoreService.Transition:output_type -> state.v1.TransitionResponse
72, // 251: state.v1.StateStoreService.Update:output_type -> state.v1.UpdateResponse
58, // 252: state.v1.StateStoreService.StartStep:output_type -> state.v1.StartStepResponse
60, // 253: state.v1.StateStoreService.FinishStep:output_type -> state.v1.FinishStepResponse
62, // 254: state.v1.StateStoreService.CancelExecution:output_type -> state.v1.CancelExecutionResponse
65, // 255: state.v1.StateStoreService.ListSteps:output_type -> state.v1.ListStepsResponse
68, // 256: state.v1.StateStoreService.GetHarnessSecret:output_type -> state.v1.GetHarnessSecretResponse
70, // 257: state.v1.StateStoreService.PutHarnessSecret:output_type -> state.v1.PutHarnessSecretResponse
74, // 258: state.v1.StateStoreService.Requeue:output_type -> state.v1.RequeueResponse
76, // 259: state.v1.StateStoreService.ParkTask:output_type -> state.v1.ParkTaskResponse
78, // 260: state.v1.StateStoreService.RecoverStale:output_type -> state.v1.RecoverStaleResponse
80, // 261: state.v1.StateStoreService.ArchiveTask:output_type -> state.v1.ArchiveTaskResponse
82, // 262: state.v1.StateStoreService.RetryTask:output_type -> state.v1.RetryTaskResponse
84, // 263: state.v1.StateStoreService.RespondReviewGate:output_type -> state.v1.RespondReviewGateResponse
86, // 264: state.v1.StateStoreService.BeginRemediation:output_type -> state.v1.BeginRemediationResponse
88, // 265: state.v1.StateStoreService.UpdateReviewPayload:output_type -> state.v1.UpdateReviewPayloadResponse
90, // 266: state.v1.StateStoreService.SetReviewCursors:output_type -> state.v1.SetReviewCursorsResponse
92, // 267: state.v1.StateStoreService.TaskByIssue:output_type -> state.v1.TaskByIssueResponse
94, // 268: state.v1.StateStoreService.OpenTaskByPR:output_type -> state.v1.OpenTaskByPRResponse
96, // 269: state.v1.StateStoreService.TaskByID:output_type -> state.v1.TaskByIDResponse
98, // 270: state.v1.StateStoreService.OpenPRs:output_type -> state.v1.OpenPRsResponse
100, // 271: state.v1.StateStoreService.ClearTerminalTasks:output_type -> state.v1.ClearTerminalTasksResponse
102, // 272: state.v1.StateStoreService.Tasks:output_type -> state.v1.TasksResponse
104, // 273: state.v1.StateStoreService.StatusCounts:output_type -> state.v1.StatusCountsResponse
106, // 274: state.v1.StateStoreService.InsertEvent:output_type -> state.v1.InsertEventResponse
108, // 275: state.v1.StateStoreService.EventsSince:output_type -> state.v1.EventsSinceResponse
110, // 276: state.v1.StateStoreService.TaskEvents:output_type -> state.v1.TaskEventsResponse
112, // 277: state.v1.StateStoreService.WorkflowStats:output_type -> state.v1.WorkflowStatsResponse
114, // 278: state.v1.StateStoreService.StageStats:output_type -> state.v1.StageStatsResponse
116, // 279: state.v1.StateStoreService.TokensByDay:output_type -> state.v1.TokensByDayResponse
119, // 280: state.v1.StateStoreService.PutConfigSnapshot:output_type -> state.v1.PutConfigSnapshotResponse
121, // 281: state.v1.StateStoreService.GetConfigSnapshot:output_type -> state.v1.GetConfigSnapshotResponse
124, // 282: state.v1.StateStoreService.PutChannelStatus:output_type -> state.v1.PutChannelStatusResponse
126, // 283: state.v1.StateStoreService.ListChannelStatus:output_type -> state.v1.ListChannelStatusResponse
129, // 284: state.v1.StateStoreService.PutApplyStatus:output_type -> state.v1.PutApplyStatusResponse
131, // 285: state.v1.StateStoreService.ListApplyStatus:output_type -> state.v1.ListApplyStatusResponse
139, // 286: state.v1.StateStoreService.PutPresence:output_type -> state.v1.PutPresenceResponse
134, // 287: state.v1.StateStoreService.RecordCaptureRefusal:output_type -> state.v1.RecordCaptureRefusalResponse
137, // 288: state.v1.StateStoreService.ListCaptureRefusals:output_type -> state.v1.ListCaptureRefusalsResponse
141, // 289: state.v1.StateStoreService.ListPresence:output_type -> state.v1.ListPresenceResponse
144, // 290: state.v1.StateStoreService.ReadTaskLog:output_type -> state.v1.ReadTaskLogResponse
146, // 291: state.v1.StateStoreService.StreamTaskLogContent:output_type -> state.v1.StreamTaskLogContentResponse
148, // 292: state.v1.StateStoreService.InsertCapture:output_type -> state.v1.InsertCaptureResponse
150, // 293: state.v1.StateStoreService.StreamCaptures:output_type -> state.v1.StreamCapturesResponse
152, // 294: state.v1.StateStoreService.InsertMapping:output_type -> state.v1.InsertMappingResponse
154, // 295: state.v1.StateStoreService.GetMapping:output_type -> state.v1.GetMappingResponse
156, // 296: state.v1.StateStoreService.ListMappings:output_type -> state.v1.ListMappingsResponse
158, // 297: state.v1.StateStoreService.UpdateMapping:output_type -> state.v1.UpdateMappingResponse
160, // 298: state.v1.StateStoreService.DeleteMapping:output_type -> state.v1.DeleteMappingResponse
162, // 299: state.v1.StateStoreService.RecordMappingMatch:output_type -> state.v1.RecordMappingMatchResponse
164, // 300: state.v1.StateStoreService.InsertEventType:output_type -> state.v1.InsertEventTypeResponse
166, // 301: state.v1.StateStoreService.UpdateEventType:output_type -> state.v1.UpdateEventTypeResponse
168, // 302: state.v1.StateStoreService.DeleteEventType:output_type -> state.v1.DeleteEventTypeResponse
170, // 303: state.v1.StateStoreService.ListEventTypes:output_type -> state.v1.ListEventTypesResponse
172, // 304: state.v1.StateStoreService.InsertBinding:output_type -> state.v1.InsertBindingResponse
174, // 305: state.v1.StateStoreService.GetBinding:output_type -> state.v1.GetBindingResponse
176, // 306: state.v1.StateStoreService.ListBindings:output_type -> state.v1.ListBindingsResponse
201, // 307: state.v1.StateStoreService.ListDispatches:output_type -> state.v1.ListDispatchesResponse
178, // 308: state.v1.StateStoreService.UpdateBinding:output_type -> state.v1.UpdateBindingResponse
180, // 309: state.v1.StateStoreService.DeleteBinding:output_type -> state.v1.DeleteBindingResponse
182, // 310: state.v1.StateStoreService.ApproveBinding:output_type -> state.v1.ApproveBindingResponse
184, // 311: state.v1.StateStoreService.InsertSource:output_type -> state.v1.InsertSourceResponse
186, // 312: state.v1.StateStoreService.GetSource:output_type -> state.v1.GetSourceResponse
188, // 313: state.v1.StateStoreService.ListSources:output_type -> state.v1.ListSourcesResponse
190, // 314: state.v1.StateStoreService.SetSourceSigning:output_type -> state.v1.SetSourceSigningResponse
192, // 315: state.v1.StateStoreService.SetSourceSecret:output_type -> state.v1.SetSourceSecretResponse
194, // 316: state.v1.StateStoreService.ArmedBindingsForSource:output_type -> state.v1.ArmedBindingsForSourceResponse
196, // 317: state.v1.StateStoreService.RecordDispatch:output_type -> state.v1.RecordDispatchResponse
198, // 318: state.v1.StateStoreService.SetDispatchTask:output_type -> state.v1.SetDispatchTaskResponse
203, // 319: state.v1.StateStoreService.RecordPlaybookDispatch:output_type -> state.v1.RecordPlaybookDispatchResponse
205, // 320: state.v1.StateStoreService.DeletePlaybookDispatches:output_type -> state.v1.DeletePlaybookDispatchesResponse
207, // 321: state.v1.StateStoreService.StreamUndispatchedCaptures:output_type -> state.v1.StreamUndispatchedCapturesResponse
209, // 322: state.v1.StateStoreService.EnqueueBindingTask:output_type -> state.v1.EnqueueBindingTaskResponse
211, // 323: state.v1.StateStoreService.EnqueueCallTask:output_type -> state.v1.EnqueueCallTaskResponse
213, // 324: state.v1.StateStoreService.WorkflowCallStatus:output_type -> state.v1.WorkflowCallStatusResponse
229, // 325: state.v1.StateStoreService.GetPrincipal:output_type -> state.v1.GetPrincipalResponse
232, // 326: state.v1.StateStoreService.ListPolicies:output_type -> state.v1.ListPoliciesResponse
234, // 327: state.v1.StateStoreService.PutPolicy:output_type -> state.v1.PutPolicyResponse
236, // 328: state.v1.StateStoreService.DeletePolicy:output_type -> state.v1.DeletePolicyResponse
238, // 329: state.v1.StateStoreService.EnsureShippedOrgPolicies:output_type -> state.v1.EnsureShippedOrgPoliciesResponse
241, // 330: state.v1.StateStoreService.RecordDenial:output_type -> state.v1.RecordDenialResponse
243, // 331: state.v1.StateStoreService.ListDenials:output_type -> state.v1.ListDenialsResponse
226, // [226:332] is the sub-list for method output_type
120, // [120:226] is the sub-list for method input_type
120, // [120:120] is the sub-list for extension type_name
120, // [120:120] is the sub-list for extension extendee
0, // [0:120] is the sub-list for field type_name
}
func init() { file_state_v1_state_proto_init() }
@@ -124,7 +124,10 @@ type TaskQueries interface {
TaskByID(ctx context.Context, taskID int64) (*task.Task, error)
OpenPRs(ctx context.Context) ([]task.Task, error)
ClearTerminalTasks(ctx context.Context) (int64, error)
// Tasks returns the most recently updated tasks.
Tasks(ctx context.Context, limit int) ([]task.Task, error)
// TasksPage returns one page of tasks, most recently updated first.
TasksPage(ctx context.Context, page TaskPage) ([]task.Task, error)
StatusCounts(ctx context.Context) (map[string]int, error)
}
@@ -246,6 +249,21 @@ type SourceStore interface {
SetSourceSecret(ctx context.Context, path, secret string) error
}
// TaskPage selects one page of the task list. Empty Statuses matches every
// status. A zero After starts at the newest task; otherwise the page begins
// after the task it names, in (updated_at, id) descending order.
type TaskPage struct {
Statuses []string
After TaskCursor
Limit int
}
// TaskCursor is the position of the last task a page returned.
type TaskCursor struct {
UpdatedAt time.Time
ID int64
}
// Dispatch is one binding/capture ledger row: the task it started, or the
// reason it started none.
type Dispatch struct {
@@ -8,6 +8,8 @@ package postgresdb
import (
"context"
"time"
"github.com/jackc/pgx/v5/pgtype"
)
const appendPendingReview = `-- name: AppendPendingReview :execrows
@@ -480,9 +482,21 @@ SELECT id, owner, repo, issue_number, title, status, workflow,
pr_number, tokens_used, iterations, attempt, park_reason, retry_count,
created_at, updated_at, plan, source, identity, binding_id, binding_version,
outputs, review_gate, rereview_rounds
FROM tasks ORDER BY updated_at DESC LIMIT $1
FROM tasks
WHERE (cardinality($1::text[]) = 0 OR status = ANY($1::text[]))
AND ($2::timestamptz IS NULL
OR (updated_at, id) < ($2::timestamptz, $3::bigint))
ORDER BY updated_at DESC, id DESC
LIMIT $4
`
type ListTaskSummariesParams struct {
Statuses []string
BeforeUpdated pgtype.Timestamptz
BeforeID int64
PageLimit int32
}
type ListTaskSummariesRow struct {
ID int64
Owner string
@@ -518,8 +532,13 @@ type ListTaskSummariesRow struct {
// wrote is what the operator reads before answering it
// (docs/prds/pr-review-operator-response.md, "The review the operator
// answers"), and the round count is the cap's visible half.
func (q *Queries) ListTaskSummaries(ctx context.Context, limit int32) ([]ListTaskSummariesRow, error) {
rows, err := q.db.Query(ctx, listTaskSummaries, limit)
func (q *Queries) ListTaskSummaries(ctx context.Context, arg ListTaskSummariesParams) ([]ListTaskSummariesRow, error) {
rows, err := q.db.Query(ctx, listTaskSummaries,
arg.Statuses,
arg.BeforeUpdated,
arg.BeforeID,
arg.PageLimit,
)
if err != nil {
return nil, err
}
@@ -42,7 +42,12 @@ SELECT id, owner, repo, issue_number, title, status, workflow,
pr_number, tokens_used, iterations, attempt, park_reason, retry_count,
created_at, updated_at, plan, source, identity, binding_id, binding_version,
outputs, review_gate, rereview_rounds
FROM tasks ORDER BY updated_at DESC LIMIT $1;
FROM tasks
WHERE (cardinality(@statuses::text[]) = 0 OR status = ANY(@statuses::text[]))
AND (sqlc.narg(before_updated)::timestamptz IS NULL
OR (updated_at, id) < (sqlc.narg(before_updated)::timestamptz, @before_id::bigint))
ORDER BY updated_at DESC, id DESC
LIMIT @page_limit;
-- name: CountTasksByStatus :many
SELECT status, count(*)::int AS count FROM tasks GROUP BY status;
+16 -2
View File
@@ -7,6 +7,7 @@ import (
"fmt"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgtype"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/samcharles93/archie-core/internal/domain/org"
@@ -627,9 +628,22 @@ func (s *Store) ClearTerminalTasks(ctx context.Context) (int64, error) {
return s.queries().ClearTerminalTasks(ctx)
}
// Tasks returns all tasks, newest first (dashboard listing).
// Tasks returns the most recently updated tasks.
func (s *Store) Tasks(ctx context.Context, limit int) ([]workflow.Task, error) {
rows, err := s.queries().ListTaskSummaries(ctx, int32(limit))
return s.TasksPage(ctx, storecontract.TaskPage{Limit: limit})
}
// TasksPage returns one page of tasks, most recently updated first.
func (s *Store) TasksPage(ctx context.Context, page storecontract.TaskPage) ([]workflow.Task, error) {
params := postgresdb.ListTaskSummariesParams{
Statuses: append([]string{}, page.Statuses...),
PageLimit: int32(min(max(page.Limit, 1), 500)), //nolint:gosec // clamped
}
if page.After.ID != 0 {
params.BeforeUpdated = pgtype.Timestamptz{Time: page.After.UpdatedAt, Valid: true}
params.BeforeID = page.After.ID
}
rows, err := s.queries().ListTaskSummaries(ctx, params)
if err != nil {
return nil, err
}
+10 -1
View File
@@ -288,8 +288,17 @@ func (c *Client) ClearTerminalTasks(ctx context.Context) (int64, error) {
return r.Count, nil
}
// Tasks returns the most recently updated tasks.
func (c *Client) Tasks(ctx context.Context, limit int) ([]task.Task, error) {
r, err := c.client.Tasks(ctx, &pb.TasksRequest{Limit: int64(limit)})
return c.TasksPage(ctx, storecontract.TaskPage{Limit: limit})
}
// TasksPage returns one page of tasks, most recently updated first.
func (c *Client) TasksPage(ctx context.Context, page storecontract.TaskPage) ([]task.Task, error) {
r, err := c.client.Tasks(ctx, &pb.TasksRequest{
Limit: int64(page.Limit), Statuses: page.Statuses,
AfterUpdatedAt: timestamp(page.After.UpdatedAt), AfterId: page.After.ID,
})
if err != nil {
return nil, unmapError(err)
}
+4 -1
View File
@@ -416,7 +416,10 @@ func (s *server) ClearTerminalTasks(ctx context.Context, _ *pb.ClearTerminalTask
}
func (s *server) Tasks(ctx context.Context, r *pb.TasksRequest) (*pb.TasksResponse, error) {
tasks, err := s.deps.Tasks.Tasks(ctx, int(r.Limit))
tasks, err := s.deps.Tasks.TasksPage(ctx, storecontract.TaskPage{
Statuses: r.Statuses, Limit: int(r.Limit),
After: storecontract.TaskCursor{UpdatedAt: timeValue(r.AfterUpdatedAt), ID: r.AfterId},
})
if err != nil {
return nil, s.logErr("Tasks", err)
}
+62 -2
View File
@@ -11,6 +11,7 @@ import (
"net/url"
"strconv"
"strings"
"time"
"github.com/samcharles93/archie-core/internal/domain/storecontract"
"github.com/samcharles93/archie-core/internal/domain/taskactions"
@@ -41,18 +42,46 @@ func (s *Server) handleSummary(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
needsYou := 0
for _, id := range needsYouStatuses() {
needsYou += statuses[id]
}
writeJSON(w, map[string]any{
"statuses": statuses, "workflows": workflows,
"statuses": statuses, "needs_you": needsYou, "workflows": workflows,
"stages": stages, "tokens_by_day": days,
})
}
// needsYouStatuses are the statuses the "needs you" filter and count group.
func needsYouStatuses() []string {
var ids []string
for _, meta := range taskstate.Statuses() {
if meta.NeedsYou {
ids = append(ids, meta.ID)
}
}
return ids
}
// handleTasks serves one page of tasks, most recently updated first. ?status
// narrows it (needs_you is the grouped filter), ?limit sizes it, and ?cursor
// resumes after the previous page; a full page answers the next cursor in the
// X-Next-Cursor header.
func (s *Server) handleTasks(w http.ResponseWriter, r *http.Request) {
tasks, err := s.Store.Tasks(r.Context(), 100)
page, err := taskPageFrom(r.URL.Query())
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
tasks, err := s.Store.TasksPage(r.Context(), page)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
if len(tasks) == page.Limit {
last := tasks[len(tasks)-1]
w.Header().Set("X-Next-Cursor", fmt.Sprintf("%d.%d", last.UpdatedAt.UnixNano(), last.ID))
}
forge := s.resolveForge(r.Context())
views := make([]taskView, len(tasks))
for i := range tasks {
@@ -62,6 +91,37 @@ func (s *Server) handleTasks(w http.ResponseWriter, r *http.Request) {
writeJSON(w, views)
}
const defaultTaskPage = 100
// taskPageFrom reads the task list's query parameters.
func taskPageFrom(q url.Values) (storecontract.TaskPage, error) {
page := storecontract.TaskPage{Limit: defaultTaskPage}
switch status := q.Get("status"); status {
case "":
case "needs_you":
page.Statuses = needsYouStatuses()
default:
page.Statuses = []string{status}
}
if raw := q.Get("limit"); raw != "" {
limit, err := strconv.Atoi(raw)
if err != nil || limit < 1 || limit > 500 {
return page, fmt.Errorf("limit must be 1 to 500")
}
page.Limit = limit
}
if raw := q.Get("cursor"); raw != "" {
nanos, id, ok := strings.Cut(raw, ".")
n, nerr := strconv.ParseInt(nanos, 10, 64)
i, ierr := strconv.ParseInt(id, 10, 64)
if !ok || nerr != nil || ierr != nil || i <= 0 {
return page, fmt.Errorf("invalid cursor")
}
page.After = storecontract.TaskCursor{UpdatedAt: time.Unix(0, n), ID: i}
}
return page, nil
}
type taskView struct {
task.Task
Actions []taskstate.Action `json:"actions"`
+8 -1
View File
@@ -833,7 +833,14 @@ message OpenPRsResponse { repeated Task tasks = 1; }
message ClearTerminalTasksRequest {}
message ClearTerminalTasksResponse { int64 count = 1; }
message TasksRequest { int64 limit = 1; }
// TasksRequest selects one page of tasks, most recently updated first. Empty
// statuses matches every status; after_id 0 starts at the newest task.
message TasksRequest {
int64 limit = 1;
repeated string statuses = 2;
google.protobuf.Timestamp after_updated_at = 3;
int64 after_id = 4;
}
message TasksResponse { repeated Task tasks = 1; }
message StatusCountsRequest {}
+15 -15
View File
@@ -1,24 +1,24 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HarnessPage.js","assets/HarnessPage.css"])))=>i.map(i=>d[i]);
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>w(e)===`[object Map]`,h=e=>w(e)===`[object Set]`,g=e=>w(e)===`[object Date]`,_=e=>w(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),C=Object.prototype.toString,w=e=>C.call(e),T=e=>w(e).slice(8,-1),E=e=>w(e)===`[object Object]`,D=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,O=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,k=ee(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,re=ee(e=>e.replace(ne,`-$1`).toLowerCase()),ie=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),ae=ee(e=>e?`on${ie(e)}`:``),A=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},le=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},ue,de=()=>ue||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},fe=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function pe(e){if(p(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=y(r)?_e(r):pe(r);if(i)for(let e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}var me=/;(?![^(]*\))/g,he=/:([^]+)/,ge=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function _e(e){let t={};return e.replace(ge,e=>e.startsWith(`/*`)?``:e).split(me).forEach(e=>{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function j(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){let r=j(e[n]);r&&(t+=r+` `)}else if(x(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ve(e){if(!e)return null;let{class:t,style:n}=e;return t&&!y(t)&&(e.class=j(t)),n&&(e.style=pe(n)),e}var ye=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,be=n(ye);ye+``;function xe(e){return!!e||e===``}function Se(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Ee(e[i],t[i],n);return r}function Ce(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Ee(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function we(e,t,n){let r=m(e),i=m(t);if(r||i||(r=h(e),i=h(t),r||i))return r&&i?Ce(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Ee(e[r],t[r],n))return!1}return String(e)===String(t)}function Te(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Ee(e,t,n){if(e===t)return!0;let r=g(e),i=g(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=b(e),i=b(t),r||i?e===t:(r=p(e),i=p(t),r||i?r&&i?Te(e,t,n,Se):!1:(r=x(e),i=x(t),r||i?!r||!i?!1:Te(e,t,n,we):String(e)===String(t))))}function De(e,t){return e.findIndex(e=>Ee(e,t))}var Oe=e=>!!(e&&e.__v_isRef===!0),M=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===C||!v(e.toString))?Oe(e)?M(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>Oe(t)?ke(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:b(t)?Ae(t):x(t)&&!p(t)&&!E(t)?String(t):t,Ae=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof eLine truncated
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>w(e)===`[object Map]`,h=e=>w(e)===`[object Set]`,g=e=>w(e)===`[object Date]`,_=e=>w(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),C=Object.prototype.toString,w=e=>C.call(e),T=e=>w(e).slice(8,-1),E=e=>w(e)===`[object Object]`,D=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,O=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,k=ee(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,re=ee(e=>e.replace(ne,`-$1`).toLowerCase()),ie=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),ae=ee(e=>e?`on${ie(e)}`:``),A=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},le=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},ue,de=()=>ue||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},fe=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function pe(e){if(p(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=y(r)?_e(r):pe(r);if(i)for(let e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}var me=/;(?![^(]*\))/g,he=/:([^]+)/,ge=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function _e(e){let t={};return e.replace(ge,e=>e.startsWith(`/*`)?``:e).split(me).forEach(e=>{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function j(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){let r=j(e[n]);r&&(t+=r+` `)}else if(x(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ve(e){if(!e)return null;let{class:t,style:n}=e;return t&&!y(t)&&(e.class=j(t)),n&&(e.style=pe(n)),e}var ye=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,be=n(ye);ye+``;function xe(e){return!!e||e===``}function Se(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Ee(e[i],t[i],n);return r}function Ce(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Ee(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function we(e,t,n){let r=m(e),i=m(t);if(r||i||(r=h(e),i=h(t),r||i))return r&&i?Ce(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Ee(e[r],t[r],n))return!1}return String(e)===String(t)}function Te(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Ee(e,t,n){if(e===t)return!0;let r=g(e),i=g(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=b(e),i=b(t),r||i?e===t:(r=p(e),i=p(t),r||i?r&&i?Te(e,t,n,Se):!1:(r=x(e),i=x(t),r||i?!r||!i?!1:Te(e,t,n,we):String(e)===String(t))))}function De(e,t){return e.findIndex(e=>Ee(e,t))}var Oe=e=>!!(e&&e.__v_isRef===!0),M=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===C||!v(e.toString))?Oe(e)?M(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>Oe(t)?ke(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:b(t)?Ae(t):x(t)&&!p(t)&&!E(t)?String(t):t,Ae=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof eLine truncated
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(pi(e,0)||ri(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!O(a)||a[0]===`.`||t&&!O(a)||u&&u.includes(a)){if(ui(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Qt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&ms(x,n,t),h&&cr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Wo(()=>{x&&ms(x,n,t),l&&g.enter(e),h&&cr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=ds(d[t]),g=h.type===qo;e?(g&&!u&&t+1<p&&ds(d[t+1]).type===qo&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,pi(r,1)||ri()),n(null,h,r,null,o,s,oi(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&si(f)&&f.data===`]`?a(t.anchor=f):(ri(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(hi(e,t)||ri(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,oi(d),s),r&&(r.vnode.el=t.el,no(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&si(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var li=new Set([`src`,`srcset`,`href`,`poster`]);function ui(e,t,n){return li.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var di=`data-allow-mismatch`,fi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function pi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(di);)e=e.parentElement;return mi(e&&e.getAttribute(di),t)}function mi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(fi[t])}}function hi(e,t){return pi(e.parentElement,1)||gi(e)||_i(t)}function gi(e){return e.nodeType===1&&mi(e.getAttribute(di),1)}function _i({props:e}){let t=e&&e[di];return typeof t==`string`&&mi(t,1)}var vi=de().requestIdleCallback||(e=>setTimeout(e,1)),yi=de().cancelIdleCallback||(e=>clearTimeout(e)),bi=(e=1e4)=>t=>{let n=vi(t,{timeout:e});return()=>yi(n)};function xi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Si=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(xi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ci=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},wi=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Ti(e,t){if(si(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(si(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ei=e=>!!e.type.__asyncLoader;function Di(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return L({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Ti(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=vs;if(Xr(e),u)return()=>Oi(u,e);let t=t=>{l=null,Ln(t,e,13,!r)};if(s&&e.suspense||Ts)return p().then(t=>()=>Oi(t,e)).catch(e=>(t(e),()=>r?G(r,{error:e}):null));let a=N(!1),c=N(),d=N(!!i),f,m;return Gi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&ki(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Oi(u,e);if(c.value&&r)return G(r,{error:c.value});if(n&&!d Line truncated
`))),e[El]=Cl(i);let a=r||i.props&&i.props.type===`number`;Wc(e,t?`change`:`input`,t=>{t.target.composing||e[El](Ol(e.value,n,a))}),(n||a)&&Wc(e,`change`,()=>{e.value=Ol(e.value,n,a)}),t||(Wc(e,`compositionstart`,wl),Wc(e,`compositionend`,Tl),Wc(e,`change`,Tl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Dl];delete e[Dl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[El](Ol(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[El]=Cl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Al={deep:!0,created(e,t,n){e[El]=Cl(n),Wc(e,`change`,()=>{let t=e._modelValue,n=Fl(e),r=e.checked,i=e[El];if(p(t)){let e=De(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Il(e,r))})},mounted:jl,beforeUpdate(e,t,n){e[El]=Cl(n),jl(e,t,n)}};function jl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=De(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Ee(t,Il(e,!0))}e.checked!==i&&(e.checked=i)}var Ml={created(e,{value:t},n){e.checked=Ee(t,n.props.value),e[El]=Cl(n),Wc(e,`change`,()=>{e[El](Fl(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[El]=Cl(r),t!==n&&(e.checked=Ee(t,r.props.value))}},Nl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Wc(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce(Fl(e)):Fl(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[El](i)}finally{Kn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[El]=Cl(r)},mounted(e,{value:t}){Pl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[El]=Cl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!mee(t,n[1],n[0]))&&Pl(e,t)}};function mee(e,t,n){if(!n||p(e))return Ee(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Pl(e,t){let n=e.multiple,r=p(t);if(!n||r||h(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Fl(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):De(t,o)>-1}else a.selected=t.has(o)}else if(Ee(Fl(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Fl(e){return`_value`in e?e._value:e.value}function Il(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var Ll={created(e,t,n){zl(e,t,n,null,`created`)},mounted(e,t,n){zl(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){zl(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){zl(e,t,n,r,`updated`)}};function Rl(e,t){switch(e){case`SELECT`:return Nl;case`TEXTAREA`:return kl;default:switch(t){case`checkbox`:return Al;case`radio`:return Ml;default:return kl}}}function zl(e,t,n,r,i){let a=Rl(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function hee(){kl.getSSRProps=({value:e})=>({value:e}),Ml.getSSRProps=({value:e},t)=>{if(t.props&&Ee(t.props.value,e))return{checked:!0}},Al.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&De(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Ll.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=Rl(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var gee=[`ctrl`,`shift`,`alt`,`meta`],_ee={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>gee.some(n=>e[`${n}Key`]&&!t.includes(n))},Bl=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=_ee[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Vl={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Hl=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=re(n.key);if(t.some(e=>e===r||Vl[e]===r))return e(n)}))},Ul=l({patchProp:nl},nc),Wl,Gl=!1;function Kl(){return Wl||=Co(Ul)}function ql(){return Wl=Gl?Wl:wo(Ul),Gl=!0,Wl}var Jl=((...e)=>{Kl().render(...e)}),Yl=((...e)=>{ql().hydrate(...e)}),Xl=((...e)=>{let t=Kl().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=$l(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Ql(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t} Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Lp;function Rp(e){Lp=e}var zp=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Bp(e){let t=e instanceof zp?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Vp(e,t){let n=await fetch(e,t);if(Lp?.(n.status===401),!n.ok)throw new zp(await Ip(n),n.status);return n}async function Hp(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Pp,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Vp(e,s);return a?await c.json():void 0}var Z={health:()=>Hp(`/health/detailed`),services:()=>Hp(`/api/services`),policies:()=>Hp(`/api/access/policies`),putPolicy:e=>Hp(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Hp(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),summary:()=>Hp(`/api/summary`),tasks:()=>Hp(`/api/tasks`),taskMeta:()=>Hp(`/api/task-meta`),task:e=>Hp(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Hp(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Hp(`/api/tasks/${encodeURIComponent(e)}/changes`+Fp(t)),taskDebug:(e,t)=>Hp(`/api/tasks/${encodeURIComponent(e)}/debug`+Fp(t)),taskAction:(e,t,n)=>Hp(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Hp(`/api/setup`),capabilities:()=>Hp(`/api/capabilities`),workflows:()=>Hp(`/api/workflows`),workflowEnabled:(e,t)=>Hp(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>Hp(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Hp(`/api/skills`),channels:()=>Hp(`/api/channels`),curators:()=>Hp(`/api/curators`),channelReload:e=>Hp(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Hp(`/api/config`),logs:e=>Hp(`/api/logs`+Fp(e)),taskLogs:(e,t)=>Hp(`/api/tasks/${encodeURIComponent(e)}/logs`+Fp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>Hp(`/api/version`),updateSnapshot:()=>Hp(`/api/chat/update`),updateInstall:e=>Hp(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>Hp(`/api/captures`+Fp({limit:e})),eventTypes:()=>Hp(`/api/event-types`),eventTypeCreate:e=>Hp(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>Hp(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>Hp(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>Hp(`/api/mappings`),mappingCreate:e=>Hp(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Hp(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Hp(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Hp(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Hp(`/api/bindings`),dispatches:(e,t)=>Hp(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>Hp(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Hp(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Hp(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Hp(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),harnessBindings:()=>Hp(`/api/harness/bindings`),sources:()=>Hp(`/api/sources`),sourceCreate:e=>Hp(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>Hp(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>Hp(`/api/sources/${encodeURIComponent(e)}/approve-unsigned`,{method:`POST`}),sourceSecret:e=>Hp(`/api/sources/${encodeURIComponent(e)}/secret`,{method:`POST`}),chatSessions:()=>Hp(`/api/chat/sessions`),chatMessages:e=>Hp(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Hp(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Hp(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Hp(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Np(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Hp(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatDangerous:()=>Hp(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Hp(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Hp(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>Vp(`/api/chat/stream`,{method:`POST`,headers:{Accept:`text/event-stream`,"Content-Type":`application/json`,"X-Archie-CSRF":`1`},body:JSON.stringify(e),signal:t.signal})};function Up(e Line truncated
`)&&(mi(e,0)||ii(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!O(a)||a[0]===`.`||t&&!O(a)||u&&u.includes(a)){if(di(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&$t(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&hs(x,n,t),h&&lr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Go(()=>{x&&hs(x,n,t),l&&g.enter(e),h&&lr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=fs(d[t]),g=h.type===Jo;e?(g&&!u&&t+1<p&&fs(d[t+1]).type===Jo&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,mi(r,1)||ii()),n(null,h,r,null,o,s,si(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&ci(f)&&f.data===`]`?a(t.anchor=f):(ii(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(gi(e,t)||ii(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,si(d),s),r&&(r.vnode.el=t.el,ro(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&ci(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var ui=new Set([`src`,`srcset`,`href`,`poster`]);function di(e,t,n){return ui.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var fi=`data-allow-mismatch`,pi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function mi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(fi);)e=e.parentElement;return hi(e&&e.getAttribute(fi),t)}function hi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(pi[t])}}function gi(e,t){return mi(e.parentElement,1)||_i(e)||vi(t)}function _i(e){return e.nodeType===1&&hi(e.getAttribute(fi),1)}function vi({props:e}){let t=e&&e[fi];return typeof t==`string`&&hi(t,1)}var yi=de().requestIdleCallback||(e=>setTimeout(e,1)),bi=de().cancelIdleCallback||(e=>clearTimeout(e)),xi=(e=1e4)=>t=>{let n=yi(t,{timeout:e});return()=>bi(n)};function Si(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Ci=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Si(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},wi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ti=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Ei(e,t){if(ci(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(ci(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Di=e=>!!e.type.__asyncLoader;function Oi(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return L({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Ei(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=ys;if(Zr(e),u)return()=>ki(u,e);let t=t=>{l=null,Rn(t,e,13,!r)};if(s&&e.suspense||Es)return p().then(t=>()=>ki(t,e)).catch(e=>(t(e),()=>r?G(r,{error:e}):null));let a=N(!1),c=N(),d=N(!!i),f,m;return Ki(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ai(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return ki(u,e);if(c.value&&r)return G(r,{error:c.value});if(n&&!d Line truncated
`))),e[Dl]=wl(i);let a=r||i.props&&i.props.type===`number`;Gc(e,t?`change`:`input`,t=>{t.target.composing||e[Dl](kl(e.value,n,a))}),(n||a)&&Gc(e,`change`,()=>{e.value=kl(e.value,n,a)}),t||(Gc(e,`compositionstart`,Tl),Gc(e,`compositionend`,El),Gc(e,`change`,El))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Ol];delete e[Ol],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Dl](kl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Dl]=wl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},jl={deep:!0,created(e,t,n){e[Dl]=wl(n),Gc(e,`change`,()=>{let t=e._modelValue,n=Il(e),r=e.checked,i=e[Dl];if(p(t)){let e=De(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Ll(e,r))})},mounted:Ml,beforeUpdate(e,t,n){e[Dl]=wl(n),Ml(e,t,n)}};function Ml(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=De(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Ee(t,Ll(e,!0))}e.checked!==i&&(e.checked=i)}var Nl={created(e,{value:t},n){e.checked=Ee(t,n.props.value),e[Dl]=wl(n),Gc(e,`change`,()=>{e[Dl](Il(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Dl]=wl(r),t!==n&&(e.checked=Ee(t,r.props.value))}},Pl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Gc(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce(Il(e)):Il(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[Dl](i)}finally{qn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Dl]=wl(r)},mounted(e,{value:t}){Fl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Dl]=wl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!pee(t,n[1],n[0]))&&Fl(e,t)}};function pee(e,t,n){if(!n||p(e))return Ee(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Fl(e,t){let n=e.multiple,r=p(t);if(!n||r||h(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Il(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):De(t,o)>-1}else a.selected=t.has(o)}else if(Ee(Il(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Il(e){return`_value`in e?e._value:e.value}function Ll(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var Rl={created(e,t,n){Bl(e,t,n,null,`created`)},mounted(e,t,n){Bl(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){Bl(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){Bl(e,t,n,r,`updated`)}};function zl(e,t){switch(e){case`SELECT`:return Pl;case`TEXTAREA`:return Al;default:switch(t){case`checkbox`:return jl;case`radio`:return Nl;default:return Al}}}function Bl(e,t,n,r,i){let a=zl(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function mee(){Al.getSSRProps=({value:e})=>({value:e}),Nl.getSSRProps=({value:e},t)=>{if(t.props&&Ee(t.props.value,e))return{checked:!0}},jl.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&De(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Rl.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=zl(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var hee=[`ctrl`,`shift`,`alt`,`meta`],gee={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>hee.some(n=>e[`${n}Key`]&&!t.includes(n))},Vl=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=gee[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},_ee={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Hl=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=re(n.key);if(t.some(e=>e===r||_ee[e]===r))return e(n)}))},Ul=l({patchProp:rl},rc),Wl,Gl=!1;function Kl(){return Wl||=wo(Ul)}function ql(){return Wl=Gl?Wl:To(Ul),Gl=!0,Wl}var Jl=((...e)=>{Kl().render(...e)}),Yl=((...e)=>{ql().hydrate(...e)}),Xl=((...e)=>{let t=Kl().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=$l(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Ql(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a}, Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ip;function Lp(e){Ip=e}var Rp=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function zp(e){let t=e instanceof Rp?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Bp(e,t){let n=await fetch(e,t);if(Ip?.(n.status===401),!n.ok)throw new Rp(await Fp(n),n.status);return n}async function Vp(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Np,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Bp(e,s);return a?await c.json():void 0}var Z={health:()=>Vp(`/health/detailed`),services:()=>Vp(`/api/services`),policies:()=>Vp(`/api/access/policies`),putPolicy:e=>Vp(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Vp(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),summary:()=>Vp(`/api/summary`),tasks:()=>Vp(`/api/tasks`),taskPage:async e=>{let t=await Bp(`/api/tasks`+Pp(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Np)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>Vp(`/api/task-meta`),task:e=>Vp(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Vp(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Vp(`/api/tasks/${encodeURIComponent(e)}/changes`+Pp(t)),taskDebug:(e,t)=>Vp(`/api/tasks/${encodeURIComponent(e)}/debug`+Pp(t)),taskAction:(e,t,n)=>Vp(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Vp(`/api/setup`),capabilities:()=>Vp(`/api/capabilities`),workflows:()=>Vp(`/api/workflows`),workflowEnabled:(e,t)=>Vp(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>Vp(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Vp(`/api/skills`),channels:()=>Vp(`/api/channels`),curators:()=>Vp(`/api/curators`),channelReload:e=>Vp(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Vp(`/api/config`),logs:e=>Vp(`/api/logs`+Pp(e)),taskLogs:(e,t)=>Vp(`/api/tasks/${encodeURIComponent(e)}/logs`+Pp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>Vp(`/api/version`),updateSnapshot:()=>Vp(`/api/chat/update`),updateInstall:e=>Vp(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>Vp(`/api/captures`+Pp({limit:e})),eventTypes:()=>Vp(`/api/event-types`),eventTypeCreate:e=>Vp(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>Vp(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>Vp(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>Vp(`/api/mappings`),mappingCreate:e=>Vp(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Vp(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Vp(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Vp(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Vp(`/api/bindings`),dispatches:(e,t)=>Vp(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>Vp(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Vp(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Vp(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Vp(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),harnessBindings:()=>Vp(`/api/harness/bindings`),sources:()=>Vp(`/api/sources`),sourceCreate:e=>Vp(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>Vp(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>Vp(`/api/sources/${encodeURIComponent(e)}/approve-unsigned`,{method:`POST`}),sourceSecret:e=>Vp(`/api/sources/${encodeURIComponent(e)}/secret`,{method:`POST`}),chatSessions:()=>Vp(`/api/chat/sessions`),chatMessages:e=>Vp(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Vp(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Vp(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Vp(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Mp(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Vp(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatDangerous:()=>Vp(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Vp(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Vp(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t Line truncated
`);u=r.pop()||``;for(let e of r){let t=e.split(`
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(im.value=n.session_id),n.type===`delta`&&(o+=n.text,lm.value=lm.value?{...lm.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],lm.value=lm.value?{...lm.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);am.value=[...am.value,{from:`assistant`,text:o,tool_calls:a}],lm.value=null,sm.value=`Ready`,await wm()}catch(e){let t=e;t.name===`AbortError`&&!c?(lm.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},sm.value=`Stopped`):(lm.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?$p(r):void 0,isRetry:i},sm.value=`Error — retry available`)}finally{clearTimeout(l),Sm=null,cm.value=!1}}function Tee(){sm.value=`Stopping…`,im.value&&Z.chatCancel(im.value).catch(()=>{}),Cm()}function Eee(){Vi(()=>{wm().catch(e=>{sm.value=e.message||`Chat unavailable`})}),Gi(()=>{Cm()})}var Dee=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Oee=L({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return X(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(V(),H(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":P(tm),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:j(r(!e.open))},[G(P(Sd),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:j(r(e.open))},[G(P(Qd),{size:22})],2)],8,Dee))}});function jm(e){return typeof e==`string`?`'${e}'`:new Aee().serialize(e)}var kee=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Mm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[kee.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Nm(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Mm[n]?Mm[n]:n+128,s=a<128&&Mm[a]?Mm[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var Aee=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Nm(e,t):n===`number`&&r===`number`?e-t:Nm(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Nm),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`FloatLine truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(rm.value=n.session_id),n.type===`delta`&&(o+=n.text,cm.value=cm.value?{...cm.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],cm.value=cm.value?{...cm.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);im.value=[...im.value,{from:`assistant`,text:o,tool_calls:a}],cm.value=null,om.value=`Ready`,await Cm()}catch(e){let t=e;t.name===`AbortError`&&!c?(cm.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},om.value=`Stopped`):(cm.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Qp(r):void 0,isRetry:i},om.value=`Error — retry available`)}finally{clearTimeout(l),xm=null,sm.value=!1}}function Tee(){om.value=`Stopping…`,rm.value&&Z.chatCancel(rm.value).catch(()=>{}),Sm()}function Eee(){Hi(()=>{Cm().catch(e=>{om.value=e.message||`Chat unavailable`})}),Ki(()=>{Sm()})}var Dee=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Oee=L({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return X(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(V(),H(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":P(em),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:j(r(!e.open))},[G(P(Sd),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:j(r(e.open))},[G(P(Qd),{size:22})],2)],8,Dee))}});function jm(e){return typeof e==`string`?`'${e}'`:new Aee().serialize(e)}var kee=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Mm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[kee.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Nm(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Mm[n]?Mm[n]:n+128,s=a<128&&Mm[a]?Mm[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var Aee=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Nm(e,t):n===`number`&&r===`number`?e-t:Nm(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Nm),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`FloatLine truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?zs(t.default({present:o.value})[0],{ref:e=>{let t=lh(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Dg=L({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=Th(n.default()),r=e.findIndex(e=>e.type!==Jo);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?J(t,i.props):t,o=ls({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Og=[`area`,`img`,`input`],kg=L({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Og.includes(r)?()=>zs(r,t):r===`template`?()=>zs(Dg,t,{default:n.default}):()=>zs(e.as,t,{default:n.default})}});function Ag(){let e=N();return{primitiveElement:e,currentElement:Y(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:lh(e))}}var[jg,Mg]=Rm(`CollapsibleRoot`),Ng=L({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=wh(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=_n(r);return Mg({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Q(),(e,t)=>(V(),U(P(kg),{as:e.as,"as-child":r.asChild,"data-state":P(i)?`open`:`closed`,"data-disabled":P(a)?``:void 0},{default:F(()=>[z(e.$slots,`default`,{open:P(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),Pg=L({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=jg();i.contentId||=gg(void 0,`reka-collapsible-content`);let a=N(),{forwardRef:o,currentElement:s}=Q(),c=N(0),l=N(0),u=Y(()=>i.open.value),d=N(u.value),f=N();I(()=>[u.value,a.value?.present],async()=>{await Kn();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=Y(()=>d.value&&i.open.value);return Vi(()=>{requestAnimationFrame(()=>{d.value=!1})}),uh(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(V(),U(P(Eg),{ref_key:`presentRef`,ref:a,present:e.forceMount||P(i).open.value,"force-mount":!0},{default:F(({present:t})=>[G(P(kg),J(e.$attrs,{id:P(i).contentId,ref:P(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:P(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:P(i).open.value?`open`:`closed`,"data-disabled":P(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:F(()=>[!P(i).unmountOnHide.value||t?z(e.$slots,`default`,{key:0}):q(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),Fg=L({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Q();let n=jg();return(e,r)=>(V(),U(P(kg),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":P(n).contentId,"aria-expanded":P(n).open.value,"data-state":P(n).open.value?`open`:`closed`,"data-disabled":P(n).disabled?.value?``:void 0,disabled:P(n).disabled?.value,onClick:P(n).onOpenToggle},{default:F(()=>[z(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function Ig({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Lg({type:e,defaultValue:t,modelValue:n}){return e||Ig({type:e,defaultValue:t,modelValue:n})}function Rg({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function zg(e,t){let n=Y(()=>Lg(e)),r=wh(e,`modelValue`,t,{defaultValue:Rg(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Pm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(Hm(t,e)){let n=t.findIndex(t=>Pm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:Y(()=>n.value===`single`)}}var[Bg,Vg]=Rm(`AccordionRoot`),Hg=L({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:! Line truncated
`))}return()=>i.value||r.value||o.value?Bs(t.default({present:o.value})[0],{ref:e=>{let t=ch(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Eg=L({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=wh(n.default()),r=e.findIndex(e=>e.type!==Yo);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?J(t,i.props):t,o=us({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Dg=[`area`,`img`,`input`],Og=L({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Dg.includes(r)?()=>Bs(r,t):r===`template`?()=>Bs(Eg,t,{default:n.default}):()=>Bs(e.as,t,{default:n.default})}});function kg(){let e=N();return{primitiveElement:e,currentElement:Y(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:ch(e))}}var[Ag,jg]=Rm(`CollapsibleRoot`),Mg=L({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=Ch(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=vn(r);return jg({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Q(),(e,t)=>(V(),U(P(Og),{as:e.as,"as-child":r.asChild,"data-state":P(i)?`open`:`closed`,"data-disabled":P(a)?``:void 0},{default:F(()=>[z(e.$slots,`default`,{open:P(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),Ng=L({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=Ag();i.contentId||=hg(void 0,`reka-collapsible-content`);let a=N(),{forwardRef:o,currentElement:s}=Q(),c=N(0),l=N(0),u=Y(()=>i.open.value),d=N(u.value),f=N();I(()=>[u.value,a.value?.present],async()=>{await qn();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=Y(()=>d.value&&i.open.value);return Hi(()=>{requestAnimationFrame(()=>{d.value=!1})}),lh(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(V(),U(P(Tg),{ref_key:`presentRef`,ref:a,present:e.forceMount||P(i).open.value,"force-mount":!0},{default:F(({present:t})=>[G(P(Og),J(e.$attrs,{id:P(i).contentId,ref:P(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:P(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:P(i).open.value?`open`:`closed`,"data-disabled":P(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:F(()=>[!P(i).unmountOnHide.value||t?z(e.$slots,`default`,{key:0}):q(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),Pg=L({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Q();let n=Ag();return(e,r)=>(V(),U(P(Og),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":P(n).contentId,"aria-expanded":P(n).open.value,"data-state":P(n).open.value?`open`:`closed`,"data-disabled":P(n).disabled?.value?``:void 0,disabled:P(n).disabled?.value,onClick:P(n).onOpenToggle},{default:F(()=>[z(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function Fg({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Ig({type:e,defaultValue:t,modelValue:n}){return e||Fg({type:e,defaultValue:t,modelValue:n})}function Lg({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Rg(e,t){let n=Y(()=>Ig(e)),r=Ch(e,`modelValue`,t,{defaultValue:Lg(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Pm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(Hm(t,e)){let n=t.findIndex(t=>Pm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:Y(()=>n.value===`single`)}}var[zg,Bg]=Rm(`AccordionRoot`),Vg=L({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:! Line truncated
- a positive number
- less than the value passed to \`max\` (or ${bS} if no \`max\` prop is set)
- less than the value passed to \`max\` (or ${yS} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`),null)}function TS(e){return CS(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${bS}\`.`),bS)}var ES=L({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:bS},getValueLabel:{type:Function,required:!1,default:(e,t)=>CS(e)?`${Math.round(e/t*bS)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Q();let i=wh(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=wh(n,`max`,r,{passive:n.max===void 0});I(()=>i.value,async e=>{let t=wS(e,n.max);t!==e&&(await Kn(),i.value=t)},{immediate:!0}),I(()=>n.max,e=>{let t=TS(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=Y(()=>Vm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return SS({modelValue:i,max:a,progressState:o}),(e,t)=>(V(),U(P(kg),{"as-child":e.asChild,as:e.as,"aria-valuemax":P(a),"aria-valuemin":0,"aria-valuenow":CS(P(i))?P(i):void 0,"aria-valuetext":e.getValueText?.(P(i),P(a)),"aria-label":e.getValueLabel(P(i),P(a)),role:`progressbar`,"data-state":o.value,"data-value":P(i)??void 0,"data-max":P(a)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),DS=L({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=xS();return Q(),(e,r)=>(V(),U(P(kg),J(t,{"data-state":P(n).progressState.value,"data-value":P(n).modelValue?.value??void 0,"data-max":P(n).max.value}),{default:F(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),OS=`radio.select`;function kS(e,t,n){Bm(OS,n,{originalEvent:e,value:t})}var AS=L({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=wh(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=_n(n),{forwardRef:o,currentElement:s}=Q(),c=Jh(s),l=Zh(),u=Y(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||kS(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(V(),H(B,null,[G(P(kg),J({id:e.id,ref:P(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":P(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":P(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:P(a),required:e.required,name:e.name},{...P(l),...e.$attrs},{onClick:Bl(d,[`stop`])}),{default:F(()=>[z(e.$slots,`default`,{checked:P(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),P(c)&&e.name?(V(),U(P(iv),J({key:0,type:`radio`,tabindex:`-1`,value:P(a),checked:!!P(i),name:e.name,disabled:e.disabled,required:e.required},P(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):q(`v-if`,!0)],64))}}),[jS,MS]=Rm(`RadioGroupRoot`),NS=L({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Q(),o=wh(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=_n(n),p=Uh(f),m=Jh(a);return MS({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(V(),U(P(Bb),{"as-child":``,orientation:P(l),dir:P(p),loop:P(c)},{default:F(()=>[G(P(kg),{ref:P(i),role:`radiogroup`,"data-disabled":P(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":P(l),"aria-required":P(d),dir:P(p)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(o)}),P(m)&&P(u)?(V(),U(P(iv),{key:0,required:P(d),disabled:P(s),value:P(o),name:P(u)},null,8,[`required`,`disabled`,`value`,`name`])):q(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Iee,PS]=Rm(`RadioGroupItem`),FS=L({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nuLine truncated
Defaulting to \`null\`.`),null)}function wS(e){return SS(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${yS}\`.`),yS)}var TS=L({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:yS},getValueLabel:{type:Function,required:!1,default:(e,t)=>SS(e)?`${Math.round(e/t*yS)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Q();let i=Ch(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=Ch(n,`max`,r,{passive:n.max===void 0});I(()=>i.value,async e=>{let t=CS(e,n.max);t!==e&&(await qn(),i.value=t)},{immediate:!0}),I(()=>n.max,e=>{let t=wS(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=Y(()=>Vm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return xS({modelValue:i,max:a,progressState:o}),(e,t)=>(V(),U(P(Og),{"as-child":e.asChild,as:e.as,"aria-valuemax":P(a),"aria-valuemin":0,"aria-valuenow":SS(P(i))?P(i):void 0,"aria-valuetext":e.getValueText?.(P(i),P(a)),"aria-label":e.getValueLabel(P(i),P(a)),role:`progressbar`,"data-state":o.value,"data-value":P(i)??void 0,"data-max":P(a)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),ES=L({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=bS();return Q(),(e,r)=>(V(),U(P(Og),J(t,{"data-state":P(n).progressState.value,"data-value":P(n).modelValue?.value??void 0,"data-max":P(n).max.value}),{default:F(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),DS=`radio.select`;function OS(e,t,n){Bm(DS,n,{originalEvent:e,value:t})}var kS=L({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=Ch(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=vn(n),{forwardRef:o,currentElement:s}=Q(),c=qh(s),l=Xh(),u=Y(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||OS(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(V(),H(B,null,[G(P(Og),J({id:e.id,ref:P(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":P(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":P(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:P(a),required:e.required,name:e.name},{...P(l),...e.$attrs},{onClick:Vl(d,[`stop`])}),{default:F(()=>[z(e.$slots,`default`,{checked:P(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),P(c)&&e.name?(V(),U(P(rv),J({key:0,type:`radio`,tabindex:`-1`,value:P(a),checked:!!P(i),name:e.name,disabled:e.disabled,required:e.required},P(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):q(`v-if`,!0)],64))}}),[AS,jS]=Rm(`RadioGroupRoot`),MS=L({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Q(),o=Ch(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=vn(n),p=Hh(f),m=qh(a);return jS({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(V(),U(P(zb),{"as-child":``,orientation:P(l),dir:P(p),loop:P(c)},{default:F(()=>[G(P(Og),{ref:P(i),role:`radiogroup`,"data-disabled":P(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":P(l),"aria-required":P(d),dir:P(p)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(o)}),P(m)&&P(u)?(V(),U(P(rv),{key:0,required:P(d),disabled:P(s),value:P(o),name:P(u)},null,8,[`required`,`disabled`,`value`,`name`])):q(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Lee,NS]=Rm(`RadioGroupItem`),PS=L({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nuLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:OE(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>OE(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=AE(c),u=e+1<n.length?AE(n[e+1]):null;if(l&&u&&jE(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=AE(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>OE(e)),rows:r.map(e=>e.map(e=>OE(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:OE(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:OE(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function AE(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function jE(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var ME={class:`[overflow-wrap:anywhere]`},NE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},PE={class:`font-mono text-[0.85em]`},FE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},IE={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},zee={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Bee={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Vee={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Hee={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Uee={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Wee={key:8,class:`mb-2.5 last:mb-0`},Gee=L({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>kE(t.text));return(e,t)=>(V(),H(`div`,ME,[(V(!0),H(B,null,R(n.value,(e,t)=>(V(),H(B,{key:t},[e.kind===`pre`?(V(),H(`pre`,NE,[W(`code`,PE,M(e.code),1)])):e.kind===`table`?(V(),H(`table`,FE,[W(`thead`,null,[W(`tr`,null,[(V(!0),H(B,null,R(e.head,(e,t)=>(V(),H(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[G(EE,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(V(!0),H(B,null,R(e.rows,(e,t)=>(V(),H(`tr`,{key:t},[(V(!0),H(B,null,R(e,(e,t)=>(V(),H(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[G(EE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(V(),H(`blockquote`,IE,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(V(),H(`h1`,zee,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(V(),H(`h2`,Bee,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(V(),H(`h3`,Vee,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(V(),H(`ul`,Hee,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(EE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(V(),H(`ol`,Uee,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(EE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(V(),H(`p`,Wee,[G(EE,{inline:e.inline},null,8,[`inline`])])):q(``,!0)],64))),128))]))}}),Kee={class:`truncate`},qee=L({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Qi(`RouterLink`);return V(),U(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:F(()=>[G(P(Xu),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,Kee,M(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Jee={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Yee={class:`font-semibold text-foreground`},Xee={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Zee=L({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(V(),U(qee,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(V(),H(`div`,Jee,[G(P(Zd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Yee,M(n.value),1),r.value?(V(),H(`code`,Xee,M(r.value),1)):q(``,!0),W(`span`,{class:j(P(X)(`text-fg-muted`,i.value&&`text-danger`))},M(a.value),3)]))}}),Qee={key:0,class:`mb-2 grid gap-0.5 text-xs`},$ee={key:1,class:`mb-2 flex flex-wrap gap-1.5`},ete={key:3,class:`whitespace-pre-wrap`},LE=L({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(V(),H(`div`,{class:j([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:j(P(X)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(V(),H(`div`,Qee,[(V(!0),H(B,null,R(e.tools,(t,n)=>(V(),U(Zee,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):q(``,!0),e.media.length?(V(),H(`div`,$ee,[(V(!0),H(B,null,R(e.media,(e,t)=>(V(),U(yE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):q(``,!0),e.assistant?(V(),U(Gee,{key:2,text:e.text},null,8,[`text`])):(V(),H(`div`,ete,M(e.text),1)),z(t.$slots,`default`)],2)],2))}}),tte={class:`w-full self-center justify-self-center py-6 text-center`},nte={class:`grid gap-2`},rte=[`onClick`],ite=L( Line truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Mj?`${n.slice(0,Mj).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var Pj=[`title`],Fj=L({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>ij(n.event)),a=Y(()=>Nj(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=Y(()=>n.event.at?fA(n.event.at):`—`);return(e,t)=>(V(),U(P(kj),{class:j(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[Hl(Bl(o,[`prevent`]),[`enter`]),Hl(Bl(o,[`prevent`]),[`space`])]},{default:F(()=>[G(P(Oj),{class:`font-medium`},{default:F(()=>[K(M(n.event.kind||n.event.type||`event`),1)]),_:1}),G(P(Oj),{class:`font-mono`},{default:F(()=>[K(M(i.value>0?`#${i.value}`:`—`),1)]),_:1}),G(P(Oj),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},M(a.value.text),9,Pj)]),_:1}),G(P(Oj),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Ij=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function Lj(e){return(Number(e?.task_id)||0)>0}function Rj(e,t){return t===`tasks`?Lj(e):t!==`system`||!Lj(e)}function zj(e,t){return e.filter(e=>Rj(e,t))}function Bj(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function Vj(e,t){return`${e}:${t??0}`}function Hj(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=Vj(Nj(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var Uj={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},Wj={class:`max-h-[28rem] overflow-y-auto`},Gj=[`aria-expanded`,`aria-label`,`onClick`],Kj=[`title`],qj=L({__name:`LiveActivityCard`,setup(e){let t=QE(),{activity:n,streamKind:r,streamState:i}=Fu(hk()),a=N(`all`),o=Y(()=>zj(n.value,a.value)),s=Y(()=>Bj(o.value.length,a.value)),c=qt(new Set),l=Y(()=>Hj(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return Nj(e.representative)}function p(e){return e.representative.at?fA(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(V(),U(P(aA),null,{default:F(()=>[G(P(uA),null,{default:F(()=>[G(P(dA),null,{default:F(()=>[...t[1]||=[K(`Live activity`,-1)]]),_:1}),G(P(oA),{class:`flex items-center gap-2`},{default:F(()=>[G(P(wj),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:P(Ij)},null,8,[`modelValue`,`options`]),G(P(nA),{variant:P(r)},{default:F(()=>[K(M(P(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),G(P(sA),null,{default:F(()=>[W(`div`,Uj,[W(`div`,Wj,[G(P(Ej),null,{default:F(()=>[G(P(jj),{class:`sticky top-0 z-10 bg-card`},{default:F(()=>[G(P(kj),null,{default:F(()=>[G(P(Aj),null,{default:F(()=>[...t[2]||=[K(`Event`,-1)]]),_:1}),G(P(Aj),null,{default:F(()=>[...t[3]||=[K(`Task`,-1)]]),_:1}),G(P(Aj),null,{default:F(()=>[...t[4]||=[K(`Detail`,-1)]]),_:1}),G(P(Aj),null,{default:F(()=>[...t[5]||=[K(`When`,-1)]]),_:1})]),_:1})]),_:1}),G(P(Dj),null,{default:F(()=>[o.value.length?q(``,!0):(V(),U(P(kj),{key:0},{default:F(()=>[G(P(Oj),{colspan:`4`},{default:F(()=>[G(P(Jk),null,{default:F(()=>[G(P(Zk),null,{default:F(()=>[G(P(eA),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(V(!0),H(B,{key:1},R(l.value,e=>(V(),H(B,{key:e.key},[e.count===1?(V(),U(Fj,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(V(),H(B,{key:1},[G(P(kj),{class:j(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[Hl(Bl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Hl(Bl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:F(()=>[G(P(Oj),{class:`font-medium`},{default:F(()=>[W(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:Bl(t=>u(e.key),[`stop`])},[d(e)?(V(),U(P(rd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(V(),U(P(id),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),K(` `+M(e.label)+` `,1),G(P(nA),{variant:`idle`},{default:F(()=>[K(`×`+M(e.count),1)]),_:2},1024)],8,Gj)]),_:2},1024),G(P(Oj),{class:`font-mono`},{default:F(()=>[K(M(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),G(P(Oj),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},M(f(e).text),9,Kj)]),_:2},1024),G(P(Oj),null,{default:F(()=>[K(M(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(V(!0),H(B,{key:0},R(e.events,(t,n)=>(V(),U(Fj,{key:`${e.key}:${n}`,ev Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function mN(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function hN(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function gN(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function _N(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var vN=N([]),yN=N([]),bN=N(!0),xN=N(null),SN=N(null),CN=N(!1),wN=N(null);async function TN(){try{let e=await Z.eventTypes();bN.value=e.enabled!==!1,vN.value=e.event_types||[],yN.value=e.proposals||[],xN.value=null}catch(e){xN.value=e.message||String(e)}}function EN(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function DN(e){wN.value=null,SN.value=e}function ON(e){let t=IN.value.find(t=>String(t.id)===e.sample_id);DN({mode:`proposal`,id:null,source:e.source,name:``,rule:EN(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function kN(e=``){DN({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function AN(e){DN({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:EN(e.rule),headersText:``,body:``,exampleHeaders:{}})}function jN(){SN.value=null}async function MN(){let e=SN.value;if(e){CN.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:_N(e.rule)});else{let t=e.mode===`paste`?pN(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:_N(e.rule),example:{headers:t,body:e.body}})}SN.value=null,await TN()}catch(e){wN.value=e.message||String(e)}finally{CN.value=!1}}}var NN=N(null);async function PN(){let e=NN.value;if(NN.value=null,e)try{await Z.eventTypeDelete(e.id),await TN()}catch(e){xN.value=e.message||String(e)}}var FN=100,IN=N([]),LN=N(!0),RN=N(null),zN=N(!0),BN=N(null);async function VN(){try{let e=await Z.captures(FN);LN.value=e.enabled!==!1,IN.value=e.captures||[],RN.value=null}catch(e){RN.value=e.message||String(e)}finally{zN.value=!1}}function HN(e){let t=IN.value.find(t=>t.id===e);return t&&(BN.value=t),!!t}function UN(){IN.value.length&&(BN.value=IN.value[0])}function WN(){gk(`captures`,()=>{VN(),TN()})}var GN=`archie.theme`,KN=`archie.density`,qN=`archie.motion`,JN=`archie.tooltips`;function YN(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function XN(e,t){try{localStorage.setItem(e,t)}catch{}}function ZN(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var QN=Pu(`appearance`,()=>{let e=N(YN(GN,[`system`,`dark`,`light`],`dark`)),t=N(YN(KN,[`comfortable`,`compact`],`comfortable`)),n=N(YN(qN,[`system`,`reduced`],`system`)),r=N(YN(JN,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=ZN(e.value)}function o(t){e.value=t,a(),XN(GN,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,XN(KN,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,XN(qN,e)}function l(e){r.value=e,XN(JN,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),$N=L({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Xh(n,t),{tooltipsEnabled:i}=Fu(QN());return(e,t)=>(V(),U(P(XC),J({"data-slot":`tooltip`},P(r),{disabled:n.disabled||!P(i)}),{default:F(t=>[z(e.$slots,`default`,ve(cs(t)))]),_:3},16,[`disabled`]))}}),eP=L({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Xh(gw(n,`class`),r);return(e,t)=>(V(),U(P(ew),null,{default:F( Line truncated
`)}),t}function AE(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function jE(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var ME={class:`[overflow-wrap:anywhere]`},NE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},PE={class:`font-mono text-[0.85em]`},FE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},IE={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},LE={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},RE={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},zee={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Bee={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Vee={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Hee={key:8,class:`mb-2.5 last:mb-0`},Uee=L({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>kE(t.text));return(e,t)=>(V(),H(`div`,ME,[(V(!0),H(B,null,R(n.value,(e,t)=>(V(),H(B,{key:t},[e.kind===`pre`?(V(),H(`pre`,NE,[W(`code`,PE,M(e.code),1)])):e.kind===`table`?(V(),H(`table`,FE,[W(`thead`,null,[W(`tr`,null,[(V(!0),H(B,null,R(e.head,(e,t)=>(V(),H(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[G(EE,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(V(!0),H(B,null,R(e.rows,(e,t)=>(V(),H(`tr`,{key:t},[(V(!0),H(B,null,R(e,(e,t)=>(V(),H(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[G(EE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(V(),H(`blockquote`,IE,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(V(),H(`h1`,LE,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(V(),H(`h2`,RE,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(V(),H(`h3`,zee,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(V(),H(`ul`,Bee,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(EE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(V(),H(`ol`,Vee,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(EE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(V(),H(`p`,Hee,[G(EE,{inline:e.inline},null,8,[`inline`])])):q(``,!0)],64))),128))]))}}),Wee={class:`truncate`},Gee=L({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=$i(`RouterLink`);return V(),U(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:F(()=>[G(P(Xu),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,Wee,M(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Kee={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},qee={class:`font-semibold text-foreground`},Jee={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Yee=L({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(V(),U(Gee,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(V(),H(`div`,Kee,[G(P(Zd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,qee,M(n.value),1),r.value?(V(),H(`code`,Jee,M(r.value),1)):q(``,!0),W(`span`,{class:j(P(X)(`text-fg-muted`,i.value&&`text-danger`))},M(a.value),3)]))}}),Xee={key:0,class:`mb-2 grid gap-0.5 text-xs`},Zee={key:1,class:`mb-2 flex flex-wrap gap-1.5`},Qee={key:3,class:`whitespace-pre-wrap`},zE=L({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(V(),H(`div`,{class:j([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:j(P(X)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(V(),H(`div`,Xee,[(V(!0),H(B,null,R(e.tools,(t,n)=>(V(),U(Yee,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):q(``,!0),e.media.length?(V(),H(`div`,Zee,[(V(!0),H(B,null,R(e.media,(e,t)=>(V(),U(yE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):q(``,!0),e.assistant?(V(),U(Uee,{key:2,text:e.text},null,8,[`text`])):(V(),H(`div`,Qee,M(e.text),1)),z(t.$slots,`default`)],2)],2))}}),$ee={class:`w-full self-center justify-self-center py-6 text-center`},ete={class:`grid gap-2`},tte=[`onClick`],nte=L({__n Line truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Nj?`${n.slice(0,Nj).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var Fj=[`title`],Ij=L({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>aj(n.event)),a=Y(()=>Pj(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=Y(()=>n.event.at?pA(n.event.at):`—`);return(e,t)=>(V(),U(P(Aj),{class:j(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[Hl(Vl(o,[`prevent`]),[`enter`]),Hl(Vl(o,[`prevent`]),[`space`])]},{default:F(()=>[G(P(kj),{class:`font-medium`},{default:F(()=>[K(M(n.event.kind||n.event.type||`event`),1)]),_:1}),G(P(kj),{class:`font-mono`},{default:F(()=>[K(M(i.value>0?`#${i.value}`:`—`),1)]),_:1}),G(P(kj),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},M(a.value.text),9,Fj)]),_:1}),G(P(kj),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Lj=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function Rj(e){return(Number(e?.task_id)||0)>0}function zj(e,t){return t===`tasks`?Rj(e):t!==`system`||!Rj(e)}function Bj(e,t){return e.filter(e=>zj(e,t))}function Vj(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function Hj(e,t){return`${e}:${t??0}`}function Uj(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=Hj(Pj(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var Wj={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},Gj={class:`max-h-[28rem] overflow-y-auto`},Kj=[`aria-expanded`,`aria-label`,`onClick`],qj=[`title`],Jj=L({__name:`LiveActivityCard`,setup(e){let t=eD(),{activity:n,streamKind:r,streamState:i}=Fu(gk()),a=N(`all`),o=Y(()=>Bj(n.value,a.value)),s=Y(()=>Vj(o.value.length,a.value)),c=Jt(new Set),l=Y(()=>Uj(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return Pj(e.representative)}function p(e){return e.representative.at?pA(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(V(),U(P(oA),null,{default:F(()=>[G(P(dA),null,{default:F(()=>[G(P(fA),null,{default:F(()=>[...t[1]||=[K(`Live activity`,-1)]]),_:1}),G(P(sA),{class:`flex items-center gap-2`},{default:F(()=>[G(P(Tj),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:P(Lj)},null,8,[`modelValue`,`options`]),G(P(rA),{variant:P(r)},{default:F(()=>[K(M(P(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),G(P(cA),null,{default:F(()=>[W(`div`,Wj,[W(`div`,Gj,[G(P(Dj),null,{default:F(()=>[G(P(Mj),{class:`sticky top-0 z-10 bg-card`},{default:F(()=>[G(P(Aj),null,{default:F(()=>[G(P(jj),null,{default:F(()=>[...t[2]||=[K(`Event`,-1)]]),_:1}),G(P(jj),null,{default:F(()=>[...t[3]||=[K(`Task`,-1)]]),_:1}),G(P(jj),null,{default:F(()=>[...t[4]||=[K(`Detail`,-1)]]),_:1}),G(P(jj),null,{default:F(()=>[...t[5]||=[K(`When`,-1)]]),_:1})]),_:1})]),_:1}),G(P(Oj),null,{default:F(()=>[o.value.length?q(``,!0):(V(),U(P(Aj),{key:0},{default:F(()=>[G(P(kj),{colspan:`4`},{default:F(()=>[G(P(Yk),null,{default:F(()=>[G(P(Qk),null,{default:F(()=>[G(P(tA),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(V(!0),H(B,{key:1},R(l.value,e=>(V(),H(B,{key:e.key},[e.count===1?(V(),U(Ij,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(V(),H(B,{key:1},[G(P(Aj),{class:j(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[Hl(Vl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Hl(Vl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:F(()=>[G(P(kj),{class:`font-medium`},{default:F(()=>[W(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:Vl(t=>u(e.key),[`stop`])},[d(e)?(V(),U(P(rd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(V(),U(P(id),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),K(` `+M(e.label)+` `,1),G(P(rA),{variant:`idle`},{default:F(()=>[K(`×`+M(e.count),1)]),_:2},1024)],8,Kj)]),_:2},1024),G(P(kj),{class:`font-mono`},{default:F(()=>[K(M(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),G(P(kj),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},M(f(e).text),9,qj)]),_:2},1024),G(P(kj),null,{default:F(()=>[K(M(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(V(!0),H(B,{key:0},R(e.events,(t,n)=>(V(),U(Ij,{key:`${e.key}:${n}`,ev Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function hN(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function gN(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function _N(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function vN(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var yN=N([]),bN=N([]),xN=N(!0),SN=N(null),CN=N(null),wN=N(!1),TN=N(null);async function EN(){try{let e=await Z.eventTypes();xN.value=e.enabled!==!1,yN.value=e.event_types||[],bN.value=e.proposals||[],SN.value=null}catch(e){SN.value=e.message||String(e)}}function DN(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function ON(e){TN.value=null,CN.value=e}function kN(e){let t=LN.value.find(t=>String(t.id)===e.sample_id);ON({mode:`proposal`,id:null,source:e.source,name:``,rule:DN(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function AN(e=``){ON({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function jN(e){ON({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:DN(e.rule),headersText:``,body:``,exampleHeaders:{}})}function MN(){CN.value=null}async function NN(){let e=CN.value;if(e){wN.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:vN(e.rule)});else{let t=e.mode===`paste`?mN(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:vN(e.rule),example:{headers:t,body:e.body}})}CN.value=null,await EN()}catch(e){TN.value=e.message||String(e)}finally{wN.value=!1}}}var PN=N(null);async function FN(){let e=PN.value;if(PN.value=null,e)try{await Z.eventTypeDelete(e.id),await EN()}catch(e){SN.value=e.message||String(e)}}var IN=100,LN=N([]),RN=N(!0),zN=N(null),BN=N(!0),VN=N(null);async function HN(){try{let e=await Z.captures(IN);RN.value=e.enabled!==!1,LN.value=e.captures||[],zN.value=null}catch(e){zN.value=e.message||String(e)}finally{BN.value=!1}}function UN(e){let t=LN.value.find(t=>t.id===e);return t&&(VN.value=t),!!t}function WN(){LN.value.length&&(VN.value=LN.value[0])}function GN(){_k(`captures`,()=>{HN(),EN()})}var KN=`archie.theme`,qN=`archie.density`,JN=`archie.motion`,YN=`archie.tooltips`;function XN(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function ZN(e,t){try{localStorage.setItem(e,t)}catch{}}function QN(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var $N=Pu(`appearance`,()=>{let e=N(XN(KN,[`system`,`dark`,`light`],`dark`)),t=N(XN(qN,[`comfortable`,`compact`],`comfortable`)),n=N(XN(JN,[`system`,`reduced`],`system`)),r=N(XN(YN,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=QN(e.value)}function o(t){e.value=t,a(),ZN(KN,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,ZN(qN,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,ZN(JN,e)}function l(e){r.value=e,ZN(YN,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),eP=L({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Yh(n,t),{tooltipsEnabled:i}=Fu($N());return(e,t)=>(V(),U(P(XC),J({"data-slot":`tooltip`},P(r),{disabled:n.disabled||!P(i)}),{default:F(t=>[z(e.$slots,`default`,ve(ls(t)))]),_:3},16,[`disabled`]))}}),tP=L({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Yh(gw(n,`class`),r);return(e,t)=>(V(),U(P(ew),null,{default:F( Line truncated
`)}};aJ.defaultYaml={explicit:!1,version:`1.2`},aJ.defaultTags={"!!":`tag:yaml.org,2002:`};function oJ(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function sJ(e){let t=new Set;return Qq(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function cJ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function lJ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=sJ(e);let a=cJ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Wq(t.node)||Kq(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function uJ(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=uJ(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=uJ(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=uJ(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=uJ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function dJ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>dJ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Jq(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var fJ=class{constructor(e){Object.defineProperty(this,zq,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Vq(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=dJ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?uJ(i,{"":o},``,o):o}},pJ=class extends fJ{constructor(e){super(Nq),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Qq(e,{Node:(e,t)=>{(Bq(t)||Jq(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(dJ(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=mJ(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(oJ(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function mJ(e,t,n){if(Bq(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Kq(t)){let r=0;for(let i of t.items){let t=mJ(e,i,n);t>r&&(r=t)}return r}if(Uq(t)){let r=mJ(e,t.key,n),i=mJ(e,t.value,n);return Math.max(r,i)}return 1}var hJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,gJ=class extends fJ{constructor(e){super(Lq),this.value=e}toJSON(e,t){return t?.keep?this.value:dJ(this.value,e,t)}toString(){return String(this.value)}};gJ.BLOCK_FOLDED=`BLOCK_FOLDED`,gJ.BLOCK_LITERAL=`BLOCK_LITERAL`,gJ.PLAIN=`PLAIN`,gJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,gJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var _J=`tag:yaml.org,2002:`;function vJ(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function yJ(e,t,n){if(Vq(e)&&(e=e.contents),qq(e))return e;if(Uq(e)){let t=n.schema[Fq].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new pJ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=_J+t.slice(2));let l=vJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new gJ(e);return c&&(c.node=t),t Line truncated
`)?wJ(n,t):n.includes(`
`)?`
@@ -126,14 +126,14 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`).find(e=>e.trim())?.trim()}}function FZ(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(jZ)].map(e=>e[1]))]}function IZ(e){let t=SZ(e).toJS(),n=MZ(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=MZ(e)?e:{},f=typeof u.type==`string`?u.type:``,p=MZ(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`,g=s?`${s}/${m||f}`:m||f;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||AZ(f),type:f,detail:NZ(f,p),summary:PZ(p),when:typeof u.when==`string`?u.when:void 0,retry:MZ(u.retry)&&typeof u.retry.attempts==`number`?u.retry.attempts:void 0,continues:u.on_failure===`continue`,branch:s,path:l,stage:g,occurrence:d(g),...c?{resume:c}:{}}}),m&&a.set(m,h);for(let e of FZ(u.settings,u.when))o.push({from:e,to:h});return h},p=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){if(MZ(t)&&MZ(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i=[],a=0;n.forEach(([t,o],s)=>{let u=(s-(n.length-1)/2)*OZ,d=c,m=c;(Array.isArray(o)?o:[]).forEach((i,o)=>{let c=f(i,`${e+1}-${t}-${o+1}`,u,(l+o)*DZ,t,r,[`steps`,e,`parallel`,t,o]);p(d,c,d===m&&s===n.length-1?e-1:void 0),d=[c],a=Math.max(a,o+1)}),i.push(...d)}),c=i,l+=Math.max(a,1);continue}let n=f(t,String(e+1),0,l*DZ,void 0,void 0,[`steps`,e]);p(c,n,e-1),c=[n],l++}r.push({id:`add-end`,type:`add`,position:{x:104,y:l*DZ-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``}}),p(c,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var LZ={agent:$u,command:Bd,repo:hd,gate:Ld,forge:Cd,human:qd,review:pd,workflow:Xd},RZ={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function zZ(e){return LZ[e.split(`.`)[0]]??Xd}function BZ(e){return Object.keys(RZ).map(t=>({title:RZ[t],icon:LZ[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function VZ(e,t){let n=SZ(e).getIn(t,!0);if(Hq(n))return n.toJSON()}function HZ(e,t,n){let r=SZ(e);return r.setIn(t,r.createNode(JZ(n))),r.toString()}function UZ(e,t,n){let r=SZ(e),i=r.get(`steps`,!0);if(Gq(i)||(r.set(`steps`,r.createNode([])),i=r.get(`steps`,!0)),!Gq(i))return{source:e,path:[]};let a=Math.min(Math.max(t+1,0),i.items.length);return i.items.splice(a,0,r.createNode({type:n})),{source:r.toString(),path:[`steps`,a]}}function WZ(e,t){let n=SZ(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!Gq(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return Hq(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function GZ(e,t){let n=SZ(e);n.deleteIn(t);let r=t.slice(0,-1);if(r.length>2){let e=n.getIn(r,!0);Gq(e)&&e.items.length===0&&n.deleteIn(r)}return n.toString()}function KZ(e,t,n){let r=SZ(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!Gq(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function qZ(e,t){let n=SZ(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(typeof t.id==`string`&&a.push(t.id),typeof t.parallel==`object`&&t.parallel!==null)for(let e of Object.values(t.parallel))Array.isArray(e)&&e.forEach(o)};if(r.slice(0,i).forEach(o),t.length===5){let e=r[i]?.parallel?.[t[3]];Array.isArray(e)&&e.slice(0,t[4]).forEach(o)}return a}function JZ(e){if(Array.isArray(e))return e.map(JZ);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=JZ(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function YZ(e,t){let n=SZ(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():SZ(e).get(t)}function XZ(e,t,n){let r=SZ(e),i=JZ({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function ZZ(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function QZ(e,t=[]){let n=SZ(e),r=n.errors[0];if(r)return{ok:!1,message:fQ(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!pQ(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};le Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:cQ(e)}))}var oQ=/^(\s*)(-\s+)?/,sQ=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function cQ(e){let{code:t,comment:n}=lQ(e),r=uQ(t);return n&&r.push({text:n,kind:`comment`}),r}function lQ(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t){r===t&&(t=``);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function uQ(e){if(!e)return[];let t=[],n=oQ.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=sQ.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...dQ(i[4]??``)]):[...t,...dQ(r)]}function dQ(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function fQ(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function pQ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function mQ(e){return typeof e==`string`&&e.trim()!==``}var hQ={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},gQ={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},_Q={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},vQ={class:`min-w-0 flex-1`},yQ=[`value`,`placeholder`],bQ={class:`truncate font-mono text-[11px] text-fg-subtle`},xQ={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},SQ={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},CQ={key:1,class:`space-y-1.5`},wQ=[`title`],TQ=[`value`],EQ=[`value`],DQ={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},OQ=[`onClick`],kQ=[`onClick`],AQ={key:2,class:`divide-y divide-border rounded-md border border-border`},jQ=[`title`],MQ=[`value`,`onChange`],NQ=[`value`],PQ=[`value`,`onInput`],FQ=[`value`,`onFocus`,`onInput`],IQ=[`title`],LQ={key:0,class:`text-xs text-danger`},RQ={class:`space-y-2`},zQ={class:`divide-y divide-border rounded-md border border-border`},BQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},VQ=[`value`],HQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},UQ=[`value`],WQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},GQ=[`value`],KQ={class:`flex items-center border-t border-border px-4 py-2.5`},qQ=L({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>VZ(n.yaml,n.path)??{}),a=Y(()=>typeof i.value.type==`string`?i.value.type:``),o=Y(()=>n.vocabulary.find(e=>e.name===a.value)),s=Y(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=Y(()=>qZ(n.yaml,n.path)),l=Y(()=>o.value?.settings&&i.value.settings?rQ(i.value.settings,o.value.settings,`settings`):``),u=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],d=/mission|body|detail|plan|rules/;function f(e,t){return t.type===`string`?t.enum?`select`:d.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let p=Y(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:f(e,t)})),t=e.filter(e=>u.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>u.indexOf(e.key)-u.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function m(e){let{id:t,type:i,...a}=e;r(`update:yaml`,HZ(n.yaml,n.path,{id:t,type:i,...a}))}function h(e,t){m({...i.value,[e]:t})}function g(e,t){m({...i.value,settings:{...s.value,[e]:t}})}let _=N(null);function v(e,t){let n=_.value??p.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;g(n,r?`${r.trimEnd()} ${i}`:i)}let y=N({});function b(e,t){try{g(e,t.trim()?CZ(t):void 0),y.value={...y.value,[e]:``}}catch(t){y.value={...y.value,[e]:String(t.message).split(`
`)[0]}}}let x=e=>e===void 0?``:wZ(e).trimEnd(),S=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),C=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(V(),H(`aside`,hQ,[W(`header`,gQ,[W(`span`,_Q,[(V(),U(ea(P(zZ)(a.value)),{class:`size-4`}))]),W(`div`,vQ,[W(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:P(AZ)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>h(`id`,e.target.value)},null,40,yQ),W(`div`,bQ,M(a.value),1)]),G(P($),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:F(()=>[G(P(Qd))]),_:1})]),W(`div`,xQ,[l.value?(V(),H(`p`,SQ,M(l.value),1)):q(``,!0),p.value.lead?(V(),H(`section`,CQ,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:p.value.lead.schema.description},[K(M(S(p.value.lead.key,p.value.lead.schema))+` `,1),p.value.lead.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,wQ),p.value.lead.kind===`select`?(V(),H(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:C(p.value.lead.key),onChange:t[2]||=e=>g(p.value.lead.key,e.target.value||void 0)},[t[12]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(p.value.lead.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,EQ))),128))],40,TQ)):p.value.lead.kind===`text`?(V(),U(P(lT),{key:1,"model-value":C(p.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[4]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])):(V(),U(P(CO),{key:2,"model-value":C(p.value.lead.key),onFocus:t[5]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[6]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&p.value.lead.kind!==`select`?(V(),H(`div`,DQ,[t[13]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(V(!0),H(B,null,R(c.value,e=>(V(),H(B,{key:e},[W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`summary`)},M(e),9,OQ),W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`result`)},M(e)+`.result`,9,kQ)],64))),128))])):q(``,!0)])):q(``,!0),p.value.compact.length?(V(),H(`section`,AQ,[(V(!0),H(B,null,R(p.value.compact,e=>(V(),H(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,jQ),e.kind===`boolean`?(V(),U(P(JO),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>g(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(V(),H(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:C(e.key),onChange:t=>g(e.key,t.target.value||void 0)},[t[14]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(e.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,NQ))),128))],40,MQ)):e.kind===`number`?(V(),H(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>g(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,PQ)):(V(),H(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:C(e.key),onFocus:t=>_.value=e.key,onInput:t=>g(e.key,t.target.value)},null,40,FQ))]))),128))])):q(``,!0),(V(!0),H(B,null,R(p.value.long,e=>(V(),H(`section`,{key:e.key,class:`space-y-1.5`},[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,IQ),e.kind===`text`?(V(),U(P(lT),{key:0,"model-value":C(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>_.value=e.key,"onUpdate:modelValue":t=>g(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(V(),U(P(lT),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
`)[0]}}}let x=e=>e===void 0?``:wZ(e).trimEnd(),S=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),C=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(V(),H(`aside`,hQ,[W(`header`,gQ,[W(`span`,_Q,[(V(),U(ta(P(zZ)(a.value)),{class:`size-4`}))]),W(`div`,vQ,[W(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:P(AZ)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>h(`id`,e.target.value)},null,40,yQ),W(`div`,bQ,M(a.value),1)]),G(P($),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:F(()=>[G(P(Qd))]),_:1})]),W(`div`,xQ,[l.value?(V(),H(`p`,SQ,M(l.value),1)):q(``,!0),p.value.lead?(V(),H(`section`,CQ,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:p.value.lead.schema.description},[K(M(S(p.value.lead.key,p.value.lead.schema))+` `,1),p.value.lead.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,wQ),p.value.lead.kind===`select`?(V(),H(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:C(p.value.lead.key),onChange:t[2]||=e=>g(p.value.lead.key,e.target.value||void 0)},[t[12]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(p.value.lead.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,EQ))),128))],40,TQ)):p.value.lead.kind===`text`?(V(),U(P(lT),{key:1,"model-value":C(p.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[4]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])):(V(),U(P(wO),{key:2,"model-value":C(p.value.lead.key),onFocus:t[5]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[6]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&p.value.lead.kind!==`select`?(V(),H(`div`,DQ,[t[13]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(V(!0),H(B,null,R(c.value,e=>(V(),H(B,{key:e},[W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`summary`)},M(e),9,OQ),W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`result`)},M(e)+`.result`,9,kQ)],64))),128))])):q(``,!0)])):q(``,!0),p.value.compact.length?(V(),H(`section`,AQ,[(V(!0),H(B,null,R(p.value.compact,e=>(V(),H(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,jQ),e.kind===`boolean`?(V(),U(P(YO),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>g(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(V(),H(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:C(e.key),onChange:t=>g(e.key,t.target.value||void 0)},[t[14]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(e.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,NQ))),128))],40,MQ)):e.kind===`number`?(V(),H(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>g(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,PQ)):(V(),H(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:C(e.key),onFocus:t=>_.value=e.key,onInput:t=>g(e.key,t.target.value)},null,40,FQ))]))),128))])):q(``,!0),(V(!0),H(B,null,R(p.value.long,e=>(V(),H(`section`,{key:e.key,class:`space-y-1.5`},[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,IQ),e.kind===`text`?(V(),U(P(lT),{key:0,"model-value":C(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>_.value=e.key,"onUpdate:modelValue":t=>g(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(V(),U(P(lT),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>g(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(V(),H(B,{key:2},[G(P(lT),{"model-value":x(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>b(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),y.value[e.key]?(V(),H(`span`,LQ,M(y.value[e.key]),1)):q(``,!0)],64))]))),128)),W(`section`,RQ,[t[19]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,zQ,[W(`label`,BQ,[t[15]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),W(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>h(`when`,e.target.value)},null,40,VQ)]),W(`label`,HQ,[t[17]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),W(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>h(`on_failure`,e.target.value||void 0)},[...t[16]||=[W(`option`,{value:``},`Park the task`,-1),W(`option`,{value:`continue`},`Continue`,-1)]],40,UQ)]),W(`label`,WQ,[t[18]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),W(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>h(`retry`,e.target.value===``?void 0:{...i.value.retry,attempts:Number(e.target.value)})},null,40,GQ)])])])]),W(`footer`,KQ,[G(P($),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[10]||=e=>r(`remove`)},{default:F(()=>[G(P(Hd)),t[20]||=K(` Delete step`,-1)]),_:1}),G(P($),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[11]||=e=>r(`close`)},{default:F(()=>[...t[21]||=[K(`Done`,-1)]]),_:1})])]))}}),JQ=`repository_path`;function YQ(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:JQ,path:n.trim(),type:`string`,required:!0}),r}function XQ(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function ZQ(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=XQ(EP(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function QQ(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:EP(e.value,i.type??`string`)})}return n}function $Q(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function e$(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...e$(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...e$(n,r)]}):[]}function t$(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function n$(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function r$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var i$={class:`flex h-full flex-col`},a$={class:`flex items-center gap-2 border-b border-border px-4 py-3`},o$={class:`min-w-0 flex-1 truncate text-sm font-medium`},s$={key:0,class:`flex flex-1 items-center justify-center`},c$={class:`space-y-1.5`},l$=[`disabled`],u$=[`value`],d$={key:1,class:`space-y-1.5`},f$=[`value`],p$=[`title`],m$={class:`space-y-1.5`},h$={id:`bind-paths`},g$=[`value`],_$={class:`divide-y divide-border rounded-md border border-border`},v$={class:`flex items-center gap-1.5 text-xs`},y$={class:`font-mono`},b$={class:`text-fg-subtle`},x$={key:0,class:`text-danger`,title:`Required`},S$=[`title`,`aria-label`,`onClick`],C$=[`onUpdate:modelValue`,`aria-label`],w$=[`onUpdate:modelValue`,`aria-label`],T$={key:2,class:`text-xs text-danger`},E$=[`title`],D$={key:0,class:`space-y-1 px-3 py-2`},O$={key:0,class:`text-xs text-danger`},k$={key:1,class:`truncate font-mono text-xs text-success`},A$={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},j$={class:`space-y-2`},M$={key:0,role:`alert`,class:`text-xs text-danger`},N$={key:1,class:`text-xs text-fg-subtle`},P$={class:`flex gap-2`},F$=`__new__`,I$=L({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>String(YZ(n.yaml,`id`)??``)),a=Y(()= Line truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(V(),H(B,{key:2},[G(P(lT),{"model-value":x(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>b(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),y.value[e.key]?(V(),H(`span`,LQ,M(y.value[e.key]),1)):q(``,!0)],64))]))),128)),W(`section`,RQ,[t[19]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,zQ,[W(`label`,BQ,[t[15]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),W(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>h(`when`,e.target.value)},null,40,VQ)]),W(`label`,HQ,[t[17]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),W(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>h(`on_failure`,e.target.value||void 0)},[...t[16]||=[W(`option`,{value:``},`Park the task`,-1),W(`option`,{value:`continue`},`Continue`,-1)]],40,UQ)]),W(`label`,WQ,[t[18]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),W(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>h(`retry`,e.target.value===``?void 0:{...i.value.retry,attempts:Number(e.target.value)})},null,40,GQ)])])])]),W(`footer`,KQ,[G(P($),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[10]||=e=>r(`remove`)},{default:F(()=>[G(P(Hd)),t[20]||=K(` Delete step`,-1)]),_:1}),G(P($),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[11]||=e=>r(`close`)},{default:F(()=>[...t[21]||=[K(`Done`,-1)]]),_:1})])]))}}),JQ=`repository_path`;function YQ(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:JQ,path:n.trim(),type:`string`,required:!0}),r}function XQ(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function ZQ(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=XQ(DP(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function QQ(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:DP(e.value,i.type??`string`)})}return n}function $Q(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function e$(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...e$(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...e$(n,r)]}):[]}function t$(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function n$(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function r$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var i$={class:`flex h-full flex-col`},a$={class:`flex items-center gap-2 border-b border-border px-4 py-3`},o$={class:`min-w-0 flex-1 truncate text-sm font-medium`},s$={key:0,class:`flex flex-1 items-center justify-center`},c$={class:`space-y-1.5`},l$=[`disabled`],u$=[`value`],d$={key:1,class:`space-y-1.5`},f$=[`value`],p$=[`title`],m$={class:`space-y-1.5`},h$={id:`bind-paths`},g$=[`value`],_$={class:`divide-y divide-border rounded-md border border-border`},v$={class:`flex items-center gap-1.5 text-xs`},y$={class:`font-mono`},b$={class:`text-fg-subtle`},x$={key:0,class:`text-danger`,title:`Required`},S$=[`title`,`aria-label`,`onClick`],C$=[`onUpdate:modelValue`,`aria-label`],w$=[`onUpdate:modelValue`,`aria-label`],T$={key:2,class:`text-xs text-danger`},E$=[`title`],D$={key:0,class:`space-y-1 px-3 py-2`},O$={key:0,class:`text-xs text-danger`},k$={key:1,class:`truncate font-mono text-xs text-success`},A$={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},j$={class:`space-y-2`},M$={key:0,role:`alert`,class:`text-xs text-danger`},N$={key:1,class:`text-xs text-fg-subtle`},P$={class:`flex gap-2`},F$=`__new__`,I$=L({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>String(YZ(n.yaml,`id`)??``)),a=Y(()= Line truncated
`).replace(`
`,`
+`).split(`
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function b5(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=x5(n.code,e);return Array.isArray(e)?e.some(e=>y5(n[r],e,t,n.type===`keyup`)):y5(n[r],e,t,n.type===`keyup`)}}function x5(e,t){return t.includes(e)?`code`:`key`}function S5(e,t){let n=Y(()=>fn(t?.target)??g5),r=cn(fn(e)===!0),i=!1,a=new Set,o=c(fn(e));I(()=>fn(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),m0([`blur`,`contextmenu`],s),g0((...e)=>o(...e),e=>{let n=fn(t?.actInsideInputWithModifier)??!0,a=fn(t?.preventDefault)??!1;if(i=v5(e),(!i||i&&!n)&&_5(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),g0((...e)=>o(...e),e=>{let n=fn(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&_5(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=fn(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?b5(e,a):e}return r}var C5=`vue-flow__node-desc`,w5=`vue-flow__edge-desc`,T5=`vue-flow__aria-live`,E5=[`Enter`,` `,`Escape`],D5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function O5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function k5(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function A5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function j5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function M5(e,t){return{x:j5(e.x,t[0][0],t[1][0]),y:j5(e.y,t[0][1],t[1][1])}}function N5(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function P5(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function F5(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!P5(e)}function I5(e){return F5(e)&&`computedPosition`in e}function L5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function R5(e){return L5(e.width)&&L5(e.height)&&L5(e.x)&&L5(e.y)}function z5(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:rn({width:0,height:0}),computedPosition:rn({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:G7(e.data)?e.data:{},events:rn(G7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function B5(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:G7(e.data)?e.data:{},events:rn(G7(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function V5(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function H5(...e){if(e.length===3){let[t,n,r]=e;return V5(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>P5(e)&&e.source===r).map(e=>n.find(t=>F5(t)&&t.id===e.target))}function U5(...e){if(e.length===3){let[t,n,r]=e;return V5(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>P5(e)&&e.target===r).map(e=>n.find(t=>F5(t)&&t.id===e.source))}function W5({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function G5(e,t){return t.some(t=>P5(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function K5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function q5({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?F7(s,o):s}function J5(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function Y5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function X5({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function Z5(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=J5(t,Y5({...r.computedPosition,...r.dimensions}))}return X5(t)}function Q5(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...q5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function b5(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=x5(n.code,e);return Array.isArray(e)?e.some(e=>y5(n[r],e,t,n.type===`keyup`)):y5(n[r],e,t,n.type===`keyup`)}}function x5(e,t){return t.includes(e)?`code`:`key`}function S5(e,t){let n=Y(()=>pn(t?.target)??g5),r=ln(pn(e)===!0),i=!1,a=new Set,o=c(pn(e));I(()=>pn(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),m0([`blur`,`contextmenu`],s),g0((...e)=>o(...e),e=>{let n=pn(t?.actInsideInputWithModifier)??!0,a=pn(t?.preventDefault)??!1;if(i=v5(e),(!i||i&&!n)&&_5(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),g0((...e)=>o(...e),e=>{let n=pn(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&_5(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=pn(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?b5(e,a):e}return r}var C5=`vue-flow__node-desc`,w5=`vue-flow__edge-desc`,T5=`vue-flow__aria-live`,E5=[`Enter`,` `,`Escape`],D5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function O5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function k5(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function A5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function j5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function M5(e,t){return{x:j5(e.x,t[0][0],t[1][0]),y:j5(e.y,t[0][1],t[1][1])}}function N5(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function P5(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function F5(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!P5(e)}function I5(e){return F5(e)&&`computedPosition`in e}function L5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function R5(e){return L5(e.width)&&L5(e.height)&&L5(e.x)&&L5(e.y)}function z5(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:an({width:0,height:0}),computedPosition:an({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:G7(e.data)?e.data:{},events:an(G7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function B5(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:G7(e.data)?e.data:{},events:an(G7(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function V5(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function H5(...e){if(e.length===3){let[t,n,r]=e;return V5(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>P5(e)&&e.source===r).map(e=>n.find(t=>F5(t)&&t.id===e.target))}function U5(...e){if(e.length===3){let[t,n,r]=e;return V5(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>P5(e)&&e.target===r).map(e=>n.find(t=>F5(t)&&t.id===e.source))}function W5({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function G5(e,t){return t.some(t=>P5(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function K5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function q5({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?F7(s,o):s}function J5(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function Y5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function X5({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function Z5(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=J5(t,Y5({...r.computedPosition,...r.dimensions}))}return X5(t)}function Q5(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...q5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
Node: ${e}
@@ -153,4 +153,4 @@ Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},j7=class extends Error{constructor(e,...t){super(A7[e]?.call(A7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function M7(e){return`clientX`in e}function Lte(e){return`sourceEvent`in e}function N7(e,t){let n=M7(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var P7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function Rte(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function F7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var zte=()=>!0;function I7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Bte(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())k5(i,O5(e))>0&&r.push(e);return r}var Vte=250;function Hte(e,t,n,r){let i=[],a=1/0,o=Bte(e,n,t+Vte);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=D7(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function L7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=zte},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=N7(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=R7(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===d5.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=z7(t,e,a,p,n,!0)}return b}function R7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Ute(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function Wte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function z7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===d5.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...D7(o,c,c.position,!0)}:c}var B7={[c5.Left]:c5.Right,[c5.Right]:c5.Left,[c5.Top]:c5.Bottom,[c5.Bottom]:c5.Top},Gte=[`production`,`prod`];function V7(e,...t){H7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function H7(){return!Gte.includes(`production`)}function U7(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...A5(t)}}):null}function W7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),Kn(()=>{o.blur()})):n([e])}function G7(e){return P(e)!==void 0}function Kte(e,t,n,r){if(!e||!e.source||!e.target)return n(new j7(k7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=P5(e)?e:{...e,id:W5(e)},i=B5(i,void 0,r),!G5(i,t)&&i}function qte(e,t,n,r,i){if(!t.source||!t.target)return i(new j7(k7.EDGE_INVALID,e.id)),!1;if(!n)return i(new j7(k7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?W5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function K7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!F5(o)){n(new j7(k7.NODE_INVALID,o?.id));continue}let s=z5(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new j7(k7.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function q7(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function J7(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;q7(`source`Line truncated
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},j7=class extends Error{constructor(e,...t){super(A7[e]?.call(A7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function M7(e){return`clientX`in e}function Ite(e){return`sourceEvent`in e}function N7(e,t){let n=M7(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var P7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function Lte(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function F7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var Rte=()=>!0;function I7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function zte(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())k5(i,O5(e))>0&&r.push(e);return r}var Bte=250;function Vte(e,t,n,r){let i=[],a=1/0,o=zte(e,n,t+Bte);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=D7(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function L7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Rte},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=N7(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=R7(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===d5.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=z7(t,e,a,p,n,!0)}return b}function R7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Hte(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function Ute(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function z7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===d5.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...D7(o,c,c.position,!0)}:c}var B7={[c5.Left]:c5.Right,[c5.Right]:c5.Left,[c5.Top]:c5.Bottom,[c5.Bottom]:c5.Top},Wte=[`production`,`prod`];function V7(e,...t){H7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function H7(){return!Wte.includes(`production`)}function U7(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...A5(t)}}):null}function W7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),qn(()=>{o.blur()})):n([e])}function G7(e){return P(e)!==void 0}function Gte(e,t,n,r){if(!e||!e.source||!e.target)return n(new j7(k7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=P5(e)?e:{...e,id:W5(e)},i=B5(i,void 0,r),!G5(i,t)&&i}function Kte(e,t,n,r,i){if(!t.source||!t.target)return i(new j7(k7.EDGE_INVALID,e.id)),!1;if(!n)return i(new j7(k7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?W5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function K7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!F5(o)){n(new j7(k7.NODE_INVALID,o?.id));continue}let s=z5(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new j7(k7.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function q7(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function J7(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;q7(`source`Line truncated
+12
View File
@@ -147,6 +147,18 @@ export const api = {
request<void>("/api/access/policies", { method: "DELETE", body: policy, parse: false }),
summary: <T = unknown>() => request<T>("/api/summary"),
tasks: <T = unknown>() => request<T>("/api/tasks"),
// taskPage reads one page of the board; next is the cursor for the page
// after it, or null when this page was the last.
taskPage: async <T = unknown>(params: QueryParams) => {
const res = await send("/api/tasks" + qs(params), {
headers: { Accept: "application/json" },
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS),
});
return {
tasks: (await res.json()) as T[],
next: res.headers.get("X-Next-Cursor"),
};
},
taskMeta: <T = unknown>() => request<T>("/api/task-meta"),
task: <T = unknown>(id: string) =>
request<T>(`/api/tasks/${encodeURIComponent(id)}`),
+49 -8
View File
@@ -27,15 +27,12 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { api } from "@/lib/api";
import { statusList } from "@/lib/task-meta";
import { useLiveResource } from "@/stores/live-updates";
import TaskFilters from "./TaskFilters.vue";
import {
boardStatus,
initialTaskFilter,
taskMatchesStatus,
} from "./task-filter";
import { boardStatus, initialTaskFilter } from "./task-filter";
import type { Task } from "./TaskRow.vue";
import TaskTable from "./TaskTable.vue";
import TasksState from "./TasksState.vue";
@@ -53,6 +50,9 @@ const router = useRouter();
// null means loading: an empty list and a list that has not arrived are
// different states, and only one of them is worth a spinner.
const tasks = ref<Task[] | null>(null);
const next = ref<string | null>(null);
const loadingMore = ref(false);
const summary = ref<{ statuses?: Record<string, number>; needs_you?: number } | null>(null);
const error = ref<string | null>(null);
const search = ref("");
@@ -73,9 +73,9 @@ const requestedTaskId = computed(() => {
// serves.
const status = computed(() => boardStatus(statusQuery.value, statusList()));
// The server filters by status; search narrows the rows already loaded.
const visible = computed(() =>
(tasks.value ?? []).filter((task) => {
if (!taskMatchesStatus(task, status.value, statusList())) return false;
const needle = search.value.trim().toLowerCase();
if (!needle) return true;
return `${task.title ?? ""} ${task.repo ?? ""}`
@@ -99,18 +99,51 @@ const state = computed<"loading" | "error" | "empty" | "no-match">(() => {
return "no-match";
});
const PAGE = 100;
// load re-reads the board from the top, as many rows as are showing, so a live
// update or a row action does not collapse pages the operator loaded.
async function load() {
error.value = null;
const limit = Math.min(Math.max(tasks.value?.length ?? 0, PAGE), 500);
try {
tasks.value = await api.tasks<Task[]>();
const [page, counts] = await Promise.all([
api.taskPage<Task>({ status: status.value || undefined, limit }),
api.summary<{ statuses?: Record<string, number>; needs_you?: number }>(),
]);
tasks.value = page.tasks;
next.value = page.next;
summary.value = counts;
} catch (err) {
error.value = String((err as Error).message || err);
tasks.value = null;
}
}
async function loadMore() {
if (!next.value || loadingMore.value) return;
loadingMore.value = true;
try {
const page = await api.taskPage<Task>({
status: status.value || undefined,
limit: PAGE,
cursor: next.value,
});
tasks.value = [...(tasks.value ?? []), ...page.tasks];
next.value = page.next;
} catch (err) {
error.value = String((err as Error).message || err);
} finally {
loadingMore.value = false;
}
}
useLiveResource("tasks", () => void load(), 500);
onMounted(load);
watch(status, () => {
tasks.value = null;
void load();
});
// A filter change is a query-only route change, so it must not remount the
// list: the table keeps its identity and only its rows move. The query is the
@@ -171,7 +204,7 @@ async function reveal(id: number) {
</Card>
<template v-else>
<TasksSummary v-if="tasks" :tasks="tasks" />
<TasksSummary v-if="summary" :summary="summary" />
<Card>
<CardHeader>
@@ -196,6 +229,14 @@ async function reveal(id: number) {
<TasksState :kind="state" @clear="clearFilters" />
</template>
</TaskTable>
<Button
v-if="next"
variant="outline"
class="self-center"
:disabled="loadingMore"
@click="loadMore"
>Load more</Button
>
</CardContent>
</Card>
</template>
+11 -24
View File
@@ -3,41 +3,28 @@ import { computed } from "vue";
import StatTile from "@/base/StatTile.vue";
import { delivered } from "@/lib/delivered";
import { attentionStatusIds } from "@/lib/task-meta";
import type { Task } from "./TaskRow.vue";
/**
* The four numbers that say what the board holds, counted from the tasks the
* page already has rather than from an aggregate endpoint: the same list feeds
* the table, so a tile and a row can never disagree.
* The four numbers that say what the board holds, counted by the server over
* every task: the table pages, so counting its rows would count one page.
*/
const props = defineProps<{ tasks: Task[] }>();
const props = defineProps<{
summary: { statuses?: Record<string, number>; needs_you?: number };
}>();
const counts = computed(() => {
const tally: Record<string, number> = {};
for (const task of props.tasks) {
const status = task.status ?? "";
tally[status] = (tally[status] ?? 0) + 1;
}
return tally;
});
const counts = computed(() => props.summary.statuses ?? {});
const total = computed(() => props.tasks.length);
const total = computed(() =>
Object.values(counts.value).reduce((sum, n) => sum + n, 0),
);
const working = computed(() => counts.value.running ?? 0);
// Delivered counts everything whose work is out of archied's hands: merged,
// in review, or finished with no change to make (completed, which is how a
// no-change build and a no-code triage end).
const done = computed(() => delivered(counts.value) + (counts.value.pr_open ?? 0));
// "Needs you" is the server's grouping, not a local pair of ids: the same set
// backs the ?status=needs_you filter, so the tile and the filter cannot drift.
const needsYou = computed(() => {
const attention = attentionStatusIds();
return Object.entries(counts.value).reduce(
(sum, [status, n]) => (attention.has(status) ? sum + n : sum),
0,
);
});
// "Needs you" is grouped by the server, the same set ?status=needs_you filters.
const needsYou = computed(() => props.summary.needs_you ?? 0);
</script>
<template>
-14
View File
@@ -50,17 +50,3 @@ export function initialTaskFilter(
export function boardStatus(query: string, catalog: StatusMeta[]): string {
return initialTaskFilter(query, catalog);
}
/** taskMatchesStatus reports whether a task survives the status filter. */
export function taskMatchesStatus(
task: { status?: string },
status: string,
catalog: StatusMeta[],
): boolean {
if (!status) return true;
if (status === "needs_you")
return catalog.some(
(entry) => entry.needs_you && entry.id === (task.status ?? ""),
);
return task.status === status;
}
-25
View File
@@ -7,7 +7,6 @@ import { computed, ref } from "vue";
import {
boardStatus,
initialTaskFilter,
taskMatchesStatus,
taskStatuses,
} from "../src/tasks/task-filter.ts";
@@ -41,30 +40,6 @@ test("only a status the served catalog knows becomes a filter", () => {
}
});
test("needs_you groups exactly the statuses the catalog marks for a human", () => {
const catalog = [QUEUED, WAITING, TRIAGING];
assert.deepEqual(
[...taskStatuses(catalog)],
["needs_you", "queued", "waiting_human", "triaging"],
);
const cases: Array<[{ status?: string }, string, boolean]> = [
[{ status: "waiting_human" }, "needs_you", true],
[{ status: "triaging" }, "needs_you", false],
[{ status: "queued" }, "", true],
[{ status: "triaging" }, "triaging", true],
[{ status: "queued" }, "triaging", false],
[{}, "queued", false],
];
for (const [task, status, expected] of cases) {
assert.equal(
taskMatchesStatus(task, status, catalog),
expected,
`${task.status} against ${status}`,
);
}
});
// The defect: the board captured the filter at setup, before loadTaskMeta()
// replaced the freeze-dried defaults, and the only re-derivation watched the
// query string. A status the server serves but the defaults do not know was