@elizaos/plugin-todos 2.0.0-beta.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.
- package/dist/actions/todo.d.ts +3 -0
- package/dist/actions/todo.d.ts.map +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/schema.d.ts +249 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4991 -0
- package/dist/index.js.map +88 -0
- package/dist/providers/current-todos.d.ts +11 -0
- package/dist/providers/current-todos.d.ts.map +1 -0
- package/dist/service.d.ts +70 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/types.d.ts +33 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Provider } from "@elizaos/core";
|
|
2
|
+
/**
|
|
3
|
+
* Surface the user's current todo list to the planner each turn.
|
|
4
|
+
* Mirrors how Claude Code keeps the TodoWrite list in the model's context.
|
|
5
|
+
* Returns empty text when the user has no active todos.
|
|
6
|
+
*
|
|
7
|
+
* Scoping: by `entityId` (user) — todos persist across rooms for the same user.
|
|
8
|
+
* Pending + in_progress are always shown; completed/cancelled are excluded.
|
|
9
|
+
*/
|
|
10
|
+
export declare const currentTodosProvider: Provider;
|
|
11
|
+
//# sourceMappingURL=current-todos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"current-todos.d.ts","sourceRoot":"","sources":["../../src/providers/current-todos.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,QAAQ,EAGd,MAAM,eAAe,CAAC;AAsBvB;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,QA+BlC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type IAgentRuntime, Service } from "@elizaos/core";
|
|
2
|
+
import { type Todo, type TodoStatus } from "./types.js";
|
|
3
|
+
export interface TodoFilter {
|
|
4
|
+
entityId: string;
|
|
5
|
+
agentId?: string;
|
|
6
|
+
roomId?: string | null;
|
|
7
|
+
status?: TodoStatus | TodoStatus[];
|
|
8
|
+
includeCompleted?: boolean;
|
|
9
|
+
limit?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CreateTodoInput {
|
|
12
|
+
entityId: string;
|
|
13
|
+
agentId: string;
|
|
14
|
+
roomId?: string | null;
|
|
15
|
+
worldId?: string | null;
|
|
16
|
+
content: string;
|
|
17
|
+
activeForm?: string;
|
|
18
|
+
status?: TodoStatus;
|
|
19
|
+
parentTodoId?: string | null;
|
|
20
|
+
parentTrajectoryStepId?: string | null;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface UpdateTodoInput {
|
|
24
|
+
content?: string;
|
|
25
|
+
activeForm?: string;
|
|
26
|
+
status?: TodoStatus;
|
|
27
|
+
parentTodoId?: string | null;
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export declare class TodosService extends Service {
|
|
31
|
+
static readonly serviceType = "todos";
|
|
32
|
+
capabilityDescription: string;
|
|
33
|
+
private getDb;
|
|
34
|
+
static start(runtime: IAgentRuntime): Promise<TodosService>;
|
|
35
|
+
stop(): Promise<void>;
|
|
36
|
+
create(input: CreateTodoInput): Promise<Todo>;
|
|
37
|
+
get(id: string): Promise<Todo | null>;
|
|
38
|
+
list(filter: TodoFilter): Promise<Todo[]>;
|
|
39
|
+
update(id: string, patch: UpdateTodoInput): Promise<Todo | null>;
|
|
40
|
+
delete(id: string): Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Bulk-replace the user's todo list for a given (entityId, roomId) scope.
|
|
43
|
+
* Mirrors Claude Code's TodoWrite contract: the caller passes the full
|
|
44
|
+
* desired list, and the store reconciles. Existing rows are matched by id;
|
|
45
|
+
* absent rows are deleted; new rows are inserted.
|
|
46
|
+
*/
|
|
47
|
+
writeList(args: {
|
|
48
|
+
entityId: string;
|
|
49
|
+
agentId: string;
|
|
50
|
+
roomId: string | null;
|
|
51
|
+
worldId: string | null;
|
|
52
|
+
parentTrajectoryStepId: string | null;
|
|
53
|
+
todos: Array<{
|
|
54
|
+
id?: string;
|
|
55
|
+
content: string;
|
|
56
|
+
status: TodoStatus;
|
|
57
|
+
activeForm?: string;
|
|
58
|
+
}>;
|
|
59
|
+
}): Promise<{
|
|
60
|
+
before: Todo[];
|
|
61
|
+
after: Todo[];
|
|
62
|
+
}>;
|
|
63
|
+
clear(filter: {
|
|
64
|
+
entityId: string;
|
|
65
|
+
agentId?: string;
|
|
66
|
+
roomId?: string | null;
|
|
67
|
+
}): Promise<number>;
|
|
68
|
+
}
|
|
69
|
+
export declare function getTodosService(runtime: IAgentRuntime): TodosService;
|
|
70
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAU,OAAO,EAAa,MAAM,eAAe,CAAC;AAK/E,OAAO,EAGL,KAAK,IAAI,EACT,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,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,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;QACtC,KAAK,EAAE,KAAK,CAAC;YACX,EAAE,CAAC,EAAE,MAAM,CAAC;YACZ,OAAO,EAAE,MAAM,CAAC;YAChB,MAAM,EAAE,UAAU,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC,CAAC;KACJ,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAAC,KAAK,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IAuDxC,KAAK,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACxB,GAAG,OAAO,CAAC,MAAM,CAAC;CAepB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAQpE"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const TODOS_LOG_PREFIX = "[Todos]";
|
|
2
|
+
export declare const TODOS_SERVICE_TYPE = "todos";
|
|
3
|
+
export declare const TODO_STATUSES: readonly ["pending", "in_progress", "completed", "cancelled"];
|
|
4
|
+
export type TodoStatus = (typeof TODO_STATUSES)[number];
|
|
5
|
+
export declare const TODO_OPS: readonly ["write", "create", "update", "complete", "cancel", "delete", "list", "clear"];
|
|
6
|
+
export type TodoOp = (typeof TODO_OPS)[number];
|
|
7
|
+
export interface Todo {
|
|
8
|
+
id: string;
|
|
9
|
+
entityId: string;
|
|
10
|
+
agentId: string;
|
|
11
|
+
roomId: string | null;
|
|
12
|
+
worldId: string | null;
|
|
13
|
+
content: string;
|
|
14
|
+
activeForm: string;
|
|
15
|
+
status: TodoStatus;
|
|
16
|
+
parentTodoId: string | null;
|
|
17
|
+
parentTrajectoryStepId: string | null;
|
|
18
|
+
metadata: Record<string, unknown>;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
21
|
+
completedAt: Date | null;
|
|
22
|
+
}
|
|
23
|
+
export interface TodoInput {
|
|
24
|
+
id?: string;
|
|
25
|
+
content: string;
|
|
26
|
+
status: TodoStatus;
|
|
27
|
+
activeForm?: string;
|
|
28
|
+
parentTodoId?: string | null;
|
|
29
|
+
}
|
|
30
|
+
export declare const TODOS_CONTEXTS: readonly ["tasks", "todos", "automation"];
|
|
31
|
+
export type TodosContext = (typeof TODOS_CONTEXTS)[number];
|
|
32
|
+
export declare const TODO_FAILURE_TEXT_PREFIX = "[Todos]";
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,eAAO,MAAM,aAAa,+DAKhB,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,eAAO,MAAM,QAAQ,yFASX,CAAC;AACX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,cAAc,2CAA4C,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,eAAO,MAAM,wBAAwB,YAAY,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elizaos/plugin-todos",
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
|
+
"description": "User-scoped persistent todos with CRUD. Single TODO umbrella action (op-based: write/create/update/complete/cancel/delete/list/clear) and a currentTodosProvider that surfaces the user's pending + in-progress todos to the planner each turn. Backed by drizzle pgSchema('todos').",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/elizaos/eliza.git"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"eliza",
|
|
27
|
+
"plugin",
|
|
28
|
+
"todos",
|
|
29
|
+
"todo",
|
|
30
|
+
"tasks",
|
|
31
|
+
"agent"
|
|
32
|
+
],
|
|
33
|
+
"author": "elizaOS",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@elizaos/core": "2.0.0-beta.1",
|
|
37
|
+
"drizzle-orm": "^0.45.1"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@elizaos/plugin-sql": "2.0.0-beta.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^25.0.3",
|
|
44
|
+
"typescript": "^6.0.3",
|
|
45
|
+
"vitest": "^4.0.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "bun run build.ts",
|
|
49
|
+
"dev": "bun --hot build.ts",
|
|
50
|
+
"clean": "rm -rf dist .turbo",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"typecheck": "bunx tsc --noEmit -p tsconfig.json",
|
|
53
|
+
"lint": "echo \"Lint skipped\"",
|
|
54
|
+
"lint:check": "bun run lint",
|
|
55
|
+
"check": "bun run typecheck && bun run test"
|
|
56
|
+
},
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
60
|
+
"agentConfig": {
|
|
61
|
+
"pluginType": "elizaos:plugin:1.0.0",
|
|
62
|
+
"pluginParameters": {}
|
|
63
|
+
},
|
|
64
|
+
"eliza": {
|
|
65
|
+
"platforms": [
|
|
66
|
+
"node"
|
|
67
|
+
],
|
|
68
|
+
"runtime": "node",
|
|
69
|
+
"platformDetails": {
|
|
70
|
+
"node": "Default export (Node.js)"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|