@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
package/dist/action.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dist = require("./dist
|
|
3
|
-
exports.
|
|
4
|
-
exports.DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = require_dist.DEFAULT_CREDENTIAL_RESOLUTION_CHAIN;
|
|
2
|
+
const require_dist = require("./dist-DEwBt6Ee.cjs");
|
|
3
|
+
exports.CREDENTIAL_SCOPE_TYPES = require_dist.CREDENTIAL_SCOPE_TYPES;
|
|
5
4
|
exports.actionCoreSchema = require_dist.actionCoreSchema;
|
|
6
5
|
exports.createStepInvocation = require_dist.createStepInvocation;
|
|
7
6
|
exports.credential = require_dist.credential;
|
package/dist/action.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { C as runWithRunSignal, S as runOutsideActionExecution, _ as isAction, a as ResolveActionCredentialsFn, b as registerWorkflowRunGetter, c as WorkflowActionDefinition, d as createStepInvocation, f as defineAction, g as getWorkflowRunHandle, h as getRunSignal, i as AgentRunOptions, l as WorkflowRunHandle, m as getActionCredentialRequirements, n as ActionDefinition, o as ResolveActionToolOptions, p as executeAction, r as ActionDefinitionInput, s as StepInvocation, t as ActionCredentialConsumer, u as actionCoreSchema, v as isStepInvocation, w as runWithinActionExecution, x as resolveActionTool, y as isWithinActionExecution } from "./index-
|
|
3
|
-
export { type ActionCredentialConsumer, type ActionDefinition, type ActionDefinitionInput, type AgentRunOptions,
|
|
1
|
+
import { C as isCredentialInput, S as defineCredential, T as toCredentialRequirement, a as CredentialInput, b as credential, d as DefineOAuthCredentialInput, f as DefineStaticCredentialInput, l as CredentialScopeType, n as Credential, o as CredentialList, p as NormalizeCredential, r as CredentialAuthKind, s as CredentialRequirement, t as CREDENTIAL_SCOPE_TYPES, u as DefineCredentialInput, v as ResolvedCredentials, w as normalizeCredentialList, x as credentialInputSchema } from "./index-hf0OTB6M.cjs";
|
|
2
|
+
import { C as runWithRunSignal, S as runOutsideActionExecution, _ as isAction, a as ResolveActionCredentialsFn, b as registerWorkflowRunGetter, c as WorkflowActionDefinition, d as createStepInvocation, f as defineAction, g as getWorkflowRunHandle, h as getRunSignal, i as AgentRunOptions, l as WorkflowRunHandle, m as getActionCredentialRequirements, n as ActionDefinition, o as ResolveActionToolOptions, p as executeAction, r as ActionDefinitionInput, s as StepInvocation, t as ActionCredentialConsumer, u as actionCoreSchema, v as isStepInvocation, w as runWithinActionExecution, x as resolveActionTool, y as isWithinActionExecution } from "./index-DjLUdkRo.cjs";
|
|
3
|
+
export { type ActionCredentialConsumer, type ActionDefinition, type ActionDefinitionInput, type AgentRunOptions, CREDENTIAL_SCOPE_TYPES, type Credential, type CredentialAuthKind, type CredentialInput, type CredentialList, type CredentialRequirement, type CredentialScopeType, type DefineCredentialInput, type DefineOAuthCredentialInput, type DefineStaticCredentialInput, type NormalizeCredential, type ResolveActionCredentialsFn, type ResolveActionToolOptions, type ResolvedCredentials, type StepInvocation, type WorkflowActionDefinition, type WorkflowRunHandle, actionCoreSchema, createStepInvocation, credential, credentialInputSchema, defineAction, defineCredential, executeAction, getActionCredentialRequirements, getRunSignal, getWorkflowRunHandle, isAction, isCredentialInput, isStepInvocation, isWithinActionExecution, normalizeCredentialList, registerWorkflowRunGetter, resolveActionTool, runOutsideActionExecution, runWithRunSignal, runWithinActionExecution, toCredentialRequirement };
|
package/dist/action.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { C as runWithRunSignal, S as runOutsideActionExecution, _ as isAction, a as ResolveActionCredentialsFn, b as registerWorkflowRunGetter, c as WorkflowActionDefinition, d as createStepInvocation, f as defineAction, g as getWorkflowRunHandle, h as getRunSignal, i as AgentRunOptions, l as WorkflowRunHandle, m as getActionCredentialRequirements, n as ActionDefinition, o as ResolveActionToolOptions, p as executeAction, r as ActionDefinitionInput, s as StepInvocation, t as ActionCredentialConsumer, u as actionCoreSchema, v as isStepInvocation, w as runWithinActionExecution, x as resolveActionTool, y as isWithinActionExecution } from "./index-
|
|
3
|
-
export { type ActionCredentialConsumer, type ActionDefinition, type ActionDefinitionInput, type AgentRunOptions,
|
|
1
|
+
import { C as isCredentialInput, S as defineCredential, T as toCredentialRequirement, a as CredentialInput, b as credential, d as DefineOAuthCredentialInput, f as DefineStaticCredentialInput, l as CredentialScopeType, n as Credential, o as CredentialList, p as NormalizeCredential, r as CredentialAuthKind, s as CredentialRequirement, t as CREDENTIAL_SCOPE_TYPES, u as DefineCredentialInput, v as ResolvedCredentials, w as normalizeCredentialList, x as credentialInputSchema } from "./index-hf0OTB6M.mjs";
|
|
2
|
+
import { C as runWithRunSignal, S as runOutsideActionExecution, _ as isAction, a as ResolveActionCredentialsFn, b as registerWorkflowRunGetter, c as WorkflowActionDefinition, d as createStepInvocation, f as defineAction, g as getWorkflowRunHandle, h as getRunSignal, i as AgentRunOptions, l as WorkflowRunHandle, m as getActionCredentialRequirements, n as ActionDefinition, o as ResolveActionToolOptions, p as executeAction, r as ActionDefinitionInput, s as StepInvocation, t as ActionCredentialConsumer, u as actionCoreSchema, v as isStepInvocation, w as runWithinActionExecution, x as resolveActionTool, y as isWithinActionExecution } from "./index-B8ZRIgPK.mjs";
|
|
3
|
+
export { type ActionCredentialConsumer, type ActionDefinition, type ActionDefinitionInput, type AgentRunOptions, CREDENTIAL_SCOPE_TYPES, type Credential, type CredentialAuthKind, type CredentialInput, type CredentialList, type CredentialRequirement, type CredentialScopeType, type DefineCredentialInput, type DefineOAuthCredentialInput, type DefineStaticCredentialInput, type NormalizeCredential, type ResolveActionCredentialsFn, type ResolveActionToolOptions, type ResolvedCredentials, type StepInvocation, type WorkflowActionDefinition, type WorkflowRunHandle, actionCoreSchema, createStepInvocation, credential, credentialInputSchema, defineAction, defineCredential, executeAction, getActionCredentialRequirements, getRunSignal, getWorkflowRunHandle, isAction, isCredentialInput, isStepInvocation, isWithinActionExecution, normalizeCredentialList, registerWorkflowRunGetter, resolveActionTool, runOutsideActionExecution, runWithRunSignal, runWithinActionExecution, toCredentialRequirement };
|
package/dist/action.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
export {
|
|
1
|
+
import { C as toCredentialRequirement, S as normalizeCredentialList, _ as credential, a as getActionCredentialRequirements, b as isCredentialInput, c as isAction, d as registerWorkflowRunGetter, f as resolveActionTool, g as CREDENTIAL_SCOPE_TYPES, h as runWithinActionExecution, i as executeAction, l as isStepInvocation, m as runWithRunSignal, n as createStepInvocation, o as getRunSignal, p as runOutsideActionExecution, r as defineAction, s as getWorkflowRunHandle, t as actionCoreSchema, u as isWithinActionExecution, v as credentialInputSchema, y as defineCredential } from "./dist-CFy63Npi.mjs";
|
|
2
|
+
export { CREDENTIAL_SCOPE_TYPES, actionCoreSchema, createStepInvocation, credential, credentialInputSchema, defineAction, defineCredential, executeAction, getActionCredentialRequirements, getRunSignal, getWorkflowRunHandle, isAction, isCredentialInput, isStepInvocation, isWithinActionExecution, normalizeCredentialList, registerWorkflowRunGetter, resolveActionTool, runOutsideActionExecution, runWithRunSignal, runWithinActionExecution, toCredentialRequirement };
|
package/dist/agent.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-DHdmVzO2.cjs");
|
|
3
|
-
const require_dist$1 = require("./dist
|
|
3
|
+
const require_dist$1 = require("./dist-DEwBt6Ee.cjs");
|
|
4
4
|
const require_dist$2 = require("./dist-CLr3qkxM.cjs");
|
|
5
5
|
require("./env-api-keys-BFptfIIs.cjs");
|
|
6
6
|
const require_event_stream = require("./event-stream-CS-ls7wC.cjs");
|
|
7
7
|
require("./json-parse-TT8Vr6d3.cjs");
|
|
8
|
-
const require_dist$3 = require("./dist-
|
|
8
|
+
const require_dist$3 = require("./dist-BLADLFrG.cjs");
|
|
9
9
|
let zod = require("zod");
|
|
10
10
|
let node_async_hooks = require("node:async_hooks");
|
|
11
11
|
let node_fs = require("node:fs");
|
|
@@ -902,7 +902,7 @@ function loadGoogleVertexProviderModule() {
|
|
|
902
902
|
return googleVertexProviderModulePromise;
|
|
903
903
|
}
|
|
904
904
|
function loadMistralProviderModule() {
|
|
905
|
-
mistralProviderModulePromise ||= Promise.resolve().then(() => require("./mistral-
|
|
905
|
+
mistralProviderModulePromise ||= Promise.resolve().then(() => require("./mistral-CC5EGzH4.cjs")).then((module) => {
|
|
906
906
|
const provider = module;
|
|
907
907
|
return {
|
|
908
908
|
stream: provider.streamMistral,
|
package/dist/agent.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { l as ThinkingLevel, u as getModel } from "./index-BByNfhJU.cjs";
|
|
2
|
-
import { A as loadAssetManifest, B as runLlm, C as createAgent, D as errorMessage, E as defineTool, F as resolveAgentAssets, G as AgentModelIdSchema, H as AgentCreateInput, I as resolveAgentId, J as parseAgentCreateInput, K as DEFAULT_THINKING_LEVEL, L as resolveAgentTools, M as normalizeAgentDefinition, N as prepareAgentSession, O as forceToolChoice, P as prompt, R as resolveAgentWorkspaceRoot, S as buildAgentRuntime, T as defineSubagentTool, U as AgentCreateInputSchema, V as snapshot, W as AgentModelId, X as resolveThinkingLevel, Y as resolveAgentModel, _ as SessionAgentMismatchError, a as AgentDefinitionInput, b as SubagentToolInherit, c as BuildAgentRuntimeContext, d as PromptInput, f as PromptResponse, g as SandboxedAgentRuntime, h as SUBAGENT_TOOL, i as AgentDefinition, j as messages, k as getSubagentToolMetadata, l as DefineSubagentToolInput, m as RunAgentPromptOptions, n as AgentAssetInput, o as AgentRuntime, p as ResolvedAgentAssets, q as ThinkingLevelSchema, r as AgentConfig, s as AgentSnapshot, t as Agent, u as ForcedToolChoice, v as SubagentTool, w as defineAgent, x as SubagentToolMetadata, y as SubagentToolDetails, z as runAgentPrompt } from "./index-
|
|
3
|
-
import { a as McpDefinition, c as McpServerOptions, d as McpTransport, f as connectMcpDefinition, g as isMcp, h as defineMcp, i as McpConnection, l as McpStdioOptions, m as connectMcpStdio, n as McpAuthOptions, o as McpDefinitionInput, p as connectMcpServer, r as McpCallToolOptions, s as McpHttpTransport, t as ToolCredentialResolver, u as McpStdioTransport } from "./index-
|
|
2
|
+
import { A as loadAssetManifest, B as runLlm, C as createAgent, D as errorMessage, E as defineTool, F as resolveAgentAssets, G as AgentModelIdSchema, H as AgentCreateInput, I as resolveAgentId, J as parseAgentCreateInput, K as DEFAULT_THINKING_LEVEL, L as resolveAgentTools, M as normalizeAgentDefinition, N as prepareAgentSession, O as forceToolChoice, P as prompt, R as resolveAgentWorkspaceRoot, S as buildAgentRuntime, T as defineSubagentTool, U as AgentCreateInputSchema, V as snapshot, W as AgentModelId, X as resolveThinkingLevel, Y as resolveAgentModel, _ as SessionAgentMismatchError, a as AgentDefinitionInput, b as SubagentToolInherit, c as BuildAgentRuntimeContext, d as PromptInput, f as PromptResponse, g as SandboxedAgentRuntime, h as SUBAGENT_TOOL, i as AgentDefinition, j as messages, k as getSubagentToolMetadata, l as DefineSubagentToolInput, m as RunAgentPromptOptions, n as AgentAssetInput, o as AgentRuntime, p as ResolvedAgentAssets, q as ThinkingLevelSchema, r as AgentConfig, s as AgentSnapshot, t as Agent, u as ForcedToolChoice, v as SubagentTool, w as defineAgent, x as SubagentToolMetadata, y as SubagentToolDetails, z as runAgentPrompt } from "./index-CUYwOWCh.cjs";
|
|
3
|
+
import { a as McpDefinition, c as McpServerOptions, d as McpTransport, f as connectMcpDefinition, g as isMcp, h as defineMcp, i as McpConnection, l as McpStdioOptions, m as connectMcpStdio, n as McpAuthOptions, o as McpDefinitionInput, p as connectMcpServer, r as McpCallToolOptions, s as McpHttpTransport, t as ToolCredentialResolver, u as McpStdioTransport } from "./index-y_2btA4s.cjs";
|
|
4
4
|
export { type Agent, type AgentAssetInput, type AgentConfig, type AgentCreateInput, AgentCreateInputSchema, type AgentDefinition, type AgentDefinitionInput, type AgentModelId, AgentModelIdSchema, type AgentRuntime, type AgentSnapshot, type BuildAgentRuntimeContext, DEFAULT_THINKING_LEVEL, type DefineSubagentToolInput, type ForcedToolChoice, type McpAuthOptions, type McpCallToolOptions, type McpConnection, type McpDefinition, type McpDefinitionInput, type McpHttpTransport, type McpServerOptions, type McpStdioOptions, type McpStdioTransport, type McpTransport, type PromptInput, type PromptResponse, type ResolvedAgentAssets, type RunAgentPromptOptions, SUBAGENT_TOOL, type SandboxedAgentRuntime, SessionAgentMismatchError, type SubagentTool, type SubagentToolDetails, type SubagentToolInherit, type SubagentToolMetadata, type ThinkingLevel, ThinkingLevelSchema, type ToolCredentialResolver, buildAgentRuntime, connectMcpDefinition, connectMcpServer, connectMcpStdio, createAgent, defineAgent, defineMcp, defineSubagentTool, defineTool, errorMessage, forceToolChoice, getModel, getSubagentToolMetadata, isMcp, loadAssetManifest, messages, normalizeAgentDefinition, parseAgentCreateInput, prepareAgentSession, prompt, resolveAgentAssets, resolveAgentId, resolveAgentModel, resolveAgentTools, resolveAgentWorkspaceRoot, resolveThinkingLevel, runAgentPrompt, runLlm, snapshot };
|
package/dist/agent.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { l as ThinkingLevel, u as getModel } from "./index-D37gqyek.mjs";
|
|
2
|
-
import { A as loadAssetManifest, B as runLlm, C as createAgent, D as errorMessage, E as defineTool, F as resolveAgentAssets, G as AgentModelIdSchema, H as AgentCreateInput, I as resolveAgentId, J as parseAgentCreateInput, K as DEFAULT_THINKING_LEVEL, L as resolveAgentTools, M as normalizeAgentDefinition, N as prepareAgentSession, O as forceToolChoice, P as prompt, R as resolveAgentWorkspaceRoot, S as buildAgentRuntime, T as defineSubagentTool, U as AgentCreateInputSchema, V as snapshot, W as AgentModelId, X as resolveThinkingLevel, Y as resolveAgentModel, _ as SessionAgentMismatchError, a as AgentDefinitionInput, b as SubagentToolInherit, c as BuildAgentRuntimeContext, d as PromptInput, f as PromptResponse, g as SandboxedAgentRuntime, h as SUBAGENT_TOOL, i as AgentDefinition, j as messages, k as getSubagentToolMetadata, l as DefineSubagentToolInput, m as RunAgentPromptOptions, n as AgentAssetInput, o as AgentRuntime, p as ResolvedAgentAssets, q as ThinkingLevelSchema, r as AgentConfig, s as AgentSnapshot, t as Agent, u as ForcedToolChoice, v as SubagentTool, w as defineAgent, x as SubagentToolMetadata, y as SubagentToolDetails, z as runAgentPrompt } from "./index-
|
|
3
|
-
import { a as McpDefinition, c as McpServerOptions, d as McpTransport, f as connectMcpDefinition, g as isMcp, h as defineMcp, i as McpConnection, l as McpStdioOptions, m as connectMcpStdio, n as McpAuthOptions, o as McpDefinitionInput, p as connectMcpServer, r as McpCallToolOptions, s as McpHttpTransport, t as ToolCredentialResolver, u as McpStdioTransport } from "./index-
|
|
2
|
+
import { A as loadAssetManifest, B as runLlm, C as createAgent, D as errorMessage, E as defineTool, F as resolveAgentAssets, G as AgentModelIdSchema, H as AgentCreateInput, I as resolveAgentId, J as parseAgentCreateInput, K as DEFAULT_THINKING_LEVEL, L as resolveAgentTools, M as normalizeAgentDefinition, N as prepareAgentSession, O as forceToolChoice, P as prompt, R as resolveAgentWorkspaceRoot, S as buildAgentRuntime, T as defineSubagentTool, U as AgentCreateInputSchema, V as snapshot, W as AgentModelId, X as resolveThinkingLevel, Y as resolveAgentModel, _ as SessionAgentMismatchError, a as AgentDefinitionInput, b as SubagentToolInherit, c as BuildAgentRuntimeContext, d as PromptInput, f as PromptResponse, g as SandboxedAgentRuntime, h as SUBAGENT_TOOL, i as AgentDefinition, j as messages, k as getSubagentToolMetadata, l as DefineSubagentToolInput, m as RunAgentPromptOptions, n as AgentAssetInput, o as AgentRuntime, p as ResolvedAgentAssets, q as ThinkingLevelSchema, r as AgentConfig, s as AgentSnapshot, t as Agent, u as ForcedToolChoice, v as SubagentTool, w as defineAgent, x as SubagentToolMetadata, y as SubagentToolDetails, z as runAgentPrompt } from "./index-DPyUP9U_.mjs";
|
|
3
|
+
import { a as McpDefinition, c as McpServerOptions, d as McpTransport, f as connectMcpDefinition, g as isMcp, h as defineMcp, i as McpConnection, l as McpStdioOptions, m as connectMcpStdio, n as McpAuthOptions, o as McpDefinitionInput, p as connectMcpServer, r as McpCallToolOptions, s as McpHttpTransport, t as ToolCredentialResolver, u as McpStdioTransport } from "./index-CITVigQS.mjs";
|
|
4
4
|
export { type Agent, type AgentAssetInput, type AgentConfig, type AgentCreateInput, AgentCreateInputSchema, type AgentDefinition, type AgentDefinitionInput, type AgentModelId, AgentModelIdSchema, type AgentRuntime, type AgentSnapshot, type BuildAgentRuntimeContext, DEFAULT_THINKING_LEVEL, type DefineSubagentToolInput, type ForcedToolChoice, type McpAuthOptions, type McpCallToolOptions, type McpConnection, type McpDefinition, type McpDefinitionInput, type McpHttpTransport, type McpServerOptions, type McpStdioOptions, type McpStdioTransport, type McpTransport, type PromptInput, type PromptResponse, type ResolvedAgentAssets, type RunAgentPromptOptions, SUBAGENT_TOOL, type SandboxedAgentRuntime, SessionAgentMismatchError, type SubagentTool, type SubagentToolDetails, type SubagentToolInherit, type SubagentToolMetadata, type ThinkingLevel, ThinkingLevelSchema, type ToolCredentialResolver, buildAgentRuntime, connectMcpDefinition, connectMcpServer, connectMcpStdio, createAgent, defineAgent, defineMcp, defineSubagentTool, defineTool, errorMessage, forceToolChoice, getModel, getSubagentToolMetadata, isMcp, loadAssetManifest, messages, normalizeAgentDefinition, parseAgentCreateInput, prepareAgentSession, prompt, resolveAgentAssets, resolveAgentId, resolveAgentModel, resolveAgentTools, resolveAgentWorkspaceRoot, resolveThinkingLevel, runAgentPrompt, runLlm, snapshot };
|
package/dist/agent.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $ as Options, $t as IsMap, An as IsSymbol$1, At as Unreachable, Bn as __require, Bt as IsRef$1, Cn as IsMinLength$2, Ct as IsInteger$2, Dn as IsObject$1, Dt as IsCodec, En as IsNumber$1, Et as IsBigInt$2, Fn as Symbols, Ft as IsUnion, G as ensureWorkspaceDir, Gt as IsArray$2, Ht as IsFunction$2, In as guard_exports, It as Union, Jt as IsOptional, K as materializeSandbox, Kt as Base, Ln as __commonJSMin, Lt as IsObject$2, Mn as IsUnsafePropertyKey, Mt as IsEnum$1, Nn as IsValueLike, Nt as IsCyclic, On as IsObjectNotArray$1, Ot as Hash, Pn as Keys$1, Pt as Unknown, Q as Instantiate, Qt as Get$3, Rt as _Object_, Sn as IsMaxLength$2, St as IsIterator$2, Tn as IsNull$1, Tt as IsBoolean$2, Ut as IsConstructor$2, Vt as Ref$1, W as defineSandbox, Wt as IsAsyncIterator$2, X as resolveSandboxRoot, Xt as IsPromise, Yt as Optional, Z as Evaluate$1, Zt as IsSchema$1, _n as IsGreaterThan$1, _t as IsLiteralBigInt, a as createSandbox, an as EveryAll, at as RecordPattern, bn as IsLessEqualThan$1, bt as IsLiteralString, c as defineTool$1, cn as IsAsyncIterator$1, ct as EnumToUnion, d as resolveRunProvider, dn as IsClassInstance, dt as String$1, en as IsSet, et as Compare, fn as IsConstructor$1, ft as IsSymbol$2, gn as IsGreaterEqualThan$1, gt as IsLiteral, hn as IsFunction$1, ht as IsNull$2, i as createJustBashProvider, in as Every$1, it as IsRecord, jn as IsUndefined$1, jt as IsIntersect, kn as IsString$1, kt as hash_exports, ln as IsBigInt$1, lt as TemplateLiteralDecode, mn as IsEqual$1, mt as Number$1, nn as Entries$2, nt as IsVoid, o as defaultWorkspacesRoot, on as HasPropertyKey$1, ot as RecordValue, pn as IsDeepEqual$1, pt as IsNumber$2, q as packAssetDirs, qt as IsBase, r as createInvokeToolBridge, rn as EntriesRegExp, rt as IsUndefined$2, s as defineSkill, sn as IsArray$1, st as IsTuple, tn as IsTypeArray, tt as IsTemplateLiteral, u as materializeSkills, un as IsBoolean$1, ut as IsString$2, vn as IsInteger$1, vt as IsLiteralBoolean, wn as IsMultipleOf$1, wt as Boolean$1, xn as IsLessThan$1, xt as Literal, yn as IsIterator$1, yt as IsLiteralNumber, zn as __exportAll, zt as IsNever } from "./dist-IaCcrwur.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { c as isAction, f as resolveActionTool, o as getRunSignal, s as getWorkflowRunHandle, u as isWithinActionExecution, w as toolParameters } from "./dist-CFy63Npi.mjs";
|
|
3
3
|
import "./env-api-keys-mSUt6vw1.mjs";
|
|
4
4
|
import { i as getModel, t as AssistantMessageEventStream } from "./event-stream-C7YBbzsc.mjs";
|
|
5
5
|
import "./json-parse-DzekVFUW.mjs";
|
|
6
|
-
import { C as connectMcpStdio, S as connectMcpServer, T as isMcp, _ as captureConsole, a as resolveActionCredentials, b as withSpan, c as addAgentSessionDuration, d as getAgentByRoute, f as getSession, g as touchSession, h as resolveRunSourceFromTraceContext, i as isCredentialError, l as appendEvent, m as recordLlmUsageFromAssistantMessage, n as captureCredentialToolErrors, o as resolveMcpTools, p as listMessageEvents, r as createCredentialResolver, s as MESSAGE_EVENT_TYPE$1, t as buildCredentialRunContext, u as createSession, v as getTraceContext, w as defineMcp, x as connectMcpDefinition } from "./dist-
|
|
6
|
+
import { C as connectMcpStdio, S as connectMcpServer, T as isMcp, _ as captureConsole, a as resolveActionCredentials, b as withSpan, c as addAgentSessionDuration, d as getAgentByRoute, f as getSession, g as touchSession, h as resolveRunSourceFromTraceContext, i as isCredentialError, l as appendEvent, m as recordLlmUsageFromAssistantMessage, n as captureCredentialToolErrors, o as resolveMcpTools, p as listMessageEvents, r as createCredentialResolver, s as MESSAGE_EVENT_TYPE$1, t as buildCredentialRunContext, u as createSession, v as getTraceContext, w as defineMcp, x as connectMcpDefinition } from "./dist-BX0Upt63.mjs";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -900,7 +900,7 @@ function loadGoogleVertexProviderModule() {
|
|
|
900
900
|
return googleVertexProviderModulePromise;
|
|
901
901
|
}
|
|
902
902
|
function loadMistralProviderModule() {
|
|
903
|
-
mistralProviderModulePromise ||= import("./mistral-
|
|
903
|
+
mistralProviderModulePromise ||= import("./mistral-DbKZmAHf.mjs").then((module) => {
|
|
904
904
|
const provider = module;
|
|
905
905
|
return {
|
|
906
906
|
stream: provider.streamMistral,
|
package/dist/app.cjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_dist = require("./dist-DEwBt6Ee.cjs");
|
|
3
|
+
const require_client = require("./client.cjs");
|
|
4
|
+
require("zod");
|
|
5
|
+
//#region ../app/dist/index.mjs
|
|
6
|
+
/**
|
|
7
|
+
* Author a connectable app: one templated credential, tools as data, execution via `execute`.
|
|
8
|
+
* Auth-specific wiring (e.g. Keystroke MCP gateway) lives in the caller or a facade package.
|
|
9
|
+
*/
|
|
10
|
+
function defineApp$1(input) {
|
|
11
|
+
const slug = input.slug.trim();
|
|
12
|
+
if (!slug) throw new Error("defineApp requires a non-empty slug");
|
|
13
|
+
const auth = input.auth ?? "keystroke";
|
|
14
|
+
const version = input.version.trim();
|
|
15
|
+
if (!version) throw new Error("defineApp requires a non-empty version");
|
|
16
|
+
const appCredential = require_dist.credential.keystroke(slug);
|
|
17
|
+
const execute = input.execute;
|
|
18
|
+
function tool(toolSlug, def) {
|
|
19
|
+
return require_dist.defineAction({
|
|
20
|
+
slug: def.slug,
|
|
21
|
+
...def.name !== void 0 ? { name: def.name } : {},
|
|
22
|
+
...def.description !== void 0 ? { description: def.description } : {},
|
|
23
|
+
input: def.input,
|
|
24
|
+
output: def.output,
|
|
25
|
+
credentials: [appCredential],
|
|
26
|
+
async run(runInput, credentials) {
|
|
27
|
+
const resolved = credentials[slug];
|
|
28
|
+
const result = await execute({
|
|
29
|
+
app: slug,
|
|
30
|
+
tool: toolSlug,
|
|
31
|
+
arguments: runInput,
|
|
32
|
+
version,
|
|
33
|
+
...resolved?.instanceId ? { instanceId: resolved.instanceId } : {}
|
|
34
|
+
});
|
|
35
|
+
return def.output.parse(result);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
slug,
|
|
41
|
+
auth,
|
|
42
|
+
version,
|
|
43
|
+
credential: appCredential,
|
|
44
|
+
tool
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/app.ts
|
|
49
|
+
/** Keystroke MCP app — wires `defineApp` to the platform gateway client. */
|
|
50
|
+
function defineApp(input) {
|
|
51
|
+
let client = input.client;
|
|
52
|
+
const getClient = () => client ??= require_client.createKeystrokeClient();
|
|
53
|
+
return defineApp$1({
|
|
54
|
+
slug: input.slug,
|
|
55
|
+
...input.auth !== void 0 ? { auth: input.auth } : {},
|
|
56
|
+
version: input.version,
|
|
57
|
+
async execute({ app, tool, arguments: args, instanceId, version }) {
|
|
58
|
+
const { result } = await getClient().tools.execute({
|
|
59
|
+
app,
|
|
60
|
+
tool,
|
|
61
|
+
arguments: args,
|
|
62
|
+
version,
|
|
63
|
+
...instanceId ? { instanceId } : {}
|
|
64
|
+
});
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
exports.defineApp = defineApp;
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=app.cjs.map
|
package/dist/app.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.cjs","names":["defineApp","credential","defineAction","createKeystrokeClient","defineAppCore"],"sources":["../../app/dist/index.mjs","../src/app.ts"],"sourcesContent":["import { credential, defineAction } from \"@keystrokehq/action\";\nimport \"zod\";\n//#region src/define-app.ts\n/**\n* Author a connectable app: one templated credential, tools as data, execution via `execute`.\n* Auth-specific wiring (e.g. Keystroke MCP gateway) lives in the caller or a facade package.\n*/\nfunction defineApp(input) {\n\tconst slug = input.slug.trim();\n\tif (!slug) throw new Error(\"defineApp requires a non-empty slug\");\n\tconst auth = input.auth ?? \"keystroke\";\n\tconst version = input.version.trim();\n\tif (!version) throw new Error(\"defineApp requires a non-empty version\");\n\tconst appCredential = credential.keystroke(slug);\n\tconst execute = input.execute;\n\tfunction tool(toolSlug, def) {\n\t\treturn defineAction({\n\t\t\tslug: def.slug,\n\t\t\t...def.name !== void 0 ? { name: def.name } : {},\n\t\t\t...def.description !== void 0 ? { description: def.description } : {},\n\t\t\tinput: def.input,\n\t\t\toutput: def.output,\n\t\t\tcredentials: [appCredential],\n\t\t\tasync run(runInput, credentials) {\n\t\t\t\tconst resolved = credentials[slug];\n\t\t\t\tconst result = await execute({\n\t\t\t\t\tapp: slug,\n\t\t\t\t\ttool: toolSlug,\n\t\t\t\t\targuments: runInput,\n\t\t\t\t\tversion,\n\t\t\t\t\t...resolved?.instanceId ? { instanceId: resolved.instanceId } : {}\n\t\t\t\t});\n\t\t\t\treturn def.output.parse(result);\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\tslug,\n\t\tauth,\n\t\tversion,\n\t\tcredential: appCredential,\n\t\ttool\n\t};\n}\n//#endregion\nexport { defineApp };\n\n//# sourceMappingURL=index.mjs.map","import {\n defineApp as defineAppCore,\n type App,\n type AppAuthKind,\n type AppToolDefinition,\n type DefineAppInput as CoreDefineAppInput,\n} from \"@keystrokehq/app\";\n\nimport { createKeystrokeClient, type KeystrokeClient } from \"./client\";\n\nexport type { App, AppAuthKind, AppToolDefinition };\n\nexport type DefineAppInput = Omit<CoreDefineAppInput, \"execute\"> & {\n /** Test seam — defaults to a client resolved from `KEYSTROKE_API_KEY` / `PUBLIC_PLATFORM_URL`. */\n client?: KeystrokeClient;\n};\n\n/** Keystroke MCP app — wires `defineApp` to the platform gateway client. */\nexport function defineApp(input: DefineAppInput): App {\n let client = input.client;\n const getClient = (): KeystrokeClient => (client ??= createKeystrokeClient());\n\n return defineAppCore({\n slug: input.slug,\n ...(input.auth !== undefined ? { auth: input.auth } : {}),\n version: input.version,\n async execute({ app, tool, arguments: args, instanceId, version }) {\n const { result } = await getClient().tools.execute({\n app,\n tool,\n arguments: args,\n version,\n ...(instanceId ? { instanceId } : {}),\n });\n return result;\n },\n });\n}\n"],"mappings":";;;;;;;;;AAOA,SAASA,YAAU,OAAO;CACzB,MAAM,OAAO,MAAM,KAAK,KAAK;CAC7B,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,qCAAqC;CAChE,MAAM,OAAO,MAAM,QAAQ;CAC3B,MAAM,UAAU,MAAM,QAAQ,KAAK;CACnC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,wCAAwC;CACtE,MAAM,gBAAgBC,aAAAA,WAAW,UAAU,IAAI;CAC/C,MAAM,UAAU,MAAM;CACtB,SAAS,KAAK,UAAU,KAAK;EAC5B,OAAOC,aAAAA,aAAa;GACnB,MAAM,IAAI;GACV,GAAG,IAAI,SAAS,KAAK,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;GAC/C,GAAG,IAAI,gBAAgB,KAAK,IAAI,EAAE,aAAa,IAAI,YAAY,IAAI,CAAC;GACpE,OAAO,IAAI;GACX,QAAQ,IAAI;GACZ,aAAa,CAAC,aAAa;GAC3B,MAAM,IAAI,UAAU,aAAa;IAChC,MAAM,WAAW,YAAY;IAC7B,MAAM,SAAS,MAAM,QAAQ;KAC5B,KAAK;KACL,MAAM;KACN,WAAW;KACX;KACA,GAAG,UAAU,aAAa,EAAE,YAAY,SAAS,WAAW,IAAI,CAAC;IAClE,CAAC;IACD,OAAO,IAAI,OAAO,MAAM,MAAM;GAC/B;EACD,CAAC;CACF;CACA,OAAO;EACN;EACA;EACA;EACA,YAAY;EACZ;CACD;AACD;;;;ACzBA,SAAgB,UAAU,OAA4B;CACpD,IAAI,SAAS,MAAM;CACnB,MAAM,kBAAoC,WAAWC,eAAAA,sBAAsB;CAE3E,OAAOC,YAAc;EACnB,MAAM,MAAM;EACZ,GAAI,MAAM,SAAS,KAAA,IAAY,EAAE,MAAM,MAAM,KAAK,IAAI,CAAC;EACvD,SAAS,MAAM;EACf,MAAM,QAAQ,EAAE,KAAK,MAAM,WAAW,MAAM,YAAY,WAAW;GACjE,MAAM,EAAE,WAAW,MAAM,UAAU,EAAE,MAAM,QAAQ;IACjD;IACA;IACA,WAAW;IACX;IACA,GAAI,aAAa,EAAE,WAAW,IAAI,CAAC;GACrC,CAAC;GACD,OAAO;EACT;CACF,CAAC;AACH"}
|
package/dist/app.d.cts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { b as credential } from "./index-hf0OTB6M.cjs";
|
|
2
|
+
import { c as WorkflowActionDefinition } from "./index-DjLUdkRo.cjs";
|
|
3
|
+
import { KeystrokeClient } from "./client.cjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
|
|
6
|
+
//#region ../app/dist/index.d.mts
|
|
7
|
+
//#region src/define-app.d.ts
|
|
8
|
+
/** Auth strategy an app templates onto its credential instances. */
|
|
9
|
+
type AppAuthKind = "keystroke";
|
|
10
|
+
type AppToolExecuteInput = {
|
|
11
|
+
app: string;
|
|
12
|
+
tool: string;
|
|
13
|
+
arguments: Record<string, unknown>;
|
|
14
|
+
instanceId?: string;
|
|
15
|
+
version: string;
|
|
16
|
+
};
|
|
17
|
+
type AppExecutor = (input: AppToolExecuteInput) => Promise<unknown>;
|
|
18
|
+
type DefineAppInput$1 = {
|
|
19
|
+
/** App + credential key (e.g. `github`). Matches `credential_instances.slug`. */slug: string;
|
|
20
|
+
auth?: AppAuthKind; /** Pinned app toolkit version (e.g. `20260501_01`). */
|
|
21
|
+
version: string; /** Runs a provider tool for the resolved credential instance. */
|
|
22
|
+
execute: AppExecutor;
|
|
23
|
+
};
|
|
24
|
+
type AppToolDefinition<TInput extends z.ZodType, TOutput extends z.ZodType> = {
|
|
25
|
+
/** Action slug for discovery + workflow step ids (e.g. `github-create-an-issue`). */slug: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
input: TInput;
|
|
29
|
+
output: TOutput;
|
|
30
|
+
};
|
|
31
|
+
type KeystrokeCredentialRef = ReturnType<typeof credential.keystroke<string>>;
|
|
32
|
+
type App = {
|
|
33
|
+
readonly slug: string;
|
|
34
|
+
readonly auth: AppAuthKind;
|
|
35
|
+
readonly version: string; /** Credential ref every tool on this app declares — templated from the app, not authored per use. */
|
|
36
|
+
readonly credential: KeystrokeCredentialRef;
|
|
37
|
+
/**
|
|
38
|
+
* Define an action bound to a provider tool (e.g. `GITHUB_CREATE_AN_ISSUE`). The result is an
|
|
39
|
+
* ordinary action — same credential resolution and `.scope()` binding as any other.
|
|
40
|
+
*/
|
|
41
|
+
tool<TInput extends z.ZodType, TOutput extends z.ZodType>(toolSlug: string, def: AppToolDefinition<TInput, TOutput>): WorkflowActionDefinition<z.infer<TInput>, z.infer<TOutput>, Record<string, {
|
|
42
|
+
instanceId?: string;
|
|
43
|
+
}>, readonly [KeystrokeCredentialRef]>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Author a connectable app: one templated credential, tools as data, execution via `execute`.
|
|
47
|
+
* Auth-specific wiring (e.g. Keystroke MCP gateway) lives in the caller or a facade package.
|
|
48
|
+
*/
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/app.d.ts
|
|
51
|
+
type DefineAppInput = Omit<DefineAppInput$1, "execute"> & {
|
|
52
|
+
/** Test seam — defaults to a client resolved from `KEYSTROKE_API_KEY` / `PUBLIC_PLATFORM_URL`. */client?: KeystrokeClient;
|
|
53
|
+
};
|
|
54
|
+
/** Keystroke MCP app — wires `defineApp` to the platform gateway client. */
|
|
55
|
+
declare function defineApp(input: DefineAppInput): App;
|
|
56
|
+
//#endregion
|
|
57
|
+
export { type App, type AppAuthKind, type AppToolDefinition, DefineAppInput, defineApp };
|
|
58
|
+
//# sourceMappingURL=app.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.cts","names":["WorkflowActionDefinition","credential","z","AppAuthKind","AppToolExecuteInput","Record","app","tool","arguments","instanceId","version","AppExecutor","Promise","input","DefineAppInput","slug","auth","execute","AppToolDefinition","TInput","TOutput","ZodType","name","description","output","KeystrokeCredentialRef","keystroke","ReturnType","App","infer","toolSlug","def","defineApp"],"sources":["../../app/dist/index.d.mts","../src/app.ts"],"mappings":";;;;;;;;KAKKG,WAAAA;AAAAA,KACAC,mBAAAA;EACHE,GAAAA;EACAC,IAAAA;EACAC,SAAAA,EAAWH,MAAM;EACjBI,UAAAA;EACAC,OAAAA;AAAAA;AAAAA,KAEGC,WAAAA,IAAeE,KAAAA,EAAOT,mBAAAA,KAAwBQ,OAAO;AAAA,KACrDE,gBAAAA;EAPHR,iFAQiFS,IAAAA;EACjFC,IAAAA,GAAOb,WAAAA,EARPI;EASAG,OAAAA,UARAF;EASAS,OAAAA,EAASN,WAAW;AAAA;AAAA,KAEjBO,iBAAAA,gBAAiChB,CAAAA,CAAEmB,OAAAA,kBAAyBnB,CAAAA,CAAEmB,OAAAA;EAT1D,qFAU8EN,IAAAA;EACrFO,IAAAA;EACAC,WAAAA;EACAV,KAAAA,EAAOM,MAAAA;EACPK,MAAAA,EAAQJ,OAAAA;AAAAA;AAAAA,KAELK,sBAAAA,GAAyBE,UAAU,QAAQ1B,UAAAA,CAAWyB,SAAAA;AAAAA,KACtDE,GAAAA;EAAAA,SACMb,IAAAA;EAAAA,SACAC,IAAAA,EAAMb,WAAAA;EAAAA,SACNO,OAAAA,UAlB+C;EAAA,SAmB/CT,UAAAA,EAAYwB,sBAAAA;EAlBJ;;;;EAuBjBlB,IAAAA,gBAAoBL,CAAAA,CAAEmB,OAAAA,kBAAyBnB,CAAAA,CAAEmB,OAAAA,EAASS,QAAAA,UAAkBC,GAAAA,EAAKb,iBAAAA,CAAkBC,MAAAA,EAAQC,OAAAA,IAAWpB,wBAAAA,CAAyBE,CAAAA,CAAE2B,KAAAA,CAAMV,MAAAA,GAASjB,CAAAA,CAAE2B,KAAAA,CAAMT,OAAAA,GAAUf,MAAAA;IAChLI,UAAAA;EAAAA,cACYgB,sBAAAA;AAAAA;;;AArBM;AAAA;;;KCNV,cAAA,GAAiB,IAAA,CAAK,gBAAA;oGAEhC,MAAA,GAAS,eAAA;AAAA;;iBAIK,SAAA,CAAU,KAAA,EAAO,cAAA,GAAiB,GAAG"}
|
package/dist/app.d.mts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { b as credential } from "./index-hf0OTB6M.mjs";
|
|
2
|
+
import { c as WorkflowActionDefinition } from "./index-B8ZRIgPK.mjs";
|
|
3
|
+
import { KeystrokeClient } from "./client.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
|
|
6
|
+
//#region ../app/dist/index.d.mts
|
|
7
|
+
//#region src/define-app.d.ts
|
|
8
|
+
/** Auth strategy an app templates onto its credential instances. */
|
|
9
|
+
type AppAuthKind = "keystroke";
|
|
10
|
+
type AppToolExecuteInput = {
|
|
11
|
+
app: string;
|
|
12
|
+
tool: string;
|
|
13
|
+
arguments: Record<string, unknown>;
|
|
14
|
+
instanceId?: string;
|
|
15
|
+
version: string;
|
|
16
|
+
};
|
|
17
|
+
type AppExecutor = (input: AppToolExecuteInput) => Promise<unknown>;
|
|
18
|
+
type DefineAppInput$1 = {
|
|
19
|
+
/** App + credential key (e.g. `github`). Matches `credential_instances.slug`. */slug: string;
|
|
20
|
+
auth?: AppAuthKind; /** Pinned app toolkit version (e.g. `20260501_01`). */
|
|
21
|
+
version: string; /** Runs a provider tool for the resolved credential instance. */
|
|
22
|
+
execute: AppExecutor;
|
|
23
|
+
};
|
|
24
|
+
type AppToolDefinition<TInput extends z.ZodType, TOutput extends z.ZodType> = {
|
|
25
|
+
/** Action slug for discovery + workflow step ids (e.g. `github-create-an-issue`). */slug: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
input: TInput;
|
|
29
|
+
output: TOutput;
|
|
30
|
+
};
|
|
31
|
+
type KeystrokeCredentialRef = ReturnType<typeof credential.keystroke<string>>;
|
|
32
|
+
type App = {
|
|
33
|
+
readonly slug: string;
|
|
34
|
+
readonly auth: AppAuthKind;
|
|
35
|
+
readonly version: string; /** Credential ref every tool on this app declares — templated from the app, not authored per use. */
|
|
36
|
+
readonly credential: KeystrokeCredentialRef;
|
|
37
|
+
/**
|
|
38
|
+
* Define an action bound to a provider tool (e.g. `GITHUB_CREATE_AN_ISSUE`). The result is an
|
|
39
|
+
* ordinary action — same credential resolution and `.scope()` binding as any other.
|
|
40
|
+
*/
|
|
41
|
+
tool<TInput extends z.ZodType, TOutput extends z.ZodType>(toolSlug: string, def: AppToolDefinition<TInput, TOutput>): WorkflowActionDefinition<z.infer<TInput>, z.infer<TOutput>, Record<string, {
|
|
42
|
+
instanceId?: string;
|
|
43
|
+
}>, readonly [KeystrokeCredentialRef]>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Author a connectable app: one templated credential, tools as data, execution via `execute`.
|
|
47
|
+
* Auth-specific wiring (e.g. Keystroke MCP gateway) lives in the caller or a facade package.
|
|
48
|
+
*/
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/app.d.ts
|
|
51
|
+
type DefineAppInput = Omit<DefineAppInput$1, "execute"> & {
|
|
52
|
+
/** Test seam — defaults to a client resolved from `KEYSTROKE_API_KEY` / `PUBLIC_PLATFORM_URL`. */client?: KeystrokeClient;
|
|
53
|
+
};
|
|
54
|
+
/** Keystroke MCP app — wires `defineApp` to the platform gateway client. */
|
|
55
|
+
declare function defineApp(input: DefineAppInput): App;
|
|
56
|
+
//#endregion
|
|
57
|
+
export { type App, type AppAuthKind, type AppToolDefinition, DefineAppInput, defineApp };
|
|
58
|
+
//# sourceMappingURL=app.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.mts","names":["WorkflowActionDefinition","credential","z","AppAuthKind","AppToolExecuteInput","Record","app","tool","arguments","instanceId","version","AppExecutor","Promise","input","DefineAppInput","slug","auth","execute","AppToolDefinition","TInput","TOutput","ZodType","name","description","output","KeystrokeCredentialRef","keystroke","ReturnType","App","infer","toolSlug","def","defineApp"],"sources":["../../app/dist/index.d.mts","../src/app.ts"],"mappings":";;;;;;;;KAKKG,WAAAA;AAAAA,KACAC,mBAAAA;EACHE,GAAAA;EACAC,IAAAA;EACAC,SAAAA,EAAWH,MAAM;EACjBI,UAAAA;EACAC,OAAAA;AAAAA;AAAAA,KAEGC,WAAAA,IAAeE,KAAAA,EAAOT,mBAAAA,KAAwBQ,OAAO;AAAA,KACrDE,gBAAAA;EAPHR,iFAQiFS,IAAAA;EACjFC,IAAAA,GAAOb,WAAAA,EARPI;EASAG,OAAAA,UARAF;EASAS,OAAAA,EAASN,WAAW;AAAA;AAAA,KAEjBO,iBAAAA,gBAAiChB,CAAAA,CAAEmB,OAAAA,kBAAyBnB,CAAAA,CAAEmB,OAAAA;EAT1D,qFAU8EN,IAAAA;EACrFO,IAAAA;EACAC,WAAAA;EACAV,KAAAA,EAAOM,MAAAA;EACPK,MAAAA,EAAQJ,OAAAA;AAAAA;AAAAA,KAELK,sBAAAA,GAAyBE,UAAU,QAAQ1B,UAAAA,CAAWyB,SAAAA;AAAAA,KACtDE,GAAAA;EAAAA,SACMb,IAAAA;EAAAA,SACAC,IAAAA,EAAMb,WAAAA;EAAAA,SACNO,OAAAA,UAlB+C;EAAA,SAmB/CT,UAAAA,EAAYwB,sBAAAA;EAlBJ;;;;EAuBjBlB,IAAAA,gBAAoBL,CAAAA,CAAEmB,OAAAA,kBAAyBnB,CAAAA,CAAEmB,OAAAA,EAASS,QAAAA,UAAkBC,GAAAA,EAAKb,iBAAAA,CAAkBC,MAAAA,EAAQC,OAAAA,IAAWpB,wBAAAA,CAAyBE,CAAAA,CAAE2B,KAAAA,CAAMV,MAAAA,GAASjB,CAAAA,CAAE2B,KAAAA,CAAMT,OAAAA,GAAUf,MAAAA;IAChLI,UAAAA;EAAAA,cACYgB,sBAAAA;AAAAA;;;AArBM;AAAA;;;KCNV,cAAA,GAAiB,IAAA,CAAK,gBAAA;oGAEhC,MAAA,GAAS,eAAA;AAAA;;iBAIK,SAAA,CAAU,KAAA,EAAO,cAAA,GAAiB,GAAG"}
|
package/dist/app.mjs
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { _ as credential, r as defineAction } from "./dist-CFy63Npi.mjs";
|
|
2
|
+
import { createKeystrokeClient } from "./client.mjs";
|
|
3
|
+
import "zod";
|
|
4
|
+
//#region ../app/dist/index.mjs
|
|
5
|
+
/**
|
|
6
|
+
* Author a connectable app: one templated credential, tools as data, execution via `execute`.
|
|
7
|
+
* Auth-specific wiring (e.g. Keystroke MCP gateway) lives in the caller or a facade package.
|
|
8
|
+
*/
|
|
9
|
+
function defineApp$1(input) {
|
|
10
|
+
const slug = input.slug.trim();
|
|
11
|
+
if (!slug) throw new Error("defineApp requires a non-empty slug");
|
|
12
|
+
const auth = input.auth ?? "keystroke";
|
|
13
|
+
const version = input.version.trim();
|
|
14
|
+
if (!version) throw new Error("defineApp requires a non-empty version");
|
|
15
|
+
const appCredential = credential.keystroke(slug);
|
|
16
|
+
const execute = input.execute;
|
|
17
|
+
function tool(toolSlug, def) {
|
|
18
|
+
return defineAction({
|
|
19
|
+
slug: def.slug,
|
|
20
|
+
...def.name !== void 0 ? { name: def.name } : {},
|
|
21
|
+
...def.description !== void 0 ? { description: def.description } : {},
|
|
22
|
+
input: def.input,
|
|
23
|
+
output: def.output,
|
|
24
|
+
credentials: [appCredential],
|
|
25
|
+
async run(runInput, credentials) {
|
|
26
|
+
const resolved = credentials[slug];
|
|
27
|
+
const result = await execute({
|
|
28
|
+
app: slug,
|
|
29
|
+
tool: toolSlug,
|
|
30
|
+
arguments: runInput,
|
|
31
|
+
version,
|
|
32
|
+
...resolved?.instanceId ? { instanceId: resolved.instanceId } : {}
|
|
33
|
+
});
|
|
34
|
+
return def.output.parse(result);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
slug,
|
|
40
|
+
auth,
|
|
41
|
+
version,
|
|
42
|
+
credential: appCredential,
|
|
43
|
+
tool
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/app.ts
|
|
48
|
+
/** Keystroke MCP app — wires `defineApp` to the platform gateway client. */
|
|
49
|
+
function defineApp(input) {
|
|
50
|
+
let client = input.client;
|
|
51
|
+
const getClient = () => client ??= createKeystrokeClient();
|
|
52
|
+
return defineApp$1({
|
|
53
|
+
slug: input.slug,
|
|
54
|
+
...input.auth !== void 0 ? { auth: input.auth } : {},
|
|
55
|
+
version: input.version,
|
|
56
|
+
async execute({ app, tool, arguments: args, instanceId, version }) {
|
|
57
|
+
const { result } = await getClient().tools.execute({
|
|
58
|
+
app,
|
|
59
|
+
tool,
|
|
60
|
+
arguments: args,
|
|
61
|
+
version,
|
|
62
|
+
...instanceId ? { instanceId } : {}
|
|
63
|
+
});
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { defineApp };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=app.mjs.map
|
package/dist/app.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.mjs","names":["defineApp","defineAppCore"],"sources":["../../app/dist/index.mjs","../src/app.ts"],"sourcesContent":["import { credential, defineAction } from \"@keystrokehq/action\";\nimport \"zod\";\n//#region src/define-app.ts\n/**\n* Author a connectable app: one templated credential, tools as data, execution via `execute`.\n* Auth-specific wiring (e.g. Keystroke MCP gateway) lives in the caller or a facade package.\n*/\nfunction defineApp(input) {\n\tconst slug = input.slug.trim();\n\tif (!slug) throw new Error(\"defineApp requires a non-empty slug\");\n\tconst auth = input.auth ?? \"keystroke\";\n\tconst version = input.version.trim();\n\tif (!version) throw new Error(\"defineApp requires a non-empty version\");\n\tconst appCredential = credential.keystroke(slug);\n\tconst execute = input.execute;\n\tfunction tool(toolSlug, def) {\n\t\treturn defineAction({\n\t\t\tslug: def.slug,\n\t\t\t...def.name !== void 0 ? { name: def.name } : {},\n\t\t\t...def.description !== void 0 ? { description: def.description } : {},\n\t\t\tinput: def.input,\n\t\t\toutput: def.output,\n\t\t\tcredentials: [appCredential],\n\t\t\tasync run(runInput, credentials) {\n\t\t\t\tconst resolved = credentials[slug];\n\t\t\t\tconst result = await execute({\n\t\t\t\t\tapp: slug,\n\t\t\t\t\ttool: toolSlug,\n\t\t\t\t\targuments: runInput,\n\t\t\t\t\tversion,\n\t\t\t\t\t...resolved?.instanceId ? { instanceId: resolved.instanceId } : {}\n\t\t\t\t});\n\t\t\t\treturn def.output.parse(result);\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\tslug,\n\t\tauth,\n\t\tversion,\n\t\tcredential: appCredential,\n\t\ttool\n\t};\n}\n//#endregion\nexport { defineApp };\n\n//# sourceMappingURL=index.mjs.map","import {\n defineApp as defineAppCore,\n type App,\n type AppAuthKind,\n type AppToolDefinition,\n type DefineAppInput as CoreDefineAppInput,\n} from \"@keystrokehq/app\";\n\nimport { createKeystrokeClient, type KeystrokeClient } from \"./client\";\n\nexport type { App, AppAuthKind, AppToolDefinition };\n\nexport type DefineAppInput = Omit<CoreDefineAppInput, \"execute\"> & {\n /** Test seam — defaults to a client resolved from `KEYSTROKE_API_KEY` / `PUBLIC_PLATFORM_URL`. */\n client?: KeystrokeClient;\n};\n\n/** Keystroke MCP app — wires `defineApp` to the platform gateway client. */\nexport function defineApp(input: DefineAppInput): App {\n let client = input.client;\n const getClient = (): KeystrokeClient => (client ??= createKeystrokeClient());\n\n return defineAppCore({\n slug: input.slug,\n ...(input.auth !== undefined ? { auth: input.auth } : {}),\n version: input.version,\n async execute({ app, tool, arguments: args, instanceId, version }) {\n const { result } = await getClient().tools.execute({\n app,\n tool,\n arguments: args,\n version,\n ...(instanceId ? { instanceId } : {}),\n });\n return result;\n },\n });\n}\n"],"mappings":";;;;;;;;AAOA,SAASA,YAAU,OAAO;CACzB,MAAM,OAAO,MAAM,KAAK,KAAK;CAC7B,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,qCAAqC;CAChE,MAAM,OAAO,MAAM,QAAQ;CAC3B,MAAM,UAAU,MAAM,QAAQ,KAAK;CACnC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,wCAAwC;CACtE,MAAM,gBAAgB,WAAW,UAAU,IAAI;CAC/C,MAAM,UAAU,MAAM;CACtB,SAAS,KAAK,UAAU,KAAK;EAC5B,OAAO,aAAa;GACnB,MAAM,IAAI;GACV,GAAG,IAAI,SAAS,KAAK,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;GAC/C,GAAG,IAAI,gBAAgB,KAAK,IAAI,EAAE,aAAa,IAAI,YAAY,IAAI,CAAC;GACpE,OAAO,IAAI;GACX,QAAQ,IAAI;GACZ,aAAa,CAAC,aAAa;GAC3B,MAAM,IAAI,UAAU,aAAa;IAChC,MAAM,WAAW,YAAY;IAC7B,MAAM,SAAS,MAAM,QAAQ;KAC5B,KAAK;KACL,MAAM;KACN,WAAW;KACX;KACA,GAAG,UAAU,aAAa,EAAE,YAAY,SAAS,WAAW,IAAI,CAAC;IAClE,CAAC;IACD,OAAO,IAAI,OAAO,MAAM,MAAM;GAC/B;EACD,CAAC;CACF;CACA,OAAO;EACN;EACA;EACA;EACA,YAAY;EACZ;CACD;AACD;;;;ACzBA,SAAgB,UAAU,OAA4B;CACpD,IAAI,SAAS,MAAM;CACnB,MAAM,kBAAoC,WAAW,sBAAsB;CAE3E,OAAOC,YAAc;EACnB,MAAM,MAAM;EACZ,GAAI,MAAM,SAAS,KAAA,IAAY,EAAE,MAAM,MAAM,KAAK,IAAI,CAAC;EACvD,SAAS,MAAM;EACf,MAAM,QAAQ,EAAE,KAAK,MAAM,WAAW,MAAM,YAAY,WAAW;GACjE,MAAM,EAAE,WAAW,MAAM,UAAU,EAAE,MAAM,QAAQ;IACjD;IACA;IACA,WAAW;IACX;IACA,GAAI,aAAa,EAAE,WAAW,IAAI,CAAC;GACrC,CAAC;GACD,OAAO;EACT;CACF,CAAC;AACH"}
|
package/dist/client.cjs
CHANGED
|
@@ -14,7 +14,9 @@ function createKeystrokeClient(options = {}) {
|
|
|
14
14
|
return { tools: { execute: (input) => api.post("tools/execute", { json: {
|
|
15
15
|
app: input.app,
|
|
16
16
|
tool: input.tool,
|
|
17
|
-
arguments: input.arguments ?? {}
|
|
17
|
+
arguments: input.arguments ?? {},
|
|
18
|
+
version: input.version,
|
|
19
|
+
...input.instanceId ? { instanceId: input.instanceId } : {}
|
|
18
20
|
} }).json() } };
|
|
19
21
|
}
|
|
20
22
|
//#endregion
|
package/dist/client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.cjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import ky, { type KyInstance, type Options } from \"ky\";\n\nexport type KeystrokeClientOptions = {\n /** Defaults to process.env.KEYSTROKE_API_KEY */\n apiKey?: string;\n /** Defaults to process.env.PUBLIC_PLATFORM_URL or http://localhost:3002 */\n platformUrl?: string;\n ky?: Options;\n};\n\nexport type ExecuteToolInput = {\n app: string;\n tool: string;\n arguments?: Record<string, unknown>;\n};\n\nexport type KeystrokeClient = {\n tools: {\n execute: (input: ExecuteToolInput) => Promise<{ ok: boolean; result: unknown }>;\n };\n};\n\nexport function createKeystrokeClient(options: KeystrokeClientOptions = {}): KeystrokeClient {\n const apiKey = options.apiKey ?? process.env.KEYSTROKE_API_KEY;\n const platformUrl = (\n options.platformUrl ??\n process.env.PUBLIC_PLATFORM_URL ??\n \"http://localhost:3002\"\n ).replace(/\\/+$/, \"\");\n\n const api: KyInstance = ky.create({\n prefix: `${platformUrl}/mcp/`,\n headers: apiKey ? { \"x-api-key\": apiKey } : {},\n ...options.ky,\n });\n\n return {\n tools: {\n execute: (input) =>\n api\n .post(\"tools/execute\", {\n json: {\n app: input.app,\n tool: input.tool,\n arguments: input.arguments ?? {},\n },\n })\n .json<{ ok: boolean; result: unknown }>(),\n },\n };\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"client.cjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import ky, { type KyInstance, type Options } from \"ky\";\n\nexport type KeystrokeClientOptions = {\n /** Defaults to process.env.KEYSTROKE_API_KEY */\n apiKey?: string;\n /** Defaults to process.env.PUBLIC_PLATFORM_URL or http://localhost:3002 */\n platformUrl?: string;\n ky?: Options;\n};\n\nexport type ExecuteToolInput = {\n app: string;\n tool: string;\n arguments?: Record<string, unknown>;\n /**\n * Resolved credential instance to execute against. When set, the platform executes that exact\n * connection; when omitted it falls back to resolving the app's instance by scope.\n */\n instanceId?: string;\n /** Pinned provider toolkit version (e.g. `20260501_01`); forwarded to the provider on execute. */\n version: string;\n};\n\nexport type KeystrokeClient = {\n tools: {\n execute: (input: ExecuteToolInput) => Promise<{ ok: boolean; result: unknown }>;\n };\n};\n\nexport function createKeystrokeClient(options: KeystrokeClientOptions = {}): KeystrokeClient {\n const apiKey = options.apiKey ?? process.env.KEYSTROKE_API_KEY;\n const platformUrl = (\n options.platformUrl ??\n process.env.PUBLIC_PLATFORM_URL ??\n \"http://localhost:3002\"\n ).replace(/\\/+$/, \"\");\n\n const api: KyInstance = ky.create({\n prefix: `${platformUrl}/mcp/`,\n headers: apiKey ? { \"x-api-key\": apiKey } : {},\n ...options.ky,\n });\n\n return {\n tools: {\n execute: (input) =>\n api\n .post(\"tools/execute\", {\n json: {\n app: input.app,\n tool: input.tool,\n arguments: input.arguments ?? {},\n version: input.version,\n ...(input.instanceId ? { instanceId: input.instanceId } : {}),\n },\n })\n .json<{ ok: boolean; result: unknown }>(),\n },\n };\n}\n"],"mappings":";;;;;AA6BA,SAAgB,sBAAsB,UAAkC,CAAC,GAAoB;CAC3F,MAAM,SAAS,QAAQ,UAAU,QAAQ,IAAI;CAC7C,MAAM,eACJ,QAAQ,eACR,QAAQ,IAAI,uBACZ,yBACA,QAAQ,QAAQ,EAAE;CAEpB,MAAM,MAAkB,GAAA,QAAG,OAAO;EAChC,QAAQ,GAAG,YAAY;EACvB,SAAS,SAAS,EAAE,aAAa,OAAO,IAAI,CAAC;EAC7C,GAAG,QAAQ;CACb,CAAC;CAED,OAAO,EACL,OAAO,EACL,UAAU,UACR,IACG,KAAK,iBAAiB,EACrB,MAAM;EACJ,KAAK,MAAM;EACX,MAAM,MAAM;EACZ,WAAW,MAAM,aAAa,CAAC;EAC/B,SAAS,MAAM;EACf,GAAI,MAAM,aAAa,EAAE,YAAY,MAAM,WAAW,IAAI,CAAC;CAC7D,EACF,CAAC,EACA,KAAuC,EAC9C,EACF;AACF"}
|
package/dist/client.d.cts
CHANGED
|
@@ -10,6 +10,12 @@ type ExecuteToolInput = {
|
|
|
10
10
|
app: string;
|
|
11
11
|
tool: string;
|
|
12
12
|
arguments?: Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Resolved credential instance to execute against. When set, the platform executes that exact
|
|
15
|
+
* connection; when omitted it falls back to resolving the app's instance by scope.
|
|
16
|
+
*/
|
|
17
|
+
instanceId?: string; /** Pinned provider toolkit version (e.g. `20260501_01`); forwarded to the provider on execute. */
|
|
18
|
+
version: string;
|
|
13
19
|
};
|
|
14
20
|
type KeystrokeClient = {
|
|
15
21
|
tools: {
|
package/dist/client.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.cts","names":[],"sources":["../src/client.ts"],"mappings":";;;KAEY,sBAAA;kDAEV,MAAA,WAFgC;EAIhC,WAAA;EACA,EAAA,GAAK,OAAO;AAAA;AAAA,KAGF,gBAAA;EACV,GAAA;EACA,IAAA;EACA,SAAA,GAAY,MAAM;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"client.d.cts","names":[],"sources":["../src/client.ts"],"mappings":";;;KAEY,sBAAA;kDAEV,MAAA,WAFgC;EAIhC,WAAA;EACA,EAAA,GAAK,OAAO;AAAA;AAAA,KAGF,gBAAA;EACV,GAAA;EACA,IAAA;EACA,SAAA,GAAY,MAAM;EANN;AAGd;;;EAQE,UAAA,WAPA;EASA,OAAA;AAAA;AAAA,KAGU,eAAA;EACV,KAAA;IACE,OAAA,GAAU,KAAA,EAAO,gBAAA,KAAqB,OAAO;MAAG,EAAA;MAAa,MAAA;IAAA;EAAA;AAAA;AAAA,iBAIjD,qBAAA,CAAsB,OAAA,GAAS,sBAAA,GAA8B,eAAe"}
|
package/dist/client.d.mts
CHANGED
|
@@ -10,6 +10,12 @@ type ExecuteToolInput = {
|
|
|
10
10
|
app: string;
|
|
11
11
|
tool: string;
|
|
12
12
|
arguments?: Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Resolved credential instance to execute against. When set, the platform executes that exact
|
|
15
|
+
* connection; when omitted it falls back to resolving the app's instance by scope.
|
|
16
|
+
*/
|
|
17
|
+
instanceId?: string; /** Pinned provider toolkit version (e.g. `20260501_01`); forwarded to the provider on execute. */
|
|
18
|
+
version: string;
|
|
13
19
|
};
|
|
14
20
|
type KeystrokeClient = {
|
|
15
21
|
tools: {
|
package/dist/client.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"mappings":";;;KAEY,sBAAA;kDAEV,MAAA,WAFgC;EAIhC,WAAA;EACA,EAAA,GAAK,OAAO;AAAA;AAAA,KAGF,gBAAA;EACV,GAAA;EACA,IAAA;EACA,SAAA,GAAY,MAAM;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"mappings":";;;KAEY,sBAAA;kDAEV,MAAA,WAFgC;EAIhC,WAAA;EACA,EAAA,GAAK,OAAO;AAAA;AAAA,KAGF,gBAAA;EACV,GAAA;EACA,IAAA;EACA,SAAA,GAAY,MAAM;EANN;AAGd;;;EAQE,UAAA,WAPA;EASA,OAAA;AAAA;AAAA,KAGU,eAAA;EACV,KAAA;IACE,OAAA,GAAU,KAAA,EAAO,gBAAA,KAAqB,OAAO;MAAG,EAAA;MAAa,MAAA;IAAA;EAAA;AAAA;AAAA,iBAIjD,qBAAA,CAAsB,OAAA,GAAS,sBAAA,GAA8B,eAAe"}
|
package/dist/client.mjs
CHANGED
|
@@ -11,7 +11,9 @@ function createKeystrokeClient(options = {}) {
|
|
|
11
11
|
return { tools: { execute: (input) => api.post("tools/execute", { json: {
|
|
12
12
|
app: input.app,
|
|
13
13
|
tool: input.tool,
|
|
14
|
-
arguments: input.arguments ?? {}
|
|
14
|
+
arguments: input.arguments ?? {},
|
|
15
|
+
version: input.version,
|
|
16
|
+
...input.instanceId ? { instanceId: input.instanceId } : {}
|
|
15
17
|
} }).json() } };
|
|
16
18
|
}
|
|
17
19
|
//#endregion
|
package/dist/client.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import ky, { type KyInstance, type Options } from \"ky\";\n\nexport type KeystrokeClientOptions = {\n /** Defaults to process.env.KEYSTROKE_API_KEY */\n apiKey?: string;\n /** Defaults to process.env.PUBLIC_PLATFORM_URL or http://localhost:3002 */\n platformUrl?: string;\n ky?: Options;\n};\n\nexport type ExecuteToolInput = {\n app: string;\n tool: string;\n arguments?: Record<string, unknown>;\n};\n\nexport type KeystrokeClient = {\n tools: {\n execute: (input: ExecuteToolInput) => Promise<{ ok: boolean; result: unknown }>;\n };\n};\n\nexport function createKeystrokeClient(options: KeystrokeClientOptions = {}): KeystrokeClient {\n const apiKey = options.apiKey ?? process.env.KEYSTROKE_API_KEY;\n const platformUrl = (\n options.platformUrl ??\n process.env.PUBLIC_PLATFORM_URL ??\n \"http://localhost:3002\"\n ).replace(/\\/+$/, \"\");\n\n const api: KyInstance = ky.create({\n prefix: `${platformUrl}/mcp/`,\n headers: apiKey ? { \"x-api-key\": apiKey } : {},\n ...options.ky,\n });\n\n return {\n tools: {\n execute: (input) =>\n api\n .post(\"tools/execute\", {\n json: {\n app: input.app,\n tool: input.tool,\n arguments: input.arguments ?? {},\n },\n })\n .json<{ ok: boolean; result: unknown }>(),\n },\n };\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import ky, { type KyInstance, type Options } from \"ky\";\n\nexport type KeystrokeClientOptions = {\n /** Defaults to process.env.KEYSTROKE_API_KEY */\n apiKey?: string;\n /** Defaults to process.env.PUBLIC_PLATFORM_URL or http://localhost:3002 */\n platformUrl?: string;\n ky?: Options;\n};\n\nexport type ExecuteToolInput = {\n app: string;\n tool: string;\n arguments?: Record<string, unknown>;\n /**\n * Resolved credential instance to execute against. When set, the platform executes that exact\n * connection; when omitted it falls back to resolving the app's instance by scope.\n */\n instanceId?: string;\n /** Pinned provider toolkit version (e.g. `20260501_01`); forwarded to the provider on execute. */\n version: string;\n};\n\nexport type KeystrokeClient = {\n tools: {\n execute: (input: ExecuteToolInput) => Promise<{ ok: boolean; result: unknown }>;\n };\n};\n\nexport function createKeystrokeClient(options: KeystrokeClientOptions = {}): KeystrokeClient {\n const apiKey = options.apiKey ?? process.env.KEYSTROKE_API_KEY;\n const platformUrl = (\n options.platformUrl ??\n process.env.PUBLIC_PLATFORM_URL ??\n \"http://localhost:3002\"\n ).replace(/\\/+$/, \"\");\n\n const api: KyInstance = ky.create({\n prefix: `${platformUrl}/mcp/`,\n headers: apiKey ? { \"x-api-key\": apiKey } : {},\n ...options.ky,\n });\n\n return {\n tools: {\n execute: (input) =>\n api\n .post(\"tools/execute\", {\n json: {\n app: input.app,\n tool: input.tool,\n arguments: input.arguments ?? {},\n version: input.version,\n ...(input.instanceId ? { instanceId: input.instanceId } : {}),\n },\n })\n .json<{ ok: boolean; result: unknown }>(),\n },\n };\n}\n"],"mappings":";;AA6BA,SAAgB,sBAAsB,UAAkC,CAAC,GAAoB;CAC3F,MAAM,SAAS,QAAQ,UAAU,QAAQ,IAAI;CAC7C,MAAM,eACJ,QAAQ,eACR,QAAQ,IAAI,uBACZ,yBACA,QAAQ,QAAQ,EAAE;CAEpB,MAAM,MAAkB,GAAG,OAAO;EAChC,QAAQ,GAAG,YAAY;EACvB,SAAS,SAAS,EAAE,aAAa,OAAO,IAAI,CAAC;EAC7C,GAAG,QAAQ;CACb,CAAC;CAED,OAAO,EACL,OAAO,EACL,UAAU,UACR,IACG,KAAK,iBAAiB,EACrB,MAAM;EACJ,KAAK,MAAM;EACX,MAAM,MAAM;EACZ,WAAW,MAAM,aAAa,CAAC;EAC/B,SAAS,MAAM;EACf,GAAI,MAAM,aAAa,EAAE,YAAY,MAAM,WAAW,IAAI,CAAC;CAC7D,EACF,CAAC,EACA,KAAuC,EAC9C,EACF;AACF"}
|
package/dist/config.d.cts
CHANGED
package/dist/config.d.mts
CHANGED
package/dist/credentials.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dist = require("./dist
|
|
3
|
-
exports.
|
|
4
|
-
exports.DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = require_dist.DEFAULT_CREDENTIAL_RESOLUTION_CHAIN;
|
|
2
|
+
const require_dist = require("./dist-DEwBt6Ee.cjs");
|
|
3
|
+
exports.CREDENTIAL_SCOPE_TYPES = require_dist.CREDENTIAL_SCOPE_TYPES;
|
|
5
4
|
exports.credential = require_dist.credential;
|
|
6
5
|
exports.credentialInputSchema = require_dist.credentialInputSchema;
|
|
7
6
|
exports.defineCredential = require_dist.defineCredential;
|
package/dist/credentials.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export {
|
|
1
|
+
import { C as isCredentialInput, S as defineCredential, T as toCredentialRequirement, a as CredentialInput, b as credential, d as DefineOAuthCredentialInput, f as DefineStaticCredentialInput, l as CredentialScopeType, n as Credential, o as CredentialList, p as NormalizeCredential, r as CredentialAuthKind, s as CredentialRequirement, t as CREDENTIAL_SCOPE_TYPES, u as DefineCredentialInput, v as ResolvedCredentials, w as normalizeCredentialList, x as credentialInputSchema } from "./index-hf0OTB6M.cjs";
|
|
2
|
+
export { CREDENTIAL_SCOPE_TYPES, type Credential, type CredentialAuthKind, type CredentialInput, type CredentialList, type CredentialRequirement, type CredentialScopeType, type DefineCredentialInput, type DefineOAuthCredentialInput, type DefineStaticCredentialInput, type NormalizeCredential, type ResolvedCredentials, credential, credentialInputSchema, defineCredential, isCredentialInput, normalizeCredentialList, toCredentialRequirement };
|
package/dist/credentials.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export {
|
|
1
|
+
import { C as isCredentialInput, S as defineCredential, T as toCredentialRequirement, a as CredentialInput, b as credential, d as DefineOAuthCredentialInput, f as DefineStaticCredentialInput, l as CredentialScopeType, n as Credential, o as CredentialList, p as NormalizeCredential, r as CredentialAuthKind, s as CredentialRequirement, t as CREDENTIAL_SCOPE_TYPES, u as DefineCredentialInput, v as ResolvedCredentials, w as normalizeCredentialList, x as credentialInputSchema } from "./index-hf0OTB6M.mjs";
|
|
2
|
+
export { CREDENTIAL_SCOPE_TYPES, type Credential, type CredentialAuthKind, type CredentialInput, type CredentialList, type CredentialRequirement, type CredentialScopeType, type DefineCredentialInput, type DefineOAuthCredentialInput, type DefineStaticCredentialInput, type NormalizeCredential, type ResolvedCredentials, credential, credentialInputSchema, defineCredential, isCredentialInput, normalizeCredentialList, toCredentialRequirement };
|
package/dist/credentials.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { C as toCredentialRequirement, S as normalizeCredentialList, _ as credential, b as isCredentialInput, g as CREDENTIAL_SCOPE_TYPES, v as credentialInputSchema, y as defineCredential } from "./dist-CFy63Npi.mjs";
|
|
2
|
+
export { CREDENTIAL_SCOPE_TYPES, credential, credentialInputSchema, defineCredential, isCredentialInput, normalizeCredentialList, toCredentialRequirement };
|