@getbourdon/participants 0.2.3 → 0.3.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 (48) hide show
  1. package/LICENSE +1 -1
  2. package/LICENSE_FAQ.md +1 -1
  3. package/dist/base.d.ts +109 -0
  4. package/dist/base.js +88 -0
  5. package/dist/index.cjs +12 -7
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +42 -1083
  8. package/dist/index.js +53 -6590
  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 +590 -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 +6 -6
package/LICENSE CHANGED
@@ -39,7 +39,7 @@ Additional Use Grant: You may make production use of the Licensed Work, provided
39
39
 
40
40
  For binding interpretive guidance on using RADLAB LLC products
41
41
  under the Business Source License, please see the LICENSE_FAQ
42
- at https://github.com/getbourdon/bourdon/blob/main/LICENSE_FAQ.md
42
+ at https://gitlab.com/bourdonai/bourdon/-/blob/main/LICENSE_FAQ.md
43
43
  Change Date: Four years from the date the Licensed Work is published.
44
44
  Change License: Apache License, Version 2.0
45
45
 
package/LICENSE_FAQ.md CHANGED
@@ -76,4 +76,4 @@ Email licensing@bourdon.ai with a description of what you're building. RADLAB LL
76
76
  ## Contact
77
77
 
78
78
  Licensing questions: **licensing@bourdon.ai**
79
- General project questions: GitHub issues at [github.com/getbourdon/bourdon/issues](https://github.com/getbourdon/bourdon/issues)
79
+ General project questions: GitLab issues at [gitlab.com/bourdonai/bourdon/-/issues](https://gitlab.com/bourdonai/bourdon/-/issues)
package/dist/base.d.ts ADDED
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Bourdon participant base — the Protocol → TS interface, errors, and the
3
+ * AgentStore / HealthStatus types. Faithful port of `participants/base.py`.
4
+ *
5
+ * The L5 dataclass model (AgentInfo/Entity/Session/VisibilityPolicy/L5Manifest),
6
+ * the `toDict` omission rules, and the visibility helpers all live in
7
+ * `@getbourdon/l5` and are reused verbatim — only THAT output shape is the parity
8
+ * contract. This module owns the participant CONTRACT surface around them.
9
+ *
10
+ * Contract semantics (enforced by every reader, asserted by the conformance
11
+ * fixtures, never by trust):
12
+ * 1. visibility filter BEFORE emission (`filterForFederation`) — private wins.
13
+ * 2. deterministic / idempotent `exportL5` — same store → identical `toDict`.
14
+ * 3. `healthCheck` NEVER throws — catch-all → degraded/blocked.
15
+ * 4. every native string through `@getbourdon/redaction` before it enters L5.
16
+ */
17
+ import type { L5ManifestModel, SessionModel } from "@getbourdon/l5";
18
+ /** Tied to Bourdon spec v0.1 — same literals as the Python oracle. */
19
+ export declare const CONTRACT_VERSION = "0.1";
20
+ export declare const SPEC_VERSION = "0.1";
21
+ /** Base class for participant errors. */
22
+ export declare class ParticipantError extends Error {
23
+ constructor(message?: string);
24
+ }
25
+ /** Raised by `discover()` when the native store cannot be found or read.
26
+ * Non-fatal: L6 skips this agent rather than aborting the whole export. */
27
+ export declare class ParticipantDiscoveryError extends ParticipantError {
28
+ }
29
+ /** Raised by `exportL5()` / `exportSessions()` when an export fails mid-op
30
+ * (the store WAS present — distinct from a discovery miss). */
31
+ export declare class ParticipantExportError extends ParticipantError {
32
+ }
33
+ /** Raised when the native store's version is outside the supported range.
34
+ * Subtype of discovery error (a version mismatch is a discovery-time miss). */
35
+ export declare class ParticipantVersionMismatchError extends ParticipantDiscoveryError {
36
+ }
37
+ /** Metadata describing the native agent store. Returned by `discover()`. */
38
+ export interface AgentStore {
39
+ path: string;
40
+ version: string;
41
+ metadata: Record<string, unknown>;
42
+ }
43
+ /** Returned by `healthCheck()`. Consumed by the `bourdon doctor` CLI. */
44
+ export interface HealthStatus {
45
+ status: "ok" | "degraded" | "blocked";
46
+ reason?: string;
47
+ details: Record<string, unknown>;
48
+ /** A human-runnable command to remedy a non-ok status. */
49
+ proposedFix?: string;
50
+ }
51
+ /**
52
+ * Structural interface every participant must satisfy (the Python
53
+ * `@runtime_checkable Protocol`). Duck-typed at registration: a class is a
54
+ * participant iff it has `agentId` + `agentType` + `exportL5` + `healthCheck`.
55
+ *
56
+ * Optional members (`displayName`, a `defaultNativePath` static) are documented
57
+ * here as in the Python Protocol; discovery + the setup wizard fall back to
58
+ * sensible defaults when absent.
59
+ */
60
+ export interface BourdonParticipant {
61
+ agentId: string;
62
+ agentType: string;
63
+ nativePath: string;
64
+ /** Human-friendly label (e.g. "GitHub Copilot"). Optional. */
65
+ displayName?: string;
66
+ /** Quarantined-class marker (Python `QUARANTINED_CLASS`). When true, the CLI
67
+ * requires `--i-understand-the-risk` to register the agent trusted, and its
68
+ * exports are staged for operator review rather than written to the live
69
+ * store (spec D6: quarantine follows the content, not the invoker). Absent =
70
+ * a normal, non-quarantined participant. Read by `bourdon agent add/set-tier`
71
+ * (cli/src/commands/federation.ts). */
72
+ quarantinedClass?: boolean;
73
+ /** Confirm the native store exists; return metadata. Throws
74
+ * {@link ParticipantDiscoveryError} when missing/unreadable. */
75
+ discover(): AgentStore;
76
+ /** Build the L5 manifest from native memory, applying the visibility filter
77
+ * BEFORE return. Deterministic — same store yields the same manifest. */
78
+ exportL5(since?: Date): L5ManifestModel;
79
+ /** Export recent sessions in normalized schema. */
80
+ exportSessions(since?: Date, limit?: number): SessionModel[];
81
+ /** Return ok / degraded / blocked with a reason. MUST NOT throw. */
82
+ healthCheck(): HealthStatus;
83
+ }
84
+ /**
85
+ * Tiny structural guard mirroring Python's `_PARTICIPANT_MARKER_ATTRS`
86
+ * duck-type: a value is a participant iff it carries the four marker members.
87
+ */
88
+ export declare function isParticipant(obj: unknown): obj is BourdonParticipant;
89
+ /**
90
+ * Environment variable holding the deployment's own project-name recognition
91
+ * vocabulary, as a comma-separated list (e.g.
92
+ * `BOURDON_PROJECT_HINTS="Acme Portal,Widget API,internal-tools"`).
93
+ */
94
+ export declare const PROJECT_HINTS_ENV = "BOURDON_PROJECT_HINTS";
95
+ /**
96
+ * Project-name hints used to tag sessions with a project focus.
97
+ *
98
+ * Bourdon ships **no** project roster of its own — the `defaults` a reader
99
+ * passes are limited to product-neutral names (this product, plus the agent
100
+ * surfaces it federates). A deployment that wants its own projects recognized
101
+ * sets {@link PROJECT_HINTS_ENV}; those entries are appended to `defaults`.
102
+ *
103
+ * Matching downstream is case-insensitive substring matching, so entries are
104
+ * de-duplicated case-insensitively here while preserving first-seen order and
105
+ * the original casing (which is what gets emitted as the project name).
106
+ *
107
+ * Mirrors Python `participants.base.load_project_hints`.
108
+ */
109
+ export declare function loadProjectHints(defaults?: readonly string[]): readonly string[];
package/dist/base.js ADDED
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Bourdon participant base — the Protocol → TS interface, errors, and the
3
+ * AgentStore / HealthStatus types. Faithful port of `participants/base.py`.
4
+ *
5
+ * The L5 dataclass model (AgentInfo/Entity/Session/VisibilityPolicy/L5Manifest),
6
+ * the `toDict` omission rules, and the visibility helpers all live in
7
+ * `@getbourdon/l5` and are reused verbatim — only THAT output shape is the parity
8
+ * contract. This module owns the participant CONTRACT surface around them.
9
+ *
10
+ * Contract semantics (enforced by every reader, asserted by the conformance
11
+ * fixtures, never by trust):
12
+ * 1. visibility filter BEFORE emission (`filterForFederation`) — private wins.
13
+ * 2. deterministic / idempotent `exportL5` — same store → identical `toDict`.
14
+ * 3. `healthCheck` NEVER throws — catch-all → degraded/blocked.
15
+ * 4. every native string through `@getbourdon/redaction` before it enters L5.
16
+ */
17
+ /** Tied to Bourdon spec v0.1 — same literals as the Python oracle. */
18
+ export const CONTRACT_VERSION = "0.1";
19
+ export const SPEC_VERSION = "0.1";
20
+ // -- Errors -------------------------------------------------------------------
21
+ /** Base class for participant errors. */
22
+ export class ParticipantError extends Error {
23
+ constructor(message) {
24
+ super(message);
25
+ this.name = new.target.name;
26
+ }
27
+ }
28
+ /** Raised by `discover()` when the native store cannot be found or read.
29
+ * Non-fatal: L6 skips this agent rather than aborting the whole export. */
30
+ export class ParticipantDiscoveryError extends ParticipantError {
31
+ }
32
+ /** Raised by `exportL5()` / `exportSessions()` when an export fails mid-op
33
+ * (the store WAS present — distinct from a discovery miss). */
34
+ export class ParticipantExportError extends ParticipantError {
35
+ }
36
+ /** Raised when the native store's version is outside the supported range.
37
+ * Subtype of discovery error (a version mismatch is a discovery-time miss). */
38
+ export class ParticipantVersionMismatchError extends ParticipantDiscoveryError {
39
+ }
40
+ /**
41
+ * Tiny structural guard mirroring Python's `_PARTICIPANT_MARKER_ATTRS`
42
+ * duck-type: a value is a participant iff it carries the four marker members.
43
+ */
44
+ export function isParticipant(obj) {
45
+ if (obj === null || typeof obj !== "object")
46
+ return false;
47
+ const o = obj;
48
+ return (typeof o["agentId"] === "string" &&
49
+ typeof o["agentType"] === "string" &&
50
+ typeof o["exportL5"] === "function" &&
51
+ typeof o["healthCheck"] === "function");
52
+ }
53
+ /**
54
+ * Environment variable holding the deployment's own project-name recognition
55
+ * vocabulary, as a comma-separated list (e.g.
56
+ * `BOURDON_PROJECT_HINTS="Acme Portal,Widget API,internal-tools"`).
57
+ */
58
+ export const PROJECT_HINTS_ENV = "BOURDON_PROJECT_HINTS";
59
+ /**
60
+ * Project-name hints used to tag sessions with a project focus.
61
+ *
62
+ * Bourdon ships **no** project roster of its own — the `defaults` a reader
63
+ * passes are limited to product-neutral names (this product, plus the agent
64
+ * surfaces it federates). A deployment that wants its own projects recognized
65
+ * sets {@link PROJECT_HINTS_ENV}; those entries are appended to `defaults`.
66
+ *
67
+ * Matching downstream is case-insensitive substring matching, so entries are
68
+ * de-duplicated case-insensitively here while preserving first-seen order and
69
+ * the original casing (which is what gets emitted as the project name).
70
+ *
71
+ * Mirrors Python `participants.base.load_project_hints`.
72
+ */
73
+ export function loadProjectHints(defaults = []) {
74
+ const hints = [];
75
+ const seen = new Set();
76
+ const raw = process.env[PROJECT_HINTS_ENV] ?? "";
77
+ for (const candidate of [...defaults, ...raw.split(",")]) {
78
+ const name = candidate.trim();
79
+ if (!name)
80
+ continue;
81
+ const key = name.toLowerCase();
82
+ if (seen.has(key))
83
+ continue;
84
+ seen.add(key);
85
+ hints.push(name);
86
+ }
87
+ return hints;
88
+ }
package/dist/index.cjs CHANGED
@@ -1092,6 +1092,16 @@ function mergeEntities(into, other) {
1092
1092
  into.summary = other.summary;
1093
1093
  }
1094
1094
  into.tags = [.../* @__PURE__ */ new Set([...into.tags ?? [], ...other.tags ?? []])];
1095
+ into.aliases = [.../* @__PURE__ */ new Set([...into.aliases ?? [], ...other.aliases ?? []])];
1096
+ if (other.last_touched && (into.last_touched == null || other.last_touched > into.last_touched)) {
1097
+ into.last_touched = other.last_touched;
1098
+ }
1099
+ if (other.valid_from && (into.valid_from == null || other.valid_from < into.valid_from)) {
1100
+ into.valid_from = other.valid_from;
1101
+ }
1102
+ if (other.valid_to && (into.valid_to == null || other.valid_to > into.valid_to)) {
1103
+ into.valid_to = other.valid_to;
1104
+ }
1095
1105
  if (visRank(other.visibility) < visRank(into.visibility)) {
1096
1106
  into.visibility = other.visibility;
1097
1107
  }
@@ -1110,14 +1120,9 @@ function dedupeEntities(sourceLists) {
1110
1120
  byKey.set(
1111
1121
  key,
1112
1122
  (0, import_l52.makeEntity)({
1113
- name: entity.name,
1114
- type: entity.type,
1123
+ ...entity,
1115
1124
  aliases: [...entity.aliases ?? []],
1116
- summary: entity.summary,
1117
- last_touched: entity.last_touched,
1118
- tags: [...entity.tags ?? []],
1119
- visibility: entity.visibility
1120
- // valid_from / valid_to intentionally dropped (oracle behavior).
1125
+ tags: [...entity.tags ?? []]
1121
1126
  })
1122
1127
  );
1123
1128
  }