@keystrokehq/keystroke 0.1.89 → 0.1.90
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/agent-types.cjs +1 -1
- package/dist/agent-types.d.cts +2 -2
- package/dist/agent-types.d.mts +2 -2
- package/dist/agent-types.mjs +1 -1
- package/dist/agent.cjs +3 -3
- package/dist/agent.d.cts +3 -3
- package/dist/agent.d.mts +3 -3
- package/dist/agent.mjs +3 -3
- package/dist/{context-compaction-D2_B1nky-GR-BMu9j.cjs → context-compaction-D2_B1nky-BZ0Nxnlz.cjs} +2 -2
- package/dist/{context-compaction-D2_B1nky-GR-BMu9j.cjs.map → context-compaction-D2_B1nky-BZ0Nxnlz.cjs.map} +1 -1
- package/dist/{context-compaction-D2_B1nky-BDZHww1-.mjs → context-compaction-D2_B1nky-Z-RHprX6.mjs} +2 -2
- package/dist/{context-compaction-D2_B1nky-BDZHww1-.mjs.map → context-compaction-D2_B1nky-Z-RHprX6.mjs.map} +1 -1
- package/dist/{dist-BgAHijbJ.cjs → dist-BquLTvmJ.cjs} +13 -10
- package/dist/dist-BquLTvmJ.cjs.map +1 -0
- package/dist/{dist-bKEDQL7p.mjs → dist-CBMAwfqk.mjs} +13 -10
- package/dist/dist-CBMAwfqk.mjs.map +1 -0
- package/dist/{dist-CIBQNBjh.mjs → dist-D5LMFsGS.mjs} +2 -2
- package/dist/{dist-CIBQNBjh.mjs.map → dist-D5LMFsGS.mjs.map} +1 -1
- package/dist/{dist-DFDKdWMT.cjs → dist-DV-u1dSU.cjs} +2 -2
- package/dist/{dist-DFDKdWMT.cjs.map → dist-DV-u1dSU.cjs.map} +1 -1
- package/dist/{index-CE5kyJI4.d.cts → index-BYUo1T9j.d.cts} +2 -2
- package/dist/{index-CE5kyJI4.d.cts.map → index-BYUo1T9j.d.cts.map} +1 -1
- package/dist/{index-rLP7DFdP.d.mts → index-C1LkEWsV.d.mts} +4 -4
- package/dist/{index-DgY6BIsO.d.cts.map → index-C1LkEWsV.d.mts.map} +1 -1
- package/dist/{index-DgY6BIsO.d.cts → index-CE-pKU-3.d.cts} +4 -4
- package/dist/{index-rLP7DFdP.d.mts.map → index-CE-pKU-3.d.cts.map} +1 -1
- package/dist/{index-3jmW28h7.d.mts → index-DnlzDIsv.d.mts} +2 -2
- package/dist/{index-3jmW28h7.d.mts.map → index-DnlzDIsv.d.mts.map} +1 -1
- package/dist/{index-B1GHQ7Fl.d.mts → index-IsjwL1qE.d.cts} +4 -4
- package/dist/{index-B1GHQ7Fl.d.mts.map → index-IsjwL1qE.d.cts.map} +1 -1
- package/dist/{index-CQqtpMO9.d.cts → index-XtUIsmsf.d.mts} +4 -4
- package/dist/{index-CQqtpMO9.d.cts.map → index-XtUIsmsf.d.mts.map} +1 -1
- package/dist/{schemas-lSbMfQRy-Dal7spwa.d.cts → schemas-lSbMfQRy-EZTAAsXz.d.cts} +2 -2
- package/dist/{schemas-lSbMfQRy-CLdsabVT.d.mts.map → schemas-lSbMfQRy-EZTAAsXz.d.cts.map} +1 -1
- package/dist/{schemas-lSbMfQRy-CLdsabVT.d.mts → schemas-lSbMfQRy-XXpvG020.d.mts} +2 -2
- package/dist/{schemas-lSbMfQRy-Dal7spwa.d.cts.map → schemas-lSbMfQRy-XXpvG020.d.mts.map} +1 -1
- package/dist/{token-CYEqvLAY.mjs → token-BFGvC19A.mjs} +2 -2
- package/dist/{token-CYEqvLAY.mjs.map → token-BFGvC19A.mjs.map} +1 -1
- package/dist/{token-BnoRco2o.cjs → token-CiaIOCoy.cjs} +2 -2
- package/dist/{token-BnoRco2o.cjs.map → token-CiaIOCoy.cjs.map} +1 -1
- package/dist/trigger.cjs +1 -1
- package/dist/trigger.d.cts +1 -1
- package/dist/trigger.d.mts +1 -1
- package/dist/trigger.mjs +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.mjs +1 -1
- package/package.json +1 -1
- package/dist/dist-BgAHijbJ.cjs.map +0 -1
- package/dist/dist-bKEDQL7p.mjs.map +0 -1
|
@@ -14721,6 +14721,12 @@ createRequire(import.meta.url);
|
|
|
14721
14721
|
function getDb() {
|
|
14722
14722
|
return getDbFromContext();
|
|
14723
14723
|
}
|
|
14724
|
+
function organizationScopeId() {
|
|
14725
|
+
return requireOrganizationScopeId();
|
|
14726
|
+
}
|
|
14727
|
+
function eqOrganizationScope(table) {
|
|
14728
|
+
return eq(table.organizationId, organizationScopeId());
|
|
14729
|
+
}
|
|
14724
14730
|
function eqProjectScope(table) {
|
|
14725
14731
|
return eq(table.projectId, getProjectScopeId());
|
|
14726
14732
|
}
|
|
@@ -14740,9 +14746,6 @@ async function selectActiveAgentByRoute(route) {
|
|
|
14740
14746
|
slug: agents.slug
|
|
14741
14747
|
}).from(agents).where(scopedAnd(agents, eq(agents.route, route), isNull(agents.deletedAt))).limit(1))[0];
|
|
14742
14748
|
}
|
|
14743
|
-
function organizationScopeId() {
|
|
14744
|
-
return requireOrganizationScopeId();
|
|
14745
|
-
}
|
|
14746
14749
|
async function insertAgentSession(values) {
|
|
14747
14750
|
await getDb().insert(agentSessions).values({
|
|
14748
14751
|
...values,
|
|
@@ -14801,13 +14804,13 @@ async function selectActiveSkillsBySlugs(slugs) {
|
|
|
14801
14804
|
return getDb().select().from(skills).where(scopedAnd(skills, inArray(skills.slug, slugs), isNull(skills.deletedAt)));
|
|
14802
14805
|
}
|
|
14803
14806
|
const MESSAGE_EVENT_TYPE = "message";
|
|
14804
|
-
/** Org/user credentials live once
|
|
14807
|
+
/** Org/user credentials live once per organization; project scope stays per-project. */
|
|
14805
14808
|
function credentialScopeAnd(scopeType, ...conditions) {
|
|
14806
|
-
if (scopeType === "project") return scopedAnd(credentialInstances, ...conditions);
|
|
14807
|
-
return and(...conditions.filter(Boolean));
|
|
14809
|
+
if (scopeType === "project") return scopedAnd(credentialInstances, eqOrganizationScope(credentialInstances), ...conditions);
|
|
14810
|
+
return and(eqOrganizationScope(credentialInstances), ...conditions.filter(Boolean));
|
|
14808
14811
|
}
|
|
14809
14812
|
async function selectCredentialInstanceById(id) {
|
|
14810
|
-
return (await getDb().select().from(credentialInstances).where(eq(credentialInstances.id, id)).limit(1))[0];
|
|
14813
|
+
return (await getDb().select().from(credentialInstances).where(and(eqOrganizationScope(credentialInstances), eq(credentialInstances.id, id))).limit(1))[0];
|
|
14811
14814
|
}
|
|
14812
14815
|
async function selectCredentialInstancesForScope(appSlug, scopeType, scopeId) {
|
|
14813
14816
|
const db = getDb();
|
|
@@ -14816,7 +14819,7 @@ async function selectCredentialInstancesForScope(appSlug, scopeType, scopeId) {
|
|
|
14816
14819
|
}
|
|
14817
14820
|
/** Record that a credential was just resolved/used. Targeted by id; never throws on a missing row. */
|
|
14818
14821
|
async function touchCredentialInstanceLastUsed(id) {
|
|
14819
|
-
await getDb().update(credentialInstances).set({ lastUsedAt: /* @__PURE__ */ new Date() }).where(eq(credentialInstances.id, id));
|
|
14822
|
+
await getDb().update(credentialInstances).set({ lastUsedAt: /* @__PURE__ */ new Date() }).where(and(eqOrganizationScope(credentialInstances), eq(credentialInstances.id, id)));
|
|
14820
14823
|
}
|
|
14821
14824
|
async function listCredentialAssignmentsByTarget(options) {
|
|
14822
14825
|
return getDb().select().from(credentialAssignments).where(scopedAnd(credentialAssignments, eq(credentialAssignments.targetType, options.targetType), eq(credentialAssignments.targetKey, options.targetKey)));
|
|
@@ -17714,7 +17717,7 @@ var require_get_vercel_oidc_token = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
17714
17717
|
err = error;
|
|
17715
17718
|
}
|
|
17716
17719
|
try {
|
|
17717
|
-
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_token_util())), await import("./token-
|
|
17720
|
+
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_token_util())), await import("./token-BFGvC19A.mjs").then((m) => /* @__PURE__ */ __toESM(m.default))]);
|
|
17718
17721
|
if (!token || isExpired(getTokenPayload(token), options?.expirationBufferMs)) {
|
|
17719
17722
|
await refreshToken(options);
|
|
17720
17723
|
token = getVercelOidcTokenSync();
|
|
@@ -28295,4 +28298,4 @@ createIdGenerator({
|
|
|
28295
28298
|
//#endregion
|
|
28296
28299
|
export { withSpan as $, addAgentSessionDuration as A, listCredentialAssignmentsByTarget as B, safeValidateTypes as C, AISDKError as D, EventSourceParserStream as E, getAgentByRoute as F, selectCredentialInstancesForScope as G, resolveRunSourceFromTraceContext as H, getSession as I, touchCredentialInstanceLastUsed as J, setSessionStatus as K, hasSessionEventAfterSeq as L, createSession as M, decryptCredentialPayload as N, isJSONObject as O, failAgentSession as P, logSystem as Q, isDatabaseInitialized as R, safeParseJSON as S, withUserAgentSuffix as T, selectActiveSkillsBySlugs as U, listSessionEvents as V, selectCredentialInstanceById as W, captureConsole as X, touchSession as Y, getTraceContext as Z, dynamicTool as _, generateText as a, getProjectScopeId as at, jsonSchema as b, isStepCount as c, oauthConnections as ct, toUIMessageStream as d, selectOrganizationById as dt, decryptCredentialPayload$1 as et, wrapLanguageModel as f, selectProjectById as ft, asSchema as g, require_token_error as h, generateObject as i, getOrganizationScopeId as it, appendEvent as j, MESSAGE_EVENT_TYPE as k, output_exports as l, requireOrganizationScopeId as lt, require_token_util as m, eq as mt, convertToModelMessages as n, getBoundProjectScopeId as nt, hasToolCall as o, getServerTenantScopeId as ot, createGateway as p, and as pt, setSessionTitle as q, extractJsonMiddleware as r, getDb$1 as rt, isFileUIPart as s, oauthApps as st, ToolLoopAgent as t, encryptCredentialPayload as tt, readUIMessageStream as u, secretValues as ut, generateId as v, tool as w, parseJSON as x, getRuntimeEnvironmentUserAgent as y, latestSessionEventByTypes as z };
|
|
28297
28300
|
|
|
28298
|
-
//# sourceMappingURL=dist-
|
|
28301
|
+
//# sourceMappingURL=dist-CBMAwfqk.mjs.map
|