cclaw-cli 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/LICENSE +21 -0
- package/README.md +100 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.js +101 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +70 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.js +50 -0
- package/dist/content/agents.d.ts +39 -0
- package/dist/content/agents.js +244 -0
- package/dist/content/autoplan.d.ts +7 -0
- package/dist/content/autoplan.js +297 -0
- package/dist/content/contracts.d.ts +2 -0
- package/dist/content/contracts.js +50 -0
- package/dist/content/examples.d.ts +2 -0
- package/dist/content/examples.js +327 -0
- package/dist/content/hooks.d.ts +16 -0
- package/dist/content/hooks.js +753 -0
- package/dist/content/learnings.d.ts +5 -0
- package/dist/content/learnings.js +265 -0
- package/dist/content/meta-skill.d.ts +10 -0
- package/dist/content/meta-skill.js +137 -0
- package/dist/content/observe.d.ts +21 -0
- package/dist/content/observe.js +1110 -0
- package/dist/content/session-hooks.d.ts +7 -0
- package/dist/content/session-hooks.js +137 -0
- package/dist/content/skills.d.ts +3 -0
- package/dist/content/skills.js +257 -0
- package/dist/content/stage-schema.d.ts +78 -0
- package/dist/content/stage-schema.js +1453 -0
- package/dist/content/subagents.d.ts +13 -0
- package/dist/content/subagents.js +616 -0
- package/dist/content/templates.d.ts +3 -0
- package/dist/content/templates.js +272 -0
- package/dist/content/utility-skills.d.ts +12 -0
- package/dist/content/utility-skills.js +467 -0
- package/dist/doctor.d.ts +7 -0
- package/dist/doctor.js +610 -0
- package/dist/flow-state.d.ts +19 -0
- package/dist/flow-state.js +41 -0
- package/dist/fs-utils.d.ts +5 -0
- package/dist/fs-utils.js +28 -0
- package/dist/gitignore.d.ts +3 -0
- package/dist/gitignore.js +43 -0
- package/dist/harness-adapters.d.ts +12 -0
- package/dist/harness-adapters.js +175 -0
- package/dist/install.d.ts +9 -0
- package/dist/install.js +562 -0
- package/dist/learnings-summarizer.d.ts +25 -0
- package/dist/learnings-summarizer.js +201 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.js +6 -0
- package/dist/policy.d.ts +6 -0
- package/dist/policy.js +179 -0
- package/dist/runs.d.ts +18 -0
- package/dist/runs.js +446 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.js +12 -0
- package/package.json +47 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
const STAGE_EXAMPLES = {
|
|
2
|
+
brainstorm: `### Alternatives comparison
|
|
3
|
+
|
|
4
|
+
| Approach | Pros | Cons | Effort | Recommendation |
|
|
5
|
+
| --- | --- | --- | --- | --- |
|
|
6
|
+
| REST + polling | Simple to deploy; works through strict proxies; easy to cache | Higher latency; wasted requests; battery use on mobile | Low | Good default when real-time is not required |
|
|
7
|
+
| WebSocket | Lowest latency; bidirectional; efficient for bursts | More ops complexity; reconnect/state sync; harder through some gateways | Medium | Prefer when server must push frequently or conversationally |
|
|
8
|
+
| SSE | One-way server push over HTTP; simpler than WebSockets for “notify only” | Unidirectional; browser connection limits; proxy buffering quirks | Low–Medium | Prefer for live dashboards and one-way event streams |
|
|
9
|
+
|
|
10
|
+
### Approved Direction
|
|
11
|
+
|
|
12
|
+
We will ship **SSE for server-originated notifications** to the web client first, because the UX requires timely delivery without bidirectional chat. We will keep a **REST fallback** for environments where SSE is unreliable, and we will defer WebSockets until we have a concrete bidirectional requirement (collaborative editing).
|
|
13
|
+
|
|
14
|
+
### Open Questions
|
|
15
|
+
|
|
16
|
+
- Do we need guaranteed delivery semantics (at-least-once vs best-effort) for in-app banners?
|
|
17
|
+
- What is the maximum event rate we must support per user session without degrading the UI thread?
|
|
18
|
+
- Should mobile clients reuse the same event channel contract or expose a separate polling endpoint?
|
|
19
|
+
|
|
20
|
+
### Assumptions (explicit)
|
|
21
|
+
|
|
22
|
+
- Users are authenticated; anonymous traffic does not receive personalized streams.
|
|
23
|
+
- “Notification” means **account-scoped operational messages**, not third-party ads.
|
|
24
|
+
- The first release optimizes for **web**; native clients can lag by one sprint.
|
|
25
|
+
|
|
26
|
+
### Constraints
|
|
27
|
+
|
|
28
|
+
- No new infrastructure class (managed broker) unless latency goals are missed in a spike.
|
|
29
|
+
- Compliance requires auditability: who saw what, when — at least at coarse granularity.
|
|
30
|
+
|
|
31
|
+
### Notes for the next stage
|
|
32
|
+
|
|
33
|
+
Capture the chosen direction as a **single paragraph decision** (above) and ensure open questions are either answered in scope or explicitly deferred with an owner + date.`,
|
|
34
|
+
scope: `### Scope contract
|
|
35
|
+
|
|
36
|
+
**Mode selected:** SELECTIVE EXPANSION
|
|
37
|
+
|
|
38
|
+
**Premise challenge result:** The original premise (“add notifications”) was reframed to **“ensure users know when an action requires follow-up”**, which expands the solution space beyond toast spam to include durable inbox items, empty states, and recovery paths when delivery fails.
|
|
39
|
+
|
|
40
|
+
### In scope / out of scope / deferred
|
|
41
|
+
|
|
42
|
+
| Category | Items |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| **In scope** | In-app notification feed; SSE delivery path; read/unread state; basic retry on transient failures |
|
|
45
|
+
| **Out of scope** | Email/SMS/push providers; marketing campaigns; per-user notification preferences beyond on/off |
|
|
46
|
+
| **Deferred** | WebSocket channel; rich media attachments in notifications; full-text search across historical events |
|
|
47
|
+
|
|
48
|
+
### Error & Rescue Registry (sample entry)
|
|
49
|
+
|
|
50
|
+
| Capability | Failure mode | Detection | Fallback |
|
|
51
|
+
| --- | --- | --- | --- |
|
|
52
|
+
| Event delivery | SSE connection drops mid-session | Client \`EventSource\` error event + heartbeat timeout | Fall back to REST polling every 30s until SSE reconnect succeeds; show subtle “live updates paused” banner |
|
|
53
|
+
|
|
54
|
+
### Non-goals (guardrails)
|
|
55
|
+
|
|
56
|
+
- No “infinite history” guarantee in v1; retention policy can be time-bounded.
|
|
57
|
+
- No cross-tenant fan-out optimizations until multi-tenant load tests exist.
|
|
58
|
+
|
|
59
|
+
### Owners & checkpoints
|
|
60
|
+
|
|
61
|
+
- **Product:** confirms reframed premise and acceptance of deferred items.
|
|
62
|
+
- **Engineering:** confirms SSE + REST snapshot split is feasible behind current gateway.
|
|
63
|
+
- **Checkpoint:** scope sign-off happens before detailed component design changes land in the repo.`,
|
|
64
|
+
design: `### Search Before Building (sample result)
|
|
65
|
+
|
|
66
|
+
| Layer | Label | What to reuse first |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| Layer 1 | stdlib | Built-in timers, structured logging patterns, standard error types |
|
|
69
|
+
| Layer 2 | existing codebase | Existing auth middleware, existing API client wrapper, existing feature flags helper |
|
|
70
|
+
| Layer 3 | npm | A small, well-maintained SSE helper (only if Layer 1–2 cannot cover framing/reconnect ergonomics) |
|
|
71
|
+
|
|
72
|
+
### Minimal component diagram (ASCII)
|
|
73
|
+
|
|
74
|
+
\`\`\`
|
|
75
|
+
┌─────────────┐ ┌──────────────┐ ┌────────────────┐
|
|
76
|
+
│ API Gateway │─────▶│ Notification │─────▶│ Event Publisher│
|
|
77
|
+
└─────────────┘ │ Service │ └────────┬───────┘
|
|
78
|
+
└──────┬───────┘ │
|
|
79
|
+
│ ▼
|
|
80
|
+
┌──────▼───────┐ ┌────────────────┐
|
|
81
|
+
│ Read Model │◀─────│ Outbox / Queue │
|
|
82
|
+
│ (Feed Store) │ └────────────────┘
|
|
83
|
+
└──────────────┘
|
|
84
|
+
\`\`\`
|
|
85
|
+
|
|
86
|
+
### Unresolved Decision (sample entry)
|
|
87
|
+
|
|
88
|
+
- **Decision:** Should the feed be modeled as append-only events or as CRUD “notification rows”?
|
|
89
|
+
- **Status:** OPEN
|
|
90
|
+
- **Options:** (A) append-only event log + projection, (B) mutable rows with status fields, (C) hybrid with compaction job
|
|
91
|
+
- **Deadline:** Decide before implementation of persistence migrations (end of week)
|
|
92
|
+
|
|
93
|
+
### Interface sketch (non-binding)
|
|
94
|
+
|
|
95
|
+
- **Client → server:** \`GET /api/me/notifications/snapshot?limit=50\` plus optional cursor parameters (if adopted).
|
|
96
|
+
- **Server → client:** \`GET /api/me/notifications/stream\` as SSE with periodic heartbeats.
|
|
97
|
+
|
|
98
|
+
### Quality bar for this stage
|
|
99
|
+
|
|
100
|
+
Design output should be **reviewable by someone who did not attend brainstorming**: they can trace from constraints → components → open decisions without reading code.`,
|
|
101
|
+
spec: `### Acceptance criteria (Given / When / Then)
|
|
102
|
+
|
|
103
|
+
**Criterion 1 — delivery**
|
|
104
|
+
|
|
105
|
+
- **Given** a signed-in user with an active session
|
|
106
|
+
- **When** the server publishes a new notification event for that user
|
|
107
|
+
- **Then** the client feed shows the new item within 5 seconds without a full page reload
|
|
108
|
+
|
|
109
|
+
**Criterion 2 — idempotency**
|
|
110
|
+
|
|
111
|
+
- **Given** the same logical notification is published twice with the same dedupe key
|
|
112
|
+
- **When** the client processes the stream
|
|
113
|
+
- **Then** the feed contains exactly one visible item for that key
|
|
114
|
+
|
|
115
|
+
**Criterion 3 — failure visibility**
|
|
116
|
+
|
|
117
|
+
- **Given** the live connection is unavailable
|
|
118
|
+
- **When** the user opens the notifications panel
|
|
119
|
+
- **Then** the UI shows a non-blocking degraded state and still loads the latest snapshot via REST
|
|
120
|
+
|
|
121
|
+
### Non-testable → fixed (comparison)
|
|
122
|
+
|
|
123
|
+
| Vague (non-testable) | Fixed (observable + testable) |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| “Notifications should be fast.” | “p95 time from publish to visible feed update ≤ 5s under steady load.” |
|
|
126
|
+
| “The system should handle errors gracefully.” | “If SSE is down, panel renders REST snapshot within 2s and shows ‘live updates paused’.” |
|
|
127
|
+
| “Users should not see duplicates.” | “For dedupe key K, repeated publishes produce exactly one row with key K.” |
|
|
128
|
+
|
|
129
|
+
### Test doubles / fixtures (planning notes)
|
|
130
|
+
|
|
131
|
+
- Use a deterministic clock for the “within 5 seconds” criterion in automated tests.
|
|
132
|
+
- Use a fake transport for SSE in unit tests; reserve browser-level tests for one happy path + one degraded path.
|
|
133
|
+
|
|
134
|
+
### Traceability reminder
|
|
135
|
+
|
|
136
|
+
Every criterion should map to **at least one automated check** (unit/integration/e2e) before the work is considered “specified enough” to start TDD in earnest.`,
|
|
137
|
+
plan: `### Task breakdown (sample)
|
|
138
|
+
|
|
139
|
+
| ID | Title | depends_on | acceptance_criteria | estimated_effort |
|
|
140
|
+
| --- | --- | --- | --- | --- |
|
|
141
|
+
| T1 | Define notification event schema + dedupe key rules | — | Spec criteria 2 satisfied in a written contract + fixtures | S |
|
|
142
|
+
| T2 | Implement publisher + outbox write path | T1 | Spec criterion 1 satisfied in integration test (happy path) | M |
|
|
143
|
+
| T3 | Implement client feed + SSE subscribe + REST fallback | T1, T2 | Spec criteria 1–3 satisfied in e2e-style tests (including degraded mode) | L |
|
|
144
|
+
|
|
145
|
+
### Dependency graph (ASCII)
|
|
146
|
+
|
|
147
|
+
\`\`\`
|
|
148
|
+
T1 ──▶ T2 ──▶ T3
|
|
149
|
+
│ ▲
|
|
150
|
+
└────────────┘
|
|
151
|
+
\`\`\`
|
|
152
|
+
|
|
153
|
+
### Acceptance mapping (sample)
|
|
154
|
+
|
|
155
|
+
| Spec criterion | Tasks that cover it | Notes |
|
|
156
|
+
| --- | --- | --- |
|
|
157
|
+
| Criterion 1 (delivery) | T2, T3 | T2 proves publish path; T3 proves UI subscription path |
|
|
158
|
+
| Criterion 2 (idempotency) | T1, T2 | Schema + publisher tests must include dedupe cases |
|
|
159
|
+
| Criterion 3 (failure visibility) | T3 | Explicit degraded-mode test case |
|
|
160
|
+
|
|
161
|
+
### Sequencing rationale (sample)
|
|
162
|
+
|
|
163
|
+
- **T1 first** prevents rework when event keys change mid-build.
|
|
164
|
+
- **T2 before T3** ensures the UI is not built on a mocked publisher that will not match production semantics.
|
|
165
|
+
- **T3 last** integrates transport concerns once contracts are stable.
|
|
166
|
+
|
|
167
|
+
### Risk note
|
|
168
|
+
|
|
169
|
+
If T3 grows too large, split “transport” vs “UI state machine” into two tasks while keeping the dependency graph acyclic.`,
|
|
170
|
+
test: `### RED test (Vitest) — written before production code
|
|
171
|
+
|
|
172
|
+
\`\`\`typescript
|
|
173
|
+
import { describe, it, expect } from "vitest";
|
|
174
|
+
import { summarizeDedupedFeed } from "../notificationFeed";
|
|
175
|
+
|
|
176
|
+
describe("summarizeDedupedFeed", () => {
|
|
177
|
+
it("counts unique keys and unread items", () => {
|
|
178
|
+
const summary = summarizeDedupedFeed([
|
|
179
|
+
{ dedupeKey: "a", read: false },
|
|
180
|
+
{ dedupeKey: "a", read: true },
|
|
181
|
+
{ dedupeKey: "b", read: false },
|
|
182
|
+
]);
|
|
183
|
+
|
|
184
|
+
expect(summary).toEqual({ uniqueKeys: 2, unread: 1 });
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
\`\`\`
|
|
188
|
+
|
|
189
|
+
### Expected output (FAIL)
|
|
190
|
+
|
|
191
|
+
\`\`\`bash
|
|
192
|
+
FAIL src/notificationFeed.test.ts
|
|
193
|
+
Error: Cannot find module '../notificationFeed' imported from src/notificationFeed.test.ts
|
|
194
|
+
\`\`\`
|
|
195
|
+
|
|
196
|
+
> **Annotation:** This test MUST fail before any production code is written.
|
|
197
|
+
|
|
198
|
+
### Iron Law verification
|
|
199
|
+
|
|
200
|
+
1. **Run** the test command (for example: \`pnpm vitest run src/notificationFeed.test.ts\`).
|
|
201
|
+
2. **Read output** and confirm the failure is due to the module/function not existing (or the function throwing “not implemented”), not due to a typo in assertions.
|
|
202
|
+
3. **Confirm** the failure reason matches the intentional gap: **missing implementation**, not a flaky environment or misconfigured test runner.
|
|
203
|
+
|
|
204
|
+
### Common mistakes to avoid
|
|
205
|
+
|
|
206
|
+
- “GREEN” that secretly imports a helper that already implements the behavior (that is skipping RED).
|
|
207
|
+
- Assertions that pass because the function returns \`undefined\` and the matcher is too loose.`,
|
|
208
|
+
build: `### GREEN (minimal implementation to pass RED)
|
|
209
|
+
|
|
210
|
+
\`\`\`typescript
|
|
211
|
+
export type FeedItem = { dedupeKey: string; read: boolean };
|
|
212
|
+
|
|
213
|
+
export function summarizeDedupedFeed(items: FeedItem[]) {
|
|
214
|
+
// Last write wins per dedupeKey (stable ordering: later items override earlier ones).
|
|
215
|
+
const latestReadByKey = new Map<string, boolean>();
|
|
216
|
+
|
|
217
|
+
for (const item of items) {
|
|
218
|
+
latestReadByKey.set(item.dedupeKey, item.read);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
let unread = 0;
|
|
222
|
+
for (const read of latestReadByKey.values()) {
|
|
223
|
+
if (!read) unread += 1;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return { uniqueKeys: latestReadByKey.size, unread };
|
|
227
|
+
}
|
|
228
|
+
\`\`\`
|
|
229
|
+
|
|
230
|
+
### REFACTOR (keep tests green)
|
|
231
|
+
|
|
232
|
+
Keep semantics identical, but make the merge step explicit and easier to unit test in isolation:
|
|
233
|
+
|
|
234
|
+
\`\`\`typescript
|
|
235
|
+
export type FeedItem = { dedupeKey: string; read: boolean };
|
|
236
|
+
|
|
237
|
+
function mergeLatestByDedupeKey(items: FeedItem[]) {
|
|
238
|
+
const latestReadByKey = new Map<string, boolean>();
|
|
239
|
+
for (const item of items) latestReadByKey.set(item.dedupeKey, item.read);
|
|
240
|
+
return latestReadByKey;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export function summarizeDedupedFeed(items: FeedItem[]) {
|
|
244
|
+
const latestReadByKey = mergeLatestByDedupeKey(items);
|
|
245
|
+
|
|
246
|
+
let unread = 0;
|
|
247
|
+
for (const read of latestReadByKey.values()) {
|
|
248
|
+
if (!read) unread += 1;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return { uniqueKeys: latestReadByKey.size, unread };
|
|
252
|
+
}
|
|
253
|
+
\`\`\`
|
|
254
|
+
|
|
255
|
+
### Sample terminal output (GREEN)
|
|
256
|
+
|
|
257
|
+
\`\`\`bash
|
|
258
|
+
RUN v2.1.0 /Users/dev/app
|
|
259
|
+
|
|
260
|
+
✓ src/notificationFeed.test.ts (1 test) 12ms
|
|
261
|
+
|
|
262
|
+
Test Files 1 passed (1)
|
|
263
|
+
Tests 1 passed (1)
|
|
264
|
+
Tests: 1 passed.
|
|
265
|
+
\`\`\``,
|
|
266
|
+
review: `### Layer 1 — Spec compliance (per-criterion)
|
|
267
|
+
|
|
268
|
+
| Criterion | Status | Evidence |
|
|
269
|
+
| --- | --- | --- |
|
|
270
|
+
| Delivery within 5s without reload | PASS | \`notification-feed.e2e.ts:44-88\` asserts SSE-to-UI timing under mock clock |
|
|
271
|
+
| Dedupe: one visible item per key | PARTIAL | Unit tests cover publisher dedupe; UI merge path lacks test for race reordering (\`feedStore.test.ts\` missing case) |
|
|
272
|
+
| Degraded mode + REST snapshot | PASS | \`NotificationsPanel.tsx:112-140\` renders banner + calls snapshot endpoint |
|
|
273
|
+
|
|
274
|
+
### Layer 2 — Engineering finding (sample)
|
|
275
|
+
|
|
276
|
+
- **Severity:** Major
|
|
277
|
+
- **Description:** Snapshot endpoint returns newest N rows but does not guarantee consistency with stream cursor, so users can miss items that arrived between snapshot and subscribe.
|
|
278
|
+
- **File:line:** \`server/routes/notifications.ts:208\`
|
|
279
|
+
- **Recommendation:** Return a monotonic cursor with snapshot and initialize SSE from that cursor; add contract tests for gapless delivery.
|
|
280
|
+
- **Resolution options:**
|
|
281
|
+
1. Add cursor field + server-side reconciliation on subscribe (preferred).
|
|
282
|
+
2. Client-side “fetch since last seen id” merge pass (more complex, easier to get wrong).
|
|
283
|
+
3. Temporary mitigation: widen polling window when SSE is unhealthy (acceptable only as a short-term bridge).
|
|
284
|
+
|
|
285
|
+
### Layer 0 — hygiene checks (sample)
|
|
286
|
+
|
|
287
|
+
- **Dependency freshness:** no critical CVEs in direct server dependencies (scanner report linked in PR).
|
|
288
|
+
- **Secrets:** no new env vars committed; rotation playbook unchanged.
|
|
289
|
+
|
|
290
|
+
### Exit criteria (sample)
|
|
291
|
+
|
|
292
|
+
- All **Major** findings resolved or explicitly accepted with a time-bounded follow-up ticket.
|
|
293
|
+
- **PARTIAL** spec compliance items have a named owner and a test plan before ship.`,
|
|
294
|
+
ship: `### Preflight checklist (sample)
|
|
295
|
+
|
|
296
|
+
- tests ✅ (\`pnpm test\` green on main)
|
|
297
|
+
- build ✅ (\`pnpm build\` succeeds)
|
|
298
|
+
- lint ✅ (\`pnpm lint\` clean)
|
|
299
|
+
- type-check ✅ (\`pnpm typecheck\` clean)
|
|
300
|
+
|
|
301
|
+
### Release notes (sample)
|
|
302
|
+
|
|
303
|
+
- **Added:** In-app notification feed with SSE updates and REST fallback snapshotting.
|
|
304
|
+
- **Changed:** Notification payloads now include a stable dedupe key for idempotent rendering.
|
|
305
|
+
- **Fixed:** Panel no longer drops the newest item when reconnecting after sleep/resume.
|
|
306
|
+
|
|
307
|
+
### Rollback plan (sample)
|
|
308
|
+
|
|
309
|
+
1. Revert release tag \`v1.14.0\` to \`v1.13.2\` and redeploy the previous container image from the registry.
|
|
310
|
+
2. If database migrations shipped, run the documented down migration \`2026_04_12_notifications_cursor_down.sql\` before serving traffic again.
|
|
311
|
+
|
|
312
|
+
### Post-release monitoring (sample)
|
|
313
|
+
|
|
314
|
+
- Watch error rate on \`/notifications/stream\` and snapshot endpoint separately for 24 hours.
|
|
315
|
+
- Track p95 “publish → visible” lag via existing metrics dashboard; alert if SLO regresses.
|
|
316
|
+
|
|
317
|
+
### Communications (sample)
|
|
318
|
+
|
|
319
|
+
- Post a short internal changelog entry linking to release notes and rollback doc location.
|
|
320
|
+
- If user-visible behavior changes, prepare a one-paragraph support macro explaining the new feed + fallback behavior.`,
|
|
321
|
+
};
|
|
322
|
+
export function stageExamples(stage) {
|
|
323
|
+
const examples = STAGE_EXAMPLES[stage];
|
|
324
|
+
if (!examples)
|
|
325
|
+
return "";
|
|
326
|
+
return `## Examples\n\nConcrete samples of what good output looks like for this stage.\n\n${examples}\n`;
|
|
327
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook generators for all supported harnesses.
|
|
3
|
+
*
|
|
4
|
+
* SessionStart: injects using-cclaw + flow state + learnings + checkpoint/activity summary.
|
|
5
|
+
* Stop: writes checkpoint.json and reminds about flow consistency.
|
|
6
|
+
* PreToolUse/PostToolUse and summarize chain are generated in observe.ts.
|
|
7
|
+
*/
|
|
8
|
+
/** Shared bash preamble for generated hook scripts. */
|
|
9
|
+
export declare const RUNTIME_SHELL_DETECT_ROOT = "HARNESS=\"codex\"\nif [ -n \"${CLAUDE_PROJECT_DIR:-}\" ]; then\n HARNESS=\"claude\"\nelif [ -n \"${CURSOR_PROJECT_DIR:-}\" ] || [ -n \"${CURSOR_PROJECT_ROOT:-}\" ]; then\n HARNESS=\"cursor\"\nelif [ -n \"${OPENCODE_PROJECT_DIR:-}\" ] || [ -n \"${OPENCODE_PROJECT_ROOT:-}\" ]; then\n HARNESS=\"opencode\"\nfi\n\nROOT=\"\"\nfor candidate in \"${CCLAW_PROJECT_ROOT:-}\" \"${CLAUDE_PROJECT_DIR:-}\" \"${CURSOR_PROJECT_DIR:-}\" \"${CURSOR_PROJECT_ROOT:-}\" \"${OPENCODE_PROJECT_DIR:-}\" \"${OPENCODE_PROJECT_ROOT:-}\" \"${PWD:-}\"; do\n if [ -n \"$candidate\" ] && [ -d \"$candidate/.cclaw\" ]; then\n ROOT=\"$candidate\"\n break\n fi\ndone\nif [ -z \"$ROOT\" ]; then\n ROOT=\"${CCLAW_PROJECT_ROOT:-${CLAUDE_PROJECT_DIR:-${CURSOR_PROJECT_DIR:-${CURSOR_PROJECT_ROOT:-${OPENCODE_PROJECT_DIR:-${OPENCODE_PROJECT_ROOT:-${PWD}}}}}}}\"\nfi";
|
|
10
|
+
export declare function sessionStartScript(): string;
|
|
11
|
+
export declare function stopCheckpointScript(): string;
|
|
12
|
+
export { claudeHooksJsonWithObservation as claudeHooksJson } from "./observe.js";
|
|
13
|
+
export { cursorHooksJsonWithObservation as cursorHooksJson } from "./observe.js";
|
|
14
|
+
export { codexHooksJsonWithObservation as codexHooksJson } from "./observe.js";
|
|
15
|
+
export declare function opencodePluginJs(): string;
|
|
16
|
+
export declare function hooksAgentsMdBlock(): string;
|