managed-deepagents 0.5.3-dev.111 → 0.5.3-dev.112
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/README.md +1 -12
- package/dist/channels/slack/http.d.ts.map +1 -1
- package/dist/channels/slack/http.js +3 -48
- package/dist/channels/slack/http.js.map +1 -1
- package/dist/channels/slack/index.d.ts +2 -3
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +2 -3
- package/dist/channels/slack/index.js.map +1 -1
- package/dist/connectors/mcp/index.d.ts.map +1 -1
- package/dist/connectors/mcp/index.js +5 -1
- package/dist/connectors/mcp/index.js.map +1 -1
- package/dist/connectors/mcp/load.js +3 -0
- package/dist/connectors/mcp/load.js.map +1 -1
- package/dist/connectors/tool-selection.d.ts +13 -18
- package/dist/connectors/tool-selection.d.ts.map +1 -1
- package/dist/connectors/tool-selection.js +10 -13
- package/dist/connectors/tool-selection.js.map +1 -1
- package/dist/extension.d.ts +5 -5
- package/dist/extension.js +5 -5
- package/dist/identity/credential-resolvers.d.ts +1 -13
- package/dist/identity/credential-resolvers.d.ts.map +1 -1
- package/dist/identity/credential-resolvers.js +1 -32
- package/dist/identity/credential-resolvers.js.map +1 -1
- package/dist/identity/github/credentials-store.d.ts +3 -3
- package/dist/identity/github/credentials-store.js +4 -4
- package/dist/identity/github/credentials-store.js.map +1 -1
- package/dist/identity/github/credentials.d.ts +7 -9
- package/dist/identity/github/credentials.d.ts.map +1 -1
- package/dist/identity/github/credentials.js +4 -22
- package/dist/identity/github/credentials.js.map +1 -1
- package/dist/identity/github/index.d.ts +1 -3
- package/dist/identity/github/index.d.ts.map +1 -1
- package/dist/identity/github/index.js +1 -2
- package/dist/identity/github/index.js.map +1 -1
- package/dist/identity/index.d.ts +1 -8
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +0 -11
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/options.d.ts +3 -3
- package/dist/identity/options.js +3 -9
- package/dist/identity/options.js.map +1 -1
- package/dist/identity/slack/links.d.ts +1 -2
- package/dist/identity/slack/links.d.ts.map +1 -1
- package/dist/identity/slack/links.js +1 -2
- package/dist/identity/slack/links.js.map +1 -1
- package/dist/identity/types.d.ts +8 -29
- package/dist/identity/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/namespaces.d.ts +5 -177
- package/dist/namespaces.d.ts.map +1 -1
- package/dist/namespaces.js +1 -57
- package/dist/namespaces.js.map +1 -1
- package/dist/runtime/auth.d.ts +1 -1
- package/dist/runtime/auth.js +1 -1
- package/dist/runtime/cors.d.ts +1 -0
- package/dist/runtime/cors.d.ts.map +1 -1
- package/dist/runtime/cors.js +1 -1
- package/dist/runtime/cors.js.map +1 -1
- package/dist/runtime/credentials.d.ts +1 -1
- package/dist/runtime/credentials.js +1 -1
- package/dist/runtime/identity-http.d.ts.map +1 -1
- package/dist/runtime/identity-http.js +0 -69
- package/dist/runtime/identity-http.js.map +1 -1
- package/dist/runtime/index.d.ts +0 -8
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +0 -35
- package/dist/runtime/index.js.map +1 -1
- package/package.json +12 -14
- package/dist/connectors/marketplace/catalog.d.ts +0 -96
- package/dist/connectors/marketplace/catalog.d.ts.map +0 -1
- package/dist/connectors/marketplace/catalog.js +0 -213
- package/dist/connectors/marketplace/catalog.js.map +0 -1
- package/dist/connectors/marketplace/fleet-mcp.d.ts +0 -62
- package/dist/connectors/marketplace/fleet-mcp.d.ts.map +0 -1
- package/dist/connectors/marketplace/fleet-mcp.js +0 -215
- package/dist/connectors/marketplace/fleet-mcp.js.map +0 -1
- package/dist/connectors/marketplace/index.d.ts +0 -31
- package/dist/connectors/marketplace/index.d.ts.map +0 -1
- package/dist/connectors/marketplace/index.js +0 -39
- package/dist/connectors/marketplace/index.js.map +0 -1
- package/dist/connectors/marketplace/load.d.ts +0 -14
- package/dist/connectors/marketplace/load.d.ts.map +0 -1
- package/dist/connectors/marketplace/load.js +0 -206
- package/dist/connectors/marketplace/load.js.map +0 -1
- package/dist/connectors/slack/index.d.ts +0 -24
- package/dist/connectors/slack/index.d.ts.map +0 -1
- package/dist/connectors/slack/index.js +0 -64
- package/dist/connectors/slack/index.js.map +0 -1
- package/dist/connectors/toolserver/catalog.d.ts +0 -326
- package/dist/connectors/toolserver/catalog.d.ts.map +0 -1
- package/dist/connectors/toolserver/catalog.js +0 -415
- package/dist/connectors/toolserver/catalog.js.map +0 -1
- package/dist/connectors/toolserver/connectors.d.ts +0 -698
- package/dist/connectors/toolserver/connectors.d.ts.map +0 -1
- package/dist/connectors/toolserver/connectors.js +0 -13
- package/dist/connectors/toolserver/connectors.js.map +0 -1
- package/dist/connectors/toolserver/index.d.ts +0 -142
- package/dist/connectors/toolserver/index.d.ts.map +0 -1
- package/dist/connectors/toolserver/index.js +0 -105
- package/dist/connectors/toolserver/index.js.map +0 -1
- package/dist/connectors/toolserver/integrations.d.ts +0 -103
- package/dist/connectors/toolserver/integrations.d.ts.map +0 -1
- package/dist/connectors/toolserver/integrations.js +0 -288
- package/dist/connectors/toolserver/integrations.js.map +0 -1
- package/dist/connectors/toolserver/load.d.ts +0 -55
- package/dist/connectors/toolserver/load.d.ts.map +0 -1
- package/dist/connectors/toolserver/load.js +0 -289
- package/dist/connectors/toolserver/load.js.map +0 -1
- package/dist/identity/actor-subject.d.ts +0 -60
- package/dist/identity/actor-subject.d.ts.map +0 -1
- package/dist/identity/actor-subject.js +0 -107
- package/dist/identity/actor-subject.js.map +0 -1
- package/dist/identity/byo-oauth.d.ts +0 -105
- package/dist/identity/byo-oauth.d.ts.map +0 -1
- package/dist/identity/byo-oauth.js +0 -190
- package/dist/identity/byo-oauth.js.map +0 -1
- package/dist/identity/connect-inference.d.ts +0 -37
- package/dist/identity/connect-inference.d.ts.map +0 -1
- package/dist/identity/connect-inference.js +0 -53
- package/dist/identity/connect-inference.js.map +0 -1
- package/dist/identity/connect-paths.d.ts +0 -8
- package/dist/identity/connect-paths.d.ts.map +0 -1
- package/dist/identity/connect-paths.js +0 -11
- package/dist/identity/connect-paths.js.map +0 -1
- package/dist/identity/connect-provider-types.d.ts +0 -97
- package/dist/identity/connect-provider-types.d.ts.map +0 -1
- package/dist/identity/connect-provider-types.js +0 -10
- package/dist/identity/connect-provider-types.js.map +0 -1
- package/dist/identity/connect-provider.d.ts +0 -35
- package/dist/identity/connect-provider.d.ts.map +0 -1
- package/dist/identity/connect-provider.js +0 -148
- package/dist/identity/connect-provider.js.map +0 -1
- package/dist/identity/define-fleet-connect.d.ts +0 -53
- package/dist/identity/define-fleet-connect.d.ts.map +0 -1
- package/dist/identity/define-fleet-connect.js +0 -76
- package/dist/identity/define-fleet-connect.js.map +0 -1
- package/dist/identity/fleet-connect-hint.d.ts +0 -41
- package/dist/identity/fleet-connect-hint.d.ts.map +0 -1
- package/dist/identity/fleet-connect-hint.js +0 -190
- package/dist/identity/fleet-connect-hint.js.map +0 -1
- package/dist/identity/fleet-connect.d.ts +0 -93
- package/dist/identity/fleet-connect.d.ts.map +0 -1
- package/dist/identity/fleet-connect.js +0 -256
- package/dist/identity/fleet-connect.js.map +0 -1
- package/dist/identity/fleet-integration-connect.d.ts +0 -32
- package/dist/identity/fleet-integration-connect.d.ts.map +0 -1
- package/dist/identity/fleet-integration-connect.js +0 -35
- package/dist/identity/fleet-integration-connect.js.map +0 -1
- package/dist/identity/fleet.d.ts +0 -56
- package/dist/identity/fleet.d.ts.map +0 -1
- package/dist/identity/fleet.js +0 -131
- package/dist/identity/fleet.js.map +0 -1
- package/dist/identity/github/connect-http.d.ts +0 -37
- package/dist/identity/github/connect-http.d.ts.map +0 -1
- package/dist/identity/github/connect-http.js +0 -128
- package/dist/identity/github/connect-http.js.map +0 -1
- package/dist/identity/github/oauth.d.ts +0 -47
- package/dist/identity/github/oauth.d.ts.map +0 -1
- package/dist/identity/github/oauth.js +0 -124
- package/dist/identity/github/oauth.js.map +0 -1
- package/dist/identity/google/connect-http.d.ts +0 -37
- package/dist/identity/google/connect-http.d.ts.map +0 -1
- package/dist/identity/google/connect-http.js +0 -42
- package/dist/identity/google/connect-http.js.map +0 -1
- package/dist/identity/google/index.d.ts +0 -7
- package/dist/identity/google/index.d.ts.map +0 -1
- package/dist/identity/google/index.js +0 -6
- package/dist/identity/google/index.js.map +0 -1
- package/dist/identity/google/oauth.d.ts +0 -22
- package/dist/identity/google/oauth.d.ts.map +0 -1
- package/dist/identity/google/oauth.js +0 -48
- package/dist/identity/google/oauth.js.map +0 -1
- package/dist/identity/linkedin/connect-http.d.ts +0 -37
- package/dist/identity/linkedin/connect-http.d.ts.map +0 -1
- package/dist/identity/linkedin/connect-http.js +0 -41
- package/dist/identity/linkedin/connect-http.js.map +0 -1
- package/dist/identity/linkedin/index.d.ts +0 -7
- package/dist/identity/linkedin/index.d.ts.map +0 -1
- package/dist/identity/linkedin/index.js +0 -6
- package/dist/identity/linkedin/index.js.map +0 -1
- package/dist/identity/linkedin/oauth.d.ts +0 -22
- package/dist/identity/linkedin/oauth.d.ts.map +0 -1
- package/dist/identity/linkedin/oauth.js +0 -47
- package/dist/identity/linkedin/oauth.js.map +0 -1
- package/dist/identity/marketplace/connect-hint.d.ts +0 -31
- package/dist/identity/marketplace/connect-hint.d.ts.map +0 -1
- package/dist/identity/marketplace/connect-hint.js +0 -59
- package/dist/identity/marketplace/connect-hint.js.map +0 -1
- package/dist/identity/marketplace/connect.d.ts +0 -51
- package/dist/identity/marketplace/connect.d.ts.map +0 -1
- package/dist/identity/marketplace/connect.js +0 -88
- package/dist/identity/marketplace/connect.js.map +0 -1
- package/dist/identity/marketplace/index.d.ts +0 -9
- package/dist/identity/marketplace/index.d.ts.map +0 -1
- package/dist/identity/marketplace/index.js +0 -9
- package/dist/identity/marketplace/index.js.map +0 -1
- package/dist/identity/microsoft/connect-http.d.ts +0 -38
- package/dist/identity/microsoft/connect-http.d.ts.map +0 -1
- package/dist/identity/microsoft/connect-http.js +0 -42
- package/dist/identity/microsoft/connect-http.js.map +0 -1
- package/dist/identity/microsoft/index.d.ts +0 -7
- package/dist/identity/microsoft/index.d.ts.map +0 -1
- package/dist/identity/microsoft/index.js +0 -6
- package/dist/identity/microsoft/index.js.map +0 -1
- package/dist/identity/microsoft/oauth.d.ts +0 -24
- package/dist/identity/microsoft/oauth.d.ts.map +0 -1
- package/dist/identity/microsoft/oauth.js +0 -65
- package/dist/identity/microsoft/oauth.js.map +0 -1
- package/dist/identity/oauth-env.d.ts +0 -43
- package/dist/identity/oauth-env.d.ts.map +0 -1
- package/dist/identity/oauth-env.js +0 -66
- package/dist/identity/oauth-env.js.map +0 -1
- package/dist/identity/oauth-tickets.d.ts +0 -37
- package/dist/identity/oauth-tickets.d.ts.map +0 -1
- package/dist/identity/oauth-tickets.js +0 -114
- package/dist/identity/oauth-tickets.js.map +0 -1
- package/dist/identity/slack/connect-http.d.ts +0 -35
- package/dist/identity/slack/connect-http.d.ts.map +0 -1
- package/dist/identity/slack/connect-http.js +0 -115
- package/dist/identity/slack/connect-http.js.map +0 -1
- package/dist/identity/slack/index.d.ts +0 -8
- package/dist/identity/slack/index.d.ts.map +0 -1
- package/dist/identity/slack/index.js +0 -7
- package/dist/identity/slack/index.js.map +0 -1
- package/dist/identity/slack/oauth.d.ts +0 -28
- package/dist/identity/slack/oauth.d.ts.map +0 -1
- package/dist/identity/slack/oauth.js +0 -87
- package/dist/identity/slack/oauth.js.map +0 -1
- package/dist/identity/x/connect-http.d.ts +0 -38
- package/dist/identity/x/connect-http.d.ts.map +0 -1
- package/dist/identity/x/connect-http.js +0 -41
- package/dist/identity/x/connect-http.js.map +0 -1
- package/dist/identity/x/index.d.ts +0 -6
- package/dist/identity/x/index.d.ts.map +0 -1
- package/dist/identity/x/index.js +0 -5
- package/dist/identity/x/index.js.map +0 -1
- package/types/index.d.ts +0 -6
- package/types/markdown-md.d.ts +0 -14
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect-with-Slack — {@link IdentityConnectProvider} for Slack OIDC linking.
|
|
3
|
-
*
|
|
4
|
-
* Mounted under `/identity/slack/*` when listed on `identity.connect`, or when
|
|
5
|
-
* a Slack channel routes into a user-scoped / custom-credentials deployment
|
|
6
|
-
* (so Events can remap actors and tools can use per-caller tokens).
|
|
7
|
-
*/
|
|
8
|
-
import { buildIdentityLinkRecord, getIdentityLinkStore, } from "./links.js";
|
|
9
|
-
import { buildSlackAuthorizeUrl, exchangeSlackOidcCode, MDA_PUBLIC_APP_URL_ENV, OAUTH_STATE_SIGNING_KEY_ENV, readOauthStateSigningKey, readSlackOidcConfig, resolveOauthRedirectBase, slackOauthTickets, } from "./oauth.js";
|
|
10
|
-
import { identityConnectPaths } from "../connect-paths.js";
|
|
11
|
-
import { hasChannelForProvider, isUserScopedDeployment, } from "../connect-inference.js";
|
|
12
|
-
const PATHS = identityConnectPaths("slack");
|
|
13
|
-
export const SLACK_CONNECT_STATUS_PATH = PATHS.status;
|
|
14
|
-
export const SLACK_CONNECT_START_PATH = PATHS.connect;
|
|
15
|
-
export const SLACK_CONNECT_CALLBACK_PATH = PATHS.callback;
|
|
16
|
-
export const SLACK_CONNECT_LINK_PATH = PATHS.link;
|
|
17
|
-
/** Build a Slack connect provider (injectable store for tests). */
|
|
18
|
-
export function createSlackIdentityConnectProvider(options = {}) {
|
|
19
|
-
const store = () => options.linkStore ?? getIdentityLinkStore();
|
|
20
|
-
return {
|
|
21
|
-
id: "slack",
|
|
22
|
-
shouldMount(ctx) {
|
|
23
|
-
if (!ctx.hasIdentity) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
// Listed on `identity.connect` — the author already opted in. Otherwise
|
|
27
|
-
// mount only when a Slack channel routes into a per-user deployment,
|
|
28
|
-
// which is exactly when there is a Slack account worth linking.
|
|
29
|
-
return (ctx.declared !== false ||
|
|
30
|
-
(hasChannelForProvider(ctx.channels, "slack") &&
|
|
31
|
-
isUserScopedDeployment(ctx.scope)));
|
|
32
|
-
},
|
|
33
|
-
async status(userId) {
|
|
34
|
-
const link = await store().getByUserId(userId);
|
|
35
|
-
return {
|
|
36
|
-
linked: Boolean(link),
|
|
37
|
-
...(link
|
|
38
|
-
? {
|
|
39
|
-
slackUserId: link.slackUserId,
|
|
40
|
-
slackKey: link.slackKey,
|
|
41
|
-
linkedAt: link.linkedAt,
|
|
42
|
-
}
|
|
43
|
-
: {}),
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
async startAuthorize(userId, redirectUri) {
|
|
47
|
-
const oauth = readSlackOidcConfig();
|
|
48
|
-
const stateKey = readOauthStateSigningKey();
|
|
49
|
-
if (!oauth || !stateKey) {
|
|
50
|
-
return {
|
|
51
|
-
notConfigured: true,
|
|
52
|
-
error: `Slack connect is not configured (set SLACK_CLIENT_ID, SLACK_CLIENT_SECRET, MDA_PUBLIC_APP_URL, ${OAUTH_STATE_SIGNING_KEY_ENV})`,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const state = await slackOauthTickets.createState(userId, stateKey);
|
|
56
|
-
return {
|
|
57
|
-
authorizeUrl: buildSlackAuthorizeUrl(oauth, state, redirectUri),
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
async completeCallback(code, state, redirectUri) {
|
|
61
|
-
const oauth = readSlackOidcConfig();
|
|
62
|
-
if (!oauth) {
|
|
63
|
-
throw new Error("Slack OAuth is not configured");
|
|
64
|
-
}
|
|
65
|
-
const stateKey = readOauthStateSigningKey();
|
|
66
|
-
if (!stateKey) {
|
|
67
|
-
throw new Error(`${OAUTH_STATE_SIGNING_KEY_ENV} is not configured`);
|
|
68
|
-
}
|
|
69
|
-
const { userId } = await slackOauthTickets.verifyState(state, stateKey);
|
|
70
|
-
const slackIdentity = await exchangeSlackOidcCode(oauth, code, redirectUri);
|
|
71
|
-
const teamId = slackIdentity.teamId ?? oauth.teamId;
|
|
72
|
-
const record = buildIdentityLinkRecord({
|
|
73
|
-
userId,
|
|
74
|
-
slackUserId: slackIdentity.userId,
|
|
75
|
-
...(teamId ? { slackTeamId: teamId } : {}),
|
|
76
|
-
...(slackIdentity.email ? { email: slackIdentity.email } : {}),
|
|
77
|
-
});
|
|
78
|
-
await store().upsert(record);
|
|
79
|
-
return {
|
|
80
|
-
successRedirect: `${oauth.publicAppUrl}/settings?slack=connected`,
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
async unlink(userId) {
|
|
84
|
-
await store().removeByUserId(userId);
|
|
85
|
-
},
|
|
86
|
-
resolveRedirectBase(options) {
|
|
87
|
-
return resolveOauthRedirectBase(options);
|
|
88
|
-
},
|
|
89
|
-
resolvePublicAppUrl() {
|
|
90
|
-
const oauth = readSlackOidcConfig();
|
|
91
|
-
return (oauth?.publicAppUrl ??
|
|
92
|
-
process.env[MDA_PUBLIC_APP_URL_ENV]?.replace(/\/$/, ""));
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
/** Default Slack connect provider used by the identity-connect registry. */
|
|
97
|
-
export const slackIdentityConnectProvider = createSlackIdentityConnectProvider();
|
|
98
|
-
/**
|
|
99
|
-
* Opt into Connect-with-Slack on `defineIdentity({ connect: […] })`.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```ts
|
|
103
|
-
* import { connect, defineIdentity } from "managed-deepagents";
|
|
104
|
-
*
|
|
105
|
-
* export const identity = defineIdentity({
|
|
106
|
-
* connect: [connect.slack()],
|
|
107
|
-
* });
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
export function connect(options) {
|
|
111
|
-
return options
|
|
112
|
-
? createSlackIdentityConnectProvider(options)
|
|
113
|
-
: slackIdentityConnectProvider;
|
|
114
|
-
}
|
|
115
|
-
//# sourceMappingURL=connect-http.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect-http.js","sourceRoot":"","sources":["../../../src/identity/slack/connect-http.ts"],"names":[],"mappings":"AA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GAWG;AACH,MAAM,UAAU,OAAO,CACrB,OAA6C;IAE7C,OAAO,OAAO;QACZ,CAAC,CAAC,kCAAkC,CAAC,OAAO,CAAC;QAC7C,CAAC,CAAC,4BAA4B,CAAC;AACnC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slack identity helpers — Connect-with-Slack opt-in for `defineIdentity`.
|
|
3
|
-
*
|
|
4
|
-
* Slack Events / messaging authoring lives on `connectors.slack`.
|
|
5
|
-
*/
|
|
6
|
-
export { connect, createSlackIdentityConnectProvider, slackIdentityConnectProvider, SLACK_CONNECT_CALLBACK_PATH, SLACK_CONNECT_LINK_PATH, SLACK_CONNECT_START_PATH, SLACK_CONNECT_STATUS_PATH, } from "./connect-http.js";
|
|
7
|
-
export type { SlackIdentityConnectProviderOptions } from "./connect-http.js";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/identity/slack/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,OAAO,EACP,kCAAkC,EAClC,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slack identity helpers — Connect-with-Slack opt-in for `defineIdentity`.
|
|
3
|
-
*
|
|
4
|
-
* Slack Events / messaging authoring lives on `connectors.slack`.
|
|
5
|
-
*/
|
|
6
|
-
export { connect, createSlackIdentityConnectProvider, slackIdentityConnectProvider, SLACK_CONNECT_CALLBACK_PATH, SLACK_CONNECT_LINK_PATH, SLACK_CONNECT_START_PATH, SLACK_CONNECT_STATUS_PATH, } from "./connect-http.js";
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/identity/slack/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,OAAO,EACP,kCAAkC,EAClC,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slack OpenID Connect helpers for Connect-with-Slack account linking.
|
|
3
|
-
*/
|
|
4
|
-
export { MDA_PUBLIC_API_URL_ENV, MDA_PUBLIC_APP_URL_ENV, OAUTH_STATE_SIGNING_KEY_ENV, readOauthStateSigningKey, resolveOauthRedirectBase, resolveSlackOauthRedirectBase, } from "../oauth-env.js";
|
|
5
|
-
export declare const SLACK_CLIENT_ID_ENV = "SLACK_CLIENT_ID";
|
|
6
|
-
export declare const SLACK_CLIENT_SECRET_ENV = "SLACK_CLIENT_SECRET";
|
|
7
|
-
export declare const SLACK_TEAM_ID_ENV = "SLACK_TEAM_ID";
|
|
8
|
-
/** Override Slack OIDC base (tests). */
|
|
9
|
-
export declare const SLACK_OIDC_BASE_ENV = "SLACK_OIDC_BASE";
|
|
10
|
-
/** Slack-bound OAuth state / connect-ticket helpers. */
|
|
11
|
-
export declare const slackOauthTickets: import("../oauth-tickets.js").OauthTickets;
|
|
12
|
-
export interface SlackOidcConfig {
|
|
13
|
-
clientId: string;
|
|
14
|
-
clientSecret: string;
|
|
15
|
-
teamId?: string;
|
|
16
|
-
publicAppUrl: string;
|
|
17
|
-
oidcBase: string;
|
|
18
|
-
}
|
|
19
|
-
export interface SlackOidcIdentity {
|
|
20
|
-
userId: string;
|
|
21
|
-
teamId?: string;
|
|
22
|
-
email?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare function readSlackOidcConfig(env?: NodeJS.ProcessEnv): SlackOidcConfig | null;
|
|
25
|
-
export declare function slackConnectUrl(publicAppUrl: string): string;
|
|
26
|
-
export declare function buildSlackAuthorizeUrl(config: SlackOidcConfig, state: string, redirectUri: string): string;
|
|
27
|
-
export declare function exchangeSlackOidcCode(config: SlackOidcConfig, code: string, redirectUri: string): Promise<SlackOidcIdentity>;
|
|
28
|
-
//# sourceMappingURL=oauth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/identity/slack/oauth.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAC7D,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,wCAAwC;AACxC,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAIrD,wDAAwD;AACxD,eAAO,MAAM,iBAAiB,4CAA2B,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,mBAAmB,CACjC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,eAAe,GAAG,IAAI,CAmBxB;AAED,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,MAAM,CAWR;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,CAAC,CA4D5B"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slack OpenID Connect helpers for Connect-with-Slack account linking.
|
|
3
|
-
*/
|
|
4
|
-
import { fetchWithTimeout, PROVIDER_HTTP_TIMEOUT_MS, } from "../../runtime/http.js";
|
|
5
|
-
import { oauthTicketsFor } from "../oauth-tickets.js";
|
|
6
|
-
import { MDA_PUBLIC_APP_URL_ENV } from "../oauth-env.js";
|
|
7
|
-
export { MDA_PUBLIC_API_URL_ENV, MDA_PUBLIC_APP_URL_ENV, OAUTH_STATE_SIGNING_KEY_ENV, readOauthStateSigningKey, resolveOauthRedirectBase, resolveSlackOauthRedirectBase, } from "../oauth-env.js";
|
|
8
|
-
export const SLACK_CLIENT_ID_ENV = "SLACK_CLIENT_ID";
|
|
9
|
-
export const SLACK_CLIENT_SECRET_ENV = "SLACK_CLIENT_SECRET";
|
|
10
|
-
export const SLACK_TEAM_ID_ENV = "SLACK_TEAM_ID";
|
|
11
|
-
/** Override Slack OIDC base (tests). */
|
|
12
|
-
export const SLACK_OIDC_BASE_ENV = "SLACK_OIDC_BASE";
|
|
13
|
-
const DEFAULT_OIDC_BASE = "https://slack.com";
|
|
14
|
-
/** Slack-bound OAuth state / connect-ticket helpers. */
|
|
15
|
-
export const slackOauthTickets = oauthTicketsFor("slack");
|
|
16
|
-
export function readSlackOidcConfig(env = process.env) {
|
|
17
|
-
const clientId = env[SLACK_CLIENT_ID_ENV]?.trim();
|
|
18
|
-
const clientSecret = env[SLACK_CLIENT_SECRET_ENV]?.trim();
|
|
19
|
-
const publicAppUrl = env[MDA_PUBLIC_APP_URL_ENV]?.trim();
|
|
20
|
-
if (!clientId || !clientSecret || !publicAppUrl) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
clientId,
|
|
25
|
-
clientSecret,
|
|
26
|
-
...(env[SLACK_TEAM_ID_ENV]?.trim()
|
|
27
|
-
? { teamId: env[SLACK_TEAM_ID_ENV].trim() }
|
|
28
|
-
: {}),
|
|
29
|
-
publicAppUrl: publicAppUrl.replace(/\/$/, ""),
|
|
30
|
-
oidcBase: (env[SLACK_OIDC_BASE_ENV]?.trim() || DEFAULT_OIDC_BASE).replace(/\/$/, ""),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export function slackConnectUrl(publicAppUrl) {
|
|
34
|
-
return `${publicAppUrl.replace(/\/$/, "")}/settings`;
|
|
35
|
-
}
|
|
36
|
-
export function buildSlackAuthorizeUrl(config, state, redirectUri) {
|
|
37
|
-
const url = new URL(`${config.oidcBase}/openid/connect/authorize`);
|
|
38
|
-
url.searchParams.set("response_type", "code");
|
|
39
|
-
url.searchParams.set("client_id", config.clientId);
|
|
40
|
-
url.searchParams.set("scope", "openid email profile");
|
|
41
|
-
url.searchParams.set("redirect_uri", redirectUri);
|
|
42
|
-
url.searchParams.set("state", state);
|
|
43
|
-
if (config.teamId) {
|
|
44
|
-
url.searchParams.set("team", config.teamId);
|
|
45
|
-
}
|
|
46
|
-
return url.toString();
|
|
47
|
-
}
|
|
48
|
-
export async function exchangeSlackOidcCode(config, code, redirectUri) {
|
|
49
|
-
const tokenUrl = `${config.oidcBase}/api/openid.connect.token`;
|
|
50
|
-
const body = new URLSearchParams({
|
|
51
|
-
client_id: config.clientId,
|
|
52
|
-
client_secret: config.clientSecret,
|
|
53
|
-
code,
|
|
54
|
-
redirect_uri: redirectUri,
|
|
55
|
-
grant_type: "authorization_code",
|
|
56
|
-
});
|
|
57
|
-
const tokenResponse = await fetchWithTimeout(tokenUrl, {
|
|
58
|
-
method: "POST",
|
|
59
|
-
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
60
|
-
body,
|
|
61
|
-
}, PROVIDER_HTTP_TIMEOUT_MS);
|
|
62
|
-
const tokenJson = (await tokenResponse.json());
|
|
63
|
-
if (!tokenResponse.ok || tokenJson.ok === false || !tokenJson.access_token) {
|
|
64
|
-
throw new Error(tokenJson.error ?? "Slack OIDC token exchange failed");
|
|
65
|
-
}
|
|
66
|
-
const userInfoUrl = `${config.oidcBase}/api/openid.connect.userInfo`;
|
|
67
|
-
const userResponse = await fetchWithTimeout(userInfoUrl, { headers: { Authorization: `Bearer ${tokenJson.access_token}` } }, PROVIDER_HTTP_TIMEOUT_MS);
|
|
68
|
-
const userJson = (await userResponse.json());
|
|
69
|
-
if (!userResponse.ok || userJson.ok === false) {
|
|
70
|
-
throw new Error(userJson.error ?? "Slack OIDC userInfo failed");
|
|
71
|
-
}
|
|
72
|
-
const userId = userJson["https://slack.com/user_id"] ??
|
|
73
|
-
(typeof userJson.sub === "string"
|
|
74
|
-
? userJson.sub.split("|").pop()
|
|
75
|
-
: undefined);
|
|
76
|
-
if (!userId) {
|
|
77
|
-
throw new Error("Slack OIDC userInfo missing user id");
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
userId,
|
|
81
|
-
...(userJson["https://slack.com/team_id"]
|
|
82
|
-
? { teamId: userJson["https://slack.com/team_id"] }
|
|
83
|
-
: {}),
|
|
84
|
-
...(typeof userJson.email === "string" ? { email: userJson.email } : {}),
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=oauth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/identity/slack/oauth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAi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AM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IACD,OAAO;QACL,MAAM;QACN,GAAG,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YACvC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,2BAA2B,CAAC,EAAE;YACnD,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzE,CAAC;AACJ,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect-with-X — thin adapter over {@link defineFleetVaultConnect}.
|
|
3
|
-
*
|
|
4
|
-
* Mounted under `/identity/x/*` when listed on `identity.connect`, or inferred
|
|
5
|
-
* from `connectors.x` on a user-scoped deployment. OAuth uses Fleet
|
|
6
|
-
* auth-sessions against the reserved `twitter-oauth-provider` slug (PKCE is
|
|
7
|
-
* handled by Host); there is no local BYO client path.
|
|
8
|
-
*/
|
|
9
|
-
import type { FleetVaultConnectProviderOptions } from "../fleet-connect.js";
|
|
10
|
-
export declare const X_CONNECT_STATUS_PATH: string;
|
|
11
|
-
export declare const X_CONNECT_START_PATH: string;
|
|
12
|
-
export declare const X_CONNECT_CALLBACK_PATH: string;
|
|
13
|
-
export declare const X_CONNECT_LINK_PATH: string;
|
|
14
|
-
export declare const isXActorSubjectEnabled: () => boolean;
|
|
15
|
-
export declare const enableXActorSubject: () => void;
|
|
16
|
-
/**
|
|
17
|
-
* Enable actor-subject mode when X connectors imply per-user vault subjects.
|
|
18
|
-
*
|
|
19
|
-
* Prefer {@link enableActorSubjectIntegrationsFromConnectors} at compile seams.
|
|
20
|
-
*/
|
|
21
|
-
export declare const enableXActorSubjectFromConnectors: (connectorKinds: readonly (string | undefined)[] | undefined, scope?: import("../connect-provider-types.js").IdentityConnectMountContext["scope"]) => void;
|
|
22
|
-
export declare const resetXActorSubjectEnabledForTests: () => void;
|
|
23
|
-
export declare const isXConnectConfigured: (env?: NodeJS.ProcessEnv) => boolean;
|
|
24
|
-
export declare const xConnectUrl: (publicAppUrl: string) => string;
|
|
25
|
-
/** Options for {@link createXIdentityConnectProvider}. */
|
|
26
|
-
export type XIdentityConnectProviderOptions = Pick<FleetVaultConnectProviderOptions, "providerSlug" | "scopes" | "fleet">;
|
|
27
|
-
/** Build an X connect provider (Fleet auth-sessions / twitter-oauth-provider). */
|
|
28
|
-
export declare const createXIdentityConnectProvider: (options?: Pick<FleetVaultConnectProviderOptions, "providerSlug" | "scopes" | "fleet">) => import("../connect-provider-types.js").IdentityConnectProvider;
|
|
29
|
-
/** Default X connect provider used as a built-in mount candidate. */
|
|
30
|
-
export declare const xIdentityConnectProvider: import("../connect-provider-types.js").IdentityConnectProvider;
|
|
31
|
-
/**
|
|
32
|
-
* Opt into Connect-with-X on `defineIdentity({ connect: […] })`.
|
|
33
|
-
*
|
|
34
|
-
* Usually unnecessary: declaring `connectors.x` on a user-scoped identity
|
|
35
|
-
* deployment mounts this provider and derives OAuth scopes automatically.
|
|
36
|
-
*/
|
|
37
|
-
export declare const connect: (options?: Pick<FleetVaultConnectProviderOptions, "providerSlug" | "scopes" | "fleet">) => import("../connect-provider-types.js").IdentityConnectProvider;
|
|
38
|
-
//# sourceMappingURL=connect-http.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect-http.d.ts","sourceRoot":"","sources":["../../../src/identity/x/connect-http.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AAO5E,eAAO,MAAM,qBAAqB,QAAiB,CAAC;AACpD,eAAO,MAAM,oBAAoB,QAAkB,CAAC;AACpD,eAAO,MAAM,uBAAuB,QAAmB,CAAC;AACxD,eAAO,MAAM,mBAAmB,QAAe,CAAC;AAEhD,eAAO,MAAM,sBAAsB,eAA0B,CAAC;AAC9D,eAAO,MAAM,mBAAmB,YAAuB,CAAC;AACxD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,4JACV,CAAC;AACrC,eAAO,MAAM,iCAAiC,YACV,CAAC;AACrC,eAAO,MAAM,oBAAoB,sCAAwB,CAAC;AAC1D,eAAO,MAAM,WAAW,kCAAe,CAAC;AAExC,0DAA0D;AAC1D,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAChD,gCAAgC,EAChC,cAAc,GAAG,QAAQ,GAAG,OAAO,CACpC,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,8BAA8B,2JAAmB,CAAC;AAE/D,qEAAqE;AACrE,eAAO,MAAM,wBAAwB,gEAAa,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,2JAAY,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect-with-X — thin adapter over {@link defineFleetVaultConnect}.
|
|
3
|
-
*
|
|
4
|
-
* Mounted under `/identity/x/*` when listed on `identity.connect`, or inferred
|
|
5
|
-
* from `connectors.x` on a user-scoped deployment. OAuth uses Fleet
|
|
6
|
-
* auth-sessions against the reserved `twitter-oauth-provider` slug (PKCE is
|
|
7
|
-
* handled by Host); there is no local BYO client path.
|
|
8
|
-
*/
|
|
9
|
-
import { X_INTEGRATION, readXProviderSlug, } from "../../connectors/toolserver/integrations.js";
|
|
10
|
-
import { defineFleetVaultConnect } from "../define-fleet-connect.js";
|
|
11
|
-
const x = defineFleetVaultConnect({
|
|
12
|
-
integration: X_INTEGRATION,
|
|
13
|
-
resolveProviderSlug: readXProviderSlug,
|
|
14
|
-
});
|
|
15
|
-
export const X_CONNECT_STATUS_PATH = x.paths.status;
|
|
16
|
-
export const X_CONNECT_START_PATH = x.paths.connect;
|
|
17
|
-
export const X_CONNECT_CALLBACK_PATH = x.paths.callback;
|
|
18
|
-
export const X_CONNECT_LINK_PATH = x.paths.link;
|
|
19
|
-
export const isXActorSubjectEnabled = x.isActorSubjectEnabled;
|
|
20
|
-
export const enableXActorSubject = x.enableActorSubject;
|
|
21
|
-
/**
|
|
22
|
-
* Enable actor-subject mode when X connectors imply per-user vault subjects.
|
|
23
|
-
*
|
|
24
|
-
* Prefer {@link enableActorSubjectIntegrationsFromConnectors} at compile seams.
|
|
25
|
-
*/
|
|
26
|
-
export const enableXActorSubjectFromConnectors = x.enableActorSubjectFromConnectors;
|
|
27
|
-
export const resetXActorSubjectEnabledForTests = x.resetActorSubjectEnabledForTests;
|
|
28
|
-
export const isXConnectConfigured = x.isConnectConfigured;
|
|
29
|
-
export const xConnectUrl = x.connectUrl;
|
|
30
|
-
/** Build an X connect provider (Fleet auth-sessions / twitter-oauth-provider). */
|
|
31
|
-
export const createXIdentityConnectProvider = x.createProvider;
|
|
32
|
-
/** Default X connect provider used as a built-in mount candidate. */
|
|
33
|
-
export const xIdentityConnectProvider = x.provider;
|
|
34
|
-
/**
|
|
35
|
-
* Opt into Connect-with-X on `defineIdentity({ connect: […] })`.
|
|
36
|
-
*
|
|
37
|
-
* Usually unnecessary: declaring `connectors.x` on a user-scoped identity
|
|
38
|
-
* deployment mounts this provider and derives OAuth scopes automatically.
|
|
39
|
-
*/
|
|
40
|
-
export const connect = x.connect;
|
|
41
|
-
//# sourceMappingURL=connect-http.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect-http.js","sourceRoot":"","sources":["../../../src/identity/x/connect-http.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,aAAa,EACb,iBAAiB,GAClB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAGrE,MAAM,CAAC,GAAG,uBAAuB,CAAC;IAChC,WAAW,EAAE,aAAa;IAC1B,mBAAmB,EAAE,iBAAiB;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;AACpD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;AACxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;AAEhD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,qBAAqB,CAAC;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,kBAAkB,CAAC;AACxD;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAC5C,CAAC,CAAC,gCAAgC,CAAC;AACrC,MAAM,CAAC,MAAM,iCAAiC,GAC5C,CAAC,CAAC,gCAAgC,CAAC;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,UAAU,CAAC;AAQxC,kFAAkF;AAClF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,cAAc,CAAC;AAE/D,qEAAqE;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,QAAQ,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* X identity helpers — Connect-with-X (Fleet vault / twitter-oauth-provider).
|
|
3
|
-
*/
|
|
4
|
-
export { connect, createXIdentityConnectProvider, enableXActorSubject, enableXActorSubjectFromConnectors, xConnectUrl, xIdentityConnectProvider, isXActorSubjectEnabled, isXConnectConfigured, resetXActorSubjectEnabledForTests, X_CONNECT_CALLBACK_PATH, X_CONNECT_LINK_PATH, X_CONNECT_START_PATH, X_CONNECT_STATUS_PATH, } from "./connect-http.js";
|
|
5
|
-
export type { XIdentityConnectProviderOptions } from "./connect-http.js";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/identity/x/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,OAAO,EACP,8BAA8B,EAC9B,mBAAmB,EACnB,iCAAiC,EACjC,WAAW,EACX,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,iCAAiC,EACjC,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/identity/x/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* X identity helpers — Connect-with-X (Fleet vault / twitter-oauth-provider).
|
|
3
|
-
*/
|
|
4
|
-
export { connect, createXIdentityConnectProvider, enableXActorSubject, enableXActorSubjectFromConnectors, xConnectUrl, xIdentityConnectProvider, isXActorSubjectEnabled, isXConnectConfigured, resetXActorSubjectEnabledForTests, X_CONNECT_CALLBACK_PATH, X_CONNECT_LINK_PATH, X_CONNECT_START_PATH, X_CONNECT_STATUS_PATH, } from "./connect-http.js";
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/identity/x/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,OAAO,EACP,8BAA8B,EAC9B,mBAAmB,EACnB,iCAAiC,EACjC,WAAW,EACX,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,iCAAiC,EACjC,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC"}
|
package/types/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference path="./markdown-md.d.ts" />
|
|
2
|
-
|
|
3
|
-
// Re-export the implementation specifier; NodeNext resolves it to the adjacent
|
|
4
|
-
// `.d.ts`. Importing `../dist/index.d.ts` directly is invalid (TS2846) for
|
|
5
|
-
// consumers that do not enable `skipLibCheck`.
|
|
6
|
-
export * from "../dist/index.js";
|
package/types/markdown-md.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ambient typings for MDA text-module imports.
|
|
3
|
-
*
|
|
4
|
-
* The CLI inlines `import … from "./file.md" with { type: "text" }` into a
|
|
5
|
-
* string constant at compile time. This declaration makes the same import
|
|
6
|
-
* type-check in authoring projects without a local `*.md` ambient module.
|
|
7
|
-
*
|
|
8
|
-
* Pulled in via `types/index.d.ts` (the package `"types"` entry) so importing
|
|
9
|
-
* `managed-deepagents` loads it automatically.
|
|
10
|
-
*/
|
|
11
|
-
declare module "*.md" {
|
|
12
|
-
const content: string;
|
|
13
|
-
export default content;
|
|
14
|
-
}
|