@tangle-network/agent-app 0.43.67 → 0.43.68
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/assistant/index.d.ts +4 -2
- package/dist/assistant/index.js +6 -3
- package/dist/assistant/index.js.map +1 -1
- package/dist/{attachment-validation-B2FFna9E.d.ts → attachment-validation-Dv1A_Puy.d.ts} +1 -1
- package/dist/chat-routes/index.d.ts +4 -3
- package/dist/chat-routes/index.js +6 -4
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-store/index.d.ts +3 -2
- package/dist/chat-store/index.js +4 -1
- package/dist/chat-store/index.js.map +1 -1
- package/dist/{chunk-JWBZ74TW.js → chunk-7ESQUSAC.js} +5 -3
- package/dist/{chunk-JWBZ74TW.js.map → chunk-7ESQUSAC.js.map} +1 -1
- package/dist/{chunk-X3N2H6JE.js → chunk-AFNTRJQ7.js} +10 -1
- package/dist/chunk-AFNTRJQ7.js.map +1 -0
- package/dist/chunk-F2CBC4DY.js +193 -0
- package/dist/chunk-F2CBC4DY.js.map +1 -0
- package/dist/chunk-HRH7ASAG.js +759 -0
- package/dist/chunk-HRH7ASAG.js.map +1 -0
- package/dist/{chunk-YTSEDJWA.js → chunk-RXOTWZ4G.js} +22 -6
- package/dist/chunk-RXOTWZ4G.js.map +1 -0
- package/dist/chunk-UDSY2F6N.js +331 -0
- package/dist/chunk-UDSY2F6N.js.map +1 -0
- package/dist/chunk-UOAYS72M.js +80 -0
- package/dist/chunk-UOAYS72M.js.map +1 -0
- package/dist/chunk-UP33Z633.js +141 -0
- package/dist/chunk-UP33Z633.js.map +1 -0
- package/dist/{chunk-FMDMI25K.js → chunk-V55WJSR4.js} +2 -2
- package/dist/{chunk-YKBDH2UY.js → chunk-WL7XHLDK.js} +2 -2
- package/dist/{chunk-7CTIUCQ4.js → chunk-YEFFHORB.js} +2 -73
- package/dist/chunk-YEFFHORB.js.map +1 -0
- package/dist/eval-campaign/index.d.ts +2 -81
- package/dist/index.d.ts +5 -1
- package/dist/index.js +62 -8
- package/dist/{parts-Bg8qcDvB.d.ts → parts-2ymE5cs-.d.ts} +15 -2
- package/dist/queue-C24V13h9.d.ts +68 -0
- package/dist/runtime/index.js +3 -2
- package/dist/sandbox/index.js +3 -2
- package/dist/teams/index.js +5 -5
- package/dist/teams/invitations-api.js +4 -4
- package/dist/teams-react/index.js +3 -3
- package/dist/tools/index.js +8 -6
- package/dist/trust-gate-Dcm5xSva.d.ts +83 -0
- package/dist/types-CEchbvgz.d.ts +268 -0
- package/dist/web-react/index.d.ts +97 -5
- package/dist/web-react/index.js +31 -4
- package/dist/work-product/index.d.ts +331 -0
- package/dist/work-product/index.js +54 -0
- package/dist/work-product/index.js.map +1 -0
- package/dist/work-product-react/index.d.ts +36 -0
- package/dist/work-product-react/index.js +180 -0
- package/dist/work-product-react/index.js.map +1 -0
- package/package.json +15 -1
- package/dist/chunk-7CTIUCQ4.js.map +0 -1
- package/dist/chunk-X3N2H6JE.js.map +0 -1
- package/dist/chunk-YTSEDJWA.js.map +0 -1
- /package/dist/{chunk-FMDMI25K.js.map → chunk-V55WJSR4.js.map} +0 -0
- /package/dist/{chunk-YKBDH2UY.js.map → chunk-WL7XHLDK.js.map} +0 -0
|
@@ -5,14 +5,17 @@ export { C as ChatFreeTextField, e as ComposerAnswerDelivery, I as INTERACTION_C
|
|
|
5
5
|
import { ChatPlan } from '../plans/index.js';
|
|
6
6
|
import { InteractionData } from '@tangle-network/agent-interface';
|
|
7
7
|
export { InteractionData, InteractionOutcome, InteractionRequest } from '@tangle-network/agent-interface';
|
|
8
|
-
import {
|
|
9
|
-
export { e as ChatMentionKind,
|
|
8
|
+
import { M as FileMention, f as ChatMentionPart, a as ChatAttachmentPart, C as ChatAttachmentKind, Q as ChatAttachmentInput } from '../parts-2ymE5cs-.js';
|
|
9
|
+
export { e as ChatMentionKind, P as ChatTurnFilePartInput, O as ChatTurnPartInput, N as ChatTurnRequestPayload, U as DISPATCH_MAX_MEDIA_PARTS, V as DISPATCH_MAX_PARTS, W as DISPATCH_REQUEST_MAX_BYTES, X as DISPATCH_STRUCTURAL_RESERVE_BYTES, $ as ProducerErrorEvent, a0 as ProducerNoticeEvent, a1 as ProducerPassthroughEvent, a2 as ProducerPassthroughEventType, a3 as ProducerReasoningEvent, a4 as ProducerTextEvent, a5 as ProducerToolCallEvent, a6 as ProducerToolResultEvent, a7 as ProducerUsageEvent, a8 as ProducerWireEvent, u as attachmentInputToPart, v as attachmentKindForMime, w as attachmentPartsFromMessageParts, ab as base64WireLen, ac as buildMentionPromptBlock, ad as chatTurnRequestInit, ae as fileMentionsToParts, z as isChatAttachmentPart, ag as mediaTypeForMentionPath, J as mentionInputToPart, ah as mentionKindForPath, K as mentionPartsFromMessageParts } from '../parts-2ymE5cs-.js';
|
|
10
|
+
import { E as EvidenceEntry, b as ExceptionEntry, h as WorkProductProvenance, P as ProfileBacktestSummary, Q as QualityCheck, g as WorkProductPersistedPart, k as WorkProductStatus } from '../types-CEchbvgz.js';
|
|
10
11
|
import { S as StepAgentActivity } from '../agent-activity-C8ZG0F0M.js';
|
|
11
12
|
import { a as FlowTrace } from '../flow-types-CqomVAUN.js';
|
|
13
|
+
import { a as ReviewQueueItem, c as ReviewQueueState } from '../queue-C24V13h9.js';
|
|
14
|
+
export { p as parseReviewQueueItem } from '../queue-C24V13h9.js';
|
|
12
15
|
export { S as SandboxTerminalConnection, a as SandboxTerminalConnectionResponse, U as UseSandboxTerminalConnectionOptions, b as UseSandboxTerminalConnectionResult, t as tabTerminalConnectionId, u as useSandboxTerminalConnection } from '../sandbox-terminal-ChNEdHF8.js';
|
|
13
16
|
import { CatalogModel } from '../catalog/index.js';
|
|
14
17
|
import { Harness } from '../harness/index.js';
|
|
15
|
-
export { a as ATTACHMENT_ACCEPT, e as FileIndexReadyResponse, f as FileIndexResponse, g as FileIndexWarmingResponse } from '../attachment-validation-
|
|
18
|
+
export { a as ATTACHMENT_ACCEPT, e as FileIndexReadyResponse, f as FileIndexResponse, g as FileIndexWarmingResponse } from '../attachment-validation-Dv1A_Puy.js';
|
|
16
19
|
export { d as attachmentPartKey } from '../stream-normalizer-QYUl4vnl.js';
|
|
17
20
|
|
|
18
21
|
/** Represent durable plan decisions as either approved or rejected */
|
|
@@ -1049,6 +1052,88 @@ interface AgentActivityPanelProps {
|
|
|
1049
1052
|
*/
|
|
1050
1053
|
declare function AgentActivityPanel({ fetchActivity, renderMissionRef, title, emptyLabel }: AgentActivityPanelProps): react.JSX.Element;
|
|
1051
1054
|
|
|
1055
|
+
/** Human label for a queue state. */
|
|
1056
|
+
declare function reviewQueueStateLabel(state: ReviewQueueState): string;
|
|
1057
|
+
/** Human label for a work-product status. */
|
|
1058
|
+
declare function workProductStatusLabel(status: WorkProductStatus): string;
|
|
1059
|
+
/** Every persisted work-product anchor on one message, re-validated. */
|
|
1060
|
+
declare function workProductPartsFromMessageParts(parts: ReadonlyArray<Record<string, unknown>> | null | undefined): WorkProductPersistedPart[];
|
|
1061
|
+
/** Properties for the transcript anchor card rendered in chat */
|
|
1062
|
+
interface WorkProductCardProps {
|
|
1063
|
+
part: WorkProductPersistedPart;
|
|
1064
|
+
/** Open the work product (queue detail / pane) — the card's only action. */
|
|
1065
|
+
onOpen?: (part: WorkProductPersistedPart) => void;
|
|
1066
|
+
className?: string;
|
|
1067
|
+
}
|
|
1068
|
+
/** The chat transcript anchor card for one work-product version — a compact,
|
|
1069
|
+
* system-authored pointer, not a parallel review surface. */
|
|
1070
|
+
declare function WorkProductCard({ part, onOpen, className }: WorkProductCardProps): react.JSX.Element;
|
|
1071
|
+
/** One fetched page of queue items with an optional continuation cursor */
|
|
1072
|
+
interface ReviewQueuePage {
|
|
1073
|
+
items: ReviewQueueItem[];
|
|
1074
|
+
/** Opaque continuation token; absent ⇒ no further pages. */
|
|
1075
|
+
nextCursor?: string;
|
|
1076
|
+
}
|
|
1077
|
+
/** Properties for the review queue panel over a fetch data port */
|
|
1078
|
+
interface ReviewQueuePanelProps {
|
|
1079
|
+
/** Data port — fetch one page of queue items (the projection's output,
|
|
1080
|
+
* re-validated here at the JSON boundary). */
|
|
1081
|
+
fetchQueue: (cursor?: string) => Promise<ReviewQueuePage>;
|
|
1082
|
+
/** Open one queue item (navigate to its thread / detail pane). */
|
|
1083
|
+
onSelect?: (item: ReviewQueueItem) => void;
|
|
1084
|
+
title?: string;
|
|
1085
|
+
emptyLabel?: string;
|
|
1086
|
+
className?: string;
|
|
1087
|
+
}
|
|
1088
|
+
/** Merge a fetched page into held rows: dedupe by scopeKey, incoming wins,
|
|
1089
|
+
* newest updatedAt first. Exported for tests. */
|
|
1090
|
+
declare function mergeReviewQueuePages(existing: ReviewQueueItem[], incoming: ReviewQueueItem[]): ReviewQueueItem[];
|
|
1091
|
+
/** The workspace review queue — cursor-paged, refreshable, selection via
|
|
1092
|
+
* callback. States, counts, and provenance render from the projection; the
|
|
1093
|
+
* panel holds no domain logic. */
|
|
1094
|
+
declare function ReviewQueuePanel({ fetchQueue, onSelect, title, emptyLabel, className, }: ReviewQueuePanelProps): react.JSX.Element;
|
|
1095
|
+
/** Properties for the evidence lineage table with source click-through */
|
|
1096
|
+
interface EvidenceLineageTableProps {
|
|
1097
|
+
evidence: readonly EvidenceEntry[];
|
|
1098
|
+
/** Resolve one entry's source document to an openable URL (signed
|
|
1099
|
+
* object-store/vault download) — the `resolveFileUrl` pattern. Absent →
|
|
1100
|
+
* sources render as plain refs without links. */
|
|
1101
|
+
resolveSourceUrl?: (entry: EvidenceEntry) => string;
|
|
1102
|
+
className?: string;
|
|
1103
|
+
}
|
|
1104
|
+
/** Target → claim → source lineage rows: the "every material value traceable
|
|
1105
|
+
* to source evidence" surface. Each row names the artifact target, the
|
|
1106
|
+
* claim, and the source document location supporting it. */
|
|
1107
|
+
declare function EvidenceLineageTable({ evidence, resolveSourceUrl, className }: EvidenceLineageTableProps): react.JSX.Element;
|
|
1108
|
+
/** Properties for the severity-badged exception list */
|
|
1109
|
+
interface ExceptionListProps {
|
|
1110
|
+
exceptions: readonly ExceptionEntry[];
|
|
1111
|
+
className?: string;
|
|
1112
|
+
}
|
|
1113
|
+
/** Severity-badged exception rows with resolution state. */
|
|
1114
|
+
declare function ExceptionList({ exceptions, className }: ExceptionListProps): react.JSX.Element;
|
|
1115
|
+
/** Properties for the pass/fail quality check list */
|
|
1116
|
+
interface QualityCheckListProps {
|
|
1117
|
+
checks: readonly QualityCheck[];
|
|
1118
|
+
className?: string;
|
|
1119
|
+
}
|
|
1120
|
+
/** Pass/fail quality-check rows tagged with their source (agent self-report,
|
|
1121
|
+
* platform gate, judge ensemble). */
|
|
1122
|
+
declare function QualityCheckList({ checks, className }: QualityCheckListProps): react.JSX.Element;
|
|
1123
|
+
/** Properties for the provenance stamp with the optional backtest slot */
|
|
1124
|
+
interface ProvenanceStampProps {
|
|
1125
|
+
provenance: Pick<WorkProductProvenance, 'profileHash' | 'runId' | 'servingModels'> & Partial<Pick<WorkProductProvenance, 'costUsd' | 'producedAt'>>;
|
|
1126
|
+
/** The product-resolved backtest summary for this profile hash. When its
|
|
1127
|
+
* trust gate failed, the composite renders as "quality: unverified" —
|
|
1128
|
+
* never a naked number. */
|
|
1129
|
+
backtest?: ProfileBacktestSummary;
|
|
1130
|
+
className?: string;
|
|
1131
|
+
}
|
|
1132
|
+
/** The audit line a reviewer approves against: which configuration produced
|
|
1133
|
+
* this document, what served it, and how that configuration measured on its
|
|
1134
|
+
* backtest. */
|
|
1135
|
+
declare function ProvenanceStamp({ provenance, backtest, className }: ProvenanceStampProps): react.JSX.Element;
|
|
1136
|
+
|
|
1052
1137
|
/**
|
|
1053
1138
|
* `SeatPaywall` — the shared "unlock this product" screen every agent app
|
|
1054
1139
|
* shows when a user has no active seat and has spent past the free tier. One
|
|
@@ -1331,6 +1416,13 @@ interface ChatMessagesProps {
|
|
|
1331
1416
|
* row next to the bubble — thumbnails for images, download chips for files.
|
|
1332
1417
|
* Absent → today's rendering, byte-identical (no attachment row). */
|
|
1333
1418
|
resolveAttachmentUrl?: (part: ChatAttachmentPart) => string;
|
|
1419
|
+
/** Render persisted `type:'work_product'` anchor parts as `WorkProductCard`
|
|
1420
|
+
* rows under the message body — the chat card that keeps chat the driver
|
|
1421
|
+
* surface for review. `onOpen` opens the product's queue/detail surface.
|
|
1422
|
+
* Absent → today's rendering, byte-identical (no card row). */
|
|
1423
|
+
workProductCards?: {
|
|
1424
|
+
onOpen?: (part: WorkProductPersistedPart) => void;
|
|
1425
|
+
};
|
|
1334
1426
|
}
|
|
1335
1427
|
/** One starting "door" in the chat first-run state — a concrete, labeled action
|
|
1336
1428
|
* (start from a template, do it by hand, ask the agent), not a placeholder. */
|
|
@@ -1375,6 +1467,6 @@ declare function useThinkingSeconds(active: boolean): number;
|
|
|
1375
1467
|
* model id, tokens/sec, and cost, plus a collapsible thinking section and
|
|
1376
1468
|
* tool-call chips.
|
|
1377
1469
|
*/
|
|
1378
|
-
declare function ChatMessages({ messages, models, renderMarkdown, renderExtras, durableCards, userLabel, agentLabel, loading, approval, onToolCallClick, toolRenderers, error, onRetry, renderEmpty, emptyState, header, resolveAttachmentUrl, }: ChatMessagesProps): react.JSX.Element;
|
|
1470
|
+
declare function ChatMessages({ messages, models, renderMarkdown, renderExtras, durableCards, userLabel, agentLabel, loading, approval, onToolCallClick, toolRenderers, error, onRetry, renderEmpty, emptyState, header, resolveAttachmentUrl, workProductCards, }: ChatMessagesProps): react.JSX.Element;
|
|
1379
1471
|
|
|
1380
|
-
export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, AgentSessionControls, type AgentSessionControlsProps, type AttachmentFileResult, CatalogModel, ChatAttachmentInput, ChatAttachmentKind, ChatAttachmentPart, ChatComposer, type ChatComposerProps, type ChatEmptyDoor, ChatEmptyState, type ChatEmptyStateProps, ChatInteraction, ChatInteractionField, type ChatInteractionRestoreMode, ChatInteractionStatus, ChatMentionPart, type ChatMessageMetrics, type ChatMessageSegment, ChatMessages, type ChatMessagesProps, ChatSelectField, type ChatStreamCallbacks, type ChatStreamToolCall, type ChatStreamToolResult, type ChatToolCallInfo, type ChatUiMessage, type ComposerFile, type ComposerFilePart, type ComposerMentionProp, type ConsumeChatStreamResult, DEFAULT_EFFORT_LEVELS, DEFAULT_MENTION_EMPTY_TEXT, DEFAULT_MENTION_LIMIT, type DurableChatCard, DurableChatCards, type DurableChatCardsProps, type DurableInteractionAnswerSubmitterOptions, DurablePlanCard, type DurablePlanCardProps, DurablePlanClientError, type DurablePlanCurrentInput, type DurablePlanDecision, type DurablePlanDecisionClient, type DurablePlanDecisionClientOptions, type DurablePlanDecisionInput, type DurablePlanDecisionResult, type DurablePlanFollowUpReceipt, type EffortLevel, EffortPicker, type EffortPickerProps, type FieldValues, FileMention, FlowWaterfall, type FlowWaterfallProps, INDEX_REFRESH_AFTER_MS, INTERACTION_SUBMIT_TIMEOUT_MESSAGE, INTERACTION_SUBMIT_TIMEOUT_MS, InteractionActionButton, type InteractionAnswerSubmission, type InteractionAnswerSubmitterOptions, InteractionAnswers, type InteractionAttemptStore, InteractionBadge, type InteractionBadgeVariant, InteractionCancelData, InteractionPlanCard, type InteractionPlanCardProps, InteractionQuestionCard, type InteractionQuestionCardProps, InteractionRequestWire, type InteractionSubmitResult, type MentionItem, type MentionTextSegment, MessageAttachments, type MessageAttachmentsProps, MissionActivityLane, type MissionActivityLaneProps, ModelPicker, type ModelPickerProps, type ProposalApprovalHandlers, ProviderLogo, type ProviderLogoProps, QuestionOptionList, type QuestionOptionListProps, type RestoreChatInteractionsOptions, RunDrillIn, type RunDrillInProps, SeatPaywall, type SeatPaywallProps, type SmoothRevealOptions, type StreamChatOptions, type SubmitInteractionAnswer, type ToolDetailRenderers, type ToolRunRecord, type ToolRunStep, type UseChatInteractionsOptions, type UseChatInteractionsResult, type UseComposerAttachmentsOptions, type UseComposerAttachmentsResult, type UseDurablePlanFlowOptions, type UseDurablePlanFlowResult, type UseFileMentionsOptions, type UseFileMentionsResult, type WaterfallRow, __resetAttachmentFileCacheForTests, activityTone, buildAnswerData, cancelChatInteraction, consumeChatStream, createDurableInteractionAnswerSubmitter, createDurablePlanDecisionClient, createInteractionAnswerSubmitter, createMemoryInteractionAttemptStore, createSessionInteractionAttemptStore, dispatchChatStreamLine, durableChatCardsFromParts, fieldAnswer, fieldValuesFromAnswers, formatActivityCost, formatActivityDuration, formatModelCost, formatTokensPerSecond, hasSecretField, hydrateChatInteractions, interactionStatusLabels, interactionSubmissionSignature, interactionTerminalNotes, isLateAnswerableStatus, lateAnswerMessage, loadAttachmentFile, mergeActivityPages, nextRevealCount, pendingApprovalOf, rankFileMentions, resolveChatInteraction, responseErrorMessage, restoreChatInteractions, segmentMentionContent, settleInteractionSubmit, streamChatTurn, terminalizePendingChatInteractions, triggerAttachmentDownload, upsertChatInteraction, useChatInteractions, useComposerAttachments, useDurablePlanFlow, useFileMentions, usePending, usePopover, useSmoothText, useThinkingSeconds, waterfallLayout };
|
|
1472
|
+
export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, AgentSessionControls, type AgentSessionControlsProps, type AttachmentFileResult, CatalogModel, ChatAttachmentInput, ChatAttachmentKind, ChatAttachmentPart, ChatComposer, type ChatComposerProps, type ChatEmptyDoor, ChatEmptyState, type ChatEmptyStateProps, ChatInteraction, ChatInteractionField, type ChatInteractionRestoreMode, ChatInteractionStatus, ChatMentionPart, type ChatMessageMetrics, type ChatMessageSegment, ChatMessages, type ChatMessagesProps, ChatSelectField, type ChatStreamCallbacks, type ChatStreamToolCall, type ChatStreamToolResult, type ChatToolCallInfo, type ChatUiMessage, type ComposerFile, type ComposerFilePart, type ComposerMentionProp, type ConsumeChatStreamResult, DEFAULT_EFFORT_LEVELS, DEFAULT_MENTION_EMPTY_TEXT, DEFAULT_MENTION_LIMIT, type DurableChatCard, DurableChatCards, type DurableChatCardsProps, type DurableInteractionAnswerSubmitterOptions, DurablePlanCard, type DurablePlanCardProps, DurablePlanClientError, type DurablePlanCurrentInput, type DurablePlanDecision, type DurablePlanDecisionClient, type DurablePlanDecisionClientOptions, type DurablePlanDecisionInput, type DurablePlanDecisionResult, type DurablePlanFollowUpReceipt, type EffortLevel, EffortPicker, type EffortPickerProps, EvidenceLineageTable, type EvidenceLineageTableProps, ExceptionList, type ExceptionListProps, type FieldValues, FileMention, FlowWaterfall, type FlowWaterfallProps, INDEX_REFRESH_AFTER_MS, INTERACTION_SUBMIT_TIMEOUT_MESSAGE, INTERACTION_SUBMIT_TIMEOUT_MS, InteractionActionButton, type InteractionAnswerSubmission, type InteractionAnswerSubmitterOptions, InteractionAnswers, type InteractionAttemptStore, InteractionBadge, type InteractionBadgeVariant, InteractionCancelData, InteractionPlanCard, type InteractionPlanCardProps, InteractionQuestionCard, type InteractionQuestionCardProps, InteractionRequestWire, type InteractionSubmitResult, type MentionItem, type MentionTextSegment, MessageAttachments, type MessageAttachmentsProps, MissionActivityLane, type MissionActivityLaneProps, ModelPicker, type ModelPickerProps, type ProposalApprovalHandlers, ProvenanceStamp, type ProvenanceStampProps, ProviderLogo, type ProviderLogoProps, QualityCheckList, type QualityCheckListProps, QuestionOptionList, type QuestionOptionListProps, type RestoreChatInteractionsOptions, ReviewQueueItem, type ReviewQueuePage, ReviewQueuePanel, type ReviewQueuePanelProps, ReviewQueueState, RunDrillIn, type RunDrillInProps, SeatPaywall, type SeatPaywallProps, type SmoothRevealOptions, type StreamChatOptions, type SubmitInteractionAnswer, type ToolDetailRenderers, type ToolRunRecord, type ToolRunStep, type UseChatInteractionsOptions, type UseChatInteractionsResult, type UseComposerAttachmentsOptions, type UseComposerAttachmentsResult, type UseDurablePlanFlowOptions, type UseDurablePlanFlowResult, type UseFileMentionsOptions, type UseFileMentionsResult, type WaterfallRow, WorkProductCard, type WorkProductCardProps, __resetAttachmentFileCacheForTests, activityTone, buildAnswerData, cancelChatInteraction, consumeChatStream, createDurableInteractionAnswerSubmitter, createDurablePlanDecisionClient, createInteractionAnswerSubmitter, createMemoryInteractionAttemptStore, createSessionInteractionAttemptStore, dispatchChatStreamLine, durableChatCardsFromParts, fieldAnswer, fieldValuesFromAnswers, formatActivityCost, formatActivityDuration, formatModelCost, formatTokensPerSecond, hasSecretField, hydrateChatInteractions, interactionStatusLabels, interactionSubmissionSignature, interactionTerminalNotes, isLateAnswerableStatus, lateAnswerMessage, loadAttachmentFile, mergeActivityPages, mergeReviewQueuePages, nextRevealCount, pendingApprovalOf, rankFileMentions, resolveChatInteraction, responseErrorMessage, restoreChatInteractions, reviewQueueStateLabel, segmentMentionContent, settleInteractionSubmit, streamChatTurn, terminalizePendingChatInteractions, triggerAttachmentDownload, upsertChatInteraction, useChatInteractions, useComposerAttachments, useDurablePlanFlow, useFileMentions, usePending, usePopover, useSmoothText, useThinkingSeconds, waterfallLayout, workProductPartsFromMessageParts, workProductStatusLabel };
|
package/dist/web-react/index.js
CHANGED
|
@@ -74,15 +74,30 @@ import {
|
|
|
74
74
|
useSmoothText,
|
|
75
75
|
useThinkingSeconds,
|
|
76
76
|
waterfallLayout
|
|
77
|
-
} from "../chunk-
|
|
77
|
+
} from "../chunk-RXOTWZ4G.js";
|
|
78
|
+
import {
|
|
79
|
+
EvidenceLineageTable,
|
|
80
|
+
ExceptionList,
|
|
81
|
+
ProvenanceStamp,
|
|
82
|
+
QualityCheckList,
|
|
83
|
+
ReviewQueuePanel,
|
|
84
|
+
WorkProductCard,
|
|
85
|
+
mergeReviewQueuePages,
|
|
86
|
+
reviewQueueStateLabel,
|
|
87
|
+
workProductPartsFromMessageParts,
|
|
88
|
+
workProductStatusLabel
|
|
89
|
+
} from "../chunk-UDSY2F6N.js";
|
|
78
90
|
import {
|
|
79
91
|
tabTerminalConnectionId,
|
|
80
92
|
useSandboxTerminalConnection
|
|
81
93
|
} from "../chunk-HCOROIRT.js";
|
|
82
94
|
import {
|
|
83
95
|
ATTACHMENT_ACCEPT
|
|
84
|
-
} from "../chunk-
|
|
96
|
+
} from "../chunk-V55WJSR4.js";
|
|
85
97
|
import "../chunk-FBVLEGEG.js";
|
|
98
|
+
import {
|
|
99
|
+
parseReviewQueueItem
|
|
100
|
+
} from "../chunk-UP33Z633.js";
|
|
86
101
|
import {
|
|
87
102
|
DISPATCH_MAX_MEDIA_PARTS,
|
|
88
103
|
DISPATCH_MAX_PARTS,
|
|
@@ -100,7 +115,8 @@ import {
|
|
|
100
115
|
mentionInputToPart,
|
|
101
116
|
mentionKindForPath,
|
|
102
117
|
mentionPartsFromMessageParts
|
|
103
|
-
} from "../chunk-
|
|
118
|
+
} from "../chunk-AFNTRJQ7.js";
|
|
119
|
+
import "../chunk-F2CBC4DY.js";
|
|
104
120
|
import {
|
|
105
121
|
attachmentPartKey
|
|
106
122
|
} from "../chunk-5EPIPT4V.js";
|
|
@@ -149,6 +165,8 @@ export {
|
|
|
149
165
|
DurablePlanCard,
|
|
150
166
|
DurablePlanClientError,
|
|
151
167
|
EffortPicker,
|
|
168
|
+
EvidenceLineageTable,
|
|
169
|
+
ExceptionList,
|
|
152
170
|
FlowWaterfall,
|
|
153
171
|
INDEX_REFRESH_AFTER_MS,
|
|
154
172
|
INTERACTION_CANCEL_EVENT,
|
|
@@ -163,10 +181,14 @@ export {
|
|
|
163
181
|
MessageAttachments,
|
|
164
182
|
MissionActivityLane,
|
|
165
183
|
ModelPicker,
|
|
184
|
+
ProvenanceStamp,
|
|
166
185
|
ProviderLogo,
|
|
186
|
+
QualityCheckList,
|
|
167
187
|
QuestionOptionList,
|
|
188
|
+
ReviewQueuePanel,
|
|
168
189
|
RunDrillIn,
|
|
169
190
|
SeatPaywall,
|
|
191
|
+
WorkProductCard,
|
|
170
192
|
__resetAttachmentFileCacheForTests,
|
|
171
193
|
activityTone,
|
|
172
194
|
attachmentInputToPart,
|
|
@@ -219,12 +241,14 @@ export {
|
|
|
219
241
|
mentionKindForPath,
|
|
220
242
|
mentionPartsFromMessageParts,
|
|
221
243
|
mergeActivityPages,
|
|
244
|
+
mergeReviewQueuePages,
|
|
222
245
|
nextRevealCount,
|
|
223
246
|
noticePart,
|
|
224
247
|
noticePartKey,
|
|
225
248
|
parseInteractionAnswers,
|
|
226
249
|
parseInteractionCancel,
|
|
227
250
|
parseInteractionRequest,
|
|
251
|
+
parseReviewQueueItem,
|
|
228
252
|
pendingApprovalOf,
|
|
229
253
|
persistedPartToInteraction,
|
|
230
254
|
questionInteractionContentSignature,
|
|
@@ -232,6 +256,7 @@ export {
|
|
|
232
256
|
resolveChatInteraction,
|
|
233
257
|
responseErrorMessage,
|
|
234
258
|
restoreChatInteractions,
|
|
259
|
+
reviewQueueStateLabel,
|
|
235
260
|
segmentMentionContent,
|
|
236
261
|
settleInteractionSubmit,
|
|
237
262
|
stampInteractionAnswers,
|
|
@@ -249,6 +274,8 @@ export {
|
|
|
249
274
|
useSandboxTerminalConnection,
|
|
250
275
|
useSmoothText,
|
|
251
276
|
useThinkingSeconds,
|
|
252
|
-
waterfallLayout
|
|
277
|
+
waterfallLayout,
|
|
278
|
+
workProductPartsFromMessageParts,
|
|
279
|
+
workProductStatusLabel
|
|
253
280
|
};
|
|
254
281
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { h as WorkProductProvenance, l as WorkProductStorePort, d as WorkProductAuditEvent, i as WorkProductRecord, W as WorkProductArtifact, Q as QualityCheck, E as EvidenceEntry, b as ExceptionEntry, k as WorkProductStatus, g as WorkProductPersistedPart } from '../types-CEchbvgz.js';
|
|
2
|
+
export { A as AgentCheckInput, a as EvidenceLocator, c as ExceptionSeverity, P as ProfileBacktestSummary, e as WorkProductParseResult, f as WorkProductPatch, j as WorkProductRef, m as WorkProductUpdateGuard, n as WorkProductVersionEntry, o as isWorkProductStatus, p as parseAgentCheckInput, q as parseArtifactInput, r as parseEvidenceInput, s as parseExceptionInput, t as persistedPartToWorkProduct, u as unresolvedBlockingExceptions, w as workProductToPersistedPart } from '../types-CEchbvgz.js';
|
|
3
|
+
import { c as AppToolContext, d as AppToolDefinition } from '../types-CBRyqijY.js';
|
|
4
|
+
import { JudgeVerdict } from '@tangle-network/agent-eval';
|
|
5
|
+
import { T as TrustItem } from '../trust-gate-Dcm5xSva.js';
|
|
6
|
+
export { R as ReviewQueueInputs, a as ReviewQueueItem, b as ReviewQueuePendingAsk, c as ReviewQueueState, d as ReviewQueueThread, p as parseReviewQueueItem, e as projectReviewQueue } from '../queue-C24V13h9.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The guarded work-product status machine — the `/missions` service PATTERN
|
|
10
|
+
* (load → validate against a transition table → CAS-write guarded on what was
|
|
11
|
+
* read → audit event) over {@link WorkProductStorePort}. Deliberately NOT a
|
|
12
|
+
* reuse of the mission service: missions' cursor/plan/budget machinery does
|
|
13
|
+
* not apply here, and the six-status review machine is a different contract.
|
|
14
|
+
*
|
|
15
|
+
* Concurrency contract: a scope's draft is driven by a single serialized turn
|
|
16
|
+
* owner, so real contention is rare. The service is the typed guard layer,
|
|
17
|
+
* not a serializer — every mutation re-reads the record and CAS-writes
|
|
18
|
+
* guarded on the `{status, version}` it read. A guard miss surfaces as
|
|
19
|
+
* `{ succeeded: false, conflict: true }` (retryable: re-read and re-apply),
|
|
20
|
+
* never a silent clobber.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** Discriminated outcome for guarded operations — `conflict` distinguishes a
|
|
24
|
+
* lost guarded race (retryable) from a logic rejection (illegal edge,
|
|
25
|
+
* missing row — deterministic, never retried). */
|
|
26
|
+
type WorkProductOutcome<T> = {
|
|
27
|
+
succeeded: true;
|
|
28
|
+
value: T;
|
|
29
|
+
} | {
|
|
30
|
+
succeeded: false;
|
|
31
|
+
error: string;
|
|
32
|
+
conflict: boolean;
|
|
33
|
+
};
|
|
34
|
+
/** Whether a legal edge exists from `from` to `to` in the review machine. */
|
|
35
|
+
declare function canTransitionWorkProduct(from: WorkProductStatus, to: WorkProductStatus): boolean;
|
|
36
|
+
/** Statuses a work product can never leave. */
|
|
37
|
+
declare function isWorkProductTerminal(status: WorkProductStatus): boolean;
|
|
38
|
+
/** Define the input required to create a new draft work product row */
|
|
39
|
+
interface CreateWorkProductInput {
|
|
40
|
+
/** Explicit row id — omit to use the service's generator. The MODEL never
|
|
41
|
+
* supplies ids; this is for deterministic server-side creation. */
|
|
42
|
+
id?: string;
|
|
43
|
+
workspaceId: string;
|
|
44
|
+
threadId: string | null;
|
|
45
|
+
scopeKey: string;
|
|
46
|
+
/** Version this draft will become; default 1. The tool layer passes
|
|
47
|
+
* `last reviewed version + 1` when a scope is re-engaged after approval. */
|
|
48
|
+
version?: number;
|
|
49
|
+
provenance: WorkProductProvenance;
|
|
50
|
+
/** Opaque product-column values handed VERBATIM to the store's insert. */
|
|
51
|
+
extras?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
/** Payload for the draft→ready submit transition */
|
|
54
|
+
interface SubmitWorkProductInput {
|
|
55
|
+
artifact: WorkProductArtifact;
|
|
56
|
+
checks: QualityCheck[];
|
|
57
|
+
provenance: WorkProductProvenance;
|
|
58
|
+
/** Frozen snapshot ref of this version's body for the history entry;
|
|
59
|
+
* defaults to `artifact.path`. */
|
|
60
|
+
artifactPath?: string;
|
|
61
|
+
}
|
|
62
|
+
/** Reviewer verdict payload for the ready→approved / ready→changes_requested transition */
|
|
63
|
+
interface WorkProductVerdictInput {
|
|
64
|
+
verdict: 'approve' | 'request_changes';
|
|
65
|
+
reviewedBy: string;
|
|
66
|
+
note?: string;
|
|
67
|
+
}
|
|
68
|
+
/** Guarded mutation surface over the work-product store */
|
|
69
|
+
interface WorkProductService {
|
|
70
|
+
create(input: CreateWorkProductInput): Promise<WorkProductRecord>;
|
|
71
|
+
get(id: string): Promise<WorkProductRecord | null>;
|
|
72
|
+
/** The scope's open accumulator row (`draft`/`blocked`), or null. */
|
|
73
|
+
openDraft(workspaceId: string, scopeKey: string): Promise<WorkProductRecord | null>;
|
|
74
|
+
/** The scope's `changes_requested` row awaiting its correction turn, or null. */
|
|
75
|
+
awaitingCorrection(workspaceId: string, scopeKey: string): Promise<WorkProductRecord | null>;
|
|
76
|
+
/** The scope's `ready` row awaiting review, or null. */
|
|
77
|
+
awaitingReview(workspaceId: string, scopeKey: string): Promise<WorkProductRecord | null>;
|
|
78
|
+
/** `max(version over the scope's approved/superseded rows) + 1` — the
|
|
79
|
+
* version a fresh draft for the scope should carry. */
|
|
80
|
+
nextVersion(workspaceId: string, scopeKey: string): Promise<number>;
|
|
81
|
+
/** Re-open a `changes_requested` row as the next draft: version bumps +1
|
|
82
|
+
* and the correction turn accumulates into the same scope row. */
|
|
83
|
+
reopen(id: string): Promise<WorkProductOutcome<WorkProductRecord>>;
|
|
84
|
+
/** Merge evidence entries by id (same id replaces — the agent can correct
|
|
85
|
+
* itself mid-turn). Legal only while `draft`/`blocked`. */
|
|
86
|
+
upsertEvidence(id: string, entries: readonly EvidenceEntry[]): Promise<WorkProductOutcome<WorkProductRecord>>;
|
|
87
|
+
/** Merge exception entries by id, then reconcile the blocked flag: any
|
|
88
|
+
* unresolved blocking entry parks `draft`→`blocked`; resolving the last
|
|
89
|
+
* one releases `blocked`→`draft`. */
|
|
90
|
+
upsertExceptions(id: string, entries: readonly ExceptionEntry[]): Promise<WorkProductOutcome<WorkProductRecord>>;
|
|
91
|
+
/** Persist a checks array without transitioning — how a failed platform
|
|
92
|
+
* gate (e.g. evidence_coverage) stays visible on the still-draft row. */
|
|
93
|
+
recordChecks(id: string, checks: readonly QualityCheck[]): Promise<WorkProductOutcome<WorkProductRecord>>;
|
|
94
|
+
/** The terminal agent call: CAS `draft`→`ready` with artifact + checks +
|
|
95
|
+
* provenance, appending the version-history entry. Refuses while an
|
|
96
|
+
* unresolved blocking exception exists. */
|
|
97
|
+
submit(id: string, input: SubmitWorkProductInput): Promise<WorkProductOutcome<WorkProductRecord>>;
|
|
98
|
+
/** Reviewer verdict: CAS `ready`→`approved`/`changes_requested` + history
|
|
99
|
+
* entry. Approval also supersedes the scope's prior approved versions so
|
|
100
|
+
* exactly one approved version is current per scope. */
|
|
101
|
+
applyVerdict(id: string, input: WorkProductVerdictInput): Promise<WorkProductOutcome<WorkProductRecord>>;
|
|
102
|
+
/** Explicit replacement: CAS to `superseded` (legal from ready /
|
|
103
|
+
* changes_requested / approved). */
|
|
104
|
+
supersede(id: string): Promise<WorkProductOutcome<WorkProductRecord>>;
|
|
105
|
+
}
|
|
106
|
+
/** Configuration options for creating a work product service */
|
|
107
|
+
interface WorkProductServiceOptions {
|
|
108
|
+
store: WorkProductStorePort;
|
|
109
|
+
/** Injectable clock (epoch ms). Default `Date.now`. */
|
|
110
|
+
now?: () => number;
|
|
111
|
+
/** Row-id generator. Default `crypto.randomUUID()`. */
|
|
112
|
+
generateId?: () => string;
|
|
113
|
+
}
|
|
114
|
+
/** Create the guarded work-product service over a store port */
|
|
115
|
+
declare function createWorkProductService(options: WorkProductServiceOptions): WorkProductService;
|
|
116
|
+
/** In-memory store surface with audit trail access and unguarded direct writes for tests */
|
|
117
|
+
interface InMemoryWorkProductStore extends WorkProductStorePort {
|
|
118
|
+
/** The full audit trail, append order. */
|
|
119
|
+
events(): WorkProductAuditEvent[];
|
|
120
|
+
/** Unguarded direct write — simulates a concurrent owner in tests. */
|
|
121
|
+
put(record: WorkProductRecord): void;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* In-memory {@link WorkProductStorePort} — the portable backend for tests and
|
|
125
|
+
* reference assemblies. Records are deep-copied on every boundary so callers
|
|
126
|
+
* can never mutate stored state around the guards.
|
|
127
|
+
*/
|
|
128
|
+
declare function createInMemoryWorkProductStore(): InMemoryWorkProductStore;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Provenance stamping — the backtest spine. Every version of every work
|
|
132
|
+
* product carries `profileHash + runId + servingModels`, stamped at the two
|
|
133
|
+
* honest moments:
|
|
134
|
+
*
|
|
135
|
+
* 1. At dispatch, the product route composes the turn's profile and computes
|
|
136
|
+
* agent-eval's `agentProfileHash(profile)` — the SAME hash that keys the
|
|
137
|
+
* app's scorecard cells — and closes it (plus runId/sessionId) into the
|
|
138
|
+
* `provenance` seam `buildWorkProductTools` receives, so the model can
|
|
139
|
+
* neither omit nor forge it.
|
|
140
|
+
* 2. At turn completion, the route's existing lifecycle seam calls
|
|
141
|
+
* {@link finalizeWorkProductProvenance}: serving model and cost come from
|
|
142
|
+
* the usage receipt, because only the completed turn knows what actually
|
|
143
|
+
* served. `servingModels` is honestly EMPTY until then.
|
|
144
|
+
*
|
|
145
|
+
* The trust bridge ({@link workProductTrustInputs}) maps judge-sourced
|
|
146
|
+
* quality verdicts into `/eval-campaign`'s `trustVerdicts()` input with
|
|
147
|
+
* type-only imports — products call `trustVerdicts` from
|
|
148
|
+
* `@tangle-network/agent-app/eval-campaign` (which they already import for
|
|
149
|
+
* their ensemble loop). Deliberately NOT a value re-export here: it would put
|
|
150
|
+
* agent-eval's runtime on `/work-product`'s import path and drag the eval
|
|
151
|
+
* engine into every product worker bundle.
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
/** The dispatch-time provenance closure's output: everything the route knows
|
|
155
|
+
* before the turn completes. */
|
|
156
|
+
type WorkProductProvenanceBase = Omit<WorkProductProvenance, 'servingModels' | 'producedAt'>;
|
|
157
|
+
/** Stamp a full provenance from the dispatch-time base. `servingModels` starts
|
|
158
|
+
* empty (honestly absent — never guessed) until the completion back-fill. */
|
|
159
|
+
declare function stampProvenance(base: WorkProductProvenanceBase, now?: () => number): WorkProductProvenance;
|
|
160
|
+
/** Completion receipt for one run, from the turn's usage/lifecycle seam. */
|
|
161
|
+
interface FinalizeWorkProductProvenanceInput {
|
|
162
|
+
workspaceId: string;
|
|
163
|
+
/** The chat turnId / mission-step run id the records were stamped with. */
|
|
164
|
+
runId: string;
|
|
165
|
+
/** What actually served, from the usage receipt / serving-model header. */
|
|
166
|
+
servingModels: readonly string[];
|
|
167
|
+
costUsd?: number;
|
|
168
|
+
logger?: Pick<Console, 'warn'>;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Back-fill `servingModels`/`costUsd` onto every record (and its history
|
|
172
|
+
* entries) stamped with `runId` — wire it into the chat route's existing
|
|
173
|
+
* `lifecycle.onTurnComplete` seam; no new hook. Returns the updated records.
|
|
174
|
+
* A CAS miss on one record is logged and skipped (the next completion or a
|
|
175
|
+
* re-read re-applies); it never throws mid-fleet.
|
|
176
|
+
*/
|
|
177
|
+
declare function finalizeWorkProductProvenance(store: WorkProductStorePort, input: FinalizeWorkProductProvenanceInput): Promise<WorkProductRecord[]>;
|
|
178
|
+
/**
|
|
179
|
+
* Trust-gate bridge: one `TrustItem` per work product whose production
|
|
180
|
+
* quality was scored by the product's eval-campaign ensemble. `verdictsFor`
|
|
181
|
+
* returns the per-judge raw verdicts the product retained for a record (the
|
|
182
|
+
* same verdicts `aggregateJudgeVerdicts` reduces); records without verdicts
|
|
183
|
+
* are omitted. Feed the result to `/eval-campaign`'s `trustVerdicts()` —
|
|
184
|
+
* an untrusted verdict renders as "quality: unverified", never a naked
|
|
185
|
+
* number. Zero statistics code here: pure mapping.
|
|
186
|
+
*/
|
|
187
|
+
declare function workProductTrustInputs<D extends string = string>(records: readonly WorkProductRecord[], verdictsFor: (record: WorkProductRecord) => readonly JudgeVerdict<D>[] | undefined): TrustItem<D>[];
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The agent-facing work-product side channel — three registry `customTools`
|
|
191
|
+
* built on `/tools`' `defineAppTool`, dispatched through `dispatchAppTool`'s
|
|
192
|
+
* single validation/outcome path (a thrown `ToolInputError` → correctable 4xx
|
|
193
|
+
* back to the model; any other throw → internal error; a call never silently
|
|
194
|
+
* succeeds without its effect). Deliberately NOT new `/tools` built-ins:
|
|
195
|
+
* extending `AppToolHandlers` would break every existing consumer, and the
|
|
196
|
+
* registry seam exists precisely for a product tool family like this.
|
|
197
|
+
*
|
|
198
|
+
* Partial-emission contract across a long turn: the draft ROW is the
|
|
199
|
+
* accumulator. Evidence and exceptions stream in as found via small batched
|
|
200
|
+
* calls; the artifact arrives once at the end. The agent addresses everything
|
|
201
|
+
* by `scopeKey` — the server mints row ids, the model never invents them, and
|
|
202
|
+
* identity (userId/workspaceId/threadId) rides the trusted `AppToolContext`
|
|
203
|
+
* from headers, never model args. A turn that dies mid-emission leaves a
|
|
204
|
+
* consistent draft the next turn resumes by the same scopeKey.
|
|
205
|
+
*/
|
|
206
|
+
|
|
207
|
+
/** Max entries per `upsert_evidence`/`flag_exception` call — keeps each call a
|
|
208
|
+
* small batch the model can correct precisely on a named-index failure. */
|
|
209
|
+
declare const MAX_WORK_PRODUCT_BATCH = 50;
|
|
210
|
+
/** The shell's one generic platform check: every material target has ≥1
|
|
211
|
+
* evidence row. Recorded as `QualityCheck{source:'platform'}`. */
|
|
212
|
+
declare const EVIDENCE_COVERAGE_CHECK = "evidence_coverage";
|
|
213
|
+
/** Domain seams for the three work-product tools — every domain word is a
|
|
214
|
+
* parameter; the shell bakes none. */
|
|
215
|
+
interface WorkProductToolConfig {
|
|
216
|
+
store: WorkProductStorePort;
|
|
217
|
+
/** PARAMETER — accepted `artifact.kind` values, validated on submit. */
|
|
218
|
+
artifactKinds: readonly string[];
|
|
219
|
+
/** PARAMETER — accepted exception `kind` values. */
|
|
220
|
+
exceptionKinds: readonly string[];
|
|
221
|
+
/** Fail-loud source check: resolve an evidence `sourceRef` to existence
|
|
222
|
+
* (vault stat / attachment lookup). A dangling ref is a `ToolInputError`
|
|
223
|
+
* naming the entry index — lineage can never point at nothing. */
|
|
224
|
+
resolveSourceRef: (ref: string, ctx: AppToolContext) => Promise<boolean>;
|
|
225
|
+
/** The material targets the platform coverage check requires evidence for.
|
|
226
|
+
* Product-owned vocabulary; omit to skip the coverage gate. */
|
|
227
|
+
materialTargets?: (artifact: WorkProductArtifact) => string[];
|
|
228
|
+
/** Per-turn provenance closure the ROUTE supplies (profileHash + runId are
|
|
229
|
+
* known at dispatch; trusted, never read from model args). */
|
|
230
|
+
provenance: (ctx: AppToolContext) => WorkProductProvenanceBase;
|
|
231
|
+
/** Called on the draft→ready commit so the route persists the transcript
|
|
232
|
+
* anchor part and the queue projection updates. */
|
|
233
|
+
onReady?: (record: WorkProductRecord, ctx: AppToolContext) => void | Promise<void>;
|
|
234
|
+
/** Injectable clock / id generator (tests, deterministic ids). */
|
|
235
|
+
now?: () => number;
|
|
236
|
+
generateId?: () => string;
|
|
237
|
+
}
|
|
238
|
+
/** Build the three work-product tools for `customTools` registration on the
|
|
239
|
+
* MCP server / HTTP handler / runtime executor. */
|
|
240
|
+
declare function buildWorkProductTools(config: WorkProductToolConfig): AppToolDefinition[];
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Framework-neutral work-product review endpoints — the
|
|
244
|
+
* `createInteractionAnswerRoute` factory pattern: web-standard
|
|
245
|
+
* `Request`/`Response`, ONE product-supplied `authorize` seam (session auth,
|
|
246
|
+
* workspace access, reviewer identity, rate limits), everything behind it
|
|
247
|
+
* mechanism. Server-only and subpath-only: never reachable from a client
|
|
248
|
+
* bundle (enforced by the browser-safety test).
|
|
249
|
+
*
|
|
250
|
+
* The verdict endpoint is deliberately NOT a second approval broker: agent
|
|
251
|
+
* asks stay on `/interactions`; this is the REVIEWER's plain authorized
|
|
252
|
+
* verdict on a ready package — one human-in-the-loop channel per direction.
|
|
253
|
+
* A `request_changes` note re-enters chat as the correction turn via the
|
|
254
|
+
* `onVerdict` seam; chat remains the driver surface.
|
|
255
|
+
*/
|
|
256
|
+
|
|
257
|
+
/** Reviewer verdict wire body for the POST endpoint. */
|
|
258
|
+
type WorkProductVerdictBody = {
|
|
259
|
+
ok: true;
|
|
260
|
+
id: string;
|
|
261
|
+
verdict: 'approve';
|
|
262
|
+
note?: string;
|
|
263
|
+
} | {
|
|
264
|
+
ok: true;
|
|
265
|
+
id: string;
|
|
266
|
+
verdict: 'request_changes';
|
|
267
|
+
note: string;
|
|
268
|
+
} | {
|
|
269
|
+
ok: false;
|
|
270
|
+
error: string;
|
|
271
|
+
};
|
|
272
|
+
/** Validate the verdict POST body: `{ id, verdict, note? }`; a
|
|
273
|
+
* `request_changes` verdict REQUIRES a non-empty note — the note IS the
|
|
274
|
+
* correction turn the agent works from. */
|
|
275
|
+
declare function validateWorkProductVerdictBody(body: Record<string, unknown>): WorkProductVerdictBody;
|
|
276
|
+
/** The product seam's verdict for one request: authenticated reviewer +
|
|
277
|
+
* workspace, or a product-authored short-circuit Response (401/403/429…). */
|
|
278
|
+
type WorkProductRouteAuthorization = {
|
|
279
|
+
ok: true;
|
|
280
|
+
workspaceId: string;
|
|
281
|
+
reviewedBy: string;
|
|
282
|
+
} | {
|
|
283
|
+
ok: false;
|
|
284
|
+
response: Response;
|
|
285
|
+
};
|
|
286
|
+
/** Auth seam arguments carrying the request, the endpoint intent, and the parsed verdict body */
|
|
287
|
+
interface WorkProductAuthorizeArgs {
|
|
288
|
+
request: Request;
|
|
289
|
+
intent: 'list' | 'detail' | 'verdict';
|
|
290
|
+
/** The parsed, validated POST body (verdict intent only). */
|
|
291
|
+
body?: Record<string, unknown>;
|
|
292
|
+
}
|
|
293
|
+
/** Configuration options assembling the review endpoints from the store and product seams */
|
|
294
|
+
interface WorkProductRoutesOptions {
|
|
295
|
+
store: WorkProductStorePort;
|
|
296
|
+
/** Authenticate + authorize the caller; the ONLY product access step. */
|
|
297
|
+
authorize: (args: WorkProductAuthorizeArgs) => Promise<WorkProductRouteAuthorization>;
|
|
298
|
+
/** Post-verdict product seam: post the `request_changes` note into the
|
|
299
|
+
* driving chat thread as the correction turn, notify, etc. Runs after the
|
|
300
|
+
* transition commits; a throw is logged, never unwinds the verdict. */
|
|
301
|
+
onVerdict?: (args: {
|
|
302
|
+
record: WorkProductRecord;
|
|
303
|
+
verdict: 'approve' | 'request_changes';
|
|
304
|
+
note?: string;
|
|
305
|
+
reviewedBy: string;
|
|
306
|
+
}) => void | Promise<void>;
|
|
307
|
+
/** Persist/update the transcript anchor part reflecting the new status, so
|
|
308
|
+
* the chat card flips with the verdict. */
|
|
309
|
+
persistAnchorPart?: (part: WorkProductPersistedPart, record: WorkProductRecord) => void | Promise<void>;
|
|
310
|
+
/** Future integration point fired on approval (push to a DMS/CRM/export
|
|
311
|
+
* pipeline). A stub seam by design — export itself stays the product's
|
|
312
|
+
* signed object-store download. */
|
|
313
|
+
onExport?: (record: WorkProductRecord) => void | Promise<void>;
|
|
314
|
+
logger?: Pick<Console, 'warn' | 'error'>;
|
|
315
|
+
now?: () => number;
|
|
316
|
+
}
|
|
317
|
+
/** Assembled review endpoints returning web-standard Responses */
|
|
318
|
+
interface WorkProductRoutes {
|
|
319
|
+
/** GET — the workspace's records for the queue projection. Optional
|
|
320
|
+
* `?status=a,b` filter. */
|
|
321
|
+
list: (request: Request) => Promise<Response>;
|
|
322
|
+
/** GET — one record by id (404 when absent or outside the workspace). */
|
|
323
|
+
detail: (request: Request, id: string) => Promise<Response>;
|
|
324
|
+
/** POST `{ id, verdict, note? }` — the reviewer verdict: CAS transition +
|
|
325
|
+
* history entry + product seams. 409 when the record is no longer ready. */
|
|
326
|
+
verdict: (request: Request) => Promise<Response>;
|
|
327
|
+
}
|
|
328
|
+
/** Create the work-product review endpoints over the store port and product seams */
|
|
329
|
+
declare function createWorkProductRoutes(options: WorkProductRoutesOptions): WorkProductRoutes;
|
|
330
|
+
|
|
331
|
+
export { type CreateWorkProductInput, EVIDENCE_COVERAGE_CHECK, EvidenceEntry, ExceptionEntry, type FinalizeWorkProductProvenanceInput, type InMemoryWorkProductStore, MAX_WORK_PRODUCT_BATCH, QualityCheck, type SubmitWorkProductInput, TrustItem, WorkProductArtifact, WorkProductAuditEvent, type WorkProductAuthorizeArgs, type WorkProductOutcome, WorkProductPersistedPart, WorkProductProvenance, type WorkProductProvenanceBase, WorkProductRecord, type WorkProductRouteAuthorization, type WorkProductRoutes, type WorkProductRoutesOptions, type WorkProductService, type WorkProductServiceOptions, WorkProductStatus, WorkProductStorePort, type WorkProductToolConfig, type WorkProductVerdictBody, type WorkProductVerdictInput, buildWorkProductTools, canTransitionWorkProduct, createInMemoryWorkProductStore, createWorkProductRoutes, createWorkProductService, finalizeWorkProductProvenance, isWorkProductTerminal, stampProvenance, validateWorkProductVerdictBody, workProductTrustInputs };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EVIDENCE_COVERAGE_CHECK,
|
|
3
|
+
MAX_WORK_PRODUCT_BATCH,
|
|
4
|
+
buildWorkProductTools,
|
|
5
|
+
canTransitionWorkProduct,
|
|
6
|
+
createInMemoryWorkProductStore,
|
|
7
|
+
createWorkProductRoutes,
|
|
8
|
+
createWorkProductService,
|
|
9
|
+
finalizeWorkProductProvenance,
|
|
10
|
+
isWorkProductTerminal,
|
|
11
|
+
stampProvenance,
|
|
12
|
+
validateWorkProductVerdictBody,
|
|
13
|
+
workProductTrustInputs
|
|
14
|
+
} from "../chunk-HRH7ASAG.js";
|
|
15
|
+
import {
|
|
16
|
+
parseReviewQueueItem,
|
|
17
|
+
projectReviewQueue
|
|
18
|
+
} from "../chunk-UP33Z633.js";
|
|
19
|
+
import {
|
|
20
|
+
isWorkProductStatus,
|
|
21
|
+
parseAgentCheckInput,
|
|
22
|
+
parseArtifactInput,
|
|
23
|
+
parseEvidenceInput,
|
|
24
|
+
parseExceptionInput,
|
|
25
|
+
persistedPartToWorkProduct,
|
|
26
|
+
unresolvedBlockingExceptions,
|
|
27
|
+
workProductToPersistedPart
|
|
28
|
+
} from "../chunk-F2CBC4DY.js";
|
|
29
|
+
import "../chunk-YEFFHORB.js";
|
|
30
|
+
export {
|
|
31
|
+
EVIDENCE_COVERAGE_CHECK,
|
|
32
|
+
MAX_WORK_PRODUCT_BATCH,
|
|
33
|
+
buildWorkProductTools,
|
|
34
|
+
canTransitionWorkProduct,
|
|
35
|
+
createInMemoryWorkProductStore,
|
|
36
|
+
createWorkProductRoutes,
|
|
37
|
+
createWorkProductService,
|
|
38
|
+
finalizeWorkProductProvenance,
|
|
39
|
+
isWorkProductStatus,
|
|
40
|
+
isWorkProductTerminal,
|
|
41
|
+
parseAgentCheckInput,
|
|
42
|
+
parseArtifactInput,
|
|
43
|
+
parseEvidenceInput,
|
|
44
|
+
parseExceptionInput,
|
|
45
|
+
parseReviewQueueItem,
|
|
46
|
+
persistedPartToWorkProduct,
|
|
47
|
+
projectReviewQueue,
|
|
48
|
+
stampProvenance,
|
|
49
|
+
unresolvedBlockingExceptions,
|
|
50
|
+
validateWorkProductVerdictBody,
|
|
51
|
+
workProductToPersistedPart,
|
|
52
|
+
workProductTrustInputs
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|