@usesocial/cli 0.2.1 → 0.2.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @usesocial/cli
2
2
 
3
+ ## 0.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`962b0ad`](https://github.com/usesocial/monorepo/commit/962b0ad79bd764b27a24bf157115c721afb49017) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Cache more non-DM X reads, including handle lookup, engagement graphs,
8
+ bookmarks, likes, mentions, timeline, lists, and list members.
9
+
10
+ - [`6a79019`](https://github.com/usesocial/monorepo/commit/6a79019a46e09e63148341ea8b8cf67aec1f4819) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Mark `social x profile` as a cacheable read so repeated profile fetches can be
11
+ served from cache for zero credits and support `-H/--header` cache controls.
12
+
13
+ ## 0.2.2
14
+
15
+ ### Patch Changes
16
+
17
+ - Clean up account connect progress output so X and LinkedIn show the auth handshake spinner before opening the browser URL.
18
+
3
19
  ## 0.2.1
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -45,7 +45,7 @@ A few of the things the command surface supports:
45
45
  | "Surface the ten connections worth reaching out to this week." | `linkedin connections`, `x tweets` |
46
46
  | "Pull everyone who reacted to my last LinkedIn post and flag the warm leads." | `linkedin reactions`, `linkedin profile` |
47
47
  | "Read this creator's recent posts and break down what makes them land." | `linkedin posts`, `x tweets` |
48
- | "Find what people are saying about AI agents this week and summarize the themes." | `linkedin search posts`, `x timeline` |
48
+ | "Find what people are saying about AI agents this week and summarize the themes." | `linkedin posts`, `x timeline` |
49
49
  | "Draft a reply to this thread and post it once I approve." | `linkedin comment`, `x post` |
50
50
 
51
51
  ## Commands
@@ -84,10 +84,10 @@ connected account.
84
84
  | `(bare)` | Show who is signed in and list connected accounts. | |
85
85
  | `login` | Device sign-in, scope selection, and billing. | |
86
86
  | `logout` | Revoke the session and clear the saved token. | |
87
- | `connect linkedin` | Connect a LinkedIn account through the browser. | ✎ write |
88
- | `connect x` | Connect an X account through OAuth. | ✎ write |
89
- | `reconnect linkedin <account>` | Re-auth an existing LinkedIn account. | ✎ write |
90
- | `reconnect x <account>` | Re-auth an existing X account. | ✎ write |
87
+ | `connect linkedin` | Open or print a LinkedIn connection URL. | ✎ write |
88
+ | `connect x` | Open or print an X OAuth URL. | ✎ write |
89
+ | `reconnect linkedin <account>` | Re-auth an existing LinkedIn account by opening or printing a connection URL. | ✎ write |
90
+ | `reconnect x <account>` | Re-auth an existing X account by opening or printing an OAuth URL. | ✎ write |
91
91
  | `disconnect linkedin <account>` | Disconnect a LinkedIn account. | ✎ write |
92
92
  | `disconnect x <account>` | Disconnect an X account. | ✎ write |
93
93
  | `usage` | Aggregate proxy usage and billing stats. | |
@@ -116,10 +116,6 @@ connected account.
116
116
  | `connections [target]` | List connections; omit the target for account-level connections. | |
117
117
  | `company <target>` | Fetch a company profile. | |
118
118
  | `jobs <target>` | List a company's job postings. | |
119
- | `search people <keywords>` | Search for people. | |
120
- | `search posts <keywords>` | Search for posts. | |
121
- | `search jobs <keywords>` | Search for jobs. | |
122
- | `search companies <keywords>` | Search for companies. | |
123
119
  | `messages` | List conversations. | |
124
120
  | `messages <target>` | Read a conversation by `chat_id:<id>`, `@handle`, `profile_id:<id>`, profile URL, or messaging-thread URL. | |
125
121
  | `message <target> <text>` | Send a message. | ✎ write |
@@ -160,9 +156,9 @@ connected account.
160
156
  then knows the commands.
161
157
 
162
158
  ```sh
163
- # Find hiring posts, fan out to reaction graphs, rank warm contacts.
164
- social linkedin search posts "AI infra hiring" --limit 25 > /tmp/hiring-posts.json
165
- jq -r '.items[].id' /tmp/hiring-posts.json \
159
+ # Review recent LinkedIn posts, fan out to reaction graphs, rank warm contacts.
160
+ social linkedin posts --limit 25 > /tmp/recent-posts.json
161
+ jq -r '.items[].id' /tmp/recent-posts.json \
166
162
  | xargs -I{} social linkedin reactions post_id:{} \
167
163
  | jq -s '[ .[] | .items[] ]
168
164
  | group_by(.actor.id // .reactor.id // .profile_id)
@@ -247,7 +243,6 @@ Built so your accounts outlive your prototype.
247
243
 
248
244
  ```sh
249
245
  # LinkedIn
250
- social linkedin search people "founder ai"
251
246
  social linkedin profile
252
247
 
253
248
  # X
package/dist/index.mjs CHANGED
@@ -1755,7 +1755,7 @@ var Doc = class {
1755
1755
  };
1756
1756
  //#endregion
1757
1757
  //#region ../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/versions.js
1758
- const version$1 = {
1758
+ const version$2 = {
1759
1759
  major: 4,
1760
1760
  minor: 4,
1761
1761
  patch: 3
@@ -1767,7 +1767,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1767
1767
  inst ?? (inst = {});
1768
1768
  inst._zod.def = def;
1769
1769
  inst._zod.bag = inst._zod.bag || {};
1770
- inst._zod.version = version$1;
1770
+ inst._zod.version = version$2;
1771
1771
  const checks = [...inst._zod.def.checks ?? []];
1772
1772
  if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
1773
1773
  for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
@@ -11202,223 +11202,79 @@ function renderDescription(arg, required) {
11202
11202
  ].filter(Boolean).join(" ");
11203
11203
  }
11204
11204
  //#endregion
11205
- //#region ../../packages/x/src/pricing.ts
11206
- const { costBPSForCategory } = createPricing([
11205
+ //#region ../../packages/linkedin/src/pricing.ts
11206
+ const { costBPSForCategory: costBPSForCategory$1 } = createPricing([
11207
11207
  {
11208
11208
  "key": "posts_read",
11209
11209
  "label": "Posts: Read",
11210
- "description": "Charged per resource fetched.",
11211
- "unit": "resource",
11210
+ "description": "Read LinkedIn posts, comments, reactions, jobs, and other post-like result sets.",
11211
+ "unit": "per_resource",
11212
11212
  "unitPriceUSD": .005,
11213
11213
  "featureId": "post_read_resource"
11214
11214
  },
11215
11215
  {
11216
11216
  "key": "user_read",
11217
11217
  "label": "User: Read",
11218
- "description": "Charged per resource fetched.",
11219
- "unit": "resource",
11218
+ "description": "Read non-owned LinkedIn profiles, companies, people search, company search, requests, and other profile-like result sets.",
11219
+ "unit": "per_resource",
11220
11220
  "unitPriceUSD": .01,
11221
11221
  "featureId": "user_read_resource"
11222
11222
  },
11223
11223
  {
11224
11224
  "key": "dm_event_read",
11225
11225
  "label": "DM Event: Read",
11226
- "description": "Charged per resource fetched.",
11227
- "unit": "resource",
11226
+ "description": "Read LinkedIn chats, chat messages, and profile-to-chat lookups.",
11227
+ "unit": "per_resource",
11228
11228
  "unitPriceUSD": .01,
11229
11229
  "featureId": "dm_event_read_resource"
11230
11230
  },
11231
11231
  {
11232
11232
  "key": "post_create",
11233
11233
  "label": "Post: Create",
11234
- "description": "Creating posts. Charged per request.",
11235
- "unit": "request",
11234
+ "description": "Create a simple LinkedIn post without a detected URL.",
11235
+ "unit": "per_request",
11236
11236
  "unitPriceUSD": .015,
11237
11237
  "featureId": "content_create_request"
11238
11238
  },
11239
11239
  {
11240
11240
  "key": "content_create",
11241
11241
  "label": "Content: Create",
11242
- "description": "Summoned replies/quotes (replying to a post where you were mentioned). Charged per request.",
11243
- "unit": "request",
11242
+ "description": "Create LinkedIn comments or other lower-cost content writes.",
11243
+ "unit": "per_request",
11244
11244
  "unitPriceUSD": .01,
11245
11245
  "featureId": "content_create_request"
11246
11246
  },
11247
11247
  {
11248
11248
  "key": "content_create_with_url",
11249
11249
  "label": "Content: Create with URL",
11250
- "description": "Creating content with URL. Charged per request.",
11251
- "unit": "request",
11250
+ "description": "Create a LinkedIn post when URL presence is unknown or detected, priced conservatively.",
11251
+ "unit": "per_request",
11252
11252
  "unitPriceUSD": .2,
11253
11253
  "featureId": "content_create_with_url_request"
11254
11254
  },
11255
11255
  {
11256
11256
  "key": "dm_interaction_create",
11257
11257
  "label": "DM Interaction: Create",
11258
- "description": "Creating DM interactions. Charged per request.",
11259
- "unit": "request",
11258
+ "description": "Send, modify, delete, or mark LinkedIn chat messages and chat state.",
11259
+ "unit": "per_request",
11260
11260
  "unitPriceUSD": .015,
11261
11261
  "featureId": "dm_interaction_create_request"
11262
11262
  },
11263
11263
  {
11264
11264
  "key": "user_interaction_create",
11265
11265
  "label": "User Interaction: Create",
11266
- "description": "Creating user interactions. Charged per request.",
11267
- "unit": "request",
11266
+ "description": "Create LinkedIn reactions, connection requests, and relation-request state changes.",
11267
+ "unit": "per_request",
11268
11268
  "unitPriceUSD": .015,
11269
11269
  "featureId": "user_interaction_create_request"
11270
11270
  },
11271
- {
11272
- "key": "list_read",
11273
- "label": "List: Read",
11274
- "description": "Charged per resource fetched.",
11275
- "unit": "resource",
11276
- "unitPriceUSD": .005,
11277
- "featureId": "list_read_resource"
11278
- },
11279
- {
11280
- "key": "space_read",
11281
- "label": "Space: Read",
11282
- "description": "Charged per resource fetched.",
11283
- "unit": "resource",
11284
- "unitPriceUSD": .005,
11285
- "featureId": "space_read_resource"
11286
- },
11287
- {
11288
- "key": "community_read",
11289
- "label": "Community: Read",
11290
- "description": "Charged per resource fetched.",
11291
- "unit": "resource",
11292
- "unitPriceUSD": .005,
11293
- "featureId": "community_read_resource"
11294
- },
11295
- {
11296
- "key": "note_read",
11297
- "label": "Note: Read",
11298
- "description": "Charged per resource fetched.",
11299
- "unit": "resource",
11300
- "unitPriceUSD": .005,
11301
- "featureId": "note_read_resource"
11302
- },
11303
- {
11304
- "key": "following_read",
11305
- "label": "Following/Followers: Read",
11306
- "description": "Charged per resource fetched for both following and followers.",
11307
- "unit": "resource",
11308
- "unitPriceUSD": .01,
11309
- "featureId": "following_followers_read_resource"
11310
- },
11311
- {
11312
- "key": "media_read",
11313
- "label": "Media: Read",
11314
- "description": "Charged per resource fetched.",
11315
- "unit": "resource",
11316
- "unitPriceUSD": .005,
11317
- "featureId": "media_read_resource"
11318
- },
11319
- {
11320
- "key": "analytics_read",
11321
- "label": "Analytics: Read",
11322
- "description": "Charged per resource fetched.",
11323
- "unit": "resource",
11324
- "unitPriceUSD": .005,
11325
- "featureId": "analytics_read_resource"
11326
- },
11327
- {
11328
- "key": "trend_read",
11329
- "label": "Trend: Read",
11330
- "description": "Fetching trends. Charged per resource fetched.",
11331
- "unit": "resource",
11332
- "unitPriceUSD": .01,
11333
- "featureId": "trend_read_resource"
11334
- },
11335
11271
  {
11336
11272
  "key": "owned_read",
11337
11273
  "label": "Owned: Read",
11338
- "description": "Charged per resource fetched.",
11339
- "unit": "resource",
11274
+ "description": "Read the connected LinkedIn account's own profile or first-party relation data.",
11275
+ "unit": "per_resource",
11340
11276
  "unitPriceUSD": .001,
11341
11277
  "featureId": "owned_read_resource"
11342
- },
11343
- {
11344
- "key": "interaction_delete",
11345
- "label": "Interaction: Delete",
11346
- "description": "Deleting interactions. Charged per request.",
11347
- "unit": "request",
11348
- "unitPriceUSD": .01,
11349
- "featureId": "interaction_delete_request"
11350
- },
11351
- {
11352
- "key": "content_manage",
11353
- "label": "Content: Manage",
11354
- "description": "Managing content (deleting or hiding posts). Charged per request.",
11355
- "unit": "request",
11356
- "unitPriceUSD": .005,
11357
- "featureId": "content_manage_request"
11358
- },
11359
- {
11360
- "key": "list_create",
11361
- "label": "List: Create",
11362
- "description": "Creating lists. Charged per request.",
11363
- "unit": "request",
11364
- "unitPriceUSD": .01,
11365
- "featureId": "list_create_request"
11366
- },
11367
- {
11368
- "key": "list_manage",
11369
- "label": "List: Manage",
11370
- "description": "Managing lists (deleting or updating). Charged per request.",
11371
- "unit": "request",
11372
- "unitPriceUSD": .005,
11373
- "featureId": "list_manage_request"
11374
- },
11375
- {
11376
- "key": "bookmark",
11377
- "label": "Bookmark",
11378
- "description": "Creating bookmarks. Charged per request.",
11379
- "unit": "request",
11380
- "unitPriceUSD": .005,
11381
- "featureId": "bookmark_request"
11382
- },
11383
- {
11384
- "key": "media_metadata",
11385
- "label": "Media Metadata",
11386
- "description": "Creating/deleting media metadata. Charged per request.",
11387
- "unit": "request",
11388
- "unitPriceUSD": .005,
11389
- "featureId": "media_metadata_request"
11390
- },
11391
- {
11392
- "key": "privacy_update",
11393
- "label": "Privacy: Update",
11394
- "description": "Updating privacy settings. Charged per request.",
11395
- "unit": "request",
11396
- "unitPriceUSD": .01,
11397
- "featureId": "privacy_update_request"
11398
- },
11399
- {
11400
- "key": "mute_delete",
11401
- "label": "Mute: Delete",
11402
- "description": "Deleting mutes. Charged per request.",
11403
- "unit": "request",
11404
- "unitPriceUSD": .005,
11405
- "featureId": "mute_delete_request"
11406
- },
11407
- {
11408
- "key": "counts_recent",
11409
- "label": "Counts: Recent",
11410
- "description": "Fetching recent counts. Charged per request.",
11411
- "unit": "request",
11412
- "unitPriceUSD": .005,
11413
- "featureId": "counts_recent_request"
11414
- },
11415
- {
11416
- "key": "counts_all",
11417
- "label": "Counts: All",
11418
- "description": "Fetching all counts. Charged per request.",
11419
- "unit": "request",
11420
- "unitPriceUSD": .01,
11421
- "featureId": "counts_all_request"
11422
11278
  }
11423
11279
  ]);
11424
11280
  const LINKEDIN_OPERATIONS = [
@@ -13561,7 +13417,7 @@ const defineOperationCommand$1 = (op, deps) => {
13561
13417
  const DM_INTERACTION_BILLING_CATEGORY = "dm_interaction_create";
13562
13418
  const DM_INTERACTION_ENDPOINT_BILLING = {
13563
13419
  billingCategory: DM_INTERACTION_BILLING_CATEGORY,
13564
- costBPS: costBPSForCategory(DM_INTERACTION_BILLING_CATEGORY)
13420
+ costBPS: costBPSForCategory$1(DM_INTERACTION_BILLING_CATEGORY)
13565
13421
  };
13566
13422
  const isRecord$5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
13567
13423
  const groupDescriptions = {
@@ -14380,6 +14236,226 @@ createLinkedinCommands({
14380
14236
  resolveAccountId: unconfigured$1,
14381
14237
  resolveOwnLinkedinAccount: unconfigured$1
14382
14238
  });
14239
+ //#endregion
14240
+ //#region ../../packages/x/src/pricing.ts
14241
+ const { costBPSForCategory } = createPricing([
14242
+ {
14243
+ "key": "posts_read",
14244
+ "label": "Posts: Read",
14245
+ "description": "Charged per resource fetched.",
14246
+ "unit": "resource",
14247
+ "unitPriceUSD": .005,
14248
+ "featureId": "post_read_resource"
14249
+ },
14250
+ {
14251
+ "key": "user_read",
14252
+ "label": "User: Read",
14253
+ "description": "Charged per resource fetched.",
14254
+ "unit": "resource",
14255
+ "unitPriceUSD": .01,
14256
+ "featureId": "user_read_resource"
14257
+ },
14258
+ {
14259
+ "key": "dm_event_read",
14260
+ "label": "DM Event: Read",
14261
+ "description": "Charged per resource fetched.",
14262
+ "unit": "resource",
14263
+ "unitPriceUSD": .01,
14264
+ "featureId": "dm_event_read_resource"
14265
+ },
14266
+ {
14267
+ "key": "post_create",
14268
+ "label": "Post: Create",
14269
+ "description": "Creating posts. Charged per request.",
14270
+ "unit": "request",
14271
+ "unitPriceUSD": .015,
14272
+ "featureId": "content_create_request"
14273
+ },
14274
+ {
14275
+ "key": "content_create",
14276
+ "label": "Content: Create",
14277
+ "description": "Summoned replies/quotes (replying to a post where you were mentioned). Charged per request.",
14278
+ "unit": "request",
14279
+ "unitPriceUSD": .01,
14280
+ "featureId": "content_create_request"
14281
+ },
14282
+ {
14283
+ "key": "content_create_with_url",
14284
+ "label": "Content: Create with URL",
14285
+ "description": "Creating content with URL. Charged per request.",
14286
+ "unit": "request",
14287
+ "unitPriceUSD": .2,
14288
+ "featureId": "content_create_with_url_request"
14289
+ },
14290
+ {
14291
+ "key": "dm_interaction_create",
14292
+ "label": "DM Interaction: Create",
14293
+ "description": "Creating DM interactions. Charged per request.",
14294
+ "unit": "request",
14295
+ "unitPriceUSD": .015,
14296
+ "featureId": "dm_interaction_create_request"
14297
+ },
14298
+ {
14299
+ "key": "user_interaction_create",
14300
+ "label": "User Interaction: Create",
14301
+ "description": "Creating user interactions. Charged per request.",
14302
+ "unit": "request",
14303
+ "unitPriceUSD": .015,
14304
+ "featureId": "user_interaction_create_request"
14305
+ },
14306
+ {
14307
+ "key": "list_read",
14308
+ "label": "List: Read",
14309
+ "description": "Charged per resource fetched.",
14310
+ "unit": "resource",
14311
+ "unitPriceUSD": .005,
14312
+ "featureId": "list_read_resource"
14313
+ },
14314
+ {
14315
+ "key": "space_read",
14316
+ "label": "Space: Read",
14317
+ "description": "Charged per resource fetched.",
14318
+ "unit": "resource",
14319
+ "unitPriceUSD": .005,
14320
+ "featureId": "space_read_resource"
14321
+ },
14322
+ {
14323
+ "key": "community_read",
14324
+ "label": "Community: Read",
14325
+ "description": "Charged per resource fetched.",
14326
+ "unit": "resource",
14327
+ "unitPriceUSD": .005,
14328
+ "featureId": "community_read_resource"
14329
+ },
14330
+ {
14331
+ "key": "note_read",
14332
+ "label": "Note: Read",
14333
+ "description": "Charged per resource fetched.",
14334
+ "unit": "resource",
14335
+ "unitPriceUSD": .005,
14336
+ "featureId": "note_read_resource"
14337
+ },
14338
+ {
14339
+ "key": "following_read",
14340
+ "label": "Following/Followers: Read",
14341
+ "description": "Charged per resource fetched for both following and followers.",
14342
+ "unit": "resource",
14343
+ "unitPriceUSD": .01,
14344
+ "featureId": "following_followers_read_resource"
14345
+ },
14346
+ {
14347
+ "key": "media_read",
14348
+ "label": "Media: Read",
14349
+ "description": "Charged per resource fetched.",
14350
+ "unit": "resource",
14351
+ "unitPriceUSD": .005,
14352
+ "featureId": "media_read_resource"
14353
+ },
14354
+ {
14355
+ "key": "analytics_read",
14356
+ "label": "Analytics: Read",
14357
+ "description": "Charged per resource fetched.",
14358
+ "unit": "resource",
14359
+ "unitPriceUSD": .005,
14360
+ "featureId": "analytics_read_resource"
14361
+ },
14362
+ {
14363
+ "key": "trend_read",
14364
+ "label": "Trend: Read",
14365
+ "description": "Fetching trends. Charged per resource fetched.",
14366
+ "unit": "resource",
14367
+ "unitPriceUSD": .01,
14368
+ "featureId": "trend_read_resource"
14369
+ },
14370
+ {
14371
+ "key": "owned_read",
14372
+ "label": "Owned: Read",
14373
+ "description": "Charged per resource fetched.",
14374
+ "unit": "resource",
14375
+ "unitPriceUSD": .001,
14376
+ "featureId": "owned_read_resource"
14377
+ },
14378
+ {
14379
+ "key": "interaction_delete",
14380
+ "label": "Interaction: Delete",
14381
+ "description": "Deleting interactions. Charged per request.",
14382
+ "unit": "request",
14383
+ "unitPriceUSD": .01,
14384
+ "featureId": "interaction_delete_request"
14385
+ },
14386
+ {
14387
+ "key": "content_manage",
14388
+ "label": "Content: Manage",
14389
+ "description": "Managing content (deleting or hiding posts). Charged per request.",
14390
+ "unit": "request",
14391
+ "unitPriceUSD": .005,
14392
+ "featureId": "content_manage_request"
14393
+ },
14394
+ {
14395
+ "key": "list_create",
14396
+ "label": "List: Create",
14397
+ "description": "Creating lists. Charged per request.",
14398
+ "unit": "request",
14399
+ "unitPriceUSD": .01,
14400
+ "featureId": "list_create_request"
14401
+ },
14402
+ {
14403
+ "key": "list_manage",
14404
+ "label": "List: Manage",
14405
+ "description": "Managing lists (deleting or updating). Charged per request.",
14406
+ "unit": "request",
14407
+ "unitPriceUSD": .005,
14408
+ "featureId": "list_manage_request"
14409
+ },
14410
+ {
14411
+ "key": "bookmark",
14412
+ "label": "Bookmark",
14413
+ "description": "Creating bookmarks. Charged per request.",
14414
+ "unit": "request",
14415
+ "unitPriceUSD": .005,
14416
+ "featureId": "bookmark_request"
14417
+ },
14418
+ {
14419
+ "key": "media_metadata",
14420
+ "label": "Media Metadata",
14421
+ "description": "Creating/deleting media metadata. Charged per request.",
14422
+ "unit": "request",
14423
+ "unitPriceUSD": .005,
14424
+ "featureId": "media_metadata_request"
14425
+ },
14426
+ {
14427
+ "key": "privacy_update",
14428
+ "label": "Privacy: Update",
14429
+ "description": "Updating privacy settings. Charged per request.",
14430
+ "unit": "request",
14431
+ "unitPriceUSD": .01,
14432
+ "featureId": "privacy_update_request"
14433
+ },
14434
+ {
14435
+ "key": "mute_delete",
14436
+ "label": "Mute: Delete",
14437
+ "description": "Deleting mutes. Charged per request.",
14438
+ "unit": "request",
14439
+ "unitPriceUSD": .005,
14440
+ "featureId": "mute_delete_request"
14441
+ },
14442
+ {
14443
+ "key": "counts_recent",
14444
+ "label": "Counts: Recent",
14445
+ "description": "Fetching recent counts. Charged per request.",
14446
+ "unit": "request",
14447
+ "unitPriceUSD": .005,
14448
+ "featureId": "counts_recent_request"
14449
+ },
14450
+ {
14451
+ "key": "counts_all",
14452
+ "label": "Counts: All",
14453
+ "description": "Fetching all counts. Charged per request.",
14454
+ "unit": "request",
14455
+ "unitPriceUSD": .01,
14456
+ "featureId": "counts_all_request"
14457
+ }
14458
+ ]);
14383
14459
  const X_OPERATIONS = [
14384
14460
  {
14385
14461
  schemaBaseName: "TweetsDelete",
@@ -16120,12 +16196,23 @@ const X_OPERATIONS = [
16120
16196
  //#endregion
16121
16197
  //#region ../../packages/x/src/cache.ts
16122
16198
  const xCacheableEndpointPaths = [
16199
+ "GET /lists/:id/members",
16123
16200
  "GET /tweets",
16124
16201
  "GET /tweets/:id",
16202
+ "GET /tweets/:id/liking_users",
16203
+ "GET /tweets/:id/quote_tweets",
16204
+ "GET /tweets/:id/retweeted_by",
16125
16205
  "GET /tweets/search/recent",
16206
+ "GET /users/:id",
16207
+ "GET /users/:id/bookmarks",
16126
16208
  "GET /users/:id/followers",
16127
16209
  "GET /users/:id/following",
16210
+ "GET /users/:id/liked_tweets",
16211
+ "GET /users/:id/mentions",
16212
+ "GET /users/:id/owned_lists",
16213
+ "GET /users/:id/timelines/reverse_chronological",
16128
16214
  "GET /users/:id/tweets",
16215
+ "GET /users/by/username/:username",
16129
16216
  "GET /users/me"
16130
16217
  ];
16131
16218
  const schemas = {
@@ -17919,8 +18006,9 @@ const CONNECTED_STATUS = "connected";
17919
18006
  const LEADING_AT_PATTERN$1 = /^@+/;
17920
18007
  const LINKEDIN_PROFILE_HOST_PATTERN = /(^|\.)linkedin\.com$/i;
17921
18008
  const isInteractiveTerminal$1 = (deps) => deps.isInteractiveTerminal?.() ?? process.stdout.isTTY === true;
17922
- const openURL = async (deps, url) => {
17923
- (deps.log ?? console.error)(`Opening ${url}`);
18009
+ const openURL = async (deps, url, options = {}) => {
18010
+ const log = deps.log ?? console.error;
18011
+ if (options.log ?? true) log(`Opening ${url}`);
17924
18012
  if (!(isInteractiveTerminal$1(deps) && deps.openURL)) return {
17925
18013
  opened: false,
17926
18014
  url
@@ -17998,6 +18086,10 @@ const pollForAccount$1 = async (deps, predicate, errorMessage) => {
17998
18086
  }
17999
18087
  throw new Error(errorMessage);
18000
18088
  };
18089
+ const authURLFor$1 = async (deps, operation) => ({
18090
+ url: deps.handshakeAuthURL ? await deps.handshakeAuthURL(operation) : await operation(),
18091
+ openingLogged: deps.handshakeAuthURL !== void 0
18092
+ });
18001
18093
  const accountForIdentifier = async (deps, identifier) => {
18002
18094
  const target = linkedinReconnectTargetFrom(identifier);
18003
18095
  const account = (await listLinkedinLifecycleAccounts(deps)).find((candidate) => accountMatchesReconnectTarget(candidate, target));
@@ -18014,10 +18106,11 @@ const connectLinkedinAccount = async (deps) => {
18014
18106
  await prepareAccountConnect$1(deps);
18015
18107
  const before = await listLinkedinLifecycleAccounts(deps);
18016
18108
  const existingProfileIds = new Set(before.map((account) => account.profileId));
18017
- await openURL(deps, (await deps.client.createHostedAuthURL({
18109
+ const authURL = await authURLFor$1(deps, async () => (await deps.client.createHostedAuthURL({
18018
18110
  platform: LINKEDIN_PLATFORM,
18019
18111
  mode: "create"
18020
18112
  })).url);
18113
+ await openURL(deps, authURL.url, { log: !authURL.openingLogged });
18021
18114
  return {
18022
18115
  platform: LINKEDIN_PLATFORM,
18023
18116
  status: "connected",
@@ -18026,11 +18119,12 @@ const connectLinkedinAccount = async (deps) => {
18026
18119
  };
18027
18120
  const reconnectLinkedinAccount = async (deps, identifier) => {
18028
18121
  const account = await reconnectAccountForIdentifier(deps, identifier);
18029
- await openURL(deps, (await deps.client.createHostedAuthURL({
18122
+ const authURL = await authURLFor$1(deps, async () => (await deps.client.createHostedAuthURL({
18030
18123
  platform: LINKEDIN_PLATFORM,
18031
18124
  mode: "reconnect",
18032
18125
  account: reconnectCommandTargetFor(account)
18033
18126
  })).url);
18127
+ await openURL(deps, authURL.url, { log: !authURL.openingLogged });
18034
18128
  return {
18035
18129
  platform: LINKEDIN_PLATFORM,
18036
18130
  status: "connected",
@@ -18078,8 +18172,9 @@ const connectURLFor = async (deps, reconnectProfileId) => {
18078
18172
  return url.toString();
18079
18173
  };
18080
18174
  const isInteractiveTerminal = (deps) => deps.isInteractiveTerminal?.() ?? process.stdout.isTTY === true;
18081
- const openOrPrint = async (deps, url) => {
18082
- (deps.log ?? console.error)(`Opening ${url}`);
18175
+ const openOrPrint = async (deps, url, options = {}) => {
18176
+ const log = deps.log ?? console.error;
18177
+ if (options.log ?? true) log(`Opening ${url}`);
18083
18178
  if (!(isInteractiveTerminal(deps) && deps.openBrowser)) return;
18084
18179
  await deps.openBrowser(url);
18085
18180
  };
@@ -18097,6 +18192,10 @@ const pollForAccount = async (deps, matches) => {
18097
18192
  }
18098
18193
  throw new Error("x_connect_timed_out");
18099
18194
  };
18195
+ const authURLFor = async (deps, operation) => ({
18196
+ url: deps.handshakeAuthURL ? await deps.handshakeAuthURL(operation) : await operation(),
18197
+ openingLogged: deps.handshakeAuthURL !== void 0
18198
+ });
18100
18199
  const pollForSeat$1 = async (deps) => {
18101
18200
  const sleep = deps.sleep ?? defaultSleep;
18102
18201
  const now = deps.now ?? Date.now;
@@ -18143,7 +18242,8 @@ const connectXAccount = async (deps) => {
18143
18242
  const before = await listXLifecycleAccounts(deps, true);
18144
18243
  const connectedBefore = new Set(before.filter((account) => account.status === "connected").map(accountKey));
18145
18244
  await prepareAccountConnect(deps);
18146
- await openOrPrint(deps, await connectURLFor(deps));
18245
+ const authURL = await authURLFor(deps, () => connectURLFor(deps));
18246
+ await openOrPrint(deps, authURL.url, { log: !authURL.openingLogged });
18147
18247
  return {
18148
18248
  platform: "x",
18149
18249
  status: "connected",
@@ -18154,7 +18254,8 @@ const reconnectXAccount = async (deps, args) => {
18154
18254
  assertXAccountSelector(args.account);
18155
18255
  const existing = findAccount(await listXLifecycleAccounts(deps, true), args.account);
18156
18256
  if (!existing) throw new Error("x_account_not_found");
18157
- await openOrPrint(deps, await connectURLFor(deps, existing.profileId));
18257
+ const authURL = await authURLFor(deps, () => connectURLFor(deps, existing.profileId));
18258
+ await openOrPrint(deps, authURL.url, { log: !authURL.openingLogged });
18158
18259
  return {
18159
18260
  platform: "x",
18160
18261
  status: "connected",
@@ -20739,6 +20840,9 @@ const createInstance = (defaults) => {
20739
20840
  };
20740
20841
  const ky = createInstance();
20741
20842
  //#endregion
20843
+ //#region package.json
20844
+ var version$1 = "0.2.3";
20845
+ //#endregion
20742
20846
  //#region src/lib/env.ts
20743
20847
  const URLWithTrailingSlash = url().transform(ensureTrailingSlash);
20744
20848
  const env = createEnv({
@@ -20767,7 +20871,7 @@ const env = createEnv({
20767
20871
  }
20768
20872
  });
20769
20873
  const SERVICE_NAME = "social-cli";
20770
- const VERSION = "0.2.1";
20874
+ const VERSION = version$1;
20771
20875
  const apiURL = (path) => createAbsoluteURL(env.SOCIAL_API_URL, path);
20772
20876
  //#endregion
20773
20877
  //#region src/lib/bearer.ts
@@ -27830,12 +27934,30 @@ const lifecycleConnectContract = {
27830
27934
  confirmation: false
27831
27935
  };
27832
27936
  const handleFor = (account) => account.handle.startsWith("@") ? account.handle : `@${account.handle}`;
27937
+ const authHandshakeMessage = "Handshaking auth...";
27833
27938
  const lifecycleDepsWithTextLogs = (deps) => ({
27834
27939
  ...deps,
27835
- log: (message) => writeText(deps, message)
27940
+ log: (message) => writeText(deps, message),
27941
+ handshakeAuthURL: async (operation) => {
27942
+ if (deps.ui) {
27943
+ const spinner = deps.ui.spinner();
27944
+ spinner.start(authHandshakeMessage);
27945
+ try {
27946
+ const url = await operation();
27947
+ spinner.stop(`Opening ${url}`);
27948
+ return url;
27949
+ } catch (error) {
27950
+ spinner.error(authHandshakeMessage);
27951
+ throw error;
27952
+ }
27953
+ }
27954
+ writeText(deps, authHandshakeMessage);
27955
+ const url = await operation();
27956
+ writeText(deps, `Opening ${url}`);
27957
+ return url;
27958
+ }
27836
27959
  });
27837
27960
  const runConnectOutput = async (deps, connect) => {
27838
- writeText(deps, "Handshaking auth...");
27839
27961
  writeText(deps, `${handleFor((await connect(lifecycleDepsWithTextLogs(deps))).account)} connected!`);
27840
27962
  };
27841
27963
  const createConnectPlatformCommand = (platform, run) => defineCommand({
@@ -28216,7 +28338,8 @@ const createCLIDeps = () => {
28216
28338
  url
28217
28339
  };
28218
28340
  },
28219
- writeOutput: printData
28341
+ writeOutput: printData,
28342
+ ui: createUI(process.stdout.isTTY === true)
28220
28343
  };
28221
28344
  };
28222
28345
  //#endregion
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "access": "public"
12
12
  },
13
13
  "private": false,
14
- "version": "0.2.1",
14
+ "version": "0.2.3",
15
15
  "type": "module",
16
16
  "engines": {
17
17
  "node": ">=22.5.0"