diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f303e97..19e976f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ permissions: jobs: publish: - name: Publish agent-memory to npm + name: Publish agent-memory-sdk to npm runs-on: ubuntu-latest steps: @@ -55,9 +55,9 @@ jobs: run: pnpm test - name: Verify public package contents - run: pnpm --filter agent-memory pack --dry-run + run: pnpm --filter agent-memory-sdk pack --dry-run - name: Publish public package - run: pnpm --filter agent-memory publish --access public --no-git-checks + run: pnpm --filter agent-memory-sdk publish --access public --no-git-checks env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 16eefbc..8044ba5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,4 +42,4 @@ jobs: run: pnpm test - name: Verify public package contents - run: pnpm --filter agent-memory pack --dry-run + run: pnpm --filter agent-memory-sdk pack --dry-run diff --git a/AGENTS.md b/AGENTS.md index f7d2a7b..b2debaa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,7 @@ This repo is a TypeScript-first pnpm workspace for the `agent-memory` SDK. - `packages/anthropic` is the private workspace package for Anthropic model calls through the official `@anthropic-ai/sdk` package. - `packages/gemini` is the private workspace package for Gemini model calls through the official `@google/genai` package. - `packages/xai` is the private workspace package for xAI model calls through the documented OpenAI SDK-compatible client path with xAI defaults. -- `packages/agent-memory` is the only public npm package. It should keep `createAgent({ model })` easy and automatic and bundle private workspace package output into `dist/internal`. +- `packages/agent-memory` (`agent-memory-sdk`) is the only public npm package. It should keep `createAgent({ model })` easy and automatic and bundle private workspace package output into `dist/internal`. - `apps/playground` is private and must never ship in npm packages. ## Development Rules @@ -20,7 +20,7 @@ This repo is a TypeScript-first pnpm workspace for the `agent-memory` SDK. - Keep source in TypeScript under `src`; generated output belongs in `dist`. - Add tests before changing SDK behavior. - Keep package build scripts cleaning `dist` before `tsc` so stale artifacts do not publish. -- Default memory should be automatic in `agent-memory`, but core internals should stay adapter-neutral. +- Default memory should be automatic in `agent-memory-sdk`, but core internals should stay adapter-neutral. - Major first-party model provider adapters should use official provider SDKs. Compatibility wrappers are for custom OpenAI-compatible endpoints. - Keep `sqliteMemory()` backed by a real SQLite database file, not JSON. - Keep `postgresMemory()` responsible for running its own versioned migrations before the first database operation by default. @@ -36,4 +36,4 @@ pnpm lint pnpm pack:check ``` -Package dry-runs must only target `agent-memory` and must not include `apps/playground`, `.memory`, `.ai-memory`, generated tarballs, screenshots, logs, or local databases. +Package dry-runs must only target `agent-memory-sdk` and must not include `apps/playground`, `.memory`, `.ai-memory`, generated tarballs, screenshots, logs, or local databases. diff --git a/README.md b/README.md index 363521d..6fbbab3 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,22 @@ -# agent-memory +# agent-memory-sdk TypeScript SDK for building AI agents with automatic, scoped, persistent memory. -`agent-memory` wraps model calls with memory recall and learning so apps can keep useful user, thread, and operation context without manually stuffing long chat histories into every prompt. +`agent-memory-sdk` wraps model calls with memory recall and learning so apps can keep useful user, thread, and operation context without manually stuffing long chat histories into every prompt. ## Install +Install from npm: + +```sh +npm install agent-memory-sdk +``` + +Or with another package manager: + ```sh -pnpm add agent-memory +pnpm add agent-memory-sdk +yarn add agent-memory-sdk ``` For workspace development: @@ -22,7 +31,7 @@ pnpm pack:check ## Quick Start ```ts -import { createAgent, openai } from "agent-memory" +import { createAgent, openai } from "agent-memory-sdk" const agent = createAgent({ model: openai("gpt-5") @@ -54,10 +63,10 @@ If `userId` is omitted, memory is stored in the shared default scope. That is us ## Storage -The public `agent-memory` package defaults to local JSON persistence: +The public `agent-memory-sdk` package defaults to local JSON persistence: ```ts -import { createAgent, openai } from "agent-memory" +import { createAgent, openai } from "agent-memory-sdk" const agent = createAgent({ model: openai("gpt-5") @@ -69,7 +78,7 @@ By default this writes to `.memory/memory.json`. For a real SQLite database: ```ts -import { createAgent, openai, sqliteMemory } from "agent-memory" +import { createAgent, openai, sqliteMemory } from "agent-memory-sdk" const agent = createAgent({ model: openai("gpt-5"), @@ -82,7 +91,7 @@ const agent = createAgent({ For Postgres with pgvector: ```ts -import { createAgent, openai, postgresMemory } from "agent-memory" +import { createAgent, openai, postgresMemory } from "agent-memory-sdk" const agent = createAgent({ model: openai("gpt-5"), @@ -99,27 +108,27 @@ The Postgres adapter runs migrations automatically before the first memory opera ## Model Providers -First-party provider integrations are exported from `agent-memory` and use provider SDKs or documented provider client paths internally. The OpenAI adapter depends on the official `openai` TypeScript SDK: +First-party provider integrations are exported from `agent-memory-sdk` and use provider SDKs or documented provider client paths internally. The OpenAI adapter depends on the official `openai` TypeScript SDK: ```ts -import { openai } from "agent-memory" +import { openai } from "agent-memory-sdk" const model = openai("gpt-5") ``` -Anthropic and Gemini are exported by `agent-memory` and use their official SDKs internally: +Anthropic and Gemini are exported by `agent-memory-sdk` and use their official SDKs internally: ```ts -import { anthropic, gemini } from "agent-memory" +import { anthropic, gemini } from "agent-memory-sdk" const anthropicModel = anthropic("anthropic-model") const geminiModel = gemini("gemini-2.5-pro") ``` -xAI is exported by `agent-memory` too. It uses the documented OpenAI SDK-compatible client path with xAI defaults: +xAI is exported by `agent-memory-sdk` too. It uses the documented OpenAI SDK-compatible client path with xAI defaults: ```ts -import { xai } from "agent-memory" +import { xai } from "agent-memory-sdk" const model = xai("grok-4") ``` @@ -127,7 +136,7 @@ const model = xai("grok-4") Use the OpenAI-compatible helper only for custom providers that expose a compatible chat completions API: ```ts -import { openAICompatible } from "agent-memory" +import { openAICompatible } from "agent-memory-sdk" const model = openAICompatible({ model: "deepseek-chat", @@ -138,7 +147,7 @@ const model = openAICompatible({ ## Package -`agent-memory` is the only public npm package. It bundles the runtime, storage adapters, and model provider adapters behind one install and one import surface. +`agent-memory-sdk` is the only public npm package. It bundles the runtime, storage adapters, and model provider adapters behind one install and one import surface. The repository still keeps implementation boundaries under `packages/*`: @@ -151,7 +160,7 @@ The repository still keeps implementation boundaries under `packages/*`: - `packages/gemini`: Gemini official SDK adapter. - `packages/xai`: xAI adapter using the documented OpenAI SDK-compatible client path. -Those workspace packages are private build units. They are compiled into `agent-memory/dist/internal/*` during the public package build and are not published separately. +Those workspace packages are private build units. They are compiled into `packages/agent-memory/dist/internal/*` during the public package build and are not published separately. ## Examples @@ -181,7 +190,7 @@ pnpm lint pnpm pack:check ``` -Package dry-runs must only publish the `agent-memory` artifact and must not include `apps/playground`, `.memory`, local databases, logs, screenshots, or generated tarballs. +Package dry-runs must only publish the `agent-memory-sdk` artifact and must not include `apps/playground`, `.memory`, local databases, logs, screenshots, or generated tarballs. ## License diff --git a/apps/openai-sqlite-demo/package.json b/apps/openai-sqlite-demo/package.json index 9470c15..1a97428 100644 --- a/apps/openai-sqlite-demo/package.json +++ b/apps/openai-sqlite-demo/package.json @@ -6,6 +6,6 @@ "dev": "node server.mjs" }, "dependencies": { - "agent-memory": "workspace:*" + "agent-memory-sdk": "workspace:*" } } diff --git a/apps/openai-sqlite-demo/server.mjs b/apps/openai-sqlite-demo/server.mjs index 786992f..1705b8d 100644 --- a/apps/openai-sqlite-demo/server.mjs +++ b/apps/openai-sqlite-demo/server.mjs @@ -3,7 +3,7 @@ import { readFile } from "node:fs/promises" import { existsSync } from "node:fs" import { dirname, resolve, relative } from "node:path" import { fileURLToPath } from "node:url" -import { createAgent, openai, sqliteMemory } from "agent-memory" +import { createAgent, openai, sqliteMemory } from "agent-memory-sdk" const appDir = dirname(fileURLToPath(import.meta.url)) const rootDir = resolve(appDir, "../..") diff --git a/apps/playground/package.json b/apps/playground/package.json index 1b44f9c..98d7e5e 100644 --- a/apps/playground/package.json +++ b/apps/playground/package.json @@ -6,6 +6,6 @@ "dev": "node server.mjs" }, "dependencies": { - "agent-memory": "workspace:*" + "agent-memory-sdk": "workspace:*" } } diff --git a/apps/playground/server.mjs b/apps/playground/server.mjs index 17d49b5..143f327 100644 --- a/apps/playground/server.mjs +++ b/apps/playground/server.mjs @@ -5,7 +5,7 @@ import { createAgent, customModel, localMemory -} from "agent-memory" +} from "agent-memory-sdk" const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), "../..") const port = Number(process.env.PORT ?? 4317) diff --git a/eslint.config.js b/eslint.config.js index f831d66..2f722dc 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -19,7 +19,7 @@ export default tseslint.config( ignores: [ ".memory/**", ".ai-memory/**", - "agent-memory-*.tgz", + "agent-memory-sdk-*.tgz", "coverage/**", "dist/**", "**/dist/**", diff --git a/package.json b/package.json index 64cae31..7f272f2 100644 --- a/package.json +++ b/package.json @@ -19,11 +19,11 @@ "packages/*" ], "scripts": { - "build": "pnpm --filter @agent-memory/core build && pnpm --filter @agent-memory/local build && pnpm --filter @agent-memory/sqlite build && pnpm --filter @agent-memory/postgres build && pnpm --filter @agent-memory/openai build && pnpm --filter @agent-memory/anthropic build && pnpm --filter @agent-memory/gemini build && pnpm --filter @agent-memory/xai build && pnpm --filter agent-memory build", + "build": "pnpm --filter @agent-memory/core build && pnpm --filter @agent-memory/local build && pnpm --filter @agent-memory/sqlite build && pnpm --filter @agent-memory/postgres build && pnpm --filter @agent-memory/openai build && pnpm --filter @agent-memory/anthropic build && pnpm --filter @agent-memory/gemini build && pnpm --filter @agent-memory/xai build && pnpm --filter agent-memory-sdk build", "lint": "eslint .", "lint:fix": "eslint . --fix", "test": "pnpm build && node --test packages/agent-memory/test/*.test.mjs test/*.test.mjs", - "pack:check": "pnpm --filter agent-memory pack --dry-run", + "pack:check": "pnpm --filter agent-memory-sdk pack --dry-run", "version:from-tag": "node scripts/sync-package-version-from-tag.mjs" }, "devDependencies": { diff --git a/packages/agent-memory/README.md b/packages/agent-memory/README.md index 1e7cfb4..c5503b4 100644 --- a/packages/agent-memory/README.md +++ b/packages/agent-memory/README.md @@ -1,11 +1,24 @@ -# agent-memory +# agent-memory-sdk TypeScript SDK for building AI agents with automatic, scoped, persistent memory. Full project documentation: [github.com/gharibyan/agent-memory](https://github.com/gharibyan/agent-memory). +## Install + +```sh +npm install agent-memory-sdk +``` + +```sh +pnpm add agent-memory-sdk +yarn add agent-memory-sdk +``` + +## Quick Start + ```ts -import { createAgent, openai } from "agent-memory" +import { createAgent, openai } from "agent-memory-sdk" const agent = createAgent({ model: openai("gpt-5") diff --git a/packages/agent-memory/package.json b/packages/agent-memory/package.json index 0346bcc..18a7802 100644 --- a/packages/agent-memory/package.json +++ b/packages/agent-memory/package.json @@ -1,6 +1,6 @@ { - "name": "agent-memory", - "version": "0.0.0", + "name": "agent-memory-sdk", + "version": "0.0.1", "description": "Provider-neutral agent runtime with automatic persistent memory.", "type": "module", "author": "Gharibyan", diff --git a/packages/anthropic/README.md b/packages/anthropic/README.md index 4515d87..25badee 100644 --- a/packages/anthropic/README.md +++ b/packages/anthropic/README.md @@ -1,9 +1,9 @@ # @agent-memory/anthropic -Anthropic model provider adapter for `agent-memory`, backed by the official `@anthropic-ai/sdk` TypeScript SDK. +Anthropic model provider adapter for `agent-memory-sdk`, backed by the official `@anthropic-ai/sdk` TypeScript SDK. ```ts -import { createAgent } from "agent-memory" +import { createAgent } from "agent-memory-sdk" import { anthropic } from "@agent-memory/anthropic" const agent = createAgent({ diff --git a/packages/core/README.md b/packages/core/README.md index 8ee7783..4d48ff7 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -1,5 +1,5 @@ # packages/core -Private provider-neutral runtime implementation for `agent-memory`. +Private provider-neutral runtime implementation for `agent-memory-sdk`. -Most users should install and import from `agent-memory`. +Most users should install and import from `agent-memory-sdk`. diff --git a/packages/gemini/README.md b/packages/gemini/README.md index eb869f6..6857402 100644 --- a/packages/gemini/README.md +++ b/packages/gemini/README.md @@ -1,9 +1,9 @@ # @agent-memory/gemini -Google Gemini model provider adapter for `agent-memory`, backed by the official `@google/genai` TypeScript SDK. +Google Gemini model provider adapter for `agent-memory-sdk`, backed by the official `@google/genai` TypeScript SDK. ```ts -import { createAgent } from "agent-memory" +import { createAgent } from "agent-memory-sdk" import { gemini } from "@agent-memory/gemini" const agent = createAgent({ diff --git a/packages/local/README.md b/packages/local/README.md index e0dabdc..c0ed4cc 100644 --- a/packages/local/README.md +++ b/packages/local/README.md @@ -1,9 +1,9 @@ # packages/local -Private local persistent memory implementation for `agent-memory`. +Private local persistent memory implementation for `agent-memory-sdk`. ```ts -import { createAgent, localMemory } from "agent-memory" +import { createAgent, localMemory } from "agent-memory-sdk" const agent = createAgent({ model, @@ -11,4 +11,4 @@ const agent = createAgent({ }) ``` -By default, local memory persists to `.memory/memory.json` in the current working directory. This adapter is meant for local development, prototypes, and single-node apps. Use `sqliteMemory()` from `agent-memory` when you need a real SQLite database file. +By default, local memory persists to `.memory/memory.json` in the current working directory. This adapter is meant for local development, prototypes, and single-node apps. Use `sqliteMemory()` from `agent-memory-sdk` when you need a real SQLite database file. diff --git a/packages/openai/README.md b/packages/openai/README.md index e9fff2a..ea83abb 100644 --- a/packages/openai/README.md +++ b/packages/openai/README.md @@ -1,9 +1,9 @@ # packages/openai -Private OpenAI model provider implementation for `agent-memory`, backed by the official `openai` TypeScript SDK. +Private OpenAI model provider implementation for `agent-memory-sdk`, backed by the official `openai` TypeScript SDK. ```ts -import { createAgent, openai } from "agent-memory" +import { createAgent, openai } from "agent-memory-sdk" const agent = createAgent({ model: openai("gpt-5") @@ -13,7 +13,7 @@ const agent = createAgent({ For custom models or providers that expose an OpenAI-compatible chat completions API, use `openAICompatible()`: ```ts -import { openAICompatible } from "agent-memory" +import { openAICompatible } from "agent-memory-sdk" const model = openAICompatible({ model: "deepseek-chat", diff --git a/packages/postgres/README.md b/packages/postgres/README.md index 40f12ca..79d5e27 100644 --- a/packages/postgres/README.md +++ b/packages/postgres/README.md @@ -1,9 +1,9 @@ # packages/postgres -Private Postgres persistence implementation for `agent-memory` with automatic migrations and pgvector retrieval. +Private Postgres persistence implementation for `agent-memory-sdk` with automatic migrations and pgvector retrieval. ```ts -import { createAgent, postgresMemory } from "agent-memory" +import { createAgent, postgresMemory } from "agent-memory-sdk" const agent = createAgent({ model, diff --git a/packages/sqlite/README.md b/packages/sqlite/README.md index 9d79814..3923f11 100644 --- a/packages/sqlite/README.md +++ b/packages/sqlite/README.md @@ -1,9 +1,9 @@ # packages/sqlite -Private SQLite persistent memory implementation for `agent-memory`. +Private SQLite persistent memory implementation for `agent-memory-sdk`. ```ts -import { createAgent, openai, sqliteMemory } from "agent-memory" +import { createAgent, openai, sqliteMemory } from "agent-memory-sdk" const agent = createAgent({ model: openai("gpt-5"), diff --git a/packages/xai/README.md b/packages/xai/README.md index 554ef1f..c484064 100644 --- a/packages/xai/README.md +++ b/packages/xai/README.md @@ -1,9 +1,9 @@ # @agent-memory/xai -xAI model provider adapter for `agent-memory`, using the documented OpenAI SDK-compatible client path with xAI defaults. +xAI model provider adapter for `agent-memory-sdk`, using the documented OpenAI SDK-compatible client path with xAI defaults. ```ts -import { createAgent } from "agent-memory" +import { createAgent } from "agent-memory-sdk" import { xai } from "@agent-memory/xai" const agent = createAgent({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b043f5e..5849e5c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,13 +26,13 @@ importers: apps/openai-sqlite-demo: dependencies: - agent-memory: + 'agent-memory-sdk': specifier: workspace:* version: link:../../packages/agent-memory apps/playground: dependencies: - agent-memory: + 'agent-memory-sdk': specifier: workspace:* version: link:../../packages/agent-memory diff --git a/skills/agent-memory/SKILL.md b/skills/agent-memory/SKILL.md index e173842..e1298dc 100644 --- a/skills/agent-memory/SKILL.md +++ b/skills/agent-memory/SKILL.md @@ -7,13 +7,13 @@ description: Use when building, integrating, testing, or extending the agent-mem ## Overview -`agent-memory` is a TypeScript SDK that wraps model calls with automatic scoped memory, compact recall, and pluggable storage/model adapters. +`agent-memory-sdk` is a TypeScript SDK that wraps model calls with automatic scoped memory, compact recall, and pluggable storage/model adapters. ## When to Use Use this when: -- Adding `agent-memory` to an app, API route, worker, or service. +- Adding `agent-memory-sdk` to an app, API route, worker, or service. - Extending model providers or storage adapters. - Testing memory recall, learning, forget/export, or package boundaries. - Debugging prompt bloat or missing context in long-running chats. @@ -28,12 +28,12 @@ Use this when: - `packages/anthropic`: private Anthropic messages through the official `@anthropic-ai/sdk` package. - `packages/gemini`: private Gemini generation through the official `@google/genai` package. - `packages/xai`: private xAI chat completions through the documented OpenAI SDK-compatible client path with xAI defaults. -- `agent-memory`: the only public npm package. `createAgent({ model })` should work with automatic local memory and should bundle private workspace package output into `dist/internal`. +- `agent-memory-sdk`: the only public npm package. `createAgent({ model })` should work with automatic local memory and should bundle private workspace package output into `dist/internal`. ## Basic Usage ```ts -import { createAgent, openai } from "agent-memory" +import { createAgent, openai } from "agent-memory-sdk" const agent = createAgent({ model: openai("gpt-5") diff --git a/test/automation.test.mjs b/test/automation.test.mjs index d15d1d5..f45ec86 100644 --- a/test/automation.test.mjs +++ b/test/automation.test.mjs @@ -6,6 +6,7 @@ import { test } from "node:test" import { pathToFileURL } from "node:url" const root = new URL("../", import.meta.url) +const internalPackageFilterPattern = /pnpm --filter @agent-memory\/(?:anthropic|core|gemini|local|openai|postgres|sqlite|xai)/ async function read(path) { return readFile(new URL(path, root), "utf8") @@ -24,8 +25,8 @@ test("github ci runs lint, tests, and package boundary check", async () => { assert.match(workflow, /pnpm build/) assert.match(workflow, /pnpm test/) assert.match(workflow, /pnpm lint/) - assert.match(workflow, /pnpm --filter agent-memory pack --dry-run/) - assert.doesNotMatch(workflow, /pnpm --filter @agent-memory\/.* pack --dry-run/) + assert.match(workflow, /pnpm --filter agent-memory-sdk pack --dry-run/) + assert.doesNotMatch(workflow, new RegExp(`${internalPackageFilterPattern.source} pack --dry-run`)) }) test("github publish workflow is tag gated and syncs package version from tag", async () => { @@ -39,15 +40,15 @@ test("github publish workflow is tag gated and syncs package version from tag", assert.match(workflow, /NPM_TOKEN secret is required for npm publishing/) assert.match(workflow, /scripts\/sync-package-version-from-tag\.mjs/) assert.match(workflow, /pnpm build/) - assert.match(workflow, /pnpm --filter agent-memory pack --dry-run/) - assert.match(workflow, /pnpm --filter agent-memory publish --access public --no-git-checks/) - assert.doesNotMatch(workflow, /pnpm --filter @agent-memory\/.* publish --access public --no-git-checks/) + assert.match(workflow, /pnpm --filter agent-memory-sdk pack --dry-run/) + assert.match(workflow, /pnpm --filter agent-memory-sdk publish --access public --no-git-checks/) + assert.doesNotMatch(workflow, new RegExp(`${internalPackageFilterPattern.source} publish --access public --no-git-checks`)) }) test("root package exposes lint and version sync scripts", async () => { const packageJson = await readJson("package.json") - assert.equal(packageJson.scripts.build, "pnpm --filter @agent-memory/core build && pnpm --filter @agent-memory/local build && pnpm --filter @agent-memory/sqlite build && pnpm --filter @agent-memory/postgres build && pnpm --filter @agent-memory/openai build && pnpm --filter @agent-memory/anthropic build && pnpm --filter @agent-memory/gemini build && pnpm --filter @agent-memory/xai build && pnpm --filter agent-memory build") + assert.equal(packageJson.scripts.build, "pnpm --filter @agent-memory/core build && pnpm --filter @agent-memory/local build && pnpm --filter @agent-memory/sqlite build && pnpm --filter @agent-memory/postgres build && pnpm --filter @agent-memory/openai build && pnpm --filter @agent-memory/anthropic build && pnpm --filter @agent-memory/gemini build && pnpm --filter @agent-memory/xai build && pnpm --filter agent-memory-sdk build") assert.equal(packageJson.scripts.lint, "eslint .") assert.equal(packageJson.scripts["version:from-tag"], "node scripts/sync-package-version-from-tag.mjs") }) @@ -57,7 +58,7 @@ test("eslint config ignores local memory and package artifacts", async () => { assert.match(config, /\.memory/) assert.match(config, /\.ai-memory/) - assert.match(config, /agent-memory-\*\.tgz/) + assert.match(config, /agent-memory-sdk-\*\.tgz/) assert.match(config, /no-unused-vars/) assert.match(config, /semi/) }) @@ -86,7 +87,7 @@ test("version sync script updates the publishable package from a v-prefixed tag" await mkdir(sqlitePackageDir, { recursive: true }) await mkdir(xaiPackageDir, { recursive: true }) await writeFile(join(publicPackageDir, "package.json"), JSON.stringify({ - name: "agent-memory", + name: "agent-memory-sdk", version: "0.0.0" }, null, 2)) await writeFile(join(anthropicPackageDir, "package.json"), JSON.stringify({ diff --git a/test/package-boundary.test.mjs b/test/package-boundary.test.mjs index 51239d7..db015a3 100644 --- a/test/package-boundary.test.mjs +++ b/test/package-boundary.test.mjs @@ -28,9 +28,10 @@ test("root and playground packages are private", async () => { assert.equal(openAISqliteDemoPackage.private, true) }) -test("published agent-memory package uses a restrictive files allowlist", async () => { +test("published agent-memory-sdk package uses a restrictive files allowlist", async () => { const packageJson = await readJson("packages/agent-memory/package.json") + assert.equal(packageJson.name, "agent-memory-sdk") assert.equal(packageJson.private, undefined) assert.deepEqual(packageJson.files, [ "dist", diff --git a/test/repository-hygiene.test.mjs b/test/repository-hygiene.test.mjs index 6d361ed..4e71056 100644 --- a/test/repository-hygiene.test.mjs +++ b/test/repository-hygiene.test.mjs @@ -22,6 +22,7 @@ async function listFiles(dir = ".") { .filter((path) => !path.includes("node_modules")) .filter((path) => !path.includes(`${join(".", "dist")}`)) .filter((path) => !path.includes(`${join(".", ".git")}`)) + .filter((path) => !path.includes(`${join(".", ".idea")}`)) .filter((path) => !path.endsWith(`${join(".", ".env")}`)) .filter((path) => !/\.env\.(?!example$)/.test(path)) } @@ -30,7 +31,7 @@ test("root README and MIT license are present", async () => { const readme = await read("README.md") const license = await read("LICENSE") - assert.match(readme, /^# agent-memory/m) + assert.match(readme, /^# agent-memory-sdk/m) assert.match(readme, /MIT License/) assert.match(license, /^MIT License/m) assert.match(license, /Gharibyan/) diff --git a/test/single-package-publish.test.mjs b/test/single-package-publish.test.mjs index 0c6a295..8ee96f7 100644 --- a/test/single-package-publish.test.mjs +++ b/test/single-package-publish.test.mjs @@ -14,6 +14,7 @@ const internalPackageDirs = [ "sqlite", "xai" ] +const internalPackageFilterPattern = /pnpm --filter @agent-memory\/(?:anthropic|core|gemini|local|openai|postgres|sqlite|xai)/ async function exists(path) { try { @@ -39,9 +40,10 @@ async function listFiles(dir) { .map((entry) => join(entry.parentPath, entry.name)) } -test("only agent-memory is publishable from the workspace package set", async () => { +test("only agent-memory-sdk is publishable from the workspace package set", async () => { const publicPackage = await readJson("packages/agent-memory/package.json") + assert.equal(publicPackage.name, "agent-memory-sdk") assert.equal(publicPackage.private, undefined) assert.equal( Object.keys(publicPackage.dependencies ?? {}).some((name) => name.startsWith("@agent-memory/")), @@ -80,15 +82,15 @@ test("agent-memory dist contains bundled first-party internals", async () => { ) }) -test("pack and publish automation only target the agent-memory npm package", async () => { +test("pack and publish automation only target the agent-memory-sdk npm package", async () => { const packageJson = await readJson("package.json") const testWorkflow = await read(".github/workflows/test.yml") const publishWorkflow = await read(".github/workflows/publish.yml") - assert.match(packageJson.scripts["pack:check"], /pnpm --filter agent-memory pack --dry-run/) - assert.doesNotMatch(packageJson.scripts["pack:check"], /@agent-memory\//) - assert.match(testWorkflow, /pnpm --filter agent-memory pack --dry-run/) - assert.doesNotMatch(testWorkflow, /@agent-memory\//) - assert.match(publishWorkflow, /pnpm --filter agent-memory publish --access public --no-git-checks/) - assert.doesNotMatch(publishWorkflow, /@agent-memory\/.* publish/) + assert.match(packageJson.scripts["pack:check"], /pnpm --filter agent-memory-sdk pack --dry-run/) + assert.doesNotMatch(packageJson.scripts["pack:check"], internalPackageFilterPattern) + assert.match(testWorkflow, /pnpm --filter agent-memory-sdk pack --dry-run/) + assert.doesNotMatch(testWorkflow, internalPackageFilterPattern) + assert.match(publishWorkflow, /pnpm --filter agent-memory-sdk publish --access public --no-git-checks/) + assert.doesNotMatch(publishWorkflow, /pnpm --filter @agent-memory\/(?:anthropic|core|gemini|local|openai|postgres|sqlite|xai) publish/) }) diff --git a/test/typescript-structure.test.mjs b/test/typescript-structure.test.mjs index 1e60173..ab2516c 100644 --- a/test/typescript-structure.test.mjs +++ b/test/typescript-structure.test.mjs @@ -74,7 +74,7 @@ test("package structure separates internal runtime, adapters, and public package assert.equal(corePackage.types, "./dist/index.d.ts") assert.deepEqual(corePackage.files, ["dist", "README.md", "package.json"]) - assert.equal(publicPackage.name, "agent-memory") + assert.equal(publicPackage.name, "agent-memory-sdk") assert.equal(publicPackage.main, "./dist/index.js") assert.equal(publicPackage.types, "./dist/index.d.ts") assert.equal(Object.keys(publicPackage.dependencies).some((name) => name.startsWith("@agent-memory/")), false) @@ -150,9 +150,9 @@ test("package structure separates internal runtime, adapters, and public package test("root scripts build TypeScript before test and package checks", async () => { const packageJson = await readJson("package.json") - assert.equal(packageJson.scripts.build, "pnpm --filter @agent-memory/core build && pnpm --filter @agent-memory/local build && pnpm --filter @agent-memory/sqlite build && pnpm --filter @agent-memory/postgres build && pnpm --filter @agent-memory/openai build && pnpm --filter @agent-memory/anthropic build && pnpm --filter @agent-memory/gemini build && pnpm --filter @agent-memory/xai build && pnpm --filter agent-memory build") + assert.equal(packageJson.scripts.build, "pnpm --filter @agent-memory/core build && pnpm --filter @agent-memory/local build && pnpm --filter @agent-memory/sqlite build && pnpm --filter @agent-memory/postgres build && pnpm --filter @agent-memory/openai build && pnpm --filter @agent-memory/anthropic build && pnpm --filter @agent-memory/gemini build && pnpm --filter @agent-memory/xai build && pnpm --filter agent-memory-sdk build") assert.match(packageJson.scripts.test, /pnpm build/) - assert.equal(packageJson.scripts["pack:check"], "pnpm --filter agent-memory pack --dry-run") + assert.equal(packageJson.scripts["pack:check"], "pnpm --filter agent-memory-sdk pack --dry-run") assert.match(packageJson.devDependencies.typescript, /^\^/) })