Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51dbea28c2 |
No files matched your search
+1
-3
@@ -15,8 +15,6 @@
|
||||
"perf": "warn"
|
||||
},
|
||||
"rules": {
|
||||
"react-in-jsx-scope": "off",
|
||||
"eslint/no-shadow": "off",
|
||||
"eslint/no-await-in-loop": "off"
|
||||
"react-in-jsx-scope": "off"
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { execFileSync } from "node:child_process";
|
||||
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import {
|
||||
ApprovalRequestId,
|
||||
type OrchestrationEvent,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ProviderRuntimeEvent, ProviderSessionId } from "@t3tools/contracts";
|
||||
import { ThreadId } from "@t3tools/contracts";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { it, assert } from "@effect/vitest";
|
||||
import { Effect, FileSystem, Layer, Path, Queue, Stream } from "effect";
|
||||
|
||||
|
||||
@@ -18,17 +18,17 @@
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@effect/sql-sqlite-bun": "catalog:",
|
||||
"@effect/platform-node": "4.0.0-beta.10",
|
||||
"@effect/sql-sqlite-bun": "4.0.0-beta.10",
|
||||
"@pierre/diffs": "^1.1.0-beta.16",
|
||||
"effect": "catalog:",
|
||||
"effect": "4.0.0-beta.10",
|
||||
"node-pty": "^1.1.0",
|
||||
"open": "^10.1.0",
|
||||
"ws": "^8.18.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "0.75.1",
|
||||
"@effect/vitest": "catalog:",
|
||||
"@effect/vitest": "4.0.0-beta.10",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/web": "workspace:*",
|
||||
"@types/bun": "^1.3.9",
|
||||
|
||||
@@ -46,4 +46,4 @@ export interface CheckpointDiffQueryShape {
|
||||
export class CheckpointDiffQuery extends ServiceMap.Service<
|
||||
CheckpointDiffQuery,
|
||||
CheckpointDiffQueryShape
|
||||
>()("t3/checkpointing/Services/CheckpointDiffQuery") {}
|
||||
>()("checkpointing/CheckpointDiffQuery") {}
|
||||
@@ -96,5 +96,5 @@ export interface CheckpointStoreShape {
|
||||
* CheckpointStore - Service tag for checkpoint persistence and restore operations.
|
||||
*/
|
||||
export class CheckpointStore extends ServiceMap.Service<CheckpointStore, CheckpointStoreShape>()(
|
||||
"t3/checkpointing/Services/CheckpointStore",
|
||||
"checkpointing/CheckpointStore",
|
||||
) {}
|
||||
@@ -35,7 +35,7 @@ export interface ServerConfigShape {
|
||||
* ServerConfig - Service tag for server runtime configuration.
|
||||
*/
|
||||
export class ServerConfig extends ServiceMap.Service<ServerConfig, ServerConfigShape>()(
|
||||
"t3/config/ServerConfig",
|
||||
"server/ServerConfig",
|
||||
) {}
|
||||
|
||||
// Helpers
|
||||
@@ -61,7 +61,7 @@ export interface NetServiceShape {
|
||||
* NetService - Service tag for startup networking helpers.
|
||||
*/
|
||||
export class NetService extends ServiceMap.Service<NetService, NetServiceShape>()(
|
||||
"t3/config/NetService",
|
||||
"server/NetService",
|
||||
) {
|
||||
static readonly layer = Layer.succeed(NetService, {
|
||||
findAvailablePort: (preferred) =>
|
||||
@@ -102,18 +102,18 @@ export class NetService extends ServiceMap.Service<NetService, NetServiceShape>(
|
||||
|
||||
export const resolveStaticDir = Effect.fn(function* () {
|
||||
const { join, resolve } = yield* Path.Path;
|
||||
const { exists } = yield* FileSystem.FileSystem;
|
||||
const { stat } = yield* FileSystem.FileSystem;
|
||||
const bundledClient = resolve(join(import.meta.dirname, "client"));
|
||||
const bundledStat = yield* exists(join(bundledClient, "index.html")).pipe(
|
||||
Effect.orElseSucceed(() => false),
|
||||
const bundledStat = yield* stat(join(bundledClient, "index.html")).pipe(
|
||||
Effect.orElseSucceed(() => undefined),
|
||||
);
|
||||
if (bundledStat) {
|
||||
return bundledClient;
|
||||
}
|
||||
|
||||
const monorepoClient = resolve(join(import.meta.dirname, "../../web/dist"));
|
||||
const monorepoStat = yield* exists(join(monorepoClient, "index.html")).pipe(
|
||||
Effect.orElseSucceed(() => false),
|
||||
const monorepoStat = yield* stat(join(monorepoClient, "index.html")).pipe(
|
||||
Effect.orElseSucceed(() => undefined),
|
||||
);
|
||||
if (monorepoStat) {
|
||||
return monorepoClient;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { it } from "@effect/vitest";
|
||||
import { Effect, FileSystem, Layer, Path } from "effect";
|
||||
import { expect } from "vitest";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { existsSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { it } from "@effect/vitest";
|
||||
import { Effect, FileSystem, Layer, PlatformError, Scope } from "effect";
|
||||
import { describe, expect, vi } from "vitest";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { it } from "@effect/vitest";
|
||||
import { Effect, FileSystem, Layer, PlatformError, Scope } from "effect";
|
||||
import { expect } from "vitest";
|
||||
|
||||
@@ -29,7 +29,10 @@ function limitContext(value: string, maxChars: number): string {
|
||||
return `${value.slice(0, maxChars)}\n\n[truncated]`;
|
||||
}
|
||||
|
||||
function sanitizeCommitMessage(generated: { subject: string; body: string }): {
|
||||
function sanitizeCommitMessage(generated: {
|
||||
subject: string;
|
||||
body: string;
|
||||
}): {
|
||||
subject: string;
|
||||
body: string;
|
||||
} {
|
||||
@@ -158,14 +161,12 @@ export const makeGitManager = Effect.gen(function* () {
|
||||
|
||||
let generated = parseCustomCommitMessage(commitMessage ?? "");
|
||||
if (!generated) {
|
||||
generated = yield* textGeneration
|
||||
.generateCommitMessage({
|
||||
cwd,
|
||||
branch,
|
||||
stagedSummary: limitContext(context.stagedSummary, 8_000),
|
||||
stagedPatch: limitContext(context.stagedPatch, 50_000),
|
||||
})
|
||||
.pipe(Effect.map((result) => sanitizeCommitMessage(result)));
|
||||
generated = yield* textGeneration.generateCommitMessage({
|
||||
cwd,
|
||||
branch,
|
||||
stagedSummary: limitContext(context.stagedSummary, 8_000),
|
||||
stagedPatch: limitContext(context.stagedPatch, 50_000),
|
||||
}).pipe(Effect.map((result) => sanitizeCommitMessage(result)));
|
||||
}
|
||||
|
||||
const { commitSha } = yield* gitCore.commit(cwd, generated.subject, generated.body);
|
||||
@@ -181,10 +182,7 @@ export const makeGitManager = Effect.gen(function* () {
|
||||
const details = yield* gitCore.statusDetails(cwd);
|
||||
const branch = details.branch ?? fallbackBranch;
|
||||
if (!branch) {
|
||||
return yield* gitManagerError(
|
||||
"runPrStep",
|
||||
"Cannot create a pull request from detached HEAD.",
|
||||
);
|
||||
return yield* gitManagerError("runPrStep", "Cannot create a pull request from detached HEAD.");
|
||||
}
|
||||
if (!details.hasUpstream) {
|
||||
return yield* gitManagerError(
|
||||
@@ -222,7 +220,11 @@ export const makeGitManager = Effect.gen(function* () {
|
||||
.writeFileString(bodyFile, generated.body)
|
||||
.pipe(
|
||||
Effect.mapError((cause) =>
|
||||
gitManagerError("runPrStep", "Failed to write pull request body temp file.", cause),
|
||||
gitManagerError(
|
||||
"runPrStep",
|
||||
"Failed to write pull request body temp file.",
|
||||
cause,
|
||||
),
|
||||
),
|
||||
);
|
||||
yield* gitHubCli
|
||||
@@ -277,40 +279,35 @@ export const makeGitManager = Effect.gen(function* () {
|
||||
};
|
||||
});
|
||||
|
||||
const runStackedAction: GitManagerShape["runStackedAction"] = Effect.fnUntraced(
|
||||
function* (input) {
|
||||
const wantsPush = input.action !== "commit";
|
||||
const wantsPr = input.action === "commit_push_pr";
|
||||
const runStackedAction: GitManagerShape["runStackedAction"] = Effect.fnUntraced(function* (input) {
|
||||
const wantsPush = input.action !== "commit";
|
||||
const wantsPr = input.action === "commit_push_pr";
|
||||
|
||||
const initialStatus = yield* gitCore.statusDetails(input.cwd);
|
||||
if (wantsPush && !initialStatus.branch) {
|
||||
return yield* gitManagerError("runStackedAction", "Cannot push from detached HEAD.");
|
||||
}
|
||||
if (wantsPr && !initialStatus.branch) {
|
||||
return yield* gitManagerError(
|
||||
"runStackedAction",
|
||||
"Cannot create a pull request from detached HEAD.",
|
||||
);
|
||||
}
|
||||
const initialStatus = yield* gitCore.statusDetails(input.cwd);
|
||||
if (wantsPush && !initialStatus.branch) {
|
||||
return yield* gitManagerError("runStackedAction", "Cannot push from detached HEAD.");
|
||||
}
|
||||
if (wantsPr && !initialStatus.branch) {
|
||||
return yield* gitManagerError("runStackedAction", "Cannot create a pull request from detached HEAD.");
|
||||
}
|
||||
|
||||
const commit = yield* runCommitStep(input.cwd, initialStatus.branch, input.commitMessage);
|
||||
const commit = yield* runCommitStep(input.cwd, initialStatus.branch, input.commitMessage);
|
||||
|
||||
const push = wantsPush
|
||||
? yield* gitCore.pushCurrentBranch(input.cwd, initialStatus.branch)
|
||||
: { status: "skipped_not_requested" as const };
|
||||
const push = wantsPush
|
||||
? yield* gitCore.pushCurrentBranch(input.cwd, initialStatus.branch)
|
||||
: { status: "skipped_not_requested" as const };
|
||||
|
||||
const pr = wantsPr
|
||||
? yield* runPrStep(input.cwd, initialStatus.branch)
|
||||
: { status: "skipped_not_requested" as const };
|
||||
const pr = wantsPr
|
||||
? yield* runPrStep(input.cwd, initialStatus.branch)
|
||||
: { status: "skipped_not_requested" as const };
|
||||
|
||||
return {
|
||||
action: input.action,
|
||||
commit,
|
||||
push,
|
||||
pr,
|
||||
};
|
||||
},
|
||||
);
|
||||
return {
|
||||
action: input.action,
|
||||
commit,
|
||||
push,
|
||||
pr,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
status,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { it, assert } from "@effect/vitest";
|
||||
import { Effect, Layer } from "effect";
|
||||
|
||||
|
||||
@@ -143,6 +143,4 @@ export interface GitCoreShape {
|
||||
/**
|
||||
* GitCore - Service tag for low-level Git repository operations.
|
||||
*/
|
||||
export class GitCore extends ServiceMap.Service<GitCore, GitCoreShape>()(
|
||||
"t3/git/Services/GitCore",
|
||||
) {}
|
||||
export class GitCore extends ServiceMap.Service<GitCore, GitCoreShape>()("git/GitCore") {}
|
||||
@@ -63,6 +63,4 @@ export interface GitHubCliShape {
|
||||
/**
|
||||
* GitHubCli - Service tag for GitHub CLI process execution.
|
||||
*/
|
||||
export class GitHubCli extends ServiceMap.Service<GitHubCli, GitHubCliShape>()(
|
||||
"t3/git/Services/GitHubCli",
|
||||
) {}
|
||||
export class GitHubCli extends ServiceMap.Service<GitHubCli, GitHubCliShape>()("git/GitHubCli") {}
|
||||
@@ -23,9 +23,7 @@ export interface GitManagerShape {
|
||||
/**
|
||||
* Read current repository Git status plus open PR metadata when available.
|
||||
*/
|
||||
readonly status: (
|
||||
input: GitStatusInput,
|
||||
) => Effect.Effect<GitStatusResult, GitManagerServiceError>;
|
||||
readonly status: (input: GitStatusInput) => Effect.Effect<GitStatusResult, GitManagerServiceError>;
|
||||
|
||||
/**
|
||||
* Run a stacked Git action (`commit`, `commit_push`, `commit_push_pr`).
|
||||
@@ -39,5 +37,5 @@ export interface GitManagerShape {
|
||||
* GitManager - Service tag for stacked Git workflow orchestration.
|
||||
*/
|
||||
export class GitManager extends ServiceMap.Service<GitManager, GitManagerShape>()(
|
||||
"t3/git/Services/GitManager",
|
||||
"git/GitManager",
|
||||
) {}
|
||||
@@ -41,5 +41,5 @@ export interface GitServiceShape {
|
||||
* GitService - Service for Git command execution.
|
||||
*/
|
||||
export class GitService extends ServiceMap.Service<GitService, GitServiceShape>()(
|
||||
"t3/git/Services/GitService",
|
||||
"git/GitService",
|
||||
) {}
|
||||
@@ -67,5 +67,5 @@ export interface TextGenerationShape {
|
||||
* TextGeneration - Service tag for commit and PR text generation.
|
||||
*/
|
||||
export class TextGeneration extends ServiceMap.Service<TextGeneration, TextGenerationShape>()(
|
||||
"t3/git/Services/TextGeneration",
|
||||
"git/TextGeneration",
|
||||
) {}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { KeybindingCommand, KeybindingRule, KeybindingsConfig } from "@t3tools/contracts";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { assert, it } from "@effect/vitest";
|
||||
import { assertFailure } from "@effect/vitest/utils";
|
||||
import { Effect, FileSystem, Layer, Logger, Path, Schema } from "effect";
|
||||
@@ -178,10 +178,7 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
|
||||
return yield* keybindings.loadConfigState;
|
||||
});
|
||||
|
||||
assert.deepEqual(
|
||||
configState.keybindings,
|
||||
compileResolvedKeybindingsConfig(DEFAULT_KEYBINDINGS),
|
||||
);
|
||||
assert.deepEqual(configState.keybindings, compileResolvedKeybindingsConfig(DEFAULT_KEYBINDINGS));
|
||||
assert.deepEqual(configState.issues, [
|
||||
{
|
||||
kind: "keybindings.malformed-config",
|
||||
@@ -211,24 +208,10 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
|
||||
});
|
||||
|
||||
assert.isTrue(configState.keybindings.some((entry) => entry.command === "terminal.toggle"));
|
||||
assert.isFalse(
|
||||
configState.keybindings.some(
|
||||
(entry) =>
|
||||
// @ts-expect-error - invalid command
|
||||
entry.command === "invalid.command",
|
||||
),
|
||||
);
|
||||
assert.isFalse(configState.keybindings.some((entry) => entry.command === "invalid.command"));
|
||||
assert.deepEqual(configState.issues, [
|
||||
{
|
||||
kind: "keybindings.invalid-entry",
|
||||
index: 1,
|
||||
message: configState.issues[0]?.message ?? "",
|
||||
},
|
||||
{
|
||||
kind: "keybindings.invalid-entry",
|
||||
index: 2,
|
||||
message: configState.issues[1]?.message ?? "",
|
||||
},
|
||||
{ kind: "keybindings.invalid-entry", index: 1, message: configState.issues[0]?.message ?? "" },
|
||||
{ kind: "keybindings.invalid-entry", index: 2, message: configState.issues[1]?.message ?? "" },
|
||||
]);
|
||||
}).pipe(Effect.provide(makeKeybindingsLayer())),
|
||||
);
|
||||
|
||||
@@ -498,7 +498,7 @@ export interface KeybindingsShape {
|
||||
* Keybindings - Service tag for keybinding configuration operations.
|
||||
*/
|
||||
export class Keybindings extends ServiceMap.Service<Keybindings, KeybindingsShape>()(
|
||||
"t3/keybindings",
|
||||
"server/Keybindings",
|
||||
) {}
|
||||
|
||||
const makeKeybindings = Effect.gen(function* () {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as Http from "node:http";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { assert, it, vi } from "@effect/vitest";
|
||||
import * as ConfigProvider from "effect/ConfigProvider";
|
||||
import * as Effect from "effect/Effect";
|
||||
|
||||
@@ -63,9 +63,7 @@ export interface CliConfigShape {
|
||||
/**
|
||||
* CliConfig - Service tag for startup CLI/runtime helpers.
|
||||
*/
|
||||
export class CliConfig extends ServiceMap.Service<CliConfig, CliConfigShape>()(
|
||||
"t3/main/CliConfig",
|
||||
) {
|
||||
export class CliConfig extends ServiceMap.Service<CliConfig, CliConfigShape>()("server/CliConfig") {
|
||||
static readonly layer = Layer.effect(
|
||||
CliConfig,
|
||||
Effect.gen(function* () {
|
||||
|
||||
@@ -18,28 +18,6 @@ describe("resolveEditorLaunch", () => {
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("uses --goto when cursor target includes line/column suffixes", () =>
|
||||
Effect.gen(function* () {
|
||||
const lineOnly = yield* resolveEditorLaunch(
|
||||
{ cwd: "/tmp/workspace/AGENTS.md:48", editor: "cursor" },
|
||||
"darwin",
|
||||
);
|
||||
assert.deepEqual(lineOnly, {
|
||||
command: "cursor",
|
||||
args: ["--goto", "/tmp/workspace/AGENTS.md:48"],
|
||||
});
|
||||
|
||||
const lineAndColumn = yield* resolveEditorLaunch(
|
||||
{ cwd: "/tmp/workspace/src/open.ts:71:5", editor: "cursor" },
|
||||
"darwin",
|
||||
);
|
||||
assert.deepEqual(lineAndColumn, {
|
||||
command: "cursor",
|
||||
args: ["--goto", "/tmp/workspace/src/open.ts:71:5"],
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("maps file-manager editor to OS open commands", () =>
|
||||
Effect.gen(function* () {
|
||||
const launch1 = yield* resolveEditorLaunch(
|
||||
|
||||
+2
-10
@@ -30,12 +30,6 @@ interface EditorLaunch {
|
||||
readonly args: ReadonlyArray<string>;
|
||||
}
|
||||
|
||||
const LINE_COLUMN_SUFFIX_PATTERN = /:\d+(?::\d+)?$/;
|
||||
|
||||
function shouldUseGotoFlag(editorId: EditorId, target: string): boolean {
|
||||
return editorId === "cursor" && LINE_COLUMN_SUFFIX_PATTERN.test(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* OpenShape - Service API for browser and editor launch actions.
|
||||
*/
|
||||
@@ -56,7 +50,7 @@ export interface OpenShape {
|
||||
/**
|
||||
* Open - Service tag for browser/editor launch operations.
|
||||
*/
|
||||
export class Open extends ServiceMap.Service<Open, OpenShape>()("t3/open") {}
|
||||
export class Open extends ServiceMap.Service<Open, OpenShape>()("server/Open") {}
|
||||
|
||||
// ==============================
|
||||
// Implementations
|
||||
@@ -72,9 +66,7 @@ export const resolveEditorLaunch = Effect.fnUntraced(function* (
|
||||
}
|
||||
|
||||
if (editorDef.command) {
|
||||
return shouldUseGotoFlag(editorDef.id, input.cwd)
|
||||
? { command: editorDef.command, args: ["--goto", input.cwd] }
|
||||
: { command: editorDef.command, args: [input.cwd] };
|
||||
return { command: editorDef.command, args: [input.cwd] };
|
||||
}
|
||||
|
||||
if (editorDef.id !== "file-manager") {
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
ThreadId,
|
||||
TurnId,
|
||||
} from "@t3tools/contracts";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { Effect, Exit, Layer, ManagedRuntime, PubSub, Scope, Stream } from "effect";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
|
||||
@@ -561,9 +561,7 @@ describe("OrchestrationEngine", () => {
|
||||
).rejects.toThrow("projection failed");
|
||||
|
||||
const readModelAfterFailure = await runtime.runPromise(engine.getReadModel());
|
||||
const updatedThread = readModelAfterFailure.threads.find(
|
||||
(thread) => thread.id === "thread-sync",
|
||||
);
|
||||
const updatedThread = readModelAfterFailure.threads.find((thread) => thread.id === "thread-sync");
|
||||
expect(readModelAfterFailure.snapshotSequence).toBe(3);
|
||||
expect(updatedThread?.title).toBe("sync-after-failed-projection");
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {
|
||||
ThreadId,
|
||||
} from "@t3tools/contracts";
|
||||
import { OrchestrationCommand } from "@t3tools/contracts";
|
||||
import { Deferred, Effect, Layer, Option, PubSub, Queue, Schema, Stream } from "effect";
|
||||
import { Deferred, Effect, Layer, Option, PubSub, Queue, Stream } from "effect";
|
||||
import * as SqlClient from "effect/unstable/sql/SqlClient";
|
||||
|
||||
import { toPersistenceSqlError } from "../../persistence/Errors.ts";
|
||||
@@ -181,7 +181,7 @@ const makeOrchestrationEngine = Effect.gen(function* () {
|
||||
),
|
||||
);
|
||||
|
||||
if (Schema.is(OrchestrationCommandInvariantError)(error)) {
|
||||
if (error instanceof OrchestrationCommandInvariantError) {
|
||||
const aggregateRef = commandToAggregateRef(envelope.command);
|
||||
yield* commandReceiptRepository
|
||||
.upsert({
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
ThreadId,
|
||||
TurnId,
|
||||
} from "@t3tools/contracts";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { assert, it } from "@effect/vitest";
|
||||
import { Effect, Layer } from "effect";
|
||||
import fs from "node:fs";
|
||||
@@ -412,127 +412,125 @@ projectionLayer("OrchestrationProjectionPipeline", (it) => {
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect(
|
||||
"resolves turn-count conflicts when checkpoint completion rewrites provisional turns",
|
||||
() =>
|
||||
Effect.gen(function* () {
|
||||
const projectionPipeline = yield* OrchestrationProjectionPipeline;
|
||||
const eventStore = yield* OrchestrationEventStore;
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
const appendAndProject = (event: Parameters<typeof eventStore.append>[0]) =>
|
||||
eventStore
|
||||
.append(event)
|
||||
.pipe(Effect.flatMap((savedEvent) => projectionPipeline.projectEvent(savedEvent)));
|
||||
it.effect("resolves turn-count conflicts when checkpoint completion rewrites provisional turns", () =>
|
||||
Effect.gen(function* () {
|
||||
const projectionPipeline = yield* OrchestrationProjectionPipeline;
|
||||
const eventStore = yield* OrchestrationEventStore;
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
const appendAndProject = (event: Parameters<typeof eventStore.append>[0]) =>
|
||||
eventStore
|
||||
.append(event)
|
||||
.pipe(Effect.flatMap((savedEvent) => projectionPipeline.projectEvent(savedEvent)));
|
||||
|
||||
yield* appendAndProject({
|
||||
type: "project.created",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-1"),
|
||||
aggregateKind: "project",
|
||||
aggregateId: ProjectId.makeUnsafe("project-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:00.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-1"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-1"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
projectId: ProjectId.makeUnsafe("project-conflict"),
|
||||
title: "Project Conflict",
|
||||
workspaceRoot: "/tmp/project-conflict",
|
||||
defaultModel: null,
|
||||
scripts: [],
|
||||
createdAt: "2026-02-26T13:00:00.000Z",
|
||||
updatedAt: "2026-02-26T13:00:00.000Z",
|
||||
},
|
||||
});
|
||||
yield* appendAndProject({
|
||||
type: "project.created",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-1"),
|
||||
aggregateKind: "project",
|
||||
aggregateId: ProjectId.makeUnsafe("project-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:00.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-1"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-1"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
projectId: ProjectId.makeUnsafe("project-conflict"),
|
||||
title: "Project Conflict",
|
||||
workspaceRoot: "/tmp/project-conflict",
|
||||
defaultModel: null,
|
||||
scripts: [],
|
||||
createdAt: "2026-02-26T13:00:00.000Z",
|
||||
updatedAt: "2026-02-26T13:00:00.000Z",
|
||||
},
|
||||
});
|
||||
|
||||
yield* appendAndProject({
|
||||
type: "thread.created",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-2"),
|
||||
aggregateKind: "thread",
|
||||
aggregateId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:01.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-2"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-2"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
threadId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
projectId: ProjectId.makeUnsafe("project-conflict"),
|
||||
title: "Thread Conflict",
|
||||
model: "gpt-5-codex",
|
||||
branch: null,
|
||||
worktreePath: null,
|
||||
createdAt: "2026-02-26T13:00:01.000Z",
|
||||
updatedAt: "2026-02-26T13:00:01.000Z",
|
||||
},
|
||||
});
|
||||
yield* appendAndProject({
|
||||
type: "thread.created",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-2"),
|
||||
aggregateKind: "thread",
|
||||
aggregateId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:01.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-2"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-2"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
threadId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
projectId: ProjectId.makeUnsafe("project-conflict"),
|
||||
title: "Thread Conflict",
|
||||
model: "gpt-5-codex",
|
||||
branch: null,
|
||||
worktreePath: null,
|
||||
createdAt: "2026-02-26T13:00:01.000Z",
|
||||
updatedAt: "2026-02-26T13:00:01.000Z",
|
||||
},
|
||||
});
|
||||
|
||||
yield* appendAndProject({
|
||||
type: "thread.turn-interrupt-requested",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-3"),
|
||||
aggregateKind: "thread",
|
||||
aggregateId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:02.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-3"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-3"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
threadId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
turnId: TurnId.makeUnsafe("turn-interrupted"),
|
||||
createdAt: "2026-02-26T13:00:02.000Z",
|
||||
},
|
||||
});
|
||||
yield* appendAndProject({
|
||||
type: "thread.turn-interrupt-requested",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-3"),
|
||||
aggregateKind: "thread",
|
||||
aggregateId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:02.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-3"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-3"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
threadId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
turnId: TurnId.makeUnsafe("turn-interrupted"),
|
||||
createdAt: "2026-02-26T13:00:02.000Z",
|
||||
},
|
||||
});
|
||||
|
||||
yield* appendAndProject({
|
||||
type: "thread.message-sent",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-4"),
|
||||
aggregateKind: "thread",
|
||||
aggregateId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:03.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-4"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-4"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
threadId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
messageId: MessageId.makeUnsafe("assistant-conflict"),
|
||||
role: "assistant",
|
||||
text: "done",
|
||||
turnId: TurnId.makeUnsafe("turn-completed"),
|
||||
streaming: false,
|
||||
createdAt: "2026-02-26T13:00:03.000Z",
|
||||
updatedAt: "2026-02-26T13:00:03.000Z",
|
||||
},
|
||||
});
|
||||
yield* appendAndProject({
|
||||
type: "thread.message-sent",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-4"),
|
||||
aggregateKind: "thread",
|
||||
aggregateId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:03.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-4"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-4"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
threadId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
messageId: MessageId.makeUnsafe("assistant-conflict"),
|
||||
role: "assistant",
|
||||
text: "done",
|
||||
turnId: TurnId.makeUnsafe("turn-completed"),
|
||||
streaming: false,
|
||||
createdAt: "2026-02-26T13:00:03.000Z",
|
||||
updatedAt: "2026-02-26T13:00:03.000Z",
|
||||
},
|
||||
});
|
||||
|
||||
yield* appendAndProject({
|
||||
type: "thread.turn-diff-completed",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-5"),
|
||||
aggregateKind: "thread",
|
||||
aggregateId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:04.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-5"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-5"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
threadId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
turnId: TurnId.makeUnsafe("turn-completed"),
|
||||
checkpointTurnCount: 1,
|
||||
checkpointRef: CheckpointRef.makeUnsafe("refs/t3/checkpoints/thread-conflict/turn/1"),
|
||||
status: "ready",
|
||||
files: [],
|
||||
assistantMessageId: MessageId.makeUnsafe("assistant-conflict"),
|
||||
completedAt: "2026-02-26T13:00:04.000Z",
|
||||
},
|
||||
});
|
||||
yield* appendAndProject({
|
||||
type: "thread.turn-diff-completed",
|
||||
eventId: EventId.makeUnsafe("evt-conflict-5"),
|
||||
aggregateKind: "thread",
|
||||
aggregateId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
occurredAt: "2026-02-26T13:00:04.000Z",
|
||||
commandId: CommandId.makeUnsafe("cmd-conflict-5"),
|
||||
causationEventId: null,
|
||||
correlationId: CorrelationId.makeUnsafe("cmd-conflict-5"),
|
||||
metadata: {},
|
||||
payload: {
|
||||
threadId: ThreadId.makeUnsafe("thread-conflict"),
|
||||
turnId: TurnId.makeUnsafe("turn-completed"),
|
||||
checkpointTurnCount: 1,
|
||||
checkpointRef: CheckpointRef.makeUnsafe("refs/t3/checkpoints/thread-conflict/turn/1"),
|
||||
status: "ready",
|
||||
files: [],
|
||||
assistantMessageId: MessageId.makeUnsafe("assistant-conflict"),
|
||||
completedAt: "2026-02-26T13:00:04.000Z",
|
||||
},
|
||||
});
|
||||
|
||||
const turnRows = yield* sql<{
|
||||
readonly turnId: string;
|
||||
readonly checkpointTurnCount: number | null;
|
||||
readonly status: string;
|
||||
}>`
|
||||
const turnRows = yield* sql<{
|
||||
readonly turnId: string;
|
||||
readonly checkpointTurnCount: number | null;
|
||||
readonly status: string;
|
||||
}>`
|
||||
SELECT
|
||||
turn_id AS "turnId",
|
||||
checkpoint_turn_count AS "checkpointTurnCount",
|
||||
@@ -547,11 +545,11 @@ projectionLayer("OrchestrationProjectionPipeline", (it) => {
|
||||
checkpoint_turn_count ASC,
|
||||
requested_at ASC
|
||||
`;
|
||||
assert.deepEqual(turnRows, [
|
||||
{ turnId: "turn-completed", checkpointTurnCount: 1, status: "completed" },
|
||||
{ turnId: "turn-interrupted", checkpointTurnCount: null, status: "interrupted" },
|
||||
]);
|
||||
}),
|
||||
assert.deepEqual(turnRows, [
|
||||
{ turnId: "turn-completed", checkpointTurnCount: 1, status: "completed" },
|
||||
{ turnId: "turn-interrupted", checkpointTurnCount: null, status: "interrupted" },
|
||||
]);
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("does not fallback-retain messages whose turnId is removed by revert", () =>
|
||||
@@ -755,6 +753,7 @@ projectionLayer("OrchestrationProjectionPipeline", (it) => {
|
||||
]);
|
||||
}),
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
it.effect("restores pending turn-start metadata across projection pipeline restart", () =>
|
||||
|
||||
@@ -14,10 +14,7 @@ import {
|
||||
ProjectionThreadMessageRepository,
|
||||
} from "../../persistence/Services/ProjectionThreadMessages.ts";
|
||||
import { ProjectionThreadSessionRepository } from "../../persistence/Services/ProjectionThreadSessions.ts";
|
||||
import {
|
||||
type ProjectionTurn,
|
||||
ProjectionTurnRepository,
|
||||
} from "../../persistence/Services/ProjectionTurns.ts";
|
||||
import { type ProjectionTurn, ProjectionTurnRepository } from "../../persistence/Services/ProjectionTurns.ts";
|
||||
import { ProjectionThreadRepository } from "../../persistence/Services/ProjectionThreads.ts";
|
||||
import { ProjectionPendingApprovalRepositoryLive } from "../../persistence/Layers/ProjectionPendingApprovals.ts";
|
||||
import { ProjectionProjectRepositoryLive } from "../../persistence/Layers/ProjectionProjects.ts";
|
||||
@@ -67,10 +64,7 @@ function retainProjectionMessagesAfterRevert(
|
||||
const retainedMessageIds = new Set<string>();
|
||||
const retainedTurnIds = new Set<string>();
|
||||
const keptTurns = turns.filter(
|
||||
(turn) =>
|
||||
turn.turnId !== null &&
|
||||
turn.checkpointTurnCount !== null &&
|
||||
turn.checkpointTurnCount <= turnCount,
|
||||
(turn) => turn.turnId !== null && turn.checkpointTurnCount !== null && turn.checkpointTurnCount <= turnCount,
|
||||
);
|
||||
for (const turn of keptTurns) {
|
||||
if (turn.turnId !== null) {
|
||||
@@ -517,22 +511,16 @@ const makeOrchestrationProjectionPipeline = Effect.gen(function* () {
|
||||
(Option.isSome(pendingTurnStart) ? pendingTurnStart.value.messageId : null),
|
||||
startedAt:
|
||||
existingTurn.value.startedAt ??
|
||||
(Option.isSome(pendingTurnStart)
|
||||
? pendingTurnStart.value.requestedAt
|
||||
: event.occurredAt),
|
||||
(Option.isSome(pendingTurnStart) ? pendingTurnStart.value.requestedAt : event.occurredAt),
|
||||
requestedAt:
|
||||
existingTurn.value.requestedAt ??
|
||||
(Option.isSome(pendingTurnStart)
|
||||
? pendingTurnStart.value.requestedAt
|
||||
: event.occurredAt),
|
||||
(Option.isSome(pendingTurnStart) ? pendingTurnStart.value.requestedAt : event.occurredAt),
|
||||
});
|
||||
} else {
|
||||
yield* projectionTurnRepository.upsertByTurnId({
|
||||
turnId,
|
||||
threadId: event.payload.threadId,
|
||||
pendingMessageId: Option.isSome(pendingTurnStart)
|
||||
? pendingTurnStart.value.messageId
|
||||
: null,
|
||||
pendingMessageId: Option.isSome(pendingTurnStart) ? pendingTurnStart.value.messageId : null,
|
||||
assistantMessageId: null,
|
||||
state: "running",
|
||||
requestedAt: Option.isSome(pendingTurnStart)
|
||||
|
||||
@@ -149,11 +149,14 @@ const make = Effect.gen(function* () {
|
||||
projects: readModel.projects,
|
||||
});
|
||||
|
||||
const startedSession = yield* providerService.startSession(threadId, {
|
||||
...(preferredProvider ? { provider: preferredProvider } : {}),
|
||||
...(effectiveCwd ? { cwd: effectiveCwd } : {}),
|
||||
...(thread.model ? { model: thread.model } : {}),
|
||||
});
|
||||
const startedSession = yield* providerService.startSession(
|
||||
threadId,
|
||||
{
|
||||
...(preferredProvider ? { provider: preferredProvider } : {}),
|
||||
...(effectiveCwd ? { cwd: effectiveCwd } : {}),
|
||||
...(thread.model ? { model: thread.model } : {}),
|
||||
},
|
||||
);
|
||||
|
||||
yield* setThreadSession({
|
||||
threadId,
|
||||
|
||||
@@ -274,8 +274,7 @@ describe("ProviderRuntimeIngestion", () => {
|
||||
await waitForThread(
|
||||
harness.engine,
|
||||
(thread) =>
|
||||
thread.session?.status === "running" &&
|
||||
thread.session?.activeTurnId === "turn-complete-dedup",
|
||||
thread.session?.status === "running" && thread.session?.activeTurnId === "turn-complete-dedup",
|
||||
);
|
||||
|
||||
harness.emit({
|
||||
@@ -318,17 +317,14 @@ describe("ProviderRuntimeIngestion", () => {
|
||||
);
|
||||
|
||||
const events = await Effect.runPromise(
|
||||
Stream.runCollect(harness.engine.readEvents(0)).pipe(
|
||||
Effect.map((chunk) => Array.from(chunk)),
|
||||
),
|
||||
Stream.runCollect(harness.engine.readEvents(0)).pipe(Effect.map((chunk) => Array.from(chunk))),
|
||||
);
|
||||
const completionEvents = events.filter((event) => {
|
||||
if (event.type !== "thread.message-sent") {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
event.payload.messageId === "assistant:item-complete-dedup" &&
|
||||
event.payload.streaming === false
|
||||
event.payload.messageId === "assistant:item-complete-dedup" && event.payload.streaming === false
|
||||
);
|
||||
});
|
||||
expect(completionEvents).toHaveLength(1);
|
||||
|
||||
@@ -31,4 +31,4 @@ export interface CheckpointReactorShape {
|
||||
export class CheckpointReactor extends ServiceMap.Service<
|
||||
CheckpointReactor,
|
||||
CheckpointReactorShape
|
||||
>()("t3/orchestration/Services/CheckpointReactor") {}
|
||||
>()("orchestration/CheckpointReactor") {}
|
||||
@@ -77,4 +77,4 @@ export interface OrchestrationEngineShape {
|
||||
export class OrchestrationEngineService extends ServiceMap.Service<
|
||||
OrchestrationEngineService,
|
||||
OrchestrationEngineShape
|
||||
>()("t3/orchestration/Services/OrchestrationEngine/OrchestrationEngineService") {}
|
||||
>()("orchestration/Engine") {}
|
||||
@@ -28,4 +28,4 @@ export interface OrchestrationReactorShape {
|
||||
export class OrchestrationReactor extends ServiceMap.Service<
|
||||
OrchestrationReactor,
|
||||
OrchestrationReactorShape
|
||||
>()("t3/orchestration/Services/OrchestrationReactor") {}
|
||||
>()("orchestration/OrchestrationReactor") {}
|
||||
@@ -39,4 +39,4 @@ export interface OrchestrationProjectionPipelineShape {
|
||||
export class OrchestrationProjectionPipeline extends ServiceMap.Service<
|
||||
OrchestrationProjectionPipeline,
|
||||
OrchestrationProjectionPipelineShape
|
||||
>()("t3/orchestration/Services/ProjectionPipeline/OrchestrationProjectionPipeline") {}
|
||||
>()("orchestration/ProjectionPipeline") {}
|
||||
@@ -31,4 +31,4 @@ export interface ProjectionSnapshotQueryShape {
|
||||
export class ProjectionSnapshotQuery extends ServiceMap.Service<
|
||||
ProjectionSnapshotQuery,
|
||||
ProjectionSnapshotQueryShape
|
||||
>()("t3/orchestration/Services/ProjectionSnapshotQuery") {}
|
||||
>()("orchestration/ProjectionSnapshotQuery") {}
|
||||
@@ -31,4 +31,4 @@ export interface ProviderCommandReactorShape {
|
||||
export class ProviderCommandReactor extends ServiceMap.Service<
|
||||
ProviderCommandReactor,
|
||||
ProviderCommandReactorShape
|
||||
>()("t3/orchestration/Services/ProviderCommandReactor") {}
|
||||
>()("orchestration/ProviderCommandReactor") {}
|
||||
@@ -31,4 +31,4 @@ export interface ProviderRuntimeIngestionShape {
|
||||
export class ProviderRuntimeIngestionService extends ServiceMap.Service<
|
||||
ProviderRuntimeIngestionService,
|
||||
ProviderRuntimeIngestionShape
|
||||
>()("t3/orchestration/Services/ProviderRuntimeIngestion/ProviderRuntimeIngestionService") {}
|
||||
>()("orchestration/ProviderRuntimeIngestion") {}
|
||||
@@ -702,9 +702,7 @@ describe("orchestration projector", () => {
|
||||
},
|
||||
}),
|
||||
);
|
||||
const afterMessages = await messageEvents.reduce<
|
||||
Promise<ReturnType<typeof createEmptyReadModel>>
|
||||
>(
|
||||
const afterMessages = await messageEvents.reduce<Promise<ReturnType<typeof createEmptyReadModel>>>(
|
||||
(statePromise, event) =>
|
||||
statePromise.then((state) => Effect.runPromise(projectEvent(state, event))),
|
||||
Promise.resolve(afterCreate),
|
||||
@@ -732,9 +730,7 @@ describe("orchestration projector", () => {
|
||||
},
|
||||
}),
|
||||
);
|
||||
const finalState = await checkpointEvents.reduce<
|
||||
Promise<ReturnType<typeof createEmptyReadModel>>
|
||||
>(
|
||||
const finalState = await checkpointEvents.reduce<Promise<ReturnType<typeof createEmptyReadModel>>>(
|
||||
(statePromise, event) =>
|
||||
statePromise.then((state) => Effect.runPromise(projectEvent(state, event))),
|
||||
Promise.resolve(afterMessages),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CommandId, EventId, ProjectId } from "@t3tools/contracts";
|
||||
import { assert, it } from "@effect/vitest";
|
||||
import { Effect, Layer, Schema, Stream } from "effect";
|
||||
import { Effect, Layer, Stream } from "effect";
|
||||
import * as SqlClient from "effect/unstable/sql/SqlClient";
|
||||
|
||||
import { PersistenceDecodeError } from "../Errors.ts";
|
||||
@@ -107,7 +107,7 @@ layer("OrchestrationEventStore", (it) => {
|
||||
);
|
||||
assert.equal(replayResult._tag, "Failure");
|
||||
if (replayResult._tag === "Failure") {
|
||||
assert.ok(Schema.is(PersistenceDecodeError)(replayResult.failure));
|
||||
assert.ok(replayResult.failure instanceof PersistenceDecodeError);
|
||||
assert.ok(
|
||||
replayResult.failure.operation.includes(
|
||||
"OrchestrationEventStore.readFromSequence:decodeRows",
|
||||
|
||||
@@ -260,21 +260,23 @@ const makeProjectionTurnRepository = Effect.gen(function* () {
|
||||
),
|
||||
);
|
||||
|
||||
const getPendingTurnStartByThreadId: ProjectionTurnRepositoryShape["getPendingTurnStartByThreadId"] =
|
||||
(input) =>
|
||||
getPendingProjectionTurn(input).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("ProjectionTurnRepository.getPendingTurnStartByThreadId:query"),
|
||||
),
|
||||
);
|
||||
const getPendingTurnStartByThreadId: ProjectionTurnRepositoryShape["getPendingTurnStartByThreadId"] = (
|
||||
input,
|
||||
) =>
|
||||
getPendingProjectionTurn(input).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("ProjectionTurnRepository.getPendingTurnStartByThreadId:query"),
|
||||
),
|
||||
);
|
||||
|
||||
const deletePendingTurnStartByThreadId: ProjectionTurnRepositoryShape["deletePendingTurnStartByThreadId"] =
|
||||
(input) =>
|
||||
clearPendingProjectionTurnsByThread(input).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("ProjectionTurnRepository.deletePendingTurnStartByThreadId:query"),
|
||||
),
|
||||
);
|
||||
const deletePendingTurnStartByThreadId: ProjectionTurnRepositoryShape["deletePendingTurnStartByThreadId"] = (
|
||||
input,
|
||||
) =>
|
||||
clearPendingProjectionTurnsByThread(input).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("ProjectionTurnRepository.deletePendingTurnStartByThreadId:query"),
|
||||
),
|
||||
);
|
||||
|
||||
const listByThreadId: ProjectionTurnRepositoryShape["listByThreadId"] = (input) =>
|
||||
listProjectionTurnsByThread(input).pipe(
|
||||
@@ -304,13 +306,12 @@ const makeProjectionTurnRepository = Effect.gen(function* () {
|
||||
),
|
||||
);
|
||||
|
||||
const clearCheckpointTurnConflict: ProjectionTurnRepositoryShape["clearCheckpointTurnConflict"] =
|
||||
(input) =>
|
||||
clearCheckpointTurnConflictRow(input).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("ProjectionTurnRepository.clearCheckpointTurnConflict:query"),
|
||||
),
|
||||
);
|
||||
const clearCheckpointTurnConflict: ProjectionTurnRepositoryShape["clearCheckpointTurnConflict"] = (
|
||||
input,
|
||||
) =>
|
||||
clearCheckpointTurnConflictRow(input).pipe(
|
||||
Effect.mapError(toPersistenceSqlError("ProjectionTurnRepository.clearCheckpointTurnConflict:query")),
|
||||
);
|
||||
|
||||
const deleteByThreadId: ProjectionTurnRepositoryShape["deleteByThreadId"] = (input) =>
|
||||
deleteProjectionTurnsByThread(input).pipe(
|
||||
|
||||
@@ -51,10 +51,14 @@ function toValidationError(
|
||||
});
|
||||
}
|
||||
|
||||
function decodeInput<S extends Schema.Top>(schema: S, input: unknown, operation: string) {
|
||||
function decodeInput<A>(
|
||||
schema: Schema.Schema<A>,
|
||||
input: unknown,
|
||||
operation: string,
|
||||
): Effect.Effect<A, ProviderSessionRepositoryValidationError> {
|
||||
return Schema.decodeUnknownEffect(schema)(input).pipe(
|
||||
Effect.mapError((cause) => toValidationError(operation, cause)),
|
||||
);
|
||||
) as Effect.Effect<A, ProviderSessionRepositoryValidationError>;
|
||||
}
|
||||
|
||||
function toPersistenceError(
|
||||
|
||||
@@ -32,7 +32,7 @@ export type TypeId = "~local/sqlite-node/SqliteClient";
|
||||
/**
|
||||
* SqliteClient - Effect service tag for the sqlite SQL client.
|
||||
*/
|
||||
export const SqliteClient = ServiceMap.Service<Client.SqlClient>("t3/persistence/NodeSqliteClient");
|
||||
export const SqliteClient = ServiceMap.Service<Client.SqlClient>("@local/sqlite-node/SqliteClient");
|
||||
|
||||
export interface SqliteClientConfig {
|
||||
readonly filename: string;
|
||||
|
||||
@@ -66,4 +66,4 @@ export interface OrchestrationCommandReceiptRepositoryShape {
|
||||
export class OrchestrationCommandReceiptRepository extends ServiceMap.Service<
|
||||
OrchestrationCommandReceiptRepository,
|
||||
OrchestrationCommandReceiptRepositoryShape
|
||||
>()("t3/persistence/Services/OrchestrationCommandReceipts/OrchestrationCommandReceiptRepository") {}
|
||||
>()("persistence/OrchestrationCommandReceiptRepository") {}
|
||||
@@ -67,4 +67,4 @@ export interface OrchestrationEventStoreShape {
|
||||
export class OrchestrationEventStore extends ServiceMap.Service<
|
||||
OrchestrationEventStore,
|
||||
OrchestrationEventStoreShape
|
||||
>()("t3/persistence/Services/OrchestrationEventStore") {}
|
||||
>()("orchestration/EventStore") {}
|
||||
@@ -90,4 +90,4 @@ export interface ProjectionCheckpointRepositoryShape {
|
||||
export class ProjectionCheckpointRepository extends ServiceMap.Service<
|
||||
ProjectionCheckpointRepository,
|
||||
ProjectionCheckpointRepositoryShape
|
||||
>()("t3/persistence/Services/ProjectionCheckpoints/ProjectionCheckpointRepository") {}
|
||||
>()("persistence/ProjectionCheckpointRepository") {}
|
||||
@@ -88,4 +88,4 @@ export interface ProjectionPendingApprovalRepositoryShape {
|
||||
export class ProjectionPendingApprovalRepository extends ServiceMap.Service<
|
||||
ProjectionPendingApprovalRepository,
|
||||
ProjectionPendingApprovalRepositoryShape
|
||||
>()("t3/persistence/Services/ProjectionPendingApprovals/ProjectionPendingApprovalRepository") {}
|
||||
>()("persistence/ProjectionPendingApprovalRepository") {}
|
||||
@@ -76,4 +76,4 @@ export interface ProjectionProjectRepositoryShape {
|
||||
export class ProjectionProjectRepository extends ServiceMap.Service<
|
||||
ProjectionProjectRepository,
|
||||
ProjectionProjectRepositoryShape
|
||||
>()("t3/persistence/Services/ProjectionProjects/ProjectionProjectRepository") {}
|
||||
>()("persistence/ProjectionProjectRepository") {}
|
||||
@@ -61,4 +61,4 @@ export interface ProjectionStateRepositoryShape {
|
||||
export class ProjectionStateRepository extends ServiceMap.Service<
|
||||
ProjectionStateRepository,
|
||||
ProjectionStateRepositoryShape
|
||||
>()("t3/persistence/Services/ProjectionState/ProjectionStateRepository") {}
|
||||
>()("persistence/ProjectionStateRepository") {}
|
||||
@@ -77,4 +77,4 @@ export interface ProjectionThreadActivityRepositoryShape {
|
||||
export class ProjectionThreadActivityRepository extends ServiceMap.Service<
|
||||
ProjectionThreadActivityRepository,
|
||||
ProjectionThreadActivityRepositoryShape
|
||||
>()("t3/persistence/Services/ProjectionThreadActivities/ProjectionThreadActivityRepository") {}
|
||||
>()("persistence/ProjectionThreadActivityRepository") {}
|
||||
@@ -76,4 +76,4 @@ export interface ProjectionThreadMessageRepositoryShape {
|
||||
export class ProjectionThreadMessageRepository extends ServiceMap.Service<
|
||||
ProjectionThreadMessageRepository,
|
||||
ProjectionThreadMessageRepositoryShape
|
||||
>()("t3/persistence/Services/ProjectionThreadMessages/ProjectionThreadMessageRepository") {}
|
||||
>()("persistence/ProjectionThreadMessageRepository") {}
|
||||
@@ -73,4 +73,4 @@ export interface ProjectionThreadSessionRepositoryShape {
|
||||
export class ProjectionThreadSessionRepository extends ServiceMap.Service<
|
||||
ProjectionThreadSessionRepository,
|
||||
ProjectionThreadSessionRepositoryShape
|
||||
>()("t3/persistence/Services/ProjectionThreadSessions/ProjectionThreadSessionRepository") {}
|
||||
>()("persistence/ProjectionThreadSessionRepository") {}
|
||||
@@ -82,4 +82,4 @@ export interface ProjectionThreadRepositoryShape {
|
||||
export class ProjectionThreadRepository extends ServiceMap.Service<
|
||||
ProjectionThreadRepository,
|
||||
ProjectionThreadRepositoryShape
|
||||
>()("t3/persistence/Services/ProjectionThreads/ProjectionThreadRepository") {}
|
||||
>()("persistence/ProjectionThreadRepository") {}
|
||||
@@ -158,4 +158,4 @@ export interface ProjectionTurnRepositoryShape {
|
||||
export class ProjectionTurnRepository extends ServiceMap.Service<
|
||||
ProjectionTurnRepository,
|
||||
ProjectionTurnRepositoryShape
|
||||
>()("t3/persistence/Services/ProjectionTurns/ProjectionTurnRepository") {}
|
||||
>()("persistence/ProjectionTurnRepository") {}
|
||||
@@ -84,4 +84,4 @@ export interface ProviderSessionRuntimeRepositoryShape {
|
||||
export class ProviderSessionRuntimeRepository extends ServiceMap.Service<
|
||||
ProviderSessionRuntimeRepository,
|
||||
ProviderSessionRuntimeRepositoryShape
|
||||
>()("t3/persistence/Services/ProviderSessionRuntime/ProviderSessionRuntimeRepository") {}
|
||||
>()("persistence/ProviderSessionRuntimeRepository") {}
|
||||
@@ -78,4 +78,4 @@ export interface ProviderSessionRepositoryShape {
|
||||
export class ProviderSessionRepository extends ServiceMap.Service<
|
||||
ProviderSessionRepository,
|
||||
ProviderSessionRepositoryShape
|
||||
>()("t3/persistence/Services/ProviderSessions/ProviderSessionRepository") {}
|
||||
>()("persistence/ProviderSessionRepository") {}
|
||||
@@ -8,7 +8,7 @@ import { CodexAdapter, CodexAdapterShape } from "../Services/CodexAdapter.ts";
|
||||
import { ProviderAdapterRegistry } from "../Services/ProviderAdapterRegistry.ts";
|
||||
import { ProviderAdapterRegistryLive } from "./ProviderAdapterRegistry.ts";
|
||||
import { ProviderUnsupportedError } from "../Errors.ts";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
|
||||
const fakeCodexAdapter: CodexAdapterShape = {
|
||||
provider: "codex",
|
||||
|
||||
@@ -37,7 +37,7 @@ import { ProviderService } from "../Services/ProviderService.ts";
|
||||
import { ProviderSessionDirectory } from "../Services/ProviderSessionDirectory.ts";
|
||||
import { makeProviderServiceLive } from "./ProviderService.ts";
|
||||
import { ProviderSessionDirectoryLive } from "./ProviderSessionDirectory.ts";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { ProviderSessionRuntimeRepositoryLive } from "../../persistence/Layers/ProviderSessionRuntime.ts";
|
||||
import { ProviderSessionRuntimeRepository } from "../../persistence/Services/ProviderSessionRuntime.ts";
|
||||
import {
|
||||
@@ -323,10 +323,13 @@ it.effect(
|
||||
|
||||
const startedSession = yield* Effect.gen(function* () {
|
||||
const provider = yield* ProviderService;
|
||||
return yield* provider.startSession(asThreadId("thread-1"), {
|
||||
provider: "codex",
|
||||
cwd: "/tmp/project",
|
||||
});
|
||||
return yield* provider.startSession(
|
||||
asThreadId("thread-1"),
|
||||
{
|
||||
provider: "codex",
|
||||
cwd: "/tmp/project",
|
||||
},
|
||||
);
|
||||
}).pipe(Effect.provide(firstProviderLayer));
|
||||
|
||||
yield* Effect.gen(function* () {
|
||||
@@ -395,10 +398,13 @@ routing.layer("ProviderServiceLive routing", (it) => {
|
||||
Effect.gen(function* () {
|
||||
const provider = yield* ProviderService;
|
||||
|
||||
const session = yield* provider.startSession(asThreadId("thread-1"), {
|
||||
provider: "codex",
|
||||
cwd: "/tmp/project",
|
||||
});
|
||||
const session = yield* provider.startSession(
|
||||
asThreadId("thread-1"),
|
||||
{
|
||||
provider: "codex",
|
||||
cwd: "/tmp/project",
|
||||
},
|
||||
);
|
||||
assert.equal(session.provider, "codex");
|
||||
|
||||
const sessions = yield* provider.listSessions();
|
||||
@@ -447,10 +453,13 @@ routing.layer("ProviderServiceLive routing", (it) => {
|
||||
Effect.gen(function* () {
|
||||
const provider = yield* ProviderService;
|
||||
|
||||
const initial = yield* provider.startSession(asThreadId("thread-1"), {
|
||||
provider: "codex",
|
||||
cwd: "/tmp/project",
|
||||
});
|
||||
const initial = yield* provider.startSession(
|
||||
asThreadId("thread-1"),
|
||||
{
|
||||
provider: "codex",
|
||||
cwd: "/tmp/project",
|
||||
},
|
||||
);
|
||||
yield* routing.codex.stopSession(initial.sessionId);
|
||||
routing.codex.startSession.mockClear();
|
||||
routing.codex.rollbackThread.mockClear();
|
||||
@@ -478,12 +487,18 @@ routing.layer("ProviderServiceLive routing", (it) => {
|
||||
Effect.gen(function* () {
|
||||
const provider = yield* ProviderService;
|
||||
|
||||
yield* provider.startSession(asThreadId("thread-1"), {
|
||||
provider: "codex",
|
||||
});
|
||||
yield* provider.startSession(asThreadId("thread-2"), {
|
||||
provider: "codex",
|
||||
});
|
||||
yield* provider.startSession(
|
||||
asThreadId("thread-1"),
|
||||
{
|
||||
provider: "codex",
|
||||
},
|
||||
);
|
||||
yield* provider.startSession(
|
||||
asThreadId("thread-2"),
|
||||
{
|
||||
provider: "codex",
|
||||
},
|
||||
);
|
||||
|
||||
yield* provider.stopAll();
|
||||
|
||||
@@ -497,9 +512,12 @@ routing.layer("ProviderServiceLive routing", (it) => {
|
||||
const provider = yield* ProviderService;
|
||||
const runtimeRepository = yield* ProviderSessionRuntimeRepository;
|
||||
|
||||
const session = yield* provider.startSession(asThreadId("thread-1"), {
|
||||
provider: "codex",
|
||||
});
|
||||
const session = yield* provider.startSession(
|
||||
asThreadId("thread-1"),
|
||||
{
|
||||
provider: "codex",
|
||||
},
|
||||
);
|
||||
yield* provider.sendTurn({
|
||||
sessionId: session.sessionId,
|
||||
input: "hello",
|
||||
@@ -548,9 +566,12 @@ fanout.layer("ProviderServiceLive fanout", (it) => {
|
||||
it.effect("fans out adapter turn completion events", () =>
|
||||
Effect.gen(function* () {
|
||||
const provider = yield* ProviderService;
|
||||
const session = yield* provider.startSession(asThreadId("thread-1"), {
|
||||
provider: "codex",
|
||||
});
|
||||
const session = yield* provider.startSession(
|
||||
asThreadId("thread-1"),
|
||||
{
|
||||
provider: "codex",
|
||||
},
|
||||
);
|
||||
|
||||
const eventsRef = yield* Ref.make<Array<ProviderRuntimeEvent>>([]);
|
||||
const consumer = yield* Stream.runForEach(provider.streamEvents, (event) =>
|
||||
@@ -585,9 +606,12 @@ fanout.layer("ProviderServiceLive fanout", (it) => {
|
||||
it.effect("keeps subscriber delivery ordered and isolates failing subscribers", () =>
|
||||
Effect.gen(function* () {
|
||||
const provider = yield* ProviderService;
|
||||
const session = yield* provider.startSession(asThreadId("thread-1"), {
|
||||
provider: "codex",
|
||||
});
|
||||
const session = yield* provider.startSession(
|
||||
asThreadId("thread-1"),
|
||||
{
|
||||
provider: "codex",
|
||||
},
|
||||
);
|
||||
|
||||
const receivedByHealthy: string[] = [];
|
||||
const expectedEventIds = new Set<string>(["evt-ordered-1", "evt-ordered-2", "evt-ordered-3"]);
|
||||
@@ -662,9 +686,12 @@ validation.layer("ProviderServiceLive validation", (it) => {
|
||||
const provider = yield* ProviderService;
|
||||
|
||||
const failure = yield* Effect.result(
|
||||
provider.startSession(asThreadId("thread-validation"), {
|
||||
provider: "invalid-provider",
|
||||
} as never),
|
||||
provider.startSession(
|
||||
asThreadId("thread-validation"),
|
||||
{
|
||||
provider: "invalid-provider",
|
||||
} as never,
|
||||
),
|
||||
);
|
||||
|
||||
assert.equal(failure._tag, "Failure");
|
||||
@@ -699,10 +726,13 @@ validation.layer("ProviderServiceLive validation", (it) => {
|
||||
);
|
||||
|
||||
const failure = yield* Effect.result(
|
||||
provider.startSession(asThreadId("thread-missing"), {
|
||||
provider: "codex",
|
||||
cwd: "/tmp/project",
|
||||
}),
|
||||
provider.startSession(
|
||||
asThreadId("thread-missing"),
|
||||
{
|
||||
provider: "codex",
|
||||
cwd: "/tmp/project",
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
assertFailure(
|
||||
|
||||
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { ProviderSessionId, ProviderThreadId, ThreadId } from "@t3tools/contracts";
|
||||
import { it, assert } from "@effect/vitest";
|
||||
import { assertFailure, assertSome } from "@effect/vitest/utils";
|
||||
|
||||
@@ -26,5 +26,5 @@ export interface CodexAdapterShape extends ProviderAdapterShape<ProviderAdapterE
|
||||
* CodexAdapter - Service tag for Codex provider adapter operations.
|
||||
*/
|
||||
export class CodexAdapter extends ServiceMap.Service<CodexAdapter, CodexAdapterShape>()(
|
||||
"t3/provider/Services/CodexAdapter",
|
||||
"provider/CodexAdapter",
|
||||
) {}
|
||||
@@ -37,6 +37,6 @@ export interface ProviderAdapterRegistryShape {
|
||||
export class ProviderAdapterRegistry extends ServiceMap.Service<
|
||||
ProviderAdapterRegistry,
|
||||
ProviderAdapterRegistryShape
|
||||
>()("t3/provider/Services/ProviderAdapterRegistry") {}
|
||||
>()("provider/ProviderAdapterRegistry") {}
|
||||
|
||||
// Dummy comment for workflow testing.
|
||||
@@ -105,5 +105,5 @@ export interface ProviderServiceShape {
|
||||
* ProviderService - Service tag for provider orchestration.
|
||||
*/
|
||||
export class ProviderService extends ServiceMap.Service<ProviderService, ProviderServiceShape>()(
|
||||
"t3/provider/Services/ProviderService",
|
||||
"provider/ProviderService",
|
||||
) {}
|
||||
@@ -99,4 +99,4 @@ export interface ProviderSessionDirectoryShape {
|
||||
export class ProviderSessionDirectory extends ServiceMap.Service<
|
||||
ProviderSessionDirectory,
|
||||
ProviderSessionDirectoryShape
|
||||
>()("t3/provider/Services/ProviderSessionDirectory") {}
|
||||
>()("provider/ProviderSessionDirectory") {}
|
||||
@@ -1,6 +1,6 @@
|
||||
import path from "node:path";
|
||||
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
import { Effect, Layer } from "effect";
|
||||
import * as SqlClient from "effect/unstable/sql/SqlClient";
|
||||
|
||||
|
||||
@@ -9,13 +9,7 @@ import {
|
||||
} from "@t3tools/contracts";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
PtySpawnError,
|
||||
type PtyAdapterShape,
|
||||
type PtyExitEvent,
|
||||
type PtyProcess,
|
||||
type PtySpawnInput,
|
||||
} from "../Services/PTY";
|
||||
import type { PtyAdapterShape, PtyExitEvent, PtyProcess, PtySpawnInput } from "../Services/PTY";
|
||||
import { TerminalManagerRuntime } from "./Manager";
|
||||
import { Effect, Encoding } from "effect";
|
||||
|
||||
@@ -75,33 +69,14 @@ class FakePtyAdapter implements PtyAdapterShape {
|
||||
readonly spawnFailures: Error[] = [];
|
||||
private nextPid = 9000;
|
||||
|
||||
constructor(private readonly mode: "sync" | "async" = "sync") {}
|
||||
|
||||
spawn(input: PtySpawnInput): Effect.Effect<PtyProcess, PtySpawnError> {
|
||||
spawn(input: PtySpawnInput): Effect.Effect<PtyProcess> {
|
||||
this.spawnInputs.push(input);
|
||||
const failure = this.spawnFailures.shift();
|
||||
if (failure) {
|
||||
return Effect.fail(
|
||||
new PtySpawnError({
|
||||
adapter: "fake",
|
||||
message: "Failed to spawn PTY process",
|
||||
cause: failure,
|
||||
}),
|
||||
);
|
||||
throw failure;
|
||||
}
|
||||
const process = new FakePtyProcess(this.nextPid++);
|
||||
this.processes.push(process);
|
||||
if (this.mode === "async") {
|
||||
return Effect.tryPromise({
|
||||
try: async () => process,
|
||||
catch: (cause) =>
|
||||
new PtySpawnError({
|
||||
adapter: "fake",
|
||||
message: "Failed to spawn PTY process",
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
}
|
||||
return Effect.succeed(process);
|
||||
}
|
||||
}
|
||||
@@ -175,12 +150,11 @@ describe("TerminalManager", () => {
|
||||
subprocessPollIntervalMs?: number;
|
||||
processKillGraceMs?: number;
|
||||
maxRetainedInactiveSessions?: number;
|
||||
ptyAdapter?: FakePtyAdapter;
|
||||
} = {},
|
||||
) {
|
||||
const logsDir = fs.mkdtempSync(path.join(os.tmpdir(), "t3code-terminal-"));
|
||||
tempDirs.push(logsDir);
|
||||
const ptyAdapter = options.ptyAdapter ?? new FakePtyAdapter();
|
||||
const ptyAdapter = new FakePtyAdapter();
|
||||
const manager = new TerminalManagerRuntime({
|
||||
logsDir,
|
||||
ptyAdapter,
|
||||
@@ -215,18 +189,6 @@ describe("TerminalManager", () => {
|
||||
manager.dispose();
|
||||
});
|
||||
|
||||
it("supports asynchronous PTY spawn effects", async () => {
|
||||
const { manager, ptyAdapter } = makeManager(5, { ptyAdapter: new FakePtyAdapter("async") });
|
||||
|
||||
const snapshot = await manager.open(openInput());
|
||||
|
||||
expect(snapshot.status).toBe("running");
|
||||
expect(ptyAdapter.spawnInputs).toHaveLength(1);
|
||||
expect(ptyAdapter.processes).toHaveLength(1);
|
||||
|
||||
manager.dispose();
|
||||
});
|
||||
|
||||
it("forwards write and resize to active pty process", async () => {
|
||||
const { manager, ptyAdapter } = makeManager();
|
||||
await manager.open(openInput());
|
||||
|
||||
@@ -117,43 +117,8 @@ function resolveShellCandidates(shellResolver: () => string): ShellCandidate[] {
|
||||
}
|
||||
|
||||
function isRetryableShellSpawnError(error: unknown): boolean {
|
||||
const queue: unknown[] = [error];
|
||||
const seen = new Set<unknown>();
|
||||
const messages: string[] = [];
|
||||
|
||||
while (queue.length > 0) {
|
||||
const current = queue.shift();
|
||||
if (!current || seen.has(current)) {
|
||||
continue;
|
||||
}
|
||||
seen.add(current);
|
||||
|
||||
if (typeof current === "string") {
|
||||
messages.push(current);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (current instanceof Error) {
|
||||
messages.push(current.message);
|
||||
const cause = (current as { cause?: unknown }).cause;
|
||||
if (cause) {
|
||||
queue.push(cause);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (typeof current === "object") {
|
||||
const value = current as { message?: unknown; cause?: unknown };
|
||||
if (typeof value.message === "string") {
|
||||
messages.push(value.message);
|
||||
}
|
||||
if (value.cause) {
|
||||
queue.push(value.cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const message = messages.join(" ").toLowerCase();
|
||||
if (!(error instanceof Error)) return false;
|
||||
const message = error.message.toLowerCase();
|
||||
return (
|
||||
message.includes("posix_spawnp failed") ||
|
||||
message.includes("enoent") ||
|
||||
@@ -389,7 +354,7 @@ export class TerminalManagerRuntime extends EventEmitter<TerminalManagerEvents>
|
||||
};
|
||||
this.sessions.set(sessionKey, session);
|
||||
this.evictInactiveSessionsIfNeeded();
|
||||
await this.startSession(session, { ...input, cols, rows }, "started");
|
||||
this.startSession(session, { ...input, cols, rows }, "started");
|
||||
return this.snapshot(session);
|
||||
}
|
||||
|
||||
@@ -415,11 +380,7 @@ export class TerminalManagerRuntime extends EventEmitter<TerminalManagerEvents>
|
||||
}
|
||||
|
||||
if (!existing.process) {
|
||||
await this.startSession(
|
||||
existing,
|
||||
{ ...input, cols: targetCols, rows: targetRows },
|
||||
"started",
|
||||
);
|
||||
this.startSession(existing, { ...input, cols: targetCols, rows: targetRows }, "started");
|
||||
return this.snapshot(existing);
|
||||
}
|
||||
|
||||
@@ -516,7 +477,7 @@ export class TerminalManagerRuntime extends EventEmitter<TerminalManagerEvents>
|
||||
|
||||
session.history = "";
|
||||
await this.persistHistory(input.threadId, input.terminalId, session.history);
|
||||
await this.startSession(session, { ...input, cols, rows }, "restarted");
|
||||
this.startSession(session, { ...input, cols, rows }, "restarted");
|
||||
return this.snapshot(session);
|
||||
});
|
||||
}
|
||||
@@ -567,11 +528,11 @@ export class TerminalManagerRuntime extends EventEmitter<TerminalManagerEvents>
|
||||
this.persistQueues.clear();
|
||||
}
|
||||
|
||||
private async startSession(
|
||||
private startSession(
|
||||
session: TerminalSessionState,
|
||||
input: TerminalStartInput,
|
||||
eventType: "started" | "restarted",
|
||||
): Promise<void> {
|
||||
): void {
|
||||
this.stopProcess(session);
|
||||
|
||||
session.status = "starting";
|
||||
@@ -590,46 +551,26 @@ export class TerminalManagerRuntime extends EventEmitter<TerminalManagerEvents>
|
||||
const terminalEnv = createTerminalSpawnEnv(process.env, session.runtimeEnv);
|
||||
let lastSpawnError: unknown = null;
|
||||
|
||||
const spawnWithCandidate = (candidate: ShellCandidate) =>
|
||||
Effect.runPromise(
|
||||
this.ptyAdapter.spawn({
|
||||
shell: candidate.shell,
|
||||
...(candidate.args ? { args: candidate.args } : {}),
|
||||
cwd: session.cwd,
|
||||
cols: session.cols,
|
||||
rows: session.rows,
|
||||
env: terminalEnv,
|
||||
}),
|
||||
);
|
||||
|
||||
const trySpawn = async (
|
||||
candidates: ShellCandidate[],
|
||||
index = 0,
|
||||
): Promise<{ process: PtyProcess; shellLabel: string } | null> => {
|
||||
if (index >= candidates.length) {
|
||||
return null;
|
||||
}
|
||||
const candidate = candidates[index];
|
||||
if (!candidate) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (const candidate of shellCandidates) {
|
||||
try {
|
||||
const process = await spawnWithCandidate(candidate);
|
||||
return { process, shellLabel: formatShellCandidate(candidate) };
|
||||
ptyProcess = Effect.runSync(
|
||||
this.ptyAdapter.spawn({
|
||||
shell: candidate.shell,
|
||||
...(candidate.args ? { args: candidate.args } : {}),
|
||||
cwd: session.cwd,
|
||||
cols: session.cols,
|
||||
rows: session.rows,
|
||||
env: terminalEnv,
|
||||
}),
|
||||
);
|
||||
startedShell = formatShellCandidate(candidate);
|
||||
break;
|
||||
} catch (error) {
|
||||
lastSpawnError = error;
|
||||
if (!isRetryableShellSpawnError(error)) {
|
||||
throw error;
|
||||
}
|
||||
return trySpawn(candidates, index + 1);
|
||||
}
|
||||
};
|
||||
|
||||
const spawnResult = await trySpawn(shellCandidates);
|
||||
if (spawnResult) {
|
||||
ptyProcess = spawnResult.process;
|
||||
startedShell = spawnResult.shellLabel;
|
||||
}
|
||||
|
||||
if (!ptyProcess) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FileSystem, Path, Effect } from "effect";
|
||||
import { assert, it } from "@effect/vitest";
|
||||
|
||||
import { ensureNodePtySpawnHelperExecutable } from "./NodePTY";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { NodeServices } from "@effect/platform-node";
|
||||
|
||||
it.layer(NodeServices.layer)("ensureNodePtySpawnHelperExecutable", (it) => {
|
||||
it.effect("adds executable bits when helper exists but is not executable", () =>
|
||||
|
||||
@@ -37,12 +37,11 @@ export const ensureNodePtySpawnHelperExecutable = Effect.fn(function* (explicitP
|
||||
didEnsureSpawnHelperExecutable = true;
|
||||
}
|
||||
|
||||
if (!(yield* fs.exists(helperPath))) {
|
||||
return;
|
||||
const stat = yield* fs.stat(helperPath);
|
||||
const mode = stat.mode & 0o777;
|
||||
if ((mode & 0o111) === 0) {
|
||||
yield* fs.chmod(helperPath, mode | 0o111);
|
||||
}
|
||||
|
||||
// Best-effort: avoid FileSystem.stat in packaged mode where some fs metadata can be missing.
|
||||
yield* fs.chmod(helperPath, 0o755).pipe(Effect.orElseSucceed(() => undefined));
|
||||
});
|
||||
|
||||
class NodePtyProcess implements PtyProcess {
|
||||
|
||||
@@ -113,5 +113,5 @@ export interface TerminalManagerShape {
|
||||
* TerminalManager - Service tag for terminal session orchestration.
|
||||
*/
|
||||
export class TerminalManager extends ServiceMap.Service<TerminalManager, TerminalManagerShape>()(
|
||||
"t3/terminal/Services/Manager/TerminalManager",
|
||||
"terminal/TerminalManager",
|
||||
) {}
|
||||
@@ -6,16 +6,7 @@
|
||||
*
|
||||
* @module PtyAdapter
|
||||
*/
|
||||
import { Effect, Schema, ServiceMap } from "effect";
|
||||
|
||||
/**
|
||||
* PtyError - Error type for PTY adapter operations.
|
||||
*/
|
||||
export class PtySpawnError extends Schema.TaggedErrorClass<PtySpawnError>()("PtySpawnError", {
|
||||
adapter: Schema.String,
|
||||
message: Schema.String,
|
||||
cause: Schema.optional(Schema.Defect),
|
||||
}) {}
|
||||
import { Effect, ServiceMap } from "effect";
|
||||
|
||||
export interface PtyExitEvent {
|
||||
exitCode: number;
|
||||
@@ -47,12 +38,12 @@ export interface PtyAdapterShape {
|
||||
/**
|
||||
* Spawn a PTY process for a terminal session.
|
||||
*/
|
||||
spawn(input: PtySpawnInput): Effect.Effect<PtyProcess, PtySpawnError>;
|
||||
spawn(input: PtySpawnInput): Effect.Effect<PtyProcess>;
|
||||
}
|
||||
|
||||
/**
|
||||
* PtyAdapter - Service tag for PTY process integration.
|
||||
*/
|
||||
export class PtyAdapter extends ServiceMap.Service<PtyAdapter, PtyAdapterShape>()(
|
||||
"t3/terminal/Services/PTY/PtyAdapter",
|
||||
"terminal/PtyAdapter",
|
||||
) {}
|
||||
@@ -543,9 +543,7 @@ describe("WebSocket Server", () => {
|
||||
issues: [],
|
||||
});
|
||||
|
||||
const persistedConfig = JSON.parse(
|
||||
fs.readFileSync(keybindingsPath, "utf8"),
|
||||
) as KeybindingsConfig;
|
||||
const persistedConfig = JSON.parse(fs.readFileSync(keybindingsPath, "utf8")) as KeybindingsConfig;
|
||||
expect(persistedConfig).toEqual(DEFAULT_KEYBINDINGS);
|
||||
});
|
||||
|
||||
@@ -713,9 +711,7 @@ describe("WebSocket Server", () => {
|
||||
|
||||
const response = await sendRequest(ws, WS_METHODS.serverGetConfig);
|
||||
expect(response.error).toBeUndefined();
|
||||
const persistedConfig = JSON.parse(
|
||||
fs.readFileSync(keybindingsPath, "utf8"),
|
||||
) as KeybindingsConfig;
|
||||
const persistedConfig = JSON.parse(fs.readFileSync(keybindingsPath, "utf8")) as KeybindingsConfig;
|
||||
expect(response.result).toEqual({
|
||||
cwd: "/my/workspace",
|
||||
keybindingsConfigPath: keybindingsPath,
|
||||
@@ -746,9 +742,7 @@ describe("WebSocket Server", () => {
|
||||
command: "script.run-tests.run",
|
||||
});
|
||||
expect(upsertResponse.error).toBeUndefined();
|
||||
const persistedConfig = JSON.parse(
|
||||
fs.readFileSync(keybindingsPath, "utf8"),
|
||||
) as KeybindingsConfig;
|
||||
const persistedConfig = JSON.parse(fs.readFileSync(keybindingsPath, "utf8")) as KeybindingsConfig;
|
||||
const persistedCommands = new Set(persistedConfig.map((entry) => entry.command));
|
||||
for (const defaultRule of DEFAULT_KEYBINDINGS) {
|
||||
expect(persistedCommands.has(defaultRule.command)).toBe(true);
|
||||
|
||||
+14
-10
@@ -23,7 +23,7 @@ import {
|
||||
WsPush,
|
||||
WsResponse,
|
||||
} from "@t3tools/contracts";
|
||||
import * as NodeHttpServer from "@effect/platform-node/NodeHttpServer";
|
||||
import { NodeHttpServer } from "@effect/platform-node";
|
||||
import { Cause, Effect, Exit, Layer, Ref, Schema, Scope, ServiceMap, Stream, Struct } from "effect";
|
||||
import { WebSocketServer, type WebSocket } from "ws";
|
||||
|
||||
@@ -79,7 +79,7 @@ export interface ServerShape {
|
||||
/**
|
||||
* Server - Service tag for HTTP/WebSocket lifecycle management.
|
||||
*/
|
||||
export class Server extends ServiceMap.Service<Server, ServerShape>()("t3/wsServer/Server") {}
|
||||
export class Server extends ServiceMap.Service<Server, ServerShape>()("server/Server") {}
|
||||
|
||||
const isServerNotRunningError = (error: unknown): boolean => {
|
||||
if (!(error instanceof Error)) return false;
|
||||
@@ -320,18 +320,22 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return<
|
||||
yield* Effect.addFinalizer(() => Scope.close(subscriptionsScope, Exit.void));
|
||||
|
||||
yield* Stream.runForEach(orchestrationEngine.streamDomainEvents, (event) =>
|
||||
broadcastPush({
|
||||
type: "push",
|
||||
channel: ORCHESTRATION_WS_CHANNELS.domainEvent,
|
||||
data: event,
|
||||
Effect.gen(function* () {
|
||||
yield* broadcastPush({
|
||||
type: "push",
|
||||
channel: ORCHESTRATION_WS_CHANNELS.domainEvent,
|
||||
data: event,
|
||||
});
|
||||
}),
|
||||
).pipe(Effect.forkIn(subscriptionsScope));
|
||||
|
||||
yield* Stream.runForEach(keybindingsManager.changes, (event) =>
|
||||
broadcastPush({
|
||||
type: "push",
|
||||
channel: WS_CHANNELS.serverConfigUpdated,
|
||||
data: event,
|
||||
Effect.gen(function* () {
|
||||
yield* broadcastPush({
|
||||
type: "push",
|
||||
channel: WS_CHANNELS.serverConfigUpdated,
|
||||
data: event,
|
||||
});
|
||||
}),
|
||||
).pipe(Effect.forkIn(subscriptionsScope));
|
||||
|
||||
|
||||
@@ -8,14 +8,7 @@
|
||||
"allowImportingTsExtensions": true,
|
||||
"plugins": [
|
||||
{
|
||||
"name": "@effect/language-service",
|
||||
"namespaceImportPackages": ["@effect/platform-node"],
|
||||
"diagnosticSeverity": {
|
||||
"importFromBarrel": "error",
|
||||
"anyUnknownInErrorContext": "warning",
|
||||
"instanceOfSchema": "warning",
|
||||
"deterministicKeys": "warning"
|
||||
}
|
||||
"name": "@effect/language-service"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"@xterm/addon-fit": "^0.11.0",
|
||||
"@xterm/xterm": "^6.0.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"effect": "catalog:",
|
||||
"effect": "4.0.0-beta.10",
|
||||
"highlight.js": "^11.11.1",
|
||||
"lucide-react": "^0.564.0",
|
||||
"react": "^19.0.0",
|
||||
@@ -32,7 +32,6 @@
|
||||
"tailwind-merge": "^3.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "catalog:",
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"@tanstack/router-plugin": "^1.161.0",
|
||||
"@types/react": "^19.0.0",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { WorkerPoolContextProvider } from "@pierre/diffs/react";
|
||||
import DiffsWorker from "@pierre/diffs/worker/worker.js?worker";
|
||||
import { useMemo, type ReactNode } from "react";
|
||||
|
||||
export function DiffWorkerPoolProvider({ children }: { children?: ReactNode }) {
|
||||
@@ -12,7 +11,8 @@ export function DiffWorkerPoolProvider({ children }: { children?: ReactNode }) {
|
||||
return (
|
||||
<WorkerPoolContextProvider
|
||||
poolOptions={{
|
||||
workerFactory: () => new DiffsWorker(),
|
||||
workerFactory: () =>
|
||||
new Worker(new URL("../workers/diffs.worker.ts", import.meta.url), { type: "module" }),
|
||||
poolSize: workerPoolSize,
|
||||
totalASTLRUCacheSize: 240,
|
||||
}}
|
||||
|
||||
@@ -16,15 +16,8 @@ import {
|
||||
} from "lucide-react";
|
||||
import React, { type FormEvent, type KeyboardEvent, useMemo, useState } from "react";
|
||||
|
||||
import {
|
||||
keybindingValueForCommand,
|
||||
decodeProjectScriptKeybindingRule,
|
||||
} from "~/lib/projectScriptKeybindings";
|
||||
import {
|
||||
commandForProjectScript,
|
||||
nextProjectScriptId,
|
||||
primaryProjectScript,
|
||||
} from "~/projectScripts";
|
||||
import { keybindingValueForCommand, decodeProjectScriptKeybindingRule } from "~/lib/projectScriptKeybindings";
|
||||
import { commandForProjectScript, nextProjectScriptId, primaryProjectScript } from "~/projectScripts";
|
||||
import { shortcutLabelForCommand } from "~/keybindings";
|
||||
import { isMacPlatform } from "~/lib/utils";
|
||||
import { Button } from "./ui/button";
|
||||
@@ -195,11 +188,7 @@ export default function ProjectScriptsControl({
|
||||
setValidationError(null);
|
||||
try {
|
||||
const scriptIdForValidation =
|
||||
editingScriptId ??
|
||||
nextProjectScriptId(
|
||||
trimmedName,
|
||||
scripts.map((script) => script.id),
|
||||
);
|
||||
editingScriptId ?? nextProjectScriptId(trimmedName, scripts.map((script) => script.id));
|
||||
const keybindingRule = decodeProjectScriptKeybindingRule({
|
||||
keybinding,
|
||||
command: commandForProjectScript(scriptIdForValidation),
|
||||
|
||||
@@ -578,9 +578,7 @@ export default function Sidebar() {
|
||||
size="sm"
|
||||
isActive={isActive}
|
||||
className={`h-7 w-full translate-x-0 justify-start px-2 text-left hover:bg-accent hover:text-foreground ${
|
||||
isActive
|
||||
? "bg-accent/85 text-foreground font-medium ring-1 ring-border/70 dark:bg-accent/55 dark:ring-border/50"
|
||||
: "text-muted-foreground"
|
||||
isActive ? "text-foreground" : "text-muted-foreground"
|
||||
}`}
|
||||
onClick={() => {
|
||||
void navigate({
|
||||
@@ -626,11 +624,7 @@ export default function Sidebar() {
|
||||
/>
|
||||
</span>
|
||||
)}
|
||||
<span
|
||||
className={`text-[10px] ${
|
||||
isActive ? "text-foreground/65" : "text-muted-foreground/40"
|
||||
}`}
|
||||
>
|
||||
<span className="text-[10px] text-muted-foreground/40">
|
||||
{formatRelativeTime(thread.createdAt)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -21,9 +21,7 @@ function Combobox<Value, Multiple extends boolean | undefined = false>(
|
||||
) {
|
||||
const chipsRef = React.useRef<Element | null>(null);
|
||||
return (
|
||||
<ComboboxContext.Provider
|
||||
value={React.useMemo(() => ({ chipsRef, multiple: !!props.multiple }), [props.multiple])}
|
||||
>
|
||||
<ComboboxContext.Provider value={{ chipsRef, multiple: !!props.multiple }}>
|
||||
<ComboboxPrimitive.Root {...props} />
|
||||
</ComboboxContext.Provider>
|
||||
);
|
||||
|
||||
@@ -42,9 +42,7 @@ function ToggleGroup({
|
||||
orientation={orientation}
|
||||
{...props}
|
||||
>
|
||||
<ToggleGroupContext.Provider
|
||||
value={React.useMemo(() => ({ size, variant }), [size, variant])}
|
||||
>
|
||||
<ToggleGroupContext.Provider value={{ size, variant }}>
|
||||
{children}
|
||||
</ToggleGroupContext.Provider>
|
||||
</ToggleGroupPrimitive>
|
||||
|
||||
@@ -294,7 +294,6 @@ label:has(> select#reasoning-effort) select {
|
||||
background: var(--muted);
|
||||
padding: 0.1rem 0.35rem;
|
||||
color: var(--foreground);
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.chat-markdown pre {
|
||||
@@ -311,7 +310,6 @@ label:has(> select#reasoning-effort) select {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
line-height: 1.5;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.chat-markdown table {
|
||||
|
||||
@@ -201,7 +201,10 @@ function EventRouter() {
|
||||
void queryClient
|
||||
.ensureQueryData(serverConfigQueryOptions())
|
||||
.then((config) =>
|
||||
api.shell.openInEditor(config.keybindingsConfigPath, preferredTerminalEditor()),
|
||||
api.shell.openInEditor(
|
||||
config.keybindingsConfigPath,
|
||||
preferredTerminalEditor(),
|
||||
),
|
||||
)
|
||||
.catch((error) => {
|
||||
toastManager.add({
|
||||
|
||||
@@ -241,8 +241,8 @@ function SettingsRouteView() {
|
||||
<div className="mb-4">
|
||||
<h2 className="text-sm font-medium text-foreground">Keybindings</h2>
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
Open the persisted <code>keybindings.json</code> file to edit advanced bindings
|
||||
directly.
|
||||
Open the persisted <code>keybindings.json</code> file to edit advanced
|
||||
bindings directly.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import "@pierre/diffs/worker/worker.js";
|
||||
+1
-13
@@ -7,19 +7,7 @@
|
||||
"types": ["vite/client"],
|
||||
"paths": {
|
||||
"~/*": ["./src/*"]
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "@effect/language-service",
|
||||
"namespaceImportPackages": ["@effect/platform-node"],
|
||||
"diagnosticSeverity": {
|
||||
"importFromBarrel": "error",
|
||||
"anyUnknownInErrorContext": "warning",
|
||||
"instanceOfSchema": "warning",
|
||||
"deterministicKeys": "warning"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": ["src", "vite.config.ts"]
|
||||
}
|
||||
@@ -5,8 +5,8 @@
|
||||
"": {
|
||||
"name": "@t3tools/monorepo",
|
||||
"devDependencies": {
|
||||
"oxfmt": "^0.35.0",
|
||||
"oxlint": "^1.50.0",
|
||||
"oxfmt": "^0.28.0",
|
||||
"oxlint": "^1.43.0",
|
||||
"turbo": "^2.3.3",
|
||||
"typescript": "^5.7.3",
|
||||
"vitest": "^4.0.0",
|
||||
@@ -35,17 +35,17 @@
|
||||
"t3": "./dist/index.mjs",
|
||||
},
|
||||
"dependencies": {
|
||||
"@effect/platform-node": "catalog:",
|
||||
"@effect/sql-sqlite-bun": "catalog:",
|
||||
"@effect/platform-node": "4.0.0-beta.10",
|
||||
"@effect/sql-sqlite-bun": "4.0.0-beta.10",
|
||||
"@pierre/diffs": "^1.1.0-beta.16",
|
||||
"effect": "catalog:",
|
||||
"effect": "4.0.0-beta.10",
|
||||
"node-pty": "^1.1.0",
|
||||
"open": "^10.1.0",
|
||||
"ws": "^8.18.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "0.75.1",
|
||||
"@effect/vitest": "catalog:",
|
||||
"@effect/vitest": "4.0.0-beta.10",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/web": "workspace:*",
|
||||
"@types/bun": "^1.3.9",
|
||||
@@ -70,7 +70,7 @@
|
||||
"@xterm/addon-fit": "^0.11.0",
|
||||
"@xterm/xterm": "^6.0.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"effect": "catalog:",
|
||||
"effect": "4.0.0-beta.10",
|
||||
"highlight.js": "^11.11.1",
|
||||
"lucide-react": "^0.564.0",
|
||||
"react": "^19.0.0",
|
||||
@@ -81,7 +81,6 @@
|
||||
"tailwind-merge": "^3.4.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "catalog:",
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"@tanstack/router-plugin": "^1.161.0",
|
||||
"@types/react": "^19.0.0",
|
||||
@@ -97,23 +96,16 @@
|
||||
"name": "@t3tools/contracts",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"effect": "catalog:",
|
||||
"effect": "4.0.0-beta.10",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "0.75.1",
|
||||
"@effect/vitest": "catalog:",
|
||||
"@effect/vitest": "4.0.0-beta.10",
|
||||
"tsdown": "^0.20.3",
|
||||
"typescript": "^5.7.3",
|
||||
},
|
||||
},
|
||||
},
|
||||
"catalog": {
|
||||
"@effect/language-service": "0.75.1",
|
||||
"@effect/platform-node": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/platform-node@f591738",
|
||||
"@effect/sql-sqlite-bun": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/sql-sqlite-bun@f591738",
|
||||
"@effect/vitest": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/vitest@f591738",
|
||||
"effect": "https://pkg.pr.new/Effect-TS/effect-smol/effect@f591738",
|
||||
},
|
||||
"packages": {
|
||||
"@babel/code-frame": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="],
|
||||
|
||||
@@ -165,13 +157,13 @@
|
||||
|
||||
"@effect/language-service": ["@effect/[email protected]", "", { "bin": { "effect-language-service": "cli.js" } }, "sha512-g9xD2tAQgRFpYC2YgpZq02VeSL5fBbFJ0B/g1o+14NuNmwtaYJc7SjiLWAA9eyhJHosNrn6h1Ye+Kx6j5mN0AA=="],
|
||||
|
||||
"@effect/platform-node": ["@effect/platform-node@https://pkg.pr.new/Effect-TS/effect-smol/@effect/platform-node@f591738", { "dependencies": { "@effect/platform-node-shared": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/platform-node-shared@f59173885df0eb490dc2e6619ae89467feac0413", "mime": "^4.1.0", "undici": "^7.20.0" }, "peerDependencies": { "effect": "^4.0.0-beta.19", "ioredis": "^5.7.0" } }],
|
||||
"@effect/platform-node": ["@effect/platform-node@4.0.0-beta.10", "", { "dependencies": { "@effect/platform-node-shared": "^4.0.0-beta.10", "mime": "^4.1.0", "undici": "^7.20.0" }, "peerDependencies": { "effect": "^4.0.0-beta.10", "ioredis": "^5.7.0" } }, "sha512-ikZ/uyos5okYAHE+wWOwZkHgriFUTY3aY8Kdqbj/ro8xw0z9YXWN4fbyQAZUWkBcieDKS36N+QfHRMPG4fEWRA=="],
|
||||
|
||||
"@effect/platform-node-shared": ["@effect/platform-node-shared@https://pkg.pr.new/Effect-TS/effect-smol/@effect/platform-node-shared@f59173885df0eb490dc2e6619ae89467feac0413", { "dependencies": { "@types/ws": "^8.18.1", "ws": "^8.19.0" }, "peerDependencies": { "effect": "^4.0.0-beta.19" } }],
|
||||
"@effect/platform-node-shared": ["@effect/platform-node-shared@4.0.0-beta.10", "", { "dependencies": { "@types/ws": "^8.18.1", "ws": "^8.19.0" }, "peerDependencies": { "effect": "^4.0.0-beta.10" } }, "sha512-gBSeOG2bfchXFdgdi5oipHKynOzSd7BlzTy5QcjFOoCUTtLP9igqohPB9hTkV3a6seWE2JJqsgsQ79VuLb7fAg=="],
|
||||
|
||||
"@effect/sql-sqlite-bun": ["@effect/sql-sqlite-bun@https://pkg.pr.new/Effect-TS/effect-smol/@effect/sql-sqlite-bun@f591738", { "peerDependencies": { "effect": "^4.0.0-beta.19" } }],
|
||||
"@effect/sql-sqlite-bun": ["@effect/sql-sqlite-bun@4.0.0-beta.10", "", { "peerDependencies": { "effect": "^4.0.0-beta.10" } }, "sha512-LY1jNu2uqGYsJCVjVU73nzcZ+kAYBDsG7O8x5ddmkIXj10RmnIhjYMStWBa0NZOFg4Hsl+CadxtsDy3edaOVeA=="],
|
||||
|
||||
"@effect/vitest": ["@effect/vitest@https://pkg.pr.new/Effect-TS/effect-smol/@effect/vitest@f591738", { "peerDependencies": { "effect": "^4.0.0-beta.19", "vitest": "^3.0.0" } }],
|
||||
"@effect/vitest": ["@effect/vitest@4.0.0-beta.10", "", { "peerDependencies": { "effect": "^4.0.0-beta.10", "vitest": "^3.0.0" } }, "sha512-WmE8vCNw+eDoAq9CwwymrAdIBw1f+8hDP3AUF7jyC7/Cj/kyAYOFwkbtKmDXIFaTlf7G/2fmulEXeCO5W8j0kQ=="],
|
||||
|
||||
"@electron/get": ["@electron/[email protected]", "", { "dependencies": { "debug": "^4.1.1", "env-paths": "^2.2.0", "fs-extra": "^8.1.0", "got": "^11.8.5", "progress": "^2.0.3", "semver": "^6.2.0", "sumchecker": "^3.0.1" }, "optionalDependencies": { "global-agent": "^3.0.0" } }, "sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ=="],
|
||||
|
||||
@@ -301,81 +293,59 @@
|
||||
|
||||
"@oxc-project/types": ["@oxc-project/[email protected]", "", {}, "sha512-m6RebKHIRsax2iCwVpYW2ErQwa4ywHJrE4sCK3/8JK8ZZAWOKXaRJFl/uP51gaVyyXlaS4+chU1nSCdzYf6QqQ=="],
|
||||
|
||||
"@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.35.0", "", { "os": "android", "cpu": "arm" }, "sha512-BaRKlM3DyG81y/xWTsE6gZiv89F/3pHe2BqX2H4JbiB8HNVlWWtplzgATAE5IDSdwChdeuWLDTQzJ92Lglw3ZA=="],
|
||||
"@oxfmt/darwin-arm64": ["@oxfmt/darwin-arm64@0.28.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-jmUfF7cNJPw57bEK7sMIqrYRgn4LH428tSgtgLTCtjuGuu1ShREyrkeB7y8HtkXRfhBs4lVY+HMLhqElJvZ6ww=="],
|
||||
|
||||
"@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.35.0", "", { "os": "android", "cpu": "arm64" }, "sha512-/O+EbuAJYs6nde/anv+aID6uHsGQApyE9JtYBo/79KyU8e6RBN3DMbT0ix97y1SOnCglurmL2iZ+hlohjP2PnQ=="],
|
||||
"@oxfmt/darwin-x64": ["@oxfmt/darwin-x64@0.28.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-S6vlV8S7jbjzJOSjfVg2CimUC0r7/aHDLdUm/3+/B/SU/s1jV7ivqWkMv1/8EB43d1BBwT9JQ60ZMTkBqeXSFA=="],
|
||||
|
||||
"@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.35.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-pGqRtqlNdn9d4VrmGUWVyQjkw79ryhI6je9y2jfqNUIZCfqceob+R97YYAoG7C5TFyt8ILdLVoN+L2vw/hSFyA=="],
|
||||
"@oxfmt/linux-arm64-gnu": ["@oxfmt/linux-arm64-gnu@0.28.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-TfJkMZjePbLiskmxFXVAbGI/OZtD+y+fwS0wyW8O6DWG0ARTf0AipY9zGwGoOdpFuXOJceXvN4SHGLbYNDMY4Q=="],
|
||||
|
||||
"@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.35.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-8GmsDcSozTPjrCJeGpp+sCmS9+9V5yRrdEZ1p/sTWxPG5nYeAfSLuS0nuEYjXSO+CtdSbStIW6dxa+4NM58yRw=="],
|
||||
"@oxfmt/linux-arm64-musl": ["@oxfmt/linux-arm64-musl@0.28.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-7fyQUdW203v4WWGr1T3jwTz4L7KX9y5DeATryQ6fLT6QQp9GEuct8/k0lYhd+ys42iTV/IkJF20e3YkfSOOILg=="],
|
||||
|
||||
"@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.35.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-QyfKfTe0ytHpFKHAcHCGQEzN45QSqq1AHJOYYxQMgLM3KY4xu8OsXHpCnINjDsV4XGnQzczJDU9e04Zmd8XqIQ=="],
|
||||
"@oxfmt/linux-x64-gnu": ["@oxfmt/linux-x64-gnu@0.28.0", "", { "os": "linux", "cpu": "x64" }, "sha512-sRKqAvEonuz0qr1X1ncUZceOBJerKzkO2gZIZmosvy/JmqyffpIFL3OE2tqacFkeDhrC+dNYQpusO8zsfHo3pw=="],
|
||||
|
||||
"@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.35.0", "", { "os": "linux", "cpu": "arm" }, "sha512-u+kv3JD6P3J38oOyUaiCqgY5TNESzBRZJ5lyZQ6c2czUW2v5SIN9E/KWWa9vxoc+P8AFXQFUVrdzGy1tK+nbPQ=="],
|
||||
"@oxfmt/linux-x64-musl": ["@oxfmt/linux-x64-musl@0.28.0", "", { "os": "linux", "cpu": "x64" }, "sha512-fW6czbXutX/tdQe8j4nSIgkUox9RXqjyxwyWXUDItpoDkoXllq17qbD7GVc0whrEhYQC6hFE1UEAcDypLJoSzw=="],
|
||||
|
||||
"@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.35.0", "", { "os": "linux", "cpu": "arm" }, "sha512-1NiZroCiV57I7Pf8kOH4XGR366kW5zir3VfSMBU2D0V14GpYjiYmPYFAoJboZvp8ACnZKUReWyMkNKSa5ad58A=="],
|
||||
"@oxfmt/win32-arm64": ["@oxfmt/win32-arm64@0.28.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-D/HDeQBAQRjTbD9OLV6kRDcStrIfO+JsUODDCdGmhRfNX8LPCx95GpfyybpZfn3wVF8Jq/yjPXV1xLkQ+s7RcA=="],
|
||||
|
||||
"@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.35.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-7Q0Xeg7ZnW2nxnZ4R7aF6DEbCFls4skgHZg+I63XitpNvJCbVIU8MFOTZlvZGRsY9+rPgWPQGeUpLHlyx0wvMA=="],
|
||||
"@oxfmt/win32-x64": ["@oxfmt/win32-x64@0.28.0", "", { "os": "win32", "cpu": "x64" }, "sha512-4+S2j4OxOIyo8dz5osm5dZuL0yVmxXvtmNdHB5xyGwAWVvyWNvf7tCaQD7w2fdSsAXQLOvK7KFQrHFe33nJUCA=="],
|
||||
|
||||
"@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-[email protected].0", "", { "os": "linux", "cpu": "arm64" }, "sha512-5Okqi+uhYFxwKz8hcnUftNNwdm8BCkf6GSCbcz9xJxYMm87k1E4p7PEmAAbhLTk7cjSdDre6TDL0pDzNX+Y22Q=="],
|
||||
"@oxlint/binding-android-arm-eabi": ["@oxlint/binding-[email protected].0", "", { "os": "android", "cpu": "arm" }, "sha512-vLPcE+HcZ/W/0cVA1KLuAnoUSejGougDH/fDjBFf0Q+rbBIyBNLevOhgx3AnBNAt3hcIGY7U05ISbJCKZeVa3w=="],
|
||||
|
||||
"@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-[email protected].0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-9k66pbZQXM/lBJWys3Xbc5yhl4JexyfqkEf/tvtq8976VIJnLAAL3M127xHA3ifYSqxdVHfVGTg84eiBHCGcNw=="],
|
||||
"@oxlint/binding-android-arm64": ["@oxlint/binding-[email protected].0", "", { "os": "android", "cpu": "arm64" }, "sha512-b8IqCczUsirdtJ3R/be4cRm64I5pMPafMO/9xyTAZvc+R/FxZHMQuhw0iNT9hQwRn+Uo5rNAoA8QS7QurG2QeA=="],
|
||||
|
||||
"@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-[email protected].0", "", { "os": "linux", "cpu": "none" }, "sha512-aUcY9ofKPtjO52idT6t0SAQvEF6ctjzUQa1lLp7GDsRpSBvuTrBQGeq0rYKz3gN8dMIQ7mtMdGD9tT4LhR8jAQ=="],
|
||||
"@oxlint/binding-darwin-arm64": ["@oxlint/binding-[email protected].0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-CfC/KGnNMhI01dkfCMjquKnW4zby3kqD5o/9XA7+pgo9I4b+Nipm+JVFyZPWMNwKqLXNmi35GTLWjs9svPxlew=="],
|
||||
|
||||
"@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-[email protected].0", "", { "os": "linux", "cpu": "none" }, "sha512-C6yhY5Hvc2sGM+mCPek9ZLe5xRUOC/BvhAt2qIWFAeXMn4il04EYIjl3DsWiJr0xDMTJhvMOmD55xTRPlNp39w=="],
|
||||
"@oxlint/binding-darwin-x64": ["@oxlint/binding-[email protected].0", "", { "os": "darwin", "cpu": "x64" }, "sha512-m38mKPsV3rBdWOJ4TAGZiUjWU8RGrBxsmdSeMQ0bPr/8O6CUOm/RJkPBf0GAfPms2WRVcbkfEXvIiPshAeFkeA=="],
|
||||
|
||||
"@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-[email protected].0", "", { "os": "linux", "cpu": "s390x" }, "sha512-RG2hlvOMK4OMZpO3mt8MpxLQ0AAezlFqhn5mI/g5YrVbPFyoCv9a34AAvbSJS501ocOxlFIRcKEuw5hFvddf9g=="],
|
||||
"@oxlint/binding-freebsd-x64": ["@oxlint/binding-[email protected].0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-YaFRKslSAfuMwn7ejS1/wo9jENqQigpGBjjThX+mrpmEROLYGky+zIC5xSVGRng28U92VEDVbSNJ/sguz3dUAA=="],
|
||||
|
||||
"@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.35.0", "", { "os": "linux", "cpu": "x64" }, "sha512-wzmh90Pwvqj9xOKHJjkQYBpydRkaXG77ZvDz+iFDRRQpnqIEqGm5gmim2s6vnZIkDGsvKCuTdtxm0GFmBjM1+w=="],
|
||||
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnu[email protected].0", "", { "os": "linux", "cpu": "arm" }, "sha512-Nlw+5mSZQtkg1Oj0N8ulxzG8ATpmSDz5V2DNaGhaYAVlcdR8NYSm/xTOnweOXc/UOOv3LwkPPYzqcfPhu2lEkA=="],
|
||||
|
||||
"@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.35.0", "", { "os": "linux", "cpu": "x64" }, "sha512-+HCqYCJPCUy5I+b2cf+gUVaApfgtoQT3HdnSg/l7NIcLHOhKstlYaGyrFZLmUpQt4WkFbpGKZZayG6zjRU0KFA=="],
|
||||
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musl[email protected].0", "", { "os": "linux", "cpu": "arm" }, "sha512-d3Y5y4ukMqAGnWLMKpwqj8ftNUaac7pA0NrId4AZ77JvHzezmxEcm2gswaBw2HW8y1pnq6KDB0vEPPvpTfDLrA=="],
|
||||
|
||||
"@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-[email protected].0", "", { "os": "none", "cpu": "arm64" }, "sha512-kFYmWfR9YL78XyO5ws+1dsxNvZoD973qfVMNFOS4e9bcHXGF7DvGC2tY5UDFwyMCeB33t3sDIuGONKggnVNSJA=="],
|
||||
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-[email protected].0", "", { "os": "linux", "cpu": "arm64" }, "sha512-jkjx+XSOPuFR+C458prQmehO+v0VK19/3Hj2mOYDF4hHUf3CzmtA4fTmQUtkITZiGHnky7Oao6JeJX24mrX7WQ=="],
|
||||
|
||||
"@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-m[email protected].0", "", { "os": "win32", "cpu": "arm64" }, "sha512-uD/NGdM65eKNCDGyTGdO8e9n3IHX+wwuorBvEYrPJXhDXL9qz6gzddmXH8EN04ejUXUujlq4FsoSeCfbg0Y+Jg=="],
|
||||
"@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-m[email protected].0", "", { "os": "linux", "cpu": "arm64" }, "sha512-X/aPB1rpJUdykjWSeeGIbjk6qbD8VDulgLuTSMWgr/t6m1ljcAjqHb1g49pVG9bZl55zjECgzvlpPLWnfb4FMQ=="],
|
||||
|
||||
"@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win[email protected].0", "", { "os": "win32", "cpu": "ia32" }, "sha512-oSRD2k8J2uxYDEKR2nAE/YTY9PobOEnhZgCmspHu0+yBQ665yH8lFErQVSTE7fcGJmJp/cC6322/gc8VFuQf7g=="],
|
||||
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-lin[email protected].0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-AymyOxGWwKY2KJa8b+h8iLrYJZbWKYCjqctSc2q6uIAkYPrCsxcWlge1JP6XZ14Sa80DVMwI/QvktbytSV+xVw=="],
|
||||
|
||||
"@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win[email protected].0", "", { "os": "win32", "cpu": "x64" }, "sha512-WCDJjlS95NboR0ugI2BEwzt1tYvRDorDRM9Lvctls1SLyKYuNRCyrPwp1urUPFBnwgBNn9p2/gnmo7gFMySRoQ=="],
|
||||
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-lin[email protected].0", "", { "os": "linux", "cpu": "none" }, "sha512-PkeVdPKCDA59rlMuucsel2LjlNEpslQN5AhkMMorIJZItbbqi/0JSuACCzaiIcXYv0oNfbeQ8rbOBikv+aT6cg=="],
|
||||
|
||||
"@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.50.0", "", { "os": "android", "cpu": "arm" }, "sha512-G7MRGk/6NCe+L8ntonRdZP7IkBfEpiZ/he3buLK6JkLgMHgJShXZ+BeOwADmspXez7U7F7L1Anf4xLSkLHiGTg=="],
|
||||
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.46.0", "", { "os": "linux", "cpu": "none" }, "sha512-snQaRLO/X+Ry/CxX1px1g8GUbmXzymdRs+/RkP2bySHWZFhFDtbLm2hA1ujX/jKlTLMJDZn4hYzFGLDwG/Rh2w=="],
|
||||
|
||||
"@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.50.0", "", { "os": "android", "cpu": "arm64" }, "sha512-GeSuMoJWCVpovJi/e3xDSNgjeR8WEZ6MCXL6EtPiCIM2NTzv7LbflARINTXTJy2oFBYyvdf/l2PwHzYo6EdXvg=="],
|
||||
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.46.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-kZhDMwUe/sgDTluGao9c0Dqc1JzV6wPzfGo0l/FLQdh5Zmp39Yg1FbBsCgsJfVKmKl1fNqsHyFLTShWMOlOEhA=="],
|
||||
|
||||
"@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.50.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-w3SY5YtxGnxCHPJ8Twl3KmS9oja1gERYk3AMoZ7Hv8P43ZtB6HVfs02TxvarxfL214Tm3uzvc2vn+DhtUNeKnw=="],
|
||||
"@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.46.0", "", { "os": "linux", "cpu": "x64" }, "sha512-n5a7VtQTxHZ13cNAKQc3ziARv5bE1Fx868v/tnhZNVUjaRNYe5uiUrRJ/LZghdAzOxVuQGarjjq/q4QM2+9OPA=="],
|
||||
|
||||
"@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.50.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-hNfogDqy7tvmllXKBSlHo6k5x7dhTUVOHbMSE15CCAcXzmqf5883aPvBYPOq9AE7DpDUQUZ1kVE22YbiGW+tuw=="],
|
||||
"@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.46.0", "", { "os": "linux", "cpu": "x64" }, "sha512-KpsDU/BhdVn3iKCLxMXAOZIpO8fS0jEA5iluRoK1rhHPwKtpzEm/OCwERsu/vboMSZm66qnoTUVXRPJ8M+iKVQ=="],
|
||||
|
||||
"@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.50.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-ykZevOWEyu0nsxolA911ucxpEv0ahw8jfEeGWOwwb/VPoE4xoexuTOAiPNlWZNJqANlJl7yp8OyzCtXTUAxotw=="],
|
||||
"@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.46.0", "", { "os": "none", "cpu": "arm64" }, "sha512-jtbqUyEXlsDlRmMtTZqNbw49+1V/WxqNAR5l0S3OEkdat9diI5I+eqq9IT+jb5cSDdszTGcXpn7S3+gUYSydxQ=="],
|
||||
|
||||
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.50.0", "", { "os": "linux", "cpu": "arm" }, "sha512-hif3iDk7vo5GGJ4OLCCZAf2vjnU9FztGw4L0MbQL0M2iY9LKFtDMMiQAHmkF0PQGQMVbTYtPdXCLKVgdkiqWXQ=="],
|
||||
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.46.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-EE8NjpqEZPwHQVigNvdyJ11dZwWIfsfn4VeBAuiJeAdrnY4HFX27mIjJINJgP5ZdBYEFV1OWH/eb9fURCYel8w=="],
|
||||
|
||||
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.50.0", "", { "os": "linux", "cpu": "arm" }, "sha512-dVp9iSssiGAnTNey2Ruf6xUaQhdnvcFOJyRWd/mu5o2jVbFK15E5fbWGeFRfmuobu5QXuROtFga44+7DOS3PLg=="],
|
||||
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.46.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-BHyk3H/HRdXs+uImGZ/2+qCET+B8lwGHOm7m54JiJEEUWf3zYCFX/Df1SPqtozWWmnBvioxoTG1J3mPRAr8KUA=="],
|
||||
|
||||
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.50.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-1cT7yz2HA910CKA9NkH1ZJo50vTtmND2fkoW1oyiSb0j6WvNtJ0Wx2zoySfXWc/c+7HFoqRK5AbEoL41LOn9oA=="],
|
||||
|
||||
"@oxlint/binding-linux-arm64-musl": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-++B3k/HEPFVlj89cOz8kWfQccMZB/aWL9AhsW7jPIkG++63Mpwb2cE9XOEsd0PATbIan78k2Gky+09uWM1d/gQ=="],
|
||||
|
||||
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-Z9b/KpFMkx66w3gVBqjIC1AJBTZAGoI9+U+K5L4QM0CB/G0JSNC1es9b3Y0Vcrlvtdn8A+IQTkYjd/Q0uCSaZw=="],
|
||||
|
||||
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-jvmuIw8wRSohsQlFNIST5uUwkEtEJmOQYr33bf/K2FrFPXHhM4KqGekI3ShYJemFS/gARVacQFgBzzJKCAyJjg=="],
|
||||
|
||||
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-x+UrN47oYNh90nmAAyql8eQaaRpHbDPu5guasDg10+OpszUQ3/1+1J6zFMmV4xfIEgTcUXG/oI5fxJhF4eWCNA=="],
|
||||
|
||||
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-i/JLi2ljLUIVfekMj4ISmdt+Hn11wzYUdRRrkVUYsCWw7zAy5xV7X9iA+KMyM156LTFympa7s3oKBjuCLoTAUQ=="],
|
||||
|
||||
"@oxlint/binding-linux-x64-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-/C7brhn6c6UUPccgSPCcpLQXcp+xKIW/3sji/5VZ8/OItL3tQ2U7KalHz887UxxSQeEOmd1kY6lrpuwFnmNqOA=="],
|
||||
|
||||
"@oxlint/binding-linux-x64-musl": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-oDR1f+bGOYU8LfgtEW8XtotWGB63ghtcxk5Jm6IDTCk++rTA/IRMsjOid2iMd+1bW+nP9Mdsmcdc7VbPD3+iyQ=="],
|
||||
|
||||
"@oxlint/binding-openharmony-arm64": ["@oxlint/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-4CmRGPp5UpvXyu4jjP9Tey/SrXDQLRvZXm4pb4vdZBxAzbFZkCyh0KyRy4txld/kZKTJlW4TO8N1JKrNEk+mWw=="],
|
||||
|
||||
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-Fq0M6vsGcFsSfeuWAACDhd5KJrO85ckbEfe1EGuBj+KPyJz7KeWte2fSFrFGmNKNXyhEMyx4tbgxiWRujBM2KQ=="],
|
||||
|
||||
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-qTdWR9KwY/vxJGhHVIZG2eBOhidOQvOwzDxnX+jhW/zIVacal1nAhR8GLkiywW8BIFDkQKXo/zOfT+/DY+ns/w=="],
|
||||
|
||||
"@oxlint/binding-win32-x64-msvc": ["@oxlint/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-682t7npLC4G2Ca+iNlI9fhAKTcFPYYXJjwoa88H4q+u5HHHlsnL/gHULapX3iqp+A8FIJbgdylL5KMYo2LaluQ=="],
|
||||
"@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.46.0", "", { "os": "win32", "cpu": "x64" }, "sha512-DJbQsSJUr4KSi9uU0QqOgI7PX2C+fKGZX+YDprt3vM2sC0dWZsgVTLoN2vtkNyEWJSY2mnvRFUshWXT3bmo0Ug=="],
|
||||
|
||||
"@pierre/diffs": ["@pierre/[email protected]", "", { "dependencies": { "@shikijs/transformers": "^3.0.0", "diff": "8.0.3", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "^3.0.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-McjTuEPuacSIcXdoI2O9W6VSHIOs9ApEHnEUwONKZnKqIo2GGv1vNg9Pr8tgBOL7lgBWNEHX5ROJ5z1X74sENQ=="],
|
||||
|
||||
@@ -759,7 +729,7 @@
|
||||
|
||||
"dunder-proto": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
|
||||
|
||||
"effect": ["effect@https://pkg.pr.new/Effect-TS/effect-smol/effect@f591738", { "dependencies": { "@standard-schema/spec": "^1.1.0", "fast-check": "^4.5.3", "find-my-way-ts": "^0.1.6", "ini": "^6.0.0", "kubernetes-types": "^1.30.0", "msgpackr": "^1.11.8", "multipasta": "^0.2.7", "toml": "^3.0.0", "uuid": "^13.0.0", "yaml": "^2.8.2" } }],
|
||||
"effect": ["effect@4.0.0-beta.10", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "fast-check": "^4.5.3", "find-my-way-ts": "^0.1.6", "ini": "^6.0.0", "kubernetes-types": "^1.30.0", "msgpackr": "^1.11.8", "multipasta": "^0.2.7", "toml": "^3.0.0", "uuid": "^13.0.0", "yaml": "^2.8.2" } }, "sha512-UvxWmT0uzWZqNmQODfW7y1zb0LMlH3xtSn/UESpck2Wvv6SogxibYPWKKNcUsRMm5wwprOoW2IwItYLQyZpe8Q=="],
|
||||
|
||||
"electron": ["[email protected]", "", { "dependencies": { "@electron/get": "^2.0.0", "@types/node": "^24.9.0", "extract-zip": "^2.0.1" }, "bin": { "electron": "cli.js" } }, "sha512-ett8W+yOFGDuM0vhJMamYSkrbV3LoaffzJd9GfjI96zRAxyrNqUSKqBpf/WGbQCweDxX2pkUCUfrv4wwKpsFZA=="],
|
||||
|
||||
@@ -1137,9 +1107,9 @@
|
||||
|
||||
"outvariant": ["[email protected]", "", {}, "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA=="],
|
||||
|
||||
"oxfmt": ["oxfmt@0.35.0", "", { "dependencies": { "tinypool": "2.1.0" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.35.0", "@oxfmt/binding-android-arm64": "0.35.0", "@oxfmt/binding-darwin-arm64": "0.35.0", "@oxfmt/binding-darwin-x64": "0.35.0", "@oxfmt/binding-freebsd-x64": "0.35.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.35.0", "@oxfmt/binding-linux-arm-musleabihf": "0.35.0", "@oxfmt/binding-linux-arm64-gnu": "0.35.0", "@oxfmt/binding-linux-arm64-musl": "0.35.0", "@oxfmt/binding-linux-ppc64-gnu": "0.35.0", "@oxfmt/binding-linux-riscv64-gnu": "0.35.0", "@oxfmt/binding-linux-riscv64-musl": "0.35.0", "@oxfmt/binding-linux-s390x-gnu": "0.35.0", "@oxfmt/binding-linux-x64-gnu": "0.35.0", "@oxfmt/binding-linux-x64-musl": "0.35.0", "@oxfmt/binding-openharmony-arm64": "0.35.0", "@oxfmt/binding-win32-arm64-msvc": "0.35.0", "@oxfmt/binding-win32-ia32-msvc": "0.35.0", "@oxfmt/binding-win32-x64-msvc": "0.35.0" }, "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-QYeXWkP+aLt7utt5SLivNIk09glWx9QE235ODjgcEZ3sd1VMaUBSpLymh6ZRCA76gD2rMP4bXanUz/fx+nLM9Q=="],
|
||||
"oxfmt": ["oxfmt@0.28.0", "", { "dependencies": { "tinypool": "2.1.0" }, "optionalDependencies": { "@oxfmt/darwin-arm64": "0.28.0", "@oxfmt/darwin-x64": "0.28.0", "@oxfmt/linux-arm64-gnu": "0.28.0", "@oxfmt/linux-arm64-musl": "0.28.0", "@oxfmt/linux-x64-gnu": "0.28.0", "@oxfmt/linux-x64-musl": "0.28.0", "@oxfmt/win32-arm64": "0.28.0", "@oxfmt/win32-x64": "0.28.0" }, "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-3+hhBqPE6Kp22KfJmnstrZbl+KdOVSEu1V0ABaFIg1rYLtrMgrupx9znnHgHLqKxAVHebjTdiCJDk30CXOt6cw=="],
|
||||
|
||||
"oxlint": ["oxlint@1.50.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.50.0", "@oxlint/binding-android-arm64": "1.50.0", "@oxlint/binding-darwin-arm64": "1.50.0", "@oxlint/binding-darwin-x64": "1.50.0", "@oxlint/binding-freebsd-x64": "1.50.0", "@oxlint/binding-linux-arm-gnueabihf": "1.50.0", "@oxlint/binding-linux-arm-musleabihf": "1.50.0", "@oxlint/binding-linux-arm64-gnu": "1.50.0", "@oxlint/binding-linux-arm64-musl": "1.50.0", "@oxlint/binding-linux-ppc64-gnu": "1.50.0", "@oxlint/binding-linux-riscv64-gnu": "1.50.0", "@oxlint/binding-linux-riscv64-musl": "1.50.0", "@oxlint/binding-linux-s390x-gnu": "1.50.0", "@oxlint/binding-linux-x64-gnu": "1.50.0", "@oxlint/binding-linux-x64-musl": "1.50.0", "@oxlint/binding-openharmony-arm64": "1.50.0", "@oxlint/binding-win32-arm64-msvc": "1.50.0", "@oxlint/binding-win32-ia32-msvc": "1.50.0", "@oxlint/binding-win32-x64-msvc": "1.50.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.14.1" }, "optionalPeers": ["oxlint-tsgolint"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-iSJ4IZEICBma8cZX7kxIIz9PzsYLF2FaLAYN6RKu7VwRVKdu7RIgpP99bTZaGl//Yao7fsaGZLSEo5xBrI5ReQ=="],
|
||||
"oxlint": ["oxlint@1.46.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.46.0", "@oxlint/binding-android-arm64": "1.46.0", "@oxlint/binding-darwin-arm64": "1.46.0", "@oxlint/binding-darwin-x64": "1.46.0", "@oxlint/binding-freebsd-x64": "1.46.0", "@oxlint/binding-linux-arm-gnueabihf": "1.46.0", "@oxlint/binding-linux-arm-musleabihf": "1.46.0", "@oxlint/binding-linux-arm64-gnu": "1.46.0", "@oxlint/binding-linux-arm64-musl": "1.46.0", "@oxlint/binding-linux-ppc64-gnu": "1.46.0", "@oxlint/binding-linux-riscv64-gnu": "1.46.0", "@oxlint/binding-linux-riscv64-musl": "1.46.0", "@oxlint/binding-linux-s390x-gnu": "1.46.0", "@oxlint/binding-linux-x64-gnu": "1.46.0", "@oxlint/binding-linux-x64-musl": "1.46.0", "@oxlint/binding-openharmony-arm64": "1.46.0", "@oxlint/binding-win32-arm64-msvc": "1.46.0", "@oxlint/binding-win32-ia32-msvc": "1.46.0", "@oxlint/binding-win32-x64-msvc": "1.46.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.11.2" }, "optionalPeers": ["oxlint-tsgolint"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-I9h42QDtAVsRwoueJ4PL/7qN5jFzIUXvbO4Z5ddtII92ZCiD7uiS/JW2V4viBSfGLsbZkQp3YEs6Ls4I8q+8tA=="],
|
||||
|
||||
"p-cancelable": ["[email protected]", "", {}, "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg=="],
|
||||
|
||||
|
||||
+6
-15
@@ -1,19 +1,10 @@
|
||||
{
|
||||
"name": "@t3tools/monorepo",
|
||||
"private": true,
|
||||
"workspaces": {
|
||||
"packages": [
|
||||
"apps/*",
|
||||
"packages/*"
|
||||
],
|
||||
"catalog": {
|
||||
"effect": "https://pkg.pr.new/Effect-TS/effect-smol/effect@f591738",
|
||||
"@effect/platform-node": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/platform-node@f591738",
|
||||
"@effect/sql-sqlite-bun": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/sql-sqlite-bun@f591738",
|
||||
"@effect/vitest": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/vitest@f591738",
|
||||
"@effect/language-service": "0.75.1"
|
||||
}
|
||||
},
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "bun run scripts/dev-runner.mjs dev",
|
||||
"dev:server": "bun run scripts/dev-runner.mjs dev:server",
|
||||
@@ -36,8 +27,8 @@
|
||||
"sync:vscode-icons": "node scripts/sync-vscode-icons.mjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"oxfmt": "^0.35.0",
|
||||
"oxlint": "^1.50.0",
|
||||
"oxfmt": "^0.28.0",
|
||||
"oxlint": "^1.43.0",
|
||||
"turbo": "^2.3.3",
|
||||
"typescript": "^5.7.3",
|
||||
"vitest": "^4.0.0"
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"effect": "catalog:"
|
||||
"effect": "4.0.0-beta.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@effect/language-service": "0.75.1",
|
||||
"@effect/vitest": "catalog:",
|
||||
"@effect/vitest": "4.0.0-beta.10",
|
||||
"tsdown": "^0.20.3",
|
||||
"typescript": "^5.7.3"
|
||||
}
|
||||
|
||||
@@ -3,14 +3,7 @@
|
||||
"compilerOptions": {
|
||||
"plugins": [
|
||||
{
|
||||
"name": "@effect/language-service",
|
||||
"namespaceImportPackages": ["@effect/platform-node"],
|
||||
"diagnosticSeverity": {
|
||||
"importFromBarrel": "error",
|
||||
"anyUnknownInErrorContext": "warning",
|
||||
"instanceOfSchema": "warning",
|
||||
"deterministicKeys": "warning"
|
||||
}
|
||||
"name": "@effect/language-service"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -206,42 +206,6 @@ async function validateBundledClientAssets(clientDir) {
|
||||
}
|
||||
}
|
||||
|
||||
function readWorkspaceCatalog(rootPackageJson) {
|
||||
const workspaces = rootPackageJson?.workspaces;
|
||||
if (!workspaces || typeof workspaces !== "object" || Array.isArray(workspaces)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const catalog = workspaces.catalog;
|
||||
if (!catalog || typeof catalog !== "object" || Array.isArray(catalog)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return catalog;
|
||||
}
|
||||
|
||||
function resolveCatalogDependencies(dependencies, catalog, dependencySourceLabel) {
|
||||
return Object.fromEntries(
|
||||
Object.entries(dependencies).map(([dependencyName, spec]) => {
|
||||
if (typeof spec !== "string" || !spec.startsWith("catalog:")) {
|
||||
return [dependencyName, spec];
|
||||
}
|
||||
|
||||
const catalogKey = spec.slice("catalog:".length).trim();
|
||||
const lookupKey = catalogKey.length > 0 ? catalogKey : dependencyName;
|
||||
const resolvedSpec = catalog[lookupKey];
|
||||
if (typeof resolvedSpec !== "string" || resolvedSpec.length === 0) {
|
||||
fail(
|
||||
`Unable to resolve '${spec}' for ${dependencySourceLabel} dependency '${dependencyName}'. ` +
|
||||
`Expected key '${lookupKey}' in root workspace catalog.`,
|
||||
);
|
||||
}
|
||||
|
||||
return [dependencyName, resolvedSpec];
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const options = parseArgs(process.argv.slice(2));
|
||||
if (options.help) {
|
||||
@@ -253,7 +217,6 @@ async function main() {
|
||||
fail("This script only builds macOS .dmg artifacts and must run on macOS.");
|
||||
}
|
||||
|
||||
const rootPkg = await readJson(path.join(repoRoot, "package.json"));
|
||||
const desktopPkg = await readJson(path.join(repoRoot, "apps/desktop/package.json"));
|
||||
const serverPkg = await readJson(path.join(repoRoot, "apps/server/package.json"));
|
||||
|
||||
@@ -266,11 +229,6 @@ async function main() {
|
||||
if (!dependencies || Object.keys(dependencies).length === 0) {
|
||||
fail("Could not resolve production dependencies from apps/server/package.json.");
|
||||
}
|
||||
const resolvedDependencies = resolveCatalogDependencies(
|
||||
dependencies,
|
||||
readWorkspaceCatalog(rootPkg),
|
||||
"apps/server",
|
||||
);
|
||||
|
||||
const appVersion = options.version ?? serverPkg.version ?? "0.1.0";
|
||||
const stageRoot = path.join(os.tmpdir(), "t3code-desktop-dmg-stage");
|
||||
@@ -333,7 +291,7 @@ async function main() {
|
||||
category: "public.app-category.developer-tools",
|
||||
},
|
||||
},
|
||||
dependencies: resolvedDependencies,
|
||||
dependencies,
|
||||
devDependencies: {
|
||||
electron: electronVersion,
|
||||
},
|
||||
|
||||
+1
-2
@@ -25,8 +25,7 @@
|
||||
},
|
||||
"typecheck": {
|
||||
"dependsOn": ["^typecheck"],
|
||||
"outputs": [],
|
||||
"cache": false
|
||||
"outputs": []
|
||||
},
|
||||
"test": {
|
||||
"dependsOn": ["^build"],
|
||||
|
||||
Reference in new issue
Block a user