@hivelore/core 0.30.1 → 0.33.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/dist/index.d.ts CHANGED
@@ -43,6 +43,8 @@ declare const SensorSchema: z.ZodObject<{
43
43
  flags: z.ZodOptional<z.ZodString>;
44
44
  /** Shell/test command to run (for kind=shell|test). Executed by the CLI, never by core. */
45
45
  command: z.ZodOptional<z.ZodString>;
46
+ /** Max runtime for kind=shell|test commands (default 120000). The executor kills on expiry. */
47
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
46
48
  /** Glob-ish path prefixes the sensor applies to. Falls back to the memory's anchor paths when empty. */
47
49
  paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
48
50
  /** LLM-facing self-correction message: what was done wrong and what to do instead. */
@@ -64,6 +66,7 @@ declare const SensorSchema: z.ZodObject<{
64
66
  absent?: string | undefined;
65
67
  flags?: string | undefined;
66
68
  command?: string | undefined;
69
+ timeout_ms?: number | undefined;
67
70
  }, {
68
71
  message: string;
69
72
  paths?: string[] | undefined;
@@ -72,6 +75,7 @@ declare const SensorSchema: z.ZodObject<{
72
75
  absent?: string | undefined;
73
76
  flags?: string | undefined;
74
77
  command?: string | undefined;
78
+ timeout_ms?: number | undefined;
75
79
  severity?: "warn" | "block" | undefined;
76
80
  autogen?: boolean | undefined;
77
81
  last_fired?: string | null | undefined;
@@ -138,6 +142,8 @@ declare const MemoryFrontmatterSchema: z.ZodEffects<z.ZodObject<{
138
142
  flags: z.ZodOptional<z.ZodString>;
139
143
  /** Shell/test command to run (for kind=shell|test). Executed by the CLI, never by core. */
140
144
  command: z.ZodOptional<z.ZodString>;
145
+ /** Max runtime for kind=shell|test commands (default 120000). The executor kills on expiry. */
146
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
141
147
  /** Glob-ish path prefixes the sensor applies to. Falls back to the memory's anchor paths when empty. */
142
148
  paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
143
149
  /** LLM-facing self-correction message: what was done wrong and what to do instead. */
@@ -159,6 +165,7 @@ declare const MemoryFrontmatterSchema: z.ZodEffects<z.ZodObject<{
159
165
  absent?: string | undefined;
160
166
  flags?: string | undefined;
161
167
  command?: string | undefined;
168
+ timeout_ms?: number | undefined;
162
169
  }, {
163
170
  message: string;
164
171
  paths?: string[] | undefined;
@@ -167,6 +174,7 @@ declare const MemoryFrontmatterSchema: z.ZodEffects<z.ZodObject<{
167
174
  absent?: string | undefined;
168
175
  flags?: string | undefined;
169
176
  command?: string | undefined;
177
+ timeout_ms?: number | undefined;
170
178
  severity?: "warn" | "block" | undefined;
171
179
  autogen?: boolean | undefined;
172
180
  last_fired?: string | null | undefined;
@@ -248,6 +256,7 @@ declare const MemoryFrontmatterSchema: z.ZodEffects<z.ZodObject<{
248
256
  absent?: string | undefined;
249
257
  flags?: string | undefined;
250
258
  command?: string | undefined;
259
+ timeout_ms?: number | undefined;
251
260
  } | undefined;
252
261
  activation?: {
253
262
  keywords: string[];
@@ -277,6 +286,7 @@ declare const MemoryFrontmatterSchema: z.ZodEffects<z.ZodObject<{
277
286
  absent?: string | undefined;
278
287
  flags?: string | undefined;
279
288
  command?: string | undefined;
289
+ timeout_ms?: number | undefined;
280
290
  severity?: "warn" | "block" | undefined;
281
291
  autogen?: boolean | undefined;
282
292
  last_fired?: string | null | undefined;
@@ -330,6 +340,7 @@ declare const MemoryFrontmatterSchema: z.ZodEffects<z.ZodObject<{
330
340
  absent?: string | undefined;
331
341
  flags?: string | undefined;
332
342
  command?: string | undefined;
343
+ timeout_ms?: number | undefined;
333
344
  } | undefined;
334
345
  activation?: {
335
346
  keywords: string[];
@@ -359,6 +370,7 @@ declare const MemoryFrontmatterSchema: z.ZodEffects<z.ZodObject<{
359
370
  absent?: string | undefined;
360
371
  flags?: string | undefined;
361
372
  command?: string | undefined;
373
+ timeout_ms?: number | undefined;
362
374
  severity?: "warn" | "block" | undefined;
363
375
  autogen?: boolean | undefined;
364
376
  last_fired?: string | null | undefined;
@@ -1804,9 +1816,8 @@ interface SensorTarget {
1804
1816
  }
1805
1817
  /**
1806
1818
  * Does this sensor apply to `path`? A sensor with no explicit `paths` (and whose
1807
- * memory has no anchor paths) applies everywhere. Otherwise it applies only to the
1808
- * exact file or directory prefix. Use an explicit directory path (`src/foo/`) when a
1809
- * sensor should cover a whole subtree.
1819
+ * memory has no anchor paths) applies everywhere. Otherwise it applies to the exact
1820
+ * file, a directory prefix, or a glob (`**` / `*.controller.ts` style) scope.
1810
1821
  */
1811
1822
  declare function sensorAppliesToPath(sensor: Sensor, anchorPaths: string[], path: string): boolean;
1812
1823
  /**
@@ -1852,6 +1863,8 @@ interface CommandSensorSpec {
1852
1863
  message: string;
1853
1864
  /** Anchor/scoped paths this sensor cares about (for reporting). */
1854
1865
  paths: string[];
1866
+ /** Max runtime in ms (executor default applies when unset). */
1867
+ timeout_ms?: number;
1855
1868
  }
1856
1869
  /**
1857
1870
  * Select the shell/test sensors that apply to `changedPaths`. With no changed paths (or a sensor
package/dist/index.js CHANGED
@@ -43,6 +43,8 @@ var SensorSchema = z.object({
43
43
  flags: z.string().optional(),
44
44
  /** Shell/test command to run (for kind=shell|test). Executed by the CLI, never by core. */
45
45
  command: z.string().optional(),
46
+ /** Max runtime for kind=shell|test commands (default 120000). The executor kills on expiry. */
47
+ timeout_ms: z.number().int().positive().optional(),
46
48
  /** Glob-ish path prefixes the sensor applies to. Falls back to the memory's anchor paths when empty. */
47
49
  paths: z.array(z.string()).default([]),
48
50
  /** LLM-facing self-correction message: what was done wrong and what to do instead. */
@@ -3782,6 +3784,7 @@ function sensorAppliesToPath(sensor, anchorPaths, path19) {
3782
3784
  return scopes.some((rawScope) => {
3783
3785
  const scope = normalizeProjectPath(rawScope);
3784
3786
  if (!scope) return false;
3787
+ if (isGlobPath(scope)) return globToRegExp(scope).test(target);
3785
3788
  return target === scope || target.startsWith(`${scope}/`);
3786
3789
  });
3787
3790
  }
@@ -3864,7 +3867,8 @@ function selectCommandSensors(memories, changedPaths) {
3864
3867
  kind: sensor.kind,
3865
3868
  severity: sensor.severity,
3866
3869
  message: sensor.message,
3867
- paths: sensor.paths.length > 0 ? sensor.paths : anchorPaths
3870
+ paths: sensor.paths.length > 0 ? sensor.paths : anchorPaths,
3871
+ ...sensor.timeout_ms ? { timeout_ms: sensor.timeout_ms } : {}
3868
3872
  });
3869
3873
  }
3870
3874
  return specs;