Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased

- Added `SEMA4AI_FILE_MANAGEMENT_URL` environment variable when running actions to `file://<path-to-package>/devdata/chat-files`.
- Updated Action Server to `2.9.0`
- Updated Agent CLI to `v1.0.5`
- Updated RCC to `v19.0.2`
Expand Down
23 changes: 20 additions & 3 deletions sema4ai/vscode-client/src/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import {
import { createActionPackage } from "./robo/actionPackage";
import { createAgentPackage } from "./robo/agentPackage";
import { langServer } from "./extension";
import * as path from "path";
import * as fs from "fs";

export interface ListRobotSelectionOpts {
showTaskPackages: boolean;
Expand Down Expand Up @@ -494,7 +496,7 @@ export async function uploadRobot(robot?: LocalPackageMetadataInfo) {
let refresh = false;
SELECT_OR_REFRESH: do {
let workspaceSelection = await selectWorkspace(
"Please select a Workspace to upload " + robot.name + " to.",
"Please select a Workspace to upload '" + robot.name + "' to.",
refresh
);
if (workspaceSelection === undefined) {
Expand Down Expand Up @@ -605,7 +607,7 @@ export async function uploadRobot(robot?: LocalPackageMetadataInfo) {

let selectedItem: QuickPickItemWithAction = await showSelectOneQuickPick(
updateExistingCaptions,
"This will overwrite the robot " + robotInfo.name + " on Control Room. Are you sure? "
"This will overwrite the robot '" + robotInfo.name + "' on Control Room. Are you sure? "
);

// robot.language-server.python
Expand Down Expand Up @@ -892,7 +894,8 @@ export async function createPackage() {
* tasks will use `updateLaunchEnvironment`).
*/
export async function updateLaunchEnvironmentCommonTasksAndActions(
environment: Record<string, string>
environment: Record<string, string>,
targetYaml?: string
): Promise<Record<string, string>> {
const newEnv = applyOutViewIntegrationEnvVars(environment);

Expand All @@ -901,6 +904,20 @@ export async function updateLaunchEnvironmentCommonTasksAndActions(
newEnv["SEMA4AI_CREDENTIAL_API"] = externalApiUrl;
}

if (targetYaml) {
const packageDir = path.dirname(targetYaml);
const devdataPath = path.join(packageDir, "devdata", "chat-files");

try {
if (!fs.existsSync(devdataPath)) {
fs.mkdirSync(devdataPath, { recursive: true });
}
newEnv["SEMA4AI_FILE_MANAGEMENT_URL"] = `file://${devdataPath}`;
} catch (error) {
logError("Error creating devdata/chat-files directory", error, "ERR_CREATE_DEVDATA_DIR");
}
}

return newEnv;
}

Expand Down
2 changes: 1 addition & 1 deletion sema4ai/vscode-client/src/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class RobocorpCodeDebugConfigurationProvider implements DebugConfiguratio
}

if (isActionPackageLaunch) {
env = await updateLaunchEnvironmentCommonTasksAndActions(env);
env = await updateLaunchEnvironmentCommonTasksAndActions(env, debugConfiguration.package);
// Vault/work-items features not available in action server at this point.
} else {
// Resolve environment (updates the environment to add vault
Expand Down
Loading