@lightcone-ai/daemon 0.9.79 → 0.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.
- package/mcp-servers/mysql/index.js +13 -5
- package/mcp-servers/mysql/manifest.json +16 -0
- package/mcp-servers/official/company-fundamentals/index.js +34 -0
- package/mcp-servers/official/company-fundamentals/manifest.json +14 -0
- package/mcp-servers/official/compliance-check/index.js +49 -0
- package/mcp-servers/official/compliance-check/manifest.json +14 -0
- package/mcp-servers/official/industry-report/index.js +34 -0
- package/mcp-servers/official/industry-report/manifest.json +14 -0
- package/mcp-servers/official/market-data-query/index.js +34 -0
- package/mcp-servers/official/market-data-query/manifest.json +14 -0
- package/mcp-servers/official/portfolio-analysis/index.js +74 -0
- package/mcp-servers/official/portfolio-analysis/manifest.json +14 -0
- package/mcp-servers/official/portfolio-read/index.js +34 -0
- package/mcp-servers/official/portfolio-read/manifest.json +14 -0
- package/mcp-servers/official/research-fetch/index.js +35 -0
- package/mcp-servers/official/research-fetch/manifest.json +14 -0
- package/mcp-servers/official/risk-metrics/index.js +34 -0
- package/mcp-servers/official/risk-metrics/manifest.json +14 -0
- package/mcp-servers/official-common/fixtures.js +273 -0
- package/mcp-servers/official-common/server.js +34 -0
- package/mcp-servers/platform/manifest.json +15 -0
- package/mcp-servers/portfolio-analysis/core.js +592 -0
- package/mcp-servers/portfolio-analysis/index.js +45 -0
- package/mcp-servers/portfolio-analysis/package-lock.json +1139 -0
- package/mcp-servers/portfolio-analysis/package.json +10 -0
- package/mcp-servers/portfolio-read/core.js +330 -0
- package/mcp-servers/portfolio-read/index.js +127 -0
- package/mcp-servers/portfolio-read/package-lock.json +1243 -0
- package/mcp-servers/portfolio-read/package.json +11 -0
- package/mcp-servers/publisher/index.js +14 -14
- package/mcp-servers/publisher/manifest.json +16 -0
- package/package.json +1 -1
- package/src/agent-manager.js +761 -188
- package/src/chat-bridge.js +567 -92
- package/src/connection.js +1 -1
- package/src/drivers/claude.js +48 -45
- package/src/drivers/codex.js +110 -8
- package/src/drivers/kimi.js +80 -35
- package/src/governance-state.js +89 -0
- package/src/index.js +34 -16
- package/src/lease-window.js +8 -0
- package/src/mcp-config.js +52 -23
|
@@ -23,9 +23,9 @@ import { withProfileLock } from '../../src/profile-lock.js';
|
|
|
23
23
|
const SERVER_URL = process.env.SERVER_URL ?? '';
|
|
24
24
|
const MACHINE_API_KEY = process.env.MACHINE_API_KEY ?? '';
|
|
25
25
|
const AGENT_ID = process.env.AGENT_ID ?? '';
|
|
26
|
-
const
|
|
26
|
+
const WORKSPACE_ID = process.env.WORKSPACE_ID ?? '';
|
|
27
27
|
const WORKSPACE_DIR = process.env.WORKSPACE_DIR ?? process.cwd();
|
|
28
|
-
const
|
|
28
|
+
const WORKSPACE_ROOT_DIR = path.dirname(WORKSPACE_DIR);
|
|
29
29
|
|
|
30
30
|
// ── Platform registry ──────────────────────────────────────────────────────────
|
|
31
31
|
|
|
@@ -87,7 +87,7 @@ async function api(method, path, body) {
|
|
|
87
87
|
});
|
|
88
88
|
if (!res.ok) {
|
|
89
89
|
const text = await res.text();
|
|
90
|
-
throw new Error(`
|
|
90
|
+
throw new Error(`lightcone API ${method} ${path} failed (${res.status}): ${text}`);
|
|
91
91
|
}
|
|
92
92
|
return res.json();
|
|
93
93
|
}
|
|
@@ -139,15 +139,15 @@ function workspacePathFromMediaPath(filePath, approvalData) {
|
|
|
139
139
|
|
|
140
140
|
const normalized = filePath.replaceAll('\\', '/');
|
|
141
141
|
const virtualMatch = normalized.match(/^\/agent-workspace\/([^/]+)\/workspace\/(.+)$/);
|
|
142
|
-
if (virtualMatch) return {
|
|
142
|
+
if (virtualMatch) return { workspaceId: virtualMatch[1], relPath: virtualMatch[2] };
|
|
143
143
|
|
|
144
144
|
const workspaceSegmentMatch = normalized.match(/\/workspace\/((?:artifacts|notes|tmp)\/.+)$/);
|
|
145
145
|
if (workspaceSegmentMatch) {
|
|
146
|
-
return {
|
|
146
|
+
return { workspaceId: approvalData?.workspaceId ?? WORKSPACE_ID, relPath: workspaceSegmentMatch[1] };
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
if (!path.isAbsolute(filePath) && /^(artifacts|notes|tmp)\//.test(normalized)) {
|
|
150
|
-
return {
|
|
150
|
+
return { workspaceId: approvalData?.workspaceId ?? WORKSPACE_ID, relPath: normalized };
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
return null;
|
|
@@ -157,23 +157,23 @@ async function materializeWorkspaceMedia(filePath, approvalData) {
|
|
|
157
157
|
if (!filePath || existsSync(filePath)) return filePath;
|
|
158
158
|
|
|
159
159
|
const workspacePath = workspacePathFromMediaPath(filePath, approvalData);
|
|
160
|
-
if (!workspacePath?.
|
|
160
|
+
if (!workspacePath?.workspaceId || !workspacePath.relPath) return filePath;
|
|
161
161
|
|
|
162
|
-
const localPath = path.resolve(
|
|
163
|
-
const allowedRoots = ['artifacts', 'notes', 'tmp'].map(dir => path.join(
|
|
162
|
+
const localPath = path.resolve(WORKSPACE_ROOT_DIR, workspacePath.relPath);
|
|
163
|
+
const allowedRoots = ['artifacts', 'notes', 'tmp'].map(dir => path.join(WORKSPACE_ROOT_DIR, dir));
|
|
164
164
|
if (!allowedRoots.some(root => isInsideDir(localPath, root))) {
|
|
165
|
-
throw new Error(`workspace media path is outside allowed
|
|
165
|
+
throw new Error(`workspace media path is outside allowed workspace directories: ${filePath}`);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
if (existsSync(localPath)) return localPath;
|
|
169
169
|
|
|
170
170
|
const data = await api(
|
|
171
171
|
'GET',
|
|
172
|
-
`/
|
|
172
|
+
`/workspace-memory?path=${encodeURIComponent(workspacePath.relPath)}&workspaceId=${encodeURIComponent(workspacePath.workspaceId)}`
|
|
173
173
|
);
|
|
174
174
|
mkdirSync(path.dirname(localPath), { recursive: true });
|
|
175
175
|
writeFileSync(localPath, decodeWorkspaceContent(data.content));
|
|
176
|
-
console.error(`[publisher] Materialized
|
|
176
|
+
console.error(`[publisher] Materialized workspace media ${workspacePath.relPath} -> ${localPath}`);
|
|
177
177
|
return localPath;
|
|
178
178
|
}
|
|
179
179
|
|
|
@@ -201,12 +201,12 @@ function validateLocalFile(filePath, { kind, required = false, allowedExts = []
|
|
|
201
201
|
const allowedRoots = [
|
|
202
202
|
realpathSync(WORKSPACE_DIR),
|
|
203
203
|
...['artifacts', 'notes', 'tmp']
|
|
204
|
-
.map(dir => path.join(
|
|
204
|
+
.map(dir => path.join(WORKSPACE_ROOT_DIR, dir))
|
|
205
205
|
.filter(existsSync)
|
|
206
206
|
.map(dir => realpathSync(dir)),
|
|
207
207
|
];
|
|
208
208
|
if (!allowedRoots.some(root => isInsideDir(realFile, root))) {
|
|
209
|
-
throw new Error(`${kind} file must be inside the agent workspace or
|
|
209
|
+
throw new Error(`${kind} file must be inside the agent workspace or workspace shared artifacts/notes/tmp directory: ${filePath}`);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
const stat = statSync(realFile);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "publisher",
|
|
3
|
+
"name": "Publisher MCP Server",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"runtime": "node",
|
|
6
|
+
"entrypoint": "index.js",
|
|
7
|
+
"tool_declarations": [
|
|
8
|
+
{ "name": "get_platform_requirements", "classification": "cacheable" },
|
|
9
|
+
{ "name": "check_login_status", "classification": "mandatory" },
|
|
10
|
+
{ "name": "publish_content", "classification": "mandatory" }
|
|
11
|
+
],
|
|
12
|
+
"smoke_test": {
|
|
13
|
+
"tool": "get_platform_requirements",
|
|
14
|
+
"arguments": { "platform": "xhs", "content_type": "image_text" }
|
|
15
|
+
}
|
|
16
|
+
}
|