clay-server 5.2.0-beta.5 → 5.2.0-beta.6

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 (151) hide show
  1. package/lib/claude-hook-installer.js +1 -267
  2. package/lib/claude-jsonl-watcher.js +1 -204
  3. package/lib/clay-skill-install.js +1 -33
  4. package/lib/cli-sessions.js +1 -300
  5. package/lib/codex-defaults.js +1 -28
  6. package/lib/context-usage.js +3 -2
  7. package/lib/daemon.js +5 -55
  8. package/lib/default-ai-runtime.js +4 -8
  9. package/lib/email-mcp-server.js +1 -1
  10. package/lib/kiro-defaults.js +1 -22
  11. package/lib/mcp-proxy.js +2 -32
  12. package/lib/mcp-query-bridge.js +1 -1
  13. package/lib/mcp-source-adapters.js +1 -91
  14. package/lib/mcp-source-context.js +1 -42
  15. package/lib/mcp-source-discovery.js +1 -169
  16. package/lib/mcp-source-plugins.js +1 -68
  17. package/lib/mcp-source-restrictions.js +1 -47
  18. package/lib/mcp-tool-policy.js +1 -26
  19. package/lib/os-user-diagnostics.js +2 -4
  20. package/lib/os-users.js +4 -65
  21. package/lib/project-connection.js +8 -7
  22. package/lib/project-http.js +4 -4
  23. package/lib/project-mcp.js +2 -2
  24. package/lib/project-pair-result-delivery.js +2 -2
  25. package/lib/project-pair-usage.js +12 -13
  26. package/lib/project-pending-message-queue.js +3 -1
  27. package/lib/project-session-history-actions.js +5 -3
  28. package/lib/project-session-pair.js +1 -1
  29. package/lib/project-session-runtime-actions.js +2 -1
  30. package/lib/project-session-spawn.js +2 -3
  31. package/lib/project-session-vendor.js +2 -1
  32. package/lib/project-sessions.js +18 -26
  33. package/lib/project-user-message.js +1 -0
  34. package/lib/project-vendor-login.js +6 -36
  35. package/lib/public/app.js +1 -0
  36. package/lib/public/css/messages.css +6 -2
  37. package/lib/public/modules/app-favicon.js +11 -2
  38. package/lib/public/modules/app-header.js +4 -2
  39. package/lib/public/modules/app-loop-ui.js +2 -0
  40. package/lib/public/modules/app-messages.js +36 -5
  41. package/lib/public/modules/app-notifications.js +1 -2
  42. package/lib/public/modules/app-panels.js +61 -123
  43. package/lib/public/modules/app-rate-limit.js +7 -27
  44. package/lib/public/modules/chat-render-runtime.js +3 -0
  45. package/lib/public/modules/mcp-connection-view.js +1 -1
  46. package/lib/public/modules/permission-control.js +5 -4
  47. package/lib/public/modules/scheduler.js +2 -0
  48. package/lib/public/modules/session-create-form.js +10 -10
  49. package/lib/public/modules/settings-defaults.js +27 -28
  50. package/lib/public/modules/tools.js +2 -1
  51. package/lib/public/modules/tui-grab.js +1 -2
  52. package/lib/public/modules/vendor-login-browser.js +5 -3
  53. package/lib/public/modules/vendor-login.js +2 -2
  54. package/lib/public/modules/vendor-priority.js +15 -1
  55. package/lib/public/muse-avatar.svg +4 -0
  56. package/lib/safe-bash-commands.js +3 -45
  57. package/lib/sdk-bridge.js +127 -395
  58. package/lib/sdk-foreground-admission.js +16 -0
  59. package/lib/sdk-mcp-descriptors.js +2 -37
  60. package/lib/sdk-message-processor.js +50 -17
  61. package/lib/sdk-quota-snapshot.js +1 -1
  62. package/lib/sdk-response-recovery.js +1 -155
  63. package/lib/sdk-worker.js +2 -677
  64. package/lib/server.js +1 -1
  65. package/lib/session-fork-history.js +21 -0
  66. package/lib/session-hygiene.js +3 -35
  67. package/lib/session-permission-mode.js +4 -3
  68. package/lib/session-skill-scope.js +11 -0
  69. package/lib/sessions.js +17 -89
  70. package/lib/tool-llm.js +1 -1
  71. package/lib/tui-transcript-index.js +1 -132
  72. package/lib/vendor-login-browser.js +1 -11
  73. package/lib/yoke/acp-agent-profiles.js +5 -3
  74. package/lib/yoke/adapters/antigravity.js +3 -14
  75. package/lib/yoke/adapters/claude-query-contract.js +9 -0
  76. package/lib/yoke/adapters/claude.js +7 -42
  77. package/lib/yoke/adapters/codex-query-contract.js +24 -0
  78. package/lib/yoke/adapters/codex.js +1 -0
  79. package/lib/yoke/adapters/kiro.js +3 -1
  80. package/lib/yoke/adapters/muse-query-contract.js +7 -0
  81. package/lib/yoke/adapters/muse.js +122 -0
  82. package/lib/yoke/auth-events.js +17 -0
  83. package/lib/yoke/claude-hook-installer.js +267 -0
  84. package/lib/yoke/claude-jsonl-watcher.js +204 -0
  85. package/lib/yoke/claude-maintenance.js +55 -0
  86. package/lib/yoke/claude-permission-patterns.js +53 -0
  87. package/lib/yoke/claude-response-recovery.js +155 -0
  88. package/lib/yoke/claude-transcript-hygiene.js +34 -0
  89. package/lib/yoke/clay-skill-install.js +33 -0
  90. package/lib/yoke/cli-sessions.js +300 -0
  91. package/lib/yoke/codex-app-server.js +7 -12
  92. package/lib/yoke/configuration.js +13 -0
  93. package/lib/yoke/discovery.js +70 -0
  94. package/lib/yoke/errors.js +8 -0
  95. package/lib/yoke/host-environment.js +7 -0
  96. package/lib/yoke/index.js +9 -51
  97. package/lib/yoke/interface.js +116 -0
  98. package/lib/yoke/kiro-acp-server.js +5 -5
  99. package/lib/yoke/legacy-sessions.js +89 -0
  100. package/lib/yoke/login-protocol.js +25 -0
  101. package/lib/yoke/maintenance.js +12 -0
  102. package/lib/yoke/mcp-proxy.js +32 -0
  103. package/lib/yoke/mcp-source-adapters.js +91 -0
  104. package/lib/yoke/mcp-source-context.js +42 -0
  105. package/lib/yoke/mcp-source-discovery.js +169 -0
  106. package/lib/yoke/mcp-source-plugins.js +68 -0
  107. package/lib/yoke/mcp-source-restrictions.js +47 -0
  108. package/lib/yoke/mcp-tool-policy-normalize.js +28 -0
  109. package/lib/yoke/model-preferences.js +6 -0
  110. package/lib/yoke/muse-artifacts.js +36 -0
  111. package/lib/yoke/muse-controls.js +50 -0
  112. package/lib/yoke/muse-input.js +64 -0
  113. package/lib/yoke/muse-items.js +157 -0
  114. package/lib/yoke/muse-policy.js +52 -0
  115. package/lib/yoke/muse-query.js +428 -0
  116. package/lib/yoke/muse-runtime.js +211 -0
  117. package/lib/yoke/muse-services.js +79 -0
  118. package/lib/yoke/muse-skills.js +79 -0
  119. package/lib/yoke/muse-turns.js +71 -0
  120. package/lib/yoke/options/acp.js +2 -0
  121. package/lib/yoke/options/antigravity.js +2 -0
  122. package/lib/yoke/options/claude.js +21 -0
  123. package/lib/yoke/options/codex-defaults.js +29 -0
  124. package/lib/yoke/options/codex-settings.js +21 -0
  125. package/lib/yoke/options/codex.js +6 -0
  126. package/lib/yoke/options/kiro-defaults.js +22 -0
  127. package/lib/yoke/options/kiro.js +5 -0
  128. package/lib/yoke/options/muse.js +5 -0
  129. package/lib/yoke/provider-contract.js +5 -0
  130. package/lib/yoke/providers/antigravity-executable.js +8 -0
  131. package/lib/yoke/providers/claude-executable.js +40 -0
  132. package/lib/yoke/providers/claude-model-descriptions.js +14 -0
  133. package/lib/yoke/providers/claude-process.js +97 -0
  134. package/lib/yoke/providers/claude-provision.js +75 -0
  135. package/lib/yoke/providers/codex-errors.js +8 -0
  136. package/lib/yoke/providers/muse-executable.js +17 -0
  137. package/lib/yoke/provisioning.js +6 -0
  138. package/lib/yoke/query-options.js +10 -0
  139. package/lib/yoke/response-recovery.js +41 -0
  140. package/lib/yoke/sdk-mcp-descriptors.js +37 -0
  141. package/lib/yoke/sdk-server-factory.js +7 -0
  142. package/lib/yoke/session-history.js +8 -0
  143. package/lib/yoke/session-tool-transport.js +31 -13
  144. package/lib/yoke/settings.js +23 -0
  145. package/lib/yoke/source-locations.js +4 -0
  146. package/lib/yoke/title-query.js +18 -7
  147. package/lib/yoke/tui-transcript-index.js +132 -0
  148. package/lib/yoke/usage.js +48 -0
  149. package/lib/yoke/user-input.js +13 -0
  150. package/lib/yoke/vendor-registry.js +81 -1
  151. package/package.json +3 -2
@@ -246,6 +246,7 @@ function capability(adapter) {
246
246
  }
247
247
 
248
248
  function selectMode(adapter, requestedMode) {
249
+ if (requestedMode !== undefined && ["auto", "native", "fallback"].indexOf(requestedMode) < 0) throw new Error("Unsupported structured input mode.");
249
250
  if (requestedMode === "fallback") return "fallback";
250
251
  if (requestedMode === "native" && capability(adapter).mode !== "native") {
251
252
  throw new Error("This provider does not support native structured user input.");
@@ -260,7 +261,19 @@ function createFallbackServer(adapter, handler) {
260
261
  return adapter.createToolServer({ name: "yoke-user-input", version: "1.0.0", tools: fallbackToolDefs(handler, opts) });
261
262
  }
262
263
 
264
+ // AskUserQuestion is also the normalized legacy question-tool identity in
265
+ // stored Clay transcripts. Adapters may translate another native shape.
266
+ function toolQuestions(adapter, name, input) {
267
+ var contract = require("./session-tool-transport").contract(adapter);
268
+ if (typeof contract.questionInput === "function") {
269
+ var nativeInput = contract.questionInput(name, input);
270
+ if (nativeInput) return nativeInput;
271
+ }
272
+ return name === "AskUserQuestion" || name === TOOL_NAME ? input : null;
273
+ }
274
+
263
275
  module.exports = {
276
+ toolQuestions: toolQuestions,
264
277
  TOOL_NAME: TOOL_NAME,
265
278
  normalizeQuestions: normalizeQuestions,
266
279
  questionsFromElicitation: questionsFromElicitation,
@@ -1,6 +1,6 @@
1
1
  // Static, init-free facts about each vendor YOKE supports. Host code that
2
2
  // needs metadata before adapter initialization should read it from here.
3
- // Do not import adapters into this module.
3
+ // Only init-free contract data may be imported here; never runtime adapters.
4
4
 
5
5
  // Canonical effort ordering used to clamp a level onto a vendor that does
6
6
  // not support it (e.g. codex "minimal" -> claude "low", claude "max" ->
@@ -10,6 +10,26 @@ var EFFORT_ORDER = ["minimal", "low", "medium", "high", "xhigh", "max"];
10
10
  // sessionBoundTools gates whether per-session MCP tool mounting reaches a vendor's process.
11
11
  var VENDOR_REGISTRY = {
12
12
  claude: {
13
+ readSessionHistory: require("./cli-sessions").readCliSessionHistory,
14
+ terminalResumeCommand: "claude --resume",
15
+ planPathSegments: [".claude/plans/"],
16
+ notificationHooks: require("./claude-hook-installer"),
17
+ maintenance: require("./claude-maintenance"),
18
+ credentialDirectories: [".claude"],
19
+ preferredModelFamilies: ["opus", "sonnet", "haiku"],
20
+ provisionUser: require("./providers/claude-provision").attachProvisioning,
21
+ configuration: require("./configuration").claude,
22
+ normalizeContext: require("./usage").sdkContext, authenticationReply: require("./auth-events").authenticationReply,
23
+ rateLimitScheduling: true, acceptsUnstampedQuota: true,
24
+ terminalLoginCommand: "claude auth login", browserLoginCommand: "claude auth login",
25
+ oauthHosts: ["claude.ai", "claude.com", "console.anthropic.com", "platform.claude.com"],
26
+ resolveExecutable: require("./discovery").bundledResolver(function() { return require("./providers/claude-executable").resolve(); }, "claude"),
27
+ processControl: require("./providers/claude-process"),
28
+ prepareIsolation: require("./providers/claude-process").prepareIsolation,
29
+ recoveryFactory: require("./claude-response-recovery").attachResponseRecovery,
30
+ supportsLegacyGuiResume: function(session) { return !!session.cliSessionId; },
31
+ mapQueryOptions: require("./options/claude").map,
32
+ queryContract: require("./adapters/claude-query-contract"),
13
33
  displayName: "Claude Code",
14
34
  loginCommand: "claude login",
15
35
  binaryName: "claude",
@@ -27,6 +47,16 @@ var VENDOR_REGISTRY = {
27
47
  rateLimitTracking: true,
28
48
  },
29
49
  codex: {
50
+ credentialDirectories: [".codex"],
51
+ preferredModelFamilies: ["astra", "sol", "gpt", "o"],
52
+ classifyError: require("./providers/codex-errors").classify,
53
+ settings: require("./options/codex-settings"),
54
+ configuration: require("./configuration").codex,
55
+ normalizeContext: require("./usage").tokenContext, requiresQuotaSource: true,
56
+ browserLoginCommand: "codex login", oauthHosts: ["auth.openai.com"],
57
+ resolveExecutable: require("./discovery").bundledResolver(function() { return require("./codex-app-server").findCodexPath(); }, "codex"),
58
+ mapQueryOptions: require("./options/codex").map,
59
+ queryContract: require("./adapters/codex-query-contract"),
30
60
  displayName: "Codex",
31
61
  loginCommand: "codex login --device-auth",
32
62
  binaryName: "codex",
@@ -43,7 +73,27 @@ var VENDOR_REGISTRY = {
43
73
  },
44
74
  rateLimitTracking: true,
45
75
  },
76
+ muse: {
77
+ displayName: "Muse Code",
78
+ loginCommand: "muse",
79
+ binaryName: "muse",
80
+ avatar: "/muse-avatar.svg",
81
+ sessionModes: ["gui"],
82
+ effortLevels: ["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra"],
83
+ osUserIsolation: false,
84
+ sessionBoundTools: true,
85
+ usageDashboard: null,
86
+ rateLimitTracking: false,
87
+ forkHistoryBoundary: "completed-turn-inclusive",
88
+ resolveExecutable: require("./providers/muse-executable").resolve,
89
+ mapQueryOptions: require("./options/muse").map,
90
+ queryContract: require("./adapters/muse-query-contract"),
91
+ normalizeContext: require("./usage").tokenContext,
92
+ configuration: { auto: true, permissionModes: [{ value: "default", label: "Ask" }] },
93
+ },
46
94
  antigravity: {
95
+ resolveExecutable: require("./providers/antigravity-executable").resolve,
96
+ mapQueryOptions: require("./options/antigravity").map,
47
97
  displayName: "Antigravity CLI",
48
98
  loginCommand: "agy",
49
99
  binaryName: "agy",
@@ -56,6 +106,8 @@ var VENDOR_REGISTRY = {
56
106
  rateLimitTracking: false,
57
107
  },
58
108
  opencode: {
109
+ resolveExecutable: require("./discovery").acpResolver("opencode"),
110
+ mapQueryOptions: require("./options/acp").map,
59
111
  displayName: "OpenCode",
60
112
  loginCommand: "opencode auth login",
61
113
  binaryName: "opencode",
@@ -68,6 +120,8 @@ var VENDOR_REGISTRY = {
68
120
  rateLimitTracking: false,
69
121
  },
70
122
  kimi: {
123
+ resolveExecutable: require("./discovery").acpResolver("kimi"),
124
+ mapQueryOptions: require("./options/acp").map,
71
125
  displayName: "Kimi Code",
72
126
  loginCommand: "kimi login",
73
127
  binaryName: "kimi",
@@ -80,6 +134,8 @@ var VENDOR_REGISTRY = {
80
134
  rateLimitTracking: false,
81
135
  },
82
136
  grok: {
137
+ resolveExecutable: require("./discovery").acpResolver("grok"),
138
+ mapQueryOptions: require("./options/acp").map,
83
139
  displayName: "Grok Build",
84
140
  loginCommand: "grok login --device-auth",
85
141
  binaryName: "grok",
@@ -92,6 +148,8 @@ var VENDOR_REGISTRY = {
92
148
  rateLimitTracking: false,
93
149
  },
94
150
  copilot: {
151
+ resolveExecutable: require("./discovery").acpResolver("copilot"),
152
+ mapQueryOptions: require("./options/acp").map,
95
153
  displayName: "GitHub Copilot CLI",
96
154
  loginCommand: "copilot login",
97
155
  binaryName: "copilot",
@@ -104,6 +162,8 @@ var VENDOR_REGISTRY = {
104
162
  rateLimitTracking: false,
105
163
  },
106
164
  qwen: {
165
+ resolveExecutable: require("./discovery").acpResolver("qwen"),
166
+ mapQueryOptions: require("./options/acp").map,
107
167
  displayName: "Qwen Code",
108
168
  loginCommand: "qwen",
109
169
  binaryName: "qwen",
@@ -116,6 +176,8 @@ var VENDOR_REGISTRY = {
116
176
  rateLimitTracking: false,
117
177
  },
118
178
  junie: {
179
+ resolveExecutable: require("./discovery").acpResolver("junie"),
180
+ mapQueryOptions: require("./options/acp").map,
119
181
  displayName: "Junie CLI",
120
182
  loginCommand: "junie",
121
183
  binaryName: "junie",
@@ -128,6 +190,9 @@ var VENDOR_REGISTRY = {
128
190
  rateLimitTracking: false,
129
191
  },
130
192
  kiro: {
193
+ normalizeContext: require("./usage").tokenContext,
194
+ resolveExecutable: require("./discovery").bundledResolver(function() { return require("./kiro-acp-server").findKiroPath(); }, "kiro-cli"),
195
+ mapQueryOptions: require("./options/kiro").map,
131
196
  displayName: "Kiro CLI",
132
197
  loginCommand: "kiro-cli login",
133
198
  binaryName: "kiro-cli",
@@ -169,7 +234,22 @@ function clampEffort(vendor, effort) {
169
234
  return nearest;
170
235
  }
171
236
 
237
+ // Publish only serializable product descriptions, never backend services.
238
+ function publicInfo() {
239
+ var result = {};
240
+ Object.keys(VENDOR_REGISTRY).forEach(function(vendor) {
241
+ var info = VENDOR_REGISTRY[vendor], entry = {};
242
+ ["displayName", "terminalResumeCommand", "planPathSegments", "loginCommand", "binaryName", "avatar", "sessionModes", "effortLevels", "osUserIsolation", "sessionBoundTools", "usageDashboard", "rateLimitTracking", "rateLimitScheduling", "acceptsUnstampedQuota", "configuration"].forEach(function(key) {
243
+ if (info[key] !== undefined) entry[key] = info[key];
244
+ });
245
+ entry.browserLoginSupported = typeof info.browserLoginCommand === "string" && Array.isArray(info.oauthHosts) && info.oauthHosts.length > 0;
246
+ result[vendor] = entry;
247
+ });
248
+ return result;
249
+ }
250
+
172
251
  module.exports = {
252
+ publicInfo: publicInfo,
173
253
  VENDOR_REGISTRY: VENDOR_REGISTRY,
174
254
  getVendorInfo: getVendorInfo,
175
255
  clampEffort: clampEffort,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clay-server",
3
- "version": "5.2.0-beta.5",
3
+ "version": "5.2.0-beta.6",
4
4
  "description": "Self-hosted team workspace for Claude Code and Codex. Multi-user, browser-based, with persistent AI mates.",
5
5
  "bin": {
6
6
  "clay-server": "./bin/cli.js"
@@ -74,7 +74,8 @@
74
74
  "web-push": "^3.6.7",
75
75
  "ws": "^8.18.0",
76
76
  "yaml": "^2.9.1",
77
- "zod": "^4.6.5"
77
+ "zod": "^4.6.5",
78
+ "@muse-code/sdk": "1.4.7"
78
79
  },
79
80
  "license": "AGPL-3.0-only",
80
81
  "engines": {