borgmcp 2.8.0 → 2.10.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 (118) hide show
  1. package/dist/assimilate-cmd.d.ts +14 -0
  2. package/dist/assimilate-cmd.d.ts.map +1 -1
  3. package/dist/assimilate-cmd.js +187 -14
  4. package/dist/assimilate-cmd.js.map +1 -1
  5. package/dist/assimilate-deps.d.ts.map +1 -1
  6. package/dist/assimilate-deps.js +29 -1
  7. package/dist/assimilate-deps.js.map +1 -1
  8. package/dist/assimilate-welcome.d.ts.map +1 -1
  9. package/dist/assimilate-welcome.js +1 -0
  10. package/dist/assimilate-welcome.js.map +1 -1
  11. package/dist/claude.d.ts.map +1 -1
  12. package/dist/claude.js +27 -0
  13. package/dist/claude.js.map +1 -1
  14. package/dist/cli-help.d.ts +1 -0
  15. package/dist/cli-help.d.ts.map +1 -1
  16. package/dist/cli-help.js +13 -3
  17. package/dist/cli-help.js.map +1 -1
  18. package/dist/config.d.ts +12 -1
  19. package/dist/config.d.ts.map +1 -1
  20. package/dist/config.js +170 -11
  21. package/dist/config.js.map +1 -1
  22. package/dist/first-run-server.d.ts +10 -2
  23. package/dist/first-run-server.d.ts.map +1 -1
  24. package/dist/first-run-server.js +54 -7
  25. package/dist/first-run-server.js.map +1 -1
  26. package/dist/invitation-artifact.d.ts +33 -0
  27. package/dist/invitation-artifact.d.ts.map +1 -0
  28. package/dist/invitation-artifact.js +89 -0
  29. package/dist/invitation-artifact.js.map +1 -0
  30. package/dist/launch-gate.d.ts +5 -4
  31. package/dist/launch-gate.d.ts.map +1 -1
  32. package/dist/launch-gate.js +7 -8
  33. package/dist/launch-gate.js.map +1 -1
  34. package/dist/parse-assimilate-args.d.ts.map +1 -1
  35. package/dist/parse-assimilate-args.js +9 -3
  36. package/dist/parse-assimilate-args.js.map +1 -1
  37. package/dist/recover-enrollment-cmd.d.ts +17 -0
  38. package/dist/recover-enrollment-cmd.d.ts.map +1 -0
  39. package/dist/recover-enrollment-cmd.js +62 -0
  40. package/dist/recover-enrollment-cmd.js.map +1 -0
  41. package/dist/regen-format.d.ts +9 -0
  42. package/dist/regen-format.d.ts.map +1 -1
  43. package/dist/regen-format.js +15 -0
  44. package/dist/regen-format.js.map +1 -1
  45. package/dist/regen.js +27 -3
  46. package/dist/regen.js.map +1 -1
  47. package/dist/remote-client.d.ts +1 -1
  48. package/dist/remote-client.d.ts.map +1 -1
  49. package/dist/remote-client.js +1 -1
  50. package/dist/remote-client.js.map +1 -1
  51. package/dist/runtime-metadata.d.ts +1 -1
  52. package/dist/runtime-metadata.d.ts.map +1 -1
  53. package/dist/runtime-metadata.js +3 -3
  54. package/dist/runtime-metadata.js.map +1 -1
  55. package/dist/seat-store.d.ts.map +1 -1
  56. package/dist/seat-store.js +7 -0
  57. package/dist/seat-store.js.map +1 -1
  58. package/dist/server-errors.d.ts +1 -1
  59. package/dist/server-errors.d.ts.map +1 -1
  60. package/dist/server-errors.js.map +1 -1
  61. package/dist/server-facade.d.ts +1 -1
  62. package/dist/server-facade.d.ts.map +1 -1
  63. package/dist/server-facade.js +2 -2
  64. package/dist/server-facade.js.map +1 -1
  65. package/dist/server-handshake.d.ts +23 -3
  66. package/dist/server-handshake.d.ts.map +1 -1
  67. package/dist/server-handshake.js +102 -7
  68. package/dist/server-handshake.js.map +1 -1
  69. package/dist/server-trust.d.ts +8 -0
  70. package/dist/server-trust.d.ts.map +1 -1
  71. package/dist/server-trust.js +165 -5
  72. package/dist/server-trust.js.map +1 -1
  73. package/dist/setup.js +5 -2
  74. package/dist/setup.js.map +1 -1
  75. package/dist/token-store.d.ts +3 -0
  76. package/dist/token-store.d.ts.map +1 -1
  77. package/dist/token-store.js +2 -0
  78. package/dist/token-store.js.map +1 -1
  79. package/dist/tool-manifest.d.ts.map +1 -1
  80. package/dist/tool-manifest.js +5 -3
  81. package/dist/tool-manifest.js.map +1 -1
  82. package/dist/unknown-subcommand.d.ts +1 -1
  83. package/dist/unknown-subcommand.d.ts.map +1 -1
  84. package/dist/unknown-subcommand.js +1 -0
  85. package/dist/unknown-subcommand.js.map +1 -1
  86. package/dist/update-cmd.d.ts +1 -0
  87. package/dist/update-cmd.d.ts.map +1 -1
  88. package/dist/update-cmd.js +8 -3
  89. package/dist/update-cmd.js.map +1 -1
  90. package/docs/EXTRACTION_PROVENANCE.md +11 -7
  91. package/docs/LOCAL_SERVER.md +12 -3
  92. package/docs/RELEASING.md +17 -6
  93. package/package.json +2 -2
  94. package/src/assimilate-cmd.ts +234 -20
  95. package/src/assimilate-deps.ts +29 -0
  96. package/src/assimilate-welcome.ts +1 -0
  97. package/src/claude.ts +22 -0
  98. package/src/cli-help.ts +16 -3
  99. package/src/config.ts +167 -8
  100. package/src/first-run-server.ts +71 -8
  101. package/src/invitation-artifact.ts +116 -0
  102. package/src/launch-gate.ts +7 -8
  103. package/src/parse-assimilate-args.ts +11 -4
  104. package/src/recover-enrollment-cmd.ts +63 -0
  105. package/src/regen-format.ts +25 -0
  106. package/src/regen.ts +30 -2
  107. package/src/remote-client.ts +2 -2
  108. package/src/runtime-metadata.ts +4 -3
  109. package/src/seat-store.ts +6 -0
  110. package/src/server-errors.ts +1 -0
  111. package/src/server-facade.ts +2 -2
  112. package/src/server-handshake.ts +140 -4
  113. package/src/server-trust.ts +180 -5
  114. package/src/setup.ts +5 -2
  115. package/src/token-store.ts +5 -0
  116. package/src/tool-manifest.ts +5 -3
  117. package/src/unknown-subcommand.ts +1 -0
  118. package/src/update-cmd.ts +8 -3
package/src/setup.ts CHANGED
@@ -73,11 +73,12 @@ async function main() {
73
73
  // configuration. Decline/non-interactive/failure paths therefore leave no
74
74
  // partial setup state behind.
75
75
  console.log(chalk.blue('◼ Local Server'));
76
- const serverInstall = await offerFirstRunServerInstall();
76
+ const serverInstall = await offerFirstRunServerInstall(undefined, undefined, { initializeServer: true });
77
77
  if (serverInstall.kind !== 'present' && serverInstall.kind !== 'installed') {
78
78
  process.exit(serverInstall.kind === 'declined' ? 0 : 1);
79
79
  }
80
80
  console.log('');
81
+ console.log('◼ Local server initialized');
81
82
 
82
83
  // Step 1: Configure every detected agent CLI
83
84
  console.log(chalk.blue('◼ Agent CLI Integration'));
@@ -185,7 +186,9 @@ async function main() {
185
186
  // Success message
186
187
  console.log(chalk.green.bold('\nSetup complete!\n'));
187
188
  console.log(chalk.yellow('🔄 Restart Claude Code / Codex / OpenCode (or open a new session) for the changes to take effect.\n'));
188
- console.log(chalk.gray(setupNextStepsText()));
189
+ if (!serverInstall.suppressClientNextSteps) {
190
+ console.log(chalk.gray(setupNextStepsText()));
191
+ }
189
192
  }
190
193
 
191
194
  // Run wizard
@@ -20,6 +20,9 @@ export type TokenBackendName = 'file';
20
20
  export interface TokenBackend {
21
21
  readonly name: TokenBackendName;
22
22
  get(account: string): Promise<string | null>;
23
+ readonly entries?: () => Promise<Record<string, string>>;
24
+ /** Replace the complete account map in one backend transaction when available. */
25
+ readonly replaceAccounts?: (accounts: Record<string, string>) => Promise<void>;
23
26
  set(account: string, value: string): Promise<void>;
24
27
  delete(account: string): Promise<void>;
25
28
  }
@@ -87,6 +90,8 @@ export function makeFileBackend(
87
90
  atomicWrite0600(filePath, JSON.stringify({ version: 1, accounts }, null, 2) + '\n', options);
88
91
  return {
89
92
  name: 'file',
93
+ entries: load,
94
+ replaceAccounts: save,
90
95
  async get(account) {
91
96
  const accounts = await load();
92
97
  return Object.prototype.hasOwnProperty.call(accounts, account) ? accounts[account] : null;
@@ -30,7 +30,7 @@ export const TOOL_MANIFEST: ToolManifestEntry[] = [
30
30
  'Optional `since` (entry-id UUID or ISO-8601 timestamp) trims the recent-log section ' +
31
31
  'to entries strictly after the anchor — pass your last-seen entry id to skip ' +
32
32
  'already-processed history on each refresh. If you know the current session model, pass ' +
33
- 'optional `model` to self-report it as advisory metadata; unrecognized model strings are accepted.',
33
+ 'optional `model` to self-report its printable identifier as advisory metadata; model names are not allowlisted.',
34
34
  inputSchema: {
35
35
  type: 'object',
36
36
  properties: {
@@ -47,9 +47,11 @@ export const TOOL_MANIFEST: ToolManifestEntry[] = [
47
47
  },
48
48
  model: {
49
49
  type: 'string',
50
- maxLength: 256,
50
+ minLength: 1,
51
+ maxLength: 160,
52
+ pattern: '^[A-Za-z0-9][A-Za-z0-9._/@:+-]*$',
51
53
  description:
52
- 'Optional advisory self-report of the model running this agent session. Use the model identifier you know from session context; the server does not infer or validate it against an allowlist.',
54
+ 'Optional advisory self-report of the model running this agent session. Use a printable model identifier of 1-160 ASCII characters; model names are not allowlisted.',
53
55
  },
54
56
  },
55
57
  required: [],
@@ -17,6 +17,7 @@ export const KNOWN_SUBCOMMANDS = [
17
17
  'update',
18
18
  'assimilate',
19
19
  'reset-local-seat',
20
+ 'recover-enrollment',
20
21
  'spawn',
21
22
  'sync',
22
23
  'cleanup',
package/src/update-cmd.ts CHANGED
@@ -1128,7 +1128,13 @@ async function defaultPublishedVersions(
1128
1128
  }
1129
1129
  }
1130
1130
 
1131
- async function defaultConfirm(message: string): Promise<'yes' | 'no' | 'eof' | 'interrupted'> {
1131
+ export function parseConfirmationAnswer(answer: string, defaultYes = false): 'yes' | 'no' {
1132
+ const normalized = answer.trim().toLowerCase();
1133
+ if (normalized === '') return defaultYes ? 'yes' : 'no';
1134
+ return normalized === 'y' || normalized === 'yes' ? 'yes' : 'no';
1135
+ }
1136
+
1137
+ async function defaultConfirm(message: string, defaultYes = false): Promise<'yes' | 'no' | 'eof' | 'interrupted'> {
1132
1138
  const rl = createInterface({ input: process.stdin, output: process.stdout });
1133
1139
  let interrupted = false;
1134
1140
  rl.once('SIGINT', () => {
@@ -1136,8 +1142,7 @@ async function defaultConfirm(message: string): Promise<'yes' | 'no' | 'eof' | '
1136
1142
  rl.close();
1137
1143
  });
1138
1144
  try {
1139
- const answer = (await rl.question(message)).trim().toLowerCase();
1140
- return answer === 'y' || answer === 'yes' ? 'yes' : 'no';
1145
+ return parseConfirmationAnswer(await rl.question(message), defaultYes);
1141
1146
  } catch (error) {
1142
1147
  if (interrupted) return 'interrupted';
1143
1148
  if ((error as NodeJS.ErrnoException).code === 'ERR_USE_AFTER_CLOSE') return 'eof';