Commit Graph

55 Commits

Author SHA1 Message Date
github-actions[bot] ea746d4629 chore(post-release): update version to 1.54.0 2026-03-12 22:32:04 +00:00
github-actions[bot] 98890426e5 chore(post-release): update version to 1.54.0-next.9 2026-03-12 19:08:50 +00:00
Alem Tuzlak 3780c6ae74 chore: deprecate all @copilotkitnext/* packages
Mark all publishable @copilotkitnext/* packages as deprecated in
package.json, pointing users to the @copilotkit/* equivalents.
V2 features will be available under the /v2 subpath.

Affected packages: shared, core, agent, angular, react, runtime,
sqlite-runner, web-inspector.
2026-03-12 15:05:29 -04:00
github-actions[bot] b443706792 chore(post-release): update version to 1.54.0-next.8 2026-03-12 16:52:13 +00:00
github-actions[bot] ecd76256ed chore(post-release): update version to 1.54.0-next.7 2026-03-12 14:26:14 +00:00
github-actions[bot] ed34d9daef chore(post-release): update version to 1.54.0-next.6 2026-03-11 16:22:53 +00:00
github-actions[bot] e9cb7dfe26 chore(post-release): update version to 1.54.0-next.5 2026-03-11 15:20:13 +00:00
github-actions[bot] 190eb07f09 chore(post-release): update version to 1.54.0-next.4 2026-03-11 12:50:08 +00:00
github-actions[bot] 60de47cda2 chore(post-release): update version to 1.54.0-next.3 2026-03-11 11:14:53 +00:00
Alem Tuzlak ea98c8649c test: add Zod regression tests for Standard Schema migration
Adds 77 regression tests across shared, core, react, and agent packages
proving that existing Zod usage produces identical results after the
Standard Schema V1 migration. Covers JSON Schema output identity,
additionalProperties stripping, schema pass-through to AI SDK, React
hook compatibility, and complex Zod patterns (unions, discriminated
unions, nested objects, arrays, constraints, defaults, etc.).
2026-03-10 15:36:27 -07:00
Alem Tuzlak f64a815cea feat: migrate public API from Zod to Standard Schema V1
Replace Zod-specific types (z.ZodType, z.infer) with Standard Schema V1
interfaces across the V2 public API surface. This allows users to use any
Standard Schema V1 compatible library (Zod 3.24+, Valibot v1+, ArkType v2+)
for tool parameters, with zero breaking changes for existing Zod users.

- Add schemaToJsonSchema() utility in shared with Standard JSON Schema V1
  support and Zod fallback
- Update FrontendTool, ToolDefinition, useRenderTool, useComponent, and
  Angular tool types to accept StandardSchemaV1
- Move zod from dependencies to devDependencies in core and angular
- Add runtime tests (40) and type-level tests (38) across all packages
  verifying Zod, Valibot, and ArkType compatibility
2026-03-10 15:36:26 -07:00
giulio-leone 921dd1944d fix: address all 7 PR review feedback items for tool args guard
CRITICAL 1: ensureObjectArgs (renamed from safeParseToolArgs) in
run-handler.ts now throws on non-object parsed results so the catch
block fires TOOL_ARGUMENT_PARSE_FAILED structured errors.

CRITICAL 2: partialJSONParse return type reverted from
Record<string,unknown> to unknown — callers handle the type.

IMPORTANT 3: safeParseToolArgs consolidated into shared/utils.ts and
exported. Agent/index.ts imports from @copilotkitnext/shared. V1 keeps
a local copy with a comment noting it mirrors the shared version.

IMPORTANT 4: All non-object fallback sites now emit console.warn with
consistent [CopilotKit] prefix format.

IMPORTANT 5: Removed console.warn from getPartialArguments catch block
(incomplete JSON is expected during streaming). Warning is now only in
the try-block non-object guard.

TEST 6: Added run-handler-ensureObjectArgs.test.ts covering valid
object, string, number, array, null, boolean, and undefined inputs.

TEST 7: Added conversion.test.ts for v1 safeParseToolArgs covering
valid object, string, number, array, malformed JSON, null, boolean,
and empty string inputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 21:13:16 +01:00
Jordan Ritter 792a0b1241 fix: guard against malformed JSON in tool argument parsing
Rename ensureObjectArgs to safeParseToolArgs in v2/agent and v1/runtime,
folding JSON.parse into the guard so malformed JSON (e.g. "{broken") is
caught instead of throwing an unhandled SyntaxError up the call stack.

Add console.warn on parse failure in all three locations (v2/agent,
v1/runtime, v1/runtime-client-gql) so malformed tool arguments are
visible in logs rather than silently swallowed.

Update the v2/agent unparseable-JSON test to expect {} instead of throw.
2026-03-09 15:09:59 +01:00
Jordan Ritter a7662957fc test: add coverage for non-object tool argument guards
Tests for ensureObjectArgs in @copilotkitnext/agent (via
convertMessagesToVercelAISDKMessages) and getPartialArguments in
@copilotkit/runtime-client-gql (via convertGqlOutputToMessages).

Covers string, array, null, number, boolean, empty args, and
unparseable JSON — all should fall back to {}.

Also documents a pre-existing gap: JSON.parse is unguarded before
ensureObjectArgs in v2/agent, so unparseable JSON throws instead of
falling back to {}. The test explicitly expects the throw.

v1/runtime's convertGqlInputToMessages uses class-transformer which
makes isolated unit testing impractical; the same guard logic is
covered by the other two test suites.
2026-03-09 15:09:59 +01:00
g97iulio1609 aa8a8a3d11 fix: guard against non-object tool arguments from LLMs
When LLMs return non-object values (e.g. empty string) as tool call
arguments, the parsed result is stored in conversation history. On
subsequent requests, providers like Anthropic reject the non-dictionary
tool_use input with a 400 error, making the conversation permanently
broken.

Fixed in 4 locations across v1 and v2:
- v1 runtime conversion.ts: validate parsed arguments
- v1 client conversion.ts: validate partial arguments
- v2 core run-handler.ts: validate both specific and wildcard tool args
- v2 agent index.ts: validate tool call input conversion

All locations now ensure parsed args are a plain object, falling back to
{} for non-object values.

Fixes #3300
2026-03-09 15:09:59 +01:00
github-actions[bot] d2cf028903 chore(post-release): update version to 1.53.1-next.2 2026-03-07 08:47:03 +00:00
github-actions[bot] 6c4aab7d6f chore(post-release): update version to 1.53.1-next.1 2026-03-06 18:32:39 +00:00
github-actions[bot] 1fd878c582 chore(post-release): update version to 1.53.1-next.0 2026-03-06 17:10:16 +00:00
github-actions[bot] 57eb016a10 chore(post-release): update version to 1.53.0 2026-03-05 23:57:25 +00:00
github-actions[bot] 671fd0ae47 chore(post-release): update version to 1.53.0-next.6 2026-03-05 23:41:37 +00:00
github-actions[bot] 3ba2352ef8 chore(post-release): update version to 1.53.0-next.5 2026-03-05 23:06:01 +00:00
github-actions[bot] 9f12589107 chore(post-release): update version to 1.52.2-next.4 2026-03-05 21:28:52 +00:00
github-actions[bot] 2173e89096 chore(post-release): update version to 1.52.2-next.3 2026-03-05 17:42:38 +00:00
Ran Shem Tov e76e5e7c11 chore: use latest agui 2026-03-05 16:43:33 +01:00
github-actions[bot] 3ff24c8b05 chore(post-release): update version to 1.52.2-next.2 2026-03-05 10:31:34 +00:00
Maxim bdedf25f6d feat(agent): upgrade AI SDK to v6 for LanguageModelV3 compatibility 2026-03-04 15:02:16 -05:00
github-actions[bot] 7abe7f89d1 chore(post-release): update version to 1.52.2-next.1 2026-03-03 23:59:38 +00:00
Maxim a9f518d77c Merge branch 'main' into fix/enums-in-convert-json-schema-to-zod-schema 2026-03-04 01:55:22 +04:00
github-actions[bot] 4b78d74e11 chore(post-release): update version to 1.52.2-next.0 2026-03-03 17:40:27 +00:00
Maxim 6cfdd3464c fix: formatting 2026-03-02 23:51:19 +04:00
Maxim 30c2ae95ba test: add enum preservation tests for convertJsonSchemaToZodSchema
Move V1 test file to __tests__/ directory and add test verifying that
string enum constraints round-trip through convertJsonSchemaToZodSchema.
Add equivalent test for V2's copy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 23:47:54 +04:00
Maxim 662007f264 fix: preserve enum constraints in convertJsonSchemaToZodSchema
The string case in convertJsonSchemaToZodSchema produced z.string() and
silently discarded the enum field. When useCopilotAction defines a
parameter with enum: ["todo", "done"], the constraint was lost during
the V1→V2 bridge and never reached the runtime payload.

Add an enum check before falling through to z.string() in both V1
(shared/json-schema.ts) and V2 (agent/index.ts) copies of the function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 23:47:54 +04:00
Alem Tuzlak 45652201a9 Merge branch 'main' into worktree-validated-greeting-quokka 2026-03-02 15:23:37 +01:00
github-actions[bot] aeac645881 chore(post-release): update version to 1.52.1 2026-02-27 20:04:51 +00:00
Markus Ecker 39722ecbe4 Merge branch 'main' into mme/ag-ui-0.0.46 2026-02-27 15:13:22 +01:00
github-actions[bot] d523d6cc68 chore(post-release): update version to 1.52.1-next.1 2026-02-27 14:12:29 +00:00
Markus Ecker 979511a900 chore: upgrade AG-UI to 0.0.46 2026-02-27 14:47:50 +01:00
github-actions[bot] 0cf39911a0 chore(post-release): update version to 1.52.1-next.0 2026-02-27 03:53:52 +00:00
github-actions[bot] f924ecb4aa chore(post-release): update version to 1.52.0 2026-02-26 19:37:25 +00:00
github-actions[bot] a0cd2ed364 chore(post-release): update version to 1.52.0-next.8 2026-02-24 15:21:43 +00:00
github-actions[bot] 17d42682ef chore(post-release): update version to 1.52.0-next.7 2026-02-24 14:54:00 +00:00
Alem Tuzlak f25f182ff1 chore: migrate from husky to lefthook and fix angular tests
- Replace husky with lefthook for git hooks management
- Pre-commit runs lint --fix, format, test, and check:packages in parallel
  with auto-staging of fixes via stage_fixed
- Commit-msg runs commitlint
- Add dependsOn ^build to test target in nx.json so dependencies are
  built before tests run
- Upgrade @analogjs/vite-plugin-angular and @analogjs/vitest-angular
  from ^1.20.2 to ^2.2.3 for vite 7 compatibility
- Add pnpm packageExtensions to declare missing vite peer dependency
  on @analogjs/vite-plugin-angular
- Fix lint issues: let -> const in agent and react packages
- Disable nx TUI in pre-commit hooks via NX_TUI env var
2026-02-24 15:17:21 +01:00
github-actions[bot] 740d21a0aa chore(post-release): update version to 1.52.0-next.6 2026-02-21 02:42:07 +00:00
github-actions[bot] 4fc8abe886 chore(post-release): update version to 1.52.0-next.5 2026-02-21 02:20:08 +00:00
github-actions[bot] fac1c7c015 chore(post-release): update version to 1.51.5-next.4 2026-02-20 23:28:02 +00:00
github-actions[bot] 2e3a03132b chore(post-release): update version to 1.51.5-next.3 2026-02-20 05:42:01 +00:00
github-actions[bot] 365b915e26 chore(post-release): update version to 1.51.5-next.2 2026-02-18 23:50:35 +00:00
github-actions[bot] 012c8aa111 chore(post-release): update version to 1.51.5-next.1 2026-02-18 23:11:01 +00:00
Alem Tuzlak 98ed92c4ef Feat/speed up build system (#3213) 2026-02-17 18:34:26 +01:00
github-actions[bot] 521c05dd57 chore(post-release): update version to 1.51.5-next.0 2026-02-17 10:19:30 +00:00