Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Nov 14, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

seefeldb and others added 3 commits November 13, 2025 13:58
…PI (#2070)

* add new `pattern` definition, which is a subset of `recipe` with saner argument order

* feat(ts-transformers): add support for pattern() as alternative to recipe()

Add comprehensive TypeScript transformer support for the new `pattern()`
function, which simplifies the API by removing the optional name parameter
and using a cleaner argument order: pattern(fn, argSchema?, resSchema?).

Changes:
- Update schema-injection.ts to handle pattern() calls with three variants:
  * pattern<ArgType, ResType>((input) => {...})
  * pattern<ArgType>((input) => {...})
  * pattern((input: Type) => {...})
- Add "pattern" to BUILDER_SYMBOL_NAMES in call-kind.ts for recognition
- Add comprehensive test fixtures across all categories:
  * ast-transform: counter-pattern, pattern-with-type, pattern-array-map
  * closures: computed-pattern variants, opaque-ref-map patterns
  * jsx-expressions: pattern-with-cells, pattern-statements-vs-jsx
  * schema-transform: pattern-with-types

All tests passing (16 passed, 178 steps).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(ts-transformers): use TypeScript inference for pattern schemas

Improve pattern() transformation to leverage TypeScript's type checker
instead of reading type arguments directly, making it more robust and
capable of inferring result types automatically.

Before: Only handled explicit type arguments, couldn't infer result types
After: Uses collectFunctionSchemaTypeNodes to infer both argument and
result types from function signatures, with type args as hints

Key improvements:
- Result schemas now automatically inferred from function return types
- More flexible: works with partial type information
- Less brittle: doesn't fail on missing type arguments
- Leverages existing inference infrastructure used by other builders
- Properly registers inferred types with type registry

Example transformation:
```typescript
// Input
pattern((input: MyInput) => {
  return { result: input.value * 2 };
})

// Output (now includes inferred result schema)
pattern((input: MyInput) => {...},
  { type: "object", properties: { value: { type: "number" } } },
  { type: "object", properties: { result: { type: "number" } } }
)
```

All tests passing with updated expected outputs reflecting inferred schemas.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
… yet (#2073)

fix(built-in): always return wished cell, even if value isn't defined yet
* Switch from per-charm tools to top-level run/read/inspect tools

* Fix tool schemas/parameter declarations

* Append schema LUT to the system prompt

Makes this a 1:1 comparison against old version

* Lint + format

* Fix test case
@pull pull bot locked and limited conversation to collaborators Nov 14, 2025
@pull pull bot added the ⤵️ pull label Nov 14, 2025
@pull pull bot merged commit a8395fe into ExaDev:main Nov 14, 2025
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants