@concord-ai/concord-mcp 0.11.0 → 0.13.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 (86) hide show
  1. package/README.md +2 -1
  2. package/dist/cli/commands/adapters.js +12 -1
  3. package/dist/cli/commands/adapters.js.map +1 -1
  4. package/dist/cli/commands/cloud-codex.d.ts +14 -0
  5. package/dist/cli/commands/cloud-codex.js +148 -0
  6. package/dist/cli/commands/cloud-codex.js.map +1 -0
  7. package/dist/cli/commands/cloud-hooks.d.ts +11 -0
  8. package/dist/cli/commands/cloud-hooks.js +121 -0
  9. package/dist/cli/commands/cloud-hooks.js.map +1 -0
  10. package/dist/cli/commands/cloud-inbox.d.ts +49 -0
  11. package/dist/cli/commands/cloud-inbox.js +167 -0
  12. package/dist/cli/commands/cloud-inbox.js.map +1 -0
  13. package/dist/cli/commands/cloud-views.d.ts +11 -0
  14. package/dist/cli/commands/cloud-views.js +92 -0
  15. package/dist/cli/commands/cloud-views.js.map +1 -0
  16. package/dist/cli/commands/cloud.d.ts +41 -0
  17. package/dist/cli/commands/cloud.js +226 -0
  18. package/dist/cli/commands/cloud.js.map +1 -0
  19. package/dist/cli/commands/export.js +7 -0
  20. package/dist/cli/commands/export.js.map +1 -1
  21. package/dist/cli/commands/hook.js +39 -19
  22. package/dist/cli/commands/hook.js.map +1 -1
  23. package/dist/cli/commands/inbox.js +129 -57
  24. package/dist/cli/commands/inbox.js.map +1 -1
  25. package/dist/cli/commands/session-start-message.d.ts +8 -0
  26. package/dist/cli/commands/session-start-message.js +21 -0
  27. package/dist/cli/commands/session-start-message.js.map +1 -0
  28. package/dist/cli/commands/status.js +4 -2
  29. package/dist/cli/commands/status.js.map +1 -1
  30. package/dist/cli/commands/tasks.js +4 -2
  31. package/dist/cli/commands/tasks.js.map +1 -1
  32. package/dist/cli/commands/who.js +4 -2
  33. package/dist/cli/commands/who.js.map +1 -1
  34. package/dist/cli/index.js +16 -1
  35. package/dist/cli/index.js.map +1 -1
  36. package/dist/cloud/browser-login.d.ts +27 -0
  37. package/dist/cloud/browser-login.js +115 -0
  38. package/dist/cloud/browser-login.js.map +1 -0
  39. package/dist/cloud/client.d.ts +68 -0
  40. package/dist/cloud/client.js +114 -0
  41. package/dist/cloud/client.js.map +1 -0
  42. package/dist/cloud/http-transport.d.ts +18 -0
  43. package/dist/cloud/http-transport.js +40 -0
  44. package/dist/cloud/http-transport.js.map +1 -0
  45. package/dist/cloud/proxy.d.ts +56 -0
  46. package/dist/cloud/proxy.js +162 -0
  47. package/dist/cloud/proxy.js.map +1 -0
  48. package/dist/cloud/runtime.d.ts +152 -0
  49. package/dist/cloud/runtime.js +332 -0
  50. package/dist/cloud/runtime.js.map +1 -0
  51. package/dist/cloud/settings.d.ts +62 -0
  52. package/dist/cloud/settings.js +162 -0
  53. package/dist/cloud/settings.js.map +1 -0
  54. package/dist/cloud/tokens.d.ts +20 -0
  55. package/dist/cloud/tokens.js +87 -0
  56. package/dist/cloud/tokens.js.map +1 -0
  57. package/dist/config/paths.d.ts +13 -0
  58. package/dist/config/paths.js +40 -0
  59. package/dist/config/paths.js.map +1 -1
  60. package/dist/domain/harness-config.d.ts +1 -1
  61. package/dist/domain/harness-config.js +18 -1
  62. package/dist/domain/harness-config.js.map +1 -1
  63. package/dist/domain/identity.js +1 -0
  64. package/dist/domain/identity.js.map +1 -1
  65. package/dist/domain/project-key.d.ts +23 -0
  66. package/dist/domain/project-key.js +109 -0
  67. package/dist/domain/project-key.js.map +1 -0
  68. package/dist/domain/pull-inbox.d.ts +12 -0
  69. package/dist/domain/pull-inbox.js +14 -1
  70. package/dist/domain/pull-inbox.js.map +1 -1
  71. package/dist/domain/schemas.d.ts +1 -1
  72. package/dist/index.js +11 -2
  73. package/dist/index.js.map +1 -1
  74. package/dist/install/adapters/index.js +55 -13
  75. package/dist/install/adapters/index.js.map +1 -1
  76. package/dist/install/goose-config.d.ts +4 -0
  77. package/dist/install/goose-config.js +90 -0
  78. package/dist/install/goose-config.js.map +1 -0
  79. package/dist/server.d.ts +1 -1
  80. package/dist/version.d.ts +1 -1
  81. package/dist/version.js +1 -1
  82. package/package.json +3 -1
  83. package/plugin/concord-relay/scripts/watch-inbox.sh +11 -0
  84. package/plugin/cursor/concord-relay/cursor-hook.mjs +19 -3
  85. package/plugin/gemini/concord-relay/hooks/session-register.mjs +3 -2
  86. package/plugin/spawn-command.mjs +74 -0
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Hooks import this file from the packaged plugin tree. Each relay directory
3
+ * is linked on its own, and Node resolves those imports from this real path.
4
+ */
5
+ import { spawnSync } from 'node:child_process';
6
+ import { existsSync } from 'node:fs';
7
+ import { delimiter, extname, isAbsolute, join } from 'node:path';
8
+
9
+ const BATCH_EXTENSION = /\.(?:cmd|bat)$/iu;
10
+
11
+ export function quoteCmdArgument(value) {
12
+ if (value.length === 0) return '""';
13
+ const escaped = value.replaceAll('%', '%%cd:~,%').replaceAll('"', '""');
14
+ if (value !== escaped || /[\s"&|<>^]/u.test(value)) return `"${escaped}"`;
15
+ return value;
16
+ }
17
+
18
+ export function batchCommandLine(file, args) {
19
+ const inner = [quoteCmdArgument(file), ...args.map((arg) => quoteCmdArgument(arg))].join(' ');
20
+ return `"${inner}"`;
21
+ }
22
+
23
+ function envValue(env, name) {
24
+ const wanted = name.toLowerCase();
25
+ for (const key of Object.keys(env)) {
26
+ if (key.toLowerCase() !== wanted) continue;
27
+ const value = env[key]?.trim();
28
+ if (value !== undefined && value !== '') return value;
29
+ }
30
+ return undefined;
31
+ }
32
+
33
+ function commandInterpreter(env) {
34
+ const comSpec = envValue(env, 'ComSpec');
35
+ if (comSpec !== undefined) return comSpec;
36
+ const root = envValue(env, 'SystemRoot') ?? 'C:\\Windows';
37
+ return join(root, 'System32', 'cmd.exe');
38
+ }
39
+
40
+ function resolveWindowsCommand(file, env) {
41
+ if (extname(file) !== '' || isAbsolute(file) || file.includes('/') || file.includes('\\')) {
42
+ return file;
43
+ }
44
+ const path = envValue(env, 'PATH');
45
+ if (path === undefined) return file;
46
+ for (const directory of path.split(delimiter)) {
47
+ for (const extension of ['.exe', '.cmd', '.bat']) {
48
+ const candidate = join(directory, `${file}${extension}`);
49
+ if (existsSync(candidate)) return candidate;
50
+ }
51
+ }
52
+ return file;
53
+ }
54
+
55
+ function batchTarget(file, args, env) {
56
+ return {
57
+ command: commandInterpreter(env),
58
+ args: ['/d', '/v:off', '/s', '/c', batchCommandLine(file, args)],
59
+ };
60
+ }
61
+
62
+ export function spawnCommandSync(file, args, options) {
63
+ const env = options.env ?? process.env;
64
+ const resolved = process.platform === 'win32' ? resolveWindowsCommand(file, env) : file;
65
+ if (process.platform !== 'win32' || !BATCH_EXTENSION.test(resolved)) {
66
+ return spawnSync(resolved, [...args], { ...options, shell: false });
67
+ }
68
+ const target = batchTarget(resolved, args, env);
69
+ return spawnSync(target.command, [...target.args], {
70
+ ...options,
71
+ shell: false,
72
+ windowsVerbatimArguments: true,
73
+ });
74
+ }