@noodleseed/assistant 1.9.0 → 1.11.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.
@@ -34,6 +34,10 @@ interface TurnDetail {
34
34
  interface AssistantContentDetail extends TurnDetail {
35
35
  readonly delta: string;
36
36
  }
37
+ interface AssistantToolStartedDetail extends TurnDetail {
38
+ readonly id: string;
39
+ readonly tool: string;
40
+ }
37
41
  interface AssistantToolProposedDetail extends TurnDetail {
38
42
  readonly id: string;
39
43
  readonly tool: string;
@@ -83,6 +87,7 @@ interface AssistantErrorEventDetail extends TurnDetail {
83
87
  readonly retryable?: boolean;
84
88
  }
85
89
  type AssistantContentEvent = NamedEvent<'content', AssistantContentDetail>;
90
+ type AssistantToolStartedEvent = NamedEvent<'tool_started', AssistantToolStartedDetail>;
86
91
  type AssistantToolProposedEvent = NamedEvent<'tool_proposed', AssistantToolProposedDetail>;
87
92
  type AssistantInputRequestedEvent = NamedEvent<'input_requested', AssistantInputRequestedDetail>;
88
93
  type AssistantInteractionResolvedEvent = NamedEvent<'interaction_resolved', AssistantInteractionResolvedDetail>;
@@ -121,7 +126,7 @@ interface AssistantUnrecognizedEvent {
121
126
  };
122
127
  }
123
128
  /** Closed event union for the DOM-free client; unknown future SSE names remain observable safely. */
124
- type AssistantClientEvent = AssistantContentEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
129
+ type AssistantClientEvent = AssistantContentEvent | AssistantToolStartedEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
125
130
 
126
131
  type AssistantInteractionStatus = 'pending' | 'submitting' | 'accepted' | 'declined' | 'cancelled';
127
132
  interface AssistantConfirmationData {
@@ -226,4 +231,4 @@ declare class AssistantClientError extends Error {
226
231
  }
227
232
  declare function createAssistantClient<TPageContext extends AssistantPageContext = AssistantContext>(options: CreateAssistantClientOptions<TPageContext>): AssistantClient<TPageContext>;
228
233
 
229
- export { type AssistantPageContext as A, type AssistantInteractionStatus as B, type CreateAssistantClientOptions as C, type AssistantJsonValue as D, type AssistantSessionResponse as E, type AssistantToolCompletedDetail as F, type AssistantToolCompletedEvent as G, type AssistantToolProposedDetail as H, type AssistantToolProposedEvent as I, type AssistantToolResultData as J, type AssistantUIDataTypes as K, type AssistantUIMessage as L, type AssistantUnrecognizedEvent as M, type AssistantViewData as N, createAssistantClient as O, type AssistantContext as a, type AssistantChatState as b, type AssistantClient as c, type AssistantViewAvailableDetail as d, type AssistantModelContextUpdate as e, type AssistantClientEvent as f, type AssistantErrorDetail as g, type AssistantInteractionResponse as h, type AssistantEvent as i, type AssistantViewAvailableEvent as j, type AssistantChatError as k, type AssistantClientContext as l, AssistantClientError as m, type AssistantClientLifecycleEvent as n, type AssistantConfirmationData as o, type AssistantContentDetail as p, type AssistantContentEvent as q, type AssistantContextValue as r, type AssistantDoneEvent as s, type AssistantErrorEvent as t, type AssistantErrorEventDetail as u, type AssistantInputRequestData as v, type AssistantInputRequestedDetail as w, type AssistantInputRequestedEvent as x, type AssistantInteractionResolvedDetail as y, type AssistantInteractionResolvedEvent as z };
234
+ export { type AssistantPageContext as A, type AssistantInteractionStatus as B, type CreateAssistantClientOptions as C, type AssistantJsonValue as D, type AssistantSessionResponse as E, type AssistantToolCompletedDetail as F, type AssistantToolCompletedEvent as G, type AssistantToolProposedDetail as H, type AssistantToolProposedEvent as I, type AssistantToolResultData as J, type AssistantToolStartedDetail as K, type AssistantToolStartedEvent as L, type AssistantUIDataTypes as M, type AssistantUIMessage as N, type AssistantUnrecognizedEvent as O, type AssistantViewData as P, createAssistantClient as Q, type AssistantContext as a, type AssistantChatState as b, type AssistantClient as c, type AssistantViewAvailableDetail as d, type AssistantModelContextUpdate as e, type AssistantClientEvent as f, type AssistantErrorDetail as g, type AssistantInteractionResponse as h, type AssistantEvent as i, type AssistantViewAvailableEvent as j, type AssistantChatError as k, type AssistantClientContext as l, AssistantClientError as m, type AssistantClientLifecycleEvent as n, type AssistantConfirmationData as o, type AssistantContentDetail as p, type AssistantContentEvent as q, type AssistantContextValue as r, type AssistantDoneEvent as s, type AssistantErrorEvent as t, type AssistantErrorEventDetail as u, type AssistantInputRequestData as v, type AssistantInputRequestedDetail as w, type AssistantInputRequestedEvent as x, type AssistantInteractionResolvedDetail as y, type AssistantInteractionResolvedEvent as z };
@@ -34,6 +34,10 @@ interface TurnDetail {
34
34
  interface AssistantContentDetail extends TurnDetail {
35
35
  readonly delta: string;
36
36
  }
37
+ interface AssistantToolStartedDetail extends TurnDetail {
38
+ readonly id: string;
39
+ readonly tool: string;
40
+ }
37
41
  interface AssistantToolProposedDetail extends TurnDetail {
38
42
  readonly id: string;
39
43
  readonly tool: string;
@@ -83,6 +87,7 @@ interface AssistantErrorEventDetail extends TurnDetail {
83
87
  readonly retryable?: boolean;
84
88
  }
85
89
  type AssistantContentEvent = NamedEvent<'content', AssistantContentDetail>;
90
+ type AssistantToolStartedEvent = NamedEvent<'tool_started', AssistantToolStartedDetail>;
86
91
  type AssistantToolProposedEvent = NamedEvent<'tool_proposed', AssistantToolProposedDetail>;
87
92
  type AssistantInputRequestedEvent = NamedEvent<'input_requested', AssistantInputRequestedDetail>;
88
93
  type AssistantInteractionResolvedEvent = NamedEvent<'interaction_resolved', AssistantInteractionResolvedDetail>;
@@ -121,7 +126,7 @@ interface AssistantUnrecognizedEvent {
121
126
  };
122
127
  }
123
128
  /** Closed event union for the DOM-free client; unknown future SSE names remain observable safely. */
124
- type AssistantClientEvent = AssistantContentEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
129
+ type AssistantClientEvent = AssistantContentEvent | AssistantToolStartedEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
125
130
 
126
131
  type AssistantInteractionStatus = 'pending' | 'submitting' | 'accepted' | 'declined' | 'cancelled';
127
132
  interface AssistantConfirmationData {
@@ -226,4 +231,4 @@ declare class AssistantClientError extends Error {
226
231
  }
227
232
  declare function createAssistantClient<TPageContext extends AssistantPageContext = AssistantContext>(options: CreateAssistantClientOptions<TPageContext>): AssistantClient<TPageContext>;
228
233
 
229
- export { type AssistantPageContext as A, type AssistantInteractionStatus as B, type CreateAssistantClientOptions as C, type AssistantJsonValue as D, type AssistantSessionResponse as E, type AssistantToolCompletedDetail as F, type AssistantToolCompletedEvent as G, type AssistantToolProposedDetail as H, type AssistantToolProposedEvent as I, type AssistantToolResultData as J, type AssistantUIDataTypes as K, type AssistantUIMessage as L, type AssistantUnrecognizedEvent as M, type AssistantViewData as N, createAssistantClient as O, type AssistantContext as a, type AssistantChatState as b, type AssistantClient as c, type AssistantViewAvailableDetail as d, type AssistantModelContextUpdate as e, type AssistantClientEvent as f, type AssistantErrorDetail as g, type AssistantInteractionResponse as h, type AssistantEvent as i, type AssistantViewAvailableEvent as j, type AssistantChatError as k, type AssistantClientContext as l, AssistantClientError as m, type AssistantClientLifecycleEvent as n, type AssistantConfirmationData as o, type AssistantContentDetail as p, type AssistantContentEvent as q, type AssistantContextValue as r, type AssistantDoneEvent as s, type AssistantErrorEvent as t, type AssistantErrorEventDetail as u, type AssistantInputRequestData as v, type AssistantInputRequestedDetail as w, type AssistantInputRequestedEvent as x, type AssistantInteractionResolvedDetail as y, type AssistantInteractionResolvedEvent as z };
234
+ export { type AssistantPageContext as A, type AssistantInteractionStatus as B, type CreateAssistantClientOptions as C, type AssistantJsonValue as D, type AssistantSessionResponse as E, type AssistantToolCompletedDetail as F, type AssistantToolCompletedEvent as G, type AssistantToolProposedDetail as H, type AssistantToolProposedEvent as I, type AssistantToolResultData as J, type AssistantToolStartedDetail as K, type AssistantToolStartedEvent as L, type AssistantUIDataTypes as M, type AssistantUIMessage as N, type AssistantUnrecognizedEvent as O, type AssistantViewData as P, createAssistantClient as Q, type AssistantContext as a, type AssistantChatState as b, type AssistantClient as c, type AssistantViewAvailableDetail as d, type AssistantModelContextUpdate as e, type AssistantClientEvent as f, type AssistantErrorDetail as g, type AssistantInteractionResponse as h, type AssistantEvent as i, type AssistantViewAvailableEvent as j, type AssistantChatError as k, type AssistantClientContext as l, AssistantClientError as m, type AssistantClientLifecycleEvent as n, type AssistantConfirmationData as o, type AssistantContentDetail as p, type AssistantContentEvent as q, type AssistantContextValue as r, type AssistantDoneEvent as s, type AssistantErrorEvent as t, type AssistantErrorEventDetail as u, type AssistantInputRequestData as v, type AssistantInputRequestedDetail as w, type AssistantInputRequestedEvent as x, type AssistantInteractionResolvedDetail as y, type AssistantInteractionResolvedEvent as z };
package/dist/client.cjs CHANGED
@@ -22895,6 +22895,11 @@ function toAssistantClientEvent(event) {
22895
22895
  return event;
22896
22896
  }
22897
22897
  break;
22898
+ case "tool_started":
22899
+ if (hasString(value, "id") && hasString(value, "tool") && hasOptionalTurnId(value)) {
22900
+ return event;
22901
+ }
22902
+ break;
22898
22903
  case "tool_proposed":
22899
22904
  if (hasString(value, "id") && hasString(value, "tool") && hasOptionalString(value.title) && hasOptionalString(value.description) && hasOptionalJson(value.arguments) && (value.reviewSchema === void 0 || isRecord2(value.reviewSchema)) && hasOptionalString(value.expiresAt) && (value.requiresConfirmation === void 0 || value.requiresConfirmation === true) && hasOptionalTurnId(value)) {
22900
22905
  return event;