@hoox-sh/hoox-shared 1.2.1 → 1.4.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.
Files changed (67) hide show
  1. package/dist/agent-config-fields.js +2 -0
  2. package/dist/d1/index.js +4 -2
  3. package/dist/d1/repository.js +4 -2
  4. package/dist/errors.d.ts.map +1 -1
  5. package/dist/errors.js +4 -2
  6. package/dist/health.js +4 -2
  7. package/dist/index.d.ts +5 -5
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +432 -139
  10. package/dist/kill-switch.js +2 -0
  11. package/dist/kvKeys.d.ts +3 -0
  12. package/dist/kvKeys.d.ts.map +1 -1
  13. package/dist/kvKeys.js +3 -0
  14. package/dist/kvUtils.d.ts +34 -1
  15. package/dist/kvUtils.d.ts.map +1 -1
  16. package/dist/kvUtils.js +56 -3
  17. package/dist/middleware/auth.d.ts +6 -3
  18. package/dist/middleware/auth.d.ts.map +1 -1
  19. package/dist/middleware/auth.js +19 -5
  20. package/dist/middleware/index.d.ts +3 -2
  21. package/dist/middleware/index.d.ts.map +1 -1
  22. package/dist/middleware/index.js +88 -8
  23. package/dist/middleware/logger.js +4 -2
  24. package/dist/middleware/validate.d.ts +16 -0
  25. package/dist/middleware/validate.d.ts.map +1 -1
  26. package/dist/middleware/validate.js +37 -1
  27. package/dist/middleware/wait-until.d.ts +32 -0
  28. package/dist/middleware/wait-until.d.ts.map +1 -0
  29. package/dist/middleware/wait-until.js +46 -0
  30. package/dist/path-utils.d.ts +35 -4
  31. package/dist/path-utils.d.ts.map +1 -1
  32. package/dist/path-utils.js +72 -5
  33. package/dist/queue-handler.d.ts +6 -0
  34. package/dist/queue-handler.d.ts.map +1 -1
  35. package/dist/queue-handler.js +51 -20
  36. package/dist/router.d.ts.map +1 -1
  37. package/dist/router.js +12 -2
  38. package/dist/schemas/index.d.ts +2 -1
  39. package/dist/schemas/index.d.ts.map +1 -1
  40. package/dist/schemas/index.js +58 -13
  41. package/dist/schemas/registry.d.ts +13 -0
  42. package/dist/schemas/registry.d.ts.map +1 -1
  43. package/dist/schemas/registry.js +55 -12
  44. package/dist/schemas/types.d.ts +5 -0
  45. package/dist/schemas/types.d.ts.map +1 -1
  46. package/dist/schemas/validators.d.ts.map +1 -1
  47. package/dist/schemas/validators.js +3 -1
  48. package/dist/service-bindings.js +18 -5
  49. package/dist/session.js +69 -5
  50. package/dist/stores/config-store.d.ts +2 -0
  51. package/dist/stores/config-store.d.ts.map +1 -1
  52. package/dist/stores/config-store.js +267 -16
  53. package/dist/stores/service-store.d.ts +12 -0
  54. package/dist/stores/service-store.d.ts.map +1 -1
  55. package/dist/stores/service-store.js +101 -40
  56. package/dist/stores/ui-store.d.ts +14 -0
  57. package/dist/stores/ui-store.d.ts.map +1 -1
  58. package/dist/stores/ui-store.js +8 -1
  59. package/dist/types.d.ts +22 -4
  60. package/dist/types.d.ts.map +1 -1
  61. package/dist/types.js +8 -4
  62. package/dist/wizard/engine.d.ts.map +1 -1
  63. package/dist/wizard/engine.js +18 -35
  64. package/dist/wizard/index.js +18 -35
  65. package/dist/wizard/presets.d.ts.map +1 -1
  66. package/dist/wizard/presets.js +6 -32
  67. package/package.json +1 -1
@@ -0,0 +1,46 @@
1
+ // @bun
2
+ var __defProp = Object.defineProperty;
3
+ var __returnValue = (v) => v;
4
+ function __exportSetter(name, newValue) {
5
+ this[name] = __returnValue.bind(null, newValue);
6
+ }
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true,
12
+ configurable: true,
13
+ set: __exportSetter.bind(all, name)
14
+ });
15
+ };
16
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
+
18
+ // src/middleware/wait-until.ts
19
+ function safeWaitUntil(ctx, promise, onError) {
20
+ ctx.waitUntil(promise.catch((err) => {
21
+ onError?.(err);
22
+ console.error(JSON.stringify({
23
+ message: "waitUntil background task failed",
24
+ error: err instanceof Error ? err.message : String(err)
25
+ }));
26
+ }));
27
+ }
28
+ function waitUntilAll(ctx, promises, onError) {
29
+ if (promises.length === 0)
30
+ return;
31
+ safeWaitUntil(ctx, Promise.allSettled(promises).then((results) => {
32
+ for (const result of results) {
33
+ if (result.status === "rejected") {
34
+ onError?.(result.reason);
35
+ console.error(JSON.stringify({
36
+ message: "waitUntilAll background task failed",
37
+ error: result.reason instanceof Error ? result.reason.message : String(result.reason)
38
+ }));
39
+ }
40
+ }
41
+ }), onError);
42
+ }
43
+ export {
44
+ waitUntilAll,
45
+ safeWaitUntil
46
+ };
@@ -10,7 +10,7 @@ export type HooxPath = string & {
10
10
  readonly __brand: "HooxPath";
11
11
  };
12
12
  /** Where resolveHooxRuntimeRoot found (or failed to find) a setup monorepo. */
13
- export type RuntimeRootSource = "env" | "cwd" | "global" | "none";
13
+ export type RuntimeRootSource = "env" | "cwd" | "remembered" | "global" | "none";
14
14
  /** Result of resolveHooxRuntimeRoot(). */
15
15
  export interface RuntimeRootResult {
16
16
  /** Absolute monorepo root, or null if none found. */
@@ -21,9 +21,17 @@ export interface RuntimeRootResult {
21
21
  checked: {
22
22
  env?: string;
23
23
  cwd: string | null;
24
+ remembered?: string | null;
24
25
  global: string;
25
26
  };
26
27
  }
28
+ /** Persisted monorepo pointer written when the CLI discovers a checkout. */
29
+ export interface RememberedMonorepo {
30
+ /** Absolute path to monorepo root. */
31
+ root: string;
32
+ /** ISO timestamp of last successful remember. */
33
+ updatedAt: string;
34
+ }
27
35
  /**
28
36
  * Gets the Hoox home directory location: $HOME/.hoox
29
37
  *
@@ -48,9 +56,29 @@ export declare function getHooxHome(): HooxPath;
48
56
  /**
49
57
  * True when `dir` looks like a hoox monorepo root.
50
58
  *
51
- * Markers match CLI verifyRepoRoot: root wrangler.jsonc + packages/cli package.
59
+ * Aligns with CLI `verifyRepoRoot`:
60
+ * - Required: `packages/cli/package.json`
61
+ * - Plus one of: `wrangler.jsonc`, `wrangler.jsonc.example`, `workers/`, `.gitmodules`
62
+ *
63
+ * (`wrangler.jsonc` is gitignored and created by init — fresh clones only
64
+ * ship `wrangler.jsonc.example`.)
52
65
  */
53
66
  export declare function isHooxSetupRoot(dir: string): boolean;
67
+ /**
68
+ * Path to the remembered monorepo pointer file.
69
+ * `$HOOX_HOME/config/monorepo.json` (default `~/.hoox/config/monorepo.json`).
70
+ */
71
+ export declare function getRememberedMonorepoPath(): HooxPath;
72
+ /**
73
+ * Read the last monorepo path the CLI discovered (if still valid).
74
+ * Returns null when missing, unreadable, or no longer a setup root.
75
+ */
76
+ export declare function getRememberedMonorepoRoot(): string | null;
77
+ /**
78
+ * Persist a monorepo root for future CLI invocations from any cwd.
79
+ * No-op when path is not a valid setup root.
80
+ */
81
+ export declare function rememberMonorepoRoot(root: string): boolean;
54
82
  /**
55
83
  * Walk up from `startDir` looking for a hoox monorepo root.
56
84
  *
@@ -63,14 +91,17 @@ export declare function findHooxSetupRoot(startDir?: string): string | null;
63
91
  * Order:
64
92
  * 1. HOOX_REPO — must pass isHooxSetupRoot or result is source "env" with root null
65
93
  * 2. Walk up from cwd
66
- * 3. getHooxRepoPath() ($HOME/.hoox/repo or $HOOX_HOME/repo)
94
+ * 3. Remembered monorepo (~/.hoox/config/monorepo.json) — last discovered checkout
95
+ * 4. getHooxRepoPath() ($HOME/.hoox/repo or $HOOX_HOME/repo)
67
96
  *
68
97
  * Project cwd and tool root are intentionally separate: a random project
69
- * directory can still use the global runtime for TUI / templates.
98
+ * directory can still use a remembered or global monorepo for CLI ops.
70
99
  */
71
100
  export declare function resolveHooxRuntimeRoot(options?: {
72
101
  cwd?: string;
73
102
  env?: NodeJS.ProcessEnv;
103
+ /** Skip reading remembered path (tests). Default false. */
104
+ skipRemembered?: boolean;
74
105
  }): RuntimeRootResult;
75
106
  /**
76
107
  * Candidate TUI entry files under a monorepo root (source first, then dist).
@@ -1 +1 @@
1
- {"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":"AAAA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;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,QAAQ,CAE9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,QAAQ,CAE3C"}
@@ -16,7 +16,13 @@ var __export = (target, all) => {
16
16
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
17
 
18
18
  // src/path-utils.ts
19
- import { existsSync } from "fs";
19
+ import {
20
+ existsSync,
21
+ mkdirSync,
22
+ readFileSync,
23
+ writeFileSync,
24
+ chmodSync
25
+ } from "fs";
20
26
  import { homedir } from "os";
21
27
  import { dirname, join, resolve } from "path";
22
28
  function createHooxPath(path) {
@@ -42,7 +48,55 @@ function isHooxSetupRoot(dir) {
42
48
  return false;
43
49
  try {
44
50
  const root = resolve(dir);
45
- return existsSync(join(root, "wrangler.jsonc")) && existsSync(join(root, "packages", "cli", "package.json"));
51
+ if (!existsSync(join(root, "packages", "cli", "package.json"))) {
52
+ return false;
53
+ }
54
+ return existsSync(join(root, "wrangler.jsonc")) || existsSync(join(root, "wrangler.jsonc.example")) || existsSync(join(root, "workers")) || existsSync(join(root, ".gitmodules"));
55
+ } catch {
56
+ return false;
57
+ }
58
+ }
59
+ function getRememberedMonorepoPath() {
60
+ return resolveHooxPath("config/monorepo.json");
61
+ }
62
+ function getRememberedMonorepoRoot() {
63
+ try {
64
+ const path = getRememberedMonorepoPath();
65
+ if (!existsSync(path))
66
+ return null;
67
+ const raw = readFileSync(path, "utf-8");
68
+ const data = JSON.parse(raw);
69
+ if (!data.root || typeof data.root !== "string")
70
+ return null;
71
+ const resolved = resolve(data.root);
72
+ return isHooxSetupRoot(resolved) ? resolved : null;
73
+ } catch {
74
+ return null;
75
+ }
76
+ }
77
+ function rememberMonorepoRoot(root) {
78
+ try {
79
+ const resolved = resolve(root);
80
+ if (!isHooxSetupRoot(resolved))
81
+ return false;
82
+ const configDir = getHooxConfigDir();
83
+ mkdirSync(configDir, { recursive: true, mode: 448 });
84
+ try {
85
+ chmodSync(configDir, 448);
86
+ } catch {}
87
+ const payload = {
88
+ root: resolved,
89
+ updatedAt: new Date().toISOString()
90
+ };
91
+ const path = getRememberedMonorepoPath();
92
+ writeFileSync(path, JSON.stringify(payload, null, 2) + `
93
+ `, {
94
+ mode: 384
95
+ });
96
+ try {
97
+ chmodSync(path, 384);
98
+ } catch {}
99
+ return true;
46
100
  } catch {
47
101
  return false;
48
102
  }
@@ -62,6 +116,7 @@ function resolveHooxRuntimeRoot(options) {
62
116
  const env = options?.env ?? process.env;
63
117
  const cwd = resolve(options?.cwd ?? process.cwd());
64
118
  const globalRepo = getHooxRepoPath();
119
+ const remembered = options?.skipRemembered ? null : getRememberedMonorepoRoot();
65
120
  const envRepo = env.HOOX_REPO?.trim();
66
121
  if (envRepo) {
67
122
  const resolved = resolve(envRepo);
@@ -72,6 +127,7 @@ function resolveHooxRuntimeRoot(options) {
72
127
  checked: {
73
128
  env: resolved,
74
129
  cwd: findHooxSetupRoot(cwd),
130
+ remembered,
75
131
  global: globalRepo
76
132
  }
77
133
  };
@@ -82,6 +138,7 @@ function resolveHooxRuntimeRoot(options) {
82
138
  checked: {
83
139
  env: resolved,
84
140
  cwd: findHooxSetupRoot(cwd),
141
+ remembered,
85
142
  global: globalRepo
86
143
  }
87
144
  };
@@ -91,20 +148,27 @@ function resolveHooxRuntimeRoot(options) {
91
148
  return {
92
149
  root: local,
93
150
  source: "cwd",
94
- checked: { cwd: local, global: globalRepo }
151
+ checked: { cwd: local, remembered, global: globalRepo }
152
+ };
153
+ }
154
+ if (remembered) {
155
+ return {
156
+ root: remembered,
157
+ source: "remembered",
158
+ checked: { cwd: null, remembered, global: globalRepo }
95
159
  };
96
160
  }
97
161
  if (isHooxSetupRoot(globalRepo)) {
98
162
  return {
99
163
  root: globalRepo,
100
164
  source: "global",
101
- checked: { cwd: null, global: globalRepo }
165
+ checked: { cwd: null, remembered: null, global: globalRepo }
102
166
  };
103
167
  }
104
168
  return {
105
169
  root: null,
106
170
  source: "none",
107
- checked: { cwd: null, global: globalRepo }
171
+ checked: { cwd: null, remembered: null, global: globalRepo }
108
172
  };
109
173
  }
110
174
  function getTuiEntryCandidates(runtimeRoot) {
@@ -174,9 +238,12 @@ function getHooxStatePath() {
174
238
  export {
175
239
  resolveHooxRuntimeRoot,
176
240
  resolveHooxPath,
241
+ rememberMonorepoRoot,
177
242
  isWithinHooxHome,
178
243
  isHooxSetupRoot,
179
244
  getTuiEntryCandidates,
245
+ getRememberedMonorepoRoot,
246
+ getRememberedMonorepoPath,
180
247
  getRelativeHooxPath,
181
248
  getHooxWranglerPath,
182
249
  getHooxStatePath,
@@ -19,6 +19,11 @@ export interface QueueHandlerOptions<T> {
19
19
  info(msg: string, data?: unknown): void;
20
20
  error(msg: string, data?: unknown): void;
21
21
  };
22
+ /**
23
+ * Max number of messages to process concurrently within a batch.
24
+ * Defaults to 1 (serial) for back-compat. Values < 1 are treated as 1.
25
+ */
26
+ concurrency?: number;
22
27
  }
23
28
  /**
24
29
  * Creates a reusable queue handler with retry + exponential backoff logic.
@@ -28,6 +33,7 @@ export interface QueueHandlerOptions<T> {
28
33
  * const handler = createQueueHandler({
29
34
  * maxRetries: 5,
30
35
  * backoffDelays: [0, 30, 60, 300, 900],
36
+ * concurrency: 4, // optional; default 1 (serial)
31
37
  * onMessage: async (msg) => {
32
38
  * await executeTask(msg);
33
39
  * },
@@ -1 +1 @@
1
- {"version":3,"file":"queue-handler.d.ts","sourceRoot":"","sources":["../src/queue-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,+CAA+C;IAC/C,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,O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AE,CACR,OAAO,EAAE,CAAC,EACV,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,KACjB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,iEAAiE;IACjE,KAAK,CAAC,EAAE,CACN,OAAO,EAAE,CAAC,EACV,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,KACV,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,oCAAoC;IACpC,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QACxC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;KAC1C,CAAC;IACF;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAkCD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,IAqDrD,OAAO,YAAY,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC,CAGrD"}
@@ -16,29 +16,60 @@ var __export = (target, all) => {
16
16
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
17
 
18
18
  // src/queue-handler.ts
19
+ async function mapPool(items, concurrency, fn) {
20
+ if (items.length === 0)
21
+ return;
22
+ const limit = Math.min(Math.max(1, concurrency), items.length);
23
+ if (limit === 1) {
24
+ for (const item of items) {
25
+ await fn(item);
26
+ }
27
+ return;
28
+ }
29
+ let nextIndex = 0;
30
+ async function worker() {
31
+ while (true) {
32
+ const i = nextIndex++;
33
+ if (i >= items.length)
34
+ return;
35
+ await fn(items[i]);
36
+ }
37
+ }
38
+ await Promise.all(Array.from({ length: limit }, () => worker()));
39
+ }
19
40
  function createQueueHandler(options) {
20
- const { maxRetries, backoffDelays, onMessage, onRetry, onDLQ, logger } = options;
21
- return async (batch) => {
22
- for (const msg of batch.messages) {
23
- const attemptNumber = msg.attempts || 0;
24
- const logId = `[${msg.id}]`;
25
- try {
26
- logger?.info(`${logId} Processing message (attempt ${attemptNumber + 1})`);
27
- await onMessage(msg.body, attemptNumber);
28
- logger?.info(`${logId} Message processed successfully`);
29
- } catch (error) {
30
- const errorMsg = error instanceof Error ? error.message : String(error);
31
- if (attemptNumber < maxRetries) {
32
- const delaySeconds = backoffDelays[attemptNumber] ?? backoffDelays[backoffDelays.length - 1];
33
- logger?.info(`${logId} Retrying in ${delaySeconds}s (attempt ${attemptNumber + 2}/${maxRetries + 1})`);
34
- await onRetry?.(msg.body, attemptNumber, errorMsg, delaySeconds);
35
- msg.retry({ delaySeconds });
36
- } else {
37
- logger?.error(`${logId} Max retries exceeded (${maxRetries + 1} attempts), moving to DLQ`);
38
- await onDLQ?.(msg.body, attemptNumber, errorMsg);
39
- }
41
+ const {
42
+ maxRetries,
43
+ backoffDelays,
44
+ onMessage,
45
+ onRetry,
46
+ onDLQ,
47
+ logger,
48
+ concurrency: concurrencyOpt
49
+ } = options;
50
+ const concurrency = typeof concurrencyOpt === "number" && Number.isFinite(concurrencyOpt) && concurrencyOpt >= 1 ? Math.floor(concurrencyOpt) : 1;
51
+ async function processMessage(msg) {
52
+ const attemptNumber = msg.attempts || 0;
53
+ const logId = `[${msg.id}]`;
54
+ try {
55
+ logger?.info(`${logId} Processing message (attempt ${attemptNumber + 1})`);
56
+ await onMessage(msg.body, attemptNumber);
57
+ logger?.info(`${logId} Message processed successfully`);
58
+ } catch (error) {
59
+ const errorMsg = error instanceof Error ? error.message : String(error);
60
+ if (attemptNumber < maxRetries) {
61
+ const delaySeconds = backoffDelays[attemptNumber] ?? backoffDelays[backoffDelays.length - 1] ?? 0;
62
+ logger?.info(`${logId} Retrying in ${delaySeconds}s (attempt ${attemptNumber + 2}/${maxRetries + 1})`);
63
+ await onRetry?.(msg.body, attemptNumber, errorMsg, delaySeconds);
64
+ msg.retry({ delaySeconds });
65
+ } else {
66
+ logger?.error(`${logId} Max retries exceeded (${maxRetries + 1} attempts), moving to DLQ`);
67
+ await onDLQ?.(msg.body, attemptNumber, errorMsg);
40
68
  }
41
69
  }
70
+ }
71
+ return async (batch) => {
72
+ await mapPool(batch.messages, concurrency, processMessage);
42
73
  };
43
74
  }
44
75
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,KAAK,EAKV,MAAM,EACP,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE9E,wBAAgB,YAAY,CAAC,IAAI,GAAG,OAAO,KAAK,MAAM,CAAC,IAAI,CAAC,CAsM3D"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,KAAK,EAKV,MAAM,EACP,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE9E,wBAAgB,YAAY,CAAC,IAAI,GAAG,OAAO,KAAK,MAAM,CAAC,IAAI,CAAC,CA6M3D"}
package/dist/router.js CHANGED
@@ -23,7 +23,9 @@ function createRouter() {
23
23
  const regex = /:([a-zA-Z_][a-zA-Z0-9_]*)/g;
24
24
  let match;
25
25
  while ((match = regex.exec(pattern)) !== null) {
26
- params.push(match[1]);
26
+ const name = match[1];
27
+ if (name !== undefined)
28
+ params.push(name);
27
29
  }
28
30
  return params;
29
31
  }
@@ -38,7 +40,11 @@ function createRouter() {
38
40
  return null;
39
41
  const params = {};
40
42
  for (let i = 0;i < paramNames.length; i++) {
41
- params[paramNames[i]] = m[i + 1];
43
+ const key = paramNames[i];
44
+ const value = m[i + 1];
45
+ if (key !== undefined && value !== undefined) {
46
+ params[key] = value;
47
+ }
42
48
  }
43
49
  return params;
44
50
  }
@@ -57,6 +63,8 @@ function createRouter() {
57
63
  return { route: exact };
58
64
  for (let i = routes.length - 1;i >= 0; i--) {
59
65
  const route = routes[i];
66
+ if (!route)
67
+ continue;
60
68
  if (route.params && route.params.length > 0 && route.regex) {
61
69
  const matched = matchPattern(path, route.regex, route.params);
62
70
  if (matched && route.method === method) {
@@ -88,6 +96,8 @@ function createRouter() {
88
96
  let pathExists = false;
89
97
  for (let i = routes.length - 1;i >= 0; i--) {
90
98
  const r = routes[i];
99
+ if (!r)
100
+ continue;
91
101
  if (r.path === path) {
92
102
  pathExists = true;
93
103
  break;
@@ -3,6 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  export type { WorkerManifest, VarDef, ServiceBindingDef, InfraBindings, KVBindingDef, D1BindingDef, R2BindingDef, QueueBindingDef, VectorizeBindingDef, DOBindingDef, ValidationError, ValidationReport, } from "./types.js";
6
- export { WORKER_MANIFESTS, WORKER_NAMES, CALLED_BY } from "./registry.js";
6
+ export { WORKER_MANIFESTS, WORKER_NAMES, WORKER_CATALOG, CALLED_BY, getWorkerDefaultEnabled, } from "./registry.js";
7
+ export type { WorkerCatalogEntry } from "./registry.js";
7
8
  export { validateWranglerJsonc, validateRootSecrets, validateDevVars, validateAll, generateWranglerJsonc, generateDevVars, } from "./validators.js";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACV,cAAc,EACd,MAAM,EACN,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,eAAe,GAChB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACV,cAAc,EACd,MAAM,EACN,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,SAAS,EACT,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,eAAe,GAChB,MAAM,iBAAiB,CAAC"}
@@ -22,9 +22,12 @@ function deriveCalledBy(manifests) {
22
22
  if (!calledBy[workerName])
23
23
  calledBy[workerName] = new Set;
24
24
  for (const svc of manifest.services) {
25
- if (!calledBy[svc.service])
26
- calledBy[svc.service] = new Set;
27
- calledBy[svc.service].add(workerName);
25
+ let callers = calledBy[svc.service];
26
+ if (!callers) {
27
+ callers = new Set;
28
+ calledBy[svc.service] = callers;
29
+ }
30
+ callers.add(workerName);
28
31
  }
29
32
  }
30
33
  const result = {};
@@ -37,6 +40,7 @@ var manifests = {
37
40
  hoox: {
38
41
  name: "hoox",
39
42
  path: "workers/hoox-worker",
43
+ defaultEnabled: true,
40
44
  vars: {
41
45
  WEBHOOK_API_KEY_BINDING: {
42
46
  type: "secret",
@@ -46,7 +50,11 @@ var manifests = {
46
50
  type: "secret",
47
51
  description: "Inter-worker auth key"
48
52
  },
49
- HA_TOKEN_BINDING: { type: "secret", description: "Home Assistant token" }
53
+ HA_TOKEN_BINDING: { type: "secret", description: "Home Assistant token" },
54
+ TELEGRAM_ALLOWED_CHAT_IDS: {
55
+ type: "secret",
56
+ description: "Comma-separated chat IDs for webhook notify (fail-closed when unset); alias AUTHORIZED_CHAT_IDS"
57
+ }
50
58
  },
51
59
  services: [
52
60
  {
@@ -72,7 +80,8 @@ var manifests = {
72
80
  ai: true,
73
81
  queues: { producer: ["trade-execution"] },
74
82
  durableObjects: [
75
- { name: "IDEMPOTENCY_STORE", className: "IdempotencyStore" }
83
+ { name: "IDEMPOTENCY_STORE", className: "IdempotencyStore" },
84
+ { name: "RATE_LIMITER", className: "RateLimiterStore" }
76
85
  ]
77
86
  },
78
87
  middleware: [
@@ -87,6 +96,7 @@ var manifests = {
87
96
  "trade-worker": {
88
97
  name: "trade-worker",
89
98
  path: "workers/trade-worker",
99
+ defaultEnabled: true,
90
100
  vars: {
91
101
  INTERNAL_KEY_BINDING: {
92
102
  type: "secret",
@@ -96,15 +106,22 @@ var manifests = {
96
106
  type: "secret",
97
107
  description: "Telegram outbound auth"
98
108
  },
99
- BINANCE_KEY_BINDING: { type: "secret", description: "Binance API key" },
100
- BINANCE_SECRET_BINDING: {
109
+ EXCHANGE_KEY_BINDING: {
110
+ type: "secret",
111
+ description: "Unified exchange API key (Binance / Bybit / MEXC)"
112
+ },
113
+ EXCHANGE_SECRET_BINDING: {
114
+ type: "secret",
115
+ description: "Unified exchange API secret"
116
+ },
117
+ EXCHANGE_TESTNET_KEY_BINDING: {
101
118
  type: "secret",
102
- description: "Binance API secret"
119
+ description: "Optional unified testnet API key"
103
120
  },
104
- MEXC_KEY_BINDING: { type: "secret", description: "MEXC API key" },
105
- MEXC_SECRET_BINDING: { type: "secret", description: "MEXC API secret" },
106
- BYBIT_KEY_BINDING: { type: "secret", description: "Bybit API key" },
107
- BYBIT_SECRET_BINDING: { type: "secret", description: "Bybit API secret" }
121
+ EXCHANGE_TESTNET_SECRET_BINDING: {
122
+ type: "secret",
123
+ description: "Optional unified testnet API secret"
124
+ }
108
125
  },
109
126
  services: [
110
127
  {
@@ -146,6 +163,7 @@ var manifests = {
146
163
  "telegram-worker": {
147
164
  name: "telegram-worker",
148
165
  path: "workers/telegram-worker",
166
+ defaultEnabled: true,
149
167
  vars: {
150
168
  INTERNAL_KEY_BINDING: {
151
169
  type: "secret",
@@ -159,6 +177,10 @@ var manifests = {
159
177
  TELEGRAM_SECRET_TOKEN: {
160
178
  type: "secret",
161
179
  description: "Webhook verification token"
180
+ },
181
+ AUTHORIZED_CHAT_IDS: {
182
+ type: "secret",
183
+ description: "Comma-separated chat IDs; inbound webhook fail-closed when unset; outbound /alert allowlist"
162
184
  }
163
185
  },
164
186
  services: [],
@@ -179,6 +201,7 @@ var manifests = {
179
201
  "d1-worker": {
180
202
  name: "d1-worker",
181
203
  path: "workers/d1-worker",
204
+ defaultEnabled: true,
182
205
  vars: {
183
206
  INTERNAL_KEY_BINDING: {
184
207
  type: "secret",
@@ -201,6 +224,7 @@ var manifests = {
201
224
  "web3-wallet-worker": {
202
225
  name: "web3-wallet-worker",
203
226
  path: "workers/web3-wallet-worker",
227
+ defaultEnabled: false,
204
228
  vars: {
205
229
  WALLET_PK_SECRET: { type: "secret", description: "Wallet private key" },
206
230
  WALLET_MNEMONIC_SECRET: {
@@ -221,6 +245,7 @@ var manifests = {
221
245
  "agent-worker": {
222
246
  name: "agent-worker",
223
247
  path: "workers/agent-worker",
248
+ defaultEnabled: true,
224
249
  vars: {
225
250
  AGENT_INTERNAL_KEY: { type: "secret", description: "Agent worker auth" },
226
251
  INTERNAL_KEY_BINDING: {
@@ -257,6 +282,7 @@ var manifests = {
257
282
  "email-worker": {
258
283
  name: "email-worker",
259
284
  path: "workers/email-worker",
285
+ defaultEnabled: false,
260
286
  vars: {
261
287
  INTERNAL_KEY_BINDING: {
262
288
  type: "secret",
@@ -294,6 +320,7 @@ var manifests = {
294
320
  "analytics-worker": {
295
321
  name: "analytics-worker",
296
322
  path: "workers/analytics-worker",
323
+ defaultEnabled: true,
297
324
  vars: {
298
325
  CLOUDFLARE_API_TOKEN: {
299
326
  type: "secret",
@@ -313,6 +340,7 @@ var manifests = {
313
340
  "report-worker": {
314
341
  name: "report-worker",
315
342
  path: "workers/report-worker",
343
+ defaultEnabled: false,
316
344
  vars: {
317
345
  CF_API_TOKEN_BINDING: {
318
346
  type: "secret",
@@ -347,6 +375,7 @@ var manifests = {
347
375
  "pyne-worker": {
348
376
  name: "pyne-worker",
349
377
  path: "workers/pyne-worker",
378
+ defaultEnabled: true,
350
379
  vars: {
351
380
  API_KEY: {
352
381
  type: "secret",
@@ -384,6 +413,7 @@ var manifests = {
384
413
  dashboard: {
385
414
  name: "dashboard",
386
415
  path: "workers/dashboard",
416
+ defaultEnabled: true,
387
417
  vars: {
388
418
  DASHBOARD_USER: {
389
419
  type: "secret",
@@ -426,6 +456,17 @@ var manifests = {
426
456
  var CALLED_BY = deriveCalledBy(manifests);
427
457
  var WORKER_MANIFESTS = manifests;
428
458
  var WORKER_NAMES = Object.keys(manifests).sort();
459
+ var WORKER_CATALOG = WORKER_NAMES.map((name) => {
460
+ const m = manifests[name];
461
+ return {
462
+ name: m.name,
463
+ path: m.path,
464
+ defaultEnabled: m.defaultEnabled
465
+ };
466
+ });
467
+ function getWorkerDefaultEnabled(name) {
468
+ return manifests[name]?.defaultEnabled;
469
+ }
429
470
 
430
471
  // src/schemas/validators.ts
431
472
  import { parse } from "jsonc-parser";
@@ -465,7 +506,7 @@ function validateWranglerJsonc(workerName, manifest, jsoncContent) {
465
506
  }
466
507
  }
467
508
  for (const [name, def] of Object.entries(manifest.vars)) {
468
- if (def.type === "secret" && !name.endsWith("_BINDING") && !name.endsWith("_SECRET") && !name.startsWith("CLOUDFLARE_") && name !== "TELEGRAM_SECRET_TOKEN" && name !== "MAILGUN_API_KEY" && name !== "EMAIL_SCAN_SUBJECT" && name !== "DASHBOARD_USER" && name !== "DASHBOARD_PASS" && name !== "SESSION_SECRET" && name !== "AGENT_INTERNAL_KEY") {
509
+ if (def.type === "secret" && !name.endsWith("_BINDING") && !name.endsWith("_SECRET") && !name.startsWith("CLOUDFLARE_") && name !== "TELEGRAM_SECRET_TOKEN" && name !== "TELEGRAM_ALLOWED_CHAT_IDS" && name !== "AUTHORIZED_CHAT_IDS" && name !== "MAILGUN_API_KEY" && name !== "EMAIL_SCAN_SUBJECT" && name !== "DASHBOARD_USER" && name !== "DASHBOARD_PASS" && name !== "SESSION_SECRET" && name !== "AGENT_INTERNAL_KEY") {
469
510
  errors.push({
470
511
  worker: workerName,
471
512
  severity: "warning",
@@ -582,6 +623,8 @@ function generateWranglerJsonc(manifest) {
582
623
  parts.push(` "vars": {`);
583
624
  for (const [i, name] of varKeys.entries()) {
584
625
  const def = manifest.vars[name];
626
+ if (!def)
627
+ continue;
585
628
  const comma = i < varKeys.length - 1 ? "," : "";
586
629
  const val = def.type === "secret" ? "__SECRET__" : JSON.stringify(def.default ?? "");
587
630
  parts.push(` "${name}": ${val}${comma}`);
@@ -697,9 +740,11 @@ export {
697
740
  validateRootSecrets,
698
741
  validateDevVars,
699
742
  validateAll,
743
+ getWorkerDefaultEnabled,
700
744
  generateWranglerJsonc,
701
745
  generateDevVars,
702
746
  WORKER_NAMES,
703
747
  WORKER_MANIFESTS,
748
+ WORKER_CATALOG,
704
749
  CALLED_BY
705
750
  };
@@ -9,4 +9,17 @@ export declare const CALLED_BY: Record<string, string[]>;
9
9
  export declare const WORKER_MANIFESTS: Record<string, WorkerManifest>;
10
10
  /** List of all worker names in the registry. */
11
11
  export declare const WORKER_NAMES: string[];
12
+ /**
13
+ * Catalog entry for CLI worker enable/disable — one row per known worker.
14
+ * `defaultEnabled` is the seed value when the worker is first added to config.
15
+ */
16
+ export interface WorkerCatalogEntry {
17
+ name: string;
18
+ path: string;
19
+ defaultEnabled: boolean;
20
+ }
21
+ /** Full catalog of known workers with default enable flags (sorted by name). */
22
+ export declare const WORKER_CATALOG: WorkerCatalogEntry[];
23
+ /** Lookup defaultEnabled for a known worker; undefined if not in catalog. */
24
+ export declare function getWorkerDefaultEnabled(name: string): boolean | undefined;
12
25
  //# sourceMappingURL=registry.d.ts.map