declare-cc 1.0.7 → 2.0.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.
Files changed (75) hide show
  1. package/README.md +153 -187
  2. package/dist/client/assets/index-BVuhr02G.css +1 -0
  3. package/dist/client/assets/index-DujGXAYw.js +9 -0
  4. package/dist/client/index.html +23 -0
  5. package/dist/index.js +17459 -0
  6. package/package.json +38 -45
  7. package/src/agents/prompts/00-research.md +90 -0
  8. package/src/agents/prompts/01-vision.md +38 -0
  9. package/src/agents/prompts/02-declarations.md +47 -0
  10. package/src/agents/prompts/03-milestones.md +43 -0
  11. package/src/agents/prompts/04-actions.md +90 -0
  12. package/src/agents/prompts/05-execution.md +63 -0
  13. package/src/agents/prompts/06-verification.md +104 -0
  14. package/LICENSE +0 -21
  15. package/agents/declare-codebase-mapper.md +0 -761
  16. package/agents/declare-debugger.md +0 -1198
  17. package/agents/declare-executor.md +0 -353
  18. package/agents/declare-integration-checker.md +0 -440
  19. package/agents/declare-plan-checker.md +0 -608
  20. package/agents/declare-planner.md +0 -1015
  21. package/agents/declare-research-synthesizer.md +0 -309
  22. package/agents/declare-researcher.md +0 -484
  23. package/agents/declare-roadmapper.md +0 -639
  24. package/agents/declare-verifier.md +0 -555
  25. package/bin/declare.js +0 -16
  26. package/bin/install.js +0 -1907
  27. package/commands/declare/actions.md +0 -113
  28. package/commands/declare/add-todo.md +0 -41
  29. package/commands/declare/audit.md +0 -76
  30. package/commands/declare/check-todos.md +0 -125
  31. package/commands/declare/complete-milestone.md +0 -215
  32. package/commands/declare/dashboard.md +0 -65
  33. package/commands/declare/debug.md +0 -162
  34. package/commands/declare/discuss.md +0 -65
  35. package/commands/declare/execute.md +0 -521
  36. package/commands/declare/future.md +0 -72
  37. package/commands/declare/health.md +0 -92
  38. package/commands/declare/help.md +0 -31
  39. package/commands/declare/init.md +0 -39
  40. package/commands/declare/map-codebase.md +0 -149
  41. package/commands/declare/milestones.md +0 -98
  42. package/commands/declare/new-cycle.md +0 -172
  43. package/commands/declare/new-project.md +0 -565
  44. package/commands/declare/pause.md +0 -138
  45. package/commands/declare/plan.md +0 -320
  46. package/commands/declare/prioritize.md +0 -65
  47. package/commands/declare/progress.md +0 -116
  48. package/commands/declare/quick.md +0 -119
  49. package/commands/declare/reapply-patches.md +0 -178
  50. package/commands/declare/research.md +0 -267
  51. package/commands/declare/resume.md +0 -146
  52. package/commands/declare/set-profile.md +0 -66
  53. package/commands/declare/settings.md +0 -119
  54. package/commands/declare/status.md +0 -65
  55. package/commands/declare/trace.md +0 -81
  56. package/commands/declare/update.md +0 -251
  57. package/commands/declare/verify.md +0 -65
  58. package/commands/declare/visualize.md +0 -74
  59. package/dist/declare-tools.cjs +0 -9428
  60. package/dist/public/app.js +0 -9086
  61. package/dist/public/index.html +0 -4292
  62. package/hooks/declare-activity.js +0 -106
  63. package/hooks/declare-check-update.js +0 -62
  64. package/hooks/declare-server.js +0 -116
  65. package/hooks/declare-statusline.js +0 -91
  66. package/scripts/build-hooks.js +0 -42
  67. package/scripts/release.js +0 -50
  68. package/templates/future.md +0 -4
  69. package/templates/milestones.md +0 -11
  70. package/workflows/actions.md +0 -89
  71. package/workflows/discuss.md +0 -476
  72. package/workflows/future.md +0 -185
  73. package/workflows/milestones.md +0 -87
  74. package/workflows/scope.md +0 -94
  75. package/workflows/verify.md +0 -504
@@ -1,113 +0,0 @@
1
- ---
2
- description: Define actions per milestone — what must be done and what each produces (creates PLAN.md)
3
- allowed-tools:
4
- - Read
5
- - Write
6
- - Bash
7
- - Glob
8
- - Grep
9
- - AskUserQuestion
10
- argument-hint: "[M-XX] [--auto]"
11
- ---
12
-
13
- Derive action plans for milestones by working backward from what must be done.
14
-
15
- **Step 1: Load current graph state.**
16
-
17
- ```bash
18
- node dist/declare-tools.cjs load-graph
19
- ```
20
-
21
- Parse the JSON output. If the output contains an `error` field, tell the user to run `/declare:init` first and stop.
22
-
23
- If no milestones exist in the graph, tell the user to run `/declare:milestones` first and stop.
24
-
25
- Note all milestones and their current plan status from the graph.
26
-
27
- **Step 2: Determine scope and mode.**
28
-
29
- - If `$ARGUMENTS` contains a milestone ID (e.g., `M-01`), derive only for that milestone.
30
- - Otherwise, derive for all milestones that don't have a plan yet (milestones where `hasPlan` is false or no PLAN.md folder exists).
31
- - If `$ARGUMENTS` contains `--auto`, use **auto mode** (see Step 3b). Otherwise use **interactive mode** (Step 3a).
32
-
33
- If all milestones already have plans and no specific milestone was requested, tell the user: "All milestones already have action plans. Run `/declare:status` to see coverage."
34
-
35
- **Step 3a: Interactive mode (default) — per-milestone approval.**
36
-
37
- Read and follow the workflow:
38
-
39
- @workflows/actions.md
40
-
41
- For each milestone, derive and present the plan, then ask for approval using AskUserQuestion:
42
-
43
- ```
44
- Proposed plan for M-XX "[milestone title]":
45
- - A-XX: [action title] -- produces [what]
46
- - A-XX: [action title] -- produces [what]
47
-
48
- Approve this plan? (yes/adjust/skip)
49
- ```
50
-
51
- If the user wants adjustments, adjust and re-present. If they skip, move to the next milestone.
52
-
53
- After approval, persist:
54
-
55
- ```bash
56
- node dist/declare-tools.cjs create-plan --milestone "M-XX" --actions '[{"title":"Action Title","produces":"what it creates"}]'
57
- ```
58
-
59
- **Step 3b: Auto mode (`--auto`) — derive all, present once, persist all.**
60
-
61
- Derive action plans for ALL milestones in scope without pausing between them. Use the same backward derivation logic from the workflow, but skip all AskUserQuestion prompts.
62
-
63
- After deriving all plans:
64
-
65
- 1. Present the complete set as one summary:
66
-
67
- ```
68
- ## Derived Action Plans
69
-
70
- ### M-01: [title]
71
- 1. [Action A] -- produces [what]
72
- 2. [Action B] -- produces [what]
73
-
74
- ### M-02: [title]
75
- 1. [Action A] -- produces [what]
76
- 2. [Action B] -- produces [what]
77
-
78
- ...
79
-
80
- Total: X milestones, Y actions
81
- ```
82
-
83
- 2. Ask ONE confirmation using AskUserQuestion: "Create all plans?" with options: "Yes, create all" / "Let me adjust first"
84
-
85
- 3. If approved, persist ALL plans by calling create-plan for each milestone (these are fast — just file writes + commits).
86
-
87
- 4. If the user wants adjustments, let them specify which milestones to adjust, adjust, then re-present.
88
-
89
- **Step 4: Show summary and suggest next step.**
90
-
91
- After all milestones processed:
92
-
93
- 1. Reload the graph to get final counts:
94
- ```bash
95
- node dist/declare-tools.cjs load-graph
96
- ```
97
-
98
- 2. Start the dashboard if not already running:
99
- ```bash
100
- curl -sf http://localhost:3847/api/graph -o /dev/null || (node dist/declare-tools.cjs serve --port 3847 > /tmp/declare-dashboard.log 2>&1 & sleep 1 && open http://localhost:3847 2>/dev/null || true)
101
- ```
102
-
103
- 3. Show summary: milestones processed, plans created, total actions derived.
104
- 4. Suggest the next step clearly:
105
-
106
- ```
107
- Actions and edges are live in the dashboard → http://localhost:3847
108
-
109
- /declare:plan M-XX — research + planner + checker loop → EXEC-PLAN files
110
- /declare:execute M-XX — once plans exist, execute with wave scheduling
111
- ```
112
-
113
- If multiple milestones were planned, list each one with its suggested next command.
@@ -1,41 +0,0 @@
1
- ---
2
- description: Capture an idea or task as a todo for later work
3
- argument-hint: "[description]"
4
- allowed-tools:
5
- - Bash
6
- ---
7
-
8
- Capture an idea, task, or issue that surfaced during the current session as a structured todo.
9
-
10
- **Step 1: Get the description.**
11
-
12
- Parse `$ARGUMENTS` for a description string.
13
-
14
- If `$ARGUMENTS` is non-empty, use it as the description directly.
15
-
16
- If `$ARGUMENTS` is empty, infer the description from the current conversation context: look at the last few exchanges for any mentioned ideas, tasks, follow-ups, or issues the user flagged. If context is ambiguous, ask:
17
-
18
- "What would you like to capture as a todo? Give a short description."
19
-
20
- Wait for the user's reply.
21
-
22
- **Step 2: Create the todo.**
23
-
24
- ```bash
25
- node dist/declare-tools.cjs add-todo --description "[description]"
26
- ```
27
-
28
- Parse the JSON output. It contains `id`, `path`, and `committed`.
29
-
30
- **Step 3: Confirm capture.**
31
-
32
- Display:
33
-
34
- ```
35
- Todo [id] captured: [path]
36
- "[description]"
37
- ```
38
-
39
- If `committed` is true, mention the commit hash.
40
-
41
- Suggest: "Run `/declare:check-todos` to see all pending todos."
@@ -1,76 +0,0 @@
1
- ---
2
- description: Audit milestone completion against declarations before archiving
3
- allowed-tools:
4
- - Read
5
- - Write
6
- - Bash
7
- - Glob
8
- - Grep
9
- argument-hint: "[M-XX]"
10
- ---
11
-
12
- Audit a milestone's completion by cross-referencing completed actions against its declarations.
13
-
14
- **Step 1: Determine milestone scope.**
15
-
16
- If `$ARGUMENTS` contains a milestone ID (e.g., `M-01`), use it directly.
17
-
18
- Otherwise, run the milestone picker and ask the user to select:
19
-
20
- ```bash
21
- node dist/declare-tools.cjs execute
22
- ```
23
-
24
- Display milestones and ask: "Which milestone would you like to audit?"
25
-
26
- **Step 2: Run the audit.**
27
-
28
- ```bash
29
- node dist/declare-tools.cjs audit-milestone --milestone M-XX
30
- ```
31
-
32
- Parse the JSON output.
33
-
34
- **Step 3: Display audit results.**
35
-
36
- ```
37
- ## Milestone Audit: M-XX — [milestoneTitle]
38
-
39
- **Declarations checked:** [declarationsChecked]
40
- **Actions checked:** [actionsChecked] ([actionsDone] done)
41
-
42
- ### Coverage
43
- ```
44
-
45
- For each declaration, show whether it has completed supporting actions.
46
-
47
- For each gap, display:
48
-
49
- ```
50
- ### Gaps Found
51
-
52
- | Severity | Type | Description |
53
- |----------|------|-------------|
54
- | BLOCKER | pending-actions | A-01, A-02 not yet complete |
55
- | WARNING | missing-verification | No VERIFICATION.md found |
56
- ```
57
-
58
- **Step 4: Route based on result.**
59
-
60
- If `passed` is true (no blockers):
61
-
62
- ```
63
- Audit passed. This milestone is ready to complete.
64
-
65
- Run `/declare:complete-milestone` to archive and tag this milestone.
66
- ```
67
-
68
- If `passed` is false (blockers found):
69
-
70
- ```
71
- Audit found [N] blocker(s). Resolve these before completing the milestone.
72
- ```
73
-
74
- For pending actions: suggest running `/declare:execute M-XX` to complete them.
75
- For missing plan: suggest running `/declare:actions M-XX` first.
76
- For declaration gaps: offer to derive additional actions with `/declare:actions M-XX`.
@@ -1,125 +0,0 @@
1
- ---
2
- description: List pending todos and select one to work on or route to a milestone
3
- argument-hint: ""
4
- allowed-tools:
5
- - Read
6
- - Write
7
- - Bash
8
- - Task
9
- ---
10
-
11
- List all pending todos, let the user select one, and offer to act on it now or plan it into the next milestone.
12
-
13
- **Step 1: Load pending todos.**
14
-
15
- ```bash
16
- node dist/declare-tools.cjs check-todos
17
- ```
18
-
19
- Parse the JSON output. It contains a `todos` array with `{id, description, created, path}` objects.
20
-
21
- If `todos` is empty:
22
-
23
- ```
24
- No pending todos. Capture ideas with `/declare:add-todo`.
25
- ```
26
-
27
- Stop.
28
-
29
- **Step 2: Display the todo list.**
30
-
31
- ```
32
- ## Pending Todos ([count])
33
-
34
- 1. [id]: [description] — [created]
35
- 2. [id]: [description] — [created]
36
- ...
37
- ```
38
-
39
- Ask: "Which todo would you like to look at? Enter the number, ID, or 'skip' to exit."
40
-
41
- **Step 3: Load the selected todo.**
42
-
43
- Wait for the user's response.
44
-
45
- If "skip" or empty: exit.
46
-
47
- Identify the selected todo by number or ID from the list.
48
-
49
- Read the todo file at its `path`:
50
-
51
- ```bash
52
- cat [path]
53
- ```
54
-
55
- Display the full todo content so the user can review it.
56
-
57
- **Step 4: Offer actions.**
58
-
59
- Ask: "What would you like to do with this todo?"
60
-
61
- Present these options:
62
-
63
- ```
64
- 1. Work on it now (spawn a quick task agent)
65
- 2. Add to next milestone planning
66
- 3. Mark as completed (move to completed/)
67
- 4. Skip (leave pending)
68
- ```
69
-
70
- **Step 5: Execute the chosen action.**
71
-
72
- **Option 1 — Work on it now:**
73
-
74
- Spawn a Task agent:
75
-
76
- ```
77
- Execute this todo task. Make atomic commits after each logical unit of work.
78
-
79
- Task: [description]
80
- Context file: [path]
81
-
82
- Read the context file. Do the work. When complete, report what was done, files changed, and commit hashes.
83
- ```
84
-
85
- After the agent completes, display its report, then ask: "Mark this todo as completed? (yes/no)"
86
-
87
- If yes: run:
88
-
89
- ```bash
90
- node dist/declare-tools.cjs complete-todo --id [id]
91
- ```
92
-
93
- Display: "Todo [id] marked as completed."
94
-
95
- **Option 2 — Add to next milestone planning:**
96
-
97
- Ask: "Which milestone should this feed into? (e.g. M-14, or 'new' to create a new one)"
98
-
99
- If the user provides a milestone ID, display:
100
-
101
- ```
102
- Noted: "[description]" should be considered when planning [milestone-id].
103
- ```
104
-
105
- Add this note as a reminder: suggest the user mention it when running `/declare:milestones` or `/declare:actions` for that milestone.
106
-
107
- **Option 3 — Mark as completed:**
108
-
109
- ```bash
110
- node dist/declare-tools.cjs complete-todo --id [id]
111
- ```
112
-
113
- Parse the JSON output and display: "Todo [id] moved to completed/."
114
-
115
- **Option 4 — Skip:**
116
-
117
- Display: "Todo left pending."
118
-
119
- **Step 6: Offer to review another todo.**
120
-
121
- After completing any action (or skipping), ask: "Would you like to review another todo? (yes/no)"
122
-
123
- If yes: return to Step 2 with the updated list (reload to reflect any completions).
124
-
125
- If no: exit.
@@ -1,215 +0,0 @@
1
- ---
2
- description: Archive a completed Declare milestone — snapshot graph, tag release, and prepare for next cycle
3
- allowed-tools:
4
- - Read
5
- - Write
6
- - Bash
7
- - Glob
8
- - Grep
9
- - AskUserQuestion
10
- argument-hint: "[vX.Y]"
11
- ---
12
-
13
- Archive a completed Declare milestone: snapshot the graph, check milestone statuses, update PROJECT.md, create a git tag, and prepare for the next cycle.
14
-
15
- **Step 0: Determine version.**
16
-
17
- Parse `$ARGUMENTS` for a version string matching `vX.Y` or `X.Y`.
18
-
19
- If no version in `$ARGUMENTS`, ask: "What version are we completing? (e.g., v1.0)"
20
-
21
- Normalize to `vX.Y` format (prepend `v` if absent).
22
-
23
- **Step 1: Pre-flight check — verify milestone statuses.**
24
-
25
- Load the full graph:
26
-
27
- ```bash
28
- node dist/declare-tools.cjs load-graph
29
- ```
30
-
31
- Parse the JSON output. If it contains an `error` field, tell the user to run `/declare:init` first and stop.
32
-
33
- For each milestone in the graph, check its `status` field. A milestone is complete when its status is `DONE`, `KEPT`, `HONORED`, or `RENEGOTIATED`.
34
-
35
- Milestones are NOT complete if their status is `PENDING`, `ACTIVE`, or `BROKEN`.
36
-
37
- Present a status table:
38
-
39
- ```
40
- ## Pre-flight Check: vX.Y
41
-
42
- | Milestone | Title | Status | Complete? |
43
- | --------- | ------------------------------ | ------- | --------- |
44
- | M-01 | Context capture per milestone | KEPT | YES |
45
- | M-02 | Milestone research pipeline | PENDING | NO |
46
- ```
47
-
48
- If any milestones are NOT complete, show a warning:
49
-
50
- ```
51
- Warning: [N] milestone(s) not yet complete:
52
- - M-XX: [title] (PENDING)
53
- - M-YY: [title] (BROKEN)
54
-
55
- Options:
56
- 1. Proceed anyway — mark version complete with known incomplete milestones
57
- 2. Stop — complete remaining milestones first, then re-run
58
- ```
59
-
60
- If the user chooses to stop, end here.
61
-
62
- If the user proceeds with incomplete milestones, note them as known gaps in Step 5.
63
-
64
- If ALL milestones are complete, display:
65
-
66
- ```
67
- All [N] milestones complete. Proceeding with vX.Y completion.
68
- ```
69
-
70
- **Step 2: Gather stats from git log.**
71
-
72
- ```bash
73
- git log --oneline | wc -l
74
- git log --oneline --since="$(git log --format='%ai' | tail -1)" | wc -l
75
- git diff --stat HEAD~$(git log --oneline | wc -l | tr -d ' ')..HEAD 2>/dev/null | tail -1 || echo "stats unavailable"
76
- git log --format="%ai" | tail -1
77
- git log --format="%ai" | head -1
78
- ```
79
-
80
- If a previous git tag exists, calculate stats since that tag:
81
-
82
- ```bash
83
- # Check for existing tags
84
- git tag --list "v*" | sort -V | tail -1
85
-
86
- # If previous tag exists (e.g., v0.9), use it as the range start
87
- PREV_TAG=$(git tag --list "v*" | sort -V | tail -1)
88
- if [ -n "$PREV_TAG" ]; then
89
- git log --oneline "$PREV_TAG"..HEAD | wc -l
90
- git diff --stat "$PREV_TAG"..HEAD | tail -1
91
- git log --format="%ai" "$PREV_TAG"..HEAD | tail -1
92
- fi
93
- ```
94
-
95
- Present:
96
-
97
- ```
98
- ## Milestone Stats: vX.Y
99
-
100
- - Milestones: [N] total ([N complete] complete, [N incomplete] incomplete)
101
- - Commits since last tag: [N] commits
102
- - Files changed: [M] files, [+N/-N] lines
103
- - Timeline: [Start date] → [End date] ([N] days)
104
- ```
105
-
106
- **Step 3: Archive graph snapshot.**
107
-
108
- Run the complete-milestone CJS command to snapshot the current graph state:
109
-
110
- ```bash
111
- node dist/declare-tools.cjs complete-milestone --version vX.Y
112
- ```
113
-
114
- Parse the JSON output.
115
-
116
- If it contains an `error` field, display it and stop.
117
-
118
- On success, display:
119
-
120
- ```
121
- ## Archive Complete
122
-
123
- Snapshot saved to .planning/milestones/vX.Y/
124
-
125
- Files archived:
126
- - .planning/milestones/vX.Y/FUTURE.md
127
- - .planning/milestones/vX.Y/MILESTONES.md
128
- - .planning/milestones/vX.Y/M-XX-*/PLAN.md (for each milestone folder)
129
- ```
130
-
131
- **Step 4: Update PROJECT.md "Current State" section.**
132
-
133
- Read `.planning/PROJECT.md`:
134
-
135
- ```bash
136
- cat .planning/PROJECT.md
137
- ```
138
-
139
- Locate or create a `## Current State` section. Update it to reflect the completed version:
140
-
141
- ```markdown
142
- ## Current State
143
-
144
- **Version shipped:** vX.Y (YYYY-MM-DD)
145
- **Milestones completed:** [N] ([M-01, M-02, ...])
146
- **Known gaps:** [list incomplete milestones, or "None"]
147
- **Next step:** Run /declare:new-cycle to start vX.Z cycle
148
- ```
149
-
150
- If the section already exists, update it in place. If it does not exist, append it after the last section.
151
-
152
- Write the updated PROJECT.md back.
153
-
154
- **Step 5: Create git tag.**
155
-
156
- ```bash
157
- git tag -a vX.Y -m "$(cat <<'TAGMSG'
158
- Declare vX.Y
159
-
160
- Milestones shipped:
161
- - M-XX: [title]
162
- - M-YY: [title]
163
-
164
- [Brief one-line summary of what this version delivers]
165
-
166
- See .planning/milestones/vX.Y/ for full graph snapshot.
167
- TAGMSG
168
- )"
169
- ```
170
-
171
- Confirm: "Tagged: vX.Y"
172
-
173
- **Step 6: Commit archived files.**
174
-
175
- Stage and commit all archive files and updated documents:
176
-
177
- ```bash
178
- git add .planning/milestones/vX.Y/ .planning/PROJECT.md
179
- git commit -m "chore: archive vX.Y milestone snapshot
180
-
181
- - Snapshot: .planning/milestones/vX.Y/
182
- - PROJECT.md: updated Current State section
183
- "
184
- ```
185
-
186
- **Step 7: Show completion summary.**
187
-
188
- ```
189
- ## vX.Y Complete
190
-
191
- **Milestones shipped:** [N]
192
- **Archive:** .planning/milestones/vX.Y/
193
- **Git tag:** vX.Y
194
- **PROJECT.md:** Updated
195
-
196
- ---
197
-
198
- Next: Start the next milestone cycle.
199
-
200
- Run /declare:new-cycle
201
- ```
202
-
203
- **Error handling:**
204
-
205
- - If `node dist/declare-tools.cjs load-graph` returns an error, suggest running `/declare:init` first.
206
- - If `node dist/declare-tools.cjs complete-milestone` returns an error containing "already exists", ask the user if they want to delete the existing archive and retry.
207
- - If git is not initialized, inform the user that git tagging requires `git init` and a prior commit.
208
-
209
- **Key patterns:**
210
-
211
- - Pre-flight check surfaces incomplete milestones before archiving — never silently proceed.
212
- - Archive is a snapshot, not a destructive operation — FUTURE.md and MILESTONES.md remain in place.
213
- - PROJECT.md is the persistent memory across versions — always update it.
214
- - Git tag marks the historical release point for the snapshot.
215
- - This command archives only — use /declare:new-cycle to reset for the next cycle.
@@ -1,65 +0,0 @@
1
- ---
2
- description: Open the interactive DAG dashboard in the browser (starts the server if needed)
3
- allowed-tools:
4
- - Bash
5
- ---
6
-
7
- Open the Declare interactive DAG dashboard — a live web UI showing declarations, milestones, and actions as a navigable graph.
8
-
9
- **Step 1: Resolve the port for this project.**
10
-
11
- Each project gets its own stable port derived from the project path. Check if it's already been assigned:
12
-
13
- ```bash
14
- cat .planning/server.port 2>/dev/null || echo "NOT_SET"
15
- ```
16
-
17
- If a port file exists, use that port. If not, the SessionStart hook hasn't fired yet — use the default port 3847 and set PORT to it.
18
-
19
- ```bash
20
- PORT=$(cat .planning/server.port 2>/dev/null || echo "3847")
21
- echo "PORT=$PORT"
22
- ```
23
-
24
- **Step 2: Check if the server is already running on that port.**
25
-
26
- ```bash
27
- curl -sf http://localhost:${PORT}/api/graph -o /dev/null && echo "RUNNING" || echo "NOT_RUNNING"
28
- ```
29
-
30
- **Step 3: Start the server if it is not running.**
31
-
32
- If `NOT_RUNNING`:
33
-
34
- ```bash
35
- nohup node dist/declare-tools.cjs serve --port ${PORT} > /tmp/declare-dashboard.log 2>&1 &
36
- sleep 1 && curl -sf http://localhost:${PORT}/api/graph -o /dev/null && echo "STARTED" || echo "FAILED"
37
- ```
38
-
39
- If `FAILED`:
40
- ```bash
41
- tail -20 /tmp/declare-dashboard.log
42
- ```
43
-
44
- **Step 4: Open the dashboard in the browser.**
45
-
46
- ```bash
47
- if [[ "$OSTYPE" == "darwin"* ]]; then
48
- open http://localhost:${PORT}
49
- else
50
- xdg-open http://localhost:${PORT} 2>/dev/null || echo "Visit http://localhost:${PORT} in your browser"
51
- fi
52
- ```
53
-
54
- **Step 5: Confirm to the user.**
55
-
56
- ```
57
- Dashboard running at http://localhost:[PORT]
58
-
59
- The graph updates live as agents run and files change.
60
- Click any node to inspect details and exec-plan.
61
-
62
- To stop: kill $(lsof -ti :[PORT])
63
- ```
64
-
65
- If the server was already running (Step 2 returned `RUNNING`), say "Server was already running."