@newheap/platform-ai-chat 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"newheap-platform-ai-chat-agent-runs.mjs","sources":["../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-proposals.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-proposals.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-inbox.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-inbox.component.html","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-run-receipt.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-artifacts.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-artifacts.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-consultations.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-consultations.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-memory.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-memory.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-run-result.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-run-result.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-run-timeline.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-run-timeline.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-thread-view.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-thread-view.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-subject-suggestions.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-subject-suggestions.component.html","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-subject-picker.component.ts","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-subject-picker.component.html","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-run-now-dialog.component.ts","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-run-now-dialog.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-object-agents.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-object-agents.component.html","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-board-history.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-board.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-board.component.html","../../../projects/nh-ai-chat/agent-runs/src/public-api.ts","../../../projects/nh-ai-chat/agent-runs/src/newheap-platform-ai-chat-agent-runs.ts"],"sourcesContent":["import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n afterNextRender,\n computed,\n inject,\n input,\n output,\n signal\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Observable, Subscription, forkJoin } from 'rxjs';\nimport {\n AgentExecutionResolution,\n AgentProposal,\n AgentProposalDecision,\n AgentProposalDecisionRight,\n AgentProposalFeedback,\n AgentProposalOrigin,\n NH_ASSISTANT_MAX_PROPOSAL_LOOKUP,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n NhAssistantProposalFeedbackComponent,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantSubjectLinkComponent as NhAssistantSubjectLinkComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\n\n/** A feedback question: after a rejection above the list, or from a card's own action. */\ninterface NhAssistantFeedbackRequest {\n approvalIds: string[];\n initial: AgentProposalFeedback | null;\n placement: 'prompt' | 'card';\n /** What was rejected, for a single rejection. */\n summary: string | null;\n /** The feedback was stored; the panel thanks the person until the next action. */\n saved: boolean;\n}\n\n/**\n * A list of agent proposals with their decision and execution state. People who may decide see\n * approve and reject on pending proposals and the resolution of an execution with an unknown\n * outcome; the server checks every decision again. With `selectable`, pending proposals can be\n * approved or rejected together. Deciding takes one action. After a rejection the list asks,\n * optionally and above the list, what was wrong; closed proposals keep a low-key action to give or\n * change that feedback later. With `decisionRights` each proposal has its own right, for example\n * from the agent work on a subject, and a pending proposal the viewer may not decide says who does.\n * A proposal that no longer fits, for example because a person already did the work, shows why.\n * With `holdClosedCards`, a list of open proposals keeps such a proposal, or one a newer proposal\n * replaced, as a closed card when it closes while shown, or when an approval is refused because of\n * it, until the person dismisses it. It reads those proposals by id with one lookup, never through\n * their threads. A proposal that a run placed here from another subject, such as a run for the whole\n * application, says so and offers that run's conversation through `openConversation`.\n */\n@Component({\n selector: 'nh-assistant-agent-proposals',\n standalone: true,\n imports: [\n DatePipe,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantSubjectLinkComponent,\n NhAssistantProposalFeedbackComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-proposals.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentProposalsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private subscription?: Subscription;\n\n readonly proposals = input.required<AgentProposal[]>();\n /** Whether the caller may decide: an approver of the subjects or the inbox owner. */\n readonly canDecide = input(false);\n /**\n * The caller's live right per proposal, by approval id, for example from\n * `AgentSubjectWork.openProposals`. A proposal with a right uses it instead of `canDecide`.\n */\n readonly decisionRights = input<ReadonlyMap<string, AgentProposalDecisionRight> | null>(null);\n readonly selectable = input(false);\n /**\n * Keeps proposals that close as stale or are replaced while shown as closed cards with their\n * explanation until they are dismissed. For lists of open proposals, which drop a proposal once\n * it closes.\n */\n readonly holdClosedCards = input(false);\n /** Emits after a proposal or its feedback changed, so the host reloads its list. */\n readonly changed = output<void>();\n /**\n * Emits the conversation of the run that placed a proposal here from another subject, so the host\n * opens it, for example in the assistant panel. The server checks the reader's access again.\n */\n readonly openConversation = output<string>();\n\n readonly busy = signal(false);\n readonly selected = signal<ReadonlySet<string>>(new Set());\n readonly error = signal<NhAssistantError | null>(null);\n readonly errorKeys = computed(() => nhAssistantErrorKeys(this.error()));\n /** Pending proposals the caller may decide. */\n readonly pending = computed(() =>\n this.proposals().filter(proposal => proposal.status === 'pending' && this.mayDecide(proposal)));\n readonly allSelected = computed(() =>\n this.pending().length > 0 && this.pending().every(proposal => this.selected().has(proposal.approvalId)));\n /** The feedback question. It does not depend on `proposals`, which drop rejected proposals in the inbox. */\n readonly feedback = signal<NhAssistantFeedbackRequest | null>(null);\n /** Proposals that closed as stale while shown, kept until dismissed; newest first. */\n readonly held = signal<AgentProposal[]>([]);\n /** The held closed cards first, then the proposals the host gave. */\n readonly shown = computed(() => {\n const held = this.held();\n const heldIds = new Set(held.map(proposal => proposal.approvalId));\n return [...held, ...this.proposals().filter(proposal => !heldIds.has(proposal.approvalId))];\n });\n private readonly lookups = new Subscription();\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.lookups.unsubscribe();\n });\n }\n\n /**\n * The translation key of a proposal's status: the kind of a stale proposal, \"replaced\" for a\n * superseded one, otherwise its status.\n */\n statusKey(proposal: AgentProposal): string {\n if (proposal.status === 'stale' && proposal.staleKind) {\n return `nh-assistant.approval.stale-kind.${proposal.staleKind}`;\n }\n\n return isSuperseded(proposal)\n ? 'nh-assistant.approval.superseded'\n : `nh-assistant.agent-runs.proposal.status.${proposal.status}`;\n }\n\n /**\n * The translation key and parameters that say where a placed proposal came from: the whole\n * application, a division of it, or another object, named only by its kind.\n */\n originText(origin: AgentProposalOrigin): { key: string; params: Record<string, string> } {\n if (origin.subjectType === 'nh-system') {\n return origin.subjectId?.startsWith('division-') && origin.subjectDisplayName\n ? { key: 'nh-assistant.agent-runs.proposal.placed-by.division', params: { name: origin.subjectDisplayName } }\n : { key: 'nh-assistant.agent-runs.proposal.placed-by.application', params: {} };\n }\n\n return origin.subjectTypeName\n ? { key: 'nh-assistant.agent-runs.proposal.placed-by.object-named', params: { type: origin.subjectTypeName } }\n : { key: 'nh-assistant.agent-runs.proposal.placed-by.object', params: {} };\n }\n\n /** True when the newer proposal that replaced this one is in the list. */\n hasSuccessor(proposal: AgentProposal): boolean {\n const successor = proposal.supersededByApprovalId;\n return !!successor && this.shown().some(item => item.approvalId === successor);\n }\n\n /** Moves focus to the newer proposal that replaced this one. */\n showSuccessor(proposal: AgentProposal): void {\n const card = Array.from(this.host.nativeElement.querySelectorAll<HTMLElement>('[data-approval-id]'))\n .find(element => element.dataset['approvalId'] === proposal.supersededByApprovalId);\n card?.scrollIntoView({ block: 'nearest' });\n card?.focus();\n }\n\n /** True for a closed card the list keeps until it is dismissed. */\n isHeld(proposal: AgentProposal): boolean {\n return this.held().some(item => item.approvalId === proposal.approvalId);\n }\n\n /** Removes a closed card. */\n dismiss(proposal: AgentProposal): void {\n this.held.update(held => held.filter(item => item.approvalId !== proposal.approvalId));\n }\n\n /**\n * Called by a host of open proposals after a live update replaced `previous` with `next`: keeps\n * the shown pending proposals that left the list because they closed as stale or were replaced.\n */\n holdClosed(previous: readonly AgentProposal[], next: readonly AgentProposal[]): void {\n const nextIds = new Set(next.map(proposal => proposal.approvalId));\n this.holdStale(previous.filter(proposal => proposal.status === 'pending' && !nextIds.has(proposal.approvalId)));\n }\n\n /** Whether the caller may decide this proposal: its own right when one was given, otherwise `canDecide`. */\n mayDecide(proposal: AgentProposal): boolean {\n const right = this.decisionRights()?.get(proposal.approvalId);\n return right ? right.canDecide : this.canDecide();\n }\n\n /**\n * Who decides a pending proposal that has a right the caller lacks: another approver when\n * four-eyes keeps out the person who started the work, otherwise an approver.\n */\n waitingForKey(proposal: AgentProposal): string | null {\n const right = this.decisionRights()?.get(proposal.approvalId);\n if (!right || right.canDecide || proposal.status !== 'pending') {\n return null;\n }\n\n return right.reasonCode === 'assistant-four-eyes-required'\n ? 'nh-assistant.approval.waiting-for-other-approver'\n : 'nh-assistant.approval.waiting-for-approver';\n }\n\n toggle(proposal: AgentProposal): void {\n const next = new Set(this.selected());\n if (next.has(proposal.approvalId)) {\n next.delete(proposal.approvalId);\n } else {\n next.add(proposal.approvalId);\n }\n this.selected.set(next);\n }\n\n toggleAll(): void {\n this.selected.set(this.allSelected() ? new Set() : new Set(this.pending().map(proposal => proposal.approvalId)));\n }\n\n decide(proposal: AgentProposal, decision: AgentProposalDecision): void {\n this.run(this.api.decide(proposal, decision), result => {\n if (decision === 'reject' && result.status === 'rejected' && result.canGiveFeedback === true) {\n this.ask([proposal.approvalId], summaryOf(proposal));\n }\n }, code => {\n if (code === staleCode) {\n // The approval was refused because the proposal no longer fits; show why.\n this.holdStale([proposal]);\n }\n });\n }\n\n decideSelected(decision: AgentProposalDecision): void {\n const ids = [...this.selected()];\n if (ids.length === 0) {\n return;\n }\n\n const proposals = this.proposals();\n this.run(this.api.decideMany(ids, decision), response => {\n this.selected.set(new Set());\n const stale = response.results\n .filter(outcome => !outcome.succeeded && outcome.code === staleCode)\n .map(outcome => outcome.approvalId);\n this.holdStale(proposals.filter(proposal => stale.includes(proposal.approvalId)));\n if (decision !== 'reject') {\n return;\n }\n\n const rejected = response.results\n .filter(outcome => outcome.succeeded && outcome.status === 'rejected')\n .map(outcome => outcome.approvalId);\n if (rejected.length > 0) {\n const single = rejected.length === 1 ? proposals.find(proposal => proposal.approvalId === rejected[0]) : undefined;\n this.ask(rejected, single ? summaryOf(single) : null);\n }\n });\n }\n\n resolve(proposal: AgentProposal, action: AgentExecutionResolution): void {\n this.run(this.api.resolve(proposal.approvalId, action));\n }\n\n /** Opens the feedback question in the card of a closed proposal, with the caller's own feedback. */\n giveFeedback(proposal: AgentProposal): void {\n this.feedback.set({\n approvalIds: [proposal.approvalId],\n initial: proposal.feedback ?? null,\n placement: 'card',\n summary: null,\n saved: false\n });\n }\n\n /** True while the feedback question for this proposal is open, above the list or in its card. */\n isAsking(proposal: AgentProposal): boolean {\n const request = this.feedback();\n return request !== null && !request.saved && request.approvalIds.includes(proposal.approvalId);\n }\n\n /** True when the card of this proposal shows the feedback question or its thanks. */\n inCard(proposal: AgentProposal): boolean {\n const request = this.feedback();\n return request?.placement === 'card' && request.approvalIds[0] === proposal.approvalId;\n }\n\n /** Keeps the panel, which now thanks the person, and lets the host reload the proposals. */\n onFeedbackSaved(): void {\n this.feedback.update(request => request ? { ...request, saved: true } : request);\n this.changed.emit();\n }\n\n /** Closes the question; from a card, focus returns to the card's feedback action. */\n onFeedbackDismissed(): void {\n const request = this.feedback();\n this.feedback.set(null);\n if (request?.placement !== 'card') {\n return;\n }\n\n const [approvalId] = request.approvalIds;\n afterNextRender(() => {\n const action = Array.from(this.host.nativeElement.querySelectorAll<HTMLButtonElement>('[data-feedback-approval]'))\n .find(item => item.dataset['feedbackApproval'] === approvalId);\n action?.focus();\n }, { injector: this.injector });\n }\n\n private ask(approvalIds: string[], summary: string | null): void {\n this.feedback.set({ approvalIds, initial: null, placement: 'prompt', summary, saved: false });\n }\n\n /**\n * Reads `proposals` again by id and keeps those that closed as stale or were replaced as closed\n * cards, with their kind and explanation or their successor.\n */\n private holdStale(proposals: readonly AgentProposal[]): void {\n if (!this.holdClosedCards() || proposals.length === 0) {\n return;\n }\n\n // The proposals are read by id, never through their threads.\n const ids = [...new Set(proposals.map(proposal => proposal.approvalId))];\n const batches: string[][] = [];\n for (let start = 0; start < ids.length; start += NH_ASSISTANT_MAX_PROPOSAL_LOOKUP) {\n batches.push(ids.slice(start, start + NH_ASSISTANT_MAX_PROPOSAL_LOOKUP));\n }\n this.lookups.add(forkJoin(batches.map(batch => this.api.lookupProposals(batch))).subscribe({\n next: lookups => {\n const closed = lookups\n .flatMap(lookup => lookup.items)\n .map(item => item.proposal)\n .filter(proposal => proposal.status === 'stale' || isSuperseded(proposal));\n if (closed.length === 0) {\n return;\n }\n\n this.held.update(held => [\n ...closed,\n ...held.filter(item => !closed.some(proposal => proposal.approvalId === item.approvalId))\n ]);\n },\n // Without the lookup the proposal just leaves the list, as it did before.\n error: () => undefined\n }));\n }\n\n private run<T>(request: Observable<T>, done?: (result: T) => void, failed?: (code: string) => void): void {\n this.busy.set(true);\n this.error.set(null);\n if (this.feedback()?.saved) {\n this.feedback.set(null);\n }\n this.subscription?.unsubscribe();\n this.subscription = request.subscribe({\n next: result => {\n this.busy.set(false);\n done?.(result);\n this.changed.emit();\n },\n error: failure => {\n this.busy.set(false);\n const error = toNhAssistantError(failure);\n this.error.set(error);\n failed?.(error.code);\n this.changed.emit();\n }\n });\n }\n}\n\n/** The refusal of an approval because the proposal no longer fits. */\nconst staleCode = 'assistant-proposal-stale';\n\n/** The application's words for a proposal, falling back to its subject and tool. */\nfunction summaryOf(proposal: AgentProposal): string {\n return proposal.presentation?.summary\n ?? `${proposal.subjectDisplayName ?? proposal.subjectId} · ${proposal.presentation?.toolDisplayName ?? proposal.toolId}`;\n}\n\n/** True for a proposal a newer proposal for the same objects replaced. */\nfunction isSuperseded(proposal: AgentProposal): boolean {\n return proposal.status === 'withdrawn' && !!proposal.supersededByApprovalId;\n}\n","<div class=\"proposal-list\">\n @if (error(); as failure) {\n <p class=\"message error\" role=\"alert\"><nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}</p>\n }\n\n @if (feedback(); as request) {\n @if (request.placement === 'prompt') {\n <div class=\"feedback-prompt\">\n @if (request.summary && !request.saved) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.proposal.rejected-one' | translate: { summary: request.summary } }}</p>\n }\n <nh-assistant-proposal-feedback\n [approvalIds]=\"request.approvalIds\"\n [initial]=\"request.initial\"\n (saved)=\"onFeedbackSaved()\"\n (dismissed)=\"onFeedbackDismissed()\" />\n </div>\n }\n }\n\n @if (selectable() && pending().length > 0) {\n <div class=\"toolbar\">\n <label class=\"select\">\n <input type=\"checkbox\" [checked]=\"allSelected()\" [disabled]=\"busy()\" (change)=\"toggleAll()\" />\n {{ 'nh-assistant.agent-runs.inbox.select-all' | translate }}\n </label>\n <button class=\"primary\" type=\"button\" [disabled]=\"busy() || selected().size === 0\" (click)=\"decideSelected('approve')\">\n <nh-assistant-icon name=\"check\" />{{ 'nh-assistant.agent-runs.inbox.approve-selected' | translate }}\n </button>\n <button class=\"secondary\" type=\"button\" [disabled]=\"busy() || selected().size === 0\" (click)=\"decideSelected('reject')\">\n <nh-assistant-icon name=\"x\" />{{ 'nh-assistant.agent-runs.inbox.reject-selected' | translate }}\n </button>\n </div>\n }\n\n @if (shown().length > 0) {\n <ul class=\"cards\" [attr.aria-busy]=\"busy()\">\n @for (proposal of shown(); track proposal.approvalId) {\n <li\n class=\"card\"\n tabindex=\"-1\"\n [attr.data-approval-id]=\"proposal.approvalId\"\n [class.selected]=\"selected().has(proposal.approvalId)\"\n [class.closed]=\"isHeld(proposal)\">\n <div class=\"card-header\">\n @if (selectable() && proposal.status === 'pending' && mayDecide(proposal)) {\n <input\n type=\"checkbox\"\n [checked]=\"selected().has(proposal.approvalId)\"\n [disabled]=\"busy()\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.inbox.select' | translate\"\n (change)=\"toggle(proposal)\" />\n }\n <strong>\n <nh-assistant-subject-link\n [subjectType]=\"proposal.subjectType\"\n [subjectId]=\"proposal.subjectId\"\n [label]=\"proposal.subjectDisplayName ?? proposal.subjectId\"\n [typeName]=\"proposal.subjectTypeName\"\n [link]=\"proposal.subjectLink\" />\n </strong>\n <span class=\"muted\">{{ proposal.presentation?.toolDisplayName ?? proposal.toolId }}</span>\n <span\n class=\"badge\"\n [class.success]=\"proposal.status === 'executed' || proposal.status === 'resolved'\"\n [class.warning]=\"proposal.status === 'pending' || proposal.status === 'execution-unknown' || proposal.status === 'stale'\"\n [class.danger]=\"proposal.status === 'execution-failed' || proposal.status === 'rejected'\">\n {{ statusKey(proposal) | translate }}\n </span>\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.proposal.mode.' + proposal.mode | translate }}</span>\n @if (proposal.grantSource !== 'none') {\n <span class=\"badge\" [attr.title]=\"'nh-assistant.tool-call.grant-source.' + proposal.grantSource + '-hint' | translate\">\n {{ 'nh-assistant.tool-call.grant-source.' + proposal.grantSource | translate }}\n </span>\n }\n @if (proposal.consultationId) {\n <span class=\"badge\" [attr.title]=\"'nh-assistant.agent-runs.proposal.from-consultation-hint' | translate\">\n {{ 'nh-assistant.agent-runs.proposal.from-consultation' | translate }}\n </span>\n }\n </div>\n @if (proposal.placedBy; as origin) {\n @let placedBy = originText(origin);\n <p class=\"placed-by\">\n <span>{{ placedBy.key | translate: placedBy.params }}</span>\n <button\n class=\"text-button\"\n type=\"button\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.proposal.placed-by.open-label' | translate\"\n (click)=\"openConversation.emit(origin.conversationId)\">\n {{ 'nh-assistant.agent-runs.proposal.placed-by.open' | translate }}\n </button>\n </p>\n }\n @if (proposal.presentation; as presentation) {\n <p class=\"summary\">{{ presentation.summary }}</p>\n @if (presentation.fields.length > 0) {\n <dl class=\"presentation-fields\">\n @for (field of presentation.fields; track $index) {\n <div>\n <dt>{{ field.label }}</dt>\n <dd>{{ field.value }}</dd>\n </div>\n }\n </dl>\n }\n @if (presentation.notice) {\n <p class=\"message warning\">{{ presentation.notice }}</p>\n }\n } @else {\n <p class=\"summary\">{{ 'nh-assistant.approval.fallback-summary' | translate }}</p>\n }\n @if (proposal.rationale) {\n <p class=\"rationale\">{{ 'nh-assistant.approval.rationale' | translate: { rationale: proposal.rationale } }}</p>\n }\n @if (proposal.status === 'stale' && proposal.staleExplanation) {\n <p class=\"message stale-explanation\">{{ proposal.staleExplanation }}</p>\n }\n @if (hasSuccessor(proposal)) {\n <button class=\"text-button\" type=\"button\" (click)=\"showSuccessor(proposal)\">\n {{ 'nh-assistant.agent-runs.proposal.show-successor' | translate }}\n </button>\n }\n @if (isHeld(proposal)) {\n <div class=\"closed-card\">\n <p class=\"muted\" role=\"status\">{{ 'nh-assistant.agent-runs.proposal.closed' | translate }}</p>\n <button\n class=\"text-button\"\n type=\"button\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.proposal.dismiss-label' | translate: { summary: proposal.presentation?.summary ?? proposal.toolId }\"\n (click)=\"dismiss(proposal)\">\n {{ 'nh-assistant.agent-runs.proposal.dismiss' | translate }}\n </button>\n </div>\n }\n <details class=\"technical-details\">\n <summary>{{ 'nh-assistant.approval.technical-details' | translate }}</summary>\n <p class=\"label\">{{ 'nh-assistant.approval.tool-id' | translate }}</p>\n <code>{{ proposal.toolId }}</code>\n @if (proposal.targets.length > 0) {\n <p class=\"label\">{{ 'nh-assistant.approval.targets' | translate }}</p>\n <ul class=\"targets\">\n @for (target of proposal.targets; track $index) {\n <li>{{ target }}</li>\n }\n </ul>\n }\n @if (proposal.argumentsPreview) {\n <p class=\"label\">{{ 'nh-assistant.approval.arguments' | translate }}</p>\n <pre>{{ proposal.argumentsPreview }}</pre>\n }\n </details>\n <div class=\"meta\">\n @if (proposal.status === 'pending') {\n <span>{{ 'nh-assistant.agent-runs.proposal.expires' | translate: { date: (proposal.expiresAt | date: 'short') } }}</span>\n }\n @if (proposal.decidedByActorId) {\n <span\n data-proposal-decided-by\n [attr.title]=\"proposal.decidedByDisplayName ? ('nh-assistant.account-id-title' | translate: { id: proposal.decidedByActorId }) : null\">{{ 'nh-assistant.agent-runs.proposal.decided-by' | translate: { actor: proposal.decidedByDisplayName || ('nh-assistant.account-id' | translate: { id: proposal.decidedByActorId }) } }}</span>\n }\n @if (proposal.status === 'stale' && proposal.staleByActorId) {\n <span\n data-proposal-stale-by\n [attr.title]=\"proposal.staleByDisplayName ? ('nh-assistant.account-id-title' | translate: { id: proposal.staleByActorId }) : null\">{{ 'nh-assistant.agent-runs.proposal.stale-by' | translate: { actor: proposal.staleByDisplayName || ('nh-assistant.account-id' | translate: { id: proposal.staleByActorId }) } }}</span>\n }\n @if (proposal.executionResultCode; as code) {\n <span class=\"mono\">{{ code }}</span>\n }\n @if (proposal.feedback; as given) {\n <span>\n {{ 'nh-assistant.agent-runs.proposal.your-feedback' | translate: { category: ('nh-assistant.proposal-feedback.categories.' + given.category | translate) } }}\n </span>\n }\n @if (proposal.canGiveFeedback && !isAsking(proposal)) {\n <button\n class=\"text-button\"\n type=\"button\"\n [attr.data-feedback-approval]=\"proposal.approvalId\"\n [disabled]=\"busy()\"\n (click)=\"giveFeedback(proposal)\">\n {{ (proposal.feedback ? 'nh-assistant.agent-runs.proposal.change-feedback' : 'nh-assistant.agent-runs.proposal.give-feedback') | translate }}\n </button>\n }\n </div>\n @if (inCard(proposal) && feedback(); as request) {\n <nh-assistant-proposal-feedback\n [approvalIds]=\"request.approvalIds\"\n [initial]=\"request.initial\"\n (saved)=\"onFeedbackSaved()\"\n (dismissed)=\"onFeedbackDismissed()\" />\n }\n @if (waitingForKey(proposal); as waitingFor) {\n <p class=\"waiting-for\"><nh-assistant-icon name=\"users\" />{{ waitingFor | translate }}</p>\n }\n @if (proposal.status === 'pending' && mayDecide(proposal)) {\n <div class=\"card-actions\">\n <button class=\"primary\" type=\"button\" [disabled]=\"busy()\" (click)=\"decide(proposal, 'approve')\">\n <nh-assistant-icon name=\"check\" />{{ 'nh-assistant.agent-runs.proposal.approve' | translate }}\n </button>\n <button class=\"secondary\" type=\"button\" [disabled]=\"busy()\" (click)=\"decide(proposal, 'reject')\">\n <nh-assistant-icon name=\"x\" />{{ 'nh-assistant.agent-runs.proposal.reject' | translate }}\n </button>\n </div>\n }\n @if (proposal.status === 'execution-unknown' && mayDecide(proposal)) {\n <p class=\"message warning\"><nh-assistant-icon name=\"warning\" />{{ 'nh-assistant.agent-runs.proposal.unknown-hint' | translate }}</p>\n <div class=\"card-actions\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"busy()\" (click)=\"resolve(proposal, 'mark-resolved')\">\n <nh-assistant-icon name=\"check\" />{{ 'nh-assistant.agent-runs.proposal.mark-resolved' | translate }}\n </button>\n <button class=\"danger\" type=\"button\" [disabled]=\"busy()\" (click)=\"resolve(proposal, 're-execute')\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.proposal.re-execute' | translate }}\n </button>\n </div>\n }\n </li>\n }\n </ul>\n }\n</div>\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n viewChild\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentProposal,\n NhAssistantAgentRunApiService,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵnhAssistantWatchAgentWork as nhAssistantWatchAgentWork\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantAgentProposalsComponent } from './nh-assistant-agent-proposals.component';\n\n/**\n * The approval inbox: pending agent proposals across subjects that the signed-in person may\n * decide, earliest expiry first. Proposals are decided in place, one by one or together; the\n * server checks each decision against the proposal's approval policy again. After a rejection the\n * inbox asks, optionally, what was wrong, also when the rejected proposals have left the list.\n * With live updates the inbox reloads by itself when agent work changes, for example when a\n * colleague decided a proposal or a run proposed a new one; it watches the work of agents for the\n * whole application, whose approvers are no members of it, while it is shown. A proposal that closes because it no\n * longer fits, for example because someone did the work by hand, stays as a closed card with the\n * reason until it is dismissed. A proposal a run placed at its object from another subject, such as a\n * run for the whole application, names that run; `openConversation` emits its conversation.\n */\n@Component({\n selector: 'nh-assistant-agent-inbox',\n standalone: true,\n imports: [TranslatePipe, NhAssistantIconComponent, NhAssistantAgentProposalsComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-inbox.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentInboxComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly proposalList = viewChild(NhAssistantAgentProposalsComponent);\n private subscription?: Subscription;\n\n /** Limits the inbox to one agent. */\n readonly agentId = input<string | undefined>(undefined);\n /** Limits the inbox to one kind of subject, for example `project`. */\n readonly subjectType = input<string | undefined>(undefined);\n readonly itemsPerPage = input(20);\n /**\n * Emits the conversation of the run that placed a proposal at its object from another subject, so\n * the host opens it, for example in the assistant panel.\n */\n readonly openConversation = output<string>();\n\n readonly page = signal(1);\n readonly loading = signal(true);\n /** True after the first successful load; later loads keep the list, and an open feedback question, in place. */\n readonly loaded = signal(false);\n readonly loadFailed = signal(false);\n readonly items = signal<AgentProposal[]>([]);\n readonly total = signal(0);\n readonly pages = computed(() => Math.max(1, Math.ceil(this.total() / this.itemsPerPage())));\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.agentId();\n this.subjectType();\n untracked(() => {\n this.page.set(1);\n this.load();\n });\n });\n // Any agent's work may add, decide or close a proposal of this inbox, also work for the whole\n // application, which reaches the approvers only while they watch it.\n nhAssistantWatchAgentWork();\n nhAssistantReloadOnAgentWork(() => true, () => this.refresh());\n }\n\n load(): void {\n this.fetch(false);\n }\n\n goTo(page: number): void {\n this.page.set(Math.min(Math.max(1, page), this.pages()));\n this.load();\n }\n\n /**\n * Reloads after a live update. Once the inbox is shown it reloads quietly: no loading state, and\n * a failure keeps the list and an open feedback question in place. While a decision of the list\n * is in flight it waits, because the decision reloads the inbox when it ends.\n */\n private refresh(): void {\n if (this.proposalList()?.busy()) {\n return;\n }\n\n this.fetch(this.loaded() && !this.loading() && !this.loadFailed());\n }\n\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api\n .getInbox({\n agentId: this.agentId(),\n subjectType: this.subjectType(),\n page: this.page(),\n itemsPerPage: this.itemsPerPage()\n })\n .subscribe({\n next: inbox => {\n const lastPage = Math.max(1, Math.ceil(inbox.total / this.itemsPerPage()));\n if (inbox.items.length === 0 && this.page() > lastPage) {\n // Proposals were decided elsewhere and this page no longer exists.\n this.page.set(lastPage);\n this.fetch(quiet);\n return;\n }\n\n const previous = this.items();\n this.items.set(inbox.items);\n if (quiet) {\n this.proposalList()?.holdClosed(previous, inbox.items);\n }\n this.total.set(inbox.total);\n this.loading.set(false);\n this.loadFailed.set(false);\n this.loaded.set(true);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","<section class=\"section\" aria-labelledby=\"nh-assistant-agent-inbox-title\" [attr.aria-busy]=\"loading()\">\n <header class=\"section-header\">\n <div>\n <h3 id=\"nh-assistant-agent-inbox-title\">{{ 'nh-assistant.agent-runs.inbox.title' | translate }}</h3>\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.inbox.description' | translate }}</p>\n </div>\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </header>\n\n @if (loading() && items().length === 0 && !loaded()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else {\n <!-- Stays rendered when the list empties, so the optional feedback after a rejection remains. -->\n <nh-assistant-agent-proposals\n [proposals]=\"items()\"\n [canDecide]=\"true\"\n [selectable]=\"true\"\n [holdClosedCards]=\"true\"\n (changed)=\"load()\"\n (openConversation)=\"openConversation.emit($event)\" />\n @if (items().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.inbox.empty' | translate }}</p>\n }\n @if (pages() > 1) {\n <nav class=\"toolbar\" [attr.aria-label]=\"'nh-assistant.agent-runs.inbox.pages' | translate\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"page() <= 1 || loading()\" (click)=\"goTo(page() - 1)\">\n {{ 'nh-assistant.agent-runs.inbox.previous' | translate }}\n </button>\n <span class=\"muted\">{{ 'nh-assistant.agent-runs.inbox.page' | translate: { page: page(), pages: pages() } }}</span>\n <button class=\"secondary\" type=\"button\" [disabled]=\"page() >= pages() || loading()\" (click)=\"goTo(page() + 1)\">\n {{ 'nh-assistant.agent-runs.inbox.next' | translate }}\n </button>\n </nav>\n }\n }\n</section>\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport {\n AgentTriggerOutcome,\n AgentTriggerReceipt,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe\n} from '@newheap/platform-ai-chat';\n\n/**\n * How a start by hand reads: `success` when a run started or will start after the current one,\n * `warning` while the agent or its skill is paused (`waiting`), and `info` when nothing started yet\n * for another reason (`deferred` until the application's change is saved, `ignored`).\n */\nexport type NhAssistantRunReceiptTone = 'success' | 'warning' | 'info';\n\n/** The tone of a receipt's outcome (internal). */\nexport function nhAssistantRunReceiptTone(outcome: AgentTriggerOutcome): NhAssistantRunReceiptTone {\n switch (outcome) {\n case 'waiting':\n return 'warning';\n case 'deferred':\n case 'ignored':\n return 'info';\n default:\n return 'success';\n }\n}\n\n/**\n * The receipt of a start by hand (internal): what happens now, in the presentation its outcome\n * needs. A paused agent or skill reads as a warning with the reason the server named, never as a\n * started run.\n */\n@Component({\n selector: 'nh-assistant-run-receipt',\n standalone: true,\n imports: [NhAssistantTranslatePipe, NhAssistantIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <p\n class=\"message\"\n role=\"status\"\n [class.success]=\"tone() === 'success'\"\n [class.warning]=\"tone() === 'warning'\"\n [class.info]=\"tone() === 'info'\"\n [attr.data-outcome]=\"receipt().outcome\"\n [attr.data-receipt-focus]=\"focusable() ? '' : null\"\n [attr.tabindex]=\"focusable() ? -1 : null\">\n <nh-assistant-icon [name]=\"icon()\" />\n <span>{{ keys() | nhAssistantTranslate: receipt().outcome }}</span>\n </p>\n `,\n styleUrl: './nh-assistant-run-receipt.component.scss'\n})\nexport class NhAssistantRunReceiptComponent {\n readonly receipt = input.required<AgentTriggerReceipt>();\n /** The receipt takes the focus after the start, as in the run-now dialog. */\n readonly focusable = input(false);\n\n readonly tone = computed(() => nhAssistantRunReceiptTone(this.receipt().outcome));\n readonly icon = computed(() => {\n switch (this.tone()) {\n case 'warning':\n return 'warning' as const;\n case 'info':\n return 'clock' as const;\n default:\n return 'check' as const;\n }\n });\n /** The text of the reason a waiting start names first, then the text of its outcome. */\n readonly keys = computed(() => {\n const receipt = this.receipt();\n const outcomeKey = `nh-assistant.agent-runs.thread.outcome.${receipt.outcome}`;\n return receipt.outcome === 'waiting' && receipt.reasonCode\n ? [`nh-assistant.agent-runs.thread.waiting.${receipt.reasonCode}`, outcomeKey]\n : [outcomeKey];\n });\n}\n","import { DatePipe, DOCUMENT } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, computed, effect, inject, input, signal, untracked } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentArtifact,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\n\n/**\n * The files the agent's tools saved in a thread, every version newest first. Files of the\n * agent's own grant that the viewer may not read are listed as shielded and cannot be downloaded.\n * With live updates the list reloads by itself when a run or proposal of the thread changes.\n */\n@Component({\n selector: 'nh-assistant-agent-artifacts',\n standalone: true,\n imports: [DatePipe, TranslatePipe, NhAssistantTranslatePipe, NhAssistantIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-artifacts.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentArtifactsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly document = inject(DOCUMENT);\n private subscription?: Subscription;\n\n readonly conversationId = input.required<string>();\n\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n /** Why the latest download failed, as a code and translation key; `null` after one that worked. */\n readonly downloadError = signal<NhAssistantError | null>(null);\n /** Whether the latest download failed. */\n readonly downloadFailed = computed(() => this.downloadError() !== null);\n /** The text of the download's failure, then the text that a file could not be downloaded. */\n readonly downloadErrorKeys = computed(() => {\n const keys = nhAssistantErrorKeys(this.downloadError());\n return keys.length > 0 ? [...keys.slice(0, -1), 'nh-assistant.agent-runs.artifacts.download-failed'] : [];\n });\n readonly artifacts = signal<AgentArtifact[]>([]);\n readonly downloadingId = signal<string | null>(null);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.conversationId();\n untracked(() => this.load());\n });\n nhAssistantReloadOnAgentWork(\n change => change.conversationId === this.conversationId() && change.reason !== 'feedback',\n () => this.fetch(!this.loading() && !this.loadFailed())\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n async download(artifact: AgentArtifact): Promise<void> {\n this.downloadingId.set(artifact.id);\n this.downloadError.set(null);\n try {\n const blob = await this.api.downloadArtifact(this.conversationId(), artifact.id);\n const url = URL.createObjectURL(blob);\n const link = this.document.createElement('a');\n link.href = url;\n link.download = `${artifact.name}-v${artifact.version}`;\n link.click();\n URL.revokeObjectURL(url);\n } catch (error) {\n this.downloadError.set(toNhAssistantError(error));\n } finally {\n this.downloadingId.set(null);\n }\n }\n\n /** A quiet load, after a live update, shows no loading state and keeps the files when it fails. */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getArtifacts(this.conversationId()).subscribe({\n next: artifacts => {\n this.artifacts.set(artifacts);\n this.loading.set(false);\n this.loadFailed.set(false);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","@if (downloadError(); as failure) {\n <p class=\"message error\" role=\"alert\" data-download-error><nh-assistant-icon name=\"warning\" />{{ downloadErrorKeys() | nhAssistantTranslate: failure.code }}</p>\n}\n\n@if (loading()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n} @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n} @else if (artifacts().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.artifacts.empty' | translate }}</p>\n} @else {\n <ul class=\"cards\">\n @for (artifact of artifacts(); track artifact.id) {\n <li class=\"card\">\n <div class=\"card-header\">\n <strong>{{ artifact.name }}</strong>\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.artifacts.version' | translate: { version: artifact.version } }}</span>\n @if (artifact.restricted) {\n <span class=\"badge warning\">{{ 'nh-assistant.agent-runs.artifacts.restricted' | translate }}</span>\n }\n </div>\n <div class=\"meta\">\n <span class=\"mono\">{{ artifact.contentType }}</span>\n <span>{{ 'nh-assistant.agent-runs.artifacts.size' | translate: { size: artifact.sizeBytes } }}</span>\n <span>{{ artifact.createdAt | date: 'short' }}</span>\n </div>\n @if (!artifact.restricted) {\n <div class=\"card-actions\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"downloadingId() !== null\" (click)=\"download(artifact)\">\n <nh-assistant-icon name=\"page\" />{{ 'nh-assistant.agent-runs.artifacts.download' | translate }}\n </button>\n </div>\n }\n </li>\n }\n </ul>\n}\n","import { DatePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, input, signal, untracked } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentConsultation,\n NhAssistantAgentRunApiService,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe\n} from '@newheap/platform-ai-chat';\n\n/**\n * Who consulted the thread's agent through another assistant, newest first: the person whose rights\n * were used, the asking assistant, the outcome, the usage and the proposals left for approvers. The\n * question and the answer stay in the asking conversation and are never shown here. With live\n * updates the list reloads by itself when a run or proposal of the thread changes.\n */\n@Component({\n selector: 'nh-assistant-agent-consultations',\n standalone: true,\n imports: [DatePipe, TranslatePipe, NhAssistantTranslatePipe, NhAssistantIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-consultations.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentConsultationsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private subscription?: Subscription;\n\n readonly conversationId = input.required<string>();\n\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly consultations = signal<AgentConsultation[]>([]);\n readonly total = signal(0);\n readonly codeKeys = nhAssistantCodeKeys;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.conversationId();\n untracked(() => this.load());\n });\n nhAssistantReloadOnAgentWork(\n change => change.conversationId === this.conversationId() && change.reason !== 'feedback',\n () => this.fetch(!this.loading() && !this.loadFailed())\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /** A quiet load, after a live update, shows no loading state and keeps the list when it fails. */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getConsultations(this.conversationId()).subscribe({\n next: list => {\n this.consultations.set(list.items);\n this.total.set(list.total);\n this.loading.set(false);\n this.loadFailed.set(false);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","@if (loading() && consultations().length === 0) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n} @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n} @else if (consultations().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.consultation.empty' | translate }}</p>\n} @else {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.consultation.private' | translate }}</p>\n <ol class=\"cards\" [attr.aria-label]=\"'nh-assistant.agent-runs.thread.tabs.consultations' | translate\">\n @for (consultation of consultations(); track consultation.id) {\n <li class=\"card\">\n <div class=\"card-header\">\n <strong>{{ consultation.createdAt | date: 'short' }}</strong>\n <span\n class=\"badge\"\n [class.success]=\"consultation.status === 'completed'\"\n [class.warning]=\"consultation.status === 'running'\"\n [class.danger]=\"consultation.status === 'failed'\">\n {{ 'nh-assistant.agent-runs.consultation.status.' + consultation.status | translate }}\n </span>\n <span\n data-consultation-asker\n [attr.title]=\"consultation.askerDisplayName ? ('nh-assistant.account-id-title' | translate: { id: consultation.askerActorId }) : null\">\n {{ 'nh-assistant.agent-runs.consultation.asked-by' | translate: { name: consultation.askerDisplayName ?? ('nh-assistant.account-id' | translate: { id: consultation.askerActorId }) } }}\n @if (consultation.askingAgentId; as agentId) {\n {{ 'nh-assistant.agent-runs.consultation.through' | translate: { agent: (['nh-assistant.agents.' + agentId + '.name'] | nhAssistantTranslate: agentId) } }}\n }\n </span>\n @if (consultation.depth > 1) {\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.consultation.depth' | translate: { depth: consultation.depth } }}</span>\n }\n </div>\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.run.tool-calls' | translate: { count: consultation.toolCalls } }}</span>\n <span>{{ 'nh-assistant.agent-runs.run.tokens' | translate: { count: consultation.inputTokens + consultation.outputTokens } }}</span>\n <span>{{ 'nh-assistant.agent-runs.run.proposals' | translate: { count: consultation.proposalCount } }}</span>\n @if (consultation.failureCode; as code) {\n <span><nh-assistant-icon name=\"warning\" />{{ codeKeys(code) | nhAssistantTranslate: code }}</span>\n }\n </div>\n </li>\n }\n </ol>\n @if (total() > consultations().length) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.consultation.more' | translate: { count: total() - consultations().length } }}</p>\n }\n}\n","import { DatePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, computed, effect, inject, input, signal, untracked } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentThreadMemory,\n NhAssistantAgentRunApiService,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork\n} from '@newheap/platform-ai-chat';\n\n/**\n * The working memory of an agent about the subject of a thread, read-only. The agent keeps it\n * up to date itself; it is shown so that people can see what the agent remembers. With live\n * updates it reloads by itself when a run of the thread changes.\n */\n@Component({\n selector: 'nh-assistant-agent-memory',\n standalone: true,\n imports: [DatePipe, TranslatePipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-memory.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentMemoryComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private subscription?: Subscription;\n\n readonly conversationId = input.required<string>();\n\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly memory = signal<AgentThreadMemory | null>(null);\n readonly formatted = computed(() => {\n const value = this.memory()?.memory;\n return value === null || value === undefined ? null : JSON.stringify(value, null, 2);\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.conversationId();\n untracked(() => this.load());\n });\n // Only runs write the working memory.\n nhAssistantReloadOnAgentWork(\n change => change.conversationId === this.conversationId() && change.reason === 'run',\n () => this.fetch(!this.loading() && !this.loadFailed())\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /** A quiet load, after a live update, shows no loading state and keeps the memory when it fails. */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getMemory(this.conversationId()).subscribe({\n next: memory => {\n this.memory.set(memory);\n this.loading.set(false);\n this.loadFailed.set(false);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","@if (loading()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n} @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n} @else if (!memory()?.configured) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.memory.not-configured' | translate }}</p>\n} @else if (formatted(); as json) {\n <div class=\"section\">\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.memory.version' | translate: { version: memory()!.schemaVersion } }}</span>\n @if (memory()!.updatedAt; as updatedAt) {\n <span>{{ 'nh-assistant.agent-runs.memory.updated' | translate: { date: (updatedAt | date: 'short') } }}</span>\n }\n </div>\n <pre [attr.aria-label]=\"'nh-assistant.agent-runs.thread.tabs.memory' | translate\">{{ json }}</pre>\n </div>\n} @else {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.memory.empty' | translate }}</p>\n}\n","import { DatePipe, DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentArtifact,\n AgentRunResult,\n NhAssistantAgentRunApiService,\n NhAssistantApiError,\n NhAssistantError,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantMarkdownPipe as NhAssistantMarkdownPipe,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantSubjectLinkComponent as NhAssistantSubjectLinkComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantAgentProposalsComponent } from './nh-assistant-agent-proposals.component';\n\nlet nextId = 0;\n\n/** How long a run took, for people to read: a text key and its number. */\ninterface RunDuration {\n key: string;\n value: number;\n}\n\n/**\n * One run of an agent with its result: what it worked on, how it was started and ended, its usage\n * and duration, its whole answer, the proposals it made (also those it placed at other objects the\n * reader may read) and the files it saved. The answer is model output: it is rendered with the\n * assistant's safe Markdown rendering, which shows inline HTML as text and keeps only a strict set\n * of tags and links, never as HTML. The server decides who sees a run (`GET runs/{id}`): readers of\n * its object, for the whole application the agent's view policy, administrators every run. The\n * thread view's run timeline and the administration's runs view open it; an application may show\n * it anywhere with a run id. With live updates it reloads by itself while the run works.\n */\n@Component({\n selector: 'nh-assistant-run-result',\n standalone: true,\n imports: [\n DatePipe,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantMarkdownPipe,\n NhAssistantSubjectLinkComponent,\n NhAssistantAgentProposalsComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-run-result.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantRunResultComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly document = inject(DOCUMENT);\n private subscription?: Subscription;\n\n /** The run to show. */\n readonly runId = input.required<string>();\n /**\n * Whether to offer the run's conversation; leave it off where that conversation is already shown,\n * as in its thread's run timeline.\n */\n readonly conversationLink = input(true);\n /** Emits the run's thread conversation, or the one of a run that placed a proposal, so the host can open it. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-run-result-${nextId++}`;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n /** The run does not exist or the reader may not see it. */\n readonly notFound = signal(false);\n readonly detail = signal<AgentRunResult | null>(null);\n readonly downloadingId = signal<string | null>(null);\n /** Why the latest download failed, as a code and translation key; `null` after one that worked. */\n readonly downloadError = signal<NhAssistantError | null>(null);\n /** Whether the latest download failed. */\n readonly downloadFailed = computed(() => this.downloadError() !== null);\n /** The text of the download's failure, then the text that a file could not be downloaded. */\n readonly downloadErrorKeys = computed(() => {\n const keys = nhAssistantErrorKeys(this.downloadError());\n return keys.length > 0 ? [...keys.slice(0, -1), 'nh-assistant.agent-runs.artifacts.download-failed'] : [];\n });\n readonly codeKeys = nhAssistantCodeKeys;\n readonly duration = computed(() => {\n const run = this.detail()?.run;\n return run ? durationOf(run.startedAt, run.endedAt) : null;\n });\n readonly tokens = computed(() => {\n const run = this.detail()?.run;\n return run ? run.inputTokens + run.outputTokens : 0;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.runId();\n untracked(() => this.fetch(false));\n });\n nhAssistantReloadOnAgentWork(\n change => change.runId === this.runId() || change.conversationId === this.detail()?.run.conversationId,\n () => this.fetch(true)\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n async download(artifact: AgentArtifact): Promise<void> {\n this.downloadingId.set(artifact.id);\n this.downloadError.set(null);\n try {\n const blob = await this.api.downloadRunArtifact(this.runId(), artifact.id);\n const url = URL.createObjectURL(blob);\n const link = this.document.createElement('a');\n link.href = url;\n link.download = `${artifact.name}-v${artifact.version}`;\n link.click();\n URL.revokeObjectURL(url);\n } catch (error) {\n this.downloadError.set(toNhAssistantError(error));\n } finally {\n this.downloadingId.set(null);\n }\n }\n\n /**\n * Reads the run. A quiet reload, after a live update, keeps what is shown when it fails and shows\n * no loading state.\n */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.notFound.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getRunResult(this.runId()).subscribe({\n next: detail => {\n this.detail.set(detail);\n this.loading.set(false);\n this.loadFailed.set(false);\n this.notFound.set(false);\n },\n error: (failure: unknown) => {\n if (quiet && this.detail() !== null) {\n return;\n }\n this.detail.set(null);\n this.loading.set(false);\n const missing = failure instanceof NhAssistantApiError && failure.code === 'assistant-run-not-found';\n this.notFound.set(missing);\n this.loadFailed.set(!missing);\n }\n });\n }\n}\n\n/** The time between a run's start and end, in seconds below two minutes and in minutes above. */\nfunction durationOf(startedAt: string | null, endedAt: string | null): RunDuration | null {\n if (!startedAt || !endedAt) {\n return null;\n }\n\n const seconds = Math.max(0, Math.round((Date.parse(endedAt) - Date.parse(startedAt)) / 1000));\n if (Number.isNaN(seconds)) {\n return null;\n }\n\n return seconds < 120\n ? { key: 'nh-assistant.agent-runs.result.duration-seconds', value: seconds }\n : { key: 'nh-assistant.agent-runs.result.duration-minutes', value: Math.round(seconds / 60) };\n}\n","<section class=\"run-result\" [attr.aria-labelledby]=\"id + '-title'\" [attr.aria-busy]=\"loading()\">\n @if (loading() && !detail()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.result.loading' | translate }}</p>\n } @else if (notFound()) {\n <p class=\"state\" data-run-not-found>{{ 'nh-assistant.agent-runs.result.not-found' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else if (detail(); as current) {\n @let run = current.run;\n <header class=\"run-result-header\">\n <h4 [id]=\"id + '-title'\">\n <span>{{ [run.agentDisplayNameKey ?? ('nh-assistant.agents.' + run.agentId + '.name')] | nhAssistantTranslate: (run.agentDisplayNameKey ?? run.agentId) }}</span>{{ ' ' }}\n <span class=\"muted\" aria-hidden=\"true\">·</span>{{ ' ' }}\n <nh-assistant-subject-link\n [subjectType]=\"run.subjectType\"\n [subjectId]=\"run.subjectId\"\n [label]=\"run.subjectDisplayName ?? run.subjectId\"\n [typeName]=\"run.subjectTypeName\"\n [link]=\"run.subjectLink\" />\n </h4>\n <div class=\"meta\">\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.warning]=\"run.status === 'waiting-for-approval' || run.status === 'queued' || run.status === 'running'\"\n [class.danger]=\"run.status === 'failed'\">{{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}</span>\n @if (run.shadow) {\n <span class=\"badge warning\" data-run-shadow>{{ 'nh-assistant.agent-runs.run.shadow' | translate }}</span>\n }\n @if (run.kind !== 'model') {\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.run.kind.' + run.kind | translate }}</span>\n }\n <span class=\"mono muted\">{{ 'nh-assistant.agent-runs.run.trigger' | translate: { trigger: run.triggerId } }}</span>\n @if (run.skill) {\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.run.skill' | translate: { skill: run.skill } }}</span>\n }\n </div>\n </header>\n\n <dl class=\"facts\">\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.started' | translate }}</dt>\n <dd><time [attr.datetime]=\"run.startedAt ?? run.createdAt\">{{ (run.startedAt ?? run.createdAt) | date: 'medium' }}</time></dd>\n </div>\n @if (duration(); as took) {\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.duration' | translate }}</dt>\n <dd data-run-duration>{{ took.key | translate: { count: took.value } }}</dd>\n </div>\n }\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.usage' | translate }}</dt>\n <dd>\n {{ 'nh-assistant.agent-runs.run.tool-calls' | translate: { count: run.toolCalls } }},\n {{ 'nh-assistant.agent-runs.run.tokens' | translate: { count: tokens() } }}\n </dd>\n </div>\n @if (run.failureCode; as code) {\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.failure' | translate }}</dt>\n <dd data-run-failure>{{ codeKeys(code) | nhAssistantTranslate: code }}</dd>\n </div>\n }\n @if (run.mcpConnectionSkips?.length) {\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.mcp-skipped' | translate }}</dt>\n <dd>\n <ul class=\"mcp-skips\" data-run-mcp-skips>\n @for (skip of run.mcpConnectionSkips; track skip.serverId) {\n <li [attr.data-run-mcp-skip]=\"skip.serverId\">\n <strong>{{ skip.serverDisplayName || skip.serverId }}</strong>: {{ codeKeys(skip.code) | nhAssistantTranslate: skip.code }}\n </li>\n }\n </ul>\n </dd>\n </div>\n }\n </dl>\n\n <!-- The answer is model output: the safe Markdown rendering shows inline HTML as text. -->\n <div class=\"result-body\">\n <h5>{{ 'nh-assistant.agent-runs.result.answer' | translate }}</h5>\n @if (current.result; as answer) {\n <div class=\"markdown\" data-run-answer [innerHTML]=\"answer | nhAssistantMarkdown\"></div>\n @if (current.resultTruncated) {\n <p class=\"muted\" data-run-truncated>{{ 'nh-assistant.agent-runs.result.truncated' | translate }}</p>\n }\n } @else {\n <p class=\"muted\" data-run-no-answer>{{ 'nh-assistant.agent-runs.result.no-answer' | translate }}</p>\n @if (current.summary; as summary) {\n <p class=\"summary\">{{ summary }}</p>\n }\n }\n </div>\n\n <div class=\"result-section\">\n <h5>{{ 'nh-assistant.agent-runs.result.proposals' | translate }}</h5>\n @if (current.proposals.length > 0) {\n <nh-assistant-agent-proposals\n [proposals]=\"current.proposals\"\n (openConversation)=\"openConversation.emit($event)\" />\n } @else if (current.hiddenProposals === 0) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.result.no-proposals' | translate }}</p>\n }\n @if (current.hiddenProposals > 0) {\n <p class=\"muted\" data-hidden-proposals>{{ 'nh-assistant.agent-runs.result.hidden-proposals' | translate: { count: current.hiddenProposals } }}</p>\n }\n </div>\n\n @if (current.artifacts.length > 0) {\n <div class=\"result-section\">\n <h5>{{ 'nh-assistant.agent-runs.result.files' | translate }}</h5>\n @if (downloadError(); as failure) {\n <p class=\"message error\" role=\"alert\" data-download-error><nh-assistant-icon name=\"warning\" />{{ downloadErrorKeys() | nhAssistantTranslate: failure.code }}</p>\n }\n <ul class=\"files\">\n @for (artifact of current.artifacts; track artifact.id) {\n <li [attr.data-run-artifact]=\"artifact.id\">\n <span class=\"file-name\">{{ artifact.name }}</span>\n <span class=\"muted\">{{ 'nh-assistant.agent-runs.artifacts.version' | translate: { version: artifact.version } }}</span>\n @if (artifact.restricted) {\n <span class=\"badge warning\">{{ 'nh-assistant.agent-runs.artifacts.restricted' | translate }}</span>\n } @else {\n <button\n class=\"secondary\"\n type=\"button\"\n [attr.aria-label]=\"('nh-assistant.agent-runs.artifacts.download' | translate) + ' ' + artifact.name\"\n [disabled]=\"downloadingId() !== null\"\n (click)=\"download(artifact)\">\n <nh-assistant-icon name=\"page\" />{{ 'nh-assistant.agent-runs.artifacts.download' | translate }}\n </button>\n }\n </li>\n }\n </ul>\n </div>\n }\n\n @if (conversationLink() && current.canOpenConversation) {\n <div class=\"card-actions\">\n <button class=\"secondary\" type=\"button\" data-run-conversation (click)=\"openConversation.emit(run.conversationId)\">\n <nh-assistant-icon name=\"link\" />{{ 'nh-assistant.agent-runs.thread.open-conversation' | translate }}\n </button>\n </div>\n }\n }\n</section>\n","import { DatePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, computed, effect, inject, input, output, signal, untracked } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Observable, Subscription } from 'rxjs';\nimport {\n AgentRun,\n AgentRunRetryMode,\n AgentSubjectRole,\n AgentTriggerReceipt,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunReceiptComponent } from './internal/nh-assistant-run-receipt.component';\nimport { NhAssistantRunResultComponent } from './nh-assistant-run-result.component';\n\nlet nextId = 0;\n\nconst endedStatuses = new Set(['completed', 'failed', 'cancelled']);\n\n/**\n * The runs of an agent thread, newest first: trigger, status, failure, usage, proposals and the\n * summary the next run starts from, and the agent that handed a run its work. \"Show the result\"\n * opens a run's whole result, proposals and files in `nh-assistant-run-result`. Participants cancel\n * an open run; approvers resume or restart a failed or cancelled one, and a restart shows what became\n * of it like a start by hand. A run's failure reads as its translated code. With live updates it\n * reloads by itself when a run or proposal of the thread changes.\n */\n@Component({\n selector: 'nh-assistant-run-timeline',\n standalone: true,\n imports: [\n DatePipe,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantRunResultComponent,\n NhAssistantRunReceiptComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-run-timeline.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantRunTimelineComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private subscription?: Subscription;\n private actionSubscription?: Subscription;\n\n readonly conversationId = input.required<string>();\n readonly role = input<AgentSubjectRole>('reader');\n /** Emits after a run was cancelled or retried. */\n readonly changed = output<void>();\n /** Emits the thread of the agent that handed a run its work, so the host can open it. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-run-timeline-${nextId++}`;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly runs = signal<AgentRun[]>([]);\n /** The run whose result is shown; one at a time. */\n readonly openedRunId = signal<string | null>(null);\n readonly busyRunId = signal<string | null>(null);\n readonly error = signal<NhAssistantError | null>(null);\n readonly errorKeys = computed(() => nhAssistantErrorKeys(this.error()));\n /** What became of the latest restart. */\n readonly receipt = signal<AgentTriggerReceipt | null>(null);\n readonly codeKeys = nhAssistantCodeKeys;\n readonly canCancel = computed(() => this.role() === 'participant' || this.role() === 'approver');\n readonly canRetry = computed(() => this.role() === 'approver');\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.actionSubscription?.unsubscribe();\n });\n effect(() => {\n this.conversationId();\n untracked(() => this.load());\n });\n nhAssistantReloadOnAgentWork(\n change => change.conversationId === this.conversationId() && change.reason !== 'feedback',\n () => this.fetch(!this.loading() && !this.loadFailed())\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n toggleResult(run: AgentRun): void {\n this.openedRunId.update(current => current === run.id ? null : run.id);\n }\n\n isOpen(run: AgentRun): boolean {\n return !endedStatuses.has(run.status);\n }\n\n canRetryRun(run: AgentRun): boolean {\n return this.canRetry() && (run.status === 'failed' || run.status === 'cancelled');\n }\n\n cancel(run: AgentRun): void {\n this.act(run, this.api.cancelRun(run.id), () => undefined);\n }\n\n retry(run: AgentRun, mode: AgentRunRetryMode): void {\n // A restart starts the agent again; its receipt says whether it started or waits.\n this.act(run, this.api.retryRun(run.id, mode), receipt => {\n if (mode === 'restart') {\n this.receipt.set(receipt);\n }\n });\n }\n\n private act<T>(run: AgentRun, request: Observable<T>, done: (result: T) => void): void {\n this.busyRunId.set(run.id);\n this.error.set(null);\n this.receipt.set(null);\n this.actionSubscription?.unsubscribe();\n this.actionSubscription = request.subscribe({\n next: result => {\n this.busyRunId.set(null);\n done(result);\n this.changed.emit();\n this.load();\n },\n error: failure => {\n this.busyRunId.set(null);\n this.error.set(toNhAssistantError(failure));\n }\n });\n }\n\n /** A quiet load, after a live update, shows no loading state and keeps the runs when it fails. */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getRuns(this.conversationId()).subscribe({\n next: list => {\n this.runs.set(list.items);\n this.loading.set(false);\n this.loadFailed.set(false);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","@if (error(); as failure) {\n <p class=\"message error\" role=\"alert\"><nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}</p>\n}\n@if (receipt(); as restarted) {\n <nh-assistant-run-receipt [receipt]=\"restarted\" />\n}\n\n@if (loading() && runs().length === 0) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n} @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n} @else if (runs().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.run.empty' | translate }}</p>\n} @else {\n <ol class=\"cards\" [attr.aria-label]=\"'nh-assistant.agent-runs.thread.tabs.runs' | translate\">\n @for (run of runs(); track run.id) {\n <li class=\"card\" [attr.aria-busy]=\"busyRunId() === run.id\">\n <div class=\"card-header\">\n <strong>{{ run.createdAt | date: 'short' }}</strong>\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.warning]=\"run.status === 'waiting-for-approval' || run.status === 'queued' || run.status === 'running'\"\n [class.danger]=\"run.status === 'failed'\">\n {{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}\n </span>\n @if (run.shadow) {\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.run.shadow' | translate }}</span>\n }\n @if (run.kind && run.kind !== 'model') {\n <span class=\"badge\" [attr.data-kind]=\"run.kind\">{{ 'nh-assistant.agent-runs.run.kind.' + run.kind | translate }}</span>\n }\n <span class=\"mono muted\">{{ 'nh-assistant.agent-runs.run.trigger' | translate: { trigger: run.triggerId } }}</span>\n @if (run.skill) {\n <span class=\"badge\" [attr.data-skill]=\"run.skill\">\n {{ 'nh-assistant.agent-runs.run.skill' | translate: { skill: run.skill } }}\n @if (run.skillChosenBy) {\n · {{ 'nh-assistant.agent-runs.run.skill-chosen-by.' + run.skillChosenBy | translate }}\n }\n </span>\n }\n </div>\n @if (run.requestedByAgentId; as source) {\n <p class=\"handed-off\" [attr.data-handed-off-by]=\"source\">\n {{ 'nh-assistant.agent-runs.run.handed-off-by' | translate: { agent: (['nh-assistant.agents.' + source + '.name'] | nhAssistantTranslate: source) } }}\n @if (run.requestedByConversationId; as sourceThread) {\n <button class=\"link\" type=\"button\" (click)=\"openConversation.emit(sourceThread)\">\n {{ 'nh-assistant.agent-runs.run.open-source-thread' | translate }}\n </button>\n }\n </p>\n }\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.run.tool-calls' | translate: { count: run.toolCalls } }}</span>\n <span>{{ 'nh-assistant.agent-runs.run.tokens' | translate: { count: run.inputTokens + run.outputTokens } }}</span>\n <span>{{ 'nh-assistant.agent-runs.run.proposals' | translate: { count: run.proposalCount } }}</span>\n @if (run.attempt > 1) {\n <span>{{ 'nh-assistant.agent-runs.run.attempt' | translate: { attempt: run.attempt } }}</span>\n }\n @if (run.failureCode; as code) {\n <span data-run-failure>{{ codeKeys(code) | nhAssistantTranslate: code }}</span>\n }\n </div>\n @if (run.summary) {\n <p class=\"summary\">{{ run.summary }}</p>\n }\n <div class=\"card-actions\">\n <button\n class=\"secondary\"\n type=\"button\"\n data-toggle-run-result\n [attr.aria-expanded]=\"openedRunId() === run.id\"\n [attr.aria-controls]=\"id + '-' + run.id + '-result'\"\n (click)=\"toggleResult(run)\">\n <nh-assistant-icon name=\"list\" />{{ (openedRunId() === run.id ? 'nh-assistant.agent-runs.result.hide' : 'nh-assistant.agent-runs.result.show') | translate }}\n </button>\n @if ((isOpen(run) && canCancel()) || canRetryRun(run)) {\n @if (isOpen(run) && canCancel()) {\n <button class=\"secondary\" type=\"button\" [disabled]=\"busyRunId() !== null\" (click)=\"cancel(run)\">\n <nh-assistant-icon name=\"stop\" />{{ 'nh-assistant.agent-runs.run.cancel' | translate }}\n </button>\n }\n @if (canRetryRun(run)) {\n <button class=\"secondary\" type=\"button\" [disabled]=\"busyRunId() !== null\" (click)=\"retry(run, 'resume')\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.run.resume' | translate }}\n </button>\n <button class=\"secondary\" type=\"button\" [disabled]=\"busyRunId() !== null\" (click)=\"retry(run, 'restart')\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.run.restart' | translate }}\n </button>\n }\n }\n </div>\n @if (openedRunId() === run.id) {\n <div class=\"work\" [id]=\"id + '-' + run.id + '-result'\">\n <nh-assistant-run-result\n [runId]=\"run.id\"\n [conversationLink]=\"false\"\n (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n </li>\n }\n </ol>\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n viewChild\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentProposal,\n AgentThreadLookup,\n AgentTriggerReceipt,\n LiveAgentWorkChanged,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantSubjectLinkComponent as NhAssistantSubjectLinkComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunReceiptComponent } from './internal/nh-assistant-run-receipt.component';\nimport { NhAssistantAgentArtifactsComponent } from './nh-assistant-agent-artifacts.component';\nimport { NhAssistantAgentConsultationsComponent } from './nh-assistant-agent-consultations.component';\nimport { NhAssistantAgentMemoryComponent } from './nh-assistant-agent-memory.component';\nimport { NhAssistantAgentProposalsComponent } from './nh-assistant-agent-proposals.component';\nimport { NhAssistantRunTimelineComponent } from './nh-assistant-run-timeline.component';\n\nexport type NhAssistantAgentThreadTab = 'proposals' | 'runs' | 'consultations' | 'memory' | 'artifacts';\n\n/**\n * The agent's work on one subject, for example an \"Intake review\" tab on a project page: the\n * caller's role, a start action for participants, and the thread's proposals, runs, consultations\n * by other assistants, working memory and files. Everything follows the caller's live role on the\n * subject. With live updates the view reloads by itself when the thread's runs, proposals or\n * feedback change, also when a colleague decided elsewhere.\n */\n@Component({\n selector: 'nh-assistant-agent-thread-view',\n standalone: true,\n imports: [\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantSubjectLinkComponent,\n NhAssistantAgentProposalsComponent,\n NhAssistantRunTimelineComponent,\n NhAssistantAgentMemoryComponent,\n NhAssistantAgentArtifactsComponent,\n NhAssistantAgentConsultationsComponent,\n NhAssistantRunReceiptComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-thread-view.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentThreadViewComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly proposalList = viewChild(NhAssistantAgentProposalsComponent);\n private subscription?: Subscription;\n private proposalSubscription?: Subscription;\n private startSubscription?: Subscription;\n\n readonly agentId = input.required<string>();\n readonly subjectType = input.required<string>();\n readonly subjectId = input.required<string>();\n /**\n * Emits the thread's conversation id, so the host can open it in the assistant panel; also the\n * conversation of a run that placed one of the thread's proposals here from another subject.\n */\n readonly openConversation = output<string>();\n\n readonly tab = signal<NhAssistantAgentThreadTab>('proposals');\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly lookup = signal<AgentThreadLookup | null>(null);\n readonly proposals = signal<AgentProposal[]>([]);\n readonly message = signal('');\n readonly starting = signal(false);\n readonly receipt = signal<AgentTriggerReceipt | null>(null);\n readonly error = signal<NhAssistantError | null>(null);\n readonly errorKeys = computed(() => nhAssistantErrorKeys(this.error()));\n readonly thread = computed(() => this.lookup()?.thread ?? null);\n readonly role = computed(() => this.lookup()?.role ?? 'none');\n readonly tabs: readonly NhAssistantAgentThreadTab[] = ['proposals', 'runs', 'consultations', 'memory', 'artifacts'];\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.proposalSubscription?.unsubscribe();\n this.startSubscription?.unsubscribe();\n });\n effect(() => {\n this.agentId();\n this.subjectType();\n this.subjectId();\n untracked(() => this.load());\n });\n nhAssistantReloadOnAgentWork(change => this.concerns(change), () => this.refresh());\n }\n\n load(): void {\n this.fetch(false);\n }\n\n loadProposals(): void {\n this.fetchProposals(false);\n }\n\n onMessage(event: Event): void {\n this.message.set((event.target as HTMLTextAreaElement).value);\n }\n\n start(): void {\n this.starting.set(true);\n this.error.set(null);\n this.receipt.set(null);\n this.startSubscription?.unsubscribe();\n this.startSubscription = this.api\n .startAgent({\n agentId: this.agentId(),\n subjectType: this.subjectType(),\n subjectId: this.subjectId(),\n message: this.message().trim() || null\n })\n .subscribe({\n next: receipt => {\n this.starting.set(false);\n this.receipt.set(receipt);\n this.message.set('');\n this.load();\n },\n error: failure => {\n this.starting.set(false);\n this.error.set(toNhAssistantError(failure));\n }\n });\n }\n\n /**\n * Whether a live update is about this view: its own thread, or, before the subject has a thread,\n * a run that may have started it.\n */\n private concerns(change: LiveAgentWorkChanged): boolean {\n const thread = this.thread();\n return thread ? change.conversationId === thread.conversationId : change.reason === 'run';\n }\n\n /**\n * Reloads after a live update. Once the thread is shown it reloads quietly: no loading state, and\n * a failure keeps what is shown, including an open feedback question. While a decision of the\n * proposal list is in flight only the thread reloads, because the decision reloads the proposals\n * when it ends.\n */\n private refresh(): void {\n const withProposals = this.proposalList()?.busy() !== true;\n this.fetch(this.lookup() !== null && !this.loading() && !this.loadFailed(), withProposals);\n }\n\n private fetch(quiet: boolean, withProposals = true): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getThread(this.agentId(), this.subjectType(), this.subjectId()).subscribe({\n next: lookup => {\n this.lookup.set(lookup);\n if (!lookup.thread?.activeRun && this.receipt()?.runId) {\n // The run the receipt announced has ended; the run timeline shows how.\n this.receipt.set(null);\n }\n this.loading.set(false);\n this.loadFailed.set(false);\n if (withProposals) {\n this.fetchProposals(quiet);\n }\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n\n private fetchProposals(quiet: boolean): void {\n const thread = this.thread();\n this.proposalSubscription?.unsubscribe();\n if (!thread) {\n this.proposals.set([]);\n return;\n }\n\n this.proposalSubscription = this.api.getProposals(thread.conversationId).subscribe({\n next: proposals => this.proposals.set(proposals),\n error: () => {\n if (!quiet) {\n this.proposals.set([]);\n }\n }\n });\n }\n}\n","<section class=\"section\" aria-labelledby=\"nh-assistant-agent-thread-title\" [attr.aria-busy]=\"loading()\">\n <header class=\"section-header\">\n <div>\n <h3 id=\"nh-assistant-agent-thread-title\">\n @if (thread(); as current) {\n <nh-assistant-subject-link\n [subjectType]=\"current.subjectType\"\n [subjectId]=\"current.subjectId\"\n [label]=\"current.subjectDisplayName ?? ('nh-assistant.agent-runs.thread.title' | translate)\"\n [typeName]=\"current.subjectTypeName\"\n [link]=\"current.subjectLink\" />\n } @else {\n {{ 'nh-assistant.agent-runs.thread.title' | translate }}\n }\n </h3>\n <p class=\"muted\">\n {{ 'nh-assistant.agent-runs.role.' + role() | translate }}\n @if (thread()?.activeRun; as activeRun) {\n · {{ 'nh-assistant.agent-runs.run.status.' + activeRun.status | translate }}\n }\n @if (thread()?.waitingInputs) {\n · {{ 'nh-assistant.agent-runs.thread.waiting-inputs' | translate: { count: thread()!.waitingInputs } }}\n }\n </p>\n @if (thread()?.shadow) {\n <p class=\"muted\" data-shadow-thread>{{ 'nh-assistant.agent-runs.thread.shadow' | translate }}</p>\n }\n </div>\n <div class=\"toolbar\">\n @if (thread(); as current) {\n <button class=\"secondary\" type=\"button\" (click)=\"openConversation.emit(current.conversationId)\">\n <nh-assistant-icon name=\"link\" />{{ 'nh-assistant.agent-runs.thread.open-conversation' | translate }}\n </button>\n }\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </div>\n </header>\n\n @if (error(); as failure) {\n <p class=\"message error\" role=\"alert\"><nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}</p>\n }\n @if (receipt(); as started) {\n <nh-assistant-run-receipt [receipt]=\"started\" />\n }\n\n @if (loading() && !lookup()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else {\n @if (lookup()?.canStart) {\n <form class=\"toolbar\" (submit)=\"$event.preventDefault(); start()\">\n <textarea\n class=\"reason\"\n rows=\"2\"\n maxlength=\"4000\"\n [value]=\"message()\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.thread.start-message' | translate\"\n [placeholder]=\"'nh-assistant.agent-runs.thread.start-message' | translate\"\n (input)=\"onMessage($event)\"></textarea>\n <button class=\"primary\" type=\"submit\" [disabled]=\"starting()\">\n <nh-assistant-icon name=\"send\" />{{ (starting() ? 'nh-assistant.agent-runs.thread.starting' : 'nh-assistant.agent-runs.thread.start') | translate }}\n </button>\n </form>\n }\n\n @if (thread(); as current) {\n <div class=\"tabs\" role=\"tablist\">\n @for (item of tabs; track item) {\n <button\n type=\"button\"\n role=\"tab\"\n [attr.aria-selected]=\"tab() === item\"\n (click)=\"tab.set(item)\">\n {{ 'nh-assistant.agent-runs.thread.tabs.' + item | translate }}\n </button>\n }\n </div>\n <div role=\"tabpanel\">\n @switch (tab()) {\n @case ('proposals') {\n @if (proposals().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.thread.no-proposals' | translate }}</p>\n } @else {\n <nh-assistant-agent-proposals\n [proposals]=\"proposals()\"\n [canDecide]=\"role() === 'approver'\"\n (changed)=\"loadProposals()\"\n (openConversation)=\"openConversation.emit($event)\" />\n }\n }\n @case ('runs') {\n <nh-assistant-run-timeline\n [conversationId]=\"current.conversationId\"\n [role]=\"role()\"\n (changed)=\"load()\"\n (openConversation)=\"openConversation.emit($event)\" />\n }\n @case ('consultations') {\n <nh-assistant-agent-consultations [conversationId]=\"current.conversationId\" />\n }\n @case ('memory') {\n <nh-assistant-agent-memory [conversationId]=\"current.conversationId\" />\n }\n @case ('artifacts') {\n <nh-assistant-agent-artifacts [conversationId]=\"current.conversationId\" />\n }\n }\n </div>\n } @else {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.thread.no-thread' | translate }}</p>\n }\n }\n</section>\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n viewChild\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentProposalDecisionRight,\n AgentSubjectWork,\n AgentSubjectWorkAgent,\n AgentThreadLookup,\n AgentTriggerReceipt,\n NhAssistantAgentRunApiService,\n NhAssistantApiError,\n NhAssistantError,\n NhAssistantPanelService,\n NhAssistantStore,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunReceiptComponent } from './internal/nh-assistant-run-receipt.component';\nimport { NhAssistantAgentProposalsComponent } from './nh-assistant-agent-proposals.component';\n\nlet nextSuggestionsId = 0;\n\n/** The outcome of starting one agent on the subject. */\ninterface NhAssistantStartedAgent {\n agentId: string;\n receipt: AgentTriggerReceipt;\n}\n\n/**\n * The agent work on one subject of the application, for example in a project's dialog: the open\n * proposals of every agent on the subject with the viewer's own decision right, including who\n * decides when the viewer may not and the optional question after a rejection, and per agent the\n * conversation about the subject and, for participants, a start action. `agentId` names the agent\n * whose conversation the host offers also before it worked on the subject. With live updates the\n * view reloads by itself when agent work on its subject changes; a proposal that closes because it\n * no longer fits stays as a closed card with the reason until it is dismissed. Opening a\n * conversation uses `NhAssistantPanelService.openSubject` and emits `conversationOpened` afterwards;\n * opening the conversation of a run that placed a proposal here emits `runConversationOpened`.\n */\n@Component({\n selector: 'nh-assistant-subject-suggestions',\n standalone: true,\n imports: [\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantAgentProposalsComponent,\n NhAssistantRunReceiptComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-subject-suggestions.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantSubjectSuggestionsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly panel = inject(NhAssistantPanelService);\n private readonly store = inject(NhAssistantStore);\n private readonly proposalList = viewChild(NhAssistantAgentProposalsComponent);\n private subscription?: Subscription;\n private startSubscription?: Subscription;\n private destroyed = false;\n\n /** The application's kind of subject, for example `project`. */\n readonly subjectType = input.required<string>();\n readonly subjectId = input.required<string>();\n /** The agent whose conversation about the subject the host offers, also before it worked on it. */\n readonly agentId = input<string | undefined>(undefined);\n /** Emits once the panel opens the conversation, so a host in a dialog can make room for it. */\n readonly conversationOpened = output<AgentThreadLookup>();\n /**\n * Emits once the panel opens the conversation of a run that placed a proposal here from another\n * subject, so a host in a dialog can make room for it.\n */\n readonly runConversationOpened = output<string>();\n\n readonly headingId = `nh-assistant-subject-suggestions-${++nextSuggestionsId}`;\n readonly loading = signal(true);\n /** True after the first successful load; later loads keep the list, and an open feedback question, in place. */\n readonly loaded = signal(false);\n readonly loadFailed = signal(false);\n /** The caller has no role on the subject, or it no longer exists. */\n readonly unavailable = signal(false);\n readonly work = signal<AgentSubjectWork | null>(null);\n /** The agent whose conversation is opening or which is starting. */\n readonly opening = signal<string | null>(null);\n readonly starting = signal<string | null>(null);\n readonly started = signal<NhAssistantStartedAgent | null>(null);\n readonly error = signal<NhAssistantError | null>(null);\n readonly errorKeys = computed(() => nhAssistantErrorKeys(this.error()));\n /** True while the assistant panel can show a conversation. */\n readonly assistantEnabled = this.store.enabled;\n readonly agents = computed<AgentSubjectWorkAgent[]>(() => this.work()?.agents ?? []);\n readonly proposals = computed(() => this.work()?.openProposals.map(item => item.proposal) ?? []);\n readonly decisionRights = computed<ReadonlyMap<string, AgentProposalDecisionRight>>(() =>\n new Map((this.work()?.openProposals ?? []).map(item => [\n item.proposal.approvalId,\n { canDecide: item.canDecide, reasonCode: item.reasonCode }\n ])));\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.subscription?.unsubscribe();\n this.startSubscription?.unsubscribe();\n });\n // Browser only: the access policy and the status need the signed-in user.\n afterNextRender(() => {\n void this.store.initialize();\n });\n effect(() => {\n this.subjectType();\n this.subjectId();\n this.agentId();\n untracked(() => {\n this.work.set(null);\n this.loaded.set(false);\n this.started.set(null);\n this.error.set(null);\n this.load();\n });\n });\n nhAssistantReloadOnAgentWork(\n change => change.subjectType === this.subjectType() && change.subjectId === this.subjectId(),\n () => this.refresh()\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /**\n * The translation keys of an agent's name: the name the subject's work gives, which names an agent\n * kept out of the chat as well (the text itself for an agent created in the administration), then\n * the server's status, then the convention.\n */\n agentNameKeys(agent: AgentSubjectWorkAgent): string[] {\n const convention = `nh-assistant.agents.${agent.agentId}.name`;\n const known = agent.displayNameKey ?? this.store.agents().find(item => item.id === agent.agentId)?.displayNameKey;\n return known && known !== convention ? [known, convention] : [convention];\n }\n\n /** Readers may open an existing conversation; creating one needs the participant role. */\n canOpen(agent: AgentSubjectWorkAgent): boolean {\n return agent.thread !== null || this.work()?.role !== 'reader';\n }\n\n /**\n * Opens the conversation of the run that placed a proposal here, such as a run for the whole\n * application, in the assistant panel; the server checks the reader's access to it.\n */\n openRunConversation(conversationId: string): void {\n this.panel.open(conversationId);\n this.runConversationOpened.emit(conversationId);\n }\n\n async open(agent: AgentSubjectWorkAgent): Promise<void> {\n this.opening.set(agent.agentId);\n this.error.set(null);\n try {\n const lookup = await this.panel.openSubject(agent.agentId, { type: this.subjectType(), id: this.subjectId() });\n if (!this.destroyed) {\n this.conversationOpened.emit(lookup);\n if (!agent.thread) {\n // The conversation now exists; show it as the agent's thread.\n this.fetch(true);\n }\n }\n } catch (failure) {\n if (!this.destroyed) {\n this.error.set(toNhAssistantError(failure));\n }\n } finally {\n if (!this.destroyed) {\n this.opening.set(null);\n }\n }\n }\n\n start(agent: AgentSubjectWorkAgent): void {\n this.starting.set(agent.agentId);\n this.error.set(null);\n this.started.set(null);\n this.startSubscription?.unsubscribe();\n this.startSubscription = this.api\n .startAgent({ agentId: agent.agentId, subjectType: this.subjectType(), subjectId: this.subjectId() })\n .subscribe({\n next: receipt => {\n this.starting.set(null);\n this.started.set({ agentId: agent.agentId, receipt });\n this.fetch(true);\n },\n error: failure => {\n this.starting.set(null);\n this.error.set(toNhAssistantError(failure));\n }\n });\n }\n\n /**\n * Reloads after a live update. Once the work is shown it reloads quietly: no loading state, and\n * a failure keeps what is shown, including an open feedback question. While a decision of the\n * list is in flight it waits, because the decision reloads the list when it ends.\n */\n private refresh(): void {\n if (this.proposalList()?.busy()) {\n return;\n }\n\n this.fetch(this.loaded() && !this.loading() && !this.loadFailed());\n }\n\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.unavailable.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getSubjectWork(this.subjectType(), this.subjectId(), this.agentId()).subscribe({\n next: work => {\n const previous = this.proposals();\n this.work.set(work);\n if (quiet) {\n this.proposalList()?.holdClosed(previous, this.proposals());\n }\n const started = this.started();\n const startedAgent = started ? work.agents.find(agent => agent.agentId === started.agentId) : undefined;\n if (started?.receipt.runId && !startedAgent?.thread?.activeRun) {\n // The run the start announced has ended; its proposals are in the list.\n this.started.set(null);\n }\n this.loading.set(false);\n this.loadFailed.set(false);\n this.unavailable.set(false);\n this.loaded.set(true);\n },\n error: failure => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n if (failure instanceof NhAssistantApiError && failure.status === 404) {\n this.unavailable.set(true);\n } else {\n this.loadFailed.set(true);\n }\n }\n });\n }\n}\n","<section class=\"section\" [attr.aria-labelledby]=\"headingId\" [attr.aria-busy]=\"loading()\">\n <header class=\"section-header\">\n <div>\n <h3 [id]=\"headingId\">{{ 'nh-assistant.agent-runs.subject.title' | translate }}</h3>\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.subject.description' | translate }}</p>\n </div>\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </header>\n\n @if (error(); as failure) {\n <p class=\"message error\" role=\"alert\"><nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}</p>\n }\n @if (started(); as start) {\n <nh-assistant-run-receipt [receipt]=\"start.receipt\" />\n }\n\n @if (loading() && !loaded()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n } @else if (unavailable()) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.subject.unavailable' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else {\n @if (agents().length > 0) {\n <ul class=\"subject-agents\" [attr.aria-label]=\"'nh-assistant.agent-runs.subject.agents' | translate\">\n @for (agent of agents(); track agent.agentId) {\n @let name = agentNameKeys(agent) | nhAssistantTranslate: (agent.displayNameKey ?? agent.agentId);\n <li class=\"subject-agent\">\n <div class=\"subject-agent-text\">\n <strong>{{ name }}</strong>\n <span class=\"muted\">\n @if (agent.thread?.activeRun; as activeRun) {\n {{ 'nh-assistant.agent-runs.run.status.' + activeRun.status | translate }}\n } @else if (!agent.thread) {\n {{ 'nh-assistant.agent-runs.thread.no-thread' | translate }}\n } @else {\n {{ 'nh-assistant.agent-runs.subject.idle' | translate }}\n }\n </span>\n </div>\n <div class=\"card-actions\">\n @if (canOpen(agent)) {\n <button\n class=\"secondary\"\n type=\"button\"\n [disabled]=\"opening() !== null || !assistantEnabled()\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.subject.open-conversation-label' | translate: { agent: name }\"\n [attr.title]=\"assistantEnabled() ? null : ('nh-assistant.agent-runs.subject.assistant-unavailable' | translate)\"\n (click)=\"open(agent)\">\n <nh-assistant-icon name=\"assistant\" />{{ (opening() === agent.agentId ? 'nh-assistant.agent-runs.subject.opening' : 'nh-assistant.agent-runs.thread.open-conversation') | translate }}\n </button>\n }\n @if (agent.canStart) {\n <button\n class=\"secondary\"\n type=\"button\"\n [disabled]=\"starting() !== null\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.subject.start-label' | translate: { agent: name }\"\n (click)=\"start(agent)\">\n <nh-assistant-icon name=\"send\" />{{ (starting() === agent.agentId ? 'nh-assistant.agent-runs.thread.starting' : 'nh-assistant.agent-runs.thread.start') | translate }}\n </button>\n }\n </div>\n </li>\n }\n </ul>\n }\n\n <!-- Stays rendered when the list empties, so the optional feedback after a rejection remains. -->\n <nh-assistant-agent-proposals\n [proposals]=\"proposals()\"\n [decisionRights]=\"decisionRights()\"\n [holdClosedCards]=\"true\"\n (changed)=\"load()\"\n (openConversation)=\"openRunConversation($event)\" />\n @if (proposals().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.subject.empty' | translate }}</p>\n }\n }\n</section>\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Observable, Subscription, map } from 'rxjs';\nimport {\n AgentSubjectType,\n NH_ASSISTANT_SYSTEM_GLOBAL_ID,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantPickerComponent as NhAssistantPickerComponent,\n type ɵNhAssistantPickerOption as NhAssistantPickerOption,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\n\n/** Lookups that cannot succeed by asking again: the person changes the id instead. */\nconst finalLookupCodes = new Set(['assistant-subject-not-found', 'assistant-subject-invalid', 'assistant-subject-type-unknown']);\n\n/** A subject chosen in the subject picker, with the name the application gives it. */\nexport interface NhAssistantChosenSubject {\n type: string;\n id: string;\n displayName: string | null;\n}\n\n/**\n * The search of the picker for the subjects of one type: the subjects the caller may read whose\n * name matches, from `GET subjects/{type}/search` (internal).\n */\nexport function nhAssistantSubjectSearch(\n api: NhAssistantAgentRunApiService,\n subjectType: string,\n limit = 20\n): (query: string) => Observable<NhAssistantPickerOption[]> {\n return query => api.searchSubjects(subjectType, query, limit).pipe(\n map(result => result.items.map(item => ({ value: item.id, label: item.displayName ?? item.id })))\n );\n}\n\nlet nextId = 0;\n\n/**\n * Chooses one subject of a type (internal). A searchable type is a combobox that searches the\n * caller's readable subjects by name; for any other type people give the id, and the picker shows\n * the name the application gives that subject, or why it was not found, below the field, with\n * the translated code and, when asking again can help, a button that looks it up again. The\n * platform's type of the whole application (`isSystem`) is \"The whole application\" itself for an\n * app-wide agent, chosen as soon as the type is, and a search of the divisions by name for an agent\n * that works per division (`perDivision`).\n */\n@Component({\n selector: 'nh-assistant-subject-picker',\n standalone: true,\n imports: [TranslatePipe, NhAssistantTranslatePipe, NhAssistantPickerComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-subject-picker.component.html',\n styleUrl: './nh-assistant-subject-picker.component.scss'\n})\nexport class NhAssistantSubjectPickerComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private lookup?: Subscription;\n\n /** The id of the field, for the label's `for`. */\n readonly inputId = input.required<string>();\n readonly subjectType = input.required<AgentSubjectType>();\n /**\n * For the whole application: choose one of the application's divisions, for an agent that works\n * per division, instead of the whole application app-wide.\n */\n readonly perDivision = input(false);\n /** The chosen subject's id. */\n readonly value = input<string | null>(null);\n /** The name of the chosen subject, when the host knows it. */\n readonly selectedLabel = input<string | null>(null);\n readonly invalid = input(false);\n readonly describedBy = input<string | null>(null);\n readonly disabled = input(false);\n\n /** The chosen subject, or `null` when the choice was cleared or the id was not found. */\n readonly subjectChange = output<NhAssistantChosenSubject | null>();\n\n readonly hintId = `nh-assistant-subject-picker-hint-${nextId++}`;\n /** The whole application app-wide: nothing to choose beyond the type itself. */\n readonly wholeApplication = computed(() => this.subjectType().isSystem && !this.perDivision());\n readonly search = computed(() => {\n const type = this.subjectType();\n if (type.isSystem) {\n // The whole application is searched for its divisions only.\n return this.perDivision() ? nhAssistantSubjectSearch(this.api, type.id) : null;\n }\n\n return type.searchable ? nhAssistantSubjectSearch(this.api, type.id) : null;\n });\n readonly placeholderKey = computed(() => this.subjectType().isSystem\n ? 'nh-assistant.subject-picker.division-placeholder'\n : 'nh-assistant.subject-picker.search-placeholder');\n readonly typedId = signal('');\n readonly lookingUp = signal(false);\n readonly found = signal<NhAssistantChosenSubject | null>(null);\n /** Why the typed id could not be looked up; `null` while there is no failure. */\n readonly lookupError = signal<NhAssistantError | null>(null);\n /** An unknown subject reads as such; any other failure with its own text and the generic fallback. */\n readonly lookupErrorKeys = computed(() => {\n const error = this.lookupError();\n return error?.code === 'assistant-subject-not-found'\n ? ['nh-assistant.subject-picker.not-found', ...nhAssistantErrorKeys(error)]\n : nhAssistantErrorKeys(error);\n });\n /** Looking the same id up again can help after a failure of the connection or the server. */\n readonly lookupRetryable = computed(() => {\n const error = this.lookupError();\n return error !== null && !finalLookupCodes.has(error.code);\n });\n readonly fieldDescribedBy = computed(() => [this.hintId, this.describedBy()].filter(Boolean).join(' '));\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.lookup?.unsubscribe());\n // A new type starts a new choice; the whole application app-wide is chosen with its type.\n effect(() => {\n const type = this.subjectType();\n const whole = this.wholeApplication();\n untracked(() => {\n this.lookup?.unsubscribe();\n this.typedId.set(this.value() ?? '');\n this.found.set(null);\n this.lookupError.set(null);\n this.lookingUp.set(false);\n if (whole) {\n this.subjectChange.emit({ type: type.id, id: NH_ASSISTANT_SYSTEM_GLOBAL_ID, displayName: type.name });\n }\n });\n });\n }\n\n choose(option: NhAssistantPickerOption | null): void {\n this.subjectChange.emit(option ? { type: this.subjectType().id, id: option.value, displayName: option.label } : null);\n }\n\n onIdInput(event: Event): void {\n this.typedId.set((event.target as HTMLInputElement).value);\n this.found.set(null);\n this.lookupError.set(null);\n }\n\n /** Looks the typed id up again after a failure that asking again may resolve. */\n lookUpAgain(): void {\n this.found.set(null);\n this.lookUp();\n }\n\n /** Looks the typed id up; the server names the subject when the caller may read it. */\n lookUp(): void {\n const id = this.typedId().trim();\n const type = this.subjectType().id;\n this.lookup?.unsubscribe();\n if (id.length === 0) {\n this.lookingUp.set(false);\n this.lookupError.set(null);\n this.subjectChange.emit(null);\n return;\n }\n if (this.found()?.id === id) {\n return;\n }\n\n this.lookingUp.set(true);\n this.lookupError.set(null);\n this.lookup = this.api.getSubjectWork(type, id).subscribe({\n next: work => {\n const subject = { type, id, displayName: work.subjectDisplayName };\n this.lookingUp.set(false);\n this.found.set(subject);\n this.subjectChange.emit(subject);\n },\n error: (error: unknown) => {\n this.lookingUp.set(false);\n this.lookupError.set(toNhAssistantError(error));\n this.subjectChange.emit(null);\n }\n });\n }\n}\n","@if (wholeApplication()) {\n <!-- The whole application app-wide is one subject: the field names it, there is nothing to choose. -->\n <output\n class=\"fixed\"\n data-whole-application\n [id]=\"inputId()\"\n [attr.aria-describedby]=\"fieldDescribedBy()\">{{ subjectType().name }}</output>\n <p class=\"hint\" [id]=\"hintId\">{{ 'nh-assistant.subject-picker.whole-application-hint' | translate }}</p>\n} @else if (search(); as find) {\n <nh-assistant-picker\n [inputId]=\"inputId()\"\n [value]=\"value()\"\n [selectedLabel]=\"selectedLabel()\"\n [search]=\"find\"\n [placeholder]=\"placeholderKey() | translate\"\n [invalid]=\"invalid()\"\n [describedBy]=\"describedBy()\"\n [disabled]=\"disabled()\"\n (optionChange)=\"choose($event)\" />\n} @else {\n <input\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [id]=\"inputId()\"\n [value]=\"typedId()\"\n [placeholder]=\"'nh-assistant.subject-picker.id-placeholder' | translate\"\n [attr.aria-invalid]=\"invalid() || lookupError() ? true : null\"\n [attr.aria-describedby]=\"fieldDescribedBy()\"\n [disabled]=\"disabled()\"\n (input)=\"onIdInput($event)\"\n (change)=\"lookUp()\"\n (keydown.enter)=\"$event.preventDefault(); lookUp()\" />\n <p class=\"hint\" aria-live=\"polite\" [id]=\"hintId\" [class.error]=\"lookupError()\">\n @if (lookingUp()) {\n {{ 'nh-assistant.subject-picker.looking-up' | translate }}\n } @else if (lookupError(); as failure) {\n <span data-lookup-error>{{ lookupErrorKeys() | nhAssistantTranslate: failure.code }}</span>\n @if (lookupRetryable()) {\n <button type=\"button\" class=\"link\" data-lookup-retry [disabled]=\"disabled()\" (click)=\"lookUpAgain()\">\n {{ 'nh-assistant.subject-picker.look-up-again' | translate }}\n </button>\n }\n } @else if (found(); as subject) {\n {{ 'nh-assistant.subject-picker.found' | translate: { name: subject.displayName ?? subject.id } }}\n } @else {\n {{ 'nh-assistant.subject-picker.id-hint' | translate }}\n }\n </p>\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n afterNextRender,\n computed,\n inject,\n input,\n output,\n signal,\n viewChild\n} from '@angular/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentSubjectType,\n AgentTriggerReceipt,\n NH_ASSISTANT_SYSTEM_SUBJECT_TYPE,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantSubjectLinkComponent as NhAssistantSubjectLinkComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunReceiptComponent } from './nh-assistant-run-receipt.component';\nimport { NhAssistantChosenSubject, NhAssistantSubjectPickerComponent } from './nh-assistant-subject-picker.component';\n\n/** The agent the dialog runs: its id, its name as people read it and what it works on. */\nexport interface NhAssistantRunNowAgent {\n id: string;\n /** The agent's name in the reader's language, or the text an administrator gave it. */\n name: string;\n /** The object types it works on; with `worksOnAllSubjects` every type the application registers. */\n worksOnSubjectTypes?: readonly string[] | null;\n worksOnAllSubjects?: boolean | null;\n /** It works on the whole application. */\n worksOnApplication?: boolean | null;\n /** Its work for the whole application exists per division. */\n perDivision?: boolean | null;\n}\n\n/** A subject the dialog runs the agent on without asking, such as the object of the page. */\nexport interface NhAssistantRunNowSubject {\n type: string;\n id: string;\n displayName?: string | null;\n typeName?: string | null;\n link?: string | null;\n}\n\n/** What a run by hand was started on, with the receipt of `POST threads/start`. */\nexport interface NhAssistantRunNowStarted {\n receipt: AgentTriggerReceipt;\n subject: NhAssistantChosenSubject;\n}\n\n/** One answer to \"What should the agent work on?\". */\ninterface RunNowTarget {\n key: string;\n type: AgentSubjectType;\n /** For the whole application: the agent works per division, so a division is chosen. */\n perDivision: boolean;\n}\n\n/** The longest instruction the dialog sends with a run. */\nexport const NH_ASSISTANT_RUN_NOW_MAX_MESSAGE = 4_000;\n\nlet nextId = 0;\n\n/**\n * Runs an agent now, by hand (internal to the library; the administration's \"Run now\", the run now\n * of `nh-assistant-object-agents` and the board's tile use it, so it lives in the `agent-runs` entry\n * point and stays out of the chat's initial bundle). A modal dialog asks what the agent\n * works on this time, unless the host gives the subject: the whole application, in a division for an\n * agent that works per division, or an object of one of its types through the subject picker; and an\n * optional instruction. It sends `POST threads/start` with the caller as initiator, shows the\n * server's refusal at the form with its translated code, and ends with the receipt: what happens\n * now (a warning while the agent or its skill is paused, information while the start waits for the\n * application's change to be saved), the subject and the conversation to open. The server decides\n * who may run the agent: on an object the participant role, on the whole application the agent's\n * run policy.\n *\n * The host renders it when people ask to run the agent; it opens itself and emits `closed` when it\n * closes, after which the host removes it. Escape closes it, and focus returns to what opened it.\n */\n@Component({\n selector: 'nh-assistant-run-now-dialog',\n standalone: true,\n imports: [\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantSubjectLinkComponent,\n NhAssistantSubjectPickerComponent,\n NhAssistantRunReceiptComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-run-now-dialog.component.html',\n styleUrl: './nh-assistant-run-now-dialog.component.scss'\n})\nexport class NhAssistantRunNowDialogComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly translate = inject(TranslateService);\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly dialog = viewChild.required<ElementRef<HTMLDialogElement>>('dialog');\n private subscription?: Subscription;\n\n readonly agent = input.required<NhAssistantRunNowAgent>();\n /** The application's subject types from the run catalog, for choosing an object type. */\n readonly subjectTypes = input<readonly AgentSubjectType[]>([]);\n /** Whether the application lists its divisions, so a per-division agent can be run in one. */\n readonly divisions = input(false);\n /** Runs the agent on this subject without asking, such as the object of the page. */\n readonly subject = input<NhAssistantRunNowSubject | null>(null);\n\n /** The run started, with its receipt. */\n readonly started = output<NhAssistantRunNowStarted>();\n /** People want to open the agent's conversation; the dialog has closed. */\n readonly openConversation = output<string>();\n /** The dialog closed; the host removes it. */\n readonly closed = output<void>();\n\n readonly id = `nh-assistant-run-now-${nextId++}`;\n readonly maxMessage = NH_ASSISTANT_RUN_NOW_MAX_MESSAGE;\n readonly targetKey = signal<string | null>(null);\n readonly chosen = signal<NhAssistantChosenSubject | null>(null);\n readonly message = signal('');\n readonly starting = signal(false);\n readonly subjectMissing = signal(false);\n readonly receipt = signal<NhAssistantRunNowStarted | null>(null);\n readonly error = signal<NhAssistantError | null>(null);\n /** A refusal of the start explained for running an agent, then as the server names it. */\n readonly errorKeys = computed(() => {\n const error = this.error();\n return error ? [`nh-assistant.run-now.errors.${error.code}`, ...nhAssistantErrorKeys(error)] : [];\n });\n\n /** The whole application as the run catalog names it, or in the reader's language without one. */\n private readonly systemType = computed<AgentSubjectType>(() =>\n this.subjectTypes().find(type => type.isSystem && type.id === NH_ASSISTANT_SYSTEM_SUBJECT_TYPE) ?? {\n id: NH_ASSISTANT_SYSTEM_SUBJECT_TYPE,\n name: this.translate.instant('nh-assistant.run-now.whole-application'),\n pluralName: null,\n entityType: null,\n entityTypeFull: null,\n link: null,\n searchable: this.divisions(),\n isSystem: true\n });\n\n /** What the agent can be run on: the whole application when it works on it, then its object types. */\n readonly targets = computed<RunNowTarget[]>(() => {\n const agent = this.agent();\n const targets: RunNowTarget[] = [];\n if (agent.worksOnApplication) {\n targets.push({ key: NH_ASSISTANT_SYSTEM_SUBJECT_TYPE, type: this.systemType(), perDivision: agent.perDivision === true });\n }\n const named = new Set(agent.worksOnSubjectTypes ?? []);\n for (const type of this.subjectTypes()) {\n if (!type.isSystem && (agent.worksOnAllSubjects === true || named.has(type.id))) {\n targets.push({ key: type.id, type, perDivision: false });\n }\n }\n return targets;\n });\n\n /** The chosen answer, by default the first: the whole application when the agent works on it. */\n readonly target = computed(() => {\n const targets = this.targets();\n return targets.find(item => item.key === this.targetKey()) ?? targets[0] ?? null;\n });\n /** A per-division agent cannot be run while the application lists no divisions. */\n readonly divisionUnavailable = computed(() => this.target()?.perDivision === true && !this.divisions());\n readonly subjectFieldId = computed(() => `${this.id}-subject`);\n readonly subjectErrorId = computed(() => `${this.id}-subject-error`);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n afterNextRender(() => {\n const dialog = this.dialog().nativeElement;\n if (!dialog.open) {\n dialog.showModal();\n }\n this.focusFirst();\n }, { injector: this.injector });\n }\n\n chooseTarget(key: string): void {\n if (this.target()?.key === key) {\n return;\n }\n this.targetKey.set(key);\n this.chosen.set(null);\n this.subjectMissing.set(false);\n this.error.set(null);\n }\n\n onSubject(subject: NhAssistantChosenSubject | null): void {\n this.chosen.set(subject);\n if (subject) {\n this.subjectMissing.set(false);\n }\n }\n\n onMessage(event: Event): void {\n this.message.set((event.target as HTMLTextAreaElement).value);\n }\n\n /** The subject the run is for: the host's, or the one chosen in the form. */\n subjectOfRun(): NhAssistantChosenSubject | null {\n const fixed = this.subject();\n return fixed ? { type: fixed.type, id: fixed.id, displayName: fixed.displayName ?? null } : this.chosen();\n }\n\n submit(): void {\n if (this.starting()) {\n return;\n }\n const subject = this.subjectOfRun();\n if (!subject) {\n this.subjectMissing.set(true);\n this.focusSubject();\n return;\n }\n\n this.starting.set(true);\n this.error.set(null);\n this.subscription?.unsubscribe();\n this.subscription = this.api.startAgent({\n agentId: this.agent().id,\n subjectType: subject.type,\n subjectId: subject.id,\n message: this.message().trim() || null\n }).subscribe({\n next: receipt => {\n const started = { receipt, subject };\n this.starting.set(false);\n this.receipt.set(started);\n this.started.emit(started);\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('[data-receipt-focus]')?.focus(), { injector: this.injector });\n },\n error: (failure: unknown) => {\n this.starting.set(false);\n this.error.set(toNhAssistantError(failure));\n }\n });\n }\n\n open(conversationId: string): void {\n this.close();\n this.openConversation.emit(conversationId);\n }\n\n close(): void {\n const dialog = this.dialog().nativeElement;\n if (dialog.open) {\n dialog.close();\n } else {\n this.onClosed();\n }\n }\n\n /** The native dialog closed, by a button or by Escape. */\n onClosed(): void {\n this.subscription?.unsubscribe();\n this.closed.emit();\n }\n\n /** The name of the subject in the receipt, when the server's type name adds something. */\n receiptTypeName(started: NhAssistantRunNowStarted): string | null {\n const fixed = this.subject();\n if (fixed && fixed.type === started.subject.type && fixed.id === started.subject.id) {\n return fixed.typeName ?? null;\n }\n return this.subjectTypes().find(type => type.id === started.subject.type)?.name ?? null;\n }\n\n receiptLink(started: NhAssistantRunNowStarted): string | null {\n const fixed = this.subject();\n return fixed && fixed.type === started.subject.type && fixed.id === started.subject.id ? fixed.link ?? null : null;\n }\n\n private focusFirst(): void {\n const element = this.host.nativeElement;\n const first = element.querySelector<HTMLElement>('[data-target-choice]:checked')\n ?? element.querySelector<HTMLElement>('textarea');\n first?.focus();\n }\n\n private focusSubject(): void {\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>(`#${this.subjectFieldId()}`)?.focus(), { injector: this.injector });\n }\n}\n","<dialog #dialog class=\"dialog\" [attr.aria-labelledby]=\"id + '-title'\" (close)=\"onClosed()\">\n <div class=\"dialog-body\">\n <header class=\"dialog-header\">\n <h2 [id]=\"id + '-title'\">{{ 'nh-assistant.run-now.title' | translate: { agent: agent().name } }}</h2>\n <button class=\"icon-button\" type=\"button\" [attr.aria-label]=\"'nh-assistant.run-now.close' | translate\" (click)=\"close()\">\n <nh-assistant-icon name=\"close\" />\n </button>\n </header>\n\n @if (receipt(); as started) {\n <!-- The receipt: what happens now, on what, and the conversation the run works in. -->\n <div class=\"stack\" data-receipt>\n <nh-assistant-run-receipt [receipt]=\"started.receipt\" [focusable]=\"true\" />\n <p class=\"muted\" data-receipt-subject>\n <span>{{ 'nh-assistant.run-now.receipt-subject' | translate }}</span>{{ ' ' }}\n <nh-assistant-subject-link\n [subjectType]=\"started.subject.type\"\n [subjectId]=\"started.subject.id\"\n [label]=\"started.subject.displayName ?? started.subject.id\"\n [typeName]=\"receiptTypeName(started)\"\n [link]=\"receiptLink(started)\" />\n </p>\n <div class=\"actions\">\n @if (started.receipt.conversationId; as conversationId) {\n <button class=\"secondary\" type=\"button\" data-open-conversation (click)=\"open(conversationId)\">\n <nh-assistant-icon name=\"link\" />{{ 'nh-assistant.run-now.open-conversation' | translate }}\n </button>\n }\n <button class=\"primary\" type=\"button\" (click)=\"close()\">{{ 'nh-assistant.run-now.done' | translate }}</button>\n </div>\n </div>\n } @else {\n <form class=\"stack\" novalidate (submit)=\"$event.preventDefault(); submit()\">\n @if (subject(); as fixed) {\n <p class=\"muted\" data-fixed-subject>\n <span>{{ 'nh-assistant.run-now.on' | translate }}</span>{{ ' ' }}\n <nh-assistant-subject-link\n [subjectType]=\"fixed.type\"\n [subjectId]=\"fixed.id\"\n [label]=\"fixed.displayName ?? fixed.id\"\n [typeName]=\"fixed.typeName ?? null\"\n [link]=\"fixed.link ?? null\" />\n </p>\n } @else if (targets().length === 0) {\n <p class=\"message warning\" role=\"status\" data-no-target>\n <nh-assistant-icon name=\"warning\" />{{ 'nh-assistant.run-now.no-target' | translate }}\n </p>\n } @else {\n <fieldset class=\"field\">\n <legend [id]=\"id + '-target-label'\">{{ 'nh-assistant.run-now.target' | translate }}</legend>\n <div class=\"choices\" role=\"radiogroup\" [attr.aria-labelledby]=\"id + '-target-label'\">\n @for (item of targets(); track item.key) {\n <label class=\"choice\" [attr.data-target]=\"item.key\">\n <input\n type=\"radio\"\n data-target-choice\n [name]=\"id + '-target'\"\n [value]=\"item.key\"\n [checked]=\"target()?.key === item.key\"\n (change)=\"chooseTarget(item.key)\" />\n <span>\n {{ item.type.isSystem ? item.type.name : (item.type.pluralName ?? item.type.name) }}\n @if (item.perDivision) {\n <small>{{ 'nh-assistant.run-now.per-division' | translate }}</small>\n }\n </span>\n </label>\n }\n </div>\n </fieldset>\n\n @if (target(); as current) {\n <div class=\"field\" data-subject-field>\n <label [for]=\"subjectFieldId()\">\n {{ (current.type.isSystem ? (current.perDivision ? 'nh-assistant.run-now.division' : 'nh-assistant.run-now.application') : 'nh-assistant.run-now.object') | translate: { type: current.type.name } }}\n </label>\n @if (divisionUnavailable()) {\n <p class=\"message warning\" role=\"status\">\n <nh-assistant-icon name=\"warning\" />{{ 'nh-assistant.run-now.no-divisions' | translate }}\n </p>\n } @else {\n <nh-assistant-subject-picker\n [inputId]=\"subjectFieldId()\"\n [subjectType]=\"current.type\"\n [perDivision]=\"current.perDivision\"\n [value]=\"chosen()?.id ?? null\"\n [selectedLabel]=\"chosen()?.displayName ?? null\"\n [invalid]=\"subjectMissing()\"\n [describedBy]=\"subjectMissing() ? subjectErrorId() : null\"\n (subjectChange)=\"onSubject($event)\" />\n }\n @if (subjectMissing()) {\n <p class=\"field-error\" [id]=\"subjectErrorId()\">\n <nh-assistant-icon name=\"warning\" />{{ 'nh-assistant.run-now.subject-required' | translate }}\n </p>\n }\n </div>\n }\n }\n\n <div class=\"field\">\n <label [for]=\"id + '-message'\">{{ 'nh-assistant.run-now.message' | translate }}</label>\n <textarea\n rows=\"3\"\n [id]=\"id + '-message'\"\n [maxLength]=\"maxMessage\"\n [value]=\"message()\"\n [attr.aria-describedby]=\"id + '-message-hint'\"\n (input)=\"onMessage($event)\"></textarea>\n <p class=\"hint\" [id]=\"id + '-message-hint'\">\n <span>{{ 'nh-assistant.run-now.message-hint' | translate }}</span>\n <span class=\"counter\">{{ message().length }}/{{ maxMessage }}</span>\n </p>\n </div>\n\n @if (error(); as failure) {\n <p class=\"form-error\" role=\"alert\" data-run-now-error>\n <nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}\n </p>\n }\n\n <div class=\"actions\">\n <button class=\"secondary\" type=\"button\" (click)=\"close()\">{{ 'nh-assistant.run-now.cancel' | translate }}</button>\n <button\n class=\"primary\"\n type=\"submit\"\n data-run-now-submit\n [disabled]=\"starting() || (subject() === null && (targets().length === 0 || divisionUnavailable()))\">\n <nh-assistant-icon name=\"send\" />{{ (starting() ? 'nh-assistant.run-now.starting' : 'nh-assistant.run-now.submit') | translate }}\n </button>\n </div>\n </form>\n }\n </div>\n</dialog>\n","import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentObjectAgent,\n AgentObjectAgents,\n LiveAgentWorkChanged,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport {\n NhAssistantRunNowAgent,\n NhAssistantRunNowDialogComponent,\n NhAssistantRunNowSubject\n} from './internal/nh-assistant-run-now-dialog.component';\nimport { NhAssistantAgentThreadViewComponent } from './nh-assistant-agent-thread-view.component';\nimport { NhAssistantRunResultComponent } from './nh-assistant-run-result.component';\n\nlet nextId = 0;\n\n/**\n * Failures of the object itself: asking again does not help, the page names an object that does not\n * exist, that the person may not see, or that is no valid reference.\n */\nconst objectFailures = new Set(['assistant-subject-not-found', 'assistant-subject-invalid', 'assistant-subject-type-unknown']);\n\n/**\n * The agents that work on one object, for the object's page, for example on a project: per agent its\n * latest run with the beginning of its result, the whole result on demand in `nh-assistant-run-result`,\n * its open proposals, \"Run now\" for people who may run it (the participants of the object; for the\n * whole application, `nh-system`, the agent's run policy), and on demand its work on the object in\n * `nh-assistant-agent-thread-view`. The server lists only the agents that work on the object and that\n * the person may use, and checks every start again. A failed load reads as its translated code, such as\n * an object that does not exist or that the person may not see, with \"Try again\" where asking again\n * can help. With live updates the list reloads by itself when an agent's work on the object changes.\n */\n@Component({\n selector: 'nh-assistant-object-agents',\n standalone: true,\n imports: [\n DatePipe,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantRunNowDialogComponent,\n NhAssistantAgentThreadViewComponent,\n NhAssistantRunResultComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-object-agents.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantObjectAgentsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly translate = inject(TranslateService);\n private subscription?: Subscription;\n\n /** The object's type, such as `project`, or `nh-system` for the whole application. */\n readonly subjectType = input.required<string>();\n /** The object's id, or `global` (or `division-…`) for the whole application. */\n readonly subjectId = input.required<string>();\n /** Emits the conversation id of an agent's thread, so the host can open it in the assistant panel. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-object-agents-${nextId++}`;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n /** Why the agents could not be read; `null` after a load that worked. */\n readonly loadError = signal<NhAssistantError | null>(null);\n readonly loadErrorKeys = computed(() => nhAssistantErrorKeys(this.loadError()));\n /** Loading again can help after a failure of the connection or the server, not of the object. */\n readonly loadRetryable = computed(() => {\n const error = this.loadError();\n return error === null || !objectFailures.has(error.code);\n });\n readonly codeKeys = nhAssistantCodeKeys;\n readonly listing = signal<AgentObjectAgents | null>(null);\n readonly agents = computed(() => this.listing()?.agents ?? []);\n /** The agent whose work on the object is shown; one at a time. */\n readonly expanded = signal<string | null>(null);\n /** The agent whose latest result is shown in full; one at a time. */\n readonly resultShown = signal<string | null>(null);\n /** The agent the run-now dialog runs; `null` while it is closed. */\n readonly runningNow = signal<AgentObjectAgent | null>(null);\n readonly runNowAgent = computed<NhAssistantRunNowAgent | null>(() => {\n const agent = this.runningNow();\n return agent ? { id: agent.agentId, name: this.nameOf(agent) } : null;\n });\n /** The object of the page: the run-now dialog runs on it without asking. */\n readonly runNowSubject = computed<NhAssistantRunNowSubject | null>(() => {\n const listing = this.listing();\n return listing\n ? {\n type: listing.subjectType,\n id: listing.subjectId,\n displayName: listing.subjectDisplayName,\n typeName: listing.subjectTypeName ?? null,\n link: listing.subjectLink ?? null\n }\n : null;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.subjectType();\n this.subjectId();\n untracked(() => {\n this.expanded.set(null);\n this.resultShown.set(null);\n this.runningNow.set(null);\n this.fetch(false);\n });\n });\n nhAssistantReloadOnAgentWork(change => this.concerns(change), () => this.fetch(true));\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /** The agent's name: a translation key of an agent in code, or the text of one created as data. */\n nameOf(agent: AgentObjectAgent): string {\n const translated = this.translate.instant(agent.displayNameKey) as string;\n return translated && translated !== agent.displayNameKey ? translated : agent.displayNameKey;\n }\n\n toggleResult(agent: AgentObjectAgent): void {\n this.resultShown.update(current => current === agent.agentId ? null : agent.agentId);\n }\n\n toggleWork(agent: AgentObjectAgent): void {\n this.expanded.update(current => current === agent.agentId ? null : agent.agentId);\n }\n\n runNow(agent: AgentObjectAgent): void {\n this.runningNow.set(agent);\n }\n\n /** A run started: the list shows it as the agent's latest run. */\n onStarted(): void {\n this.fetch(true);\n }\n\n proposalsKey(count: number): string {\n switch (count) {\n case 0:\n return 'nh-assistant.agent-runs.object-agents.proposals-none';\n case 1:\n return 'nh-assistant.agent-runs.object-agents.proposals-one';\n default:\n return 'nh-assistant.agent-runs.object-agents.proposals';\n }\n }\n\n /** Whether a live update concerns the object: its runs, proposals or feedback changed. */\n private concerns(change: LiveAgentWorkChanged): boolean {\n return change.subjectType === this.subjectType() && change.subjectId === this.subjectId();\n }\n\n /**\n * Reads the agents. A quiet reload, after a live update or a start, keeps what is shown when it\n * fails and shows no loading state.\n */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.loadError.set(null);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getObjectAgents(this.subjectType(), this.subjectId()).subscribe({\n next: listing => {\n this.listing.set(listing);\n this.loading.set(false);\n this.loadFailed.set(false);\n this.loadError.set(null);\n },\n error: (error: unknown) => {\n if (quiet && this.listing() !== null) {\n return;\n }\n this.listing.set(null);\n this.loading.set(false);\n this.loadFailed.set(true);\n this.loadError.set(toNhAssistantError(error));\n }\n });\n }\n}\n","<section class=\"section\" [attr.aria-labelledby]=\"id + '-title'\" [attr.aria-busy]=\"loading()\">\n <header class=\"section-header\">\n <div>\n <h3 [id]=\"id + '-title'\">{{ 'nh-assistant.agent-runs.object-agents.title' | translate }}</h3>\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.description' | translate }}</p>\n </div>\n <div class=\"toolbar\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </div>\n </header>\n\n @if (loading() && !listing()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.object-agents.loading' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\" data-object-agents-error>\n @if (loadError(); as failure) {\n <p>{{ loadErrorKeys() | nhAssistantTranslate: failure.code }}</p>\n } @else {\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n }\n @if (loadRetryable()) {\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n }\n </div>\n } @else if (agents().length === 0) {\n <p class=\"state\" data-object-agents-empty>{{ 'nh-assistant.agent-runs.object-agents.empty' | translate }}</p>\n } @else {\n <ul class=\"cards\">\n @for (agent of agents(); track agent.agentId) {\n <li class=\"card\" [attr.data-object-agent]=\"agent.agentId\">\n <div class=\"card-header\">\n <strong>{{ [agent.displayNameKey] | nhAssistantTranslate: agent.displayNameKey }}</strong>\n <span class=\"badge\" [class.warning]=\"agent.openProposals > 0\" data-open-proposals>\n {{ proposalsKey(agent.openProposals) | translate: { count: agent.openProposals } }}\n </span>\n </div>\n @if ([agent.descriptionKey] | nhAssistantTranslate: agent.descriptionKey; as description) {\n <p class=\"muted\">{{ description }}</p>\n }\n\n <!-- The latest run: its status and time, and the beginning of its result as plain text. -->\n @if (agent.latestRun; as run) {\n <div class=\"latest-run\" data-latest-run>\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.object-agents.latest' | translate }}</span>\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.danger]=\"run.status === 'failed'\"\n [class.warning]=\"run.status === 'waiting-for-approval'\">{{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}</span>\n <time [attr.datetime]=\"run.at\">{{ run.at | date: 'medium' }}</time>\n @if (run.shadow) {\n <span class=\"badge warning\">{{ 'nh-assistant.agent-runs.object-agents.shadow' | translate }}</span>\n }\n </div>\n @if (run.failureCode; as reason) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.failure' | translate: { reason: (codeKeys(reason) | nhAssistantTranslate: reason) } }}</p>\n }\n @if (run.result; as result) {\n <p class=\"summary result\" data-latest-result>\n <span class=\"visually-hidden\">{{ 'nh-assistant.agent-runs.object-agents.result-label' | translate }}: </span>{{ result }}@if (run.resultTruncated) {…}\n </p>\n } @else {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.no-result' | translate }}</p>\n }\n </div>\n } @else {\n <p class=\"muted\" data-never-run>{{ 'nh-assistant.agent-runs.object-agents.never' | translate }}</p>\n }\n\n <div class=\"card-actions\">\n @if (agent.canStart) {\n <button class=\"primary\" type=\"button\" aria-haspopup=\"dialog\" data-object-run-now (click)=\"runNow(agent)\">\n <nh-assistant-icon name=\"send\" />{{ 'nh-assistant.agent-runs.object-agents.run-now' | translate }}\n </button>\n }\n @if (agent.latestRun) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-toggle-result\n [attr.aria-expanded]=\"resultShown() === agent.agentId\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-result'\"\n (click)=\"toggleResult(agent)\">\n <nh-assistant-icon name=\"page\" />{{ (resultShown() === agent.agentId ? 'nh-assistant.agent-runs.result.hide' : 'nh-assistant.agent-runs.result.show') | translate }}\n </button>\n }\n @if (agent.conversationId) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-toggle-work\n [attr.aria-expanded]=\"expanded() === agent.agentId\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-work'\"\n (click)=\"toggleWork(agent)\">\n <nh-assistant-icon name=\"list\" />{{ (expanded() === agent.agentId ? 'nh-assistant.agent-runs.object-agents.hide-work' : 'nh-assistant.agent-runs.object-agents.show-work') | translate }}\n </button>\n }\n </div>\n\n @if (resultShown() === agent.agentId && agent.latestRun; as run) {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-result'\">\n <nh-assistant-run-result [runId]=\"run.runId\" (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n\n @if (expanded() === agent.agentId) {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-work'\">\n <nh-assistant-agent-thread-view\n [agentId]=\"agent.agentId\"\n [subjectType]=\"subjectType()\"\n [subjectId]=\"subjectId()\"\n (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n </li>\n }\n </ul>\n }\n\n @if (runNowAgent(); as runAgent) {\n <nh-assistant-run-now-dialog\n [agent]=\"runAgent\"\n [subject]=\"runNowSubject()\"\n (started)=\"onStarted()\"\n (openConversation)=\"openConversation.emit($event)\"\n (closed)=\"runningNow.set(null)\" />\n }\n</section>\n","import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentRunHistoryItem,\n NhAssistantAgentRunApiService,\n ɵNhAssistantIconComponent as NhAssistantIconComponent\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunResultComponent } from '../nh-assistant-run-result.component';\n\n/** How many runs the history of a board tile reads at a time. */\nconst pageSize = 5;\n\nlet nextId = 0;\n\n/**\n * The runs of one agent for one subject of the whole application, newest first, as a board tile shows\n * them (internal): status, time and the beginning of each result, the whole result on demand in\n * `nh-assistant-run-result`, and more runs on request. The server's people's history (`GET runs`)\n * decides what the reader sees.\n */\n@Component({\n selector: 'nh-assistant-board-history',\n standalone: true,\n imports: [DatePipe, TranslatePipe, NhAssistantIconComponent, NhAssistantRunResultComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <section class=\"board-history\" [attr.aria-labelledby]=\"id + '-title'\" [attr.aria-busy]=\"loading()\">\n <h4 [id]=\"id + '-title'\">{{ 'nh-assistant.agent-runs.board.history-title' | translate }}</h4>\n @if (loading() && runs().length === 0) {\n <p class=\"muted\" role=\"status\">{{ 'nh-assistant.agent-runs.board.history-loading' | translate }}</p>\n } @else if (loadFailed() && runs().length === 0) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else if (runs().length === 0) {\n <p class=\"muted\" data-board-history-empty>{{ 'nh-assistant.agent-runs.board.history-empty' | translate }}</p>\n } @else {\n <ol class=\"history-runs\">\n @for (run of runs(); track run.id) {\n <li class=\"history-run\" [attr.data-board-history-run]=\"run.id\">\n <div class=\"meta\">\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.danger]=\"run.status === 'failed'\"\n [class.warning]=\"run.status === 'waiting-for-approval'\">{{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}</span>\n <time [attr.datetime]=\"timeOf(run)\">{{ timeOf(run) | date: 'medium' }}</time>\n </div>\n @if (run.result; as result) {\n <p class=\"summary result\">{{ result }}@if (run.resultTruncated) {…}</p>\n }\n <div class=\"card-actions\">\n <button\n class=\"text-button\"\n type=\"button\"\n [attr.aria-expanded]=\"shown() === run.id\"\n [attr.aria-controls]=\"id + '-' + run.id\"\n (click)=\"toggle(run.id)\">\n {{ (shown() === run.id ? 'nh-assistant.agent-runs.result.hide' : 'nh-assistant.agent-runs.result.show') | translate }}\n </button>\n </div>\n @if (shown() === run.id) {\n <div class=\"work\" [id]=\"id + '-' + run.id\">\n <nh-assistant-run-result [runId]=\"run.id\" (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n </li>\n }\n </ol>\n @if (runs().length < total()) {\n <button class=\"secondary\" type=\"button\" data-board-history-more [disabled]=\"loading()\" (click)=\"more()\">\n <nh-assistant-icon name=\"list\" />{{ 'nh-assistant.agent-runs.board.history-more' | translate }}\n </button>\n } @else if (limited()) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.board.history-limited' | translate }}</p>\n }\n }\n </section>\n `,\n styleUrl: '../nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantBoardHistoryComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private subscription?: Subscription;\n private page = 1;\n\n readonly agentId = input.required<string>();\n readonly subjectType = input.required<string>();\n readonly subjectId = input.required<string>();\n /** Emits the conversation a shown result offers to open. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-board-history-${nextId++}`;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly runs = signal<AgentRunHistoryItem[]>([]);\n readonly total = signal(0);\n readonly limited = signal(false);\n /** The run whose whole result is shown; one at a time. */\n readonly shown = signal<string | null>(null);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.agentId();\n this.subjectType();\n this.subjectId();\n untracked(() => this.load());\n });\n }\n\n load(): void {\n this.page = 1;\n this.shown.set(null);\n this.fetch(false);\n }\n\n more(): void {\n this.page++;\n this.fetch(true);\n }\n\n toggle(runId: string): void {\n this.shown.update(current => current === runId ? null : runId);\n }\n\n /** When the run ended, or started, or was queued. */\n timeOf(run: AgentRunHistoryItem): string {\n return run.endedAt ?? run.startedAt ?? run.createdAt;\n }\n\n private fetch(append: boolean): void {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.subscription?.unsubscribe();\n this.subscription = this.api\n .getRunHistory({\n agentId: this.agentId(),\n subjectType: this.subjectType(),\n subjectId: this.subjectId(),\n page: this.page,\n itemsPerPage: pageSize\n })\n .subscribe({\n next: history => {\n this.runs.update(runs => append ? [...runs, ...history.items.filter(item => !runs.some(run => run.id === item.id))] : history.items);\n this.total.set(history.total);\n this.limited.set(history.limited);\n this.loading.set(false);\n },\n error: () => {\n if (append) {\n this.page--;\n }\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentBoard,\n AgentBoardAgent,\n LiveAgentWorkChanged,\n NH_ASSISTANT_SYSTEM_SUBJECT_TYPE,\n NhAssistantAgentRunApiService,\n NhAssistantApiError,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantMarkdownPipe as NhAssistantMarkdownPipe,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵnhAssistantWatchAgentWork as nhAssistantWatchAgentWork\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantBoardHistoryComponent } from './internal/nh-assistant-board-history.component';\nimport {\n NhAssistantRunNowAgent,\n NhAssistantRunNowDialogComponent,\n NhAssistantRunNowSubject\n} from './internal/nh-assistant-run-now-dialog.component';\nimport { NhAssistantAgentInboxComponent } from './nh-assistant-agent-inbox.component';\nimport { NhAssistantRunResultComponent } from './nh-assistant-run-result.component';\n\n/** What a board tile shows below the agent: its latest result, its proposals or its history. */\nexport type NhAssistantBoardPanel = 'result' | 'proposals' | 'history';\n\nlet nextId = 0;\n\n/**\n * The board of one group of agents, for a page of the application such as \"Project management\"\n * (K15): per agent a tile with what it works on, its latest result for the whole application rendered\n * with the assistant's safe Markdown rendering, \"New\" for what arrived since the person's last visit\n * (K16), \"Run now\" for people who may run it, its open proposals in the inbox, and its history with\n * every result on demand. Showing the board records the visit, so the next visit marks what is new\n * after this one. The server decides which agents the person sees: an agent that works on the whole\n * application by its view policy, by default its required policy. With `divisionId` the board shows\n * the work of agents that work per division in that division. With live updates the board reloads by\n * itself when its agents' work changes.\n */\n@Component({\n selector: 'nh-assistant-agent-board',\n standalone: true,\n imports: [\n DatePipe,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantMarkdownPipe,\n NhAssistantRunNowDialogComponent,\n NhAssistantRunResultComponent,\n NhAssistantAgentInboxComponent,\n NhAssistantBoardHistoryComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-board.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentBoardComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly translate = inject(TranslateService);\n private subscription?: Subscription;\n private visitSubscription?: Subscription;\n /** The board and scope whose visit this view recorded; the visit is recorded once per board shown. */\n private visited: string | null = null;\n /**\n * What the first read of the shown board found: the visit before this one and the agents that were\n * new then. Later reads, after live updates or a start, compare with the visit this view recorded,\n * so the view keeps both: what was new when the board was opened stays new while it is shown.\n */\n private opened: { previousVisit: string | null; newAgents: ReadonlySet<string> } | null = null;\n\n /** The group whose board is shown, such as `project-management`, as the application registered it. */\n readonly group = input.required<string>();\n /** The division whose board is shown; without it the board of the whole application. */\n readonly divisionId = input<string | null>(null);\n /** Emits a conversation a result or proposal offers to open, so the host can open it in the assistant panel. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-agent-board-${nextId++}`;\n readonly codeKeys = nhAssistantCodeKeys;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n /** The board does not exist or the person sees none of its agents. */\n readonly notFound = signal(false);\n /** The board as shown: new since the visit before this one, also after the visit was recorded. */\n readonly board = signal<AgentBoard | null>(null);\n readonly agents = computed(() => this.board()?.agents ?? []);\n /** Per agent what its tile shows below it; one panel per tile. */\n readonly panels = signal<Readonly<Record<string, NhAssistantBoardPanel>>>({});\n /** The agent the run-now dialog runs; `null` while it is closed. */\n readonly runningNow = signal<AgentBoardAgent | null>(null);\n readonly runNowAgent = computed<NhAssistantRunNowAgent | null>(() => {\n const agent = this.runningNow();\n return agent ? { id: agent.agentId, name: this.nameOf(agent) } : null;\n });\n /** The whole application in the board's scope: the run-now dialog runs on it without asking. */\n readonly runNowSubject = computed<NhAssistantRunNowSubject | null>(() => {\n const agent = this.runningNow();\n return agent?.subjectType && agent.subjectId\n ? { type: agent.subjectType, id: agent.subjectId, displayName: agent.subjectDisplayName }\n : null;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.visitSubscription?.unsubscribe();\n });\n effect(() => {\n this.group();\n this.divisionId();\n untracked(() => {\n this.panels.set({});\n this.runningNow.set(null);\n this.fetch(false);\n });\n });\n // The board shows the work of its agents for the whole application, which reaches the people who\n // may read it only while they watch it.\n nhAssistantWatchAgentWork();\n nhAssistantReloadOnAgentWork(change => this.concerns(change), () => this.fetch(true));\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /** The agent's name: a translation key of an agent in code, or the text of one created as data. */\n nameOf(agent: AgentBoardAgent): string {\n const translated = this.translate.instant(agent.displayNameKey) as string;\n return translated && translated !== agent.displayNameKey ? translated : agent.displayNameKey;\n }\n\n /** What the agent works on, in the reader's language. */\n worksOnOf(agent: AgentBoardAgent): string {\n const worksOn = agent.worksOn;\n const parts: string[] = worksOn.allObjects\n ? [this.translate.instant('nh-assistant.agent-runs.board.works-on-all') as string]\n : worksOn.subjectTypes.map(type => type.pluralName ?? type.name);\n if (worksOn.application) {\n parts.push(this.translate.instant(worksOn.perDivision\n ? 'nh-assistant.agent-runs.board.works-on-application-per-division'\n : 'nh-assistant.agent-runs.board.works-on-application') as string);\n }\n return this.translate.instant('nh-assistant.agent-runs.board.works-on', { list: parts.join(', ') }) as string;\n }\n\n panelOf(agent: AgentBoardAgent): NhAssistantBoardPanel | null {\n return this.panels()[agent.agentId] ?? null;\n }\n\n toggle(agent: AgentBoardAgent, panel: NhAssistantBoardPanel): void {\n this.panels.update(panels => {\n const next = { ...panels };\n if (next[agent.agentId] === panel) {\n delete next[agent.agentId];\n } else {\n next[agent.agentId] = panel;\n }\n return next;\n });\n }\n\n runNow(agent: AgentBoardAgent): void {\n this.runningNow.set(agent);\n }\n\n /** A run started: the board shows it as the agent's latest run. */\n onStarted(): void {\n this.fetch(true);\n }\n\n proposalsKey(count: number): string {\n switch (count) {\n case 0:\n return 'nh-assistant.agent-runs.object-agents.proposals-none';\n case 1:\n return 'nh-assistant.agent-runs.object-agents.proposals-one';\n default:\n return 'nh-assistant.agent-runs.object-agents.proposals';\n }\n }\n\n /** The beginning of a result as Markdown, marked when the result goes on. */\n previewOf(result: string, truncated: boolean): string {\n return truncated ? `${result}…` : result;\n }\n\n /**\n * Whether a live update concerns the board: the work in one of its agents' threads, or a run of the\n * whole application that may have started an agent's first thread.\n */\n private concerns(change: LiveAgentWorkChanged): boolean {\n return this.agents().some(agent => agent.conversationId === change.conversationId)\n || (change.subjectType === NH_ASSISTANT_SYSTEM_SUBJECT_TYPE && change.reason === 'run');\n }\n\n /**\n * Reads the board. A quiet reload, after a live update or a start, keeps what is shown when it\n * fails and shows no loading state. The first time a board is shown, its visit is recorded after it\n * was read, so it still marks what arrived since the visit before.\n */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.notFound.set(false);\n }\n\n const group = this.group();\n const divisionId = this.divisionId();\n this.subscription?.unsubscribe();\n this.subscription = this.api.getBoard(group, divisionId).subscribe({\n next: board => {\n this.board.set(this.asOpened(board, group, divisionId));\n this.loading.set(false);\n this.loadFailed.set(false);\n this.notFound.set(false);\n this.recordVisit(group, divisionId);\n },\n error: (failure: unknown) => {\n if (quiet && this.board() !== null) {\n return;\n }\n this.board.set(null);\n this.loading.set(false);\n const missing = failure instanceof NhAssistantApiError && failure.code === 'assistant-board-not-found';\n this.notFound.set(missing);\n this.loadFailed.set(!missing);\n }\n });\n }\n\n /**\n * The board read compared with the visit before the board was opened: the first read of a board\n * keeps its previous visit and new agents; later reads keep showing them as new.\n */\n private asOpened(board: AgentBoard, group: string, divisionId: string | null): AgentBoard {\n if (this.visited !== `${group}|${divisionId ?? ''}` || this.opened === null) {\n this.opened = {\n previousVisit: board.lastVisitedAt,\n newAgents: new Set(board.agents.filter(agent => agent.isNew).map(agent => agent.agentId))\n };\n return board;\n }\n\n const opened = this.opened;\n return {\n ...board,\n lastVisitedAt: opened.previousVisit,\n agents: board.agents.map(agent => agent.isNew || !opened.newAgents.has(agent.agentId) ? agent : { ...agent, isNew: true })\n };\n }\n\n private recordVisit(group: string, divisionId: string | null): void {\n const key = `${group}|${divisionId ?? ''}`;\n if (this.visited === key) {\n return;\n }\n\n this.visited = key;\n this.visitSubscription?.unsubscribe();\n // A visit that cannot be recorded only means the next visit shows more as new.\n this.visitSubscription = this.api.visitBoard(group, divisionId).subscribe({ error: () => undefined });\n }\n}\n","<section class=\"section\" [attr.aria-labelledby]=\"id + '-title'\" [attr.aria-busy]=\"loading()\" data-agent-board>\n <header class=\"section-header\">\n <div>\n <h3 [id]=\"id + '-title'\">{{ board()?.name ?? ('nh-assistant.agent-runs.board.title' | translate) }}</h3>\n @if (board(); as shown) {\n @if (shown.description; as description) {\n <p class=\"muted\">{{ description }}</p>\n }\n @if (shown.lastVisitedAt; as visitedAt) {\n <p class=\"muted\" data-board-last-visit>{{ 'nh-assistant.agent-runs.board.last-visit' | translate: { date: (visitedAt | date: 'medium') } }}</p>\n } @else {\n <p class=\"muted\" data-board-first-visit>{{ 'nh-assistant.agent-runs.board.first-visit' | translate }}</p>\n }\n }\n </div>\n <div class=\"toolbar\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </div>\n </header>\n\n @if (loading() && !board()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.board.loading' | translate }}</p>\n } @else if (notFound()) {\n <p class=\"state\" data-board-not-found>{{ 'nh-assistant.agent-runs.board.not-found' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else {\n <ul class=\"cards board-tiles\">\n @for (agent of agents(); track agent.agentId) {\n <li class=\"card board-tile\" [class.new]=\"agent.isNew\" [attr.data-board-agent]=\"agent.agentId\" [attr.aria-labelledby]=\"id + '-' + agent.agentId + '-name'\">\n <div class=\"card-header\">\n <strong [id]=\"id + '-' + agent.agentId + '-name'\">{{ [agent.displayNameKey] | nhAssistantTranslate: agent.displayNameKey }}</strong>\n @if (agent.isNew) {\n <span class=\"badge new\" data-board-new [attr.title]=\"'nh-assistant.agent-runs.board.new-label' | translate\">\n {{ 'nh-assistant.agent-runs.board.new' | translate }}<span class=\"visually-hidden\">: {{ 'nh-assistant.agent-runs.board.new-label' | translate }}</span>\n </span>\n }\n <span class=\"badge\" [class.warning]=\"agent.openProposals > 0\" data-open-proposals>\n {{ proposalsKey(agent.openProposals) | translate: { count: agent.openProposals } }}\n </span>\n </div>\n @if ([agent.descriptionKey] | nhAssistantTranslate: agent.descriptionKey; as description) {\n <p class=\"muted\">{{ description }}</p>\n }\n <p class=\"muted\" data-works-on>{{ worksOnOf(agent) }}</p>\n\n @if (agent.subjectType) {\n @if (agent.latestRun; as run) {\n <div class=\"latest-run\" data-latest-run>\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.board.latest' | translate }}</span>\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.danger]=\"run.status === 'failed'\"\n [class.warning]=\"run.status === 'waiting-for-approval'\">{{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}</span>\n <time [attr.datetime]=\"run.at\">{{ run.at | date: 'medium' }}</time>\n </div>\n @if (run.failureCode; as reason) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.failure' | translate: { reason: (codeKeys(reason) | nhAssistantTranslate: reason) } }}</p>\n }\n @if (run.result; as result) {\n <!-- Model output: rendered only through the assistant's safe Markdown rendering. -->\n <div class=\"markdown board-preview\" data-latest-result [innerHTML]=\"previewOf(result, run.resultTruncated) | nhAssistantMarkdown\"></div>\n } @else {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.no-result' | translate }}</p>\n }\n </div>\n } @else {\n <p class=\"muted\" data-never-run>{{ 'nh-assistant.agent-runs.board.never' | translate }}</p>\n }\n } @else {\n <p class=\"muted\" data-board-no-application>\n {{ (agent.worksOn.perDivision ? 'nh-assistant.agent-runs.board.per-division' : 'nh-assistant.agent-runs.board.objects-only') | translate }}\n </p>\n }\n\n <div class=\"card-actions\">\n @if (agent.canStart) {\n <button class=\"primary\" type=\"button\" aria-haspopup=\"dialog\" data-board-run-now (click)=\"runNow(agent)\">\n <nh-assistant-icon name=\"send\" />{{ 'nh-assistant.agent-runs.board.run-now' | translate }}\n </button>\n }\n @if (agent.latestRun) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-board-toggle-result\n [attr.aria-expanded]=\"panelOf(agent) === 'result'\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-panel'\"\n (click)=\"toggle(agent, 'result')\">\n <nh-assistant-icon name=\"page\" />{{ (panelOf(agent) === 'result' ? 'nh-assistant.agent-runs.result.hide' : 'nh-assistant.agent-runs.result.show') | translate }}\n </button>\n }\n @if (agent.openProposals > 0) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-board-toggle-proposals\n [attr.aria-expanded]=\"panelOf(agent) === 'proposals'\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-panel'\"\n (click)=\"toggle(agent, 'proposals')\">\n <nh-assistant-icon name=\"check\" />{{ (panelOf(agent) === 'proposals' ? 'nh-assistant.agent-runs.board.hide-proposals' : 'nh-assistant.agent-runs.board.show-proposals') | translate }}\n </button>\n }\n @if (agent.subjectType) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-board-toggle-history\n [attr.aria-expanded]=\"panelOf(agent) === 'history'\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-panel'\"\n (click)=\"toggle(agent, 'history')\">\n <nh-assistant-icon name=\"list\" />{{ (panelOf(agent) === 'history' ? 'nh-assistant.agent-runs.board.hide-history' : 'nh-assistant.agent-runs.board.show-history') | translate }}\n </button>\n }\n </div>\n\n @switch (panelOf(agent)) {\n @case ('result') {\n @if (agent.latestRun; as run) {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-panel'\">\n <nh-assistant-run-result [runId]=\"run.runId\" (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n }\n @case ('proposals') {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-panel'\">\n <nh-assistant-agent-inbox [agentId]=\"agent.agentId\" (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n @case ('history') {\n @if (agent.subjectType && agent.subjectId) {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-panel'\">\n <nh-assistant-board-history\n [agentId]=\"agent.agentId\"\n [subjectType]=\"agent.subjectType\"\n [subjectId]=\"agent.subjectId\"\n (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n }\n }\n </li>\n }\n </ul>\n }\n\n @if (runNowAgent(); as runAgent) {\n <nh-assistant-run-now-dialog\n [agent]=\"runAgent\"\n [subject]=\"runNowSubject()\"\n (started)=\"onStarted()\"\n (openConversation)=\"openConversation.emit($event)\"\n (closed)=\"runningNow.set(null)\" />\n }\n</section>\n","/*\n * Public API surface of @newheap/platform-ai-chat/agent-runs.\n *\n * Agents that run on their own are a separate entry point, so hosts load the inbox and the\n * subject views only on the routes that show them and the chat panel stays small. The\n * components use `NhAssistantAgentRunApiService` from the `provideNhAssistant` scope and reload\n * by themselves on the agent-work updates of its `NhAssistantLiveService`.\n */\nexport * from './nh-assistant-agent-inbox.component';\nexport * from './nh-assistant-agent-thread-view.component';\nexport * from './nh-assistant-agent-proposals.component';\nexport * from './nh-assistant-run-timeline.component';\nexport * from './nh-assistant-agent-memory.component';\nexport * from './nh-assistant-agent-artifacts.component';\nexport * from './nh-assistant-agent-consultations.component';\nexport * from './nh-assistant-subject-suggestions.component';\nexport * from './nh-assistant-object-agents.component';\nexport * from './nh-assistant-run-result.component';\nexport * from './nh-assistant-agent-board.component';\n\n/*\n * Internal building blocks shared with the administration entry point; they live here so the chat's\n * initial bundle stays small. Not part of the public API; they may change without notice.\n */\nexport {\n NhAssistantRunNowDialogComponent as ɵNhAssistantRunNowDialogComponent,\n NH_ASSISTANT_RUN_NOW_MAX_MESSAGE as ɵNH_ASSISTANT_RUN_NOW_MAX_MESSAGE,\n type NhAssistantRunNowAgent as ɵNhAssistantRunNowAgent,\n type NhAssistantRunNowStarted as ɵNhAssistantRunNowStarted,\n type NhAssistantRunNowSubject as ɵNhAssistantRunNowSubject\n} from './internal/nh-assistant-run-now-dialog.component';\nexport {\n NhAssistantSubjectPickerComponent as ɵNhAssistantSubjectPickerComponent,\n nhAssistantSubjectSearch as ɵnhAssistantSubjectSearch,\n type NhAssistantChosenSubject as ɵNhAssistantChosenSubject\n} from './internal/nh-assistant-subject-picker.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["nhAssistantErrorKeys","toNhAssistantError","NhAssistantIconComponent","NhAssistantSubjectLinkComponent","NhAssistantTranslatePipe","nhAssistantWatchAgentWork","nhAssistantReloadOnAgentWork","nhAssistantCodeKeys","nextId","NhAssistantMarkdownPipe","NhAssistantPickerComponent"],"mappings":";;;;;;;AA6CA;;;;;;;;;;;;;;AAcG;MAgBU,kCAAkC,CAAA;AAkD7C,IAAA,WAAA,GAAA;AAjDiB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC3C,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAA0B,UAAU,CAAC;AAClD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAGnC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,oDAAmB;;AAE7C,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,qDAAC;AACjC;;;AAGG;AACM,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAyD,IAAI,0DAAC;AACpF,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK,sDAAC;AAClC;;;;AAIG;AACM,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,KAAK,2DAAC;;QAE9B,IAAA,CAAA,OAAO,GAAG,MAAM,EAAQ;AACjC;;;AAGG;QACM,IAAA,CAAA,gBAAgB,GAAG,MAAM,EAAU;AAEnC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,KAAK,gDAAC;AACpB,QAA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A,QAAA,EAAA,0BAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,aAAA,EAAA,cAAA,CAAA,EAAA,OAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC9B,gCAAgC,kJARhC,QAAQ,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EACR,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EACbE,yBAAwB,wDAExBK,wBAAuB,EAAA,IAAA,EAAA,qBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAUd,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAlB1C,SAAS;+BACE,0BAA0B,EAAA,UAAA,EACxB,IAAI,EAAA,OAAA,EACP;wBACP,QAAQ;wBACR,aAAa;wBACbL,yBAAwB;wBACxBF,yBAAwB;wBACxBO,wBAAuB;wBACvB,gCAAgC;wBAChC,6BAA6B;wBAC7B,8BAA8B;wBAC9B;qBACD,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,82QAAA,EAAA,MAAA,EAAA,CAAA,sphBAAA,CAAA,EAAA;;;AEpEjD;;;;;;;AAOG;;ACPH;;AAEG;;;;"}
1
+ {"version":3,"file":"newheap-platform-ai-chat-agent-runs.mjs","sources":["../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-proposals.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-proposals.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-inbox.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-inbox.component.html","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-run-receipt.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-artifacts.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-artifacts.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-consultations.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-consultations.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-memory.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-memory.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-run-result.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-run-result.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-run-timeline.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-run-timeline.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-thread-view.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-thread-view.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-subject-suggestions.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-subject-suggestions.component.html","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-subject-picker.component.ts","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-subject-picker.component.html","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-run-now-dialog.component.ts","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-run-now-dialog.component.html","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-object-agents.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-object-agents.component.html","../../../projects/nh-ai-chat/agent-runs/src/internal/nh-assistant-board-history.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-board.component.ts","../../../projects/nh-ai-chat/agent-runs/src/nh-assistant-agent-board.component.html","../../../projects/nh-ai-chat/agent-runs/src/public-api.ts","../../../projects/nh-ai-chat/agent-runs/src/newheap-platform-ai-chat-agent-runs.ts"],"sourcesContent":["import { DatePipe, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n afterNextRender,\n computed,\n inject,\n input,\n output,\n signal\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Observable, Subscription, forkJoin } from 'rxjs';\nimport {\n AgentExecutionResolution,\n AgentInboxGroup,\n AgentProposal,\n AgentProposalDecision,\n AgentProposalDecisionRight,\n AgentProposalFeedback,\n AgentProposalOrigin,\n NH_ASSISTANT_MAX_PROPOSAL_LOOKUP,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n NhAssistantProposalFeedbackComponent,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantSubjectLinkComponent as NhAssistantSubjectLinkComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\n\n/** The proposals of one run within a subject of a grouped list, in the order the list gave them. */\ninterface NhAssistantRunSection {\n key: string;\n runId: string | null;\n agentId: string;\n /** When the run's first proposal on the page was made. */\n proposedAt: string;\n items: AgentProposal[];\n}\n\n/** One subject within a group of a grouped list. */\ninterface NhAssistantSubjectSection {\n key: string;\n subjectType: string;\n subjectId: string;\n label: string;\n typeName: string | null;\n link: string | null;\n /** The group's own subject, whose proposals stand directly under the group's header. */\n own: boolean;\n count: number;\n total: number;\n runs: NhAssistantRunSection[];\n}\n\n/** One group of a grouped list, such as a parent subject of the grouped inbox. */\ninterface NhAssistantGroupSection {\n key: string;\n subjectType: string;\n subjectId: string;\n label: string;\n typeName: string | null;\n link: string | null;\n count: number;\n total: number;\n continuesFromPreviousPage: boolean;\n continuesOnNextPage: boolean;\n subjects: NhAssistantSubjectSection[];\n /** The group's pending proposals on this page that the caller may decide: what \"Select group\" selects. */\n selectableIds: string[];\n}\n\n/** A feedback question: after a rejection above the list, or from a card's own action. */\ninterface NhAssistantFeedbackRequest {\n approvalIds: string[];\n initial: AgentProposalFeedback | null;\n placement: 'prompt' | 'card';\n /** What was rejected, for a single rejection. */\n summary: string | null;\n /** The feedback was stored; the panel thanks the person until the next action. */\n saved: boolean;\n}\n\n/**\n * A list of agent proposals with their decision and execution state. People who may decide see\n * approve and reject on pending proposals and the resolution of an execution with an unknown\n * outcome; the server checks every decision again. With `selectable`, pending proposals can be\n * approved or rejected together. Deciding takes one action. After a rejection the list asks,\n * optionally and above the list, what was wrong; closed proposals keep a low-key action to give or\n * change that feedback later. With `decisionRights` each proposal has its own right, for example\n * from the agent work on a subject, and a pending proposal the viewer may not decide says who does.\n * A proposal that no longer fits, for example because a person already did the work, shows why.\n * With `holdClosedCards`, a list of open proposals keeps such a proposal, or one a newer proposal\n * replaced, as a closed card when it closes while shown, or when an approval is refused because of\n * it, until the person dismisses it. It reads those proposals by id with one lookup, never through\n * their threads. A proposal that a run placed here from another subject, such as a run for the whole\n * application, says so and offers that run's conversation through `openConversation`. With `groups`\n * from the grouped inbox the list shows a header per group and per subject, optionally per run\n * (`groupByRun`), and \"Select group\" selects only the group's pending proposals in this list that\n * the caller may decide, never those on another page. `newIds` marks proposals as new. A proposal of\n * a consultation names who asked and its route: one the person who asked decides in their own chat\n * (`asker-decides`) waits for them without actions here; one that runs with the agent's own rights\n * (`subject-agent-rights`) says so, and the person who asked reads why another approver decides.\n */\n@Component({\n selector: 'nh-assistant-agent-proposals',\n standalone: true,\n imports: [\n DatePipe,\n NgTemplateOutlet,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantSubjectLinkComponent,\n NhAssistantProposalFeedbackComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-proposals.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentProposalsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private subscription?: Subscription;\n\n readonly proposals = input.required<AgentProposal[]>();\n /** Whether the caller may decide: an approver of the subjects or the inbox owner. */\n readonly canDecide = input(false);\n /**\n * The caller's live right per proposal, by approval id, for example from\n * `AgentSubjectWork.openProposals`. A proposal with a right uses it instead of `canDecide`.\n */\n readonly decisionRights = input<ReadonlyMap<string, AgentProposalDecisionRight> | null>(null);\n readonly selectable = input(false);\n /**\n * Keeps proposals that close as stale or are replaced while shown as closed cards with their\n * explanation until they are dismissed. For lists of open proposals, which drop a proposal once\n * it closes.\n */\n readonly holdClosedCards = input(false);\n /**\n * The groups of the grouped inbox (`AgentInbox.groups`) for `proposals` in the order the inbox gave\n * them: the first `count` proposals belong to the first group, and so on. Without groups, or when\n * they do not describe `proposals`, the list is flat.\n */\n readonly groups = input<readonly AgentInboxGroup[] | null>(null);\n /** Shows a header per run within a subject of a grouped list. */\n readonly groupByRun = input(false);\n /** Proposals to mark as new, by approval id, for example those made since the last visit of the inbox. */\n readonly newIds = input<ReadonlySet<string> | null>(null);\n /** Emits after a proposal or its feedback changed, so the host reloads its list. */\n readonly changed = output<void>();\n /**\n * Emits the conversation of the run that placed a proposal here from another subject, so the host\n * opens it, for example in the assistant panel. The server checks the reader's access again.\n */\n readonly openConversation = output<string>();\n\n readonly busy = signal(false);\n readonly selected = signal<ReadonlySet<string>>(new Set());\n readonly error = signal<NhAssistantError | null>(null);\n readonly errorKeys = computed(() => nhAssistantErrorKeys(this.error()));\n /** Pending proposals the caller may decide. */\n readonly pending = computed(() =>\n this.proposals().filter(proposal => proposal.status === 'pending' && this.mayDecide(proposal)));\n readonly allSelected = computed(() =>\n this.pending().length > 0 && this.pending().every(proposal => this.selected().has(proposal.approvalId)));\n /** The feedback question. It does not depend on `proposals`, which drop rejected proposals in the inbox. */\n readonly feedback = signal<NhAssistantFeedbackRequest | null>(null);\n /** Proposals that closed as stale while shown, kept until dismissed; newest first. */\n readonly held = signal<AgentProposal[]>([]);\n /** The held closed cards first, then the proposals the host gave. */\n readonly shown = computed(() => {\n const held = this.held();\n const heldIds = new Set(held.map(proposal => proposal.approvalId));\n return [...held, ...this.proposals().filter(proposal => !heldIds.has(proposal.approvalId))];\n });\n private readonly lookups = new Subscription();\n /**\n * The grouped list: the held closed cards stay above it; `null` for a flat list, or when the groups\n * do not describe the proposals.\n */\n readonly sections = computed<NhAssistantGroupSection[] | null>(() => {\n const groups = this.groups();\n const items = this.proposals();\n if (!groups || groups.reduce((sum, group) => sum + group.count, 0) !== items.length) {\n return null;\n }\n\n const heldIds = new Set(this.held().map(proposal => proposal.approvalId));\n const sections: NhAssistantGroupSection[] = [];\n let offset = 0;\n for (const group of groups) {\n const members = items.slice(offset, offset + group.count);\n offset += group.count;\n sections.push(this.groupSection(group, members, heldIds));\n }\n return sections;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.lookups.unsubscribe();\n });\n }\n\n /**\n * The translation key of a proposal's status: the kind of a stale proposal, \"replaced\" for a\n * superseded one, otherwise its status.\n */\n statusKey(proposal: AgentProposal): string {\n if (proposal.status === 'stale' && proposal.staleKind) {\n return `nh-assistant.approval.stale-kind.${proposal.staleKind}`;\n }\n\n return isSuperseded(proposal)\n ? 'nh-assistant.approval.superseded'\n : `nh-assistant.agent-runs.proposal.status.${proposal.status}`;\n }\n\n /**\n * The translation key and parameters that say where a placed proposal came from: the whole\n * application, a division of it, or another object, named only by its kind.\n */\n originText(origin: AgentProposalOrigin): { key: string; params: Record<string, string> } {\n if (origin.subjectType === 'nh-system') {\n return origin.subjectId?.startsWith('division-') && origin.subjectDisplayName\n ? { key: 'nh-assistant.agent-runs.proposal.placed-by.division', params: { name: origin.subjectDisplayName } }\n : { key: 'nh-assistant.agent-runs.proposal.placed-by.application', params: {} };\n }\n\n return origin.subjectTypeName\n ? { key: 'nh-assistant.agent-runs.proposal.placed-by.object-named', params: { type: origin.subjectTypeName } }\n : { key: 'nh-assistant.agent-runs.proposal.placed-by.object', params: {} };\n }\n\n /** Whether the proposal is marked as new. */\n isNew(proposal: AgentProposal): boolean {\n return this.newIds()?.has(proposal.approvalId) ?? false;\n }\n\n /** Whether every proposal \"Select group\" would select in the group is selected. */\n groupSelected(group: NhAssistantGroupSection): boolean {\n const selected = this.selected();\n return group.selectableIds.length > 0 && group.selectableIds.every(id => selected.has(id));\n }\n\n /**\n * Selects the group's pending proposals in this list that the caller may decide, or deselects them\n * when all are selected. Proposals of the group on another page are never selected: an approver\n * decides only what they see.\n */\n toggleGroup(group: NhAssistantGroupSection): void {\n const next = new Set(this.selected());\n if (this.groupSelected(group)) {\n group.selectableIds.forEach(id => next.delete(id));\n } else {\n group.selectableIds.forEach(id => next.add(id));\n }\n this.selected.set(next);\n }\n\n /** True when the newer proposal that replaced this one is in the list. */\n hasSuccessor(proposal: AgentProposal): boolean {\n const successor = proposal.supersededByApprovalId;\n return !!successor && this.shown().some(item => item.approvalId === successor);\n }\n\n /** Moves focus to the newer proposal that replaced this one. */\n showSuccessor(proposal: AgentProposal): void {\n const card = Array.from(this.host.nativeElement.querySelectorAll<HTMLElement>('[data-approval-id]'))\n .find(element => element.dataset['approvalId'] === proposal.supersededByApprovalId);\n card?.scrollIntoView({ block: 'nearest' });\n card?.focus();\n }\n\n /** True for a closed card the list keeps until it is dismissed. */\n isHeld(proposal: AgentProposal): boolean {\n return this.held().some(item => item.approvalId === proposal.approvalId);\n }\n\n /** Removes a closed card. */\n dismiss(proposal: AgentProposal): void {\n this.held.update(held => held.filter(item => item.approvalId !== proposal.approvalId));\n }\n\n /**\n * Called by a host of open proposals after a live update replaced `previous` with `next`: keeps\n * the shown pending proposals that left the list because they closed as stale or were replaced.\n */\n holdClosed(previous: readonly AgentProposal[], next: readonly AgentProposal[]): void {\n const nextIds = new Set(next.map(proposal => proposal.approvalId));\n this.holdStale(previous.filter(proposal => proposal.status === 'pending' && !nextIds.has(proposal.approvalId)));\n }\n\n /**\n * Whether the caller may decide this proposal: its own right when one was given, otherwise\n * `canDecide`. Nobody decides a proposal here that the person who asked decides in their own chat.\n */\n mayDecide(proposal: AgentProposal): boolean {\n if (this.waitsForAsker(proposal)) {\n return false;\n }\n\n const right = this.decisionRights()?.get(proposal.approvalId);\n return right ? right.canDecide : this.canDecide();\n }\n\n /**\n * Whether a pending proposal of a consultation waits for the person who asked, who decides it in\n * their own chat: its route says so, or the server's reason for the caller's right.\n */\n waitsForAsker(proposal: AgentProposal): boolean {\n if (proposal.status !== 'pending') {\n return false;\n }\n\n return proposal.consultationRoute === 'asker-decides'\n || this.decisionRights()?.get(proposal.approvalId)?.reasonCode === askerDecidesCode;\n }\n\n /**\n * Who decides a pending proposal that has a right the caller lacks: another approver when\n * four-eyes keeps out the person who started the work, which for a consultation's proposal that\n * runs with the agent's own rights is the person who asked, otherwise an approver. A proposal that\n * waits for the person who asked says so on its own (`waitsForAsker`).\n */\n waitingForKey(proposal: AgentProposal): string | null {\n const right = this.decisionRights()?.get(proposal.approvalId);\n if (!right || right.canDecide || proposal.status !== 'pending' || this.waitsForAsker(proposal)) {\n return null;\n }\n\n if (right.reasonCode !== fourEyesCode) {\n return 'nh-assistant.approval.waiting-for-approver';\n }\n\n return proposal.consultationRoute === 'subject-agent-rights'\n ? 'nh-assistant.agent-runs.proposal.consultation.four-eyes'\n : 'nh-assistant.approval.waiting-for-other-approver';\n }\n\n /**\n * The badge of a consultation's proposal that runs with the agent's own rights: those of a technical\n * account when the agent answers to one, otherwise the agent's own; `null` for other proposals.\n */\n agentRightsKey(proposal: AgentProposal): string | null {\n if (proposal.consultationRoute !== 'subject-agent-rights') {\n return null;\n }\n\n return proposal.grantSource === 'accountable'\n ? 'nh-assistant.agent-runs.proposal.consultation.runs-with.accountable'\n : 'nh-assistant.agent-runs.proposal.consultation.runs-with.agent';\n }\n\n toggle(proposal: AgentProposal): void {\n const next = new Set(this.selected());\n if (next.has(proposal.approvalId)) {\n next.delete(proposal.approvalId);\n } else {\n next.add(proposal.approvalId);\n }\n this.selected.set(next);\n }\n\n toggleAll(): void {\n this.selected.set(this.allSelected() ? new Set() : new Set(this.pending().map(proposal => proposal.approvalId)));\n }\n\n decide(proposal: AgentProposal, decision: AgentProposalDecision): void {\n this.run(this.api.decide(proposal, decision), result => {\n if (decision === 'reject' && result.status === 'rejected' && result.canGiveFeedback === true) {\n this.ask([proposal.approvalId], summaryOf(proposal));\n }\n }, code => {\n if (code === staleCode) {\n // The approval was refused because the proposal no longer fits; show why.\n this.holdStale([proposal]);\n }\n });\n }\n\n decideSelected(decision: AgentProposalDecision): void {\n const ids = [...this.selected()];\n if (ids.length === 0) {\n return;\n }\n\n const proposals = this.proposals();\n this.run(this.api.decideMany(ids, decision), response => {\n this.selected.set(new Set());\n const stale = response.results\n .filter(outcome => !outcome.succeeded && outcome.code === staleCode)\n .map(outcome => outcome.approvalId);\n this.holdStale(proposals.filter(proposal => stale.includes(proposal.approvalId)));\n if (decision !== 'reject') {\n return;\n }\n\n const rejected = response.results\n .filter(outcome => outcome.succeeded && outcome.status === 'rejected')\n .map(outcome => outcome.approvalId);\n if (rejected.length > 0) {\n const single = rejected.length === 1 ? proposals.find(proposal => proposal.approvalId === rejected[0]) : undefined;\n this.ask(rejected, single ? summaryOf(single) : null);\n }\n });\n }\n\n resolve(proposal: AgentProposal, action: AgentExecutionResolution): void {\n this.run(this.api.resolve(proposal.approvalId, action));\n }\n\n /** Opens the feedback question in the card of a closed proposal, with the caller's own feedback. */\n giveFeedback(proposal: AgentProposal): void {\n this.feedback.set({\n approvalIds: [proposal.approvalId],\n initial: proposal.feedback ?? null,\n placement: 'card',\n summary: null,\n saved: false\n });\n }\n\n /** True while the feedback question for this proposal is open, above the list or in its card. */\n isAsking(proposal: AgentProposal): boolean {\n const request = this.feedback();\n return request !== null && !request.saved && request.approvalIds.includes(proposal.approvalId);\n }\n\n /** True when the card of this proposal shows the feedback question or its thanks. */\n inCard(proposal: AgentProposal): boolean {\n const request = this.feedback();\n return request?.placement === 'card' && request.approvalIds[0] === proposal.approvalId;\n }\n\n /** Keeps the panel, which now thanks the person, and lets the host reload the proposals. */\n onFeedbackSaved(): void {\n this.feedback.update(request => request ? { ...request, saved: true } : request);\n this.changed.emit();\n }\n\n /** Closes the question; from a card, focus returns to the card's feedback action. */\n onFeedbackDismissed(): void {\n const request = this.feedback();\n this.feedback.set(null);\n if (request?.placement !== 'card') {\n return;\n }\n\n const [approvalId] = request.approvalIds;\n afterNextRender(() => {\n const action = Array.from(this.host.nativeElement.querySelectorAll<HTMLButtonElement>('[data-feedback-approval]'))\n .find(item => item.dataset['feedbackApproval'] === approvalId);\n action?.focus();\n }, { injector: this.injector });\n }\n\n private groupSection(group: AgentInboxGroup, members: AgentProposal[], heldIds: ReadonlySet<string>): NhAssistantGroupSection {\n const key = `${group.subjectType}|${group.subjectId}`;\n const subjects: NhAssistantSubjectSection[] = [];\n let offset = 0;\n for (const subject of group.subjects) {\n const items = members\n .slice(offset, offset + subject.count)\n .filter(proposal => !heldIds.has(proposal.approvalId)\n && proposal.subjectType === subject.subjectType\n && proposal.subjectId === subject.subjectId);\n offset += subject.count;\n const first = items[0];\n subjects.push({\n key: `${key}|${subject.subjectType}|${subject.subjectId}`,\n subjectType: subject.subjectType,\n subjectId: subject.subjectId,\n label: first?.subjectDisplayName ?? subject.subjectId,\n typeName: first?.subjectTypeName ?? null,\n link: first?.subjectLink ?? null,\n own: subject.subjectType === group.subjectType && subject.subjectId === group.subjectId,\n count: subject.count,\n total: subject.total,\n runs: runsOf(items)\n });\n }\n\n return {\n key,\n subjectType: group.subjectType,\n subjectId: group.subjectId,\n label: group.displayName ?? group.subjectId,\n typeName: group.subjectTypeName ?? null,\n link: group.subjectLink ?? null,\n count: group.count,\n total: group.total,\n continuesFromPreviousPage: group.continuesFromPreviousPage,\n continuesOnNextPage: group.continuesOnNextPage,\n subjects,\n selectableIds: members\n .filter(proposal => !heldIds.has(proposal.approvalId) && proposal.status === 'pending' && this.mayDecide(proposal))\n .map(proposal => proposal.approvalId)\n };\n }\n\n private ask(approvalIds: string[], summary: string | null): void {\n this.feedback.set({ approvalIds, initial: null, placement: 'prompt', summary, saved: false });\n }\n\n /**\n * Reads `proposals` again by id and keeps those that closed as stale or were replaced as closed\n * cards, with their kind and explanation or their successor.\n */\n private holdStale(proposals: readonly AgentProposal[]): void {\n if (!this.holdClosedCards() || proposals.length === 0) {\n return;\n }\n\n // The proposals are read by id, never through their threads.\n const ids = [...new Set(proposals.map(proposal => proposal.approvalId))];\n const batches: string[][] = [];\n for (let start = 0; start < ids.length; start += NH_ASSISTANT_MAX_PROPOSAL_LOOKUP) {\n batches.push(ids.slice(start, start + NH_ASSISTANT_MAX_PROPOSAL_LOOKUP));\n }\n this.lookups.add(forkJoin(batches.map(batch => this.api.lookupProposals(batch))).subscribe({\n next: lookups => {\n const closed = lookups\n .flatMap(lookup => lookup.items)\n .map(item => item.proposal)\n .filter(proposal => proposal.status === 'stale' || isSuperseded(proposal));\n if (closed.length === 0) {\n return;\n }\n\n this.held.update(held => [\n ...closed,\n ...held.filter(item => !closed.some(proposal => proposal.approvalId === item.approvalId))\n ]);\n },\n // Without the lookup the proposal just leaves the list, as it did before.\n error: () => undefined\n }));\n }\n\n private run<T>(request: Observable<T>, done?: (result: T) => void, failed?: (code: string) => void): void {\n this.busy.set(true);\n this.error.set(null);\n if (this.feedback()?.saved) {\n this.feedback.set(null);\n }\n this.subscription?.unsubscribe();\n this.subscription = request.subscribe({\n next: result => {\n this.busy.set(false);\n done?.(result);\n this.changed.emit();\n },\n error: failure => {\n this.busy.set(false);\n const error = toNhAssistantError(failure);\n this.error.set(error);\n failed?.(error.code);\n this.changed.emit();\n }\n });\n }\n}\n\n/** The refusal of an approval because the proposal no longer fits. */\nconst staleCode = 'assistant-proposal-stale';\n\n/** Someone other than the person who started the work decides the proposal. */\nconst fourEyesCode = 'assistant-four-eyes-required';\n\n/** The person who asked decides a consultation's proposal in their own chat; nobody decides it here. */\nconst askerDecidesCode = 'assistant-consult-asker-decides';\n\n/** The application's words for a proposal, falling back to its subject and tool. */\nfunction summaryOf(proposal: AgentProposal): string {\n return proposal.presentation?.summary\n ?? `${proposal.subjectDisplayName ?? proposal.subjectId} · ${proposal.presentation?.toolDisplayName ?? proposal.toolId}`;\n}\n\n/** The proposals of each run in a row, in the order given. */\nfunction runsOf(items: readonly AgentProposal[]): NhAssistantRunSection[] {\n const runs: NhAssistantRunSection[] = [];\n for (const proposal of items) {\n const last = runs.at(-1);\n if (last && last.runId === proposal.runId) {\n last.items.push(proposal);\n continue;\n }\n\n runs.push({\n key: `${proposal.runId ?? 'none'}|${proposal.approvalId}`,\n runId: proposal.runId,\n agentId: proposal.agentId,\n proposedAt: proposal.createdAt,\n items: [proposal]\n });\n }\n return runs;\n}\n\n/** True for a proposal a newer proposal for the same objects replaced. */\nfunction isSuperseded(proposal: AgentProposal): boolean {\n return proposal.status === 'withdrawn' && !!proposal.supersededByApprovalId;\n}\n","<div class=\"proposal-list\">\n @if (error(); as failure) {\n <p class=\"message error\" role=\"alert\"><nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}</p>\n }\n\n @if (feedback(); as request) {\n @if (request.placement === 'prompt') {\n <div class=\"feedback-prompt\">\n @if (request.summary && !request.saved) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.proposal.rejected-one' | translate: { summary: request.summary } }}</p>\n }\n <nh-assistant-proposal-feedback\n [approvalIds]=\"request.approvalIds\"\n [initial]=\"request.initial\"\n (saved)=\"onFeedbackSaved()\"\n (dismissed)=\"onFeedbackDismissed()\" />\n </div>\n }\n }\n\n @if (selectable() && pending().length > 0) {\n <div class=\"toolbar\">\n <label class=\"select\">\n <input type=\"checkbox\" [checked]=\"allSelected()\" [disabled]=\"busy()\" (change)=\"toggleAll()\" />\n {{ 'nh-assistant.agent-runs.inbox.select-all' | translate }}\n </label>\n <button class=\"primary\" type=\"button\" [disabled]=\"busy() || selected().size === 0\" (click)=\"decideSelected('approve')\">\n <nh-assistant-icon name=\"check\" />{{ 'nh-assistant.agent-runs.inbox.approve-selected' | translate }}\n </button>\n <button class=\"secondary\" type=\"button\" [disabled]=\"busy() || selected().size === 0\" (click)=\"decideSelected('reject')\">\n <nh-assistant-icon name=\"x\" />{{ 'nh-assistant.agent-runs.inbox.reject-selected' | translate }}\n </button>\n </div>\n }\n\n @if (sections(); as groups) {\n @if (held().length > 0) {\n <ul class=\"cards\" [attr.aria-busy]=\"busy()\">\n @for (proposal of held(); track proposal.approvalId) {\n <ng-container *ngTemplateOutlet=\"card; context: { $implicit: proposal }\" />\n }\n </ul>\n }\n @for (group of groups; track group.key) {\n <section class=\"proposal-group\" [attr.data-proposal-group]=\"group.key\" [attr.aria-label]=\"group.label\">\n <header class=\"proposal-group-header\">\n <h4>\n <nh-assistant-subject-link\n [subjectType]=\"group.subjectType\"\n [subjectId]=\"group.subjectId\"\n [label]=\"group.label\"\n [typeName]=\"group.typeName\"\n [link]=\"group.link\" />\n </h4>\n <span class=\"muted\" data-group-loaded>{{ 'nh-assistant.agent-runs.inbox.group-loaded' | translate: { loaded: group.count, total: group.total } }}</span>\n @if (selectable() && group.selectableIds.length > 0) {\n <label class=\"select\">\n <input\n type=\"checkbox\"\n data-select-group\n [checked]=\"groupSelected(group)\"\n [disabled]=\"busy()\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.inbox.select-group-label' | translate: { count: group.selectableIds.length, name: group.label }\"\n (change)=\"toggleGroup(group)\" />\n {{ 'nh-assistant.agent-runs.inbox.select-group' | translate: { count: group.selectableIds.length } }}\n </label>\n }\n </header>\n @if (group.continuesFromPreviousPage) {\n <p class=\"muted\" data-group-continued>{{ 'nh-assistant.agent-runs.inbox.group-continued' | translate }}</p>\n }\n @for (subject of group.subjects; track subject.key) {\n @if (!subject.own) {\n <h5 class=\"proposal-subject-header\" [attr.data-proposal-subject]=\"subject.subjectType + '|' + subject.subjectId\">\n <nh-assistant-subject-link\n [subjectType]=\"subject.subjectType\"\n [subjectId]=\"subject.subjectId\"\n [label]=\"subject.label\"\n [typeName]=\"subject.typeName\"\n [link]=\"subject.link\" />\n @if (subject.count < subject.total) {\n <span class=\"muted\">{{ 'nh-assistant.agent-runs.inbox.group-loaded' | translate: { loaded: subject.count, total: subject.total } }}</span>\n }\n </h5>\n }\n @for (run of subject.runs; track run.key) {\n @if (groupByRun()) {\n <p class=\"proposal-run-header\" [attr.data-proposal-run]=\"run.runId ?? ''\">\n @if (run.runId) {\n {{ 'nh-assistant.agent-runs.inbox.run' | translate: { agent: ([('nh-assistant.agents.' + run.agentId + '.name')] | nhAssistantTranslate: run.agentId), date: (run.proposedAt | date: 'short') } }}\n } @else {\n {{ 'nh-assistant.agent-runs.inbox.no-run' | translate }}\n }\n </p>\n }\n <ul class=\"cards\" [attr.aria-busy]=\"busy()\">\n @for (proposal of run.items; track proposal.approvalId) {\n <ng-container *ngTemplateOutlet=\"card; context: { $implicit: proposal }\" />\n }\n </ul>\n }\n }\n @if (group.continuesOnNextPage) {\n <p class=\"muted\" data-group-continues>{{ 'nh-assistant.agent-runs.inbox.group-continues' | translate }}</p>\n }\n </section>\n }\n } @else if (shown().length > 0) {\n <ul class=\"cards\" [attr.aria-busy]=\"busy()\">\n @for (proposal of shown(); track proposal.approvalId) {\n <ng-container *ngTemplateOutlet=\"card; context: { $implicit: proposal }\" />\n }\n </ul>\n }\n\n <ng-template #card let-proposal>\n <li\n class=\"card\"\n tabindex=\"-1\"\n [attr.data-approval-id]=\"proposal.approvalId\"\n [class.selected]=\"selected().has(proposal.approvalId)\"\n [class.closed]=\"isHeld(proposal)\"\n [class.new]=\"isNew(proposal)\">\n <div class=\"card-header\">\n @if (selectable() && proposal.status === 'pending' && mayDecide(proposal)) {\n <input\n type=\"checkbox\"\n [checked]=\"selected().has(proposal.approvalId)\"\n [disabled]=\"busy()\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.inbox.select' | translate\"\n (change)=\"toggle(proposal)\" />\n }\n <strong>\n <nh-assistant-subject-link\n [subjectType]=\"proposal.subjectType\"\n [subjectId]=\"proposal.subjectId\"\n [label]=\"proposal.subjectDisplayName ?? proposal.subjectId\"\n [typeName]=\"proposal.subjectTypeName\"\n [link]=\"proposal.subjectLink\" />\n </strong>\n <span class=\"muted\">{{ proposal.presentation?.toolDisplayName ?? proposal.toolId }}</span>\n @if (isNew(proposal)) {\n <span class=\"badge new\" data-proposal-new [attr.title]=\"'nh-assistant.agent-runs.inbox.new-label' | translate\">\n {{ 'nh-assistant.agent-runs.inbox.new' | translate }}<span class=\"visually-hidden\">: {{ 'nh-assistant.agent-runs.inbox.new-label' | translate }}</span>\n </span>\n }\n <span\n class=\"badge\"\n [class.success]=\"proposal.status === 'executed' || proposal.status === 'resolved'\"\n [class.warning]=\"proposal.status === 'pending' || proposal.status === 'execution-unknown' || proposal.status === 'stale'\"\n [class.danger]=\"proposal.status === 'execution-failed' || proposal.status === 'rejected'\">\n {{ statusKey(proposal) | translate }}\n </span>\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.proposal.mode.' + proposal.mode | translate }}</span>\n @if (agentRightsKey(proposal); as rightsKey) {\n <!-- A consultation's proposal that runs with the agent's own rights says so plainly. -->\n <span class=\"badge\" data-consultation-rights [attr.title]=\"'nh-assistant.tool-call.grant-source.' + proposal.grantSource + '-hint' | translate\">\n {{ rightsKey | translate }}\n </span>\n } @else if (proposal.grantSource !== 'none') {\n <span class=\"badge\" [attr.title]=\"'nh-assistant.tool-call.grant-source.' + proposal.grantSource + '-hint' | translate\">\n {{ 'nh-assistant.tool-call.grant-source.' + proposal.grantSource | translate }}\n </span>\n }\n @if (proposal.consultationId) {\n <span class=\"badge\" [attr.title]=\"'nh-assistant.agent-runs.proposal.from-consultation-hint' | translate\">\n {{ 'nh-assistant.agent-runs.proposal.from-consultation' | translate }}\n </span>\n }\n </div>\n @if (proposal.consultationId && (proposal.initiatorActorId || proposal.consultationRoute)) {\n <!-- Who asked through the consultation, and who decides it with whose rights. -->\n <p class=\"consultation-route\" data-consultation-route [attr.data-route]=\"proposal.consultationRoute ?? null\">\n @if (proposal.initiatorActorId; as asker) {\n <span data-consultation-asker>{{ 'nh-assistant.agent-runs.proposal.consultation.asked-by' | translate: { name: ('nh-assistant.account-id' | translate: { id: asker }) } }}</span>\n }\n @if (proposal.consultationRoute; as route) {\n <span>{{ 'nh-assistant.agent-runs.proposal.consultation.route.' + route | translate }}</span>\n }\n </p>\n }\n @if (proposal.placedBy; as origin) {\n @let placedBy = originText(origin);\n <p class=\"placed-by\">\n <span>{{ placedBy.key | translate: placedBy.params }}</span>\n <button\n class=\"text-button\"\n type=\"button\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.proposal.placed-by.open-label' | translate\"\n (click)=\"openConversation.emit(origin.conversationId)\">\n {{ 'nh-assistant.agent-runs.proposal.placed-by.open' | translate }}\n </button>\n </p>\n }\n @if (proposal.presentation; as presentation) {\n <p class=\"summary\">{{ presentation.summary }}</p>\n @if (presentation.fields.length > 0) {\n <dl class=\"presentation-fields\">\n @for (field of presentation.fields; track $index) {\n <div>\n <dt>{{ field.label }}</dt>\n <dd>{{ field.value }}</dd>\n </div>\n }\n </dl>\n }\n @if (presentation.notice) {\n <p class=\"message warning\">{{ presentation.notice }}</p>\n }\n } @else {\n <p class=\"summary\">{{ 'nh-assistant.approval.fallback-summary' | translate }}</p>\n }\n @if (proposal.rationale) {\n <p class=\"rationale\">{{ 'nh-assistant.approval.rationale' | translate: { rationale: proposal.rationale } }}</p>\n }\n @if (proposal.status === 'stale' && proposal.staleExplanation) {\n <p class=\"message stale-explanation\">{{ proposal.staleExplanation }}</p>\n }\n @if (hasSuccessor(proposal)) {\n <button class=\"text-button\" type=\"button\" (click)=\"showSuccessor(proposal)\">\n {{ 'nh-assistant.agent-runs.proposal.show-successor' | translate }}\n </button>\n }\n @if (isHeld(proposal)) {\n <div class=\"closed-card\">\n <p class=\"muted\" role=\"status\">{{ 'nh-assistant.agent-runs.proposal.closed' | translate }}</p>\n <button\n class=\"text-button\"\n type=\"button\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.proposal.dismiss-label' | translate: { summary: proposal.presentation?.summary ?? proposal.toolId }\"\n (click)=\"dismiss(proposal)\">\n {{ 'nh-assistant.agent-runs.proposal.dismiss' | translate }}\n </button>\n </div>\n }\n <details class=\"technical-details\">\n <summary>{{ 'nh-assistant.approval.technical-details' | translate }}</summary>\n <p class=\"label\">{{ 'nh-assistant.approval.tool-id' | translate }}</p>\n <code>{{ proposal.toolId }}</code>\n @if (proposal.targets.length > 0) {\n <p class=\"label\">{{ 'nh-assistant.approval.targets' | translate }}</p>\n <ul class=\"targets\">\n @for (target of proposal.targets; track $index) {\n <li>{{ target }}</li>\n }\n </ul>\n }\n @if (proposal.argumentsPreview) {\n <p class=\"label\">{{ 'nh-assistant.approval.arguments' | translate }}</p>\n <pre>{{ proposal.argumentsPreview }}</pre>\n }\n </details>\n <div class=\"meta\">\n @if (proposal.status === 'pending') {\n <span>{{ 'nh-assistant.agent-runs.proposal.expires' | translate: { date: (proposal.expiresAt | date: 'short') } }}</span>\n }\n @if (proposal.decidedByActorId) {\n <span\n data-proposal-decided-by\n [attr.title]=\"proposal.decidedByDisplayName ? ('nh-assistant.account-id-title' | translate: { id: proposal.decidedByActorId }) : null\">{{ 'nh-assistant.agent-runs.proposal.decided-by' | translate: { actor: proposal.decidedByDisplayName || ('nh-assistant.account-id' | translate: { id: proposal.decidedByActorId }) } }}</span>\n }\n @if (proposal.status === 'stale' && proposal.staleByActorId) {\n <span\n data-proposal-stale-by\n [attr.title]=\"proposal.staleByDisplayName ? ('nh-assistant.account-id-title' | translate: { id: proposal.staleByActorId }) : null\">{{ 'nh-assistant.agent-runs.proposal.stale-by' | translate: { actor: proposal.staleByDisplayName || ('nh-assistant.account-id' | translate: { id: proposal.staleByActorId }) } }}</span>\n }\n @if (proposal.executionResultCode; as code) {\n <span class=\"mono\">{{ code }}</span>\n }\n @if (proposal.feedback; as given) {\n <span>\n {{ 'nh-assistant.agent-runs.proposal.your-feedback' | translate: { category: ('nh-assistant.proposal-feedback.categories.' + given.category | translate) } }}\n </span>\n }\n @if (proposal.canGiveFeedback && !isAsking(proposal)) {\n <button\n class=\"text-button\"\n type=\"button\"\n [attr.data-feedback-approval]=\"proposal.approvalId\"\n [disabled]=\"busy()\"\n (click)=\"giveFeedback(proposal)\">\n {{ (proposal.feedback ? 'nh-assistant.agent-runs.proposal.change-feedback' : 'nh-assistant.agent-runs.proposal.give-feedback') | translate }}\n </button>\n }\n </div>\n @if (inCard(proposal) && feedback(); as request) {\n <nh-assistant-proposal-feedback\n [approvalIds]=\"request.approvalIds\"\n [initial]=\"request.initial\"\n (saved)=\"onFeedbackSaved()\"\n (dismissed)=\"onFeedbackDismissed()\" />\n }\n @if (waitsForAsker(proposal)) {\n <p class=\"waiting-for\" data-waiting-for-asker>\n <nh-assistant-icon name=\"users\" />{{ 'nh-assistant.agent-runs.proposal.consultation.waiting-for-asker' | translate: { name: (proposal.initiatorActorId ? ('nh-assistant.account-id' | translate: { id: proposal.initiatorActorId }) : ('nh-assistant.agent-runs.proposal.consultation.the-asker' | translate)) } }}\n </p>\n } @else if (waitingForKey(proposal); as waitingFor) {\n <p class=\"waiting-for\"><nh-assistant-icon name=\"users\" />{{ waitingFor | translate }}</p>\n }\n @if (proposal.status === 'pending' && mayDecide(proposal)) {\n <div class=\"card-actions\">\n <button class=\"primary\" type=\"button\" [disabled]=\"busy()\" (click)=\"decide(proposal, 'approve')\">\n <nh-assistant-icon name=\"check\" />{{ 'nh-assistant.agent-runs.proposal.approve' | translate }}\n </button>\n <button class=\"secondary\" type=\"button\" [disabled]=\"busy()\" (click)=\"decide(proposal, 'reject')\">\n <nh-assistant-icon name=\"x\" />{{ 'nh-assistant.agent-runs.proposal.reject' | translate }}\n </button>\n </div>\n }\n @if (proposal.status === 'execution-unknown' && mayDecide(proposal)) {\n <p class=\"message warning\"><nh-assistant-icon name=\"warning\" />{{ 'nh-assistant.agent-runs.proposal.unknown-hint' | translate }}</p>\n <div class=\"card-actions\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"busy()\" (click)=\"resolve(proposal, 'mark-resolved')\">\n <nh-assistant-icon name=\"check\" />{{ 'nh-assistant.agent-runs.proposal.mark-resolved' | translate }}\n </button>\n <button class=\"danger\" type=\"button\" [disabled]=\"busy()\" (click)=\"resolve(proposal, 're-execute')\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.proposal.re-execute' | translate }}\n </button>\n </div>\n }\n </li>\n </ng-template>\n</div>\n","import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n viewChild\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentInbox,\n AgentInboxGroup,\n AgentProposal,\n NhAssistantAgentRunApiService,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵnhAssistantWatchAgentWork as nhAssistantWatchAgentWork\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantAgentProposalsComponent } from './nh-assistant-agent-proposals.component';\n\n/**\n * The approval inbox: pending agent proposals across subjects that the signed-in person may\n * decide, earliest expiry first. Proposals are decided in place, one by one or together; the\n * server checks each decision against the proposal's approval policy again. After a rejection the\n * inbox asks, optionally, what was wrong, also when the rejected proposals have left the list.\n * With live updates the inbox reloads by itself when agent work changes, for example when a\n * colleague decided a proposal or a run proposed a new one; it watches the work of agents for the\n * whole application, whose approvers are no members of it, while it is shown. A proposal that closes because it no\n * longer fits, for example because someone did the work by hand, stays as a closed card with the\n * reason until it is dismissed. A proposal a run placed at its object from another subject, such as a\n * run for the whole application, names that run; `openConversation` emits its conversation.\n *\n * `agentId`, `subjectType`, `divisionId` and `runId` filter the inbox; changing a filter, or `grouped`,\n * reloads it from the first page. With `grouped` the inbox shows the proposals per parent, such as a\n * project with its own proposals and those of its tasks, and per subject, optionally per run\n * (`groupByRun`); a group that goes on on another page says so, and \"Select group\" selects only its\n * proposals shown here. With `markNew` (on by default) it marks the proposals made since the person's\n * last visit of the inbox in its scope, the whole application or the division of `divisionId`, and\n * those that arrive while it is shown; with `recordVisit` (on by default) showing it records the\n * visit. Turn `recordVisit` off for an inbox that shows only part of the scope, such as one agent's\n * proposals, so the person's next visit of the whole inbox still marks what they have not seen.\n */\n@Component({\n selector: 'nh-assistant-agent-inbox',\n standalone: true,\n imports: [DatePipe, TranslatePipe, NhAssistantIconComponent, NhAssistantAgentProposalsComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-inbox.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentInboxComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly proposalList = viewChild(NhAssistantAgentProposalsComponent);\n private subscription?: Subscription;\n private visitSubscription?: Subscription;\n /** The scope whose visit this view recorded; the visit is recorded once per scope shown. */\n private visited: string | null = null;\n /**\n * What the first read of the shown scope found: the visit before this one and the proposals that\n * were new since. Later reads, after live updates, paging or a decision, compare with both, so what\n * was new when the inbox was opened stays new while it is shown.\n */\n private opened: { scopeKey: string; previousVisit: string | null; newIds: Set<string> } | null = null;\n\n /** Limits the inbox to one agent. */\n readonly agentId = input<string | undefined>(undefined);\n /** Limits the inbox to one kind of subject, for example `project`. */\n readonly subjectType = input<string | undefined>(undefined);\n /**\n * Limits the inbox to the subjects of one division, for example the active division; its visits are\n * then those of that division.\n */\n readonly divisionId = input<string | null | undefined>(undefined);\n /** Limits the inbox to the proposals of one run. */\n readonly runId = input<string | null | undefined>(undefined);\n /** Groups the proposals per parent and subject instead of listing them by expiry alone. */\n readonly grouped = input(false);\n /** In a grouped inbox, also shows a header per run within a subject. */\n readonly groupByRun = input(false);\n /** Marks the proposals made since the person's last visit of the inbox, and those that arrive while it is shown. */\n readonly markNew = input(true);\n /** Records the person's visit of the inbox in its scope when it is shown. */\n readonly recordVisit = input(true);\n readonly itemsPerPage = input(20);\n /**\n * Emits the conversation of the run that placed a proposal at its object from another subject, so\n * the host opens it, for example in the assistant panel.\n */\n readonly openConversation = output<string>();\n\n readonly page = signal(1);\n readonly loading = signal(true);\n /** True after the first successful load; later loads keep the list, and an open feedback question, in place. */\n readonly loaded = signal(false);\n readonly loadFailed = signal(false);\n readonly items = signal<AgentProposal[]>([]);\n readonly total = signal(0);\n /** The groups of the page in a grouped inbox; `null` for the flat inbox. */\n readonly groups = signal<AgentInboxGroup[] | null>(null);\n /** The proposals of the page marked as new. */\n readonly newIds = signal<ReadonlySet<string>>(new Set());\n /**\n * The person's visit of the shown scope before the inbox was opened: `null` before their first\n * visit, `undefined` while unknown or when new proposals are not marked.\n */\n readonly previousVisit = signal<string | null | undefined>(undefined);\n readonly pages = computed(() => Math.max(1, Math.ceil(this.total() / this.itemsPerPage())));\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.visitSubscription?.unsubscribe();\n });\n effect(() => {\n this.agentId();\n this.subjectType();\n this.divisionId();\n this.runId();\n this.grouped();\n untracked(() => {\n this.page.set(1);\n this.load();\n });\n });\n // Any agent's work may add, decide or close a proposal of this inbox, also work for the whole\n // application, which reaches the approvers only while they watch it.\n nhAssistantWatchAgentWork();\n nhAssistantReloadOnAgentWork(() => true, () => this.refresh());\n }\n\n load(): void {\n this.fetch(false);\n }\n\n goTo(page: number): void {\n this.page.set(Math.min(Math.max(1, page), this.pages()));\n this.load();\n }\n\n /**\n * Reloads after a live update. Once the inbox is shown it reloads quietly: no loading state, and\n * a failure keeps the list and an open feedback question in place. While a decision of the list\n * is in flight it waits, because the decision reloads the inbox when it ends.\n */\n private refresh(): void {\n if (this.proposalList()?.busy()) {\n return;\n }\n\n this.fetch(this.loaded() && !this.loading() && !this.loadFailed());\n }\n\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n const divisionId = this.divisionId() ?? null;\n this.subscription?.unsubscribe();\n this.subscription = this.api\n .getInbox({\n agentId: this.agentId(),\n subjectType: this.subjectType(),\n divisionId: divisionId ?? undefined,\n runId: this.runId() ?? undefined,\n // Only a grouped inbox asks for groups, so the requests of a flat inbox stay as they were.\n grouped: this.grouped() || undefined,\n page: this.page(),\n itemsPerPage: this.itemsPerPage()\n })\n .subscribe({\n next: inbox => {\n const lastPage = Math.max(1, Math.ceil(inbox.total / this.itemsPerPage()));\n if (inbox.items.length === 0 && this.page() > lastPage) {\n // Proposals were decided elsewhere and this page no longer exists.\n this.page.set(lastPage);\n this.fetch(quiet);\n return;\n }\n\n const previous = this.items();\n this.items.set(inbox.items);\n this.groups.set(this.grouped() ? inbox.groups ?? null : null);\n this.markNewOf(inbox);\n if (quiet) {\n this.proposalList()?.holdClosed(previous, inbox.items);\n }\n this.total.set(inbox.total);\n this.loading.set(false);\n this.loadFailed.set(false);\n this.loaded.set(true);\n this.recordVisitOf(inbox, divisionId);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n\n /**\n * Marks what is new: what the server marks since the visit this view recorded, and what was made\n * after the person's visit before the inbox was opened, on any page. Before the first visit\n * everything is new. A server without visits marks nothing.\n */\n private markNewOf(inbox: AgentInbox): void {\n if (!this.markNew() || inbox.newApprovalIds === undefined) {\n this.newIds.set(new Set());\n this.previousVisit.set(undefined);\n return;\n }\n\n const scopeKey = inbox.scopeKey ?? 'global';\n if (this.opened?.scopeKey !== scopeKey) {\n this.opened = { scopeKey, previousVisit: inbox.lastVisitedAt ?? null, newIds: new Set() };\n }\n\n const opened = this.opened;\n const before = opened.previousVisit === null ? null : Date.parse(opened.previousVisit);\n for (const id of inbox.newApprovalIds) {\n opened.newIds.add(id);\n }\n for (const proposal of inbox.items) {\n if (before === null || Date.parse(proposal.createdAt) > before) {\n opened.newIds.add(proposal.approvalId);\n }\n }\n\n this.previousVisit.set(opened.previousVisit);\n this.newIds.set(new Set(inbox.items\n .filter(proposal => opened.newIds.has(proposal.approvalId))\n .map(proposal => proposal.approvalId)));\n }\n\n /**\n * Records the visit of the shown scope after its first read, so that read still marks what arrived\n * since the visit before.\n */\n private recordVisitOf(inbox: AgentInbox, divisionId: string | null): void {\n const scopeKey = inbox.scopeKey;\n if (!this.recordVisit() || scopeKey === undefined || this.visited === scopeKey) {\n return;\n }\n\n this.visited = scopeKey;\n this.visitSubscription?.unsubscribe();\n // A visit that cannot be recorded only means the next visit shows more as new.\n this.visitSubscription = this.api.visitInbox(divisionId).subscribe({ error: () => undefined });\n }\n}\n","<section class=\"section\" aria-labelledby=\"nh-assistant-agent-inbox-title\" [attr.aria-busy]=\"loading()\">\n <header class=\"section-header\">\n <div>\n <h3 id=\"nh-assistant-agent-inbox-title\">{{ 'nh-assistant.agent-runs.inbox.title' | translate }}</h3>\n <!-- The order the description names follows the view: groups by their first expiry, or proposals by expiry. -->\n <p class=\"muted\" data-inbox-description>{{ (grouped() ? 'nh-assistant.agent-runs.inbox.description-grouped' : 'nh-assistant.agent-runs.inbox.description') | translate }}</p>\n @if (items().length > 0) {\n @if (previousVisit(); as visitedAt) {\n <p class=\"muted\" data-inbox-last-visit>{{ 'nh-assistant.agent-runs.inbox.last-visit' | translate: { date: (visitedAt | date: 'medium') } }}</p>\n } @else if (previousVisit() === null) {\n <p class=\"muted\" data-inbox-first-visit>{{ 'nh-assistant.agent-runs.inbox.first-visit' | translate }}</p>\n }\n }\n </div>\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </header>\n\n @if (loading() && items().length === 0 && !loaded()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else {\n <!-- Stays rendered when the list empties, so the optional feedback after a rejection remains. -->\n <nh-assistant-agent-proposals\n [proposals]=\"items()\"\n [canDecide]=\"true\"\n [selectable]=\"true\"\n [holdClosedCards]=\"true\"\n [groups]=\"groups()\"\n [groupByRun]=\"groupByRun()\"\n [newIds]=\"newIds()\"\n (changed)=\"load()\"\n (openConversation)=\"openConversation.emit($event)\" />\n @if (items().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.inbox.empty' | translate }}</p>\n }\n @if (pages() > 1) {\n <nav class=\"toolbar\" [attr.aria-label]=\"'nh-assistant.agent-runs.inbox.pages' | translate\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"page() <= 1 || loading()\" (click)=\"goTo(page() - 1)\">\n {{ 'nh-assistant.agent-runs.inbox.previous' | translate }}\n </button>\n <span class=\"muted\">{{ 'nh-assistant.agent-runs.inbox.page' | translate: { page: page(), pages: pages() } }}</span>\n <button class=\"secondary\" type=\"button\" [disabled]=\"page() >= pages() || loading()\" (click)=\"goTo(page() + 1)\">\n {{ 'nh-assistant.agent-runs.inbox.next' | translate }}\n </button>\n </nav>\n }\n }\n</section>\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport {\n AgentTriggerOutcome,\n AgentTriggerReceipt,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe\n} from '@newheap/platform-ai-chat';\n\n/**\n * How a start by hand reads: `success` when a run started or will start after the current one,\n * `warning` while the agent or its skill is paused (`waiting`), and `info` when nothing started yet\n * for another reason (`deferred` until the application's change is saved, `ignored`).\n */\nexport type NhAssistantRunReceiptTone = 'success' | 'warning' | 'info';\n\n/** The tone of a receipt's outcome (internal). */\nexport function nhAssistantRunReceiptTone(outcome: AgentTriggerOutcome): NhAssistantRunReceiptTone {\n switch (outcome) {\n case 'waiting':\n return 'warning';\n case 'deferred':\n case 'ignored':\n return 'info';\n default:\n return 'success';\n }\n}\n\n/**\n * The receipt of a start by hand (internal): what happens now, in the presentation its outcome\n * needs. A paused agent or skill reads as a warning with the reason the server named, never as a\n * started run.\n */\n@Component({\n selector: 'nh-assistant-run-receipt',\n standalone: true,\n imports: [NhAssistantTranslatePipe, NhAssistantIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <p\n class=\"message\"\n role=\"status\"\n [class.success]=\"tone() === 'success'\"\n [class.warning]=\"tone() === 'warning'\"\n [class.info]=\"tone() === 'info'\"\n [attr.data-outcome]=\"receipt().outcome\"\n [attr.data-receipt-focus]=\"focusable() ? '' : null\"\n [attr.tabindex]=\"focusable() ? -1 : null\">\n <nh-assistant-icon [name]=\"icon()\" />\n <span>{{ keys() | nhAssistantTranslate: receipt().outcome }}</span>\n </p>\n `,\n styleUrl: './nh-assistant-run-receipt.component.scss'\n})\nexport class NhAssistantRunReceiptComponent {\n readonly receipt = input.required<AgentTriggerReceipt>();\n /** The receipt takes the focus after the start, as in the run-now dialog. */\n readonly focusable = input(false);\n\n readonly tone = computed(() => nhAssistantRunReceiptTone(this.receipt().outcome));\n readonly icon = computed(() => {\n switch (this.tone()) {\n case 'warning':\n return 'warning' as const;\n case 'info':\n return 'clock' as const;\n default:\n return 'check' as const;\n }\n });\n /** The text of the reason a waiting start names first, then the text of its outcome. */\n readonly keys = computed(() => {\n const receipt = this.receipt();\n const outcomeKey = `nh-assistant.agent-runs.thread.outcome.${receipt.outcome}`;\n return receipt.outcome === 'waiting' && receipt.reasonCode\n ? [`nh-assistant.agent-runs.thread.waiting.${receipt.reasonCode}`, outcomeKey]\n : [outcomeKey];\n });\n}\n","import { DatePipe, DOCUMENT } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, computed, effect, inject, input, signal, untracked } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentArtifact,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\n\n/**\n * The files the agent's tools saved in a thread, every version newest first. Files of the\n * agent's own grant that the viewer may not read are listed as shielded and cannot be downloaded.\n * With live updates the list reloads by itself when a run or proposal of the thread changes.\n */\n@Component({\n selector: 'nh-assistant-agent-artifacts',\n standalone: true,\n imports: [DatePipe, TranslatePipe, NhAssistantTranslatePipe, NhAssistantIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-artifacts.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentArtifactsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly document = inject(DOCUMENT);\n private subscription?: Subscription;\n\n readonly conversationId = input.required<string>();\n\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n /** Why the latest download failed, as a code and translation key; `null` after one that worked. */\n readonly downloadError = signal<NhAssistantError | null>(null);\n /** Whether the latest download failed. */\n readonly downloadFailed = computed(() => this.downloadError() !== null);\n /** The text of the download's failure, then the text that a file could not be downloaded. */\n readonly downloadErrorKeys = computed(() => {\n const keys = nhAssistantErrorKeys(this.downloadError());\n return keys.length > 0 ? [...keys.slice(0, -1), 'nh-assistant.agent-runs.artifacts.download-failed'] : [];\n });\n readonly artifacts = signal<AgentArtifact[]>([]);\n readonly downloadingId = signal<string | null>(null);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.conversationId();\n untracked(() => this.load());\n });\n nhAssistantReloadOnAgentWork(\n change => change.conversationId === this.conversationId() && change.reason !== 'feedback',\n () => this.fetch(!this.loading() && !this.loadFailed())\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n async download(artifact: AgentArtifact): Promise<void> {\n this.downloadingId.set(artifact.id);\n this.downloadError.set(null);\n try {\n const blob = await this.api.downloadArtifact(this.conversationId(), artifact.id);\n const url = URL.createObjectURL(blob);\n const link = this.document.createElement('a');\n link.href = url;\n link.download = `${artifact.name}-v${artifact.version}`;\n link.click();\n URL.revokeObjectURL(url);\n } catch (error) {\n this.downloadError.set(toNhAssistantError(error));\n } finally {\n this.downloadingId.set(null);\n }\n }\n\n /** A quiet load, after a live update, shows no loading state and keeps the files when it fails. */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getArtifacts(this.conversationId()).subscribe({\n next: artifacts => {\n this.artifacts.set(artifacts);\n this.loading.set(false);\n this.loadFailed.set(false);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","@if (downloadError(); as failure) {\n <p class=\"message error\" role=\"alert\" data-download-error><nh-assistant-icon name=\"warning\" />{{ downloadErrorKeys() | nhAssistantTranslate: failure.code }}</p>\n}\n\n@if (loading()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n} @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n} @else if (artifacts().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.artifacts.empty' | translate }}</p>\n} @else {\n <ul class=\"cards\">\n @for (artifact of artifacts(); track artifact.id) {\n <li class=\"card\">\n <div class=\"card-header\">\n <strong>{{ artifact.name }}</strong>\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.artifacts.version' | translate: { version: artifact.version } }}</span>\n @if (artifact.restricted) {\n <span class=\"badge warning\">{{ 'nh-assistant.agent-runs.artifacts.restricted' | translate }}</span>\n }\n </div>\n <div class=\"meta\">\n <span class=\"mono\">{{ artifact.contentType }}</span>\n <span>{{ 'nh-assistant.agent-runs.artifacts.size' | translate: { size: artifact.sizeBytes } }}</span>\n <span>{{ artifact.createdAt | date: 'short' }}</span>\n </div>\n @if (!artifact.restricted) {\n <div class=\"card-actions\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"downloadingId() !== null\" (click)=\"download(artifact)\">\n <nh-assistant-icon name=\"page\" />{{ 'nh-assistant.agent-runs.artifacts.download' | translate }}\n </button>\n </div>\n }\n </li>\n }\n </ul>\n}\n","import { DatePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, input, signal, untracked } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentConsultation,\n NhAssistantAgentRunApiService,\n NhAssistantConsultationRoute,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe\n} from '@newheap/platform-ai-chat';\n\n/** The routes in the order the list names them. */\nconst routeOrder: readonly NhAssistantConsultationRoute[] = ['asker-decides', 'subject-agent-rights', 'subject-asker-rights'];\n\n/**\n * Who consulted the thread's agent through another assistant, newest first: the person whose rights\n * were used, the asking assistant, the outcome, the usage and the proposals it left, with their\n * number per route. The question and the answer stay in the asking conversation and are never shown\n * here. With live updates the list reloads by itself when a run or proposal of the thread changes.\n */\n@Component({\n selector: 'nh-assistant-agent-consultations',\n standalone: true,\n imports: [DatePipe, TranslatePipe, NhAssistantTranslatePipe, NhAssistantIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-consultations.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentConsultationsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private subscription?: Subscription;\n\n readonly conversationId = input.required<string>();\n\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly consultations = signal<AgentConsultation[]>([]);\n readonly total = signal(0);\n readonly codeKeys = nhAssistantCodeKeys;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.conversationId();\n untracked(() => this.load());\n });\n nhAssistantReloadOnAgentWork(\n change => change.conversationId === this.conversationId() && change.reason !== 'feedback',\n () => this.fetch(!this.loading() && !this.loadFailed())\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /** The proposals the consultation left per route, in a fixed order; routes without proposals are left out. */\n routeCounts(consultation: AgentConsultation): { route: NhAssistantConsultationRoute; count: number }[] {\n const byRoute = consultation.proposalsByRoute ?? {};\n return routeOrder\n .map(route => ({ route, count: byRoute[route] ?? 0 }))\n .filter(item => item.count > 0);\n }\n\n /** A quiet load, after a live update, shows no loading state and keeps the list when it fails. */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getConsultations(this.conversationId()).subscribe({\n next: list => {\n this.consultations.set(list.items);\n this.total.set(list.total);\n this.loading.set(false);\n this.loadFailed.set(false);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","@if (loading() && consultations().length === 0) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n} @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n} @else if (consultations().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.consultation.empty' | translate }}</p>\n} @else {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.consultation.private' | translate }}</p>\n <ol class=\"cards\" [attr.aria-label]=\"'nh-assistant.agent-runs.thread.tabs.consultations' | translate\">\n @for (consultation of consultations(); track consultation.id) {\n <li class=\"card\">\n <div class=\"card-header\">\n <strong>{{ consultation.createdAt | date: 'short' }}</strong>\n <span\n class=\"badge\"\n [class.success]=\"consultation.status === 'completed'\"\n [class.warning]=\"consultation.status === 'running'\"\n [class.danger]=\"consultation.status === 'failed'\">\n {{ 'nh-assistant.agent-runs.consultation.status.' + consultation.status | translate }}\n </span>\n <span\n data-consultation-asker\n [attr.title]=\"consultation.askerDisplayName ? ('nh-assistant.account-id-title' | translate: { id: consultation.askerActorId }) : null\">\n {{ 'nh-assistant.agent-runs.consultation.asked-by' | translate: { name: consultation.askerDisplayName ?? ('nh-assistant.account-id' | translate: { id: consultation.askerActorId }) } }}\n @if (consultation.askingAgentId; as agentId) {\n {{ 'nh-assistant.agent-runs.consultation.through' | translate: { agent: (['nh-assistant.agents.' + agentId + '.name'] | nhAssistantTranslate: agentId) } }}\n }\n </span>\n @if (consultation.depth > 1) {\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.consultation.depth' | translate: { depth: consultation.depth } }}</span>\n }\n </div>\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.run.tool-calls' | translate: { count: consultation.toolCalls } }}</span>\n <span>{{ 'nh-assistant.agent-runs.run.tokens' | translate: { count: consultation.inputTokens + consultation.outputTokens } }}</span>\n <span>{{ 'nh-assistant.agent-runs.run.proposals' | translate: { count: consultation.proposalCount } }}</span>\n @let counts = routeCounts(consultation);\n @if (counts.length > 0) {\n <span class=\"consultation-routes\" data-consultation-routes>\n @for (item of counts; track item.route) {\n <span\n class=\"badge\"\n [attr.data-route]=\"item.route\"\n [attr.title]=\"'nh-assistant.agent-runs.proposal.consultation.route.' + item.route | translate\">\n {{ 'nh-assistant.agent-runs.consultation.routes.' + item.route | translate: { count: item.count } }}\n </span>\n }\n </span>\n }\n @if (consultation.failureCode; as code) {\n <span><nh-assistant-icon name=\"warning\" />{{ codeKeys(code) | nhAssistantTranslate: code }}</span>\n }\n </div>\n </li>\n }\n </ol>\n @if (total() > consultations().length) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.consultation.more' | translate: { count: total() - consultations().length } }}</p>\n }\n}\n","import { DatePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, computed, effect, inject, input, signal, untracked } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentThreadMemory,\n NhAssistantAgentRunApiService,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork\n} from '@newheap/platform-ai-chat';\n\n/**\n * The working memory of an agent about the subject of a thread, read-only. The agent keeps it\n * up to date itself; it is shown so that people can see what the agent remembers. With live\n * updates it reloads by itself when a run of the thread changes.\n */\n@Component({\n selector: 'nh-assistant-agent-memory',\n standalone: true,\n imports: [DatePipe, TranslatePipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-memory.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentMemoryComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private subscription?: Subscription;\n\n readonly conversationId = input.required<string>();\n\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly memory = signal<AgentThreadMemory | null>(null);\n readonly formatted = computed(() => {\n const value = this.memory()?.memory;\n return value === null || value === undefined ? null : JSON.stringify(value, null, 2);\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.conversationId();\n untracked(() => this.load());\n });\n // Only runs write the working memory.\n nhAssistantReloadOnAgentWork(\n change => change.conversationId === this.conversationId() && change.reason === 'run',\n () => this.fetch(!this.loading() && !this.loadFailed())\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /** A quiet load, after a live update, shows no loading state and keeps the memory when it fails. */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getMemory(this.conversationId()).subscribe({\n next: memory => {\n this.memory.set(memory);\n this.loading.set(false);\n this.loadFailed.set(false);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","@if (loading()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n} @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n} @else if (!memory()?.configured) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.memory.not-configured' | translate }}</p>\n} @else if (formatted(); as json) {\n <div class=\"section\">\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.memory.version' | translate: { version: memory()!.schemaVersion } }}</span>\n @if (memory()!.updatedAt; as updatedAt) {\n <span>{{ 'nh-assistant.agent-runs.memory.updated' | translate: { date: (updatedAt | date: 'short') } }}</span>\n }\n </div>\n <pre [attr.aria-label]=\"'nh-assistant.agent-runs.thread.tabs.memory' | translate\">{{ json }}</pre>\n </div>\n} @else {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.memory.empty' | translate }}</p>\n}\n","import { DatePipe, DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription, forkJoin } from 'rxjs';\nimport {\n AgentArtifact,\n AgentProposalDecisionRight,\n AgentRunResult,\n NH_ASSISTANT_MAX_PROPOSAL_LOOKUP,\n NhAssistantAgentRunApiService,\n NhAssistantApiError,\n NhAssistantError,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantMarkdownPipe as NhAssistantMarkdownPipe,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantSubjectLinkComponent as NhAssistantSubjectLinkComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantAgentProposalsComponent } from './nh-assistant-agent-proposals.component';\n\nlet nextId = 0;\n\n/** How long a run took, for people to read: a text key and its number. */\ninterface RunDuration {\n key: string;\n value: number;\n}\n\n/**\n * One run of an agent with its result: what it worked on, how it was started and ended, its usage\n * and duration, its whole answer, the proposals it made (also those it placed at other objects the\n * reader may read) and the files it saved. The answer is model output: it is rendered with the\n * assistant's safe Markdown rendering, which shows inline HTML as text and keeps only a strict set\n * of tags and links, never as HTML. The server decides who sees a run (`GET runs/{id}`): readers of\n * its object, for the whole application the agent's view policy, administrators every run. The\n * thread view's run timeline and the administration's runs view open it; an application may show\n * it anywhere with a run id. With live updates it reloads by itself while the run works.\n *\n * The run's pending proposals that the reader may decide, by the same live check as the inbox and the\n * subject's work (`POST approvals/lookup`), can be decided in place, one by one or selected together\n * with \"Select all\"; a pending proposal the reader may not decide says who does, and a reader who may\n * decide none sees no selection. After a rejection the list asks, optionally, what was wrong, and a\n * proposal refused because it no longer fits stays as a closed card with the reason until dismissed.\n */\n@Component({\n selector: 'nh-assistant-run-result',\n standalone: true,\n imports: [\n DatePipe,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantMarkdownPipe,\n NhAssistantSubjectLinkComponent,\n NhAssistantAgentProposalsComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-run-result.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantRunResultComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly document = inject(DOCUMENT);\n private subscription?: Subscription;\n private rightsSubscription?: Subscription;\n\n /** The run to show. */\n readonly runId = input.required<string>();\n /**\n * Whether to offer the run's conversation; leave it off where that conversation is already shown,\n * as in its thread's run timeline.\n */\n readonly conversationLink = input(true);\n /** Emits the run's thread conversation, or the one of a run that placed a proposal, so the host can open it. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-run-result-${nextId++}`;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n /** The run does not exist or the reader may not see it. */\n readonly notFound = signal(false);\n readonly detail = signal<AgentRunResult | null>(null);\n readonly downloadingId = signal<string | null>(null);\n /** Why the latest download failed, as a code and translation key; `null` after one that worked. */\n readonly downloadError = signal<NhAssistantError | null>(null);\n /** Whether the latest download failed. */\n readonly downloadFailed = computed(() => this.downloadError() !== null);\n /** The text of the download's failure, then the text that a file could not be downloaded. */\n readonly downloadErrorKeys = computed(() => {\n const keys = nhAssistantErrorKeys(this.downloadError());\n return keys.length > 0 ? [...keys.slice(0, -1), 'nh-assistant.agent-runs.artifacts.download-failed'] : [];\n });\n readonly codeKeys = nhAssistantCodeKeys;\n /**\n * The reader's live right to decide each pending proposal of the run, by approval id; `null` until\n * it is known, when nobody may decide.\n */\n readonly rights = signal<ReadonlyMap<string, AgentProposalDecisionRight> | null>(null);\n /** Whether the reader may decide at least one of the run's proposals: only then can they select. */\n readonly decidable = computed(() => [...(this.rights()?.values() ?? [])].some(right => right.canDecide));\n readonly duration = computed(() => {\n const run = this.detail()?.run;\n return run ? durationOf(run.startedAt, run.endedAt) : null;\n });\n readonly tokens = computed(() => {\n const run = this.detail()?.run;\n return run ? run.inputTokens + run.outputTokens : 0;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.rightsSubscription?.unsubscribe();\n });\n effect(() => {\n this.runId();\n untracked(() => this.fetch(false));\n });\n nhAssistantReloadOnAgentWork(\n change => change.runId === this.runId() || change.conversationId === this.detail()?.run.conversationId,\n () => this.fetch(true)\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /** A proposal was decided or its feedback given: the run's proposals and the rights are read again. */\n onProposalsChanged(): void {\n this.fetch(true);\n }\n\n async download(artifact: AgentArtifact): Promise<void> {\n this.downloadingId.set(artifact.id);\n this.downloadError.set(null);\n try {\n const blob = await this.api.downloadRunArtifact(this.runId(), artifact.id);\n const url = URL.createObjectURL(blob);\n const link = this.document.createElement('a');\n link.href = url;\n link.download = `${artifact.name}-v${artifact.version}`;\n link.click();\n URL.revokeObjectURL(url);\n } catch (error) {\n this.downloadError.set(toNhAssistantError(error));\n } finally {\n this.downloadingId.set(null);\n }\n }\n\n /**\n * Reads the reader's live right to decide each pending proposal of the run, as the server checks it\n * for every decision. Without an answer nobody may decide here; the server checks again anyway.\n */\n private readRights(detail: AgentRunResult): void {\n this.rightsSubscription?.unsubscribe();\n const batches = pendingBatches(detail);\n if (batches.length === 0) {\n this.rights.set(new Map());\n return;\n }\n\n this.rightsSubscription = forkJoin(batches.map(batch => this.api.lookupProposals(batch))).subscribe({\n next: lookups => this.rights.set(new Map(lookups\n .flatMap(lookup => lookup.items)\n .map(item => [item.proposal.approvalId, { canDecide: item.canDecide, reasonCode: item.reasonCode }] as const))),\n error: () => this.rights.set(new Map())\n });\n }\n\n /**\n * Reads the run. A quiet reload, after a live update, keeps what is shown when it fails and shows\n * no loading state.\n */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.notFound.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getRunResult(this.runId()).subscribe({\n next: detail => {\n this.detail.set(detail);\n this.loading.set(false);\n this.loadFailed.set(false);\n this.notFound.set(false);\n this.readRights(detail);\n },\n error: (failure: unknown) => {\n if (quiet && this.detail() !== null) {\n return;\n }\n this.detail.set(null);\n this.loading.set(false);\n const missing = failure instanceof NhAssistantApiError && failure.code === 'assistant-run-not-found';\n this.notFound.set(missing);\n this.loadFailed.set(!missing);\n }\n });\n }\n}\n\n/** The ids of the run's pending proposals in lookups of at most the lookup's limit each. */\nfunction pendingBatches(detail: AgentRunResult): string[][] {\n const ids = detail.proposals.filter(proposal => proposal.status === 'pending').map(proposal => proposal.approvalId);\n const batches: string[][] = [];\n for (let start = 0; start < ids.length; start += NH_ASSISTANT_MAX_PROPOSAL_LOOKUP) {\n batches.push(ids.slice(start, start + NH_ASSISTANT_MAX_PROPOSAL_LOOKUP));\n }\n return batches;\n}\n\n/** The time between a run's start and end, in seconds below two minutes and in minutes above. */\nfunction durationOf(startedAt: string | null, endedAt: string | null): RunDuration | null {\n if (!startedAt || !endedAt) {\n return null;\n }\n\n const seconds = Math.max(0, Math.round((Date.parse(endedAt) - Date.parse(startedAt)) / 1000));\n if (Number.isNaN(seconds)) {\n return null;\n }\n\n return seconds < 120\n ? { key: 'nh-assistant.agent-runs.result.duration-seconds', value: seconds }\n : { key: 'nh-assistant.agent-runs.result.duration-minutes', value: Math.round(seconds / 60) };\n}\n","<section class=\"run-result\" [attr.aria-labelledby]=\"id + '-title'\" [attr.aria-busy]=\"loading()\">\n @if (loading() && !detail()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.result.loading' | translate }}</p>\n } @else if (notFound()) {\n <p class=\"state\" data-run-not-found>{{ 'nh-assistant.agent-runs.result.not-found' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else if (detail(); as current) {\n @let run = current.run;\n <header class=\"run-result-header\">\n <h4 [id]=\"id + '-title'\">\n <span>{{ [run.agentDisplayNameKey ?? ('nh-assistant.agents.' + run.agentId + '.name')] | nhAssistantTranslate: (run.agentDisplayNameKey ?? run.agentId) }}</span>{{ ' ' }}\n <span class=\"muted\" aria-hidden=\"true\">·</span>{{ ' ' }}\n <nh-assistant-subject-link\n [subjectType]=\"run.subjectType\"\n [subjectId]=\"run.subjectId\"\n [label]=\"run.subjectDisplayName ?? run.subjectId\"\n [typeName]=\"run.subjectTypeName\"\n [link]=\"run.subjectLink\" />\n </h4>\n <div class=\"meta\">\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.warning]=\"run.status === 'waiting-for-approval' || run.status === 'queued' || run.status === 'running'\"\n [class.danger]=\"run.status === 'failed'\">{{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}</span>\n @if (run.shadow) {\n <span class=\"badge warning\" data-run-shadow>{{ 'nh-assistant.agent-runs.run.shadow' | translate }}</span>\n }\n @if (run.kind !== 'model') {\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.run.kind.' + run.kind | translate }}</span>\n }\n <span class=\"mono muted\">{{ 'nh-assistant.agent-runs.run.trigger' | translate: { trigger: run.triggerId } }}</span>\n @if (run.skill) {\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.run.skill' | translate: { skill: run.skill } }}</span>\n }\n </div>\n </header>\n\n <dl class=\"facts\">\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.started' | translate }}</dt>\n <dd><time [attr.datetime]=\"run.startedAt ?? run.createdAt\">{{ (run.startedAt ?? run.createdAt) | date: 'medium' }}</time></dd>\n </div>\n @if (duration(); as took) {\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.duration' | translate }}</dt>\n <dd data-run-duration>{{ took.key | translate: { count: took.value } }}</dd>\n </div>\n }\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.usage' | translate }}</dt>\n <dd>\n {{ 'nh-assistant.agent-runs.run.tool-calls' | translate: { count: run.toolCalls } }},\n {{ 'nh-assistant.agent-runs.run.tokens' | translate: { count: tokens() } }}\n </dd>\n </div>\n @if (run.failureCode; as code) {\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.failure' | translate }}</dt>\n <dd data-run-failure>{{ codeKeys(code) | nhAssistantTranslate: code }}</dd>\n </div>\n }\n @if (run.mcpConnectionSkips?.length) {\n <div>\n <dt>{{ 'nh-assistant.agent-runs.result.mcp-skipped' | translate }}</dt>\n <dd>\n <ul class=\"mcp-skips\" data-run-mcp-skips>\n @for (skip of run.mcpConnectionSkips; track skip.serverId) {\n <li [attr.data-run-mcp-skip]=\"skip.serverId\">\n <strong>{{ skip.serverDisplayName || skip.serverId }}</strong>: {{ codeKeys(skip.code) | nhAssistantTranslate: skip.code }}\n </li>\n }\n </ul>\n </dd>\n </div>\n }\n </dl>\n\n <!-- The answer is model output: the safe Markdown rendering shows inline HTML as text. -->\n <div class=\"result-body\">\n <h5>{{ 'nh-assistant.agent-runs.result.answer' | translate }}</h5>\n @if (current.result; as answer) {\n <div class=\"markdown\" data-run-answer [innerHTML]=\"answer | nhAssistantMarkdown\"></div>\n @if (current.resultTruncated) {\n <p class=\"muted\" data-run-truncated>{{ 'nh-assistant.agent-runs.result.truncated' | translate }}</p>\n }\n } @else {\n <p class=\"muted\" data-run-no-answer>{{ 'nh-assistant.agent-runs.result.no-answer' | translate }}</p>\n @if (current.summary; as summary) {\n <p class=\"summary\">{{ summary }}</p>\n }\n }\n </div>\n\n <div class=\"result-section\">\n <h5>{{ 'nh-assistant.agent-runs.result.proposals' | translate }}</h5>\n @if (current.proposals.length > 0) {\n <nh-assistant-agent-proposals\n [proposals]=\"current.proposals\"\n [decisionRights]=\"rights()\"\n [selectable]=\"decidable()\"\n [holdClosedCards]=\"true\"\n (changed)=\"onProposalsChanged()\"\n (openConversation)=\"openConversation.emit($event)\" />\n } @else if (current.hiddenProposals === 0) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.result.no-proposals' | translate }}</p>\n }\n @if (current.hiddenProposals > 0) {\n <p class=\"muted\" data-hidden-proposals>{{ 'nh-assistant.agent-runs.result.hidden-proposals' | translate: { count: current.hiddenProposals } }}</p>\n }\n </div>\n\n @if (current.artifacts.length > 0) {\n <div class=\"result-section\">\n <h5>{{ 'nh-assistant.agent-runs.result.files' | translate }}</h5>\n @if (downloadError(); as failure) {\n <p class=\"message error\" role=\"alert\" data-download-error><nh-assistant-icon name=\"warning\" />{{ downloadErrorKeys() | nhAssistantTranslate: failure.code }}</p>\n }\n <ul class=\"files\">\n @for (artifact of current.artifacts; track artifact.id) {\n <li [attr.data-run-artifact]=\"artifact.id\">\n <span class=\"file-name\">{{ artifact.name }}</span>\n <span class=\"muted\">{{ 'nh-assistant.agent-runs.artifacts.version' | translate: { version: artifact.version } }}</span>\n @if (artifact.restricted) {\n <span class=\"badge warning\">{{ 'nh-assistant.agent-runs.artifacts.restricted' | translate }}</span>\n } @else {\n <button\n class=\"secondary\"\n type=\"button\"\n [attr.aria-label]=\"('nh-assistant.agent-runs.artifacts.download' | translate) + ' ' + artifact.name\"\n [disabled]=\"downloadingId() !== null\"\n (click)=\"download(artifact)\">\n <nh-assistant-icon name=\"page\" />{{ 'nh-assistant.agent-runs.artifacts.download' | translate }}\n </button>\n }\n </li>\n }\n </ul>\n </div>\n }\n\n @if (conversationLink() && current.canOpenConversation) {\n <div class=\"card-actions\">\n <button class=\"secondary\" type=\"button\" data-run-conversation (click)=\"openConversation.emit(run.conversationId)\">\n <nh-assistant-icon name=\"link\" />{{ 'nh-assistant.agent-runs.thread.open-conversation' | translate }}\n </button>\n </div>\n }\n }\n</section>\n","import { DatePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, computed, effect, inject, input, output, signal, untracked } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Observable, Subscription } from 'rxjs';\nimport {\n AgentRun,\n AgentRunRetryMode,\n AgentSubjectRole,\n AgentTriggerReceipt,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunReceiptComponent } from './internal/nh-assistant-run-receipt.component';\nimport { NhAssistantRunResultComponent } from './nh-assistant-run-result.component';\n\nlet nextId = 0;\n\nconst endedStatuses = new Set(['completed', 'failed', 'cancelled']);\n\n/**\n * The runs of an agent thread, newest first: trigger, status, failure, usage, proposals and the\n * summary the next run starts from, and the agent that handed a run its work. \"Show the result\"\n * opens a run's whole result, proposals and files in `nh-assistant-run-result`. Participants cancel\n * an open run; approvers resume or restart a failed or cancelled one, and a restart shows what became\n * of it like a start by hand. A run's failure reads as its translated code. With live updates it\n * reloads by itself when a run or proposal of the thread changes.\n */\n@Component({\n selector: 'nh-assistant-run-timeline',\n standalone: true,\n imports: [\n DatePipe,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantRunResultComponent,\n NhAssistantRunReceiptComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-run-timeline.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantRunTimelineComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private subscription?: Subscription;\n private actionSubscription?: Subscription;\n\n readonly conversationId = input.required<string>();\n readonly role = input<AgentSubjectRole>('reader');\n /** Emits after a run was cancelled or retried. */\n readonly changed = output<void>();\n /** Emits the thread of the agent that handed a run its work, so the host can open it. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-run-timeline-${nextId++}`;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly runs = signal<AgentRun[]>([]);\n /** The run whose result is shown; one at a time. */\n readonly openedRunId = signal<string | null>(null);\n readonly busyRunId = signal<string | null>(null);\n readonly error = signal<NhAssistantError | null>(null);\n readonly errorKeys = computed(() => nhAssistantErrorKeys(this.error()));\n /** What became of the latest restart. */\n readonly receipt = signal<AgentTriggerReceipt | null>(null);\n readonly codeKeys = nhAssistantCodeKeys;\n readonly canCancel = computed(() => this.role() === 'participant' || this.role() === 'approver');\n readonly canRetry = computed(() => this.role() === 'approver');\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.actionSubscription?.unsubscribe();\n });\n effect(() => {\n this.conversationId();\n untracked(() => this.load());\n });\n nhAssistantReloadOnAgentWork(\n change => change.conversationId === this.conversationId() && change.reason !== 'feedback',\n () => this.fetch(!this.loading() && !this.loadFailed())\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n toggleResult(run: AgentRun): void {\n this.openedRunId.update(current => current === run.id ? null : run.id);\n }\n\n isOpen(run: AgentRun): boolean {\n return !endedStatuses.has(run.status);\n }\n\n canRetryRun(run: AgentRun): boolean {\n return this.canRetry() && (run.status === 'failed' || run.status === 'cancelled');\n }\n\n cancel(run: AgentRun): void {\n this.act(run, this.api.cancelRun(run.id), () => undefined);\n }\n\n retry(run: AgentRun, mode: AgentRunRetryMode): void {\n // A restart starts the agent again; its receipt says whether it started or waits.\n this.act(run, this.api.retryRun(run.id, mode), receipt => {\n if (mode === 'restart') {\n this.receipt.set(receipt);\n }\n });\n }\n\n private act<T>(run: AgentRun, request: Observable<T>, done: (result: T) => void): void {\n this.busyRunId.set(run.id);\n this.error.set(null);\n this.receipt.set(null);\n this.actionSubscription?.unsubscribe();\n this.actionSubscription = request.subscribe({\n next: result => {\n this.busyRunId.set(null);\n done(result);\n this.changed.emit();\n this.load();\n },\n error: failure => {\n this.busyRunId.set(null);\n this.error.set(toNhAssistantError(failure));\n }\n });\n }\n\n /** A quiet load, after a live update, shows no loading state and keeps the runs when it fails. */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getRuns(this.conversationId()).subscribe({\n next: list => {\n this.runs.set(list.items);\n this.loading.set(false);\n this.loadFailed.set(false);\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","@if (error(); as failure) {\n <p class=\"message error\" role=\"alert\"><nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}</p>\n}\n@if (receipt(); as restarted) {\n <nh-assistant-run-receipt [receipt]=\"restarted\" />\n}\n\n@if (loading() && runs().length === 0) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n} @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n} @else if (runs().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.run.empty' | translate }}</p>\n} @else {\n <ol class=\"cards\" [attr.aria-label]=\"'nh-assistant.agent-runs.thread.tabs.runs' | translate\">\n @for (run of runs(); track run.id) {\n <li class=\"card\" [attr.aria-busy]=\"busyRunId() === run.id\">\n <div class=\"card-header\">\n <strong>{{ run.createdAt | date: 'short' }}</strong>\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.warning]=\"run.status === 'waiting-for-approval' || run.status === 'queued' || run.status === 'running'\"\n [class.danger]=\"run.status === 'failed'\">\n {{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}\n </span>\n @if (run.shadow) {\n <span class=\"badge\">{{ 'nh-assistant.agent-runs.run.shadow' | translate }}</span>\n }\n @if (run.kind && run.kind !== 'model') {\n <span class=\"badge\" [attr.data-kind]=\"run.kind\">{{ 'nh-assistant.agent-runs.run.kind.' + run.kind | translate }}</span>\n }\n <span class=\"mono muted\">{{ 'nh-assistant.agent-runs.run.trigger' | translate: { trigger: run.triggerId } }}</span>\n @if (run.skill) {\n <span class=\"badge\" [attr.data-skill]=\"run.skill\">\n {{ 'nh-assistant.agent-runs.run.skill' | translate: { skill: run.skill } }}\n @if (run.skillChosenBy) {\n · {{ 'nh-assistant.agent-runs.run.skill-chosen-by.' + run.skillChosenBy | translate }}\n }\n </span>\n }\n </div>\n @if (run.requestedByAgentId; as source) {\n <p class=\"handed-off\" [attr.data-handed-off-by]=\"source\">\n {{ 'nh-assistant.agent-runs.run.handed-off-by' | translate: { agent: (['nh-assistant.agents.' + source + '.name'] | nhAssistantTranslate: source) } }}\n @if (run.requestedByConversationId; as sourceThread) {\n <button class=\"link\" type=\"button\" (click)=\"openConversation.emit(sourceThread)\">\n {{ 'nh-assistant.agent-runs.run.open-source-thread' | translate }}\n </button>\n }\n </p>\n }\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.run.tool-calls' | translate: { count: run.toolCalls } }}</span>\n <span>{{ 'nh-assistant.agent-runs.run.tokens' | translate: { count: run.inputTokens + run.outputTokens } }}</span>\n <span>{{ 'nh-assistant.agent-runs.run.proposals' | translate: { count: run.proposalCount } }}</span>\n @if (run.attempt > 1) {\n <span>{{ 'nh-assistant.agent-runs.run.attempt' | translate: { attempt: run.attempt } }}</span>\n }\n @if (run.failureCode; as code) {\n <span data-run-failure>{{ codeKeys(code) | nhAssistantTranslate: code }}</span>\n }\n </div>\n @if (run.summary) {\n <p class=\"summary\">{{ run.summary }}</p>\n }\n <div class=\"card-actions\">\n <button\n class=\"secondary\"\n type=\"button\"\n data-toggle-run-result\n [attr.aria-expanded]=\"openedRunId() === run.id\"\n [attr.aria-controls]=\"id + '-' + run.id + '-result'\"\n (click)=\"toggleResult(run)\">\n <nh-assistant-icon name=\"list\" />{{ (openedRunId() === run.id ? 'nh-assistant.agent-runs.result.hide' : 'nh-assistant.agent-runs.result.show') | translate }}\n </button>\n @if ((isOpen(run) && canCancel()) || canRetryRun(run)) {\n @if (isOpen(run) && canCancel()) {\n <button class=\"secondary\" type=\"button\" [disabled]=\"busyRunId() !== null\" (click)=\"cancel(run)\">\n <nh-assistant-icon name=\"stop\" />{{ 'nh-assistant.agent-runs.run.cancel' | translate }}\n </button>\n }\n @if (canRetryRun(run)) {\n <button class=\"secondary\" type=\"button\" [disabled]=\"busyRunId() !== null\" (click)=\"retry(run, 'resume')\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.run.resume' | translate }}\n </button>\n <button class=\"secondary\" type=\"button\" [disabled]=\"busyRunId() !== null\" (click)=\"retry(run, 'restart')\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.run.restart' | translate }}\n </button>\n }\n }\n </div>\n @if (openedRunId() === run.id) {\n <div class=\"work\" [id]=\"id + '-' + run.id + '-result'\">\n <nh-assistant-run-result\n [runId]=\"run.id\"\n [conversationLink]=\"false\"\n (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n </li>\n }\n </ol>\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n viewChild\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription, forkJoin } from 'rxjs';\nimport {\n AgentProposal,\n AgentProposalDecisionRight,\n AgentThreadLookup,\n AgentTriggerReceipt,\n LiveAgentWorkChanged,\n NH_ASSISTANT_MAX_PROPOSAL_LOOKUP,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantSubjectLinkComponent as NhAssistantSubjectLinkComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunReceiptComponent } from './internal/nh-assistant-run-receipt.component';\nimport { NhAssistantAgentArtifactsComponent } from './nh-assistant-agent-artifacts.component';\nimport { NhAssistantAgentConsultationsComponent } from './nh-assistant-agent-consultations.component';\nimport { NhAssistantAgentMemoryComponent } from './nh-assistant-agent-memory.component';\nimport { NhAssistantAgentProposalsComponent } from './nh-assistant-agent-proposals.component';\nimport { NhAssistantRunTimelineComponent } from './nh-assistant-run-timeline.component';\n\nexport type NhAssistantAgentThreadTab = 'proposals' | 'runs' | 'consultations' | 'memory' | 'artifacts';\n\n/**\n * The agent's work on one subject, for example an \"Intake review\" tab on a project page: the\n * caller's role, a start action for participants, and the thread's proposals, runs, consultations\n * by other assistants, working memory and files. Everything follows the caller's live role on the\n * subject. With live updates the view reloads by itself when the thread's runs, proposals or\n * feedback change, also when a colleague decided elsewhere.\n */\n@Component({\n selector: 'nh-assistant-agent-thread-view',\n standalone: true,\n imports: [\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantSubjectLinkComponent,\n NhAssistantAgentProposalsComponent,\n NhAssistantRunTimelineComponent,\n NhAssistantAgentMemoryComponent,\n NhAssistantAgentArtifactsComponent,\n NhAssistantAgentConsultationsComponent,\n NhAssistantRunReceiptComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-thread-view.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentThreadViewComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly proposalList = viewChild(NhAssistantAgentProposalsComponent);\n private subscription?: Subscription;\n private proposalSubscription?: Subscription;\n private rightsSubscription?: Subscription;\n private startSubscription?: Subscription;\n\n readonly agentId = input.required<string>();\n readonly subjectType = input.required<string>();\n readonly subjectId = input.required<string>();\n /**\n * Emits the thread's conversation id, so the host can open it in the assistant panel; also the\n * conversation of a run that placed one of the thread's proposals here from another subject.\n */\n readonly openConversation = output<string>();\n\n readonly tab = signal<NhAssistantAgentThreadTab>('proposals');\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly lookup = signal<AgentThreadLookup | null>(null);\n readonly proposals = signal<AgentProposal[]>([]);\n /**\n * The caller's live right to decide each pending proposal, as the server checks it for the decision:\n * four-eyes keeps the person who asked for a consultation's proposal out, also as an approver, and\n * nobody decides here what the asker decides in their own chat. Without an answer the caller's role\n * decides what is offered; the server checks every decision again.\n */\n readonly rights = signal<ReadonlyMap<string, AgentProposalDecisionRight> | null>(null);\n readonly message = signal('');\n readonly starting = signal(false);\n readonly receipt = signal<AgentTriggerReceipt | null>(null);\n readonly error = signal<NhAssistantError | null>(null);\n readonly errorKeys = computed(() => nhAssistantErrorKeys(this.error()));\n readonly thread = computed(() => this.lookup()?.thread ?? null);\n readonly role = computed(() => this.lookup()?.role ?? 'none');\n readonly tabs: readonly NhAssistantAgentThreadTab[] = ['proposals', 'runs', 'consultations', 'memory', 'artifacts'];\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.proposalSubscription?.unsubscribe();\n this.rightsSubscription?.unsubscribe();\n this.startSubscription?.unsubscribe();\n });\n effect(() => {\n this.agentId();\n this.subjectType();\n this.subjectId();\n untracked(() => this.load());\n });\n nhAssistantReloadOnAgentWork(change => this.concerns(change), () => this.refresh());\n }\n\n load(): void {\n this.fetch(false);\n }\n\n loadProposals(): void {\n this.fetchProposals(false);\n }\n\n onMessage(event: Event): void {\n this.message.set((event.target as HTMLTextAreaElement).value);\n }\n\n start(): void {\n this.starting.set(true);\n this.error.set(null);\n this.receipt.set(null);\n this.startSubscription?.unsubscribe();\n this.startSubscription = this.api\n .startAgent({\n agentId: this.agentId(),\n subjectType: this.subjectType(),\n subjectId: this.subjectId(),\n message: this.message().trim() || null\n })\n .subscribe({\n next: receipt => {\n this.starting.set(false);\n this.receipt.set(receipt);\n this.message.set('');\n this.load();\n },\n error: failure => {\n this.starting.set(false);\n this.error.set(toNhAssistantError(failure));\n }\n });\n }\n\n /**\n * Whether a live update is about this view: its own thread, or, before the subject has a thread,\n * a run that may have started it.\n */\n private concerns(change: LiveAgentWorkChanged): boolean {\n const thread = this.thread();\n return thread ? change.conversationId === thread.conversationId : change.reason === 'run';\n }\n\n /**\n * Reloads after a live update. Once the thread is shown it reloads quietly: no loading state, and\n * a failure keeps what is shown, including an open feedback question. While a decision of the\n * proposal list is in flight only the thread reloads, because the decision reloads the proposals\n * when it ends.\n */\n private refresh(): void {\n const withProposals = this.proposalList()?.busy() !== true;\n this.fetch(this.lookup() !== null && !this.loading() && !this.loadFailed(), withProposals);\n }\n\n private fetch(quiet: boolean, withProposals = true): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getThread(this.agentId(), this.subjectType(), this.subjectId()).subscribe({\n next: lookup => {\n this.lookup.set(lookup);\n if (!lookup.thread?.activeRun && this.receipt()?.runId) {\n // The run the receipt announced has ended; the run timeline shows how.\n this.receipt.set(null);\n }\n this.loading.set(false);\n this.loadFailed.set(false);\n if (withProposals) {\n this.fetchProposals(quiet);\n }\n },\n error: () => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n\n private fetchProposals(quiet: boolean): void {\n const thread = this.thread();\n this.proposalSubscription?.unsubscribe();\n if (!thread) {\n this.proposals.set([]);\n this.rights.set(null);\n return;\n }\n\n this.proposalSubscription = this.api.getProposals(thread.conversationId).subscribe({\n next: proposals => {\n this.proposals.set(proposals);\n this.readRights(proposals);\n },\n error: () => {\n if (!quiet) {\n this.proposals.set([]);\n this.rights.set(null);\n }\n }\n });\n }\n\n /**\n * Reads the caller's live right to decide each pending proposal, in batches of\n * `NH_ASSISTANT_MAX_PROPOSAL_LOOKUP`, as the run result and the subject's work do.\n */\n private readRights(proposals: readonly AgentProposal[]): void {\n this.rightsSubscription?.unsubscribe();\n const ids = [...new Set(proposals.filter(proposal => proposal.status === 'pending').map(proposal => proposal.approvalId))];\n if (ids.length === 0) {\n this.rights.set(null);\n return;\n }\n\n const batches: string[][] = [];\n for (let start = 0; start < ids.length; start += NH_ASSISTANT_MAX_PROPOSAL_LOOKUP) {\n batches.push(ids.slice(start, start + NH_ASSISTANT_MAX_PROPOSAL_LOOKUP));\n }\n this.rightsSubscription = forkJoin(batches.map(batch => this.api.lookupProposals(batch))).subscribe({\n next: lookups => this.rights.set(new Map(lookups\n .flatMap(lookup => lookup.items)\n .map(item => [item.proposal.approvalId, { canDecide: item.canDecide, reasonCode: item.reasonCode }] as const))),\n error: () => this.rights.set(null)\n });\n }\n}\n","<section class=\"section\" aria-labelledby=\"nh-assistant-agent-thread-title\" [attr.aria-busy]=\"loading()\">\n <header class=\"section-header\">\n <div>\n <h3 id=\"nh-assistant-agent-thread-title\">\n @if (thread(); as current) {\n <nh-assistant-subject-link\n [subjectType]=\"current.subjectType\"\n [subjectId]=\"current.subjectId\"\n [label]=\"current.subjectDisplayName ?? ('nh-assistant.agent-runs.thread.title' | translate)\"\n [typeName]=\"current.subjectTypeName\"\n [link]=\"current.subjectLink\" />\n } @else {\n {{ 'nh-assistant.agent-runs.thread.title' | translate }}\n }\n </h3>\n <p class=\"muted\">\n {{ 'nh-assistant.agent-runs.role.' + role() | translate }}\n @if (thread()?.activeRun; as activeRun) {\n · {{ 'nh-assistant.agent-runs.run.status.' + activeRun.status | translate }}\n }\n @if (thread()?.waitingInputs) {\n · {{ 'nh-assistant.agent-runs.thread.waiting-inputs' | translate: { count: thread()!.waitingInputs } }}\n }\n </p>\n @if (thread()?.shadow) {\n <p class=\"muted\" data-shadow-thread>{{ 'nh-assistant.agent-runs.thread.shadow' | translate }}</p>\n }\n </div>\n <div class=\"toolbar\">\n @if (thread(); as current) {\n <button class=\"secondary\" type=\"button\" (click)=\"openConversation.emit(current.conversationId)\">\n <nh-assistant-icon name=\"link\" />{{ 'nh-assistant.agent-runs.thread.open-conversation' | translate }}\n </button>\n }\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </div>\n </header>\n\n @if (error(); as failure) {\n <p class=\"message error\" role=\"alert\"><nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}</p>\n }\n @if (receipt(); as started) {\n <nh-assistant-run-receipt [receipt]=\"started\" />\n }\n\n @if (loading() && !lookup()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else {\n @if (lookup()?.canStart) {\n <form class=\"toolbar\" (submit)=\"$event.preventDefault(); start()\">\n <textarea\n class=\"reason\"\n rows=\"2\"\n maxlength=\"4000\"\n [value]=\"message()\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.thread.start-message' | translate\"\n [placeholder]=\"'nh-assistant.agent-runs.thread.start-message' | translate\"\n (input)=\"onMessage($event)\"></textarea>\n <button class=\"primary\" type=\"submit\" [disabled]=\"starting()\">\n <nh-assistant-icon name=\"send\" />{{ (starting() ? 'nh-assistant.agent-runs.thread.starting' : 'nh-assistant.agent-runs.thread.start') | translate }}\n </button>\n </form>\n }\n\n @if (thread(); as current) {\n <div class=\"tabs\" role=\"tablist\">\n @for (item of tabs; track item) {\n <button\n type=\"button\"\n role=\"tab\"\n [attr.aria-selected]=\"tab() === item\"\n (click)=\"tab.set(item)\">\n {{ 'nh-assistant.agent-runs.thread.tabs.' + item | translate }}\n </button>\n }\n </div>\n <div role=\"tabpanel\">\n @switch (tab()) {\n @case ('proposals') {\n @if (proposals().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.thread.no-proposals' | translate }}</p>\n } @else {\n <nh-assistant-agent-proposals\n [proposals]=\"proposals()\"\n [canDecide]=\"role() === 'approver'\"\n [decisionRights]=\"rights()\"\n (changed)=\"loadProposals()\"\n (openConversation)=\"openConversation.emit($event)\" />\n }\n }\n @case ('runs') {\n <nh-assistant-run-timeline\n [conversationId]=\"current.conversationId\"\n [role]=\"role()\"\n (changed)=\"load()\"\n (openConversation)=\"openConversation.emit($event)\" />\n }\n @case ('consultations') {\n <nh-assistant-agent-consultations [conversationId]=\"current.conversationId\" />\n }\n @case ('memory') {\n <nh-assistant-agent-memory [conversationId]=\"current.conversationId\" />\n }\n @case ('artifacts') {\n <nh-assistant-agent-artifacts [conversationId]=\"current.conversationId\" />\n }\n }\n </div>\n } @else {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.thread.no-thread' | translate }}</p>\n }\n }\n</section>\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n viewChild\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentProposalDecisionRight,\n AgentSubjectWork,\n AgentSubjectWorkAgent,\n AgentThreadLookup,\n AgentTriggerReceipt,\n NhAssistantAgentRunApiService,\n NhAssistantApiError,\n NhAssistantError,\n NhAssistantPanelService,\n NhAssistantStore,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunReceiptComponent } from './internal/nh-assistant-run-receipt.component';\nimport { NhAssistantAgentProposalsComponent } from './nh-assistant-agent-proposals.component';\n\nlet nextSuggestionsId = 0;\n\n/** The outcome of starting one agent on the subject. */\ninterface NhAssistantStartedAgent {\n agentId: string;\n receipt: AgentTriggerReceipt;\n}\n\n/**\n * The agent work on one subject of the application, for example in a project's dialog: the open\n * proposals of every agent on the subject with the viewer's own decision right, including who\n * decides when the viewer may not and the optional question after a rejection, and per agent the\n * conversation about the subject and, for participants, a start action. `agentId` names the agent\n * whose conversation the host offers also before it worked on the subject. With live updates the\n * view reloads by itself when agent work on its subject changes; a proposal that closes because it\n * no longer fits stays as a closed card with the reason until it is dismissed. Opening a\n * conversation uses `NhAssistantPanelService.openSubject` and emits `conversationOpened` afterwards;\n * opening the conversation of a run that placed a proposal here emits `runConversationOpened`.\n */\n@Component({\n selector: 'nh-assistant-subject-suggestions',\n standalone: true,\n imports: [\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantAgentProposalsComponent,\n NhAssistantRunReceiptComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-subject-suggestions.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantSubjectSuggestionsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly panel = inject(NhAssistantPanelService);\n private readonly store = inject(NhAssistantStore);\n private readonly proposalList = viewChild(NhAssistantAgentProposalsComponent);\n private subscription?: Subscription;\n private startSubscription?: Subscription;\n private destroyed = false;\n\n /** The application's kind of subject, for example `project`. */\n readonly subjectType = input.required<string>();\n readonly subjectId = input.required<string>();\n /** The agent whose conversation about the subject the host offers, also before it worked on it. */\n readonly agentId = input<string | undefined>(undefined);\n /** Emits once the panel opens the conversation, so a host in a dialog can make room for it. */\n readonly conversationOpened = output<AgentThreadLookup>();\n /**\n * Emits once the panel opens the conversation of a run that placed a proposal here from another\n * subject, so a host in a dialog can make room for it.\n */\n readonly runConversationOpened = output<string>();\n\n readonly headingId = `nh-assistant-subject-suggestions-${++nextSuggestionsId}`;\n readonly loading = signal(true);\n /** True after the first successful load; later loads keep the list, and an open feedback question, in place. */\n readonly loaded = signal(false);\n readonly loadFailed = signal(false);\n /** The caller has no role on the subject, or it no longer exists. */\n readonly unavailable = signal(false);\n readonly work = signal<AgentSubjectWork | null>(null);\n /** The agent whose conversation is opening or which is starting. */\n readonly opening = signal<string | null>(null);\n readonly starting = signal<string | null>(null);\n readonly started = signal<NhAssistantStartedAgent | null>(null);\n readonly error = signal<NhAssistantError | null>(null);\n readonly errorKeys = computed(() => nhAssistantErrorKeys(this.error()));\n /** True while the assistant panel can show a conversation. */\n readonly assistantEnabled = this.store.enabled;\n readonly agents = computed<AgentSubjectWorkAgent[]>(() => this.work()?.agents ?? []);\n readonly proposals = computed(() => this.work()?.openProposals.map(item => item.proposal) ?? []);\n readonly decisionRights = computed<ReadonlyMap<string, AgentProposalDecisionRight>>(() =>\n new Map((this.work()?.openProposals ?? []).map(item => [\n item.proposal.approvalId,\n { canDecide: item.canDecide, reasonCode: item.reasonCode }\n ])));\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.subscription?.unsubscribe();\n this.startSubscription?.unsubscribe();\n });\n // Browser only: the access policy and the status need the signed-in user.\n afterNextRender(() => {\n void this.store.initialize();\n });\n effect(() => {\n this.subjectType();\n this.subjectId();\n this.agentId();\n untracked(() => {\n this.work.set(null);\n this.loaded.set(false);\n this.started.set(null);\n this.error.set(null);\n this.load();\n });\n });\n nhAssistantReloadOnAgentWork(\n change => change.subjectType === this.subjectType() && change.subjectId === this.subjectId(),\n () => this.refresh()\n );\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /**\n * The translation keys of an agent's name: the name the subject's work gives, which names an agent\n * kept out of the chat as well (the text itself for an agent created in the administration), then\n * the server's status, then the convention.\n */\n agentNameKeys(agent: AgentSubjectWorkAgent): string[] {\n const convention = `nh-assistant.agents.${agent.agentId}.name`;\n const known = agent.displayNameKey ?? this.store.agents().find(item => item.id === agent.agentId)?.displayNameKey;\n return known && known !== convention ? [known, convention] : [convention];\n }\n\n /** Readers may open an existing conversation; creating one needs the participant role. */\n canOpen(agent: AgentSubjectWorkAgent): boolean {\n return agent.thread !== null || this.work()?.role !== 'reader';\n }\n\n /**\n * Opens the conversation of the run that placed a proposal here, such as a run for the whole\n * application, in the assistant panel; the server checks the reader's access to it.\n */\n openRunConversation(conversationId: string): void {\n this.panel.open(conversationId);\n this.runConversationOpened.emit(conversationId);\n }\n\n async open(agent: AgentSubjectWorkAgent): Promise<void> {\n this.opening.set(agent.agentId);\n this.error.set(null);\n try {\n const lookup = await this.panel.openSubject(agent.agentId, { type: this.subjectType(), id: this.subjectId() });\n if (!this.destroyed) {\n this.conversationOpened.emit(lookup);\n if (!agent.thread) {\n // The conversation now exists; show it as the agent's thread.\n this.fetch(true);\n }\n }\n } catch (failure) {\n if (!this.destroyed) {\n this.error.set(toNhAssistantError(failure));\n }\n } finally {\n if (!this.destroyed) {\n this.opening.set(null);\n }\n }\n }\n\n start(agent: AgentSubjectWorkAgent): void {\n this.starting.set(agent.agentId);\n this.error.set(null);\n this.started.set(null);\n this.startSubscription?.unsubscribe();\n this.startSubscription = this.api\n .startAgent({ agentId: agent.agentId, subjectType: this.subjectType(), subjectId: this.subjectId() })\n .subscribe({\n next: receipt => {\n this.starting.set(null);\n this.started.set({ agentId: agent.agentId, receipt });\n this.fetch(true);\n },\n error: failure => {\n this.starting.set(null);\n this.error.set(toNhAssistantError(failure));\n }\n });\n }\n\n /**\n * Reloads after a live update. Once the work is shown it reloads quietly: no loading state, and\n * a failure keeps what is shown, including an open feedback question. While a decision of the\n * list is in flight it waits, because the decision reloads the list when it ends.\n */\n private refresh(): void {\n if (this.proposalList()?.busy()) {\n return;\n }\n\n this.fetch(this.loaded() && !this.loading() && !this.loadFailed());\n }\n\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.unavailable.set(false);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getSubjectWork(this.subjectType(), this.subjectId(), this.agentId()).subscribe({\n next: work => {\n const previous = this.proposals();\n this.work.set(work);\n if (quiet) {\n this.proposalList()?.holdClosed(previous, this.proposals());\n }\n const started = this.started();\n const startedAgent = started ? work.agents.find(agent => agent.agentId === started.agentId) : undefined;\n if (started?.receipt.runId && !startedAgent?.thread?.activeRun) {\n // The run the start announced has ended; its proposals are in the list.\n this.started.set(null);\n }\n this.loading.set(false);\n this.loadFailed.set(false);\n this.unavailable.set(false);\n this.loaded.set(true);\n },\n error: failure => {\n if (quiet) {\n return;\n }\n\n this.loading.set(false);\n if (failure instanceof NhAssistantApiError && failure.status === 404) {\n this.unavailable.set(true);\n } else {\n this.loadFailed.set(true);\n }\n }\n });\n }\n}\n","<section class=\"section\" [attr.aria-labelledby]=\"headingId\" [attr.aria-busy]=\"loading()\">\n <header class=\"section-header\">\n <div>\n <h3 [id]=\"headingId\">{{ 'nh-assistant.agent-runs.subject.title' | translate }}</h3>\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.subject.description' | translate }}</p>\n </div>\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </header>\n\n @if (error(); as failure) {\n <p class=\"message error\" role=\"alert\"><nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}</p>\n }\n @if (started(); as start) {\n <nh-assistant-run-receipt [receipt]=\"start.receipt\" />\n }\n\n @if (loading() && !loaded()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.loading' | translate }}</p>\n } @else if (unavailable()) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.subject.unavailable' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else {\n @if (agents().length > 0) {\n <ul class=\"subject-agents\" [attr.aria-label]=\"'nh-assistant.agent-runs.subject.agents' | translate\">\n @for (agent of agents(); track agent.agentId) {\n @let name = agentNameKeys(agent) | nhAssistantTranslate: (agent.displayNameKey ?? agent.agentId);\n <li class=\"subject-agent\">\n <div class=\"subject-agent-text\">\n <strong>{{ name }}</strong>\n <span class=\"muted\">\n @if (agent.thread?.activeRun; as activeRun) {\n {{ 'nh-assistant.agent-runs.run.status.' + activeRun.status | translate }}\n } @else if (!agent.thread) {\n {{ 'nh-assistant.agent-runs.thread.no-thread' | translate }}\n } @else {\n {{ 'nh-assistant.agent-runs.subject.idle' | translate }}\n }\n </span>\n </div>\n <div class=\"card-actions\">\n @if (canOpen(agent)) {\n <button\n class=\"secondary\"\n type=\"button\"\n [disabled]=\"opening() !== null || !assistantEnabled()\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.subject.open-conversation-label' | translate: { agent: name }\"\n [attr.title]=\"assistantEnabled() ? null : ('nh-assistant.agent-runs.subject.assistant-unavailable' | translate)\"\n (click)=\"open(agent)\">\n <nh-assistant-icon name=\"assistant\" />{{ (opening() === agent.agentId ? 'nh-assistant.agent-runs.subject.opening' : 'nh-assistant.agent-runs.thread.open-conversation') | translate }}\n </button>\n }\n @if (agent.canStart) {\n <button\n class=\"secondary\"\n type=\"button\"\n [disabled]=\"starting() !== null\"\n [attr.aria-label]=\"'nh-assistant.agent-runs.subject.start-label' | translate: { agent: name }\"\n (click)=\"start(agent)\">\n <nh-assistant-icon name=\"send\" />{{ (starting() === agent.agentId ? 'nh-assistant.agent-runs.thread.starting' : 'nh-assistant.agent-runs.thread.start') | translate }}\n </button>\n }\n </div>\n </li>\n }\n </ul>\n }\n\n <!-- Stays rendered when the list empties, so the optional feedback after a rejection remains. -->\n <nh-assistant-agent-proposals\n [proposals]=\"proposals()\"\n [decisionRights]=\"decisionRights()\"\n [holdClosedCards]=\"true\"\n (changed)=\"load()\"\n (openConversation)=\"openRunConversation($event)\" />\n @if (proposals().length === 0) {\n <p class=\"state\">{{ 'nh-assistant.agent-runs.subject.empty' | translate }}</p>\n }\n }\n</section>\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Observable, Subscription, map } from 'rxjs';\nimport {\n AgentSubjectType,\n NH_ASSISTANT_SYSTEM_GLOBAL_ID,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantPickerComponent as NhAssistantPickerComponent,\n type ɵNhAssistantPickerOption as NhAssistantPickerOption,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\n\n/** Lookups that cannot succeed by asking again: the person changes the id instead. */\nconst finalLookupCodes = new Set(['assistant-subject-not-found', 'assistant-subject-invalid', 'assistant-subject-type-unknown']);\n\n/** A subject chosen in the subject picker, with the name the application gives it. */\nexport interface NhAssistantChosenSubject {\n type: string;\n id: string;\n displayName: string | null;\n}\n\n/**\n * The search of the picker for the subjects of one type: the subjects the caller may read whose\n * name matches, from `GET subjects/{type}/search` (internal).\n */\nexport function nhAssistantSubjectSearch(\n api: NhAssistantAgentRunApiService,\n subjectType: string,\n limit = 20\n): (query: string) => Observable<NhAssistantPickerOption[]> {\n return query => api.searchSubjects(subjectType, query, limit).pipe(\n map(result => result.items.map(item => ({ value: item.id, label: item.displayName ?? item.id })))\n );\n}\n\nlet nextId = 0;\n\n/**\n * Chooses one subject of a type (internal). A searchable type is a combobox that searches the\n * caller's readable subjects by name; for any other type people give the id, and the picker shows\n * the name the application gives that subject, or why it was not found, below the field, with\n * the translated code and, when asking again can help, a button that looks it up again. The\n * platform's type of the whole application (`isSystem`) is \"The whole application\" itself for an\n * app-wide agent, chosen as soon as the type is, and a search of the divisions by name for an agent\n * that works per division (`perDivision`).\n */\n@Component({\n selector: 'nh-assistant-subject-picker',\n standalone: true,\n imports: [TranslatePipe, NhAssistantTranslatePipe, NhAssistantPickerComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-subject-picker.component.html',\n styleUrl: './nh-assistant-subject-picker.component.scss'\n})\nexport class NhAssistantSubjectPickerComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private lookup?: Subscription;\n\n /** The id of the field, for the label's `for`. */\n readonly inputId = input.required<string>();\n readonly subjectType = input.required<AgentSubjectType>();\n /**\n * For the whole application: choose one of the application's divisions, for an agent that works\n * per division, instead of the whole application app-wide.\n */\n readonly perDivision = input(false);\n /** The chosen subject's id. */\n readonly value = input<string | null>(null);\n /** The name of the chosen subject, when the host knows it. */\n readonly selectedLabel = input<string | null>(null);\n readonly invalid = input(false);\n readonly describedBy = input<string | null>(null);\n readonly disabled = input(false);\n\n /** The chosen subject, or `null` when the choice was cleared or the id was not found. */\n readonly subjectChange = output<NhAssistantChosenSubject | null>();\n\n readonly hintId = `nh-assistant-subject-picker-hint-${nextId++}`;\n /** The whole application app-wide: nothing to choose beyond the type itself. */\n readonly wholeApplication = computed(() => this.subjectType().isSystem && !this.perDivision());\n readonly search = computed(() => {\n const type = this.subjectType();\n if (type.isSystem) {\n // The whole application is searched for its divisions only.\n return this.perDivision() ? nhAssistantSubjectSearch(this.api, type.id) : null;\n }\n\n return type.searchable ? nhAssistantSubjectSearch(this.api, type.id) : null;\n });\n readonly placeholderKey = computed(() => this.subjectType().isSystem\n ? 'nh-assistant.subject-picker.division-placeholder'\n : 'nh-assistant.subject-picker.search-placeholder');\n readonly typedId = signal('');\n readonly lookingUp = signal(false);\n readonly found = signal<NhAssistantChosenSubject | null>(null);\n /** Why the typed id could not be looked up; `null` while there is no failure. */\n readonly lookupError = signal<NhAssistantError | null>(null);\n /** An unknown subject reads as such; any other failure with its own text and the generic fallback. */\n readonly lookupErrorKeys = computed(() => {\n const error = this.lookupError();\n return error?.code === 'assistant-subject-not-found'\n ? ['nh-assistant.subject-picker.not-found', ...nhAssistantErrorKeys(error)]\n : nhAssistantErrorKeys(error);\n });\n /** Looking the same id up again can help after a failure of the connection or the server. */\n readonly lookupRetryable = computed(() => {\n const error = this.lookupError();\n return error !== null && !finalLookupCodes.has(error.code);\n });\n readonly fieldDescribedBy = computed(() => [this.hintId, this.describedBy()].filter(Boolean).join(' '));\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.lookup?.unsubscribe());\n // A new type starts a new choice; the whole application app-wide is chosen with its type.\n effect(() => {\n const type = this.subjectType();\n const whole = this.wholeApplication();\n untracked(() => {\n this.lookup?.unsubscribe();\n this.typedId.set(this.value() ?? '');\n this.found.set(null);\n this.lookupError.set(null);\n this.lookingUp.set(false);\n if (whole) {\n this.subjectChange.emit({ type: type.id, id: NH_ASSISTANT_SYSTEM_GLOBAL_ID, displayName: type.name });\n }\n });\n });\n }\n\n choose(option: NhAssistantPickerOption | null): void {\n this.subjectChange.emit(option ? { type: this.subjectType().id, id: option.value, displayName: option.label } : null);\n }\n\n onIdInput(event: Event): void {\n this.typedId.set((event.target as HTMLInputElement).value);\n this.found.set(null);\n this.lookupError.set(null);\n }\n\n /** Looks the typed id up again after a failure that asking again may resolve. */\n lookUpAgain(): void {\n this.found.set(null);\n this.lookUp();\n }\n\n /** Looks the typed id up; the server names the subject when the caller may read it. */\n lookUp(): void {\n const id = this.typedId().trim();\n const type = this.subjectType().id;\n this.lookup?.unsubscribe();\n if (id.length === 0) {\n this.lookingUp.set(false);\n this.lookupError.set(null);\n this.subjectChange.emit(null);\n return;\n }\n if (this.found()?.id === id) {\n return;\n }\n\n this.lookingUp.set(true);\n this.lookupError.set(null);\n this.lookup = this.api.getSubjectWork(type, id).subscribe({\n next: work => {\n const subject = { type, id, displayName: work.subjectDisplayName };\n this.lookingUp.set(false);\n this.found.set(subject);\n this.subjectChange.emit(subject);\n },\n error: (error: unknown) => {\n this.lookingUp.set(false);\n this.lookupError.set(toNhAssistantError(error));\n this.subjectChange.emit(null);\n }\n });\n }\n}\n","@if (wholeApplication()) {\n <!-- The whole application app-wide is one subject: the field names it, there is nothing to choose. -->\n <output\n class=\"fixed\"\n data-whole-application\n [id]=\"inputId()\"\n [attr.aria-describedby]=\"fieldDescribedBy()\">{{ subjectType().name }}</output>\n <p class=\"hint\" [id]=\"hintId\">{{ 'nh-assistant.subject-picker.whole-application-hint' | translate }}</p>\n} @else if (search(); as find) {\n <nh-assistant-picker\n [inputId]=\"inputId()\"\n [value]=\"value()\"\n [selectedLabel]=\"selectedLabel()\"\n [search]=\"find\"\n [placeholder]=\"placeholderKey() | translate\"\n [invalid]=\"invalid()\"\n [describedBy]=\"describedBy()\"\n [disabled]=\"disabled()\"\n (optionChange)=\"choose($event)\" />\n} @else {\n <input\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [id]=\"inputId()\"\n [value]=\"typedId()\"\n [placeholder]=\"'nh-assistant.subject-picker.id-placeholder' | translate\"\n [attr.aria-invalid]=\"invalid() || lookupError() ? true : null\"\n [attr.aria-describedby]=\"fieldDescribedBy()\"\n [disabled]=\"disabled()\"\n (input)=\"onIdInput($event)\"\n (change)=\"lookUp()\"\n (keydown.enter)=\"$event.preventDefault(); lookUp()\" />\n <p class=\"hint\" aria-live=\"polite\" [id]=\"hintId\" [class.error]=\"lookupError()\">\n @if (lookingUp()) {\n {{ 'nh-assistant.subject-picker.looking-up' | translate }}\n } @else if (lookupError(); as failure) {\n <span data-lookup-error>{{ lookupErrorKeys() | nhAssistantTranslate: failure.code }}</span>\n @if (lookupRetryable()) {\n <button type=\"button\" class=\"link\" data-lookup-retry [disabled]=\"disabled()\" (click)=\"lookUpAgain()\">\n {{ 'nh-assistant.subject-picker.look-up-again' | translate }}\n </button>\n }\n } @else if (found(); as subject) {\n {{ 'nh-assistant.subject-picker.found' | translate: { name: subject.displayName ?? subject.id } }}\n } @else {\n {{ 'nh-assistant.subject-picker.id-hint' | translate }}\n }\n </p>\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n afterNextRender,\n computed,\n inject,\n input,\n output,\n signal,\n viewChild\n} from '@angular/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentSubjectType,\n AgentTriggerReceipt,\n NH_ASSISTANT_SYSTEM_SUBJECT_TYPE,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantSubjectLinkComponent as NhAssistantSubjectLinkComponent,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunReceiptComponent } from './nh-assistant-run-receipt.component';\nimport { NhAssistantChosenSubject, NhAssistantSubjectPickerComponent } from './nh-assistant-subject-picker.component';\n\n/** The agent the dialog runs: its id, its name as people read it and what it works on. */\nexport interface NhAssistantRunNowAgent {\n id: string;\n /** The agent's name in the reader's language, or the text an administrator gave it. */\n name: string;\n /** The object types it works on; with `worksOnAllSubjects` every type the application registers. */\n worksOnSubjectTypes?: readonly string[] | null;\n worksOnAllSubjects?: boolean | null;\n /** It works on the whole application. */\n worksOnApplication?: boolean | null;\n /** Its work for the whole application exists per division. */\n perDivision?: boolean | null;\n}\n\n/** A subject the dialog runs the agent on without asking, such as the object of the page. */\nexport interface NhAssistantRunNowSubject {\n type: string;\n id: string;\n displayName?: string | null;\n typeName?: string | null;\n link?: string | null;\n}\n\n/** What a run by hand was started on, with the receipt of `POST threads/start`. */\nexport interface NhAssistantRunNowStarted {\n receipt: AgentTriggerReceipt;\n subject: NhAssistantChosenSubject;\n}\n\n/** One answer to \"What should the agent work on?\". */\ninterface RunNowTarget {\n key: string;\n type: AgentSubjectType;\n /** For the whole application: the agent works per division, so a division is chosen. */\n perDivision: boolean;\n}\n\n/** The longest instruction the dialog sends with a run. */\nexport const NH_ASSISTANT_RUN_NOW_MAX_MESSAGE = 4_000;\n\nlet nextId = 0;\n\n/**\n * Runs an agent now, by hand (internal to the library; the administration's \"Run now\", the run now\n * of `nh-assistant-object-agents` and the board's tile use it, so it lives in the `agent-runs` entry\n * point and stays out of the chat's initial bundle). A modal dialog asks what the agent\n * works on this time, unless the host gives the subject: the whole application, in a division for an\n * agent that works per division, or an object of one of its types through the subject picker; and an\n * optional instruction. It sends `POST threads/start` with the caller as initiator, shows the\n * server's refusal at the form with its translated code, and ends with the receipt: what happens\n * now (a warning while the agent or its skill is paused, information while the start waits for the\n * application's change to be saved), the subject and the conversation to open. The server decides\n * who may run the agent: on an object the participant role, on the whole application the agent's\n * run policy.\n *\n * The host renders it when people ask to run the agent; it opens itself and emits `closed` when it\n * closes, after which the host removes it. Escape closes it, and focus returns to what opened it.\n */\n@Component({\n selector: 'nh-assistant-run-now-dialog',\n standalone: true,\n imports: [\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantSubjectLinkComponent,\n NhAssistantSubjectPickerComponent,\n NhAssistantRunReceiptComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-run-now-dialog.component.html',\n styleUrl: './nh-assistant-run-now-dialog.component.scss'\n})\nexport class NhAssistantRunNowDialogComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly translate = inject(TranslateService);\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly dialog = viewChild.required<ElementRef<HTMLDialogElement>>('dialog');\n private subscription?: Subscription;\n\n readonly agent = input.required<NhAssistantRunNowAgent>();\n /** The application's subject types from the run catalog, for choosing an object type. */\n readonly subjectTypes = input<readonly AgentSubjectType[]>([]);\n /** Whether the application lists its divisions, so a per-division agent can be run in one. */\n readonly divisions = input(false);\n /** Runs the agent on this subject without asking, such as the object of the page. */\n readonly subject = input<NhAssistantRunNowSubject | null>(null);\n\n /** The run started, with its receipt. */\n readonly started = output<NhAssistantRunNowStarted>();\n /** People want to open the agent's conversation; the dialog has closed. */\n readonly openConversation = output<string>();\n /** The dialog closed; the host removes it. */\n readonly closed = output<void>();\n\n readonly id = `nh-assistant-run-now-${nextId++}`;\n readonly maxMessage = NH_ASSISTANT_RUN_NOW_MAX_MESSAGE;\n readonly targetKey = signal<string | null>(null);\n readonly chosen = signal<NhAssistantChosenSubject | null>(null);\n readonly message = signal('');\n readonly starting = signal(false);\n readonly subjectMissing = signal(false);\n readonly receipt = signal<NhAssistantRunNowStarted | null>(null);\n readonly error = signal<NhAssistantError | null>(null);\n /** A refusal of the start explained for running an agent, then as the server names it. */\n readonly errorKeys = computed(() => {\n const error = this.error();\n return error ? [`nh-assistant.run-now.errors.${error.code}`, ...nhAssistantErrorKeys(error)] : [];\n });\n\n /** The whole application as the run catalog names it, or in the reader's language without one. */\n private readonly systemType = computed<AgentSubjectType>(() =>\n this.subjectTypes().find(type => type.isSystem && type.id === NH_ASSISTANT_SYSTEM_SUBJECT_TYPE) ?? {\n id: NH_ASSISTANT_SYSTEM_SUBJECT_TYPE,\n name: this.translate.instant('nh-assistant.run-now.whole-application'),\n pluralName: null,\n entityType: null,\n entityTypeFull: null,\n link: null,\n searchable: this.divisions(),\n isSystem: true\n });\n\n /** What the agent can be run on: the whole application when it works on it, then its object types. */\n readonly targets = computed<RunNowTarget[]>(() => {\n const agent = this.agent();\n const targets: RunNowTarget[] = [];\n if (agent.worksOnApplication) {\n targets.push({ key: NH_ASSISTANT_SYSTEM_SUBJECT_TYPE, type: this.systemType(), perDivision: agent.perDivision === true });\n }\n const named = new Set(agent.worksOnSubjectTypes ?? []);\n for (const type of this.subjectTypes()) {\n if (!type.isSystem && (agent.worksOnAllSubjects === true || named.has(type.id))) {\n targets.push({ key: type.id, type, perDivision: false });\n }\n }\n return targets;\n });\n\n /** The chosen answer, by default the first: the whole application when the agent works on it. */\n readonly target = computed(() => {\n const targets = this.targets();\n return targets.find(item => item.key === this.targetKey()) ?? targets[0] ?? null;\n });\n /** A per-division agent cannot be run while the application lists no divisions. */\n readonly divisionUnavailable = computed(() => this.target()?.perDivision === true && !this.divisions());\n readonly subjectFieldId = computed(() => `${this.id}-subject`);\n readonly subjectErrorId = computed(() => `${this.id}-subject-error`);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n afterNextRender(() => {\n const dialog = this.dialog().nativeElement;\n if (!dialog.open) {\n dialog.showModal();\n }\n this.focusFirst();\n }, { injector: this.injector });\n }\n\n chooseTarget(key: string): void {\n if (this.target()?.key === key) {\n return;\n }\n this.targetKey.set(key);\n this.chosen.set(null);\n this.subjectMissing.set(false);\n this.error.set(null);\n }\n\n onSubject(subject: NhAssistantChosenSubject | null): void {\n this.chosen.set(subject);\n if (subject) {\n this.subjectMissing.set(false);\n }\n }\n\n onMessage(event: Event): void {\n this.message.set((event.target as HTMLTextAreaElement).value);\n }\n\n /** The subject the run is for: the host's, or the one chosen in the form. */\n subjectOfRun(): NhAssistantChosenSubject | null {\n const fixed = this.subject();\n return fixed ? { type: fixed.type, id: fixed.id, displayName: fixed.displayName ?? null } : this.chosen();\n }\n\n submit(): void {\n if (this.starting()) {\n return;\n }\n const subject = this.subjectOfRun();\n if (!subject) {\n this.subjectMissing.set(true);\n this.focusSubject();\n return;\n }\n\n this.starting.set(true);\n this.error.set(null);\n this.subscription?.unsubscribe();\n this.subscription = this.api.startAgent({\n agentId: this.agent().id,\n subjectType: subject.type,\n subjectId: subject.id,\n message: this.message().trim() || null\n }).subscribe({\n next: receipt => {\n const started = { receipt, subject };\n this.starting.set(false);\n this.receipt.set(started);\n this.started.emit(started);\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('[data-receipt-focus]')?.focus(), { injector: this.injector });\n },\n error: (failure: unknown) => {\n this.starting.set(false);\n this.error.set(toNhAssistantError(failure));\n }\n });\n }\n\n open(conversationId: string): void {\n this.close();\n this.openConversation.emit(conversationId);\n }\n\n close(): void {\n const dialog = this.dialog().nativeElement;\n if (dialog.open) {\n dialog.close();\n } else {\n this.onClosed();\n }\n }\n\n /** The native dialog closed, by a button or by Escape. */\n onClosed(): void {\n this.subscription?.unsubscribe();\n this.closed.emit();\n }\n\n /** The name of the subject in the receipt, when the server's type name adds something. */\n receiptTypeName(started: NhAssistantRunNowStarted): string | null {\n const fixed = this.subject();\n if (fixed && fixed.type === started.subject.type && fixed.id === started.subject.id) {\n return fixed.typeName ?? null;\n }\n return this.subjectTypes().find(type => type.id === started.subject.type)?.name ?? null;\n }\n\n receiptLink(started: NhAssistantRunNowStarted): string | null {\n const fixed = this.subject();\n return fixed && fixed.type === started.subject.type && fixed.id === started.subject.id ? fixed.link ?? null : null;\n }\n\n private focusFirst(): void {\n const element = this.host.nativeElement;\n const first = element.querySelector<HTMLElement>('[data-target-choice]:checked')\n ?? element.querySelector<HTMLElement>('textarea');\n first?.focus();\n }\n\n private focusSubject(): void {\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>(`#${this.subjectFieldId()}`)?.focus(), { injector: this.injector });\n }\n}\n","<dialog #dialog class=\"dialog\" [attr.aria-labelledby]=\"id + '-title'\" (close)=\"onClosed()\">\n <div class=\"dialog-body\">\n <header class=\"dialog-header\">\n <h2 [id]=\"id + '-title'\">{{ 'nh-assistant.run-now.title' | translate: { agent: agent().name } }}</h2>\n <button class=\"icon-button\" type=\"button\" [attr.aria-label]=\"'nh-assistant.run-now.close' | translate\" (click)=\"close()\">\n <nh-assistant-icon name=\"close\" />\n </button>\n </header>\n\n @if (receipt(); as started) {\n <!-- The receipt: what happens now, on what, and the conversation the run works in. -->\n <div class=\"stack\" data-receipt>\n <nh-assistant-run-receipt [receipt]=\"started.receipt\" [focusable]=\"true\" />\n <p class=\"muted\" data-receipt-subject>\n <span>{{ 'nh-assistant.run-now.receipt-subject' | translate }}</span>{{ ' ' }}\n <nh-assistant-subject-link\n [subjectType]=\"started.subject.type\"\n [subjectId]=\"started.subject.id\"\n [label]=\"started.subject.displayName ?? started.subject.id\"\n [typeName]=\"receiptTypeName(started)\"\n [link]=\"receiptLink(started)\" />\n </p>\n <div class=\"actions\">\n @if (started.receipt.conversationId; as conversationId) {\n <button class=\"secondary\" type=\"button\" data-open-conversation (click)=\"open(conversationId)\">\n <nh-assistant-icon name=\"link\" />{{ 'nh-assistant.run-now.open-conversation' | translate }}\n </button>\n }\n <button class=\"primary\" type=\"button\" (click)=\"close()\">{{ 'nh-assistant.run-now.done' | translate }}</button>\n </div>\n </div>\n } @else {\n <form class=\"stack\" novalidate (submit)=\"$event.preventDefault(); submit()\">\n @if (subject(); as fixed) {\n <p class=\"muted\" data-fixed-subject>\n <span>{{ 'nh-assistant.run-now.on' | translate }}</span>{{ ' ' }}\n <nh-assistant-subject-link\n [subjectType]=\"fixed.type\"\n [subjectId]=\"fixed.id\"\n [label]=\"fixed.displayName ?? fixed.id\"\n [typeName]=\"fixed.typeName ?? null\"\n [link]=\"fixed.link ?? null\" />\n </p>\n } @else if (targets().length === 0) {\n <p class=\"message warning\" role=\"status\" data-no-target>\n <nh-assistant-icon name=\"warning\" />{{ 'nh-assistant.run-now.no-target' | translate }}\n </p>\n } @else {\n <fieldset class=\"field\">\n <legend [id]=\"id + '-target-label'\">{{ 'nh-assistant.run-now.target' | translate }}</legend>\n <div class=\"choices\" role=\"radiogroup\" [attr.aria-labelledby]=\"id + '-target-label'\">\n @for (item of targets(); track item.key) {\n <label class=\"choice\" [attr.data-target]=\"item.key\">\n <input\n type=\"radio\"\n data-target-choice\n [name]=\"id + '-target'\"\n [value]=\"item.key\"\n [checked]=\"target()?.key === item.key\"\n (change)=\"chooseTarget(item.key)\" />\n <span>\n {{ item.type.isSystem ? item.type.name : (item.type.pluralName ?? item.type.name) }}\n @if (item.perDivision) {\n <small>{{ 'nh-assistant.run-now.per-division' | translate }}</small>\n }\n </span>\n </label>\n }\n </div>\n </fieldset>\n\n @if (target(); as current) {\n <div class=\"field\" data-subject-field>\n <label [for]=\"subjectFieldId()\">\n {{ (current.type.isSystem ? (current.perDivision ? 'nh-assistant.run-now.division' : 'nh-assistant.run-now.application') : 'nh-assistant.run-now.object') | translate: { type: current.type.name } }}\n </label>\n @if (divisionUnavailable()) {\n <p class=\"message warning\" role=\"status\">\n <nh-assistant-icon name=\"warning\" />{{ 'nh-assistant.run-now.no-divisions' | translate }}\n </p>\n } @else {\n <nh-assistant-subject-picker\n [inputId]=\"subjectFieldId()\"\n [subjectType]=\"current.type\"\n [perDivision]=\"current.perDivision\"\n [value]=\"chosen()?.id ?? null\"\n [selectedLabel]=\"chosen()?.displayName ?? null\"\n [invalid]=\"subjectMissing()\"\n [describedBy]=\"subjectMissing() ? subjectErrorId() : null\"\n (subjectChange)=\"onSubject($event)\" />\n }\n @if (subjectMissing()) {\n <p class=\"field-error\" [id]=\"subjectErrorId()\">\n <nh-assistant-icon name=\"warning\" />{{ 'nh-assistant.run-now.subject-required' | translate }}\n </p>\n }\n </div>\n }\n }\n\n <div class=\"field\">\n <label [for]=\"id + '-message'\">{{ 'nh-assistant.run-now.message' | translate }}</label>\n <textarea\n rows=\"3\"\n [id]=\"id + '-message'\"\n [maxLength]=\"maxMessage\"\n [value]=\"message()\"\n [attr.aria-describedby]=\"id + '-message-hint'\"\n (input)=\"onMessage($event)\"></textarea>\n <p class=\"hint\" [id]=\"id + '-message-hint'\">\n <span>{{ 'nh-assistant.run-now.message-hint' | translate }}</span>\n <span class=\"counter\">{{ message().length }}/{{ maxMessage }}</span>\n </p>\n </div>\n\n @if (error(); as failure) {\n <p class=\"form-error\" role=\"alert\" data-run-now-error>\n <nh-assistant-icon name=\"warning\" />{{ errorKeys() | nhAssistantTranslate: failure.code }}\n </p>\n }\n\n <div class=\"actions\">\n <button class=\"secondary\" type=\"button\" (click)=\"close()\">{{ 'nh-assistant.run-now.cancel' | translate }}</button>\n <button\n class=\"primary\"\n type=\"submit\"\n data-run-now-submit\n [disabled]=\"starting() || (subject() === null && (targets().length === 0 || divisionUnavailable()))\">\n <nh-assistant-icon name=\"send\" />{{ (starting() ? 'nh-assistant.run-now.starting' : 'nh-assistant.run-now.submit') | translate }}\n </button>\n </div>\n </form>\n }\n </div>\n</dialog>\n","import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentObjectAgent,\n AgentObjectAgents,\n LiveAgentWorkChanged,\n NhAssistantAgentRunApiService,\n NhAssistantError,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵnhAssistantErrorKeys as nhAssistantErrorKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵtoNhAssistantError as toNhAssistantError\n} from '@newheap/platform-ai-chat';\nimport {\n NhAssistantRunNowAgent,\n NhAssistantRunNowDialogComponent,\n NhAssistantRunNowSubject\n} from './internal/nh-assistant-run-now-dialog.component';\nimport { NhAssistantAgentThreadViewComponent } from './nh-assistant-agent-thread-view.component';\nimport { NhAssistantRunResultComponent } from './nh-assistant-run-result.component';\n\nlet nextId = 0;\n\n/**\n * Failures of the object itself: asking again does not help, the page names an object that does not\n * exist, that the person may not see, or that is no valid reference.\n */\nconst objectFailures = new Set(['assistant-subject-not-found', 'assistant-subject-invalid', 'assistant-subject-type-unknown']);\n\n/**\n * The agents that work on one object, for the object's page, for example on a project: per agent its\n * latest run with the beginning of its result, the whole result on demand in `nh-assistant-run-result`,\n * its open proposals, \"Run now\" for people who may run it (the participants of the object; for the\n * whole application, `nh-system`, the agent's run policy), and on demand its work on the object in\n * `nh-assistant-agent-thread-view`. The server lists only the agents that work on the object and that\n * the person may use, and checks every start again. A failed load reads as its translated code, such as\n * an object that does not exist or that the person may not see, with \"Try again\" where asking again\n * can help. With live updates the list reloads by itself when an agent's work on the object changes.\n */\n@Component({\n selector: 'nh-assistant-object-agents',\n standalone: true,\n imports: [\n DatePipe,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantRunNowDialogComponent,\n NhAssistantAgentThreadViewComponent,\n NhAssistantRunResultComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-object-agents.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantObjectAgentsComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly translate = inject(TranslateService);\n private subscription?: Subscription;\n\n /** The object's type, such as `project`, or `nh-system` for the whole application. */\n readonly subjectType = input.required<string>();\n /** The object's id, or `global` (or `division-…`) for the whole application. */\n readonly subjectId = input.required<string>();\n /** Emits the conversation id of an agent's thread, so the host can open it in the assistant panel. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-object-agents-${nextId++}`;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n /** Why the agents could not be read; `null` after a load that worked. */\n readonly loadError = signal<NhAssistantError | null>(null);\n readonly loadErrorKeys = computed(() => nhAssistantErrorKeys(this.loadError()));\n /** Loading again can help after a failure of the connection or the server, not of the object. */\n readonly loadRetryable = computed(() => {\n const error = this.loadError();\n return error === null || !objectFailures.has(error.code);\n });\n readonly codeKeys = nhAssistantCodeKeys;\n readonly listing = signal<AgentObjectAgents | null>(null);\n readonly agents = computed(() => this.listing()?.agents ?? []);\n /** The agent whose work on the object is shown; one at a time. */\n readonly expanded = signal<string | null>(null);\n /** The agent whose latest result is shown in full; one at a time. */\n readonly resultShown = signal<string | null>(null);\n /** The agent the run-now dialog runs; `null` while it is closed. */\n readonly runningNow = signal<AgentObjectAgent | null>(null);\n readonly runNowAgent = computed<NhAssistantRunNowAgent | null>(() => {\n const agent = this.runningNow();\n return agent ? { id: agent.agentId, name: this.nameOf(agent) } : null;\n });\n /** The object of the page: the run-now dialog runs on it without asking. */\n readonly runNowSubject = computed<NhAssistantRunNowSubject | null>(() => {\n const listing = this.listing();\n return listing\n ? {\n type: listing.subjectType,\n id: listing.subjectId,\n displayName: listing.subjectDisplayName,\n typeName: listing.subjectTypeName ?? null,\n link: listing.subjectLink ?? null\n }\n : null;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.subjectType();\n this.subjectId();\n untracked(() => {\n this.expanded.set(null);\n this.resultShown.set(null);\n this.runningNow.set(null);\n this.fetch(false);\n });\n });\n nhAssistantReloadOnAgentWork(change => this.concerns(change), () => this.fetch(true));\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /** The agent's name: a translation key of an agent in code, or the text of one created as data. */\n nameOf(agent: AgentObjectAgent): string {\n const translated = this.translate.instant(agent.displayNameKey) as string;\n return translated && translated !== agent.displayNameKey ? translated : agent.displayNameKey;\n }\n\n toggleResult(agent: AgentObjectAgent): void {\n this.resultShown.update(current => current === agent.agentId ? null : agent.agentId);\n }\n\n toggleWork(agent: AgentObjectAgent): void {\n this.expanded.update(current => current === agent.agentId ? null : agent.agentId);\n }\n\n runNow(agent: AgentObjectAgent): void {\n this.runningNow.set(agent);\n }\n\n /** A run started: the list shows it as the agent's latest run. */\n onStarted(): void {\n this.fetch(true);\n }\n\n proposalsKey(count: number): string {\n switch (count) {\n case 0:\n return 'nh-assistant.agent-runs.object-agents.proposals-none';\n case 1:\n return 'nh-assistant.agent-runs.object-agents.proposals-one';\n default:\n return 'nh-assistant.agent-runs.object-agents.proposals';\n }\n }\n\n /** Whether a live update concerns the object: its runs, proposals or feedback changed. */\n private concerns(change: LiveAgentWorkChanged): boolean {\n return change.subjectType === this.subjectType() && change.subjectId === this.subjectId();\n }\n\n /**\n * Reads the agents. A quiet reload, after a live update or a start, keeps what is shown when it\n * fails and shows no loading state.\n */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.loadError.set(null);\n }\n\n this.subscription?.unsubscribe();\n this.subscription = this.api.getObjectAgents(this.subjectType(), this.subjectId()).subscribe({\n next: listing => {\n this.listing.set(listing);\n this.loading.set(false);\n this.loadFailed.set(false);\n this.loadError.set(null);\n },\n error: (error: unknown) => {\n if (quiet && this.listing() !== null) {\n return;\n }\n this.listing.set(null);\n this.loading.set(false);\n this.loadFailed.set(true);\n this.loadError.set(toNhAssistantError(error));\n }\n });\n }\n}\n","<section class=\"section\" [attr.aria-labelledby]=\"id + '-title'\" [attr.aria-busy]=\"loading()\">\n <header class=\"section-header\">\n <div>\n <h3 [id]=\"id + '-title'\">{{ 'nh-assistant.agent-runs.object-agents.title' | translate }}</h3>\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.description' | translate }}</p>\n </div>\n <div class=\"toolbar\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </div>\n </header>\n\n @if (loading() && !listing()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.object-agents.loading' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\" data-object-agents-error>\n @if (loadError(); as failure) {\n <p>{{ loadErrorKeys() | nhAssistantTranslate: failure.code }}</p>\n } @else {\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n }\n @if (loadRetryable()) {\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n }\n </div>\n } @else if (agents().length === 0) {\n <p class=\"state\" data-object-agents-empty>{{ 'nh-assistant.agent-runs.object-agents.empty' | translate }}</p>\n } @else {\n <ul class=\"cards\">\n @for (agent of agents(); track agent.agentId) {\n <li class=\"card\" [attr.data-object-agent]=\"agent.agentId\">\n <div class=\"card-header\">\n <strong>{{ [agent.displayNameKey] | nhAssistantTranslate: agent.displayNameKey }}</strong>\n <span class=\"badge\" [class.warning]=\"agent.openProposals > 0\" data-open-proposals>\n {{ proposalsKey(agent.openProposals) | translate: { count: agent.openProposals } }}\n </span>\n </div>\n @if ([agent.descriptionKey] | nhAssistantTranslate: agent.descriptionKey; as description) {\n <p class=\"muted\">{{ description }}</p>\n }\n\n <!-- The latest run: its status and time, and the beginning of its result as plain text. -->\n @if (agent.latestRun; as run) {\n <div class=\"latest-run\" data-latest-run>\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.object-agents.latest' | translate }}</span>\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.danger]=\"run.status === 'failed'\"\n [class.warning]=\"run.status === 'waiting-for-approval'\">{{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}</span>\n <time [attr.datetime]=\"run.at\">{{ run.at | date: 'medium' }}</time>\n @if (run.shadow) {\n <span class=\"badge warning\">{{ 'nh-assistant.agent-runs.object-agents.shadow' | translate }}</span>\n }\n </div>\n @if (run.failureCode; as reason) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.failure' | translate: { reason: (codeKeys(reason) | nhAssistantTranslate: reason) } }}</p>\n }\n @if (run.result; as result) {\n <p class=\"summary result\" data-latest-result>\n <span class=\"visually-hidden\">{{ 'nh-assistant.agent-runs.object-agents.result-label' | translate }}: </span>{{ result }}@if (run.resultTruncated) {…}\n </p>\n } @else {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.no-result' | translate }}</p>\n }\n </div>\n } @else {\n <p class=\"muted\" data-never-run>{{ 'nh-assistant.agent-runs.object-agents.never' | translate }}</p>\n }\n\n <div class=\"card-actions\">\n @if (agent.canStart) {\n <button class=\"primary\" type=\"button\" aria-haspopup=\"dialog\" data-object-run-now (click)=\"runNow(agent)\">\n <nh-assistant-icon name=\"send\" />{{ 'nh-assistant.agent-runs.object-agents.run-now' | translate }}\n </button>\n }\n @if (agent.latestRun) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-toggle-result\n [attr.aria-expanded]=\"resultShown() === agent.agentId\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-result'\"\n (click)=\"toggleResult(agent)\">\n <nh-assistant-icon name=\"page\" />{{ (resultShown() === agent.agentId ? 'nh-assistant.agent-runs.result.hide' : 'nh-assistant.agent-runs.result.show') | translate }}\n </button>\n }\n @if (agent.conversationId) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-toggle-work\n [attr.aria-expanded]=\"expanded() === agent.agentId\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-work'\"\n (click)=\"toggleWork(agent)\">\n <nh-assistant-icon name=\"list\" />{{ (expanded() === agent.agentId ? 'nh-assistant.agent-runs.object-agents.hide-work' : 'nh-assistant.agent-runs.object-agents.show-work') | translate }}\n </button>\n }\n </div>\n\n @if (resultShown() === agent.agentId && agent.latestRun; as run) {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-result'\">\n <nh-assistant-run-result [runId]=\"run.runId\" (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n\n @if (expanded() === agent.agentId) {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-work'\">\n <nh-assistant-agent-thread-view\n [agentId]=\"agent.agentId\"\n [subjectType]=\"subjectType()\"\n [subjectId]=\"subjectId()\"\n (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n </li>\n }\n </ul>\n }\n\n @if (runNowAgent(); as runAgent) {\n <nh-assistant-run-now-dialog\n [agent]=\"runAgent\"\n [subject]=\"runNowSubject()\"\n (started)=\"onStarted()\"\n (openConversation)=\"openConversation.emit($event)\"\n (closed)=\"runningNow.set(null)\" />\n }\n</section>\n","import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentRunHistoryItem,\n NhAssistantAgentRunApiService,\n ɵNhAssistantIconComponent as NhAssistantIconComponent\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantRunResultComponent } from '../nh-assistant-run-result.component';\n\n/** How many runs the history of a board tile reads at a time. */\nconst pageSize = 5;\n\nlet nextId = 0;\n\n/**\n * The runs of one agent for one subject of the whole application, newest first, as a board tile shows\n * them (internal): status, time and the beginning of each result, the whole result on demand in\n * `nh-assistant-run-result`, and more runs on request. The server's people's history (`GET runs`)\n * decides what the reader sees.\n */\n@Component({\n selector: 'nh-assistant-board-history',\n standalone: true,\n imports: [DatePipe, TranslatePipe, NhAssistantIconComponent, NhAssistantRunResultComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <section class=\"board-history\" [attr.aria-labelledby]=\"id + '-title'\" [attr.aria-busy]=\"loading()\">\n <h4 [id]=\"id + '-title'\">{{ 'nh-assistant.agent-runs.board.history-title' | translate }}</h4>\n @if (loading() && runs().length === 0) {\n <p class=\"muted\" role=\"status\">{{ 'nh-assistant.agent-runs.board.history-loading' | translate }}</p>\n } @else if (loadFailed() && runs().length === 0) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else if (runs().length === 0) {\n <p class=\"muted\" data-board-history-empty>{{ 'nh-assistant.agent-runs.board.history-empty' | translate }}</p>\n } @else {\n <ol class=\"history-runs\">\n @for (run of runs(); track run.id) {\n <li class=\"history-run\" [attr.data-board-history-run]=\"run.id\">\n <div class=\"meta\">\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.danger]=\"run.status === 'failed'\"\n [class.warning]=\"run.status === 'waiting-for-approval'\">{{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}</span>\n <time [attr.datetime]=\"timeOf(run)\">{{ timeOf(run) | date: 'medium' }}</time>\n </div>\n @if (run.result; as result) {\n <p class=\"summary result\">{{ result }}@if (run.resultTruncated) {…}</p>\n }\n <div class=\"card-actions\">\n <button\n class=\"text-button\"\n type=\"button\"\n [attr.aria-expanded]=\"shown() === run.id\"\n [attr.aria-controls]=\"id + '-' + run.id\"\n (click)=\"toggle(run.id)\">\n {{ (shown() === run.id ? 'nh-assistant.agent-runs.result.hide' : 'nh-assistant.agent-runs.result.show') | translate }}\n </button>\n </div>\n @if (shown() === run.id) {\n <div class=\"work\" [id]=\"id + '-' + run.id\">\n <nh-assistant-run-result [runId]=\"run.id\" (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n </li>\n }\n </ol>\n @if (runs().length < total()) {\n <button class=\"secondary\" type=\"button\" data-board-history-more [disabled]=\"loading()\" (click)=\"more()\">\n <nh-assistant-icon name=\"list\" />{{ 'nh-assistant.agent-runs.board.history-more' | translate }}\n </button>\n } @else if (limited()) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.board.history-limited' | translate }}</p>\n }\n }\n </section>\n `,\n styleUrl: '../nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantBoardHistoryComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private subscription?: Subscription;\n private page = 1;\n\n readonly agentId = input.required<string>();\n readonly subjectType = input.required<string>();\n readonly subjectId = input.required<string>();\n /** Emits the conversation a shown result offers to open. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-board-history-${nextId++}`;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n readonly runs = signal<AgentRunHistoryItem[]>([]);\n readonly total = signal(0);\n readonly limited = signal(false);\n /** The run whose whole result is shown; one at a time. */\n readonly shown = signal<string | null>(null);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n effect(() => {\n this.agentId();\n this.subjectType();\n this.subjectId();\n untracked(() => this.load());\n });\n }\n\n load(): void {\n this.page = 1;\n this.shown.set(null);\n this.fetch(false);\n }\n\n more(): void {\n this.page++;\n this.fetch(true);\n }\n\n toggle(runId: string): void {\n this.shown.update(current => current === runId ? null : runId);\n }\n\n /** When the run ended, or started, or was queued. */\n timeOf(run: AgentRunHistoryItem): string {\n return run.endedAt ?? run.startedAt ?? run.createdAt;\n }\n\n private fetch(append: boolean): void {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.subscription?.unsubscribe();\n this.subscription = this.api\n .getRunHistory({\n agentId: this.agentId(),\n subjectType: this.subjectType(),\n subjectId: this.subjectId(),\n page: this.page,\n itemsPerPage: pageSize\n })\n .subscribe({\n next: history => {\n this.runs.update(runs => append ? [...runs, ...history.items.filter(item => !runs.some(run => run.id === item.id))] : history.items);\n this.total.set(history.total);\n this.limited.set(history.limited);\n this.loading.set(false);\n },\n error: () => {\n if (append) {\n this.page--;\n }\n this.loading.set(false);\n this.loadFailed.set(true);\n }\n });\n }\n}\n","import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked\n} from '@angular/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport {\n AgentBoard,\n AgentBoardAgent,\n LiveAgentWorkChanged,\n NH_ASSISTANT_SYSTEM_SUBJECT_TYPE,\n NhAssistantAgentRunApiService,\n NhAssistantApiError,\n ɵnhAssistantCodeKeys as nhAssistantCodeKeys,\n ɵNhAssistantIconComponent as NhAssistantIconComponent,\n ɵNhAssistantMarkdownPipe as NhAssistantMarkdownPipe,\n ɵnhAssistantReloadOnAgentWork as nhAssistantReloadOnAgentWork,\n ɵNhAssistantTranslatePipe as NhAssistantTranslatePipe,\n ɵnhAssistantWatchAgentWork as nhAssistantWatchAgentWork\n} from '@newheap/platform-ai-chat';\nimport { NhAssistantBoardHistoryComponent } from './internal/nh-assistant-board-history.component';\nimport {\n NhAssistantRunNowAgent,\n NhAssistantRunNowDialogComponent,\n NhAssistantRunNowSubject\n} from './internal/nh-assistant-run-now-dialog.component';\nimport { NhAssistantAgentInboxComponent } from './nh-assistant-agent-inbox.component';\nimport { NhAssistantRunResultComponent } from './nh-assistant-run-result.component';\n\n/** What a board tile shows below the agent: its latest result, its proposals or its history. */\nexport type NhAssistantBoardPanel = 'result' | 'proposals' | 'history';\n\nlet nextId = 0;\n\n/**\n * The board of one group of agents, for a page of the application such as \"Project management\"\n * (K15): per agent a tile with what it works on, its latest result for the whole application rendered\n * with the assistant's safe Markdown rendering, \"New\" for what arrived since the person's last visit\n * (K16), \"Run now\" for people who may run it, its open proposals in the inbox, and its history with\n * every result on demand. Showing the board records the visit, so the next visit marks what is new\n * after this one. The server decides which agents the person sees: an agent that works on the whole\n * application by its view policy, by default its required policy. With `divisionId` the board shows\n * the work of agents that work per division in that division. With live updates the board reloads by\n * itself when its agents' work changes.\n */\n@Component({\n selector: 'nh-assistant-agent-board',\n standalone: true,\n imports: [\n DatePipe,\n TranslatePipe,\n NhAssistantTranslatePipe,\n NhAssistantIconComponent,\n NhAssistantMarkdownPipe,\n NhAssistantRunNowDialogComponent,\n NhAssistantRunResultComponent,\n NhAssistantAgentInboxComponent,\n NhAssistantBoardHistoryComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './nh-assistant-agent-board.component.html',\n styleUrl: './nh-assistant-agent-runs.scss'\n})\nexport class NhAssistantAgentBoardComponent {\n private readonly api = inject(NhAssistantAgentRunApiService);\n private readonly translate = inject(TranslateService);\n private subscription?: Subscription;\n private visitSubscription?: Subscription;\n /** The board and scope whose visit this view recorded; the visit is recorded once per board shown. */\n private visited: string | null = null;\n /**\n * What the first read of the shown board found: the visit before this one and the agents that were\n * new then. Later reads, after live updates or a start, compare with the visit this view recorded,\n * so the view keeps both: what was new when the board was opened stays new while it is shown.\n */\n private opened: { previousVisit: string | null; newAgents: ReadonlySet<string> } | null = null;\n\n /** The group whose board is shown, such as `project-management`, as the application registered it. */\n readonly group = input.required<string>();\n /** The division whose board is shown; without it the board of the whole application. */\n readonly divisionId = input<string | null>(null);\n /** Emits a conversation a result or proposal offers to open, so the host can open it in the assistant panel. */\n readonly openConversation = output<string>();\n\n readonly id = `nh-assistant-agent-board-${nextId++}`;\n readonly codeKeys = nhAssistantCodeKeys;\n readonly loading = signal(true);\n readonly loadFailed = signal(false);\n /** The board does not exist or the person sees none of its agents. */\n readonly notFound = signal(false);\n /** The board as shown: new since the visit before this one, also after the visit was recorded. */\n readonly board = signal<AgentBoard | null>(null);\n readonly agents = computed(() => this.board()?.agents ?? []);\n /** Per agent what its tile shows below it; one panel per tile. */\n readonly panels = signal<Readonly<Record<string, NhAssistantBoardPanel>>>({});\n /** The agent the run-now dialog runs; `null` while it is closed. */\n readonly runningNow = signal<AgentBoardAgent | null>(null);\n readonly runNowAgent = computed<NhAssistantRunNowAgent | null>(() => {\n const agent = this.runningNow();\n return agent ? { id: agent.agentId, name: this.nameOf(agent) } : null;\n });\n /** The whole application in the board's scope: the run-now dialog runs on it without asking. */\n readonly runNowSubject = computed<NhAssistantRunNowSubject | null>(() => {\n const agent = this.runningNow();\n return agent?.subjectType && agent.subjectId\n ? { type: agent.subjectType, id: agent.subjectId, displayName: agent.subjectDisplayName }\n : null;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.subscription?.unsubscribe();\n this.visitSubscription?.unsubscribe();\n });\n effect(() => {\n this.group();\n this.divisionId();\n untracked(() => {\n this.panels.set({});\n this.runningNow.set(null);\n this.fetch(false);\n });\n });\n // The board shows the work of its agents for the whole application, which reaches the people who\n // may read it only while they watch it.\n nhAssistantWatchAgentWork();\n nhAssistantReloadOnAgentWork(change => this.concerns(change), () => this.fetch(true));\n }\n\n load(): void {\n this.fetch(false);\n }\n\n /** The agent's name: a translation key of an agent in code, or the text of one created as data. */\n nameOf(agent: AgentBoardAgent): string {\n const translated = this.translate.instant(agent.displayNameKey) as string;\n return translated && translated !== agent.displayNameKey ? translated : agent.displayNameKey;\n }\n\n /** What the agent works on, in the reader's language. */\n worksOnOf(agent: AgentBoardAgent): string {\n const worksOn = agent.worksOn;\n const parts: string[] = worksOn.allObjects\n ? [this.translate.instant('nh-assistant.agent-runs.board.works-on-all') as string]\n : worksOn.subjectTypes.map(type => type.pluralName ?? type.name);\n if (worksOn.application) {\n parts.push(this.translate.instant(worksOn.perDivision\n ? 'nh-assistant.agent-runs.board.works-on-application-per-division'\n : 'nh-assistant.agent-runs.board.works-on-application') as string);\n }\n return this.translate.instant('nh-assistant.agent-runs.board.works-on', { list: parts.join(', ') }) as string;\n }\n\n panelOf(agent: AgentBoardAgent): NhAssistantBoardPanel | null {\n return this.panels()[agent.agentId] ?? null;\n }\n\n toggle(agent: AgentBoardAgent, panel: NhAssistantBoardPanel): void {\n this.panels.update(panels => {\n const next = { ...panels };\n if (next[agent.agentId] === panel) {\n delete next[agent.agentId];\n } else {\n next[agent.agentId] = panel;\n }\n return next;\n });\n }\n\n runNow(agent: AgentBoardAgent): void {\n this.runningNow.set(agent);\n }\n\n /** A run started: the board shows it as the agent's latest run. */\n onStarted(): void {\n this.fetch(true);\n }\n\n proposalsKey(count: number): string {\n switch (count) {\n case 0:\n return 'nh-assistant.agent-runs.object-agents.proposals-none';\n case 1:\n return 'nh-assistant.agent-runs.object-agents.proposals-one';\n default:\n return 'nh-assistant.agent-runs.object-agents.proposals';\n }\n }\n\n /** The beginning of a result as Markdown, marked when the result goes on. */\n previewOf(result: string, truncated: boolean): string {\n return truncated ? `${result}…` : result;\n }\n\n /**\n * Whether a live update concerns the board: the work in one of its agents' threads, or a run of the\n * whole application that may have started an agent's first thread.\n */\n private concerns(change: LiveAgentWorkChanged): boolean {\n return this.agents().some(agent => agent.conversationId === change.conversationId)\n || (change.subjectType === NH_ASSISTANT_SYSTEM_SUBJECT_TYPE && change.reason === 'run');\n }\n\n /**\n * Reads the board. A quiet reload, after a live update or a start, keeps what is shown when it\n * fails and shows no loading state. The first time a board is shown, its visit is recorded after it\n * was read, so it still marks what arrived since the visit before.\n */\n private fetch(quiet: boolean): void {\n if (!quiet) {\n this.loading.set(true);\n this.loadFailed.set(false);\n this.notFound.set(false);\n }\n\n const group = this.group();\n const divisionId = this.divisionId();\n this.subscription?.unsubscribe();\n this.subscription = this.api.getBoard(group, divisionId).subscribe({\n next: board => {\n this.board.set(this.asOpened(board, group, divisionId));\n this.loading.set(false);\n this.loadFailed.set(false);\n this.notFound.set(false);\n this.recordVisit(group, divisionId);\n },\n error: (failure: unknown) => {\n if (quiet && this.board() !== null) {\n return;\n }\n this.board.set(null);\n this.loading.set(false);\n const missing = failure instanceof NhAssistantApiError && failure.code === 'assistant-board-not-found';\n this.notFound.set(missing);\n this.loadFailed.set(!missing);\n }\n });\n }\n\n /**\n * The board read compared with the visit before the board was opened: the first read of a board\n * keeps its previous visit and new agents; later reads keep showing them as new.\n */\n private asOpened(board: AgentBoard, group: string, divisionId: string | null): AgentBoard {\n if (this.visited !== `${group}|${divisionId ?? ''}` || this.opened === null) {\n this.opened = {\n previousVisit: board.lastVisitedAt,\n newAgents: new Set(board.agents.filter(agent => agent.isNew).map(agent => agent.agentId))\n };\n return board;\n }\n\n const opened = this.opened;\n return {\n ...board,\n lastVisitedAt: opened.previousVisit,\n agents: board.agents.map(agent => agent.isNew || !opened.newAgents.has(agent.agentId) ? agent : { ...agent, isNew: true })\n };\n }\n\n private recordVisit(group: string, divisionId: string | null): void {\n const key = `${group}|${divisionId ?? ''}`;\n if (this.visited === key) {\n return;\n }\n\n this.visited = key;\n this.visitSubscription?.unsubscribe();\n // A visit that cannot be recorded only means the next visit shows more as new.\n this.visitSubscription = this.api.visitBoard(group, divisionId).subscribe({ error: () => undefined });\n }\n}\n","<section class=\"section\" [attr.aria-labelledby]=\"id + '-title'\" [attr.aria-busy]=\"loading()\" data-agent-board>\n <header class=\"section-header\">\n <div>\n <h3 [id]=\"id + '-title'\">{{ board()?.name ?? ('nh-assistant.agent-runs.board.title' | translate) }}</h3>\n @if (board(); as shown) {\n @if (shown.description; as description) {\n <p class=\"muted\">{{ description }}</p>\n }\n @if (shown.lastVisitedAt; as visitedAt) {\n <p class=\"muted\" data-board-last-visit>{{ 'nh-assistant.agent-runs.board.last-visit' | translate: { date: (visitedAt | date: 'medium') } }}</p>\n } @else {\n <p class=\"muted\" data-board-first-visit>{{ 'nh-assistant.agent-runs.board.first-visit' | translate }}</p>\n }\n }\n </div>\n <div class=\"toolbar\">\n <button class=\"secondary\" type=\"button\" [disabled]=\"loading()\" (click)=\"load()\">\n <nh-assistant-icon name=\"refresh\" />{{ 'nh-assistant.agent-runs.refresh' | translate }}\n </button>\n </div>\n </header>\n\n @if (loading() && !board()) {\n <p class=\"state\" role=\"status\">{{ 'nh-assistant.agent-runs.board.loading' | translate }}</p>\n } @else if (notFound()) {\n <p class=\"state\" data-board-not-found>{{ 'nh-assistant.agent-runs.board.not-found' | translate }}</p>\n } @else if (loadFailed()) {\n <div class=\"state\" role=\"alert\">\n <p>{{ 'nh-assistant.agent-runs.load-failed' | translate }}</p>\n <button class=\"secondary\" type=\"button\" (click)=\"load()\">{{ 'nh-assistant.agent-runs.retry' | translate }}</button>\n </div>\n } @else {\n <ul class=\"cards board-tiles\">\n @for (agent of agents(); track agent.agentId) {\n <li class=\"card board-tile\" [class.new]=\"agent.isNew\" [attr.data-board-agent]=\"agent.agentId\" [attr.aria-labelledby]=\"id + '-' + agent.agentId + '-name'\">\n <div class=\"card-header\">\n <strong [id]=\"id + '-' + agent.agentId + '-name'\">{{ [agent.displayNameKey] | nhAssistantTranslate: agent.displayNameKey }}</strong>\n @if (agent.isNew) {\n <span class=\"badge new\" data-board-new [attr.title]=\"'nh-assistant.agent-runs.board.new-label' | translate\">\n {{ 'nh-assistant.agent-runs.board.new' | translate }}<span class=\"visually-hidden\">: {{ 'nh-assistant.agent-runs.board.new-label' | translate }}</span>\n </span>\n }\n <span class=\"badge\" [class.warning]=\"agent.openProposals > 0\" data-open-proposals>\n {{ proposalsKey(agent.openProposals) | translate: { count: agent.openProposals } }}\n </span>\n </div>\n @if ([agent.descriptionKey] | nhAssistantTranslate: agent.descriptionKey; as description) {\n <p class=\"muted\">{{ description }}</p>\n }\n <p class=\"muted\" data-works-on>{{ worksOnOf(agent) }}</p>\n\n @if (agent.subjectType) {\n @if (agent.latestRun; as run) {\n <div class=\"latest-run\" data-latest-run>\n <div class=\"meta\">\n <span>{{ 'nh-assistant.agent-runs.board.latest' | translate }}</span>\n <span\n class=\"badge\"\n [class.success]=\"run.status === 'completed'\"\n [class.danger]=\"run.status === 'failed'\"\n [class.warning]=\"run.status === 'waiting-for-approval'\">{{ 'nh-assistant.agent-runs.run.status.' + run.status | translate }}</span>\n <time [attr.datetime]=\"run.at\">{{ run.at | date: 'medium' }}</time>\n </div>\n @if (run.failureCode; as reason) {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.failure' | translate: { reason: (codeKeys(reason) | nhAssistantTranslate: reason) } }}</p>\n }\n @if (run.result; as result) {\n <!-- Model output: rendered only through the assistant's safe Markdown rendering. -->\n <div class=\"markdown board-preview\" data-latest-result [innerHTML]=\"previewOf(result, run.resultTruncated) | nhAssistantMarkdown\"></div>\n } @else {\n <p class=\"muted\">{{ 'nh-assistant.agent-runs.object-agents.no-result' | translate }}</p>\n }\n </div>\n } @else {\n <p class=\"muted\" data-never-run>{{ 'nh-assistant.agent-runs.board.never' | translate }}</p>\n }\n } @else {\n <p class=\"muted\" data-board-no-application>\n {{ (agent.worksOn.perDivision ? 'nh-assistant.agent-runs.board.per-division' : 'nh-assistant.agent-runs.board.objects-only') | translate }}\n </p>\n }\n\n <div class=\"card-actions\">\n @if (agent.canStart) {\n <button class=\"primary\" type=\"button\" aria-haspopup=\"dialog\" data-board-run-now (click)=\"runNow(agent)\">\n <nh-assistant-icon name=\"send\" />{{ 'nh-assistant.agent-runs.board.run-now' | translate }}\n </button>\n }\n @if (agent.latestRun) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-board-toggle-result\n [attr.aria-expanded]=\"panelOf(agent) === 'result'\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-panel'\"\n (click)=\"toggle(agent, 'result')\">\n <nh-assistant-icon name=\"page\" />{{ (panelOf(agent) === 'result' ? 'nh-assistant.agent-runs.result.hide' : 'nh-assistant.agent-runs.result.show') | translate }}\n </button>\n }\n @if (agent.openProposals > 0) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-board-toggle-proposals\n [attr.aria-expanded]=\"panelOf(agent) === 'proposals'\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-panel'\"\n (click)=\"toggle(agent, 'proposals')\">\n <nh-assistant-icon name=\"check\" />{{ (panelOf(agent) === 'proposals' ? 'nh-assistant.agent-runs.board.hide-proposals' : 'nh-assistant.agent-runs.board.show-proposals') | translate }}\n </button>\n }\n @if (agent.subjectType) {\n <button\n class=\"secondary\"\n type=\"button\"\n data-board-toggle-history\n [attr.aria-expanded]=\"panelOf(agent) === 'history'\"\n [attr.aria-controls]=\"id + '-' + agent.agentId + '-panel'\"\n (click)=\"toggle(agent, 'history')\">\n <nh-assistant-icon name=\"list\" />{{ (panelOf(agent) === 'history' ? 'nh-assistant.agent-runs.board.hide-history' : 'nh-assistant.agent-runs.board.show-history') | translate }}\n </button>\n }\n </div>\n\n @switch (panelOf(agent)) {\n @case ('result') {\n @if (agent.latestRun; as run) {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-panel'\">\n <nh-assistant-run-result [runId]=\"run.runId\" (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n }\n @case ('proposals') {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-panel'\">\n <!-- One agent's proposals are no visit of the whole inbox; the tile already marks what is new.\n The board of a division shows that division's proposals only. -->\n <nh-assistant-agent-inbox\n [agentId]=\"agent.agentId\"\n [divisionId]=\"divisionId()\"\n [markNew]=\"false\"\n [recordVisit]=\"false\"\n (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n @case ('history') {\n @if (agent.subjectType && agent.subjectId) {\n <div class=\"work\" [id]=\"id + '-' + agent.agentId + '-panel'\">\n <nh-assistant-board-history\n [agentId]=\"agent.agentId\"\n [subjectType]=\"agent.subjectType\"\n [subjectId]=\"agent.subjectId\"\n (openConversation)=\"openConversation.emit($event)\" />\n </div>\n }\n }\n }\n </li>\n }\n </ul>\n }\n\n @if (runNowAgent(); as runAgent) {\n <nh-assistant-run-now-dialog\n [agent]=\"runAgent\"\n [subject]=\"runNowSubject()\"\n (started)=\"onStarted()\"\n (openConversation)=\"openConversation.emit($event)\"\n (closed)=\"runningNow.set(null)\" />\n }\n</section>\n","/*\n * Public API surface of @newheap/platform-ai-chat/agent-runs.\n *\n * Agents that run on their own are a separate entry point, so hosts load the inbox and the\n * subject views only on the routes that show them and the chat panel stays small. The\n * components use `NhAssistantAgentRunApiService` from the `provideNhAssistant` scope and reload\n * by themselves on the agent-work updates of its `NhAssistantLiveService`.\n */\nexport * from './nh-assistant-agent-inbox.component';\nexport * from './nh-assistant-agent-thread-view.component';\nexport * from './nh-assistant-agent-proposals.component';\nexport * from './nh-assistant-run-timeline.component';\nexport * from './nh-assistant-agent-memory.component';\nexport * from './nh-assistant-agent-artifacts.component';\nexport * from './nh-assistant-agent-consultations.component';\nexport * from './nh-assistant-subject-suggestions.component';\nexport * from './nh-assistant-object-agents.component';\nexport * from './nh-assistant-run-result.component';\nexport * from './nh-assistant-agent-board.component';\n\n/*\n * Internal building blocks shared with the administration entry point; they live here so the chat's\n * initial bundle stays small. Not part of the public API; they may change without notice.\n */\nexport {\n NhAssistantRunNowDialogComponent as ɵNhAssistantRunNowDialogComponent,\n NH_ASSISTANT_RUN_NOW_MAX_MESSAGE as ɵNH_ASSISTANT_RUN_NOW_MAX_MESSAGE,\n type NhAssistantRunNowAgent as ɵNhAssistantRunNowAgent,\n type NhAssistantRunNowStarted as ɵNhAssistantRunNowStarted,\n type NhAssistantRunNowSubject as ɵNhAssistantRunNowSubject\n} from './internal/nh-assistant-run-now-dialog.component';\nexport {\n NhAssistantSubjectPickerComponent as ɵNhAssistantSubjectPickerComponent,\n nhAssistantSubjectSearch as ɵnhAssistantSubjectSearch,\n type NhAssistantChosenSubject as ɵNhAssistantChosenSubject\n} from './internal/nh-assistant-subject-picker.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["nhAssistantErrorKeys","toNhAssistantError","NhAssistantIconComponent","NhAssistantSubjectLinkComponent","NhAssistantTranslatePipe","nhAssistantWatchAgentWork","nhAssistantReloadOnAgentWork","nhAssistantCodeKeys","nextId","NhAssistantMarkdownPipe","NhAssistantPickerComponent"],"mappings":";;;;;;;AAwFA;;;;;;;;;;;;;;;;;;;;AAoBG;MAiBU,kCAAkC,CAAA;AAiF7C,IAAA,WAAA,GAAA;AAhFiB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC3C,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAA0B,UAAU,CAAC;AAClD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAGnC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,oDAAmB;;AAE7C,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,qDAAC;AACjC;;;AAGG;AACM,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAyD,IAAI,0DAAC;AACpF,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK,sDAAC;AAClC;;;;AAIG;AACM,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,KAAK,2DAAC;AACvC;;;;AAIG;AACM,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAoC,IAAI,kDAAC;;AAEvD,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK,sDAAC;;AAEzB,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAA6B,IAAI,kDAAC;;QAEhD,IAAA,CAAA,OAAO,GAAG,MAAM,EAAQ;AACjC;;;AAGG;QACM,IAAA,CAAA,gBAAgB,GAAG,MAAM,EAAU;AAEnC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,KAAK,gDAAC;AACpB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAsB,IA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