@memberjunction/ng-conversations 6.1.0-edge.6 → 6.1.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.
- package/dist/lib/components/dialogs/input-dialog.component.d.ts.map +1 -1
- package/dist/lib/components/dialogs/input-dialog.component.js +3 -3
- package/dist/lib/components/dialogs/input-dialog.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.js +4 -4
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.js +2 -2
- package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts +16 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.js +39 -7
- package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.js +159 -107
- package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.d.ts +9 -4
- package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.js +95 -19
- package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
- package/dist/lib/services/delegation-result-parser.d.ts +5 -0
- package/dist/lib/services/delegation-result-parser.d.ts.map +1 -1
- package/dist/lib/services/delegation-result-parser.js +12 -0
- package/dist/lib/services/delegation-result-parser.js.map +1 -1
- package/dist/lib/services/realtime-session-review.service.d.ts +31 -1
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session-review.service.js +63 -8
- package/dist/lib/services/realtime-session-review.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +15 -8
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +62 -14
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/package.json +31 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-delegation-card.component.js","sourceRoot":"","sources":["../../../../src/lib/components/realtime/realtime-delegation-card.component.ts","../../../../src/lib/components/realtime/realtime-delegation-card.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAA4B,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;;;;;;;ICO/E,kCACoD;IADb,wNAAS,sBAAe,KAAC;IAE9D,wBAAyE;IACzE,4BAAM;IAAA,wBAAQ;IAChB,AADgB,iBAAO,EACd;;;IASX,+BAA+B;IAAA,YAAwB;IAAA,iBAAM;;;IAA9B,cAAwB;IAAxB,+CAAwB;;;IAIrD,0BAAyE;;;IAAxC,oDAAiC;;;IAElE,0BAAkE;;;;IAzBpE,AADF,AADF,8BAAwD,aACzB,aACY;IAAA,YAA8B;IAAA,iBAAM;IAC3E,8BAA8B;IAAA,YAAgC;IAAA,iBAAM;IACpE,+BAAiC;IAC/B,uBAA2D;IAAC,yBAC9D;IAAA,iBAAO;IACP,kHAAmB;IAOnB,kCAC+D;IADrB,0MAAS,yBAAkB,KAAC;IAEpE,wBAAoD;IAExD,AADE,iBAAS,EACL;IACN,gCAA6B;IAAA,aAAe;IAAA,iBAAM;IAClD,kHAAsB;IAGtB,gCAA0F;IAGtF,AAFF,kHAA+B,4FAEtB;IAIb,AADE,iBAAM,EACF;;;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D,OAAO,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;IAChF,CAAC;IAED,mDAAmD;IACnD,IAAW,eAAe;QACxB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,sBAAsB,IAAI,CAAC,IAAI,CAAC,SAAS,mBAAmB,GAAG,wCAAwC,CAAC;IACjH,CAAC;yHA3FU,+BAA+B;6DAA/B,+BAA+B;YCG1C,AAjCF,kGAAkB,0FAiCT;;YAjCT,wCA+FC;4BDrEW,YAAY,cAAE,iBAAiB;;iFAI9B,+BAA+B;cAP3C,SAAS;6BACI,IAAI,YACN,6BAA6B,WAC9B,CAAC,YAAY,EAAE,iBAAiB,CAAC;;kBASzC,KAAK;mBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;kBAGxB,KAAK;;kBAGL,MAAM;;kBAGN,MAAM;;kBASN,MAAM;;kFAvBI,+BAA+B","sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MJAccordionModule } from '@memberjunction/ng-ui-components';\nimport { RealtimeDelegationCardVM, FriendlyStepLabel } from './realtime-session-state';\nimport { ParsedDelegationArtifact } from '../../services/delegation-result-parser';\n\n/**\n * Renders a single delegation in the live session thread:\n * - **Working**: a compact card — agent avatar, \"<agent> is working…\", the CURRENT\n * friendly step label, the latest raw message indented + muted beneath it, and a\n * thin progress bar (determinate when the server supplies a percentage,\n * indeterminate shimmer otherwise).\n * - **Done**: COLLAPSED to a single-line chip — `✓ <agent> · <one-line result preview>\n * · via <agent>` — expandable inline (click / chevron) to the full result text.\n * Failures render the `✗` variant.\n *\n * Provenance is a small `via <agent>` badge + a shield icon whose `title` tooltip\n * carries the full provenance sentence (no repeated sentence under every card).\n *\n * DEVELOPER MODE (gear-gated by the overlay shell): when {@link DevMode} is on and the\n * card knows its delegated run id, an \"Open run\" link is revealed that emits\n * {@link OpenRunRequested} so the shell can navigate to the `MJ: AI Agent Runs` record.\n */\n@Component({\n standalone: true,\n selector: 'mj-realtime-delegation-card',\n imports: [CommonModule, MJAccordionModule],\n templateUrl: './realtime-delegation-card.component.html',\n styleUrl: './realtime-delegation-card.component.css'\n})\nexport class RealtimeDelegationCardComponent {\n /** Maximum characters of the result shown in the collapsed done chip. */\n private static readonly PreviewMaxChars = 120;\n\n /** The delegation card view-model to render (immutable — replaced on every update). */\n @Input({ required: true }) Card!: RealtimeDelegationCardVM;\n\n /** Whether developer affordances (the \"Open run\" link) are revealed. */\n @Input() DevMode = false;\n\n /** Emitted with the delegated run's ID when the dev \"Open run\" link is clicked. */\n @Output() OpenRunRequested = new EventEmitter<string>();\n\n /** Emitted when a \"View\" artifact chip is clicked (the overlay focuses the artifact's tab). */\n @Output() OpenArtifactRequested = new EventEmitter<ParsedDelegationArtifact>();\n\n /**\n * Emitted with the call's ID when the WORKING card's ✕ cancel affordance is clicked —\n * EXPLICIT user intent to kill the in-flight delegated run (by deliberate host policy,\n * barge-in alone never cancels delegations; only this button does). The overlay routes\n * it to `RealtimeSessionService.CancelDelegation`, which flips this card to a failed\n * \"Cancelled by user\" result.\n */\n @Output() CancelRequested = new EventEmitter<string>();\n\n /** Whether the done chip is expanded inline to show the full result text. */\n public Expanded = false;\n\n /** The artifacts this (done) delegation produced (empty array while running / when none). */\n public get Artifacts(): ParsedDelegationArtifact[] {\n return this.Card.Done && this.Card.Artifacts ? this.Card.Artifacts : [];\n }\n\n /** Emits the open-artifact request for one of this card's produced artifacts. */\n public OpenArtifact(event: MouseEvent, artifact: ParsedDelegationArtifact): void {\n event.stopPropagation();\n this.OpenArtifactRequested.emit(artifact);\n }\n\n /** True when the dev \"Open run\" link should render (gear on + run id known). */\n public get ShowOpenRun(): boolean {\n return this.DevMode && !!this.Card.RunID;\n }\n\n /** Emits the open-run request for this card's delegated run. */\n public OpenRun(event: MouseEvent): void {\n event.stopPropagation();\n if (this.Card.RunID) {\n this.OpenRunRequested.emit(this.Card.RunID);\n }\n }\n\n /** Emits the cancel request for this (still-working) delegation. */\n public CancelWork(event: MouseEvent): void {\n event.stopPropagation();\n if (!this.Card.Done) {\n this.CancelRequested.emit(this.Card.CallID);\n }\n }\n\n /** Friendly label for the current delegation step (raw message as fallback). */\n public get StepLabel(): string {\n return FriendlyStepLabel(this.Card.LatestStep, this.Card.LatestMessage);\n }\n\n /**\n * Whether to render the latest raw message as the indented detail line. Hidden when\n * it would just repeat the step label (the unknown-step fallback maps label = message).\n */\n public get ShowDetailLine(): boolean {\n return !!this.Card.LatestMessage && this.Card.LatestMessage !== this.StepLabel;\n }\n\n /** Full result text (falls back to the last progress message / a generic line). */\n public get ResultText(): string {\n return this.Card.Result\n || this.Card.LatestMessage\n || `${this.Card.AgentName} completed the delegated work.`;\n }\n\n /** One-line, ~120-char preview of the result for the collapsed chip. */\n public get ResultPreview(): string {\n const oneLine = this.ResultText.replace(/\\s+/g, ' ').trim();\n const max = RealtimeDelegationCardComponent.PreviewMaxChars;\n return oneLine.length > max ? `${oneLine.slice(0, max).trimEnd()}…` : oneLine;\n }\n\n /** Tooltip text for the provenance shield icon. */\n public get ProvenanceTitle(): string {\n const run = this.Card.RunRef ? ` (run ${this.Card.RunRef})` : '';\n return `Result produced by ${this.Card.AgentName}'s own agent run${run} — not invented by the voice co-agent.`;\n }\n}\n","@if (!Card.Done) {\n <!-- WORKING — compact live card -->\n <div class=\"work-card\" role=\"status\" aria-live=\"polite\">\n <div class=\"work-card__head\">\n <div class=\"avatar\" aria-hidden=\"true\">{{ Card.AgentName.charAt(0) }}</div>\n <div class=\"work-card__title\">{{ Card.AgentName }} is working…</div>\n <span class=\"pill pill--running\">\n <i class=\"fa-solid fa-spinner spin\" aria-hidden=\"true\"></i> Running\n </span>\n @if (ShowOpenRun) {\n <button type=\"button\" class=\"dev-link\" (click)=\"OpenRun($event)\"\n title=\"Open the delegated agent run record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open run</span>\n </button>\n }\n <button type=\"button\" class=\"cancel-work\" (click)=\"CancelWork($event)\"\n title=\"Cancel this work\" aria-label=\"Cancel this work\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </div>\n <div class=\"work-card__step\">{{ StepLabel }}</div>\n @if (ShowDetailLine) {\n <div class=\"work-card__detail\">{{ Card.LatestMessage }}</div>\n }\n <div class=\"work-progress\" [class.work-progress--indeterminate]=\"Card.Percentage == null\">\n @if (Card.Percentage != null) {\n <div class=\"work-progress__fill\" [style.width.%]=\"Card.Percentage\"></div>\n } @else {\n <div class=\"work-progress__fill work-progress__fill--slide\"></div>\n }\n </div>\n </div>\n} @else {\n <!-- DONE / FAILED — collapsed single-line chip, expandable inline.\n Migrated from a bespoke done-chip button + chevron + @if(Expanded) detail to\n mj-accordion-panel: title = result chip (mark/agent/preview/via-badge),\n actions = artifact \"View\" + dev \"Open run\" chips, body = full result detail.\n Failed state is carried via .done-accordion--failed on the panel. -->\n <mj-accordion-panel class=\"done-accordion\" [class.done-accordion--failed]=\"!Card.Success\"\n Size=\"sm\" [FlushBody]=\"true\" [(Expanded)]=\"Expanded\">\n <ng-template mjAccordionTitle>\n <i class=\"fa-solid done-chip__mark\" [ngClass]=\"Card.Success ? 'fa-check' : 'fa-xmark'\" aria-hidden=\"true\"></i>\n <span class=\"done-chip__agent\">{{ Card.AgentName }}</span>\n <span class=\"done-chip__sep\" aria-hidden=\"true\">·</span>\n <span class=\"done-chip__preview\">{{ ResultPreview }}</span>\n <span class=\"via-badge\">\n <i class=\"fa-solid fa-shield-halved\" [title]=\"ProvenanceTitle\" aria-hidden=\"true\"></i>\n via {{ Card.AgentName }}\n </span>\n </ng-template>\n <ng-template mjAccordionActions>\n @for (artifact of Artifacts; track artifact.ArtifactVersionID) {\n <button type=\"button\" class=\"artifact-link\" (click)=\"OpenArtifact($event, artifact)\"\n [title]=\"'View ' + artifact.Name\">\n <i class=\"fa-solid fa-file-lines\" aria-hidden=\"true\"></i>\n <span>View</span>\n <i class=\"fa-solid fa-arrow-right\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (ShowOpenRun) {\n <button type=\"button\" class=\"dev-link\" (click)=\"OpenRun($event)\"\n title=\"Open the delegated agent run record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open run</span>\n </button>\n }\n </ng-template>\n <ng-template mjAccordionBody>\n <div class=\"done-detail\">\n <div class=\"done-detail__body\">{{ ResultText }}</div>\n @for (artifact of Artifacts; track artifact.ArtifactVersionID) {\n <button type=\"button\" class=\"artifact-link artifact-link--detail\" (click)=\"OpenArtifact($event, artifact)\"\n [title]=\"'View ' + artifact.Name\">\n <i class=\"fa-solid fa-file-lines\" aria-hidden=\"true\"></i>\n <span>{{ artifact.Name }}</span>\n <i class=\"fa-solid fa-arrow-right\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (Card.RunRef) {\n <div class=\"done-detail__meta\">\n <i class=\"fa-solid fa-shield-halved\" [title]=\"ProvenanceTitle\" aria-hidden=\"true\"></i>\n via {{ Card.AgentName }} · run {{ Card.RunRef }}\n @if (ShowOpenRun) {\n <button type=\"button\" class=\"dev-link dev-link--inline\" (click)=\"OpenRun($event)\"\n title=\"Open the delegated agent run record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open run</span>\n </button>\n }\n </div>\n }\n </div>\n </ng-template>\n </mj-accordion-panel>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"realtime-delegation-card.component.js","sourceRoot":"","sources":["../../../../src/lib/components/realtime/realtime-delegation-card.component.ts","../../../../src/lib/components/realtime/realtime-delegation-card.component.html"],"names":[],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":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MJAccordionModule } from '@memberjunction/ng-ui-components';\nimport { RealtimeDelegationCardVM, FriendlyStepLabel } from './realtime-session-state';\nimport { ParsedDelegationArtifact } from '../../services/delegation-result-parser';\n\n/**\n * Renders a single delegation in the live session thread:\n * - **Working**: a compact card — agent avatar, \"<agent> is working…\", the CURRENT\n * friendly step label, the latest raw message indented + muted beneath it, and a\n * thin progress bar (determinate when the server supplies a percentage,\n * indeterminate shimmer otherwise).\n * - **Done**: COLLAPSED to a single-line chip — `✓ <agent> · <one-line result preview>\n * · via <agent>` — expandable inline (click / chevron) to the full result text.\n * Failures render the `✗` variant.\n *\n * Provenance is a small `via <agent>` badge + a shield icon whose `title` tooltip\n * carries the full provenance sentence (no repeated sentence under every card).\n *\n * DEVELOPER MODE (gear-gated by the overlay shell): when {@link DevMode} is on and the\n * card knows its delegated run id, an \"Open run\" link is revealed that emits\n * {@link OpenRunRequested} so the shell can navigate to the `MJ: AI Agent Runs` record.\n */\n@Component({\n standalone: true,\n selector: 'mj-realtime-delegation-card',\n imports: [CommonModule, MJAccordionModule],\n templateUrl: './realtime-delegation-card.component.html',\n styleUrl: './realtime-delegation-card.component.css'\n})\nexport class RealtimeDelegationCardComponent {\n /** Maximum characters of the result shown in the collapsed done chip. */\n private static readonly PreviewMaxChars = 120;\n\n /** The delegation card view-model to render (immutable — replaced on every update). */\n @Input({ required: true }) Card!: RealtimeDelegationCardVM;\n\n /** Whether developer affordances (the \"Open run\" link) are revealed. */\n @Input() DevMode = false;\n\n /** Emitted with the delegated run's ID when the dev \"Open run\" link is clicked. */\n @Output() OpenRunRequested = new EventEmitter<string>();\n\n /** Emitted when a \"View\" artifact chip is clicked (the overlay focuses the artifact's tab). */\n @Output() OpenArtifactRequested = new EventEmitter<ParsedDelegationArtifact>();\n\n /**\n * Emitted with the call's ID when the WORKING card's ✕ cancel affordance is clicked —\n * EXPLICIT user intent to kill the in-flight delegated run (by deliberate host policy,\n * barge-in alone never cancels delegations; only this button does). The overlay routes\n * it to `RealtimeSessionService.CancelDelegation`, which flips this card to a failed\n * \"Cancelled by user\" result.\n */\n @Output() CancelRequested = new EventEmitter<string>();\n\n /** Whether the done chip is expanded inline to show the full result text. */\n public Expanded = false;\n\n /** The artifacts this (done) delegation produced (empty array while running / when none). Suppressed for direct actions. */\n public get Artifacts(): ParsedDelegationArtifact[] {\n return this.Card.Done && this.Card.Kind !== 'action' && this.Card.Artifacts ? this.Card.Artifacts : [];\n }\n\n /** Emits the open-artifact request for one of this card's produced artifacts. */\n public OpenArtifact(event: MouseEvent, artifact: ParsedDelegationArtifact): void {\n event.stopPropagation();\n this.OpenArtifactRequested.emit(artifact);\n }\n\n /** True when the dev \"Open run\" link should render (gear on + run id known). Suppressed for direct actions. */\n public get ShowOpenRun(): boolean {\n return this.DevMode && this.Card.Kind !== 'action' && !!this.Card.RunID;\n }\n\n /** Emits the open-run request for this card's delegated run. */\n public OpenRun(event: MouseEvent): void {\n event.stopPropagation();\n if (this.Card.RunID) {\n this.OpenRunRequested.emit(this.Card.RunID);\n }\n }\n\n /** Emits the cancel request for this (still-working) delegation. */\n public CancelWork(event: MouseEvent): void {\n event.stopPropagation();\n if (!this.Card.Done) {\n this.CancelRequested.emit(this.Card.CallID);\n }\n }\n\n /** Friendly label for the current delegation step (raw message as fallback). */\n public get StepLabel(): string {\n return FriendlyStepLabel(this.Card.LatestStep, this.Card.LatestMessage);\n }\n\n /**\n * Whether to render the latest raw message as the indented detail line. Hidden when\n * it would just repeat the step label (the unknown-step fallback maps label = message).\n */\n public get ShowDetailLine(): boolean {\n return !!this.Card.LatestMessage && this.Card.LatestMessage !== this.StepLabel;\n }\n\n /** Full result text (falls back to the last progress message / a generic line). */\n public get ResultText(): string {\n return this.Card.Result\n || this.Card.LatestMessage\n || (this.Card.Kind === 'action'\n ? `${this.Card.AgentName} executed.`\n : `${this.Card.AgentName} completed the delegated work.`);\n }\n\n /** One-line, ~120-char preview of the result for the collapsed chip. */\n public get ResultPreview(): string {\n const oneLine = this.ResultText.replace(/\\s+/g, ' ').trim();\n const max = RealtimeDelegationCardComponent.PreviewMaxChars;\n return oneLine.length > max ? `${oneLine.slice(0, max).trimEnd()}…` : oneLine;\n }\n\n /** Tooltip text for the provenance shield icon. */\n public get ProvenanceTitle(): string {\n if (this.Card.Kind === 'action') {\n return `Result produced directly by the ${this.Card.AgentName} action.`;\n }\n const run = this.Card.RunRef ? ` (run ${this.Card.RunRef})` : '';\n return `Result produced by ${this.Card.AgentName}'s own agent run${run} — not invented by the voice co-agent.`;\n }\n}\n","@if (!Card.Done) {\n <!-- WORKING — compact live card -->\n <div class=\"work-card\" role=\"status\" aria-live=\"polite\">\n <div class=\"work-card__head\">\n @if (Card.Kind === 'action') {\n <div class=\"avatar avatar--action\" aria-hidden=\"true\"><i class=\"fa-solid fa-wrench\"></i></div>\n <div class=\"work-card__title\">{{ Card.AgentName }}</div>\n } @else {\n <div class=\"avatar\" aria-hidden=\"true\">{{ Card.AgentName.charAt(0) }}</div>\n <div class=\"work-card__title\">{{ Card.AgentName }} is working…</div>\n }\n <span class=\"pill pill--running\">\n <i class=\"fa-solid fa-spinner spin\" aria-hidden=\"true\"></i> Running\n </span>\n @if (ShowOpenRun) {\n <button type=\"button\" class=\"dev-link\" (click)=\"OpenRun($event)\"\n title=\"Open the delegated agent run record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open run</span>\n </button>\n }\n @if (Card.Kind !== 'action') {\n <button type=\"button\" class=\"cancel-work\" (click)=\"CancelWork($event)\"\n title=\"Cancel this work\" aria-label=\"Cancel this work\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n <div class=\"work-card__step\">{{ StepLabel }}</div>\n @if (ShowDetailLine) {\n <div class=\"work-card__detail\">{{ Card.LatestMessage }}</div>\n }\n <div class=\"work-progress\" [class.work-progress--indeterminate]=\"Card.Percentage == null\">\n @if (Card.Percentage != null) {\n <div class=\"work-progress__fill\" [style.width.%]=\"Card.Percentage\"></div>\n } @else {\n <div class=\"work-progress__fill work-progress__fill--slide\"></div>\n }\n </div>\n </div>\n} @else {\n <!-- DONE / FAILED — collapsed single-line chip, expandable inline.\n Migrated from a bespoke done-chip button + chevron + @if(Expanded) detail to\n mj-accordion-panel: title = result chip (mark/agent/preview/via-badge),\n actions = artifact \"View\" + dev \"Open run\" chips, body = full result detail.\n Failed state is carried via .done-accordion--failed on the panel. -->\n <mj-accordion-panel class=\"done-accordion\" [class.done-accordion--failed]=\"!Card.Success\"\n Size=\"sm\" [FlushBody]=\"true\" [(Expanded)]=\"Expanded\">\n <ng-template mjAccordionTitle>\n <i class=\"fa-solid done-chip__mark\" [ngClass]=\"Card.Success ? 'fa-check' : 'fa-xmark'\" aria-hidden=\"true\"></i>\n <span class=\"done-chip__agent\">{{ Card.AgentName }}</span>\n <span class=\"done-chip__sep\" aria-hidden=\"true\">·</span>\n <span class=\"done-chip__preview\">{{ ResultPreview }}</span>\n <span class=\"via-badge\">\n <i class=\"fa-solid fa-shield-halved\" [title]=\"ProvenanceTitle\" aria-hidden=\"true\"></i>\n @if (Card.Kind === 'action') {\n tool\n } @else {\n via {{ Card.AgentName }}\n }\n </span>\n </ng-template>\n <ng-template mjAccordionActions>\n @for (artifact of Artifacts; track artifact.ArtifactVersionID) {\n <button type=\"button\" class=\"artifact-link\" (click)=\"OpenArtifact($event, artifact)\"\n [title]=\"'View ' + artifact.Name\">\n <i class=\"fa-solid fa-file-lines\" aria-hidden=\"true\"></i>\n <span>View</span>\n <i class=\"fa-solid fa-arrow-right\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (ShowOpenRun) {\n <button type=\"button\" class=\"dev-link\" (click)=\"OpenRun($event)\"\n title=\"Open the delegated agent run record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open run</span>\n </button>\n }\n </ng-template>\n <ng-template mjAccordionBody>\n <div class=\"done-detail\">\n <div class=\"done-detail__body\">{{ ResultText }}</div>\n @for (artifact of Artifacts; track artifact.ArtifactVersionID) {\n <button type=\"button\" class=\"artifact-link artifact-link--detail\" (click)=\"OpenArtifact($event, artifact)\"\n [title]=\"'View ' + artifact.Name\">\n <i class=\"fa-solid fa-file-lines\" aria-hidden=\"true\"></i>\n <span>{{ artifact.Name }}</span>\n <i class=\"fa-solid fa-arrow-right\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (Card.Kind === 'action') {\n <div class=\"done-detail__meta\">\n <i class=\"fa-solid fa-shield-halved\" [title]=\"ProvenanceTitle\" aria-hidden=\"true\"></i>\n Direct action · {{ Card.AgentName }}\n </div>\n } @else if (Card.RunRef) {\n <div class=\"done-detail__meta\">\n <i class=\"fa-solid fa-shield-halved\" [title]=\"ProvenanceTitle\" aria-hidden=\"true\"></i>\n via {{ Card.AgentName }} · run {{ Card.RunRef }}\n @if (ShowOpenRun) {\n <button type=\"button\" class=\"dev-link dev-link--inline\" (click)=\"OpenRun($event)\"\n title=\"Open the delegated agent run record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open run</span>\n </button>\n }\n </div>\n }\n </div>\n </ng-template>\n </mj-accordion-panel>\n}\n"]}
|
|
@@ -27,13 +27,17 @@ export interface RealtimeSessionStreams {
|
|
|
27
27
|
* references and in-place updates reliably re-render.
|
|
28
28
|
*/
|
|
29
29
|
export interface RealtimeDelegationCardVM {
|
|
30
|
-
/**
|
|
30
|
+
/** What this card represents: a delegated agent run, or a direct action invoked by the co-agent. */
|
|
31
|
+
Kind: 'agent' | 'action';
|
|
32
|
+
/** The `invoke-target-agent` or direct-action call this card represents. */
|
|
31
33
|
CallID: string;
|
|
32
|
-
/** Display name of the delegated agent (e.g. "Sage"). */
|
|
34
|
+
/** Display name of the delegated agent (e.g. "Sage") or formatted direct action title (e.g. "Get Weather"). */
|
|
33
35
|
AgentName: string;
|
|
36
|
+
/** The raw tool name when Kind === 'action' (e.g. "File_Storage_List_Objects"). */
|
|
37
|
+
ToolName?: string;
|
|
34
38
|
/** Latest human-readable progress message from the stream. */
|
|
35
39
|
LatestMessage: string;
|
|
36
|
-
/** The delegation phase (`prompt_execution` | `action_execution` | …). */
|
|
40
|
+
/** The delegation phase (`prompt_execution` | `action_execution` | `direct_action` | …). */
|
|
37
41
|
LatestStep: string;
|
|
38
42
|
/** Optional completion percentage (0–100) when the server supplies it. */
|
|
39
43
|
Percentage?: number;
|
|
@@ -93,6 +97,7 @@ export interface RealtimeThreadDividerItem {
|
|
|
93
97
|
}
|
|
94
98
|
/** One entry in the chronological thread: a caption bubble, a delegation card, or a leg divider. */
|
|
95
99
|
export type RealtimeThreadItem = RealtimeThreadCaptionItem | RealtimeThreadDelegationItem | RealtimeThreadDividerItem;
|
|
100
|
+
export { FormatToolName } from '../../services/delegation-result-parser';
|
|
96
101
|
/**
|
|
97
102
|
* Maps a raw delegation step id to a human-friendly phrase. Unknown steps fall back to
|
|
98
103
|
* the raw progress message (per product direction) so the UI never shows snake_case ids.
|
|
@@ -164,7 +169,7 @@ export declare class RealtimeSessionState {
|
|
|
164
169
|
* cards insert alongside them and `ActiveCallId` recomputes normally.
|
|
165
170
|
*/
|
|
166
171
|
StartLiveContinuation(at?: Date): void;
|
|
167
|
-
/** Appends any newly-arrived captions, keeping order relative to delegation cards. */
|
|
172
|
+
/** Appends any newly-arrived captions, keeping order relative to delegation cards, and updates streaming captions in place. */
|
|
168
173
|
private onCaptions;
|
|
169
174
|
/** Inserts a new working card, or immutably replaces the existing one for this CallID. */
|
|
170
175
|
private onProgress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-session-state.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/realtime/realtime-session-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AACzD,OAAO,EACL,eAAe,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,2BAA2B,EACnG,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"realtime-session-state.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/realtime/realtime-session-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AACzD,OAAO,EACL,eAAe,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,2BAA2B,EACnG,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAkB,MAAM,yCAAyC,CAAC;AAEnG;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;IACzC,kDAAkD;IAClD,mBAAmB,EAAE,UAAU,CAAC,0BAA0B,CAAC,CAAC;IAC5D,mCAAmC;IACnC,iBAAiB,EAAE,UAAU,CAAC,wBAAwB,CAAC,CAAC;IACxD,4CAA4C;IAC5C,oBAAoB,EAAE,UAAU,CAAC,2BAA2B,CAAC,CAAC;CAC/D;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,wBAAwB;IACvC,oGAAoG;IACpG,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,+GAA+G;IAC/G,SAAS,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,aAAa,EAAE,MAAM,CAAC;IACtB,4FAA4F;IAC5F,UAAU,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,IAAI,EAAE,OAAO,CAAC;IACd,mFAAmF;IACnF,OAAO,EAAE,OAAO,CAAC;IACjB,yFAAyF;IACzF,MAAM,CAAC,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';
|
|
2
|
+
import { FormatToolName } from '../../services/delegation-result-parser';
|
|
3
|
+
export { FormatToolName } from '../../services/delegation-result-parser';
|
|
2
4
|
/**
|
|
3
5
|
* Maps a raw delegation step id to a human-friendly phrase. Unknown steps fall back to
|
|
4
6
|
* the raw progress message (per product direction) so the UI never shows snake_case ids.
|
|
5
7
|
*/
|
|
6
8
|
export function FriendlyStepLabel(step, message) {
|
|
7
9
|
switch (step) {
|
|
10
|
+
case 'direct_action': return 'Looking that up';
|
|
8
11
|
case 'prompt_execution': return 'Thinking it through';
|
|
9
12
|
case 'action_execution': return 'Running actions';
|
|
10
13
|
case 'subagent_execution': return 'Working with another agent';
|
|
@@ -85,12 +88,16 @@ export class RealtimeSessionState {
|
|
|
85
88
|
*/
|
|
86
89
|
LoadHistoricalItems(items) {
|
|
87
90
|
this.reset();
|
|
88
|
-
this.Items =
|
|
89
|
-
for (const item of items) {
|
|
91
|
+
this.Items = items.map(item => {
|
|
90
92
|
if (item.Kind === 'delegation') {
|
|
91
|
-
|
|
93
|
+
const card = item.Card.Kind
|
|
94
|
+
? item.Card
|
|
95
|
+
: { ...item.Card, Kind: 'agent' };
|
|
96
|
+
this.cardsByCallId.set(card.CallID, card);
|
|
97
|
+
return { Kind: 'delegation', Card: card };
|
|
92
98
|
}
|
|
93
|
-
|
|
99
|
+
return item;
|
|
100
|
+
});
|
|
94
101
|
this.rebuildCards();
|
|
95
102
|
this.recomputeActive();
|
|
96
103
|
this.Changed$.next();
|
|
@@ -124,23 +131,55 @@ export class RealtimeSessionState {
|
|
|
124
131
|
this.recomputeActive();
|
|
125
132
|
this.Changed$.next();
|
|
126
133
|
}
|
|
127
|
-
/** Appends any newly-arrived captions, keeping order relative to delegation cards. */
|
|
134
|
+
/** Appends any newly-arrived captions, keeping order relative to delegation cards, and updates streaming captions in place. */
|
|
128
135
|
onCaptions(captions) {
|
|
129
|
-
if (captions.length
|
|
136
|
+
if (captions.length < this.placedCaptionCount) {
|
|
130
137
|
// Captions are cleared on a fresh session — reset all merge state.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
this.Changed$.next();
|
|
134
|
-
}
|
|
138
|
+
this.reset();
|
|
139
|
+
this.Changed$.next();
|
|
135
140
|
return;
|
|
136
141
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
// Find the indices in this.Items of the captions already placed in the current session.
|
|
143
|
+
// They are the last `placedCaptionCount` caption items in this.Items.
|
|
144
|
+
const liveCaptionIndices = [];
|
|
145
|
+
for (let idx = this.Items.length - 1; idx >= 0 && liveCaptionIndices.length < this.placedCaptionCount; idx--) {
|
|
146
|
+
if (this.Items[idx].Kind === 'caption') {
|
|
147
|
+
liveCaptionIndices.unshift(idx);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
let nextItems = this.Items;
|
|
151
|
+
let hasChanges = false;
|
|
152
|
+
// 1. Update any already-placed captions in place if their text or role changed (e.g. streaming deltas or corrections)
|
|
153
|
+
const updateCount = Math.min(this.placedCaptionCount, liveCaptionIndices.length);
|
|
154
|
+
for (let i = 0; i < updateCount; i++) {
|
|
155
|
+
const itemIdx = liveCaptionIndices[i];
|
|
156
|
+
const current = nextItems[itemIdx];
|
|
157
|
+
const incoming = captions[i];
|
|
158
|
+
if (current.Role !== incoming.Role || current.Text !== incoming.Text) {
|
|
159
|
+
if (nextItems === this.Items) {
|
|
160
|
+
nextItems = [...this.Items];
|
|
161
|
+
}
|
|
162
|
+
nextItems[itemIdx] = { Kind: 'caption', Role: incoming.Role, Text: incoming.Text };
|
|
163
|
+
hasChanges = true;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// 2. Append newly-arrived captions
|
|
167
|
+
if (captions.length > this.placedCaptionCount) {
|
|
168
|
+
const appended = [];
|
|
169
|
+
for (let i = this.placedCaptionCount; i < captions.length; i++) {
|
|
170
|
+
appended.push({ Kind: 'caption', Role: captions[i].Role, Text: captions[i].Text });
|
|
171
|
+
}
|
|
172
|
+
if (nextItems === this.Items) {
|
|
173
|
+
nextItems = [...this.Items];
|
|
174
|
+
}
|
|
175
|
+
nextItems = [...nextItems, ...appended];
|
|
176
|
+
this.placedCaptionCount = captions.length;
|
|
177
|
+
hasChanges = true;
|
|
178
|
+
}
|
|
179
|
+
if (hasChanges) {
|
|
180
|
+
this.Items = nextItems;
|
|
181
|
+
this.Changed$.next();
|
|
140
182
|
}
|
|
141
|
-
this.placedCaptionCount = captions.length;
|
|
142
|
-
this.Items = [...this.Items, ...appended];
|
|
143
|
-
this.Changed$.next();
|
|
144
183
|
}
|
|
145
184
|
/** Inserts a new working card, or immutably replaces the existing one for this CallID. */
|
|
146
185
|
onProgress(progress) {
|
|
@@ -148,6 +187,7 @@ export class RealtimeSessionState {
|
|
|
148
187
|
if (existing) {
|
|
149
188
|
this.replaceCard({
|
|
150
189
|
...existing,
|
|
190
|
+
ToolName: progress.ToolName ?? existing.ToolName,
|
|
151
191
|
LatestStep: progress.Step,
|
|
152
192
|
LatestMessage: progress.Message,
|
|
153
193
|
Percentage: progress.Percentage
|
|
@@ -160,9 +200,12 @@ export class RealtimeSessionState {
|
|
|
160
200
|
}
|
|
161
201
|
/** Creates a working card for a first-seen CallID and appends it to the thread tail. */
|
|
162
202
|
insertCard(progress) {
|
|
203
|
+
const isAction = !!progress.ToolName && progress.ToolName !== 'invoke-target-agent';
|
|
163
204
|
const card = {
|
|
164
205
|
CallID: progress.CallID,
|
|
165
|
-
|
|
206
|
+
Kind: isAction ? 'action' : 'agent',
|
|
207
|
+
ToolName: progress.ToolName,
|
|
208
|
+
AgentName: isAction ? FormatToolName(progress.ToolName) : this.AgentName,
|
|
166
209
|
LatestStep: progress.Step,
|
|
167
210
|
LatestMessage: progress.Message,
|
|
168
211
|
Percentage: progress.Percentage,
|
|
@@ -180,15 +223,48 @@ export class RealtimeSessionState {
|
|
|
180
223
|
onResult(result) {
|
|
181
224
|
const existing = this.cardsByCallId.get(result.CallID);
|
|
182
225
|
if (!existing) {
|
|
183
|
-
|
|
226
|
+
if (!result.ToolName) {
|
|
227
|
+
return; // untracked result without tool name — ignore
|
|
228
|
+
}
|
|
229
|
+
// Create-or-update safety net: if a terminal result arrives without prior progress
|
|
230
|
+
// (e.g. fast direct action or missed stream packet), construct and insert the done card
|
|
231
|
+
// rather than dropping the result.
|
|
232
|
+
const isAction = result.ToolName !== 'invoke-target-agent';
|
|
233
|
+
const toolName = result.ToolName;
|
|
234
|
+
const card = {
|
|
235
|
+
CallID: result.CallID,
|
|
236
|
+
Kind: isAction ? 'action' : 'agent',
|
|
237
|
+
ToolName: toolName,
|
|
238
|
+
AgentName: isAction ? FormatToolName(toolName) : this.AgentName,
|
|
239
|
+
LatestStep: isAction ? 'direct_action' : 'decision_processing',
|
|
240
|
+
LatestMessage: isAction ? `Executed ${FormatToolName(toolName)}` : 'Completed',
|
|
241
|
+
Done: true,
|
|
242
|
+
Success: result.Success,
|
|
243
|
+
Result: result.Output,
|
|
244
|
+
RunRef: this.shortRunRef(result.CallID),
|
|
245
|
+
RunID: result.RunID,
|
|
246
|
+
Artifacts: isAction ? undefined : result.Artifacts,
|
|
247
|
+
StartedAt: Date.now(),
|
|
248
|
+
FinishedAt: Date.now()
|
|
249
|
+
};
|
|
250
|
+
this.cardsByCallId.set(result.CallID, card);
|
|
251
|
+
this.Items = [...this.Items, { Kind: 'delegation', Card: card }];
|
|
252
|
+
this.rebuildCards();
|
|
253
|
+
this.recomputeActive();
|
|
254
|
+
if (!this.HasRunningDelegation) {
|
|
255
|
+
this.Narration = null;
|
|
256
|
+
}
|
|
257
|
+
this.Changed$.next();
|
|
258
|
+
return;
|
|
184
259
|
}
|
|
185
260
|
this.replaceCard({
|
|
186
261
|
...existing,
|
|
262
|
+
ToolName: result.ToolName ?? existing.ToolName,
|
|
187
263
|
Done: true,
|
|
188
264
|
Success: result.Success,
|
|
189
265
|
Result: result.Output,
|
|
190
266
|
RunID: result.RunID ?? existing.RunID,
|
|
191
|
-
Artifacts: result.Artifacts ?? existing.Artifacts,
|
|
267
|
+
Artifacts: existing.Kind === 'action' ? undefined : (result.Artifacts ?? existing.Artifacts),
|
|
192
268
|
FinishedAt: Date.now()
|
|
193
269
|
});
|
|
194
270
|
if (!this.HasRunningDelegation) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-session-state.js","sourceRoot":"","sources":["../../../../src/lib/components/realtime/realtime-session-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAgB,MAAM,MAAM,CAAC;AAwGzD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,OAAe;IAC7D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,kBAAkB,CAAC,CAAC,OAAO,qBAAqB,CAAC;QACtD,KAAK,kBAAkB,CAAC,CAAC,OAAO,iBAAiB,CAAC;QAClD,KAAK,oBAAoB,CAAC,CAAC,OAAO,4BAA4B,CAAC;QAC/D,KAAK,qBAAqB,CAAC,CAAC,OAAO,qBAAqB,CAAC;QACzD,OAAO,CAAC,CAAC,OAAO,OAAO,IAAI,SAAS,CAAC;IACvC,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IACpD,IAAI,QAAQ,GAAG,EAAE,EAAE,CAAC;QAClB,OAAO,GAAG,QAAQ,GAAG,CAAC;IACxB,CAAC;IACD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,QAAQ,GAAG,EAAE,CAAC;IACxB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;;;;;;GAi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GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IACjE,CAAC;IAED,iFAAiF;IACzE,eAAe;QACrB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,CAAC;IAED,6EAA6E;IACrE,WAAW,CAAC,MAAc;QAChC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QAClD,OAAO,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;IACnG,CAAC;IAED,+CAA+C;IACvC,KAAK;QACX,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;CACF","sourcesContent":["import { Observable, Subject, Subscription } from 'rxjs';\nimport {\n RealtimeCaption, RealtimeDelegationProgress, RealtimeDelegationResult, RealtimeDelegationNarration\n} from '../../services/realtime-session.service';\nimport { ParsedDelegationArtifact } from '../../services/delegation-result-parser';\n\n/**\n * The four reactive session streams {@link RealtimeSessionState} merges — structurally\n * satisfied by `RealtimeSessionService`. Narrowed to an interface so the state (and its unit\n * tests) depend only on the streams, not on the full service / GraphQL import chain.\n */\nexport interface RealtimeSessionStreams {\n /** Growing user/assistant caption list. */\n Captions$: Observable<RealtimeCaption[]>;\n /** Progress updates from delegated agent runs. */\n DelegationProgress$: Observable<RealtimeDelegationProgress>;\n /** Terminal delegation results. */\n DelegationResult$: Observable<RealtimeDelegationResult>;\n /** Ephemeral spoken progress narrations. */\n DelegationNarration$: Observable<RealtimeDelegationNarration>;\n}\n\n/**\n * The view-model for one delegated tool/agent call in the live session. Built by\n * {@link RealtimeSessionState} from the `DelegationProgress$` / `DelegationResult$`\n * streams (correlated by `CallID`) and rendered both inline in the session thread\n * and as a compact card in the activity rail.\n *\n * Card objects are treated as IMMUTABLE — every progress/result event REPLACES the\n * card object (and the arrays containing it) so Angular bindings always see fresh\n * references and in-place updates reliably re-render.\n */\nexport interface RealtimeDelegationCardVM {\n /** The `invoke-target-agent` call this card represents. */\n CallID: string;\n /** Display name of the delegated agent (e.g. \"Sage\"). */\n AgentName: string;\n /** Latest human-readable progress message from the stream. */\n LatestMessage: string;\n /** The delegation phase (`prompt_execution` | `action_execution` | …). */\n LatestStep: string;\n /** Optional completion percentage (0–100) when the server supplies it. */\n Percentage?: number;\n /** `true` once the delegation reached a terminal result. */\n Done: boolean;\n /** Whether the delegated work succeeded (meaningful once {@link Done} is true). */\n Success: boolean;\n /** Short run identifier (e.g. \"#a3f1\") if known; shown in expanded provenance detail. */\n RunRef?: string;\n /**\n * ID of the delegated agent run (`MJ: AI Agent Runs`) once the result reports it.\n * Powers the gear-gated \"Open run\" developer link on the card / rail entry.\n */\n RunID?: string;\n /** The real result text once the delegation completes. */\n Result?: string | null;\n /**\n * Artifacts the delegated run produced (set with the terminal result). Powers the\n * \"View\" affordance on done cards / rail entries and the surface panel's artifact tabs.\n */\n Artifacts?: ParsedDelegationArtifact[];\n /** Epoch ms when the first progress event for this call arrived. */\n StartedAt: number;\n /** Epoch ms when the terminal result arrived. */\n FinishedAt?: number;\n}\n\n/** A caption turn (user or assistant) in the unified thread. */\nexport interface RealtimeThreadCaptionItem {\n Kind: 'caption';\n Role: 'User' | 'Assistant';\n Text: string;\n}\n\n/** A delegation card in the unified thread (working → done chip). */\nexport interface RealtimeThreadDelegationItem {\n Kind: 'delegation';\n Card: RealtimeDelegationCardVM;\n}\n\n/**\n * A SESSION-BOUNDARY divider in the unified thread — a subtle, token-styled rule marking\n * where one session leg ends and another begins. Two producers:\n * - review→live continuation ({@link RealtimeSessionState.StartLiveContinuation}):\n * \"Resumed live session · <time>\" before the new live items;\n * - multi-leg session review (`BuildReviewThreadItems` over a `lastSessionId` chain):\n * \"Session leg · started <time>\" between legs, carrying the PREVIOUS leg's CloseReason\n * as a small chip so the reader sees why that leg ended.\n */\nexport interface RealtimeThreadDividerItem {\n Kind: 'divider';\n /** The divider's label (e.g. \"Resumed live session\", \"Session leg\"). */\n Label: string;\n /** Timestamp rendered after the label (\"· <time>\"), or null when unknown. */\n At: Date | null;\n /** Font Awesome icon class rendered before the label (e.g. `fa-solid fa-phone`). */\n Icon: string;\n /** Why the PRECEDING leg closed (review chains only) — rendered as a small chip. */\n CloseReason?: string | null;\n}\n\n/** One entry in the chronological thread: a caption bubble, a delegation card, or a leg divider. */\nexport type RealtimeThreadItem = RealtimeThreadCaptionItem | RealtimeThreadDelegationItem | RealtimeThreadDividerItem;\n\n/**\n * Maps a raw delegation step id to a human-friendly phrase. Unknown steps fall back to\n * the raw progress message (per product direction) so the UI never shows snake_case ids.\n */\nexport function FriendlyStepLabel(step: string, message: string): string {\n switch (step) {\n case 'prompt_execution': return 'Thinking it through';\n case 'action_execution': return 'Running actions';\n case 'subagent_execution': return 'Working with another agent';\n case 'decision_processing': return 'Deciding next steps';\n default: return message || 'Working';\n }\n}\n\n/** Formats an elapsed duration in ms as a compact human string (\"8s\", \"1m 04s\"). */\nexport function FormatElapsed(ms: number): string {\n const totalSec = Math.max(0, Math.round(ms / 1000));\n if (totalSec < 60) {\n return `${totalSec}s`;\n }\n const m = Math.floor(totalSec / 60);\n const s = totalSec % 60;\n return `${m}m ${s.toString().padStart(2, '0')}s`;\n}\n\n/**\n * SINGLE SOURCE of merged live-session state, owned by the overlay shell\n * (`RealtimeSessionOverlayComponent`) and passed via `@Input()` to BOTH the session\n * thread and the activity rail — so the per-CallID card bookkeeping and subscription\n * logic exists exactly once.\n *\n * Merges FOUR reactive streams from {@link RealtimeSessionService}:\n * - `Captions$` — growing user/assistant caption list → appended to {@link Items}.\n * - `DelegationProgress$` — first event per `CallID` inserts a working card at the thread\n * tail; later events REPLACE the card immutably (new object +\n * new arrays) so change detection always fires.\n * - `DelegationResult$` — flips the card to Done/Failed with the real result text.\n * - `DelegationNarration$` — the EPHEMERAL spoken progress note (latest only, never\n * accumulated), cleared when no delegation is running anymore.\n *\n * Consumers subscribe to {@link Changed$} and `markForCheck()`; all exposed collections\n * are replaced (never mutated) on change.\n */\nexport class RealtimeSessionState {\n /** Display name used for new delegation cards (set by the overlay's AgentName input). */\n public AgentName = 'Sage';\n\n /** The merged, chronological thread (captions + delegation cards), oldest first. */\n public Items: RealtimeThreadItem[] = [];\n\n /** All delegation cards of the session, NEWEST first — the activity rail's list. */\n public Cards: RealtimeDelegationCardVM[] = [];\n\n /** Latest ephemeral narration text, or null when none should be shown. */\n public Narration: string | null = null;\n\n /** CallID of the most recently started, still-running delegation (anchors the live note). */\n public ActiveCallId: string | null = null;\n\n /** Emits after every state change so views can mark themselves for check. */\n public readonly Changed$ = new Subject<void>();\n\n /** Number of captions already merged into {@link Items} (append-only bookkeeping). */\n private placedCaptionCount = 0;\n /** Live card lookup by CallID (insertion order = start order). */\n private cardsByCallId = new Map<string, RealtimeDelegationCardVM>();\n private subs: Subscription[] = [];\n\n /** True while at least one delegation is still running. */\n public get HasRunningDelegation(): boolean {\n return this.ActiveCallId !== null;\n }\n\n /** Subscribes to the session streams. Call once from the owning overlay shell. */\n public Attach(voice: RealtimeSessionStreams): void {\n if (this.subs.length > 0) {\n return; // already attached\n }\n this.subs.push(\n voice.Captions$.subscribe(c => this.onCaptions(c)),\n voice.DelegationProgress$.subscribe(p => this.onProgress(p)),\n voice.DelegationResult$.subscribe(r => this.onResult(r)),\n voice.DelegationNarration$.subscribe(n => this.onNarration(n))\n );\n }\n\n /** Unsubscribes from all session streams. Call from the owning shell's ngOnDestroy. */\n public Detach(): void {\n for (const s of this.subs) {\n s.unsubscribe();\n }\n this.subs = [];\n }\n\n /**\n * SESSION REVIEW population path: replaces ALL merged state with a pre-built\n * HISTORICAL thread (caption turns + done delegation cards, oldest first — see\n * `BuildReviewThreadItems`). Resets the live-stream bookkeeping first, so a later\n * live session starts from a clean merge baseline; delegation cards are indexed by\n * CallID so the rail's {@link Cards} list and {@link ActiveCallId} derive normally.\n */\n public LoadHistoricalItems(items: RealtimeThreadItem[]): void {\n this.reset();\n this.Items = [...items];\n for (const item of items) {\n if (item.Kind === 'delegation') {\n this.cardsByCallId.set(item.Card.CallID, item.Card);\n }\n }\n this.rebuildCards();\n this.recomputeActive();\n this.Changed$.next();\n }\n\n /** Clears all merged state and notifies subscribers (e.g. leaving session review). */\n public Clear(): void {\n this.reset();\n this.Changed$.next();\n }\n\n /**\n * REVIEW→LIVE continuation path: KEEPS the historical thread (and its delegation cards\n * in the rail) and appends a \"Resumed live session\" {@link RealtimeThreadDividerItem},\n * then resets only the LIVE-merge bookkeeping so the new session's captions and cards\n * append cleanly AFTER the divider:\n * - `placedCaptionCount` → 0 (the fresh session's caption stream starts empty, so the\n * start-of-session `[]` emission is a no-op rather than a reset);\n * - the ephemeral narration is dropped (nothing is running yet);\n * - historical cards stay indexed by CallID — new live CallIDs are unique, so live\n * cards insert alongside them and `ActiveCallId` recomputes normally.\n */\n public StartLiveContinuation(at: Date = new Date()): void {\n const divider: RealtimeThreadDividerItem = {\n Kind: 'divider',\n Label: 'Resumed live session',\n At: at,\n Icon: 'fa-solid fa-phone'\n };\n this.Items = [...this.Items, divider];\n this.Narration = null;\n this.placedCaptionCount = 0;\n this.recomputeActive();\n this.Changed$.next();\n }\n\n /** Appends any newly-arrived captions, keeping order relative to delegation cards. */\n private onCaptions(captions: RealtimeCaption[]): void {\n if (captions.length <= this.placedCaptionCount) {\n // Captions are cleared on a fresh session — reset all merge state.\n if (captions.length < this.placedCaptionCount) {\n this.reset();\n this.Changed$.next();\n }\n return;\n }\n const appended: RealtimeThreadItem[] = [];\n for (let i = this.placedCaptionCount; i < captions.length; i++) {\n appended.push({ Kind: 'caption', Role: captions[i].Role, Text: captions[i].Text });\n }\n this.placedCaptionCount = captions.length;\n this.Items = [...this.Items, ...appended];\n this.Changed$.next();\n }\n\n /** Inserts a new working card, or immutably replaces the existing one for this CallID. */\n private onProgress(progress: RealtimeDelegationProgress): void {\n const existing = this.cardsByCallId.get(progress.CallID);\n if (existing) {\n this.replaceCard({\n ...existing,\n LatestStep: progress.Step,\n LatestMessage: progress.Message,\n Percentage: progress.Percentage\n });\n } else {\n this.insertCard(progress);\n }\n this.Changed$.next();\n }\n\n /** Creates a working card for a first-seen CallID and appends it to the thread tail. */\n private insertCard(progress: RealtimeDelegationProgress): void {\n const card: RealtimeDelegationCardVM = {\n CallID: progress.CallID,\n AgentName: this.AgentName,\n LatestStep: progress.Step,\n LatestMessage: progress.Message,\n Percentage: progress.Percentage,\n Done: false,\n Success: false,\n RunRef: this.shortRunRef(progress.CallID),\n StartedAt: Date.now()\n };\n this.cardsByCallId.set(progress.CallID, card);\n this.Items = [...this.Items, { Kind: 'delegation', Card: card }];\n this.rebuildCards();\n this.recomputeActive();\n }\n\n /** Flips the card for a finished delegation to Done/Failed with its real result. */\n private onResult(result: RealtimeDelegationResult): void {\n const existing = this.cardsByCallId.get(result.CallID);\n if (!existing) {\n return; // non-delegation tool result (no card was ever created) — ignore\n }\n this.replaceCard({\n ...existing,\n Done: true,\n Success: result.Success,\n Result: result.Output,\n RunID: result.RunID ?? existing.RunID,\n Artifacts: result.Artifacts ?? existing.Artifacts,\n FinishedAt: Date.now()\n });\n if (!this.HasRunningDelegation) {\n // All delegations finished — the live narration note fades away.\n this.Narration = null;\n }\n this.Changed$.next();\n }\n\n /** Latest narration REPLACES the previous one (never accumulated). */\n private onNarration(narration: RealtimeDelegationNarration): void {\n this.Narration = narration.Text;\n this.Changed$.next();\n }\n\n /**\n * Immutable replacement of a card: new card object, new thread-item wrapper, new\n * Items array, rebuilt Cards array — so every binding sees a fresh reference.\n */\n private replaceCard(card: RealtimeDelegationCardVM): void {\n this.cardsByCallId.set(card.CallID, card);\n const idx = this.Items.findIndex(i => i.Kind === 'delegation' && i.Card.CallID === card.CallID);\n if (idx >= 0) {\n const next = [...this.Items];\n next[idx] = { Kind: 'delegation', Card: card };\n this.Items = next;\n }\n this.rebuildCards();\n this.recomputeActive();\n }\n\n /** Rebuilds the rail's newest-first card list from the (start-ordered) map. */\n private rebuildCards(): void {\n this.Cards = Array.from(this.cardsByCallId.values()).reverse();\n }\n\n /** Recomputes which still-running delegation anchors the live narration note. */\n private recomputeActive(): void {\n const running = this.Cards.find(c => !c.Done);\n this.ActiveCallId = running ? running.CallID : null;\n }\n\n /** Derives a short, stable run reference (e.g. \"#a3f1\") from the call id. */\n private shortRunRef(callId: string): string {\n const compact = callId.replace(/[^a-z0-9]/gi, '');\n return compact.length >= 4 ? `#${compact.slice(-4).toLowerCase()}` : `#${compact.toLowerCase()}`;\n }\n\n /** Clears all merged state (fresh session). */\n private reset(): void {\n this.Items = [];\n this.Cards = [];\n this.Narration = null;\n this.ActiveCallId = null;\n this.placedCaptionCount = 0;\n this.cardsByCallId.clear();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"realtime-session-state.js","sourceRoot":"","sources":["../../../../src/lib/components/realtime/realtime-session-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAgB,MAAM,MAAM,CAAC;AAIzD,OAAO,EAA4B,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAwGnG,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE;;;GAGG;AACH,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OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,CAAC;IAED,6EAA6E;IACrE,WAAW,CAAC,MAAc;QAChC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QAClD,OAAO,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;IACnG,CAAC;IAED,+CAA+C;IACvC,KAAK;QACX,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;CACF","sourcesContent":["import { Observable, Subject, Subscription } from 'rxjs';\nimport {\n RealtimeCaption, RealtimeDelegationProgress, RealtimeDelegationResult, RealtimeDelegationNarration\n} from '../../services/realtime-session.service';\nimport { ParsedDelegationArtifact, FormatToolName } from '../../services/delegation-result-parser';\n\n/**\n * The four reactive session streams {@link RealtimeSessionState} merges — structurally\n * satisfied by `RealtimeSessionService`. Narrowed to an interface so the state (and its unit\n * tests) depend only on the streams, not on the full service / GraphQL import chain.\n */\nexport interface RealtimeSessionStreams {\n /** Growing user/assistant caption list. */\n Captions$: Observable<RealtimeCaption[]>;\n /** Progress updates from delegated agent runs. */\n DelegationProgress$: Observable<RealtimeDelegationProgress>;\n /** Terminal delegation results. */\n DelegationResult$: Observable<RealtimeDelegationResult>;\n /** Ephemeral spoken progress narrations. */\n DelegationNarration$: Observable<RealtimeDelegationNarration>;\n}\n\n/**\n * The view-model for one delegated tool/agent call in the live session. Built by\n * {@link RealtimeSessionState} from the `DelegationProgress$` / `DelegationResult$`\n * streams (correlated by `CallID`) and rendered both inline in the session thread\n * and as a compact card in the activity rail.\n *\n * Card objects are treated as IMMUTABLE — every progress/result event REPLACES the\n * card object (and the arrays containing it) so Angular bindings always see fresh\n * references and in-place updates reliably re-render.\n */\nexport interface RealtimeDelegationCardVM {\n /** What this card represents: a delegated agent run, or a direct action invoked by the co-agent. */\n Kind: 'agent' | 'action';\n /** The `invoke-target-agent` or direct-action call this card represents. */\n CallID: string;\n /** Display name of the delegated agent (e.g. \"Sage\") or formatted direct action title (e.g. \"Get Weather\"). */\n AgentName: string;\n /** The raw tool name when Kind === 'action' (e.g. \"File_Storage_List_Objects\"). */\n ToolName?: string;\n /** Latest human-readable progress message from the stream. */\n LatestMessage: string;\n /** The delegation phase (`prompt_execution` | `action_execution` | `direct_action` | …). */\n LatestStep: string;\n /** Optional completion percentage (0–100) when the server supplies it. */\n Percentage?: number;\n /** `true` once the delegation reached a terminal result. */\n Done: boolean;\n /** Whether the delegated work succeeded (meaningful once {@link Done} is true). */\n Success: boolean;\n /** Short run identifier (e.g. \"#a3f1\") if known; shown in expanded provenance detail. */\n RunRef?: string;\n /**\n * ID of the delegated agent run (`MJ: AI Agent Runs`) once the result reports it.\n * Powers the gear-gated \"Open run\" developer link on the card / rail entry.\n */\n RunID?: string;\n /** The real result text once the delegation completes. */\n Result?: string | null;\n /**\n * Artifacts the delegated run produced (set with the terminal result). Powers the\n * \"View\" affordance on done cards / rail entries and the surface panel's artifact tabs.\n */\n Artifacts?: ParsedDelegationArtifact[];\n /** Epoch ms when the first progress event for this call arrived. */\n StartedAt: number;\n /** Epoch ms when the terminal result arrived. */\n FinishedAt?: number;\n}\n\n/** A caption turn (user or assistant) in the unified thread. */\nexport interface RealtimeThreadCaptionItem {\n Kind: 'caption';\n Role: 'User' | 'Assistant';\n Text: string;\n}\n\n/** A delegation card in the unified thread (working → done chip). */\nexport interface RealtimeThreadDelegationItem {\n Kind: 'delegation';\n Card: RealtimeDelegationCardVM;\n}\n\n/**\n * A SESSION-BOUNDARY divider in the unified thread — a subtle, token-styled rule marking\n * where one session leg ends and another begins. Two producers:\n * - review→live continuation ({@link RealtimeSessionState.StartLiveContinuation}):\n * \"Resumed live session · <time>\" before the new live items;\n * - multi-leg session review (`BuildReviewThreadItems` over a `lastSessionId` chain):\n * \"Session leg · started <time>\" between legs, carrying the PREVIOUS leg's CloseReason\n * as a small chip so the reader sees why that leg ended.\n */\nexport interface RealtimeThreadDividerItem {\n Kind: 'divider';\n /** The divider's label (e.g. \"Resumed live session\", \"Session leg\"). */\n Label: string;\n /** Timestamp rendered after the label (\"· <time>\"), or null when unknown. */\n At: Date | null;\n /** Font Awesome icon class rendered before the label (e.g. `fa-solid fa-phone`). */\n Icon: string;\n /** Why the PRECEDING leg closed (review chains only) — rendered as a small chip. */\n CloseReason?: string | null;\n}\n\n/** One entry in the chronological thread: a caption bubble, a delegation card, or a leg divider. */\nexport type RealtimeThreadItem = RealtimeThreadCaptionItem | RealtimeThreadDelegationItem | RealtimeThreadDividerItem;\n\nexport { FormatToolName } from '../../services/delegation-result-parser';\n\n/**\n * Maps a raw delegation step id to a human-friendly phrase. Unknown steps fall back to\n * the raw progress message (per product direction) so the UI never shows snake_case ids.\n */\nexport function FriendlyStepLabel(step: string, message: string): string {\n switch (step) {\n case 'direct_action': return 'Looking that up';\n case 'prompt_execution': return 'Thinking it through';\n case 'action_execution': return 'Running actions';\n case 'subagent_execution': return 'Working with another agent';\n case 'decision_processing': return 'Deciding next steps';\n default: return message || 'Working';\n }\n}\n\n/** Formats an elapsed duration in ms as a compact human string (\"8s\", \"1m 04s\"). */\nexport function FormatElapsed(ms: number): string {\n const totalSec = Math.max(0, Math.round(ms / 1000));\n if (totalSec < 60) {\n return `${totalSec}s`;\n }\n const m = Math.floor(totalSec / 60);\n const s = totalSec % 60;\n return `${m}m ${s.toString().padStart(2, '0')}s`;\n}\n\n/**\n * SINGLE SOURCE of merged live-session state, owned by the overlay shell\n * (`RealtimeSessionOverlayComponent`) and passed via `@Input()` to BOTH the session\n * thread and the activity rail — so the per-CallID card bookkeeping and subscription\n * logic exists exactly once.\n *\n * Merges FOUR reactive streams from {@link RealtimeSessionService}:\n * - `Captions$` — growing user/assistant caption list → appended to {@link Items}.\n * - `DelegationProgress$` — first event per `CallID` inserts a working card at the thread\n * tail; later events REPLACE the card immutably (new object +\n * new arrays) so change detection always fires.\n * - `DelegationResult$` — flips the card to Done/Failed with the real result text.\n * - `DelegationNarration$` — the EPHEMERAL spoken progress note (latest only, never\n * accumulated), cleared when no delegation is running anymore.\n *\n * Consumers subscribe to {@link Changed$} and `markForCheck()`; all exposed collections\n * are replaced (never mutated) on change.\n */\nexport class RealtimeSessionState {\n /** Display name used for new delegation cards (set by the overlay's AgentName input). */\n public AgentName = 'Sage';\n\n /** The merged, chronological thread (captions + delegation cards), oldest first. */\n public Items: RealtimeThreadItem[] = [];\n\n /** All delegation cards of the session, NEWEST first — the activity rail's list. */\n public Cards: RealtimeDelegationCardVM[] = [];\n\n /** Latest ephemeral narration text, or null when none should be shown. */\n public Narration: string | null = null;\n\n /** CallID of the most recently started, still-running delegation (anchors the live note). */\n public ActiveCallId: string | null = null;\n\n /** Emits after every state change so views can mark themselves for check. */\n public readonly Changed$ = new Subject<void>();\n\n /** Number of captions already merged into {@link Items} (append-only bookkeeping). */\n private placedCaptionCount = 0;\n /** Live card lookup by CallID (insertion order = start order). */\n private cardsByCallId = new Map<string, RealtimeDelegationCardVM>();\n private subs: Subscription[] = [];\n\n /** True while at least one delegation is still running. */\n public get HasRunningDelegation(): boolean {\n return this.ActiveCallId !== null;\n }\n\n /** Subscribes to the session streams. Call once from the owning overlay shell. */\n public Attach(voice: RealtimeSessionStreams): void {\n if (this.subs.length > 0) {\n return; // already attached\n }\n this.subs.push(\n voice.Captions$.subscribe(c => this.onCaptions(c)),\n voice.DelegationProgress$.subscribe(p => this.onProgress(p)),\n voice.DelegationResult$.subscribe(r => this.onResult(r)),\n voice.DelegationNarration$.subscribe(n => this.onNarration(n))\n );\n }\n\n /** Unsubscribes from all session streams. Call from the owning shell's ngOnDestroy. */\n public Detach(): void {\n for (const s of this.subs) {\n s.unsubscribe();\n }\n this.subs = [];\n }\n\n /**\n * SESSION REVIEW population path: replaces ALL merged state with a pre-built\n * HISTORICAL thread (caption turns + done delegation cards, oldest first — see\n * `BuildReviewThreadItems`). Resets the live-stream bookkeeping first, so a later\n * live session starts from a clean merge baseline; delegation cards are indexed by\n * CallID so the rail's {@link Cards} list and {@link ActiveCallId} derive normally.\n */\n public LoadHistoricalItems(items: RealtimeThreadItem[]): void {\n this.reset();\n this.Items = items.map(item => {\n if (item.Kind === 'delegation') {\n const card: RealtimeDelegationCardVM = item.Card.Kind\n ? item.Card\n : { ...item.Card, Kind: 'agent' };\n this.cardsByCallId.set(card.CallID, card);\n return { Kind: 'delegation', Card: card };\n }\n return item;\n });\n this.rebuildCards();\n this.recomputeActive();\n this.Changed$.next();\n }\n\n /** Clears all merged state and notifies subscribers (e.g. leaving session review). */\n public Clear(): void {\n this.reset();\n this.Changed$.next();\n }\n\n /**\n * REVIEW→LIVE continuation path: KEEPS the historical thread (and its delegation cards\n * in the rail) and appends a \"Resumed live session\" {@link RealtimeThreadDividerItem},\n * then resets only the LIVE-merge bookkeeping so the new session's captions and cards\n * append cleanly AFTER the divider:\n * - `placedCaptionCount` → 0 (the fresh session's caption stream starts empty, so the\n * start-of-session `[]` emission is a no-op rather than a reset);\n * - the ephemeral narration is dropped (nothing is running yet);\n * - historical cards stay indexed by CallID — new live CallIDs are unique, so live\n * cards insert alongside them and `ActiveCallId` recomputes normally.\n */\n public StartLiveContinuation(at: Date = new Date()): void {\n const divider: RealtimeThreadDividerItem = {\n Kind: 'divider',\n Label: 'Resumed live session',\n At: at,\n Icon: 'fa-solid fa-phone'\n };\n this.Items = [...this.Items, divider];\n this.Narration = null;\n this.placedCaptionCount = 0;\n this.recomputeActive();\n this.Changed$.next();\n }\n\n /** Appends any newly-arrived captions, keeping order relative to delegation cards, and updates streaming captions in place. */\n private onCaptions(captions: RealtimeCaption[]): void {\n if (captions.length < this.placedCaptionCount) {\n // Captions are cleared on a fresh session — reset all merge state.\n this.reset();\n this.Changed$.next();\n return;\n }\n\n // Find the indices in this.Items of the captions already placed in the current session.\n // They are the last `placedCaptionCount` caption items in this.Items.\n const liveCaptionIndices: number[] = [];\n for (let idx = this.Items.length - 1; idx >= 0 && liveCaptionIndices.length < this.placedCaptionCount; idx--) {\n if (this.Items[idx].Kind === 'caption') {\n liveCaptionIndices.unshift(idx);\n }\n }\n\n let nextItems = this.Items;\n let hasChanges = false;\n\n // 1. Update any already-placed captions in place if their text or role changed (e.g. streaming deltas or corrections)\n const updateCount = Math.min(this.placedCaptionCount, liveCaptionIndices.length);\n for (let i = 0; i < updateCount; i++) {\n const itemIdx = liveCaptionIndices[i];\n const current = nextItems[itemIdx] as RealtimeThreadCaptionItem;\n const incoming = captions[i];\n if (current.Role !== incoming.Role || current.Text !== incoming.Text) {\n if (nextItems === this.Items) {\n nextItems = [...this.Items];\n }\n nextItems[itemIdx] = { Kind: 'caption', Role: incoming.Role, Text: incoming.Text };\n hasChanges = true;\n }\n }\n\n // 2. Append newly-arrived captions\n if (captions.length > this.placedCaptionCount) {\n const appended: RealtimeThreadItem[] = [];\n for (let i = this.placedCaptionCount; i < captions.length; i++) {\n appended.push({ Kind: 'caption', Role: captions[i].Role, Text: captions[i].Text });\n }\n if (nextItems === this.Items) {\n nextItems = [...this.Items];\n }\n nextItems = [...nextItems, ...appended];\n this.placedCaptionCount = captions.length;\n hasChanges = true;\n }\n\n if (hasChanges) {\n this.Items = nextItems;\n this.Changed$.next();\n }\n }\n\n /** Inserts a new working card, or immutably replaces the existing one for this CallID. */\n private onProgress(progress: RealtimeDelegationProgress): void {\n const existing = this.cardsByCallId.get(progress.CallID);\n if (existing) {\n this.replaceCard({\n ...existing,\n ToolName: progress.ToolName ?? existing.ToolName,\n LatestStep: progress.Step,\n LatestMessage: progress.Message,\n Percentage: progress.Percentage\n });\n } else {\n this.insertCard(progress);\n }\n this.Changed$.next();\n }\n\n /** Creates a working card for a first-seen CallID and appends it to the thread tail. */\n private insertCard(progress: RealtimeDelegationProgress): void {\n const isAction = !!progress.ToolName && progress.ToolName !== 'invoke-target-agent';\n const card: RealtimeDelegationCardVM = {\n CallID: progress.CallID,\n Kind: isAction ? 'action' : 'agent',\n ToolName: progress.ToolName,\n AgentName: isAction ? FormatToolName(progress.ToolName!) : this.AgentName,\n LatestStep: progress.Step,\n LatestMessage: progress.Message,\n Percentage: progress.Percentage,\n Done: false,\n Success: false,\n RunRef: this.shortRunRef(progress.CallID),\n StartedAt: Date.now()\n };\n this.cardsByCallId.set(progress.CallID, card);\n this.Items = [...this.Items, { Kind: 'delegation', Card: card }];\n this.rebuildCards();\n this.recomputeActive();\n }\n\n /** Flips the card for a finished delegation to Done/Failed with its real result. */\n private onResult(result: RealtimeDelegationResult): void {\n const existing = this.cardsByCallId.get(result.CallID);\n if (!existing) {\n if (!result.ToolName) {\n return; // untracked result without tool name — ignore\n }\n // Create-or-update safety net: if a terminal result arrives without prior progress\n // (e.g. fast direct action or missed stream packet), construct and insert the done card\n // rather than dropping the result.\n const isAction = result.ToolName !== 'invoke-target-agent';\n const toolName = result.ToolName;\n const card: RealtimeDelegationCardVM = {\n CallID: result.CallID,\n Kind: isAction ? 'action' : 'agent',\n ToolName: toolName,\n AgentName: isAction ? FormatToolName(toolName) : this.AgentName,\n LatestStep: isAction ? 'direct_action' : 'decision_processing',\n LatestMessage: isAction ? `Executed ${FormatToolName(toolName)}` : 'Completed',\n Done: true,\n Success: result.Success,\n Result: result.Output,\n RunRef: this.shortRunRef(result.CallID),\n RunID: result.RunID,\n Artifacts: isAction ? undefined : result.Artifacts,\n StartedAt: Date.now(),\n FinishedAt: Date.now()\n };\n this.cardsByCallId.set(result.CallID, card);\n this.Items = [...this.Items, { Kind: 'delegation', Card: card }];\n this.rebuildCards();\n this.recomputeActive();\n if (!this.HasRunningDelegation) {\n this.Narration = null;\n }\n this.Changed$.next();\n return;\n }\n this.replaceCard({\n ...existing,\n ToolName: result.ToolName ?? existing.ToolName,\n Done: true,\n Success: result.Success,\n Result: result.Output,\n RunID: result.RunID ?? existing.RunID,\n Artifacts: existing.Kind === 'action' ? undefined : (result.Artifacts ?? existing.Artifacts),\n FinishedAt: Date.now()\n });\n if (!this.HasRunningDelegation) {\n // All delegations finished — the live narration note fades away.\n this.Narration = null;\n }\n this.Changed$.next();\n }\n\n /** Latest narration REPLACES the previous one (never accumulated). */\n private onNarration(narration: RealtimeDelegationNarration): void {\n this.Narration = narration.Text;\n this.Changed$.next();\n }\n\n /**\n * Immutable replacement of a card: new card object, new thread-item wrapper, new\n * Items array, rebuilt Cards array — so every binding sees a fresh reference.\n */\n private replaceCard(card: RealtimeDelegationCardVM): void {\n this.cardsByCallId.set(card.CallID, card);\n const idx = this.Items.findIndex(i => i.Kind === 'delegation' && i.Card.CallID === card.CallID);\n if (idx >= 0) {\n const next = [...this.Items];\n next[idx] = { Kind: 'delegation', Card: card };\n this.Items = next;\n }\n this.rebuildCards();\n this.recomputeActive();\n }\n\n /** Rebuilds the rail's newest-first card list from the (start-ordered) map. */\n private rebuildCards(): void {\n this.Cards = Array.from(this.cardsByCallId.values()).reverse();\n }\n\n /** Recomputes which still-running delegation anchors the live narration note. */\n private recomputeActive(): void {\n const running = this.Cards.find(c => !c.Done);\n this.ActiveCallId = running ? running.CallID : null;\n }\n\n /** Derives a short, stable run reference (e.g. \"#a3f1\") from the call id. */\n private shortRunRef(callId: string): string {\n const compact = callId.replace(/[^a-z0-9]/gi, '');\n return compact.length >= 4 ? `#${compact.slice(-4).toLowerCase()}` : `#${compact.toLowerCase()}`;\n }\n\n /** Clears all merged state (fresh session). */\n private reset(): void {\n this.Items = [];\n this.Cards = [];\n this.Narration = null;\n this.ActiveCallId = null;\n this.placedCaptionCount = 0;\n this.cardsByCallId.clear();\n }\n}\n"]}
|
|
@@ -42,4 +42,9 @@ export interface ParsedDelegationResult {
|
|
|
42
42
|
* mirroring the spoken path, which feeds whatever came back to the model verbatim.
|
|
43
43
|
*/
|
|
44
44
|
export declare function ParseDelegationResultJson(resultJson: string): ParsedDelegationResult;
|
|
45
|
+
/**
|
|
46
|
+
* Convert snake_case or colon-delimited tool names (e.g. `File_Storage_List_Objects` or `File Storage: List Objects`)
|
|
47
|
+
* to a clean human-readable title (e.g. `File Storage List Objects`).
|
|
48
|
+
*/
|
|
49
|
+
export declare function FormatToolName(toolName?: string): string;
|
|
45
50
|
//# sourceMappingURL=delegation-result-parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegation-result-parser.d.ts","sourceRoot":"","sources":["../../../src/lib/services/delegation-result-parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,0DAA0D;AAC1D,MAAM,WAAW,sBAAsB;IACrC,qGAAqG;IACrG,OAAO,EAAE,OAAO,CAAC;IACjB,wFAAwF;IACxF,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACxC;AASD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,sBAAsB,CAkBpF"}
|
|
1
|
+
{"version":3,"file":"delegation-result-parser.d.ts","sourceRoot":"","sources":["../../../src/lib/services/delegation-result-parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,0DAA0D;AAC1D,MAAM,WAAW,sBAAsB;IACrC,qGAAqG;IACrG,OAAO,EAAE,OAAO,CAAC;IACjB,wFAAwF;IACxF,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACxC;AASD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,sBAAsB,CAkBpF;AAwBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAMxD"}
|
|
@@ -45,4 +45,16 @@ function parseArtifacts(raw) {
|
|
|
45
45
|
}
|
|
46
46
|
return artifacts.length > 0 ? artifacts : undefined;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Convert snake_case or colon-delimited tool names (e.g. `File_Storage_List_Objects` or `File Storage: List Objects`)
|
|
50
|
+
* to a clean human-readable title (e.g. `File Storage List Objects`).
|
|
51
|
+
*/
|
|
52
|
+
export function FormatToolName(toolName) {
|
|
53
|
+
if (!toolName)
|
|
54
|
+
return 'Action';
|
|
55
|
+
return toolName
|
|
56
|
+
.replace(/[_\-:]+/g, ' ')
|
|
57
|
+
.replace(/\s+/g, ' ')
|
|
58
|
+
.trim();
|
|
59
|
+
}
|
|
48
60
|
//# sourceMappingURL=delegation-result-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtD,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;QAC7G,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC","sourcesContent":["/**\n * Pure parsing of the serialized realtime tool result (`ResultJson`) the server's\n * `RealtimeToolBroker` produces — `{ success, output, runId?, artifacts? }` on success or\n * `{ success: false, error }` on failure. Kept framework-free (no Angular / GraphQL\n * imports) so it is unit-testable in isolation and the {@link RealtimeSessionService}\n * stays focused on session orchestration.\n */\n\n/**\n * One artifact a delegated run produced, as reported in the tool ResultJson\n * (`artifacts: [{ artifactId, artifactVersionId, name }]`). The call overlay opens each\n * in its own artifact tab on the tabbed surface panel.\n */\nexport interface ParsedDelegationArtifact {\n /** The `MJ: Artifacts` row id. */\n ArtifactID: string;\n /** The `MJ: Artifact Versions` row id of the version the run produced. */\n ArtifactVersionID: string;\n /** The artifact's display name (used as the tab title). */\n Name: string;\n}\n\n/** The normalized shape a tool ResultJson parses into. */\nexport interface ParsedDelegationResult {\n /** Whether the delegated work succeeded (`success !== false`; non-JSON payloads default to true). */\n Success: boolean;\n /** The result text — the agent's output, or the structured error message on failure. */\n Output: string;\n /**\n * ID of the delegated agent run (`MJ: AI Agent Runs`) when the server reported one\n * (`runId` in the JSON). Lets developer tooling link straight to the run record.\n */\n RunID?: string;\n /**\n * Artifacts the delegated run produced, when the server reported any (`artifacts` in\n * the JSON). Drives the overlay's auto-opened artifact tabs. `undefined` when absent,\n * empty, or malformed.\n */\n Artifacts?: ParsedDelegationArtifact[];\n}\n\n/** The raw camelCase artifact entry shape the broker serializes. */\ninterface RawDelegationArtifact {\n artifactId?: unknown;\n artifactVersionId?: unknown;\n name?: unknown;\n}\n\n/**\n * Parses the broker's `{success, output, runId, artifacts}` | `{success:false, error}` ResultJson.\n * If the payload isn't JSON, the raw string is surfaced as the output (success assumed) —\n * mirroring the spoken path, which feeds whatever came back to the model verbatim.\n */\nexport function ParseDelegationResultJson(resultJson: string): ParsedDelegationResult {\n try {\n const parsed = JSON.parse(resultJson) as {\n success?: boolean;\n output?: string;\n error?: string;\n runId?: string;\n artifacts?: unknown;\n };\n return {\n Success: parsed.success !== false,\n Output: parsed.output ?? parsed.error ?? '',\n RunID: typeof parsed.runId === 'string' && parsed.runId.length > 0 ? parsed.runId : undefined,\n Artifacts: parseArtifacts(parsed.artifacts)\n };\n } catch {\n return { Success: true, Output: resultJson };\n }\n}\n\n/**\n * Normalizes the raw `artifacts` array: entries must carry non-empty `artifactId` and\n * `artifactVersionId` strings (malformed entries are dropped); a missing/blank `name`\n * falls back to `\"Artifact\"`. Returns `undefined` when nothing valid remains.\n */\nfunction parseArtifacts(raw: unknown): ParsedDelegationArtifact[] | undefined {\n if (!Array.isArray(raw)) {\n return undefined;\n }\n const artifacts: ParsedDelegationArtifact[] = [];\n for (const entry of raw as RawDelegationArtifact[]) {\n const artifactId = typeof entry?.artifactId === 'string' ? entry.artifactId : '';\n const versionId = typeof entry?.artifactVersionId === 'string' ? entry.artifactVersionId : '';\n if (artifactId.length === 0 || versionId.length === 0) {\n continue;\n }\n const name = typeof entry.name === 'string' && entry.name.trim().length > 0 ? entry.name.trim() : 'Artifact';\n artifacts.push({ ArtifactID: artifactId, ArtifactVersionID: versionId, Name: name });\n }\n return artifacts.length > 0 ? artifacts : undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"delegation-result-parser.js","sourceRoot":"","sources":["../../../src/lib/services/delegation-result-parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0CH;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,UAAkB;IAC1D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAMnC,CAAC;QACF,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,KAAK;YACjC,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE;YAC3C,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;YAC7F,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC;SAC5C,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAC/C,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,GAAY;IAClC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,SAAS,GAA+B,EAAE,CAAC;IACjD,KAAK,MAAM,KAAK,IAAI,GAA8B,EAAE,CAAC;QACnD,MAAM,UAAU,GAAG,OAAO,KAAK,EAAE,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,MAAM,SAAS,GAAG,OAAO,KAAK,EAAE,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9F,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtD,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;QAC7G,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,QAAiB;IAC9C,IAAI,CAAC,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC/B,OAAO,QAAQ;SACZ,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;SACxB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/**\n * Pure parsing of the serialized realtime tool result (`ResultJson`) the server's\n * `RealtimeToolBroker` produces — `{ success, output, runId?, artifacts? }` on success or\n * `{ success: false, error }` on failure. Kept framework-free (no Angular / GraphQL\n * imports) so it is unit-testable in isolation and the {@link RealtimeSessionService}\n * stays focused on session orchestration.\n */\n\n/**\n * One artifact a delegated run produced, as reported in the tool ResultJson\n * (`artifacts: [{ artifactId, artifactVersionId, name }]`). The call overlay opens each\n * in its own artifact tab on the tabbed surface panel.\n */\nexport interface ParsedDelegationArtifact {\n /** The `MJ: Artifacts` row id. */\n ArtifactID: string;\n /** The `MJ: Artifact Versions` row id of the version the run produced. */\n ArtifactVersionID: string;\n /** The artifact's display name (used as the tab title). */\n Name: string;\n}\n\n/** The normalized shape a tool ResultJson parses into. */\nexport interface ParsedDelegationResult {\n /** Whether the delegated work succeeded (`success !== false`; non-JSON payloads default to true). */\n Success: boolean;\n /** The result text — the agent's output, or the structured error message on failure. */\n Output: string;\n /**\n * ID of the delegated agent run (`MJ: AI Agent Runs`) when the server reported one\n * (`runId` in the JSON). Lets developer tooling link straight to the run record.\n */\n RunID?: string;\n /**\n * Artifacts the delegated run produced, when the server reported any (`artifacts` in\n * the JSON). Drives the overlay's auto-opened artifact tabs. `undefined` when absent,\n * empty, or malformed.\n */\n Artifacts?: ParsedDelegationArtifact[];\n}\n\n/** The raw camelCase artifact entry shape the broker serializes. */\ninterface RawDelegationArtifact {\n artifactId?: unknown;\n artifactVersionId?: unknown;\n name?: unknown;\n}\n\n/**\n * Parses the broker's `{success, output, runId, artifacts}` | `{success:false, error}` ResultJson.\n * If the payload isn't JSON, the raw string is surfaced as the output (success assumed) —\n * mirroring the spoken path, which feeds whatever came back to the model verbatim.\n */\nexport function ParseDelegationResultJson(resultJson: string): ParsedDelegationResult {\n try {\n const parsed = JSON.parse(resultJson) as {\n success?: boolean;\n output?: string;\n error?: string;\n runId?: string;\n artifacts?: unknown;\n };\n return {\n Success: parsed.success !== false,\n Output: parsed.output ?? parsed.error ?? '',\n RunID: typeof parsed.runId === 'string' && parsed.runId.length > 0 ? parsed.runId : undefined,\n Artifacts: parseArtifacts(parsed.artifacts)\n };\n } catch {\n return { Success: true, Output: resultJson };\n }\n}\n\n/**\n * Normalizes the raw `artifacts` array: entries must carry non-empty `artifactId` and\n * `artifactVersionId` strings (malformed entries are dropped); a missing/blank `name`\n * falls back to `\"Artifact\"`. Returns `undefined` when nothing valid remains.\n */\nfunction parseArtifacts(raw: unknown): ParsedDelegationArtifact[] | undefined {\n if (!Array.isArray(raw)) {\n return undefined;\n }\n const artifacts: ParsedDelegationArtifact[] = [];\n for (const entry of raw as RawDelegationArtifact[]) {\n const artifactId = typeof entry?.artifactId === 'string' ? entry.artifactId : '';\n const versionId = typeof entry?.artifactVersionId === 'string' ? entry.artifactVersionId : '';\n if (artifactId.length === 0 || versionId.length === 0) {\n continue;\n }\n const name = typeof entry.name === 'string' && entry.name.trim().length > 0 ? entry.name.trim() : 'Artifact';\n artifacts.push({ ArtifactID: artifactId, ArtifactVersionID: versionId, Name: name });\n }\n return artifacts.length > 0 ? artifacts : undefined;\n}\n\n/**\n * Convert snake_case or colon-delimited tool names (e.g. `File_Storage_List_Objects` or `File Storage: List Objects`)\n * to a clean human-readable title (e.g. `File Storage List Objects`).\n */\nexport function FormatToolName(toolName?: string): string {\n if (!toolName) return 'Action';\n return toolName\n .replace(/[_\\-:]+/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n"]}
|
|
@@ -79,6 +79,28 @@ export interface RealtimeSessionReviewChannelState {
|
|
|
79
79
|
* review still knows the channel existed.
|
|
80
80
|
*/
|
|
81
81
|
export declare function MergeChainChannelStates(legChannelStates: ReadonlyArray<ReadonlyArray<RealtimeSessionReviewChannelState>>): RealtimeSessionReviewChannelState[];
|
|
82
|
+
/**
|
|
83
|
+
* A direct action or channel tool execution performed during the reviewed session
|
|
84
|
+
* (stored as a hidden `MJ: Conversation Details` turn with `type: 'realtime_tool_execution'`).
|
|
85
|
+
*/
|
|
86
|
+
export interface RealtimeSessionReviewAction {
|
|
87
|
+
/** `MJ: Conversation Details.ID`. */
|
|
88
|
+
ID: string;
|
|
89
|
+
/** Correlated tool call id (`MJ: Conversation Details.ExternalID`), falling back to ID. */
|
|
90
|
+
CallID: string;
|
|
91
|
+
/** The tool/action name (e.g. `File_Storage_List_Objects` or `Whiteboard_draw_shape`). */
|
|
92
|
+
ToolName: string;
|
|
93
|
+
/** Serialized argument payload, when recorded. */
|
|
94
|
+
ArgsJson: string | null;
|
|
95
|
+
/** Serialized result payload, when recorded. */
|
|
96
|
+
ResultJson: string | null;
|
|
97
|
+
/** Whether the execution reported success. */
|
|
98
|
+
Success: boolean;
|
|
99
|
+
/** Execution duration in ms (`MJ: Conversation Details.CompletionTime`). */
|
|
100
|
+
DurationMs: number;
|
|
101
|
+
/** When the tool execution was recorded (`MJ: Conversation Details.__mj_CreatedAt`). */
|
|
102
|
+
At: Date | null;
|
|
103
|
+
}
|
|
82
104
|
/**
|
|
83
105
|
* One LEG of a reviewed session chain: a single `MJ: AI Agent Sessions` row plus its own
|
|
84
106
|
* caption turns and delegated-run previews. A session resumed via `lastSessionId` chains
|
|
@@ -99,6 +121,8 @@ export interface RealtimeSessionReviewLeg {
|
|
|
99
121
|
Turns: RealtimeSessionReviewTurn[];
|
|
100
122
|
/** This leg's delegated-run previews (oldest first, minus its co-agent observability run). */
|
|
101
123
|
DelegatedRuns: RealtimeSessionReviewRun[];
|
|
124
|
+
/** This leg's direct action and channel tool executions. */
|
|
125
|
+
DirectActions?: RealtimeSessionReviewAction[];
|
|
102
126
|
}
|
|
103
127
|
/**
|
|
104
128
|
* Everything the call overlay's SESSION REVIEW mode renders for one past realtime session:
|
|
@@ -139,6 +163,8 @@ export interface RealtimeSessionReview {
|
|
|
139
163
|
Turns: RealtimeSessionReviewTurn[];
|
|
140
164
|
/** Delegated run previews (oldest first, all legs), minus each leg's co-agent observability run. */
|
|
141
165
|
DelegatedRuns: RealtimeSessionReviewRun[];
|
|
166
|
+
/** Direct action and channel tool executions (oldest first, all legs). */
|
|
167
|
+
DirectActions?: RealtimeSessionReviewAction[];
|
|
142
168
|
/**
|
|
143
169
|
* Saved channel states, one per session-channel row that carried a name. Channel state
|
|
144
170
|
* (e.g. the whiteboard board) is the LATEST leg's only — earlier legs' states were
|
|
@@ -167,8 +193,10 @@ export declare const MAX_REVIEW_LEGS = 5;
|
|
|
167
193
|
export declare const MAX_REVIEW_DETAILS = 500;
|
|
168
194
|
/** Maps one delegated-run preview to the done delegation-card VM the thread/rail render. */
|
|
169
195
|
export declare function BuildReviewDelegationCard(run: RealtimeSessionReviewRun, fallbackAgentName: string): RealtimeDelegationCardVM;
|
|
196
|
+
/** Maps one direct-action execution to the done action-card VM the thread/rail render. */
|
|
197
|
+
export declare function BuildReviewActionCard(action: RealtimeSessionReviewAction): RealtimeDelegationCardVM;
|
|
170
198
|
/**
|
|
171
|
-
* Builds the chronological thread (caption turns + done delegation cards, oldest first)
|
|
199
|
+
* Builds the chronological thread (caption turns + done delegation cards + done action cards, oldest first)
|
|
172
200
|
* for a reviewed session — the items `RealtimeSessionState.LoadHistoricalItems` takes.
|
|
173
201
|
*
|
|
174
202
|
* CHAIN-AWARE: when the review carries multiple {@link RealtimeSessionReview.Legs}, each
|
|
@@ -244,6 +272,8 @@ export declare class RealtimeSessionReviewService {
|
|
|
244
272
|
private assembleReview;
|
|
245
273
|
/** Maps one leg's raw rows to the public leg shape (per-leg co-agent-run exclusion). */
|
|
246
274
|
private mapLeg;
|
|
275
|
+
/** Hidden detail rows with realtime_tool_execution payload → direct-action reviews. */
|
|
276
|
+
private mapDirectActions;
|
|
247
277
|
/** Persisted detail rows → caption turns: visible `User`/`AI` rows with text (AI → Assistant). */
|
|
248
278
|
private mapTurns;
|
|
249
279
|
/** Linked run rows → delegated-run previews, EXCLUDING the co-agent's observability run. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-session-review.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/realtime-session-review.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAoC,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAC7G,OAAO,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"realtime-session-review.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/realtime-session-review.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAoC,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAA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