Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Oct 2, 2024

See Commits and Changes for more details.


Created by pull[bot]

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

seefeldb and others added 22 commits July 29, 2025 14:37
- Replace path.join('/') with JSON.stringify(path) for consistent serialization
- Update address.toString() to use JSON format for paths
- Fix differential.ts to use Address.toString() instead of manual concatenation
- Update chronicle.ts to use JSON.stringify for path-based map keys
- Ensure consistent path comparison logic across the codebase

This change prevents issues with path elements containing slashes or special
characters by using JSON serialization instead of simple string joining.
* fix: log reads despite errors

* only look for relevant reads (list now contains many more)

* fix traversing over shortened paths to objects

* fix test for shim flow

---------

Co-authored-by: Bernhard Seefeld <[email protected]>
* refactor: update js-runtime logging to use utils/src/logger.ts
  - replace console.log/warn/error with getLogger from @commontools/utils/logger
  - remove logger parameter passing to transformers - each module creates its own
  - keep console.log for --show-transformed raw output only
  - update tests to not pass logger to transformer functions

* removed unused interface
Modified iframe-ctx.ts to wrap object updates in a transaction using runtime.edit() and tx.commit(). This ensures that object updates in iframes are properly handled within the transaction system, preventing potential state inconsistencies.

The change specifically affects how object-type values are updated through the iframe context API.
* Change StorageProvider.sync to take a SchemaPathSelector.
Removed the expectedInStorage and schemaContext arguments to StorageProvider.sync, since the former was unused and the latter is replaced by selector.
Changed the structures that tracked the SchemaContext in cache to use SchemaPathSelectors instead.
Renamed Replia.getSchema to generateSchemaFromLabels to better indicate the function's purpose.
Updated curl to new api that takes URI instead of EntityId.

* Added integration test
…ces (#1521)

When arrays contain nested documents (objects with [ID] property), array
elements now resolve to the actual nested document links rather than
array index paths. This fixes array splice operations that were failing
because elements were incorrectly resolving to array positions.

- Modified link resolution to follow nested document links in arrays
- Removed overwrite field from resolved links for cleaner references
- Updated todo-list recipe to use spread operator for proper array copying
- Added comprehensive tests for array element link resolution
* Add support for schema definitions to traverse.ts

* Added LiftHandler method signature that provides both the types and the schema.
Updated static, since we've added support for definitions to the JSONSchema.

* Provide rootSchema to cfc.schemaAtPath, since we do have it available.

* Incorporated PR feedback
- mark `definitions` deprecated
- remove confusing argument type
- made $ref walking more general

* needed to recompile api types to incorporate my @deprecated comment

* Do JSONPointer unescaping on `$ref`

* Better spec compliance (JSONPointer escaping)
chore: Unify how integration tests are called, provide some utilities to normalize env vars used in integration, and initial work on a helper to scaffold shell integration tests.
* fix(js-runtime): Fix Cell<T>[] array schema transformation

The schema transformer was incorrectly handling arrays of Cell types (Cell<T>[]).
Instead of recognizing that array elements were Cell types, it was outputting
the actual Cell type structure with properties like get, set, send, etc.

This fix:
- Detects when array elements are Cell<T> or Stream<T> types
- Properly extracts the inner type from Cell/Stream wrappers
- Adds the appropriate asCell/asStream flags to the schema
- Handles both Array<Cell<T>> and Cell<T>[] syntax

Added comprehensive test cases covering:
- Cell<any>[] - arrays of cells with any type
- Cell<string>[] - arrays of cells with primitive types
- Cell<{...}>[] - arrays of cells with object types
- Cell<T[]> - cells containing arrays
- Stream<T>[] - arrays of streams
- Mixed scenarios with nested Cell types

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

Co-Authored-By: Claude <[email protected]>

* fix expected

* fix(js-runtime): Fix schema transformation for Cell<T[]> and Default<T, V> in arrays

- Fixed Cell<T[]> transformation to place asCell flag at array level, not inside items
- Added support for Default type detection using aliasSymbol for array elements
- Fixed asStream spread syntax issue in schema AST generation
- Updated expected test outputs to match correct transformations
- Added comprehensive nested wrappers test for complex type combinations

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

Co-Authored-By: Claude <[email protected]>

* fix(js-runtime): Remove meaningless Default<T, V>[] pattern from tests

Arrays of Default types (Default<T, V>[]) are not a meaningful pattern
since Default is meant to provide a default value for a property, not
for individual array elements. Removed this case from the nested
wrappers test and the associated aliasSymbol handling code.

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

Co-Authored-By: Claude <[email protected]>

* feat(js-runtime): Add support for type aliases in Cell and Stream detection

- Updated Cell and Stream detection to check symbol names, not just type strings
- This enables recognition of type aliases like `type MyCell<T> = Cell<T>`
- Added comprehensive test for various type alias patterns
- Note: Default type aliases are not currently supported

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

Co-Authored-By: Claude <[email protected]>

* feat(js-runtime): Add support for Default type aliases in schema transformer

- Detect type aliases that resolve to Default<T, V> by checking the alias declaration
- Process type arguments passed to Default aliases (e.g., WithDefault<string, "hello">)
- Extract default values from type alias instantiations
- Update type-aliases test to include Default alias support
- Fix handling of all wrapper type aliases (Cell, Stream, Default)

This allows users to create type aliases like:
  type WithDefault<T, V extends T> = Default<T, V>
And use them in interfaces with proper schema generation.

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

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
…ith empty cells, for invalid input in validateAndTransform (#1524)

fix(runner): return undefined instead of empty object, or an object with empty cells, for invalid input in validateAndTransform

When validateAndTransform receives a non-record value for an object schema
and no properties would be populated (no defaults, no asCell/asStream),
return undefined instead of creating an empty object. This prevents
unnecessary empty objects from being created in the data structure.
…1518)

* refactor(runner): convert array_push test to use type-safe handlers

- Replace proxy-based handlers with typed handler signatures
- Add test coverage for both primitive (number) and object arrays
- Add explicit ID field to objects to ensure proper tracking
- Update UI to display both array types separately

This change aligns with the codebase direction of avoiding proxy usage
and ensuring type safety throughout the handler system.

* fix linter issues
* Rework `ct-list` as premier example of cell interop

* Clean up repeated code

* Remove context menu and status concepts
Treat the absense of additionlProperties similarly to false.
JSONSchema defaults this to true, but we want an intermediate behavior where if it's missing, we don't traverse the property, but we also don't reject the object as invalid.
*  track types we've seen for cycles
- fix cycle detection to only track interface/class types, not primitives or arrays
- still need to implement $ref/definitions for recursive types instead of placeholder

* add getcycles function for recursive type detection
  - implement getcycles() function to detect recursive/circular type references
  - existing code didnt detect array types for non primitive types (resolves arrays to {})
  - add unit tests for getcycles and recursive type handling

* implement two-pass approach for recursive types with $ref/definitions

* enable recursive type test after fixing stack overflow issue
- remove recursive-type from skip list in fixture tests
- update expected output to match actual transformer format (unquoted property names)

* handle mutually recursive types in schema generation
- add fixture tests for mutually recursive types (A→B→A) and nested recursive types
- fix bug where non-root cyclic types generated self-referential definitions
- prevent infinite recursion by temporarily removing current type from cycle set
chore: Remove Blobby/Spellbook/Spellcasting from Toolshed, and Redis from CI
chore: Do not create a 'default' runtime with default space on initialization. Pass a single instance of CharmController for the active charm, rather than the ID so that the charm is only fetched once.
Also: Rename CellToOpaque to StripCell for clarity, since all uses then wrap the output in Opaque<>
bfollington and others added 29 commits September 10, 2025 18:14
* Add `chatbot-outliner.tsx`

* Add `ct-prompt-input`

* Format pass

* Restore full recursive type
* schema-generator: propagate JSDoc descriptions to JSON Schema

- Port behavior from old js-runtime transformer (branch fix/ast-add-descriptions-to-schema):
  - Attach property descriptions from JSDoc (merging/conflict note for intersections)
  - Attach index signature descriptions to additionalProperties
  - Attach root-level descriptions when present on the type symbol
- Add doc-utils with robust extraction from declarations and symbols
- Add fixture: descriptions-basic to verify behavior

No changes to existing fixtures; behavior is additive only when JSDoc exists.

* schema-generator: remove stray _doc file from commit

* schema-generator: add full JSDoc description parity and fixtures

- Property docs across all types (primitives, arrays, unions, wrappers)
- Root-level descriptions from interface/type alias docs
- Intersection conflicts: keep first, add , warn
- Inheritance (extends) preserves property and root docs
- Index signatures: string/number → additionalProperties.description; conflict comment
- Preserve multiline/markdown text
- Improve array detection to avoid misclassifying map-like types
- Add comprehensive fixtures (no auto-gen):
  descriptions-basic, -index, -index-ambiguous, -intersection-same,
  -intersection-conflict, -extends, -union-literals, -array-doc,
  -wrappers, -recursive

* schema-generator: add parity fixtures and alias-root doc handling

- Add fixtures: descriptions-root-alias, -record-alias, -optional-union,
  -root-with-tags, -nested (Doc/ChildNode)
- Improve root description extraction to also consider underlying symbol when
  the root is a type alias (use target doc if alias has none)

* schema-generator: switch conflict logging to getLogger and add multiline property doc fixture; remove try/catch swallowing; fix logger optional-level assignment for exactOptionalPropertyTypes

* add back warning for intersection property merge

* fix issue with not recognizing typescript's NonPrimitive generic object type in objectformatter; return basic permissive schema in that case

* use isRecord to improve code and reduce 'as any' casts

* address code review simplification suggestions
* Fix indent/outdent/rendering bugs

* Format pass
* Basic theme works

* Extract common code

* Animation speed control

* Theme prompt input

* Fix reactivity issue in ct-select

* Add `chatbot-theme.tsx` example

* Remove unused handler

* Format pass

* `window` -> `globalThis`
* store charm reference in a cell

* add guard for initialized

* needed to add json schema to lift

* create navigateTo button

* create a new charm each time, we were passing in the same charm

* added an isInitialized specifically for the storeCharmInCell lift because it was looping

* only call navigateTo within lift so we know charm is ready
and also check isInitialized so we only do it once

* ci: retrigger

* formatting fix

* removed TODO

* updated comments
…ramResolver (#1769)

feat: Move CliProgram to a deno-only js-runtime export FileSystemProgramResolver, to use in integration tests for mutlifile patterns.
* pattern to have an array of charms in a cell
UI to navigate to each charm created in the array

* use cell.push()

* use ifElse but still need to use derive inside clause due to bug in CTS
- llm-dialog:
  - Add `pattern` to LLM tool schema to register recipe-based tools.
  - Relax schema requirements (only `description` is required). A tool can be
    provided via a `pattern` or a `handler`; an `inputSchema` must come from
    one of: `tool.inputSchema`, `pattern.argumentSchema`, or `handler.schema`.
  - Replace `invokeHandlerAsToolCall` with `invokeToolCall`. When `pattern` is
    present, run it via `runtime.run(tx, pattern, input, result)`; otherwise
    send to the `handler`. Wait for the `result` cell and, for patterns, stop
    the runner once the result resolves.
  - Advertise tool schemas using `pattern.argumentSchema` when present.
  - Change return value to json.
  - Add [ID] manually, as in a built-in this isn't done automatically

- patterns/chatbot-tools:
  - Convert `calculator`, `searchWeb` and `readWebpage` from a handler to a
    `recipe` that derives the computed value from the `expression` (with basic
    sanitization) / makes the respective REST calls.

- fetchData:
   - If `options.body` isn't a string, it gets JSON serialized
    
---------

Co-authored-by: Ben Follington <[email protected]>
* Break out `Chat` recipe

* Re-use common chatbot.tsx

* Format pass

* Update `chatbot-theme.tsx` to use common `Chat` recipe

* Update `chatbot-tools.tsx` to merge with changes in main

* Format pass
* `ct-code-editor` backlink support

* Fix type errors

* Format pass

* Update layout

* Clean up logging and code
- Instead of caching previousRecipeAsString in the closure, maintain a map of these keyed by result cell, and clear the key when we get an update of the result cell (so we can run again if needed).
…1773)

feat(chat): rely fully on jsdoc to bring in description and schema

deprecates inputSchema, but description is still an option.
* fix(runner): avoid infinite recursion in function cacher

* ignore literals, better types

* simplify things given the new isRecord check

* don't make seen a default input so we don't accidentally recurse without it

* Runner: stop ref recursion & fix anonymous cell naming

- prevent the runner’s function cache walk from re-entering cells, shadow refs, and opaque refs
- tighten opaque-ref typing so JSON conversion uses the shared OpaqueRefMethods surface
- teach the recipe factory to pull cell names from export() so unnamed internal cells get stable, meaningful aliases
- refresh recipe.test.ts expectations to cover the corrected alias naming and avoid the long-standing double naming bug

* re-arrange for clarity

* undo the name fix, since it caused other issues

* Avoid duplicate auto cell names

* re-enable names and fix tests
chore: Remove Shoelace themes and its dependencies, including compromised @ctrl/tinycolor (though a previous version)
* Implement auto-generated title for in `chatbot.tsx`

* Format pass

* Fix `llm.tsx` pattern

* Split type definitions for `llm` vs `generateObject`

* Re-implement using `generateObject`

* Clean up

* Fix types
* Correctly handle storage updates in runner.
- Instead of caching previousRecipeAsString in the closure, maintain a map of these keyed by result cell, and clear the key when we get an update of the result cell (so we can run again if needed).

* Added test from gpt

* Changed recommended by Cubic
- capture the end-to-end “Recipe Graph Unification” spec, replacing the opaque-ref/legacy metadata model with capability-wrapped cells, deterministic causes, and runtime graph snapshots
- define supporting pillars: shippable node factory sigils, integration test harness design, phased rollout strategy, and V2-only builder/runtime entry points
- consolidate the repository observations, impacted areas, risks, open questions, and detailed implementation roadmap into the docs/specs/recipe-construction folder
* `ct-code-editor` backlink support

* Fix type errors

* Format pass

* Clean up logging and code

* Workaround focus issue by inlining

* List mentions + backlinks

* Make mentions and backlinks actually clickable

* Replace `derive()` with `lift()` to avoid Proxy(Array) shenanigans

* Clean up backlinks calculation

* Format pass
@pull pull bot merged commit 692c6bc into ExaDev:main Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants