@keystrokehq/keystroke 0.0.173 → 0.0.174
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/dist/action.cjs +2 -3
- package/dist/action.d.cts +3 -3
- package/dist/action.d.mts +3 -3
- package/dist/action.mjs +2 -2
- package/dist/agent.cjs +3 -3
- package/dist/agent.d.cts +2 -2
- package/dist/agent.d.mts +2 -2
- package/dist/agent.mjs +3 -3
- package/dist/app.cjs +72 -0
- package/dist/app.cjs.map +1 -0
- package/dist/app.d.cts +58 -0
- package/dist/app.d.cts.map +1 -0
- package/dist/app.d.mts +58 -0
- package/dist/app.d.mts.map +1 -0
- package/dist/app.mjs +71 -0
- package/dist/app.mjs.map +1 -0
- package/dist/client.cjs +3 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -0
- package/dist/client.d.cts.map +1 -1
- package/dist/client.d.mts +6 -0
- package/dist/client.d.mts.map +1 -1
- package/dist/client.mjs +3 -1
- package/dist/client.mjs.map +1 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/credentials.cjs +2 -3
- package/dist/credentials.d.cts +2 -2
- package/dist/credentials.d.mts +2 -2
- package/dist/credentials.mjs +2 -2
- package/dist/{dist-Dz0i7l87.cjs → dist-BLADLFrG.cjs} +41 -63
- package/dist/dist-BLADLFrG.cjs.map +1 -0
- package/dist/{dist-bGasqeNy.mjs → dist-BX0Upt63.mjs} +41 -63
- package/dist/dist-BX0Upt63.mjs.map +1 -0
- package/dist/{dist--dtTaEXy.cjs → dist-Bwkl4vwe.cjs} +8 -10
- package/dist/dist-Bwkl4vwe.cjs.map +1 -0
- package/dist/{dist-BF5yN9sB.mjs → dist-CFy63Npi.mjs} +30 -50
- package/dist/dist-CFy63Npi.mjs.map +1 -0
- package/dist/{dist--zLOSTcG.cjs → dist-DEwBt6Ee.cjs} +31 -63
- package/dist/dist-DEwBt6Ee.cjs.map +1 -0
- package/dist/{dist-DT5CSOQc.mjs → dist-g-XZ7Tbo.mjs} +8 -10
- package/dist/dist-g-XZ7Tbo.mjs.map +1 -0
- package/dist/{index-1uEWGKCk.d.mts → index-B8ZRIgPK.d.mts} +12 -9
- package/dist/index-B8ZRIgPK.d.mts.map +1 -0
- package/dist/{index-s53YoTdO.d.cts → index-CDWAJRJD.d.cts} +2 -2
- package/dist/{index-BDPrsenN.d.mts.map → index-CDWAJRJD.d.cts.map} +1 -1
- package/dist/{index-BPC4loSM.d.mts → index-CITVigQS.d.mts} +2 -2
- package/dist/index-CITVigQS.d.mts.map +1 -0
- package/dist/{index-uWH8vj_f.d.cts → index-CUYwOWCh.d.cts} +4 -4
- package/dist/{index-uWH8vj_f.d.cts.map → index-CUYwOWCh.d.cts.map} +1 -1
- package/dist/{index-DvJmjY4X.d.mts → index-DPyUP9U_.d.mts} +4 -4
- package/dist/{index-DvJmjY4X.d.mts.map → index-DPyUP9U_.d.mts.map} +1 -1
- package/dist/{index-BDPrsenN.d.mts → index-DT9Ml-7N.d.mts} +2 -2
- package/dist/{index-s53YoTdO.d.cts.map → index-DT9Ml-7N.d.mts.map} +1 -1
- package/dist/{index-B9hlxKDT.d.cts → index-DjLUdkRo.d.cts} +12 -9
- package/dist/index-DjLUdkRo.d.cts.map +1 -0
- package/dist/{index-DAzE8I-g.d.cts → index-hf0OTB6M.d.cts} +14 -16
- package/dist/index-hf0OTB6M.d.cts.map +1 -0
- package/dist/{index-DAzE8I-g.d.mts → index-hf0OTB6M.d.mts} +14 -16
- package/dist/index-hf0OTB6M.d.mts.map +1 -0
- package/dist/{index-Ugto82oH.d.cts → index-y_2btA4s.d.cts} +2 -2
- package/dist/index-y_2btA4s.d.cts.map +1 -0
- package/dist/{mistral-GXPqP1mo.cjs → mistral-CC5EGzH4.cjs} +2 -2
- package/dist/{mistral-GXPqP1mo.cjs.map → mistral-CC5EGzH4.cjs.map} +1 -1
- package/dist/{mistral-D56Ydau-.mjs → mistral-DbKZmAHf.mjs} +2 -2
- package/dist/{mistral-D56Ydau-.mjs.map → mistral-DbKZmAHf.mjs.map} +1 -1
- package/dist/{sse-U_LwOMpt.mjs → sse-DqYCbW54.mjs} +2 -2
- package/dist/{sse-U_LwOMpt.mjs.map → sse-DqYCbW54.mjs.map} +1 -1
- package/dist/{sse-D1mtozXN.cjs → sse-dAxMgDEB.cjs} +2 -2
- package/dist/{sse-D1mtozXN.cjs.map → sse-dAxMgDEB.cjs.map} +1 -1
- package/dist/trigger.cjs +1 -1
- package/dist/trigger.d.cts +3 -3
- package/dist/trigger.d.mts +3 -3
- package/dist/trigger.mjs +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.d.cts +2 -2
- package/dist/workflow.d.mts +2 -2
- package/dist/workflow.mjs +1 -1
- package/package.json +7 -1
- package/dist/dist--dtTaEXy.cjs.map +0 -1
- package/dist/dist--zLOSTcG.cjs.map +0 -1
- package/dist/dist-BF5yN9sB.mjs.map +0 -1
- package/dist/dist-DT5CSOQc.mjs.map +0 -1
- package/dist/dist-Dz0i7l87.cjs.map +0 -1
- package/dist/dist-bGasqeNy.mjs.map +0 -1
- package/dist/index-1uEWGKCk.d.mts.map +0 -1
- package/dist/index-B9hlxKDT.d.cts.map +0 -1
- package/dist/index-BPC4loSM.d.mts.map +0 -1
- package/dist/index-DAzE8I-g.d.cts.map +0 -1
- package/dist/index-DAzE8I-g.d.mts.map +0 -1
- package/dist/index-Ugto82oH.d.cts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bn as __require, Ln as __commonJSMin, Vn as __toESM } from "./dist-IaCcrwur.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { S as normalizeCredentialList, x as mcpEntityId } from "./dist-CFy63Npi.mjs";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import "node:fs";
|
|
5
5
|
import { ZodFirstPartyTypeKind } from "zod/v3";
|
|
@@ -13251,7 +13251,7 @@ async function connectMcpServer(name, options) {
|
|
|
13251
13251
|
}
|
|
13252
13252
|
async function createTransport(url, transport, requestInit, fetchImpl) {
|
|
13253
13253
|
if (transport === "sse") {
|
|
13254
|
-
const { SSEClientTransport } = await import("./sse-
|
|
13254
|
+
const { SSEClientTransport } = await import("./sse-DqYCbW54.mjs");
|
|
13255
13255
|
return new SSEClientTransport(url, {
|
|
13256
13256
|
requestInit,
|
|
13257
13257
|
fetch: fetchImpl
|
|
@@ -17156,12 +17156,6 @@ function credentialScopeAnd(scopeType, ...conditions) {
|
|
|
17156
17156
|
async function selectCredentialInstanceById$1(id) {
|
|
17157
17157
|
return (await getDb$1().select().from(credentialInstances).where(eq(credentialInstances.id, id)).limit(1))[0];
|
|
17158
17158
|
}
|
|
17159
|
-
async function listCredentialInstancesByScope$1(options) {
|
|
17160
|
-
const db = getDb$1();
|
|
17161
|
-
const conditions = [options.scopeId === null ? and(eq(credentialInstances.scopeType, options.scopeType), isNull(credentialInstances.scopeId)) : and(eq(credentialInstances.scopeType, options.scopeType), eq(credentialInstances.scopeId, options.scopeId))];
|
|
17162
|
-
if (options.slug) conditions.push(eq(credentialInstances.slug, options.slug));
|
|
17163
|
-
return db.select().from(credentialInstances).where(credentialScopeAnd(options.scopeType, ...conditions));
|
|
17164
|
-
}
|
|
17165
17159
|
async function selectCredentialInstancesForScope$1(slug, scopeType, scopeId) {
|
|
17166
17160
|
const db = getDb$1();
|
|
17167
17161
|
const scopeCondition = scopeId === null ? and(eq(credentialInstances.scopeType, scopeType), isNull(credentialInstances.scopeId)) : and(eq(credentialInstances.scopeType, scopeType), eq(credentialInstances.scopeId, scopeId));
|
|
@@ -17841,9 +17835,6 @@ async function selectCredentialInstanceById(id) {
|
|
|
17841
17835
|
async function selectCredentialInstancesForScope(key, scopeType, scopeId) {
|
|
17842
17836
|
return (await selectCredentialInstancesForScope$1(key, scopeType, scopeId)).map(normalizeLocalRow);
|
|
17843
17837
|
}
|
|
17844
|
-
async function listCredentialInstancesByScope(options) {
|
|
17845
|
-
return (await listCredentialInstancesByScope$1(options)).map(normalizeLocalRow);
|
|
17846
|
-
}
|
|
17847
17838
|
//#endregion
|
|
17848
17839
|
//#region ../credentials/dist/index.mjs
|
|
17849
17840
|
var MissingCredentialsError = class extends Error {
|
|
@@ -18019,20 +18010,6 @@ function createCredentialBackend(options = {}) {
|
|
|
18019
18010
|
}
|
|
18020
18011
|
return createLocalCredentialBackend(options);
|
|
18021
18012
|
}
|
|
18022
|
-
const CHAIN_TO_SCOPE = {
|
|
18023
|
-
organization: {
|
|
18024
|
-
scopeType: CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE.organization,
|
|
18025
|
-
contextKey: "orgId"
|
|
18026
|
-
},
|
|
18027
|
-
project: {
|
|
18028
|
-
scopeType: CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE.project,
|
|
18029
|
-
contextKey: "projectId"
|
|
18030
|
-
},
|
|
18031
|
-
user: {
|
|
18032
|
-
scopeType: CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE.user,
|
|
18033
|
-
contextKey: "userId"
|
|
18034
|
-
}
|
|
18035
|
-
};
|
|
18036
18013
|
function toSelectionOption(row) {
|
|
18037
18014
|
return {
|
|
18038
18015
|
id: row.id,
|
|
@@ -18105,21 +18082,12 @@ function withTenantScope(context) {
|
|
|
18105
18082
|
orgId: getServerTenantScopeId()
|
|
18106
18083
|
};
|
|
18107
18084
|
}
|
|
18108
|
-
|
|
18109
|
-
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
key,
|
|
18113
|
-
|
|
18114
|
-
scopeId: scoped.orgId
|
|
18115
|
-
}));
|
|
18116
|
-
const userId = resolveUserId(key, scoped);
|
|
18117
|
-
if (userId) rows.push(...await listCredentialInstancesByScope({
|
|
18118
|
-
key,
|
|
18119
|
-
scopeType: "user",
|
|
18120
|
-
scopeId: userId
|
|
18121
|
-
}));
|
|
18122
|
-
return rows.map(toSelectionOption);
|
|
18085
|
+
function scopeIdForScope(scope, key, context) {
|
|
18086
|
+
switch (scope) {
|
|
18087
|
+
case "organization": return context.orgId;
|
|
18088
|
+
case "project": return context.projectId;
|
|
18089
|
+
case "user": return resolveUserId(key, context);
|
|
18090
|
+
}
|
|
18123
18091
|
}
|
|
18124
18092
|
async function resolveAtScope(key, scopeType, scopeId, consumer) {
|
|
18125
18093
|
const rows = await selectCredentialInstancesForScope(key, scopeType, scopeId);
|
|
@@ -18131,35 +18099,45 @@ async function resolveAtScope(key, scopeType, scopeId, consumer) {
|
|
|
18131
18099
|
throw error;
|
|
18132
18100
|
}
|
|
18133
18101
|
}
|
|
18102
|
+
/**
|
|
18103
|
+
* Resolution order:
|
|
18104
|
+
* 1. A platform-provided binding (explicit instance id in `context.selection`) wins.
|
|
18105
|
+
* 2. A scope pinned on the requirement (`.scope("user")`) resolves only at that scope.
|
|
18106
|
+
* 3. Otherwise the project default, then the org default. No configurable chain.
|
|
18107
|
+
* If nothing matches, throw — there is no binding.
|
|
18108
|
+
*/
|
|
18134
18109
|
async function resolvePolicy(requirement, context, consumer, backend) {
|
|
18135
|
-
const
|
|
18136
|
-
const selectionId = context.selection?.[requirement.key];
|
|
18110
|
+
const attempted = [];
|
|
18137
18111
|
const materialBackend = backend ?? createCredentialBackend();
|
|
18138
18112
|
const scoped = withTenantScope(context);
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
|
|
18145
|
-
|
|
18146
|
-
if (
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
}
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18113
|
+
const selectionId = context.selection?.[requirement.key];
|
|
18114
|
+
if (selectionId) return resolveInstanceValue(await resolveSelectedInstance(requirement.key, selectionId, scoped, consumer), requirement, materialBackend);
|
|
18115
|
+
if (requirement.scope) {
|
|
18116
|
+
const scopeId = scopeIdForScope(requirement.scope, requirement.key, scoped);
|
|
18117
|
+
if (scopeId) {
|
|
18118
|
+
attempted.push(requirement.scope);
|
|
18119
|
+
const row = await resolveAtScope(requirement.key, requirement.scope, scopeId, consumer);
|
|
18120
|
+
if (row) return resolveInstanceValue(row, requirement, materialBackend);
|
|
18121
|
+
}
|
|
18122
|
+
throw new MissingCredentialsError({
|
|
18123
|
+
key: requirement.key,
|
|
18124
|
+
chainAttempted: attempted.length > 0 ? attempted : [requirement.scope],
|
|
18125
|
+
consumer
|
|
18126
|
+
});
|
|
18127
|
+
}
|
|
18128
|
+
if (scoped.projectId) {
|
|
18129
|
+
attempted.push("project");
|
|
18130
|
+
const row = await resolveAtScope(requirement.key, "project", scoped.projectId, consumer);
|
|
18131
|
+
if (row) return resolveInstanceValue(row, requirement, materialBackend);
|
|
18132
|
+
}
|
|
18133
|
+
if (scoped.orgId) {
|
|
18134
|
+
attempted.push("organization");
|
|
18135
|
+
const row = await resolveAtScope(requirement.key, "organization", scoped.orgId, consumer);
|
|
18158
18136
|
if (row) return resolveInstanceValue(row, requirement, materialBackend);
|
|
18159
18137
|
}
|
|
18160
18138
|
throw new MissingCredentialsError({
|
|
18161
18139
|
key: requirement.key,
|
|
18162
|
-
chainAttempted,
|
|
18140
|
+
chainAttempted: attempted,
|
|
18163
18141
|
consumer
|
|
18164
18142
|
});
|
|
18165
18143
|
}
|
|
@@ -18285,4 +18263,4 @@ async function resolveActionCredentials(requirements, options) {
|
|
|
18285
18263
|
//#endregion
|
|
18286
18264
|
export { createFetchWithInit as A, connectMcpStdio as C, UnauthorizedError as D, createParser as E, zodToJsonSchema as M, JSONRPCMessageSchema as N, auth as O, connectMcpServer as S, isMcp as T, captureConsole as _, resolveActionCredentials as a, withSpan as b, addAgentSessionDuration as c, getAgentByRoute as d, getSession as f, touchSession as g, resolveRunSourceFromTraceContext as h, isCredentialError as i, normalizeHeaders as j, extractWWWAuthenticateParams as k, appendEvent as l, recordLlmUsageFromAssistantMessage as m, captureCredentialToolErrors as n, resolveMcpTools as o, listMessageEvents as p, createCredentialResolver as r, MESSAGE_EVENT_TYPE as s, buildCredentialRunContext as t, createSession as u, getTraceContext as v, defineMcp as w, connectMcpDefinition as x, logSystem as y };
|
|
18287
18265
|
|
|
18288
|
-
//# sourceMappingURL=dist-
|
|
18266
|
+
//# sourceMappingURL=dist-BX0Upt63.mjs.map
|