@alva-ai/toolkit 0.32.0-beta.0 → 0.32.0-beta.1

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.
@@ -1257,6 +1257,82 @@ declare class FeedResource {
1257
1257
  setVisibility(params: FeedSetVisibilityRequest): Promise<FeedSetVisibilityResponse>;
1258
1258
  }
1259
1259
 
1260
+ /**
1261
+ * The canonical viewpoint author. `__typename` names the exact handle that
1262
+ * `thesis list` accepts: a Person's `slug` or a PublicUser's `username`.
1263
+ */
1264
+ type ThesisPublisher = {
1265
+ id: string;
1266
+ displayName: string;
1267
+ avatarUrl: string;
1268
+ bio: string;
1269
+ followersCount: number;
1270
+ viewerState: {
1271
+ following: boolean | null;
1272
+ };
1273
+ } & ({
1274
+ __typename: 'Person';
1275
+ slug: string;
1276
+ } | {
1277
+ __typename: 'PublicUser';
1278
+ username: string;
1279
+ });
1280
+ interface ThesisSourceReference {
1281
+ title: string | null;
1282
+ sourceKind: string;
1283
+ sourceContentId: string;
1284
+ publicUrl: string;
1285
+ sourceTimeMs: number | null;
1286
+ locator: string;
1287
+ }
1288
+ /** The exact author version this recommendation renders, not the mutable Thesis. */
1289
+ interface ThesisPublicationSummary {
1290
+ thesisId: string;
1291
+ playbookId: string;
1292
+ authorVersionId: string;
1293
+ materialVersionId: string;
1294
+ itemKey: string;
1295
+ title: string;
1296
+ body: string;
1297
+ publishedAtMs: number;
1298
+ changeKind: string;
1299
+ visibility: string;
1300
+ closed: boolean;
1301
+ archived: boolean;
1302
+ note: string;
1303
+ closingNote: string;
1304
+ researchPaused: boolean;
1305
+ entityIds: string[];
1306
+ categoryIds: string[];
1307
+ /** `stance` is UNKNOWN, BULLISH or BEARISH today; Gateway may add values. */
1308
+ entityStances: {
1309
+ entityId: string;
1310
+ stance: string;
1311
+ }[];
1312
+ entities: {
1313
+ id: string;
1314
+ ticker: string;
1315
+ name: string;
1316
+ }[];
1317
+ publisher: ThesisPublisher;
1318
+ /** `type` is PRICE_CHART, IMAGE, AUDIO or VIDEO today; Gateway may add values. */
1319
+ medias: {
1320
+ type: string;
1321
+ coverUrl: string;
1322
+ url: string | null;
1323
+ }[];
1324
+ signalFeed: {
1325
+ id: string;
1326
+ } | null;
1327
+ snapshotRelease: {
1328
+ versionId: string;
1329
+ materialVersionId: string;
1330
+ publishedAtMs: number;
1331
+ changeKind: string;
1332
+ sourceRefs: ThesisSourceReference[];
1333
+ };
1334
+ }
1335
+
1260
1336
  interface ForYouListParams {
1261
1337
  first?: number;
1262
1338
  after?: string;
@@ -1335,72 +1411,6 @@ interface ForYouThesesParams {
1335
1411
  first?: number;
1336
1412
  after?: string;
1337
1413
  }
1338
- /** Interface fields shared by user and curated-person publisher profiles. */
1339
- interface ThesisPublisher {
1340
- id: string;
1341
- displayName: string;
1342
- avatarUrl: string;
1343
- bio: string;
1344
- followersCount: number;
1345
- viewerState: {
1346
- following: boolean | null;
1347
- };
1348
- }
1349
- interface ThesisSourceReference {
1350
- title: string | null;
1351
- sourceKind: string;
1352
- sourceContentId: string;
1353
- publicUrl: string;
1354
- sourceTimeMs: number | null;
1355
- locator: string;
1356
- }
1357
- /** The exact author version this recommendation renders, not the mutable Thesis. */
1358
- interface ThesisPublicationSummary {
1359
- thesisId: string;
1360
- playbookId: string;
1361
- authorVersionId: string;
1362
- materialVersionId: string;
1363
- itemKey: string;
1364
- title: string;
1365
- body: string;
1366
- publishedAtMs: number;
1367
- changeKind: string;
1368
- visibility: string;
1369
- closed: boolean;
1370
- archived: boolean;
1371
- note: string;
1372
- closingNote: string;
1373
- researchPaused: boolean;
1374
- entityIds: string[];
1375
- categoryIds: string[];
1376
- /** `stance` is UNKNOWN, BULLISH or BEARISH today; Gateway may add values. */
1377
- entityStances: {
1378
- entityId: string;
1379
- stance: string;
1380
- }[];
1381
- entities: {
1382
- id: string;
1383
- ticker: string;
1384
- name: string;
1385
- }[];
1386
- publisher: ThesisPublisher;
1387
- /** `type` is PRICE_CHART, IMAGE, AUDIO or VIDEO today; Gateway may add values. */
1388
- medias: {
1389
- type: string;
1390
- coverUrl: string;
1391
- url: string | null;
1392
- }[];
1393
- signalFeed: {
1394
- id: string;
1395
- } | null;
1396
- snapshotRelease: {
1397
- versionId: string;
1398
- materialVersionId: string;
1399
- publishedAtMs: number;
1400
- changeKind: string;
1401
- sourceRefs: ThesisSourceReference[];
1402
- };
1403
- }
1404
1414
  interface ThesisRecommendation {
1405
1415
  itemKey: string;
1406
1416
  publication: ThesisPublicationSummary;
@@ -2425,6 +2435,82 @@ declare class TradingPairsResource {
2425
2435
  } & TradingPairResolveFilters) | Omit<TradingPairSearchParams, 'limit'>): Promise<TradingPairCandidate>;
2426
2436
  }
2427
2437
 
2438
+ interface ThesisPageParams {
2439
+ /** 1-50; omitted reads 10. */
2440
+ first?: number;
2441
+ /** The previous page's `nextCursor`. */
2442
+ cursor?: string;
2443
+ }
2444
+ interface ListThesesParams extends ThesisPageParams {
2445
+ /** Exact Person slug, e.g. a Person publisher's `slug`. */
2446
+ person?: string;
2447
+ /** Person name search; resolves only a unique match. */
2448
+ personName?: string;
2449
+ /** Exact PublicUser username, e.g. a publisher's `username`; not a display name. */
2450
+ user?: string;
2451
+ /** Catalog ticker or alias; resolves only a unique entity. */
2452
+ ticker?: string;
2453
+ entityId?: string;
2454
+ /** Author lists only; omitted means ACTIVE. */
2455
+ status?: 'ACTIVE' | 'ARCHIVED';
2456
+ }
2457
+ type ThesisReadScope = {
2458
+ __typename: 'Person';
2459
+ id: string;
2460
+ slug: string;
2461
+ displayName: string;
2462
+ bio: string;
2463
+ } | {
2464
+ __typename: 'PublicUser';
2465
+ id: string;
2466
+ username: string;
2467
+ displayName: string;
2468
+ bio: string;
2469
+ } | {
2470
+ __typename: 'Entity';
2471
+ id: string;
2472
+ ticker: string;
2473
+ name: string;
2474
+ kind: string;
2475
+ assetClass: string;
2476
+ venue: {
2477
+ id: string;
2478
+ name: string;
2479
+ } | null;
2480
+ };
2481
+ /**
2482
+ * `nextCursor` is the only continuation: pass it as `cursor`, and stop when it
2483
+ * is null. A page can be empty while `nextCursor` is still set.
2484
+ */
2485
+ interface ThesisListPage {
2486
+ scope: ThesisReadScope;
2487
+ edges: {
2488
+ cursor: string;
2489
+ node: {
2490
+ /** Internal ID accepted by get/version/signals/related. */
2491
+ playbookId: string;
2492
+ /** Null when the author list has no readable publication snapshot. */
2493
+ publication: ThesisPublicationSummary | null;
2494
+ };
2495
+ }[];
2496
+ nextCursor: string | null;
2497
+ }
2498
+ /** Related publications of the source's current version. */
2499
+ interface RelatedThesesPage {
2500
+ /** GENERATING and FAILED carry no matches; READY with no edges means none. */
2501
+ state: 'GENERATING' | 'READY' | 'FAILED';
2502
+ edges: {
2503
+ cursor: string;
2504
+ node: {
2505
+ itemKey: string;
2506
+ /** Relatedness, not quality or support. */
2507
+ score: number;
2508
+ publication: ThesisPublicationSummary;
2509
+ };
2510
+ }[];
2511
+ nextCursor: string | null;
2512
+ }
2513
+
2428
2514
  /** Thesis IDs are signed int64 values represented losslessly as decimal strings. */
2429
2515
  type ThesisID = string;
2430
2516
  type ThesisVisibility = 'public' | 'private';
@@ -2574,6 +2660,10 @@ interface RewriteThesisResponse {
2574
2660
  declare class ThesesResource {
2575
2661
  private client;
2576
2662
  constructor(client: AlvaClient);
2663
+ /** One visible page; no automatic pagination or content truncation. */
2664
+ list(params: ListThesesParams): Promise<ThesisListPage>;
2665
+ /** Related publications always use the current source version. */
2666
+ related(id: ThesisID, params?: ThesisPageParams): Promise<RelatedThesesPage>;
2577
2667
  assetCandidates(text: string): Promise<ThesisAssetCandidatesResponse>;
2578
2668
  create(params: CreateThesisParams): Promise<ThesisResponse>;
2579
2669
  get(id: ThesisID): Promise<ThesisGetResponse>;
@@ -2586,6 +2676,22 @@ declare class ThesesResource {
2586
2676
  rewrite(params: RewriteThesisParams): Promise<RewriteThesisResponse>;
2587
2677
  }
2588
2678
 
2679
+ interface CreateCompanyNewsParams {
2680
+ name: string;
2681
+ tickers: string[];
2682
+ initial_lookback_hours?: number;
2683
+ page_size?: number;
2684
+ }
2685
+ interface CreateCompanyNewsResponse {
2686
+ feed_id: string;
2687
+ cronjob_id: string;
2688
+ }
2689
+ declare class CompanyNewsResource {
2690
+ private client;
2691
+ constructor(client: AlvaClient);
2692
+ create(params: CreateCompanyNewsParams): Promise<CreateCompanyNewsResponse>;
2693
+ }
2694
+
2589
2695
  interface RequestOptions {
2590
2696
  query?: Record<string, unknown>;
2591
2697
  body?: unknown;
@@ -2658,6 +2764,7 @@ declare class AlvaClient {
2658
2764
  private _steward?;
2659
2765
  private _tradingPairs?;
2660
2766
  private _theses?;
2767
+ private _companyNews?;
2661
2768
  constructor(config: AlvaClientConfig);
2662
2769
  get fs(): FsResource;
2663
2770
  get run(): RunResource;
@@ -2691,6 +2798,7 @@ declare class AlvaClient {
2691
2798
  get schedules(): SchedulesResource;
2692
2799
  get steward(): StewardResource;
2693
2800
  get theses(): ThesesResource;
2801
+ get companyNews(): CompanyNewsResource;
2694
2802
  _requireAuth(): void;
2695
2803
  get forYou(): ForYouResource;
2696
2804
  _request(method: string, path: string, options?: RequestOptions): Promise<unknown>;