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
10 changes: 1 addition & 9 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [
[
"@openagentpack/sdk",
"@openagentpack/project-versions",
"@openagentpack/project-workspace",
"@openagentpack/playground",
"@openagentpack/cli"
]
],
"fixed": [["@openagentpack/sdk", "@openagentpack/playground", "@openagentpack/cli"]],
"linked": [],
"access": "public",
"baseBranch": "main",
Expand Down
35 changes: 12 additions & 23 deletions .dependency-cruiser.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,25 @@ module.exports = {
severity: "error",
comment: "@openagentpack/sdk is the shared engine and must not depend on host packages or applications.",
from: { path: "^packages/sdk/" },
to: { path: "^(packages/cli|apps/server|apps/webui)/" },
to: { path: "^(packages/cli|packages/playground|apps/server|apps/webui)/" },
},
{
name: "no-project-versions-to-hosts-or-apps",
name: "no-sdk-core-to-project-services",
severity: "error",
comment:
"@openagentpack/project-versions is a shared Node engine and must not depend on host packages or applications.",
from: { path: "^packages/project-versions/" },
to: { path: "^(packages/cli|packages/playground|apps/server|apps/webui)/" },
"Core SDK modules must not pull Node project services into the default entry or create dependency cycles.",
from: {
path: "^packages/sdk/src/",
pathNot: "^packages/sdk/src/(internal/project-(versions|workspace)/|project-(versions|workspace)\\.ts$)",
},
to: { path: "^packages/sdk/src/(internal/project-(versions|workspace)/|project-(versions|workspace)\\.ts$)" },
},
{
name: "no-project-workspace-to-hosts-or-apps",
name: "no-project-versions-to-workspace",
severity: "error",
comment: "@openagentpack/project-workspace is a shared Node engine and must not depend on hosts or applications.",
from: { path: "^packages/project-workspace/" },
to: { path: "^(packages/cli|packages/playground|apps/server|apps/webui)/" },
comment: "Snapshot storage must remain independent of the directory workspace adapter.",
from: { path: "^packages/sdk/src/(internal/project-versions/|project-versions\\.ts$)" },
to: { path: "^packages/sdk/src/(internal/project-workspace/|project-workspace\\.ts$)" },
},
{
name: "no-sdk-deep-imports",
Expand All @@ -57,20 +60,6 @@ module.exports = {
from: { path: "^apps/webui/src/" },
to: { path: "^packages/sdk/" },
},
{
name: "no-webui-project-versions-runtime-import",
severity: "error",
comment: "Browser-facing code must use Workbench APIs instead of importing the Node-only version engine.",
from: { path: "^apps/webui/src/" },
to: { path: "^packages/project-versions/" },
},
{
name: "no-webui-project-workspace-runtime-import",
severity: "error",
comment: "Browser-facing code must use Workbench APIs instead of importing the Node-only workspace engine.",
from: { path: "^apps/webui/src/" },
to: { path: "^packages/project-workspace/" },
},
],
options: {
doNotFollow: {
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- node: 24
scope: all
# Library smoke on the SDK engines floor (>=18.17.0): build and install
# sdk, project-versions, and project-workspace; cli/playground require Node >=22.
# SDK and its project subpaths; cli/playground require Node >=22.
- node: 18.17.0
scope: sdk
- node: 20
Expand All @@ -86,8 +86,6 @@ jobs:
- if: matrix.scope == 'sdk'
run: |
bun run build:sdk
bun run build:project-versions
bun run build:project-workspace
bun scripts/release/smoke-packed.ts --sdk-only

gate:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ The [`examples/`](./examples) directory has runnable configs for every provider,

## Using the SDK

Cloud runtime capabilities are available from `@openagentpack/sdk`. Directory compilation, Build/Publish, and full-tree versions are exposed by `@openagentpack/project-workspace`, backed by the storage primitives in `@openagentpack/project-versions`:
Cloud runtime capabilities are available from `@openagentpack/sdk`. The same npm package includes Node-only subpaths: `@openagentpack/sdk/project-workspace` provides directory compilation, Build/Publish, and full-tree versions, backed by the storage primitives in `@openagentpack/sdk/project-versions`:

```ts
import { previewProjectBuild, commitProjectBuild } from "@openagentpack/project-workspace";
import { previewProjectBuild, commitProjectBuild } from "@openagentpack/sdk/project-workspace";

const preview = await previewProjectBuild("./my-agent");
const build = await commitProjectBuild({
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ Beta 用户可以安装 `@openagentpack/cli@beta`;固定版本及切回稳定

## 使用 SDK

云端项目运行能力可通过 `@openagentpack/sdk` 以编程方式调用;仅限 Node.js 的本地项目版本能力由独立包 `@openagentpack/project-versions` 提供
云端项目运行能力可通过 `@openagentpack/sdk` 以编程方式调用;本地版本和目录项目能力随同一个 SDK 包发布,分别通过仅限 Node.js `@openagentpack/sdk/project-versions`、`@openagentpack/sdk/project-workspace` 子路径调用

```ts
import { resolveProjectConfig, planProjectContext } from "@openagentpack/sdk";
import { createProjectVersionService } from "@openagentpack/project-versions";
import { createProjectVersionService } from "@openagentpack/sdk/project-versions";

const config = await resolveProjectConfig({ configPath: "agents.yaml" });
const plan = await planProjectContext(config);
Expand Down
2 changes: 0 additions & 2 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
},
"dependencies": {
"@hono/zod-openapi": "^1.4.0",
"@openagentpack/project-versions": "workspace:*",
"@openagentpack/project-workspace": "workspace:*",
"@openagentpack/sdk": "workspace:*",
"chokidar": "^4.0.3",
"hono": "^4.12.28",
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/routes/project.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { planAgentResourcesWithStateBackend, syncAgentResourcesWithStateBackend } from "@openagentpack/sdk";
import {
acquireDirectoryProjectMutation,
commitProjectBuild,
previewProjectBuild,
readValidProjectBuild,
} from "@openagentpack/project-workspace";
import { planAgentResourcesWithStateBackend, syncAgentResourcesWithStateBackend } from "@openagentpack/sdk";
} from "@openagentpack/sdk/project-workspace";
import { errorResponses } from "@/schemas/common";
import {
AgentApplyBodySchema,
Expand Down
14 changes: 7 additions & 7 deletions apps/server/src/services/project-declarations.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { randomUUID } from "node:crypto";
import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises";
import { basename, dirname, relative, resolve } from "node:path";
import {
acquireDirectoryProjectMutation,
type DirectoryResourceType,
FILE_AUTO_ASSOCIATION_IGNORE_FILE,
inspectDirectoryProject,
locateDirectoryProjectResource,
} from "@openagentpack/project-workspace";
import {
type Diagnostic,
type ResolvedProjectConfig,
resolveProjectConfigFromObject,
validateProjectConfig,
} from "@openagentpack/sdk";
import {
acquireDirectoryProjectMutation,
type DirectoryResourceType,
FILE_AUTO_ASSOCIATION_IGNORE_FILE,
inspectDirectoryProject,
locateDirectoryProjectResource,
} from "@openagentpack/sdk/project-workspace";
import { parse, stringify } from "yaml";
import { type ProjectRuntimeManager, projectRuntimeManager } from "@/services/project-manager";
import { projectMutationCoordinator } from "@/services/project-mutations";
Expand Down
16 changes: 8 additions & 8 deletions apps/server/src/services/project-manager.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import { createHash } from "node:crypto";
import { existsSync } from "node:fs";
import { basename, resolve } from "node:path";
import {
getProjectBuildStatus,
inspectDirectoryProject,
PROJECT_BUILD_FILE,
PROJECT_METADATA_FILE,
PROJECT_STATE_FILE,
resolveDirectoryProjectRuntime,
} from "@openagentpack/project-workspace";
import {
type AgentWithReadiness,
type BackendRuntimeInput,
Expand All @@ -18,6 +10,14 @@ import {
type ResolvedProjectConfig,
readProjectRuntime,
} from "@openagentpack/sdk";
import {
getProjectBuildStatus,
inspectDirectoryProject,
PROJECT_BUILD_FILE,
PROJECT_METADATA_FILE,
PROJECT_STATE_FILE,
resolveDirectoryProjectRuntime,
} from "@openagentpack/sdk/project-workspace";
import { type FSWatcher, watch } from "chokidar";
import { type ProjectMutationSnapshot, projectMutationCoordinator } from "@/services/project-mutations";

Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/services/project-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type {
DirectoryProjectVersionStatus,
DirectoryVersionFileChange,
PreparedDirectoryProjectVersion,
} from "@openagentpack/project-versions";
import { createDirectoryWorkspaceVersionService, inspectDirectoryProject } from "@openagentpack/project-workspace";
} from "@openagentpack/sdk/project-versions";
import { createDirectoryWorkspaceVersionService, inspectDirectoryProject } from "@openagentpack/sdk/project-workspace";
import { type ProjectRuntimeManager, projectRuntimeManager } from "@/services/project-manager";
import { projectMutationCoordinator } from "@/services/project-mutations";

Expand Down
2 changes: 1 addition & 1 deletion apps/server/tests/project-declarations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
acquireDirectoryProjectMutation,
FILE_AUTO_ASSOCIATION_IGNORE_FILE,
previewProjectBuild,
} from "@openagentpack/project-workspace";
} from "@openagentpack/sdk/project-workspace";
import {
commitDeclarationChange,
listProjectDeclarations,
Expand Down
2 changes: 1 addition & 1 deletion apps/server/tests/project-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
commitProjectBuild,
getProjectBuildStatus,
initializeDirectoryProject,
} from "@openagentpack/project-workspace";
} from "@openagentpack/sdk/project-workspace";
import { listProjectDeclarations } from "../src/services/project-declarations";
import { ProjectRuntimeManager } from "../src/services/project-manager";

Expand Down
2 changes: 1 addition & 1 deletion apps/server/tests/project-versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, describe, expect, test } from "bun:test";
import { chmod, mkdir, mkdtemp, readFile, rm, stat, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { initializeDirectoryProject } from "@openagentpack/project-workspace";
import { initializeDirectoryProject } from "@openagentpack/sdk/project-workspace";
import { ProjectRuntimeManager } from "../src/services/project-manager";
import {
commitProjectVersionAfterApply,
Expand Down
42 changes: 3 additions & 39 deletions bun.lock

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

2 changes: 1 addition & 1 deletion docs/contributing/release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# npm releases

OpenAgentPack publishes `@openagentpack/sdk`, `@openagentpack/project-versions`, `@openagentpack/playground`, and `@openagentpack/cli` as one fixed version group. Real publishing happens only in GitHub Actions; local commands can build and dry-run the tarballs but cannot publish them.
OpenAgentPack publishes `@openagentpack/sdk`, `@openagentpack/playground`, and `@openagentpack/cli` as one fixed version group. Local versions and directory projects ship inside the SDK as `@openagentpack/sdk/project-versions` and `@openagentpack/sdk/project-workspace` subpath exports; they are not separate npm packages. Real publishing happens only in GitHub Actions; local commands can build and dry-run the tarballs but cannot publish them.

## One-time repository setup

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/release.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# npm 发布流程

OpenAgentPack 将 `@openagentpack/sdk`、`@openagentpack/project-versions`、`@openagentpack/playground` 和 `@openagentpack/cli` 作为同一版本组发布。真实发布只能在 GitHub Actions 中执行;本地只能构建和 dry-run,不能把包发布到 npm。
OpenAgentPack 将 `@openagentpack/sdk`、`@openagentpack/playground` 和 `@openagentpack/cli` 作为同一版本组发布。本地版本和目录项目随 SDK 一起发布,通过 `@openagentpack/sdk/project-versions`、`@openagentpack/sdk/project-workspace` 子路径导出,不再是独立 npm 包。真实发布只能在 GitHub Actions 中执行;本地只能构建和 dry-run,不能把包发布到 npm。

## 一次性配置

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdk.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SDK reference

`@openagentpack/sdk` is the Node-compatible TypeScript project/runtime SDK that powers the `agents` CLI. Node-only local project versioning is published separately as `@openagentpack/project-versions`, which depends on the SDK for project validation and redaction. This page summarizes the public surface re-exported from `packages/sdk/src/index.ts`; the contract is detailed in [`packages/sdk/docs/public-api-layers.md`](../../packages/sdk/docs/public-api-layers.md).
`@openagentpack/sdk` is the Node-compatible TypeScript project/runtime SDK that powers the `agents` CLI. The same package exports Node-only local snapshots from `@openagentpack/sdk/project-versions` and directory Build/Publish services from `@openagentpack/sdk/project-workspace`. These subpaths share the SDK's validation, transport, and error types without adding project services to the default entry. See [directory projects](../../packages/sdk/docs/project-workspace.md), [local versions](../../packages/sdk/docs/project-versions.md), and the [public API contract](../../packages/sdk/docs/public-api-layers.md).

## Install

Expand Down
10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,18 @@
"dev": "bun run dev:server & bun run dev:webui & wait",
"dev:webui": "bun run --cwd apps/webui dev",
"dev:server": "bun run --cwd apps/server dev",
"typecheck": "bun run build:sdk && bun run build:project-versions && bun run build:project-workspace && bun run typecheck:scripts && bun run typecheck:sdk && bun run typecheck:project-versions && bun run typecheck:project-workspace && bun run typecheck:cli && bun run typecheck:playbooks && bun run typecheck:playground && bun run typecheck:webui && bun run typecheck:server",
"typecheck": "bun run build:sdk && bun run typecheck:scripts && bun run typecheck:sdk && bun run typecheck:cli && bun run typecheck:playbooks && bun run typecheck:playground && bun run typecheck:webui && bun run typecheck:server",
"build:sdk": "bun run --cwd packages/sdk build",
"build:project-versions": "bun run --cwd packages/project-versions build",
"build:project-workspace": "bun run --cwd packages/project-workspace build",
"typecheck:scripts": "tsc -p scripts/tsconfig.json --noEmit",
"typecheck:sdk": "bun run --cwd packages/sdk typecheck",
"typecheck:project-versions": "bun run --cwd packages/project-versions typecheck",
"typecheck:project-workspace": "bun run --cwd packages/project-workspace typecheck",
"typecheck:cli": "bun run --cwd packages/cli typecheck",
"typecheck:playbooks": "bun run --cwd packages/playbooks typecheck",
"typecheck:playground": "bun run --cwd packages/playground typecheck",
"typecheck:webui": "bun run --cwd apps/webui typecheck",
"typecheck:server": "bun run --cwd apps/server typecheck",
"test": "bun run build:sdk && bun run build:project-versions && bun run build:project-workspace && bun run test:verification && bun run test:sdk && bun run test:project-versions && bun run test:project-workspace && bun run test:cli && bun run test:playbooks && bun run test:webui && bun run test:server",
"test": "bun run build:sdk && bun run test:verification && bun run test:sdk && bun run test:cli && bun run test:playbooks && bun run test:webui && bun run test:server",
"test:verification": "bun test scripts/*.test.ts scripts/release/*.test.ts",
"test:sdk": "bun run --cwd packages/sdk test",
"test:project-versions": "bun run --cwd packages/project-versions test",
"test:project-workspace": "bun run --cwd packages/project-workspace test",
"test:cli": "bun run --cwd packages/cli test",
"test:playbooks": "bun run --cwd packages/playbooks test",
"test:webui": "bun run --cwd apps/webui test",
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openagentpack/cli

## 0.7.0

### Minor Changes

- Use SDK subpath exports for project and version commands instead of the standalone project packages.
- Updated dependencies: `@openagentpack/sdk@0.7.0`.

## 0.6.0

### Minor Changes
Expand Down
Loading