Chore: reorg files #25
+1
-1
@@ -16,7 +16,7 @@
|
||||
".roo/**",
|
||||
".windsurf/**",
|
||||
"tools/oxlint/anti-slop/**",
|
||||
"src/anti-overengineering.md",
|
||||
"src/skills/anti-overengineering.md",
|
||||
"node_modules/**",
|
||||
"dist/**",
|
||||
"coverage/**",
|
||||
|
||||
+6
-6
@@ -5,27 +5,27 @@
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./agents": {
|
||||
"types": "./dist/agents.d.ts",
|
||||
"types": "./dist/agents/agents.d.ts",
|
||||
"import": "./dist/agents.js"
|
||||
},
|
||||
"./multi-work": {
|
||||
"types": "./dist/multi-work.d.ts",
|
||||
"types": "./dist/multi-work/multi-work.d.ts",
|
||||
"import": "./dist/multi-work.js"
|
||||
},
|
||||
"./quota": {
|
||||
"types": "./dist/quota-plugin.d.ts",
|
||||
"types": "./dist/quota/quota-plugin.d.ts",
|
||||
"import": "./dist/quota-plugin.js"
|
||||
},
|
||||
"./tui": {
|
||||
"types": "./dist/tui.d.ts",
|
||||
"types": "./dist/quota/tui.d.ts",
|
||||
"import": "./dist/tui.js"
|
||||
},
|
||||
"./quota/tui": {
|
||||
"types": "./dist/tui.d.ts",
|
||||
"types": "./dist/quota/tui.d.ts",
|
||||
"import": "./dist/tui.js"
|
||||
},
|
||||
"./quota-rpc": {
|
||||
"types": "./dist/quota-rpc.d.ts",
|
||||
"types": "./dist/quota/quota-rpc.d.ts",
|
||||
"import": "./dist/quota-rpc.js"
|
||||
}
|
||||
},
|
||||
|
||||
+8
-5
@@ -7,24 +7,27 @@ export async function build() {
|
||||
const results = await Promise.all([
|
||||
Bun.build({
|
||||
entrypoints: [
|
||||
"src/agents.ts",
|
||||
"src/multi-work.ts",
|
||||
"src/quota-plugin.ts",
|
||||
"src/quota-rpc.ts",
|
||||
"src/agents/agents.ts",
|
||||
"src/multi-work/multi-work.ts",
|
||||
"src/quota/quota-plugin.ts",
|
||||
"src/quota/quota-rpc.ts",
|
||||
],
|
||||
outdir: "dist",
|
||||
naming: "[name].[ext]",
|
||||
target: "bun",
|
||||
format: "esm",
|
||||
}),
|
||||
Bun.build({
|
||||
entrypoints: ["scripts/install.ts"],
|
||||
outdir: "dist",
|
||||
naming: "[name].[ext]",
|
||||
target: "bun",
|
||||
format: "esm",
|
||||
}),
|
||||
Bun.build({
|
||||
entrypoints: ["src/tui.tsx"],
|
||||
entrypoints: ["src/quota/tui.tsx"],
|
||||
outdir: "dist",
|
||||
naming: "[name].[ext]",
|
||||
target: "bun",
|
||||
format: "esm",
|
||||
external: ["@opencode/plugin/tui", "@opentui/solid", "solid-js"],
|
||||
|
||||
@@ -5,7 +5,7 @@ import { tmpdir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
import { createServer } from "node:net";
|
||||
import { OpenCode } from "@opencode/client";
|
||||
import { command } from "../src/herdr.js";
|
||||
import { command } from "../src/multi-work/herdr.js";
|
||||
import { z } from "zod";
|
||||
|
||||
const binary = process.env.OPENCODE_2022;
|
||||
@@ -358,7 +358,7 @@ try {
|
||||
server.kill();
|
||||
await server.exited;
|
||||
const quotaBuild = await Bun.build({
|
||||
entrypoints: [resolve("src/quota-plugin.ts")],
|
||||
entrypoints: [resolve("src/quota/quota-plugin.ts")],
|
||||
outdir: join(temp, "plugin", "quota"),
|
||||
naming: "index.js",
|
||||
target: "bun",
|
||||
|
||||
@@ -8,8 +8,8 @@ import { descriptions, routingGuide } from "./routing.js";
|
||||
import { Skill } from "@opencode/schema/skill";
|
||||
import { AbsolutePath } from "@opencode/schema/schema";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import antiOverengineering from "./anti-overengineering.md" with { type: "text" };
|
||||
import taskPlanning from "./task-planning.md" with { type: "text" };
|
||||
import antiOverengineering from "../skills/anti-overengineering.md" with { type: "text" };
|
||||
import taskPlanning from "../skills/task-planning.md" with { type: "text" };
|
||||
import { AgentsRpc } from "./agents-rpc.js";
|
||||
|
||||
// Permission actions use wildcards, not filesystem globs.
|
||||
@@ -4,12 +4,12 @@ import { Session } from "@opencode/schema/session";
|
||||
import { AbsolutePath } from "@opencode/schema/schema";
|
||||
import type { Context } from "@opencode/plugin/effect/plugin";
|
||||
import { Plugin } from "@opencode/plugin/effect";
|
||||
import { AgentsRpc } from "./agents-rpc.js";
|
||||
import { AgentsRpc } from "../agents/agents-rpc.js";
|
||||
import { Cause, Effect, Schedule, Stream } from "effect";
|
||||
import { z } from "zod";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { Herdr, rootSchema } from "./herdr.js";
|
||||
import { multiWorkGuide } from "./routing.js";
|
||||
import { multiWorkGuide } from "../agents/routing.js";
|
||||
|
||||
export const bindingSchema = z
|
||||
.object({
|
||||
@@ -2,7 +2,7 @@ import { afterEach, beforeEach, expect, test } from "bun:test";
|
||||
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { ClaudeQuotaTracker, normalizeClaudeQuota } from "../src/claude-quota.js";
|
||||
import { ClaudeQuotaTracker, normalizeClaudeQuota } from "../src/quota/claude-quota.js";
|
||||
|
||||
const payload = {
|
||||
five_hour: { utilization: 12.5, resets_at: "2026-10-07T12:00:00+00:00" },
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { Plugin, Model, Provider } from "@opencode/plugin/effect";
|
||||
import { fromPromise } from "@opencode/plugin/promise/adapter";
|
||||
import { Effect } from "effect";
|
||||
import agents from "../../src/agents.js";
|
||||
import agents from "../../src/agents/agents.js";
|
||||
|
||||
export default Plugin.define({
|
||||
id: agents.id,
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@ import { Tool } from "@opencode/schema/tool";
|
||||
import { Cause, Effect } from "effect";
|
||||
import { z } from "zod";
|
||||
import { appendFile } from "node:fs/promises";
|
||||
import multiWork from "../../src/multi-work.js";
|
||||
import multiWork from "../../src/multi-work/multi-work.js";
|
||||
|
||||
const probe = Rpc.define({
|
||||
id: "multi-work-test",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { afterEach, expect, test } from "bun:test";
|
||||
import { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { command, Herdr } from "../src/herdr.js";
|
||||
import { command, Herdr } from "../src/multi-work/herdr.js";
|
||||
|
||||
const directories: string[] = [];
|
||||
afterEach(async () => {
|
||||
|
||||
@@ -9,8 +9,8 @@ import type { ToolEditor, ToolHooks } from "@opencode/plugin/effect/tool";
|
||||
import type { AgentEditor } from "@opencode/plugin/effect/agent";
|
||||
import type { SessionContext } from "@opencode/plugin/effect/session";
|
||||
import { z } from "zod";
|
||||
import { Herdr, type HerdrRoot } from "../src/herdr.js";
|
||||
import { bindingKey, bindingSchema, installMultiWork } from "../src/multi-work.js";
|
||||
import { Herdr, type HerdrRoot } from "../src/multi-work/herdr.js";
|
||||
import { bindingKey, bindingSchema, installMultiWork } from "../src/multi-work/multi-work.js";
|
||||
|
||||
class FixtureHerdr extends Herdr {
|
||||
eligible = true;
|
||||
|
||||
@@ -7,10 +7,10 @@ import type { SkillEditor } from "@opencode/plugin/promise/skill";
|
||||
import type { DeepMutable } from "@opencode/plugin/promise/types";
|
||||
import type { Skill } from "@opencode/schema/skill";
|
||||
import type { ModelInfo } from "@opencode/client";
|
||||
import plugin from "../src/agents.js";
|
||||
import { model } from "../src/model.js";
|
||||
import plugin from "../src/agents/agents.js";
|
||||
import { model } from "../src/agents/model.js";
|
||||
import { z } from "zod";
|
||||
import { AgentsRpc } from "../src/agents-rpc.js";
|
||||
import { AgentsRpc } from "../src/agents/agents-rpc.js";
|
||||
|
||||
const cleanups: Plugin.Cleanup[] = [];
|
||||
afterEach(async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import type { Plugin } from "@opencode/plugin";
|
||||
import quota from "../src/quota-plugin.js";
|
||||
import { QuotaRpc } from "../src/quota-rpc.js";
|
||||
import quota from "../src/quota/quota-plugin.js";
|
||||
import { QuotaRpc } from "../src/quota/quota-rpc.js";
|
||||
|
||||
test("Quota loads independently and retains its RPC ID and nullable status", async () => {
|
||||
let controller: ReadableStreamDefaultController<unknown>;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import type { Schema } from "effect";
|
||||
import { normalizeQuota, QuotaTracker } from "../src/quota.js";
|
||||
import { normalizeQuota, QuotaTracker } from "../src/quota/quota.js";
|
||||
|
||||
const plus = {
|
||||
plan_type: "plus",
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import type { Route, SlotMap } from "@opencode/plugin/tui/context";
|
||||
import { testRender, type JSX } from "@opentui/solid";
|
||||
import { createSignal } from "solid-js";
|
||||
import { build } from "../scripts/build.js";
|
||||
import type { QuotaStatus } from "../src/quota.js";
|
||||
import type { QuotaStatus } from "../src/quota/quota.js";
|
||||
|
||||
type SidebarSlotRender = (input: { readonly sessionID: string }) => JSX.Element;
|
||||
type HomeSlotRender = (input: SlotMap["prompt.footer"]) => JSX.Element;
|
||||
@@ -27,7 +27,7 @@ const status = (plan: string, remaining: number): QuotaStatus => ({
|
||||
test("built quota slot stays reactive across pending, empty, failure, update, and session states", async () => {
|
||||
await build();
|
||||
// Resolve the built bundle at runtime; tsc runs before build creates dist/tui.js.
|
||||
const tui: typeof import("../src/tui.js") = await import(
|
||||
const tui: typeof import("../src/quota/tui.js") = await import(
|
||||
new URL("../dist/tui.js", import.meta.url).href
|
||||
);
|
||||
const { default: plugin } = tui;
|
||||
|
||||
Reference in New Issue
Block a user