Skip to content

docs: publish real README content to npm for @google/adk and @google/adk-devtools - #623

Closed
AmaadMartin wants to merge 2 commits into
google:mainfrom
AmaadMartin:docs/package-readmes
Closed

AmaadMartin wants to merge 2 commits into
google:mainfrom
AmaadMartin:docs/package-readmes

Conversation

@AmaadMartin

@AmaadMartin AmaadMartin commented Aug 5, 2026 •

Copy link
Copy Markdown
Collaborator

Why

@google/adk is downloaded ~693k times a month. This is the entire npm page a
developer lands on:

# @google/adk

Please see README for adk-js at https://github.com/google/adk-js

@google/adk-devtools is two lines. And docs/ — a directory a developer will
click while evaluating the library — contains exactly one file: an internal
design memo whose opening paragraph tells them the goal is "functional parity
with the Python implementation", followed by a Phase 1/2/3 roadmap.

For comparison, ai, @openai/agents, and @mastra/core all open their npm
pages with a one-line value proposition and a runnable code sample. Nothing in
this PR changes behaviour; it changes what a developer sees before they install
anything.

What changed

1. The published README is generated from the repository README

scripts/sync-package-readme.mjs copies the root README.md into core/,
rewriting every relative link and image to an absolute
github.com / raw.githubusercontent.com URL — npmjs.com resolves relative
links against nothing, so ](LICENSE) and relative <img src> are broken on
the package page today.

It is wired into core's prepublishOnly, so the published page cannot
drift from the repository README
— a maintained duplicate would.

The generated file is also committed so it is reviewable in this diff and
visible on GitHub, and so the page is never blank if a publish ever runs with
--ignore-scripts. Two helpers keep that copy honest:

npm run readme:sync    # regenerate
npm run readme:check   # fail if the committed copy is stale

npm run readme:check is a good candidate for a CI step; I left validation.yaml
alone to keep this PR to one concern. npm pack in core/ goes from a 90-byte
README to 4.3 kB.

2. @google/adk-devtools gets a real page

Written by hand rather than generated, because the CLI is genuinely a different
product from the SDK and the root README only mentions it in one bullet. It
covers install, authentication (GEMINI_API_KEY / GOOGLE_GENAI_API_KEY, or
the Vertex AI variables), and every command with its useful flags:
create, run, web, api_server, deploy cloud_run, deploy agent_engine.

It also warns to install the package locally before reaching for npx adk —
on a clean machine npx adk resolves to an unrelated third-party adk package
on the public registry, which is a confusing first five minutes.

3. docs/adk-ts-improvements.md is removed

134 lines of internal design memo, referenced from nowhere in the repo, that
reads to an outside developer as "this library is an unfinished port chasing
Python". It has no user-facing value and docs/ had nothing else in it, so the
directory goes away; the real documentation is at adk.dev and the API reference
is generated by npm run docs:generate.

The content is preserved in git history (git show 81c1422:docs/adk-ts-improvements.md).
If this roadmap is still live, please relocate it to an internal design doc
or a tracking bug
— that is where a Phase 1/2/3 plan belongs, not in a public
package repository.

4. One stale assertion in integrations/test/version_test.ts

integrations/test/version_test.ts asserted version === '1.3.0' while the
package is at 1.6.0 — it has been failing since 1.4.0 and nobody noticed,
because unit:integrations is not in the default npm test projects. It now
asserts a semver shape instead of a literal that nothing keeps in sync.

This is the only remaining integrations/ change. Per review feedback, the
earlier proposal to retire the package (marking it private and removing it
from the release train) has been dropped — @google/adk-integrations stays in
lockstep for future third-party integration work. Happy to revert this test
line too if you would rather the PR touch nothing under integrations/.

Testing

  • npm run build — all three workspaces build.
  • npm run test:unit — 2681 pass. One pre-existing, environment-dependent
    failure in dev/test/cli/cli_create_test.ts (the test mocks execSync but
    getProject() reads process.env.GOOGLE_CLOUD_PROJECT first, so it fails on
    any machine that exports it); it passes with
    env -u GOOGLE_CLOUD_PROJECT, and is untouched by this PR.
  • npx vitest run --project unit:integrations — passes for the first time
    since 1.4.0.
  • npm run lint, npm run format:check — clean.
  • node scripts/sync-package-readme.mjs --check — clean and idempotent; the
    generated README is stable under prettier, so the pre-commit hook does not
    fight it.
  • npm pack --dry-run in core/ lists a 4.3 kB README.md.

Not in scope

No source behaviour changes, no dependency changes, and the root README.md is
untouched — improvements there flow into the npm page automatically via the
sync script.

@AmaadMartin

Copy link
Copy Markdown
Collaborator Author

CI note: the red X is a known main flake, not this PR

run-tests (ubuntu-latest) passes. macOS fails on:

FAIL  integration  tests/integration/app_loader/app_loader_test.ts
  > AgentLoader discovery and loading integration
  > should discover apps vs agents across directories and standalone files
Error: Test timed out in 40000ms.

I re-ran the failed jobs and got the identical failure, so it is not a one-off.
It is also not caused by this change:

  • That test's beforeAll runs npm install inside
    tests/integration/app_loader/discovery and the it() shares a 40 s budget
    (TEST_EXECUTION_TIMEOUT), which macOS runners regularly blow through.
  • The same test is responsible for 4 of the last 5 validation.yaml failures on
    main itself (runs 30957710794, 30955615153, 30953757550,
    30948243444).
  • This PR changes no source: markdown, two package.json script lines, the
    release-please config, and one deleted doc. The fixture depends on
    file:../../../../core and file:../../../../dev and never touches
    @google/adk-integrations.

run-tests (windows-latest) shows cancelled, not failure — the matrix has
fail-fast on, so it was killed when macOS failed. Its Build packages,
Install dependencies, and secret-scan steps all passed before it was cut off.

@AmaadMartin
AmaadMartin force-pushed the docs/package-readmes branch from fb042d4 to ab45925 Compare August 13, 2026 15:52
@ScottMansfield

Copy link
Copy Markdown
Member

This change looks good overall, but I'm declining the integrations package change. We will soon need it for third party integrations, probably just after 2.0 we can add those implementations. I want to continue keeping things in lockstep, even if it's a trivial package for now.

@AmaadMartin AmaadMartin changed the title docs: publish real README content to npm and retire the empty integrations package docs: publish real package READMEs to npm Aug 13, 2026
@AmaadMartin AmaadMartin changed the title docs: publish real package READMEs to npm docs: publish real README content to npm for @google/adk and @google/adk-devtools Aug 13, 2026
@AmaadMartin AmaadMartin changed the title docs: publish real README content to npm for @google/adk and @google/adk-devtools docs: publish real README content to npm and retire the empty integrations package Aug 13, 2026
@AmaadMartin AmaadMartin changed the title docs: publish real README content to npm and retire the empty integrations package docs: publish real README content to npm for @google/adk and @google/adk-devtools Aug 13, 2026
@AmaadMartin

Copy link
Copy Markdown
Collaborator Author

Done — the integrations retirement is dropped. @google/adk-integrations stays in the release train and in lockstep, exactly as you asked.

Reverted in 227a922d (back to the merge-base state, so these four no longer appear in the diff at all):

  • integrations/package.json — "private": true removed
  • release-please-config.json — package entry and linked-versions component restored
  • .release-please-manifest.json — entry restored
  • integrations/README.md — back to the original placeholder

I also retitled the PR, since the squash subject would otherwise have shipped a release note claiming a retirement that is no longer in it.

One judgement call I did not make unilaterally: integrations/test/version_test.ts is still in the diff. It asserted version === '1.3.0' while src/version.ts is release-please-managed and has reached 1.6.0, so it has been failing since 1.4.0 — unnoticed because unit:integrations is not in the default npm test projects. Reverting it would restore a knowingly-red test, so I left it asserting a semver shape instead of a literal nothing keeps in sync. If you would rather this PR touch nothing under integrations/ at all, say the word and I will pull that line and send it separately.

What remains is docs-only: the generated core/ README (synced from the root README via prepublishOnly, so the npm page cannot drift), a hand-written dev/ README for the CLI, and the removal of docs/adk-ts-improvements.md.

Amaad Martin added 2 commits August 20, 2026 14:16
…tions package

The npm page for @google/adk is three lines of "Please see README for adk-js
at ...". @google/adk-devtools is two. That is the first thing a JS developer
sees, and it gives them no reason to keep reading.

- Generate core/README.md from the repository README at publish time
  (scripts/sync-package-readme.mjs, wired into core's prepublishOnly), with
  every relative link and image rewritten to an absolute URL so it resolves on
  npmjs.com. The published page can no longer drift from the repo README.
- Write a real README for @google/adk-devtools: install, authentication, and
  the full adk command surface (create/run/web/api_server/deploy).
- Delete docs/adk-ts-improvements.md, an internal design memo that was the
  entire contents of docs/.
- Stop publishing @google/adk-integrations: it exports nothing but its own
  version string. Marked private and removed from release-please, so no more
  releases are cut for it.
Reviewer declined retiring @google/adk-integrations; it must stay in
lockstep for upcoming third-party integrations. Revert the retirement:
restore integrations to release-please-config.json and the manifest,
remove `private` and restore `prepublishOnly` in its package.json, and
restore the placeholder README.

Keep only the version test fix: src/version.ts is release-please-managed,
so the hardcoded '1.3.0' assertion drifted (the package reached 1.6.0).
Assert the semver shape instead.
@AmaadMartin
AmaadMartin force-pushed the docs/package-readmes branch from 227a922 to 9336d4e Compare August 20, 2026 21:17
kalenkevich pushed a commit that referenced this pull request Sep 14, 2026
…625)

* fix(cli): surface model errors and make agent stack traces readable

`adk run` with a bad, expired, or wrong API key -- the most common
first-run failure -- printed nothing at all and exited 0:

    $ npx adk run agent.ts
    [user]: INFO: [ADK] Sending out request, model: gemini-flash-latest...
    [user]:
    EXITCODE=0

Three separate defects:

1. Model failures ride on `Event.errorCode` / `Event.errorMessage` with
   no `content` (llm_agent.ts), but both event loops in cli_run.ts only
   printed `event.content.parts`, so the error was dropped. Print it to
   stderr and set a non-zero exit code, in interactive and replay mode.

2. `runAgent`'s catch was `console.log(e)` -> stdout, exit 0. Now
   `console.error` plus `process.exitCode = 1` (same for the run
   subcommand and the CLI entrypoint).

3. The agent loader esbuild-bundled and minified the user's file, so
   every trace pointed into a mangled, already-deleted temp bundle:
   `at new H_ (/tmp/adk_agent_loader/.../agent.cjs:537:1742)`.
   Minification is now opt-in and used only for `adk deploy`; local
   commands emit an inline source map, so traces name the developer's
   own file and line.

* fix(dev): make the debug build opt-in and share one agent preload pass

The unminified, source-mapped bundle is what makes an agent's stack trace
readable, but it is 3.5x larger (23.6 MB -> 83.1 MB over the four agents in
the app_loader fixture) and it was applied to every caller, including ones
that never read a trace. That pushed `app_loader_test.ts`'s discovery test
from 18.3s to 29.6s locally against a 40s budget, and made macos-latest fail
deterministically.

Every CLI entry point already passes `minify` explicitly - run/web/api_server
ask for the debug build, both deploy targets opt out - so the loader-level
default is reached only by programmatic callers. Restore it to the historical
"minify when bundling", and gate the source map (and the plugin's chained
entry map) on an explicit `minify: false`. `adk run` still prints
`at new WeatherClient (/path/boom_agent.ts:6:13)` on stderr with exit 1;
nobody else pays for it.

Two pre-existing problems in the same area, which is why this test also failed
on unrelated PRs such as the docs-only #623:

- `preloadAgents()` only set its "done" flag after the whole pass finished, so
  overlapping callers each re-bundled every agent - 4 esbuild builds became 12
  and 5.1s became 13.6s. One timing-out test therefore made the next two
  slower, which is why the failures arrived in clusters. `adk web` hits the
  same path from several routes on concurrent requests.
- `app_loader_test.ts` pinned tests *and hooks* to 40s, overriding the 60s/120s
  budgets vitest.config.ts sets for the integration project in #548. A cold
  `npm install` (~60s) blew the hook budget, and 40s never suited the discovery
  test: it takes 29.8s on a *green* macos-latest run of main.

* refactor(cli): carry minify inside the agent file options object

getAgentFileOptions took minify as a trailing positional parameter, so
the two deploy call sites had to spell out what the bare `true` meant
with a `/* minify= */` marker comment. Making it a field of the options
object the function already takes lets the call site name it directly.

---------

Co-authored-by: Amaad Martin <[email protected]>
@AmaadMartin

Copy link
Copy Markdown
Collaborator Author

Closing this as part of a cleanup: I'm leaving the team and will not be able to
maintain it.

It never picked up a reviewer, so nothing here is waiting on someone else's
feedback. The branch is not deleted and the work is not lost — if anyone wants
to carry it forward, reopen this PR or branch from it directly.

prasanna8585 pushed a commit to prasanna8585/adk-js that referenced this pull request Nov 10, 2026
…oogle#625)

* fix(cli): surface model errors and make agent stack traces readable

`adk run` with a bad, expired, or wrong API key -- the most common
first-run failure -- printed nothing at all and exited 0:

    $ npx adk run agent.ts
    [user]: INFO: [ADK] Sending out request, model: gemini-flash-latest...
    [user]:
    EXITCODE=0

Three separate defects:

1. Model failures ride on `Event.errorCode` / `Event.errorMessage` with
   no `content` (llm_agent.ts), but both event loops in cli_run.ts only
   printed `event.content.parts`, so the error was dropped. Print it to
   stderr and set a non-zero exit code, in interactive and replay mode.

2. `runAgent`'s catch was `console.log(e)` -> stdout, exit 0. Now
   `console.error` plus `process.exitCode = 1` (same for the run
   subcommand and the CLI entrypoint).

3. The agent loader esbuild-bundled and minified the user's file, so
   every trace pointed into a mangled, already-deleted temp bundle:
   `at new H_ (/tmp/adk_agent_loader/.../agent.cjs:537:1742)`.
   Minification is now opt-in and used only for `adk deploy`; local
   commands emit an inline source map, so traces name the developer's
   own file and line.

* fix(dev): make the debug build opt-in and share one agent preload pass

The unminified, source-mapped bundle is what makes an agent's stack trace
readable, but it is 3.5x larger (23.6 MB -> 83.1 MB over the four agents in
the app_loader fixture) and it was applied to every caller, including ones
that never read a trace. That pushed `app_loader_test.ts`'s discovery test
from 18.3s to 29.6s locally against a 40s budget, and made macos-latest fail
deterministically.

Every CLI entry point already passes `minify` explicitly - run/web/api_server
ask for the debug build, both deploy targets opt out - so the loader-level
default is reached only by programmatic callers. Restore it to the historical
"minify when bundling", and gate the source map (and the plugin's chained
entry map) on an explicit `minify: false`. `adk run` still prints
`at new WeatherClient (/path/boom_agent.ts:6:13)` on stderr with exit 1;
nobody else pays for it.

Two pre-existing problems in the same area, which is why this test also failed
on unrelated PRs such as the docs-only google#623:

- `preloadAgents()` only set its "done" flag after the whole pass finished, so
  overlapping callers each re-bundled every agent - 4 esbuild builds became 12
  and 5.1s became 13.6s. One timing-out test therefore made the next two
  slower, which is why the failures arrived in clusters. `adk web` hits the
  same path from several routes on concurrent requests.
- `app_loader_test.ts` pinned tests *and hooks* to 40s, overriding the 60s/120s
  budgets vitest.config.ts sets for the integration project in google#548. A cold
  `npm install` (~60s) blew the hook budget, and 40s never suited the discovery
  test: it takes 29.8s on a *green* macos-latest run of main.

* refactor(cli): carry minify inside the agent file options object

getAgentFileOptions took minify as a trailing positional parameter, so
the two deploy call sites had to spell out what the bare `true` meant
with a `/* minify= */` marker comment. Making it a field of the options
object the function already takes lets the call site name it directly.

---------

Co-authored-by: Amaad Martin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants