@juicesharp/rpiv-todo 2.8.0 → 2.10.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/package.json +2 -2
- package/state/selectors.ts +1 -2
- package/state/state-reducer.ts +2 -4
- package/state/store.ts +5 -6
- package/todo.ts +2 -2
- package/tool/types.ts +1 -2
- package/view/format.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-todo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Pi extension. A todo list for the model, rendered as a live overlay that survives /reload and conversation compaction.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@juicesharp/rpiv-config": "^2.
|
|
72
|
+
"@juicesharp/rpiv-config": "^2.10.0",
|
|
73
73
|
"typebox": "^1.1.24"
|
|
74
74
|
}
|
|
75
75
|
}
|
package/state/selectors.ts
CHANGED
|
@@ -62,8 +62,7 @@ export function selectTaskSubjectById(state: TaskState, id: number): string | un
|
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Overlay layout decision. Encapsulates the "drop completed first, then
|
|
65
|
-
* truncate non-completed tail" rule
|
|
66
|
-
* `todo-overlay.ts:144-188`. `budget` is the body-slot count (caller passes
|
|
65
|
+
* truncate non-completed tail" rule. `budget` is the body-slot count (caller passes
|
|
67
66
|
* `getMaxWidgetLines() - 1` to reserve the heading row); on overflow the
|
|
68
67
|
* selector reserves one more slot internally for the summary row. Returns
|
|
69
68
|
* the visible task slice plus the overflow summary parts.
|
package/state/state-reducer.ts
CHANGED
|
@@ -65,15 +65,13 @@ function taskChanged(before: Task, after: Task): boolean {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* Pure reducer: (state, action, params) → (state, op).
|
|
69
|
-
* `applyTaskMutation` of pre-refactor `todo.ts` minus content/details
|
|
70
|
-
* formatting; the response envelope (`tool/response-envelope.ts`) owns
|
|
68
|
+
* Pure reducer: (state, action, params) → (state, op). The response envelope (`tool/response-envelope.ts`) owns
|
|
71
69
|
* formatting, the store (`state/store.ts`) owns commit.
|
|
72
70
|
*
|
|
73
71
|
* Validation is in-line: structural guards (`subject required`, `id required`,
|
|
74
72
|
* `at least one mutable field`) plus state-aware checks (transition legality,
|
|
75
73
|
* dangling/deleted blockedBy, self-block, cycles). Decision: validation stays
|
|
76
|
-
* in-reducer
|
|
74
|
+
* in-reducer.
|
|
77
75
|
*/
|
|
78
76
|
export function applyTaskMutation(state: TaskState, action: TaskAction, params: TaskMutationParams): ApplyResult {
|
|
79
77
|
switch (action) {
|
package/state/store.ts
CHANGED
|
@@ -2,9 +2,8 @@ import type { Task } from "../tool/types.js";
|
|
|
2
2
|
import { EMPTY_STATE, type TaskState } from "./state.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Per-session live state
|
|
6
|
-
*
|
|
7
|
-
* (distinct sid) can never read or clobber another session's tasks.
|
|
5
|
+
* Per-session live state: a Map partitioned by session id, so a detached/child
|
|
6
|
+
* session (distinct sid) can never read or clobber another session's tasks.
|
|
8
7
|
*
|
|
9
8
|
* The Map is the single mutation seam — only `commitState` / `replaceState` /
|
|
10
9
|
* `evictSession` write it; the reducer (`state/state-reducer.ts`) stays pure.
|
|
@@ -24,7 +23,7 @@ let activeRenderSession = "";
|
|
|
24
23
|
* Session-id extractor. Structural ctx type (no Pi-runtime import) —
|
|
25
24
|
* mirrors `replay.ts`'s ctx shape so `state/` stays Pi-import-free. Returns
|
|
26
25
|
* `… ?? ""` so an unknown/empty session resolves to "" rather than undefined
|
|
27
|
-
* (keeps the key a plain string for callers and the
|
|
26
|
+
* (keeps the key a plain string for callers and the `index.ts` sid-gate).
|
|
28
27
|
*/
|
|
29
28
|
export function sid(ctx: { sessionManager: { getSessionId(): string } }): string {
|
|
30
29
|
return ctx.sessionManager.getSessionId() ?? "";
|
|
@@ -99,8 +98,8 @@ export function setActiveRenderSession(sessionId: string): void {
|
|
|
99
98
|
/**
|
|
100
99
|
* Reads the foreground render pointer — the sid the `index.ts` sid-gate compares
|
|
101
100
|
* against, and the slot `getRenderState()` resolves to. Distinct from
|
|
102
|
-
* `setActiveRenderSession` (the writer):
|
|
103
|
-
*
|
|
101
|
+
* `setActiveRenderSession` (the writer): the gate *reads* this pointer, and
|
|
102
|
+
* foreground teardown must *clear* it.
|
|
104
103
|
*/
|
|
105
104
|
export function getActiveRenderSession(): string {
|
|
106
105
|
return activeRenderSession;
|
package/todo.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* surface — it mirrors `packages/rpiv-ask-user-question/ask-user-question.ts`
|
|
8
8
|
* which keeps the tool registration at the package root.
|
|
9
9
|
*
|
|
10
|
-
* Public re-exports below preserve the
|
|
10
|
+
* Public re-exports below preserve the package-root import surface so that
|
|
11
11
|
* `index.ts`, `todo-overlay.ts`, and the global `test/setup.ts` `beforeEach`
|
|
12
12
|
* continue to import from `./todo.js`.
|
|
13
13
|
*/
|
|
@@ -37,7 +37,7 @@ const SECTION_IN_PROGRESS = "── In Progress ──";
|
|
|
37
37
|
const SECTION_COMPLETED = "── Completed ──";
|
|
38
38
|
|
|
39
39
|
// ---------------------------------------------------------------------------
|
|
40
|
-
// Public re-exports —
|
|
40
|
+
// Public re-exports — existing consumers (overlay, tests, index.ts) keep
|
|
41
41
|
// importing from `./todo.js`. New code may opt into deeper imports.
|
|
42
42
|
// ---------------------------------------------------------------------------
|
|
43
43
|
|
package/tool/types.ts
CHANGED
|
@@ -74,8 +74,7 @@ export interface TaskMutationParams {
|
|
|
74
74
|
|
|
75
75
|
// ---------------------------------------------------------------------------
|
|
76
76
|
// TypeBox parameter schema — every `description` doubles as LLM-facing prompt
|
|
77
|
-
// copy. Field order and wording are pinned by registration tests
|
|
78
|
-
// pre-refactor schema at `packages/rpiv-todo/todo.ts:512-573`.
|
|
77
|
+
// copy. Field order and wording are pinned by registration tests.
|
|
79
78
|
// ---------------------------------------------------------------------------
|
|
80
79
|
|
|
81
80
|
export const TodoParamsSchema = Type.Object({
|
package/view/format.ts
CHANGED
|
@@ -24,7 +24,7 @@ export const STATUS_GLYPH: Record<TaskStatus, string> = {
|
|
|
24
24
|
/**
|
|
25
25
|
* Color palette for the renderResult status echo. `deleted` uses `muted` so a
|
|
26
26
|
* successful delete is visually distinct from the error branch (which uses
|
|
27
|
-
* `error` + `✗`)
|
|
27
|
+
* `error` + `✗`)..
|
|
28
28
|
*/
|
|
29
29
|
export const STATUS_COLOR: Record<TaskStatus, "dim" | "warning" | "success" | "muted"> = {
|
|
30
30
|
pending: "dim",
|
|
@@ -35,7 +35,7 @@ export const STATUS_COLOR: Record<TaskStatus, "dim" | "warning" | "success" | "m
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Per-action prefix glyph for renderCall. `+` create, `→` update, `×` delete,
|
|
38
|
-
* `›` get, `☰` list, `∅` clear
|
|
38
|
+
* `›` get, `☰` list, `∅` clear..
|
|
39
39
|
*/
|
|
40
40
|
export const ACTION_GLYPH: Record<TaskAction, string> = {
|
|
41
41
|
create: "+",
|
|
@@ -50,7 +50,7 @@ export const ACTION_GLYPH: Record<TaskAction, string> = {
|
|
|
50
50
|
* Glyph for the persistent overlay's per-task row. Differs from `STATUS_GLYPH`
|
|
51
51
|
* for `completed` (`✓` vs `●`) and `deleted` (`✗` vs `⊘`) because the
|
|
52
52
|
* overlay caller never renders a `deleted` row but uses `✗` in its
|
|
53
|
-
* error-toned palette
|
|
53
|
+
* error-toned palette..
|
|
54
54
|
*/
|
|
55
55
|
export function overlayStatusGlyph(status: TaskStatus, theme: Theme): string {
|
|
56
56
|
switch (status) {
|