@juicesharp/rpiv-todo 1.8.0 → 1.8.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.
Files changed (2) hide show
  1. package/config.ts +5 -34
  2. package/package.json +67 -64
package/config.ts CHANGED
@@ -1,43 +1,14 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { homedir } from "node:os";
3
- import { join } from "node:path";
1
+ import type { GuidanceFields } from "@juicesharp/rpiv-config";
2
+ import { configPath, loadJsonConfig, validateGuidanceFields } from "@juicesharp/rpiv-config";
4
3
 
5
- const CONFIG_DIR = join(homedir(), ".config", "rpiv-todo");
6
- const CONFIG_PATH = join(CONFIG_DIR, "config.json");
7
-
8
- interface GuidanceFields {
9
- promptSnippet?: string;
10
- promptGuidelines?: string[];
11
- }
4
+ const CONFIG_PATH = configPath("rpiv-todo");
12
5
 
13
6
  interface TodoConfig {
14
7
  guidance?: GuidanceFields;
15
8
  }
16
9
 
17
10
  export function loadConfig(): TodoConfig {
18
- if (!existsSync(CONFIG_PATH)) return {};
19
- try {
20
- const parsed = JSON.parse(readFileSync(CONFIG_PATH, "utf-8")) as unknown;
21
- if (parsed === null || typeof parsed !== "object") return {};
22
- return parsed as TodoConfig;
23
- } catch {
24
- return {};
25
- }
11
+ return loadJsonConfig<TodoConfig>(CONFIG_PATH);
26
12
  }
27
13
 
28
- export function validateGuidanceFields(fields: unknown): GuidanceFields {
29
- if (!fields || typeof fields !== "object") return {};
30
- const g = fields as Record<string, unknown>;
31
- const result: GuidanceFields = {};
32
- if (typeof g.promptSnippet === "string" && g.promptSnippet.length > 0) {
33
- result.promptSnippet = g.promptSnippet;
34
- }
35
- if (
36
- Array.isArray(g.promptGuidelines) &&
37
- g.promptGuidelines.length > 0 &&
38
- g.promptGuidelines.every((s) => typeof s === "string" && s.length > 0)
39
- ) {
40
- result.promptGuidelines = g.promptGuidelines;
41
- }
42
- return result;
43
- }
14
+ export { validateGuidanceFields };
package/package.json CHANGED
@@ -1,66 +1,69 @@
1
1
  {
2
- "name": "@juicesharp/rpiv-todo",
3
- "version": "1.8.0",
4
- "description": "Pi extension. A todo list for the model, rendered as a live overlay that survives /reload and conversation compaction.",
5
- "keywords": [
6
- "pi-package",
7
- "pi-extension",
8
- "rpiv",
9
- "todo"
10
- ],
11
- "type": "module",
12
- "license": "MIT",
13
- "author": "juicesharp",
14
- "repository": {
15
- "type": "git",
16
- "url": "git+https://github.com/juicesharp/rpiv-mono.git",
17
- "directory": "packages/rpiv-todo"
18
- },
19
- "homepage": "https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-todo#readme",
20
- "bugs": {
21
- "url": "https://github.com/juicesharp/rpiv-mono/issues"
22
- },
23
- "publishConfig": {
24
- "access": "public"
25
- },
26
- "scripts": {
27
- "test": "vitest run"
28
- },
29
- "files": [
30
- "config.ts",
31
- "index.ts",
32
- "locales/",
33
- "todo.ts",
34
- "todo-overlay.ts",
35
- "LICENSE",
36
- "README.md",
37
- "state/invariants.ts",
38
- "state/i18n-bridge.ts",
39
- "state/replay.ts",
40
- "state/selectors.ts",
41
- "state/state-reducer.ts",
42
- "state/state.ts",
43
- "state/store.ts",
44
- "state/task-graph.ts",
45
- "tool/response-envelope.ts",
46
- "tool/types.ts",
47
- "view/format.ts"
48
- ],
49
- "pi": {
50
- "extensions": [
51
- "./index.ts"
52
- ]
53
- },
54
- "peerDependencies": {
55
- "@juicesharp/rpiv-i18n": "*",
56
- "@earendil-works/pi-ai": "*",
57
- "@earendil-works/pi-coding-agent": "*",
58
- "@earendil-works/pi-tui": "*",
59
- "typebox": "*"
60
- },
61
- "peerDependenciesMeta": {
62
- "@juicesharp/rpiv-i18n": {
63
- "optional": true
64
- }
65
- }
2
+ "name": "@juicesharp/rpiv-todo",
3
+ "version": "1.8.1",
4
+ "description": "Pi extension. A todo list for the model, rendered as a live overlay that survives /reload and conversation compaction.",
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi-extension",
8
+ "rpiv",
9
+ "todo"
10
+ ],
11
+ "type": "module",
12
+ "license": "MIT",
13
+ "author": "juicesharp",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/juicesharp/rpiv-mono.git",
17
+ "directory": "packages/rpiv-todo"
18
+ },
19
+ "homepage": "https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-todo#readme",
20
+ "bugs": {
21
+ "url": "https://github.com/juicesharp/rpiv-mono/issues"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "scripts": {
27
+ "test": "vitest run"
28
+ },
29
+ "files": [
30
+ "config.ts",
31
+ "index.ts",
32
+ "locales/",
33
+ "todo.ts",
34
+ "todo-overlay.ts",
35
+ "LICENSE",
36
+ "README.md",
37
+ "state/invariants.ts",
38
+ "state/i18n-bridge.ts",
39
+ "state/replay.ts",
40
+ "state/selectors.ts",
41
+ "state/state-reducer.ts",
42
+ "state/state.ts",
43
+ "state/store.ts",
44
+ "state/task-graph.ts",
45
+ "tool/response-envelope.ts",
46
+ "tool/types.ts",
47
+ "view/format.ts"
48
+ ],
49
+ "pi": {
50
+ "extensions": [
51
+ "./index.ts"
52
+ ]
53
+ },
54
+ "peerDependencies": {
55
+ "@juicesharp/rpiv-i18n": "*",
56
+ "@earendil-works/pi-ai": "*",
57
+ "@earendil-works/pi-coding-agent": "*",
58
+ "@earendil-works/pi-tui": "*",
59
+ "typebox": "*"
60
+ },
61
+ "peerDependenciesMeta": {
62
+ "@juicesharp/rpiv-i18n": {
63
+ "optional": true
64
+ }
65
+ },
66
+ "dependencies": {
67
+ "@juicesharp/rpiv-config": "^1.8.1"
68
+ }
66
69
  }