@usesocial/cli 0.12.3 → 0.14.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/CHANGELOG.md +12 -0
- package/README.md +2 -7
- package/dist/index.mjs +134 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @usesocial/cli
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#89](https://github.com/usesocial/monorepo/pull/89) [`2e31835`](https://github.com/usesocial/monorepo/commit/2e318350dc0bb1eeca53a36f2bc98059a07a55b3) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Add `social mcp url` for the canonical hosted Social MCP server.
|
|
8
|
+
|
|
9
|
+
## 0.13.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#88](https://github.com/usesocial/monorepo/pull/88) [`6d3c8aa`](https://github.com/usesocial/monorepo/commit/6d3c8aaaafe23d461c97048bd3589a9b53001ade) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Remove `social x sync timeline` from the supported X sync collections.
|
|
14
|
+
|
|
3
15
|
## 0.12.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ social x profile
|
|
|
64
64
|
| "Surface the ten warm contacts worth reaching out to this week." | `linkedin search people`, `linkedin reactions`, `linkedin sql` |
|
|
65
65
|
| "Pull everyone who reacted to my last LinkedIn post and flag the warm leads." | `linkedin posts <target>`, `linkedin reactions`, `linkedin profile` |
|
|
66
66
|
| "Read this creator's recent posts and break down what makes them land." | `linkedin posts <target>`, `x tweets <target>` |
|
|
67
|
-
| "Find what people are saying about AI agents this week and summarize the themes." | `linkedin search posts
|
|
67
|
+
| "Find what people are saying about AI agents this week and summarize the themes." | `linkedin search posts` |
|
|
68
68
|
| "Triage my inbox and draft replies for approval." | `sync messages`, `sql`, `linkedin message`, `x message` |
|
|
69
69
|
| "Show this week's company Page visitors and invite the approved prospects." | `linkedin page visitors`, `linkedin page invite` |
|
|
70
70
|
| "Draft a reply to this thread and post it once I approve." | `linkedin comment`, `x post` |
|
|
@@ -217,7 +217,7 @@ profile lookup is needed.
|
|
|
217
217
|
| `quotes <target>` | List quote posts of a post. | |
|
|
218
218
|
| `likers <target>` | List users who liked a post. | |
|
|
219
219
|
| `reposters <target>` | List users who reposted a post. | |
|
|
220
|
-
| `sync [collection]` | Pull your own `tweets`, `
|
|
220
|
+
| `sync [collection]` | Pull your own `tweets`, `followers`, `following`, `bookmarks`, `liked`, `mentions`, or `messages` into the local mirror; costs usage. | local |
|
|
221
221
|
| `sql [query]` | Query your local mirror with read-only SQL - free; bare `sql` prints compact schema metadata. | |
|
|
222
222
|
| `post` | Create a post (body from stdin). | write |
|
|
223
223
|
| `message <recipients>` | Send a DM (body from stdin). | write |
|
|
@@ -304,9 +304,6 @@ query it with `sql`. SQL reads show local freshness in `meta.cache.tables` and a
|
|
|
304
304
|
```sh
|
|
305
305
|
social x sql "SELECT sender_username, text FROM x_messages ORDER BY created_at DESC LIMIT 5" \
|
|
306
306
|
| jq '{cache: .meta.cache}'
|
|
307
|
-
social x sync timeline
|
|
308
|
-
social x sql "SELECT text, url FROM x_timeline ORDER BY created_at DESC LIMIT 20" \
|
|
309
|
-
| jq '{cache: .meta.cache}'
|
|
310
307
|
```
|
|
311
308
|
|
|
312
309
|
Agents should watch `.meta.cost` when it is present during high-fanout loops, use
|
|
@@ -334,8 +331,6 @@ social x sync messages
|
|
|
334
331
|
social x sql "SELECT sender_username, text FROM x_messages ORDER BY created_at DESC LIMIT 20"
|
|
335
332
|
social x sql "SELECT text, url FROM x_bookmarks ORDER BY created_at DESC LIMIT 50"
|
|
336
333
|
social x sql "SELECT username, name, followers_count FROM x_followers ORDER BY followers_count DESC LIMIT 100"
|
|
337
|
-
social x sync timeline
|
|
338
|
-
social x sql "SELECT text, url FROM x_timeline ORDER BY created_at DESC LIMIT 50"
|
|
339
334
|
|
|
340
335
|
# X live reads.
|
|
341
336
|
social x tweets profile_id:<x-user-id> --limit 30
|
package/dist/index.mjs
CHANGED
|
@@ -405,7 +405,7 @@ const U = (e) => e.status === `ok` ? {
|
|
|
405
405
|
const org = "usesocial";
|
|
406
406
|
const cliPackageName = `@${org}/cli`;
|
|
407
407
|
const cliBin = "social";
|
|
408
|
-
const skillInstallCommand = `npx skills add ${org}/skill`;
|
|
408
|
+
const skillInstallCommand = `npx --yes skills add ${org}/skill --global --yes --agent claude-code codex`;
|
|
409
409
|
const publicWebURL = "https://usesocial.dev";
|
|
410
410
|
const publicAPIURL = "https://api.usesocial.dev/v1";
|
|
411
411
|
const publicLinks = {
|
|
@@ -444,10 +444,11 @@ const cliBrand = {
|
|
|
444
444
|
installCommands: {
|
|
445
445
|
setup: `curl -fsSL ${setupScriptURL} | bash`,
|
|
446
446
|
bun: `bun install -g ${cliPackageName}`,
|
|
447
|
-
npm: `npm install -g ${cliPackageName}`,
|
|
447
|
+
npm: `npm install -g ${cliPackageName}@latest`,
|
|
448
448
|
skill: skillInstallCommand
|
|
449
449
|
}
|
|
450
450
|
};
|
|
451
|
+
`${cliBrand.installCommands.npm}${cliBrand.installCommands.skill}`;
|
|
451
452
|
h("InvalidPublicBaseURL")();
|
|
452
453
|
h("InvalidPublicRoute")();
|
|
453
454
|
const publicURLForLiteral = (route) => new URL(route, brandURLs.publicWebURL).toString();
|
|
@@ -1837,6 +1838,7 @@ const X_COLLECTIONS = [
|
|
|
1837
1838
|
pageSize: 100,
|
|
1838
1839
|
sinceField: "created_at",
|
|
1839
1840
|
expectedFields: expectedTweetFields,
|
|
1841
|
+
syncable: false,
|
|
1840
1842
|
lift: liftTweet
|
|
1841
1843
|
},
|
|
1842
1844
|
{
|
|
@@ -2011,7 +2013,7 @@ const collectionByKey = (key) => COLLECTIONS.find((collection) => collection.key
|
|
|
2011
2013
|
const collectionsFor = (platform) => COLLECTIONS.filter((collection) => collection.platform === platform);
|
|
2012
2014
|
const syncableCollectionsFor = (platform) => {
|
|
2013
2015
|
const parentKeys = new Set(COLLECTIONS.map((collection) => collection.parentCollection).filter(Boolean));
|
|
2014
|
-
return collectionsFor(platform).filter((collection) => !parentKeys.has(collection.key));
|
|
2016
|
+
return collectionsFor(platform).filter((collection) => collection.syncable !== false && !parentKeys.has(collection.key));
|
|
2015
2017
|
};
|
|
2016
2018
|
const physicalTableFor = (collection) => collection.table ?? collection.key;
|
|
2017
2019
|
const resetTablesFor = (collection) => {
|
|
@@ -10910,6 +10912,13 @@ pgTable("verification", {
|
|
|
10910
10912
|
createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(),
|
|
10911
10913
|
updatedAt: timestamp("updatedAt", { mode: "date" }).notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date())
|
|
10912
10914
|
}, (table) => [index("verification_identifier_idx").on(table.identifier)]);
|
|
10915
|
+
pgTable("jwks", {
|
|
10916
|
+
id: text$1("id").primaryKey(),
|
|
10917
|
+
publicKey: text$1("publicKey").notNull(),
|
|
10918
|
+
privateKey: text$1("privateKey").notNull(),
|
|
10919
|
+
createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(),
|
|
10920
|
+
expiresAt: timestamp("expiresAt", { mode: "date" })
|
|
10921
|
+
});
|
|
10913
10922
|
pgTable("deviceCode", {
|
|
10914
10923
|
id: text$1("id").primaryKey(),
|
|
10915
10924
|
deviceCode: text$1("deviceCode").notNull(),
|
|
@@ -10930,6 +10939,81 @@ pgTable("deviceCode", {
|
|
|
10930
10939
|
uniqueIndex("device_code_user_code_key").on(table.userCode),
|
|
10931
10940
|
index("device_code_status_expires_idx").on(table.status, table.expiresAt)
|
|
10932
10941
|
]);
|
|
10942
|
+
const oauthClient = pgTable("oauthClient", {
|
|
10943
|
+
id: text$1("id").primaryKey(),
|
|
10944
|
+
clientId: text$1("clientId").notNull().unique(),
|
|
10945
|
+
clientSecret: text$1("clientSecret"),
|
|
10946
|
+
disabled: boolean("disabled").default(false),
|
|
10947
|
+
skipConsent: boolean("skipConsent"),
|
|
10948
|
+
enableEndSession: boolean("enableEndSession"),
|
|
10949
|
+
subjectType: text$1("subjectType"),
|
|
10950
|
+
scopes: text$1("scopes").array(),
|
|
10951
|
+
userId: text$1("userId").references(() => user.id, { onDelete: "cascade" }),
|
|
10952
|
+
createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(),
|
|
10953
|
+
updatedAt: timestamp("updatedAt", { mode: "date" }).notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date()),
|
|
10954
|
+
name: text$1("name"),
|
|
10955
|
+
uri: text$1("uri"),
|
|
10956
|
+
icon: text$1("icon"),
|
|
10957
|
+
contacts: text$1("contacts").array(),
|
|
10958
|
+
tos: text$1("tos"),
|
|
10959
|
+
policy: text$1("policy"),
|
|
10960
|
+
softwareId: text$1("softwareId"),
|
|
10961
|
+
softwareVersion: text$1("softwareVersion"),
|
|
10962
|
+
softwareStatement: text$1("softwareStatement"),
|
|
10963
|
+
redirectUris: text$1("redirectUris").array().notNull(),
|
|
10964
|
+
postLogoutRedirectUris: text$1("postLogoutRedirectUris").array(),
|
|
10965
|
+
tokenEndpointAuthMethod: text$1("tokenEndpointAuthMethod"),
|
|
10966
|
+
grantTypes: text$1("grantTypes").array(),
|
|
10967
|
+
responseTypes: text$1("responseTypes").array(),
|
|
10968
|
+
public: boolean("public"),
|
|
10969
|
+
type: text$1("type"),
|
|
10970
|
+
requirePKCE: boolean("requirePKCE"),
|
|
10971
|
+
referenceId: text$1("referenceId"),
|
|
10972
|
+
metadata: jsonb("metadata").$type()
|
|
10973
|
+
}, (table) => [index("oauth_client_userId_idx").on(table.userId)]);
|
|
10974
|
+
const oauthRefreshToken = pgTable("oauthRefreshToken", {
|
|
10975
|
+
id: text$1("id").primaryKey(),
|
|
10976
|
+
token: text$1("token").notNull().unique(),
|
|
10977
|
+
clientId: text$1("clientId").notNull().references(() => oauthClient.clientId, { onDelete: "cascade" }),
|
|
10978
|
+
sessionId: text$1("sessionId").references(() => session.id, { onDelete: "set null" }),
|
|
10979
|
+
userId: text$1("userId").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
10980
|
+
referenceId: text$1("referenceId"),
|
|
10981
|
+
expiresAt: timestamp("expiresAt", { mode: "date" }).notNull(),
|
|
10982
|
+
createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(),
|
|
10983
|
+
revoked: timestamp("revoked", { mode: "date" }),
|
|
10984
|
+
authTime: timestamp("authTime", { mode: "date" }),
|
|
10985
|
+
scopes: text$1("scopes").array().notNull()
|
|
10986
|
+
}, (table) => [
|
|
10987
|
+
index("oauth_refresh_token_clientId_idx").on(table.clientId),
|
|
10988
|
+
index("oauth_refresh_token_sessionId_idx").on(table.sessionId),
|
|
10989
|
+
index("oauth_refresh_token_userId_idx").on(table.userId)
|
|
10990
|
+
]);
|
|
10991
|
+
pgTable("oauthAccessToken", {
|
|
10992
|
+
id: text$1("id").primaryKey(),
|
|
10993
|
+
token: text$1("token").notNull().unique(),
|
|
10994
|
+
clientId: text$1("clientId").notNull().references(() => oauthClient.clientId, { onDelete: "cascade" }),
|
|
10995
|
+
sessionId: text$1("sessionId").references(() => session.id, { onDelete: "set null" }),
|
|
10996
|
+
userId: text$1("userId").references(() => user.id, { onDelete: "cascade" }),
|
|
10997
|
+
referenceId: text$1("referenceId"),
|
|
10998
|
+
refreshId: text$1("refreshId").references(() => oauthRefreshToken.id, { onDelete: "cascade" }),
|
|
10999
|
+
expiresAt: timestamp("expiresAt", { mode: "date" }).notNull(),
|
|
11000
|
+
createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(),
|
|
11001
|
+
scopes: text$1("scopes").array().notNull()
|
|
11002
|
+
}, (table) => [
|
|
11003
|
+
index("oauth_access_token_clientId_idx").on(table.clientId),
|
|
11004
|
+
index("oauth_access_token_sessionId_idx").on(table.sessionId),
|
|
11005
|
+
index("oauth_access_token_userId_idx").on(table.userId),
|
|
11006
|
+
index("oauth_access_token_refreshId_idx").on(table.refreshId)
|
|
11007
|
+
]);
|
|
11008
|
+
pgTable("oauthConsent", {
|
|
11009
|
+
id: text$1("id").primaryKey(),
|
|
11010
|
+
clientId: text$1("clientId").notNull().references(() => oauthClient.clientId, { onDelete: "cascade" }),
|
|
11011
|
+
userId: text$1("userId").references(() => user.id, { onDelete: "cascade" }),
|
|
11012
|
+
referenceId: text$1("referenceId"),
|
|
11013
|
+
scopes: text$1("scopes").array().notNull(),
|
|
11014
|
+
createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(),
|
|
11015
|
+
updatedAt: timestamp("updatedAt", { mode: "date" }).notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date())
|
|
11016
|
+
}, (table) => [index("oauth_consent_clientId_idx").on(table.clientId), index("oauth_consent_userId_idx").on(table.userId)]);
|
|
10933
11017
|
//#endregion
|
|
10934
11018
|
//#region ../../packages/db/src/schema/domain.ts
|
|
10935
11019
|
const timestamptz = (name) => timestamp(name, {
|
|
@@ -10957,6 +11041,11 @@ const connectedAccounts = pgTable("connected_accounts", {
|
|
|
10957
11041
|
check("connected_accounts_platform_check", sqlCheckIn(table.platform, PLATFORMS)),
|
|
10958
11042
|
check("connected_accounts_status_check", sqlCheckIn(table.status, CONNECTED_ACCOUNT_STATUSES))
|
|
10959
11043
|
]);
|
|
11044
|
+
pgTable("account_defaults", {
|
|
11045
|
+
userId: text$1("user_id").primaryKey().references(() => user.id, { onDelete: "cascade" }),
|
|
11046
|
+
connectedAccountId: text$1("connected_account_id").notNull().references(() => connectedAccounts.id, { onDelete: "cascade" }),
|
|
11047
|
+
updatedAt: timestamptz("updated_at").notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date())
|
|
11048
|
+
}, (table) => [index("account_defaults_connected_account_idx").on(table.connectedAccountId)]);
|
|
10960
11049
|
pgTable("billing_overrides", {
|
|
10961
11050
|
email: text$1("email").primaryKey(),
|
|
10962
11051
|
userId: text$1("user_id").references(() => user.id, { onDelete: "cascade" }),
|
|
@@ -11047,6 +11136,8 @@ pgTable("wrapped", {
|
|
|
11047
11136
|
status: text$1("status", { enum: WRAPPED_STATUSES }).notNull().default("pending"),
|
|
11048
11137
|
quotedCredits: integer("quoted_credits").notNull().default(0),
|
|
11049
11138
|
billedCredits: integer("billed_credits").notNull().default(0),
|
|
11139
|
+
readCount: integer("read_count").notNull().default(0),
|
|
11140
|
+
resumeCursor: text$1("resume_cursor"),
|
|
11050
11141
|
workflowRunId: text$1("workflow_run_id"),
|
|
11051
11142
|
snapshot: jsonb("snapshot").$type(),
|
|
11052
11143
|
error: text$1("error"),
|
|
@@ -23961,7 +24052,7 @@ function createEnv(opts) {
|
|
|
23961
24052
|
}
|
|
23962
24053
|
//#endregion
|
|
23963
24054
|
//#region package.json
|
|
23964
|
-
var version$1 = "0.
|
|
24055
|
+
var version$1 = "0.14.0";
|
|
23965
24056
|
//#endregion
|
|
23966
24057
|
//#region src/lib/env.ts
|
|
23967
24058
|
const URLWithTrailingSlash = url().transform(ensureTrailingSlash);
|
|
@@ -24739,7 +24830,7 @@ const printError = (error) => {
|
|
|
24739
24830
|
outputWriters.stderr(JSON.stringify(errorPayload(error)));
|
|
24740
24831
|
};
|
|
24741
24832
|
//#endregion
|
|
24742
|
-
//#region
|
|
24833
|
+
//#region ../../packages/lib/src/validation.ts
|
|
24743
24834
|
const INTEGER_PATTERN = /^-?\d+$/;
|
|
24744
24835
|
const BOOLEAN_STRINGS = [
|
|
24745
24836
|
"true",
|
|
@@ -37532,6 +37623,42 @@ const createCLIDeps = () => {
|
|
|
37532
37623
|
};
|
|
37533
37624
|
};
|
|
37534
37625
|
//#endregion
|
|
37626
|
+
//#region src/mcp/index.ts
|
|
37627
|
+
const SOCIAL_MCP_URL = "https://mcp.usesocial.dev/mcp";
|
|
37628
|
+
const mcpCommand = defineCommand({
|
|
37629
|
+
meta: {
|
|
37630
|
+
name: "mcp",
|
|
37631
|
+
description: "Connect agents and MCP clients to Social."
|
|
37632
|
+
},
|
|
37633
|
+
subCommands: { url: defineCommand({
|
|
37634
|
+
meta: commandMeta({
|
|
37635
|
+
name: "url",
|
|
37636
|
+
description: "Print the canonical, secret-free Social MCP URL.",
|
|
37637
|
+
contract: localCLIContract({
|
|
37638
|
+
inputSchema: {
|
|
37639
|
+
type: "object",
|
|
37640
|
+
properties: { json: { type: "boolean" } }
|
|
37641
|
+
},
|
|
37642
|
+
outputSchema: {
|
|
37643
|
+
type: "object",
|
|
37644
|
+
properties: { url: { type: "string" } }
|
|
37645
|
+
}
|
|
37646
|
+
})
|
|
37647
|
+
}),
|
|
37648
|
+
args: { json: {
|
|
37649
|
+
type: "boolean",
|
|
37650
|
+
description: "Print a JSON object"
|
|
37651
|
+
} },
|
|
37652
|
+
run: ({ args }) => {
|
|
37653
|
+
if (args.json) {
|
|
37654
|
+
printData({ url: SOCIAL_MCP_URL });
|
|
37655
|
+
return;
|
|
37656
|
+
}
|
|
37657
|
+
printLine(SOCIAL_MCP_URL);
|
|
37658
|
+
}
|
|
37659
|
+
}) }
|
|
37660
|
+
});
|
|
37661
|
+
//#endregion
|
|
37535
37662
|
//#region ../../packages/lib/src/cli-schema-contract.ts
|
|
37536
37663
|
const isZodSchema = (value) => Boolean(value && typeof value === "object" && "safeParse" in value && typeof value.safeParse === "function");
|
|
37537
37664
|
const isZodUnknownSchema = (value) => value instanceof ZodUnknown;
|
|
@@ -38723,7 +38850,8 @@ const createSocialCommand = (deps = createCLIDeps()) => {
|
|
|
38723
38850
|
update: updateCommand,
|
|
38724
38851
|
x: xCommand,
|
|
38725
38852
|
linkedin: linkedinCommand,
|
|
38726
|
-
feedback: feedbackCommand
|
|
38853
|
+
feedback: feedbackCommand,
|
|
38854
|
+
mcp: mcpCommand
|
|
38727
38855
|
}
|
|
38728
38856
|
});
|
|
38729
38857
|
setSchemaRootCommand(socialCommand);
|