@acryldev/launcher-desktop 0.1.2 → 0.1.3
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/lib/client.js +63 -4
- package/lib/client.js.map +1 -1
- package/lib/index.js +14 -3
- package/lib/index.js.map +1 -1
- package/lib/page.js +12 -12
- package/lib/types/contract.d.ts +6 -0
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
2
2
|
import { basename, dirname, join } from "node:path";
|
|
3
|
-
import { APP_MARKER, APP_NAME, STARTERS, addApp, appNameProblem, blendOf, blendVersionOf, clearGithub, githubClientId, githubEnv, inspectApp, maskKey, modelEnv, pollGithubSignIn, prepareTools, readApps, readGithub, readModelKey, removeApp, setBlendVisibility, startGithubSignIn, toolsEnv, whereProblem } from "@acryldev/launcher";
|
|
3
|
+
import { APP_MARKER, APP_NAME, STARTERS, addApp, appNameProblem, blendOf, blendVersionOf, clearGithub, githubClientId, githubEnv, githubOf, inspectApp, maskKey, modelEnv, pollGithubSignIn, prepareTools, readApps, readGithub, readModelKey, removeApp, setBlendVisibility, startGithubSignIn, toolsEnv, whereProblem } from "@acryldev/launcher";
|
|
4
4
|
import { defineAcrylTool } from "@acryldev/control";
|
|
5
5
|
import { Acryl } from "@acryldev/blends";
|
|
6
6
|
import { error } from "@acryldev/loopback-http";
|
|
@@ -39,7 +39,16 @@ const SURFACES = [
|
|
|
39
39
|
];
|
|
40
40
|
/** Surfaces a person can choose for a new app today. */
|
|
41
41
|
const MAKEABLE_SURFACES = ["web", "desktop"];
|
|
42
|
+
/** WebBoxes.ai's New WebBox form, opened with the app's repository filled in (the person signs in and presses Create there). */
|
|
43
|
+
function webboxesDeployUrl(github, name) {
|
|
44
|
+
const url = new URL(WEBBOXES_NEW_BOX);
|
|
45
|
+
url.searchParams.set("github", github);
|
|
46
|
+
url.searchParams.set("name", name.toLowerCase().replace(/[^a-z0-9-]+/gu, "-").replace(/^-+|-+$/gu, "").slice(0, 40));
|
|
47
|
+
return url.href;
|
|
48
|
+
}
|
|
42
49
|
/** A Blend id as `acryl new --from` takes it: it starts with a letter or digit, so it can never read as an option. */
|
|
50
|
+
/** The New WebBox page of webboxes.ai, which takes `github` and `name` to fill its form. */
|
|
51
|
+
const WEBBOXES_NEW_BOX = "https://webboxes.ai/dashboard/webboxes/new";
|
|
43
52
|
const BLEND_ID = /^[a-z0-9][a-z0-9._-]{0,127}$/u;
|
|
44
53
|
/** A Blend released on GitHub, as `--from` takes it (create-acrylblends `github:owner/repo#ref`): what a community Blend is made from. */
|
|
45
54
|
const BLEND_SOURCE = /^github:[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}(?:#[A-Za-z0-9._/-]{1,100})?$/u;
|
|
@@ -588,6 +597,7 @@ var LauncherService = class {
|
|
|
588
597
|
const blend = entry.blend === "" ? blendOf(entry.path) : entry.blend;
|
|
589
598
|
const version = missing ? "" : blendVersionOf(entry.path);
|
|
590
599
|
const latest = this.#blends?.list.find((listed) => listed.id === blend)?.version;
|
|
600
|
+
const github = missing ? void 0 : githubOf(entry.path);
|
|
591
601
|
return {
|
|
592
602
|
id: entry.id,
|
|
593
603
|
name: basename(entry.path),
|
|
@@ -600,7 +610,8 @@ var LauncherService = class {
|
|
|
600
610
|
...version !== "" && latest !== void 0 && newerVersion(latest, version) ? { update: latest } : {},
|
|
601
611
|
...started?.address === void 0 ? {} : { address: started.address },
|
|
602
612
|
...started === void 0 || started.address !== void 0 || started.output === "" ? {} : { output: started.output.trimEnd() },
|
|
603
|
-
...failure === void 0 || state !== "stopped" ? {} : { failure }
|
|
613
|
+
...failure === void 0 || state !== "stopped" ? {} : { failure },
|
|
614
|
+
...github === void 0 ? {} : { github }
|
|
604
615
|
};
|
|
605
616
|
}
|
|
606
617
|
add(path) {
|
|
@@ -1435,6 +1446,6 @@ function apply(ctx) {
|
|
|
1435
1446
|
ctx.routerHttp.mount(LAUNCHER_API_PREFIX);
|
|
1436
1447
|
}
|
|
1437
1448
|
//#endregion
|
|
1438
|
-
export { ACCOUNT_NAME, BLEND_ID, BLEND_SOURCE, LAUNCHER_ADD_PATH, LAUNCHER_ADE_PATH, LAUNCHER_API_PREFIX, LAUNCHER_ASSISTANT_FOLDER_PATH, LAUNCHER_BLENDS_PATH, LAUNCHER_GITHUB_DISCONNECT_PATH, LAUNCHER_GITHUB_PATH, LAUNCHER_GITHUB_POLL_PATH, LAUNCHER_GITHUB_START_PATH, LAUNCHER_HEALTH_PATH, LAUNCHER_NEW_PATH, LAUNCHER_PLUGINS_PATH, LAUNCHER_PLUGIN_PULL_PATH, LAUNCHER_PUBLISH_PATH, LAUNCHER_PUBLISH_PLAN_PATH, LAUNCHER_REMOVE_PATH, LAUNCHER_SHARE_PATH, LAUNCHER_SHARE_PLAN_PATH, LAUNCHER_START_PATH, LAUNCHER_STATE_PATH, LAUNCHER_STOP_PATH, LAUNCHER_UPDATE_PATH, LICENSE_ID, LauncherRefusal, LauncherService, MAKEABLE_SURFACES, PLUGIN_NAME, SURFACES, apply, inject, name };
|
|
1449
|
+
export { ACCOUNT_NAME, BLEND_ID, BLEND_SOURCE, LAUNCHER_ADD_PATH, LAUNCHER_ADE_PATH, LAUNCHER_API_PREFIX, LAUNCHER_ASSISTANT_FOLDER_PATH, LAUNCHER_BLENDS_PATH, LAUNCHER_GITHUB_DISCONNECT_PATH, LAUNCHER_GITHUB_PATH, LAUNCHER_GITHUB_POLL_PATH, LAUNCHER_GITHUB_START_PATH, LAUNCHER_HEALTH_PATH, LAUNCHER_NEW_PATH, LAUNCHER_PLUGINS_PATH, LAUNCHER_PLUGIN_PULL_PATH, LAUNCHER_PUBLISH_PATH, LAUNCHER_PUBLISH_PLAN_PATH, LAUNCHER_REMOVE_PATH, LAUNCHER_SHARE_PATH, LAUNCHER_SHARE_PLAN_PATH, LAUNCHER_START_PATH, LAUNCHER_STATE_PATH, LAUNCHER_STOP_PATH, LAUNCHER_UPDATE_PATH, LICENSE_ID, LauncherRefusal, LauncherService, MAKEABLE_SURFACES, PLUGIN_NAME, SURFACES, WEBBOXES_NEW_BOX, apply, inject, name, webboxesDeployUrl };
|
|
1439
1450
|
|
|
1440
1451
|
//# sourceMappingURL=index.js.map
|