@dexto/tools-todo 1.7.1 → 1.8.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/errors.cjs CHANGED
@@ -21,7 +21,7 @@ __export(errors_exports, {
21
21
  TodoError: () => TodoError
22
22
  });
23
23
  module.exports = __toCommonJS(errors_exports);
24
- var import_core = require("@dexto/core");
24
+ var import_errors = require("@dexto/core/errors");
25
25
  var import_error_codes = require("./error-codes.js");
26
26
  const TODO_ERROR_SCOPE = "todo";
27
27
  class TodoError {
@@ -31,10 +31,10 @@ class TodoError {
31
31
  * Service not initialized error
32
32
  */
33
33
  static notInitialized() {
34
- return new import_core.DextoRuntimeError(
34
+ return new import_errors.DextoRuntimeError(
35
35
  import_error_codes.TodoErrorCode.SERVICE_NOT_INITIALIZED,
36
36
  TODO_ERROR_SCOPE,
37
- import_core.ErrorType.SYSTEM,
37
+ import_errors.ErrorType.SYSTEM,
38
38
  "TodoService has not been initialized",
39
39
  {},
40
40
  "Initialize the TodoService before using it"
@@ -44,10 +44,10 @@ class TodoError {
44
44
  * Todo limit exceeded error
45
45
  */
46
46
  static todoLimitExceeded(current, max) {
47
- return new import_core.DextoRuntimeError(
47
+ return new import_errors.DextoRuntimeError(
48
48
  import_error_codes.TodoErrorCode.TODO_LIMIT_EXCEEDED,
49
49
  TODO_ERROR_SCOPE,
50
- import_core.ErrorType.USER,
50
+ import_errors.ErrorType.USER,
51
51
  `Todo limit exceeded: ${current} todos. Maximum allowed: ${max}`,
52
52
  { current, max },
53
53
  "Complete or delete existing todos before adding new ones"
@@ -57,10 +57,10 @@ class TodoError {
57
57
  * Invalid todo status error
58
58
  */
59
59
  static invalidStatus(status) {
60
- return new import_core.DextoRuntimeError(
60
+ return new import_errors.DextoRuntimeError(
61
61
  import_error_codes.TodoErrorCode.INVALID_TODO_STATUS,
62
62
  TODO_ERROR_SCOPE,
63
- import_core.ErrorType.USER,
63
+ import_errors.ErrorType.USER,
64
64
  `Invalid todo status: ${status}. Must be 'pending', 'in_progress', or 'completed'`,
65
65
  { status }
66
66
  );
@@ -69,10 +69,10 @@ class TodoError {
69
69
  * Database error
70
70
  */
71
71
  static databaseError(operation, cause) {
72
- return new import_core.DextoRuntimeError(
72
+ return new import_errors.DextoRuntimeError(
73
73
  import_error_codes.TodoErrorCode.DATABASE_ERROR,
74
74
  TODO_ERROR_SCOPE,
75
- import_core.ErrorType.SYSTEM,
75
+ import_errors.ErrorType.SYSTEM,
76
76
  `Database error during ${operation}: ${cause}`,
77
77
  { operation, cause }
78
78
  );
package/dist/errors.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Error factory for todo list management operations
5
5
  */
6
- import { DextoRuntimeError } from '@dexto/core';
6
+ import { DextoRuntimeError } from '@dexto/core/errors';
7
7
  /**
8
8
  * Factory class for creating Todo-related errors
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AASvE;;GAEG;AACH,qBAAa,SAAS;IAClB,OAAO;IAIP;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,iBAAiB;IAW1C;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB;IAWzE;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB;IAUvD;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB;CAS5E"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAyB,MAAM,oBAAoB,CAAC;AAS9E;;GAEG;AACH,qBAAa,SAAS;IAClB,OAAO;IAIP;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,iBAAiB;IAW1C;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB;IAWzE;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB;IAUvD;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB;CAS5E"}
package/dist/errors.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DextoRuntimeError, ErrorType } from "@dexto/core";
1
+ import { DextoRuntimeError, ErrorType } from "@dexto/core/errors";
2
2
  import { TodoErrorCode } from "./error-codes.js";
3
3
  const TODO_ERROR_SCOPE = "todo";
4
4
  class TodoError {
package/dist/index.d.cts CHANGED
@@ -1,6 +1,10 @@
1
1
  import { ToolFactory } from '@dexto/agent-config';
2
2
  import { z } from 'zod';
3
- import { Database, AgentEventBus, Logger, DextoRuntimeError, ToolExecutionContext, Tool } from '@dexto/core';
3
+ import { AgentEventBus } from '@dexto/core/events';
4
+ import { Logger } from '@dexto/core/logger';
5
+ import { ToolStateStore } from '@dexto/core/storage';
6
+ import { DextoRuntimeError } from '@dexto/core/errors';
7
+ import { ToolExecutionContext, Tool } from '@dexto/core/tools';
4
8
 
5
9
  /**
6
10
  * Todo Tools Factory
@@ -89,12 +93,12 @@ type TodoEventEmitter = Pick<AgentEventBus, 'emit'>;
89
93
  * TodoService - Manages todo lists for agent workflow tracking
90
94
  */
91
95
  declare class TodoService {
92
- private database;
96
+ private toolState;
93
97
  private eventBus;
94
98
  private logger;
95
99
  private config;
96
100
  private initialized;
97
- constructor(database: Database, eventBus: TodoEventEmitter, logger: Logger, config?: TodoConfig);
101
+ constructor(toolState: ToolStateStore, eventBus: TodoEventEmitter, logger: Logger, config?: TodoConfig);
98
102
  /**
99
103
  * Initialize the service
100
104
  */
@@ -108,9 +112,9 @@ declare class TodoService {
108
112
  */
109
113
  getTodos(sessionId: string): Promise<Todo[]>;
110
114
  /**
111
- * Generate database key for session todos
115
+ * Generate state key for session todos
112
116
  */
113
- private getTodosDatabaseKey;
117
+ private getTodosStateKey;
114
118
  /**
115
119
  * Generate consistent key for todo matching (content + activeForm)
116
120
  * Uses JSON encoding to prevent collisions when fields contain delimiters
@@ -22,19 +22,19 @@ __export(todo_service_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(todo_service_exports);
24
24
  var import_nanoid = require("nanoid");
25
- var import_core = require("@dexto/core");
26
- var import_errors = require("./errors.js");
25
+ var import_errors = require("@dexto/core/errors");
26
+ var import_errors2 = require("./errors.js");
27
27
  var import_types = require("./types.js");
28
28
  const DEFAULT_MAX_TODOS = 100;
29
- const TODOS_KEY_PREFIX = "todos:";
29
+ const TODO_TOOL_STATE_NAME = "todo";
30
30
  class TodoService {
31
- database;
31
+ toolState;
32
32
  eventBus;
33
33
  logger;
34
34
  config;
35
35
  initialized = false;
36
- constructor(database, eventBus, logger, config = {}) {
37
- this.database = database;
36
+ constructor(toolState, eventBus, logger, config = {}) {
37
+ this.toolState = toolState;
38
38
  this.eventBus = eventBus;
39
39
  this.logger = logger;
40
40
  this.config = {
@@ -58,10 +58,10 @@ class TodoService {
58
58
  */
59
59
  async updateTodos(sessionId, todoInputs) {
60
60
  if (!this.initialized) {
61
- throw import_errors.TodoError.notInitialized();
61
+ throw import_errors2.TodoError.notInitialized();
62
62
  }
63
63
  if (todoInputs.length > this.config.maxTodosPerSession) {
64
- throw import_errors.TodoError.todoLimitExceeded(todoInputs.length, this.config.maxTodosPerSession);
64
+ throw import_errors2.TodoError.todoLimitExceeded(todoInputs.length, this.config.maxTodosPerSession);
65
65
  }
66
66
  try {
67
67
  const existing = await this.getTodos(sessionId);
@@ -100,8 +100,11 @@ class TodoService {
100
100
  }
101
101
  }
102
102
  stats.deleted = existingMap.size;
103
- const key = this.getTodosDatabaseKey(sessionId);
104
- await this.database.set(key, newTodos);
103
+ await this.toolState.set({
104
+ toolName: TODO_TOOL_STATE_NAME,
105
+ key: this.getTodosStateKey(sessionId),
106
+ value: newTodos
107
+ });
105
108
  if (this.config.enableEvents) {
106
109
  this.eventBus.emit("service:event", {
107
110
  service: "todo",
@@ -122,10 +125,10 @@ class TodoService {
122
125
  ...stats
123
126
  };
124
127
  } catch (error) {
125
- if (error instanceof import_core.DextoRuntimeError) {
128
+ if (error instanceof import_errors.DextoRuntimeError) {
126
129
  throw error;
127
130
  }
128
- throw import_errors.TodoError.databaseError(
131
+ throw import_errors2.TodoError.databaseError(
129
132
  "updateTodos",
130
133
  error instanceof Error ? error.message : String(error)
131
134
  );
@@ -136,27 +139,29 @@ class TodoService {
136
139
  */
137
140
  async getTodos(sessionId) {
138
141
  if (!this.initialized) {
139
- throw import_errors.TodoError.notInitialized();
142
+ throw import_errors2.TodoError.notInitialized();
140
143
  }
141
144
  try {
142
- const key = this.getTodosDatabaseKey(sessionId);
143
- const todos = await this.database.get(key);
145
+ const todos = await this.toolState.get({
146
+ toolName: TODO_TOOL_STATE_NAME,
147
+ key: this.getTodosStateKey(sessionId)
148
+ });
144
149
  return todos || [];
145
150
  } catch (error) {
146
- if (error instanceof import_core.DextoRuntimeError) {
151
+ if (error instanceof import_errors.DextoRuntimeError) {
147
152
  throw error;
148
153
  }
149
- throw import_errors.TodoError.databaseError(
154
+ throw import_errors2.TodoError.databaseError(
150
155
  "getTodos",
151
156
  error instanceof Error ? error.message : String(error)
152
157
  );
153
158
  }
154
159
  }
155
160
  /**
156
- * Generate database key for session todos
161
+ * Generate state key for session todos
157
162
  */
158
- getTodosDatabaseKey(sessionId) {
159
- return `${TODOS_KEY_PREFIX}${sessionId}`;
163
+ getTodosStateKey(sessionId) {
164
+ return `sessions:${sessionId}:todos`;
160
165
  }
161
166
  /**
162
167
  * Generate consistent key for todo matching (content + activeForm)
@@ -177,7 +182,7 @@ class TodoService {
177
182
  */
178
183
  validateTodoStatus(status) {
179
184
  if (!import_types.TODO_STATUS_VALUES.includes(status)) {
180
- throw import_errors.TodoError.invalidStatus(status);
185
+ throw import_errors2.TodoError.invalidStatus(status);
181
186
  }
182
187
  }
183
188
  }
@@ -4,19 +4,21 @@
4
4
  * Manages todo lists for tracking agent workflow and task progress.
5
5
  * Emits events through the AgentEventBus using the service:event pattern.
6
6
  */
7
- import type { Database, AgentEventBus, Logger } from '@dexto/core';
7
+ import type { AgentEventBus } from '@dexto/core/events';
8
+ import type { Logger } from '@dexto/core/logger';
9
+ import type { ToolStateStore } from '@dexto/core/storage';
8
10
  import type { Todo, TodoInput, TodoUpdateResult, TodoConfig } from './types.js';
9
11
  type TodoEventEmitter = Pick<AgentEventBus, 'emit'>;
10
12
  /**
11
13
  * TodoService - Manages todo lists for agent workflow tracking
12
14
  */
13
15
  export declare class TodoService {
14
- private database;
16
+ private toolState;
15
17
  private eventBus;
16
18
  private logger;
17
19
  private config;
18
20
  private initialized;
19
- constructor(database: Database, eventBus: TodoEventEmitter, logger: Logger, config?: TodoConfig);
21
+ constructor(toolState: ToolStateStore, eventBus: TodoEventEmitter, logger: Logger, config?: TodoConfig);
20
22
  /**
21
23
  * Initialize the service
22
24
  */
@@ -30,9 +32,9 @@ export declare class TodoService {
30
32
  */
31
33
  getTodos(sessionId: string): Promise<Todo[]>;
32
34
  /**
33
- * Generate database key for session todos
35
+ * Generate state key for session todos
34
36
  */
35
- private getTodosDatabaseKey;
37
+ private getTodosStateKey;
36
38
  /**
37
39
  * Generate consistent key for todo matching (content + activeForm)
38
40
  * Uses JSON encoding to prevent collisions when fields contain delimiters
@@ -1 +1 @@
1
- {"version":3,"file":"todo-service.d.ts","sourceRoot":"","sources":["../src/todo-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAc,MAAM,YAAY,CAAC;AAM5F,KAAK,gBAAgB,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAEpD;;GAEG;AACH,qBAAa,WAAW;IACpB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAkB;gBAGjC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,UAAe;IAW3B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAUjC;;OAEG;IACG,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAgGxF;;OAEG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAoBlD;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;;OAGG;IACH,OAAO,CAAC,UAAU;IAIlB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAK7B"}
1
+ {"version":3,"file":"todo-service.d.ts","sourceRoot":"","sources":["../src/todo-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAc,MAAM,YAAY,CAAC;AAM5F,KAAK,gBAAgB,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAEpD;;GAEG;AACH,qBAAa,WAAW;IACpB,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAkB;gBAGjC,SAAS,EAAE,cAAc,EACzB,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,UAAe;IAW3B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAUjC;;OAEG;IACG,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAkGxF;;OAEG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAsBlD;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAIlB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAK7B"}
@@ -1,17 +1,17 @@
1
1
  import { nanoid } from "nanoid";
2
- import { DextoRuntimeError } from "@dexto/core";
2
+ import { DextoRuntimeError } from "@dexto/core/errors";
3
3
  import { TodoError } from "./errors.js";
4
4
  import { TODO_STATUS_VALUES } from "./types.js";
5
5
  const DEFAULT_MAX_TODOS = 100;
6
- const TODOS_KEY_PREFIX = "todos:";
6
+ const TODO_TOOL_STATE_NAME = "todo";
7
7
  class TodoService {
8
- database;
8
+ toolState;
9
9
  eventBus;
10
10
  logger;
11
11
  config;
12
12
  initialized = false;
13
- constructor(database, eventBus, logger, config = {}) {
14
- this.database = database;
13
+ constructor(toolState, eventBus, logger, config = {}) {
14
+ this.toolState = toolState;
15
15
  this.eventBus = eventBus;
16
16
  this.logger = logger;
17
17
  this.config = {
@@ -77,8 +77,11 @@ class TodoService {
77
77
  }
78
78
  }
79
79
  stats.deleted = existingMap.size;
80
- const key = this.getTodosDatabaseKey(sessionId);
81
- await this.database.set(key, newTodos);
80
+ await this.toolState.set({
81
+ toolName: TODO_TOOL_STATE_NAME,
82
+ key: this.getTodosStateKey(sessionId),
83
+ value: newTodos
84
+ });
82
85
  if (this.config.enableEvents) {
83
86
  this.eventBus.emit("service:event", {
84
87
  service: "todo",
@@ -116,8 +119,10 @@ class TodoService {
116
119
  throw TodoError.notInitialized();
117
120
  }
118
121
  try {
119
- const key = this.getTodosDatabaseKey(sessionId);
120
- const todos = await this.database.get(key);
122
+ const todos = await this.toolState.get({
123
+ toolName: TODO_TOOL_STATE_NAME,
124
+ key: this.getTodosStateKey(sessionId)
125
+ });
121
126
  return todos || [];
122
127
  } catch (error) {
123
128
  if (error instanceof DextoRuntimeError) {
@@ -130,10 +135,10 @@ class TodoService {
130
135
  }
131
136
  }
132
137
  /**
133
- * Generate database key for session todos
138
+ * Generate state key for session todos
134
139
  */
135
- getTodosDatabaseKey(sessionId) {
136
- return `${TODOS_KEY_PREFIX}${sessionId}`;
140
+ getTodosStateKey(sessionId) {
141
+ return `sessions:${sessionId}:todos`;
137
142
  }
138
143
  /**
139
144
  * Generate consistent key for todo matching (content + activeForm)
@@ -22,7 +22,7 @@ __export(todo_write_tool_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(todo_write_tool_exports);
24
24
  var import_zod = require("zod");
25
- var import_core = require("@dexto/core");
25
+ var import_tools = require("@dexto/core/tools");
26
26
  var import_types = require("./types.js");
27
27
  const TodoItemSchema = import_zod.z.object({
28
28
  content: import_zod.z.string().min(1).describe('Task description in imperative form (e.g., "Fix authentication bug")'),
@@ -48,7 +48,7 @@ const TodoWriteInputSchema = import_zod.z.object({
48
48
  "Manage todo list for current session. Replaces the entire todo list with the provided items."
49
49
  );
50
50
  function createTodoWriteTool(getTodoService) {
51
- return (0, import_core.defineTool)({
51
+ return (0, import_tools.defineTool)({
52
52
  id: "todo_write",
53
53
  description: `Track progress on multi-step tasks. Use for:
54
54
  - Implementation tasks with 3+ steps (features, refactors, bug fixes)
@@ -60,7 +60,7 @@ Do NOT use for simple single-file edits, quick questions, or explanations.
60
60
  IMPORTANT: This replaces the entire todo list. Always include ALL tasks (pending, in_progress, completed). Only ONE task should be in_progress at a time. Update status as you work: pending \u2192 in_progress \u2192 completed.`,
61
61
  inputSchema: TodoWriteInputSchema,
62
62
  presentation: {
63
- describeHeader: (input) => (0, import_core.createLocalToolCallHeader)({
63
+ describeHeader: (input) => (0, import_tools.createLocalToolCallHeader)({
64
64
  title: "Update Todos",
65
65
  argsText: `${input.todos.length} items`
66
66
  })
@@ -4,7 +4,7 @@
4
4
  * Manages todo lists for tracking agent progress and workflow organization
5
5
  */
6
6
  import { z } from 'zod';
7
- import type { Tool, ToolExecutionContext } from '@dexto/core';
7
+ import type { Tool, ToolExecutionContext } from '@dexto/core/tools';
8
8
  import type { TodoService } from './todo-service.js';
9
9
  /**
10
10
  * Zod schema for todo_write tool input
@@ -1 +1 @@
1
- {"version":3,"file":"todo-write-tool.d.ts","sourceRoot":"","sources":["../src/todo-write-tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA0BrD;;GAEG;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;kBAoBrB,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAExF,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,iBAAiB,GAClC,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAwCnC"}
1
+ {"version":3,"file":"todo-write-tool.d.ts","sourceRoot":"","sources":["../src/todo-write-tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA0BrD;;GAEG;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;kBAoBrB,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAExF,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,iBAAiB,GAClC,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAwCnC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { createLocalToolCallHeader, defineTool } from "@dexto/core";
2
+ import { createLocalToolCallHeader, defineTool } from "@dexto/core/tools";
3
3
  import { TODO_STATUS_VALUES } from "./types.js";
4
4
  const TodoItemSchema = z.object({
5
5
  content: z.string().min(1).describe('Task description in imperative form (e.g., "Fix authentication bug")'),
@@ -21,7 +21,7 @@ __export(tool_factory_exports, {
21
21
  todoToolsFactory: () => todoToolsFactory
22
22
  });
23
23
  module.exports = __toCommonJS(tool_factory_exports);
24
- var import_core = require("@dexto/core");
24
+ var import_tools = require("@dexto/core/tools");
25
25
  var import_todo_service = require("./todo-service.js");
26
26
  var import_todo_write_tool = require("./todo-write-tool.js");
27
27
  var import_tool_factory_config = require("./tool-factory-config.js");
@@ -39,17 +39,15 @@ const todoToolsFactory = {
39
39
  return todoService;
40
40
  }
41
41
  const logger = context.logger;
42
- const database = context.storage?.database;
43
- if (!database) {
44
- throw import_core.ToolError.configInvalid(
45
- "todo-tools requires ToolExecutionContext.storage.database"
46
- );
42
+ const toolState = context.toolState;
43
+ if (!toolState) {
44
+ throw import_tools.ToolError.configInvalid("todo-tools requires ToolExecutionContext.toolState");
47
45
  }
48
46
  const agent = context.agent;
49
47
  if (!agent) {
50
- throw import_core.ToolError.configInvalid("todo-tools requires ToolExecutionContext.agent");
48
+ throw import_tools.ToolError.configInvalid("todo-tools requires ToolExecutionContext.agent");
51
49
  }
52
- todoService = new import_todo_service.TodoService(database, agent, logger, {
50
+ todoService = new import_todo_service.TodoService(toolState, agent, logger, {
53
51
  maxTodosPerSession: config.maxTodosPerSession,
54
52
  enableEvents: config.enableEvents
55
53
  });
@@ -1 +1 @@
1
- {"version":3,"file":"tool-factory.d.ts","sourceRoot":"","sources":["../src/tool-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEvF,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,eAAe,CAsCzD,CAAC"}
1
+ {"version":3,"file":"tool-factory.d.ts","sourceRoot":"","sources":["../src/tool-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEvF,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,eAAe,CAoCzD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ToolError } from "@dexto/core";
1
+ import { ToolError } from "@dexto/core/tools";
2
2
  import { TodoService } from "./todo-service.js";
3
3
  import { createTodoWriteTool } from "./todo-write-tool.js";
4
4
  import { TodoToolsConfigSchema } from "./tool-factory-config.js";
@@ -16,17 +16,15 @@ const todoToolsFactory = {
16
16
  return todoService;
17
17
  }
18
18
  const logger = context.logger;
19
- const database = context.storage?.database;
20
- if (!database) {
21
- throw ToolError.configInvalid(
22
- "todo-tools requires ToolExecutionContext.storage.database"
23
- );
19
+ const toolState = context.toolState;
20
+ if (!toolState) {
21
+ throw ToolError.configInvalid("todo-tools requires ToolExecutionContext.toolState");
24
22
  }
25
23
  const agent = context.agent;
26
24
  if (!agent) {
27
25
  throw ToolError.configInvalid("todo-tools requires ToolExecutionContext.agent");
28
26
  }
29
- todoService = new TodoService(database, agent, logger, {
27
+ todoService = new TodoService(toolState, agent, logger, {
30
28
  maxTodosPerSession: config.maxTodosPerSession,
31
29
  enableEvents: config.enableEvents
32
30
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dexto/tools-todo",
3
- "version": "1.7.1",
3
+ "version": "1.8.0",
4
4
  "description": "Todo/task tracking tools factory for Dexto agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -20,8 +20,8 @@
20
20
  "dependencies": {
21
21
  "nanoid": "^5.0.9",
22
22
  "zod": "^4.3.6",
23
- "@dexto/agent-config": "1.7.1",
24
- "@dexto/core": "1.7.1"
23
+ "@dexto/agent-config": "1.8.0",
24
+ "@dexto/core": "1.8.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "tsup": "^8.0.0",