feat(agent): remove the experimental harness from pi-agent-core

pi-agent-core now contains only Agent, the agent loop, the proxy stream, and
their types. Removed the harness, sessions and session storage, pico3, harness
tools, compaction, skills, prompt templates, telemetry schemas, search types,
and the uuidv7 and pi-telemetry re-exports, plus the ./node, ./harness/* and
./experimental/pico3 subpath exports. Durable sessions live in
@earendil-works/pi-durable.

Also removed packages/session-backends and the experimental mini and micro
coding-agent frontends, with their scripts and build configuration.
This commit is contained in:
Mario Zechner 2026-10-01 14:44:30 +02:00
parent f29ea3deb2
commit 7fd478a2e8
341 changed files with 12 additions and 105456 deletions

View file

@ -1,22 +1,7 @@
import { Client } from "@earendil-works/pi-client";
import { createAssistantMessageEventStream, Type } from "@earendil-works/pi-ai";
import { complete, getModel, getProviders, streamSimple } from "@earendil-works/pi-ai/compat";
import {
Agent,
bashExecutionToText,
convertToLlm,
createCustomMessage,
FileError,
formatPromptTemplateInvocation,
formatSkillInvocation,
formatSkillsForSystemPrompt,
getOrThrow,
ok,
parseCommandArgs,
streamProxy,
toError,
truncateHead,
} from "@earendil-works/pi-agent-core";
import { Agent, streamProxy } from "@earendil-works/pi-agent-core";
import { decodeCbor, encodeCbor, PROTOCOL_VERSION } from "@earendil-works/pi-protocol";
// Keep this entry browser-safe. It is bundled by scripts/check-browser-smoke.mjs
@ -27,10 +12,6 @@ const stream = createAssistantMessageEventStream();
const agent = new Agent({ initialState: { model }, streamFn: streamSimple });
agent.steer({ role: "user", content: [{ type: "text", text: "queued" }], timestamp: 0 });
const result = getOrThrow(ok({ value: 1 }));
const customMessage = createCustomMessage("note", "hello", true, undefined, "2026-01-01T00:00:00.000Z");
const llmMessages = convertToLlm([customMessage]);
const skill = { name: "browser-safe", description: "Smoke test", content: "Use browser APIs.", filePath: "/skills/browser-safe/SKILL.md" };
console.log(
model.id,
@ -39,23 +20,6 @@ console.log(
schema.type,
typeof stream.push,
agent.hasQueuedMessages(),
result.value,
llmMessages.length,
bashExecutionToText({
role: "bashExecution",
command: "echo ok",
output: "ok",
exitCode: 0,
cancelled: false,
truncated: false,
timestamp: 0,
}),
formatSkillsForSystemPrompt([skill]).length,
formatSkillInvocation(skill).length,
formatPromptTemplateInvocation({ name: "example", content: "$1 $@" }, parseCommandArgs('one "two three"')),
truncateHead("a\nb", { maxLines: 1 }).content,
new FileError("not_found", "missing").code,
toError("boom").message,
typeof streamProxy,
typeof Client,
PROTOCOL_VERSION,

View file

@ -48,12 +48,6 @@ const BUDGETS = {
forbid: ["packages/ai/src/index.ts", "packages/ai/src/utils/typebox-helpers.ts"],
},
},
"packages/agent": {
"./harness/runtime/reducer": { maxFiles: 1 },
"./harness/context": { maxFiles: 6, forbid: ["harness/runtime/", "harness/execution/", "packages/ai/"] },
"./harness/env/nodejs": { maxFiles: 5, forbid: ["packages/ai/", "harness/runtime/"] },
"./harness/session": { maxFiles: 25, forbid: ["harness/runtime/", "harness/execution/", "packages/ai/src/index.ts"] },
},
};
const SPEC = /(?:^|\n)\s*(?:import|export)\s+(?!type\s)([^;]*?\sfrom\s*)?["']([^"']+)["']/g;

View file

@ -17,7 +17,6 @@ const packages = [
{ directory: "packages/agent", name: "@earendil-works/pi-agent-core" },
{ directory: "packages/protocol", name: "@earendil-works/pi-protocol" },
{ directory: "packages/client", name: "@earendil-works/pi-client" },
{ directory: "packages/session-backends/sqlite-node", name: "@earendil-works/pi-session-backend-sqlite-node" },
{ directory: "packages/server", name: "@earendil-works/pi-server" },
{ directory: "packages/coding-agent", name: "@earendil-works/pi-coding-agent" },
];