@alquimia-ai/tools 2.5.0 → 2.7.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.
Files changed (46) hide show
  1. package/README.md +527 -23
  2. package/dist/actions/index.d.mts +1 -1
  3. package/dist/actions/index.d.ts +1 -1
  4. package/dist/hooks/index.d.mts +3 -3
  5. package/dist/hooks/index.d.ts +3 -3
  6. package/dist/hooks/index.js +62 -6
  7. package/dist/hooks/index.js.map +1 -1
  8. package/dist/hooks/index.mjs +62 -6
  9. package/dist/hooks/index.mjs.map +1 -1
  10. package/dist/next/index.js +4 -1
  11. package/dist/next/index.js.map +1 -1
  12. package/dist/next/index.mjs +4 -1
  13. package/dist/next/index.mjs.map +1 -1
  14. package/dist/providers/index.d.mts +3 -3
  15. package/dist/providers/index.d.ts +3 -3
  16. package/dist/{providers-DiR9cgyo.d.mts → providers-B4IOiGfr.d.mts} +1 -1
  17. package/dist/{providers-b5_yMyMo.d.ts → providers-mx21gNgZ.d.ts} +1 -1
  18. package/dist/proxy.js +4 -1
  19. package/dist/proxy.js.map +1 -1
  20. package/dist/proxy.mjs +4 -1
  21. package/dist/proxy.mjs.map +1 -1
  22. package/dist/sdk/index.d.mts +37 -4
  23. package/dist/sdk/index.d.ts +37 -4
  24. package/dist/sdk/index.js +43 -6
  25. package/dist/sdk/index.js.map +1 -1
  26. package/dist/sdk/index.mjs +43 -6
  27. package/dist/sdk/index.mjs.map +1 -1
  28. package/dist/services/index.d.mts +1 -1
  29. package/dist/services/index.d.ts +1 -1
  30. package/dist/{type-DqX3-9QS.d.mts → type-61gaZga-.d.mts} +45 -1
  31. package/dist/{type-xksRnBUW.d.ts → type-D-JaSMkV.d.ts} +45 -1
  32. package/dist/types/index.d.mts +6 -4
  33. package/dist/types/index.d.ts +6 -4
  34. package/dist/types/index.js.map +1 -1
  35. package/dist/types/index.mjs.map +1 -1
  36. package/dist/{types-C-6fgK1_.d.mts → types-lOliroPw.d.mts} +1 -1
  37. package/dist/{types-C-6fgK1_.d.ts → types-lOliroPw.d.ts} +1 -1
  38. package/dist/utils/index.d.mts +1 -1
  39. package/dist/utils/index.d.ts +1 -1
  40. package/dist/worklog/index.d.mts +2 -2
  41. package/dist/worklog/index.d.ts +2 -2
  42. package/dist/worklog/index.js +19 -0
  43. package/dist/worklog/index.js.map +1 -1
  44. package/dist/worklog/index.mjs +19 -0
  45. package/dist/worklog/index.mjs.map +1 -1
  46. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- export { a as AIMessageChunk, b as AIMessageChunkData, c as ActionResponse, d as AlquimiaEventData, e as AlquimiaMessage, f as ApiError, A as ApmSpan, g as AssistantInferenceResponse, h as AssistantResponseData, i as AttachmentPayload, B as BaseAPIConfig, C as CommonAttributes, j as ConversationsMap, D as DocumentSearchResult, E as ElevenLabsRequestSpecs, k as ElevenLabsVoiceSettings, l as EvaluationStrategy, m as ExpertInferenceResponse, n as ExtraDataContext, G as GenuiSurfaceItem, I as IToolSpec, o as ITooler, p as InferInitResponse, N as NativeToolsEvaluationStrategy, O as OneShootEvaluationStrategy, R as RatingData, q as RawToolsEvaluationStrategy, r as ResponseMetadata, T as TTSResult, s as ThinkingsInferenceResponse, t as TokenUsage, u as ToolEvent, v as ToolFactory, w as ToolOutput, x as ToolSummary, y as Tooler, U as UsageMetadata } from '../type-DqX3-9QS.mjs';
1
+ export { a as AIMessageChunk, b as AIMessageChunkData, c as ActionResponse, d as AlquimiaEventData, e as AlquimiaMessage, f as ApiError, A as ApmSpan, g as AssistantInferenceResponse, h as AssistantResponseData, i as AttachmentPayload, B as BaseAPIConfig, C as CommonAttributes, j as Content, k as ContentPart, l as ConversationsMap, D as DocumentSearchResult, E as ElevenLabsRequestSpecs, m as ElevenLabsVoiceSettings, n as EvaluationStrategy, o as ExpertInferenceResponse, p as ExtraDataContext, G as GenuiSurfaceItem, I as IToolSpec, q as ITooler, r as ImageContentPart, s as InferInitResponse, N as NativeToolsEvaluationStrategy, t as NonStandardContentPart, O as OneShootEvaluationStrategy, R as RatingData, u as RawToolsEvaluationStrategy, v as ResponseMetadata, w as RuntimeBlob, T as TTSResult, x as TextContentPart, y as ThinkingsInferenceResponse, z as TokenUsage, F as ToolEvent, H as ToolFactory, J as ToolOutput, K as ToolSummary, L as Tooler, U as UsageMetadata } from '../type-61gaZga-.mjs';
2
2
  import { T as ToolExecutionResponse } from '../types-CMVbyEv8.mjs';
3
- import { W as WorklogRecord } from '../types-C-6fgK1_.mjs';
3
+ import { W as WorklogRecord } from '../types-lOliroPw.mjs';
4
4
  import '@elastic/apm-rum';
5
5
  import 'ai';
6
6
 
7
7
  /**
8
- * Runtime v0.5.0 event payloads.
8
+ * Runtime v0.5.1 event payloads.
9
9
  *
10
10
  * These types mirror the request/response schemas exposed by the
11
11
  * `/event/*` endpoints. Many fields are optional because the runtime accepts
@@ -21,6 +21,8 @@ interface RuntimeEventBase {
21
21
  channel_id?: string;
22
22
  control_id?: string | null;
23
23
  timestamp?: string;
24
+ /** Resolved registry version tag for versioned assistant refs (runtime v0.5.1). */
25
+ versiontag?: string | null;
24
26
  }
25
27
  /** POST /event/session-start */
26
28
  interface SessionStartEvent extends RuntimeEventBase {
@@ -80,7 +82,7 @@ interface BusModeEvent extends RuntimeEventBase {
80
82
  interface HeartbeatEvent extends RuntimeEventBase {
81
83
  event_class: "HeartbeatEvent";
82
84
  }
83
- /** Discriminated union of all runtime v0.5.0 event payloads. */
85
+ /** Discriminated union of all runtime v0.5.1 event payloads. */
84
86
  type RuntimeEvent = SessionStartEvent | SessionEndEvent | UserMessageEvent | AgentMessageEvent | ToolApprovalEvent | ToolCompletionEvent | RuntimeErrorEvent | BusModeEvent | HeartbeatEvent;
85
87
 
86
88
  export type { AgentMessageEvent, BusModeEvent, HeartbeatEvent, RuntimeErrorEvent, RuntimeEvent, RuntimeEventBase, SessionEndEvent, SessionStartEvent, ToolApprovalEvent, ToolCompletionEvent, UserMessageEvent };
@@ -1,11 +1,11 @@
1
- export { a as AIMessageChunk, b as AIMessageChunkData, c as ActionResponse, d as AlquimiaEventData, e as AlquimiaMessage, f as ApiError, A as ApmSpan, g as AssistantInferenceResponse, h as AssistantResponseData, i as AttachmentPayload, B as BaseAPIConfig, C as CommonAttributes, j as ConversationsMap, D as DocumentSearchResult, E as ElevenLabsRequestSpecs, k as ElevenLabsVoiceSettings, l as EvaluationStrategy, m as ExpertInferenceResponse, n as ExtraDataContext, G as GenuiSurfaceItem, I as IToolSpec, o as ITooler, p as InferInitResponse, N as NativeToolsEvaluationStrategy, O as OneShootEvaluationStrategy, R as RatingData, q as RawToolsEvaluationStrategy, r as ResponseMetadata, T as TTSResult, s as ThinkingsInferenceResponse, t as TokenUsage, u as ToolEvent, v as ToolFactory, w as ToolOutput, x as ToolSummary, y as Tooler, U as UsageMetadata } from '../type-xksRnBUW.js';
1
+ export { a as AIMessageChunk, b as AIMessageChunkData, c as ActionResponse, d as AlquimiaEventData, e as AlquimiaMessage, f as ApiError, A as ApmSpan, g as AssistantInferenceResponse, h as AssistantResponseData, i as AttachmentPayload, B as BaseAPIConfig, C as CommonAttributes, j as Content, k as ContentPart, l as ConversationsMap, D as DocumentSearchResult, E as ElevenLabsRequestSpecs, m as ElevenLabsVoiceSettings, n as EvaluationStrategy, o as ExpertInferenceResponse, p as ExtraDataContext, G as GenuiSurfaceItem, I as IToolSpec, q as ITooler, r as ImageContentPart, s as InferInitResponse, N as NativeToolsEvaluationStrategy, t as NonStandardContentPart, O as OneShootEvaluationStrategy, R as RatingData, u as RawToolsEvaluationStrategy, v as ResponseMetadata, w as RuntimeBlob, T as TTSResult, x as TextContentPart, y as ThinkingsInferenceResponse, z as TokenUsage, F as ToolEvent, H as ToolFactory, J as ToolOutput, K as ToolSummary, L as Tooler, U as UsageMetadata } from '../type-D-JaSMkV.js';
2
2
  import { T as ToolExecutionResponse } from '../types-CMVbyEv8.js';
3
- import { W as WorklogRecord } from '../types-C-6fgK1_.js';
3
+ import { W as WorklogRecord } from '../types-lOliroPw.js';
4
4
  import '@elastic/apm-rum';
5
5
  import 'ai';
6
6
 
7
7
  /**
8
- * Runtime v0.5.0 event payloads.
8
+ * Runtime v0.5.1 event payloads.
9
9
  *
10
10
  * These types mirror the request/response schemas exposed by the
11
11
  * `/event/*` endpoints. Many fields are optional because the runtime accepts
@@ -21,6 +21,8 @@ interface RuntimeEventBase {
21
21
  channel_id?: string;
22
22
  control_id?: string | null;
23
23
  timestamp?: string;
24
+ /** Resolved registry version tag for versioned assistant refs (runtime v0.5.1). */
25
+ versiontag?: string | null;
24
26
  }
25
27
  /** POST /event/session-start */
26
28
  interface SessionStartEvent extends RuntimeEventBase {
@@ -80,7 +82,7 @@ interface BusModeEvent extends RuntimeEventBase {
80
82
  interface HeartbeatEvent extends RuntimeEventBase {
81
83
  event_class: "HeartbeatEvent";
82
84
  }
83
- /** Discriminated union of all runtime v0.5.0 event payloads. */
85
+ /** Discriminated union of all runtime v0.5.1 event payloads. */
84
86
  type RuntimeEvent = SessionStartEvent | SessionEndEvent | UserMessageEvent | AgentMessageEvent | ToolApprovalEvent | ToolCompletionEvent | RuntimeErrorEvent | BusModeEvent | HeartbeatEvent;
85
87
 
86
88
  export type { AgentMessageEvent, BusModeEvent, HeartbeatEvent, RuntimeErrorEvent, RuntimeEvent, RuntimeEventBase, SessionEndEvent, SessionStartEvent, ToolApprovalEvent, ToolCompletionEvent, UserMessageEvent };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/index.ts","../../src/types/type.ts"],"sourcesContent":["export * from './type';\nexport * from './runtime';\n","import { Span } from \"@elastic/apm-rum\";\nimport { Message } from \"ai\";\nimport { A2uiSurface } from \"../genui\";\nexport interface ITooler {\n tooler: Array<{\n name: string;\n parameters: Record<string, any>;\n }>;\n}\n\nexport interface IToolSpec {\n name: string;\n parameters: Record<string, any>;\n}\n\nexport abstract class ToolFactory {\n protected toolSpec: IToolSpec | null = null;\n\n constructor(toolSpec: IToolSpec) {\n this.toolSpec = toolSpec;\n }\n\n static createTool(toolSpec: IToolSpec): IToolSpec {\n return toolSpec;\n }\n\n abstract execute(): Promise<any>;\n}\n\nexport interface AIMessageChunk {\n type: string;\n data?: AIMessageChunkData;\n answer?: string;\n tooler?: ToolEvent[];\n error_code?: string;\n error_detail?: string;\n taskid?: string;\n loading?: boolean;\n thinkings?: ThinkingsInferenceResponse[];\n}\n\nexport interface AIMessageChunkData {\n content: string;\n additional_kwargs?: Record<string, unknown>;\n response_metadata?: Record<string, unknown>;\n type: string;\n name?: string | null;\n id?: string | null;\n example?: boolean;\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n usage_metadata?: any;\n tool_call_chunks?: unknown[];\n error_code?: string;\n error_detail?: string;\n}\n\ntype ToolCall = {\n name: string;\n args: Record<string, any>;\n id?: string | null;\n};\n\ntype InvalidToolCall = {\n name: string | null;\n args: string | null;\n id: string | null;\n error: string | null;\n};\n\nexport interface BaseAPIConfig {\n baseUrl: string;\n route: string;\n token?: string;\n headers?: Record<string, string>;\n}\n\nexport interface RatingData {\n assistantId: string;\n sessionId: string;\n topicId: number;\n score?: number;\n description?: string;\n}\n\nexport interface AttachmentPayload {\n filename: string;\n content_type: string;\n content_size: number;\n}\n\nexport type AlquimiaMessage = Message & {\n error_code?: string;\n error_detail?: string;\n taskid?: string;\n loading?: boolean;\n created_at?: string;\n additionalInfo?: string;\n tooler?: Tooler[];\n thinkings?: ThinkingsInferenceResponse[];\n attachments?: AttachmentPayload[];\n};\n\nexport interface ActionResponse<T = void> {\n success: boolean;\n data?: T;\n error?: {\n message: string;\n code?: string;\n details?: any;\n name?: string;\n cause?: string;\n status?: string;\n };\n}\n\nexport type ApmSpan = Span & {\n id?: string \n traceId?: string\n} | undefined\n\nexport type ApiError = Error & {\n message: string;\n name: string;\n cause: string;\n code?: string | number;\n status?: string | number;\n}\n\nexport type Tooler = {\n control_id: string;\n tool_summary?: ToolSummary;\n tool_output?: ToolOutput;\n}\n\nexport type ToolSummary = {\n name: string;\n parameters: Record<string, any>;\n}\n\nexport type ToolOutput = {\n result: any;\n status: string;\n}\n\nexport type ToolEvent = {\n event_class: string;\n control_id: string;\n data: any;\n status: string;\n}\n\nexport interface ConversationsMap {\n [topicId: string]: string;\n}\n\nexport interface DocumentSearchResult {\n pageContent: string;\n metadata: {\n source: string;\n _id: string;\n _collection_name: string;\n };\n score: number;\n}\n\nexport type ElevenLabsVoiceSettings = {\n stability: number;\n similarity_boost: number;\n style: number;\n};\n\nexport type ElevenLabsRequestSpecs = {\n optimize_streaming_latency: string;\n output_format: string;\n model_id: string;\n language: string;\n voice_settings: ElevenLabsVoiceSettings;\n};\n\nexport type TTSResult =\n | { type: 'blob'; data: Blob }\n | { type: 'url'; data: string }\n | { type: 'error'; message: string };\n\n /** One SSE `data:` JSON frame (`event_class` at top level). */\n export interface AlquimiaEventData {\n taskid?: string;\n event_class?: string;\n control_id?: string;\n date_submitted?: string;\n status?: string | null;\n data?: unknown;\n experts?: ExpertInferenceResponse[];\n thinkings?: ThinkingsInferenceResponse[];\n tools_output?: ToolEvent[];\n agents_output?: any[];\n tools_pending_approval?: any[];\n tools_pending_execution?: any[];\n errors?: any[];\n }\n\n export interface AssistantInferenceResponse {\n event_class: string;\n control_id: string;\n data: string;\n status: string;\n date_submitted: string;\n message?: string | null;\n extras?: Record<string, unknown> | null;\n extra_data?: ExtraDataContext | null;\n channel?: unknown | null;\n depth?: number;\n taskid?: string;\n }\n\n /**\n * Channel-scoped context returned alongside an inference response (was\n * `ExtraDataConfig` in v0.2.0). Carries message metadata from the channel\n * the inference was triggered from.\n */\n export interface ExtraDataContext {\n whatsapp_message_id?: string;\n whatsapp_message_from?: string;\n email_message_recipient?: string;\n email_message_subject?: string;\n email_message_id?: string;\n email_message_body?: string;\n slack_team_id?: string;\n slack_user_id?: string;\n slack_channel_id?: string;\n slack_response_url?: string;\n }\n\n /**\n * JSON body returned by `POST /event/infer/{assistantId}` (and channel\n * variants). Keys match the runtime wire format (lowercase, no underscores).\n * `taskid` is the id used for the SSE stream.\n */\n export interface CommonAttributes {\n taskid?: string | null;\n parenttaskid?: string | null;\n sessionid?: string | null;\n userid?: string | null;\n assistantid?: string | null;\n agentspaceid?: string | null;\n channelid?: string | null;\n depth?: string;\n attachments?: string[];\n }\n\n export type InferInitResponse = CommonAttributes;\n\n /**\n * Native-tools evaluation strategy. Wraps the client-side tool schemas\n * the SDK previously sent at the top level of the infer payload.\n */\n export interface NativeToolsEvaluationStrategy {\n evaluation_strategy_id: 'native';\n tool_schemas?: unknown[];\n max_steps?: number;\n current_step?: number;\n max_concurrent_tools?: number;\n decorators?: unknown[];\n tool_choice?: unknown;\n structured_output?: unknown;\n }\n\n export interface RawToolsEvaluationStrategy {\n evaluation_strategy_id: 'raw';\n tool_schemas?: unknown[];\n }\n\n export interface OneShootEvaluationStrategy {\n evaluation_strategy_id: 'one-shoot';\n }\n\n export type EvaluationStrategy =\n | NativeToolsEvaluationStrategy\n | RawToolsEvaluationStrategy\n | OneShootEvaluationStrategy;\n\n export interface AssistantResponseData {\n content: string;\n additional_kwargs: Record<string, any>;\n response_metadata: ResponseMetadata;\n type: string;\n id: string;\n example: boolean;\n tool_calls: any[];\n invalid_tool_calls: any[];\n usage_metadata: UsageMetadata;\n }\n\n export interface ResponseMetadata {\n token_usage: TokenUsage;\n model_name: string;\n system_fingerprint: string;\n finish_reason: string;\n logprobs: any | null;\n }\n\n export interface TokenUsage {\n completion_tokens: number;\n prompt_tokens: number;\n total_tokens: number;\n completion_time: number;\n prompt_time: number;\n queue_time: number;\n total_time: number;\n }\n\n export interface UsageMetadata {\n input_tokens: number;\n output_tokens: number;\n total_tokens: number;\n }\n\n export interface ExpertInferenceResponse {\n event_class: string;\n control_id: string;\n data: {\n label: string;\n score: number;\n };\n status: string;\n date_submitted: string;\n }\n\n export interface ThinkingsInferenceResponse {\n event_class: string;\n control_id: string;\n status: string;\n date_submitted: string;\n data: {\n content: AssistantResponseData;\n is_complete: boolean;\n is_partial: boolean;\n };\n }\n\n export interface GenuiSurfaceItem {\n controlId: string;\n surface: A2uiSurface;\n /** Message-count anchor: the surface renders after this many messages (chronological ordering). */\n afterCount: number;\n /** True once the user has submitted an interactive surface (disables it + shows a submitted state). */\n submitted?: boolean;\n /** Set when the user declined the surface and typed a reply */\n dismissedWith?: string;\n }"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,IAAe,cAAf,MAA2B;AAAA,EAGhC,YAAY,UAAqB;AAFjC,SAAU,WAA6B;AAGrC,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,OAAO,WAAW,UAAgC;AAChD,WAAO;AAAA,EACT;AAGF;","names":[]}
1
+ {"version":3,"sources":["../../src/types/index.ts","../../src/types/type.ts"],"sourcesContent":["export * from './type';\nexport * from './runtime';\n","import { Span } from \"@elastic/apm-rum\";\nimport { Message } from \"ai\";\nimport { A2uiSurface } from \"../genui\";\nexport interface ITooler {\n tooler: Array<{\n name: string;\n parameters: Record<string, any>;\n }>;\n}\n\nexport interface IToolSpec {\n name: string;\n parameters: Record<string, any>;\n}\n\nexport abstract class ToolFactory {\n protected toolSpec: IToolSpec | null = null;\n\n constructor(toolSpec: IToolSpec) {\n this.toolSpec = toolSpec;\n }\n\n static createTool(toolSpec: IToolSpec): IToolSpec {\n return toolSpec;\n }\n\n abstract execute(): Promise<any>;\n}\n\nexport interface AIMessageChunk {\n type: string;\n data?: AIMessageChunkData;\n answer?: string;\n tooler?: ToolEvent[];\n error_code?: string;\n error_detail?: string;\n taskid?: string;\n loading?: boolean;\n thinkings?: ThinkingsInferenceResponse[];\n}\n\nexport interface AIMessageChunkData {\n content: string;\n additional_kwargs?: Record<string, unknown>;\n response_metadata?: Record<string, unknown>;\n type: string;\n name?: string | null;\n id?: string | null;\n example?: boolean;\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n usage_metadata?: any;\n tool_call_chunks?: unknown[];\n error_code?: string;\n error_detail?: string;\n}\n\ntype ToolCall = {\n name: string;\n args: Record<string, any>;\n id?: string | null;\n};\n\ntype InvalidToolCall = {\n name: string | null;\n args: string | null;\n id: string | null;\n error: string | null;\n};\n\nexport interface BaseAPIConfig {\n baseUrl: string;\n route: string;\n token?: string;\n headers?: Record<string, string>;\n}\n\nexport interface RatingData {\n assistantId: string;\n sessionId: string;\n topicId: number;\n score?: number;\n description?: string;\n}\n\nexport interface AttachmentPayload {\n filename: string;\n content_type: string;\n content_size: number;\n}\n\nexport type AlquimiaMessage = Message & {\n error_code?: string;\n error_detail?: string;\n taskid?: string;\n loading?: boolean;\n created_at?: string;\n additionalInfo?: string;\n tooler?: Tooler[];\n thinkings?: ThinkingsInferenceResponse[];\n attachments?: AttachmentPayload[];\n};\n\nexport interface ActionResponse<T = void> {\n success: boolean;\n data?: T;\n error?: {\n message: string;\n code?: string;\n details?: any;\n name?: string;\n cause?: string;\n status?: string;\n };\n}\n\nexport type ApmSpan = Span & {\n id?: string \n traceId?: string\n} | undefined\n\nexport type ApiError = Error & {\n message: string;\n name: string;\n cause: string;\n code?: string | number;\n status?: string | number;\n}\n\nexport type Tooler = {\n control_id: string;\n tool_summary?: ToolSummary;\n tool_output?: ToolOutput;\n}\n\nexport type ToolSummary = {\n name: string;\n parameters: Record<string, any>;\n}\n\nexport type ToolOutput = {\n result: any;\n status: string;\n}\n\nexport type ToolEvent = {\n event_class: string;\n control_id: string;\n data: any;\n status: string;\n}\n\nexport interface ConversationsMap {\n [topicId: string]: string;\n}\n\nexport interface DocumentSearchResult {\n pageContent: string;\n metadata: {\n source: string;\n _id: string;\n _collection_name: string;\n };\n score: number;\n}\n\nexport type ElevenLabsVoiceSettings = {\n stability: number;\n similarity_boost: number;\n style: number;\n};\n\nexport type ElevenLabsRequestSpecs = {\n optimize_streaming_latency: string;\n output_format: string;\n model_id: string;\n language: string;\n voice_settings: ElevenLabsVoiceSettings;\n};\n\nexport type TTSResult =\n | { type: 'blob'; data: Blob }\n | { type: 'url'; data: string }\n | { type: 'error'; message: string };\n\n /** One SSE `data:` JSON frame (`event_class` at top level). */\n export interface AlquimiaEventData {\n taskid?: string;\n event_class?: string;\n control_id?: string;\n date_submitted?: string;\n status?: string | null;\n data?: unknown;\n experts?: ExpertInferenceResponse[];\n thinkings?: ThinkingsInferenceResponse[];\n tools_output?: ToolEvent[];\n agents_output?: any[];\n tools_pending_approval?: any[];\n tools_pending_execution?: any[];\n errors?: any[];\n }\n\n export interface AssistantInferenceResponse {\n event_class: string;\n control_id: string;\n data: string;\n status: string;\n date_submitted: string;\n message?: string | null;\n extras?: Record<string, unknown> | null;\n extra_data?: ExtraDataContext | null;\n channel?: unknown | null;\n depth?: number;\n taskid?: string;\n }\n\n /**\n * Channel-scoped context returned alongside an inference response (was\n * `ExtraDataConfig` in v0.2.0). Carries message metadata from the channel\n * the inference was triggered from.\n */\n export interface ExtraDataContext {\n whatsapp_message_id?: string;\n whatsapp_message_from?: string;\n email_message_recipient?: string;\n email_message_subject?: string;\n email_message_id?: string;\n email_message_body?: string;\n slack_team_id?: string;\n slack_user_id?: string;\n slack_channel_id?: string;\n slack_response_url?: string;\n }\n\n /**\n * JSON body returned by `POST /event/infer/{assistantId}` (and channel\n * variants). Keys match the runtime wire format (lowercase, no underscores).\n * `taskid` is the id used for the SSE stream.\n */\n export interface CommonAttributes {\n taskid?: string | null;\n parenttaskid?: string | null;\n sessionid?: string | null;\n userid?: string | null;\n assistantid?: string | null;\n agentspaceid?: string | null;\n channelid?: string | null;\n depth?: string;\n attachments?: string[];\n /** Registry version the runtime resolved for this task (runtime v0.5.1). */\n versiontag?: string | null;\n }\n\n export type InferInitResponse = CommonAttributes;\n\n /** A text block in a multimodal `query` (runtime `TextContentPart`). */\n export interface TextContentPart {\n type: 'text';\n text: string;\n }\n\n /** An image block in a multimodal `query` (runtime `ImageContentPart`). */\n export interface ImageContentPart {\n type: 'image_url';\n image_url: {\n url: string;\n detail?: 'auto' | 'low' | 'high';\n };\n }\n\n /**\n * Catch-all for content blocks the runtime does not model explicitly. It\n * round-trips unknown provider blocks rather than failing validation.\n */\n export interface NonStandardContentPart {\n type: 'non_standard';\n value?: Record<string, unknown>;\n }\n\n export type ContentPart = TextContentPart | ImageContentPart | NonStandardContentPart;\n\n /**\n * An inference `query`: either plain text, or an OpenAI-style list of content\n * parts for multimodal input.\n */\n export type Content = string | ContentPart[];\n\n /**\n * A blob held in the session context. Returned by `POST /context/blob/upload`\n * and accepted as `input_audio` on infer (runtime v0.5.1).\n */\n export interface RuntimeBlob {\n blob_id: string;\n filename: string;\n content_size: number;\n content_type?: string | null;\n checksum?: string | null;\n created_at?: number | null;\n expires_at?: number | null;\n /** Base64-encoded content. Populated by channel ingest, not by blob upload. */\n data_base64?: string | null;\n }\n\n /**\n * Native-tools evaluation strategy. Wraps the client-side tool schemas\n * the SDK previously sent at the top level of the infer payload.\n */\n export interface NativeToolsEvaluationStrategy {\n evaluation_strategy_id: 'native';\n tool_schemas?: unknown[];\n max_steps?: number;\n current_step?: number;\n max_concurrent_tools?: number;\n decorators?: unknown[];\n tool_choice?: unknown;\n structured_output?: unknown;\n }\n\n export interface RawToolsEvaluationStrategy {\n evaluation_strategy_id: 'raw';\n tool_schemas?: unknown[];\n }\n\n export interface OneShootEvaluationStrategy {\n evaluation_strategy_id: 'one-shoot';\n }\n\n export type EvaluationStrategy =\n | NativeToolsEvaluationStrategy\n | RawToolsEvaluationStrategy\n | OneShootEvaluationStrategy;\n\n export interface AssistantResponseData {\n content: string;\n additional_kwargs: Record<string, any>;\n response_metadata: ResponseMetadata;\n type: string;\n id: string;\n example: boolean;\n tool_calls: any[];\n invalid_tool_calls: any[];\n usage_metadata: UsageMetadata;\n }\n\n export interface ResponseMetadata {\n token_usage: TokenUsage;\n model_name: string;\n system_fingerprint: string;\n finish_reason: string;\n logprobs: any | null;\n }\n\n export interface TokenUsage {\n completion_tokens: number;\n prompt_tokens: number;\n total_tokens: number;\n completion_time: number;\n prompt_time: number;\n queue_time: number;\n total_time: number;\n }\n\n export interface UsageMetadata {\n input_tokens: number;\n output_tokens: number;\n total_tokens: number;\n }\n\n export interface ExpertInferenceResponse {\n event_class: string;\n control_id: string;\n data: {\n label: string;\n score: number;\n };\n status: string;\n date_submitted: string;\n }\n\n export interface ThinkingsInferenceResponse {\n event_class: string;\n control_id: string;\n status: string;\n date_submitted: string;\n data: {\n content: AssistantResponseData;\n is_complete: boolean;\n is_partial: boolean;\n };\n }\n\n export interface GenuiSurfaceItem {\n controlId: string;\n surface: A2uiSurface;\n /** Message-count anchor: the surface renders after this many messages (chronological ordering). */\n afterCount: number;\n /** True once the user has submitted an interactive surface (disables it + shows a submitted state). */\n submitted?: boolean;\n /** Set when the user declined the surface and typed a reply */\n dismissedWith?: string;\n }"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,IAAe,cAAf,MAA2B;AAAA,EAGhC,YAAY,UAAqB;AAFjC,SAAU,WAA6B;AAGrC,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,OAAO,WAAW,UAAgC;AAChD,WAAO;AAAA,EACT;AAGF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/type.ts"],"sourcesContent":["import { Span } from \"@elastic/apm-rum\";\nimport { Message } from \"ai\";\nimport { A2uiSurface } from \"../genui\";\nexport interface ITooler {\n tooler: Array<{\n name: string;\n parameters: Record<string, any>;\n }>;\n}\n\nexport interface IToolSpec {\n name: string;\n parameters: Record<string, any>;\n}\n\nexport abstract class ToolFactory {\n protected toolSpec: IToolSpec | null = null;\n\n constructor(toolSpec: IToolSpec) {\n this.toolSpec = toolSpec;\n }\n\n static createTool(toolSpec: IToolSpec): IToolSpec {\n return toolSpec;\n }\n\n abstract execute(): Promise<any>;\n}\n\nexport interface AIMessageChunk {\n type: string;\n data?: AIMessageChunkData;\n answer?: string;\n tooler?: ToolEvent[];\n error_code?: string;\n error_detail?: string;\n taskid?: string;\n loading?: boolean;\n thinkings?: ThinkingsInferenceResponse[];\n}\n\nexport interface AIMessageChunkData {\n content: string;\n additional_kwargs?: Record<string, unknown>;\n response_metadata?: Record<string, unknown>;\n type: string;\n name?: string | null;\n id?: string | null;\n example?: boolean;\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n usage_metadata?: any;\n tool_call_chunks?: unknown[];\n error_code?: string;\n error_detail?: string;\n}\n\ntype ToolCall = {\n name: string;\n args: Record<string, any>;\n id?: string | null;\n};\n\ntype InvalidToolCall = {\n name: string | null;\n args: string | null;\n id: string | null;\n error: string | null;\n};\n\nexport interface BaseAPIConfig {\n baseUrl: string;\n route: string;\n token?: string;\n headers?: Record<string, string>;\n}\n\nexport interface RatingData {\n assistantId: string;\n sessionId: string;\n topicId: number;\n score?: number;\n description?: string;\n}\n\nexport interface AttachmentPayload {\n filename: string;\n content_type: string;\n content_size: number;\n}\n\nexport type AlquimiaMessage = Message & {\n error_code?: string;\n error_detail?: string;\n taskid?: string;\n loading?: boolean;\n created_at?: string;\n additionalInfo?: string;\n tooler?: Tooler[];\n thinkings?: ThinkingsInferenceResponse[];\n attachments?: AttachmentPayload[];\n};\n\nexport interface ActionResponse<T = void> {\n success: boolean;\n data?: T;\n error?: {\n message: string;\n code?: string;\n details?: any;\n name?: string;\n cause?: string;\n status?: string;\n };\n}\n\nexport type ApmSpan = Span & {\n id?: string \n traceId?: string\n} | undefined\n\nexport type ApiError = Error & {\n message: string;\n name: string;\n cause: string;\n code?: string | number;\n status?: string | number;\n}\n\nexport type Tooler = {\n control_id: string;\n tool_summary?: ToolSummary;\n tool_output?: ToolOutput;\n}\n\nexport type ToolSummary = {\n name: string;\n parameters: Record<string, any>;\n}\n\nexport type ToolOutput = {\n result: any;\n status: string;\n}\n\nexport type ToolEvent = {\n event_class: string;\n control_id: string;\n data: any;\n status: string;\n}\n\nexport interface ConversationsMap {\n [topicId: string]: string;\n}\n\nexport interface DocumentSearchResult {\n pageContent: string;\n metadata: {\n source: string;\n _id: string;\n _collection_name: string;\n };\n score: number;\n}\n\nexport type ElevenLabsVoiceSettings = {\n stability: number;\n similarity_boost: number;\n style: number;\n};\n\nexport type ElevenLabsRequestSpecs = {\n optimize_streaming_latency: string;\n output_format: string;\n model_id: string;\n language: string;\n voice_settings: ElevenLabsVoiceSettings;\n};\n\nexport type TTSResult =\n | { type: 'blob'; data: Blob }\n | { type: 'url'; data: string }\n | { type: 'error'; message: string };\n\n /** One SSE `data:` JSON frame (`event_class` at top level). */\n export interface AlquimiaEventData {\n taskid?: string;\n event_class?: string;\n control_id?: string;\n date_submitted?: string;\n status?: string | null;\n data?: unknown;\n experts?: ExpertInferenceResponse[];\n thinkings?: ThinkingsInferenceResponse[];\n tools_output?: ToolEvent[];\n agents_output?: any[];\n tools_pending_approval?: any[];\n tools_pending_execution?: any[];\n errors?: any[];\n }\n\n export interface AssistantInferenceResponse {\n event_class: string;\n control_id: string;\n data: string;\n status: string;\n date_submitted: string;\n message?: string | null;\n extras?: Record<string, unknown> | null;\n extra_data?: ExtraDataContext | null;\n channel?: unknown | null;\n depth?: number;\n taskid?: string;\n }\n\n /**\n * Channel-scoped context returned alongside an inference response (was\n * `ExtraDataConfig` in v0.2.0). Carries message metadata from the channel\n * the inference was triggered from.\n */\n export interface ExtraDataContext {\n whatsapp_message_id?: string;\n whatsapp_message_from?: string;\n email_message_recipient?: string;\n email_message_subject?: string;\n email_message_id?: string;\n email_message_body?: string;\n slack_team_id?: string;\n slack_user_id?: string;\n slack_channel_id?: string;\n slack_response_url?: string;\n }\n\n /**\n * JSON body returned by `POST /event/infer/{assistantId}` (and channel\n * variants). Keys match the runtime wire format (lowercase, no underscores).\n * `taskid` is the id used for the SSE stream.\n */\n export interface CommonAttributes {\n taskid?: string | null;\n parenttaskid?: string | null;\n sessionid?: string | null;\n userid?: string | null;\n assistantid?: string | null;\n agentspaceid?: string | null;\n channelid?: string | null;\n depth?: string;\n attachments?: string[];\n }\n\n export type InferInitResponse = CommonAttributes;\n\n /**\n * Native-tools evaluation strategy. Wraps the client-side tool schemas\n * the SDK previously sent at the top level of the infer payload.\n */\n export interface NativeToolsEvaluationStrategy {\n evaluation_strategy_id: 'native';\n tool_schemas?: unknown[];\n max_steps?: number;\n current_step?: number;\n max_concurrent_tools?: number;\n decorators?: unknown[];\n tool_choice?: unknown;\n structured_output?: unknown;\n }\n\n export interface RawToolsEvaluationStrategy {\n evaluation_strategy_id: 'raw';\n tool_schemas?: unknown[];\n }\n\n export interface OneShootEvaluationStrategy {\n evaluation_strategy_id: 'one-shoot';\n }\n\n export type EvaluationStrategy =\n | NativeToolsEvaluationStrategy\n | RawToolsEvaluationStrategy\n | OneShootEvaluationStrategy;\n\n export interface AssistantResponseData {\n content: string;\n additional_kwargs: Record<string, any>;\n response_metadata: ResponseMetadata;\n type: string;\n id: string;\n example: boolean;\n tool_calls: any[];\n invalid_tool_calls: any[];\n usage_metadata: UsageMetadata;\n }\n\n export interface ResponseMetadata {\n token_usage: TokenUsage;\n model_name: string;\n system_fingerprint: string;\n finish_reason: string;\n logprobs: any | null;\n }\n\n export interface TokenUsage {\n completion_tokens: number;\n prompt_tokens: number;\n total_tokens: number;\n completion_time: number;\n prompt_time: number;\n queue_time: number;\n total_time: number;\n }\n\n export interface UsageMetadata {\n input_tokens: number;\n output_tokens: number;\n total_tokens: number;\n }\n\n export interface ExpertInferenceResponse {\n event_class: string;\n control_id: string;\n data: {\n label: string;\n score: number;\n };\n status: string;\n date_submitted: string;\n }\n\n export interface ThinkingsInferenceResponse {\n event_class: string;\n control_id: string;\n status: string;\n date_submitted: string;\n data: {\n content: AssistantResponseData;\n is_complete: boolean;\n is_partial: boolean;\n };\n }\n\n export interface GenuiSurfaceItem {\n controlId: string;\n surface: A2uiSurface;\n /** Message-count anchor: the surface renders after this many messages (chronological ordering). */\n afterCount: number;\n /** True once the user has submitted an interactive surface (disables it + shows a submitted state). */\n submitted?: boolean;\n /** Set when the user declined the surface and typed a reply */\n dismissedWith?: string;\n }"],"mappings":";AAeO,IAAe,cAAf,MAA2B;AAAA,EAGhC,YAAY,UAAqB;AAFjC,SAAU,WAA6B;AAGrC,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,OAAO,WAAW,UAAgC;AAChD,WAAO;AAAA,EACT;AAGF;","names":[]}
1
+ {"version":3,"sources":["../../src/types/type.ts"],"sourcesContent":["import { Span } from \"@elastic/apm-rum\";\nimport { Message } from \"ai\";\nimport { A2uiSurface } from \"../genui\";\nexport interface ITooler {\n tooler: Array<{\n name: string;\n parameters: Record<string, any>;\n }>;\n}\n\nexport interface IToolSpec {\n name: string;\n parameters: Record<string, any>;\n}\n\nexport abstract class ToolFactory {\n protected toolSpec: IToolSpec | null = null;\n\n constructor(toolSpec: IToolSpec) {\n this.toolSpec = toolSpec;\n }\n\n static createTool(toolSpec: IToolSpec): IToolSpec {\n return toolSpec;\n }\n\n abstract execute(): Promise<any>;\n}\n\nexport interface AIMessageChunk {\n type: string;\n data?: AIMessageChunkData;\n answer?: string;\n tooler?: ToolEvent[];\n error_code?: string;\n error_detail?: string;\n taskid?: string;\n loading?: boolean;\n thinkings?: ThinkingsInferenceResponse[];\n}\n\nexport interface AIMessageChunkData {\n content: string;\n additional_kwargs?: Record<string, unknown>;\n response_metadata?: Record<string, unknown>;\n type: string;\n name?: string | null;\n id?: string | null;\n example?: boolean;\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n usage_metadata?: any;\n tool_call_chunks?: unknown[];\n error_code?: string;\n error_detail?: string;\n}\n\ntype ToolCall = {\n name: string;\n args: Record<string, any>;\n id?: string | null;\n};\n\ntype InvalidToolCall = {\n name: string | null;\n args: string | null;\n id: string | null;\n error: string | null;\n};\n\nexport interface BaseAPIConfig {\n baseUrl: string;\n route: string;\n token?: string;\n headers?: Record<string, string>;\n}\n\nexport interface RatingData {\n assistantId: string;\n sessionId: string;\n topicId: number;\n score?: number;\n description?: string;\n}\n\nexport interface AttachmentPayload {\n filename: string;\n content_type: string;\n content_size: number;\n}\n\nexport type AlquimiaMessage = Message & {\n error_code?: string;\n error_detail?: string;\n taskid?: string;\n loading?: boolean;\n created_at?: string;\n additionalInfo?: string;\n tooler?: Tooler[];\n thinkings?: ThinkingsInferenceResponse[];\n attachments?: AttachmentPayload[];\n};\n\nexport interface ActionResponse<T = void> {\n success: boolean;\n data?: T;\n error?: {\n message: string;\n code?: string;\n details?: any;\n name?: string;\n cause?: string;\n status?: string;\n };\n}\n\nexport type ApmSpan = Span & {\n id?: string \n traceId?: string\n} | undefined\n\nexport type ApiError = Error & {\n message: string;\n name: string;\n cause: string;\n code?: string | number;\n status?: string | number;\n}\n\nexport type Tooler = {\n control_id: string;\n tool_summary?: ToolSummary;\n tool_output?: ToolOutput;\n}\n\nexport type ToolSummary = {\n name: string;\n parameters: Record<string, any>;\n}\n\nexport type ToolOutput = {\n result: any;\n status: string;\n}\n\nexport type ToolEvent = {\n event_class: string;\n control_id: string;\n data: any;\n status: string;\n}\n\nexport interface ConversationsMap {\n [topicId: string]: string;\n}\n\nexport interface DocumentSearchResult {\n pageContent: string;\n metadata: {\n source: string;\n _id: string;\n _collection_name: string;\n };\n score: number;\n}\n\nexport type ElevenLabsVoiceSettings = {\n stability: number;\n similarity_boost: number;\n style: number;\n};\n\nexport type ElevenLabsRequestSpecs = {\n optimize_streaming_latency: string;\n output_format: string;\n model_id: string;\n language: string;\n voice_settings: ElevenLabsVoiceSettings;\n};\n\nexport type TTSResult =\n | { type: 'blob'; data: Blob }\n | { type: 'url'; data: string }\n | { type: 'error'; message: string };\n\n /** One SSE `data:` JSON frame (`event_class` at top level). */\n export interface AlquimiaEventData {\n taskid?: string;\n event_class?: string;\n control_id?: string;\n date_submitted?: string;\n status?: string | null;\n data?: unknown;\n experts?: ExpertInferenceResponse[];\n thinkings?: ThinkingsInferenceResponse[];\n tools_output?: ToolEvent[];\n agents_output?: any[];\n tools_pending_approval?: any[];\n tools_pending_execution?: any[];\n errors?: any[];\n }\n\n export interface AssistantInferenceResponse {\n event_class: string;\n control_id: string;\n data: string;\n status: string;\n date_submitted: string;\n message?: string | null;\n extras?: Record<string, unknown> | null;\n extra_data?: ExtraDataContext | null;\n channel?: unknown | null;\n depth?: number;\n taskid?: string;\n }\n\n /**\n * Channel-scoped context returned alongside an inference response (was\n * `ExtraDataConfig` in v0.2.0). Carries message metadata from the channel\n * the inference was triggered from.\n */\n export interface ExtraDataContext {\n whatsapp_message_id?: string;\n whatsapp_message_from?: string;\n email_message_recipient?: string;\n email_message_subject?: string;\n email_message_id?: string;\n email_message_body?: string;\n slack_team_id?: string;\n slack_user_id?: string;\n slack_channel_id?: string;\n slack_response_url?: string;\n }\n\n /**\n * JSON body returned by `POST /event/infer/{assistantId}` (and channel\n * variants). Keys match the runtime wire format (lowercase, no underscores).\n * `taskid` is the id used for the SSE stream.\n */\n export interface CommonAttributes {\n taskid?: string | null;\n parenttaskid?: string | null;\n sessionid?: string | null;\n userid?: string | null;\n assistantid?: string | null;\n agentspaceid?: string | null;\n channelid?: string | null;\n depth?: string;\n attachments?: string[];\n /** Registry version the runtime resolved for this task (runtime v0.5.1). */\n versiontag?: string | null;\n }\n\n export type InferInitResponse = CommonAttributes;\n\n /** A text block in a multimodal `query` (runtime `TextContentPart`). */\n export interface TextContentPart {\n type: 'text';\n text: string;\n }\n\n /** An image block in a multimodal `query` (runtime `ImageContentPart`). */\n export interface ImageContentPart {\n type: 'image_url';\n image_url: {\n url: string;\n detail?: 'auto' | 'low' | 'high';\n };\n }\n\n /**\n * Catch-all for content blocks the runtime does not model explicitly. It\n * round-trips unknown provider blocks rather than failing validation.\n */\n export interface NonStandardContentPart {\n type: 'non_standard';\n value?: Record<string, unknown>;\n }\n\n export type ContentPart = TextContentPart | ImageContentPart | NonStandardContentPart;\n\n /**\n * An inference `query`: either plain text, or an OpenAI-style list of content\n * parts for multimodal input.\n */\n export type Content = string | ContentPart[];\n\n /**\n * A blob held in the session context. Returned by `POST /context/blob/upload`\n * and accepted as `input_audio` on infer (runtime v0.5.1).\n */\n export interface RuntimeBlob {\n blob_id: string;\n filename: string;\n content_size: number;\n content_type?: string | null;\n checksum?: string | null;\n created_at?: number | null;\n expires_at?: number | null;\n /** Base64-encoded content. Populated by channel ingest, not by blob upload. */\n data_base64?: string | null;\n }\n\n /**\n * Native-tools evaluation strategy. Wraps the client-side tool schemas\n * the SDK previously sent at the top level of the infer payload.\n */\n export interface NativeToolsEvaluationStrategy {\n evaluation_strategy_id: 'native';\n tool_schemas?: unknown[];\n max_steps?: number;\n current_step?: number;\n max_concurrent_tools?: number;\n decorators?: unknown[];\n tool_choice?: unknown;\n structured_output?: unknown;\n }\n\n export interface RawToolsEvaluationStrategy {\n evaluation_strategy_id: 'raw';\n tool_schemas?: unknown[];\n }\n\n export interface OneShootEvaluationStrategy {\n evaluation_strategy_id: 'one-shoot';\n }\n\n export type EvaluationStrategy =\n | NativeToolsEvaluationStrategy\n | RawToolsEvaluationStrategy\n | OneShootEvaluationStrategy;\n\n export interface AssistantResponseData {\n content: string;\n additional_kwargs: Record<string, any>;\n response_metadata: ResponseMetadata;\n type: string;\n id: string;\n example: boolean;\n tool_calls: any[];\n invalid_tool_calls: any[];\n usage_metadata: UsageMetadata;\n }\n\n export interface ResponseMetadata {\n token_usage: TokenUsage;\n model_name: string;\n system_fingerprint: string;\n finish_reason: string;\n logprobs: any | null;\n }\n\n export interface TokenUsage {\n completion_tokens: number;\n prompt_tokens: number;\n total_tokens: number;\n completion_time: number;\n prompt_time: number;\n queue_time: number;\n total_time: number;\n }\n\n export interface UsageMetadata {\n input_tokens: number;\n output_tokens: number;\n total_tokens: number;\n }\n\n export interface ExpertInferenceResponse {\n event_class: string;\n control_id: string;\n data: {\n label: string;\n score: number;\n };\n status: string;\n date_submitted: string;\n }\n\n export interface ThinkingsInferenceResponse {\n event_class: string;\n control_id: string;\n status: string;\n date_submitted: string;\n data: {\n content: AssistantResponseData;\n is_complete: boolean;\n is_partial: boolean;\n };\n }\n\n export interface GenuiSurfaceItem {\n controlId: string;\n surface: A2uiSurface;\n /** Message-count anchor: the surface renders after this many messages (chronological ordering). */\n afterCount: number;\n /** True once the user has submitted an interactive surface (disables it + shows a submitted state). */\n submitted?: boolean;\n /** Set when the user declined the surface and typed a reply */\n dismissedWith?: string;\n }"],"mappings":";AAeO,IAAe,cAAf,MAA2B;AAAA,EAGhC,YAAY,UAAqB;AAFjC,SAAU,WAA6B;AAGrC,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,OAAO,WAAW,UAAgC;AAChD,WAAO;AAAA,EACT;AAGF;","names":[]}
@@ -65,7 +65,7 @@ interface WorklogVerificationResult {
65
65
  message: string;
66
66
  }
67
67
  /** Semantic bucket a node belongs to. */
68
- type NodeKind = "safeguard" | "reasoning" | "tool" | "a2a" | "memory" | "answer" | "unknown";
68
+ type NodeKind = "safeguard" | "reasoning" | "tool" | "a2a" | "memory" | "knowledge" | "speech" | "answer" | "unknown";
69
69
  /** Lifecycle state of a single node. */
70
70
  type NodeStatus = "pending" | "running" | "completed" | "failed" | "skipped";
71
71
  /** Overall run status. */
@@ -65,7 +65,7 @@ interface WorklogVerificationResult {
65
65
  message: string;
66
66
  }
67
67
  /** Semantic bucket a node belongs to. */
68
- type NodeKind = "safeguard" | "reasoning" | "tool" | "a2a" | "memory" | "answer" | "unknown";
68
+ type NodeKind = "safeguard" | "reasoning" | "tool" | "a2a" | "memory" | "knowledge" | "speech" | "answer" | "unknown";
69
69
  /** Lifecycle state of a single node. */
70
70
  type NodeStatus = "pending" | "running" | "completed" | "failed" | "skipped";
71
71
  /** Overall run status. */
@@ -1,4 +1,4 @@
1
- import { B as BaseAPIConfig, s as ThinkingsInferenceResponse, y as Tooler, u as ToolEvent, j as ConversationsMap } from '../type-DqX3-9QS.mjs';
1
+ import { B as BaseAPIConfig, y as ThinkingsInferenceResponse, L as Tooler, F as ToolEvent, l as ConversationsMap } from '../type-61gaZga-.mjs';
2
2
  import { C as CatalogManifest } from '../registry-Bcu_ZYL1.mjs';
3
3
  import '@elastic/apm-rum';
4
4
  import 'ai';
@@ -1,4 +1,4 @@
1
- import { B as BaseAPIConfig, s as ThinkingsInferenceResponse, y as Tooler, u as ToolEvent, j as ConversationsMap } from '../type-xksRnBUW.js';
1
+ import { B as BaseAPIConfig, y as ThinkingsInferenceResponse, L as Tooler, F as ToolEvent, l as ConversationsMap } from '../type-D-JaSMkV.js';
2
2
  import { C as CatalogManifest } from '../registry-Bcu_ZYL1.js';
3
3
  import '@elastic/apm-rum';
4
4
  import 'ai';
@@ -1,5 +1,5 @@
1
- import { E as EventInterpreter, W as WorklogRecord, a as WorklogState } from '../types-C-6fgK1_.mjs';
2
- export { b as EventRole, N as NodeKind, c as NodeStatus, R as RunStatus, d as WorklogDetail, e as WorklogEventDetail, f as WorklogEventPage, g as WorklogNode, h as WorklogPage, i as WorklogSummary, j as WorklogVerificationResult, k as initialWorklogState } from '../types-C-6fgK1_.mjs';
1
+ import { E as EventInterpreter, W as WorklogRecord, a as WorklogState } from '../types-lOliroPw.mjs';
2
+ export { b as EventRole, N as NodeKind, c as NodeStatus, R as RunStatus, d as WorklogDetail, e as WorklogEventDetail, f as WorklogEventPage, g as WorklogNode, h as WorklogPage, i as WorklogSummary, j as WorklogVerificationResult, k as initialWorklogState } from '../types-lOliroPw.mjs';
3
3
 
4
4
  declare const EVENT_REGISTRY: Record<string, EventInterpreter>;
5
5
  declare function resolveInterpreter(eventClass: string): EventInterpreter;
@@ -1,5 +1,5 @@
1
- import { E as EventInterpreter, W as WorklogRecord, a as WorklogState } from '../types-C-6fgK1_.js';
2
- export { b as EventRole, N as NodeKind, c as NodeStatus, R as RunStatus, d as WorklogDetail, e as WorklogEventDetail, f as WorklogEventPage, g as WorklogNode, h as WorklogPage, i as WorklogSummary, j as WorklogVerificationResult, k as initialWorklogState } from '../types-C-6fgK1_.js';
1
+ import { E as EventInterpreter, W as WorklogRecord, a as WorklogState } from '../types-lOliroPw.js';
2
+ export { b as EventRole, N as NodeKind, c as NodeStatus, R as RunStatus, d as WorklogDetail, e as WorklogEventDetail, f as WorklogEventPage, g as WorklogNode, h as WorklogPage, i as WorklogSummary, j as WorklogVerificationResult, k as initialWorklogState } from '../types-lOliroPw.js';
3
3
 
4
4
  declare const EVENT_REGISTRY: Record<string, EventInterpreter>;
5
5
  declare function resolveInterpreter(eventClass: string): EventInterpreter;
@@ -46,6 +46,14 @@ var agentTitle = (r) => {
46
46
  return typeof name === "string" && name.length > 0 ? `Agent: ${name}` : "Agent-to-agent";
47
47
  };
48
48
  var constTitle = (label) => () => label;
49
+ var shieldBlockTitle = (r) => {
50
+ const id = asRecord(r.data).shield_id;
51
+ return typeof id === "string" && id.length > 0 ? `Blocked by ${id}` : "Blocked by safeguard";
52
+ };
53
+ var knowledgeTitle = (r) => {
54
+ const query = asRecord(r.data).query;
55
+ return typeof query === "string" && query.length > 0 ? `Knowledge: ${query}` : "Knowledge retrieval";
56
+ };
49
57
  var EVENT_REGISTRY = {
50
58
  // Run envelope
51
59
  AssistantInference: { kind: "answer", role: "run-open", title: constTitle("Inference started") },
@@ -53,6 +61,9 @@ var EVENT_REGISTRY = {
53
61
  // Safeguard
54
62
  ShieldInference: { kind: "safeguard", role: "open", title: constTitle("Safeguard") },
55
63
  ShieldInferenceResponse: { kind: "safeguard", role: "close", title: constTitle("Safeguard") },
64
+ // Emitted when a shield enforcement decision blocks the request (core 0.5.x).
65
+ // Response-only: the reducer opens it already closed when no command matched.
66
+ ShieldBlockedResponse: { kind: "safeguard", role: "close", title: shieldBlockTitle },
56
67
  // Reasoning
57
68
  ResponseInference: { kind: "reasoning", role: "open", title: constTitle("Reasoning") },
58
69
  ResponseInferenceResponse: { kind: "reasoning", role: "close", title: constTitle("Reasoning") },
@@ -70,6 +81,14 @@ var EVENT_REGISTRY = {
70
81
  A2AInference: { kind: "a2a", role: "open", title: agentTitle },
71
82
  AgentDiscovery: { kind: "a2a", role: "open", title: constTitle("Agent discovery") },
72
83
  AgentDiscoveryResponse: { kind: "a2a", role: "close", title: constTitle("Agent discovery") },
84
+ // Knowledge retrieval (RAG) — core 0.5.x
85
+ KnowledgeRetrieval: { kind: "knowledge", role: "open", title: knowledgeTitle },
86
+ KnowledgeRetrievalResponse: { kind: "knowledge", role: "close", title: knowledgeTitle },
87
+ // Speech pipeline — core 0.5.x
88
+ SpeechTranscription: { kind: "speech", role: "open", title: constTitle("Speech-to-text") },
89
+ SpeechTranscriptionResponse: { kind: "speech", role: "close", title: constTitle("Speech-to-text") },
90
+ SpeechSynthesis: { kind: "speech", role: "open", title: constTitle("Text-to-speech") },
91
+ SpeechSynthesisResponse: { kind: "speech", role: "close", title: constTitle("Text-to-speech") },
73
92
  // Memory / persistence
74
93
  ContextPersistence: { kind: "memory", role: "open", title: constTitle("Memory persistence") },
75
94
  ContextFlush: { kind: "memory", role: "open", title: constTitle("Memory flush") },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/worklog/index.ts","../../src/worklog/types.ts","../../src/worklog/registry.ts","../../src/worklog/reducer.ts","../../src/worklog/use-worklog.ts","../../src/worklog/from-frame.ts"],"sourcesContent":["export * from \"./types\";\nexport { EVENT_REGISTRY, resolveInterpreter } from \"./registry\";\nexport { reduceWorklog, foldWorklog } from \"./reducer\";\nexport { useWorklog } from \"./use-worklog\";\nexport { frameToRecord, type RawFrame } from \"./from-frame\";\n","/** One granular Runtime worklog record (a `bus_mode` SSE frame or a `/worklog/{task_id}/events` item). */\nexport interface WorklogRecord {\n /** Runtime v0.5.0+ tamper-evident hash chain fields (optional on SSE frames). */\n entry_hash?: string | null;\n previous_hash?: string | null;\n event_class: string;\n control_id: string | null;\n data: unknown;\n status: \"success\" | \"error\" | null;\n date_submitted: string;\n}\n\n/** Runtime v0.5.0 worklog audit summary returned by `GET /worklog/`. */\nexport interface WorklogSummary {\n task_id: string;\n parent_task_id?: string | null;\n session_id?: string | null;\n user_id?: string | null;\n assistant_id?: string | null;\n agentspace_id?: string | null;\n channel_id?: string | null;\n depth?: number;\n final_status?: string | null;\n started_at: string;\n finished_at?: string | null;\n}\n\n/** Runtime v0.5.0 full worklog detail returned by `GET /worklog/{task_id}`. */\nexport interface WorklogDetail extends WorklogSummary {\n final_result?: string | null;\n error_message?: string | null;\n}\n\n/** Runtime v0.5.0 single worklog event returned by `GET /worklog/{task_id}/events`. */\nexport interface WorklogEventDetail {\n id: number;\n task_id: string;\n previous_hash?: string | null;\n entry_hash?: string | null;\n event_class: string;\n control_id?: string | null;\n status?: string | null;\n data?: unknown;\n submitted_at: string;\n}\n\n/** Runtime v0.5.0 paginated list of worklog summaries. */\nexport interface WorklogPage {\n items: WorklogSummary[];\n total: number;\n limit: number;\n offset: number;\n}\n\n/** Runtime v0.5.0 paginated list of worklog events for a single task. */\nexport interface WorklogEventPage {\n task_id: string;\n items: WorklogEventDetail[];\n total: number;\n}\n\n/** Runtime v0.5.0 hash-chain verification result returned by `GET /worklog/{task_id}/verify`. */\nexport interface WorklogVerificationResult {\n valid: boolean;\n task_id: string;\n event_count: number;\n first_broken_event_id?: number | null;\n first_broken_index?: number | null;\n expected_hash?: string | null;\n actual_hash?: string | null;\n message: string;\n}\n\n/** Semantic bucket a node belongs to. */\nexport type NodeKind =\n | \"safeguard\"\n | \"reasoning\"\n | \"tool\"\n | \"a2a\"\n | \"memory\"\n | \"answer\"\n | \"unknown\";\n\n/** Lifecycle state of a single node. */\nexport type NodeStatus = \"pending\" | \"running\" | \"completed\" | \"failed\" | \"skipped\";\n\n/** Overall run status. */\nexport type RunStatus = \"idle\" | \"running\" | \"success\" | \"error\";\n\n/** A single step in the execution chain (command + its response merged by control_id). */\nexport interface WorklogNode {\n id: string;\n kind: NodeKind;\n eventClass: string;\n status: NodeStatus;\n title: string;\n startedAt?: string;\n endedAt?: string;\n depth: number;\n parentId?: string;\n children: WorklogNode[];\n command?: unknown;\n response?: unknown;\n error?: string;\n raw: WorklogRecord[];\n}\n\n/** Normalized execution model produced by the reducer. */\nexport interface WorklogState {\n taskId: string | null;\n status: RunStatus;\n answer: string | null;\n nodes: WorklogNode[];\n index: Record<string, number>;\n raw: WorklogRecord[];\n}\n\n/** How a record acts on the model. */\nexport type EventRole = \"open\" | \"close\" | \"run-open\" | \"run-close\" | \"ignore\";\n\n/** Registry descriptor for one event_class. */\nexport interface EventInterpreter {\n kind: NodeKind;\n role: EventRole;\n title: (_record: WorklogRecord) => string;\n /** If true, an opened node starts in \"pending\" (awaiting external input) rather than \"running\". */\n pending?: boolean;\n}\n\nexport function initialWorklogState(taskId: string | null = null): WorklogState {\n return { taskId, status: \"idle\", answer: null, nodes: [], index: {}, raw: [] };\n}\n","import type { EventInterpreter, WorklogRecord } from \"./types\";\n\nconst asRecord = (data: unknown): Record<string, unknown> =>\n data && typeof data === \"object\" ? (data as Record<string, unknown>) : {};\n\nconst toolTitle = (r: WorklogRecord): string => {\n const name = asRecord(r.data).name;\n return typeof name === \"string\" && name.length > 0 ? `Tool: ${name}` : \"Tool\";\n};\n\nconst agentTitle = (r: WorklogRecord): string => {\n const name = asRecord(r.data).name;\n return typeof name === \"string\" && name.length > 0 ? `Agent: ${name}` : \"Agent-to-agent\";\n};\n\nconst constTitle = (label: string) => () => label;\n\nexport const EVENT_REGISTRY: Record<string, EventInterpreter> = {\n // Run envelope\n AssistantInference: { kind: \"answer\", role: \"run-open\", title: constTitle(\"Inference started\") },\n AssistantInferenceResponse: { kind: \"answer\", role: \"run-close\", title: constTitle(\"Answer\") },\n\n // Safeguard\n ShieldInference: { kind: \"safeguard\", role: \"open\", title: constTitle(\"Safeguard\") },\n ShieldInferenceResponse: { kind: \"safeguard\", role: \"close\", title: constTitle(\"Safeguard\") },\n\n // Reasoning\n ResponseInference: { kind: \"reasoning\", role: \"open\", title: constTitle(\"Reasoning\") },\n ResponseInferenceResponse: { kind: \"reasoning\", role: \"close\", title: constTitle(\"Reasoning\") },\n\n // Tools (server + subclasses) and their responses\n ServerToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n BuiltinToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n UnknownToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n ClientToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle, pending: true },\n ToolExecutionResponse: { kind: \"tool\", role: \"close\", title: toolTitle },\n BuiltinToolExecutionResponse: { kind: \"tool\", role: \"close\", title: toolTitle },\n\n // Tool schema discovery\n ToolSchema: { kind: \"tool\", role: \"open\", title: constTitle(\"Tool schema\") },\n ToolSchemaResponse: { kind: \"tool\", role: \"close\", title: constTitle(\"Tool schema\") },\n\n // Agent-to-agent\n A2AInference: { kind: \"a2a\", role: \"open\", title: agentTitle },\n AgentDiscovery: { kind: \"a2a\", role: \"open\", title: constTitle(\"Agent discovery\") },\n AgentDiscoveryResponse: { kind: \"a2a\", role: \"close\", title: constTitle(\"Agent discovery\") },\n\n // Memory / persistence\n ContextPersistence: { kind: \"memory\", role: \"open\", title: constTitle(\"Memory persistence\") },\n ContextFlush: { kind: \"memory\", role: \"open\", title: constTitle(\"Memory flush\") },\n ContextFlushResponse: { kind: \"memory\", role: \"close\", title: constTitle(\"Memory flush\") },\n\n // Human approval\n HumanApprovalRequired: {\n kind: \"tool\",\n role: \"open\",\n title: constTitle(\"Human approval required\"),\n pending: true,\n },\n HumanApprovalRequiredResponse: { kind: \"tool\", role: \"close\", title: constTitle(\"Human approval\") },\n};\n\nexport function resolveInterpreter(eventClass: string): EventInterpreter {\n if (Object.prototype.hasOwnProperty.call(EVENT_REGISTRY, eventClass)) {\n return EVENT_REGISTRY[eventClass];\n }\n return {\n kind: \"unknown\",\n role: \"open\",\n title: (r: WorklogRecord) => r.event_class,\n };\n}\n","import { resolveInterpreter } from \"./registry\";\nimport type { EventInterpreter, WorklogNode, WorklogRecord, WorklogState } from \"./types\";\nimport { initialWorklogState } from \"./types\";\n\nconst asString = (v: unknown): string =>\n typeof v === \"string\" ? v : v == null ? \"\" : JSON.stringify(v);\n\nconst nodeDepth = (record: WorklogRecord): number => {\n const d = record.data && typeof record.data === \"object\"\n ? (record.data as Record<string, unknown>).depth\n : undefined;\n return typeof d === \"number\" ? d : 0;\n};\n\nconst makeOpenNode = (record: WorklogRecord, interp: EventInterpreter, id: string): WorklogNode => ({\n id,\n kind: interp.kind,\n eventClass: record.event_class,\n status: interp.pending ? \"pending\" : \"running\",\n title: interp.title(record),\n startedAt: record.date_submitted,\n depth: nodeDepth(record),\n children: [],\n command: record.data,\n raw: [record],\n});\n\nconst makeClosedNode = (record: WorklogRecord, interp: EventInterpreter, id: string): WorklogNode => ({\n id,\n kind: interp.kind,\n eventClass: record.event_class,\n status: record.status === \"error\" ? \"failed\" : \"completed\",\n title: interp.title(record),\n startedAt: record.date_submitted,\n endedAt: record.date_submitted,\n depth: nodeDepth(record),\n children: [],\n response: record.data,\n error: record.status === \"error\" ? asString(record.data) : undefined,\n raw: [record],\n});\n\nexport function reduceWorklog(state: WorklogState, record: WorklogRecord): WorklogState {\n const interp = resolveInterpreter(record.event_class);\n const next: WorklogState = {\n ...state,\n nodes: state.nodes.slice(),\n index: { ...state.index },\n raw: [...state.raw, record],\n };\n\n if (interp.role === \"ignore\") return next;\n\n if (interp.role === \"run-open\") {\n next.status = \"running\";\n return next;\n }\n\n if (interp.role === \"run-close\") {\n next.answer = asString(record.data) || null;\n next.status = record.status === \"error\" ? \"error\" : \"success\";\n return next;\n }\n\n const key = record.control_id ?? `${record.event_class}-${next.raw.length}`;\n\n if (interp.role === \"close\") {\n const pos = Object.prototype.hasOwnProperty.call(next.index, key) ? next.index[key] : undefined;\n if (pos != null) {\n const existing = next.nodes[pos];\n next.nodes[pos] = {\n ...existing,\n status: record.status === \"error\" ? \"failed\" : \"completed\",\n endedAt: record.date_submitted,\n response: record.data,\n error: record.status === \"error\" ? asString(record.data) : existing.error,\n raw: [...existing.raw, record],\n };\n } else {\n // response arrived without a seen command — create it already closed\n next.index[key] = next.nodes.length;\n next.nodes.push(makeClosedNode(record, interp, key));\n }\n if (record.status === \"error\") next.status = \"error\";\n return next;\n }\n\n // role === \"open\"\n const pos = Object.prototype.hasOwnProperty.call(next.index, key) ? next.index[key] : undefined;\n if (pos != null) {\n const existing = next.nodes[pos];\n next.nodes[pos] = { ...existing, raw: [...existing.raw, record] };\n } else {\n next.index[key] = next.nodes.length;\n next.nodes.push(makeOpenNode(record, interp, key));\n }\n return next;\n}\n\nexport function foldWorklog(records: WorklogRecord[], taskId: string | null = null): WorklogState {\n return records.reduce(reduceWorklog, initialWorklogState(taskId));\n}\n","import { useCallback, useReducer } from \"react\";\nimport { reduceWorklog } from \"./reducer\";\nimport { initialWorklogState, type WorklogRecord, type WorklogState } from \"./types\";\n\ntype Action =\n | { type: \"ingest\"; record: WorklogRecord }\n | { type: \"ingestMany\"; records: WorklogRecord[] }\n | { type: \"reset\"; taskId: string | null };\n\nfunction hookReducer(state: WorklogState, action: Action): WorklogState {\n switch (action.type) {\n case \"ingest\":\n return reduceWorklog(state, action.record);\n case \"ingestMany\":\n return action.records.reduce(reduceWorklog, state);\n case \"reset\":\n return initialWorklogState(action.taskId);\n }\n}\n\n/** Live worklog accumulator. Feed it `bus_mode` records via `ingest`; use `foldWorklog` for history. */\nexport function useWorklog(taskId: string | null = null) {\n const [worklog, dispatch] = useReducer(hookReducer, taskId, initialWorklogState);\n\n const ingest = useCallback((record: WorklogRecord) => dispatch({ type: \"ingest\", record }), []);\n const ingestMany = useCallback(\n (records: WorklogRecord[]) => dispatch({ type: \"ingestMany\", records }),\n [],\n );\n const reset = useCallback(\n (id: string | null = null) => dispatch({ type: \"reset\", taskId: id }),\n [],\n );\n\n return { worklog, ingest, ingestMany, reset };\n}\n","import type { WorklogRecord } from \"./types\";\n\n/** Loosely-typed shape of a parsed SSE `data:` frame from the granular Runtime stream. */\nexport interface RawFrame {\n event_class?: string;\n control_id?: string | null;\n data?: unknown;\n status?: string | null;\n date_submitted?: string;\n /** Runtime v0.5.0+ tamper-evident hash chain fields. */\n entry_hash?: string | null;\n previous_hash?: string | null;\n}\n\n/** Normalize a parsed SSE frame into a WorklogRecord (defaults missing fields; never throws). */\nexport function frameToRecord(frame: RawFrame): WorklogRecord {\n const status = frame.status === \"success\" || frame.status === \"error\" ? frame.status : null;\n return {\n event_class: typeof frame.event_class === \"string\" && frame.event_class.length > 0\n ? frame.event_class\n : \"Unknown\",\n control_id: frame.control_id ?? null,\n data: frame.data,\n status,\n date_submitted: typeof frame.date_submitted === \"string\" ? frame.date_submitted : \"\",\n entry_hash: frame.entry_hash ?? null,\n previous_hash: frame.previous_hash ?? null,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiIO,SAAS,oBAAoB,SAAwB,MAAoB;AAC9E,SAAO,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,MAAM,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,KAAK,CAAC,EAAE;AAC/E;;;ACjIA,IAAM,WAAW,CAAC,SAChB,QAAQ,OAAO,SAAS,WAAY,OAAmC,CAAC;AAE1E,IAAM,YAAY,CAAC,MAA6B;AAC9C,QAAM,OAAO,SAAS,EAAE,IAAI,EAAE;AAC9B,SAAO,OAAO,SAAS,YAAY,KAAK,SAAS,IAAI,SAAS,IAAI,KAAK;AACzE;AAEA,IAAM,aAAa,CAAC,MAA6B;AAC/C,QAAM,OAAO,SAAS,EAAE,IAAI,EAAE;AAC9B,SAAO,OAAO,SAAS,YAAY,KAAK,SAAS,IAAI,UAAU,IAAI,KAAK;AAC1E;AAEA,IAAM,aAAa,CAAC,UAAkB,MAAM;AAErC,IAAM,iBAAmD;AAAA;AAAA,EAE9D,oBAAoB,EAAE,MAAM,UAAU,MAAM,YAAY,OAAO,WAAW,mBAAmB,EAAE;AAAA,EAC/F,4BAA4B,EAAE,MAAM,UAAU,MAAM,aAAa,OAAO,WAAW,QAAQ,EAAE;AAAA;AAAA,EAG7F,iBAAiB,EAAE,MAAM,aAAa,MAAM,QAAQ,OAAO,WAAW,WAAW,EAAE;AAAA,EACnF,yBAAyB,EAAE,MAAM,aAAa,MAAM,SAAS,OAAO,WAAW,WAAW,EAAE;AAAA;AAAA,EAG5F,mBAA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AAEA,SAAO,EAAE,SAAS,QAAQ,YAAY,MAAM;AAC9C;;;ACpBO,SAAS,cAAc,OAAgC;AAC5D,QAAM,SAAS,MAAM,WAAW,aAAa,MAAM,WAAW,UAAU,MAAM,SAAS;AACvF,SAAO;AAAA,IACL,aAAa,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,SAAS,IAC7E,MAAM,cACN;AAAA,IACJ,YAAY,MAAM,cAAc;AAAA,IAChC,MAAM,MAAM;AAAA,IACZ;AAAA,IACA,gBAAgB,OAAO,MAAM,mBAAmB,WAAW,MAAM,iBAAiB;AAAA,IAClF,YAAY,MAAM,cAAc;AAAA,IAChC,eAAe,MAAM,iBAAiB;AAAA,EACxC;AACF;","names":["pos"]}
1
+ {"version":3,"sources":["../../src/worklog/index.ts","../../src/worklog/types.ts","../../src/worklog/registry.ts","../../src/worklog/reducer.ts","../../src/worklog/use-worklog.ts","../../src/worklog/from-frame.ts"],"sourcesContent":["export * from \"./types\";\nexport { EVENT_REGISTRY, resolveInterpreter } from \"./registry\";\nexport { reduceWorklog, foldWorklog } from \"./reducer\";\nexport { useWorklog } from \"./use-worklog\";\nexport { frameToRecord, type RawFrame } from \"./from-frame\";\n","/** One granular Runtime worklog record (a `bus_mode` SSE frame or a `/worklog/{task_id}/events` item). */\nexport interface WorklogRecord {\n /** Runtime v0.5.0+ tamper-evident hash chain fields (optional on SSE frames). */\n entry_hash?: string | null;\n previous_hash?: string | null;\n event_class: string;\n control_id: string | null;\n data: unknown;\n status: \"success\" | \"error\" | null;\n date_submitted: string;\n}\n\n/** Runtime v0.5.0 worklog audit summary returned by `GET /worklog/`. */\nexport interface WorklogSummary {\n task_id: string;\n parent_task_id?: string | null;\n session_id?: string | null;\n user_id?: string | null;\n assistant_id?: string | null;\n agentspace_id?: string | null;\n channel_id?: string | null;\n depth?: number;\n final_status?: string | null;\n started_at: string;\n finished_at?: string | null;\n}\n\n/** Runtime v0.5.0 full worklog detail returned by `GET /worklog/{task_id}`. */\nexport interface WorklogDetail extends WorklogSummary {\n final_result?: string | null;\n error_message?: string | null;\n}\n\n/** Runtime v0.5.0 single worklog event returned by `GET /worklog/{task_id}/events`. */\nexport interface WorklogEventDetail {\n id: number;\n task_id: string;\n previous_hash?: string | null;\n entry_hash?: string | null;\n event_class: string;\n control_id?: string | null;\n status?: string | null;\n data?: unknown;\n submitted_at: string;\n}\n\n/** Runtime v0.5.0 paginated list of worklog summaries. */\nexport interface WorklogPage {\n items: WorklogSummary[];\n total: number;\n limit: number;\n offset: number;\n}\n\n/** Runtime v0.5.0 paginated list of worklog events for a single task. */\nexport interface WorklogEventPage {\n task_id: string;\n items: WorklogEventDetail[];\n total: number;\n}\n\n/** Runtime v0.5.0 hash-chain verification result returned by `GET /worklog/{task_id}/verify`. */\nexport interface WorklogVerificationResult {\n valid: boolean;\n task_id: string;\n event_count: number;\n first_broken_event_id?: number | null;\n first_broken_index?: number | null;\n expected_hash?: string | null;\n actual_hash?: string | null;\n message: string;\n}\n\n/** Semantic bucket a node belongs to. */\nexport type NodeKind =\n | \"safeguard\"\n | \"reasoning\"\n | \"tool\"\n | \"a2a\"\n | \"memory\"\n | \"knowledge\"\n | \"speech\"\n | \"answer\"\n | \"unknown\";\n\n/** Lifecycle state of a single node. */\nexport type NodeStatus = \"pending\" | \"running\" | \"completed\" | \"failed\" | \"skipped\";\n\n/** Overall run status. */\nexport type RunStatus = \"idle\" | \"running\" | \"success\" | \"error\";\n\n/** A single step in the execution chain (command + its response merged by control_id). */\nexport interface WorklogNode {\n id: string;\n kind: NodeKind;\n eventClass: string;\n status: NodeStatus;\n title: string;\n startedAt?: string;\n endedAt?: string;\n depth: number;\n parentId?: string;\n children: WorklogNode[];\n command?: unknown;\n response?: unknown;\n error?: string;\n raw: WorklogRecord[];\n}\n\n/** Normalized execution model produced by the reducer. */\nexport interface WorklogState {\n taskId: string | null;\n status: RunStatus;\n answer: string | null;\n nodes: WorklogNode[];\n index: Record<string, number>;\n raw: WorklogRecord[];\n}\n\n/** How a record acts on the model. */\nexport type EventRole = \"open\" | \"close\" | \"run-open\" | \"run-close\" | \"ignore\";\n\n/** Registry descriptor for one event_class. */\nexport interface EventInterpreter {\n kind: NodeKind;\n role: EventRole;\n title: (_record: WorklogRecord) => string;\n /** If true, an opened node starts in \"pending\" (awaiting external input) rather than \"running\". */\n pending?: boolean;\n}\n\nexport function initialWorklogState(taskId: string | null = null): WorklogState {\n return { taskId, status: \"idle\", answer: null, nodes: [], index: {}, raw: [] };\n}\n","import type { EventInterpreter, WorklogRecord } from \"./types\";\n\nconst asRecord = (data: unknown): Record<string, unknown> =>\n data && typeof data === \"object\" ? (data as Record<string, unknown>) : {};\n\nconst toolTitle = (r: WorklogRecord): string => {\n const name = asRecord(r.data).name;\n return typeof name === \"string\" && name.length > 0 ? `Tool: ${name}` : \"Tool\";\n};\n\nconst agentTitle = (r: WorklogRecord): string => {\n const name = asRecord(r.data).name;\n return typeof name === \"string\" && name.length > 0 ? `Agent: ${name}` : \"Agent-to-agent\";\n};\n\nconst constTitle = (label: string) => () => label;\n\nconst shieldBlockTitle = (r: WorklogRecord): string => {\n const id = asRecord(r.data).shield_id;\n return typeof id === \"string\" && id.length > 0 ? `Blocked by ${id}` : \"Blocked by safeguard\";\n};\n\nconst knowledgeTitle = (r: WorklogRecord): string => {\n const query = asRecord(r.data).query;\n return typeof query === \"string\" && query.length > 0\n ? `Knowledge: ${query}`\n : \"Knowledge retrieval\";\n};\n\nexport const EVENT_REGISTRY: Record<string, EventInterpreter> = {\n // Run envelope\n AssistantInference: { kind: \"answer\", role: \"run-open\", title: constTitle(\"Inference started\") },\n AssistantInferenceResponse: { kind: \"answer\", role: \"run-close\", title: constTitle(\"Answer\") },\n\n // Safeguard\n ShieldInference: { kind: \"safeguard\", role: \"open\", title: constTitle(\"Safeguard\") },\n ShieldInferenceResponse: { kind: \"safeguard\", role: \"close\", title: constTitle(\"Safeguard\") },\n // Emitted when a shield enforcement decision blocks the request (core 0.5.x).\n // Response-only: the reducer opens it already closed when no command matched.\n ShieldBlockedResponse: { kind: \"safeguard\", role: \"close\", title: shieldBlockTitle },\n\n // Reasoning\n ResponseInference: { kind: \"reasoning\", role: \"open\", title: constTitle(\"Reasoning\") },\n ResponseInferenceResponse: { kind: \"reasoning\", role: \"close\", title: constTitle(\"Reasoning\") },\n\n // Tools (server + subclasses) and their responses\n ServerToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n BuiltinToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n UnknownToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n ClientToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle, pending: true },\n ToolExecutionResponse: { kind: \"tool\", role: \"close\", title: toolTitle },\n BuiltinToolExecutionResponse: { kind: \"tool\", role: \"close\", title: toolTitle },\n\n // Tool schema discovery\n ToolSchema: { kind: \"tool\", role: \"open\", title: constTitle(\"Tool schema\") },\n ToolSchemaResponse: { kind: \"tool\", role: \"close\", title: constTitle(\"Tool schema\") },\n\n // Agent-to-agent\n A2AInference: { kind: \"a2a\", role: \"open\", title: agentTitle },\n AgentDiscovery: { kind: \"a2a\", role: \"open\", title: constTitle(\"Agent discovery\") },\n AgentDiscoveryResponse: { kind: \"a2a\", role: \"close\", title: constTitle(\"Agent discovery\") },\n\n // Knowledge retrieval (RAG) — core 0.5.x\n KnowledgeRetrieval: { kind: \"knowledge\", role: \"open\", title: knowledgeTitle },\n KnowledgeRetrievalResponse: { kind: \"knowledge\", role: \"close\", title: knowledgeTitle },\n\n // Speech pipeline — core 0.5.x\n SpeechTranscription: { kind: \"speech\", role: \"open\", title: constTitle(\"Speech-to-text\") },\n SpeechTranscriptionResponse: { kind: \"speech\", role: \"close\", title: constTitle(\"Speech-to-text\") },\n SpeechSynthesis: { kind: \"speech\", role: \"open\", title: constTitle(\"Text-to-speech\") },\n SpeechSynthesisResponse: { kind: \"speech\", role: \"close\", title: constTitle(\"Text-to-speech\") },\n\n // Memory / persistence\n ContextPersistence: { kind: \"memory\", role: \"open\", title: constTitle(\"Memory persistence\") },\n ContextFlush: { kind: \"memory\", role: \"open\", title: constTitle(\"Memory flush\") },\n ContextFlushResponse: { kind: \"memory\", role: \"close\", title: constTitle(\"Memory flush\") },\n\n // Human approval\n HumanApprovalRequired: {\n kind: \"tool\",\n role: \"open\",\n title: constTitle(\"Human approval required\"),\n pending: true,\n },\n HumanApprovalRequiredResponse: { kind: \"tool\", role: \"close\", title: constTitle(\"Human approval\") },\n};\n\nexport function resolveInterpreter(eventClass: string): EventInterpreter {\n if (Object.prototype.hasOwnProperty.call(EVENT_REGISTRY, eventClass)) {\n return EVENT_REGISTRY[eventClass];\n }\n return {\n kind: \"unknown\",\n role: \"open\",\n title: (r: WorklogRecord) => r.event_class,\n };\n}\n","import { resolveInterpreter } from \"./registry\";\nimport type { EventInterpreter, WorklogNode, WorklogRecord, WorklogState } from \"./types\";\nimport { initialWorklogState } from \"./types\";\n\nconst asString = (v: unknown): string =>\n typeof v === \"string\" ? v : v == null ? \"\" : JSON.stringify(v);\n\nconst nodeDepth = (record: WorklogRecord): number => {\n const d = record.data && typeof record.data === \"object\"\n ? (record.data as Record<string, unknown>).depth\n : undefined;\n return typeof d === \"number\" ? d : 0;\n};\n\nconst makeOpenNode = (record: WorklogRecord, interp: EventInterpreter, id: string): WorklogNode => ({\n id,\n kind: interp.kind,\n eventClass: record.event_class,\n status: interp.pending ? \"pending\" : \"running\",\n title: interp.title(record),\n startedAt: record.date_submitted,\n depth: nodeDepth(record),\n children: [],\n command: record.data,\n raw: [record],\n});\n\nconst makeClosedNode = (record: WorklogRecord, interp: EventInterpreter, id: string): WorklogNode => ({\n id,\n kind: interp.kind,\n eventClass: record.event_class,\n status: record.status === \"error\" ? \"failed\" : \"completed\",\n title: interp.title(record),\n startedAt: record.date_submitted,\n endedAt: record.date_submitted,\n depth: nodeDepth(record),\n children: [],\n response: record.data,\n error: record.status === \"error\" ? asString(record.data) : undefined,\n raw: [record],\n});\n\nexport function reduceWorklog(state: WorklogState, record: WorklogRecord): WorklogState {\n const interp = resolveInterpreter(record.event_class);\n const next: WorklogState = {\n ...state,\n nodes: state.nodes.slice(),\n index: { ...state.index },\n raw: [...state.raw, record],\n };\n\n if (interp.role === \"ignore\") return next;\n\n if (interp.role === \"run-open\") {\n next.status = \"running\";\n return next;\n }\n\n if (interp.role === \"run-close\") {\n next.answer = asString(record.data) || null;\n next.status = record.status === \"error\" ? \"error\" : \"success\";\n return next;\n }\n\n const key = record.control_id ?? `${record.event_class}-${next.raw.length}`;\n\n if (interp.role === \"close\") {\n const pos = Object.prototype.hasOwnProperty.call(next.index, key) ? next.index[key] : undefined;\n if (pos != null) {\n const existing = next.nodes[pos];\n next.nodes[pos] = {\n ...existing,\n status: record.status === \"error\" ? \"failed\" : \"completed\",\n endedAt: record.date_submitted,\n response: record.data,\n error: record.status === \"error\" ? asString(record.data) : existing.error,\n raw: [...existing.raw, record],\n };\n } else {\n // response arrived without a seen command — create it already closed\n next.index[key] = next.nodes.length;\n next.nodes.push(makeClosedNode(record, interp, key));\n }\n if (record.status === \"error\") next.status = \"error\";\n return next;\n }\n\n // role === \"open\"\n const pos = Object.prototype.hasOwnProperty.call(next.index, key) ? next.index[key] : undefined;\n if (pos != null) {\n const existing = next.nodes[pos];\n next.nodes[pos] = { ...existing, raw: [...existing.raw, record] };\n } else {\n next.index[key] = next.nodes.length;\n next.nodes.push(makeOpenNode(record, interp, key));\n }\n return next;\n}\n\nexport function foldWorklog(records: WorklogRecord[], taskId: string | null = null): WorklogState {\n return records.reduce(reduceWorklog, initialWorklogState(taskId));\n}\n","import { useCallback, useReducer } from \"react\";\nimport { reduceWorklog } from \"./reducer\";\nimport { initialWorklogState, type WorklogRecord, type WorklogState } from \"./types\";\n\ntype Action =\n | { type: \"ingest\"; record: WorklogRecord }\n | { type: \"ingestMany\"; records: WorklogRecord[] }\n | { type: \"reset\"; taskId: string | null };\n\nfunction hookReducer(state: WorklogState, action: Action): WorklogState {\n switch (action.type) {\n case \"ingest\":\n return reduceWorklog(state, action.record);\n case \"ingestMany\":\n return action.records.reduce(reduceWorklog, state);\n case \"reset\":\n return initialWorklogState(action.taskId);\n }\n}\n\n/** Live worklog accumulator. Feed it `bus_mode` records via `ingest`; use `foldWorklog` for history. */\nexport function useWorklog(taskId: string | null = null) {\n const [worklog, dispatch] = useReducer(hookReducer, taskId, initialWorklogState);\n\n const ingest = useCallback((record: WorklogRecord) => dispatch({ type: \"ingest\", record }), []);\n const ingestMany = useCallback(\n (records: WorklogRecord[]) => dispatch({ type: \"ingestMany\", records }),\n [],\n );\n const reset = useCallback(\n (id: string | null = null) => dispatch({ type: \"reset\", taskId: id }),\n [],\n );\n\n return { worklog, ingest, ingestMany, reset };\n}\n","import type { WorklogRecord } from \"./types\";\n\n/** Loosely-typed shape of a parsed SSE `data:` frame from the granular Runtime stream. */\nexport interface RawFrame {\n event_class?: string;\n control_id?: string | null;\n data?: unknown;\n status?: string | null;\n date_submitted?: string;\n /** Runtime v0.5.0+ tamper-evident hash chain fields. */\n entry_hash?: string | null;\n previous_hash?: string | null;\n}\n\n/** Normalize a parsed SSE frame into a WorklogRecord (defaults missing fields; never throws). */\nexport function frameToRecord(frame: RawFrame): WorklogRecord {\n const status = frame.status === \"success\" || frame.status === \"error\" ? frame.status : null;\n return {\n event_class: typeof frame.event_class === \"string\" && frame.event_class.length > 0\n ? frame.event_class\n : \"Unknown\",\n control_id: frame.control_id ?? null,\n data: frame.data,\n status,\n date_submitted: typeof frame.date_submitted === \"string\" ? frame.date_submitted : \"\",\n entry_hash: frame.entry_hash ?? null,\n previous_hash: frame.previous_hash ?? null,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmIO,SAAS,oBAAoB,SAAwB,MAAoB;AAC9E,SAAO,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,MAAM,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,KA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AACvD,QAAM,CAAC,SAAS,QAAQ,QAAI,yBAAW,aAAa,QAAQ,mBAAmB;AAE/E,QAAM,aAAS,0BAAY,CAAC,WAA0B,SAAS,EAAE,MAAM,UAAU,OAAO,CAAC,GAAG,CAAC,CAAC;AAC9F,QAAM,iBAAa;AAAA,IACjB,CAAC,YAA6B,SAAS,EAAE,MAAM,cAAc,QAAQ,CAAC;AAAA,IACtE,CAAC;AAAA,EACH;AACA,QAAM,YAAQ;AAAA,IACZ,CAAC,KAAoB,SAAS,SAAS,EAAE,MAAM,SAAS,QAAQ,GAAG,CAAC;AAAA,IACpE,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,SAAS,QAAQ,YAAY,MAAM;AAC9C;;;ACpBO,SAAS,cAAc,OAAgC;AAC5D,QAAM,SAAS,MAAM,WAAW,aAAa,MAAM,WAAW,UAAU,MAAM,SAAS;AACvF,SAAO;AAAA,IACL,aAAa,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,SAAS,IAC7E,MAAM,cACN;AAAA,IACJ,YAAY,MAAM,cAAc;AAAA,IAChC,MAAM,MAAM;AAAA,IACZ;AAAA,IACA,gBAAgB,OAAO,MAAM,mBAAmB,WAAW,MAAM,iBAAiB;AAAA,IAClF,YAAY,MAAM,cAAc;AAAA,IAChC,eAAe,MAAM,iBAAiB;AAAA,EACxC;AACF;","names":["pos"]}
@@ -14,6 +14,14 @@ var agentTitle = (r) => {
14
14
  return typeof name === "string" && name.length > 0 ? `Agent: ${name}` : "Agent-to-agent";
15
15
  };
16
16
  var constTitle = (label) => () => label;
17
+ var shieldBlockTitle = (r) => {
18
+ const id = asRecord(r.data).shield_id;
19
+ return typeof id === "string" && id.length > 0 ? `Blocked by ${id}` : "Blocked by safeguard";
20
+ };
21
+ var knowledgeTitle = (r) => {
22
+ const query = asRecord(r.data).query;
23
+ return typeof query === "string" && query.length > 0 ? `Knowledge: ${query}` : "Knowledge retrieval";
24
+ };
17
25
  var EVENT_REGISTRY = {
18
26
  // Run envelope
19
27
  AssistantInference: { kind: "answer", role: "run-open", title: constTitle("Inference started") },
@@ -21,6 +29,9 @@ var EVENT_REGISTRY = {
21
29
  // Safeguard
22
30
  ShieldInference: { kind: "safeguard", role: "open", title: constTitle("Safeguard") },
23
31
  ShieldInferenceResponse: { kind: "safeguard", role: "close", title: constTitle("Safeguard") },
32
+ // Emitted when a shield enforcement decision blocks the request (core 0.5.x).
33
+ // Response-only: the reducer opens it already closed when no command matched.
34
+ ShieldBlockedResponse: { kind: "safeguard", role: "close", title: shieldBlockTitle },
24
35
  // Reasoning
25
36
  ResponseInference: { kind: "reasoning", role: "open", title: constTitle("Reasoning") },
26
37
  ResponseInferenceResponse: { kind: "reasoning", role: "close", title: constTitle("Reasoning") },
@@ -38,6 +49,14 @@ var EVENT_REGISTRY = {
38
49
  A2AInference: { kind: "a2a", role: "open", title: agentTitle },
39
50
  AgentDiscovery: { kind: "a2a", role: "open", title: constTitle("Agent discovery") },
40
51
  AgentDiscoveryResponse: { kind: "a2a", role: "close", title: constTitle("Agent discovery") },
52
+ // Knowledge retrieval (RAG) — core 0.5.x
53
+ KnowledgeRetrieval: { kind: "knowledge", role: "open", title: knowledgeTitle },
54
+ KnowledgeRetrievalResponse: { kind: "knowledge", role: "close", title: knowledgeTitle },
55
+ // Speech pipeline — core 0.5.x
56
+ SpeechTranscription: { kind: "speech", role: "open", title: constTitle("Speech-to-text") },
57
+ SpeechTranscriptionResponse: { kind: "speech", role: "close", title: constTitle("Speech-to-text") },
58
+ SpeechSynthesis: { kind: "speech", role: "open", title: constTitle("Text-to-speech") },
59
+ SpeechSynthesisResponse: { kind: "speech", role: "close", title: constTitle("Text-to-speech") },
41
60
  // Memory / persistence
42
61
  ContextPersistence: { kind: "memory", role: "open", title: constTitle("Memory persistence") },
43
62
  ContextFlush: { kind: "memory", role: "open", title: constTitle("Memory flush") },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/worklog/types.ts","../../src/worklog/registry.ts","../../src/worklog/reducer.ts","../../src/worklog/use-worklog.ts","../../src/worklog/from-frame.ts"],"sourcesContent":["/** One granular Runtime worklog record (a `bus_mode` SSE frame or a `/worklog/{task_id}/events` item). */\nexport interface WorklogRecord {\n /** Runtime v0.5.0+ tamper-evident hash chain fields (optional on SSE frames). */\n entry_hash?: string | null;\n previous_hash?: string | null;\n event_class: string;\n control_id: string | null;\n data: unknown;\n status: \"success\" | \"error\" | null;\n date_submitted: string;\n}\n\n/** Runtime v0.5.0 worklog audit summary returned by `GET /worklog/`. */\nexport interface WorklogSummary {\n task_id: string;\n parent_task_id?: string | null;\n session_id?: string | null;\n user_id?: string | null;\n assistant_id?: string | null;\n agentspace_id?: string | null;\n channel_id?: string | null;\n depth?: number;\n final_status?: string | null;\n started_at: string;\n finished_at?: string | null;\n}\n\n/** Runtime v0.5.0 full worklog detail returned by `GET /worklog/{task_id}`. */\nexport interface WorklogDetail extends WorklogSummary {\n final_result?: string | null;\n error_message?: string | null;\n}\n\n/** Runtime v0.5.0 single worklog event returned by `GET /worklog/{task_id}/events`. */\nexport interface WorklogEventDetail {\n id: number;\n task_id: string;\n previous_hash?: string | null;\n entry_hash?: string | null;\n event_class: string;\n control_id?: string | null;\n status?: string | null;\n data?: unknown;\n submitted_at: string;\n}\n\n/** Runtime v0.5.0 paginated list of worklog summaries. */\nexport interface WorklogPage {\n items: WorklogSummary[];\n total: number;\n limit: number;\n offset: number;\n}\n\n/** Runtime v0.5.0 paginated list of worklog events for a single task. */\nexport interface WorklogEventPage {\n task_id: string;\n items: WorklogEventDetail[];\n total: number;\n}\n\n/** Runtime v0.5.0 hash-chain verification result returned by `GET /worklog/{task_id}/verify`. */\nexport interface WorklogVerificationResult {\n valid: boolean;\n task_id: string;\n event_count: number;\n first_broken_event_id?: number | null;\n first_broken_index?: number | null;\n expected_hash?: string | null;\n actual_hash?: string | null;\n message: string;\n}\n\n/** Semantic bucket a node belongs to. */\nexport type NodeKind =\n | \"safeguard\"\n | \"reasoning\"\n | \"tool\"\n | \"a2a\"\n | \"memory\"\n | \"answer\"\n | \"unknown\";\n\n/** Lifecycle state of a single node. */\nexport type NodeStatus = \"pending\" | \"running\" | \"completed\" | \"failed\" | \"skipped\";\n\n/** Overall run status. */\nexport type RunStatus = \"idle\" | \"running\" | \"success\" | \"error\";\n\n/** A single step in the execution chain (command + its response merged by control_id). */\nexport interface WorklogNode {\n id: string;\n kind: NodeKind;\n eventClass: string;\n status: NodeStatus;\n title: string;\n startedAt?: string;\n endedAt?: string;\n depth: number;\n parentId?: string;\n children: WorklogNode[];\n command?: unknown;\n response?: unknown;\n error?: string;\n raw: WorklogRecord[];\n}\n\n/** Normalized execution model produced by the reducer. */\nexport interface WorklogState {\n taskId: string | null;\n status: RunStatus;\n answer: string | null;\n nodes: WorklogNode[];\n index: Record<string, number>;\n raw: WorklogRecord[];\n}\n\n/** How a record acts on the model. */\nexport type EventRole = \"open\" | \"close\" | \"run-open\" | \"run-close\" | \"ignore\";\n\n/** Registry descriptor for one event_class. */\nexport interface EventInterpreter {\n kind: NodeKind;\n role: EventRole;\n title: (_record: WorklogRecord) => string;\n /** If true, an opened node starts in \"pending\" (awaiting external input) rather than \"running\". */\n pending?: boolean;\n}\n\nexport function initialWorklogState(taskId: string | null = null): WorklogState {\n return { taskId, status: \"idle\", answer: null, nodes: [], index: {}, raw: [] };\n}\n","import type { EventInterpreter, WorklogRecord } from \"./types\";\n\nconst asRecord = (data: unknown): Record<string, unknown> =>\n data && typeof data === \"object\" ? (data as Record<string, unknown>) : {};\n\nconst toolTitle = (r: WorklogRecord): string => {\n const name = asRecord(r.data).name;\n return typeof name === \"string\" && name.length > 0 ? `Tool: ${name}` : \"Tool\";\n};\n\nconst agentTitle = (r: WorklogRecord): string => {\n const name = asRecord(r.data).name;\n return typeof name === \"string\" && name.length > 0 ? `Agent: ${name}` : \"Agent-to-agent\";\n};\n\nconst constTitle = (label: string) => () => label;\n\nexport const EVENT_REGISTRY: Record<string, EventInterpreter> = {\n // Run envelope\n AssistantInference: { kind: \"answer\", role: \"run-open\", title: constTitle(\"Inference started\") },\n AssistantInferenceResponse: { kind: \"answer\", role: \"run-close\", title: constTitle(\"Answer\") },\n\n // Safeguard\n ShieldInference: { kind: \"safeguard\", role: \"open\", title: constTitle(\"Safeguard\") },\n ShieldInferenceResponse: { kind: \"safeguard\", role: \"close\", title: constTitle(\"Safeguard\") },\n\n // Reasoning\n ResponseInference: { kind: \"reasoning\", role: \"open\", title: constTitle(\"Reasoning\") },\n ResponseInferenceResponse: { kind: \"reasoning\", role: \"close\", title: constTitle(\"Reasoning\") },\n\n // Tools (server + subclasses) and their responses\n ServerToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n BuiltinToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n UnknownToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n ClientToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle, pending: true },\n ToolExecutionResponse: { kind: \"tool\", role: \"close\", title: toolTitle },\n BuiltinToolExecutionResponse: { kind: \"tool\", role: \"close\", title: toolTitle },\n\n // Tool schema discovery\n ToolSchema: { kind: \"tool\", role: \"open\", title: constTitle(\"Tool schema\") },\n ToolSchemaResponse: { kind: \"tool\", role: \"close\", title: constTitle(\"Tool schema\") },\n\n // Agent-to-agent\n A2AInference: { kind: \"a2a\", role: \"open\", title: agentTitle },\n AgentDiscovery: { kind: \"a2a\", role: \"open\", title: constTitle(\"Agent discovery\") },\n AgentDiscoveryResponse: { kind: \"a2a\", role: \"close\", title: constTitle(\"Agent discovery\") },\n\n // Memory / persistence\n ContextPersistence: { kind: \"memory\", role: \"open\", title: constTitle(\"Memory persistence\") },\n ContextFlush: { kind: \"memory\", role: \"open\", title: constTitle(\"Memory flush\") },\n ContextFlushResponse: { kind: \"memory\", role: \"close\", title: constTitle(\"Memory flush\") },\n\n // Human approval\n HumanApprovalRequired: {\n kind: \"tool\",\n role: \"open\",\n title: constTitle(\"Human approval required\"),\n pending: true,\n },\n HumanApprovalRequiredResponse: { kind: \"tool\", role: \"close\", title: constTitle(\"Human approval\") },\n};\n\nexport function resolveInterpreter(eventClass: string): EventInterpreter {\n if (Object.prototype.hasOwnProperty.call(EVENT_REGISTRY, eventClass)) {\n return EVENT_REGISTRY[eventClass];\n }\n return {\n kind: \"unknown\",\n role: \"open\",\n title: (r: WorklogRecord) => r.event_class,\n };\n}\n","import { resolveInterpreter } from \"./registry\";\nimport type { EventInterpreter, WorklogNode, WorklogRecord, WorklogState } from \"./types\";\nimport { initialWorklogState } from \"./types\";\n\nconst asString = (v: unknown): string =>\n typeof v === \"string\" ? v : v == null ? \"\" : JSON.stringify(v);\n\nconst nodeDepth = (record: WorklogRecord): number => {\n const d = record.data && typeof record.data === \"object\"\n ? (record.data as Record<string, unknown>).depth\n : undefined;\n return typeof d === \"number\" ? d : 0;\n};\n\nconst makeOpenNode = (record: WorklogRecord, interp: EventInterpreter, id: string): WorklogNode => ({\n id,\n kind: interp.kind,\n eventClass: record.event_class,\n status: interp.pending ? \"pending\" : \"running\",\n title: interp.title(record),\n startedAt: record.date_submitted,\n depth: nodeDepth(record),\n children: [],\n command: record.data,\n raw: [record],\n});\n\nconst makeClosedNode = (record: WorklogRecord, interp: EventInterpreter, id: string): WorklogNode => ({\n id,\n kind: interp.kind,\n eventClass: record.event_class,\n status: record.status === \"error\" ? \"failed\" : \"completed\",\n title: interp.title(record),\n startedAt: record.date_submitted,\n endedAt: record.date_submitted,\n depth: nodeDepth(record),\n children: [],\n response: record.data,\n error: record.status === \"error\" ? asString(record.data) : undefined,\n raw: [record],\n});\n\nexport function reduceWorklog(state: WorklogState, record: WorklogRecord): WorklogState {\n const interp = resolveInterpreter(record.event_class);\n const next: WorklogState = {\n ...state,\n nodes: state.nodes.slice(),\n index: { ...state.index },\n raw: [...state.raw, record],\n };\n\n if (interp.role === \"ignore\") return next;\n\n if (interp.role === \"run-open\") {\n next.status = \"running\";\n return next;\n }\n\n if (interp.role === \"run-close\") {\n next.answer = asString(record.data) || null;\n next.status = record.status === \"error\" ? \"error\" : \"success\";\n return next;\n }\n\n const key = record.control_id ?? `${record.event_class}-${next.raw.length}`;\n\n if (interp.role === \"close\") {\n const pos = Object.prototype.hasOwnProperty.call(next.index, key) ? next.index[key] : undefined;\n if (pos != null) {\n const existing = next.nodes[pos];\n next.nodes[pos] = {\n ...existing,\n status: record.status === \"error\" ? \"failed\" : \"completed\",\n endedAt: record.date_submitted,\n response: record.data,\n error: record.status === \"error\" ? asString(record.data) : existing.error,\n raw: [...existing.raw, record],\n };\n } else {\n // response arrived without a seen command — create it already closed\n next.index[key] = next.nodes.length;\n next.nodes.push(makeClosedNode(record, interp, key));\n }\n if (record.status === \"error\") next.status = \"error\";\n return next;\n }\n\n // role === \"open\"\n const pos = Object.prototype.hasOwnProperty.call(next.index, key) ? next.index[key] : undefined;\n if (pos != null) {\n const existing = next.nodes[pos];\n next.nodes[pos] = { ...existing, raw: [...existing.raw, record] };\n } else {\n next.index[key] = next.nodes.length;\n next.nodes.push(makeOpenNode(record, interp, key));\n }\n return next;\n}\n\nexport function foldWorklog(records: WorklogRecord[], taskId: string | null = null): WorklogState {\n return records.reduce(reduceWorklog, initialWorklogState(taskId));\n}\n","import { useCallback, useReducer } from \"react\";\nimport { reduceWorklog } from \"./reducer\";\nimport { initialWorklogState, type WorklogRecord, type WorklogState } from \"./types\";\n\ntype Action =\n | { type: \"ingest\"; record: WorklogRecord }\n | { type: \"ingestMany\"; records: WorklogRecord[] }\n | { type: \"reset\"; taskId: string | null };\n\nfunction hookReducer(state: WorklogState, action: Action): WorklogState {\n switch (action.type) {\n case \"ingest\":\n return reduceWorklog(state, action.record);\n case \"ingestMany\":\n return action.records.reduce(reduceWorklog, state);\n case \"reset\":\n return initialWorklogState(action.taskId);\n }\n}\n\n/** Live worklog accumulator. Feed it `bus_mode` records via `ingest`; use `foldWorklog` for history. */\nexport function useWorklog(taskId: string | null = null) {\n const [worklog, dispatch] = useReducer(hookReducer, taskId, initialWorklogState);\n\n const ingest = useCallback((record: WorklogRecord) => dispatch({ type: \"ingest\", record }), []);\n const ingestMany = useCallback(\n (records: WorklogRecord[]) => dispatch({ type: \"ingestMany\", records }),\n [],\n );\n const reset = useCallback(\n (id: string | null = null) => dispatch({ type: \"reset\", taskId: id }),\n [],\n );\n\n return { worklog, ingest, ingestMany, reset };\n}\n","import type { WorklogRecord } from \"./types\";\n\n/** Loosely-typed shape of a parsed SSE `data:` frame from the granular Runtime stream. */\nexport interface RawFrame {\n event_class?: string;\n control_id?: string | null;\n data?: unknown;\n status?: string | null;\n date_submitted?: string;\n /** Runtime v0.5.0+ tamper-evident hash chain fields. */\n entry_hash?: string | null;\n previous_hash?: string | null;\n}\n\n/** Normalize a parsed SSE frame into a WorklogRecord (defaults missing fields; never throws). */\nexport function frameToRecord(frame: RawFrame): WorklogRecord {\n const status = frame.status === \"success\" || frame.status === \"error\" ? frame.status : null;\n return {\n event_class: typeof frame.event_class === \"string\" && frame.event_class.length > 0\n ? frame.event_class\n : \"Unknown\",\n control_id: frame.control_id ?? null,\n data: frame.data,\n status,\n date_submitted: typeof frame.date_submitted === \"string\" ? frame.date_submitted : \"\",\n entry_hash: frame.entry_hash ?? null,\n previous_hash: frame.previous_hash ?? null,\n };\n}\n"],"mappings":";AAiIO,SAAS,oBAAoB,SAAwB,MAAoB;AAC9E,SAAO,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,MAAM,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,KAAK,CAAC,EAAE;AAC/E;;;ACjIA,IAAM,WAAW,CAAC,SAChB,QAAQ,OAAO,SAAS,WAAY,OAAmC,CAAC;AAE1E,IAAM,YAAY,CAAC,MAA6B;AAC9C,QAAM,OAAO,SAAS,EAAE,IAAI,EAAE;AAC9B,SAAO,OAAO,SAAS,YAAY,KAAK,SAAS,IAAI,SAAS,IAAI,KAAK;AACzE;AAEA,IAAM,aAAa,CAAC,MAA6B;AAC/C,QAAM,OAAO,SAAS,EAAE,IAAI,EAAE;AAC9B,SAAO,OAAO,S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AO,oBAAoB,OAAO,MAAM;AAAA,EAC5C;AACF;AAGO,SAAS,WAAW,SAAwB,MAAM;AACvD,QAAM,CAAC,SAAS,QAAQ,IAAI,WAAW,aAAa,QAAQ,mBAAmB;AAE/E,QAAM,SAAS,YAAY,CAAC,WAA0B,SAAS,EAAE,MAAM,UAAU,OAAO,CAAC,GAAG,CAAC,CAAC;AAC9F,QAAM,aAAa;AAAA,IACjB,CAAC,YAA6B,SAAS,EAAE,MAAM,cAAc,QAAQ,CAAC;AAAA,IACtE,CAAC;AAAA,EACH;AACA,QAAM,QAAQ;AAAA,IACZ,CAAC,KAAoB,SAAS,SAAS,EAAE,MAAM,SAAS,QAAQ,GAAG,CAAC;AAAA,IACpE,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,SAAS,QAAQ,YAAY,MAAM;AAC9C;;;ACpBO,SAAS,cAAc,OAAgC;AAC5D,QAAM,SAAS,MAAM,WAAW,aAAa,MAAM,WAAW,UAAU,MAAM,SAAS;AACvF,SAAO;AAAA,IACL,aAAa,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,SAAS,IAC7E,MAAM,cACN;AAAA,IACJ,YAAY,MAAM,cAAc;AAAA,IAChC,MAAM,MAAM;AAAA,IACZ;AAAA,IACA,gBAAgB,OAAO,MAAM,mBAAmB,WAAW,MAAM,iBAAiB;AAAA,IAClF,YAAY,MAAM,cAAc;AAAA,IAChC,eAAe,MAAM,iBAAiB;AAAA,EACxC;AACF;","names":["pos"]}
1
+ {"version":3,"sources":["../../src/worklog/types.ts","../../src/worklog/registry.ts","../../src/worklog/reducer.ts","../../src/worklog/use-worklog.ts","../../src/worklog/from-frame.ts"],"sourcesContent":["/** One granular Runtime worklog record (a `bus_mode` SSE frame or a `/worklog/{task_id}/events` item). */\nexport interface WorklogRecord {\n /** Runtime v0.5.0+ tamper-evident hash chain fields (optional on SSE frames). */\n entry_hash?: string | null;\n previous_hash?: string | null;\n event_class: string;\n control_id: string | null;\n data: unknown;\n status: \"success\" | \"error\" | null;\n date_submitted: string;\n}\n\n/** Runtime v0.5.0 worklog audit summary returned by `GET /worklog/`. */\nexport interface WorklogSummary {\n task_id: string;\n parent_task_id?: string | null;\n session_id?: string | null;\n user_id?: string | null;\n assistant_id?: string | null;\n agentspace_id?: string | null;\n channel_id?: string | null;\n depth?: number;\n final_status?: string | null;\n started_at: string;\n finished_at?: string | null;\n}\n\n/** Runtime v0.5.0 full worklog detail returned by `GET /worklog/{task_id}`. */\nexport interface WorklogDetail extends WorklogSummary {\n final_result?: string | null;\n error_message?: string | null;\n}\n\n/** Runtime v0.5.0 single worklog event returned by `GET /worklog/{task_id}/events`. */\nexport interface WorklogEventDetail {\n id: number;\n task_id: string;\n previous_hash?: string | null;\n entry_hash?: string | null;\n event_class: string;\n control_id?: string | null;\n status?: string | null;\n data?: unknown;\n submitted_at: string;\n}\n\n/** Runtime v0.5.0 paginated list of worklog summaries. */\nexport interface WorklogPage {\n items: WorklogSummary[];\n total: number;\n limit: number;\n offset: number;\n}\n\n/** Runtime v0.5.0 paginated list of worklog events for a single task. */\nexport interface WorklogEventPage {\n task_id: string;\n items: WorklogEventDetail[];\n total: number;\n}\n\n/** Runtime v0.5.0 hash-chain verification result returned by `GET /worklog/{task_id}/verify`. */\nexport interface WorklogVerificationResult {\n valid: boolean;\n task_id: string;\n event_count: number;\n first_broken_event_id?: number | null;\n first_broken_index?: number | null;\n expected_hash?: string | null;\n actual_hash?: string | null;\n message: string;\n}\n\n/** Semantic bucket a node belongs to. */\nexport type NodeKind =\n | \"safeguard\"\n | \"reasoning\"\n | \"tool\"\n | \"a2a\"\n | \"memory\"\n | \"knowledge\"\n | \"speech\"\n | \"answer\"\n | \"unknown\";\n\n/** Lifecycle state of a single node. */\nexport type NodeStatus = \"pending\" | \"running\" | \"completed\" | \"failed\" | \"skipped\";\n\n/** Overall run status. */\nexport type RunStatus = \"idle\" | \"running\" | \"success\" | \"error\";\n\n/** A single step in the execution chain (command + its response merged by control_id). */\nexport interface WorklogNode {\n id: string;\n kind: NodeKind;\n eventClass: string;\n status: NodeStatus;\n title: string;\n startedAt?: string;\n endedAt?: string;\n depth: number;\n parentId?: string;\n children: WorklogNode[];\n command?: unknown;\n response?: unknown;\n error?: string;\n raw: WorklogRecord[];\n}\n\n/** Normalized execution model produced by the reducer. */\nexport interface WorklogState {\n taskId: string | null;\n status: RunStatus;\n answer: string | null;\n nodes: WorklogNode[];\n index: Record<string, number>;\n raw: WorklogRecord[];\n}\n\n/** How a record acts on the model. */\nexport type EventRole = \"open\" | \"close\" | \"run-open\" | \"run-close\" | \"ignore\";\n\n/** Registry descriptor for one event_class. */\nexport interface EventInterpreter {\n kind: NodeKind;\n role: EventRole;\n title: (_record: WorklogRecord) => string;\n /** If true, an opened node starts in \"pending\" (awaiting external input) rather than \"running\". */\n pending?: boolean;\n}\n\nexport function initialWorklogState(taskId: string | null = null): WorklogState {\n return { taskId, status: \"idle\", answer: null, nodes: [], index: {}, raw: [] };\n}\n","import type { EventInterpreter, WorklogRecord } from \"./types\";\n\nconst asRecord = (data: unknown): Record<string, unknown> =>\n data && typeof data === \"object\" ? (data as Record<string, unknown>) : {};\n\nconst toolTitle = (r: WorklogRecord): string => {\n const name = asRecord(r.data).name;\n return typeof name === \"string\" && name.length > 0 ? `Tool: ${name}` : \"Tool\";\n};\n\nconst agentTitle = (r: WorklogRecord): string => {\n const name = asRecord(r.data).name;\n return typeof name === \"string\" && name.length > 0 ? `Agent: ${name}` : \"Agent-to-agent\";\n};\n\nconst constTitle = (label: string) => () => label;\n\nconst shieldBlockTitle = (r: WorklogRecord): string => {\n const id = asRecord(r.data).shield_id;\n return typeof id === \"string\" && id.length > 0 ? `Blocked by ${id}` : \"Blocked by safeguard\";\n};\n\nconst knowledgeTitle = (r: WorklogRecord): string => {\n const query = asRecord(r.data).query;\n return typeof query === \"string\" && query.length > 0\n ? `Knowledge: ${query}`\n : \"Knowledge retrieval\";\n};\n\nexport const EVENT_REGISTRY: Record<string, EventInterpreter> = {\n // Run envelope\n AssistantInference: { kind: \"answer\", role: \"run-open\", title: constTitle(\"Inference started\") },\n AssistantInferenceResponse: { kind: \"answer\", role: \"run-close\", title: constTitle(\"Answer\") },\n\n // Safeguard\n ShieldInference: { kind: \"safeguard\", role: \"open\", title: constTitle(\"Safeguard\") },\n ShieldInferenceResponse: { kind: \"safeguard\", role: \"close\", title: constTitle(\"Safeguard\") },\n // Emitted when a shield enforcement decision blocks the request (core 0.5.x).\n // Response-only: the reducer opens it already closed when no command matched.\n ShieldBlockedResponse: { kind: \"safeguard\", role: \"close\", title: shieldBlockTitle },\n\n // Reasoning\n ResponseInference: { kind: \"reasoning\", role: \"open\", title: constTitle(\"Reasoning\") },\n ResponseInferenceResponse: { kind: \"reasoning\", role: \"close\", title: constTitle(\"Reasoning\") },\n\n // Tools (server + subclasses) and their responses\n ServerToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n BuiltinToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n UnknownToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle },\n ClientToolExecution: { kind: \"tool\", role: \"open\", title: toolTitle, pending: true },\n ToolExecutionResponse: { kind: \"tool\", role: \"close\", title: toolTitle },\n BuiltinToolExecutionResponse: { kind: \"tool\", role: \"close\", title: toolTitle },\n\n // Tool schema discovery\n ToolSchema: { kind: \"tool\", role: \"open\", title: constTitle(\"Tool schema\") },\n ToolSchemaResponse: { kind: \"tool\", role: \"close\", title: constTitle(\"Tool schema\") },\n\n // Agent-to-agent\n A2AInference: { kind: \"a2a\", role: \"open\", title: agentTitle },\n AgentDiscovery: { kind: \"a2a\", role: \"open\", title: constTitle(\"Agent discovery\") },\n AgentDiscoveryResponse: { kind: \"a2a\", role: \"close\", title: constTitle(\"Agent discovery\") },\n\n // Knowledge retrieval (RAG) — core 0.5.x\n KnowledgeRetrieval: { kind: \"knowledge\", role: \"open\", title: knowledgeTitle },\n KnowledgeRetrievalResponse: { kind: \"knowledge\", role: \"close\", title: knowledgeTitle },\n\n // Speech pipeline — core 0.5.x\n SpeechTranscription: { kind: \"speech\", role: \"open\", title: constTitle(\"Speech-to-text\") },\n SpeechTranscriptionResponse: { kind: \"speech\", role: \"close\", title: constTitle(\"Speech-to-text\") },\n SpeechSynthesis: { kind: \"speech\", role: \"open\", title: constTitle(\"Text-to-speech\") },\n SpeechSynthesisResponse: { kind: \"speech\", role: \"close\", title: constTitle(\"Text-to-speech\") },\n\n // Memory / persistence\n ContextPersistence: { kind: \"memory\", role: \"open\", title: constTitle(\"Memory persistence\") },\n ContextFlush: { kind: \"memory\", role: \"open\", title: constTitle(\"Memory flush\") },\n ContextFlushResponse: { kind: \"memory\", role: \"close\", title: constTitle(\"Memory flush\") },\n\n // Human approval\n HumanApprovalRequired: {\n kind: \"tool\",\n role: \"open\",\n title: constTitle(\"Human approval required\"),\n pending: true,\n },\n HumanApprovalRequiredResponse: { kind: \"tool\", role: \"close\", title: constTitle(\"Human approval\") },\n};\n\nexport function resolveInterpreter(eventClass: string): EventInterpreter {\n if (Object.prototype.hasOwnProperty.call(EVENT_REGISTRY, eventClass)) {\n return EVENT_REGISTRY[eventClass];\n }\n return {\n kind: \"unknown\",\n role: \"open\",\n title: (r: WorklogRecord) => r.event_class,\n };\n}\n","import { resolveInterpreter } from \"./registry\";\nimport type { EventInterpreter, WorklogNode, WorklogRecord, WorklogState } from \"./types\";\nimport { initialWorklogState } from \"./types\";\n\nconst asString = (v: unknown): string =>\n typeof v === \"string\" ? v : v == null ? \"\" : JSON.stringify(v);\n\nconst nodeDepth = (record: WorklogRecord): number => {\n const d = record.data && typeof record.data === \"object\"\n ? (record.data as Record<string, unknown>).depth\n : undefined;\n return typeof d === \"number\" ? d : 0;\n};\n\nconst makeOpenNode = (record: WorklogRecord, interp: EventInterpreter, id: string): WorklogNode => ({\n id,\n kind: interp.kind,\n eventClass: record.event_class,\n status: interp.pending ? \"pending\" : \"running\",\n title: interp.title(record),\n startedAt: record.date_submitted,\n depth: nodeDepth(record),\n children: [],\n command: record.data,\n raw: [record],\n});\n\nconst makeClosedNode = (record: WorklogRecord, interp: EventInterpreter, id: string): WorklogNode => ({\n id,\n kind: interp.kind,\n eventClass: record.event_class,\n status: record.status === \"error\" ? \"failed\" : \"completed\",\n title: interp.title(record),\n startedAt: record.date_submitted,\n endedAt: record.date_submitted,\n depth: nodeDepth(record),\n children: [],\n response: record.data,\n error: record.status === \"error\" ? asString(record.data) : undefined,\n raw: [record],\n});\n\nexport function reduceWorklog(state: WorklogState, record: WorklogRecord): WorklogState {\n const interp = resolveInterpreter(record.event_class);\n const next: WorklogState = {\n ...state,\n nodes: state.nodes.slice(),\n index: { ...state.index },\n raw: [...state.raw, record],\n };\n\n if (interp.role === \"ignore\") return next;\n\n if (interp.role === \"run-open\") {\n next.status = \"running\";\n return next;\n }\n\n if (interp.role === \"run-close\") {\n next.answer = asString(record.data) || null;\n next.status = record.status === \"error\" ? \"error\" : \"success\";\n return next;\n }\n\n const key = record.control_id ?? `${record.event_class}-${next.raw.length}`;\n\n if (interp.role === \"close\") {\n const pos = Object.prototype.hasOwnProperty.call(next.index, key) ? next.index[key] : undefined;\n if (pos != null) {\n const existing = next.nodes[pos];\n next.nodes[pos] = {\n ...existing,\n status: record.status === \"error\" ? \"failed\" : \"completed\",\n endedAt: record.date_submitted,\n response: record.data,\n error: record.status === \"error\" ? asString(record.data) : existing.error,\n raw: [...existing.raw, record],\n };\n } else {\n // response arrived without a seen command — create it already closed\n next.index[key] = next.nodes.length;\n next.nodes.push(makeClosedNode(record, interp, key));\n }\n if (record.status === \"error\") next.status = \"error\";\n return next;\n }\n\n // role === \"open\"\n const pos = Object.prototype.hasOwnProperty.call(next.index, key) ? next.index[key] : undefined;\n if (pos != null) {\n const existing = next.nodes[pos];\n next.nodes[pos] = { ...existing, raw: [...existing.raw, record] };\n } else {\n next.index[key] = next.nodes.length;\n next.nodes.push(makeOpenNode(record, interp, key));\n }\n return next;\n}\n\nexport function foldWorklog(records: WorklogRecord[], taskId: string | null = null): WorklogState {\n return records.reduce(reduceWorklog, initialWorklogState(taskId));\n}\n","import { useCallback, useReducer } from \"react\";\nimport { reduceWorklog } from \"./reducer\";\nimport { initialWorklogState, type WorklogRecord, type WorklogState } from \"./types\";\n\ntype Action =\n | { type: \"ingest\"; record: WorklogRecord }\n | { type: \"ingestMany\"; records: WorklogRecord[] }\n | { type: \"reset\"; taskId: string | null };\n\nfunction hookReducer(state: WorklogState, action: Action): WorklogState {\n switch (action.type) {\n case \"ingest\":\n return reduceWorklog(state, action.record);\n case \"ingestMany\":\n return action.records.reduce(reduceWorklog, state);\n case \"reset\":\n return initialWorklogState(action.taskId);\n }\n}\n\n/** Live worklog accumulator. Feed it `bus_mode` records via `ingest`; use `foldWorklog` for history. */\nexport function useWorklog(taskId: string | null = null) {\n const [worklog, dispatch] = useReducer(hookReducer, taskId, initialWorklogState);\n\n const ingest = useCallback((record: WorklogRecord) => dispatch({ type: \"ingest\", record }), []);\n const ingestMany = useCallback(\n (records: WorklogRecord[]) => dispatch({ type: \"ingestMany\", records }),\n [],\n );\n const reset = useCallback(\n (id: string | null = null) => dispatch({ type: \"reset\", taskId: id }),\n [],\n );\n\n return { worklog, ingest, ingestMany, reset };\n}\n","import type { WorklogRecord } from \"./types\";\n\n/** Loosely-typed shape of a parsed SSE `data:` frame from the granular Runtime stream. */\nexport interface RawFrame {\n event_class?: string;\n control_id?: string | null;\n data?: unknown;\n status?: string | null;\n date_submitted?: string;\n /** Runtime v0.5.0+ tamper-evident hash chain fields. */\n entry_hash?: string | null;\n previous_hash?: string | null;\n}\n\n/** Normalize a parsed SSE frame into a WorklogRecord (defaults missing fields; never throws). */\nexport function frameToRecord(frame: RawFrame): WorklogRecord {\n const status = frame.status === \"success\" || frame.status === \"error\" ? frame.status : null;\n return {\n event_class: typeof frame.event_class === \"string\" && frame.event_class.length > 0\n ? frame.event_class\n : \"Unknown\",\n control_id: frame.control_id ?? null,\n data: frame.data,\n status,\n date_submitted: typeof frame.date_submitted === \"string\" ? frame.date_submitted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AM;AAAA,IACnB,KAAK;AACH,aAAO,cAAc,OAAO,OAAO,MAAM;AAAA,IAC3C,KAAK;AACH,aAAO,OAAO,QAAQ,OAAO,eAAe,KAAK;AAAA,IACnD,KAAK;AACH,aAAO,oBAAoB,OAAO,MAAM;AAAA,EAC5C;AACF;AAGO,SAAS,WAAW,SAAwB,MAAM;AACvD,QAAM,CAAC,SAAS,QAAQ,IAAI,WAAW,aAAa,QAAQ,mBAAmB;AAE/E,QAAM,SAAS,YAAY,CAAC,WAA0B,SAAS,EAAE,MAAM,UAAU,OAAO,CAAC,GAAG,CAAC,CAAC;AAC9F,QAAM,aAAa;AAAA,IACjB,CAAC,YAA6B,SAAS,EAAE,MAAM,cAAc,QAAQ,CAAC;AAAA,IACtE,CAAC;AAAA,EACH;AACA,QAAM,QAAQ;AAAA,IACZ,CAAC,KAAoB,SAAS,SAAS,EAAE,MAAM,SAAS,QAAQ,GAAG,CAAC;AAAA,IACpE,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,SAAS,QAAQ,YAAY,MAAM;AAC9C;;;ACpBO,SAAS,cAAc,OAAgC;AAC5D,QAAM,SAAS,MAAM,WAAW,aAAa,MAAM,WAAW,UAAU,MAAM,SAAS;AACvF,SAAO;AAAA,IACL,aAAa,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,SAAS,IAC7E,MAAM,cACN;AAAA,IACJ,YAAY,MAAM,cAAc;AAAA,IAChC,MAAM,MAAM;AAAA,IACZ;AAAA,IACA,gBAAgB,OAAO,MAAM,mBAAmB,WAAW,MAAM,iBAAiB;AAAA,IAClF,YAAY,MAAM,cAAc;AAAA,IAChC,eAAe,MAAM,iBAAiB;AAAA,EACxC;AACF;","names":["pos"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alquimia-ai/tools",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "author": "Alquimia AI",
5
5
  "description": "tools for Alquimia SDK",
6
6
  "private": false,