@keystrokehq/keystroke 0.1.36 → 0.1.38
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.cjs +263 -11
- package/dist/agent.cjs.map +1 -1
- package/dist/agent.mjs +263 -11
- package/dist/agent.mjs.map +1 -1
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/{dist-iDcp4e6O.mjs → dist-CB_SkwlE.mjs} +174 -3
- package/dist/dist-CB_SkwlE.mjs.map +1 -0
- package/dist/{dist-Di6PqKAu.cjs → dist-CC_AajRT.cjs} +191 -2
- package/dist/dist-CC_AajRT.cjs.map +1 -0
- package/dist/index-BTC8Uomf.d.mts.map +1 -1
- package/dist/index-B_Qa2Gk4.d.cts.map +1 -1
- package/dist/{token-DUN0yjzi.mjs → token-1esrncEC.mjs} +2 -2
- package/dist/{token-DUN0yjzi.mjs.map → token-1esrncEC.mjs.map} +1 -1
- package/dist/{token-CQiw-m2-.cjs → token-DdJ0sKKo.cjs} +2 -2
- package/dist/{token-CQiw-m2-.cjs.map → token-DdJ0sKKo.cjs.map} +1 -1
- package/dist/trigger.cjs +5 -1
- package/dist/trigger.cjs.map +1 -1
- package/dist/trigger.d.cts +16 -9
- package/dist/trigger.d.cts.map +1 -1
- package/dist/trigger.d.mts +16 -9
- package/dist/trigger.d.mts.map +1 -1
- package/dist/trigger.mjs +5 -1
- package/dist/trigger.mjs.map +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.mjs +1 -1
- package/package.json +1 -1
- package/dist/dist-Di6PqKAu.cjs.map +0 -1
- package/dist/dist-iDcp4e6O.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __commonJSMin } from "./chunk-DnnnRqeS.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { B as require_token_util, V as require_token_error } from "./dist-CB_SkwlE.mjs";
|
|
3
3
|
//#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
4
4
|
var require_token = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -54,4 +54,4 @@ var require_token = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
54
54
|
export default require_token();
|
|
55
55
|
export {};
|
|
56
56
|
|
|
57
|
-
//# sourceMappingURL=token-
|
|
57
|
+
//# sourceMappingURL=token-1esrncEC.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-
|
|
1
|
+
{"version":3,"file":"token-1esrncEC.mjs","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken(options) {\n let projectId = options?.project;\n let teamId = options?.team;\n if (!projectId && !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectInfo.projectId;\n teamId = projectInfo.teamId;\n } else if (!projectId || !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectId ?? projectInfo.projectId;\n teamId = teamId ?? projectInfo.teamId;\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`\"\n );\n }\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {\n const authToken = await (0, import_token_util.getVercelToken)({\n expirationBufferMs: options?.expirationBufferMs\n });\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,YAAY,QAAQ,QAAQ;EAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;EAAK,CAAC;CAChE;CACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;EAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS;QACjD,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;IAAE,WAAW,KAAK;IAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;GAAW,CAAC;EAAA;EAEvH,OAAO;CACT;CACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;CACzF,IAAI,gBAAgB,CAAC;CACrB,SAAS,eAAe,EACtB,oBAAoB,aACtB,CAAC;CACD,OAAO,UAAU,aAAa,aAAa;CAC3C,IAAI,qBAAA,oBAAA;CACJ,IAAI,oBAAA,mBAAA;CACJ,eAAe,aAAa,SAAS;EACnC,IAAI,YAAY,SAAS;EACzB,IAAI,SAAS,SAAS;EACtB,IAAI,CAAC,aAAa,CAAC,QAAQ;GACzB,MAAM,eAAe,GAAG,kBAAkB,iBAAiB;GAC3D,YAAY,YAAY;GACxB,SAAS,YAAY;EACvB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ;GAChC,MAAM,eAAe,GAAG,kBAAkB,iBAAiB;GAC3D,YAAY,aAAa,YAAY;GACrC,SAAS,UAAU,YAAY;EACjC;EACA,IAAI,CAAC,WACH,MAAM,IAAI,mBAAmB,qBAC3B,gGACF;EAEF,IAAI,cAAc,GAAG,kBAAkB,WAAW,SAAS;EAC3D,IAAI,CAAC,eAAe,GAAG,kBAAkB,YAAY,GAAG,kBAAkB,iBAAiB,WAAW,KAAK,GAAG,SAAS,kBAAkB,GAAG;GAC1I,MAAM,YAAY,OAAO,GAAG,kBAAkB,gBAAgB,EAC5D,oBAAoB,SAAS,mBAC/B,CAAC;GACD,aAAa,OAAO,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,MAAM;GACzF,IAAI,CAAC,YACH,MAAM,IAAI,mBAAmB,qBAAqB,8BAA8B;GAElF,CAAC,GAAG,kBAAkB,WAAW,YAAY,SAAS;EACxD;EACA,QAAQ,IAAI,oBAAoB,WAAW;CAE7C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-emK7D4bc.cjs");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-CC_AajRT.cjs");
|
|
3
3
|
//#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
4
4
|
var require_token = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -58,4 +58,4 @@ Object.defineProperty(exports, "default", {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
//# sourceMappingURL=token-
|
|
61
|
+
//# sourceMappingURL=token-DdJ0sKKo.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-
|
|
1
|
+
{"version":3,"file":"token-DdJ0sKKo.cjs","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken(options) {\n let projectId = options?.project;\n let teamId = options?.team;\n if (!projectId && !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectInfo.projectId;\n teamId = projectInfo.teamId;\n } else if (!projectId || !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectId ?? projectInfo.projectId;\n teamId = teamId ?? projectInfo.teamId;\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`\"\n );\n }\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {\n const authToken = await (0, import_token_util.getVercelToken)({\n expirationBufferMs: options?.expirationBufferMs\n });\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,YAAY,QAAQ,QAAQ;EAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;EAAK,CAAC;CAChE;CACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;EAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS;QACjD,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;IAAE,WAAW,KAAK;IAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;GAAW,CAAC;EAAA;EAEvH,OAAO;CACT;CACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;CACzF,IAAI,gBAAgB,CAAC;CACrB,SAAS,eAAe,EACtB,oBAAoB,aACtB,CAAC;CACD,OAAO,UAAU,aAAa,aAAa;CAC3C,IAAI,qBAAA,aAAA,oBAAA;CACJ,IAAI,oBAAA,aAAA,mBAAA;CACJ,eAAe,aAAa,SAAS;EACnC,IAAI,YAAY,SAAS;EACzB,IAAI,SAAS,SAAS;EACtB,IAAI,CAAC,aAAa,CAAC,QAAQ;GACzB,MAAM,eAAe,GAAG,kBAAkB,iBAAiB;GAC3D,YAAY,YAAY;GACxB,SAAS,YAAY;EACvB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ;GAChC,MAAM,eAAe,GAAG,kBAAkB,iBAAiB;GAC3D,YAAY,aAAa,YAAY;GACrC,SAAS,UAAU,YAAY;EACjC;EACA,IAAI,CAAC,WACH,MAAM,IAAI,mBAAmB,qBAC3B,gGACF;EAEF,IAAI,cAAc,GAAG,kBAAkB,WAAW,SAAS;EAC3D,IAAI,CAAC,eAAe,GAAG,kBAAkB,YAAY,GAAG,kBAAkB,iBAAiB,WAAW,KAAK,GAAG,SAAS,kBAAkB,GAAG;GAC1I,MAAM,YAAY,OAAO,GAAG,kBAAkB,gBAAgB,EAC5D,oBAAoB,SAAS,mBAC/B,CAAC;GACD,aAAa,OAAO,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,MAAM;GACzF,IAAI,CAAC,YACH,MAAM,IAAI,mBAAmB,qBAAqB,8BAA8B;GAElF,CAAC,GAAG,kBAAkB,WAAW,YAAY,SAAS;EACxD;EACA,QAAQ,IAAI,oBAAoB,WAAW;CAE7C"}
|
package/dist/trigger.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-emK7D4bc.cjs");
|
|
3
|
-
const require_dist$1 = require("./dist-
|
|
3
|
+
const require_dist$1 = require("./dist-CC_AajRT.cjs");
|
|
4
4
|
let zod = require("zod");
|
|
5
5
|
//#region ../../node_modules/.pnpm/cron-parser@5.5.0/node_modules/cron-parser/dist/fields/types.js
|
|
6
6
|
var require_types = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
|
|
@@ -8571,6 +8571,7 @@ const pollSourceSchema = zod.z.object({
|
|
|
8571
8571
|
id: zod.z.string().optional(),
|
|
8572
8572
|
schedule: cronScheduleSchema,
|
|
8573
8573
|
run: zod.z.function(),
|
|
8574
|
+
stateSchema: zodSchema.optional(),
|
|
8574
8575
|
filters: zod.z.array(zod.z.function()),
|
|
8575
8576
|
passes: zod.z.function()
|
|
8576
8577
|
});
|
|
@@ -8881,6 +8882,7 @@ function defineCronSource(options) {
|
|
|
8881
8882
|
* @param options.key - **Deprecated.** Accepted for backwards-compatible definitions.
|
|
8882
8883
|
* @param options.id - Optional group id; poll sources sharing an id poll together.
|
|
8883
8884
|
* @param options.schedule - Cron expression for the poll cadence (see `defineCronSource`).
|
|
8885
|
+
* @param options.state - Optional Zod schema for cursor state persisted between poll ticks.
|
|
8884
8886
|
* @param options.run - Produces the payload checked by `filter` and passed to the workflow.
|
|
8885
8887
|
* @param options.filter - Source-level predicate; the workflow only fires when it returns true.
|
|
8886
8888
|
* @example
|
|
@@ -8893,6 +8895,7 @@ function definePollSource(options) {
|
|
|
8893
8895
|
const schedule = parseCronSchedule(options.schedule);
|
|
8894
8896
|
const name = requireTriggerDisplayText(options.name, "name", "definePollSource");
|
|
8895
8897
|
const description = requireTriggerDisplayText(options.description, "description", "definePollSource");
|
|
8898
|
+
if (options.state && options.id) throw new Error("definePollSource: `state` and `id` (poll grouping) cannot be used together");
|
|
8896
8899
|
const filters = [];
|
|
8897
8900
|
if (options.filter) filters.push(options.filter);
|
|
8898
8901
|
const source = {
|
|
@@ -8903,6 +8906,7 @@ function definePollSource(options) {
|
|
|
8903
8906
|
id: options.id,
|
|
8904
8907
|
schedule,
|
|
8905
8908
|
run: options.run,
|
|
8909
|
+
stateSchema: options.state,
|
|
8906
8910
|
filters,
|
|
8907
8911
|
passes(payload) {
|
|
8908
8912
|
return source.filters.every((candidate) => candidate(payload));
|