@elizaos/plugin-todos 2.0.3-beta.6 → 2.0.3-beta.7
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 +17 -0
- package/dist/actions/todo.d.ts.map +1 -0
- package/dist/actions/todo.js +582 -0
- package/dist/actions/todo.js.map +1 -0
- package/dist/components/todos/TodosSpatialView.d.ts +46 -0
- package/dist/components/todos/TodosSpatialView.d.ts.map +1 -0
- package/dist/components/todos/TodosSpatialView.js +72 -0
- package/dist/components/todos/TodosSpatialView.js.map +1 -0
- package/dist/components/todos/TodosView.d.ts +41 -0
- package/dist/components/todos/TodosView.d.ts.map +1 -0
- package/dist/components/todos/TodosView.js +163 -0
- package/dist/components/todos/TodosView.js.map +1 -0
- package/dist/components/todos/todos-view-bundle.d.ts +2 -0
- package/dist/components/todos/todos-view-bundle.d.ts.map +1 -0
- package/dist/components/todos/todos-view-bundle.js +5 -0
- package/dist/components/todos/todos-view-bundle.js.map +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +2 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema.d.ts +249 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +45 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/current-todos.d.ts +11 -0
- package/dist/providers/current-todos.d.ts.map +1 -0
- package/dist/providers/current-todos.js +45 -0
- package/dist/providers/current-todos.js.map +1 -0
- package/dist/register-terminal-view.d.ts +15 -0
- package/dist/register-terminal-view.d.ts.map +1 -0
- package/dist/register-terminal-view.js +26 -0
- package/dist/register-terminal-view.js.map +1 -0
- package/dist/register.d.ts +9 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +5 -0
- package/dist/register.js.map +1 -0
- package/dist/service.d.ts +70 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +189 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +35 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +31 -0
- package/dist/types.js.map +1 -0
- package/dist/views/bundle.js +266 -0
- package/dist/views/bundle.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TodosSpatialView — the owner three-lane todo board authored once with the
|
|
3
|
+
* spatial vocabulary, so it renders correctly wherever it is displayed:
|
|
4
|
+
*
|
|
5
|
+
* - GUI / XR — mounted in `<SpatialSurface>` (DOM; XR scales up).
|
|
6
|
+
* - TUI — rendered to real terminal lines by the agent terminal, via
|
|
7
|
+
* `registerSpatialTerminalView` (see `register-terminal-view.tsx`).
|
|
8
|
+
*
|
|
9
|
+
* It is purely presentational (a snapshot + an action callback in, primitives
|
|
10
|
+
* out) and imports only the cross-modality primitives, so it is safe to render
|
|
11
|
+
* in the Node agent process where the terminal lives (no browser/client import).
|
|
12
|
+
*
|
|
13
|
+
* Lanes (Today / Upcoming / Someday) are computed in the data wrapper
|
|
14
|
+
* ({@link ./TodosView.tsx}) and handed in already grouped; this component never
|
|
15
|
+
* fetches or computes — it displays the snapshot and dispatches actions.
|
|
16
|
+
*/
|
|
17
|
+
export type LaneId = "today" | "upcoming" | "someday";
|
|
18
|
+
/** A single board item, already projected to display shape by the wrapper. */
|
|
19
|
+
export interface TodoCard {
|
|
20
|
+
id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
/** "in_progress" runs the busy dot; "pending" is idle. */
|
|
23
|
+
inProgress: boolean;
|
|
24
|
+
/** Pre-formatted due label (e.g. "Jun 24"), or empty when none. */
|
|
25
|
+
due: string;
|
|
26
|
+
}
|
|
27
|
+
/** Which render state the board is in. */
|
|
28
|
+
export type TodosViewState = "loading" | "error" | "empty" | "ready";
|
|
29
|
+
export interface TodosSnapshot {
|
|
30
|
+
/** The board state machine. */
|
|
31
|
+
state: TodosViewState;
|
|
32
|
+
/** Active todos grouped by lane (only meaningful when state === "ready"). */
|
|
33
|
+
lanes: Record<LaneId, TodoCard[]>;
|
|
34
|
+
/** Count of active todos already past due (proactive signal). */
|
|
35
|
+
overdue: number;
|
|
36
|
+
/** Error message when state === "error". */
|
|
37
|
+
error?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare const EMPTY_LANES: Record<LaneId, TodoCard[]>;
|
|
40
|
+
export interface TodosSpatialViewProps {
|
|
41
|
+
snapshot: TodosSnapshot;
|
|
42
|
+
/** Dispatch by agent id: `add` (route to chat), `retry` (reload). */
|
|
43
|
+
onAction?: (action: string) => void;
|
|
44
|
+
}
|
|
45
|
+
export declare function TodosSpatialView({ snapshot, onAction, }: TodosSpatialViewProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
//# sourceMappingURL=TodosSpatialView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TodosSpatialView.d.ts","sourceRoot":"","sources":["../../../src/components/todos/TodosSpatialView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAEtD,8EAA8E;AAC9E,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,UAAU,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAarE,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,KAAK,EAAE,cAAc,CAAC;IACtB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClC,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAIlD,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,aAAa,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,QAAQ,GACT,EAAE,qBAAqB,2CAkBvB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Card, HStack, List, Text, VStack } from "@elizaos/ui/spatial";
|
|
3
|
+
const LANES = [
|
|
4
|
+
{ id: "today", label: "Today" },
|
|
5
|
+
{ id: "upcoming", label: "Upcoming" },
|
|
6
|
+
{ id: "someday", label: "Someday" }
|
|
7
|
+
];
|
|
8
|
+
const EMPTY_LANES = {
|
|
9
|
+
today: [],
|
|
10
|
+
upcoming: [],
|
|
11
|
+
someday: []
|
|
12
|
+
};
|
|
13
|
+
function TodosSpatialView({
|
|
14
|
+
snapshot,
|
|
15
|
+
onAction
|
|
16
|
+
}) {
|
|
17
|
+
const dispatch = (action) => () => onAction?.(action);
|
|
18
|
+
return /* @__PURE__ */ jsx(Card, { gap: 1, padding: 1, children: snapshot.state === "loading" ? /* @__PURE__ */ jsx(Text, { tone: "muted", align: "center", style: "caption", children: "Loading" }) : snapshot.state === "error" ? /* @__PURE__ */ jsx(TodosErrorBody, { snapshot, dispatch }) : snapshot.state === "empty" ? /* @__PURE__ */ jsx(TodosEmptyBody, { dispatch }) : /* @__PURE__ */ jsx(TodosReadyBody, { snapshot }) });
|
|
19
|
+
}
|
|
20
|
+
function TodosErrorBody({
|
|
21
|
+
snapshot,
|
|
22
|
+
dispatch
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Text, { bold: true, children: "Could not load todos" }),
|
|
26
|
+
/* @__PURE__ */ jsx(Text, { tone: "danger", style: "caption", children: snapshot.error ?? "Could not load todos." }),
|
|
27
|
+
/* @__PURE__ */ jsx(HStack, { gap: 1, children: /* @__PURE__ */ jsx(Button, { agent: "retry", onPress: dispatch("retry"), children: "Retry" }) })
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
function TodosEmptyBody({
|
|
31
|
+
dispatch
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx(Text, { bold: true, children: "None" }),
|
|
35
|
+
/* @__PURE__ */ jsx(HStack, { gap: 1, children: /* @__PURE__ */ jsx(Button, { agent: "add", onPress: dispatch("add"), children: "Add" }) })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
function TodosReadyBody({ snapshot }) {
|
|
39
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
snapshot.overdue > 0 ? /* @__PURE__ */ jsx(Text, { tone: "warning", style: "caption", children: snapshot.overdue === 1 ? "1 todo is overdue." : `${snapshot.overdue} todos are overdue.` }) : null,
|
|
41
|
+
LANES.map((lane) => /* @__PURE__ */ jsx(Lane, { lane, todos: snapshot.lanes[lane.id] }, lane.id))
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
function Lane({ lane, todos }) {
|
|
45
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ jsxs(Text, { style: "caption", tone: "muted", children: [
|
|
47
|
+
lane.label,
|
|
48
|
+
" (",
|
|
49
|
+
todos.length,
|
|
50
|
+
")"
|
|
51
|
+
] }),
|
|
52
|
+
todos.length > 0 ? /* @__PURE__ */ jsx(List, { gap: 0, children: todos.map((todo) => /* @__PURE__ */ jsxs(
|
|
53
|
+
HStack,
|
|
54
|
+
{
|
|
55
|
+
gap: 1,
|
|
56
|
+
align: "center",
|
|
57
|
+
agent: `todo-${todo.id}`,
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsx(Text, { tone: todo.inProgress ? "primary" : "muted", wrap: false, children: todo.inProgress ? "\u25CF" : "\u25CB" }),
|
|
60
|
+
/* @__PURE__ */ jsx(VStack, { gap: 0, grow: 1, children: /* @__PURE__ */ jsx(Text, { bold: true, wrap: false, children: todo.title }) }),
|
|
61
|
+
todo.due ? /* @__PURE__ */ jsx(Text, { style: "caption", tone: "muted", wrap: false, children: todo.due }) : null
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
todo.id
|
|
65
|
+
)) }) : null
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
EMPTY_LANES,
|
|
70
|
+
TodosSpatialView
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=TodosSpatialView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/todos/TodosSpatialView.tsx"],"sourcesContent":["/**\n * TodosSpatialView — the owner three-lane todo board authored once with the\n * spatial vocabulary, so it renders correctly wherever it is displayed:\n *\n * - GUI / XR — mounted in `<SpatialSurface>` (DOM; XR scales up).\n * - TUI — rendered to real terminal lines by the agent terminal, via\n * `registerSpatialTerminalView` (see `register-terminal-view.tsx`).\n *\n * It is purely presentational (a snapshot + an action callback in, primitives\n * out) and imports only the cross-modality primitives, so it is safe to render\n * in the Node agent process where the terminal lives (no browser/client import).\n *\n * Lanes (Today / Upcoming / Someday) are computed in the data wrapper\n * ({@link ./TodosView.tsx}) and handed in already grouped; this component never\n * fetches or computes — it displays the snapshot and dispatches actions.\n */\n\nimport { Button, Card, HStack, List, Text, VStack } from \"@elizaos/ui/spatial\";\n\nexport type LaneId = \"today\" | \"upcoming\" | \"someday\";\n\n/** A single board item, already projected to display shape by the wrapper. */\nexport interface TodoCard {\n id: string;\n title: string;\n /** \"in_progress\" runs the busy dot; \"pending\" is idle. */\n inProgress: boolean;\n /** Pre-formatted due label (e.g. \"Jun 24\"), or empty when none. */\n due: string;\n}\n\n/** Which render state the board is in. */\nexport type TodosViewState = \"loading\" | \"error\" | \"empty\" | \"ready\";\n\ninterface LaneDef {\n id: LaneId;\n label: string;\n}\n\nconst LANES: readonly LaneDef[] = [\n { id: \"today\", label: \"Today\" },\n { id: \"upcoming\", label: \"Upcoming\" },\n { id: \"someday\", label: \"Someday\" },\n];\n\nexport interface TodosSnapshot {\n /** The board state machine. */\n state: TodosViewState;\n /** Active todos grouped by lane (only meaningful when state === \"ready\"). */\n lanes: Record<LaneId, TodoCard[]>;\n /** Count of active todos already past due (proactive signal). */\n overdue: number;\n /** Error message when state === \"error\". */\n error?: string;\n}\n\nexport const EMPTY_LANES: Record<LaneId, TodoCard[]> = {\n today: [],\n upcoming: [],\n someday: [],\n};\n\nexport interface TodosSpatialViewProps {\n snapshot: TodosSnapshot;\n /** Dispatch by agent id: `add` (route to chat), `retry` (reload). */\n onAction?: (action: string) => void;\n}\n\nexport function TodosSpatialView({\n snapshot,\n onAction,\n}: TodosSpatialViewProps) {\n const dispatch = (action: string) => () => onAction?.(action);\n\n return (\n <Card gap={1} padding={1}>\n {snapshot.state === \"loading\" ? (\n <Text tone=\"muted\" align=\"center\" style=\"caption\">\n Loading\n </Text>\n ) : snapshot.state === \"error\" ? (\n <TodosErrorBody snapshot={snapshot} dispatch={dispatch} />\n ) : snapshot.state === \"empty\" ? (\n <TodosEmptyBody dispatch={dispatch} />\n ) : (\n <TodosReadyBody snapshot={snapshot} />\n )}\n </Card>\n );\n}\n\nfunction TodosErrorBody({\n snapshot,\n dispatch,\n}: {\n snapshot: TodosSnapshot;\n dispatch: (action: string) => () => void;\n}) {\n return (\n <>\n <Text bold>Could not load todos</Text>\n <Text tone=\"danger\" style=\"caption\">\n {snapshot.error ?? \"Could not load todos.\"}\n </Text>\n <HStack gap={1}>\n <Button agent=\"retry\" onPress={dispatch(\"retry\")}>\n Retry\n </Button>\n </HStack>\n </>\n );\n}\n\nfunction TodosEmptyBody({\n dispatch,\n}: {\n dispatch: (action: string) => () => void;\n}) {\n return (\n <>\n <Text bold>None</Text>\n <HStack gap={1}>\n <Button agent=\"add\" onPress={dispatch(\"add\")}>\n Add\n </Button>\n </HStack>\n </>\n );\n}\n\nfunction TodosReadyBody({ snapshot }: { snapshot: TodosSnapshot }) {\n return (\n <>\n {snapshot.overdue > 0 ? (\n <Text tone=\"warning\" style=\"caption\">\n {snapshot.overdue === 1\n ? \"1 todo is overdue.\"\n : `${snapshot.overdue} todos are overdue.`}\n </Text>\n ) : null}\n {LANES.map((lane) => (\n <Lane key={lane.id} lane={lane} todos={snapshot.lanes[lane.id]} />\n ))}\n </>\n );\n}\n\nfunction Lane({ lane, todos }: { lane: LaneDef; todos: TodoCard[] }) {\n return (\n <>\n <Text style=\"caption\" tone=\"muted\">\n {lane.label} ({todos.length})\n </Text>\n {todos.length > 0 ? (\n <List gap={0}>\n {todos.map((todo) => (\n <HStack\n key={todo.id}\n gap={1}\n align=\"center\"\n agent={`todo-${todo.id}`}\n >\n <Text tone={todo.inProgress ? \"primary\" : \"muted\"} wrap={false}>\n {todo.inProgress ? \"●\" : \"○\"}\n </Text>\n <VStack gap={0} grow={1}>\n <Text bold wrap={false}>\n {todo.title}\n </Text>\n </VStack>\n {todo.due ? (\n <Text style=\"caption\" tone=\"muted\" wrap={false}>\n {todo.due}\n </Text>\n ) : null}\n </HStack>\n ))}\n </List>\n ) : null}\n </>\n );\n}\n"],"mappings":"AA6EQ,SAsBJ,UAtBI,KAsBJ,YAtBI;AA5DR,SAAS,QAAQ,MAAM,QAAQ,MAAM,MAAM,cAAc;AAsBzD,MAAM,QAA4B;AAAA,EAChC,EAAE,IAAI,SAAS,OAAO,QAAQ;AAAA,EAC9B,EAAE,IAAI,YAAY,OAAO,WAAW;AAAA,EACpC,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OAAO,SAAS,MAAM,KAAK,EAAE,KAAlD,KAAK,EAAgD,CACjE;AAAA,KACH;AAEJ;AAEA,SAAS,KAAK,EAAE,MAAM,MAAM,GAAyC;AACnE,SACE,iCACE;AAAA,yBAAC,QAAK,OAAM,WAAU,MAAK,SACxB;AAAA,WAAK;AAAA,MAAM;AAAA,MAAG,MAAM;AAAA,MAAO;AAAA,OAC9B;AAAA,IACC,MAAM,SAAS,IACd,oBAAC,QAAK,KAAK,GACR,gBAAM,IAAI,CAAC,SACV;AAAA,MAAC;AAAA;AAAA,QAEC,KAAK;AAAA,QACL,OAAM;AAAA,QACN,OAAO,QAAQ,KAAK,EAAE;AAAA,QAEtB;AAAA,8BAAC,QAAK,MAAM,KAAK,aAAa,YAAY,SAAS,MAAM,OACtD,eAAK,aAAa,WAAM,UAC3B;AAAA,UACA,oBAAC,UAAO,KAAK,GAAG,MAAM,GACpB,8BAAC,QAAK,MAAI,MAAC,MAAM,OACd,eAAK,OACR,GACF;AAAA,UACC,KAAK,MACJ,oBAAC,QAAK,OAAM,WAAU,MAAK,SAAQ,MAAM,OACtC,eAAK,KACR,IACE;AAAA;AAAA;AAAA,MAjBC,KAAK;AAAA,IAkBZ,CACD,GACH,IACE;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TodosView — the single GUI/XR data wrapper for the owner todo board.
|
|
3
|
+
*
|
|
4
|
+
* It owns the live todos data (the fetcher seam over the single read-only
|
|
5
|
+
* endpoint PA serves, the quiet background poll, wire->display mapping, lane
|
|
6
|
+
* grouping, and the overdue signal) and renders the one presentational
|
|
7
|
+
* {@link TodosSpatialView} inside a {@link SpatialSurface}. Omitting the
|
|
8
|
+
* `modality` prop lets `SpatialSurface` auto-detect GUI vs XR, so the SAME
|
|
9
|
+
* component serves both surfaces; the TUI surface renders the same
|
|
10
|
+
* `TodosSpatialView` through the terminal registry (see
|
|
11
|
+
* `../../register-terminal-view.tsx`).
|
|
12
|
+
*
|
|
13
|
+
* Data source (PA owns the shared scheduled-task spine; this plugin only reads):
|
|
14
|
+
* GET {base}/api/lifeops/todos -> { todos: TodoWire[] }
|
|
15
|
+
*
|
|
16
|
+
* The board is read-only: the only owner actions are `add` (route an add-a-todo
|
|
17
|
+
* request through the assistant chat — no fabricated todos) and `retry` (reload
|
|
18
|
+
* after an error). This plugin MUST NOT import from
|
|
19
|
+
* @elizaos/plugin-personal-assistant; the wire DTO below is declared locally to
|
|
20
|
+
* match the JSON shape PA emits.
|
|
21
|
+
*/
|
|
22
|
+
import type { ReactNode } from "react";
|
|
23
|
+
interface TodoWire {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
status: string;
|
|
27
|
+
dueDate: string | null;
|
|
28
|
+
}
|
|
29
|
+
interface TodosWire {
|
|
30
|
+
todos: TodoWire[];
|
|
31
|
+
}
|
|
32
|
+
export interface TodosFetchers {
|
|
33
|
+
fetchTodos: () => Promise<TodosWire>;
|
|
34
|
+
}
|
|
35
|
+
export interface TodosViewProps {
|
|
36
|
+
/** Test/host injection seam. Defaults to the real `/api/lifeops/todos` GET. */
|
|
37
|
+
fetchers?: TodosFetchers;
|
|
38
|
+
}
|
|
39
|
+
export declare function TodosView(props?: TodosViewProps): ReactNode;
|
|
40
|
+
export default TodosView;
|
|
41
|
+
//# sourceMappingURL=TodosView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TodosView.d.ts","sourceRoot":"","sources":["../../../src/components/todos/TodosView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAgBvC,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,UAAU,SAAS;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAMD,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;CACtC;AAcD,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAiGD,wBAAgB,SAAS,CAAC,KAAK,GAAE,cAAmB,GAAG,SAAS,CA+G/D;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { client } from "@elizaos/ui";
|
|
3
|
+
import { SpatialSurface } from "@elizaos/ui/spatial";
|
|
4
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import {
|
|
6
|
+
EMPTY_LANES,
|
|
7
|
+
TodosSpatialView
|
|
8
|
+
} from "./TodosSpatialView.js";
|
|
9
|
+
async function getTodos() {
|
|
10
|
+
const response = await fetch(`${client.getBaseUrl()}/api/lifeops/todos`);
|
|
11
|
+
if (!response.ok) {
|
|
12
|
+
throw new Error(`Todos request failed (${response.status})`);
|
|
13
|
+
}
|
|
14
|
+
return await response.json();
|
|
15
|
+
}
|
|
16
|
+
const defaultFetchers = {
|
|
17
|
+
fetchTodos: getTodos
|
|
18
|
+
};
|
|
19
|
+
const TODO_STATUSES = ["pending", "in_progress", "completed"];
|
|
20
|
+
const KNOWN_STATUSES = new Set(TODO_STATUSES);
|
|
21
|
+
function toStatus(value) {
|
|
22
|
+
return KNOWN_STATUSES.has(value) ? value : "pending";
|
|
23
|
+
}
|
|
24
|
+
function mapTodo(wire) {
|
|
25
|
+
return {
|
|
26
|
+
id: wire.id,
|
|
27
|
+
title: wire.title,
|
|
28
|
+
status: toStatus(wire.status),
|
|
29
|
+
dueDate: wire.dueDate
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function isActive(todo) {
|
|
33
|
+
return todo.status === "pending" || todo.status === "in_progress";
|
|
34
|
+
}
|
|
35
|
+
const DAY_MS = 24 * 60 * 60 * 1e3;
|
|
36
|
+
function laneFor(todo, now) {
|
|
37
|
+
if (!todo.dueDate) return "someday";
|
|
38
|
+
const ts = Date.parse(todo.dueDate);
|
|
39
|
+
if (Number.isNaN(ts)) return "someday";
|
|
40
|
+
return ts <= now + DAY_MS ? "today" : "upcoming";
|
|
41
|
+
}
|
|
42
|
+
function overdueCount(todos, now) {
|
|
43
|
+
let count = 0;
|
|
44
|
+
for (const todo of todos) {
|
|
45
|
+
if (!isActive(todo) || !todo.dueDate) continue;
|
|
46
|
+
const ts = Date.parse(todo.dueDate);
|
|
47
|
+
if (!Number.isNaN(ts) && ts < now) count += 1;
|
|
48
|
+
}
|
|
49
|
+
return count;
|
|
50
|
+
}
|
|
51
|
+
function formatDue(value) {
|
|
52
|
+
if (!value) return "";
|
|
53
|
+
const date = new Date(value);
|
|
54
|
+
if (Number.isNaN(date.getTime())) return "";
|
|
55
|
+
return date.toLocaleDateString(void 0, {
|
|
56
|
+
month: "short",
|
|
57
|
+
day: "numeric"
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function toCard(todo) {
|
|
61
|
+
return {
|
|
62
|
+
id: todo.id,
|
|
63
|
+
title: todo.title,
|
|
64
|
+
inProgress: todo.status === "in_progress",
|
|
65
|
+
due: formatDue(todo.dueDate)
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const POLL_INTERVAL_MS = 15e3;
|
|
69
|
+
function requestNewTodo() {
|
|
70
|
+
const send = client.sendChatMessage;
|
|
71
|
+
send?.("Add a todo for me.");
|
|
72
|
+
}
|
|
73
|
+
function TodosView(props = {}) {
|
|
74
|
+
const fetchers = props.fetchers ?? defaultFetchers;
|
|
75
|
+
const [state, setState] = useState({ kind: "loading" });
|
|
76
|
+
const fetchersRef = useRef(fetchers);
|
|
77
|
+
fetchersRef.current = fetchers;
|
|
78
|
+
const load = useCallback(() => {
|
|
79
|
+
let cancelled = false;
|
|
80
|
+
setState({ kind: "loading" });
|
|
81
|
+
fetchersRef.current.fetchTodos().then((wire) => {
|
|
82
|
+
if (cancelled) return;
|
|
83
|
+
setState({ kind: "ready", todos: wire.todos.map(mapTodo) });
|
|
84
|
+
}).catch((error) => {
|
|
85
|
+
if (cancelled) return;
|
|
86
|
+
setState({
|
|
87
|
+
kind: "error",
|
|
88
|
+
message: error instanceof Error ? error.message : "Could not load todos."
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
return () => {
|
|
92
|
+
cancelled = true;
|
|
93
|
+
};
|
|
94
|
+
}, []);
|
|
95
|
+
useEffect(() => load(), [load]);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const id = setInterval(() => {
|
|
98
|
+
fetchersRef.current.fetchTodos().then((wire) => {
|
|
99
|
+
setState(
|
|
100
|
+
(prev) => prev.kind === "error" ? prev : { kind: "ready", todos: wire.todos.map(mapTodo) }
|
|
101
|
+
);
|
|
102
|
+
}).catch(() => {
|
|
103
|
+
});
|
|
104
|
+
}, POLL_INTERVAL_MS);
|
|
105
|
+
return () => clearInterval(id);
|
|
106
|
+
}, []);
|
|
107
|
+
const lanes = useMemo(() => {
|
|
108
|
+
const grouped = {
|
|
109
|
+
today: [],
|
|
110
|
+
upcoming: [],
|
|
111
|
+
someday: []
|
|
112
|
+
};
|
|
113
|
+
if (state.kind !== "ready") return grouped;
|
|
114
|
+
const now = Date.now();
|
|
115
|
+
for (const todo of state.todos) {
|
|
116
|
+
if (!isActive(todo)) continue;
|
|
117
|
+
grouped[laneFor(todo, now)].push(toCard(todo));
|
|
118
|
+
}
|
|
119
|
+
return grouped;
|
|
120
|
+
}, [state]);
|
|
121
|
+
const overdue = useMemo(
|
|
122
|
+
() => state.kind === "ready" ? overdueCount(state.todos, Date.now()) : 0,
|
|
123
|
+
[state]
|
|
124
|
+
);
|
|
125
|
+
const snapshot = useMemo(() => {
|
|
126
|
+
if (state.kind === "loading") {
|
|
127
|
+
return { state: "loading", lanes: EMPTY_LANES, overdue: 0 };
|
|
128
|
+
}
|
|
129
|
+
if (state.kind === "error") {
|
|
130
|
+
return {
|
|
131
|
+
state: "error",
|
|
132
|
+
lanes: EMPTY_LANES,
|
|
133
|
+
overdue: 0,
|
|
134
|
+
error: state.message
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const activeCount = lanes.today.length + lanes.upcoming.length + lanes.someday.length;
|
|
138
|
+
if (activeCount === 0) {
|
|
139
|
+
return { state: "empty", lanes: EMPTY_LANES, overdue: 0 };
|
|
140
|
+
}
|
|
141
|
+
return { state: "ready", lanes, overdue };
|
|
142
|
+
}, [state, lanes, overdue]);
|
|
143
|
+
const onAction = useCallback(
|
|
144
|
+
(action) => {
|
|
145
|
+
switch (action) {
|
|
146
|
+
case "retry":
|
|
147
|
+
load();
|
|
148
|
+
return;
|
|
149
|
+
case "add":
|
|
150
|
+
requestNewTodo();
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
[load]
|
|
155
|
+
);
|
|
156
|
+
return /* @__PURE__ */ jsx(SpatialSurface, { children: /* @__PURE__ */ jsx(TodosSpatialView, { snapshot, onAction }) });
|
|
157
|
+
}
|
|
158
|
+
var TodosView_default = TodosView;
|
|
159
|
+
export {
|
|
160
|
+
TodosView,
|
|
161
|
+
TodosView_default as default
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=TodosView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/todos/TodosView.tsx"],"sourcesContent":["/**\n * TodosView — the single GUI/XR data wrapper for the owner todo board.\n *\n * It owns the live todos data (the fetcher seam over the single read-only\n * endpoint PA serves, the quiet background poll, wire->display mapping, lane\n * grouping, and the overdue signal) and renders the one presentational\n * {@link TodosSpatialView} inside a {@link SpatialSurface}. Omitting the\n * `modality` prop lets `SpatialSurface` auto-detect GUI vs XR, so the SAME\n * component serves both surfaces; the TUI surface renders the same\n * `TodosSpatialView` through the terminal registry (see\n * `../../register-terminal-view.tsx`).\n *\n * Data source (PA owns the shared scheduled-task spine; this plugin only reads):\n * GET {base}/api/lifeops/todos -> { todos: TodoWire[] }\n *\n * The board is read-only: the only owner actions are `add` (route an add-a-todo\n * request through the assistant chat — no fabricated todos) and `retry` (reload\n * after an error). This plugin MUST NOT import from\n * @elizaos/plugin-personal-assistant; the wire DTO below is declared locally to\n * match the JSON shape PA emits.\n */\n\nimport { client } from \"@elizaos/ui\";\nimport { SpatialSurface } from \"@elizaos/ui/spatial\";\nimport type { ReactNode } from \"react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n EMPTY_LANES,\n type LaneId,\n type TodoCard,\n type TodosSnapshot,\n TodosSpatialView,\n} from \"./TodosSpatialView.js\";\n\n// ---------------------------------------------------------------------------\n// Wire DTO — local mirror of the JSON shape served by the PA todos route.\n// Never import PA types here; keep this view's contract self-contained and\n// aligned by shape.\n// ---------------------------------------------------------------------------\n\ninterface TodoWire {\n id: string;\n title: string;\n status: string;\n dueDate: string | null;\n}\n\ninterface TodosWire {\n todos: TodoWire[];\n}\n\n// ---------------------------------------------------------------------------\n// Fetcher seam — default to a real GET; tests inject an offline fake.\n// ---------------------------------------------------------------------------\n\nexport interface TodosFetchers {\n fetchTodos: () => Promise<TodosWire>;\n}\n\nasync function getTodos(): Promise<TodosWire> {\n const response = await fetch(`${client.getBaseUrl()}/api/lifeops/todos`);\n if (!response.ok) {\n throw new Error(`Todos request failed (${response.status})`);\n }\n return (await response.json()) as TodosWire;\n}\n\nconst defaultFetchers: TodosFetchers = {\n fetchTodos: getTodos,\n};\n\nexport interface TodosViewProps {\n /** Test/host injection seam. Defaults to the real `/api/lifeops/todos` GET. */\n fetchers?: TodosFetchers;\n}\n\n// ---------------------------------------------------------------------------\n// Wire -> display DTO mapping.\n// ---------------------------------------------------------------------------\n\nconst TODO_STATUSES = [\"pending\", \"in_progress\", \"completed\"] as const;\ntype TodoStatus = (typeof TODO_STATUSES)[number];\nconst KNOWN_STATUSES: ReadonlySet<string> = new Set(TODO_STATUSES);\n\n/** Coerce an unknown wire status; unknowns settle to \"pending\". */\nfunction toStatus(value: string): TodoStatus {\n return KNOWN_STATUSES.has(value) ? (value as TodoStatus) : \"pending\";\n}\n\ninterface TodoItem {\n id: string;\n title: string;\n status: TodoStatus;\n dueDate: string | null;\n}\n\nfunction mapTodo(wire: TodoWire): TodoItem {\n return {\n id: wire.id,\n title: wire.title,\n status: toStatus(wire.status),\n dueDate: wire.dueDate,\n };\n}\n\n// An active todo is one still on the board: pending or in_progress.\nfunction isActive(todo: TodoItem): boolean {\n return todo.status === \"pending\" || todo.status === \"in_progress\";\n}\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\n\nfunction laneFor(todo: TodoItem, now: number): LaneId {\n if (!todo.dueDate) return \"someday\";\n const ts = Date.parse(todo.dueDate);\n if (Number.isNaN(ts)) return \"someday\";\n return ts <= now + DAY_MS ? \"today\" : \"upcoming\";\n}\n\n// Overdue = an active todo whose due date is already in the past. Distinct from\n// the Today lane (which also holds items due within the next 24h), so a count of\n// these is a non-redundant, actionable proactive signal.\nfunction overdueCount(todos: TodoItem[], now: number): number {\n let count = 0;\n for (const todo of todos) {\n if (!isActive(todo) || !todo.dueDate) continue;\n const ts = Date.parse(todo.dueDate);\n if (!Number.isNaN(ts) && ts < now) count += 1;\n }\n return count;\n}\n\nfunction formatDue(value: string | null): string {\n if (!value) return \"\";\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) return \"\";\n return date.toLocaleDateString(undefined, {\n month: \"short\",\n day: \"numeric\",\n });\n}\n\nfunction toCard(todo: TodoItem): TodoCard {\n return {\n id: todo.id,\n title: todo.title,\n inProgress: todo.status === \"in_progress\",\n due: formatDue(todo.dueDate),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Fetch-driven state machine.\n// ---------------------------------------------------------------------------\n\nconst POLL_INTERVAL_MS = 15_000;\n\ntype LoadState =\n | { kind: \"loading\" }\n | { kind: \"error\"; message: string }\n | { kind: \"ready\"; todos: TodoItem[] };\n\nfunction requestNewTodo(): void {\n // The add-a-todo affordance routes through the assistant chat. `client` does\n // not type `sendChatMessage`, so read it through a narrow optional-method view\n // and call it only when present — no fabricated todos, best-effort dispatch.\n const send = (client as { sendChatMessage?: (text: string) => void })\n .sendChatMessage;\n send?.(\"Add a todo for me.\");\n}\n\nexport function TodosView(props: TodosViewProps = {}): ReactNode {\n const fetchers = props.fetchers ?? defaultFetchers;\n const [state, setState] = useState<LoadState>({ kind: \"loading\" });\n\n const fetchersRef = useRef(fetchers);\n fetchersRef.current = fetchers;\n\n const load = useCallback(() => {\n let cancelled = false;\n setState({ kind: \"loading\" });\n fetchersRef.current\n .fetchTodos()\n .then((wire) => {\n if (cancelled) return;\n setState({ kind: \"ready\", todos: wire.todos.map(mapTodo) });\n })\n .catch((error: unknown) => {\n if (cancelled) return;\n setState({\n kind: \"error\",\n message:\n error instanceof Error ? error.message : \"Could not load todos.\",\n });\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => load(), [load]);\n\n // Background poll: refresh the board on an interval without flashing the\n // loading state. Transient poll failures are ignored — the explicit Retry\n // path is what surfaces errors to the user.\n useEffect(() => {\n const id = setInterval(() => {\n fetchersRef.current\n .fetchTodos()\n .then((wire) => {\n setState((prev) =>\n prev.kind === \"error\"\n ? prev\n : { kind: \"ready\", todos: wire.todos.map(mapTodo) },\n );\n })\n .catch(() => {});\n }, POLL_INTERVAL_MS);\n return () => clearInterval(id);\n }, []);\n\n // Lane grouping is presentation-only over the active todos the route returns.\n const lanes = useMemo(() => {\n const grouped: Record<LaneId, TodoCard[]> = {\n today: [],\n upcoming: [],\n someday: [],\n };\n if (state.kind !== \"ready\") return grouped;\n const now = Date.now();\n for (const todo of state.todos) {\n if (!isActive(todo)) continue;\n grouped[laneFor(todo, now)].push(toCard(todo));\n }\n return grouped;\n }, [state]);\n\n // Proactive signal: how many active todos are already past due.\n const overdue = useMemo(\n () => (state.kind === \"ready\" ? overdueCount(state.todos, Date.now()) : 0),\n [state],\n );\n\n const snapshot = useMemo<TodosSnapshot>(() => {\n if (state.kind === \"loading\") {\n return { state: \"loading\", lanes: EMPTY_LANES, overdue: 0 };\n }\n if (state.kind === \"error\") {\n return {\n state: \"error\",\n lanes: EMPTY_LANES,\n overdue: 0,\n error: state.message,\n };\n }\n const activeCount =\n lanes.today.length + lanes.upcoming.length + lanes.someday.length;\n if (activeCount === 0) {\n return { state: \"empty\", lanes: EMPTY_LANES, overdue: 0 };\n }\n return { state: \"ready\", lanes, overdue };\n }, [state, lanes, overdue]);\n\n const onAction = useCallback(\n (action: string) => {\n switch (action) {\n case \"retry\":\n load();\n return;\n case \"add\":\n requestNewTodo();\n return;\n }\n },\n [load],\n );\n\n return (\n <SpatialSurface>\n <TodosSpatialView snapshot={snapshot} onAction={onAction} />\n </SpatialSurface>\n );\n}\n\nexport default TodosView;\n"],"mappings":"AAuRM;AAjQN,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAE/B,SAAS,aAAa,WAAW,SAAS,QAAQ,gBAAgB;AAClE;AAAA,EACE;AAAA,EAIA;AAAA,OACK;AA2BP,eAAe,WAA+B;AAC5C,QAAM,WAAW,MAAM,MAAM,GAAG,OAAO,WAAW,CAAC,oBAAoB;AACvE,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI,MAAM,yBAAyB,SAAS,MAAM,GAAG;AAAA,EAC7D;AACA,SAAQ,MAAM,SAAS,KAAK;AAC9B;AAEA,MAAM,kBAAiC;AAAA,EACrC,YAAY;AACd;AAWA,MAAM,gBAAgB,CAAC,WAAW,eAAe,WAAW;AAE5D,MAAM,iBAAsC,IAAI,IAAI,aAAa;AAGjE,SAAS,SAAS,OAA2B;AAC3C,SAAO,eAAe,IAAI,KAAK,IAAK,QAAuB;AAC7D;AASA,SAAS,QAAQ,MAA0B;AACzC,SAAO;AAAA,IACL,IAAI,KAAK;AAAA,IACT,OAAO,KAAK;AAAA,IACZ,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AAQ,QAAQ,MAAM,GAAG,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC;AAAA,IAC/C;AACA,WAAO;AAAA,EACT,GAAG,CAAC,KAAK,CAAC;AAGV,QAAM,UAAU;AAAA,IACd,MAAO,MAAM,SAAS,UAAU,aAAa,MAAM,OAAO,KAAK,IAAI,CAAC,IAAI;AAAA,IACxE,CAAC,KAAK;AAAA,EACR;AAEA,QAAM,WAAW,QAAuB,MAAM;AAC5C,QAAI,MAAM,SAAS,WAAW;AAC5B,aAAO,EAAE,OAAO,WAAW,OAAO,aAAa,SAAS,EAAE;AAAA,IAC5D;AACA,QAAI,MAAM,SAAS,SAAS;AAC1B,aAAO;AAAA,QACL,OAAO;AAAA,QACP,OAAO;AAAA,QACP,SAAS;AAAA,QACT,OAAO,MAAM;AAAA,MACf;AAAA,IACF;AACA,UAAM,cACJ,MAAM,MAAM,SAAS,MAAM,SAAS,SAAS,MAAM,QAAQ;AAC7D,QAAI,gBAAgB,GAAG;AACrB,aAAO,EAAE,OAAO,SAAS,OAAO,aAAa,SAAS,EAAE;AAAA,IAC1D;AACA,WAAO,EAAE,OAAO,SAAS,OAAO,QAAQ;AAAA,EAC1C,GAAG,CAAC,OAAO,OAAO,OAAO,CAAC;AAE1B,QAAM,WAAW;AAAA,IACf,CAAC,WAAmB;AAClB,cAAQ,QAAQ;AAAA,QACd,KAAK;AACH,eAAK;AACL;AAAA,QACF,KAAK;AACH,yBAAe;AACf;AAAA,MACJ;AAAA,IACF;AAAA,IACA,CAAC,IAAI;AAAA,EACP;AAEA,SACE,oBAAC,kBACC,8BAAC,oBAAiB,UAAoB,UAAoB,GAC5D;AAEJ;AAEA,IAAO,oBAAQ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todos-view-bundle.d.ts","sourceRoot":"","sources":["../../../src/components/todos/todos-view-bundle.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/todos/todos-view-bundle.ts"],"sourcesContent":["// Vite view-bundle entry. Re-exports the TodosView component so the built\n// bundle (dist/views/bundle.js) exposes the named export the view loader reads.\n// Kept separate from TodosView.tsx so that file exports only React components\n// and stays Fast-Refresh-compatible in dev.\nexport { TodosView } from \"./TodosView.js\";\n"],"mappings":"AAIA,SAAS,iBAAiB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/dist/db/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/db/index.ts"],"sourcesContent":["export * from \"./schema.js\";\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
export declare const todosSchema: import("drizzle-orm/pg-core").PgSchema<"todos">;
|
|
2
|
+
export declare const todosTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
3
|
+
name: "todos";
|
|
4
|
+
schema: "todos";
|
|
5
|
+
columns: {
|
|
6
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
7
|
+
name: "id";
|
|
8
|
+
tableName: "todos";
|
|
9
|
+
dataType: "string";
|
|
10
|
+
columnType: "PgUUID";
|
|
11
|
+
data: string;
|
|
12
|
+
driverParam: string;
|
|
13
|
+
notNull: true;
|
|
14
|
+
hasDefault: true;
|
|
15
|
+
isPrimaryKey: true;
|
|
16
|
+
isAutoincrement: false;
|
|
17
|
+
hasRuntimeDefault: false;
|
|
18
|
+
enumValues: undefined;
|
|
19
|
+
baseColumn: never;
|
|
20
|
+
identity: undefined;
|
|
21
|
+
generated: undefined;
|
|
22
|
+
}, {}, {}>;
|
|
23
|
+
agentId: import("drizzle-orm/pg-core").PgColumn<{
|
|
24
|
+
name: "agent_id";
|
|
25
|
+
tableName: "todos";
|
|
26
|
+
dataType: "string";
|
|
27
|
+
columnType: "PgUUID";
|
|
28
|
+
data: string;
|
|
29
|
+
driverParam: string;
|
|
30
|
+
notNull: true;
|
|
31
|
+
hasDefault: false;
|
|
32
|
+
isPrimaryKey: false;
|
|
33
|
+
isAutoincrement: false;
|
|
34
|
+
hasRuntimeDefault: false;
|
|
35
|
+
enumValues: undefined;
|
|
36
|
+
baseColumn: never;
|
|
37
|
+
identity: undefined;
|
|
38
|
+
generated: undefined;
|
|
39
|
+
}, {}, {}>;
|
|
40
|
+
entityId: import("drizzle-orm/pg-core").PgColumn<{
|
|
41
|
+
name: "entity_id";
|
|
42
|
+
tableName: "todos";
|
|
43
|
+
dataType: "string";
|
|
44
|
+
columnType: "PgUUID";
|
|
45
|
+
data: string;
|
|
46
|
+
driverParam: string;
|
|
47
|
+
notNull: true;
|
|
48
|
+
hasDefault: false;
|
|
49
|
+
isPrimaryKey: false;
|
|
50
|
+
isAutoincrement: false;
|
|
51
|
+
hasRuntimeDefault: false;
|
|
52
|
+
enumValues: undefined;
|
|
53
|
+
baseColumn: never;
|
|
54
|
+
identity: undefined;
|
|
55
|
+
generated: undefined;
|
|
56
|
+
}, {}, {}>;
|
|
57
|
+
roomId: import("drizzle-orm/pg-core").PgColumn<{
|
|
58
|
+
name: "room_id";
|
|
59
|
+
tableName: "todos";
|
|
60
|
+
dataType: "string";
|
|
61
|
+
columnType: "PgUUID";
|
|
62
|
+
data: string;
|
|
63
|
+
driverParam: string;
|
|
64
|
+
notNull: false;
|
|
65
|
+
hasDefault: false;
|
|
66
|
+
isPrimaryKey: false;
|
|
67
|
+
isAutoincrement: false;
|
|
68
|
+
hasRuntimeDefault: false;
|
|
69
|
+
enumValues: undefined;
|
|
70
|
+
baseColumn: never;
|
|
71
|
+
identity: undefined;
|
|
72
|
+
generated: undefined;
|
|
73
|
+
}, {}, {}>;
|
|
74
|
+
worldId: import("drizzle-orm/pg-core").PgColumn<{
|
|
75
|
+
name: "world_id";
|
|
76
|
+
tableName: "todos";
|
|
77
|
+
dataType: "string";
|
|
78
|
+
columnType: "PgUUID";
|
|
79
|
+
data: string;
|
|
80
|
+
driverParam: string;
|
|
81
|
+
notNull: false;
|
|
82
|
+
hasDefault: false;
|
|
83
|
+
isPrimaryKey: false;
|
|
84
|
+
isAutoincrement: false;
|
|
85
|
+
hasRuntimeDefault: false;
|
|
86
|
+
enumValues: undefined;
|
|
87
|
+
baseColumn: never;
|
|
88
|
+
identity: undefined;
|
|
89
|
+
generated: undefined;
|
|
90
|
+
}, {}, {}>;
|
|
91
|
+
content: import("drizzle-orm/pg-core").PgColumn<{
|
|
92
|
+
name: "content";
|
|
93
|
+
tableName: "todos";
|
|
94
|
+
dataType: "string";
|
|
95
|
+
columnType: "PgText";
|
|
96
|
+
data: string;
|
|
97
|
+
driverParam: string;
|
|
98
|
+
notNull: true;
|
|
99
|
+
hasDefault: false;
|
|
100
|
+
isPrimaryKey: false;
|
|
101
|
+
isAutoincrement: false;
|
|
102
|
+
hasRuntimeDefault: false;
|
|
103
|
+
enumValues: [string, ...string[]];
|
|
104
|
+
baseColumn: never;
|
|
105
|
+
identity: undefined;
|
|
106
|
+
generated: undefined;
|
|
107
|
+
}, {}, {}>;
|
|
108
|
+
activeForm: import("drizzle-orm/pg-core").PgColumn<{
|
|
109
|
+
name: "active_form";
|
|
110
|
+
tableName: "todos";
|
|
111
|
+
dataType: "string";
|
|
112
|
+
columnType: "PgText";
|
|
113
|
+
data: string;
|
|
114
|
+
driverParam: string;
|
|
115
|
+
notNull: true;
|
|
116
|
+
hasDefault: false;
|
|
117
|
+
isPrimaryKey: false;
|
|
118
|
+
isAutoincrement: false;
|
|
119
|
+
hasRuntimeDefault: false;
|
|
120
|
+
enumValues: [string, ...string[]];
|
|
121
|
+
baseColumn: never;
|
|
122
|
+
identity: undefined;
|
|
123
|
+
generated: undefined;
|
|
124
|
+
}, {}, {}>;
|
|
125
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
126
|
+
name: "status";
|
|
127
|
+
tableName: "todos";
|
|
128
|
+
dataType: "string";
|
|
129
|
+
columnType: "PgText";
|
|
130
|
+
data: string;
|
|
131
|
+
driverParam: string;
|
|
132
|
+
notNull: true;
|
|
133
|
+
hasDefault: false;
|
|
134
|
+
isPrimaryKey: false;
|
|
135
|
+
isAutoincrement: false;
|
|
136
|
+
hasRuntimeDefault: false;
|
|
137
|
+
enumValues: [string, ...string[]];
|
|
138
|
+
baseColumn: never;
|
|
139
|
+
identity: undefined;
|
|
140
|
+
generated: undefined;
|
|
141
|
+
}, {}, {}>;
|
|
142
|
+
parentTodoId: import("drizzle-orm/pg-core").PgColumn<{
|
|
143
|
+
name: "parent_todo_id";
|
|
144
|
+
tableName: "todos";
|
|
145
|
+
dataType: "string";
|
|
146
|
+
columnType: "PgUUID";
|
|
147
|
+
data: string;
|
|
148
|
+
driverParam: string;
|
|
149
|
+
notNull: false;
|
|
150
|
+
hasDefault: false;
|
|
151
|
+
isPrimaryKey: false;
|
|
152
|
+
isAutoincrement: false;
|
|
153
|
+
hasRuntimeDefault: false;
|
|
154
|
+
enumValues: undefined;
|
|
155
|
+
baseColumn: never;
|
|
156
|
+
identity: undefined;
|
|
157
|
+
generated: undefined;
|
|
158
|
+
}, {}, {}>;
|
|
159
|
+
parentTrajectoryStepId: import("drizzle-orm/pg-core").PgColumn<{
|
|
160
|
+
name: "parent_trajectory_step_id";
|
|
161
|
+
tableName: "todos";
|
|
162
|
+
dataType: "string";
|
|
163
|
+
columnType: "PgText";
|
|
164
|
+
data: string;
|
|
165
|
+
driverParam: string;
|
|
166
|
+
notNull: false;
|
|
167
|
+
hasDefault: false;
|
|
168
|
+
isPrimaryKey: false;
|
|
169
|
+
isAutoincrement: false;
|
|
170
|
+
hasRuntimeDefault: false;
|
|
171
|
+
enumValues: [string, ...string[]];
|
|
172
|
+
baseColumn: never;
|
|
173
|
+
identity: undefined;
|
|
174
|
+
generated: undefined;
|
|
175
|
+
}, {}, {}>;
|
|
176
|
+
metadata: import("drizzle-orm/pg-core").PgColumn<{
|
|
177
|
+
name: "metadata";
|
|
178
|
+
tableName: "todos";
|
|
179
|
+
dataType: "json";
|
|
180
|
+
columnType: "PgJsonb";
|
|
181
|
+
data: unknown;
|
|
182
|
+
driverParam: unknown;
|
|
183
|
+
notNull: true;
|
|
184
|
+
hasDefault: true;
|
|
185
|
+
isPrimaryKey: false;
|
|
186
|
+
isAutoincrement: false;
|
|
187
|
+
hasRuntimeDefault: false;
|
|
188
|
+
enumValues: undefined;
|
|
189
|
+
baseColumn: never;
|
|
190
|
+
identity: undefined;
|
|
191
|
+
generated: undefined;
|
|
192
|
+
}, {}, {}>;
|
|
193
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
194
|
+
name: "created_at";
|
|
195
|
+
tableName: "todos";
|
|
196
|
+
dataType: "date";
|
|
197
|
+
columnType: "PgTimestamp";
|
|
198
|
+
data: Date;
|
|
199
|
+
driverParam: string;
|
|
200
|
+
notNull: true;
|
|
201
|
+
hasDefault: true;
|
|
202
|
+
isPrimaryKey: false;
|
|
203
|
+
isAutoincrement: false;
|
|
204
|
+
hasRuntimeDefault: false;
|
|
205
|
+
enumValues: undefined;
|
|
206
|
+
baseColumn: never;
|
|
207
|
+
identity: undefined;
|
|
208
|
+
generated: undefined;
|
|
209
|
+
}, {}, {}>;
|
|
210
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
211
|
+
name: "updated_at";
|
|
212
|
+
tableName: "todos";
|
|
213
|
+
dataType: "date";
|
|
214
|
+
columnType: "PgTimestamp";
|
|
215
|
+
data: Date;
|
|
216
|
+
driverParam: string;
|
|
217
|
+
notNull: true;
|
|
218
|
+
hasDefault: true;
|
|
219
|
+
isPrimaryKey: false;
|
|
220
|
+
isAutoincrement: false;
|
|
221
|
+
hasRuntimeDefault: false;
|
|
222
|
+
enumValues: undefined;
|
|
223
|
+
baseColumn: never;
|
|
224
|
+
identity: undefined;
|
|
225
|
+
generated: undefined;
|
|
226
|
+
}, {}, {}>;
|
|
227
|
+
completedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
228
|
+
name: "completed_at";
|
|
229
|
+
tableName: "todos";
|
|
230
|
+
dataType: "date";
|
|
231
|
+
columnType: "PgTimestamp";
|
|
232
|
+
data: Date;
|
|
233
|
+
driverParam: string;
|
|
234
|
+
notNull: false;
|
|
235
|
+
hasDefault: false;
|
|
236
|
+
isPrimaryKey: false;
|
|
237
|
+
isAutoincrement: false;
|
|
238
|
+
hasRuntimeDefault: false;
|
|
239
|
+
enumValues: undefined;
|
|
240
|
+
baseColumn: never;
|
|
241
|
+
identity: undefined;
|
|
242
|
+
generated: undefined;
|
|
243
|
+
}, {}, {}>;
|
|
244
|
+
};
|
|
245
|
+
dialect: "pg";
|
|
246
|
+
}>;
|
|
247
|
+
export type TodoRow = typeof todosTable.$inferSelect;
|
|
248
|
+
export type TodoInsert = typeof todosTable.$inferInsert;
|
|
249
|
+
//# sourceMappingURL=schema.d.ts.map
|