agentschat-mcp 0.36.24 → 0.36.26
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.
- package/CHANGELOG.md +12 -0
- package/README.md +8 -0
- package/codex/README.md +1 -1
- package/codex/app-server.ts +79 -22
- package/codex/bots-config.ts +31 -11
- package/codex/bridge.ts +123 -25
- package/codex/config.ts +128 -21
- package/codex/gui-channel.ts +66 -9
- package/codex/inbox-sync.ts +65 -12
- package/codex/loop-grants.ts +41 -11
- package/codex/manager.ts +101 -25
- package/codex/owner.ts +81 -9
- package/codex/processes.ts +51 -7
- package/codex/run.ts +70 -17
- package/codex/runtime-home.ts +41 -11
- package/codex/thread-history.ts +77 -30
- package/codex/transport.ts +122 -19
- package/connector/auth.ts +57 -5
- package/connector/backfill.ts +92 -10
- package/connector/descriptor.ts +27 -1
- package/connector/identities.ts +82 -14
- package/connector/ingest.ts +11 -2
- package/connector/normalize.ts +32 -12
- package/connector/run.ts +314 -67
- package/connector/server.ts +95 -26
- package/dist/codex-bots.js +410 -73
- package/dist/codex-bridge.js +1996 -576
- package/dist/connector.js +1286 -493
- package/dist/dsh.js +1776 -299
- package/dist/muse.js +967 -221
- package/dist/server.js +7645 -1172
- package/dsh/client.js +7 -5
- package/dsh/identity-ui/client.js +7 -5
- package/dsh/identity-ui/index.js +43 -8
- package/dsh/inbound-bridge/index.js +595 -146
- package/dsh/src/cli.ts +430 -91
- package/dsh/src/patch.ts +295 -15
- package/dsh/tests/dsh-hardening-127.test.ts +207 -0
- package/dsh/tests/dsh.test.ts +990 -3
- package/muse/scripts/ensure-muse-wakes.mjs +5 -3
- package/muse/scripts/muse-wake-receiver.mjs +4 -1
- package/muse/src/bridge.ts +54 -13
- package/muse/src/cli.ts +226 -41
- package/muse/src/client.ts +249 -34
- package/muse/src/config.ts +128 -12
- package/muse/src/policy.ts +28 -8
- package/muse/src/types.ts +1 -0
- package/muse/src/typing.ts +18 -1
- package/muse/src/wake.ts +237 -35
- package/muse/tests/bridge.test.mjs +131 -0
- package/muse/tests/client.test.mjs +327 -0
- package/muse/tests/config.test.mjs +78 -1
- package/muse/tests/hardening.test.mjs +199 -0
- package/muse/tests/hardening126.test.mjs +292 -0
- package/muse/tests/policy.test.mjs +83 -1
- package/muse/tests/wake.test.mjs +134 -6
- package/package.json +3 -3
- package/scripts/ensure-grok-wakes.mjs +93 -8
- package/scripts/example-url-wake-receiver.mjs +254 -61
- package/scripts/grok-bind-register.sh +38 -8
- package/skills/agentschat-team-lead/SKILL.md +1 -1
- package/skills/onboarding.md +14 -10
- package/src/argcheck.ts +1890 -1
- package/src/cli.mjs +98 -14
- package/src/dedup.ts +57 -8
- package/src/grok-bind.ts +160 -33
- package/src/heartbeat.ts +39 -11
- package/src/identity-guard.ts +93 -20
- package/src/identity.ts +67 -11
- package/src/mentions.ts +26 -5
- package/src/onboarding-status.ts +134 -11
- package/src/profile-selection.ts +269 -18
- package/src/profile-store.ts +222 -28
- package/src/read-cursor.ts +256 -9
- package/src/reconnect.ts +98 -2
- package/src/redact.ts +34 -15
- package/src/rest-cli.ts +713 -159
- package/src/server.ts +2487 -342
- package/src/session-bind.ts +731 -132
- package/src/session-route.ts +183 -12
- package/src/team-lead-skill.ts +3 -0
- package/src/timestamps.ts +56 -23
- package/src/tool-annotations.ts +22 -1
- package/src/wake.ts +524 -90
package/dsh/client.js
CHANGED
|
@@ -103,8 +103,10 @@ window.__ModuleLoader__.load({
|
|
|
103
103
|
}
|
|
104
104
|
}, [refresh]);
|
|
105
105
|
|
|
106
|
-
const boundName = data &&
|
|
107
|
-
|
|
106
|
+
const boundName = data && data.binds && typeof data.binds === 'object' &&
|
|
107
|
+
Object.prototype.hasOwnProperty.call(data.binds, sessionId) ? data.binds[sessionId] : undefined;
|
|
108
|
+
const profiles = data && Array.isArray(data.profiles) ? data.profiles.filter((p) => p && typeof p === 'object') : [];
|
|
109
|
+
const profile = boundName ? profiles.find((p) => p.name === boundName) : undefined;
|
|
108
110
|
|
|
109
111
|
async function call(path, payload) {
|
|
110
112
|
setBusy(true);
|
|
@@ -170,7 +172,7 @@ window.__ModuleLoader__.load({
|
|
|
170
172
|
{ style: { padding: '4px 8px 6px', fontSize: '11px', color: 'var(--dsw-alias-label-tertiary)' } },
|
|
171
173
|
'这个会话用哪个 AgentsChat 身份',
|
|
172
174
|
),
|
|
173
|
-
|
|
175
|
+
profiles.slice(0, 8).map((entry) =>
|
|
174
176
|
h(
|
|
175
177
|
'button',
|
|
176
178
|
{
|
|
@@ -187,7 +189,7 @@ window.__ModuleLoader__.load({
|
|
|
187
189
|
{ style: { flex: '1', minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
|
|
188
190
|
entry.displayName || entry.name,
|
|
189
191
|
),
|
|
190
|
-
h('span', { style: { color: 'var(--dsw-alias-label-tertiary)', fontSize: '11px' } }, entry.agentId.slice(0, 8)),
|
|
192
|
+
h('span', { style: { color: 'var(--dsw-alias-label-tertiary)', fontSize: '11px' } }, typeof entry.agentId === 'string' ? entry.agentId.slice(0, 8) : ''),
|
|
191
193
|
),
|
|
192
194
|
),
|
|
193
195
|
sessionId
|
|
@@ -226,7 +228,7 @@ window.__ModuleLoader__.load({
|
|
|
226
228
|
style: { color: 'var(--dsw-alias-state-business-primary)', fontSize: '12px', textDecoration: 'none' },
|
|
227
229
|
href: CHAT + encodeURIComponent(profile.agentId),
|
|
228
230
|
target: '_blank',
|
|
229
|
-
rel: 'noreferrer',
|
|
231
|
+
rel: 'noopener noreferrer',
|
|
230
232
|
},
|
|
231
233
|
'打开私聊',
|
|
232
234
|
),
|
|
@@ -107,8 +107,10 @@ window.__ModuleLoader__.load({
|
|
|
107
107
|
}
|
|
108
108
|
}, [refresh]);
|
|
109
109
|
|
|
110
|
-
const boundName = data &&
|
|
111
|
-
|
|
110
|
+
const boundName = data && data.binds && typeof data.binds === 'object' &&
|
|
111
|
+
Object.prototype.hasOwnProperty.call(data.binds, sessionId) ? data.binds[sessionId] : undefined;
|
|
112
|
+
const profiles = data && Array.isArray(data.profiles) ? data.profiles.filter((p) => p && typeof p === 'object') : [];
|
|
113
|
+
const profile = boundName ? profiles.find((p) => p.name === boundName) : undefined;
|
|
112
114
|
|
|
113
115
|
async function call(path, payload) {
|
|
114
116
|
setBusy(true);
|
|
@@ -174,7 +176,7 @@ window.__ModuleLoader__.load({
|
|
|
174
176
|
{ style: { padding: '4px 8px 6px', fontSize: '11px', color: 'var(--dsw-alias-label-tertiary)' } },
|
|
175
177
|
'这个会话用哪个 AgentsChat 身份',
|
|
176
178
|
),
|
|
177
|
-
|
|
179
|
+
profiles.slice(0, 8).map((entry) =>
|
|
178
180
|
h(
|
|
179
181
|
'button',
|
|
180
182
|
{
|
|
@@ -191,7 +193,7 @@ window.__ModuleLoader__.load({
|
|
|
191
193
|
{ style: { flex: '1', minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
|
|
192
194
|
entry.displayName || entry.name,
|
|
193
195
|
),
|
|
194
|
-
h('span', { style: { color: 'var(--dsw-alias-label-tertiary)', fontSize: '11px' } }, entry.agentId.slice(0, 8)),
|
|
196
|
+
h('span', { style: { color: 'var(--dsw-alias-label-tertiary)', fontSize: '11px' } }, typeof entry.agentId === 'string' ? entry.agentId.slice(0, 8) : ''),
|
|
195
197
|
),
|
|
196
198
|
),
|
|
197
199
|
sessionId
|
|
@@ -230,7 +232,7 @@ window.__ModuleLoader__.load({
|
|
|
230
232
|
style: { color: 'var(--dsw-alias-state-business-primary)', fontSize: '12px', textDecoration: 'none' },
|
|
231
233
|
href: CHAT + encodeURIComponent(profile.agentId),
|
|
232
234
|
target: '_blank',
|
|
233
|
-
rel: 'noreferrer',
|
|
235
|
+
rel: 'noopener noreferrer',
|
|
234
236
|
},
|
|
235
237
|
'打开私聊',
|
|
236
238
|
),
|
package/dsh/identity-ui/index.js
CHANGED
|
@@ -7,15 +7,50 @@
|
|
|
7
7
|
* very different causes — the row never loaded, or the browser module never ran
|
|
8
8
|
* — and without a marker from each half there is no way to tell them apart.
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { closeSync, constants, fstatSync, lstatSync, openSync, realpathSync, writeSync } from 'node:fs';
|
|
11
11
|
import { homedir } from 'node:os';
|
|
12
|
-
import { join } from 'node:path';
|
|
12
|
+
import { dirname, join, resolve } from 'node:path';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const MAX_LOG_BYTES = 256 * 1024;
|
|
15
|
+
const DARWIN_ROOT_LINKS = new Set(['/var', '/tmp', '/etc']);
|
|
16
|
+
|
|
17
|
+
function checkDirectories(directory) {
|
|
18
|
+
let path = resolve(directory);
|
|
19
|
+
for (;;) {
|
|
20
|
+
const stat = lstatSync(path);
|
|
21
|
+
const systemLink = process.platform === 'darwin' && DARWIN_ROOT_LINKS.has(path) && stat.isSymbolicLink();
|
|
22
|
+
if (!systemLink && (stat.isSymbolicLink() || !stat.isDirectory())) {
|
|
23
|
+
throw new Error('Refusing symlinked or non-directory log ancestor');
|
|
24
|
+
}
|
|
25
|
+
const parent = dirname(path);
|
|
26
|
+
if (parent === path) break;
|
|
27
|
+
path = parent;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function apply(_ctx, { homeDir = homedir() } = {}) {
|
|
32
|
+
let fd;
|
|
15
33
|
try {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
20
|
-
|
|
34
|
+
const directory = resolve(homeDir, '.dsh');
|
|
35
|
+
checkDirectories(directory);
|
|
36
|
+
// Check the physical path too, including ancestors behind Darwin system links.
|
|
37
|
+
checkDirectories(realpathSync(directory));
|
|
38
|
+
const path = join(directory, 'agentschat-identity-host.log');
|
|
39
|
+
let target;
|
|
40
|
+
try { target = lstatSync(path); }
|
|
41
|
+
catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
42
|
+
if (target && (!target.isFile() || target.isSymbolicLink() || target.size >= MAX_LOG_BYTES)) return;
|
|
43
|
+
const flags = constants.O_WRONLY | constants.O_APPEND | constants.O_NOFOLLOW | constants.O_NONBLOCK |
|
|
44
|
+
(target ? 0 : constants.O_CREAT | constants.O_EXCL);
|
|
45
|
+
fd = openSync(path, flags, 0o600);
|
|
46
|
+
const opened = fstatSync(fd);
|
|
47
|
+
if (!opened.isFile() || (target && (opened.dev !== target.dev || opened.ino !== target.ino))) return;
|
|
48
|
+
checkDirectories(directory);
|
|
49
|
+
checkDirectories(realpathSync(directory));
|
|
50
|
+
const line = `${new Date().toISOString()} host half applied\n`;
|
|
51
|
+
if (opened.size + Buffer.byteLength(line) > MAX_LOG_BYTES) return;
|
|
52
|
+
writeSync(fd, line);
|
|
53
|
+
} catch {} finally {
|
|
54
|
+
if (fd !== undefined) { try { closeSync(fd); } catch {} }
|
|
55
|
+
}
|
|
21
56
|
}
|