Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Validate the manifests declare this version
run: |
VERSION="${{ steps.resolve.outputs.value }}"
for f in packages/durable-streams/deno.json packages/runtime/deno.json packages/core/deno.json packages/acp/deno.json packages/workflow/deno.json packages/git/deno.json packages/testing/deno.json packages/test-agent/deno.json packages/web/deno.json packages/cli/deno.json; do
for f in packages/durable-streams/deno.json packages/runtime/deno.json packages/core/deno.json packages/agent/deno.json packages/acp/deno.json packages/workflow/deno.json packages/git/deno.json packages/testing/deno.json packages/test-agent/deno.json packages/web/deno.json packages/cli/deno.json; do
declared="$(jq -r .version "$f")"
if [ "$declared" != "$VERSION" ]; then
echo "::error::$f declares $declared, not $VERSION — the tag does not match the manifests"
Expand Down Expand Up @@ -82,15 +82,22 @@ jobs:
package: packages/core
version: ${{ needs.version.outputs.value }}

agent:
needs: [version, core, durable-streams, runtime]
uses: ./.github/workflows/publish-one.yml
with:
package: packages/agent
version: ${{ needs.version.outputs.value }}

acp:
needs: [version, core, runtime]
needs: [version, agent, core, runtime]
uses: ./.github/workflows/publish-one.yml
with:
package: packages/acp
version: ${{ needs.version.outputs.value }}

workflow:
needs: [version, core, durable-streams, runtime]
needs: [version, agent, core, durable-streams, runtime]
uses: ./.github/workflows/publish-one.yml
with:
package: packages/workflow
Expand All @@ -111,7 +118,7 @@ jobs:
version: ${{ needs.version.outputs.value }}

test-agent:
needs: [version, acp, core, durable-streams, runtime, testing]
needs: [version, acp, agent, core, durable-streams, runtime, testing]
uses: ./.github/workflows/publish-one.yml
with:
package: packages/test-agent
Expand All @@ -125,7 +132,7 @@ jobs:
version: ${{ needs.version.outputs.value }}

cli:
needs: [version, acp, core, durable-streams, git, runtime, test-agent, testing, web, workflow]
needs: [version, acp, agent, core, durable-streams, git, runtime, test-agent, testing, web, workflow]
uses: ./.github/workflows/publish-one.yml
with:
package: packages/cli
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ Locate the package that owns the behavior you are about to change:

- `packages/core/` — the engine: the boundary scanner, component expansion,
`exec` and `eval`, modifiers, and the `execute()` entry point.
- `packages/agent/` — the Agent components (`<AgentProvider>`, `<Agent>`,
`<Session>`, `<Prompt>` and the permission regions), the `Agent` Api, Prompt
journaling and held conversations. A Plugin imports `Agent` from
`@executablemd/agent/api`; a host installs the components from
`@executablemd/agent/host`.
- `packages/cli/` — the `xmd` command. `src/cli.ts` is runtime-neutral;
`src/{deno,node,bun,compiled}.ts` install the host adapters each runtime needs.
- `packages/runtime/` — the contextual host APIs — process, filesystem, env,
Expand Down
12 changes: 12 additions & 0 deletions architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ Providers answer those operations. Runtime entrypoints install the appropriate a

`@executablemd/git` owns repository composition, Git operations, Git-host behavior, issues, and pull requests. It extends Workflow through Workflow’s published boundaries; Workflow imports no Git feature.

`@executablemd/agent` owns the Agent vocabulary over Core: the `Agent` Api,
the Agent, Session and Prompt components, Prompt journaling, provider
installation and held conversations. It depends on Core, durable-streams and
runtime, and reaches Core only through Core's published entries; Core imports no
Agent package and registers no Agent component by itself. Components and
Plugins compose agent work through `@executablemd/agent/api`; a host installs
the vocabulary, a provider and a held conversation through
`@executablemd/agent/host`, and its generic `Plugin` and execution imports stay
Core's. The components keep the origin `@executablemd/core` they had when Core
shipped them, so authored documents and retained journals read the same. ACP,
Workflow, Test Agent and the CLI import Agent's entries directly.

An Agent provider supplies conversation behavior. The Agent proposes source; canonical generated evaluation admits and performs it. Provider conversation continuity has its own contract in the [ACP client specification](specs/acp-client-spec.md).

Ordinary Agent Session placement is inert: a placed session contacts nothing
Expand Down
19 changes: 19 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Agent } from "@executablemd/core/api";
import { Agent } from "@executablemd/agent/api";
import type { Operation } from "effection";
import { z } from "zod";
import { describeFailure, isFilesFailure } from "./failure.ts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AgentPromptError } from "@executablemd/core";
import { Agent, Component } from "@executablemd/core/api";
import type { AgentPromptEvent } from "@executablemd/core/api";
import { AgentPromptError } from "@executablemd/agent/api";
import { Component } from "@executablemd/core/api";
import { Agent } from "@executablemd/agent/api";
import type { AgentPromptEvent } from "@executablemd/agent/api";
import type { Operation, Stream } from "effection";
import { z } from "zod";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Agent, Component } from "@executablemd/core/api";
import type { AgentPromptEvent } from "@executablemd/core/api";
import { Component } from "@executablemd/core/api";
import { Agent } from "@executablemd/agent/api";
import type { AgentPromptEvent } from "@executablemd/agent/api";
import { API, cwd, parseFilesFailure } from "@executablemd/runtime";
import { ensure, type Stream } from "effection";
import { z } from "zod";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createAcpRuntime, createAcpxProvider, createAcpxSessionStore } from "@executablemd/acp";
import { AgentProviders, registerAgentProvider } from "@executablemd/core";
import { AgentProviders, registerAgentProvider } from "@executablemd/agent/api";
import { Component, Plugin } from "@executablemd/core/api";
import { API, command, env, readTextFile } from "@executablemd/runtime";
import { useTestAgentController } from "@executablemd/test-agent";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Agent, Component } from "@executablemd/core/api";
import type { AgentPromptEvent } from "@executablemd/core/api";
import { Component } from "@executablemd/core/api";
import { Agent } from "@executablemd/agent/api";
import type { AgentPromptEvent } from "@executablemd/agent/api";
import type { Stream } from "effection";
import { z } from "zod";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Agent, Component } from "@executablemd/core/api";
import { Component } from "@executablemd/core/api";
import { Agent } from "@executablemd/agent/api";
import { ensureDir, rm } from "@effectionx/fs";
import { z } from "zod";
import { read, write } from "../../components/Ticket/text-storage.ts";
Expand Down
5 changes: 3 additions & 2 deletions examples/agent-certification/observe.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { nativeAdapterFor } from "@executablemd/acp";
import { Agent, Component, configurationOf, sessionOf } from "@executablemd/core";
import type { AgentPromptEvent } from "@executablemd/core";
import { Component } from "@executablemd/core";
import { Agent, configurationOf, sessionOf } from "@executablemd/agent/api";
import type { AgentPromptEvent } from "@executablemd/agent/api";
import { scoped, Err, Ok, useScope, spawn, sleep } from "effection";
import type { Result, Operation, Stream, Task } from "effection";
import {
Expand Down
2 changes: 1 addition & 1 deletion examples/agent-certification/report.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SessionConfiguration } from "@executablemd/core";
import type { SessionConfiguration } from "@executablemd/agent/api";
import { z } from "zod";

export const capability = z.enum([
Expand Down
3 changes: 2 additions & 1 deletion examples/agent-certification/stage-runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { agentIdentityComponents, Agent } from "@executablemd/core";
import { Agent } from "@executablemd/agent/api";
import { agentIdentityComponents } from "@executablemd/agent/host";
import { executeInstalled } from "@executablemd/core/host";
import type { HostExecution } from "@executablemd/core/host";
import { InMemoryStream } from "@executablemd/durable-streams";
Expand Down
2 changes: 1 addition & 1 deletion examples/agent-usage/calibrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { homedir } from "node:os";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import process from "node:process";
import type { PromptUsage } from "@executablemd/core";
import type { PromptUsage } from "@executablemd/agent/api";
import { ALLOWANCE, HELP, parseSelection, Refusal } from "./selection.ts";
import type { Selection } from "./selection.ts";
import {
Expand Down
6 changes: 3 additions & 3 deletions examples/agent-usage/evidence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { exists, readdir, readTextFile } from "@effectionx/fs";
import type { Operation } from "effection";
import { join, resolve } from "node:path";
import { parseDurableEvent } from "@executablemd/durable-streams";
import { AGENT_PROMPT, parsePromptRecord } from "@executablemd/core/host";
import type { PromptRecord } from "@executablemd/core/host";
import type { PromptUsage, ReportedTokens, UsageReading } from "@executablemd/core";
import { AGENT_PROMPT, parsePromptRecord } from "@executablemd/agent/host";
import type { PromptRecord } from "@executablemd/agent/host";
import type { PromptUsage, ReportedTokens, UsageReading } from "@executablemd/agent/api";

/** How one check came out. */
export type Outcome = "verified" | "limited" | "unavailable" | "failed" | "not_run";
Expand Down
2 changes: 1 addition & 1 deletion examples/agent-usage/report.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UsageCoverage, UsageReading } from "@executablemd/core";
import type { UsageCoverage, UsageReading } from "@executablemd/agent/api";
import type { Check } from "./evidence.ts";

/** One acknowledged Prompt, as the shareable report states it. */
Expand Down
4 changes: 2 additions & 2 deletions examples/repl-bench/lib/scripted-sidekick.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createAcpxProvider, createAcpxSessionStore } from "@executablemd/acp";
import { Plugin } from "@executablemd/core/api";
import { registerAgentProvider } from "@executablemd/core";
import { installInvocationAgentProvider } from "@executablemd/core/host";
import { registerAgentProvider } from "@executablemd/agent/api";
import { installInvocationAgentProvider } from "@executablemd/agent/host";
import type { ReplPluginInstallation } from "@executablemd/cli/api";
import { env, readTextFile } from "@executablemd/runtime";
import { useTestAgentController } from "@executablemd/test-agent";
Expand Down
2 changes: 1 addition & 1 deletion examples/repl-bench/lib/wheel-permission.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createAcpxProvider } from "@executablemd/acp";
import { registerAgentProvider } from "@executablemd/core";
import { registerAgentProvider } from "@executablemd/agent/api";
import { Plugin } from "@executablemd/core/api";
import {
createFakeAcp,
Expand Down
3 changes: 2 additions & 1 deletion examples/repl-plugins/counter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { createContext } from "effection";
import type { Operation } from "effection";
import { contributeDocumentation, packageDocumentation } from "@executablemd/core";
import { AgentConversationProvider, Plugin } from "@executablemd/core/api";
import { Plugin } from "@executablemd/core/api";
import { AgentConversationProvider } from "@executablemd/agent/api";
import type { ReplPluginInstallation } from "@executablemd/cli/api";

const Counter = createContext<{ count: number }>("example.repl.counter");
Expand Down
4 changes: 4 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"paths": {
"@executablemd/acp": ["packages/acp/mod.ts"],
"@executablemd/acp/embedded-adapters": ["packages/acp/embedded-adapters.ts"],
"@executablemd/agent/api": ["packages/agent/api.ts"],
"@executablemd/agent/host": ["packages/agent/host.ts"],
"@executablemd/cli": ["packages/cli/src/deno.ts"],
"@executablemd/cli/api": ["packages/cli/api.ts"],
"@executablemd/core": ["packages/core/mod.ts"],
Expand Down Expand Up @@ -66,6 +68,8 @@
"paths": {
"@executablemd/acp": ["../../packages/acp/mod.ts"],
"@executablemd/acp/embedded-adapters": ["../../packages/acp/embedded-adapters.ts"],
"@executablemd/agent/api": ["../../packages/agent/api.ts"],
"@executablemd/agent/host": ["../../packages/agent/host.ts"],
"@executablemd/cli": ["../../packages/cli/src/deno.ts"],
"@executablemd/cli/api": ["../../packages/cli/api.ts"],
"@executablemd/core": ["../../packages/core/mod.ts"],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"devDependencies": {
"@durable-streams/server": "^0.3.8",
"@executablemd/acp": "workspace:*",
"@executablemd/agent": "workspace:*",
"@executablemd/cli": "workspace:*",
"@executablemd/core": "workspace:*",
"@executablemd/durable-streams": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions packages/acp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"@agentclientprotocol/sdk": "1.9.0",
"@executablemd/agent": "workspace:*",
"@executablemd/core": "workspace:*",
"@executablemd/runtime": "workspace:*",
"@openclaw/fs-safe": "0.27.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/acp/src/checkpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* without UUID validation or normalization.
*/

import type { AgentPromptCheckpoint } from "@executablemd/core";
import type { AgentPromptCheckpoint } from "@executablemd/agent/api";
import type { AcpRuntimeTurnResult } from "./acpx-runtime.ts";

interface RecognizedNamespace {
Expand Down
2 changes: 1 addition & 1 deletion packages/acp/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import { each, race, stream, until } from "effection";
import type { Channel, Operation } from "effection";
import type { AgentPromptCheckpoint, AgentPromptEvent, Session } from "@executablemd/core";
import type { AgentPromptCheckpoint, AgentPromptEvent, Session } from "@executablemd/agent/api";
import type { AcpRuntimeTurn, AcpRuntimeTurnResult } from "./acpx-runtime.ts";
import { checkpointFromResult } from "./checkpoint.ts";
import { XmdResponse, XMD_RESPONSE, xmdPromptEvent } from "./xmd-response.ts";
Expand Down
2 changes: 1 addition & 1 deletion packages/acp/src/native-launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import { randomUUID } from "node:crypto";
import type { IdentityProvenance } from "@executablemd/core";
import type { IdentityProvenance } from "@executablemd/agent/api";

/**
* What an adapter knows about the build behind its executable.
Expand Down
5 changes: 3 additions & 2 deletions packages/acp/src/permission-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
import { ensure, Err, Ok, on, race, withResolvers } from "effection";
import type { Operation, Result, Scope, Task } from "effection";
import { z } from "zod";
import { Agent, prepareElicitation, runPreparedElicitation } from "@executablemd/core";
import type { PermissionOption, PermissionRequest, Session } from "@executablemd/core";
import { prepareElicitation, runPreparedElicitation } from "@executablemd/core";
import { Agent } from "@executablemd/agent/api";
import type { PermissionOption, PermissionRequest, Session } from "@executablemd/agent/api";
import type {
AcpPermissionDecision,
AcpPermissionRequest,
Expand Down
Loading
Loading