@episoda/cli 0.2.150 → 0.2.151
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.
|
@@ -2913,7 +2913,7 @@ var require_package = __commonJS({
|
|
|
2913
2913
|
"package.json"(exports2, module2) {
|
|
2914
2914
|
module2.exports = {
|
|
2915
2915
|
name: "@episoda/cli",
|
|
2916
|
-
version: "0.2.
|
|
2916
|
+
version: "0.2.151",
|
|
2917
2917
|
description: "CLI tool for Episoda local development workflow orchestration",
|
|
2918
2918
|
main: "dist/index.js",
|
|
2919
2919
|
types: "dist/index.d.ts",
|
|
@@ -9161,12 +9161,21 @@ var AgentManager = class {
|
|
|
9161
9161
|
* EP1173: Added autonomousMode parameter for permission-free execution
|
|
9162
9162
|
*/
|
|
9163
9163
|
async startSession(options) {
|
|
9164
|
-
const { sessionId, moduleId, moduleUid, projectId, projectPath, provider = "claude", autonomousMode = true, canWrite = true, readOnlyReason, mcpMode = "planning", message, credentials, systemPrompt, onChunk, onToolUse, onToolResult, onComplete, onError } = options;
|
|
9164
|
+
const { sessionId, moduleId, moduleUid, projectId, workspaceId, projectPath, provider = "claude", autonomousMode = true, canWrite = true, readOnlyReason, mcpMode = "planning", message, credentials, systemPrompt, onChunk, onToolUse, onToolResult, onComplete, onError } = options;
|
|
9165
9165
|
const normalizedMcpMode = this.normalizeMcpMode(mcpMode);
|
|
9166
|
+
const normalizeWorkspaceId = (id) => {
|
|
9167
|
+
const trimmed = id?.trim();
|
|
9168
|
+
return trimmed ? trimmed : void 0;
|
|
9169
|
+
};
|
|
9170
|
+
const requestedWorkspaceId = normalizeWorkspaceId(workspaceId);
|
|
9166
9171
|
const existingSession = this.sessions.get(sessionId);
|
|
9167
9172
|
if (existingSession) {
|
|
9168
9173
|
if (existingSession.provider === provider && existingSession.moduleId === moduleId) {
|
|
9169
9174
|
console.log(`[AgentManager] EP1232: Session ${sessionId} already exists, treating start as message (idempotent)`);
|
|
9175
|
+
if (requestedWorkspaceId && !normalizeWorkspaceId(existingSession.workspaceId)) {
|
|
9176
|
+
existingSession.workspaceId = requestedWorkspaceId;
|
|
9177
|
+
console.log(`[AgentManager] EP1357: Updated session ${sessionId} workspaceId from start options`);
|
|
9178
|
+
}
|
|
9170
9179
|
return this.sendMessage({
|
|
9171
9180
|
sessionId,
|
|
9172
9181
|
message,
|
|
@@ -9212,11 +9221,22 @@ var AgentManager = class {
|
|
|
9212
9221
|
error: error instanceof Error ? error.message : `${cliName} not available`
|
|
9213
9222
|
};
|
|
9214
9223
|
}
|
|
9224
|
+
let effectiveWorkspaceId = requestedWorkspaceId;
|
|
9225
|
+
if (!effectiveWorkspaceId) {
|
|
9226
|
+
try {
|
|
9227
|
+
const config = await (0, import_core11.loadConfig)();
|
|
9228
|
+
effectiveWorkspaceId = normalizeWorkspaceId(config?.workspace_id);
|
|
9229
|
+
} catch (error) {
|
|
9230
|
+
console.warn("[AgentManager] EP1357: Unable to resolve workspaceId from local config:", error instanceof Error ? error.message : error);
|
|
9231
|
+
}
|
|
9232
|
+
}
|
|
9215
9233
|
const session = {
|
|
9216
9234
|
sessionId,
|
|
9217
9235
|
moduleId,
|
|
9218
9236
|
moduleUid,
|
|
9219
9237
|
projectId,
|
|
9238
|
+
workspaceId: effectiveWorkspaceId,
|
|
9239
|
+
// EP1357: Store workspace ID for MCP server env
|
|
9220
9240
|
projectPath,
|
|
9221
9241
|
provider,
|
|
9222
9242
|
// EP1133: Store provider in session
|
|
@@ -9426,6 +9446,9 @@ If changes are needed, explain what needs to be done.`;
|
|
|
9426
9446
|
EPISODA_PROJECT_ID: session.projectId,
|
|
9427
9447
|
DEV_ENVIRONMENT_ID: devEnvId
|
|
9428
9448
|
};
|
|
9449
|
+
if (session.workspaceId) {
|
|
9450
|
+
episodaMcpEnv.EPISODA_WORKSPACE_ID = session.workspaceId;
|
|
9451
|
+
}
|
|
9429
9452
|
if (sessionToken) {
|
|
9430
9453
|
episodaMcpEnv.EPISODA_SESSION_TOKEN = sessionToken;
|
|
9431
9454
|
}
|
|
@@ -9576,6 +9599,9 @@ If changes are needed, explain what needs to be done.`;
|
|
|
9576
9599
|
EPISODA_PROJECT_ID: session.projectId || "",
|
|
9577
9600
|
DEV_ENVIRONMENT_ID: devEnvId
|
|
9578
9601
|
};
|
|
9602
|
+
if (session.workspaceId) {
|
|
9603
|
+
env.EPISODA_WORKSPACE_ID = session.workspaceId;
|
|
9604
|
+
}
|
|
9579
9605
|
if (sessionToken) {
|
|
9580
9606
|
env.EPISODA_SESSION_TOKEN = sessionToken;
|
|
9581
9607
|
}
|
|
@@ -9659,6 +9685,9 @@ If changes are needed, explain what needs to be done.`;
|
|
|
9659
9685
|
MODULE_UID: session.moduleUid,
|
|
9660
9686
|
EPISODA_PROJECT_ID: session.projectId
|
|
9661
9687
|
};
|
|
9688
|
+
if (session.workspaceId) {
|
|
9689
|
+
envVars.EPISODA_WORKSPACE_ID = session.workspaceId;
|
|
9690
|
+
}
|
|
9662
9691
|
if (provider === "codex") {
|
|
9663
9692
|
envVars.CODEX_HOME = sessionCodexDir;
|
|
9664
9693
|
console.log(`[AgentManager] EP1260: Set CODEX_HOME=${sessionCodexDir}`);
|
|
@@ -12068,6 +12097,8 @@ var Daemon = class _Daemon {
|
|
|
12068
12097
|
moduleId: cmd.moduleId,
|
|
12069
12098
|
moduleUid: cmd.moduleUid,
|
|
12070
12099
|
projectId: cmd.projectId,
|
|
12100
|
+
workspaceId: cmd.workspaceId,
|
|
12101
|
+
// EP1357: Pass workspace ID for MCP server auth
|
|
12071
12102
|
projectPath: agentWorkingDir,
|
|
12072
12103
|
provider: cmd.provider || "claude",
|
|
12073
12104
|
// EP1133: Multi-provider support
|