@voltro/plugin-ai-flows 0.1.0
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/CHANGELOG.md +52 -0
- package/LICENSE +57 -0
- package/README.md +26 -0
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +5178 -0
- package/dist/cadence-Bt6dPelT.js +40 -0
- package/dist/errors.d.ts +88 -0
- package/dist/errors.js +29 -0
- package/dist/index.d.ts +880 -0
- package/dist/index.js +965 -0
- package/dist/ir.d.ts +279 -0
- package/dist/ir.js +102 -0
- package/dist/rpc.d.ts +7 -0
- package/dist/rpc.js +4 -0
- package/dist/web.d.ts +176 -0
- package/dist/web.js +2 -0
- package/dist/workflow.d.ts +40 -0
- package/dist/workflow.js +23 -0
- package/package.json +76 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/cadence.ts
|
|
2
|
+
var e = (e) => (e.getDay() + 6) % 7, t = (e) => Math.ceil(e.getDate() / 7), n = (e) => {
|
|
3
|
+
let t = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
4
|
+
return e.getDate() + 7 > t;
|
|
5
|
+
}, r = (t) => {
|
|
6
|
+
let n = new Date(t.getFullYear(), t.getMonth(), t.getDate());
|
|
7
|
+
return n.setDate(n.getDate() - e(t)), n.setHours(0, 0, 0, 0), n;
|
|
8
|
+
}, i = (e, t) => {
|
|
9
|
+
let n = r(t).getTime() - r(e).getTime();
|
|
10
|
+
return Math.round(n / (10080 * 60 * 1e3));
|
|
11
|
+
}, a = (r, a) => {
|
|
12
|
+
let o = r.repeats ?? [];
|
|
13
|
+
if (o.length === 0) return !1;
|
|
14
|
+
let s = r.hour ?? 9, c = r.minute ?? 0;
|
|
15
|
+
if (a.getHours() !== s || a.getMinutes() !== c) return !1;
|
|
16
|
+
let l = e(a);
|
|
17
|
+
if (!o.includes(l)) return !1;
|
|
18
|
+
if ((r.frequency ?? "weekly") === "monthly") {
|
|
19
|
+
let e = r.weekOfMonth;
|
|
20
|
+
return e === void 0 ? !0 : e === "last" ? n(a) : t(a) === e;
|
|
21
|
+
}
|
|
22
|
+
let u = r.intervalWeeks ?? 1;
|
|
23
|
+
if (u <= 1 || !r.anchorDate) return !0;
|
|
24
|
+
let d = /* @__PURE__ */ new Date(`${r.anchorDate}T00:00:00`);
|
|
25
|
+
if (Number.isNaN(d.getTime())) return !0;
|
|
26
|
+
let f = i(d, a);
|
|
27
|
+
return f >= 0 && f % u === 0;
|
|
28
|
+
}, o = (e, t, n = 3) => {
|
|
29
|
+
let r = [];
|
|
30
|
+
if ((e.repeats ?? []).length === 0) return r;
|
|
31
|
+
let i = new Date(t);
|
|
32
|
+
i.setSeconds(0, 0);
|
|
33
|
+
let o = i.getMinutes() % 15;
|
|
34
|
+
(o !== 0 || i.getTime() < t.getTime()) && i.setMinutes(i.getMinutes() + (15 - o));
|
|
35
|
+
let s = t.getTime() + 400 * 24 * 60 * 60 * 1e3;
|
|
36
|
+
for (; r.length < n && i.getTime() <= s;) a(e, i) && r.push(new Date(i)), i.setMinutes(i.getMinutes() + 15);
|
|
37
|
+
return r;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { o as n, a as t };
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
/** A required brief field was blank at launch. */
|
|
4
|
+
export declare class FlowBriefIncomplete extends FlowBriefIncomplete_base {
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare const FlowBriefIncomplete_base: Schema.TaggedErrorClass<FlowBriefIncomplete, "FlowBriefIncomplete", {
|
|
8
|
+
readonly _tag: Schema.tag<"FlowBriefIncomplete">;
|
|
9
|
+
} & {
|
|
10
|
+
missing: Schema.Array$<typeof Schema.String>;
|
|
11
|
+
message: typeof Schema.String;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
/** A generation step required a capability the host did not provide (e.g. a
|
|
15
|
+
* media modality with no configured generator, or storage for the artifact). */
|
|
16
|
+
export declare class FlowCapabilityMissing extends FlowCapabilityMissing_base {
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const FlowCapabilityMissing_base: Schema.TaggedErrorClass<FlowCapabilityMissing, "FlowCapabilityMissing", {
|
|
20
|
+
readonly _tag: Schema.tag<"FlowCapabilityMissing">;
|
|
21
|
+
} & {
|
|
22
|
+
capability: typeof Schema.String;
|
|
23
|
+
message: typeof Schema.String;
|
|
24
|
+
}>;
|
|
25
|
+
|
|
26
|
+
/** A step's input still contains an unresolved `{{ref}}` (its producing step
|
|
27
|
+
* failed / was skipped). The engine aborts rather than generate on placeholder
|
|
28
|
+
* data — the agentic dependency guard. */
|
|
29
|
+
export declare class FlowDependencyError extends FlowDependencyError_base {
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare const FlowDependencyError_base: Schema.TaggedErrorClass<FlowDependencyError, "FlowDependencyError", {
|
|
33
|
+
readonly _tag: Schema.tag<"FlowDependencyError">;
|
|
34
|
+
} & {
|
|
35
|
+
stepId: typeof Schema.String;
|
|
36
|
+
unresolvedRef: typeof Schema.String;
|
|
37
|
+
message: typeof Schema.String;
|
|
38
|
+
}>;
|
|
39
|
+
|
|
40
|
+
/** A run cannot accept a human response in its current state (not `waiting`,
|
|
41
|
+
* already answered, or cancelled). */
|
|
42
|
+
export declare class FlowNotAwaitingResponse extends FlowNotAwaitingResponse_base {
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare const FlowNotAwaitingResponse_base: Schema.TaggedErrorClass<FlowNotAwaitingResponse, "FlowNotAwaitingResponse", {
|
|
46
|
+
readonly _tag: Schema.tag<"FlowNotAwaitingResponse">;
|
|
47
|
+
} & {
|
|
48
|
+
runId: typeof Schema.String;
|
|
49
|
+
status: typeof Schema.String;
|
|
50
|
+
message: typeof Schema.String;
|
|
51
|
+
}>;
|
|
52
|
+
|
|
53
|
+
/** A flow (definition) could not be resolved by ref (code name or row id). */
|
|
54
|
+
export declare class FlowNotFound extends FlowNotFound_base {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare const FlowNotFound_base: Schema.TaggedErrorClass<FlowNotFound, "FlowNotFound", {
|
|
58
|
+
readonly _tag: Schema.tag<"FlowNotFound">;
|
|
59
|
+
} & {
|
|
60
|
+
flowRef: typeof Schema.String;
|
|
61
|
+
message: typeof Schema.String;
|
|
62
|
+
}>;
|
|
63
|
+
|
|
64
|
+
/** A flow run row could not be found. */
|
|
65
|
+
export declare class FlowRunNotFound extends FlowRunNotFound_base {
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare const FlowRunNotFound_base: Schema.TaggedErrorClass<FlowRunNotFound, "FlowRunNotFound", {
|
|
69
|
+
readonly _tag: Schema.tag<"FlowRunNotFound">;
|
|
70
|
+
} & {
|
|
71
|
+
runId: typeof Schema.String;
|
|
72
|
+
message: typeof Schema.String;
|
|
73
|
+
}>;
|
|
74
|
+
|
|
75
|
+
/** The flow definition is invalid (bad step graph, unknown agent, cycle, …). */
|
|
76
|
+
export declare class FlowValidationError extends FlowValidationError_base {
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare const FlowValidationError_base: Schema.TaggedErrorClass<FlowValidationError, "FlowValidationError", {
|
|
80
|
+
readonly _tag: Schema.tag<"FlowValidationError">;
|
|
81
|
+
} & {
|
|
82
|
+
flowRef: typeof Schema.String;
|
|
83
|
+
message: typeof Schema.String;
|
|
84
|
+
/** Optional per-issue detail for the editor. */
|
|
85
|
+
issues: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
86
|
+
}>;
|
|
87
|
+
|
|
88
|
+
export { }
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Schema as e } from "effect";
|
|
2
|
+
//#region src/errors.ts
|
|
3
|
+
var t = class extends e.TaggedError()("FlowNotFound", {
|
|
4
|
+
flowRef: e.String,
|
|
5
|
+
message: e.String
|
|
6
|
+
}) {}, n = class extends e.TaggedError()("FlowRunNotFound", {
|
|
7
|
+
runId: e.String,
|
|
8
|
+
message: e.String
|
|
9
|
+
}) {}, r = class extends e.TaggedError()("FlowValidationError", {
|
|
10
|
+
flowRef: e.String,
|
|
11
|
+
message: e.String,
|
|
12
|
+
issues: e.optional(e.Array(e.String))
|
|
13
|
+
}) {}, i = class extends e.TaggedError()("FlowDependencyError", {
|
|
14
|
+
stepId: e.String,
|
|
15
|
+
unresolvedRef: e.String,
|
|
16
|
+
message: e.String
|
|
17
|
+
}) {}, a = class extends e.TaggedError()("FlowBriefIncomplete", {
|
|
18
|
+
missing: e.Array(e.String),
|
|
19
|
+
message: e.String
|
|
20
|
+
}) {}, o = class extends e.TaggedError()("FlowNotAwaitingResponse", {
|
|
21
|
+
runId: e.String,
|
|
22
|
+
status: e.String,
|
|
23
|
+
message: e.String
|
|
24
|
+
}) {}, s = class extends e.TaggedError()("FlowCapabilityMissing", {
|
|
25
|
+
capability: e.String,
|
|
26
|
+
message: e.String
|
|
27
|
+
}) {};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { a as FlowBriefIncomplete, s as FlowCapabilityMissing, i as FlowDependencyError, o as FlowNotAwaitingResponse, t as FlowNotFound, n as FlowRunNotFound, r as FlowValidationError };
|