borgmcp-server 0.1.1 → 0.1.5

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 (61) hide show
  1. package/README.md +70 -22
  2. package/THIRD_PARTY_NOTICES.md +1 -0
  3. package/dist/cli.js +62 -11
  4. package/dist/cli.js.map +1 -1
  5. package/dist/coordination-api.d.ts +3 -1
  6. package/dist/coordination-api.js +476 -78
  7. package/dist/coordination-api.js.map +1 -1
  8. package/dist/credentials.d.ts +13 -7
  9. package/dist/credentials.js +77 -15
  10. package/dist/credentials.js.map +1 -1
  11. package/dist/debug-log.d.ts +76 -0
  12. package/dist/debug-log.js +124 -0
  13. package/dist/debug-log.js.map +1 -0
  14. package/dist/enrollment.d.ts +3 -11
  15. package/dist/enrollment.js +21 -60
  16. package/dist/enrollment.js.map +1 -1
  17. package/dist/https-server.d.ts +5 -20
  18. package/dist/https-server.js +108 -50
  19. package/dist/https-server.js.map +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/message-taxonomy.d.ts +38 -0
  22. package/dist/message-taxonomy.js +218 -0
  23. package/dist/message-taxonomy.js.map +1 -0
  24. package/dist/migrations.d.ts +4 -0
  25. package/dist/migrations.js +99 -0
  26. package/dist/migrations.js.map +1 -1
  27. package/dist/operator-error.d.ts +2 -1
  28. package/dist/operator-error.js +23 -5
  29. package/dist/operator-error.js.map +1 -1
  30. package/dist/role-section.d.ts +14 -0
  31. package/dist/role-section.js +87 -0
  32. package/dist/role-section.js.map +1 -0
  33. package/dist/service.d.ts +14 -4
  34. package/dist/service.js +243 -25
  35. package/dist/service.js.map +1 -1
  36. package/dist/start-options.d.ts +5 -1
  37. package/dist/start-options.js +17 -3
  38. package/dist/start-options.js.map +1 -1
  39. package/dist/store.d.ts +106 -8
  40. package/dist/store.js +772 -120
  41. package/dist/store.js.map +1 -1
  42. package/npm-shrinkwrap.json +6 -7
  43. package/package.json +2 -2
  44. package/src/cli.ts +61 -11
  45. package/src/coordination-api.ts +490 -72
  46. package/src/credentials.ts +103 -19
  47. package/src/debug-log.ts +165 -0
  48. package/src/enrollment.ts +32 -78
  49. package/src/https-server.ts +113 -78
  50. package/src/index.ts +1 -1
  51. package/src/message-taxonomy.ts +284 -0
  52. package/src/migrations.ts +102 -0
  53. package/src/operator-error.ts +40 -6
  54. package/src/role-section.ts +108 -0
  55. package/src/service.ts +268 -27
  56. package/src/start-options.ts +21 -4
  57. package/src/store.ts +887 -142
  58. package/dist/protocol-draft.d.ts +0 -2
  59. package/dist/protocol-draft.js +0 -31
  60. package/dist/protocol-draft.js.map +0 -1
  61. package/src/protocol-draft.ts +0 -32
package/README.md CHANGED
@@ -6,16 +6,23 @@ HTTPS.
6
6
 
7
7
  ## Release status
8
8
 
9
- The current source is the unpublished `0.1.1-preview` recovery release candidate.
10
- Purpose-bound owner enrollment, idempotent multi-cube creation, and stable
11
- prior-seat reattachment have completed coordinated client/server security
12
- review and process dogfood against the audited exact `borgmcp-shared@0.3.0`
13
- registry release.
9
+ The current public preview is `borgmcp-server@0.1.4`, published on npm.
10
+ Versions `0.1.2` and `0.1.3` were not published; their immutable tags are
11
+ internal failed-release evidence and are not installation or dogfood targets.
12
+ Version `0.1.4` retains the
13
+ reviewed owner-enrollment, idempotent multi-cube creation, and stable prior-seat
14
+ reattachment baseline, and adds managed role creation and updates, fail-closed
15
+ setup reinitialization, opt-in redacted debug logging, live-safe invitation
16
+ minting, and atomic cube-scoped invitations with enforced observer posture.
17
+ The published `0.1.4` package consumes the audited exact
18
+ `borgmcp-shared@0.3.0` registry release. Current source consumes the audited
19
+ exact `borgmcp-shared@0.4.0` release for the clean-slate protocol generation.
14
20
 
15
21
  Setup prepares local identity and storage and prints one-time recovery and
16
- owner-enrollment secrets; it creates no cube. The package remains unreleased
17
- until the exact release commit and tagged artifact complete the documented
18
- review, authorization, and protected-publication gates.
22
+ owner-enrollment secrets; it creates no cube. Version `0.1.1` completed the
23
+ documented exact-source, tagged-artifact, and protected-publication gates.
24
+ Version `0.1.4` completed a fresh exact-source, tagged-artifact, tokenless OIDC
25
+ publication, provenance, signature, and attestation gate chain.
19
26
 
20
27
  ## Requirements
21
28
 
@@ -23,12 +30,9 @@ review, authorization, and protected-publication gates.
23
30
  - npm 10 or later
24
31
  - A private local data directory with sufficient disk space
25
32
 
26
- ## Install after publication
33
+ ## Install
27
34
 
28
- The global package command becomes available only after the pending npm release
29
- completes. Until then, source and preview reviewers should follow the release
30
- status above and the [release runbook](docs/releasing.md), not expect this
31
- registry install to succeed.
35
+ Install the current public preview from npm:
32
36
 
33
37
  ```sh
34
38
  npm install --global borgmcp-server
@@ -38,15 +42,20 @@ npm install --global borgmcp-server
38
42
 
39
43
  The default data directory is `~/.borg/server`. Setup creates the local
40
44
  database, credential-digest key, local certificate authority, server
41
- certificate, one recovery credential, and one enrollment invitation. It creates
42
- no cube. Run it in a private terminal because both secrets are printed only
43
- once.
45
+ certificate, one recovery credential, and one owner enrollment invitation. It
46
+ creates no cube. Run it in a private terminal because both secrets are shown
47
+ once; the owner enrollment invitation is single-use and enrolls the owner client.
44
48
 
45
49
  ```sh
46
50
  borg-mcp-server setup
47
51
  borg-mcp-server start
48
52
  ```
49
53
 
54
+ Running `setup` again refuses to change an existing installation. After stopping
55
+ the server, `borg-mcp-server setup --reinitialize` explicitly destroys and
56
+ recreates the server identity and database; use it only when prior state may be
57
+ discarded.
58
+
50
59
  The server listens on `https://127.0.0.1:7091` by default. Use
51
60
  `BORG_SERVER_DATA_DIR` to select another data directory.
52
61
 
@@ -68,23 +77,62 @@ TLS files may instead be supplied explicitly with
68
77
  `BORG_SERVER_TLS_CA_FILE`. Run `borg-mcp-server help` for the complete command
69
78
  summary.
70
79
 
71
- ## Offline credential administration
80
+ ## Debugging
81
+
82
+ Debug diagnostics are off by default. A local operator can enable centrally
83
+ redacted, one-line JSON records on stderr for one server run:
84
+
85
+ ```sh
86
+ borg-mcp-server start --log-level debug
87
+ ```
88
+
89
+ Records include normalized routes, principal and coordination IDs, authorization
90
+ outcomes, recipient fan-out, cursor replay, SSE lifecycle, and credential-session
91
+ events. They never include authorization headers, credentials, invitations,
92
+ recovery material, request or message bodies, decision text, tokens, raw paths, or
93
+ exceptions. Operational IDs are still private data; capture stderr only in a
94
+ private local sink. The log level cannot be changed through the network API.
95
+
96
+ ## Local credential administration
72
97
 
73
- Stop the server before all offline client administration:
98
+ Invitation minting is an additive local operation and may run while the server is
99
+ live. Rotation, revocation, and grant changes remain exclusive: stop the server
100
+ before running those commands.
74
101
 
75
102
  ```sh
76
103
  borg-mcp-server client-rotate <client-id>
77
104
  borg-mcp-server client-revoke <client-id>
78
105
  borg-mcp-server client-invite
106
+ borg-mcp-server client-invite <cube-name-or-id> [--access <read|write|manage>]
79
107
  borg-mcp-server owner-invite
80
108
  borg-mcp-server client-grant <client-id> <cube-id> <read|write|manage>
81
109
  borg-mcp-server client-ungrant <client-id> <cube-id>
82
110
  ```
83
111
 
84
- Invitation commands read the recovery credential from a private hidden terminal
85
- prompt, never argv or environment. Rotation and invitation commands print their
86
- replacement secret once. Treat setup, enrollment, invitation, and rotation
87
- output as secrets; do not paste it into issues, logs, or chat.
112
+ Invitation commands visibly prompt with `Recovery credential (hidden input):`
113
+ before reading the recovery credential from a private hidden terminal, never argv
114
+ or environment. `owner-invite` prints an owner enrollment invitation. A plain
115
+ `client-invite` remains an enroll-only invitation with no cube grant. Supplying a
116
+ cube selector atomically binds one grant to the invitation. `read` attaches an
117
+ observer that can discover the cube and read shared activity, but cannot post,
118
+ acknowledge, claim, administer, be selected as a direct recipient, or receive
119
+ directed stream events. `write` attaches a participant that can coordinate and is
120
+ the default; explicit `manage` adds cube administration. Attach responses and
121
+ drone listings identify the effective `observer` or `participant` posture. The
122
+ command prints the resolved display name, full cube ID,
123
+ effective access, and capability summary before the single-use invitation.
124
+
125
+ For automation and duplicate-name environments, use the full lowercase canonical
126
+ cube UUID. A display name must match exactly and case-sensitively. Unknown names,
127
+ UUID-like malformed selectors, and duplicate names fail without creating or
128
+ printing an invitation; duplicate-name errors list the candidate IDs so the
129
+ operator can rerun unambiguously. Claiming a scoped invitation atomically creates
130
+ the client credential binding and exactly that cube grant. It grants no server
131
+ capability and no access to any other cube.
132
+
133
+ Both invitation forms are single-use and shown once. Treat setup, enrollment,
134
+ invitation, and rotation output as secrets; do not paste it into issues, logs, or
135
+ chat.
88
136
 
89
137
  ## Capacity controls
90
138
 
@@ -21,6 +21,7 @@ refer to each installed package for its complete license text.
21
21
  | `@peculiar/utils` | 2.0.3 | MIT |
22
22
  | `@peculiar/x509` | 1.14.3 | MIT |
23
23
  | `asn1js` | 3.0.10 | BSD-3-Clause |
24
+ | `borgmcp-shared` | 0.4.0 | Apache-2.0 |
24
25
  | `bytestreamjs` | 2.0.1 | BSD-3-Clause |
25
26
  | `pkijs` | 3.4.0 | BSD-3-Clause |
26
27
  | `pvtsutils` | 1.3.6 | MIT |
package/dist/cli.js CHANGED
@@ -1,38 +1,50 @@
1
1
  const usage = `Usage: borg-mcp-server <command> [options]
2
2
 
3
3
  Commands:
4
- setup Prepare an offline server installation
4
+ setup [--reinitialize] Prepare an offline server installation
5
5
  start Start the server process
6
6
  client-rotate <client-id> Rotate one client credential offline
7
7
  client-revoke <client-id> Revoke one client and its credentials offline
8
8
  client-grant <client-id> <cube-id> <read|write|manage> Set one offline cube grant
9
9
  client-ungrant <client-id> <cube-id> Remove one offline cube grant
10
- client-invite Create one ordinary client invitation using a private recovery prompt
11
- owner-invite Replace the unclaimed owner invitation using a private recovery prompt
10
+ client-invite [<cube-name-or-id>] [--access <read|write|manage>]
11
+ Create a client invitation; scoped invitations default to write
12
+ owner-invite Replace the unclaimed owner enrollment invitation using a hidden recovery prompt
12
13
  help Show this help
13
14
 
14
15
  Start options:
15
16
  --host <ip> Explicit bind address (default: 127.0.0.1)
16
17
  --port <number> Listen port (default: 7091)
17
18
  --lan Consent to this start on a private LAN address
19
+ --log-level debug Emit centrally redacted structured diagnostics to stderr
20
+
21
+ Setup options:
22
+ --reinitialize Destroy and recreate the existing server identity and database
18
23
 
19
24
  TLS files:
20
25
  BORG_SERVER_DATA_DIR (default: ~/.borg/server), or explicit
21
26
  BORG_SERVER_TLS_KEY_FILE, BORG_SERVER_TLS_CERT_FILE, and BORG_SERVER_TLS_CA_FILE
22
27
 
23
- Stop the server before running offline client administration commands.`;
28
+ Invitation commands may run alongside a live server. Stop the server before
29
+ setup, rotation, revocation, grant changes, or reinitialization.
30
+
31
+ Invitation access:
32
+ read observe: discover, attach as observer, and read
33
+ write coordinate: attach, read, post, acknowledge, and receive directed wakes (default)
34
+ manage administer: coordinate plus cube administration; explicit only`;
24
35
  export async function runCli(args, service, io) {
25
36
  const [command, ...extraArgs] = args;
26
37
  switch (command) {
27
38
  case "setup":
28
- if (extraArgs.length !== 0)
39
+ if (extraArgs.length > 1 || (extraArgs.length === 1 && extraArgs[0] !== "--reinitialize")) {
29
40
  return invalidArguments(io);
41
+ }
30
42
  if (service.setup === undefined) {
31
43
  io.stderr("Server setup is unavailable.");
32
44
  return 1;
33
45
  }
34
- const result = await service.setup();
35
- io.stdout(`Server setup complete.\nRecovery credential (shown once): ${result.recoveryCredential}\nInitial enrollment invitation (shown once): ${result.initialInvitation}`);
46
+ const result = await service.setup({ reinitialize: extraArgs[0] === "--reinitialize" });
47
+ io.stdout(`Server setup complete.\nRecovery credential (shown once; keep offline): ${result.recoveryCredential}\nOwner enrollment invitation (single-use, shown once; enroll the owner client): ${result.initialInvitation}\nSetup created no cube.\nNext: start the server with \`borg-mcp-server start\`.`);
36
48
  return 0;
37
49
  case "start":
38
50
  await service.start(extraArgs);
@@ -66,16 +78,33 @@ export async function runCli(args, service, io) {
66
78
  return 0;
67
79
  case "client-invite":
68
80
  case "owner-invite": {
69
- if (extraArgs.length !== 0 || io.readSecret === undefined)
81
+ if (io.readSecret === undefined)
70
82
  return invalidArguments(io);
83
+ const scoped = command === "client-invite" ? parseClientInviteArguments(extraArgs) : null;
84
+ if ((command === "owner-invite" && extraArgs.length !== 0) || scoped === undefined) {
85
+ return invalidArguments(io);
86
+ }
71
87
  const operation = command === "client-invite"
72
88
  ? service.createClientInvitation
73
89
  : service.replaceOwnerInvitation;
74
90
  if (operation === undefined)
75
91
  return invalidArguments(io);
76
- const recovery = await io.readSecret("Recovery credential: ");
77
- const invitation = await operation(recovery);
78
- io.stdout(`Enrollment invitation (shown once): ${invitation}`);
92
+ const recovery = await io.readSecret("Recovery credential (hidden input): ");
93
+ const result = command === "client-invite"
94
+ ? scoped?.cubeSelector === undefined
95
+ ? await operation(recovery)
96
+ : await operation(recovery, scoped.cubeSelector, scoped.access)
97
+ : await operation(recovery);
98
+ if (typeof result === "string") {
99
+ io.stdout(command === "client-invite"
100
+ ? `Client enrollment invitation (single-use, shown once): ${result}`
101
+ : `Owner enrollment invitation (single-use, shown once): ${result}`);
102
+ }
103
+ else {
104
+ io.stdout(`Cube: ${JSON.stringify(result.cubeName)} (${result.cubeId})\n` +
105
+ `Grant: ${grantSummary(result.access)}\n` +
106
+ `Client enrollment invitation (single-use, shown once): ${result.invitation}`);
107
+ }
79
108
  return 0;
80
109
  }
81
110
  case "help":
@@ -89,6 +118,28 @@ export async function runCli(args, service, io) {
89
118
  return 1;
90
119
  }
91
120
  }
121
+ function parseClientInviteArguments(args) {
122
+ if (args.length === 0)
123
+ return {};
124
+ const cubeSelector = args[0];
125
+ if (cubeSelector === undefined || cubeSelector.startsWith("--"))
126
+ return undefined;
127
+ if (args.length === 1)
128
+ return { cubeSelector };
129
+ if (args.length !== 3 || args[1] !== "--access")
130
+ return undefined;
131
+ const access = args[2];
132
+ if (access !== "read" && access !== "write" && access !== "manage")
133
+ return undefined;
134
+ return { cubeSelector, access };
135
+ }
136
+ function grantSummary(access) {
137
+ if (access === "read")
138
+ return "read (observe - discover, attach as observer, and read)";
139
+ if (access === "manage")
140
+ return "manage (administer - coordinate plus cube administration)";
141
+ return "write (coordinate - attach, read, post, acknowledge, and receive directed wakes)";
142
+ }
92
143
  function invalidArguments(io) {
93
144
  io.stderr("Invalid command arguments.");
94
145
  return 1;
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAQA,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;uEAsByD,CAAC;AAExE,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,IAAuB,EACvB,OAAsB,EACtB,EAAS;IAET,MAAM,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;IAErC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACxD,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAChC,EAAE,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC;gBAC1C,OAAO,CAAC,CAAC;YACX,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;YACrC,EAAE,CAAC,MAAM,CAAC,6DAA6D,MAAM,CAAC,kBAAkB,iDAAiD,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;YAC7K,OAAO,CAAC,CAAC;QACX,KAAK,OAAO;YACV,MAAM,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAC/B,OAAO,CAAC,CAAC;QACX,KAAK,eAAe;YAClB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS;gBAAE,OAAO,gBAAgB,CAAC,EAAE,CAAC,CAAC;YAC9F,EAAE,CAAC,MAAM,CAAC,2CAA2C,MAAM,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAC;YAClG,OAAO,CAAC,CAAC;QACX,KAAK,eAAe;YAClB,IAAI,SAAS,CAAC,MAAM,KAAK,CA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AAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjB,OAAO,CAAC,CAAC;QACX;YACE,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YAC9B,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,SAAS,0BAA0B,CACjC,IAAuB;IAEvB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAClF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IAC/C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACrF,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;AAClC,CAAC;AAED,SAAS,YAAY,CAAC,MAAmC;IACvD,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,yDAAyD,CAAC;IACxF,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,2DAA2D,CAAC;IAC5F,OAAO,kFAAkF,CAAC;AAC5F,CAAC;AAED,SAAS,gBAAgB,CAAC,EAAS;IACjC,EAAE,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC;IACxC,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { Principal } from "./principal.js";
2
+ import { type DebugLogger } from "./debug-log.js";
2
3
  import type { CredentialAuthority } from "./credentials.js";
3
4
  import { type StoreRuntime } from "./store.js";
4
5
  export interface CoordinationRequest {
@@ -7,6 +8,7 @@ export interface CoordinationRequest {
7
8
  readonly principal: Principal;
8
9
  readonly body?: unknown;
9
10
  readonly cursor?: string;
11
+ readonly since?: string;
10
12
  readonly signal: AbortSignal;
11
13
  }
12
14
  export interface CoordinationResponse {
@@ -16,7 +18,7 @@ export interface CoordinationResponse {
16
18
  }
17
19
  export declare class CoordinationApi {
18
20
  #private;
19
- constructor(runtime: StoreRuntime, authority: CredentialAuthority);
21
+ constructor(runtime: StoreRuntime, authority: CredentialAuthority, debugLogger?: DebugLogger, streamHeartbeatMs?: number);
20
22
  armReplayTransition(): {
21
23
  readonly reached: Promise<void>;
22
24
  readonly release: () => void;