Repository navigation
docs: publish real README content to npm for @google/adk and @google/adk-devtools - #623
AmaadMartin wants to merge 2 commits into
Conversation
CI note: the red X is a known
|
fb042d4 to
ab45925
Compare
|
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. |
|
Done — the integrations retirement is dropped. Reverted in
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: What remains is docs-only: the generated |
…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.
227a922 to
9336d4e
Compare
…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]>
|
Closing this as part of a cleanup: I'm leaving the team and will not be able to It never picked up a reviewer, so nothing here is waiting on someone else's |
…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]>
Why
@google/adkis downloaded ~693k times a month. This is the entire npm page adeveloper lands on:
@google/adk-devtoolsis two lines. Anddocs/— a directory a developer willclick 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/coreall open their npmpages 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.mjscopies the rootREADME.mdintocore/,rewriting every relative link and image to an absolute
github.com/raw.githubusercontent.comURL — npmjs.com resolves relativelinks against nothing, so
](LICENSE)and relative<img src>are broken onthe package page today.
It is wired into
core'sprepublishOnly, so the published page cannotdrift 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:checkis a good candidate for a CI step; I leftvalidation.yamlalone to keep this PR to one concern.
npm packincore/goes from a 90-byteREADME to 4.3 kB.
2.
@google/adk-devtoolsgets a real pageWritten 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, orthe 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 adkresolves to an unrelated third-partyadkpackageon the public registry, which is a confusing first five minutes.
3.
docs/adk-ts-improvements.mdis removed134 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 thedirectory 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.tsintegrations/test/version_test.tsassertedversion === '1.3.0'while thepackage is at
1.6.0— it has been failing since 1.4.0 and nobody noticed,because
unit:integrationsis not in the defaultnpm testprojects. It nowasserts a semver shape instead of a literal that nothing keeps in sync.
This is the only remaining
integrations/change. Per review feedback, theearlier proposal to retire the package (marking it
privateand removing itfrom the release train) has been dropped —
@google/adk-integrationsstays inlockstep 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-dependentfailure in
dev/test/cli/cli_create_test.ts(the test mocksexecSyncbutgetProject()readsprocess.env.GOOGLE_CLOUD_PROJECTfirst, so it fails onany 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 timesince 1.4.0.
npm run lint,npm run format:check— clean.node scripts/sync-package-readme.mjs --check— clean and idempotent; thegenerated README is stable under prettier, so the pre-commit hook does not
fight it.
npm pack --dry-runincore/lists a 4.3 kBREADME.md.Not in scope
No source behaviour changes, no dependency changes, and the root
README.mdisuntouched — improvements there flow into the npm page automatically via the
sync script.