Skip to content

Commit

Permalink
planning-as-a-service as default
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-dolejsi committed Jul 24, 2024
1 parent c9e8eb7 commit 151499c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# PDDL support - What's new?

## 2.28.0

Updated the [solver.planning.domains](https://solver.planning.domains) default planner to the new Planning-as-a-service api.

## 2.27.2

3rd party library updates.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Planning Domain Description Language support",
"author": "Jan Dolejsi",
"license": "MIT",
"version": "2.27.2",
"version": "2.28.0",
"publisher": "jan-dolejsi",
"engines": {
"vscode": "^1.69.0",
Expand Down Expand Up @@ -660,7 +660,7 @@
"scope": "resource",
"type": "string",
"description": "Title field of a planner from the `pddl.planners` setting.",
"default": "https://solver.planning.domains/solve"
"default": "https://solver.planning.domains:5001/package"
},
"pddl.showPlannerInStatusBar": {
"scope": "application",
Expand All @@ -674,16 +674,10 @@
"type": "array",
"markdownDescription": "The PDDL Extension can work with multiple **PDDL Planners**. It has a notion of planner _kind_. The _kind_s are defined by the PDDL Extension, or by other extensions injecting in their _Planner Providers_. For more information, see [Configuring the PDDL planner](https://github.com/jan-dolejsi/vscode-pddl/wiki/Configuring-the-PDDL-planner) wiki page.",
"default": [
{
"kind": "SERVICE_SYNC",
"url": "https://solver.planning.domains/solve",
"title": "https://solver.planning.domains/solve",
"canConfigure": false
},
{
"kind": "PLANNING_AS_A_SERVICE_PREVIEW",
"url": "https://paas-uom.org:5001/package",
"title": "Planning as a service (paas-uom.org:5001)",
"url": "https://solver.planning.domains:5001/package",
"title": "Planning as a service (solver.planning.domains)",
"canConfigure": false
}
],
Expand Down Expand Up @@ -732,7 +726,7 @@
"url": {
"type": "string",
"format": "uri",
"description": "URL of the service e.g. https://solver.planning.domains/solve."
"description": "URL of the service e.g. https://solver.planning.domains:5001/package."
},
"searchDebuggerSupport": {
"type": "string",
Expand Down
17 changes: 12 additions & 5 deletions src/configuration/plannerConfigurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class PlanutilsServerProvider extends LongRunningPlannerProvider {
return new planner.PlannerKind('planutils_server');
}
getNewPlannerLabel(): string {
return "$(package) Planutils server (preview) URL...";
return "$(package) Planutils server URL...";
}

async configurePlanner(previousConfiguration?: planner.PlannerConfiguration): Promise<planner.PlannerConfiguration | undefined> {
Expand Down Expand Up @@ -180,14 +180,14 @@ export class PlanutilsServerProvider extends LongRunningPlannerProvider {

export class PlanningAsAServiceProvider extends LongRunningPlannerProvider {
get kind(): planner.PlannerKind {
return planner.WellKnownPlannerKind.PLANNING_AS_A_SERVICE_PREVIEW;
return planner.WellKnownPlannerKind.PLANNING_AS_A_SERVICE;
}
getNewPlannerLabel(): string {
return "$(package) Planning-as-a-service (preview) URL...";
return "$(package) Planning-as-a-service URL...";
}

async configurePlanner(previousConfiguration?: planner.PlannerConfiguration): Promise<planner.PlannerConfiguration | undefined> {
const existingValue = previousConfiguration?.url ?? "https://paas-uom.org/package";
const existingValue = previousConfiguration?.url ?? "https://your-planning-as-a-service:5001/package";

const existingUri = Uri.parse(existingValue);
const indexOf = existingValue.indexOf(existingUri.authority);
Expand Down Expand Up @@ -264,6 +264,13 @@ export class PlanningAsAServiceProvider extends LongRunningPlannerProvider {
}
}

/** To support user configurations created using the 'preview' planner configuration. */
export class PreviewPlanningAsAServiceProvider extends PlanningAsAServiceProvider {
get kind(): planner.PlannerKind {
return planner.WellKnownPlannerKind.PLANNING_AS_A_SERVICE_PREVIEW;
}
}

export class SolveServicePlannerProvider extends LongRunningPlannerProvider {
get kind(): planner.PlannerKind {
return planner.WellKnownPlannerKind.SERVICE_SYNC;
Expand All @@ -273,7 +280,7 @@ export class SolveServicePlannerProvider extends LongRunningPlannerProvider {
}

async configurePlanner(previousConfiguration?: planner.PlannerConfiguration): Promise<planner.PlannerConfiguration | undefined> {
const existingValue = previousConfiguration?.url ?? "https://solver.planning.domains/solve";
const existingValue = previousConfiguration?.url ?? "https://your-server/solve";

const existingUri = Uri.parse(existingValue);
const indexOf = existingValue.indexOf(existingUri.authority);
Expand Down

0 comments on commit 151499c

Please sign in to comment.