@moku-labs/worker 0.1.2 → 0.1.4

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/cli.cjs CHANGED
@@ -1,9 +1,31 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_storage = require("./storage-BaQ6BBtl.cjs");
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ //#endregion
24
+ const require_storage = require("./storage-CgXl-dUA.cjs");
3
25
  let node_child_process = require("node:child_process");
4
26
  let node_fs_promises = require("node:fs/promises");
5
27
  let node_path = require("node:path");
6
- node_path = require_storage.__toESM(node_path, 1);
28
+ node_path = __toESM(node_path, 1);
7
29
  let node_fs = require("node:fs");
8
30
  //#region src/plugins/deploy/runner.ts
9
31
  /**
@@ -596,6 +618,9 @@ const createDeployApi = (ctx) => ({
596
618
  * generates/updates wrangler config, uploads the R2 upload dir, and runs wrangler deploy.
597
619
  * Also supports a universal path: run({ manifest }) uses a caller-supplied manifest verbatim.
598
620
  *
621
+ * Emits only the global events `deploy:phase`, `deploy:complete`, and `provision:resource`
622
+ * (declared in WorkerEvents — no per-plugin events block).
623
+ *
599
624
  * @see README.md
600
625
  */
601
626
  const deployPlugin = require_storage.createPlugin("deploy", {
package/dist/cli.d.cts CHANGED
@@ -120,6 +120,9 @@ type ExternalManifest = {
120
120
  * generates/updates wrangler config, uploads the R2 upload dir, and runs wrangler deploy.
121
121
  * Also supports a universal path: run({ manifest }) uses a caller-supplied manifest verbatim.
122
122
  *
123
+ * Emits only the global events `deploy:phase`, `deploy:complete`, and `provision:resource`
124
+ * (declared in WorkerEvents — no per-plugin events block).
125
+ *
123
126
  * @see README.md
124
127
  */
125
128
  declare const deployPlugin: import("@moku-labs/core").PluginInstance<"deploy", Config, Record<string, never>, {
package/dist/cli.d.mts CHANGED
@@ -120,6 +120,9 @@ type ExternalManifest = {
120
120
  * generates/updates wrangler config, uploads the R2 upload dir, and runs wrangler deploy.
121
121
  * Also supports a universal path: run({ manifest }) uses a caller-supplied manifest verbatim.
122
122
  *
123
+ * Emits only the global events `deploy:phase`, `deploy:complete`, and `provision:resource`
124
+ * (declared in WorkerEvents — no per-plugin events block).
125
+ *
123
126
  * @see README.md
124
127
  */
125
128
  declare const deployPlugin: import("@moku-labs/core").PluginInstance<"deploy", Config, Record<string, never>, {
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as durableObjectsPlugin, n as queuesPlugin, o as d1Plugin, r as kvPlugin, t as storagePlugin, u as createPlugin } from "./storage-bL-U_fkA.mjs";
1
+ import { i as durableObjectsPlugin, n as queuesPlugin, o as d1Plugin, r as kvPlugin, t as storagePlugin, u as createPlugin } from "./storage-COo-F38H.mjs";
2
2
  import { spawn } from "node:child_process";
3
3
  import { readdir, stat, writeFile } from "node:fs/promises";
4
4
  import path from "node:path";
@@ -594,6 +594,9 @@ const createDeployApi = (ctx) => ({
594
594
  * generates/updates wrangler config, uploads the R2 upload dir, and runs wrangler deploy.
595
595
  * Also supports a universal path: run({ manifest }) uses a caller-supplied manifest verbatim.
596
596
  *
597
+ * Emits only the global events `deploy:phase`, `deploy:complete`, and `provision:resource`
598
+ * (declared in WorkerEvents — no per-plugin events block).
599
+ *
597
600
  * @see README.md
598
601
  */
599
602
  const deployPlugin = createPlugin("deploy", {
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_storage = require("./storage-BaQ6BBtl.cjs");
2
+ const require_storage = require("./storage-CgXl-dUA.cjs");
3
3
  let _moku_labs_common = require("@moku-labs/common");
4
4
  //#region src/plugins/server/api.ts
5
5
  /**
@@ -471,53 +471,8 @@ const serverPlugin = require_storage.createPlugin("server", {
471
471
  },
472
472
  helpers: { endpoint }
473
473
  });
474
- //#endregion
475
- //#region src/plugins/d1/types.ts
476
- var types_exports = /* @__PURE__ */ require_storage.__exportAll({});
477
- //#endregion
478
- //#region src/plugins/durable-objects/types.ts
479
- var types_exports$1 = /* @__PURE__ */ require_storage.__exportAll({});
480
- //#endregion
481
- //#region src/plugins/queues/types.ts
482
- var types_exports$2 = /* @__PURE__ */ require_storage.__exportAll({});
483
- //#endregion
484
- //#region src/plugins/server/types.ts
485
- var types_exports$3 = /* @__PURE__ */ require_storage.__exportAll({});
486
- //#endregion
487
- //#region src/plugins/storage/types.ts
488
- var types_exports$4 = /* @__PURE__ */ require_storage.__exportAll({});
489
474
  const { createApp, createPlugin } = require_storage.createCore(require_storage.coreConfig, { plugins: [require_storage.bindingsPlugin, serverPlugin] });
490
475
  //#endregion
491
- Object.defineProperty(exports, "D1", {
492
- enumerable: true,
493
- get: function() {
494
- return types_exports;
495
- }
496
- });
497
- Object.defineProperty(exports, "DurableObjects", {
498
- enumerable: true,
499
- get: function() {
500
- return types_exports$1;
501
- }
502
- });
503
- Object.defineProperty(exports, "Queues", {
504
- enumerable: true,
505
- get: function() {
506
- return types_exports$2;
507
- }
508
- });
509
- Object.defineProperty(exports, "Server", {
510
- enumerable: true,
511
- get: function() {
512
- return types_exports$3;
513
- }
514
- });
515
- Object.defineProperty(exports, "Storage", {
516
- enumerable: true,
517
- get: function() {
518
- return types_exports$4;
519
- }
520
- });
521
476
  exports.bindingsPlugin = require_storage.bindingsPlugin;
522
477
  exports.createApp = createApp;
523
478
  exports.createPlugin = createPlugin;
package/dist/index.d.cts CHANGED
@@ -3,8 +3,9 @@ import { PluginCtx, PluginInstance } from "@moku-labs/core";
3
3
  import { envPlugin, logPlugin } from "@moku-labs/common";
4
4
 
5
5
  //#region \0rolldown/runtime.js
6
- //#endregion
7
- //#region src/plugins/bindings/index.d.ts
6
+ declare namespace types_d_exports {
7
+ export { BindingsApi, Config$4 as Config, Context };
8
+ }
8
9
  /**
9
10
  * bindings config. Flat (spec/05 §3,§6) — a complete default so omission
10
11
  * never yields undefined.
@@ -46,7 +47,14 @@ type BindingsApi = {
46
47
  has(env: WorkerEnv, name: string): boolean;
47
48
  };
48
49
  /**
49
- * Micro-tier stateless resolverthe binding-family dependency root.
50
+ * api-factory context. State slot is Record<string, never> bindings holds NO
51
+ * state (F4). Type-argument order is PluginCtx<Config, State, Events>.
52
+ */
53
+ type Context = PluginCtx<Config$4, Record<string, never>, WorkerEvents>;
54
+ //#endregion
55
+ //#region src/plugins/bindings/index.d.ts
56
+ /**
57
+ * Standard-tier stateless resolver — the binding-family dependency root.
50
58
  *
51
59
  * Exposes `require<T>(env, name)` and `has(env, name)` off a per-request env
52
60
  * object. Regular plugin so downstream binding plugins can declare
@@ -55,7 +63,7 @@ type BindingsApi = {
55
63
  * @see README.md
56
64
  */
57
65
  declare const bindingsPlugin: import("@moku-labs/core").PluginInstance<"bindings", Config$4, Record<string, never>, BindingsApi, {}> & Record<never, never>;
58
- declare namespace types_d_exports$3 {
66
+ declare namespace types_d_exports$4 {
59
67
  export { Api$3 as Api, CompiledEndpoint, Endpoint, EndpointHandler, MatchResult, Method, PathSegment, RequestContext, RequireFn, ServerConfig, ServerCtx, ServerEvents, ServerState };
60
68
  }
61
69
  /** HTTP method an endpoint matches; "ALL" matches any verb. */
@@ -279,7 +287,7 @@ type EndpointBuilder = {
279
287
  * ```
280
288
  */
281
289
  declare const endpoint: (path: string) => EndpointBuilder;
282
- declare namespace types_d_exports {
290
+ declare namespace types_d_exports$1 {
283
291
  export { Api$2 as Api, Config$3 as Config, D1Ctx, DeployManifest$2 as DeployManifest };
284
292
  }
285
293
  /**
@@ -390,7 +398,7 @@ declare const d1Plugin: import("@moku-labs/core").PluginInstance<"d1", Config$3,
390
398
  prepare: (env: WorkerEnv) => D1Database;
391
399
  deployManifest: () => DeployManifest$2;
392
400
  }, {}> & Record<never, never>;
393
- declare namespace types_d_exports$1 {
401
+ declare namespace types_d_exports$2 {
394
402
  export { Api$1 as Api, Config$2 as Config, Ctx$1 as Ctx, DeployManifest$1 as DeployManifest };
395
403
  }
396
404
  /**
@@ -434,8 +442,19 @@ type Api$1 = {
434
442
  */
435
443
  deployManifest(): DeployManifest$1;
436
444
  };
437
- /** Internal context type — own config first, no state, no DO events. */
438
- type Ctx$1 = PluginCtx<Config$2, Record<string, never>, WorkerEvents>;
445
+ /**
446
+ * Internal context type own config first, no state, no DO events.
447
+ * Intersected with a narrow `require` typed to the one dependency durableObjects resolves.
448
+ */
449
+ type Ctx$1 = PluginCtx<Config$2, Record<string, never>, WorkerEvents> & {
450
+ /**
451
+ * Resolve a dependency plugin's api. durableObjects only ever resolves `bindingsPlugin`.
452
+ *
453
+ * @param plugin - The bindingsPlugin instance.
454
+ * @returns The resolved bindings api.
455
+ */
456
+ require(plugin: typeof bindingsPlugin): BindingsApi;
457
+ };
439
458
  //#endregion
440
459
  //#region src/plugins/durable-objects/helpers.d.ts
441
460
  /**
@@ -594,7 +613,7 @@ type KvApi = {
594
613
  declare const kvPlugin: import("@moku-labs/core").PluginInstance<"kv", {
595
614
  binding: string;
596
615
  }, Record<string, never>, KvApi, {}> & Record<never, never>;
597
- declare namespace types_d_exports$2 {
616
+ declare namespace types_d_exports$3 {
598
617
  export { Api, Config$1 as Config, Ctx, DeployManifest, QueueEvents };
599
618
  }
600
619
  /**
@@ -683,6 +702,8 @@ type Ctx = PluginCtx<Config$1, Record<string, never>, WorkerEvents & QueueEvents
683
702
  * `events` is declared first and via `register.map<QueueEvents>` so the plugin's own events infer
684
703
  * into the factory context; the api wiring is therefore arrow-wrapped (contextually typed).
685
704
  *
705
+ * Emits the plugin-local `queue:message` event after each consumed message.
706
+ *
686
707
  * @see README.md
687
708
  */
688
709
  declare const queuesPlugin: import("@moku-labs/core").PluginInstance<"queues", Config$1, Record<string, never>, {
@@ -741,7 +762,7 @@ type StorageProvider = {
741
762
  delete(key: string | string[]): Promise<void>; /** List objects. */
742
763
  list(opts?: R2ListOptions): Promise<R2Objects>;
743
764
  };
744
- declare namespace types_d_exports$4 {
765
+ declare namespace types_d_exports$5 {
745
766
  export { StorageApi, StorageConfig, StorageCtx, StorageManifest, StorageProvider };
746
767
  }
747
768
  /**
@@ -960,4 +981,4 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
960
981
  current: () => "production" | "development" | "test";
961
982
  }>]>>;
962
983
  //#endregion
963
- export { types_d_exports as D1, types_d_exports$1 as DurableObjects, types_d_exports$2 as Queues, types_d_exports$3 as Server, type StageApi, types_d_exports$4 as Storage, type WorkerConfig, type WorkerEnv, type WorkerEvents, bindingsPlugin, createApp, createPlugin, d1Plugin, defineDurableObject, durableObjectsPlugin, endpoint, envPlugin, kvPlugin, logPlugin, queuesPlugin, serverPlugin, stagePlugin, storagePlugin };
984
+ export { type types_d_exports as Bindings, type types_d_exports$1 as D1, type types_d_exports$2 as DurableObjects, type types_d_exports$3 as Queues, type types_d_exports$4 as Server, type StageApi, type types_d_exports$5 as Storage, type WorkerConfig, type WorkerEnv, type WorkerEvents, bindingsPlugin, createApp, createPlugin, d1Plugin, defineDurableObject, durableObjectsPlugin, endpoint, envPlugin, kvPlugin, logPlugin, queuesPlugin, serverPlugin, stagePlugin, storagePlugin };
package/dist/index.d.mts CHANGED
@@ -2,7 +2,10 @@ import { n as WorkerEnv, r as WorkerEvents, t as WorkerConfig } from "./config-A
2
2
  import { envPlugin, logPlugin } from "@moku-labs/common";
3
3
  import { PluginCtx, PluginInstance } from "@moku-labs/core";
4
4
 
5
- //#region src/plugins/bindings/index.d.ts
5
+ //#region \0rolldown/runtime.js
6
+ declare namespace types_d_exports {
7
+ export { BindingsApi, Config$4 as Config, Context };
8
+ }
6
9
  /**
7
10
  * bindings config. Flat (spec/05 §3,§6) — a complete default so omission
8
11
  * never yields undefined.
@@ -44,7 +47,14 @@ type BindingsApi = {
44
47
  has(env: WorkerEnv, name: string): boolean;
45
48
  };
46
49
  /**
47
- * Micro-tier stateless resolverthe binding-family dependency root.
50
+ * api-factory context. State slot is Record<string, never> bindings holds NO
51
+ * state (F4). Type-argument order is PluginCtx<Config, State, Events>.
52
+ */
53
+ type Context = PluginCtx<Config$4, Record<string, never>, WorkerEvents>;
54
+ //#endregion
55
+ //#region src/plugins/bindings/index.d.ts
56
+ /**
57
+ * Standard-tier stateless resolver — the binding-family dependency root.
48
58
  *
49
59
  * Exposes `require<T>(env, name)` and `has(env, name)` off a per-request env
50
60
  * object. Regular plugin so downstream binding plugins can declare
@@ -53,7 +63,7 @@ type BindingsApi = {
53
63
  * @see README.md
54
64
  */
55
65
  declare const bindingsPlugin: import("@moku-labs/core").PluginInstance<"bindings", Config$4, Record<string, never>, BindingsApi, {}> & Record<never, never>;
56
- declare namespace types_d_exports$3 {
66
+ declare namespace types_d_exports$4 {
57
67
  export { Api$3 as Api, CompiledEndpoint, Endpoint, EndpointHandler, MatchResult, Method, PathSegment, RequestContext, RequireFn, ServerConfig, ServerCtx, ServerEvents, ServerState };
58
68
  }
59
69
  /** HTTP method an endpoint matches; "ALL" matches any verb. */
@@ -277,7 +287,7 @@ type EndpointBuilder = {
277
287
  * ```
278
288
  */
279
289
  declare const endpoint: (path: string) => EndpointBuilder;
280
- declare namespace types_d_exports {
290
+ declare namespace types_d_exports$1 {
281
291
  export { Api$2 as Api, Config$3 as Config, D1Ctx, DeployManifest$2 as DeployManifest };
282
292
  }
283
293
  /**
@@ -388,7 +398,7 @@ declare const d1Plugin: import("@moku-labs/core").PluginInstance<"d1", Config$3,
388
398
  prepare: (env: WorkerEnv) => D1Database;
389
399
  deployManifest: () => DeployManifest$2;
390
400
  }, {}> & Record<never, never>;
391
- declare namespace types_d_exports$1 {
401
+ declare namespace types_d_exports$2 {
392
402
  export { Api$1 as Api, Config$2 as Config, Ctx$1 as Ctx, DeployManifest$1 as DeployManifest };
393
403
  }
394
404
  /**
@@ -432,8 +442,19 @@ type Api$1 = {
432
442
  */
433
443
  deployManifest(): DeployManifest$1;
434
444
  };
435
- /** Internal context type — own config first, no state, no DO events. */
436
- type Ctx$1 = PluginCtx<Config$2, Record<string, never>, WorkerEvents>;
445
+ /**
446
+ * Internal context type own config first, no state, no DO events.
447
+ * Intersected with a narrow `require` typed to the one dependency durableObjects resolves.
448
+ */
449
+ type Ctx$1 = PluginCtx<Config$2, Record<string, never>, WorkerEvents> & {
450
+ /**
451
+ * Resolve a dependency plugin's api. durableObjects only ever resolves `bindingsPlugin`.
452
+ *
453
+ * @param plugin - The bindingsPlugin instance.
454
+ * @returns The resolved bindings api.
455
+ */
456
+ require(plugin: typeof bindingsPlugin): BindingsApi;
457
+ };
437
458
  //#endregion
438
459
  //#region src/plugins/durable-objects/helpers.d.ts
439
460
  /**
@@ -592,7 +613,7 @@ type KvApi = {
592
613
  declare const kvPlugin: import("@moku-labs/core").PluginInstance<"kv", {
593
614
  binding: string;
594
615
  }, Record<string, never>, KvApi, {}> & Record<never, never>;
595
- declare namespace types_d_exports$2 {
616
+ declare namespace types_d_exports$3 {
596
617
  export { Api, Config$1 as Config, Ctx, DeployManifest, QueueEvents };
597
618
  }
598
619
  /**
@@ -681,6 +702,8 @@ type Ctx = PluginCtx<Config$1, Record<string, never>, WorkerEvents & QueueEvents
681
702
  * `events` is declared first and via `register.map<QueueEvents>` so the plugin's own events infer
682
703
  * into the factory context; the api wiring is therefore arrow-wrapped (contextually typed).
683
704
  *
705
+ * Emits the plugin-local `queue:message` event after each consumed message.
706
+ *
684
707
  * @see README.md
685
708
  */
686
709
  declare const queuesPlugin: import("@moku-labs/core").PluginInstance<"queues", Config$1, Record<string, never>, {
@@ -739,7 +762,7 @@ type StorageProvider = {
739
762
  delete(key: string | string[]): Promise<void>; /** List objects. */
740
763
  list(opts?: R2ListOptions): Promise<R2Objects>;
741
764
  };
742
- declare namespace types_d_exports$4 {
765
+ declare namespace types_d_exports$5 {
743
766
  export { StorageApi, StorageConfig, StorageCtx, StorageManifest, StorageProvider };
744
767
  }
745
768
  /**
@@ -958,4 +981,4 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
958
981
  current: () => "production" | "development" | "test";
959
982
  }>]>>;
960
983
  //#endregion
961
- export { types_d_exports as D1, types_d_exports$1 as DurableObjects, types_d_exports$2 as Queues, types_d_exports$3 as Server, type StageApi, types_d_exports$4 as Storage, type WorkerConfig, type WorkerEnv, type WorkerEvents, bindingsPlugin, createApp, createPlugin, d1Plugin, defineDurableObject, durableObjectsPlugin, endpoint, envPlugin, kvPlugin, logPlugin, queuesPlugin, serverPlugin, stagePlugin, storagePlugin };
984
+ export { type types_d_exports as Bindings, type types_d_exports$1 as D1, type types_d_exports$2 as DurableObjects, type types_d_exports$3 as Queues, type types_d_exports$4 as Server, type StageApi, type types_d_exports$5 as Storage, type WorkerConfig, type WorkerEnv, type WorkerEvents, bindingsPlugin, createApp, createPlugin, d1Plugin, defineDurableObject, durableObjectsPlugin, endpoint, envPlugin, kvPlugin, logPlugin, queuesPlugin, serverPlugin, stagePlugin, storagePlugin };
package/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { a as defineDurableObject, c as coreConfig, d as stagePlugin, i as durableObjectsPlugin, l as createCore, n as queuesPlugin, o as d1Plugin, r as kvPlugin, s as bindingsPlugin, t as storagePlugin, u as createPlugin$1 } from "./storage-bL-U_fkA.mjs";
1
+ import { a as defineDurableObject, c as coreConfig, d as stagePlugin, i as durableObjectsPlugin, l as createCore, n as queuesPlugin, o as d1Plugin, r as kvPlugin, s as bindingsPlugin, t as storagePlugin, u as createPlugin$1 } from "./storage-COo-F38H.mjs";
3
2
  import { envPlugin, logPlugin } from "@moku-labs/common";
4
3
  //#region src/plugins/server/api.ts
5
4
  /**
@@ -471,21 +470,6 @@ const serverPlugin = createPlugin$1("server", {
471
470
  },
472
471
  helpers: { endpoint }
473
472
  });
474
- //#endregion
475
- //#region src/plugins/d1/types.ts
476
- var types_exports = /* @__PURE__ */ __exportAll({});
477
- //#endregion
478
- //#region src/plugins/durable-objects/types.ts
479
- var types_exports$1 = /* @__PURE__ */ __exportAll({});
480
- //#endregion
481
- //#region src/plugins/queues/types.ts
482
- var types_exports$2 = /* @__PURE__ */ __exportAll({});
483
- //#endregion
484
- //#region src/plugins/server/types.ts
485
- var types_exports$3 = /* @__PURE__ */ __exportAll({});
486
- //#endregion
487
- //#region src/plugins/storage/types.ts
488
- var types_exports$4 = /* @__PURE__ */ __exportAll({});
489
473
  const { createApp, createPlugin } = createCore(coreConfig, { plugins: [bindingsPlugin, serverPlugin] });
490
474
  //#endregion
491
- export { types_exports as D1, types_exports$1 as DurableObjects, types_exports$2 as Queues, types_exports$3 as Server, types_exports$4 as Storage, bindingsPlugin, createApp, createPlugin, d1Plugin, defineDurableObject, durableObjectsPlugin, endpoint, envPlugin, kvPlugin, logPlugin, queuesPlugin, serverPlugin, stagePlugin, storagePlugin };
475
+ export { bindingsPlugin, createApp, createPlugin, d1Plugin, defineDurableObject, durableObjectsPlugin, endpoint, envPlugin, kvPlugin, logPlugin, queuesPlugin, serverPlugin, stagePlugin, storagePlugin };
@@ -77,7 +77,7 @@ const coreConfig = createCoreConfig("moku-worker", {
77
77
  });
78
78
  const { createPlugin, createCore } = coreConfig;
79
79
  //#endregion
80
- //#region src/plugins/bindings/index.ts
80
+ //#region src/plugins/bindings/api.ts
81
81
  /**
82
82
  * Checks whether a value read from an env object is nullish (null or undefined).
83
83
  * Cloudflare supplies either form when a binding is absent, so both must be caught.
@@ -140,7 +140,7 @@ const createBindingsApi = (_ctx) => ({
140
140
  has: hasBinding
141
141
  });
142
142
  /**
143
- * Micro-tier stateless resolver — the binding-family dependency root.
143
+ * Standard-tier stateless resolver — the binding-family dependency root.
144
144
  *
145
145
  * Exposes `require<T>(env, name)` and `has(env, name)` off a per-request env
146
146
  * object. Regular plugin so downstream binding plugins can declare
@@ -661,6 +661,8 @@ const createQueuesApi = (ctx) => {
661
661
  * `events` is declared first and via `register.map<QueueEvents>` so the plugin's own events infer
662
662
  * into the factory context; the api wiring is therefore arrow-wrapped (contextually typed).
663
663
  *
664
+ * Emits the plugin-local `queue:message` event after each consumed message.
665
+ *
664
666
  * @see README.md
665
667
  */
666
668
  const queuesPlugin = createPlugin("queues", {
@@ -1,34 +1,3 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __exportAll = (all, no_symbols) => {
9
- let target = {};
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
14
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
- return target;
16
- };
17
- var __copyProps = (to, from, except, desc) => {
18
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
- key = keys[i];
20
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
21
- get: ((k) => from[k]).bind(null, key),
22
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23
- });
24
- }
25
- return to;
26
- };
27
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
30
- }) : target, mod));
31
- //#endregion
32
1
  let _moku_labs_common = require("@moku-labs/common");
33
2
  let _moku_labs_core = require("@moku-labs/core");
34
3
  /**
@@ -108,7 +77,7 @@ const coreConfig = (0, _moku_labs_core.createCoreConfig)("moku-worker", {
108
77
  });
109
78
  const { createPlugin, createCore } = coreConfig;
110
79
  //#endregion
111
- //#region src/plugins/bindings/index.ts
80
+ //#region src/plugins/bindings/api.ts
112
81
  /**
113
82
  * Checks whether a value read from an env object is nullish (null or undefined).
114
83
  * Cloudflare supplies either form when a binding is absent, so both must be caught.
@@ -171,7 +140,7 @@ const createBindingsApi = (_ctx) => ({
171
140
  has: hasBinding
172
141
  });
173
142
  /**
174
- * Micro-tier stateless resolver — the binding-family dependency root.
143
+ * Standard-tier stateless resolver — the binding-family dependency root.
175
144
  *
176
145
  * Exposes `require<T>(env, name)` and `has(env, name)` off a per-request env
177
146
  * object. Regular plugin so downstream binding plugins can declare
@@ -692,6 +661,8 @@ const createQueuesApi = (ctx) => {
692
661
  * `events` is declared first and via `register.map<QueueEvents>` so the plugin's own events infer
693
662
  * into the factory context; the api wiring is therefore arrow-wrapped (contextually typed).
694
663
  *
664
+ * Emits the plugin-local `queue:message` event after each consumed message.
665
+ *
695
666
  * @see README.md
696
667
  */
697
668
  const queuesPlugin = createPlugin("queues", {
@@ -910,18 +881,6 @@ const storagePlugin = createPlugin("storage", {
910
881
  api: createStorageApi
911
882
  });
912
883
  //#endregion
913
- Object.defineProperty(exports, "__exportAll", {
914
- enumerable: true,
915
- get: function() {
916
- return __exportAll;
917
- }
918
- });
919
- Object.defineProperty(exports, "__toESM", {
920
- enumerable: true,
921
- get: function() {
922
- return __toESM;
923
- }
924
- });
925
884
  Object.defineProperty(exports, "bindingsPlugin", {
926
885
  enumerable: true,
927
886
  get: function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/worker",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Cloudflare Worker framework for Moku — Durable Objects, Queues, R2, D1, and KV plugins that compose with Moku Web.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,13 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __exportAll = (all, no_symbols) => {
4
- let target = {};
5
- for (var name in all) __defProp(target, name, {
6
- get: all[name],
7
- enumerable: true
8
- });
9
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
- return target;
11
- };
12
- //#endregion
13
- export { __exportAll as t };