opencode-session-todo 0.1.1 → 0.1.2
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/index.ts +4 -2
- package/package.json +1 -1
- package/src/diff.ts +4 -0
package/index.ts
CHANGED
|
@@ -164,9 +164,11 @@ export const register = (ctx: TodoPluginContext): Effect.Effect<void, never, Sco
|
|
|
164
164
|
Effect.logWarning("Todo saved, but notification failed", error),
|
|
165
165
|
),
|
|
166
166
|
)
|
|
167
|
+
const snapshot: Snapshot = { path: saved.path, todos: saved.todos }
|
|
168
|
+
const message: string = diff === "" ? "Todo list unchanged." : `Todo list updated:\n${diff}`
|
|
167
169
|
return {
|
|
168
|
-
output:
|
|
169
|
-
content:
|
|
170
|
+
output: snapshot,
|
|
171
|
+
content: `${message}\n\n${JSON.stringify(snapshot)}`,
|
|
170
172
|
metadata: { todos: saved.todos, path: saved.path },
|
|
171
173
|
}
|
|
172
174
|
})
|
package/package.json
CHANGED
package/src/diff.ts
CHANGED
|
@@ -15,6 +15,10 @@ const advance = (cursor: Iterator<string>): string | undefined => {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const diffLines = (previous: readonly string[], next: readonly string[]): readonly string[] => {
|
|
18
|
+
if (
|
|
19
|
+
previous.length === next.length
|
|
20
|
+
&& previous.every((line: string, index: number): boolean => line === next[index])
|
|
21
|
+
) return []
|
|
18
22
|
if (
|
|
19
23
|
previous.length === 0 || next.length === 0
|
|
20
24
|
|| previous.length * next.length > MAX_CELLS
|