@reasonlayer/sdk 0.0.1-rc.3
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/LICENSE +201 -0
- package/README.md +35 -0
- package/bin/rl.mjs +75 -0
- package/dist/builder.d.ts +38 -0
- package/dist/builder.js +41 -0
- package/dist/bundler/index.d.ts +32 -0
- package/dist/bundler/index.js +143 -0
- package/dist/bundler/node.d.ts +10 -0
- package/dist/bundler/node.js +55 -0
- package/dist/cli/args.d.ts +9 -0
- package/dist/cli/args.js +71 -0
- package/dist/cli/config.d.ts +38 -0
- package/dist/cli/config.js +94 -0
- package/dist/cli/convex.d.ts +9 -0
- package/dist/cli/convex.js +25 -0
- package/dist/cli/format.d.ts +11 -0
- package/dist/cli/format.js +140 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +721 -0
- package/dist/cli/keychain.d.ts +21 -0
- package/dist/cli/keychain.js +100 -0
- package/dist/cli/operations.d.ts +106 -0
- package/dist/cli/operations.js +623 -0
- package/dist/cli/sdk-package.d.ts +18 -0
- package/dist/cli/sdk-package.js +45 -0
- package/dist/cli/storage-upload.d.ts +9 -0
- package/dist/cli/storage-upload.js +21 -0
- package/dist/cli/watcher-compile.d.ts +1 -0
- package/dist/cli/watcher-compile.js +20 -0
- package/dist/cli/watcher-process.d.ts +1 -0
- package/dist/cli/watcher-process.js +312 -0
- package/dist/cli/workspace-files.d.ts +12 -0
- package/dist/cli/workspace-files.js +91 -0
- package/dist/cli/workspace-local.d.ts +27 -0
- package/dist/cli/workspace-local.js +310 -0
- package/dist/cli/workspace-session.d.ts +13 -0
- package/dist/cli/workspace-session.js +12 -0
- package/dist/compile.d.ts +27 -0
- package/dist/compile.js +834 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +5 -0
- package/dist/schedule-validation.d.ts +1 -0
- package/dist/schedule-validation.js +16 -0
- package/dist/selector-schema.d.ts +26 -0
- package/dist/selector-schema.js +780 -0
- package/dist/selectors.d.ts +25 -0
- package/dist/selectors.js +99 -0
- package/dist/testkit.d.ts +32 -0
- package/dist/testkit.js +161 -0
- package/dist/types.d.ts +184 -0
- package/dist/types.js +110 -0
- package/node_modules/@reasonlayer/integrations/dist/catalog.d.ts +4937 -0
- package/node_modules/@reasonlayer/integrations/dist/catalog.js +20 -0
- package/node_modules/@reasonlayer/integrations/dist/generated/slack.d.ts +3014 -0
- package/node_modules/@reasonlayer/integrations/dist/generated/slack.js +3101 -0
- package/node_modules/@reasonlayer/integrations/dist/index.d.ts +2 -0
- package/node_modules/@reasonlayer/integrations/dist/index.js +1 -0
- package/node_modules/@reasonlayer/integrations/dist/internal/definitions.d.ts +44 -0
- package/node_modules/@reasonlayer/integrations/dist/internal/definitions.js +52 -0
- package/node_modules/@reasonlayer/integrations/dist/internal/transport.d.ts +7 -0
- package/node_modules/@reasonlayer/integrations/dist/internal/transport.js +48 -0
- package/node_modules/@reasonlayer/integrations/dist/testkit.d.ts +1 -0
- package/node_modules/@reasonlayer/integrations/dist/testkit.js +1 -0
- package/node_modules/@reasonlayer/integrations/package.json +26 -0
- package/node_modules/@reasonlayer/protocol/dist/environments.d.ts +7 -0
- package/node_modules/@reasonlayer/protocol/dist/environments.js +7 -0
- package/node_modules/@reasonlayer/protocol/dist/events.d.ts +313 -0
- package/node_modules/@reasonlayer/protocol/dist/events.js +20 -0
- package/node_modules/@reasonlayer/protocol/dist/index.d.ts +18 -0
- package/node_modules/@reasonlayer/protocol/dist/index.js +9 -0
- package/node_modules/@reasonlayer/protocol/dist/ir.d.ts +252 -0
- package/node_modules/@reasonlayer/protocol/dist/ir.js +116 -0
- package/node_modules/@reasonlayer/protocol/dist/permissions.d.ts +5 -0
- package/node_modules/@reasonlayer/protocol/dist/permissions.js +30 -0
- package/node_modules/@reasonlayer/protocol/dist/readmodels.d.ts +617 -0
- package/node_modules/@reasonlayer/protocol/dist/readmodels.js +36 -0
- package/node_modules/@reasonlayer/protocol/dist/runtime.d.ts +67 -0
- package/node_modules/@reasonlayer/protocol/dist/runtime.js +66 -0
- package/node_modules/@reasonlayer/protocol/dist/scheduling.d.ts +69 -0
- package/node_modules/@reasonlayer/protocol/dist/scheduling.js +126 -0
- package/node_modules/@reasonlayer/protocol/dist/selector.d.ts +23 -0
- package/node_modules/@reasonlayer/protocol/dist/selector.js +77 -0
- package/node_modules/@reasonlayer/protocol/dist/tasks.d.ts +69 -0
- package/node_modules/@reasonlayer/protocol/dist/tasks.js +6 -0
- package/node_modules/@reasonlayer/protocol/dist/validate.d.ts +6 -0
- package/node_modules/@reasonlayer/protocol/dist/validate.js +18 -0
- package/node_modules/@reasonlayer/protocol/package.json +21 -0
- package/node_modules/@reasonlayer/runner/dist/environment-materializer.d.ts +13 -0
- package/node_modules/@reasonlayer/runner/dist/environment-materializer.js +92 -0
- package/node_modules/@reasonlayer/runner/dist/flue-transcript.d.ts +17 -0
- package/node_modules/@reasonlayer/runner/dist/flue-transcript.js +182 -0
- package/node_modules/@reasonlayer/runner/dist/index.d.ts +184 -0
- package/node_modules/@reasonlayer/runner/dist/index.js +884 -0
- package/node_modules/@reasonlayer/runner/dist/mcp-supervisor.d.ts +15 -0
- package/node_modules/@reasonlayer/runner/dist/mcp-supervisor.js +142 -0
- package/node_modules/@reasonlayer/runner/dist/sandbox-env.d.ts +36 -0
- package/node_modules/@reasonlayer/runner/dist/sandbox-env.js +171 -0
- package/node_modules/@reasonlayer/runner/dist/task-child.d.ts +1 -0
- package/node_modules/@reasonlayer/runner/dist/task-child.js +72 -0
- package/node_modules/@reasonlayer/runner/package.json +21 -0
- package/package.json +65 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * as v from "valibot";
|
|
2
|
+
export { slack } from "@reasonlayer/integrations";
|
|
3
|
+
export type { CatalogActionDescriptor, CatalogActionInput, CatalogActionOutput, } from "@reasonlayer/integrations";
|
|
4
|
+
export { defineWorkflow, code, agent, review } from "./builder.js";
|
|
5
|
+
export type { WorkflowBuilder } from "./builder.js";
|
|
6
|
+
export { compileWorkflow, exportNameFor } from "./compile.js";
|
|
7
|
+
export type { CompileWorkflowOptions } from "./compile.js";
|
|
8
|
+
export { defineEnvironment, defineVariable, device, mcpUrl, resetVariableRegistryForTests, schedule, secret, } from "./types.js";
|
|
9
|
+
export type { ActionStepConfig, AnySchema, ChildStepDef, CompileError, CompileResult, DeviceRef, EnvironmentMcpName, EnvironmentConfig, EnvironmentDefinition, LocalMcpServerConfig, McpServerConfig, RemoteMcpServerConfig, SecretRef, VariableConfig, ScheduleTrigger, WorkflowConfig, WorkflowDefinition, } from "./types.js";
|
|
10
|
+
export type { Wire } from "./selectors.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * as v from "valibot";
|
|
2
|
+
export { slack } from "@reasonlayer/integrations";
|
|
3
|
+
export { defineWorkflow, code, agent, review } from "./builder.js";
|
|
4
|
+
export { compileWorkflow, exportNameFor } from "./compile.js";
|
|
5
|
+
export { defineEnvironment, defineVariable, device, mcpUrl, resetVariableRegistryForTests, schedule, secret, } from "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function validateSchedule(cron: string, timezone: string, afterMs?: number): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CronExpressionParser } from "cron-parser";
|
|
2
|
+
const MAX_CRON_LOOKAHEAD_MS = 366 * 24 * 60 * 60 * 1000;
|
|
3
|
+
export function validateSchedule(cron, timezone, afterMs = Date.now()) {
|
|
4
|
+
const fields = cron.trim().split(/\s+/);
|
|
5
|
+
if (fields.length !== 5) {
|
|
6
|
+
throw new Error("cron must have five fields: minute hour day-of-month month day-of-week");
|
|
7
|
+
}
|
|
8
|
+
if (!timezone.trim())
|
|
9
|
+
throw new Error("timezone must not be empty");
|
|
10
|
+
const interval = CronExpressionParser.parse(cron, {
|
|
11
|
+
currentDate: new Date(afterMs),
|
|
12
|
+
endDate: new Date(afterMs + MAX_CRON_LOOKAHEAD_MS),
|
|
13
|
+
tz: timezone,
|
|
14
|
+
});
|
|
15
|
+
interval.next();
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proves that selector-produced review drafts satisfy their decision schemas.
|
|
3
|
+
*
|
|
4
|
+
* Reviews are the first consumer. The same type-erasure hole exists for code
|
|
5
|
+
* step inputs and the workflow output; this module can grow to check every
|
|
6
|
+
* step input and the workflow output. Move it to @reasonlayer/protocol if the
|
|
7
|
+
* backend ever needs to validate manually uploaded IR.
|
|
8
|
+
*/
|
|
9
|
+
import type { JsonSchema, SelectorIR } from "@reasonlayer/protocol";
|
|
10
|
+
export interface SelectorSchemaContext {
|
|
11
|
+
inputSchema: JsonSchema;
|
|
12
|
+
stepSchemas: Record<string, JsonSchema>;
|
|
13
|
+
variableSchemas?: Record<string, JsonSchema>;
|
|
14
|
+
mapItemSchema?: JsonSchema;
|
|
15
|
+
}
|
|
16
|
+
interface SchemaResolution {
|
|
17
|
+
schema?: JsonSchema;
|
|
18
|
+
issues: string[];
|
|
19
|
+
}
|
|
20
|
+
/** Resolve a wire-reference selector to its declared source schema. */
|
|
21
|
+
export declare function resolveSelectorSchema(selector: SelectorIR, context: SelectorSchemaContext): SchemaResolution;
|
|
22
|
+
/** Resolve the item schema of an array-valued selector, composed or referenced. */
|
|
23
|
+
export declare function resolveSelectorArrayItemSchema(selector: SelectorIR, context: SelectorSchemaContext): SchemaResolution;
|
|
24
|
+
/** Returns mismatch descriptions; an empty array means compatibility was proven. */
|
|
25
|
+
export declare function checkSelectorSatisfiesSchema(selector: SelectorIR, target: JsonSchema, context: SelectorSchemaContext): string[];
|
|
26
|
+
export {};
|