@alva-ai/toolkit 0.27.0 → 0.28.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1253,6 +1253,87 @@ declare class FeedResource {
1253
1253
  setVisibility(params: FeedSetVisibilityRequest): Promise<FeedSetVisibilityResponse>;
1254
1254
  }
1255
1255
 
1256
+ interface ForYouListParams {
1257
+ first?: number;
1258
+ after?: string;
1259
+ newerThan?: string;
1260
+ feedId?: string;
1261
+ }
1262
+ /** The immutable publication selection, not the full mutable Feed object. */
1263
+ interface ForYouEntry {
1264
+ id: string;
1265
+ feed: {
1266
+ id: string;
1267
+ };
1268
+ major: {
1269
+ id: string;
1270
+ feedId: string;
1271
+ number: number;
1272
+ };
1273
+ displayName: string | null;
1274
+ source: string;
1275
+ eventTimeMs: number;
1276
+ publishedAtMs: number;
1277
+ title: string;
1278
+ body: string;
1279
+ actions: {
1280
+ type: 'OPEN_URL' | 'SEND_PROMPT' | 'CONNECT_PORTFOLIO' | 'CONNECT_IM';
1281
+ label: string;
1282
+ url: string | null;
1283
+ prompt: string | null;
1284
+ }[];
1285
+ presentation: {
1286
+ card: {
1287
+ accentColor: string | null;
1288
+ url: string | null;
1289
+ thumbnailUrl: string | null;
1290
+ footer: string | null;
1291
+ fields: {
1292
+ label: string;
1293
+ value: string;
1294
+ inline: boolean;
1295
+ }[];
1296
+ } | null;
1297
+ } | null;
1298
+ tickers: {
1299
+ symbol: string;
1300
+ logoUrl: string;
1301
+ sentiment: 'BULLISH' | 'BEARISH' | 'ANOMALY' | null;
1302
+ }[];
1303
+ media: {
1304
+ type: 'PRICE_CHART' | 'IMAGE' | 'AUDIO' | 'VIDEO';
1305
+ coverUrl: string;
1306
+ url: string | null;
1307
+ }[];
1308
+ sources: {
1309
+ type: 'NEWS' | 'X' | 'REDDIT' | 'YOUTUBE' | 'PODCAST' | 'EARNINGS' | 'FILING' | 'WEB';
1310
+ url: string | null;
1311
+ iconUrl: string | null;
1312
+ title: string;
1313
+ subtitle: string | null;
1314
+ description: string | null;
1315
+ publishedAtMs: number;
1316
+ }[];
1317
+ }
1318
+ interface ForYouConnection {
1319
+ edges: {
1320
+ cursor: string;
1321
+ node: ForYouEntry;
1322
+ }[];
1323
+ pageInfo: {
1324
+ startCursor: string;
1325
+ endCursor: string;
1326
+ hasNextPage: boolean;
1327
+ hasPreviousPage: boolean;
1328
+ };
1329
+ }
1330
+ declare class ForYouResource {
1331
+ private client;
1332
+ constructor(client: AlvaClient);
1333
+ /** One newest-first page. Does not truncate content or advance a watermark. */
1334
+ list(params?: ForYouListParams): Promise<ForYouConnection>;
1335
+ }
1336
+
1256
1337
  /**
1257
1338
  * Product-facing automation API. Backed by the existing feed/release gateway
1258
1339
  * surfaces while those lower-level names remain on the wire for compatibility.
@@ -2186,6 +2267,7 @@ declare class AlvaClient {
2186
2267
  private _serviceAccount?;
2187
2268
  private _release?;
2188
2269
  private _feed?;
2270
+ private _forYou?;
2189
2271
  private _automation?;
2190
2272
  private _playbooks?;
2191
2273
  private _secrets?;
@@ -2242,6 +2324,7 @@ declare class AlvaClient {
2242
2324
  get tradingPairs(): TradingPairsResource;
2243
2325
  get schedules(): SchedulesResource;
2244
2326
  _requireAuth(): void;
2327
+ get forYou(): ForYouResource;
2245
2328
  _request(method: string, path: string, options?: RequestOptions): Promise<unknown>;
2246
2329
  }
2247
2330
 
@@ -2395,4 +2478,4 @@ declare const installPlaybookRuntime: (targetWindow?: Window) => void;
2395
2478
  /** SDK version, injected at build time from package.json. */
2396
2479
  declare const VERSION: string;
2397
2480
 
2398
- export { type AgentSchedule, type AgentScheduleBounds, type AgentScheduleFailureCode, type AgentScheduleRule, type AgentScheduleStatus, AlertsResource, AlvaClient, type AlvaClientConfig, AlvaError, type AutomationAlertDelivery, type AutomationAlertDeliveryGetRequest, AutomationAlertDeliveryResource, type AutomationAlertDeliveryUpdateRequest, type AutomationAlertDeliveryUpdateResponse, type AutomationEmailDelivery, AutomationResource, type ChannelGroupAdminInfo, type ChannelGroupCallerInfo, type ChannelGroupHistoryParams, type ChannelGroupHistoryResponse, type ChannelGroupSubscription, type ChannelGroupSubscriptionContextResponse, type ChannelGroupSubscriptionListResponse, type ChannelGroupSubscriptionMutationParams, type ChannelGroupSubscriptionMutationResponse, type ChannelGroupSubscriptionSessionParams, type ChannelGroupSubscriptionTarget, type ChannelGroupSubscriptionTargetType, CliUsageError, type CompanyEarningsCatalog, type CompanyEarningsContentStatus, type CompanyEarningsContext, type CompanyEarningsEvent, type CompanyEarningsParams, type CompanyEarningsPeriod, type CompanyEarningsRelease, type CompanyEarningsSession, type CompanyEarningsStatus, type CompanyEarningsTranscript, type CompanyEarningsTranscriptEntry, type CompanyEarningsTranscriptSection, type CompanyFiscalQuarter, type CompanyNarrative, type CompanyNarrativeChangeLogEntry, type CompanyNarrativeContext, type CompanyNarrativeHistory, type CompanyNarrativeSnapshot, type CompanyPostEarningsSummary, type CompanyPreEarningsAnalysis, type CreateAllowanceParams, type CreateAllowanceResponse, type CreditAllowance, type CreditWallet, type CreditWalletItem, type CreditWalletItemConnection, type CreditWalletItemEdge, type CreditWalletItemsParams, type CreditWalletItemsResponse, type CreditWalletPageInfo, type DeleteFunctionParams, type FeedDeleteRequest, type FeedDeleteResponse, type FeedListItem, type FeedListParams, type FeedListResponse, type FeedListStatus, type FeedStatusUpdateRequest, type FeedStatusUpdateResponse, type FollowPlaybookResponse, type FsChmodParams, type FsCopyParams, type FsEntry, type FsGrantParams, type FsMkdirParams, type FsRawWriteParams, type FsReadParams, type FsReaddirParams, type FsReaddirResponse, type FsReadlinkParams, type FsRemoveParams, type FsRenameParams, type FsRevokeParams, type FsStat, type FsSymlinkParams, type FsWriteParams, type FsWriteResponse, type GetAllowanceParams, type GroupChatMessage, type InvokeFunctionParams, type InvokeFunctionResponse, type ListAllowancesResponse, type ListFunctionsParams, type ListFunctionsResponse, type ManageAgentScheduleParams, MarketsResource, type NotificationPreference, type NotificationPreferenceKey, type NotificationPreferenceUpdateParams, type NotificationPreferenceUpdateResponse, type NotificationPreferencesResponse, PBSV_UPDATE_MESSAGE, type PlaybookFollowParams, type PlaybookFunction, type PlaybookSkillFile, type PlaybookSkillFileMeta, type PlaybookSkillMeta, type PlaybookSkillSummary, type PlaybookSkillTagEntry, type PutAgentScheduleParams, type RegisterFunctionParams, type RegisterFunctionResponse, type RevokeAllowanceParams, type RevokeAllowanceResponse, SUBSCRIBE_MANAGE_MESSAGE, SUBSCRIBE_PROPOSE_MESSAGE, SUBSCRIBE_RESULT_MESSAGE, SchedulesResource, type SkillDoc, type SkillEndpointMetadata, type SkillEndpointTier, type SkillMetadata, type SkillSummary, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SubscribeApi, type SubscribeBatchParams, type SubscribeBatchResponse, type SubscribeProposalInput, type SubscribeProposalResult, type TradingPairCandidate, type TradingPairSearchParams, type TradingPairSearchResponse, TradingPairsResource, type TrendingPlaybookItem, type TrendingPlaybooksDir, type TrendingPlaybooksParams, type TrendingPlaybooksResponse, type TrendingPlaybooksSort, UDF_AUTH_REQUIRED_MESSAGE, UDF_CONSENT_REQUEST_MESSAGE, UDF_CONSENT_RESPONSE_MESSAGE, type UdfApi, UdfAuthRequiredError, type UdfButtonEventDetail, type UdfButtonOptions, UdfConsentDeniedError, UdfConsentRequiredError, UdfConsentTimeoutError, type UdfDescriptor, UdfError, UdfExecutionError, UdfFunctionDisabledError, UdfFunctionNotFoundError, UdfInsufficientCredits, type UdfInvokeResponse, UdfPidMismatchError, UdfRateLimitedError, UdfTokenExpiredError, UdfTokenInvalidError, UdfTransportError, type UnfollowPlaybookResponse, type UnsubscribeBatchParams, type UnsubscribeBatchResponse, VERSION, getViewerToken, installPlaybookRuntime, mapUdfErrorResponse, playbookIdFromToken, subscribe, udf };
2481
+ export { type AgentSchedule, type AgentScheduleBounds, type AgentScheduleFailureCode, type AgentScheduleRule, type AgentScheduleStatus, AlertsResource, AlvaClient, type AlvaClientConfig, AlvaError, type AutomationAlertDelivery, type AutomationAlertDeliveryGetRequest, AutomationAlertDeliveryResource, type AutomationAlertDeliveryUpdateRequest, type AutomationAlertDeliveryUpdateResponse, type AutomationEmailDelivery, AutomationResource, type ChannelGroupAdminInfo, type ChannelGroupCallerInfo, type ChannelGroupHistoryParams, type ChannelGroupHistoryResponse, type ChannelGroupSubscription, type ChannelGroupSubscriptionContextResponse, type ChannelGroupSubscriptionListResponse, type ChannelGroupSubscriptionMutationParams, type ChannelGroupSubscriptionMutationResponse, type ChannelGroupSubscriptionSessionParams, type ChannelGroupSubscriptionTarget, type ChannelGroupSubscriptionTargetType, CliUsageError, type CompanyEarningsCatalog, type CompanyEarningsContentStatus, type CompanyEarningsContext, type CompanyEarningsEvent, type CompanyEarningsParams, type CompanyEarningsPeriod, type CompanyEarningsRelease, type CompanyEarningsSession, type CompanyEarningsStatus, type CompanyEarningsTranscript, type CompanyEarningsTranscriptEntry, type CompanyEarningsTranscriptSection, type CompanyFiscalQuarter, type CompanyNarrative, type CompanyNarrativeChangeLogEntry, type CompanyNarrativeContext, type CompanyNarrativeHistory, type CompanyNarrativeSnapshot, type CompanyPostEarningsSummary, type CompanyPreEarningsAnalysis, type CreateAllowanceParams, type CreateAllowanceResponse, type CreditAllowance, type CreditWallet, type CreditWalletItem, type CreditWalletItemConnection, type CreditWalletItemEdge, type CreditWalletItemsParams, type CreditWalletItemsResponse, type CreditWalletPageInfo, type DeleteFunctionParams, type FeedDeleteRequest, type FeedDeleteResponse, type FeedListItem, type FeedListParams, type FeedListResponse, type FeedListStatus, type FeedStatusUpdateRequest, type FeedStatusUpdateResponse, type FollowPlaybookResponse, type ForYouConnection, type ForYouEntry, type ForYouListParams, ForYouResource, type FsChmodParams, type FsCopyParams, type FsEntry, type FsGrantParams, type FsMkdirParams, type FsRawWriteParams, type FsReadParams, type FsReaddirParams, type FsReaddirResponse, type FsReadlinkParams, type FsRemoveParams, type FsRenameParams, type FsRevokeParams, type FsStat, type FsSymlinkParams, type FsWriteParams, type FsWriteResponse, type GetAllowanceParams, type GroupChatMessage, type InvokeFunctionParams, type InvokeFunctionResponse, type ListAllowancesResponse, type ListFunctionsParams, type ListFunctionsResponse, type ManageAgentScheduleParams, MarketsResource, type NotificationPreference, type NotificationPreferenceKey, type NotificationPreferenceUpdateParams, type NotificationPreferenceUpdateResponse, type NotificationPreferencesResponse, PBSV_UPDATE_MESSAGE, type PlaybookFollowParams, type PlaybookFunction, type PlaybookSkillFile, type PlaybookSkillFileMeta, type PlaybookSkillMeta, type PlaybookSkillSummary, type PlaybookSkillTagEntry, type PutAgentScheduleParams, type RegisterFunctionParams, type RegisterFunctionResponse, type RevokeAllowanceParams, type RevokeAllowanceResponse, SUBSCRIBE_MANAGE_MESSAGE, SUBSCRIBE_PROPOSE_MESSAGE, SUBSCRIBE_RESULT_MESSAGE, SchedulesResource, type SkillDoc, type SkillEndpointMetadata, type SkillEndpointTier, type SkillMetadata, type SkillSummary, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SubscribeApi, type SubscribeBatchParams, type SubscribeBatchResponse, type SubscribeProposalInput, type SubscribeProposalResult, type TradingPairCandidate, type TradingPairSearchParams, type TradingPairSearchResponse, TradingPairsResource, type TrendingPlaybookItem, type TrendingPlaybooksDir, type TrendingPlaybooksParams, type TrendingPlaybooksResponse, type TrendingPlaybooksSort, UDF_AUTH_REQUIRED_MESSAGE, UDF_CONSENT_REQUEST_MESSAGE, UDF_CONSENT_RESPONSE_MESSAGE, type UdfApi, UdfAuthRequiredError, type UdfButtonEventDetail, type UdfButtonOptions, UdfConsentDeniedError, UdfConsentRequiredError, UdfConsentTimeoutError, type UdfDescriptor, UdfError, UdfExecutionError, UdfFunctionDisabledError, UdfFunctionNotFoundError, UdfInsufficientCredits, type UdfInvokeResponse, UdfPidMismatchError, UdfRateLimitedError, UdfTokenExpiredError, UdfTokenInvalidError, UdfTransportError, type UnfollowPlaybookResponse, type UnsubscribeBatchParams, type UnsubscribeBatchResponse, VERSION, getViewerToken, installPlaybookRuntime, mapUdfErrorResponse, playbookIdFromToken, subscribe, udf };
package/dist/index.d.ts CHANGED
@@ -1253,6 +1253,87 @@ declare class FeedResource {
1253
1253
  setVisibility(params: FeedSetVisibilityRequest): Promise<FeedSetVisibilityResponse>;
1254
1254
  }
1255
1255
 
1256
+ interface ForYouListParams {
1257
+ first?: number;
1258
+ after?: string;
1259
+ newerThan?: string;
1260
+ feedId?: string;
1261
+ }
1262
+ /** The immutable publication selection, not the full mutable Feed object. */
1263
+ interface ForYouEntry {
1264
+ id: string;
1265
+ feed: {
1266
+ id: string;
1267
+ };
1268
+ major: {
1269
+ id: string;
1270
+ feedId: string;
1271
+ number: number;
1272
+ };
1273
+ displayName: string | null;
1274
+ source: string;
1275
+ eventTimeMs: number;
1276
+ publishedAtMs: number;
1277
+ title: string;
1278
+ body: string;
1279
+ actions: {
1280
+ type: 'OPEN_URL' | 'SEND_PROMPT' | 'CONNECT_PORTFOLIO' | 'CONNECT_IM';
1281
+ label: string;
1282
+ url: string | null;
1283
+ prompt: string | null;
1284
+ }[];
1285
+ presentation: {
1286
+ card: {
1287
+ accentColor: string | null;
1288
+ url: string | null;
1289
+ thumbnailUrl: string | null;
1290
+ footer: string | null;
1291
+ fields: {
1292
+ label: string;
1293
+ value: string;
1294
+ inline: boolean;
1295
+ }[];
1296
+ } | null;
1297
+ } | null;
1298
+ tickers: {
1299
+ symbol: string;
1300
+ logoUrl: string;
1301
+ sentiment: 'BULLISH' | 'BEARISH' | 'ANOMALY' | null;
1302
+ }[];
1303
+ media: {
1304
+ type: 'PRICE_CHART' | 'IMAGE' | 'AUDIO' | 'VIDEO';
1305
+ coverUrl: string;
1306
+ url: string | null;
1307
+ }[];
1308
+ sources: {
1309
+ type: 'NEWS' | 'X' | 'REDDIT' | 'YOUTUBE' | 'PODCAST' | 'EARNINGS' | 'FILING' | 'WEB';
1310
+ url: string | null;
1311
+ iconUrl: string | null;
1312
+ title: string;
1313
+ subtitle: string | null;
1314
+ description: string | null;
1315
+ publishedAtMs: number;
1316
+ }[];
1317
+ }
1318
+ interface ForYouConnection {
1319
+ edges: {
1320
+ cursor: string;
1321
+ node: ForYouEntry;
1322
+ }[];
1323
+ pageInfo: {
1324
+ startCursor: string;
1325
+ endCursor: string;
1326
+ hasNextPage: boolean;
1327
+ hasPreviousPage: boolean;
1328
+ };
1329
+ }
1330
+ declare class ForYouResource {
1331
+ private client;
1332
+ constructor(client: AlvaClient);
1333
+ /** One newest-first page. Does not truncate content or advance a watermark. */
1334
+ list(params?: ForYouListParams): Promise<ForYouConnection>;
1335
+ }
1336
+
1256
1337
  /**
1257
1338
  * Product-facing automation API. Backed by the existing feed/release gateway
1258
1339
  * surfaces while those lower-level names remain on the wire for compatibility.
@@ -2186,6 +2267,7 @@ declare class AlvaClient {
2186
2267
  private _serviceAccount?;
2187
2268
  private _release?;
2188
2269
  private _feed?;
2270
+ private _forYou?;
2189
2271
  private _automation?;
2190
2272
  private _playbooks?;
2191
2273
  private _secrets?;
@@ -2242,6 +2324,7 @@ declare class AlvaClient {
2242
2324
  get tradingPairs(): TradingPairsResource;
2243
2325
  get schedules(): SchedulesResource;
2244
2326
  _requireAuth(): void;
2327
+ get forYou(): ForYouResource;
2245
2328
  _request(method: string, path: string, options?: RequestOptions): Promise<unknown>;
2246
2329
  }
2247
2330
 
@@ -2395,4 +2478,4 @@ declare const installPlaybookRuntime: (targetWindow?: Window) => void;
2395
2478
  /** SDK version, injected at build time from package.json. */
2396
2479
  declare const VERSION: string;
2397
2480
 
2398
- export { type AgentSchedule, type AgentScheduleBounds, type AgentScheduleFailureCode, type AgentScheduleRule, type AgentScheduleStatus, AlertsResource, AlvaClient, type AlvaClientConfig, AlvaError, type AutomationAlertDelivery, type AutomationAlertDeliveryGetRequest, AutomationAlertDeliveryResource, type AutomationAlertDeliveryUpdateRequest, type AutomationAlertDeliveryUpdateResponse, type AutomationEmailDelivery, AutomationResource, type ChannelGroupAdminInfo, type ChannelGroupCallerInfo, type ChannelGroupHistoryParams, type ChannelGroupHistoryResponse, type ChannelGroupSubscription, type ChannelGroupSubscriptionContextResponse, type ChannelGroupSubscriptionListResponse, type ChannelGroupSubscriptionMutationParams, type ChannelGroupSubscriptionMutationResponse, type ChannelGroupSubscriptionSessionParams, type ChannelGroupSubscriptionTarget, type ChannelGroupSubscriptionTargetType, CliUsageError, type CompanyEarningsCatalog, type CompanyEarningsContentStatus, type CompanyEarningsContext, type CompanyEarningsEvent, type CompanyEarningsParams, type CompanyEarningsPeriod, type CompanyEarningsRelease, type CompanyEarningsSession, type CompanyEarningsStatus, type CompanyEarningsTranscript, type CompanyEarningsTranscriptEntry, type CompanyEarningsTranscriptSection, type CompanyFiscalQuarter, type CompanyNarrative, type CompanyNarrativeChangeLogEntry, type CompanyNarrativeContext, type CompanyNarrativeHistory, type CompanyNarrativeSnapshot, type CompanyPostEarningsSummary, type CompanyPreEarningsAnalysis, type CreateAllowanceParams, type CreateAllowanceResponse, type CreditAllowance, type CreditWallet, type CreditWalletItem, type CreditWalletItemConnection, type CreditWalletItemEdge, type CreditWalletItemsParams, type CreditWalletItemsResponse, type CreditWalletPageInfo, type DeleteFunctionParams, type FeedDeleteRequest, type FeedDeleteResponse, type FeedListItem, type FeedListParams, type FeedListResponse, type FeedListStatus, type FeedStatusUpdateRequest, type FeedStatusUpdateResponse, type FollowPlaybookResponse, type FsChmodParams, type FsCopyParams, type FsEntry, type FsGrantParams, type FsMkdirParams, type FsRawWriteParams, type FsReadParams, type FsReaddirParams, type FsReaddirResponse, type FsReadlinkParams, type FsRemoveParams, type FsRenameParams, type FsRevokeParams, type FsStat, type FsSymlinkParams, type FsWriteParams, type FsWriteResponse, type GetAllowanceParams, type GroupChatMessage, type InvokeFunctionParams, type InvokeFunctionResponse, type ListAllowancesResponse, type ListFunctionsParams, type ListFunctionsResponse, type ManageAgentScheduleParams, MarketsResource, type NotificationPreference, type NotificationPreferenceKey, type NotificationPreferenceUpdateParams, type NotificationPreferenceUpdateResponse, type NotificationPreferencesResponse, PBSV_UPDATE_MESSAGE, type PlaybookFollowParams, type PlaybookFunction, type PlaybookSkillFile, type PlaybookSkillFileMeta, type PlaybookSkillMeta, type PlaybookSkillSummary, type PlaybookSkillTagEntry, type PutAgentScheduleParams, type RegisterFunctionParams, type RegisterFunctionResponse, type RevokeAllowanceParams, type RevokeAllowanceResponse, SUBSCRIBE_MANAGE_MESSAGE, SUBSCRIBE_PROPOSE_MESSAGE, SUBSCRIBE_RESULT_MESSAGE, SchedulesResource, type SkillDoc, type SkillEndpointMetadata, type SkillEndpointTier, type SkillMetadata, type SkillSummary, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SubscribeApi, type SubscribeBatchParams, type SubscribeBatchResponse, type SubscribeProposalInput, type SubscribeProposalResult, type TradingPairCandidate, type TradingPairSearchParams, type TradingPairSearchResponse, TradingPairsResource, type TrendingPlaybookItem, type TrendingPlaybooksDir, type TrendingPlaybooksParams, type TrendingPlaybooksResponse, type TrendingPlaybooksSort, UDF_AUTH_REQUIRED_MESSAGE, UDF_CONSENT_REQUEST_MESSAGE, UDF_CONSENT_RESPONSE_MESSAGE, type UdfApi, UdfAuthRequiredError, type UdfButtonEventDetail, type UdfButtonOptions, UdfConsentDeniedError, UdfConsentRequiredError, UdfConsentTimeoutError, type UdfDescriptor, UdfError, UdfExecutionError, UdfFunctionDisabledError, UdfFunctionNotFoundError, UdfInsufficientCredits, type UdfInvokeResponse, UdfPidMismatchError, UdfRateLimitedError, UdfTokenExpiredError, UdfTokenInvalidError, UdfTransportError, type UnfollowPlaybookResponse, type UnsubscribeBatchParams, type UnsubscribeBatchResponse, VERSION, getViewerToken, installPlaybookRuntime, mapUdfErrorResponse, playbookIdFromToken, subscribe, udf };
2481
+ export { type AgentSchedule, type AgentScheduleBounds, type AgentScheduleFailureCode, type AgentScheduleRule, type AgentScheduleStatus, AlertsResource, AlvaClient, type AlvaClientConfig, AlvaError, type AutomationAlertDelivery, type AutomationAlertDeliveryGetRequest, AutomationAlertDeliveryResource, type AutomationAlertDeliveryUpdateRequest, type AutomationAlertDeliveryUpdateResponse, type AutomationEmailDelivery, AutomationResource, type ChannelGroupAdminInfo, type ChannelGroupCallerInfo, type ChannelGroupHistoryParams, type ChannelGroupHistoryResponse, type ChannelGroupSubscription, type ChannelGroupSubscriptionContextResponse, type ChannelGroupSubscriptionListResponse, type ChannelGroupSubscriptionMutationParams, type ChannelGroupSubscriptionMutationResponse, type ChannelGroupSubscriptionSessionParams, type ChannelGroupSubscriptionTarget, type ChannelGroupSubscriptionTargetType, CliUsageError, type CompanyEarningsCatalog, type CompanyEarningsContentStatus, type CompanyEarningsContext, type CompanyEarningsEvent, type CompanyEarningsParams, type CompanyEarningsPeriod, type CompanyEarningsRelease, type CompanyEarningsSession, type CompanyEarningsStatus, type CompanyEarningsTranscript, type CompanyEarningsTranscriptEntry, type CompanyEarningsTranscriptSection, type CompanyFiscalQuarter, type CompanyNarrative, type CompanyNarrativeChangeLogEntry, type CompanyNarrativeContext, type CompanyNarrativeHistory, type CompanyNarrativeSnapshot, type CompanyPostEarningsSummary, type CompanyPreEarningsAnalysis, type CreateAllowanceParams, type CreateAllowanceResponse, type CreditAllowance, type CreditWallet, type CreditWalletItem, type CreditWalletItemConnection, type CreditWalletItemEdge, type CreditWalletItemsParams, type CreditWalletItemsResponse, type CreditWalletPageInfo, type DeleteFunctionParams, type FeedDeleteRequest, type FeedDeleteResponse, type FeedListItem, type FeedListParams, type FeedListResponse, type FeedListStatus, type FeedStatusUpdateRequest, type FeedStatusUpdateResponse, type FollowPlaybookResponse, type ForYouConnection, type ForYouEntry, type ForYouListParams, ForYouResource, type FsChmodParams, type FsCopyParams, type FsEntry, type FsGrantParams, type FsMkdirParams, type FsRawWriteParams, type FsReadParams, type FsReaddirParams, type FsReaddirResponse, type FsReadlinkParams, type FsRemoveParams, type FsRenameParams, type FsRevokeParams, type FsStat, type FsSymlinkParams, type FsWriteParams, type FsWriteResponse, type GetAllowanceParams, type GroupChatMessage, type InvokeFunctionParams, type InvokeFunctionResponse, type ListAllowancesResponse, type ListFunctionsParams, type ListFunctionsResponse, type ManageAgentScheduleParams, MarketsResource, type NotificationPreference, type NotificationPreferenceKey, type NotificationPreferenceUpdateParams, type NotificationPreferenceUpdateResponse, type NotificationPreferencesResponse, PBSV_UPDATE_MESSAGE, type PlaybookFollowParams, type PlaybookFunction, type PlaybookSkillFile, type PlaybookSkillFileMeta, type PlaybookSkillMeta, type PlaybookSkillSummary, type PlaybookSkillTagEntry, type PutAgentScheduleParams, type RegisterFunctionParams, type RegisterFunctionResponse, type RevokeAllowanceParams, type RevokeAllowanceResponse, SUBSCRIBE_MANAGE_MESSAGE, SUBSCRIBE_PROPOSE_MESSAGE, SUBSCRIBE_RESULT_MESSAGE, SchedulesResource, type SkillDoc, type SkillEndpointMetadata, type SkillEndpointTier, type SkillMetadata, type SkillSummary, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SubscribeApi, type SubscribeBatchParams, type SubscribeBatchResponse, type SubscribeProposalInput, type SubscribeProposalResult, type TradingPairCandidate, type TradingPairSearchParams, type TradingPairSearchResponse, TradingPairsResource, type TrendingPlaybookItem, type TrendingPlaybooksDir, type TrendingPlaybooksParams, type TrendingPlaybooksResponse, type TrendingPlaybooksSort, UDF_AUTH_REQUIRED_MESSAGE, UDF_CONSENT_REQUEST_MESSAGE, UDF_CONSENT_RESPONSE_MESSAGE, type UdfApi, UdfAuthRequiredError, type UdfButtonEventDetail, type UdfButtonOptions, UdfConsentDeniedError, UdfConsentRequiredError, UdfConsentTimeoutError, type UdfDescriptor, UdfError, UdfExecutionError, UdfFunctionDisabledError, UdfFunctionNotFoundError, UdfInsufficientCredits, type UdfInvokeResponse, UdfPidMismatchError, UdfRateLimitedError, UdfTokenExpiredError, UdfTokenInvalidError, UdfTransportError, type UnfollowPlaybookResponse, type UnsubscribeBatchParams, type UnsubscribeBatchResponse, VERSION, getViewerToken, installPlaybookRuntime, mapUdfErrorResponse, playbookIdFromToken, subscribe, udf };
package/dist/index.js CHANGED
@@ -673,6 +673,134 @@ function requireFeedID(id) {
673
673
  return id;
674
674
  }
675
675
 
676
+ // src/resources/forYou.ts
677
+ var FOR_YOU_QUERY = `
678
+ query ToolkitForYou($input: FeedEntryConnectionInput) {
679
+ viewer {
680
+ forYou(input: $input) {
681
+ edges {
682
+ cursor
683
+ node {
684
+ id
685
+ feed { id }
686
+ major { id feedId number }
687
+ displayName source eventTimeMs publishedAtMs title body
688
+ actions { type label url prompt }
689
+ presentation {
690
+ card {
691
+ accentColor url thumbnailUrl footer
692
+ fields { label value inline }
693
+ }
694
+ }
695
+ tickers { symbol logoUrl sentiment }
696
+ media { type coverUrl url }
697
+ sources { type url iconUrl title subtitle description publishedAtMs }
698
+ }
699
+ }
700
+ pageInfo { startCursor endCursor hasNextPage hasPreviousPage }
701
+ }
702
+ }
703
+ }
704
+ `.trim();
705
+ function record(value) {
706
+ return typeof value === "object" && value !== null && !Array.isArray(value);
707
+ }
708
+ function validateForYouListParams(params) {
709
+ if (!record(params)) throw new Error("For You parameters must be an object");
710
+ const first = params.first === void 0 ? 20 : params.first;
711
+ if (typeof first !== "number" || !Number.isInteger(first) || first < 1 || first > 50) {
712
+ throw new Error("first must be an integer between 1 and 50");
713
+ }
714
+ for (const field of ["after", "newerThan"]) {
715
+ const value = params[field];
716
+ if (value !== void 0 && (typeof value !== "string" || !value.trim())) {
717
+ throw new Error(`${field} must be a non-empty cursor`);
718
+ }
719
+ }
720
+ if (params.feedId !== void 0 && !isPositiveInt64(params.feedId)) {
721
+ throw new Error("feedId must be a positive decimal int64 string");
722
+ }
723
+ }
724
+ function isPositiveInt64(value) {
725
+ return typeof value === "string" && /^[1-9]\d{0,18}$/.test(value) && BigInt(value) <= 9223372036854775807n;
726
+ }
727
+ function invalidResponse() {
728
+ throw new AlvaError(
729
+ "GRAPHQL_INVALID_RESPONSE",
730
+ "GraphQL returned an invalid For You connection",
731
+ 502
732
+ );
733
+ }
734
+ function connection(value) {
735
+ if (!record(value) || !Array.isArray(value.edges) || !record(value.pageInfo)) {
736
+ return invalidResponse();
737
+ }
738
+ const page = value.pageInfo;
739
+ if (typeof page.startCursor !== "string" || typeof page.endCursor !== "string" || typeof page.hasNextPage !== "boolean" || typeof page.hasPreviousPage !== "boolean") {
740
+ return invalidResponse();
741
+ }
742
+ for (const edge of value.edges) {
743
+ if (!record(edge) || typeof edge.cursor !== "string" || !edge.cursor.trim() || !record(edge.node))
744
+ return invalidResponse();
745
+ const node = edge.node;
746
+ if (typeof node.id !== "string" || !node.id.startsWith("FeedEntry:") || !isPositiveInt64(node.id.slice("FeedEntry:".length)) || !record(node.feed) || !isPositiveInt64(node.feed.id) || !record(node.major) || typeof node.major.id !== "string" || !isPositiveInt64(node.major.feedId) || typeof node.title !== "string" || typeof node.body !== "string") {
747
+ return invalidResponse();
748
+ }
749
+ }
750
+ const first = value.edges[0];
751
+ const last = value.edges[value.edges.length - 1];
752
+ if (page.startCursor !== (first?.cursor ?? "") || page.endCursor !== (last?.cursor ?? "") || value.edges.length === 0 && page.hasNextPage)
753
+ return invalidResponse();
754
+ return value;
755
+ }
756
+ var ForYouResource = class {
757
+ constructor(client) {
758
+ this.client = client;
759
+ }
760
+ client;
761
+ /** One newest-first page. Does not truncate content or advance a watermark. */
762
+ async list(params = {}) {
763
+ validateForYouListParams(params);
764
+ this.client._requireAuth();
765
+ const response = await this.client._request("POST", "/query", {
766
+ body: {
767
+ query: FOR_YOU_QUERY,
768
+ variables: {
769
+ input: {
770
+ first: params.first ?? 20,
771
+ after: params.after,
772
+ newerThan: params.newerThan,
773
+ feedId: params.feedId
774
+ }
775
+ }
776
+ }
777
+ });
778
+ if (!record(response)) return invalidResponse();
779
+ if (response.errors !== void 0) {
780
+ if (!Array.isArray(response.errors)) return invalidResponse();
781
+ if (response.errors.length > 0) {
782
+ const messages = response.errors.flatMap(
783
+ (error) => record(error) && typeof error.message === "string" ? [error.message] : []
784
+ );
785
+ throw new AlvaError(
786
+ "GRAPHQL_ERROR",
787
+ messages.join("; ") || "GraphQL request failed",
788
+ 400,
789
+ { errors: response.errors }
790
+ );
791
+ }
792
+ }
793
+ if (!record(response.data) || !record(response.data.viewer) || response.data.viewer.forYou == null) {
794
+ throw new AlvaError(
795
+ "GRAPHQL_EMPTY_RESPONSE",
796
+ "GraphQL response did not include viewer.forYou",
797
+ 502
798
+ );
799
+ }
800
+ return connection(response.data.viewer.forYou);
801
+ }
802
+ };
803
+
676
804
  // src/resources/automation.ts
677
805
  var AUTOMATION_ALERT_DELIVERY_QUERY = `
678
806
  query ToolkitAutomationAlertDelivery($automationId: ID!) {
@@ -3185,14 +3313,14 @@ var SchedulesResource = class {
3185
3313
  LIST_SCHEDULES,
3186
3314
  { channelId: id, after }
3187
3315
  );
3188
- const connection = data.viewer?.channel?.schedules;
3189
- if (!connection?.edges) throw scheduleNotFound();
3190
- for (const edge of connection.edges) {
3316
+ const connection2 = data.viewer?.channel?.schedules;
3317
+ if (!connection2?.edges) throw scheduleNotFound();
3318
+ for (const edge of connection2.edges) {
3191
3319
  if (!edge?.node) throw scheduleEmptyResponse();
3192
3320
  schedules.push(fromWireSchedule(edge.node));
3193
3321
  }
3194
- if (connection.pageInfo?.hasNextPage !== true) return schedules;
3195
- const next = connection.pageInfo.endCursor;
3322
+ if (connection2.pageInfo?.hasNextPage !== true) return schedules;
3323
+ const next = connection2.pageInfo.endCursor;
3196
3324
  if (!next || seenCursors.has(next)) throw scheduleEmptyResponse();
3197
3325
  seenCursors.add(next);
3198
3326
  after = next;
@@ -3591,12 +3719,12 @@ function dedupe(candidates) {
3591
3719
  });
3592
3720
  }
3593
3721
  function resolveFilters(params) {
3594
- const record = isRecord(params) ? params : {};
3722
+ const record2 = isRecord(params) ? params : {};
3595
3723
  return {
3596
- market: typeof record.market === "string" ? record.market : void 0,
3597
- instrumentType: typeof record.instrumentType === "string" ? record.instrumentType : void 0,
3598
- underlyingType: typeof record.underlyingType === "string" ? record.underlyingType : void 0,
3599
- quote: typeof record.quote === "string" ? record.quote : void 0
3724
+ market: typeof record2.market === "string" ? record2.market : void 0,
3725
+ instrumentType: typeof record2.instrumentType === "string" ? record2.instrumentType : void 0,
3726
+ underlyingType: typeof record2.underlyingType === "string" ? record2.underlyingType : void 0,
3727
+ quote: typeof record2.quote === "string" ? record2.quote : void 0
3600
3728
  };
3601
3729
  }
3602
3730
  function pairSearchParams(pair, params) {
@@ -3644,11 +3772,11 @@ var TradingPairsResource = class {
3644
3772
  return { query, candidates };
3645
3773
  }
3646
3774
  async resolve(params) {
3647
- const record = isRecord(params) ? params : {};
3648
- const pair = typeof record.pair === "string" ? record.pair.trim() : void 0;
3775
+ const record2 = isRecord(params) ? params : {};
3776
+ const pair = typeof record2.pair === "string" ? record2.pair.trim() : void 0;
3649
3777
  const filters = resolveFilters(params);
3650
3778
  const searchParams = pair === void 0 ? {
3651
- symbol: typeof record.symbol === "string" ? record.symbol : "",
3779
+ symbol: typeof record2.symbol === "string" ? record2.symbol : "",
3652
3780
  ...filters
3653
3781
  } : pairSearchParams(pair, filters);
3654
3782
  const result = await this.search(searchParams);
@@ -3759,6 +3887,7 @@ var AlvaClient = class {
3759
3887
  _serviceAccount;
3760
3888
  _release;
3761
3889
  _feed;
3890
+ _forYou;
3762
3891
  _automation;
3763
3892
  _playbooks;
3764
3893
  _secrets;
@@ -3895,6 +4024,9 @@ var AlvaClient = class {
3895
4024
  );
3896
4025
  }
3897
4026
  }
4027
+ get forYou() {
4028
+ return this._forYou ??= new ForYouResource(this);
4029
+ }
3898
4030
  async _request(method, path, options) {
3899
4031
  const baseUrl = options?.baseUrl ?? this.baseUrl;
3900
4032
  let url = `${baseUrl}${path}`;
@@ -4499,7 +4631,7 @@ var installPlaybookRuntime = (targetWindow) => {
4499
4631
  };
4500
4632
 
4501
4633
  // src/index.ts
4502
- var VERSION = true ? "0.27.0" : "dev";
4634
+ var VERSION = true ? "0.28.0-beta.0" : "dev";
4503
4635
  export {
4504
4636
  AlertsResource,
4505
4637
  AlvaClient,
@@ -4507,6 +4639,7 @@ export {
4507
4639
  AutomationAlertDeliveryResource,
4508
4640
  AutomationResource,
4509
4641
  CliUsageError,
4642
+ ForYouResource,
4510
4643
  MarketsResource,
4511
4644
  PBSV_UPDATE_MESSAGE,
4512
4645
  SUBSCRIBE_MANAGE_MESSAGE,