@getbourdon/participants 0.2.2 → 0.2.4

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 (48) hide show
  1. package/README.md +7 -1
  2. package/dist/base.d.ts +109 -0
  3. package/dist/base.js +88 -0
  4. package/dist/index.cjs +171 -82
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +117 -4
  7. package/dist/index.d.ts +42 -970
  8. package/dist/index.js +53 -6509
  9. package/dist/index.js.map +1 -1
  10. package/dist/network-base.d.ts +108 -0
  11. package/dist/network-base.js +248 -0
  12. package/dist/readers/cascade.d.ts +49 -0
  13. package/dist/readers/cascade.js +428 -0
  14. package/dist/readers/claude-code-automations.d.ts +62 -0
  15. package/dist/readers/claude-code-automations.js +693 -0
  16. package/dist/readers/claude-code.d.ts +50 -0
  17. package/dist/readers/claude-code.js +583 -0
  18. package/dist/readers/claude-desktop-code.d.ts +54 -0
  19. package/dist/readers/claude-desktop-code.js +526 -0
  20. package/dist/readers/claude-desktop-cowork.d.ts +47 -0
  21. package/dist/readers/claude-desktop-cowork.js +659 -0
  22. package/dist/readers/codex-automations.d.ts +55 -0
  23. package/dist/readers/codex-automations.js +519 -0
  24. package/dist/readers/codex-sessions.d.ts +88 -0
  25. package/dist/readers/codex-sessions.js +194 -0
  26. package/dist/readers/copilot-automations.d.ts +64 -0
  27. package/dist/readers/copilot-automations.js +530 -0
  28. package/dist/readers/copilot-cli.d.ts +45 -0
  29. package/dist/readers/copilot-cli.js +416 -0
  30. package/dist/readers/copilot-vscode.d.ts +54 -0
  31. package/dist/readers/copilot-vscode.js +553 -0
  32. package/dist/readers/copilot.d.ts +59 -0
  33. package/dist/readers/copilot.js +413 -0
  34. package/dist/readers/cursor-automations.d.ts +57 -0
  35. package/dist/readers/cursor-automations.js +685 -0
  36. package/dist/readers/cursor.d.ts +50 -0
  37. package/dist/readers/cursor.js +670 -0
  38. package/dist/readers/github-copilot.d.ts +34 -0
  39. package/dist/readers/github-copilot.js +242 -0
  40. package/dist/readers/hermes.d.ts +37 -0
  41. package/dist/readers/hermes.js +426 -0
  42. package/dist/readers/openclaw.d.ts +78 -0
  43. package/dist/readers/openclaw.js +386 -0
  44. package/dist/registry.d.ts +39 -0
  45. package/dist/registry.js +98 -0
  46. package/dist/sqlite-base.d.ts +65 -0
  47. package/dist/sqlite-base.js +163 -0
  48. package/package.json +5 -5
package/dist/index.d.ts CHANGED
@@ -1,971 +1,43 @@
1
- import { L5ManifestModel, SessionModel, VisibilityPolicyModel } from '@getbourdon/l5';
2
- export { EntityModel, L5ManifestModel, SessionModel, Visibility, VisibilityPolicyModel, applyVisibility, filterForFederation, toDict, validateManifest } from '@getbourdon/l5';
3
- import DatabaseT from 'better-sqlite3';
4
-
5
1
  /**
6
- * Bourdon participant base — the Protocol → TS interface, errors, and the
7
- * AgentStore / HealthStatus types. Faithful port of `participants/base.py`.
8
- *
9
- * The L5 dataclass model (AgentInfo/Entity/Session/VisibilityPolicy/L5Manifest),
10
- * the `toDict` omission rules, and the visibility helpers all live in
11
- * `@getbourdon/l5` and are reused verbatim — only THAT output shape is the parity
12
- * contract. This module owns the participant CONTRACT surface around them.
13
- *
14
- * Contract semantics (enforced by every reader, asserted by the conformance
15
- * fixtures, never by trust):
16
- * 1. visibility filter BEFORE emission (`filterForFederation`) — private wins.
17
- * 2. deterministic / idempotent `exportL5` — same store → identical `toDict`.
18
- * 3. `healthCheck` NEVER throws — catch-all → degraded/blocked.
19
- * 4. every native string through `@getbourdon/redaction` before it enters L5.
20
- */
21
-
22
- /** Tied to Bourdon spec v0.1 — same literals as the Python oracle. */
23
- declare const CONTRACT_VERSION = "0.1";
24
- declare const SPEC_VERSION = "0.1";
25
- /** Base class for participant errors. */
26
- declare class ParticipantError extends Error {
27
- constructor(message?: string);
28
- }
29
- /** Raised by `discover()` when the native store cannot be found or read.
30
- * Non-fatal: L6 skips this agent rather than aborting the whole export. */
31
- declare class ParticipantDiscoveryError extends ParticipantError {
32
- }
33
- /** Raised by `exportL5()` / `exportSessions()` when an export fails mid-op
34
- * (the store WAS present — distinct from a discovery miss). */
35
- declare class ParticipantExportError extends ParticipantError {
36
- }
37
- /** Raised when the native store's version is outside the supported range.
38
- * Subtype of discovery error (a version mismatch is a discovery-time miss). */
39
- declare class ParticipantVersionMismatchError extends ParticipantDiscoveryError {
40
- }
41
- /** Metadata describing the native agent store. Returned by `discover()`. */
42
- interface AgentStore {
43
- path: string;
44
- version: string;
45
- metadata: Record<string, unknown>;
46
- }
47
- /** Returned by `healthCheck()`. Consumed by the `bourdon doctor` CLI. */
48
- interface HealthStatus {
49
- status: "ok" | "degraded" | "blocked";
50
- reason?: string;
51
- details: Record<string, unknown>;
52
- /** A human-runnable command to remedy a non-ok status. */
53
- proposedFix?: string;
54
- }
55
- /**
56
- * Structural interface every participant must satisfy (the Python
57
- * `@runtime_checkable Protocol`). Duck-typed at registration: a class is a
58
- * participant iff it has `agentId` + `agentType` + `exportL5` + `healthCheck`.
59
- *
60
- * Optional members (`displayName`, a `defaultNativePath` static) are documented
61
- * here as in the Python Protocol; discovery + the setup wizard fall back to
62
- * sensible defaults when absent.
63
- */
64
- interface BourdonParticipant {
65
- agentId: string;
66
- agentType: string;
67
- nativePath: string;
68
- /** Human-friendly label (e.g. "GitHub Copilot"). Optional. */
69
- displayName?: string;
70
- /** Quarantined-class marker (Python `QUARANTINED_CLASS`). When true, the CLI
71
- * requires `--i-understand-the-risk` to register the agent trusted, and its
72
- * exports are staged for operator review rather than written to the live
73
- * store (spec D6: quarantine follows the content, not the invoker). Absent =
74
- * a normal, non-quarantined participant. Read by `bourdon agent add/set-tier`
75
- * (cli/src/commands/federation.ts). */
76
- quarantinedClass?: boolean;
77
- /** Confirm the native store exists; return metadata. Throws
78
- * {@link ParticipantDiscoveryError} when missing/unreadable. */
79
- discover(): AgentStore;
80
- /** Build the L5 manifest from native memory, applying the visibility filter
81
- * BEFORE return. Deterministic — same store yields the same manifest. */
82
- exportL5(since?: Date): L5ManifestModel;
83
- /** Export recent sessions in normalized schema. */
84
- exportSessions(since?: Date, limit?: number): SessionModel[];
85
- /** Return ok / degraded / blocked with a reason. MUST NOT throw. */
86
- healthCheck(): HealthStatus;
87
- }
88
- /**
89
- * Tiny structural guard mirroring Python's `_PARTICIPANT_MARKER_ATTRS`
90
- * duck-type: a value is a participant iff it carries the four marker members.
91
- */
92
- declare function isParticipant(obj: unknown): obj is BourdonParticipant;
93
-
94
- /**
95
- * Shared read-only SQLite + normalization helpers — port of
96
- * `participants/_sqlite_base.py`.
97
- *
98
- * A SQLite-backed participant (hermes today; cursor/copilot_cli in the follow-on
99
- * slice) reads a foreign agent's native DB read-only so a live writer's lock can
100
- * never block the export, probes the schema defensively (native schemas drift
101
- * across versions), and turns epoch timestamps + paths into the L5 shapes.
102
- *
103
- * `better-sqlite3` is a NATIVE addon. It is loaded lazily through `createRequire`
104
- * inside a try/catch so this package — and the file/network readers — keep
105
- * working even on a toolchain where the addon failed to build: in that case
106
- * {@link sqliteAvailable} returns false and the sqlite readers degrade rather
107
- * than crashing import. Nothing here applies visibility or builds manifests;
108
- * that stays in the participant (per PARTICIPANT_CONTRACT.md).
109
- */
110
-
111
- /** A better-sqlite3 connection (re-exported type alias for reader signatures). */
112
- type SqliteDatabase = DatabaseT.Database;
113
- /** True when the better-sqlite3 native addon loaded successfully. Tests gate
114
- * the SQLite-reader assertions on this so a missing addon skips, not fails. */
115
- declare function sqliteAvailable(): boolean;
116
- interface OpenReadonlyOptions {
117
- /** `immutable=1`: skip locks + ignore the WAL. Only for genuinely static
118
- * snapshots; against a live writer it risks stale reads / SQLITE_CORRUPT. */
119
- immutable?: boolean;
120
- /** SQLite busy-timeout in milliseconds (Python's `timeout=2.0` seconds). */
121
- timeoutMs?: number;
122
- }
123
- /**
124
- * Open a SQLite DB read-only so a live writer is never disturbed. The default
125
- * (`immutable` omitted) is the safe `mode=ro`: it respects SQLite locking and
126
- * reads the `-wal` sidecar of a live, actively-writing agent. Raises on a
127
- * genuine open failure; callers wanting the never-raises contract use
128
- * {@link tryOpenReadonly}.
129
- */
130
- declare function openReadonly(dbPath: string, opts?: OpenReadonlyOptions): SqliteDatabase;
131
- /**
132
- * Like {@link openReadonly} but returns null instead of raising — for the
133
- * export/health path where a missing or corrupt DB must degrade to "no rows".
134
- */
135
- declare function tryOpenReadonly(dbPath: string, opts?: OpenReadonlyOptions): SqliteDatabase | null;
136
- /** True if `name` is a table in the connected DB (swallows errors → false). */
137
- declare function tableExists(db: SqliteDatabase, name: string): boolean;
138
- /** Column names for `table` (empty set if absent / on error). PRAGMA cannot be
139
- * parameterized, matching the Python f-string. */
140
- declare function tableColumns(db: SqliteDatabase, table: string): Set<string>;
141
- /**
142
- * Convert epoch seconds (number/string) to an ISO `YYYY-MM-DD` UTC date, or
143
- * null for missing/unparseable values. Mirrors `epoch_to_iso_date`.
144
- */
145
- declare function epochToIsoDate(value: unknown): string | null;
146
- /**
147
- * Convert epoch seconds to a full ISO 8601 UTC datetime, or null. The offset is
148
- * rendered `+00:00` (Python `datetime(...).isoformat()` style) rather than `Z`.
149
- */
150
- declare function epochToIsoDatetime(value: unknown): string | null;
151
- /**
152
- * Derive a lowercase project key from a working-directory path: the basename
153
- * lowercased, or null when the cwd is empty or its basename is "generic"
154
- * (carries no project identity). Mirrors `project_key_from_cwd`.
155
- */
156
- declare function projectKeyFromCwd(cwd: string | null | undefined, genericNames?: ReadonlySet<string>): string | null;
157
- /** Turn a slug-ish key (`my-cool_project`) into a Title Case label. */
158
- declare function friendlyLabel(key: string): string;
159
-
160
- /**
161
- * Network-shaped participant base — port of `participants/_network_base.py`
162
- * (v0.3 adapter contract). Same `exportL5` / `exportSessions` half as a file
163
- * participant; only the discovery half differs (fetch from an authenticated
164
- * API). The base provides the three guarantees so adapters don't reimplement:
165
- *
166
- * 1. Local TTL cache under `~/.cache/bourdon/<slug>/payload.json` storing ONLY
167
- * `{fetched_at, payload}` — NEVER the token. A cache hit = zero network.
168
- * 2. Graceful degradation: network down → serve the most recent cached payload
169
- * (even expired) and report `degraded` (not silence).
170
- * 3. Auth boundary: an injected lazy {@link AuthProvider} (env / keychain).
171
- * An invalid token (401/403 non-ratelimit) ALWAYS propagates as `blocked`
172
- * and is NEVER masked by stale cache; a missing token serves stale when a
173
- * cache exists, else blocks; rate-limit degrades.
174
- *
175
- * A subclass sets `participantSlug` / `agentId` / `agentType` (+ `nativePath`)
176
- * and implements `fetchPayload(token)` + `payloadToL5(payload)` (pure, no I/O).
177
- */
178
-
179
- declare const NETWORK_CONTRACT_VERSION = "0.3";
180
- /** Default cache TTL — adapters override via `cacheTtlSeconds`. */
181
- declare const DEFAULT_CACHE_TTL_SECONDS: number;
182
- /** Transport failure / timeout / 5xx / rate-limit — recoverable via cache fallback. */
183
- declare class NetworkUnavailable extends ParticipantError {
184
- }
185
- /** 401/403 / missing credential — NOT recoverable via cache. The user must fix
186
- * auth; surfaced as `blocked`, never silently served from stale cache (stale
187
- * data would mask a broken token indefinitely). */
188
- declare class ParticipantAuthError extends ParticipantError {
189
- }
190
- /** A zero-arg callable returning the token string, or null if no credential is
191
- * available. Kept a callable (not a bare string) so the token is fetched lazily
192
- * at call time and never sits in the participant's fields or the cache. */
193
- type AuthProvider = () => string | null;
194
- /** Auth provider that reads a token from an environment variable. */
195
- declare function envAuthProvider(varName: string): AuthProvider;
196
- /** `$XDG_CACHE_HOME/bourdon` or `~/.cache/bourdon`. */
197
- declare function defaultCacheRoot(): string;
198
- /** A cached payload + the wall-clock time it was fetched (epoch seconds). */
199
- declare class CacheEntry {
200
- readonly fetchedAt: number;
201
- readonly payload: Record<string, unknown>;
202
- constructor(fetchedAt: number, payload: Record<string, unknown>);
203
- get ageSeconds(): number;
204
- isFresh(ttlSeconds: number): boolean;
205
- }
206
- /**
207
- * A tiny JSON file cache, one file per participant slug. Stores only
208
- * `{fetched_at, payload}` — never the auth token. Read/write are best-effort: a
209
- * corrupt or unwritable cache degrades to "no cache", never raises.
210
- */
211
- declare class PayloadCache {
212
- readonly slug: string;
213
- readonly root: string;
214
- readonly path: string;
215
- constructor(slug: string, rootDir?: string);
216
- read(): CacheEntry | null;
217
- write(payload: Record<string, unknown>): void;
218
- }
219
- interface NetworkParticipantOptions {
220
- authProvider?: AuthProvider | null;
221
- cacheRoot?: string;
222
- }
223
- /**
224
- * Base for participants whose native state lives behind an authenticated API.
225
- * Caching, degradation, the auth boundary, and the
226
- * `discover`/`exportL5`/`exportSessions`/`healthCheck` plumbing live here;
227
- * subclasses provide only `fetchPayload` + `payloadToL5`.
228
- */
229
- declare abstract class NetworkParticipant implements BourdonParticipant {
230
- participantSlug: string;
231
- agentId: string;
232
- agentType: string;
233
- cacheTtlSeconds: number;
234
- nativePath: string;
235
- protected readonly authProvider: AuthProvider | null;
236
- private readonly cacheRoot?;
237
- private cacheInstance?;
238
- constructor(opts?: NetworkParticipantOptions);
239
- /** Lazily built so it reads the SUBCLASS's `participantSlug` — subclass field
240
- * initializers run after `super()`, so building the cache in the constructor
241
- * would capture the base "network" slug instead. */
242
- protected get cache(): PayloadCache;
243
- /** Do the authenticated API call; return a JSON-serializable dict. Raise
244
- * {@link NetworkUnavailable} on transport/5xx/rate-limit (→ cache fallback) or
245
- * {@link ParticipantAuthError} on 401/403 (→ blocked, no fallback). */
246
- abstract fetchPayload(token: string): Record<string, unknown>;
247
- /** Normalize a (fresh or cached) payload into an L5 manifest. Pure, no I/O. */
248
- abstract payloadToL5(payload: Record<string, unknown>): L5ManifestModel;
249
- /**
250
- * Resolve (payload, source) where source is 'cache' | 'network' | 'stale-cache'.
251
- * 1. Fresh cache hit → 'cache' (no network)
252
- * 2. Miss/expired + token → 'network' (fetch + refresh cache)
253
- * 3. Net fails + any cache → 'stale-cache' (serve last good payload)
254
- * 4. Net fails + no cache → raise
255
- * Auth errors are never swallowed — they propagate so health surfaces
256
- * 'blocked' rather than serving stale data behind a dead token.
257
- */
258
- protected getPayload(): {
259
- payload: Record<string, unknown>;
260
- source: string;
261
- };
262
- discover(): AgentStore;
263
- exportL5(_since?: Date): L5ManifestModel;
264
- exportSessions(since?: Date, limit?: number): SessionModel[];
265
- healthCheck(): HealthStatus;
266
- }
267
-
268
- /**
269
- * Hermes participant — normalize Hermes Agent (Nous Research) memory + sessions
270
- * into L5. Port of `participants/hermes.py`.
271
- *
272
- * Reads two surfaces under `~/.hermes/` (override `$HERMES_HOME`):
273
- * * `state.db` — a SQLite store (`sessions` + `messages` tables). Recent
274
- * non-archived sessions + project entities (from cwd basename) come from it.
275
- * * `memories/{memory.md,user.md}` — durable cross-session facts (one
276
- * Markdown bullet/line per memory). The highest-signal entities.
277
- *
278
- * Read-only (`mode=ro`), deterministic, visibility-enforced-before-emission,
279
- * and redaction on every native string. `healthCheck` never throws; `discover`
280
- * raises only {@link ParticipantDiscoveryError}.
281
- */
282
-
283
- /** External participant for local Hermes Agent memory + sessions. */
284
- declare class HermesParticipant implements BourdonParticipant {
285
- agentId: string;
286
- agentType: string;
287
- displayName: string;
288
- nativePath: string;
289
- private readonly home;
290
- static defaultNativePath(home?: string): string;
291
- /** `hermesHome` is the `.hermes` directory itself (matching the Python ctor). */
292
- constructor(hermesHome?: string);
293
- private sources;
294
- discover(): AgentStore;
295
- exportSessions(since?: Date, limit?: number): SessionModel[];
296
- exportL5(since?: Date): L5ManifestModel;
297
- healthCheck(): HealthStatus;
298
- }
299
-
300
- /**
301
- * Claude Code participant — reads claude-brain + auto-memory + MCP knowledge
302
- * graph. Port of `participants/claude_code.py`.
303
- *
304
- * Three optional sources (the participant degrades gracefully):
305
- * 1. claude-brain/ — git-synced markdown records
306
- * 2. ~/.claude/projects/<ws>/memory/ — per-machine auto-memory frontmatter
307
- * 3. ~/claude-memory/memory.jsonl — MCP knowledge-graph JSONL
308
- *
309
- * Privacy: entities typed `person` (+ family/contact variants) and observations
310
- * containing credential-like strings default to PRIVATE and are filtered before
311
- * federation. Entities are deduped by case-insensitive name and sorted
312
- * alphabetically.
313
- */
314
-
315
- /** External participant for Anthropic's Claude Code CLI. */
316
- declare class ClaudeCodeParticipant implements BourdonParticipant {
317
- agentId: string;
318
- agentType: string;
319
- nativePath: string;
320
- /** Public so a hermetic test can seed the discovered sources directly (path
321
- * RESOLUTION is not the parity contract — only the export output shape is). */
322
- brainPath: string | null;
323
- autoMemoryPath: string | null;
324
- knowledgeGraphPath: string | null;
325
- static defaultNativePath(home?: string): string;
326
- constructor();
327
- discover(): AgentStore;
328
- exportL5(since?: Date): L5ManifestModel;
329
- exportSessions(since?: Date, limit?: number): SessionModel[];
330
- healthCheck(): HealthStatus;
331
- }
332
-
333
- /**
334
- * GitHub-embedded Copilot participant — the v0.3 network-adapter reference.
335
- * Port of `participants/github_copilot.py`.
336
- *
337
- * Cloud-side Copilot (PR review, `@copilot` comments) persists nothing on the
338
- * user's machine — its state lives on github.com. This adapter federates it by
339
- * reading the user's GitHub activity over the REST API. The
340
- * {@link NetworkParticipant} base provides the cache, degradation, and auth
341
- * boundary; this class provides only the GitHub-specific fetch + payload→L5.
342
- *
343
- * Auth: a token with `repo` + `read:user` scope, sourced from `$GITHUB_TOKEN` /
344
- * `$GH_TOKEN`, else `gh auth token`. Fetched lazily; never stored in the cache
345
- * or the manifest.
346
- */
347
-
348
- /** Resolve a GitHub token: env var first, then the `gh` CLI keychain. */
349
- declare function ghTokenProvider(): string | null;
350
- /** Federates cloud-side GitHub Copilot activity via the GitHub REST API. */
351
- declare class GitHubCopilotParticipant extends NetworkParticipant {
352
- participantSlug: string;
353
- agentId: string;
354
- agentType: string;
355
- nativePath: string;
356
- displayName: string;
357
- private readonly maxResults;
358
- constructor(opts?: NetworkParticipantOptions & {
359
- maxResults?: number;
360
- });
361
- static defaultNativePath(): string;
362
- fetchPayload(token: string): Record<string, unknown>;
363
- payloadToL5(payload: Record<string, unknown>): L5ManifestModel;
364
- }
365
-
366
- /**
367
- * Cursor participant — reads Cursor's (the AI-first IDE) SQLite-backed
368
- * workspace/composer state and normalizes it into L5. Port of
369
- * `participants/cursor.py` + the extraction helper `participants/_cursor_sqlite.py`.
370
- *
371
- * Cursor stores workspace state in `state.vscdb` SQLite DBs at platform-specific
372
- * paths (`~/.config/Cursor/`, `~/Library/Application Support/Cursor/`,
373
- * `%APPDATA%/Cursor/`). This reader discovers those stores, reads the `ItemTable`
374
- * key/value rows read-only, parses the composer/chat records into sessions +
375
- * project/topic entities, and merges curated `.cursor/memory/short-index.json`
376
- * entities alongside them.
377
- *
378
- * SQLite access: the Python oracle copies each DB (+ its `-wal`/`-shm`
379
- * companions) to a tmp file and opens it read-write so SQLite folds the WAL into
380
- * a consistent snapshot. The TS mirror instead leans on {@link tryOpenReadonly}
381
- * (`mode=ro`), which respects SQLite locking and reads the `-wal` sidecar of a
382
- * live writer — the same consistent view without the copy. Read-only,
383
- * deterministic, visibility-enforced-before-emission, redaction on every native
384
- * string; `healthCheck` never throws.
385
- */
386
-
387
- /** External participant for Cursor's SQLite workspace state. */
388
- declare class CursorParticipant implements BourdonParticipant {
389
- agentId: string;
390
- agentType: string;
391
- private readonly cursorDir;
392
- private readonly workspaceRoot;
393
- private readonly policy;
394
- /**
395
- * Conventional Cursor config dir (`~/.cursor`) used by the setup wizard. The
396
- * wizard probes `~/.cursor` for presence; the SQLite workspace state that
397
- * `exportL5` actually reads lives at {@link defaultCursorDir}. Detection and
398
- * extraction intentionally use different anchors.
399
- */
400
- static defaultNativePath(home?: string): string;
401
- constructor(cursorDir?: string | null, workspaceRoot?: string | null);
402
- get nativePath(): string;
403
- discover(): AgentStore;
404
- exportSessions(since?: Date, limit?: number): SessionModel[];
405
- exportL5(since?: Date): L5ManifestModel;
406
- healthCheck(): HealthStatus;
407
- private extract;
408
- }
409
-
410
- /**
411
- * GitHub Copilot (local convention) participant — reads the convention-based
412
- * memory file at `~/.copilot-bourdon/memory.md`. Port of `participants/copilot.py`.
413
- *
414
- * Copilot has no accessible local session index (its reasoning is cloud-side and
415
- * its native memory is not exposed on disk), so — like the Codex pre-distillation
416
- * fallback — this reader normalizes a user-maintained convention file into a
417
- * Bourdon L5 manifest. The file is YAML front-matter (structured `entities:` /
418
- * `sessions:`) followed by an optional freeform markdown body that Copilot Chat
419
- * reads as plain context but this reader ignores.
420
- *
421
- * NOT the cloud GitHub-Copilot network adapter ({@link GitHubCopilotParticipant})
422
- * and NOT the Copilot CLI SQLite reader.
423
- *
424
- * Paths checked (in order):
425
- * 1. `COPILOT_BOURDON_HOME` env-var override
426
- * 2. `~/.copilot-bourdon/` (default convention path)
427
- *
428
- * Defensive throughout: a missing convention directory raises
429
- * {@link ParticipantDiscoveryError} from `discover()`; malformed YAML degrades to
430
- * an empty manifest rather than raising; `healthCheck` never throws.
431
- */
432
-
433
- /**
434
- * External participant for GitHub Copilot via `~/.copilot-bourdon/memory.md`.
435
- * Implements {@link BourdonParticipant} structurally.
436
- */
437
- declare class CopilotParticipant implements BourdonParticipant {
438
- agentId: string;
439
- agentType: string;
440
- displayName: string;
441
- nativePath: string;
442
- /** Conventional `~/.copilot-bourdon` dir used by the setup wizard's detection. */
443
- static defaultNativePath(home?: string): string;
444
- private readonly copilotDir;
445
- constructor(copilotDir?: string | null);
446
- discover(): AgentStore;
447
- exportSessions(since?: Date, limit?: number): SessionModel[];
448
- exportL5(since?: Date): L5ManifestModel;
449
- healthCheck(): HealthStatus;
450
- private read;
451
- }
452
-
453
- /**
454
- * GitHub Copilot CLI participant — normalize the `copilot` terminal agent's
455
- * SQLite session store into L5. Port of `participants/copilot_cli.py`.
456
- *
457
- * Copilot CLI stores session history in a SQLite database at
458
- * `~/.copilot/session-store.db` (override `$COPILOT_CLI_HOME`). This is distinct
459
- * from:
460
- * - the VS Code Copilot Chat extension (`github-copilot` network reader)
461
- * - the `~/.copilot-bourdon/memory.md` convention-file participant (`copilot`)
462
- * - GitHub-embedded Copilot (no local state)
463
- *
464
- * The schema (schema_version 4) carries `sessions` / `turns` / `checkpoints`
465
- * plus `session_files` / `session_refs` / `dynamic_context_items`. The reader
466
- * opens the DB read-only (`mode=ro` via {@link tryOpenReadonly}) so a live
467
- * writer's lock can never block the export, probes each table defensively (a
468
- * missing table degrades to "no rows" rather than raising), redacts every native
469
- * string, applies the visibility filter BEFORE emission, and is deterministic.
470
- * `healthCheck` never throws.
471
- */
472
-
473
- /**
474
- * External participant for GitHub Copilot CLI (`~/.copilot/session-store.db`).
475
- * Reads the SQLite database read-only (never locks the live db).
476
- */
477
- declare class CopilotCliParticipant implements BourdonParticipant {
478
- agentId: string;
479
- agentType: string;
480
- displayName: string;
481
- nativePath: string;
482
- private readonly copilotDir;
483
- /** Conventional `~/.copilot` dir used by the setup wizard's detection. */
484
- static defaultNativePath(home?: string): string;
485
- constructor(copilotDir?: string);
486
- discover(): AgentStore;
487
- exportSessions(since?: Date, limit?: number): SessionModel[];
488
- exportL5(since?: Date): L5ManifestModel;
489
- healthCheck(): HealthStatus;
490
- private emptyManifest;
491
- }
492
-
493
- /**
494
- * Cascade (Windsurf) participant — convention-file reader. Port of
495
- * `participants/cascade.py`.
496
- *
497
- * Cascade's internal state is not exposed on the filesystem in a standardized
498
- * format (like cloud Copilot). Instead this participant uses a CONVENTION FILE:
499
- * Cascade maintains a structured memory file at `~/.cascade-bourdon/memory.md`
500
- * with YAML front-matter carrying `entities` + `sessions`. Cascade owns that
501
- * projection explicitly (it writes what it knows at session end); the
502
- * participant normalizes the front-matter into an L5 manifest for federation.
503
- *
504
- * Privacy: entity/session summaries pass through the redaction SSOT; the
505
- * visibility policy (private_tags) filters PRIVATE entities before emission.
506
- */
507
-
508
- /**
509
- * Convention-based Bourdon participant for Cascade (Windsurf). Reads structured
510
- * memory from `~/.cascade-bourdon/memory.md` and normalizes it into L5.
511
- */
512
- declare class CascadeParticipant implements BourdonParticipant {
513
- agentId: string;
514
- agentType: string;
515
- displayName: string;
516
- private readonly dir;
517
- private readonly policy;
518
- static defaultNativePath(home?: string): string;
519
- constructor(cascadeDir?: string, policy?: VisibilityPolicyModel);
520
- /** Path to the Cascade-Bourdon convention directory. */
521
- get nativePath(): string;
522
- private memoryPath;
523
- private readFrontmatter;
524
- discover(): AgentStore;
525
- exportL5(since?: Date): L5ManifestModel;
526
- exportSessions(since?: Date, limit?: number): SessionModel[];
527
- healthCheck(): HealthStatus;
528
- }
529
-
530
- /**
531
- * OpenClaw participant — network-shaped, QUARANTINED-CLASS. Port of
532
- * `participants/openclaw.py` (v0.9.0, spec R4/D9).
533
- *
534
- * OpenClaw is the highest-demand adapter target in the ecosystem and also its
535
- * highest-risk agent class: CVE-2026-25253 (one-click RCE, CVSS 8.8, first
536
- * patched in 2026.1.29), tens of thousands of internet-exposed instances (~93%
537
- * without authentication), ClawHub's malicious-skill problem, and auth disabled
538
- * by default on port 8080. Bourdon therefore treats OpenClaw differently from
539
- * every on-disk participant:
540
- *
541
- * 1. **Network-shaped** — state is read from the OpenClaw instance's local
542
- * HTTP API, not on-disk artifacts. Because the {@link BourdonParticipant}
543
- * contract is SYNCHRONOUS (`discover`/`exportL5` return values, not
544
- * Promises) and `fetch` is async, the reads go through a tiny synchronous
545
- * `curl` shell-out (the same idiom as the github-copilot reader).
546
- * 2. **Hard handshake gate** — {@link OpenClawParticipant.discover} refuses to
547
- * talk to an instance that is unpatched (< 2026.1.29) or has authentication
548
- * disabled. These are refusals with exact reasons AND fixes, not warnings,
549
- * and every read re-runs the gate.
550
- * 3. **Quarantined-class** — `quarantinedClass = true`: registering the agent
551
- * trusted requires `--i-understand-the-risk`, and exports stage for
552
- * operator review (spec D6: quarantine follows the content, not the
553
- * invoker). Its content federates under TEAM, never PUBLIC.
554
- *
555
- * We gate on instance hygiene (version, auth) — NOT on auditing the user's
556
- * installed skills; that's ClawSecure et al.'s job (spec non-goal 3).
557
- */
558
-
559
- /** First OpenClaw release that patches CVE-2026-25253 (one-click RCE). */
560
- declare const MIN_PATCHED_VERSION = "2026.1.29";
561
- /**
562
- * Hard handshake preconditions (spec D9). Returns the version on success.
563
- * Raises {@link ParticipantDiscoveryError} with the exact reason AND the fix —
564
- * these are refusals, not warnings.
565
- */
566
- declare function verifyInstance(status: Record<string, unknown>, url: string): string;
567
- /**
568
- * Minimal HTTP client for a local OpenClaw instance. Read-only: status,
569
- * sessions, memories. Failures raise {@link ParticipantDiscoveryError} with the
570
- * reason — the participant decides how to surface them.
571
- *
572
- * Error mapping (faithful to the Python `urllib` client): an HTTP >= 400
573
- * response -> "returned HTTP {code}"; a transport failure / timeout / non-JSON
574
- * body -> "instance unreachable at {url}".
575
- */
576
- declare class OpenClawApiClient {
577
- readonly url: string;
578
- private readonly token;
579
- readonly timeout: number;
580
- constructor(url: string, token?: string, timeout?: number);
581
- private get;
582
- status(): Record<string, unknown>;
583
- sessions(): Record<string, unknown>[];
584
- memories(): Record<string, unknown>[];
585
- /** Shared `sessions()`/`memories()` body: try/except-returns-[], unwrap the
586
- * `{ "<key>": [...] }` envelope, and keep only object rows. */
587
- private readCollection;
588
- }
589
- /** Bourdon participant for OpenClaw (quarantined class). */
590
- declare class OpenClawParticipant implements BourdonParticipant {
591
- agentId: string;
592
- agentType: string;
593
- displayName: string;
594
- /** Trust marker consumed by `bourdon agent add/set-tier` + export-all:
595
- * registering as trusted needs --i-understand-the-risk; exports stage. */
596
- quarantinedClass: boolean;
597
- readonly url: string;
598
- private readonly client;
599
- static defaultNativePath(home?: string): string;
600
- constructor(url?: string, token?: string, client?: OpenClawApiClient);
601
- get nativePath(): string;
602
- discover(): AgentStore;
603
- exportSessions(since?: Date, limit?: number): SessionModel[];
604
- exportL5(since?: Date): L5ManifestModel;
605
- healthCheck(): HealthStatus;
606
- }
607
-
608
- /**
609
- * Claude Code automations participant — publishes background-run memory as L5
610
- * evidence. Port of `participants/claude_code_automations.py`.
611
- *
612
- * Convention-file reader over the `~/.claude/automations/<id>/` tree:
613
- * automation.toml — id, name, status, schedule (rrule), kind, cwds
614
- * memory.md — dated bullet entries, one block per run
615
- *
616
- * Each `automation.toml` becomes a known Entity (`type: automation`); each dated
617
- * section of `memory.md` becomes a recent Session. Mirrors the Codex automation
618
- * publisher — it covers the federation gap that the interactive-only
619
- * `claude-code` participant leaves behind (automations whose work never touches
620
- * claude-brain / auto-memory / the MCP knowledge graph).
621
- *
622
- * Privacy: every native string routes through the redaction SSOT
623
- * (`redactText`, == the oracle's `_safe_native_memory_text`); the visibility
624
- * policy filters PRIVATE entities before emission. `healthCheck` never throws.
625
- */
626
-
627
- /** External participant for Claude Code automation memory artifacts. */
628
- declare class ClaudeCodeAutomationsParticipant implements BourdonParticipant {
629
- agentId: string;
630
- agentType: string;
631
- nativePath: string;
632
- private readonly automationsDir;
633
- private readonly policy;
634
- /**
635
- * Conventional Claude Code automations dir (`~/.claude/automations`). Provided
636
- * for protocol uniformity — the setup wizard wires the parent `claude-code`
637
- * participant and skips `-automations` sub-surfaces.
638
- */
639
- static defaultNativePath(home?: string): string;
640
- constructor(automationsDir?: string, claudeHome?: string);
641
- discover(): AgentStore;
642
- exportSessions(since?: Date, limit?: number): SessionModel[];
643
- exportL5(since?: Date): L5ManifestModel;
644
- healthCheck(): HealthStatus;
645
- private runs;
646
- }
647
-
648
- /**
649
- * Codex automations participant — publishes read-only Codex background/automation
650
- * run memory into Bourdon as L5 evidence. Port of
651
- * `participants/codex_automations.py`.
652
- *
653
- * Store convention (NOT SQLite, NOT network): a CONVENTION-FILE directory tree at
654
- * `~/.codex/automations/<id>/`, each holding an `automation.toml` config and an
655
- * optional `memory.md` run log. The reader parses the TOML config and extracts
656
- * dated "runs" from the markdown memory, normalizing them into L5 sessions +
657
- * entities (the automation itself, plus inferred projects and signal classes).
658
- *
659
- * Source-resolution order for the automations dir:
660
- * 1. explicit `automationsDir` constructor arg
661
- * 2. `codexHome` constructor arg → `<codexHome>/automations`
662
- * 3. `CODEX_HOME` env-var → `$CODEX_HOME/automations`
663
- * 4. `~/.codex/automations` (default convention path)
664
- *
665
- * Privacy: every native string routes through the redaction SSOT
666
- * (`redactText(v, 180)` == the oracle's `_safe_native_memory_text`); the
667
- * visibility policy filters PRIVATE entities before emission. Defensive
668
- * throughout — a missing dir raises {@link ParticipantDiscoveryError} from
669
- * `discover()`, malformed TOML/markdown degrades to empty rather than raising,
670
- * and `healthCheck` never throws.
671
- *
672
- * NOTE: does NOT depend on the full codex reader — only the redaction helper it
673
- * imports (`_safe_native_memory_text`, reproduced inline as {@link safeNativeMemoryText}).
674
- */
675
-
676
- /**
677
- * External participant for Codex automation memory artifacts. Reads
678
- * `~/.codex/automations/<id>/{automation.toml,memory.md}` and normalizes dated
679
- * runs into an L5 manifest.
680
- */
681
- declare class CodexAutomationsParticipant implements BourdonParticipant {
682
- agentId: string;
683
- agentType: string;
684
- private readonly automationsDir;
685
- private readonly policy;
686
- /**
687
- * Conventional Codex automations dir (`~/.codex/automations`). Provided for
688
- * protocol uniformity — the setup wizard wires the parent `codex` participant
689
- * and skips `-automations` sub-surfaces rather than detecting this one.
690
- */
691
- static defaultNativePath(home?: string): string;
692
- constructor(automationsDir?: string, codexHome?: string);
693
- get nativePath(): string;
694
- discover(): AgentStore;
695
- exportSessions(since?: Date, limit?: number): SessionModel[];
696
- exportL5(since?: Date): L5ManifestModel;
697
- healthCheck(): HealthStatus;
698
- private runs;
699
- }
700
-
701
- /**
702
- * GitHub Copilot · Automations participant — convention-file reader. Port of
703
- * `participants/copilot_automations.py`.
704
- *
705
- * GitHub Copilot can be triggered by GitHub Actions workflows, scheduled tasks,
706
- * and event-driven automations (issue triage, PR review, etc.). These run on a
707
- * separate memory surface from both the CLI agent and the VS Code extension.
708
- * Copilot automations have no standardized local state dump, so — mirroring the
709
- * codex-automations reader — this participant uses a CONVENTION directory:
710
- *
711
- * ~/.copilot-bourdon/automations/<automation-id>/
712
- * automation.toml — id, name, status, trigger, kind, repos
713
- * memory.md — dated bullet entries, one block per run
714
- *
715
- * Each `automation.toml` describes a recurring automation; each dated section of
716
- * `memory.md` captures what happened in that run. Users or CI scripts maintain
717
- * these files.
718
- *
719
- * Path resolution (matches the oracle):
720
- * 1. `COPILOT_AUTOMATIONS_HOME` env-var override (verbatim, → /automations skipped:
721
- * the override IS the automations dir).
722
- * 2. `~/.copilot-bourdon/automations/` (default convention path).
723
- *
724
- * Defensive throughout: a missing automations directory raises
725
- * {@link ParticipantDiscoveryError} from `discover()`; a malformed
726
- * `automation.toml` or unreadable `memory.md` is logged and skipped rather than
727
- * raising; `healthCheck` never throws.
728
- */
729
-
730
- /**
731
- * Convention-based Bourdon participant for Copilot automation memory artifacts.
732
- * Users or CI scripts maintain `automation.toml` + `memory.md` files at
733
- * `~/.copilot-bourdon/automations/<id>/`.
734
- */
735
- declare class CopilotAutomationsParticipant implements BourdonParticipant {
736
- agentId: string;
737
- agentType: string;
738
- displayName: string;
739
- private readonly automationsDir;
740
- private readonly policy;
741
- /** Conventional automations dir (`~/.copilot-bourdon/automations`). Does NOT
742
- * consult `COPILOT_AUTOMATIONS_HOME` (matches Python `default_native_path`). */
743
- static defaultNativePath(home?: string): string;
744
- constructor(automationsDir?: string | null);
745
- get nativePath(): string;
746
- discover(): AgentStore;
747
- exportSessions(since?: Date, limit?: number): SessionModel[];
748
- exportL5(since?: Date): L5ManifestModel;
749
- healthCheck(): HealthStatus;
750
- private runs;
751
- }
752
-
753
- /**
754
- * Cursor automations participant — publish background agent run memory as L5
755
- * evidence. Port of `participants/cursor_automations.py`.
756
- *
757
- * Reads the `~/.cursor/automations/<id>/` CONVENTION (file-based, no SQLite):
758
- *
759
- * automation.toml — id, name, status, schedule (rrule), kind, cwds
760
- * memory.md — dated bullet entries, one block per run
761
- *
762
- * Each `automation.toml` becomes a known Entity; each dated section of
763
- * `memory.md` becomes a recent Session. This covers the federation gap the
764
- * interactive-only `cursor` participant leaves behind: Cursor Cloud Agent
765
- * background tasks whose work never touches the interactive SQLite state.
766
- *
767
- * Path resolution (default dir):
768
- * 1. explicit `cursorHome` ctor arg → `<cursorHome>/automations`
769
- * 2. `CURSOR_DIR` or `CURSOR_HOME` env → `<env>/automations`
770
- * 3. `~/.cursor/automations`
771
- *
772
- * Redaction: every native action string passes through the redaction SSOT
773
- * (`redactText(v, 180)` == Python `_safe_native_memory_text`). Visibility policy
774
- * filters PRIVATE entities BEFORE emission. `healthCheck` never throws.
775
- */
776
-
777
- /** External participant for Cursor Cloud Agent automation memory artifacts. */
778
- declare class CursorAutomationsParticipant implements BourdonParticipant {
779
- agentId: string;
780
- agentType: string;
781
- private readonly automationsDir;
782
- private readonly policy;
783
- constructor(automationsDir?: string | null, cursorHome?: string | null);
784
- get nativePath(): string;
785
- discover(): AgentStore;
786
- exportSessions(since?: Date, limit?: number): SessionModel[];
787
- exportL5(since?: Date): L5ManifestModel;
788
- healthCheck(): HealthStatus;
789
- private runs;
790
- }
791
-
792
- /**
793
- * Claude Desktop · Code participant — the Claude desktop app's GUI "Claude Code"
794
- * surface. Port of `participants/claude_desktop_code.py` (+ the shared
795
- * `participants/_claude_desktop.py` helpers it needs).
796
- *
797
- * The desktop GUI's Claude Code keeps **metadata-only** state on disk — there is
798
- * no transcript. State files live at:
799
- *
800
- * <desktop>/claude-code-sessions/<accountUUID>/<orgUUID>/local_<id>.json
801
- *
802
- * This participant emits **recognition metadata only** and routes every emitted
803
- * string through the shared redactor + a length cap (defense in depth): title,
804
- * cwd→project, model, effort, `enabledMcpTools` *count*, timestamps. It never
805
- * emits `planPath` contents or any free-form text beyond the redacted title.
806
- *
807
- * Distinct from the interactive-CLI {@link ClaudeCodeParticipant} and the richer
808
- * Co-Work surface. Convention: file/JSON reader (no SQLite, no network).
809
- */
810
-
811
- /**
812
- * External participant for the Claude desktop app's GUI Claude Code surface.
813
- * File/JSON reader — metadata-only, no transcript, no SQLite, no network.
814
- */
815
- declare class ClaudeDesktopCodeParticipant implements BourdonParticipant {
816
- agentId: string;
817
- agentType: string;
818
- displayName: string;
819
- private readonly storeDir;
820
- private readonly policy;
821
- /**
822
- * The Claude Code sub-store dir the setup wizard probes for presence. Resolves
823
- * to `<desktop>/claude-code-sessions`. Falls back to a non-existent sentinel
824
- * under `home` on an unrecognized platform so the wizard reports "not found".
825
- */
826
- static defaultNativePath(home?: string): string;
827
- constructor(storeDir?: string, home?: string);
828
- get nativePath(): string;
829
- discover(): AgentStore;
830
- exportSessions(since?: Date, limit?: number): SessionModel[];
831
- exportL5(since?: Date): L5ManifestModel;
832
- healthCheck(): HealthStatus;
833
- private collectConversations;
834
- private conversations;
835
- }
836
-
837
- /**
838
- * Claude Desktop · Co-Work participant — the richest of the two Claude-desktop
839
- * surfaces. Port of `participants/claude_desktop_cowork.py` (+ the shared
840
- * `participants/_claude_desktop.py` extraction helpers, inlined here).
841
- *
842
- * The desktop app stores each Co-Work / local-agent run as a state file plus a
843
- * sibling audit transcript:
844
- *
845
- * <desktop>/local-agent-mode-sessions/<acct>/<org>/local_<id>.json (state)
846
- * <desktop>/local-agent-mode-sessions/<acct>/<org>/local_<id>/audit.jsonl
847
- *
848
- * This participant emits **recognition metadata only**. From the state file it
849
- * reads surface scalars (title, cwd, model, permission mode, timestamps,
850
- * `enabledMcpTools` *count*, `userSelectedFolders` *basenames*). From the
851
- * sibling `audit.jsonl` it reads ONLY the `system`/`init` capability *counts*
852
- * and the `result` safe scalars (cost, turns, error flag). It NEVER reads
853
- * conversation content. Every emitted string passes through the redaction SSOT
854
- * + a length cap, and TEAM entities are visibility-filtered before emission.
855
- *
856
- * Storage kind: file/convention (glob + JSON + JSONL), so this reads like the
857
- * claude-code / cascade file readers — no SQLite, no network.
858
- */
859
-
860
- /** External participant for the Claude desktop app's Co-Work surface. */
861
- declare class ClaudeDesktopCoworkParticipant implements BourdonParticipant {
862
- agentId: string;
863
- agentType: string;
864
- displayName: string;
865
- private readonly storeDir;
866
- private readonly policy;
867
- /**
868
- * The Co-Work sub-store dir the setup wizard probes for presence. Resolves to
869
- * `<desktop>/local-agent-mode-sessions`. When the desktop dir cannot be
870
- * resolved on this platform, falls back to a non-existent sentinel under
871
- * `home` so the wizard reports "not found" rather than crashing.
872
- */
873
- static defaultNativePath(home?: string): string;
874
- constructor(storeDir?: string, home?: string);
875
- get nativePath(): string;
876
- discover(): AgentStore;
877
- exportSessions(since?: Date, limit?: number): SessionModel[];
878
- exportL5(since?: Date): L5ManifestModel;
879
- healthCheck(): HealthStatus;
880
- private collectRuns;
881
- private runs;
882
- }
883
-
884
- /**
885
- * GitHub Copilot · VS Code participant — reads the GUI Copilot Chat extension's
886
- * per-workspace transcripts + repo-scoped memory. Port of
887
- * `participants/copilot_vscode.py`.
888
- *
889
- * VS Code's Copilot Chat extension stores per-workspace data at
890
- * `<workspaceStorage>/<hash>/GitHub.copilot-chat/`:
891
- * - `transcripts/<session-uuid>.jsonl` — event stream per chat session
892
- * - `memory-tool/memories/**\/*.md` — per-repo memory (markdown bullets)
893
- *
894
- * This is a FILE/CONVENTION reader (not SQLite, not network): it walks the
895
- * workspaceStorage tree read-only, parses JSONL transcripts + markdown memory
896
- * files, aggregates across every workspace hash, redacts every native string,
897
- * applies the visibility filter BEFORE emission, and is deterministic.
898
- * `healthCheck` never throws.
899
- *
900
- * Distinct from:
901
- * - `copilot` (convention-file at `~/.copilot-bourdon/memory.md`)
902
- * - `copilot-cli` (terminal agent, `~/.copilot/session-store.db`, SQLite)
903
- * - `github-copilot` (network reader — GitHub-embedded Copilot)
904
- */
905
-
906
- /**
907
- * External participant for GitHub Copilot in VS Code. Reads transcripts and
908
- * memory-tool files from VS Code's workspaceStorage read-only, aggregating
909
- * across all workspace hashes.
910
- */
911
- declare class CopilotVscodeParticipant implements BourdonParticipant {
912
- agentId: string;
913
- agentType: string;
914
- displayName: string;
915
- private readonly workspaceStorage;
916
- /** The workspaceStorage dir the setup wizard probes for presence. */
917
- static defaultNativePath(home?: string): string;
918
- constructor(workspaceStorage?: string);
919
- get nativePath(): string;
920
- private resolveWs;
921
- discover(): AgentStore;
922
- exportSessions(since?: Date, limit?: number): SessionModel[];
923
- exportL5(since?: Date): L5ManifestModel;
924
- healthCheck(): HealthStatus;
925
- /** Collect and parse all transcripts across all workspaces. */
926
- private allTranscripts;
927
- /** Collect all memory-tool files across all workspaces. */
928
- private allMemories;
929
- }
930
-
931
- /**
932
- * Participant discovery — a STATIC TS registry replacing Python's `pkgutil`
933
- * package scan + entry-point duck-type (`participants/__init__.py`).
934
- *
935
- * Python scans the `participants/` package at runtime and duck-types each class
936
- * by `_PARTICIPANT_MARKER_ATTRS`. A filesystem package scan does not survive
937
- * bundling (`npx bourdon` is a single file), so the JS side declares an explicit
938
- * {@link FIRST_PARTY} array. The three preserved invariants:
939
- * - output sorted by `agentId`
940
- * - first-wins dedupe on `agentId`
941
- * - log-and-skip a participant that throws on construction (one broken reader
942
- * must NOT abort discovery / crash the CLI)
943
- *
944
- * The marker-attr duck-typing collapses into the {@link BourdonParticipant}
945
- * interface conformance (checked structurally via {@link isParticipant}).
946
- */
947
-
948
- /** A zero-arg-constructible participant class. */
949
- type ParticipantCtor = new () => BourdonParticipant;
950
- /**
951
- * The first-party reader registry. Order here is irrelevant — discovery sorts by
952
- * `agentId`. Covers the base agents, their background-run "automations" variants,
953
- * the Claude-desktop surfaces, and the quarantined-class openclaw network reader.
954
- * codex — the ~2.6k-line turn-compiler reader — is the only one still deferred.
955
- */
956
- declare const FIRST_PARTY: ParticipantCtor[];
957
- /**
958
- * Instantiate each registered participant, duck-type the contract, sort by
959
- * `agentId`, and first-wins dedupe. A class that throws on construction is
960
- * logged and skipped — never propagated.
961
- */
962
- declare function discoverParticipants(ctors?: ParticipantCtor[]): BourdonParticipant[];
963
- /**
964
- * Optional Layer 2: third-party plugins declared via a `package.json`
965
- * `"bourdon": { participants: { ... } }` field. Gated behind `BOURDON_PLUGINS=1`
966
- * and a no-op today (no external participant exists yet) — the resolver ships so
967
- * the seam is wired, defaulted off so `npx bourdon` stays predictable.
968
- */
969
- declare function resolvePluginParticipants(): ParticipantCtor[];
970
-
971
- export { type AgentStore, type AuthProvider, type BourdonParticipant, CONTRACT_VERSION, CacheEntry, CascadeParticipant, ClaudeCodeAutomationsParticipant, ClaudeCodeParticipant, ClaudeDesktopCodeParticipant, ClaudeDesktopCoworkParticipant, CodexAutomationsParticipant, CopilotAutomationsParticipant, CopilotCliParticipant, CopilotParticipant, CopilotVscodeParticipant, CursorAutomationsParticipant, CursorParticipant, DEFAULT_CACHE_TTL_SECONDS, FIRST_PARTY, GitHubCopilotParticipant, type HealthStatus, HermesParticipant, MIN_PATCHED_VERSION, NETWORK_CONTRACT_VERSION, NetworkParticipant, type NetworkParticipantOptions, NetworkUnavailable, OpenClawApiClient, OpenClawParticipant, type OpenReadonlyOptions, ParticipantAuthError, type ParticipantCtor, ParticipantDiscoveryError, ParticipantError, ParticipantExportError, ParticipantVersionMismatchError, PayloadCache, SPEC_VERSION, type SqliteDatabase, defaultCacheRoot, discoverParticipants, envAuthProvider, epochToIsoDate, epochToIsoDatetime, friendlyLabel, ghTokenProvider, isParticipant, openReadonly, projectKeyFromCwd, resolvePluginParticipants, sqliteAvailable, tableColumns, tableExists, tryOpenReadonly, verifyInstance };
2
+ * @getbourdon/participants — the external-agent → L5 reader layer (BUSL-1.1).
3
+ *
4
+ * Each participant normalizes a foreign agent's native memory store into a
5
+ * visibility-filtered, redacted L5 manifest. Reader categories:
6
+ * - SQLite (read-only, better-sqlite3 mode=ro): {@link HermesParticipant},
7
+ * {@link CursorParticipant}, {@link CopilotCliParticipant}
8
+ * - file / convention: {@link ClaudeCodeParticipant},
9
+ * {@link CopilotParticipant}, {@link CascadeParticipant}
10
+ * - network (TTL cache + lazy AuthProvider): {@link GitHubCopilotParticipant}
11
+ * - network + quarantined-class (handshake gate): {@link OpenClawParticipant}
12
+ *
13
+ * Four invariants enforced in code, not by trust: visibility-filter-before-
14
+ * emission, deterministic exportL5, healthCheck never throws, redact every
15
+ * native string. Discovery is a static registry ({@link discoverParticipants}).
16
+ *
17
+ * Python (`pip install bourdon`) is the oracle; this mirror asserts against the
18
+ * @getbourdon/conformance `native_stores` fixtures (output shape only).
19
+ * Still deferred: codex (the ~2.6k-line turn-compiler reader) lands in a
20
+ * follow-on slice.
21
+ */
22
+ export { CONTRACT_VERSION, SPEC_VERSION, ParticipantError, ParticipantDiscoveryError, ParticipantExportError, ParticipantVersionMismatchError, isParticipant, loadProjectHints, PROJECT_HINTS_ENV, type AgentStore, type BourdonParticipant, type HealthStatus, } from "./base.js";
23
+ export { sqliteAvailable, openReadonly, tryOpenReadonly, tableExists, tableColumns, epochToIsoDate, epochToIsoDatetime, projectKeyFromCwd, friendlyLabel, type OpenReadonlyOptions, type SqliteDatabase, } from "./sqlite-base.js";
24
+ export { NETWORK_CONTRACT_VERSION, DEFAULT_CACHE_TTL_SECONDS, NetworkUnavailable, ParticipantAuthError, NetworkParticipant, PayloadCache, CacheEntry, envAuthProvider, defaultCacheRoot, type AuthProvider, type NetworkParticipantOptions, } from "./network-base.js";
25
+ export { HermesParticipant } from "./readers/hermes.js";
26
+ export { ClaudeCodeParticipant } from "./readers/claude-code.js";
27
+ export { GitHubCopilotParticipant, ghTokenProvider } from "./readers/github-copilot.js";
28
+ export { CursorParticipant } from "./readers/cursor.js";
29
+ export { CopilotParticipant } from "./readers/copilot.js";
30
+ export { CopilotCliParticipant } from "./readers/copilot-cli.js";
31
+ export { CascadeParticipant } from "./readers/cascade.js";
32
+ export { OpenClawParticipant, OpenClawApiClient, verifyInstance, MIN_PATCHED_VERSION, } from "./readers/openclaw.js";
33
+ export { ClaudeCodeAutomationsParticipant } from "./readers/claude-code-automations.js";
34
+ export { CodexAutomationsParticipant } from "./readers/codex-automations.js";
35
+ export { CopilotAutomationsParticipant } from "./readers/copilot-automations.js";
36
+ export { CursorAutomationsParticipant } from "./readers/cursor-automations.js";
37
+ export { ClaudeDesktopCodeParticipant } from "./readers/claude-desktop-code.js";
38
+ export { ClaudeDesktopCoworkParticipant } from "./readers/claude-desktop-cowork.js";
39
+ export { CopilotVscodeParticipant } from "./readers/copilot-vscode.js";
40
+ export { DEFAULT_RECENT_THREAD_LIMIT, DEFAULT_TITLE_LIMIT, parseSessionIndex, recentSessionThreads, resolveCodexHome, sessionThreadTitles, } from "./readers/codex-sessions.js";
41
+ export type { RecentThread } from "./readers/codex-sessions.js";
42
+ export { FIRST_PARTY, discoverParticipants, resolvePluginParticipants, type ParticipantCtor, } from "./registry.js";
43
+ export { Visibility, applyVisibility, filterForFederation, toDict, validateManifest, type EntityModel, type L5ManifestModel, type SessionModel, type VisibilityPolicyModel, } from "@getbourdon/l5";