refactor(MetaAction): separate key attribute into name and location

Context:
This change adapts MetaAction locating to support different MetaAction types,
including loading from the local filesystem and from MCP tools.
This commit is contained in:
2025-12-19 21:35:39 +08:00
parent dc4074715e
commit 4dea948f82
9 changed files with 32 additions and 28 deletions

View File

@@ -6,7 +6,6 @@ import org.junit.jupiter.api.Test;
import work.slhaf.partner.core.action.entity.MetaAction;
import work.slhaf.partner.core.action.entity.MetaActionType;
import java.nio.file.Path;
import java.util.Map;
import java.util.concurrent.Executors;
@@ -30,10 +29,10 @@ public class LocalRunnerClientTest {
private static @NotNull MetaAction buildTmpMetaAction() {
MetaAction metaAction = new MetaAction();
metaAction.setIo(false);
metaAction.setKey("hello_world");
metaAction.setName("hello_world");
metaAction.setParams(Map.of("name", "origin_run"));
metaAction.setType(MetaActionType.ORIGIN);
metaAction.setPath(Path.of("/home/slhaf/Projects/IdeaProjects/Projects/Partner/Partner-Main/src/test/java/resources/action/tmp/hello_world.py"));
metaAction.setLocation("/home/slhaf/Projects/IdeaProjects/Projects/Partner/Partner-Main/src/test/java/resources/action/tmp/hello_world.py");
return metaAction;
}
}

View File

@@ -13,7 +13,6 @@ import work.slhaf.partner.core.action.entity.MetaAction;
import work.slhaf.partner.core.action.entity.MetaActionInfo;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;
@@ -86,7 +85,7 @@ public class RunnerClientTest {
}
@Override
public Path buildTmpPath(MetaAction tempAction, String codeType) {
public String buildTmpPath(MetaAction tempAction, String codeType) {
return null;
}