deepspace 0.30.0 → 0.30.2
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/CHANGELOG.md +14 -0
- package/dist/{chunk-DIG45T65.js → chunk-HCV4V2SU.js} +2 -2
- package/dist/{chunk-DIG45T65.js.map → chunk-HCV4V2SU.js.map} +1 -1
- package/dist/cli.js +17 -47
- package/dist/cli.js.map +1 -1
- package/dist/documentation-client-core.js +1 -1
- package/dist/documentation-default-renderer.cjs +1 -1
- package/dist/documentation-react.js +1 -1
- package/dist/documentation-runtime.js +1 -1
- package/dist/documentation-server-core.js +1 -1
- package/dist/documentation.js +1 -1
- package/dist/documentation.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +32 -1
- package/dist/worker.d.ts +57 -8
- package/dist/worker.js +49 -2
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -706,6 +706,9 @@ var INVALID_URLS = {
|
|
|
706
706
|
function appDomainForEnv(env) {
|
|
707
707
|
return env === "production" ? "app.space" : env === "staging" ? "spacestest.com" : null;
|
|
708
708
|
}
|
|
709
|
+
function platformDomainForEnv(env) {
|
|
710
|
+
return env === "production" ? "deep.space" : env === "staging" ? "deepspacesites.com" : null;
|
|
711
|
+
}
|
|
709
712
|
var PLATFORM_URLS = DEEPSPACE_ENV === "production" ? PROD_URLS : DEEPSPACE_ENV === "staging" ? STAGING_URLS : INVALID_URLS;
|
|
710
713
|
var PLANE_URLS = {
|
|
711
714
|
production: PROD_URLS,
|
|
@@ -11230,10 +11233,13 @@ function normalizeAgentTargetOrigin(value, policy) {
|
|
|
11230
11233
|
return policy.allowLoopback && ["http:", "https:"].includes(url.protocol) ? url.origin : null;
|
|
11231
11234
|
}
|
|
11232
11235
|
if (url.protocol !== "https:" || url.port) return null;
|
|
11233
|
-
|
|
11236
|
+
const appDomain = policy.appDomain.toLowerCase();
|
|
11237
|
+
const platformDomain = policy.platformDomain?.toLowerCase();
|
|
11238
|
+
const officialAdminOrigin = platformDomain ? `https://admin.${platformDomain}` : appDomain === PRODUCTION_APP_DOMAIN ? PRODUCTION_OFFICIAL_AGENT_ORIGINS[0] : null;
|
|
11239
|
+
if (url.origin === officialAdminOrigin) {
|
|
11234
11240
|
return url.origin;
|
|
11235
11241
|
}
|
|
11236
|
-
const suffix = `.${
|
|
11242
|
+
const suffix = `.${appDomain}`;
|
|
11237
11243
|
if (!hostname.endsWith(suffix)) return null;
|
|
11238
11244
|
const label = hostname.slice(0, -suffix.length);
|
|
11239
11245
|
return !label.includes(".") && validateAppName(label).valid ? url.origin : null;
|
|
@@ -11297,7 +11303,8 @@ function resolveAgentTarget(app2, plane = DEEPSPACE_ENV) {
|
|
|
11297
11303
|
if (typeof app2 !== "string" || !app2)
|
|
11298
11304
|
badApp("App must be a canonical app name or canonical app URL.");
|
|
11299
11305
|
const appDomain = appDomainForEnv(plane);
|
|
11300
|
-
|
|
11306
|
+
const platformDomain = platformDomainForEnv(plane);
|
|
11307
|
+
if (!appDomain || !platformDomain) badApp("The selected DeepSpace environment is invalid.");
|
|
11301
11308
|
if (app2.toLowerCase() === "localhost") {
|
|
11302
11309
|
badApp("Pass an explicit loopback URL for local development (e.g. 'http://localhost:8787').");
|
|
11303
11310
|
}
|
|
@@ -11306,6 +11313,7 @@ function resolveAgentTarget(app2, plane = DEEPSPACE_ENV) {
|
|
|
11306
11313
|
}
|
|
11307
11314
|
const url = normalizeAgentTargetOrigin(app2, {
|
|
11308
11315
|
appDomain,
|
|
11316
|
+
platformDomain,
|
|
11309
11317
|
allowLoopback: true
|
|
11310
11318
|
});
|
|
11311
11319
|
if (!url) {
|
|
@@ -13904,24 +13912,6 @@ async function loadWorkspaceLines(appDir, token, api4, trunkOid) {
|
|
|
13904
13912
|
return /* @__PURE__ */ new Map();
|
|
13905
13913
|
}
|
|
13906
13914
|
}
|
|
13907
|
-
async function listOverlaps(appId, token, api4, views) {
|
|
13908
|
-
const appDir = findAppDir();
|
|
13909
|
-
if (!appDir || readAppId(appDir) !== appId) return /* @__PURE__ */ new Map();
|
|
13910
|
-
try {
|
|
13911
|
-
assertSyncableRepo(appDir);
|
|
13912
|
-
ensureSpaceRemote(appDir, appId);
|
|
13913
|
-
const refs = await api4.getRefs().catch(() => null);
|
|
13914
|
-
try {
|
|
13915
|
-
fetchTrunk(appDir, token, refs?.head ?? null);
|
|
13916
|
-
} catch {
|
|
13917
|
-
}
|
|
13918
|
-
fetchPeerWorkspaceRefs(appDir, token);
|
|
13919
|
-
const lines = changedPathsByWorkspace(appDir, views, localTrunkOid(appDir, refs));
|
|
13920
|
-
return new Map([...lines].map(([id, line]) => [id, overlapsWith(line.paths, lines, id)]));
|
|
13921
|
-
} catch {
|
|
13922
|
-
return /* @__PURE__ */ new Map();
|
|
13923
|
-
}
|
|
13924
|
-
}
|
|
13925
13915
|
function printOverlaps(overlaps, json) {
|
|
13926
13916
|
if (json) return;
|
|
13927
13917
|
for (const overlap of overlaps) {
|
|
@@ -14869,12 +14859,6 @@ var syncWorkspaceCommand = defineDeepspaceCommand({
|
|
|
14869
14859
|
|
|
14870
14860
|
// src/cli/commands/workspace/list.ts
|
|
14871
14861
|
import * as p28 from "@clack/prompts";
|
|
14872
|
-
function withWorkspaceOverlaps(views, overlapsById) {
|
|
14873
|
-
return views.map((view) => ({
|
|
14874
|
-
...view,
|
|
14875
|
-
overlaps: overlapsById.get(view.workspace.id) ?? []
|
|
14876
|
-
}));
|
|
14877
|
-
}
|
|
14878
14862
|
var listWorkspacesCommand = defineDeepspaceCommand({
|
|
14879
14863
|
meta: { name: "list", description: "List workspaces on the cloud repo" },
|
|
14880
14864
|
args: {
|
|
@@ -14901,31 +14885,17 @@ var listWorkspacesCommand = defineDeepspaceCommand({
|
|
|
14901
14885
|
}
|
|
14902
14886
|
return { data: { workspaces: views, truncated: truncated === true } };
|
|
14903
14887
|
}
|
|
14904
|
-
spinner2?.message("Checking workspace overlaps\u2026");
|
|
14905
|
-
const overlapsPromise = listOverlaps(appId, token, api4, views);
|
|
14906
14888
|
if (args.json) {
|
|
14907
|
-
return {
|
|
14908
|
-
data: {
|
|
14909
|
-
workspaces: withWorkspaceOverlaps(views, await overlapsPromise),
|
|
14910
|
-
truncated: truncated === true
|
|
14911
|
-
}
|
|
14912
|
-
};
|
|
14889
|
+
return { data: { workspaces: views, truncated: truncated === true } };
|
|
14913
14890
|
}
|
|
14914
|
-
const
|
|
14915
|
-
const workspaces = withWorkspaceOverlaps(views, overlapsById);
|
|
14891
|
+
const actors = await actorLabels(token, appId);
|
|
14916
14892
|
spinner2?.stop(`Loaded ${views.length} ${views.length === 1 ? "workspace" : "workspaces"}.`);
|
|
14917
|
-
for (const view of
|
|
14893
|
+
for (const view of views) {
|
|
14918
14894
|
const workspace = view.workspace;
|
|
14919
|
-
const
|
|
14920
|
-
const marker = workspace.status === "active" ? overlaps.length > 0 ? "\u26A0" : " " : workspace.status === "landed" ? "\u2713" : "\u2717";
|
|
14895
|
+
const marker = workspace.status === "active" ? " " : workspace.status === "landed" ? "\u2713" : "\u2717";
|
|
14921
14896
|
console.log(
|
|
14922
14897
|
`${marker} ${workspace.id} ${workspace.status} \u2191${formatCount(view.aheadOfBase)} \u2193${formatCount(view.behindTrunk)} ${actors.get(workspace.createdBy) ?? workspace.createdBy} ${workspace.updatedAt} ${workspace.task}`
|
|
14923
14898
|
);
|
|
14924
|
-
for (const overlap of overlaps) {
|
|
14925
|
-
console.log(
|
|
14926
|
-
` overlaps ${overlap.workspaceId}: ${overlap.paths.slice(0, 3).join(", ")}${overlap.paths.length + overlap.morePaths > 3 ? ` (+${overlap.paths.length + overlap.morePaths - 3} more)` : ""}`
|
|
14927
|
-
);
|
|
14928
|
-
}
|
|
14929
14899
|
}
|
|
14930
14900
|
if (truncated) {
|
|
14931
14901
|
p28.log.warn(
|
|
@@ -14933,7 +14903,7 @@ var listWorkspacesCommand = defineDeepspaceCommand({
|
|
|
14933
14903
|
);
|
|
14934
14904
|
}
|
|
14935
14905
|
p28.log.info("\u2191 commits ahead of base \xB7 \u2193 trunk commits since base (staleness)");
|
|
14936
|
-
return { data: { workspaces, truncated: truncated === true } };
|
|
14906
|
+
return { data: { workspaces: views, truncated: truncated === true } };
|
|
14937
14907
|
}
|
|
14938
14908
|
});
|
|
14939
14909
|
|
|
@@ -16021,7 +15991,7 @@ import { join as join28, resolve as resolve22 } from "path";
|
|
|
16021
15991
|
// package.json
|
|
16022
15992
|
var package_default = {
|
|
16023
15993
|
name: "deepspace",
|
|
16024
|
-
version: "0.30.
|
|
15994
|
+
version: "0.30.2",
|
|
16025
15995
|
engines: {
|
|
16026
15996
|
node: ">=22.15.0 <23 || >=24 <25 || >=26 <27"
|
|
16027
15997
|
},
|