@usesocial/cli 0.13.0 → 0.15.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/dist/index.mjs +127 -3
- 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.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#90](https://github.com/usesocial/monorepo/pull/90) [`d1715ee`](https://github.com/usesocial/monorepo/commit/d1715ee18fdb6dccb433e756ec0171fd229e412d) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Print the path-free `https://mcp.usesocial.dev` URL for the hosted MCP server.
|
|
8
|
+
|
|
9
|
+
## 0.14.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#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.
|
|
14
|
+
|
|
3
15
|
## 0.13.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.mjs
CHANGED
|
@@ -10912,6 +10912,13 @@ pgTable("verification", {
|
|
|
10912
10912
|
createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(),
|
|
10913
10913
|
updatedAt: timestamp("updatedAt", { mode: "date" }).notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date())
|
|
10914
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
|
+
});
|
|
10915
10922
|
pgTable("deviceCode", {
|
|
10916
10923
|
id: text$1("id").primaryKey(),
|
|
10917
10924
|
deviceCode: text$1("deviceCode").notNull(),
|
|
@@ -10932,6 +10939,81 @@ pgTable("deviceCode", {
|
|
|
10932
10939
|
uniqueIndex("device_code_user_code_key").on(table.userCode),
|
|
10933
10940
|
index("device_code_status_expires_idx").on(table.status, table.expiresAt)
|
|
10934
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)]);
|
|
10935
11017
|
//#endregion
|
|
10936
11018
|
//#region ../../packages/db/src/schema/domain.ts
|
|
10937
11019
|
const timestamptz = (name) => timestamp(name, {
|
|
@@ -10959,6 +11041,11 @@ const connectedAccounts = pgTable("connected_accounts", {
|
|
|
10959
11041
|
check("connected_accounts_platform_check", sqlCheckIn(table.platform, PLATFORMS)),
|
|
10960
11042
|
check("connected_accounts_status_check", sqlCheckIn(table.status, CONNECTED_ACCOUNT_STATUSES))
|
|
10961
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)]);
|
|
10962
11049
|
pgTable("billing_overrides", {
|
|
10963
11050
|
email: text$1("email").primaryKey(),
|
|
10964
11051
|
userId: text$1("user_id").references(() => user.id, { onDelete: "cascade" }),
|
|
@@ -23965,7 +24052,7 @@ function createEnv(opts) {
|
|
|
23965
24052
|
}
|
|
23966
24053
|
//#endregion
|
|
23967
24054
|
//#region package.json
|
|
23968
|
-
var version$1 = "0.
|
|
24055
|
+
var version$1 = "0.15.0";
|
|
23969
24056
|
//#endregion
|
|
23970
24057
|
//#region src/lib/env.ts
|
|
23971
24058
|
const URLWithTrailingSlash = url().transform(ensureTrailingSlash);
|
|
@@ -24743,7 +24830,7 @@ const printError = (error) => {
|
|
|
24743
24830
|
outputWriters.stderr(JSON.stringify(errorPayload(error)));
|
|
24744
24831
|
};
|
|
24745
24832
|
//#endregion
|
|
24746
|
-
//#region
|
|
24833
|
+
//#region ../../packages/lib/src/validation.ts
|
|
24747
24834
|
const INTEGER_PATTERN = /^-?\d+$/;
|
|
24748
24835
|
const BOOLEAN_STRINGS = [
|
|
24749
24836
|
"true",
|
|
@@ -37536,6 +37623,42 @@ const createCLIDeps = () => {
|
|
|
37536
37623
|
};
|
|
37537
37624
|
};
|
|
37538
37625
|
//#endregion
|
|
37626
|
+
//#region src/mcp/index.ts
|
|
37627
|
+
const SOCIAL_MCP_URL = "https://mcp.usesocial.dev";
|
|
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
|
|
37539
37662
|
//#region ../../packages/lib/src/cli-schema-contract.ts
|
|
37540
37663
|
const isZodSchema = (value) => Boolean(value && typeof value === "object" && "safeParse" in value && typeof value.safeParse === "function");
|
|
37541
37664
|
const isZodUnknownSchema = (value) => value instanceof ZodUnknown;
|
|
@@ -38727,7 +38850,8 @@ const createSocialCommand = (deps = createCLIDeps()) => {
|
|
|
38727
38850
|
update: updateCommand,
|
|
38728
38851
|
x: xCommand,
|
|
38729
38852
|
linkedin: linkedinCommand,
|
|
38730
|
-
feedback: feedbackCommand
|
|
38853
|
+
feedback: feedbackCommand,
|
|
38854
|
+
mcp: mcpCommand
|
|
38731
38855
|
}
|
|
38732
38856
|
});
|
|
38733
38857
|
setSchemaRootCommand(socialCommand);
|