@mulmoclaude/todo-plugin 0.1.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/Preview.vue.d.ts +8 -0
- package/dist/View.vue.d.ts +12 -0
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/useTodos.d.ts +26 -0
- package/dist/composables.js +101 -0
- package/dist/composables.js.map +1 -0
- package/dist/definition-mymex4HE.js +55 -0
- package/dist/definition-mymex4HE.js.map +1 -0
- package/dist/definition.d.ts +43 -0
- package/dist/handlers/columns.d.ts +31 -0
- package/dist/handlers/items.d.ts +36 -0
- package/dist/handlers/llm.d.ts +30 -0
- package/dist/handlers/priority-notifier.d.ts +55 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.js +1223 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/utils.d.ts +4 -0
- package/dist/io.d.ts +6 -0
- package/dist/labels-C4z7FMoE.js +85 -0
- package/dist/labels-C4z7FMoE.js.map +1 -0
- package/dist/labels.d.ts +15 -0
- package/dist/lang/de.d.ts +25 -0
- package/dist/lang/en.d.ts +25 -0
- package/dist/lang/es.d.ts +25 -0
- package/dist/lang/fr.d.ts +25 -0
- package/dist/lang/index.d.ts +28 -0
- package/dist/lang/ja.d.ts +25 -0
- package/dist/lang/ko.d.ts +25 -0
- package/dist/lang/pt-BR.d.ts +25 -0
- package/dist/lang/zh.d.ts +25 -0
- package/dist/lang-D72AIF9U.js +215 -0
- package/dist/lang-D72AIF9U.js.map +1 -0
- package/dist/priority.d.ts +10 -0
- package/dist/shared.d.ts +13 -0
- package/dist/shared.js +89 -0
- package/dist/shared.js.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/viewModes.d.ts +11 -0
- package/dist/vue.d.ts +59 -0
- package/dist/vue.js +422 -0
- package/dist/vue.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ToolResultComplete } from 'gui-chat-protocol/vue';
|
|
2
|
+
import { TodoData } from './types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
result: ToolResultComplete<TodoData>;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ToolResultComplete } from 'gui-chat-protocol/vue';
|
|
2
|
+
import { TodoData } from './types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
selectedResult: ToolResultComplete<TodoData>;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
updateResult: (result: ToolResultComplete<unknown, unknown>) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onUpdateResult?: ((result: ToolResultComplete<unknown, unknown>) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { StatusColumn, TodoItem } from '../types';
|
|
3
|
+
import { CreateInput, MoveInput, PatchInput } from '../handlers/items';
|
|
4
|
+
export interface AddColumnInput {
|
|
5
|
+
label?: string;
|
|
6
|
+
isDone?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PatchColumnInput {
|
|
9
|
+
label?: string;
|
|
10
|
+
isDone?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface UseTodosHandle {
|
|
13
|
+
items: Ref<TodoItem[]>;
|
|
14
|
+
columns: Ref<StatusColumn[]>;
|
|
15
|
+
error: Ref<string | null>;
|
|
16
|
+
refresh: () => Promise<boolean>;
|
|
17
|
+
createItem: (input: CreateInput) => Promise<boolean>;
|
|
18
|
+
patchItem: (id: string, input: PatchInput) => Promise<boolean>;
|
|
19
|
+
moveItem: (id: string, input: MoveInput) => Promise<boolean>;
|
|
20
|
+
deleteItem: (id: string) => Promise<boolean>;
|
|
21
|
+
addColumn: (input: AddColumnInput) => Promise<boolean>;
|
|
22
|
+
patchColumn: (id: string, input: PatchColumnInput) => Promise<boolean>;
|
|
23
|
+
deleteColumn: (id: string) => Promise<boolean>;
|
|
24
|
+
reorderColumns: (ids: string[]) => Promise<boolean>;
|
|
25
|
+
}
|
|
26
|
+
export declare function useTodos(initialItems?: TodoItem[], initialColumns?: StatusColumn[]): UseTodosHandle;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { n as useT } from "./lang-D72AIF9U.js";
|
|
2
|
+
import { onMounted, onUnmounted, ref } from "vue";
|
|
3
|
+
import { useRuntime } from "gui-chat-protocol/vue";
|
|
4
|
+
//#region src/composables/useTodos.ts
|
|
5
|
+
function isErr(value) {
|
|
6
|
+
return "error" in value;
|
|
7
|
+
}
|
|
8
|
+
function useTodos(initialItems = [], initialColumns = []) {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const { dispatch, pubsub } = useRuntime();
|
|
11
|
+
const items = ref(initialItems);
|
|
12
|
+
const columns = ref(initialColumns);
|
|
13
|
+
const error = ref(null);
|
|
14
|
+
function applyResult(payload) {
|
|
15
|
+
if (Array.isArray(payload.data.items)) items.value = payload.data.items;
|
|
16
|
+
if (Array.isArray(payload.data.columns) && payload.data.columns.length > 0) columns.value = payload.data.columns;
|
|
17
|
+
}
|
|
18
|
+
async function call(args) {
|
|
19
|
+
error.value = null;
|
|
20
|
+
try {
|
|
21
|
+
const result = await dispatch(args);
|
|
22
|
+
if (isErr(result)) {
|
|
23
|
+
error.value = result.error;
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
applyResult(result);
|
|
27
|
+
return true;
|
|
28
|
+
} catch (err) {
|
|
29
|
+
error.value = err instanceof Error ? err.message : String(err);
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async function refresh() {
|
|
34
|
+
error.value = null;
|
|
35
|
+
try {
|
|
36
|
+
const result = await dispatch({ kind: "listAll" });
|
|
37
|
+
if (isErr(result)) {
|
|
38
|
+
error.value = t.value.loadFailed;
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
applyResult(result);
|
|
42
|
+
return true;
|
|
43
|
+
} catch {
|
|
44
|
+
error.value = t.value.loadFailed;
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
let unsub;
|
|
49
|
+
onMounted(() => {
|
|
50
|
+
unsub = pubsub.subscribe("changed", () => {
|
|
51
|
+
refresh();
|
|
52
|
+
});
|
|
53
|
+
refresh();
|
|
54
|
+
});
|
|
55
|
+
onUnmounted(() => unsub?.());
|
|
56
|
+
return {
|
|
57
|
+
items,
|
|
58
|
+
columns,
|
|
59
|
+
error,
|
|
60
|
+
refresh,
|
|
61
|
+
createItem: (input) => call({
|
|
62
|
+
kind: "itemCreate",
|
|
63
|
+
...input
|
|
64
|
+
}),
|
|
65
|
+
patchItem: (id, input) => call({
|
|
66
|
+
kind: "itemPatch",
|
|
67
|
+
id,
|
|
68
|
+
...input
|
|
69
|
+
}),
|
|
70
|
+
moveItem: (id, input) => call({
|
|
71
|
+
kind: "itemMove",
|
|
72
|
+
id,
|
|
73
|
+
...input
|
|
74
|
+
}),
|
|
75
|
+
deleteItem: (id) => call({
|
|
76
|
+
kind: "itemDelete",
|
|
77
|
+
id
|
|
78
|
+
}),
|
|
79
|
+
addColumn: (input) => call({
|
|
80
|
+
kind: "columnsAdd",
|
|
81
|
+
...input
|
|
82
|
+
}),
|
|
83
|
+
patchColumn: (id, input) => call({
|
|
84
|
+
kind: "columnPatch",
|
|
85
|
+
id,
|
|
86
|
+
...input
|
|
87
|
+
}),
|
|
88
|
+
deleteColumn: (id) => call({
|
|
89
|
+
kind: "columnDelete",
|
|
90
|
+
id
|
|
91
|
+
}),
|
|
92
|
+
reorderColumns: (ids) => call({
|
|
93
|
+
kind: "columnsOrder",
|
|
94
|
+
ids
|
|
95
|
+
})
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { useTodos };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=composables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composables.js","names":[],"sources":["../src/composables/useTodos.ts"],"sourcesContent":["// Composable backing the kanban / file-explorer todo View. Wraps\n// `runtime.dispatch` calls in a small ref-managed surface so the\n// component code reads as `await todos.createItem({...})` rather than\n// `await runtime.dispatch({kind: \"itemCreate\", ...})` everywhere.\n//\n// Live sync: subscribes to the plugin's \"changed\" pubsub channel and\n// re-fetches on every server-side mutation, so a second tab editing\n// the same workspace's todos updates this component's view too.\n\nimport { onMounted, onUnmounted, ref, type Ref } from \"vue\";\nimport { useRuntime } from \"gui-chat-protocol/vue\";\nimport type { StatusColumn, TodoItem } from \"../types\";\nimport type { CreateInput, MoveInput, PatchInput } from \"../handlers/items\";\nimport { useT } from \"../lang\";\n\ninterface DispatchOk {\n data: { items?: TodoItem[]; columns?: StatusColumn[] };\n item?: TodoItem;\n}\n\ninterface DispatchErr {\n error: string;\n status?: number;\n}\n\ntype DispatchResponse = DispatchOk | DispatchErr;\n\nfunction isErr(value: DispatchResponse): value is DispatchErr {\n return \"error\" in value;\n}\n\nexport interface AddColumnInput {\n label?: string;\n isDone?: boolean;\n}\n\nexport interface PatchColumnInput {\n label?: string;\n isDone?: boolean;\n}\n\nexport interface UseTodosHandle {\n items: Ref<TodoItem[]>;\n columns: Ref<StatusColumn[]>;\n error: Ref<string | null>;\n refresh: () => Promise<boolean>;\n createItem: (input: CreateInput) => Promise<boolean>;\n patchItem: (id: string, input: PatchInput) => Promise<boolean>;\n moveItem: (id: string, input: MoveInput) => Promise<boolean>;\n deleteItem: (id: string) => Promise<boolean>;\n addColumn: (input: AddColumnInput) => Promise<boolean>;\n patchColumn: (id: string, input: PatchColumnInput) => Promise<boolean>;\n deleteColumn: (id: string) => Promise<boolean>;\n reorderColumns: (ids: string[]) => Promise<boolean>;\n}\n\nexport function useTodos(initialItems: TodoItem[] = [], initialColumns: StatusColumn[] = []): UseTodosHandle {\n const t = useT();\n const { dispatch, pubsub } = useRuntime();\n const items = ref<TodoItem[]>(initialItems);\n const columns = ref<StatusColumn[]>(initialColumns);\n const error = ref<string | null>(null);\n\n function applyResult(payload: DispatchOk): void {\n if (Array.isArray(payload.data.items)) items.value = payload.data.items;\n if (Array.isArray(payload.data.columns) && payload.data.columns.length > 0) {\n columns.value = payload.data.columns;\n }\n }\n\n async function call<T extends object>(args: T): Promise<boolean> {\n error.value = null;\n try {\n const result = (await dispatch<DispatchResponse>(args)) as DispatchResponse;\n if (isErr(result)) {\n error.value = result.error;\n return false;\n }\n applyResult(result);\n return true;\n } catch (err) {\n error.value = err instanceof Error ? err.message : String(err);\n return false;\n }\n }\n\n async function refresh(): Promise<boolean> {\n error.value = null;\n try {\n const result = (await dispatch<DispatchResponse>({ kind: \"listAll\" })) as DispatchResponse;\n if (isErr(result)) {\n error.value = t.value.loadFailed;\n return false;\n }\n applyResult(result);\n return true;\n } catch {\n error.value = t.value.loadFailed;\n return false;\n }\n }\n\n let unsub: (() => void) | undefined;\n onMounted(() => {\n unsub = pubsub.subscribe(\"changed\", () => {\n void refresh();\n });\n void refresh();\n });\n onUnmounted(() => unsub?.());\n\n return {\n items,\n columns,\n error,\n refresh,\n createItem: (input) => call({ kind: \"itemCreate\", ...input }),\n patchItem: (id, input) => call({ kind: \"itemPatch\", id, ...input }),\n moveItem: (id, input) => call({ kind: \"itemMove\", id, ...input }),\n deleteItem: (id) => call({ kind: \"itemDelete\", id }),\n addColumn: (input) => call({ kind: \"columnsAdd\", ...input }),\n patchColumn: (id, input) => call({ kind: \"columnPatch\", id, ...input }),\n deleteColumn: (id) => call({ kind: \"columnDelete\", id }),\n reorderColumns: (ids) => call({ kind: \"columnsOrder\", ids }),\n };\n}\n"],"mappings":";;;;AA2BA,SAAS,MAAM,OAA+C;CAC5D,OAAO,WAAW;AACpB;AA2BA,SAAgB,SAAS,eAA2B,CAAC,GAAG,iBAAiC,CAAC,GAAmB;CAC3G,MAAM,IAAI,KAAK;CACf,MAAM,EAAE,UAAU,WAAW,WAAW;CACxC,MAAM,QAAQ,IAAgB,YAAY;CAC1C,MAAM,UAAU,IAAoB,cAAc;CAClD,MAAM,QAAQ,IAAmB,IAAI;CAErC,SAAS,YAAY,SAA2B;EAC9C,IAAI,MAAM,QAAQ,QAAQ,KAAK,KAAK,GAAG,MAAM,QAAQ,QAAQ,KAAK;EAClE,IAAI,MAAM,QAAQ,QAAQ,KAAK,OAAO,KAAK,QAAQ,KAAK,QAAQ,SAAS,GACvE,QAAQ,QAAQ,QAAQ,KAAK;CAEjC;CAEA,eAAe,KAAuB,MAA2B;EAC/D,MAAM,QAAQ;EACd,IAAI;GACF,MAAM,SAAU,MAAM,SAA2B,IAAI;GACrD,IAAI,MAAM,MAAM,GAAG;IACjB,MAAM,QAAQ,OAAO;IACrB,OAAO;GACT;GACA,YAAY,MAAM;GAClB,OAAO;EACT,SAAS,KAAK;GACZ,MAAM,QAAQ,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;GAC7D,OAAO;EACT;CACF;CAEA,eAAe,UAA4B;EACzC,MAAM,QAAQ;EACd,IAAI;GACF,MAAM,SAAU,MAAM,SAA2B,EAAE,MAAM,UAAU,CAAC;GACpE,IAAI,MAAM,MAAM,GAAG;IACjB,MAAM,QAAQ,EAAE,MAAM;IACtB,OAAO;GACT;GACA,YAAY,MAAM;GAClB,OAAO;EACT,QAAQ;GACN,MAAM,QAAQ,EAAE,MAAM;GACtB,OAAO;EACT;CACF;CAEA,IAAI;CACJ,gBAAgB;EACd,QAAQ,OAAO,UAAU,iBAAiB;GACxC,QAAa;EACf,CAAC;EACD,QAAa;CACf,CAAC;CACD,kBAAkB,QAAQ,CAAC;CAE3B,OAAO;EACL;EACA;EACA;EACA;EACA,aAAa,UAAU,KAAK;GAAE,MAAM;GAAc,GAAG;EAAM,CAAC;EAC5D,YAAY,IAAI,UAAU,KAAK;GAAE,MAAM;GAAa;GAAI,GAAG;EAAM,CAAC;EAClE,WAAW,IAAI,UAAU,KAAK;GAAE,MAAM;GAAY;GAAI,GAAG;EAAM,CAAC;EAChE,aAAa,OAAO,KAAK;GAAE,MAAM;GAAc;EAAG,CAAC;EACnD,YAAY,UAAU,KAAK;GAAE,MAAM;GAAc,GAAG;EAAM,CAAC;EAC3D,cAAc,IAAI,UAAU,KAAK;GAAE,MAAM;GAAe;GAAI,GAAG;EAAM,CAAC;EACtE,eAAe,OAAO,KAAK;GAAE,MAAM;GAAgB;EAAG,CAAC;EACvD,iBAAiB,QAAQ,KAAK;GAAE,MAAM;GAAgB;EAAI,CAAC;CAC7D;AACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//#region src/definition.ts
|
|
2
|
+
var TOOL_DEFINITION = {
|
|
3
|
+
type: "function",
|
|
4
|
+
name: "manageTodoList",
|
|
5
|
+
prompt: "When users mention tasks, things to do, or ask about their todo list, use manageTodoList to help them track items.",
|
|
6
|
+
description: "Manage a todo list — show items, add, update, check/uncheck, or delete them. Items can optionally carry labels (tags) for categorisation; use labels to group related todos (e.g. 'Work', 'Groceries', 'Urgent') and filter the list at read time.",
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
action: {
|
|
11
|
+
type: "string",
|
|
12
|
+
enum: [
|
|
13
|
+
"show",
|
|
14
|
+
"add",
|
|
15
|
+
"delete",
|
|
16
|
+
"update",
|
|
17
|
+
"check",
|
|
18
|
+
"uncheck",
|
|
19
|
+
"clear_completed",
|
|
20
|
+
"add_label",
|
|
21
|
+
"remove_label",
|
|
22
|
+
"list_labels"
|
|
23
|
+
],
|
|
24
|
+
description: "Action to perform on the todo list."
|
|
25
|
+
},
|
|
26
|
+
text: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "For 'add': the todo item text. For 'delete', 'update', 'check', 'uncheck', 'add_label', 'remove_label': partial text to find the item."
|
|
29
|
+
},
|
|
30
|
+
newText: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "For 'update' only: the replacement text."
|
|
33
|
+
},
|
|
34
|
+
note: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "For 'add' or 'update': an optional note or extra detail for the item."
|
|
37
|
+
},
|
|
38
|
+
labels: {
|
|
39
|
+
type: "array",
|
|
40
|
+
items: { type: "string" },
|
|
41
|
+
description: "For 'add': labels to tag the new item with. For 'add_label' / 'remove_label': labels to add to / remove from the item matched by 'text'. Labels are case-insensitive for matching but stored with their original case."
|
|
42
|
+
},
|
|
43
|
+
filterLabels: {
|
|
44
|
+
type: "array",
|
|
45
|
+
items: { type: "string" },
|
|
46
|
+
description: "For 'show' only: return only items that have at least one of these labels (OR semantics, case-insensitive). Omit to show all items."
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
required: ["action"]
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { TOOL_DEFINITION as t };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=definition-mymex4HE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-mymex4HE.js","names":[],"sources":["../src/definition.ts"],"sourcesContent":["// Tool schema for the todo plugin. Lives in its own module so both\n// the server entry (`index.ts`) and any future browser entry can\n// import it without dragging in handler code or its dependencies.\n//\n// `name: \"manageTodoList\" as const` is critical — it narrows the\n// literal type so `definePlugin`'s `StrictPluginResult<N>` can\n// require a matching named handler. It also matches the existing\n// built-in plugin's TOOL_DEFINITION.name exactly so during the PR1\n// → PR5 migration chain the runtime plugin and the static plugin\n// collide on the same name. The runtime registry's collision policy\n// (static wins) means this PR is no-op behaviour; PR5 deletes the\n// static side, after which the runtime plugin takes over as the real\n// `manageTodoList` handler.\n\nexport const TOOL_DEFINITION = {\n type: \"function\" as const,\n name: \"manageTodoList\" as const,\n prompt: \"When users mention tasks, things to do, or ask about their todo list, use manageTodoList to help them track items.\",\n description:\n \"Manage a todo list — show items, add, update, check/uncheck, or delete them. Items can optionally carry labels (tags) for categorisation; use labels to group related todos (e.g. 'Work', 'Groceries', 'Urgent') and filter the list at read time.\",\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n enum: [\"show\", \"add\", \"delete\", \"update\", \"check\", \"uncheck\", \"clear_completed\", \"add_label\", \"remove_label\", \"list_labels\"],\n description: \"Action to perform on the todo list.\",\n },\n text: {\n type: \"string\",\n description: \"For 'add': the todo item text. For 'delete', 'update', 'check', 'uncheck', 'add_label', 'remove_label': partial text to find the item.\",\n },\n newText: {\n type: \"string\",\n description: \"For 'update' only: the replacement text.\",\n },\n note: {\n type: \"string\",\n description: \"For 'add' or 'update': an optional note or extra detail for the item.\",\n },\n labels: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"For 'add': labels to tag the new item with. For 'add_label' / 'remove_label': labels to add to / remove from the item matched by 'text'. Labels are case-insensitive for matching but stored with their original case.\",\n },\n filterLabels: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"For 'show' only: return only items that have at least one of these labels (OR semantics, case-insensitive). Omit to show all items.\",\n },\n },\n required: [\"action\"],\n },\n};\n"],"mappings":";AAcA,IAAa,kBAAkB;CAC7B,MAAM;CACN,MAAM;CACN,QAAQ;CACR,aACE;CACF,YAAY;EACV,MAAM;EACN,YAAY;GACV,QAAQ;IACN,MAAM;IACN,MAAM;KAAC;KAAQ;KAAO;KAAU;KAAU;KAAS;KAAW;KAAmB;KAAa;KAAgB;IAAa;IAC3H,aAAa;GACf;GACA,MAAM;IACJ,MAAM;IACN,aAAa;GACf;GACA,SAAS;IACP,MAAM;IACN,aAAa;GACf;GACA,MAAM;IACJ,MAAM;IACN,aAAa;GACf;GACA,QAAQ;IACN,MAAM;IACN,OAAO,EAAE,MAAM,SAAS;IACxB,aACE;GACJ;GACA,cAAc;IACZ,MAAM;IACN,OAAO,EAAE,MAAM,SAAS;IACxB,aAAa;GACf;EACF;EACA,UAAU,CAAC,QAAQ;CACrB;AACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const TOOL_DEFINITION: {
|
|
2
|
+
type: "function";
|
|
3
|
+
name: "manageTodoList";
|
|
4
|
+
prompt: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
action: {
|
|
10
|
+
type: string;
|
|
11
|
+
enum: string[];
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
text: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
newText: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
note: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
labels: {
|
|
27
|
+
type: string;
|
|
28
|
+
items: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
filterLabels: {
|
|
34
|
+
type: string;
|
|
35
|
+
items: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
required: string[];
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TodoItem, StatusColumn } from '../types';
|
|
2
|
+
export type { StatusColumn } from '../types';
|
|
3
|
+
export declare const DEFAULT_COLUMNS: StatusColumn[];
|
|
4
|
+
export type ColumnsActionResult = {
|
|
5
|
+
kind: "error";
|
|
6
|
+
status: number;
|
|
7
|
+
error: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "success";
|
|
10
|
+
columns: StatusColumn[];
|
|
11
|
+
items?: TodoItem[];
|
|
12
|
+
};
|
|
13
|
+
export declare function normalizeColumns(raw: unknown): StatusColumn[];
|
|
14
|
+
export declare function doneColumnId(columns: StatusColumn[]): string;
|
|
15
|
+
export declare function defaultStatusId(columns: StatusColumn[]): string;
|
|
16
|
+
export declare function resyncDoneMembership(items: TodoItem[], newDoneId: string): {
|
|
17
|
+
items: TodoItem[];
|
|
18
|
+
changed: boolean;
|
|
19
|
+
};
|
|
20
|
+
export interface AddColumnInput {
|
|
21
|
+
label?: string;
|
|
22
|
+
isDone?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function handleAddColumn(columns: StatusColumn[], items: TodoItem[], input: AddColumnInput): ColumnsActionResult;
|
|
25
|
+
export interface PatchColumnInput {
|
|
26
|
+
label?: string;
|
|
27
|
+
isDone?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function handlePatchColumn(columns: StatusColumn[], columnId: string, input: PatchColumnInput, items: TodoItem[]): ColumnsActionResult;
|
|
30
|
+
export declare function handleDeleteColumn(columns: StatusColumn[], columnId: string, items: TodoItem[]): ColumnsActionResult;
|
|
31
|
+
export declare function handleReorderColumns(columns: StatusColumn[], ids: string[]): ColumnsActionResult;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { TodoItem, StatusColumn } from '../types';
|
|
2
|
+
export type ItemsActionResult = {
|
|
3
|
+
kind: "error";
|
|
4
|
+
status: number;
|
|
5
|
+
error: string;
|
|
6
|
+
} | {
|
|
7
|
+
kind: "success";
|
|
8
|
+
items: TodoItem[];
|
|
9
|
+
item?: TodoItem;
|
|
10
|
+
};
|
|
11
|
+
export declare function migrateItems(rawItems: TodoItem[], columns: StatusColumn[]): TodoItem[];
|
|
12
|
+
export interface CreateInput {
|
|
13
|
+
text?: string;
|
|
14
|
+
note?: string;
|
|
15
|
+
status?: string;
|
|
16
|
+
priority?: string;
|
|
17
|
+
dueDate?: string;
|
|
18
|
+
labels?: string[];
|
|
19
|
+
}
|
|
20
|
+
export declare function handleCreate(items: TodoItem[], columns: StatusColumn[], input: CreateInput): ItemsActionResult;
|
|
21
|
+
export interface PatchInput {
|
|
22
|
+
text?: string;
|
|
23
|
+
note?: string | null;
|
|
24
|
+
status?: string;
|
|
25
|
+
priority?: string | null;
|
|
26
|
+
dueDate?: string | null;
|
|
27
|
+
labels?: string[];
|
|
28
|
+
completed?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function handlePatch(items: TodoItem[], columns: StatusColumn[], itemId: string, input: PatchInput): ItemsActionResult;
|
|
31
|
+
export interface MoveInput {
|
|
32
|
+
status?: string;
|
|
33
|
+
position?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare function handleMove(items: TodoItem[], columns: StatusColumn[], itemId: string, input: MoveInput): ItemsActionResult;
|
|
36
|
+
export declare function handleDeleteItem(items: TodoItem[], itemId: string): ItemsActionResult;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TodoItem } from '../types';
|
|
2
|
+
export interface TodosActionInput {
|
|
3
|
+
text?: string;
|
|
4
|
+
newText?: string;
|
|
5
|
+
note?: string;
|
|
6
|
+
labels?: string[];
|
|
7
|
+
filterLabels?: string[];
|
|
8
|
+
}
|
|
9
|
+
export type TodosActionResult = {
|
|
10
|
+
kind: "error";
|
|
11
|
+
status: number;
|
|
12
|
+
error: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "success";
|
|
15
|
+
items: TodoItem[];
|
|
16
|
+
message: string;
|
|
17
|
+
jsonData: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
export declare function findTodoByText(items: TodoItem[], text: string): TodoItem | undefined;
|
|
20
|
+
export declare function handleShow(items: TodoItem[], input: TodosActionInput): TodosActionResult;
|
|
21
|
+
export declare function handleAdd(items: TodoItem[], input: TodosActionInput): TodosActionResult;
|
|
22
|
+
export declare function handleDelete(items: TodoItem[], input: TodosActionInput): TodosActionResult;
|
|
23
|
+
export declare function handleUpdate(items: TodoItem[], input: TodosActionInput): TodosActionResult;
|
|
24
|
+
export declare function handleCheck(items: TodoItem[], input: TodosActionInput): TodosActionResult;
|
|
25
|
+
export declare function handleUncheck(items: TodoItem[], input: TodosActionInput): TodosActionResult;
|
|
26
|
+
export declare function handleClearCompleted(items: TodoItem[]): TodosActionResult;
|
|
27
|
+
export declare function handleAddLabel(items: TodoItem[], input: TodosActionInput): TodosActionResult;
|
|
28
|
+
export declare function handleRemoveLabel(items: TodoItem[], input: TodosActionInput): TodosActionResult;
|
|
29
|
+
export declare function handleListLabels(items: TodoItem[]): TodosActionResult;
|
|
30
|
+
export declare function dispatchTodos(action: string, items: TodoItem[], input: TodosActionInput): TodosActionResult;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { FileOps } from 'gui-chat-protocol';
|
|
2
|
+
import { TodoItem } from '../types';
|
|
3
|
+
export type NotifiablePriority = "urgent" | "high";
|
|
4
|
+
export interface PriorityAlertPluginData {
|
|
5
|
+
kind: "todo-priority";
|
|
6
|
+
todoId: string;
|
|
7
|
+
/** Snapshot of the item's priority at the last publish / update.
|
|
8
|
+
* Duplicated on the notifier entry so a future debugger reading
|
|
9
|
+
* active.json can see which severity bucket the entry came from
|
|
10
|
+
* without cross-referencing the plugin's ticket store. */
|
|
11
|
+
priority: NotifiablePriority;
|
|
12
|
+
}
|
|
13
|
+
export interface PriorityNotifierApi {
|
|
14
|
+
publish(input: {
|
|
15
|
+
severity: "urgent" | "nudge";
|
|
16
|
+
lifecycle: "action";
|
|
17
|
+
title: string;
|
|
18
|
+
body?: string;
|
|
19
|
+
navigateTarget: string;
|
|
20
|
+
pluginData: PriorityAlertPluginData;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
id: string;
|
|
23
|
+
}>;
|
|
24
|
+
update(id: string, patch: {
|
|
25
|
+
severity?: "urgent" | "nudge";
|
|
26
|
+
title?: string;
|
|
27
|
+
body?: string;
|
|
28
|
+
pluginData?: PriorityAlertPluginData;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
clear(id: string): Promise<void>;
|
|
31
|
+
/** Returns a truthy entry when the bell still exists and belongs
|
|
32
|
+
* to this plugin, otherwise undefined. Used for ghost-bell
|
|
33
|
+
* detection: a ticket whose `notificationId` no longer resolves
|
|
34
|
+
* here means the bell was wiped (user dismissed via UI, crash
|
|
35
|
+
* truncated active.json) and reconcile should re-publish rather
|
|
36
|
+
* than `update` (which would silently no-op). */
|
|
37
|
+
get(id: string): Promise<unknown | undefined>;
|
|
38
|
+
}
|
|
39
|
+
interface ReconcileLog {
|
|
40
|
+
warn: (msg: string, data?: object) => void;
|
|
41
|
+
}
|
|
42
|
+
/** Reconcile the plugin's tickets and the host's bell entries with
|
|
43
|
+
* the current item list. After this resolves:
|
|
44
|
+
*
|
|
45
|
+
* - every notifiable item has a ticket and a live bell, with the
|
|
46
|
+
* bell's severity / title / body matching the item's current
|
|
47
|
+
* state;
|
|
48
|
+
* - no ticket references a non-notifiable item.
|
|
49
|
+
*
|
|
50
|
+
* Idempotent and tolerant of partial state. Drift is detected per-
|
|
51
|
+
* ticket against the title / body / priority stored at last publish
|
|
52
|
+
* or update; an item rename flows through `notifier.update` rather
|
|
53
|
+
* than clear-then-publish, preserving the notificationId. */
|
|
54
|
+
export declare function reconcilePriorityNotifications(items: TodoItem[], notifier: PriorityNotifierApi, files: FileOps, log?: ReconcileLog): Promise<void>;
|
|
55
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { PluginRuntime } from 'gui-chat-protocol';
|
|
2
|
+
import { TOOL_DEFINITION } from './definition';
|
|
3
|
+
export { TOOL_DEFINITION };
|
|
4
|
+
export type { TodoItem, TodoPriority, StatusColumn, TodoData } from './types';
|
|
5
|
+
declare const _default: (runtime: PluginRuntime) => {
|
|
6
|
+
TOOL_DEFINITION: {
|
|
7
|
+
type: "function";
|
|
8
|
+
name: "manageTodoList";
|
|
9
|
+
prompt: string;
|
|
10
|
+
description: string;
|
|
11
|
+
parameters: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
action: {
|
|
15
|
+
type: string;
|
|
16
|
+
enum: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
text: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
newText: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
note: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
labels: {
|
|
32
|
+
type: string;
|
|
33
|
+
items: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
filterLabels: {
|
|
39
|
+
type: string;
|
|
40
|
+
items: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
required: string[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
manageTodoList(rawArgs: unknown): Promise<{
|
|
50
|
+
data: {
|
|
51
|
+
items: import('./types').TodoItem[];
|
|
52
|
+
};
|
|
53
|
+
message: string;
|
|
54
|
+
jsonData: Record<string, unknown>;
|
|
55
|
+
instructions: string;
|
|
56
|
+
error?: undefined;
|
|
57
|
+
status?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
error: string;
|
|
60
|
+
status: number;
|
|
61
|
+
} | {
|
|
62
|
+
item?: import('./types').TodoItem | undefined;
|
|
63
|
+
data: {
|
|
64
|
+
items: import('./types').TodoItem[];
|
|
65
|
+
columns: import('./types').StatusColumn[];
|
|
66
|
+
};
|
|
67
|
+
error?: undefined;
|
|
68
|
+
status?: undefined;
|
|
69
|
+
}>;
|
|
70
|
+
};
|
|
71
|
+
export default _default;
|