@runtypelabs/persona 3.26.0 → 3.27.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.
@@ -701,6 +701,556 @@ interface AgentWidgetPlugin {
701
701
  onUnregister?: () => void;
702
702
  }
703
703
 
704
+ type RuntypeAgentSSEEvent = {
705
+ agentId: string;
706
+ agentName: string;
707
+ config?: {
708
+ enableReflection?: boolean;
709
+ model?: string;
710
+ };
711
+ executionId: string;
712
+ maxTurns: number;
713
+ seq: number;
714
+ startedAt: string;
715
+ type: "agent_start";
716
+ } | {
717
+ executionId: string;
718
+ iteration: number;
719
+ maxTurns: number;
720
+ seq: number;
721
+ startedAt: string;
722
+ totalCost?: number;
723
+ type: "agent_iteration_start";
724
+ } | ({
725
+ executionId: string;
726
+ iteration: number;
727
+ role: "user" | "assistant" | "system";
728
+ seq: number;
729
+ turnId: string;
730
+ turnIndex: number;
731
+ type: "agent_turn_start";
732
+ }) | ({
733
+ contentType: "text" | "thinking" | "tool_input";
734
+ delta: string;
735
+ executionId: string;
736
+ iteration: number;
737
+ seq: number;
738
+ turnId: string;
739
+ type: "agent_turn_delta";
740
+ }) | ({
741
+ completedAt: string;
742
+ content?: string;
743
+ cost?: number;
744
+ estimatedContextBreakdown?: {
745
+ categories: Record<string, {
746
+ chars: number;
747
+ estimatedTokens: number;
748
+ }>;
749
+ contextWindowSize?: number;
750
+ estimatedTotalTokens: number;
751
+ estimatedUtilizationPercent?: number;
752
+ };
753
+ executionId: string;
754
+ iteration: number;
755
+ role: "user" | "assistant" | "system";
756
+ seq: number;
757
+ stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
758
+ tokens?: {
759
+ input: number;
760
+ output: number;
761
+ };
762
+ turnId: string;
763
+ type: "agent_turn_complete";
764
+ }) | ({
765
+ executionId: string;
766
+ iteration: number;
767
+ origin?: "webmcp" | "sdk";
768
+ pageOrigin?: string;
769
+ parameters?: Record<string, unknown>;
770
+ seq: number;
771
+ toolCallId: string;
772
+ toolName: string;
773
+ toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local";
774
+ type: "agent_tool_start";
775
+ }) | {
776
+ delta: string;
777
+ executionId: string;
778
+ iteration: number;
779
+ seq: number;
780
+ toolCallId: string;
781
+ type: "agent_tool_delta";
782
+ } | {
783
+ delta: string;
784
+ executionId: string;
785
+ iteration: number;
786
+ seq: number;
787
+ toolCallId: string;
788
+ type: "agent_tool_input_delta";
789
+ } | {
790
+ executionId: string;
791
+ hiddenParameterNames?: Array<string>;
792
+ iteration: number;
793
+ parameters: Record<string, unknown>;
794
+ seq: number;
795
+ toolCallId: string;
796
+ toolName: string;
797
+ type: "agent_tool_input_complete";
798
+ } | {
799
+ executionId: string;
800
+ executionTime?: number;
801
+ iteration: number;
802
+ result?: unknown;
803
+ seq: number;
804
+ success: boolean;
805
+ toolCallId: string;
806
+ toolName: string;
807
+ type: "agent_tool_complete";
808
+ } | ({
809
+ executionId?: string;
810
+ iteration: number;
811
+ media: Array<({
812
+ annotations?: {
813
+ audience?: Array<"user" | "assistant">;
814
+ };
815
+ data: string;
816
+ mediaType: string;
817
+ type: "media";
818
+ }) | ({
819
+ annotations?: {
820
+ audience?: Array<"user" | "assistant">;
821
+ };
822
+ mediaType?: string;
823
+ type: "image-url";
824
+ url: string;
825
+ }) | ({
826
+ annotations?: {
827
+ audience?: Array<"user" | "assistant">;
828
+ };
829
+ mediaType: string;
830
+ type: "file-url";
831
+ url: string;
832
+ })>;
833
+ seq?: number;
834
+ toolCallId: string;
835
+ toolName: string;
836
+ type: "agent_media";
837
+ }) | {
838
+ approvalId: string;
839
+ description: string;
840
+ executionId: string;
841
+ externalAgent?: {
842
+ contextId?: string;
843
+ taskId?: string;
844
+ };
845
+ iteration?: number;
846
+ parameters?: Record<string, unknown>;
847
+ seq: number;
848
+ startedAt: string;
849
+ timeout: number;
850
+ toolCallId: string;
851
+ toolName: string;
852
+ toolType: string;
853
+ type: "agent_approval_start";
854
+ } | ({
855
+ approvalId: string;
856
+ completedAt: string;
857
+ decision: "approved" | "denied" | "timeout";
858
+ executionId: string;
859
+ resolvedBy: "user" | "system";
860
+ seq: number;
861
+ type: "agent_approval_complete";
862
+ }) | ({
863
+ awaitedAt: string;
864
+ executionId: string;
865
+ origin?: "webmcp" | "sdk";
866
+ pageOrigin?: string;
867
+ parameters?: Record<string, unknown>;
868
+ seq: number;
869
+ toolCallId?: string;
870
+ toolId: string;
871
+ toolName: string;
872
+ type: "agent_await";
873
+ }) | {
874
+ completedAt: string;
875
+ cost?: number;
876
+ duration?: number;
877
+ estimatedContextBreakdown?: {
878
+ categories: Record<string, {
879
+ chars: number;
880
+ estimatedTokens: number;
881
+ }>;
882
+ contextWindowSize?: number;
883
+ estimatedTotalTokens: number;
884
+ estimatedUtilizationPercent?: number;
885
+ };
886
+ executionId: string;
887
+ iteration: number;
888
+ output?: string;
889
+ runningTotalCost?: number;
890
+ seq: number;
891
+ stopConditionMet: boolean;
892
+ tokens?: {
893
+ input: number;
894
+ output: number;
895
+ };
896
+ toolCallsMade: number;
897
+ type: "agent_iteration_complete";
898
+ } | {
899
+ executionId: string;
900
+ iteration: number;
901
+ reflection?: string;
902
+ seq: number;
903
+ type: "agent_reflection";
904
+ } | {
905
+ activatedCapabilities: Array<string>;
906
+ executionId: string;
907
+ iteration: number;
908
+ seq: number;
909
+ skill: string;
910
+ toolCallId: string;
911
+ type: "agent_skill_loaded";
912
+ } | ({
913
+ executionId: string;
914
+ iteration: number;
915
+ outcome: "pending_approval" | "auto_published";
916
+ proposalId?: string;
917
+ seq: number;
918
+ skill: string;
919
+ toolCallId: string;
920
+ type: "agent_skill_proposed";
921
+ }) | ({
922
+ agentId: string;
923
+ completedAt: string;
924
+ duration?: number;
925
+ error?: string;
926
+ executionId: string;
927
+ externalAgent?: {
928
+ contextId?: string;
929
+ taskId?: string;
930
+ };
931
+ finalOutput?: string;
932
+ iterations: number;
933
+ seq: number;
934
+ stopReason: "complete" | "end_turn" | "max_turns" | "max_cost" | "timeout" | "error";
935
+ success: boolean;
936
+ totalCost?: number;
937
+ totalTokens?: {
938
+ input: number;
939
+ output: number;
940
+ };
941
+ type: "agent_complete";
942
+ }) | {
943
+ error: {
944
+ code: string;
945
+ details?: Record<string, unknown>;
946
+ message: string;
947
+ };
948
+ executionId: string;
949
+ iteration?: number;
950
+ recoverable: boolean;
951
+ seq: number;
952
+ type: "agent_error";
953
+ } | {
954
+ executionId: string;
955
+ seq: number;
956
+ timestamp: string;
957
+ type: "agent_ping";
958
+ };
959
+ type RuntypeFlowSSEEvent = {
960
+ executionContext?: Record<string, unknown>;
961
+ executionId?: string;
962
+ flowId: string;
963
+ flowName?: string;
964
+ input?: unknown;
965
+ seq?: number;
966
+ source?: string;
967
+ startedAt: string;
968
+ toolContext?: {
969
+ executionId: string;
970
+ stepId: string;
971
+ toolId: string;
972
+ };
973
+ totalSteps?: number;
974
+ type: "flow_start";
975
+ } | {
976
+ completedAt?: string;
977
+ completedSteps?: number;
978
+ duration?: number;
979
+ executionContext?: Record<string, unknown>;
980
+ executionId?: string;
981
+ executionTime?: number;
982
+ failedSteps?: number;
983
+ finalOutput?: string;
984
+ flowId?: string;
985
+ output?: unknown;
986
+ seq?: number;
987
+ source?: string;
988
+ success?: boolean;
989
+ successfulSteps?: number;
990
+ toolContext?: {
991
+ executionId: string;
992
+ stepId: string;
993
+ toolId: string;
994
+ };
995
+ totalSteps?: number;
996
+ totalTokensUsed?: number;
997
+ type: "flow_complete";
998
+ } | ({
999
+ code?: string;
1000
+ error: string | {
1001
+ code: string;
1002
+ message: string;
1003
+ stepId?: string;
1004
+ stepType?: string;
1005
+ };
1006
+ executionId?: string;
1007
+ executionTime?: number;
1008
+ flowId?: string;
1009
+ seq?: number;
1010
+ timestamp?: string;
1011
+ toolContext?: {
1012
+ executionId: string;
1013
+ stepId: string;
1014
+ toolId: string;
1015
+ };
1016
+ type: "flow_error";
1017
+ upgradeUrl?: string;
1018
+ }) | ({
1019
+ awaitedAt: string;
1020
+ executionId?: string;
1021
+ flowId: string;
1022
+ origin?: "webmcp" | "sdk";
1023
+ pageOrigin?: string;
1024
+ parameters?: Record<string, unknown>;
1025
+ seq?: number;
1026
+ toolCallId?: string;
1027
+ toolId?: string;
1028
+ toolName?: string;
1029
+ type: "flow_await";
1030
+ }) | {
1031
+ estimatedTokens?: number;
1032
+ executionId?: string;
1033
+ id?: string;
1034
+ index?: number;
1035
+ name?: string;
1036
+ seq?: number;
1037
+ startedAt: string;
1038
+ stepId?: string;
1039
+ stepName?: string;
1040
+ stepType?: string;
1041
+ toolContext?: {
1042
+ executionId: string;
1043
+ stepId: string;
1044
+ toolId: string;
1045
+ };
1046
+ totalSteps?: number;
1047
+ type: "step_start";
1048
+ } | {
1049
+ delta?: string;
1050
+ executionId?: string;
1051
+ id?: string;
1052
+ messageId?: string;
1053
+ partId?: string;
1054
+ seq?: number;
1055
+ text?: string;
1056
+ toolContext?: {
1057
+ executionId: string;
1058
+ stepId: string;
1059
+ toolId: string;
1060
+ };
1061
+ toolId?: string;
1062
+ type: "step_delta";
1063
+ } | ({
1064
+ completedAt?: string;
1065
+ duration?: number;
1066
+ durationMs?: number;
1067
+ error?: string;
1068
+ executionId?: string;
1069
+ executionTime?: number;
1070
+ id?: string;
1071
+ index?: number;
1072
+ name?: string;
1073
+ output?: unknown;
1074
+ result?: unknown;
1075
+ seq?: number;
1076
+ stepId?: string;
1077
+ stepName?: string;
1078
+ stepType?: string;
1079
+ stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
1080
+ success?: boolean;
1081
+ tokensUsed?: number;
1082
+ toolContext?: {
1083
+ executionId: string;
1084
+ stepId: string;
1085
+ toolId: string;
1086
+ };
1087
+ type: "step_complete";
1088
+ }) | {
1089
+ error: string;
1090
+ executionId?: string;
1091
+ executionTime?: number;
1092
+ id?: string;
1093
+ index?: number;
1094
+ name?: string;
1095
+ seq?: number;
1096
+ stepType?: string;
1097
+ type: "step_error";
1098
+ } | {
1099
+ error?: string;
1100
+ executionId?: string;
1101
+ id: string;
1102
+ index?: number;
1103
+ name?: string;
1104
+ seq?: number;
1105
+ skippedAt: string;
1106
+ stepType: string;
1107
+ totalSteps: number;
1108
+ type: "step_skip";
1109
+ when: string;
1110
+ } | {
1111
+ executionId?: string;
1112
+ seq?: number;
1113
+ type: "step_await";
1114
+ [key: string]: unknown;
1115
+ } | ({
1116
+ agentContext?: {
1117
+ executionId: string;
1118
+ iteration: number;
1119
+ seq: number;
1120
+ };
1121
+ executionId?: string;
1122
+ hiddenParameterNames?: Array<string>;
1123
+ name?: string;
1124
+ parameters?: Record<string, unknown>;
1125
+ providerOptions?: Record<string, unknown>;
1126
+ seq?: number;
1127
+ startedAt?: string;
1128
+ stepId?: string;
1129
+ toolCallId?: string;
1130
+ toolId?: string;
1131
+ toolName?: string;
1132
+ toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local";
1133
+ type: "tool_start";
1134
+ [key: string]: unknown;
1135
+ }) | {
1136
+ delta?: string;
1137
+ executionId?: string;
1138
+ seq?: number;
1139
+ toolId?: string;
1140
+ type: "tool_delta";
1141
+ [key: string]: unknown;
1142
+ } | {
1143
+ delta: string;
1144
+ executionId?: string;
1145
+ seq?: number;
1146
+ stepId?: string;
1147
+ toolCallId?: string;
1148
+ toolId?: string;
1149
+ type: "tool_input_delta";
1150
+ } | {
1151
+ executionId?: string;
1152
+ hiddenParameterNames?: Array<string>;
1153
+ parameters: Record<string, unknown>;
1154
+ providerOptions?: Record<string, unknown>;
1155
+ seq?: number;
1156
+ stepId?: string;
1157
+ toolCallId?: string;
1158
+ toolId?: string;
1159
+ toolName?: string;
1160
+ type: "tool_input_complete";
1161
+ } | {
1162
+ agentContext?: {
1163
+ executionId: string;
1164
+ iteration: number;
1165
+ seq: number;
1166
+ };
1167
+ completedAt?: string;
1168
+ error?: string;
1169
+ executionId?: string;
1170
+ executionTime?: number;
1171
+ name?: string;
1172
+ result?: unknown;
1173
+ seq?: number;
1174
+ stepId?: string;
1175
+ success: boolean;
1176
+ toolCallId?: string;
1177
+ toolCost?: number;
1178
+ toolId?: string;
1179
+ toolName?: string;
1180
+ type: "tool_complete";
1181
+ } | {
1182
+ agentContext?: {
1183
+ executionId: string;
1184
+ iteration: number;
1185
+ seq: number;
1186
+ };
1187
+ error: string;
1188
+ executionId?: string;
1189
+ executionTime?: number;
1190
+ failedAt?: string;
1191
+ name: string;
1192
+ seq?: number;
1193
+ toolId: string;
1194
+ type: "tool_error";
1195
+ } | {
1196
+ executionId?: string;
1197
+ id: string;
1198
+ seq?: number;
1199
+ text: string;
1200
+ type: "chunk";
1201
+ } | {
1202
+ executionId?: string;
1203
+ seq?: number;
1204
+ type: "text_start";
1205
+ [key: string]: unknown;
1206
+ } | {
1207
+ executionId?: string;
1208
+ seq?: number;
1209
+ type: "text_end";
1210
+ [key: string]: unknown;
1211
+ } | {
1212
+ executionId?: string;
1213
+ seq?: number;
1214
+ type: "reason_start";
1215
+ [key: string]: unknown;
1216
+ } | {
1217
+ executionId?: string;
1218
+ seq?: number;
1219
+ type: "reason_delta";
1220
+ [key: string]: unknown;
1221
+ } | {
1222
+ executionId?: string;
1223
+ seq?: number;
1224
+ type: "reason_complete";
1225
+ [key: string]: unknown;
1226
+ } | {
1227
+ executionId?: string;
1228
+ seq?: number;
1229
+ type: "source";
1230
+ [key: string]: unknown;
1231
+ } | {
1232
+ executionId?: string;
1233
+ seq?: number;
1234
+ type: "fallback_start";
1235
+ [key: string]: unknown;
1236
+ } | {
1237
+ executionId?: string;
1238
+ seq?: number;
1239
+ type: "fallback_complete";
1240
+ [key: string]: unknown;
1241
+ } | {
1242
+ executionId?: string;
1243
+ seq?: number;
1244
+ type: "fallback_exhausted";
1245
+ [key: string]: unknown;
1246
+ };
1247
+ type RuntypeStreamEventOf<U, T extends string> = Extract<U, {
1248
+ type: T;
1249
+ }>;
1250
+ type RuntypeAgentTurnCompleteEvent = RuntypeStreamEventOf<RuntypeAgentSSEEvent, "agent_turn_complete">;
1251
+ type RuntypeStepCompleteEvent = RuntypeStreamEventOf<RuntypeFlowSSEEvent, "step_complete">;
1252
+ type RuntypeStopReasonKind = NonNullable<RuntypeAgentTurnCompleteEvent["stopReason"] | RuntypeStepCompleteEvent["stopReason"]>;
1253
+
704
1254
  /**
705
1255
  * Text content part for multi-modal messages
706
1256
  */
@@ -4103,7 +4653,7 @@ type AgentWidgetMessageVariant = "assistant" | "reasoning" | "tool" | "approval"
4103
4653
  *
4104
4654
  * Absent (`undefined`) means "not reported" — distinct from `'unknown'`.
4105
4655
  */
4106
- type StopReasonKind = 'end_turn' | 'max_tool_calls' | 'length' | 'content_filter' | 'error' | 'unknown';
4656
+ type StopReasonKind = RuntypeStopReasonKind;
4107
4657
  /**
4108
4658
  * Represents a message in the chat conversation.
4109
4659
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/persona",
3
- "version": "3.26.0",
3
+ "version": "3.27.0",
4
4
  "description": "Themeable, pluggable streaming agent widget for websites, in plain JS with support for voice input and reasoning / tool output.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -99,7 +99,7 @@
99
99
  "access": "public"
100
100
  },
101
101
  "scripts": {
102
- "build": "rimraf dist && pnpm run build:styles && pnpm run build:client && pnpm run build:installer && pnpm run build:theme-ref && pnpm run build:theme-editor && pnpm run build:testing && pnpm run build:smart-dom-reader && pnpm run build:animations",
102
+ "build": "rimraf dist && pnpm run build:styles && pnpm run build:client && pnpm run build:installer && pnpm run build:launcher && pnpm run build:theme-ref && pnpm run build:theme-editor && pnpm run build:testing && pnpm run build:smart-dom-reader && pnpm run build:animations",
103
103
  "build:theme-editor": "tsup src/theme-editor.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting",
104
104
  "build:testing": "tsup src/testing.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting",
105
105
  "build:smart-dom-reader": "tsup src/smart-dom-reader.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting",
@@ -108,11 +108,15 @@
108
108
  "build:styles": "node -e \"const fs=require('fs');fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('src/styles/widget.css','dist/widget.css');\"",
109
109
  "build:client": "tsup src/index.ts --format esm,cjs --minify --sourcemap --splitting false --dts --loader \".css=text\" && tsup src/index-global.ts --format iife --global-name AgentWidget --minify --sourcemap --splitting false --out-dir dist --loader \".css=text\" && node -e \"const fs=require('fs');for(const ext of ['.global.js','.global.js.map']){const from='dist/index-global'+ext;if(fs.existsSync(from))fs.renameSync(from,'dist/index'+ext);}\"",
110
110
  "build:installer": "tsup src/install.ts --format iife --global-name SiteAgentInstaller --out-dir dist --minify --sourcemap --no-splitting",
111
+ "build:launcher": "tsup src/launcher-global.ts --format iife --global-name AgentWidgetLauncher --minify --sourcemap --splitting false --out-dir dist && node -e \"const fs=require('fs');for(const ext of ['.global.js','.global.js.map']){const from='dist/launcher-global'+ext;if(fs.existsSync(from))fs.renameSync(from,'dist/launcher'+ext);}\"",
111
112
  "lint": "eslint . --ext .ts",
112
- "typecheck": "tsc --noEmit",
113
+ "typecheck": "pnpm run check:runtype-types && tsc --noEmit",
113
114
  "test": "vitest",
114
115
  "test:ui": "vitest --ui",
115
116
  "test:run": "vitest run",
116
- "size": "size-limit"
117
+ "size": "size-limit",
118
+ "fetch:runtype-openapi": "node scripts/fetch-runtype-openapi.mjs",
119
+ "generate:runtype-types": "pnpm run fetch:runtype-openapi && node scripts/generate-runtype-openapi-types.mjs",
120
+ "check:runtype-types": "pnpm run fetch:runtype-openapi && node scripts/generate-runtype-openapi-types.mjs --check"
117
121
  }
118
122
  }
@@ -3146,7 +3146,7 @@ describe('AgentWidgetClient.resumeFlow', () => {
3146
3146
 
3147
3147
  const client = new AgentWidgetClient({
3148
3148
  clientToken: 'ct_live_demo',
3149
- apiUrl: 'https://api.runtype-staging.com',
3149
+ apiUrl: 'https://api.runtype.com',
3150
3150
  });
3151
3151
  // Simulate an initialized client session (resumeFlow reads sessionId off it).
3152
3152
  (client as unknown as { clientSession: { sessionId: string; expiresAt: Date } }).clientSession = {
@@ -3157,7 +3157,7 @@ describe('AgentWidgetClient.resumeFlow', () => {
3157
3157
  await client.resumeFlow('exec_xyz', { toolu_A: { ok: true } });
3158
3158
 
3159
3159
  // Session-authed sibling of /v1/client/chat — no Bearer key, sessionId in body.
3160
- expect(capturedUrl).toBe('https://api.runtype-staging.com/v1/client/resume');
3160
+ expect(capturedUrl).toBe('https://api.runtype.com/v1/client/resume');
3161
3161
  expect(capturedBody).toEqual({
3162
3162
  executionId: 'exec_xyz',
3163
3163
  toolOutputs: { toolu_A: { ok: true } },
@@ -3176,7 +3176,7 @@ describe('AgentWidgetClient.resumeFlow', () => {
3176
3176
 
3177
3177
  const client = new AgentWidgetClient({
3178
3178
  clientToken: 'ct_live_demo',
3179
- apiUrl: 'https://api.runtype-staging.com/v1/dispatch',
3179
+ apiUrl: 'https://api.runtype.com/v1/dispatch',
3180
3180
  });
3181
3181
  // A live session so initSession() short-circuits instead of fetching /init.
3182
3182
  (client as unknown as { clientSession: { sessionId: string; expiresAt: Date } }).clientSession = {
@@ -3185,7 +3185,7 @@ describe('AgentWidgetClient.resumeFlow', () => {
3185
3185
  };
3186
3186
  await client.resumeFlow('exec_abc', {});
3187
3187
 
3188
- expect(capturedUrl).toBe('https://api.runtype-staging.com/v1/client/resume');
3188
+ expect(capturedUrl).toBe('https://api.runtype.com/v1/client/resume');
3189
3189
  });
3190
3190
 
3191
3191
  it('refreshes the session via initSession() before resuming when stale (BugBot r3367875360)', async () => {
@@ -3197,7 +3197,7 @@ describe('AgentWidgetClient.resumeFlow', () => {
3197
3197
 
3198
3198
  const client = new AgentWidgetClient({
3199
3199
  clientToken: 'ct_live_demo',
3200
- apiUrl: 'https://api.runtype-staging.com',
3200
+ apiUrl: 'https://api.runtype.com',
3201
3201
  });
3202
3202
  // A stale session that has already expired — a long WebMCP approval wait can
3203
3203
  // outlive it, so resumeFlow must not trust this.clientSession directly.
@@ -3846,7 +3846,7 @@ describe('AgentWidgetClient - diff-only clientTools (client-token)', () => {
3846
3846
  function makeClient(tools: unknown[]) {
3847
3847
  const client = new AgentWidgetClient({
3848
3848
  clientToken: 'ct_live_demo',
3849
- apiUrl: 'https://api.runtype-staging.com',
3849
+ apiUrl: 'https://api.runtype.com',
3850
3850
  });
3851
3851
  (client as unknown as { clientSession: { sessionId: string; expiresAt: Date } }).clientSession = {
3852
3852
  sessionId: 'cs_diff_1',
@@ -3904,7 +3904,7 @@ describe('AgentWidgetClient - diff-only clientTools (client-token)', () => {
3904
3904
  const live = [...TOOLS];
3905
3905
  const client = new AgentWidgetClient({
3906
3906
  clientToken: 'ct_live_demo',
3907
- apiUrl: 'https://api.runtype-staging.com',
3907
+ apiUrl: 'https://api.runtype.com',
3908
3908
  });
3909
3909
  (client as unknown as { clientSession: { sessionId: string; expiresAt: Date } }).clientSession = {
3910
3910
  sessionId: 'cs_diff_1',
@@ -3931,7 +3931,7 @@ describe('AgentWidgetClient - diff-only clientTools (client-token)', () => {
3931
3931
  ];
3932
3932
  const client = new AgentWidgetClient({
3933
3933
  clientToken: 'ct_live_demo',
3934
- apiUrl: 'https://api.runtype-staging.com',
3934
+ apiUrl: 'https://api.runtype.com',
3935
3935
  });
3936
3936
  (client as unknown as { clientSession: { sessionId: string; expiresAt: Date } }).clientSession = {
3937
3937
  sessionId: 'cs_diff_1',
@@ -4027,7 +4027,7 @@ describe('AgentWidgetClient - diff-only clientTools (client-token)', () => {
4027
4027
  });
4028
4028
  const client = new AgentWidgetClient({
4029
4029
  clientToken: 'ct_live_demo',
4030
- apiUrl: 'https://api.runtype-staging.com',
4030
+ apiUrl: 'https://api.runtype.com',
4031
4031
  });
4032
4032
  // Pre-seed a stale fingerprint bound to a prior session (no live session, so
4033
4033
  // initSession() takes the mint path and fetches /client/init).