Skip to content

refactor: Port the agent-plugin audit off the classic TypeScript compiler API - #1990

Merged
yamcodes merged 6 commits into
v1from
cursor/agent-plugin-ts6-audit-e43a
Sep 25, 2026
Merged

yamcodes merged 6 commits into
v1from
cursor/agent-plugin-ts6-audit-e43a

Conversation

@yamcodes

@yamcodes yamcodes commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1987

Part of #1787. This does not close #1787 and does not unblock #1988.

typescript/unstable/ast cannot parse source text. The audit now parses with typescript/unstable/sync: updateSnapshot({ openFiles }), then program.getSourceFile(). @typescript/typescript6 is not a dependency.

  • Audit diagnostics are unchanged.
  • Catalog typescript stays on 6.0.3. @arkenv/agent-plugin depends on [email protected] directly, and the root install still resolves [email protected].
  • No source file imports the classic typescript entry. typescript/unstable/* is the allowed parser import.
Open in Web Open in Cursor 

typescript/unstable/ast cannot parse source text, so the audit depends on
@typescript/typescript6 instead of the classic typescript entry.

Fixes #1987

Co-authored-by: Yam Borodetsky <[email protected]>
@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d7fdd3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@arkenv/agent-plugin Patch

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

@yamcodes yamcodes added dependencies Pull requests that update a dependency file maintenance Routine tasks, tooling, and syncs refactor A change to the codebase that's neither a bug fix nor added functionality skills Issues or Pull Requests related to ArkEnv Agent Skills labels Sep 25, 2026 — with Cursor
@github-actions github-actions Bot added docs Adds or changes documentation, or acts as documentation in and of itself tests This issue or PR is about adding, removing or changing tests labels Sep 25, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@arkenv/agent-plugin

npm i https://pkg.pr.new/@arkenv/agent-plugin@1990

arkenv

npm i https://pkg.pr.new/arkenv@1990

@arkenv/build

npm i https://pkg.pr.new/@arkenv/build@1990

@arkenv/bun-plugin

npm i https://pkg.pr.new/@arkenv/bun-plugin@1990

@arkenv/core

npm i https://pkg.pr.new/@arkenv/core@1990

@arkenv/fumadocs-ui

npm i https://pkg.pr.new/@arkenv/fumadocs-ui@1990

@arkenv/nextjs

npm i https://pkg.pr.new/@arkenv/nextjs@1990

@arkenv/nuxt

npm i https://pkg.pr.new/@arkenv/nuxt@1990

@arkenv/rsbuild-plugin

npm i https://pkg.pr.new/@arkenv/rsbuild-plugin@1990

@arkenv/standard

npm i https://pkg.pr.new/@arkenv/standard@1990

@arkenv/tanstack-addon

npm i https://pkg.pr.new/@arkenv/tanstack-addon@1990

@arkenv/vite-plugin

npm i https://pkg.pr.new/@arkenv/vite-plugin@1990

commit: d7fdd3c

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one minor suggestion inline.

Reviewed changes

  • Parser dependency swap — packages/agent-plugin/src/audit/scan.ts now imports ts from @typescript/typescript6; typescript moves out of dependencies and @typescript/typescript6@^6.0.2 moves in, with typescript retained in devDependencies for tsc --noEmit.
  • Boundary test — new src/audit/typescript-import.test.ts walks src/ and asserts no source file statically imports the classic typescript entry.
  • Changeset + lockfile — patch changeset for @arkenv/agent-plugin (in the existing #### format) plus the matching nub.lock importer/package entries.

I verified the fallback is a true drop-in: @typescript/[email protected] is the Microsoft-published shim (lib/typescript.js → module.exports = require("@typescript/old"), where @typescript/old is npm:typescript@^6). Installing it standalone confirmed createSourceFile, ScriptTarget, ScriptKind, forEachChild, SyntaxKind, and the is* guards the audit uses are all present, so the reported diagnostics are unchanged. No existing test mocks typescript, so the import swap can't silently break the suite. Catalog typescript is untouched, and no repo lint forces catalog-only dependencies — rewrite-publish-protocols.js leaves the explicit ^6.0.2 range as-is at publish.

The one inline suggestion is a small hardening of the new guard; it does not block merge.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

The agent-plugin boundary guard now flags import(), bare import, and
typescript/* subpaths, including .mts and .cts sources.

Co-authored-by: Yam Borodetsky <[email protected]>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Re-reviewed the commit pushed since the prior pullfrog review (7c449579 → f222e453), which addresses the one inline suggestion from that review. The parser swap itself is unchanged and still correct.

  • Broadened the import guard — CLASSIC_TYPESCRIPT_IMPORT now also matches dynamic import("typescript"), bare side-effect import "typescript", and typescript/* subpaths, so the boundary test no longer only catches from/require spellings.
  • Widened the source walk — the file filter now includes .mts and .cts.
  • Added positive coverage — a second it asserts the matcher flags each newly-covered spelling, so the test can fail if the regex regresses.

I re-ran the guard logic directly against the checked-out tree: the regex matches all five positive samples and correctly ignores @typescript/typescript6 (and the test file's own const specifier = "typescript" line), and a simulated walk of src/ yields 14 files with 0 offenders, so the broadened pattern introduces no self-match or false positive. The new positive assertions fail against the previous regex, so this is real coverage rather than theatre. The prior review thread was resolved by the author and I've confirmed the concern is fully addressed.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@yamcodes

Copy link
Copy Markdown
Owner Author

This should not land. @typescript/typescript6 is the classic compiler under another name, and #1987 no longer allows that fallback.

createSourceFile on typescript/unstable/ast only accepts statements that are already parsed. TypeScript 7.0.2 can still produce a SourceFile through typescript/unstable/sync: updateSnapshot, then program.getSourceFile(). The audit only needs that syntax walk.

Please drop @typescript/typescript6 from the package and the lockfile and parse with that API instead.

Drop @typescript/typescript6. The audit now builds a SourceFile through
typescript/unstable/sync updateSnapshot and program.getSourceFile.

Co-authored-by: Yam Borodetsky <[email protected]>
@yamcodes

Copy link
Copy Markdown
Owner Author

Addressed in 58f45d0. @typescript/typescript6 is gone from the package and the lockfile. The audit now parses with typescript/unstable/sync: a virtual file, updateSnapshot({ openFiles }), then program.getSourceFile(). Catalog typescript stays on 6.0.3; this package depends on [email protected] directly. The existing audit tests still pass.

@github-actions github-actions Bot added the playground Issues or Pull Requests concerning a playground. (Found in the `apps/playgrounds/` directory) label Sep 25, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

The branch tip (5c067f57) bumps apps/playgrounds/arkenv-cli to [email protected] without regenerating nub.lock, so nub install --frozen-lockfile fails and every CI job dies at the install step.

Reviewed changes

Re-reviewed the commits that landed since the prior pullfrog approval (7b0a258d): the parser was re-ported from the @typescript/typescript6 shim to the TypeScript 7 unstable/* API (58f45d0a), and the arkenv-cli playground's typescript was bumped to 7.0.2 (5c067f57).

  • Parser port to TS7 — scan.ts drops createSourceFile for typescript/unstable/sync + createVirtualFileSystem, resolves nodes via getDefaultProjectForFile(...).program.getSourceFile(...), and switches the ts.* guards, ts.Node/ts.SourceFile types, and ts.SyntaxKind to named exports from typescript/unstable/ast.
  • Dependency + lockfile — @arkenv/agent-plugin now depends on [email protected] (classic typescript removed from devDependencies); nub.lock gains [email protected] and its twenty platform optional packages.
  • Changeset + guard — the TS6 changeset is replaced by agent-plugin-ts7-sync.md; the import-boundary regex now also bans @typescript/typescript6 while explicitly allowing typescript/unstable/*.
  • Playground bump — apps/playgrounds/arkenv-cli/package.json moves typescript from ~6.0.2 to 7.0.2 (current tip only), leaving nub.lock stale.

I verified the port against the published [email protected] on linux-x64: createVirtualFileSystem, updateSnapshot({ openFiles }), getDefaultProjectForFile, and program.getSourceFile all behave; api.close() before traversal is safe (nodes materialize from the returned binary buffer, not the closed client); every audited extension (.ts/.tsx/.js/.jsx/.mjs/.cjs/.mts/.cts/.d.ts) parses with the correct inferred scriptKind; and the process.env / import.meta.env / schema-key / canonical-import predicates reproduce the prior results. Diagnostics are unchanged.

ℹ️ Nitpicks

  • typescript-import.test.ts:8 now includes @typescript\/typescript6 in the banned alternation, but no positive sample exercises it — a regression that dropped the shim branch would still pass. Adding one @typescript/typescript6 sample to samples closes that gap.

Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:

  • apps/playgrounds/arkenv-cli/package.json:35 (RIGHT) — file not in PR diff

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread packages/agent-plugin/src/audit/scan.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

This delta (the autofix commit 5c067f57) bumps apps/playgrounds/arkenv-cli to [email protected] without updating nub.lock, so nub install --frozen-lockfile fails with ERR_NUB_OUTDATED_LOCKFILE and every CI job aborts at the install step.

Reviewed changes

Focused re-review of the only commit that landed after my previous review (58f45d0a → 5c067f57).

  • Playground typescript aligned to 7.0.2 — apps/playgrounds/arkenv-cli/package.json moves from ~6.0.2 to 7.0.2 (committed by autofix.ci), while nub.lock still records ~6.0.2 for that importer.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

auditProject opens every source file in a single snapshot. The lockfile
now records [email protected] for the CLI playground so frozen installs match
the manifest.

Co-authored-by: Yam Borodetsky <[email protected]>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Re-reviewed 5c067f57 → d7fdd3c3, the single commit that landed since the prior pullfrog review. It fixes both cautions raised on the previous commits.

  • Single-session project audit — auditProject now opens every collected file in one API/updateSnapshot({ openFiles }) and reuses that snapshot, so a tree audit no longer spawns a native tsc --api process (and builds a full program) per file. The new private auditParsed takes the already-parsed SourceFile, and the one-off parseSourceFile survives only to serve the public single-file auditSource.
  • Lockfile regenerated — nub.lock now records [email protected] for the arkenv-cli-playground importer (as well as @arkenv/agent-plugin), so nub install --frozen-lockfile succeeds and CI is no longer blocked at install.

The auditParsed extraction preserves the per-file diagnostic path: isEnvModule/isClientFile/hasCanonicalEnvImport are still keyed off filePath + source, and line/character offsets still come from the parsed SourceFile's own text, so sharing a program across files cannot change any file's AST or reported positions. Both prior pullfrog threads were addressed and resolved by the author. On this tip, CI now clears install, test-typesafety (tsc --noEmit under TS 7.0.2), and test-build (lts) (TS7 tsc -b over the playground's project references); test/test-vite-compatibility/test-e2e were still running at review time and are unaffected by the delta.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@yamcodes
yamcodes merged commit f3039bf into v1 Sep 25, 2026
21 checks passed
@yamcodes
yamcodes deleted the cursor/agent-plugin-ts6-audit-e43a branch September 25, 2026 10:52
@arkenv-bot arkenv-bot Bot mentioned this pull request Sep 25, 2026
yamcodes pushed a commit that referenced this pull request Sep 25, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file docs Adds or changes documentation, or acts as documentation in and of itself maintenance Routine tasks, tooling, and syncs playground Issues or Pull Requests concerning a playground. (Found in the `apps/playgrounds/` directory) refactor A change to the codebase that's neither a bug fix nor added functionality skills Issues or Pull Requests related to ArkEnv Agent Skills tests This issue or PR is about adding, removing or changing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port the agent-plugin audit off the classic TypeScript compiler API TypeScript 7 upgrade (classic compiler API / Twoslash)

2 participants