@probelabs/probe 0.6.0-rc275 → 0.6.0-rc276

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.
@@ -31298,6 +31298,14 @@ var init_TaskManager = __esm({
31298
31298
  * @returns {Task[]} Created tasks
31299
31299
  */
31300
31300
  createTasks(tasksData) {
31301
+ const hasDependencies = tasksData.some((t) => t.dependencies && t.dependencies.length > 0);
31302
+ if (hasDependencies) {
31303
+ for (let i = 0; i < tasksData.length; i++) {
31304
+ if (!tasksData[i].id) {
31305
+ throw new Error(`Task at index ${i} is missing required "id" field. When using dependencies, every task in the batch must have an "id" so other tasks can reference it.`);
31306
+ }
31307
+ }
31308
+ }
31301
31309
  const idMap = /* @__PURE__ */ new Map();
31302
31310
  const batchAutoIds = /* @__PURE__ */ new Set();
31303
31311
  let nextCounter = this.taskCounter;
@@ -31316,7 +31324,8 @@ var init_TaskManager = __esm({
31316
31324
  resolved.dependencies = resolved.dependencies.map((depId) => {
31317
31325
  if (idMap.has(depId)) return idMap.get(depId);
31318
31326
  if (this.tasks.has(depId) || batchAutoIds.has(depId)) return depId;
31319
- throw new Error(`Dependency "${depId}" does not exist. Available tasks: ${this._getAvailableTaskIds()}${idMap.size > 0 ? `, batch IDs: ${Array.from(idMap.keys()).join(", ")}` : ""}`);
31327
+ const batchIds = idMap.size > 0 ? Array.from(idMap.keys()).join(", ") : "(none provided)";
31328
+ throw new Error(`Dependency "${depId}" does not exist. Each task in the batch must have an "id" field, and dependencies must reference those IDs. Current batch IDs: ${batchIds}. Existing tasks: ${this._getAvailableTaskIds()}`);
31320
31329
  });
31321
31330
  }
31322
31331
  if (resolved.after) {
@@ -31929,12 +31938,12 @@ var init_taskTool = __esm({
31929
31938
  "use strict";
31930
31939
  init_zod();
31931
31940
  taskItemSchema = external_exports.object({
31932
- id: external_exports.string().optional(),
31941
+ id: external_exports.string().describe('Unique task identifier. Use short descriptive slugs (e.g. "auth", "setup-db"). Dependencies reference these IDs.'),
31933
31942
  title: external_exports.string().optional(),
31934
31943
  description: external_exports.string().optional(),
31935
31944
  status: external_exports.enum(["pending", "in_progress", "completed", "cancelled"]).optional(),
31936
31945
  priority: external_exports.enum(["low", "medium", "high", "critical"]).optional(),
31937
- dependencies: external_exports.array(external_exports.string()).optional(),
31946
+ dependencies: external_exports.array(external_exports.string()).optional().describe("Array of task IDs (from this batch or previously created) that must complete before this task can start."),
31938
31947
  after: external_exports.string().optional()
31939
31948
  });
31940
31949
  taskSchema = external_exports.object({
@@ -138,6 +138,16 @@ export class TaskManager {
138
138
  * @returns {Task[]} Created tasks
139
139
  */
140
140
  createTasks(tasksData) {
141
+ // Validate that all batch items have an id when dependencies are used
142
+ const hasDependencies = tasksData.some(t => t.dependencies && t.dependencies.length > 0);
143
+ if (hasDependencies) {
144
+ for (let i = 0; i < tasksData.length; i++) {
145
+ if (!tasksData[i].id) {
146
+ throw new Error(`Task at index ${i} is missing required "id" field. When using dependencies, every task in the batch must have an "id" so other tasks can reference it.`);
147
+ }
148
+ }
149
+ }
150
+
141
151
  // Build a mapping of user-provided IDs to future auto-generated IDs
142
152
  const idMap = new Map();
143
153
  const batchAutoIds = new Set();
@@ -161,7 +171,8 @@ export class TaskManager {
161
171
  if (idMap.has(depId)) return idMap.get(depId);
162
172
  // Check if it's already an existing task ID or a batch auto-generated ID
163
173
  if (this.tasks.has(depId) || batchAutoIds.has(depId)) return depId;
164
- throw new Error(`Dependency "${depId}" does not exist. Available tasks: ${this._getAvailableTaskIds()}${idMap.size > 0 ? `, batch IDs: ${Array.from(idMap.keys()).join(', ')}` : ''}`);
174
+ const batchIds = idMap.size > 0 ? Array.from(idMap.keys()).join(', ') : '(none provided)';
175
+ throw new Error(`Dependency "${depId}" does not exist. Each task in the batch must have an "id" field, and dependencies must reference those IDs. Current batch IDs: ${batchIds}. Existing tasks: ${this._getAvailableTaskIds()}`);
165
176
  });
166
177
  }
167
178
 
@@ -9,12 +9,12 @@ import { z } from 'zod';
9
9
  * Schema for a single task item in batch operations
10
10
  */
11
11
  export const taskItemSchema = z.object({
12
- id: z.string().optional(),
12
+ id: z.string().describe('Unique task identifier. Use short descriptive slugs (e.g. "auth", "setup-db"). Dependencies reference these IDs.'),
13
13
  title: z.string().optional(),
14
14
  description: z.string().optional(),
15
15
  status: z.enum(['pending', 'in_progress', 'completed', 'cancelled']).optional(),
16
16
  priority: z.enum(['low', 'medium', 'high', 'critical']).optional(),
17
- dependencies: z.array(z.string()).optional(),
17
+ dependencies: z.array(z.string()).optional().describe('Array of task IDs (from this batch or previously created) that must complete before this task can start.'),
18
18
  after: z.string().optional()
19
19
  });
20
20
 
@@ -58238,6 +58238,14 @@ var init_TaskManager = __esm({
58238
58238
  * @returns {Task[]} Created tasks
58239
58239
  */
58240
58240
  createTasks(tasksData) {
58241
+ const hasDependencies = tasksData.some((t5) => t5.dependencies && t5.dependencies.length > 0);
58242
+ if (hasDependencies) {
58243
+ for (let i5 = 0; i5 < tasksData.length; i5++) {
58244
+ if (!tasksData[i5].id) {
58245
+ throw new Error(`Task at index ${i5} is missing required "id" field. When using dependencies, every task in the batch must have an "id" so other tasks can reference it.`);
58246
+ }
58247
+ }
58248
+ }
58241
58249
  const idMap = /* @__PURE__ */ new Map();
58242
58250
  const batchAutoIds = /* @__PURE__ */ new Set();
58243
58251
  let nextCounter = this.taskCounter;
@@ -58256,7 +58264,8 @@ var init_TaskManager = __esm({
58256
58264
  resolved.dependencies = resolved.dependencies.map((depId) => {
58257
58265
  if (idMap.has(depId)) return idMap.get(depId);
58258
58266
  if (this.tasks.has(depId) || batchAutoIds.has(depId)) return depId;
58259
- throw new Error(`Dependency "${depId}" does not exist. Available tasks: ${this._getAvailableTaskIds()}${idMap.size > 0 ? `, batch IDs: ${Array.from(idMap.keys()).join(", ")}` : ""}`);
58267
+ const batchIds = idMap.size > 0 ? Array.from(idMap.keys()).join(", ") : "(none provided)";
58268
+ throw new Error(`Dependency "${depId}" does not exist. Each task in the batch must have an "id" field, and dependencies must reference those IDs. Current batch IDs: ${batchIds}. Existing tasks: ${this._getAvailableTaskIds()}`);
58260
58269
  });
58261
58270
  }
58262
58271
  if (resolved.after) {
@@ -58869,12 +58878,12 @@ var init_taskTool = __esm({
58869
58878
  "use strict";
58870
58879
  init_zod();
58871
58880
  taskItemSchema = external_exports.object({
58872
- id: external_exports.string().optional(),
58881
+ id: external_exports.string().describe('Unique task identifier. Use short descriptive slugs (e.g. "auth", "setup-db"). Dependencies reference these IDs.'),
58873
58882
  title: external_exports.string().optional(),
58874
58883
  description: external_exports.string().optional(),
58875
58884
  status: external_exports.enum(["pending", "in_progress", "completed", "cancelled"]).optional(),
58876
58885
  priority: external_exports.enum(["low", "medium", "high", "critical"]).optional(),
58877
- dependencies: external_exports.array(external_exports.string()).optional(),
58886
+ dependencies: external_exports.array(external_exports.string()).optional().describe("Array of task IDs (from this batch or previously created) that must complete before this task can start."),
58878
58887
  after: external_exports.string().optional()
58879
58888
  });
58880
58889
  taskSchema = external_exports.object({
package/cjs/index.cjs CHANGED
@@ -31374,6 +31374,14 @@ var init_TaskManager = __esm({
31374
31374
  * @returns {Task[]} Created tasks
31375
31375
  */
31376
31376
  createTasks(tasksData) {
31377
+ const hasDependencies = tasksData.some((t5) => t5.dependencies && t5.dependencies.length > 0);
31378
+ if (hasDependencies) {
31379
+ for (let i5 = 0; i5 < tasksData.length; i5++) {
31380
+ if (!tasksData[i5].id) {
31381
+ throw new Error(`Task at index ${i5} is missing required "id" field. When using dependencies, every task in the batch must have an "id" so other tasks can reference it.`);
31382
+ }
31383
+ }
31384
+ }
31377
31385
  const idMap = /* @__PURE__ */ new Map();
31378
31386
  const batchAutoIds = /* @__PURE__ */ new Set();
31379
31387
  let nextCounter = this.taskCounter;
@@ -31392,7 +31400,8 @@ var init_TaskManager = __esm({
31392
31400
  resolved.dependencies = resolved.dependencies.map((depId) => {
31393
31401
  if (idMap.has(depId)) return idMap.get(depId);
31394
31402
  if (this.tasks.has(depId) || batchAutoIds.has(depId)) return depId;
31395
- throw new Error(`Dependency "${depId}" does not exist. Available tasks: ${this._getAvailableTaskIds()}${idMap.size > 0 ? `, batch IDs: ${Array.from(idMap.keys()).join(", ")}` : ""}`);
31403
+ const batchIds = idMap.size > 0 ? Array.from(idMap.keys()).join(", ") : "(none provided)";
31404
+ throw new Error(`Dependency "${depId}" does not exist. Each task in the batch must have an "id" field, and dependencies must reference those IDs. Current batch IDs: ${batchIds}. Existing tasks: ${this._getAvailableTaskIds()}`);
31396
31405
  });
31397
31406
  }
31398
31407
  if (resolved.after) {
@@ -36111,12 +36120,12 @@ var init_taskTool = __esm({
36111
36120
  "use strict";
36112
36121
  init_zod();
36113
36122
  taskItemSchema = external_exports.object({
36114
- id: external_exports.string().optional(),
36123
+ id: external_exports.string().describe('Unique task identifier. Use short descriptive slugs (e.g. "auth", "setup-db"). Dependencies reference these IDs.'),
36115
36124
  title: external_exports.string().optional(),
36116
36125
  description: external_exports.string().optional(),
36117
36126
  status: external_exports.enum(["pending", "in_progress", "completed", "cancelled"]).optional(),
36118
36127
  priority: external_exports.enum(["low", "medium", "high", "critical"]).optional(),
36119
- dependencies: external_exports.array(external_exports.string()).optional(),
36128
+ dependencies: external_exports.array(external_exports.string()).optional().describe("Array of task IDs (from this batch or previously created) that must complete before this task can start."),
36120
36129
  after: external_exports.string().optional()
36121
36130
  });
36122
36131
  taskSchema = external_exports.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe",
3
- "version": "0.6.0-rc275",
3
+ "version": "0.6.0-rc276",
4
4
  "description": "Node.js wrapper for the probe code search tool",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -138,6 +138,16 @@ export class TaskManager {
138
138
  * @returns {Task[]} Created tasks
139
139
  */
140
140
  createTasks(tasksData) {
141
+ // Validate that all batch items have an id when dependencies are used
142
+ const hasDependencies = tasksData.some(t => t.dependencies && t.dependencies.length > 0);
143
+ if (hasDependencies) {
144
+ for (let i = 0; i < tasksData.length; i++) {
145
+ if (!tasksData[i].id) {
146
+ throw new Error(`Task at index ${i} is missing required "id" field. When using dependencies, every task in the batch must have an "id" so other tasks can reference it.`);
147
+ }
148
+ }
149
+ }
150
+
141
151
  // Build a mapping of user-provided IDs to future auto-generated IDs
142
152
  const idMap = new Map();
143
153
  const batchAutoIds = new Set();
@@ -161,7 +171,8 @@ export class TaskManager {
161
171
  if (idMap.has(depId)) return idMap.get(depId);
162
172
  // Check if it's already an existing task ID or a batch auto-generated ID
163
173
  if (this.tasks.has(depId) || batchAutoIds.has(depId)) return depId;
164
- throw new Error(`Dependency "${depId}" does not exist. Available tasks: ${this._getAvailableTaskIds()}${idMap.size > 0 ? `, batch IDs: ${Array.from(idMap.keys()).join(', ')}` : ''}`);
174
+ const batchIds = idMap.size > 0 ? Array.from(idMap.keys()).join(', ') : '(none provided)';
175
+ throw new Error(`Dependency "${depId}" does not exist. Each task in the batch must have an "id" field, and dependencies must reference those IDs. Current batch IDs: ${batchIds}. Existing tasks: ${this._getAvailableTaskIds()}`);
165
176
  });
166
177
  }
167
178
 
@@ -9,12 +9,12 @@ import { z } from 'zod';
9
9
  * Schema for a single task item in batch operations
10
10
  */
11
11
  export const taskItemSchema = z.object({
12
- id: z.string().optional(),
12
+ id: z.string().describe('Unique task identifier. Use short descriptive slugs (e.g. "auth", "setup-db"). Dependencies reference these IDs.'),
13
13
  title: z.string().optional(),
14
14
  description: z.string().optional(),
15
15
  status: z.enum(['pending', 'in_progress', 'completed', 'cancelled']).optional(),
16
16
  priority: z.enum(['low', 'medium', 'high', 'critical']).optional(),
17
- dependencies: z.array(z.string()).optional(),
17
+ dependencies: z.array(z.string()).optional().describe('Array of task IDs (from this batch or previously created) that must complete before this task can start.'),
18
18
  after: z.string().optional()
19
19
  });
20
20