@karmaniverous/jeeves-meta 0.15.12 → 0.16.1

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.
@@ -7,8 +7,6 @@
7
7
  export interface MetaSpawnOptions {
8
8
  /** Model override for this subprocess. */
9
9
  model?: string;
10
- /** Timeout in seconds. */
11
- timeout?: number;
12
10
  /** Label for the spawned session. */
13
11
  label?: string;
14
12
  /** Thinking level (e.g. "low", "medium", "high"). */
@@ -128,8 +128,6 @@ The Builder should:
128
128
  4. Merge new findings with previous `_content` (carried in context)
129
129
 
130
130
  If the scope is small enough to process in one pass, omit chunking instructions.
131
- The Builder has a timeout of \{{config.builderTimeout}} seconds.
132
-
133
131
  ### 8. Output Structure
134
132
 
135
133
  Define non-underscore fields for structured data and the _content narrative
@@ -148,7 +146,6 @@ Quote the specific issue and state what to do differently.
148
146
  Your task brief will be compiled as a Handlebars template before the Builder
149
147
  receives it. You can use these variables to write adaptive instructions:
150
148
 
151
- - `\{{config.builderTimeout}}` — Builder timeout in seconds
152
149
  - `\{{config.maxLines}}` — Maximum _content lines
153
150
  - `\{{config.architectEvery}}` — Cycles between architect refreshes
154
151
  - `\{{config.maxArchive}}` — Archive snapshots retained
@@ -159,7 +156,7 @@ receives it. You can use these variables to write adaptive instructions:
159
156
  - `\{{meta._depth}}` — Scheduling depth
160
157
  - `\{{meta._emphasis}}` — Scheduling emphasis
161
158
 
162
- Example: "Process files in chunks of 50. You have \{{config.builderTimeout}} seconds."
159
+ Example: "Process files in chunks of 50. Limit output to \{{config.maxLines}} lines."
163
160
 
164
161
  ## Constraints
165
162
 
@@ -1,26 +1,18 @@
1
1
  /**
2
- * Hybrid 3-layer synthesis queue.
2
+ * Synthesis queue.
3
3
  *
4
4
  * Layer 1: Current — the single item currently executing (at most one).
5
- * Layer 2: Overrides — items manually enqueued via POST /synthesize with path.
6
- * FIFO among overrides, ahead of automatic candidates.
7
- * Layer 3: Automatic — computed on read, not persisted. All metas with a
8
- * pending phase, ranked by scheduler priority.
9
- *
10
- * Legacy: `pending` array is the union of overrides + automatic.
5
+ * Layer 2: Pending — items enqueued via POST /synthesize (targeted) or
6
+ * scheduler tick (automatic). FIFO, ahead of automatic candidates.
7
+ * Layer 3: Automatic — computed on read (GET /queue), not persisted. All
8
+ * metas with a pending phase, ranked by scheduler priority.
11
9
  *
12
10
  * @module queue
13
11
  */
14
12
  import type { Logger } from 'pino';
15
13
  import type { PhaseName } from '../schema/meta.js';
16
- /** A queued synthesis work item. */
17
- export interface QueueItem {
18
- path: string;
19
- priority: boolean;
20
- enqueuedAt: string;
21
- }
22
- /** An override entry in the explicit queue layer. */
23
- export interface OverrideEntry {
14
+ /** An entry in the synthesis queue. */
15
+ export interface QueueEntry {
24
16
  path: string;
25
17
  enqueuedAt: string;
26
18
  }
@@ -40,69 +32,35 @@ export interface QueueState {
40
32
  depth: number;
41
33
  items: Array<{
42
34
  path: string;
43
- priority: boolean;
44
35
  enqueuedAt: string;
45
36
  }>;
46
37
  }
47
38
  /**
48
- * Hybrid 3-layer synthesis queue.
39
+ * Synthesis queue.
49
40
  *
50
- * Only one synthesis runs at a time. Override items (explicit triggers)
51
- * take priority over automatic candidates.
41
+ * Only one synthesis runs at a time. Explicitly enqueued items
42
+ * take priority over automatic (computed-on-read) candidates.
52
43
  */
53
44
  export declare class SynthesisQueue {
54
- /** Legacy queue (used by processQueue for backward compat). */
55
- private queue;
56
- private currentItem;
45
+ private entries;
46
+ private currentPhaseItem;
57
47
  private processing;
58
48
  private logger;
59
49
  private onEnqueueCallback;
60
- /** Explicit override entries (3-layer model). */
61
- private overrideEntries;
62
- /** Currently executing item with phase info (3-layer model). */
63
- private currentPhaseItem;
64
50
  constructor(logger: Logger);
65
51
  /** Set a callback to invoke when a new (non-duplicate) item is enqueued. */
66
52
  onEnqueue(callback: () => void): void;
67
53
  /**
68
- * Add an explicit override entry (from POST /synthesize with path).
54
+ * Add an entry to the queue.
69
55
  * Deduped by path. Returns position and whether already queued.
70
56
  */
71
- enqueueOverride(path: string): EnqueueResult;
72
- /** Dequeue the next override entry, or undefined if empty. */
73
- dequeueOverride(): OverrideEntry | undefined;
74
- /** Get all override entries (shallow copy). */
75
- get overrides(): OverrideEntry[];
76
- /** Clear all override entries. Returns count removed. */
77
- clearOverrides(): number;
78
- /** Check if a path is in the override layer. */
79
- hasOverride(path: string): boolean;
80
- /** Set the currently executing phase item. */
81
- setCurrentPhase(path: string, phase: PhaseName): void;
82
- /** Clear the current phase item. */
83
- clearCurrentPhase(): void;
84
- /** The currently executing phase item, or null. */
85
- get currentPhase(): CurrentItem | null;
86
- /**
87
- * Add a path to the synthesis queue.
88
- *
89
- * @param path - Meta path to synthesize.
90
- * @param priority - If true, insert at front of queue.
91
- * @returns Position and whether the path was already queued.
92
- */
93
- enqueue(path: string, priority?: boolean): EnqueueResult;
94
- /** Remove and return the next item from the queue. */
95
- dequeue(): QueueItem | undefined;
96
- /** Mark the currently-running synthesis as complete. */
97
- complete(): void;
57
+ enqueue(path: string): EnqueueResult;
58
+ /** Dequeue the next entry, or undefined if empty. */
59
+ dequeue(): QueueEntry | undefined;
60
+ /** Get all queued entries (shallow copy). */
61
+ get items(): QueueEntry[];
98
62
  /** Number of items waiting in the queue (excludes current). */
99
63
  get depth(): number;
100
- /** The item currently being synthesized, or null. */
101
- get current(): QueueItem | null;
102
- /** A shallow copy of the queued items. */
103
- get items(): QueueItem[];
104
- /** A shallow copy of the pending items (alias for items). */
105
- get pending(): QueueItem[];
106
64
  /**
107
65
  * Remove all pending items from the queue.
108
66
  * Does not affect the currently-running item.
@@ -112,16 +70,17 @@ export declare class SynthesisQueue {
112
70
  clear(): number;
113
71
  /** Check whether a path is in the queue or currently being synthesized. */
114
72
  has(path: string): boolean;
115
- /** Get the 0-indexed position of a path in the queue. */
116
- getPosition(path: string): number | null;
117
- /** Dequeue the next item: overrides first, then legacy queue. */
118
- private nextItem;
73
+ /** Set the currently executing phase item. */
74
+ setCurrentPhase(path: string, phase: PhaseName): void;
75
+ /** Clear the current phase item. */
76
+ clearCurrentPhase(): void;
77
+ /** The currently executing phase item, or null. */
78
+ get currentPhase(): CurrentItem | null;
119
79
  /** Return a snapshot of queue state for the /status endpoint. */
120
80
  getState(): QueueState;
121
81
  /**
122
- * Process queued items one at a time until all queues are empty.
82
+ * Process queued items one at a time until the queue is empty.
123
83
  *
124
- * Override entries are processed first (FIFO), then legacy queue items.
125
84
  * Re-entry is prevented: if already processing, the call returns
126
85
  * immediately. Errors are logged and do not block subsequent items.
127
86
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * PATCH /metas/:path — update user-settable reserved properties on a meta.
3
3
  *
4
- * Supported fields: _steer, _emphasis, _depth, _crossRefs, _disabled, _architectTimeout, _builderTimeout, _criticTimeout.
4
+ * Supported fields: _steer, _emphasis, _depth, _crossRefs, _disabled.
5
5
  * Set a field to null to remove it. Unknown keys are rejected.
6
6
  *
7
7
  * @module routes/metasUpdate
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Queue management and abort routes.
3
3
  *
4
- * - GET /queue — 3-layer queue model (current, overrides, automatic, pending)
5
- * - POST /queue/clear — remove override entries only
4
+ * - GET /queue — 3-layer queue model (current, pending, automatic)
5
+ * - POST /queue/clear — remove pending entries
6
6
  * - POST /synthesize/abort — abort the current synthesis
7
7
  *
8
8
  * @module routes/queue
@@ -14,9 +14,6 @@ declare const autoSeedRuleSchema: z.ZodObject<{
14
14
  steer: z.ZodOptional<z.ZodString>;
15
15
  crossRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
16
16
  parentDepth: z.ZodOptional<z.ZodNumber>;
17
- architectTimeout: z.ZodOptional<z.ZodNumber>;
18
- builderTimeout: z.ZodOptional<z.ZodNumber>;
19
- criticTimeout: z.ZodOptional<z.ZodNumber>;
20
17
  }, z.core.$strip>;
21
18
  /** Inferred type for an auto-seed rule. */
22
19
  export type AutoSeedRule = z.infer<typeof autoSeedRuleSchema>;
@@ -29,9 +26,6 @@ export declare const serviceConfigSchema: z.ZodObject<{
29
26
  depthWeight: z.ZodDefault<z.ZodNumber>;
30
27
  maxArchive: z.ZodDefault<z.ZodNumber>;
31
28
  maxLines: z.ZodDefault<z.ZodNumber>;
32
- architectTimeout: z.ZodDefault<z.ZodNumber>;
33
- builderTimeout: z.ZodDefault<z.ZodNumber>;
34
- criticTimeout: z.ZodDefault<z.ZodNumber>;
35
29
  thinking: z.ZodDefault<z.ZodString>;
36
30
  defaultArchitect: z.ZodOptional<z.ZodString>;
37
31
  defaultCritic: z.ZodOptional<z.ZodString>;
@@ -54,9 +48,6 @@ export declare const serviceConfigSchema: z.ZodObject<{
54
48
  steer: z.ZodOptional<z.ZodString>;
55
49
  crossRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
56
50
  parentDepth: z.ZodOptional<z.ZodNumber>;
57
- architectTimeout: z.ZodOptional<z.ZodNumber>;
58
- builderTimeout: z.ZodOptional<z.ZodNumber>;
59
- criticTimeout: z.ZodOptional<z.ZodNumber>;
60
51
  }, z.core.$strip>>>>;
61
52
  }, z.core.$strip>;
62
53
  /** Inferred type for service configuration. */
@@ -43,9 +43,6 @@ export declare const metaJsonSchema: z.ZodObject<{
43
43
  message: z.ZodString;
44
44
  }, z.core.$strip>>;
45
45
  _disabled: z.ZodOptional<z.ZodBoolean>;
46
- _architectTimeout: z.ZodOptional<z.ZodNumber>;
47
- _builderTimeout: z.ZodOptional<z.ZodNumber>;
48
- _criticTimeout: z.ZodOptional<z.ZodNumber>;
49
46
  _ancestorBuilderHash: z.ZodOptional<z.ZodString>;
50
47
  _phaseState: z.ZodOptional<z.ZodObject<{
51
48
  architect: z.ZodEnum<{
@@ -11,12 +11,6 @@ export interface CreateMetaOptions {
11
11
  crossRefs?: string[];
12
12
  /** Steering prompt for the meta. */
13
13
  steer?: string;
14
- /** Per-entity timeout override for the architect phase (seconds). */
15
- architectTimeout?: number;
16
- /** Per-entity timeout override for the builder phase (seconds). */
17
- builderTimeout?: number;
18
- /** Per-entity timeout override for the critic phase (seconds). */
19
- criticTimeout?: number;
20
14
  }
21
15
  /** Result of creating a new meta. */
22
16
  export interface CreateMetaResult {
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@karmaniverous/jeeves": "^0.5.12",
11
- "@karmaniverous/jeeves-meta-core": "^0.1.3",
11
+ "@karmaniverous/jeeves-meta-core": "^0.2.0",
12
12
  "commander": "^14",
13
13
  "croner": "^10",
14
14
  "fastify": "^5.8",
@@ -98,7 +98,7 @@
98
98
  "url": "git+https://github.com/karmaniverous/jeeves-meta.git"
99
99
  },
100
100
  "scripts": {
101
- "build": "rimraf dist && cross-env NO_COLOR=1 rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
101
+ "build": "rimraf dist && cross-env NO_COLOR=1 rollup --config rollup.config.ts --configPlugin \"@rollup/plugin-typescript={outputToFilesystem:true}\"",
102
102
  "changelog": "git-cliff -o CHANGELOG.md",
103
103
  "knip": "knip",
104
104
  "lint": "eslint .",
@@ -110,5 +110,5 @@
110
110
  },
111
111
  "type": "module",
112
112
  "types": "dist/index.d.ts",
113
- "version": "0.15.12"
113
+ "version": "0.16.1"
114
114
  }