Simplify workspace package builds and deps (#2676)
This commit is contained in:
1 parent
556c42452c
commit
f92e1e1b06
16 files changed
+106
-130
No files matched your search
@@ -16,6 +16,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/shared": "workspace:*",
|
||||
"@t3tools/ssh": "workspace:*",
|
||||
"@t3tools/tailscale": "workspace:*",
|
||||
"effect": "catalog:",
|
||||
"electron": "41.5.0",
|
||||
"electron-updater": "^6.6.2"
|
||||
@@ -23,13 +27,7 @@
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "catalog:",
|
||||
"@effect/vitest": "catalog:",
|
||||
"@t3tools/client-runtime": "workspace:*",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/shared": "workspace:*",
|
||||
"@t3tools/ssh": "workspace:*",
|
||||
"@t3tools/tailscale": "workspace:*",
|
||||
"@types/node": "catalog:",
|
||||
"effect-acp": "workspace:*",
|
||||
"tsdown": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:"
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as NodeOS from "node:os";
|
||||
import {
|
||||
createAdvertisedEndpoint,
|
||||
type CreateAdvertisedEndpointInput,
|
||||
} from "@t3tools/client-runtime";
|
||||
} from "@t3tools/shared/advertisedEndpoint";
|
||||
import type {
|
||||
AdvertisedEndpoint,
|
||||
AdvertisedEndpointProvider,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createAdvertisedEndpoint } from "@t3tools/client-runtime";
|
||||
import { createAdvertisedEndpoint } from "@t3tools/shared/advertisedEndpoint";
|
||||
import type { AdvertisedEndpoint, AdvertisedEndpointProvider } from "@t3tools/contracts";
|
||||
import {
|
||||
buildTailscaleHttpsBaseUrl,
|
||||
|
||||
@@ -12,7 +12,7 @@ export default defineConfig([
|
||||
...shared,
|
||||
entry: ["src/main.ts"],
|
||||
clean: true,
|
||||
noExternal: (id) => id.startsWith("@t3tools/") || id.startsWith("effect-acp"),
|
||||
noExternal: (id) => id.startsWith("@t3tools/"),
|
||||
},
|
||||
{
|
||||
...shared,
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"build:bundle": "tsdown",
|
||||
"start": "node dist/bin.mjs",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest run",
|
||||
"test:process-reaper": "vitest run src/server.test.ts src/provider/Layers/ClaudeAdapter.test.ts src/provider/Layers/ProviderSessionDirectory.test.ts src/provider/Layers/ProviderSessionReaper.test.ts src/provider/Layers/CodexAdapter.test.ts"
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@anthropic-ai/claude-agent-sdk": "^0.2.111",
|
||||
"@effect/platform-bun": "catalog:",
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@effect/platform-node-shared": "catalog:",
|
||||
"@effect/sql-sqlite-bun": "catalog:",
|
||||
"@opencode-ai/sdk": "^1.3.15",
|
||||
"@pierre/diffs": "catalog:",
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import { defineConfig } from "tsdown";
|
||||
|
||||
const internalPackagePrefixes = ["@t3tools/", "effect-acp", "effect-codex-app-server"];
|
||||
|
||||
export default defineConfig({
|
||||
entry: ["src/bin.ts"],
|
||||
format: ["esm", "cjs"],
|
||||
checks: {
|
||||
legacyCjs: false,
|
||||
},
|
||||
outDir: "dist",
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
noExternal: (id) => id.startsWith("@t3tools/") || id.startsWith("effect-acp"),
|
||||
noExternal: (id) => internalPackagePrefixes.some((prefix) => id.startsWith(prefix)),
|
||||
inlineOnly: false,
|
||||
banner: {
|
||||
js: "#!/usr/bin/env node\n",
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
"version": "0.0.23",
|
||||
"dependencies": {
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/shared": "workspace:*",
|
||||
"@t3tools/ssh": "workspace:*",
|
||||
"@t3tools/tailscale": "workspace:*",
|
||||
"effect": "catalog:",
|
||||
"electron": "41.5.0",
|
||||
"electron-updater": "^6.6.2",
|
||||
@@ -27,13 +31,7 @@
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "catalog:",
|
||||
"@effect/vitest": "catalog:",
|
||||
"@t3tools/client-runtime": "workspace:*",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/shared": "workspace:*",
|
||||
"@t3tools/ssh": "workspace:*",
|
||||
"@t3tools/tailscale": "workspace:*",
|
||||
"@types/node": "catalog:",
|
||||
"effect-acp": "workspace:*",
|
||||
"tsdown": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:",
|
||||
@@ -60,6 +58,7 @@
|
||||
"@anthropic-ai/claude-agent-sdk": "^0.2.111",
|
||||
"@effect/platform-bun": "catalog:",
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@effect/platform-node-shared": "catalog:",
|
||||
"@effect/sql-sqlite-bun": "catalog:",
|
||||
"@opencode-ai/sdk": "^1.3.15",
|
||||
"@pierre/diffs": "catalog:",
|
||||
@@ -153,7 +152,6 @@
|
||||
},
|
||||
"packages/client-runtime": {
|
||||
"name": "@t3tools/client-runtime",
|
||||
"version": "0.0.0-alpha.1",
|
||||
"dependencies": {
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"effect": "catalog:",
|
||||
@@ -173,7 +171,6 @@
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "catalog:",
|
||||
"@effect/vitest": "catalog:",
|
||||
"tsdown": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:",
|
||||
},
|
||||
@@ -188,7 +185,6 @@
|
||||
"@effect/openapi-generator": "catalog:",
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@effect/vitest": "catalog:",
|
||||
"tsdown": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:",
|
||||
},
|
||||
@@ -203,14 +199,12 @@
|
||||
"@effect/openapi-generator": "catalog:",
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@effect/vitest": "catalog:",
|
||||
"tsdown": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:",
|
||||
},
|
||||
},
|
||||
"packages/shared": {
|
||||
"name": "@t3tools/shared",
|
||||
"version": "0.0.0-alpha.1",
|
||||
"dependencies": {
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"effect": "catalog:",
|
||||
@@ -226,7 +220,6 @@
|
||||
},
|
||||
"packages/ssh": {
|
||||
"name": "@t3tools/ssh",
|
||||
"version": "0.0.0-alpha.1",
|
||||
"dependencies": {
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/shared": "workspace:*",
|
||||
@@ -243,7 +236,6 @@
|
||||
},
|
||||
"packages/tailscale": {
|
||||
"name": "@t3tools/tailscale",
|
||||
"version": "0.0.0-alpha.1",
|
||||
"dependencies": {
|
||||
"@effect/platform-node": "catalog:",
|
||||
"effect": "catalog:",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "@t3tools/client-runtime",
|
||||
"version": "0.0.0-alpha.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
@@ -15,6 +14,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/shared": "workspace:*",
|
||||
"effect": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,78 +1 @@
|
||||
import type {
|
||||
AdvertisedEndpoint,
|
||||
AdvertisedEndpointHostedHttpsCompatibility,
|
||||
AdvertisedEndpointProvider,
|
||||
AdvertisedEndpointReachability,
|
||||
AdvertisedEndpointSource,
|
||||
AdvertisedEndpointStatus,
|
||||
} from "@t3tools/contracts";
|
||||
|
||||
export interface CreateAdvertisedEndpointInput {
|
||||
readonly id: string;
|
||||
readonly label: string;
|
||||
readonly provider: AdvertisedEndpointProvider;
|
||||
readonly httpBaseUrl: string;
|
||||
readonly reachability: AdvertisedEndpointReachability;
|
||||
readonly hostedHttpsCompatibility?: AdvertisedEndpointHostedHttpsCompatibility;
|
||||
readonly desktopCompatibility?: "compatible" | "unknown";
|
||||
readonly source: AdvertisedEndpointSource;
|
||||
readonly status?: AdvertisedEndpointStatus;
|
||||
readonly isDefault?: boolean;
|
||||
readonly description?: string;
|
||||
}
|
||||
|
||||
export function normalizeHttpBaseUrl(rawValue: string): string {
|
||||
const url = new URL(rawValue);
|
||||
if (url.protocol === "ws:") {
|
||||
url.protocol = "http:";
|
||||
} else if (url.protocol === "wss:") {
|
||||
url.protocol = "https:";
|
||||
}
|
||||
|
||||
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
||||
throw new Error(`Endpoint must use HTTP or HTTPS. Received ${url.protocol}`);
|
||||
}
|
||||
|
||||
url.pathname = "/";
|
||||
url.search = "";
|
||||
url.hash = "";
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
export function deriveWsBaseUrl(httpBaseUrl: string): string {
|
||||
const url = new URL(normalizeHttpBaseUrl(httpBaseUrl));
|
||||
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
export function classifyHostedHttpsCompatibility(
|
||||
httpBaseUrl: string,
|
||||
fallback: AdvertisedEndpointHostedHttpsCompatibility = "unknown",
|
||||
): AdvertisedEndpointHostedHttpsCompatibility {
|
||||
const url = new URL(normalizeHttpBaseUrl(httpBaseUrl));
|
||||
if (url.protocol === "http:") {
|
||||
return "mixed-content-blocked";
|
||||
}
|
||||
return fallback === "mixed-content-blocked" ? "unknown" : fallback;
|
||||
}
|
||||
|
||||
export function createAdvertisedEndpoint(input: CreateAdvertisedEndpointInput): AdvertisedEndpoint {
|
||||
const httpBaseUrl = normalizeHttpBaseUrl(input.httpBaseUrl);
|
||||
return {
|
||||
id: input.id,
|
||||
label: input.label,
|
||||
provider: input.provider,
|
||||
httpBaseUrl,
|
||||
wsBaseUrl: deriveWsBaseUrl(httpBaseUrl),
|
||||
reachability: input.reachability,
|
||||
compatibility: {
|
||||
hostedHttpsApp:
|
||||
input.hostedHttpsCompatibility ?? classifyHostedHttpsCompatibility(httpBaseUrl),
|
||||
desktopApp: input.desktopCompatibility ?? "compatible",
|
||||
},
|
||||
source: input.source,
|
||||
status: input.status ?? "available",
|
||||
...(input.isDefault === undefined ? {} : { isDefault: input.isDefault }),
|
||||
...(input.description === undefined ? {} : { description: input.description }),
|
||||
};
|
||||
}
|
||||
export * from "@t3tools/shared/advertisedEndpoint";
|
||||
@@ -6,24 +6,17 @@
|
||||
"dist"
|
||||
],
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./src/index.ts",
|
||||
"exports": {
|
||||
"./settings": {
|
||||
"types": "./src/settings.ts",
|
||||
"import": "./src/settings.ts",
|
||||
"require": "./src/settings.ts"
|
||||
},
|
||||
".": {
|
||||
"types": "./src/index.ts",
|
||||
"import": "./src/index.ts",
|
||||
"require": "./dist/index.cjs"
|
||||
"import": "./src/index.ts"
|
||||
},
|
||||
"./settings": {
|
||||
"types": "./src/settings.ts",
|
||||
"import": "./src/settings.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "tsdown src/index.ts --format esm,cjs --dts --watch --clean",
|
||||
"build": "tsdown src/index.ts --format esm,cjs --dts --clean",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest run"
|
||||
},
|
||||
@@ -33,7 +26,6 @@
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "catalog:",
|
||||
"@effect/vitest": "catalog:",
|
||||
"tsdown": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:"
|
||||
}
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "tsdown src/client.ts src/agent.ts src/_generated/schema.gen.ts src/rpc.ts src/protocol.ts src/terminal.ts --format esm,cjs --dts --watch --clean",
|
||||
"build": "tsdown src/client.ts src/agent.ts src/_generated/schema.gen.ts src/rpc.ts src/protocol.ts src/terminal.ts --format esm,cjs --dts --clean",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest run",
|
||||
"generate": "bun run scripts/generate.ts"
|
||||
@@ -47,7 +45,6 @@
|
||||
"@effect/openapi-generator": "catalog:",
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@effect/vitest": "catalog:",
|
||||
"tsdown": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:"
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "tsdown src/client.ts src/rpc.ts src/protocol.ts src/schema.ts --format esm,cjs --dts --watch --clean",
|
||||
"build": "tsdown src/client.ts src/rpc.ts src/protocol.ts src/schema.ts --format esm,cjs --dts --clean",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest run",
|
||||
"generate": "bun run scripts/generate.ts",
|
||||
@@ -40,7 +38,6 @@
|
||||
"@effect/openapi-generator": "catalog:",
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@effect/vitest": "catalog:",
|
||||
"tsdown": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "@t3tools/shared",
|
||||
"version": "0.0.0-alpha.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
@@ -8,6 +7,10 @@
|
||||
"types": "./src/model.ts",
|
||||
"import": "./src/model.ts"
|
||||
},
|
||||
"./advertisedEndpoint": {
|
||||
"types": "./src/advertisedEndpoint.ts",
|
||||
"import": "./src/advertisedEndpoint.ts"
|
||||
},
|
||||
"./git": {
|
||||
"types": "./src/git.ts",
|
||||
"import": "./src/git.ts"
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
import type {
|
||||
AdvertisedEndpoint,
|
||||
AdvertisedEndpointHostedHttpsCompatibility,
|
||||
AdvertisedEndpointProvider,
|
||||
AdvertisedEndpointReachability,
|
||||
AdvertisedEndpointSource,
|
||||
AdvertisedEndpointStatus,
|
||||
} from "@t3tools/contracts";
|
||||
|
||||
export interface CreateAdvertisedEndpointInput {
|
||||
readonly id: string;
|
||||
readonly label: string;
|
||||
readonly provider: AdvertisedEndpointProvider;
|
||||
readonly httpBaseUrl: string;
|
||||
readonly reachability: AdvertisedEndpointReachability;
|
||||
readonly hostedHttpsCompatibility?: AdvertisedEndpointHostedHttpsCompatibility;
|
||||
readonly desktopCompatibility?: "compatible" | "unknown";
|
||||
readonly source: AdvertisedEndpointSource;
|
||||
readonly status?: AdvertisedEndpointStatus;
|
||||
readonly isDefault?: boolean;
|
||||
readonly description?: string;
|
||||
}
|
||||
|
||||
export function normalizeHttpBaseUrl(rawValue: string): string {
|
||||
const url = new URL(rawValue);
|
||||
if (url.protocol === "ws:") {
|
||||
url.protocol = "http:";
|
||||
} else if (url.protocol === "wss:") {
|
||||
url.protocol = "https:";
|
||||
}
|
||||
|
||||
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
||||
throw new Error(`Endpoint must use HTTP or HTTPS. Received ${url.protocol}`);
|
||||
}
|
||||
|
||||
url.pathname = "/";
|
||||
url.search = "";
|
||||
url.hash = "";
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
export function deriveWsBaseUrl(httpBaseUrl: string): string {
|
||||
const url = new URL(normalizeHttpBaseUrl(httpBaseUrl));
|
||||
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
export function classifyHostedHttpsCompatibility(
|
||||
httpBaseUrl: string,
|
||||
fallback: AdvertisedEndpointHostedHttpsCompatibility = "unknown",
|
||||
): AdvertisedEndpointHostedHttpsCompatibility {
|
||||
const url = new URL(normalizeHttpBaseUrl(httpBaseUrl));
|
||||
if (url.protocol === "http:") {
|
||||
return "mixed-content-blocked";
|
||||
}
|
||||
return fallback === "mixed-content-blocked" ? "unknown" : fallback;
|
||||
}
|
||||
|
||||
export function createAdvertisedEndpoint(input: CreateAdvertisedEndpointInput): AdvertisedEndpoint {
|
||||
const httpBaseUrl = normalizeHttpBaseUrl(input.httpBaseUrl);
|
||||
return {
|
||||
id: input.id,
|
||||
label: input.label,
|
||||
provider: input.provider,
|
||||
httpBaseUrl,
|
||||
wsBaseUrl: deriveWsBaseUrl(httpBaseUrl),
|
||||
reachability: input.reachability,
|
||||
compatibility: {
|
||||
hostedHttpsApp:
|
||||
input.hostedHttpsCompatibility ?? classifyHostedHttpsCompatibility(httpBaseUrl),
|
||||
desktopApp: input.desktopCompatibility ?? "compatible",
|
||||
},
|
||||
source: input.source,
|
||||
status: input.status ?? "available",
|
||||
...(input.isDefault === undefined ? {} : { isDefault: input.isDefault }),
|
||||
...(input.description === undefined ? {} : { description: input.description }),
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "@t3tools/ssh",
|
||||
"version": "0.0.0-alpha.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "@t3tools/tailscale",
|
||||
"version": "0.0.0-alpha.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
|
||||
Reference in new issue
Block a user