runwork 0.17.0 → 0.18.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/LICENSE +3 -3
- package/bundled-types/core-scheduler.d.ts +17 -1
- package/dist/index.js +1241 -356
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Copyright (c) 2025-2026 Runwork All rights reserved.
|
|
1
|
+
Copyright (c) 2025-2026 Runwork, Inc. All rights reserved.
|
|
2
2
|
|
|
3
3
|
This software and associated documentation files (the "Software") are the
|
|
4
|
-
proprietary and confidential property of Runwork
|
|
4
|
+
proprietary and confidential property of Runwork, Inc.
|
|
5
5
|
|
|
6
6
|
No part of the Software may be copied, modified, distributed, sublicensed,
|
|
7
7
|
sold, or otherwise made available to any third party without the prior
|
|
8
|
-
written consent of Runwork
|
|
8
|
+
written consent of Runwork, Inc.
|
|
9
9
|
|
|
10
10
|
You may use the Software solely as a tool to interact with the Runwork
|
|
11
11
|
platform in accordance with the Runwork Terms of Service.
|
|
@@ -44,6 +44,15 @@ export interface JobResult {
|
|
|
44
44
|
/** Additional result data (varies by job) */
|
|
45
45
|
[key: string]: unknown;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Wire-safe schedule definition: what crosses the RPC boundary into
|
|
49
|
+
* SchedulerDO. Deliberately excludes the handler function; over DO RPC a
|
|
50
|
+
* function arrives as a callback stub, and invoking a stubbed handler
|
|
51
|
+
* serializes JobContext back to the calling isolate, where env bindings (R2
|
|
52
|
+
* buckets, DO namespaces) cannot be serialized (AGENTCLI-6). Handlers are
|
|
53
|
+
* bound inside the DO from its own isolate's module registry.
|
|
54
|
+
*/
|
|
55
|
+
export type ScheduledJobDefinition = Omit<ScheduledJob, 'handler'> & Partial<Pick<ScheduledJob, 'handler'>>;
|
|
47
56
|
export interface JobLogger {
|
|
48
57
|
info(message: string, data?: Record<string, unknown>): void;
|
|
49
58
|
warn(message: string, data?: Record<string, unknown>): void;
|
|
@@ -58,6 +67,13 @@ export interface JobRunRecord {
|
|
|
58
67
|
completedAt?: number;
|
|
59
68
|
result?: JobResult;
|
|
60
69
|
error?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Stack trace of the failure. Stored because the error MESSAGE alone made
|
|
72
|
+
* the 2026-07 "Could not serialize object of type ..." production failures
|
|
73
|
+
* undiagnosable: the message names the workerd serializer, not the framework
|
|
74
|
+
* call site that hit it (AGENTCLI-6).
|
|
75
|
+
*/
|
|
76
|
+
errorStack?: string;
|
|
61
77
|
}
|
|
62
78
|
export interface ScheduleState {
|
|
63
79
|
name: string;
|
|
@@ -127,7 +143,7 @@ export declare class SchedulerDO extends DurableObject<Env> {
|
|
|
127
143
|
* Initialize the job scheduler with job definitions.
|
|
128
144
|
* Can be called again after HMR to sync new/changed job definitions.
|
|
129
145
|
*/
|
|
130
|
-
initializeJobScheduler(jobs:
|
|
146
|
+
initializeJobScheduler(jobs: ScheduledJobDefinition[]): Promise<void>;
|
|
131
147
|
/**
|
|
132
148
|
* Handle alarm - execute due jobs
|
|
133
149
|
*/
|