Repository navigation
refactor: Remove legacy Refusal.retryWith; keep nextActions only - #1977
Conversation
Refusals now express remediation only through nextActions. JSON output already omitted retryWith; the reporter no longer synthesizes a --force action from that field. Co-authored-by: Yam Borodetsky <[email protected]>
🦋 Changeset detectedLatest commit: b6d2d94 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@arkenv/agent-plugin
arkenv
@arkenv/build
@arkenv/bun-plugin
@arkenv/core
@arkenv/fumadocs-ui
@arkenv/nextjs
@arkenv/nuxt
@arkenv/rsbuild-plugin
@arkenv/standard
@arkenv/tanstack-addon
@arkenv/vite-plugin
commit: |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Refusal.retryWithremoved from the type —packages/arkenv/src/shared/errors.tsdrops the legacy field, andJsonReporter.refuseno longer synthesizes a--forcerun-commandfrom it, falling back to[]. The now-unusedNextActionimport is gone too.- Init refusals keep explicit
nextActions—init.tsremoves the redundantretryWithfrom all four refusals, each of which already carried a matchingnextActionsrun-command. Everyrefuse()caller in the repo is ininit.ts, so noretryWith-only refusal remains. - Agent-facing copy repointed — the MCP init tool description,
commands/init.md,agent-plugin/skills/arkenv/SKILL.md, and the internalskills/arkenv/SKILL.mdnow tell agents to retry only when anextActionsrun-commandincludes--force. - Tests and changeset —
reporters.test.tsandinit.test.tsassertnextActions(and that noretryWithstring is serialized);.changeset/drop-retry-with.mdbumps@arkenv/agent-pluginpatch.
Verified that arkenv's src/index.ts is a throwing stub, so Refusal/ERROR_CODES/JsonReporter are internal and removing retryWith is not a public API break. reportErrored never spread retryWith, so the published --json/--agent envelope is unchanged for every in-repo refusal. A whole-repo grep confirms the only surviving retryWith mentions are the new regression guard, docs/CONTEXT.md's avoid-list, and historical changelog/pre-changeset entries — all intentionally left as-is.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to v1, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `v1` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `v1`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @arkenv/[email protected] ### Major Changes - #### Remove the SharedSchema key extractors _[`#2011`](#2011) [`9483c3c`](9483c3c) [@yamcodes](https://github.com/yamcodes)_ `extractSharedKeys` and `extractSharedBlock` are no longer exported from `@arkenv/build`. `@arkenv/nextjs/config` and `@arkenv/nuxt` (including `@arkenv/nuxt/standard/config`) no longer re-export `extractSharedKeys`. Shared keys in a flat `arkenv()` call still come from `extractKeys` and `classifyEnvKeys`. **BREAKING CHANGE**: Those helpers scanned source for a `SharedSchema = { ... }` assignment. Classify a flat `arkenv()` call instead. ```ts import { classifyEnvKeys } from "@arkenv/build"; const { sharedKeys } = classifyEnvKeys(source, ["NEXT_PUBLIC_"]); ``` ### Patch Changes - #### Reject runtime keys in the plugin option guard _[`#2012`](#2012) [`87f3743`](87f3743) [@yamcodes](https://github.com/yamcodes)_ The shared transform-option guard now treats `env`, `coerce`, `onUndeclaredKey`, `arrayFormat`, `emptyAsUndefined`, `debugSecrets`, and `toJsonSchema` as unsupported plugin options. The build reads the loaded environment. ## @arkenv/[email protected] ### Major Changes - #### Export only `arkenvPlugin` from the Bun plugin _[`#2015`](#2015) [`7417dd7`](7417dd7) [@yamcodes](https://github.com/yamcodes)_ `@arkenv/bun-plugin` and `@arkenv/bun-plugin/standard` now export `arkenvPlugin` as the default and the only named export. The `arkenvBunPlugin` and `hybrid` aliases have been removed. `arkenvPlugin` is still both a factory and a plugin object with `name`, `target`, and `setup`. ```ts import arkenvPlugin from "@arkenv/bun-plugin"; await Bun.build({ plugins: [arkenvPlugin], }); ``` **BREAKING CHANGE**: `arkenvBunPlugin` and `hybrid` are no longer exported. Use `arkenvPlugin` instead. - #### Reject runtime options on bundler plugins _[`#2012`](#2012) [`87f3743`](87f3743) [@yamcodes](https://github.com/yamcodes)_ Vite, Bun, and Rsbuild plugins now accept only `schemaPath`, `clientPrefix`, `logger`, and `logLevel`. The build validates the environment loaded for that compile. Variables already set on `process.env` win over env files. ```ts import { arkenvPlugin } from "@arkenv/vite-plugin"; export default { plugins: [arkenvPlugin({ schemaPath: "src/env.ts" })], }; ``` Set `env`, `coerce`, `onUndeclaredKey`, `arrayFormat`, `emptyAsUndefined`, `debugSecrets`, and `toJsonSchema` on `arkenv()` in `env.ts`. The plugin rejects those keys. ```ts import arkenv from "@arkenv/core"; export const env = arkenv( { PORT: "number" }, { coerce: true, onUndeclaredKey: "reject" }, ); ``` **BREAKING CHANGE**: Plugin option types no longer include runtime `arkenv()` fields, including `env`. Passing them now throws. ```diff - arkenvPlugin({ env: { PORT: "3000" }, coerce: true }) + arkenvPlugin({ schemaPath: "src/env.ts" }) ``` ### Patch Changes <details><summary>Updated 3 dependencies</summary> <small> [`87f3743`](87f3743) [`9483c3c`](9483c3c) [`089ef43`](089ef43) </small> - `@arkenv/[email protected]` - `@arkenv/[email protected]` - `@arkenv/[email protected]` </details> ## @arkenv/[email protected] ### Major Changes - #### Remove the SharedSchema key extractors _[`#2011`](#2011) [`9483c3c`](9483c3c) [@yamcodes](https://github.com/yamcodes)_ `extractSharedKeys` and `extractSharedBlock` are no longer exported from `@arkenv/build`. `@arkenv/nextjs/config` and `@arkenv/nuxt` (including `@arkenv/nuxt/standard/config`) no longer re-export `extractSharedKeys`. Shared keys in a flat `arkenv()` call still come from `extractKeys` and `classifyEnvKeys`. **BREAKING CHANGE**: Those helpers scanned source for a `SharedSchema = { ... }` assignment. Classify a flat `arkenv()` call instead. ```ts import { classifyEnvKeys } from "@arkenv/build"; const { sharedKeys } = classifyEnvKeys(source, ["NEXT_PUBLIC_"]); ``` ### Patch Changes <details><summary>Updated 3 dependencies</summary> <small> [`87f3743`](87f3743) [`9483c3c`](9483c3c) [`089ef43`](089ef43) </small> - `@arkenv/[email protected]` - `@arkenv/[email protected]` - `@arkenv/[email protected]` </details> ## @arkenv/[email protected] ### Major Changes - #### Remove the SharedSchema key extractors _[`#2011`](#2011) [`9483c3c`](9483c3c) [@yamcodes](https://github.com/yamcodes)_ `extractSharedKeys` and `extractSharedBlock` are no longer exported from `@arkenv/build`. `@arkenv/nextjs/config` and `@arkenv/nuxt` (including `@arkenv/nuxt/standard/config`) no longer re-export `extractSharedKeys`. Shared keys in a flat `arkenv()` call still come from `extractKeys` and `classifyEnvKeys`. **BREAKING CHANGE**: Those helpers scanned source for a `SharedSchema = { ... }` assignment. Classify a flat `arkenv()` call instead. ```ts import { classifyEnvKeys } from "@arkenv/build"; const { sharedKeys } = classifyEnvKeys(source, ["NEXT_PUBLIC_"]); ``` ### Patch Changes <details><summary>Updated 3 dependencies</summary> <small> [`87f3743`](87f3743) [`9483c3c`](9483c3c) [`089ef43`](089ef43) </small> - `@arkenv/[email protected]` - `@arkenv/[email protected]` - `@arkenv/[email protected]` </details> ## @arkenv/[email protected] ### Major Changes - #### Export only `arkenvPlugin` from the Rsbuild plugin _[`#2015`](#2015) [`7417dd7`](7417dd7) [@yamcodes](https://github.com/yamcodes)_ `@arkenv/rsbuild-plugin` and `@arkenv/rsbuild-plugin/standard` now export `arkenvPlugin` as the default and the only named export. The `arkenvRsbuildPlugin` alias has been removed. ```ts import { arkenvPlugin } from "@arkenv/rsbuild-plugin"; export default defineConfig({ plugins: [arkenvPlugin()], }); ``` **BREAKING CHANGE**: `arkenvRsbuildPlugin` is no longer exported. Import `arkenvPlugin` instead. - #### Reject runtime options on bundler plugins _[`#2012`](#2012) [`87f3743`](87f3743) [@yamcodes](https://github.com/yamcodes)_ Vite, Bun, and Rsbuild plugins now accept only `schemaPath`, `clientPrefix`, `logger`, and `logLevel`. The build validates the environment loaded for that compile. Variables already set on `process.env` win over env files. ```ts import { arkenvPlugin } from "@arkenv/vite-plugin"; export default { plugins: [arkenvPlugin({ schemaPath: "src/env.ts" })], }; ``` Set `env`, `coerce`, `onUndeclaredKey`, `arrayFormat`, `emptyAsUndefined`, `debugSecrets`, and `toJsonSchema` on `arkenv()` in `env.ts`. The plugin rejects those keys. ```ts import arkenv from "@arkenv/core"; export const env = arkenv( { PORT: "number" }, { coerce: true, onUndeclaredKey: "reject" }, ); ``` **BREAKING CHANGE**: Plugin option types no longer include runtime `arkenv()` fields, including `env`. Passing them now throws. ```diff - arkenvPlugin({ env: { PORT: "3000" }, coerce: true }) + arkenvPlugin({ schemaPath: "src/env.ts" }) ``` ### Patch Changes <details><summary>Updated 3 dependencies</summary> <small> [`87f3743`](87f3743) [`9483c3c`](9483c3c) [`089ef43`](089ef43) </small> - `@arkenv/[email protected]` - `@arkenv/[email protected]` - `@arkenv/[email protected]` </details> ## @arkenv/[email protected] ### Major Changes - #### Export only `arkenvPlugin` from the Vite plugin _[`#2015`](#2015) [`7417dd7`](7417dd7) [@yamcodes](https://github.com/yamcodes)_ `@arkenv/vite-plugin` and `@arkenv/vite-plugin/standard` now export `arkenvPlugin` as the default and the only named export. The `arkenvVitePlugin` alias has been removed. ```ts import arkenvPlugin from "@arkenv/vite-plugin"; export default defineConfig({ plugins: [arkenvPlugin()], }); ``` **BREAKING CHANGE**: `arkenvVitePlugin` is no longer exported. Import `arkenvPlugin` instead. - #### Reject runtime options on bundler plugins _[`#2012`](#2012) [`87f3743`](87f3743) [@yamcodes](https://github.com/yamcodes)_ Vite, Bun, and Rsbuild plugins now accept only `schemaPath`, `clientPrefix`, `logger`, and `logLevel`. The build validates the environment loaded for that compile. Variables already set on `process.env` win over env files. ```ts import { arkenvPlugin } from "@arkenv/vite-plugin"; export default { plugins: [arkenvPlugin({ schemaPath: "src/env.ts" })], }; ``` Set `env`, `coerce`, `onUndeclaredKey`, `arrayFormat`, `emptyAsUndefined`, `debugSecrets`, and `toJsonSchema` on `arkenv()` in `env.ts`. The plugin rejects those keys. ```ts import arkenv from "@arkenv/core"; export const env = arkenv( { PORT: "number" }, { coerce: true, onUndeclaredKey: "reject" }, ); ``` **BREAKING CHANGE**: Plugin option types no longer include runtime `arkenv()` fields, including `env`. Passing them now throws. ```diff - arkenvPlugin({ env: { PORT: "3000" }, coerce: true }) + arkenvPlugin({ schemaPath: "src/env.ts" }) ``` ### Patch Changes <details><summary>Updated 3 dependencies</summary> <small> [`87f3743`](87f3743) [`9483c3c`](9483c3c) [`089ef43`](089ef43) </small> - `@arkenv/[email protected]` - `@arkenv/[email protected]` - `@arkenv/[email protected]` </details> ## [email protected] ### Minor Changes - #### Stop installing the agent skill during init _[`#1984`](#1984) [`2c1dd0f`](2c1dd0f) [@yamcodes](https://github.com/yamcodes)_ `arkenv init` no longer prompts for or installs the ArkEnv agent skill, including under `--yes`. When the skill is not already in the project, the next-steps note still prints `npx skills add yamcodes/arkenv`. `@arkenv/agent-plugin` already includes the skill. - #### Scaffold `arkenvPlugin` in Vite and Rsbuild configs _[`#2015`](#2015) [`7417dd7`](7417dd7) [@yamcodes](https://github.com/yamcodes)_ `arkenv init` now writes `arkenvPlugin` into new Vite and Rsbuild config entries. Vite binds the default import as `arkenvPlugin`. Rsbuild imports the named `arkenvPlugin`. ```ts import arkenvPlugin from "@arkenv/vite-plugin"; export default defineConfig({ plugins: [arkenvPlugin()], }); ``` ### Patch Changes - #### Scaffold Zod and Valibot init on standard mode _[`#2020`](#2020) [`a3815e6`](a3815e6) [@yamcodes](https://github.com/yamcodes)_ `arkenv init` no longer installs `arktype` when you choose Zod or Valibot. Next.js, Nuxt, Vite, Rsbuild, and Bun now scaffold the `/standard` integration entry, and Next.js and Nuxt also install `@arkenv/standard`. ```ts import arkenv from "@arkenv/nuxt/standard"; import * as z from "zod"; export const env = arkenv({ DATABASE_URL: z.url(), }); ``` Re-running init replaces the other engine's entry. A Nuxt app that still registers `@arkenv/nuxt/module` switches to `@arkenv/nuxt/standard/module` when you choose Zod or Valibot, and the same replacement applies to the Next.js, Vite, and Rsbuild imports. Choosing ArkType switches those entries back. ArkType init is unchanged: it still installs `arktype` and uses the ArkType integration entry. ## @arkenv/[email protected] ### Patch Changes - #### Parse audit sources with the TypeScript 7 sync API _[`#1990`](#1990) [`f3039bf`](f3039bf) [@yamcodes](https://github.com/yamcodes)_ The agent plugin audit now parses source files through `typescript/unstable/sync` instead of the classic TypeScript compiler API. - #### Point init refusals at nextActions _[`#1977`](#1977) [`dd2fa82`](dd2fa82) [@yamcodes](https://github.com/yamcodes)_ Agent instructions now tell you to retry only when a refusal's `nextActions` include a `run-command` with `--force`. ## @arkenv/[email protected] ### Patch Changes - #### Restore keyword suggestions inside inline schemas _[`#1975`](#1975) [`089ef43`](089ef43) [@yamcodes](https://github.com/yamcodes)_ A partial keyword in an inline schema string suggests ArkType keywords again. `arkenv({ PORT: "n" })` offers `never`, `null`, and `number`. The same suggestions are back on `arkenv` from `@arkenv/core/safe`. ```ts import arkenv from "@arkenv/core"; export const env = arkenv({ PORT: "number.port = 3000", }); ``` ## @arkenv/[email protected] ### Patch Changes - #### Scaffold `arkenvPlugin` in the TanStack add-on _[`#2015`](#2015) [`7417dd7`](7417dd7) [@yamcodes](https://github.com/yamcodes)_ The TanStack CLI add-on now registers the Vite plugin as `arkenvPlugin`. ```ts import arkenvPlugin from "@arkenv/vite-plugin"; export default defineConfig({ plugins: [arkenvPlugin()], }); ``` - #### Point TanStack add-on dependencies at the current release _[`#1978`](#1978) [`888e6c2`](888e6c2) [@yamcodes](https://github.com/yamcodes)_ Scaffolded TanStack Start apps now install `@arkenv/core`, `@arkenv/standard`, and `@arkenv/vite-plugin` at `^1.0.0-rc.2`, which matches the versions on npm `latest` and still accepts `1.0.0` when it publishes. Usage: ```bash npx @tanstack/cli create my-app --add-ons https://arkenv.js.org/tanstack/info.json ``` ## @arkenv/[email protected] No changes in this release. Co-authored-by: arkenv-bot[bot] <237618717+arkenv-bot[bot]@users.noreply.github.com>

Fixes #1935
CLI refusals no longer carry
retryWith. Remediation isnextActionsonly.JsonReporter.refuseused to synthesize a--forcerun-commandwhenretryWithincluded--forceandnextActionswas missing. That fallback is gone. A refusal withoutnextActionsserializesnextActions: []. Init already set both fields, and the JSON envelope never spreadretryWith, so published JSON output does not change. There is no breaking changeset onarkenv.Agent-facing copy in
@arkenv/agent-plugin(init command, skill, MCP tool description) and the repo skill now tell agents to retry only whennextActionsincludes arun-commandwith--force. Historical changelog entries and thedocs/CONTEXT.mdavoid-list still mentionretryWithas the old contract.