@agent-chat/mention-watcher 0.0.6 → 0.0.7
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/dist/watch.js +20 -3
- package/package.json +1 -1
package/dist/watch.js
CHANGED
|
@@ -81,9 +81,17 @@ function detectWorkspaceDir() {
|
|
|
81
81
|
}
|
|
82
82
|
var _WORKSPACE = process.env.WORKSPACE_DIR ?? detectWorkspaceDir();
|
|
83
83
|
{
|
|
84
|
-
const
|
|
85
|
-
for (const
|
|
86
|
-
|
|
84
|
+
const dirsToCheck = [.../* @__PURE__ */ new Set([process.cwd(), _WORKSPACE])];
|
|
85
|
+
for (const dir of dirsToCheck) {
|
|
86
|
+
const envPath = path.join(dir, ".env");
|
|
87
|
+
const fileEnv = loadEnvFile(envPath);
|
|
88
|
+
if (Object.keys(fileEnv).length > 0) {
|
|
89
|
+
process.stderr.write(`[mention-watcher] Loaded .env from ${envPath}
|
|
90
|
+
`);
|
|
91
|
+
for (const [k, v] of Object.entries(fileEnv)) {
|
|
92
|
+
if (!(k in process.env)) process.env[k] = v;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
97
|
var AGENT_TOKEN = process.env.AGENT_TOKEN ?? "";
|
|
@@ -191,7 +199,16 @@ function drainQueue(proc) {
|
|
|
191
199
|
}
|
|
192
200
|
async function main() {
|
|
193
201
|
if (!AGENT_TOKEN) {
|
|
202
|
+
const envPath = path.join(WORKSPACE_DIR, ".env");
|
|
203
|
+
const envExists = fs.existsSync(envPath);
|
|
194
204
|
process.stderr.write("[mention-watcher] Error: AGENT_TOKEN is required\n");
|
|
205
|
+
process.stderr.write(` Workspace : ${WORKSPACE_DIR}
|
|
206
|
+
`);
|
|
207
|
+
process.stderr.write(` .env : ${envPath} ${envExists ? "(exists, but AGENT_TOKEN not set)" : "(not found)"}
|
|
208
|
+
`);
|
|
209
|
+
process.stderr.write("\n");
|
|
210
|
+
process.stderr.write(" Run setup first from your project directory:\n");
|
|
211
|
+
process.stderr.write(" npx @agent-chat/mention-watcher setup\n");
|
|
195
212
|
process.exit(1);
|
|
196
213
|
}
|
|
197
214
|
syncMcpToken(WORKSPACE_DIR, MCP_NAME);
|