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