@relayflows/surface 2.0.9 → 2.0.11
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/README.md +3 -2
- package/dist/completion.d.ts +2 -0
- package/dist/completion.d.ts.map +1 -1
- package/dist/context.d.ts +27 -6
- package/dist/context.d.ts.map +1 -1
- package/dist/effect-transport.d.ts +22 -0
- package/dist/effect-transport.d.ts.map +1 -0
- package/dist/effect-transport.js +42 -0
- package/dist/effect-transport.js.map +1 -0
- package/dist/flow.d.ts +30 -17
- package/dist/flow.d.ts.map +1 -1
- package/dist/flow.js +58 -73
- package/dist/flow.js.map +1 -1
- package/dist/helper-clients.d.ts +86 -0
- package/dist/helper-clients.d.ts.map +1 -0
- package/dist/helper-clients.js +30 -0
- package/dist/helper-clients.js.map +1 -0
- package/dist/helpers/airtable.d.ts +4 -0
- package/dist/helpers/airtable.d.ts.map +1 -0
- package/dist/helpers/airtable.js +5 -0
- package/dist/helpers/airtable.js.map +1 -0
- package/dist/helpers/asana.d.ts +5 -0
- package/dist/helpers/asana.d.ts.map +1 -0
- package/dist/helpers/asana.js +6 -0
- package/dist/helpers/asana.js.map +1 -0
- package/dist/helpers/azure-blob.d.ts +5 -0
- package/dist/helpers/azure-blob.d.ts.map +1 -0
- package/dist/helpers/azure-blob.js +6 -0
- package/dist/helpers/azure-blob.js.map +1 -0
- package/dist/helpers/box.d.ts +5 -0
- package/dist/helpers/box.d.ts.map +1 -0
- package/dist/helpers/box.js +6 -0
- package/dist/helpers/box.js.map +1 -0
- package/dist/helpers/calendly.d.ts +5 -0
- package/dist/helpers/calendly.d.ts.map +1 -0
- package/dist/helpers/calendly.js +6 -0
- package/dist/helpers/calendly.js.map +1 -0
- package/dist/helpers/clickup.d.ts +5 -0
- package/dist/helpers/clickup.d.ts.map +1 -0
- package/dist/helpers/clickup.js +6 -0
- package/dist/helpers/clickup.js.map +1 -0
- package/dist/helpers/clients.d.ts +3 -0
- package/dist/helpers/clients.d.ts.map +1 -0
- package/dist/helpers/clients.js +46 -0
- package/dist/helpers/clients.js.map +1 -0
- package/dist/helpers/cloudflare.d.ts +5 -0
- package/dist/helpers/cloudflare.d.ts.map +1 -0
- package/dist/helpers/cloudflare.js +6 -0
- package/dist/helpers/cloudflare.js.map +1 -0
- package/dist/helpers/confluence.d.ts +5 -0
- package/dist/helpers/confluence.d.ts.map +1 -0
- package/dist/helpers/confluence.js +6 -0
- package/dist/helpers/confluence.js.map +1 -0
- package/dist/helpers/daytona.d.ts +5 -0
- package/dist/helpers/daytona.d.ts.map +1 -0
- package/dist/helpers/daytona.js +6 -0
- package/dist/helpers/daytona.js.map +1 -0
- package/dist/helpers/docker-hub.d.ts +4 -0
- package/dist/helpers/docker-hub.d.ts.map +1 -0
- package/dist/helpers/docker-hub.js +5 -0
- package/dist/helpers/docker-hub.js.map +1 -0
- package/dist/helpers/dropbox.d.ts +5 -0
- package/dist/helpers/dropbox.d.ts.map +1 -0
- package/dist/helpers/dropbox.js +6 -0
- package/dist/helpers/dropbox.js.map +1 -0
- package/dist/helpers/fathom.d.ts +4 -0
- package/dist/helpers/fathom.d.ts.map +1 -0
- package/dist/helpers/fathom.js +5 -0
- package/dist/helpers/fathom.js.map +1 -0
- package/dist/helpers/gcp.d.ts +4 -0
- package/dist/helpers/gcp.d.ts.map +1 -0
- package/dist/helpers/gcp.js +5 -0
- package/dist/helpers/gcp.js.map +1 -0
- package/dist/helpers/gcs.d.ts +5 -0
- package/dist/helpers/gcs.d.ts.map +1 -0
- package/dist/helpers/gcs.js +6 -0
- package/dist/helpers/gcs.js.map +1 -0
- package/dist/helpers/github.d.ts +5 -0
- package/dist/helpers/github.d.ts.map +1 -0
- package/dist/helpers/github.js +6 -0
- package/dist/helpers/github.js.map +1 -0
- package/dist/helpers/gitlab.d.ts +5 -0
- package/dist/helpers/gitlab.d.ts.map +1 -0
- package/dist/helpers/gitlab.js +6 -0
- package/dist/helpers/gitlab.js.map +1 -0
- package/dist/helpers/gmail.d.ts +5 -0
- package/dist/helpers/gmail.d.ts.map +1 -0
- package/dist/helpers/gmail.js +6 -0
- package/dist/helpers/gmail.js.map +1 -0
- package/dist/helpers/google-calendar.d.ts +5 -0
- package/dist/helpers/google-calendar.d.ts.map +1 -0
- package/dist/helpers/google-calendar.js +6 -0
- package/dist/helpers/google-calendar.js.map +1 -0
- package/dist/helpers/google-drive.d.ts +5 -0
- package/dist/helpers/google-drive.d.ts.map +1 -0
- package/dist/helpers/google-drive.js +6 -0
- package/dist/helpers/google-drive.js.map +1 -0
- package/dist/helpers/granola.d.ts +5 -0
- package/dist/helpers/granola.d.ts.map +1 -0
- package/dist/helpers/granola.js +6 -0
- package/dist/helpers/granola.js.map +1 -0
- package/dist/helpers/hubspot.d.ts +5 -0
- package/dist/helpers/hubspot.d.ts.map +1 -0
- package/dist/helpers/hubspot.js +6 -0
- package/dist/helpers/hubspot.js.map +1 -0
- package/dist/helpers/index.d.ts +155 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +105 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/intercom.d.ts +5 -0
- package/dist/helpers/intercom.d.ts.map +1 -0
- package/dist/helpers/intercom.js +6 -0
- package/dist/helpers/intercom.js.map +1 -0
- package/dist/helpers/jira.d.ts +5 -0
- package/dist/helpers/jira.d.ts.map +1 -0
- package/dist/helpers/jira.js +6 -0
- package/dist/helpers/jira.js.map +1 -0
- package/dist/helpers/linear.d.ts +5 -0
- package/dist/helpers/linear.d.ts.map +1 -0
- package/dist/helpers/linear.js +6 -0
- package/dist/helpers/linear.js.map +1 -0
- package/dist/helpers/mailgun.d.ts +5 -0
- package/dist/helpers/mailgun.d.ts.map +1 -0
- package/dist/helpers/mailgun.js +6 -0
- package/dist/helpers/mailgun.js.map +1 -0
- package/dist/helpers/mixpanel.d.ts +5 -0
- package/dist/helpers/mixpanel.d.ts.map +1 -0
- package/dist/helpers/mixpanel.js +6 -0
- package/dist/helpers/mixpanel.js.map +1 -0
- package/dist/helpers/neon.d.ts +4 -0
- package/dist/helpers/neon.d.ts.map +1 -0
- package/dist/helpers/neon.js +5 -0
- package/dist/helpers/neon.js.map +1 -0
- package/dist/helpers/notion.d.ts +5 -0
- package/dist/helpers/notion.d.ts.map +1 -0
- package/dist/helpers/notion.js +6 -0
- package/dist/helpers/notion.js.map +1 -0
- package/dist/helpers/onedrive.d.ts +5 -0
- package/dist/helpers/onedrive.d.ts.map +1 -0
- package/dist/helpers/onedrive.js +6 -0
- package/dist/helpers/onedrive.js.map +1 -0
- package/dist/helpers/pipedrive.d.ts +5 -0
- package/dist/helpers/pipedrive.d.ts.map +1 -0
- package/dist/helpers/pipedrive.js +6 -0
- package/dist/helpers/pipedrive.js.map +1 -0
- package/dist/helpers/postgres.d.ts +5 -0
- package/dist/helpers/postgres.d.ts.map +1 -0
- package/dist/helpers/postgres.js +6 -0
- package/dist/helpers/postgres.js.map +1 -0
- package/dist/helpers/posthog.d.ts +4 -0
- package/dist/helpers/posthog.d.ts.map +1 -0
- package/dist/helpers/posthog.js +5 -0
- package/dist/helpers/posthog.js.map +1 -0
- package/dist/helpers/providers.d.ts +252 -0
- package/dist/helpers/providers.d.ts.map +1 -0
- package/dist/helpers/providers.js +305 -0
- package/dist/helpers/providers.js.map +1 -0
- package/dist/helpers/ramp.d.ts +7 -0
- package/dist/helpers/ramp.d.ts.map +1 -0
- package/dist/helpers/ramp.js +7 -0
- package/dist/helpers/ramp.js.map +1 -0
- package/dist/helpers/recall.d.ts +5 -0
- package/dist/helpers/recall.d.ts.map +1 -0
- package/dist/helpers/recall.js +6 -0
- package/dist/helpers/recall.js.map +1 -0
- package/dist/helpers/reddit.d.ts +5 -0
- package/dist/helpers/reddit.d.ts.map +1 -0
- package/dist/helpers/reddit.js +6 -0
- package/dist/helpers/reddit.js.map +1 -0
- package/dist/helpers/redis.d.ts +5 -0
- package/dist/helpers/redis.d.ts.map +1 -0
- package/dist/helpers/redis.js +6 -0
- package/dist/helpers/redis.js.map +1 -0
- package/dist/helpers/s3.d.ts +5 -0
- package/dist/helpers/s3.d.ts.map +1 -0
- package/dist/helpers/s3.js +6 -0
- package/dist/helpers/s3.js.map +1 -0
- package/dist/helpers/salesforce.d.ts +5 -0
- package/dist/helpers/salesforce.d.ts.map +1 -0
- package/dist/helpers/salesforce.js +6 -0
- package/dist/helpers/salesforce.js.map +1 -0
- package/dist/helpers/segment.d.ts +4 -0
- package/dist/helpers/segment.d.ts.map +1 -0
- package/dist/helpers/segment.js +5 -0
- package/dist/helpers/segment.js.map +1 -0
- package/dist/helpers/sendgrid.d.ts +5 -0
- package/dist/helpers/sendgrid.d.ts.map +1 -0
- package/dist/helpers/sendgrid.js +6 -0
- package/dist/helpers/sendgrid.js.map +1 -0
- package/dist/helpers/sharepoint.d.ts +5 -0
- package/dist/helpers/sharepoint.d.ts.map +1 -0
- package/dist/helpers/sharepoint.js +6 -0
- package/dist/helpers/sharepoint.js.map +1 -0
- package/dist/helpers/shopify.d.ts +4 -0
- package/dist/helpers/shopify.d.ts.map +1 -0
- package/dist/helpers/shopify.js +5 -0
- package/dist/helpers/shopify.js.map +1 -0
- package/dist/helpers/shortcut.d.ts +5 -0
- package/dist/helpers/shortcut.d.ts.map +1 -0
- package/dist/helpers/shortcut.js +6 -0
- package/dist/helpers/shortcut.js.map +1 -0
- package/dist/helpers/slack.d.ts +17 -0
- package/dist/helpers/slack.d.ts.map +1 -0
- package/dist/helpers/slack.js +4 -0
- package/dist/helpers/slack.js.map +1 -0
- package/dist/helpers/stripe.d.ts +5 -0
- package/dist/helpers/stripe.d.ts.map +1 -0
- package/dist/helpers/stripe.js +6 -0
- package/dist/helpers/stripe.js.map +1 -0
- package/dist/helpers/teams.d.ts +5 -0
- package/dist/helpers/teams.d.ts.map +1 -0
- package/dist/helpers/teams.js +6 -0
- package/dist/helpers/teams.js.map +1 -0
- package/dist/helpers/telegram.d.ts +5 -0
- package/dist/helpers/telegram.d.ts.map +1 -0
- package/dist/helpers/telegram.js +6 -0
- package/dist/helpers/telegram.js.map +1 -0
- package/dist/helpers/webhook-server.d.ts +4 -0
- package/dist/helpers/webhook-server.d.ts.map +1 -0
- package/dist/helpers/webhook-server.js +5 -0
- package/dist/helpers/webhook-server.js.map +1 -0
- package/dist/helpers/x.d.ts +4 -0
- package/dist/helpers/x.d.ts.map +1 -0
- package/dist/helpers/x.js +5 -0
- package/dist/helpers/x.js.map +1 -0
- package/dist/helpers/zendesk.d.ts +5 -0
- package/dist/helpers/zendesk.d.ts.map +1 -0
- package/dist/helpers/zendesk.js +6 -0
- package/dist/helpers/zendesk.js.map +1 -0
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/memory.d.ts +19 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +2 -0
- package/dist/memory.js.map +1 -0
- package/dist/plugin-contract.d.ts +5 -0
- package/dist/plugin-contract.d.ts.map +1 -0
- package/dist/plugin-contract.js +2 -0
- package/dist/plugin-contract.js.map +1 -0
- package/dist/provider-trigger.d.ts +13 -0
- package/dist/provider-trigger.d.ts.map +1 -0
- package/dist/provider-trigger.js +18 -0
- package/dist/provider-trigger.js.map +1 -0
- package/dist/runtime.d.ts +6 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +5 -0
- package/dist/runtime.js.map +1 -1
- package/dist/slack.d.ts +34 -0
- package/dist/slack.d.ts.map +1 -0
- package/dist/slack.js +17 -0
- package/dist/slack.js.map +1 -0
- package/dist/step.d.ts +43 -1
- package/dist/step.d.ts.map +1 -1
- package/dist/triggers/github.d.ts +8 -0
- package/dist/triggers/github.d.ts.map +1 -0
- package/dist/triggers/github.js +17 -0
- package/dist/triggers/github.js.map +1 -0
- package/dist/triggers/index.d.ts +8 -0
- package/dist/triggers/index.d.ts.map +1 -0
- package/dist/triggers/index.js +9 -0
- package/dist/triggers/index.js.map +1 -0
- package/dist/triggers/slack.d.ts +8 -0
- package/dist/triggers/slack.d.ts.map +1 -0
- package/dist/triggers/slack.js +17 -0
- package/dist/triggers/slack.js.map +1 -0
- package/dist/triggers.d.ts +15 -0
- package/dist/triggers.d.ts.map +1 -0
- package/dist/triggers.js +43 -0
- package/dist/triggers.js.map +1 -0
- package/package.json +21 -2
- package/src/completion.ts +3 -0
- package/src/context.ts +26 -6
- package/src/effect-transport.ts +59 -0
- package/src/flow.ts +77 -106
- package/src/helper-clients.ts +30 -0
- package/src/helpers/README.md +42 -0
- package/src/helpers/airtable.ts +9 -0
- package/src/helpers/asana.ts +10 -0
- package/src/helpers/azure-blob.ts +10 -0
- package/src/helpers/box.ts +10 -0
- package/src/helpers/calendly.ts +10 -0
- package/src/helpers/clickup.ts +10 -0
- package/src/helpers/clients.ts +48 -0
- package/src/helpers/cloudflare.ts +10 -0
- package/src/helpers/confluence.ts +10 -0
- package/src/helpers/daytona.ts +10 -0
- package/src/helpers/docker-hub.ts +9 -0
- package/src/helpers/dropbox.ts +10 -0
- package/src/helpers/fathom.ts +9 -0
- package/src/helpers/gcp.ts +9 -0
- package/src/helpers/gcs.ts +10 -0
- package/src/helpers/github.ts +10 -0
- package/src/helpers/gitlab.ts +10 -0
- package/src/helpers/gmail.ts +10 -0
- package/src/helpers/google-calendar.ts +10 -0
- package/src/helpers/google-drive.ts +10 -0
- package/src/helpers/granola.ts +10 -0
- package/src/helpers/hubspot.ts +10 -0
- package/src/helpers/index.ts +212 -0
- package/src/helpers/intercom.ts +10 -0
- package/src/helpers/jira.ts +10 -0
- package/src/helpers/linear.ts +10 -0
- package/src/helpers/mailgun.ts +10 -0
- package/src/helpers/mixpanel.ts +10 -0
- package/src/helpers/neon.ts +9 -0
- package/src/helpers/notion.ts +10 -0
- package/src/helpers/onedrive.ts +10 -0
- package/src/helpers/pipedrive.ts +10 -0
- package/src/helpers/postgres.ts +10 -0
- package/src/helpers/posthog.ts +9 -0
- package/src/helpers/providers.ts +305 -0
- package/src/helpers/ramp.ts +12 -0
- package/src/helpers/recall.ts +10 -0
- package/src/helpers/reddit.ts +10 -0
- package/src/helpers/redis.ts +10 -0
- package/src/helpers/s3.ts +10 -0
- package/src/helpers/salesforce.ts +10 -0
- package/src/helpers/segment.ts +9 -0
- package/src/helpers/sendgrid.ts +10 -0
- package/src/helpers/sharepoint.ts +10 -0
- package/src/helpers/shopify.ts +9 -0
- package/src/helpers/shortcut.ts +10 -0
- package/src/helpers/slack.ts +16 -0
- package/src/helpers/stripe.ts +10 -0
- package/src/helpers/teams.ts +10 -0
- package/src/helpers/telegram.ts +10 -0
- package/src/helpers/webhook-server.ts +9 -0
- package/src/helpers/x.ts +9 -0
- package/src/helpers/zendesk.ts +10 -0
- package/src/index.ts +26 -3
- package/src/memory.ts +20 -0
- package/src/plugin-contract.ts +5 -0
- package/src/provider-trigger.ts +26 -0
- package/src/runtime.ts +8 -0
- package/src/slack.ts +47 -0
- package/src/step.ts +52 -1
- package/src/triggers/README.md +75 -0
- package/src/triggers/github.ts +19 -0
- package/src/triggers/index.ts +10 -0
- package/src/triggers/slack.ts +19 -0
- package/src/triggers.ts +49 -0
package/src/flow.ts
CHANGED
|
@@ -1,38 +1,33 @@
|
|
|
1
|
+
import { helperProviders } from "./helpers/providers.js";
|
|
2
|
+
import type { Helpers } from "./helpers/index.js";
|
|
3
|
+
type HelperTools = Partial<Record<keyof Helpers, boolean>>;
|
|
1
4
|
import type { Ctx } from "./context.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A reusable agent CLI/model pair, selectable by name from `f.agent(name, ...)`.
|
|
5
|
-
* Both fields are required so selecting a named agent can never inherit a
|
|
6
|
-
* host model — mirrors the kernel-spec dialect's `NamedAgentSpec`
|
|
7
|
-
* (`packages/sdk/src/spec.ts`), which this compiles into.
|
|
8
|
-
*/
|
|
9
|
-
export interface NamedAgentDeclaration {
|
|
10
|
-
cli: string;
|
|
11
|
-
model: string;
|
|
12
|
-
}
|
|
5
|
+
import { webhook, type TriggerSource } from "./triggers.js";
|
|
13
6
|
|
|
14
7
|
/** Optional escalation header; the empty header is the common case. */
|
|
15
8
|
export interface FlowHeader {
|
|
9
|
+
/** Relative paths to reusable authored flows composed by this body. */
|
|
10
|
+
use?: string[];
|
|
16
11
|
identity?: string;
|
|
17
12
|
memory?: { script?: boolean; agent?: boolean };
|
|
18
|
-
budget?: string;
|
|
19
|
-
tools?: { relayfile?: string[]; mcp?: string[] };
|
|
13
|
+
budget?: string | { tokens?: number; dollars?: number; wallclock?: string };
|
|
14
|
+
tools?: HelperTools & { relayfile?: string[]; mcp?: string[] };
|
|
20
15
|
workspace?: string;
|
|
21
|
-
agents?: Record<string, NamedAgentDeclaration>;
|
|
22
16
|
}
|
|
23
17
|
|
|
24
18
|
export type FlowBody<Input = unknown> = (f: Ctx, input: Input) => Promise<void>;
|
|
25
19
|
|
|
26
20
|
export interface ReadonlyFlowHeader {
|
|
21
|
+
readonly use?: readonly string[];
|
|
27
22
|
readonly identity?: string;
|
|
28
23
|
readonly memory?: Readonly<{ script?: boolean; agent?: boolean }>;
|
|
29
|
-
readonly budget?: string;
|
|
30
|
-
readonly tools?: Readonly<{
|
|
24
|
+
readonly budget?: string | Readonly<{ tokens?: number; dollars?: number; wallclock?: string }>;
|
|
25
|
+
readonly tools?: Readonly<HelperTools & {
|
|
26
|
+
slack?: boolean;
|
|
31
27
|
relayfile?: readonly string[];
|
|
32
28
|
mcp?: readonly string[];
|
|
33
29
|
}>;
|
|
34
30
|
readonly workspace?: string;
|
|
35
|
-
readonly agents?: Readonly<Record<string, Readonly<NamedAgentDeclaration>>>;
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
/** Immutable definition retained for the SDK's journal-backed runtime. */
|
|
@@ -40,15 +35,25 @@ export interface AuthoredFlowDefinition<Input = unknown> {
|
|
|
40
35
|
readonly name: string;
|
|
41
36
|
readonly header: ReadonlyFlowHeader;
|
|
42
37
|
readonly body: FlowBody<Input>;
|
|
38
|
+
readonly handlers: readonly TriggerHandler[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface TriggerHandler {
|
|
42
|
+
readonly trigger: TriggerSource;
|
|
43
|
+
readonly body: FlowBody;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
/** Opaque authored-flow handle. Execution stays behind the journal runtime. */
|
|
46
47
|
export interface FlowHandle {
|
|
47
48
|
readonly name: string;
|
|
49
|
+
on<Event = Record<string, unknown>>(trigger: TriggerSource, body: FlowBody<Event>): TriggeredFlowHandle;
|
|
48
50
|
}
|
|
49
51
|
|
|
52
|
+
export interface TriggeredFlowHandle extends FlowHandle {}
|
|
53
|
+
|
|
50
54
|
const definitions = new WeakMap<object, AuthoredFlowDefinition>();
|
|
51
55
|
|
|
56
|
+
export function flow(name: string, header?: FlowHeader): FlowHandle;
|
|
52
57
|
export function flow<Input = unknown>(name: string, body: FlowBody<Input>): FlowHandle;
|
|
53
58
|
export function flow<Input = unknown>(
|
|
54
59
|
name: string,
|
|
@@ -57,7 +62,7 @@ export function flow<Input = unknown>(
|
|
|
57
62
|
): FlowHandle;
|
|
58
63
|
export function flow<Input = unknown>(
|
|
59
64
|
name: string,
|
|
60
|
-
headerOrBody: FlowHeader | FlowBody<Input
|
|
65
|
+
headerOrBody: FlowHeader | FlowBody<Input> = {},
|
|
61
66
|
body?: FlowBody<Input>,
|
|
62
67
|
): FlowHandle {
|
|
63
68
|
const flowBody = typeof headerOrBody === "function" ? headerOrBody : body;
|
|
@@ -66,7 +71,7 @@ export function flow<Input = unknown>(
|
|
|
66
71
|
if (name.trim().length === 0) {
|
|
67
72
|
throw new TypeError("flow name must not be empty");
|
|
68
73
|
}
|
|
69
|
-
if (typeof flowBody !== "function") {
|
|
74
|
+
if (flowBody !== undefined && typeof flowBody !== "function") {
|
|
70
75
|
throw new TypeError(`flow "${name}" requires a body`);
|
|
71
76
|
}
|
|
72
77
|
assertFlowHeader(header, name);
|
|
@@ -74,9 +79,28 @@ export function flow<Input = unknown>(
|
|
|
74
79
|
const definition: AuthoredFlowDefinition<Input> = Object.freeze({
|
|
75
80
|
name,
|
|
76
81
|
header: freezeHeader(header),
|
|
77
|
-
body: flowBody,
|
|
82
|
+
body: flowBody ?? (async () => { throw new TypeError(`flow "${name}" has no direct-run body`); }),
|
|
83
|
+
handlers: Object.freeze([]),
|
|
78
84
|
});
|
|
79
|
-
|
|
85
|
+
return makeHandle(definition as AuthoredFlowDefinition);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function makeHandle(definition: AuthoredFlowDefinition): FlowHandle {
|
|
89
|
+
const handle = { name: definition.name } as FlowHandle;
|
|
90
|
+
Object.defineProperty(handle, "on", {
|
|
91
|
+
value: <Event>(trigger: TriggerSource, body: FlowBody<Event>): TriggeredFlowHandle => {
|
|
92
|
+
if (typeof body !== "function") throw new TypeError("trigger handler requires a body");
|
|
93
|
+
assertHeaderObject(trigger, "trigger");
|
|
94
|
+
assertKnownKeys(trigger, ["kind", "name", "filter"], "trigger");
|
|
95
|
+
if (trigger.kind !== "webhook") throw new TypeError("unsupported trigger kind");
|
|
96
|
+
const source = webhook(trigger.name, trigger.filter);
|
|
97
|
+
return makeHandle(Object.freeze({
|
|
98
|
+
...definition,
|
|
99
|
+
handlers: Object.freeze([...definition.handlers, Object.freeze({ trigger: source, body: body as FlowBody })]),
|
|
100
|
+
}));
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
Object.freeze(handle);
|
|
80
104
|
// One map holds definitions of many input types, so it is stored at the
|
|
81
105
|
// default parameterisation and `getFlowDefinition<Input>` re-parameterises on
|
|
82
106
|
// the way out. The cast is needed because `body` puts `Input` in a parameter
|
|
@@ -84,7 +108,7 @@ export function flow<Input = unknown>(
|
|
|
84
108
|
// assignable to `AuthoredFlowDefinition<unknown>` even though every read
|
|
85
109
|
// recovers the author's own type. Sound here because the handle-to-definition
|
|
86
110
|
// pairing is 1:1 and both sides are keyed by the same authored flow.
|
|
87
|
-
definitions.set(handle, definition
|
|
111
|
+
definitions.set(handle, definition);
|
|
88
112
|
return handle;
|
|
89
113
|
}
|
|
90
114
|
|
|
@@ -92,7 +116,7 @@ export function flow<Input = unknown>(
|
|
|
92
116
|
* Runtime bridge used by the SDK after it imports an authored `.flow.ts`.
|
|
93
117
|
* The root package deliberately does not re-export this accessor.
|
|
94
118
|
*/
|
|
95
|
-
export function getFlowDefinition<Input = unknown>(handle: FlowHandle): AuthoredFlowDefinition<Input> {
|
|
119
|
+
export function getFlowDefinition<Input = unknown>(handle: Pick<FlowHandle, "name">): AuthoredFlowDefinition<Input> {
|
|
96
120
|
if ((typeof handle !== "object" && typeof handle !== "function") || handle === null) {
|
|
97
121
|
throw new TypeError("expected an @relayflows/surface flow handle");
|
|
98
122
|
}
|
|
@@ -127,12 +151,12 @@ function isStoredDefinition(
|
|
|
127
151
|
|
|
128
152
|
function freezeHeader(header: FlowHeader): ReadonlyFlowHeader {
|
|
129
153
|
const unknownFields = Object.keys(header).filter((field) => ![
|
|
154
|
+
"use",
|
|
130
155
|
"identity",
|
|
131
156
|
"memory",
|
|
132
157
|
"budget",
|
|
133
158
|
"tools",
|
|
134
159
|
"workspace",
|
|
135
|
-
"agents",
|
|
136
160
|
].includes(field));
|
|
137
161
|
if (unknownFields.length > 0) {
|
|
138
162
|
throw new TypeError(`flow header has unknown fields: ${unknownFields.join(", ")}`);
|
|
@@ -143,6 +167,8 @@ function freezeHeader(header: FlowHeader): ReadonlyFlowHeader {
|
|
|
143
167
|
const tools = header.tools === undefined
|
|
144
168
|
? undefined
|
|
145
169
|
: Object.freeze({
|
|
170
|
+
...Object.fromEntries(helperProviders.filter(p => header.tools?.[p.namespace] !== undefined)
|
|
171
|
+
.map(p => [p.namespace, header.tools![p.namespace]])),
|
|
146
172
|
...(header.tools.relayfile === undefined
|
|
147
173
|
? {}
|
|
148
174
|
: { relayfile: Object.freeze([...header.tools.relayfile]) }),
|
|
@@ -150,26 +176,13 @@ function freezeHeader(header: FlowHeader): ReadonlyFlowHeader {
|
|
|
150
176
|
? {}
|
|
151
177
|
: { mcp: Object.freeze([...header.tools.mcp]) }),
|
|
152
178
|
});
|
|
153
|
-
const agents = header.agents === undefined
|
|
154
|
-
? undefined
|
|
155
|
-
: Object.freeze(
|
|
156
|
-
Object.fromEntries(
|
|
157
|
-
ownDataEntries(header.agents, "header.agents").map(([name, declaration]) => {
|
|
158
|
-
// Validated by assertFlowHeader's own ownDataEntries pass before
|
|
159
|
-
// this ever runs: exactly {cli, model}, both non-empty trimmed
|
|
160
|
-
// strings, read as data properties (never through a getter).
|
|
161
|
-
const record = declaration as NamedAgentDeclaration;
|
|
162
|
-
return [name, Object.freeze({ cli: record.cli, model: record.model })];
|
|
163
|
-
}),
|
|
164
|
-
),
|
|
165
|
-
);
|
|
166
179
|
return Object.freeze({
|
|
180
|
+
...(header.use === undefined ? {} : { use: Object.freeze([...header.use]) }),
|
|
167
181
|
...(header.identity === undefined ? {} : { identity: header.identity }),
|
|
168
182
|
...(memory === undefined ? {} : { memory }),
|
|
169
|
-
...(header.budget === undefined ? {} : { budget: header.budget }),
|
|
183
|
+
...(header.budget === undefined ? {} : { budget: typeof header.budget === "string" ? header.budget : Object.freeze({ ...header.budget }) }),
|
|
170
184
|
...(tools === undefined ? {} : { tools }),
|
|
171
185
|
...(header.workspace === undefined ? {} : { workspace: header.workspace }),
|
|
172
|
-
...(agents === undefined ? {} : { agents }),
|
|
173
186
|
});
|
|
174
187
|
}
|
|
175
188
|
|
|
@@ -178,12 +191,27 @@ function assertFlowHeader(value: unknown, flowName: string): asserts value is Fl
|
|
|
178
191
|
assertHeaderObject(value, at);
|
|
179
192
|
assertKnownKeys(
|
|
180
193
|
value,
|
|
181
|
-
["identity", "memory", "budget", "tools", "workspace"
|
|
194
|
+
["use", "identity", "memory", "budget", "tools", "workspace"],
|
|
182
195
|
at,
|
|
183
196
|
);
|
|
184
197
|
assertOptionalString(value, "identity", at);
|
|
185
|
-
|
|
198
|
+
if (value.budget !== undefined && typeof value.budget !== "string") {
|
|
199
|
+
assertHeaderObject(value.budget, `${at}.budget`);
|
|
200
|
+
assertKnownKeys(value.budget, ["tokens", "dollars", "wallclock"], `${at}.budget`);
|
|
201
|
+
assertOptionalString(value.budget, "wallclock", at);
|
|
202
|
+
for (const key of ["tokens", "dollars"]) {
|
|
203
|
+
if (value.budget[key] !== undefined && typeof value.budget[key] !== "number") throw new TypeError(`budget_syntax_invalid: ${key} must be a number`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
186
206
|
assertOptionalString(value, "workspace", at);
|
|
207
|
+
assertOptionalStringArray(value, "use", at);
|
|
208
|
+
if (value.use !== undefined) {
|
|
209
|
+
for (const path of value.use as string[]) {
|
|
210
|
+
if (!/^(?:\.\/|\.\.\/).+\.flow\.ts$/.test(path) || /[?#\\\\]/.test(path)) {
|
|
211
|
+
throw new TypeError(`${at}.use: expected relative .flow.ts paths`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
187
215
|
|
|
188
216
|
if (value.memory !== undefined) {
|
|
189
217
|
assertHeaderObject(value.memory, `${at}.memory`);
|
|
@@ -200,54 +228,13 @@ function assertFlowHeader(value: unknown, flowName: string): asserts value is Fl
|
|
|
200
228
|
assertHeaderObject(value.tools, `${at}.tools`);
|
|
201
229
|
assertKnownKeys(
|
|
202
230
|
value.tools,
|
|
203
|
-
["relayfile", "mcp"],
|
|
231
|
+
["relayfile", "mcp", ...helperProviders.map(p => p.namespace)],
|
|
204
232
|
`${at}.tools`,
|
|
205
233
|
);
|
|
234
|
+
for (const { namespace } of helperProviders) assertOptionalBoolean(value.tools, namespace, `${at}.tools`);
|
|
206
235
|
assertOptionalStringArray(value.tools, "relayfile", `${at}.tools`);
|
|
207
236
|
assertOptionalStringArray(value.tools, "mcp", `${at}.tools`);
|
|
208
237
|
}
|
|
209
|
-
|
|
210
|
-
if (value.agents !== undefined) {
|
|
211
|
-
assertHeaderObject(value.agents, `${at}.agents`);
|
|
212
|
-
for (const [name, declaration] of ownDataEntries(value.agents, `${at}.agents`)) {
|
|
213
|
-
if (name !== name.trim() || name.length === 0) {
|
|
214
|
-
throw new TypeError(`${at}.agents: agent name ${JSON.stringify(name)} must be a non-empty, trimmed string`);
|
|
215
|
-
}
|
|
216
|
-
const declarationAt = `${at}.agents.${name}`;
|
|
217
|
-
assertHeaderObject(declaration, declarationAt);
|
|
218
|
-
assertKnownKeys(declaration, ["cli", "model"], declarationAt);
|
|
219
|
-
assertRequiredTrimmedString(declaration, "cli", declarationAt);
|
|
220
|
-
assertRequiredTrimmedString(declaration, "model", declarationAt);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Reads every own property of `value` via its descriptor rather than
|
|
227
|
-
* `Object.entries`/property access, so an accessor (getter) property is
|
|
228
|
-
* REJECTED — never invoked — instead of being enumerated as if it were
|
|
229
|
-
* ordinary data. `Object.entries` would call the getter, and a stateful
|
|
230
|
-
* getter can legally answer validation with one value and a second,
|
|
231
|
-
* unvalidated read (e.g. during freezing) with a different one — the closed
|
|
232
|
-
* declaration contract must not depend on a property being well-behaved
|
|
233
|
-
* across two separate reads.
|
|
234
|
-
*/
|
|
235
|
-
function ownDataEntries(
|
|
236
|
-
value: Record<string, unknown>,
|
|
237
|
-
at: string,
|
|
238
|
-
): [string, unknown][] {
|
|
239
|
-
const entries: [string, unknown][] = [];
|
|
240
|
-
for (const key of Reflect.ownKeys(value)) {
|
|
241
|
-
if (typeof key !== "string") {
|
|
242
|
-
throw new TypeError(`${at}: unknown field ${JSON.stringify(String(key))}`);
|
|
243
|
-
}
|
|
244
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
245
|
-
if (descriptor === undefined || !("value" in descriptor)) {
|
|
246
|
-
throw new TypeError(`${at}.${key}: expected a data property`);
|
|
247
|
-
}
|
|
248
|
-
entries.push([key, descriptor.value]);
|
|
249
|
-
}
|
|
250
|
-
return entries;
|
|
251
238
|
}
|
|
252
239
|
|
|
253
240
|
function assertHeaderObject(
|
|
@@ -290,27 +277,6 @@ function assertOptionalString(
|
|
|
290
277
|
}
|
|
291
278
|
}
|
|
292
279
|
|
|
293
|
-
/**
|
|
294
|
-
* Requires a trimmed, non-empty string — not merely non-empty-after-trim.
|
|
295
|
-
* The SDK's own project-config schema only accepts already-trimmed model/cli
|
|
296
|
-
* strings (`readProjectConfig`, cli/check.ts); accepting untrimmed values
|
|
297
|
-
* here would let a flow author declare " claude " and have it validate at
|
|
298
|
-
* authoring time but fail later at f.agent preflight, moving a defect from
|
|
299
|
-
* authoring to execution instead of catching it up front.
|
|
300
|
-
*/
|
|
301
|
-
function assertRequiredTrimmedString(
|
|
302
|
-
value: Record<string, unknown>,
|
|
303
|
-
key: string,
|
|
304
|
-
at: string,
|
|
305
|
-
): void {
|
|
306
|
-
if (typeof value[key] !== "string" || value[key].length === 0) {
|
|
307
|
-
throw new TypeError(`${at}.${key}: expected a non-empty string`);
|
|
308
|
-
}
|
|
309
|
-
if (value[key] !== value[key].trim()) {
|
|
310
|
-
throw new TypeError(`${at}.${key}: must not have leading or trailing whitespace`);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
280
|
function assertOptionalBoolean(
|
|
315
281
|
value: Record<string, unknown>,
|
|
316
282
|
key: string,
|
|
@@ -329,8 +295,13 @@ function assertOptionalStringArray(
|
|
|
329
295
|
const candidate = value[key];
|
|
330
296
|
if (
|
|
331
297
|
candidate !== undefined
|
|
332
|
-
&& (!Array.isArray(candidate) || candidate.some((item) => typeof item !== "string"))
|
|
298
|
+
&& (!Array.isArray(candidate) || Array.from(candidate).some((item) => typeof item !== "string"))
|
|
333
299
|
) {
|
|
334
300
|
throw new TypeError(`${at}.${key}: expected an array of strings`);
|
|
335
301
|
}
|
|
302
|
+
if (key === "use" && Array.isArray(candidate)
|
|
303
|
+
&& (candidate.some((item) => item.trim().length === 0)
|
|
304
|
+
|| new Set(candidate).size !== candidate.length)) {
|
|
305
|
+
throw new TypeError(`${at}.${key}: expected unique nonempty paths`);
|
|
306
|
+
}
|
|
336
307
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { githubClient as upstreamGithub, notionClient as upstreamNotion, created } from '@relayfile/relay-helpers';
|
|
2
|
+
import type { RelayClientOptions } from '@relayfile/relay-helpers/transport';
|
|
3
|
+
|
|
4
|
+
/** Accept the conventional owner/repo shorthand as well as upstream arguments. */
|
|
5
|
+
export function githubClient(options: RelayClientOptions) {
|
|
6
|
+
const client = upstreamGithub(options);
|
|
7
|
+
return { ...client, createIssue(args: { owner?: string; repo: string; title: string; body: string; labels?: string[] }) {
|
|
8
|
+
const [owner, repo, extra] = args.repo.split('/');
|
|
9
|
+
if (!args.owner && (!owner || !repo || extra)) throw new Error('github.createIssue requires repo: "owner/repo" or an explicit owner');
|
|
10
|
+
return client.createIssue({ ...args, owner: args.owner ?? owner!, repo: args.owner ? args.repo : repo! });
|
|
11
|
+
} };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function stripeClient(options: RelayClientOptions) {
|
|
15
|
+
return { createInvoice(args: { customer: string; auto_advance?: boolean; collection_method?: 'charge_automatically' | 'send_invoice'; days_until_due?: number; description?: string; metadata?: Record<string, string> }) {
|
|
16
|
+
if (!options.transport) throw new Error('Stripe requires a journal transport');
|
|
17
|
+
return created(options.transport.write({ provider: 'stripe', resource: 'invoices',
|
|
18
|
+
parameters: {}, path: '/stripe/invoices', body: args }));
|
|
19
|
+
} };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function notionClient(options: RelayClientOptions) {
|
|
23
|
+
return { ...upstreamNotion(options), async appendBlock(args: { pageId: string; block: Record<string, unknown> }) {
|
|
24
|
+
if (!options.transport) throw new Error('Notion requires a journal transport');
|
|
25
|
+
// The adapter does not yet support this route. The runtime refuses it in
|
|
26
|
+
// mount mode, while mock mode can exercise authoring and effect lowering.
|
|
27
|
+
return created(options.transport.write({ provider: 'notion', resource: 'blocks',
|
|
28
|
+
parameters: { pageId: args.pageId }, path: `/notion/pages/${encodeURIComponent(args.pageId)}/blocks`, body: { children: [args.block] } }));
|
|
29
|
+
} };
|
|
30
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Generated TypeScript helpers; do not edit the `.ts` files. Run
|
|
2
|
+
`npm run gen --prefix packages/surface` from the repository root (or `npm run gen`
|
|
3
|
+
inside this package). This repository has no root npm workspace, so
|
|
4
|
+
`npm run gen -w @relayflows/surface` is not available.
|
|
5
|
+
|
|
6
|
+
This minimal slice ships Slack's four existing journal-backed methods. Argument
|
|
7
|
+
shapes come from the pinned `@relayfile/relay-helpers` declaration; return types
|
|
8
|
+
come from the existing surface dispatcher contract, including `reply`'s `ref`.
|
|
9
|
+
`post` extends that contract with a structured second argument (`text`, `blocks`,
|
|
10
|
+
`attachments`) or `blocks`/`attachments` in its third options argument. Options
|
|
11
|
+
take precedence when both forms provide the same field. `replyTo` still maps to
|
|
12
|
+
the adapter's `parentRef`; no interaction callback registration is added.
|
|
13
|
+
|
|
14
|
+
The pinned relay-helpers 0.4.11 package does **not** export Block Kit/OpenAPI
|
|
15
|
+
types. Until it does, `scripts/slack-message-schema.json` vendors the small
|
|
16
|
+
fragments used by the generator, with their upstream URL and JSON pointers.
|
|
17
|
+
Slack's published OpenAPI schema requires a string `type` on blocks but leaves
|
|
18
|
+
their other fields open. Attachment objects are likewise open (the generic
|
|
19
|
+
chat.update message schema is used; chat.postMessage's response attachment
|
|
20
|
+
schema requires a server-assigned `id`, unsuitable for authoring).
|
|
21
|
+
These types do not validate individual block layouts or interaction handlers.
|
|
22
|
+
The SDK preserves structured content at the adapter transport boundary because
|
|
23
|
+
the pinned adapter's ergonomic `post` still accepts only text.
|
|
24
|
+
|
|
25
|
+
`Ctx` extends the generated `Helpers` namespace map. A union of namespace maps
|
|
26
|
+
would make only their common properties accessible, so composition uses an
|
|
27
|
+
interface instead.
|
|
28
|
+
|
|
29
|
+
To consume a read-only adapter checkout before release:
|
|
30
|
+
`node scripts/generate-helpers.mjs --adapters-dir /path/to/relayfile-adapters`.
|
|
31
|
+
Use `--out-dir /tmp/generated-helpers` to inspect output without changing source.
|
|
32
|
+
CI regenerates from the installed pinned package and compares every generated
|
|
33
|
+
TypeScript file byte-for-byte, including the namespace index.
|
|
34
|
+
|
|
35
|
+
Follow-up for the full slice N: add GitHub, Notion, Linear, and Stripe once their
|
|
36
|
+
methods have runtime dispatch support; consume mapping/discovery resources and
|
|
37
|
+
generate the remaining providers. The current runtime implements only Slack.
|
|
38
|
+
The uniform upstream clients expose resource `read`/`list`/`write` methods,
|
|
39
|
+
not `stripe.createInvoice` or `notion.appendBlock`; those aliases need an agreed
|
|
40
|
+
runtime contract before this types-only generator can expose them. GitHub's
|
|
41
|
+
bespoke `createIssue` also requires `owner` in addition to `repo`, `title`, and
|
|
42
|
+
`body`. No new provider methods or resource methods are advertised in this proof.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper, type UnavailableHelper } from "../effect-transport.js";
|
|
5
|
+
|
|
6
|
+
export type AirtableHelper = UnavailableHelper;
|
|
7
|
+
|
|
8
|
+
export const createAirtableHelper = (dispatch: EffectDispatcher): AirtableHelper =>
|
|
9
|
+
bindHelper("airtable", undefined, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { asanaClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type AsanaHelper = JournalHelper<ReturnType<typeof asanaClient>>;
|
|
8
|
+
|
|
9
|
+
export const createAsanaHelper = (dispatch: EffectDispatcher): AsanaHelper =>
|
|
10
|
+
bindHelper("asana", asanaClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { azureBlobClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type AzureBlobHelper = JournalHelper<ReturnType<typeof azureBlobClient>>;
|
|
8
|
+
|
|
9
|
+
export const createAzureBlobHelper = (dispatch: EffectDispatcher): AzureBlobHelper =>
|
|
10
|
+
bindHelper("azure-blob", azureBlobClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { boxClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type BoxHelper = JournalHelper<ReturnType<typeof boxClient>>;
|
|
8
|
+
|
|
9
|
+
export const createBoxHelper = (dispatch: EffectDispatcher): BoxHelper =>
|
|
10
|
+
bindHelper("box", boxClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { calendlyClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type CalendlyHelper = JournalHelper<ReturnType<typeof calendlyClient>>;
|
|
8
|
+
|
|
9
|
+
export const createCalendlyHelper = (dispatch: EffectDispatcher): CalendlyHelper =>
|
|
10
|
+
bindHelper("calendly", calendlyClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { clickupClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type ClickupHelper = JournalHelper<ReturnType<typeof clickupClient>>;
|
|
8
|
+
|
|
9
|
+
export const createClickupHelper = (dispatch: EffectDispatcher): ClickupHelper =>
|
|
10
|
+
bindHelper("clickup", clickupClient, dispatch);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import * as upstream from "@relayfile/relay-helpers";
|
|
5
|
+
import * as custom from "../helper-clients.js";
|
|
6
|
+
import type { HelperFactory } from "../effect-transport.js";
|
|
7
|
+
|
|
8
|
+
export const helperClients: Readonly<Record<string, HelperFactory>> = {
|
|
9
|
+
"asana": upstream.asanaClient,
|
|
10
|
+
"azure-blob": upstream.azureBlobClient,
|
|
11
|
+
"box": upstream.boxClient,
|
|
12
|
+
"calendly": upstream.calendlyClient,
|
|
13
|
+
"clickup": upstream.clickupClient,
|
|
14
|
+
"cloudflare": upstream.cloudflareClient,
|
|
15
|
+
"confluence": upstream.confluenceClient,
|
|
16
|
+
"daytona": upstream.daytonaClient,
|
|
17
|
+
"dropbox": upstream.dropboxClient,
|
|
18
|
+
"gcs": upstream.gcsClient,
|
|
19
|
+
"github": custom.githubClient,
|
|
20
|
+
"gitlab": upstream.gitlabClient,
|
|
21
|
+
"gmail": upstream.gmailClient,
|
|
22
|
+
"google-calendar": upstream.googleCalendarClient,
|
|
23
|
+
"google-drive": upstream.googleDriveClient,
|
|
24
|
+
"granola": upstream.granolaClient,
|
|
25
|
+
"hubspot": upstream.hubspotClient,
|
|
26
|
+
"intercom": upstream.intercomClient,
|
|
27
|
+
"jira": upstream.jiraClient,
|
|
28
|
+
"linear": upstream.linearClient,
|
|
29
|
+
"mailgun": upstream.mailgunClient,
|
|
30
|
+
"mixpanel": upstream.mixpanelClient,
|
|
31
|
+
"notion": custom.notionClient,
|
|
32
|
+
"onedrive": upstream.onedriveClient,
|
|
33
|
+
"pipedrive": upstream.pipedriveClient,
|
|
34
|
+
"postgres": upstream.postgresClient,
|
|
35
|
+
"ramp": (options) => upstream.providerClient("ramp", options),
|
|
36
|
+
"recall": upstream.recallClient,
|
|
37
|
+
"reddit": upstream.redditClient,
|
|
38
|
+
"redis": upstream.redisClient,
|
|
39
|
+
"s3": upstream.s3Client,
|
|
40
|
+
"salesforce": upstream.salesforceClient,
|
|
41
|
+
"sendgrid": upstream.sendgridClient,
|
|
42
|
+
"sharepoint": upstream.sharepointClient,
|
|
43
|
+
"shortcut": upstream.shortcutClient,
|
|
44
|
+
"stripe": custom.stripeClient,
|
|
45
|
+
"teams": upstream.teamsClient,
|
|
46
|
+
"telegram": upstream.telegramClient,
|
|
47
|
+
"zendesk": upstream.zendeskClient,
|
|
48
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { cloudflareClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type CloudflareHelper = JournalHelper<ReturnType<typeof cloudflareClient>>;
|
|
8
|
+
|
|
9
|
+
export const createCloudflareHelper = (dispatch: EffectDispatcher): CloudflareHelper =>
|
|
10
|
+
bindHelper("cloudflare", cloudflareClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { confluenceClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type ConfluenceHelper = JournalHelper<ReturnType<typeof confluenceClient>>;
|
|
8
|
+
|
|
9
|
+
export const createConfluenceHelper = (dispatch: EffectDispatcher): ConfluenceHelper =>
|
|
10
|
+
bindHelper("confluence", confluenceClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { daytonaClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type DaytonaHelper = JournalHelper<ReturnType<typeof daytonaClient>>;
|
|
8
|
+
|
|
9
|
+
export const createDaytonaHelper = (dispatch: EffectDispatcher): DaytonaHelper =>
|
|
10
|
+
bindHelper("daytona", daytonaClient, dispatch);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper, type UnavailableHelper } from "../effect-transport.js";
|
|
5
|
+
|
|
6
|
+
export type DockerHubHelper = UnavailableHelper;
|
|
7
|
+
|
|
8
|
+
export const createDockerHubHelper = (dispatch: EffectDispatcher): DockerHubHelper =>
|
|
9
|
+
bindHelper("docker-hub", undefined, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { dropboxClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type DropboxHelper = JournalHelper<ReturnType<typeof dropboxClient>>;
|
|
8
|
+
|
|
9
|
+
export const createDropboxHelper = (dispatch: EffectDispatcher): DropboxHelper =>
|
|
10
|
+
bindHelper("dropbox", dropboxClient, dispatch);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper, type UnavailableHelper } from "../effect-transport.js";
|
|
5
|
+
|
|
6
|
+
export type FathomHelper = UnavailableHelper;
|
|
7
|
+
|
|
8
|
+
export const createFathomHelper = (dispatch: EffectDispatcher): FathomHelper =>
|
|
9
|
+
bindHelper("fathom", undefined, dispatch);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper, type UnavailableHelper } from "../effect-transport.js";
|
|
5
|
+
|
|
6
|
+
export type GcpHelper = UnavailableHelper;
|
|
7
|
+
|
|
8
|
+
export const createGcpHelper = (dispatch: EffectDispatcher): GcpHelper =>
|
|
9
|
+
bindHelper("gcp", undefined, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { gcsClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type GcsHelper = JournalHelper<ReturnType<typeof gcsClient>>;
|
|
8
|
+
|
|
9
|
+
export const createGcsHelper = (dispatch: EffectDispatcher): GcsHelper =>
|
|
10
|
+
bindHelper("gcs", gcsClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { githubClient } from "../helper-clients.js";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type GithubHelper = JournalHelper<ReturnType<typeof githubClient>>;
|
|
8
|
+
|
|
9
|
+
export const createGithubHelper = (dispatch: EffectDispatcher): GithubHelper =>
|
|
10
|
+
bindHelper("github", githubClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { gitlabClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type GitlabHelper = JournalHelper<ReturnType<typeof gitlabClient>>;
|
|
8
|
+
|
|
9
|
+
export const createGitlabHelper = (dispatch: EffectDispatcher): GitlabHelper =>
|
|
10
|
+
bindHelper("gitlab", gitlabClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { gmailClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type GmailHelper = JournalHelper<ReturnType<typeof gmailClient>>;
|
|
8
|
+
|
|
9
|
+
export const createGmailHelper = (dispatch: EffectDispatcher): GmailHelper =>
|
|
10
|
+
bindHelper("gmail", gmailClient, dispatch);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-helpers.mjs — do not edit.
|
|
2
|
+
// Run `npm run gen --prefix packages/surface` from the repository root.
|
|
3
|
+
|
|
4
|
+
import { googleCalendarClient } from "@relayfile/relay-helpers";
|
|
5
|
+
import { bindHelper, type EffectDispatcher, type JournalHelper } from "../effect-transport.js";
|
|
6
|
+
|
|
7
|
+
export type GoogleCalendarHelper = JournalHelper<ReturnType<typeof googleCalendarClient>>;
|
|
8
|
+
|
|
9
|
+
export const createGoogleCalendarHelper = (dispatch: EffectDispatcher): GoogleCalendarHelper =>
|
|
10
|
+
bindHelper("google-calendar", googleCalendarClient, dispatch);
|