@keystrokehq/keystroke 0.0.172 → 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
|
const require_chunk = require("./chunk-DHdmVzO2.cjs");
|
|
2
|
-
const require_dist$1 = require("./dist
|
|
2
|
+
const require_dist$1 = require("./dist-DEwBt6Ee.cjs");
|
|
3
3
|
let node_async_hooks = require("node:async_hooks");
|
|
4
4
|
require("node:fs");
|
|
5
5
|
let zod_v3 = require("zod/v3");
|
|
@@ -13258,7 +13258,7 @@ async function connectMcpServer(name, options) {
|
|
|
13258
13258
|
}
|
|
13259
13259
|
async function createTransport(url, transport, requestInit, fetchImpl) {
|
|
13260
13260
|
if (transport === "sse") {
|
|
13261
|
-
const { SSEClientTransport } = await Promise.resolve().then(() => require("./sse-
|
|
13261
|
+
const { SSEClientTransport } = await Promise.resolve().then(() => require("./sse-dAxMgDEB.cjs"));
|
|
13262
13262
|
return new SSEClientTransport(url, {
|
|
13263
13263
|
requestInit,
|
|
13264
13264
|
fetch: fetchImpl
|
|
@@ -17163,12 +17163,6 @@ function credentialScopeAnd(scopeType, ...conditions) {
|
|
|
17163
17163
|
async function selectCredentialInstanceById$1(id) {
|
|
17164
17164
|
return (await getDb$1().select().from(credentialInstances).where(eq(credentialInstances.id, id)).limit(1))[0];
|
|
17165
17165
|
}
|
|
17166
|
-
async function listCredentialInstancesByScope$1(options) {
|
|
17167
|
-
const db = getDb$1();
|
|
17168
|
-
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))];
|
|
17169
|
-
if (options.slug) conditions.push(eq(credentialInstances.slug, options.slug));
|
|
17170
|
-
return db.select().from(credentialInstances).where(credentialScopeAnd(options.scopeType, ...conditions));
|
|
17171
|
-
}
|
|
17172
17166
|
async function selectCredentialInstancesForScope$1(slug, scopeType, scopeId) {
|
|
17173
17167
|
const db = getDb$1();
|
|
17174
17168
|
const scopeCondition = scopeId === null ? and(eq(credentialInstances.scopeType, scopeType), isNull(credentialInstances.scopeId)) : and(eq(credentialInstances.scopeType, scopeType), eq(credentialInstances.scopeId, scopeId));
|
|
@@ -17848,9 +17842,6 @@ async function selectCredentialInstanceById(id) {
|
|
|
17848
17842
|
async function selectCredentialInstancesForScope(key, scopeType, scopeId) {
|
|
17849
17843
|
return (await selectCredentialInstancesForScope$1(key, scopeType, scopeId)).map(normalizeLocalRow);
|
|
17850
17844
|
}
|
|
17851
|
-
async function listCredentialInstancesByScope(options) {
|
|
17852
|
-
return (await listCredentialInstancesByScope$1(options)).map(normalizeLocalRow);
|
|
17853
|
-
}
|
|
17854
17845
|
//#endregion
|
|
17855
17846
|
//#region ../credentials/dist/index.mjs
|
|
17856
17847
|
var MissingCredentialsError = class extends Error {
|
|
@@ -18026,20 +18017,6 @@ function createCredentialBackend(options = {}) {
|
|
|
18026
18017
|
}
|
|
18027
18018
|
return createLocalCredentialBackend(options);
|
|
18028
18019
|
}
|
|
18029
|
-
const CHAIN_TO_SCOPE = {
|
|
18030
|
-
organization: {
|
|
18031
|
-
scopeType: require_dist$1.CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE.organization,
|
|
18032
|
-
contextKey: "orgId"
|
|
18033
|
-
},
|
|
18034
|
-
project: {
|
|
18035
|
-
scopeType: require_dist$1.CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE.project,
|
|
18036
|
-
contextKey: "projectId"
|
|
18037
|
-
},
|
|
18038
|
-
user: {
|
|
18039
|
-
scopeType: require_dist$1.CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE.user,
|
|
18040
|
-
contextKey: "userId"
|
|
18041
|
-
}
|
|
18042
|
-
};
|
|
18043
18020
|
function toSelectionOption(row) {
|
|
18044
18021
|
return {
|
|
18045
18022
|
id: row.id,
|
|
@@ -18112,21 +18089,12 @@ function withTenantScope(context) {
|
|
|
18112
18089
|
orgId: getServerTenantScopeId()
|
|
18113
18090
|
};
|
|
18114
18091
|
}
|
|
18115
|
-
|
|
18116
|
-
|
|
18117
|
-
|
|
18118
|
-
|
|
18119
|
-
key,
|
|
18120
|
-
|
|
18121
|
-
scopeId: scoped.orgId
|
|
18122
|
-
}));
|
|
18123
|
-
const userId = resolveUserId(key, scoped);
|
|
18124
|
-
if (userId) rows.push(...await listCredentialInstancesByScope({
|
|
18125
|
-
key,
|
|
18126
|
-
scopeType: "user",
|
|
18127
|
-
scopeId: userId
|
|
18128
|
-
}));
|
|
18129
|
-
return rows.map(toSelectionOption);
|
|
18092
|
+
function scopeIdForScope(scope, key, context) {
|
|
18093
|
+
switch (scope) {
|
|
18094
|
+
case "organization": return context.orgId;
|
|
18095
|
+
case "project": return context.projectId;
|
|
18096
|
+
case "user": return resolveUserId(key, context);
|
|
18097
|
+
}
|
|
18130
18098
|
}
|
|
18131
18099
|
async function resolveAtScope(key, scopeType, scopeId, consumer) {
|
|
18132
18100
|
const rows = await selectCredentialInstancesForScope(key, scopeType, scopeId);
|
|
@@ -18138,35 +18106,45 @@ async function resolveAtScope(key, scopeType, scopeId, consumer) {
|
|
|
18138
18106
|
throw error;
|
|
18139
18107
|
}
|
|
18140
18108
|
}
|
|
18109
|
+
/**
|
|
18110
|
+
* Resolution order:
|
|
18111
|
+
* 1. A platform-provided binding (explicit instance id in `context.selection`) wins.
|
|
18112
|
+
* 2. A scope pinned on the requirement (`.scope("user")`) resolves only at that scope.
|
|
18113
|
+
* 3. Otherwise the project default, then the org default. No configurable chain.
|
|
18114
|
+
* If nothing matches, throw — there is no binding.
|
|
18115
|
+
*/
|
|
18141
18116
|
async function resolvePolicy(requirement, context, consumer, backend) {
|
|
18142
|
-
const
|
|
18143
|
-
const selectionId = context.selection?.[requirement.key];
|
|
18117
|
+
const attempted = [];
|
|
18144
18118
|
const materialBackend = backend ?? createCredentialBackend();
|
|
18145
18119
|
const scoped = withTenantScope(context);
|
|
18146
|
-
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
if (
|
|
18154
|
-
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18158
|
-
|
|
18159
|
-
}
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18163
|
-
|
|
18164
|
-
|
|
18120
|
+
const selectionId = context.selection?.[requirement.key];
|
|
18121
|
+
if (selectionId) return resolveInstanceValue(await resolveSelectedInstance(requirement.key, selectionId, scoped, consumer), requirement, materialBackend);
|
|
18122
|
+
if (requirement.scope) {
|
|
18123
|
+
const scopeId = scopeIdForScope(requirement.scope, requirement.key, scoped);
|
|
18124
|
+
if (scopeId) {
|
|
18125
|
+
attempted.push(requirement.scope);
|
|
18126
|
+
const row = await resolveAtScope(requirement.key, requirement.scope, scopeId, consumer);
|
|
18127
|
+
if (row) return resolveInstanceValue(row, requirement, materialBackend);
|
|
18128
|
+
}
|
|
18129
|
+
throw new MissingCredentialsError({
|
|
18130
|
+
key: requirement.key,
|
|
18131
|
+
chainAttempted: attempted.length > 0 ? attempted : [requirement.scope],
|
|
18132
|
+
consumer
|
|
18133
|
+
});
|
|
18134
|
+
}
|
|
18135
|
+
if (scoped.projectId) {
|
|
18136
|
+
attempted.push("project");
|
|
18137
|
+
const row = await resolveAtScope(requirement.key, "project", scoped.projectId, consumer);
|
|
18138
|
+
if (row) return resolveInstanceValue(row, requirement, materialBackend);
|
|
18139
|
+
}
|
|
18140
|
+
if (scoped.orgId) {
|
|
18141
|
+
attempted.push("organization");
|
|
18142
|
+
const row = await resolveAtScope(requirement.key, "organization", scoped.orgId, consumer);
|
|
18165
18143
|
if (row) return resolveInstanceValue(row, requirement, materialBackend);
|
|
18166
18144
|
}
|
|
18167
18145
|
throw new MissingCredentialsError({
|
|
18168
18146
|
key: requirement.key,
|
|
18169
|
-
chainAttempted,
|
|
18147
|
+
chainAttempted: attempted,
|
|
18170
18148
|
consumer
|
|
18171
18149
|
});
|
|
18172
18150
|
}
|
|
@@ -18489,4 +18467,4 @@ Object.defineProperty(exports, "zodToJsonSchema", {
|
|
|
18489
18467
|
}
|
|
18490
18468
|
});
|
|
18491
18469
|
|
|
18492
|
-
//# sourceMappingURL=dist-
|
|
18470
|
+
//# sourceMappingURL=dist-BLADLFrG.cjs.map
|