@lunora/server 1.0.0-alpha.23 → 1.0.0-alpha.24
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/types.d.mts +24 -2
- package/dist/types.d.ts +24 -2
- package/package.json +2 -2
package/dist/types.d.mts
CHANGED
|
@@ -684,6 +684,21 @@ interface ScheduledJob {
|
|
|
684
684
|
/** Routing hint forwarded so dispatch lands on the right shard. */
|
|
685
685
|
shardKey?: string;
|
|
686
686
|
}
|
|
687
|
+
/**
|
|
688
|
+
* A schedulable durable-workflow reference — the generated `workflows.<name>` /
|
|
689
|
+
* `agents.<name>` object, which carries its `WORKFLOW_*`/`AGENT_*` binding and
|
|
690
|
+
* stable name. Structural mirror of `@lunora/scheduler`'s `WorkflowReference` so
|
|
691
|
+
* `ctx.scheduler` can target a workflow/agent without a dependency on
|
|
692
|
+
* `@lunora/scheduler` / `@lunora/workflow`. A scheduled workflow target starts a
|
|
693
|
+
* fresh instance on fire (the args become its `params`).
|
|
694
|
+
*/
|
|
695
|
+
interface SchedulableWorkflowReference {
|
|
696
|
+
/** The `WORKFLOW_*`/`AGENT_*` binding name (present on a generated ref). */
|
|
697
|
+
readonly binding?: string;
|
|
698
|
+
readonly isLunoraWorkflow: true;
|
|
699
|
+
/** The workflow/agent export/stable name (present on a generated ref). */
|
|
700
|
+
readonly name?: string;
|
|
701
|
+
}
|
|
687
702
|
interface Scheduler {
|
|
688
703
|
/** Cancel a pending job by id. `cancelled` is `false` when no such job exists. */
|
|
689
704
|
cancel: (id: string) => Promise<{
|
|
@@ -693,8 +708,15 @@ interface Scheduler {
|
|
|
693
708
|
get: (id: string) => Promise<ScheduledJob | null>;
|
|
694
709
|
/** List all pending scheduled jobs. */
|
|
695
710
|
list: () => Promise<ScheduledJob[]>;
|
|
696
|
-
|
|
697
|
-
|
|
711
|
+
/**
|
|
712
|
+
* Schedule a one-shot run `delayMs` from now. `target` is a function path
|
|
713
|
+
* (`"ns:fn"`) dispatched as a one-shot, or a generated `workflows.<name>` /
|
|
714
|
+
* `agents.<name>` reference which starts a fresh durable instance on fire
|
|
715
|
+
* (the args become its `params`).
|
|
716
|
+
*/
|
|
717
|
+
runAfter: (delayMs: number, target: SchedulableWorkflowReference | string, args?: Record<string, unknown>) => Promise<string>;
|
|
718
|
+
/** Like {@link Scheduler.runAfter} but fires at an absolute epoch-ms timestamp. */
|
|
719
|
+
runAt: (timestampMs: number, target: SchedulableWorkflowReference | string, args?: Record<string, unknown>) => Promise<string>;
|
|
698
720
|
}
|
|
699
721
|
/**
|
|
700
722
|
* A workflow instance's lifecycle status. Clean public mirror of
|
package/dist/types.d.ts
CHANGED
|
@@ -684,6 +684,21 @@ interface ScheduledJob {
|
|
|
684
684
|
/** Routing hint forwarded so dispatch lands on the right shard. */
|
|
685
685
|
shardKey?: string;
|
|
686
686
|
}
|
|
687
|
+
/**
|
|
688
|
+
* A schedulable durable-workflow reference — the generated `workflows.<name>` /
|
|
689
|
+
* `agents.<name>` object, which carries its `WORKFLOW_*`/`AGENT_*` binding and
|
|
690
|
+
* stable name. Structural mirror of `@lunora/scheduler`'s `WorkflowReference` so
|
|
691
|
+
* `ctx.scheduler` can target a workflow/agent without a dependency on
|
|
692
|
+
* `@lunora/scheduler` / `@lunora/workflow`. A scheduled workflow target starts a
|
|
693
|
+
* fresh instance on fire (the args become its `params`).
|
|
694
|
+
*/
|
|
695
|
+
interface SchedulableWorkflowReference {
|
|
696
|
+
/** The `WORKFLOW_*`/`AGENT_*` binding name (present on a generated ref). */
|
|
697
|
+
readonly binding?: string;
|
|
698
|
+
readonly isLunoraWorkflow: true;
|
|
699
|
+
/** The workflow/agent export/stable name (present on a generated ref). */
|
|
700
|
+
readonly name?: string;
|
|
701
|
+
}
|
|
687
702
|
interface Scheduler {
|
|
688
703
|
/** Cancel a pending job by id. `cancelled` is `false` when no such job exists. */
|
|
689
704
|
cancel: (id: string) => Promise<{
|
|
@@ -693,8 +708,15 @@ interface Scheduler {
|
|
|
693
708
|
get: (id: string) => Promise<ScheduledJob | null>;
|
|
694
709
|
/** List all pending scheduled jobs. */
|
|
695
710
|
list: () => Promise<ScheduledJob[]>;
|
|
696
|
-
|
|
697
|
-
|
|
711
|
+
/**
|
|
712
|
+
* Schedule a one-shot run `delayMs` from now. `target` is a function path
|
|
713
|
+
* (`"ns:fn"`) dispatched as a one-shot, or a generated `workflows.<name>` /
|
|
714
|
+
* `agents.<name>` reference which starts a fresh durable instance on fire
|
|
715
|
+
* (the args become its `params`).
|
|
716
|
+
*/
|
|
717
|
+
runAfter: (delayMs: number, target: SchedulableWorkflowReference | string, args?: Record<string, unknown>) => Promise<string>;
|
|
718
|
+
/** Like {@link Scheduler.runAfter} but fires at an absolute epoch-ms timestamp. */
|
|
719
|
+
runAt: (timestampMs: number, target: SchedulableWorkflowReference | string, args?: Record<string, unknown>) => Promise<string>;
|
|
698
720
|
}
|
|
699
721
|
/**
|
|
700
722
|
* A workflow instance's lifecycle status. Clean public mirror of
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/server",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.24",
|
|
4
4
|
"description": "Server primitives for Lunora: defineSchema, defineTable, query, mutation, and action",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"backend",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@lunora/errors": "1.0.0-alpha.4",
|
|
66
|
-
"@lunora/scheduler": "1.0.0-alpha.
|
|
66
|
+
"@lunora/scheduler": "1.0.0-alpha.9",
|
|
67
67
|
"@lunora/values": "1.0.0-alpha.7",
|
|
68
68
|
"drizzle-orm": "^0.45.2",
|
|
69
69
|
"hono": "^4.12.28"
|