Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c4a66c4
move builder/ into runner/ + moving and splitting files while we do that
seefeldb Jun 13, 2025
711689b
undid a few spurious Claude changes + minor cleanups
seefeldb Jun 13, 2025
f4eb1bb
moves a few of the utils out of builder, especially those use by trav…
seefeldb Jun 13, 2025
af6dee7
split utils tests into smaller files as well
seefeldb Jun 13, 2025
be96409
first pass at cell link conversion
seefeldb Jun 14, 2025
4bf0e05
fixed tests
seefeldb Jun 14, 2025
18eee61
add .getAsLink() that is now the canonical way to get a link + change…
seefeldb Jun 16, 2025
0113287
feat: Add optional parameters to getAsLink() method
seefeldb Jun 16, 2025
e3ae54f
Implement baseSpace strategy and getAsAlias method with shared logic
seefeldb Jun 16, 2025
685379a
post rebase: properly using DIDs everywhere
seefeldb Jun 16, 2025
38cb0f7
change string to DID for space
seefeldb Jun 17, 2025
d981020
rename DID to MemorySpace for spaces
seefeldb Jun 17, 2025
d94f64e
refactor: Convert more cell links to use sigil values
seefeldb Jun 17, 2025
1e0e9b5
revert toJSON to old format, use baseCell for parseToLegacyCellLink
seefeldb Jun 17, 2025
9a2a89e
no need to declare this in a global namespace anymore
seefeldb Jun 17, 2025
7113587
add ability to create cell without resolving, avoiding recursion, sin…
seefeldb Jun 17, 2025
1ed3d80
minor clarifications
seefeldb Jun 18, 2025
0dbdc4b
fix tests
seefeldb Jun 18, 2025
e27f176
refactor: change sigil format from '@' to '/' property
seefeldb Jun 18, 2025
dbac9d4
Phase 2: Rename sigil types from link-v0.1/alias-v0.1 to embed@1/alias@1
seefeldb Jun 18, 2025
0d0633d
Phase 3: Remove backwards compatibility for old alias@1 format
seefeldb Jun 18, 2025
91f554c
refactor: rename SigilLink to SigilEmbed and getAsAlias to getAsWrite…
seefeldb Jun 18, 2025
c0d0324
refactor: move traverse-utils to builder module and simplify sigil de…
seefeldb Jun 18, 2025
ccc7738
refactor: consolidate link parsing by merging parseAlias into parseLink
seefeldb Jun 19, 2025
6c5b4a0
refactor: convert cell links to use sigil values
seefeldb Jun 19, 2025
089cc6d
simplify fromURI logic
seefeldb Jun 19, 2025
afcd274
allow no id on legacy aliases for now
seefeldb Jun 19, 2025
c85baf7
isSigilEmbed returns true for aliases as well
seefeldb Jun 19, 2025
2059380
change .setRaw to .set where it's fine to just use .set
seefeldb Jun 19, 2025
1ba2f39
feat: add legacy alias support to cell link utilities
seefeldb Jun 19, 2025
4054d6c
simplified fromURI logic since we only support `of:` right now
seefeldb Jun 19, 2025
37b403b
correctly handle no id case
seefeldb Jun 19, 2025
d7392c1
fix tests post rebase
seefeldb Jun 19, 2025
042f746
refactor: rename embed/writethrough concepts to link/write-redirect
seefeldb Jun 19, 2025
96d19d5
stragglers for renames in previous commit
seefeldb Jun 19, 2025
27744c9
rename `replace: "destination"` to `overwrite: "redirect"`
seefeldb Jun 19, 2025
af49af0
address copilot nitpicks
seefeldb Jun 20, 2025
419379d
Actually turn off cell id to DocImpl conversion in storage on load!
seefeldb Jun 20, 2025
7dff115
fix comment as well
seefeldb Jun 20, 2025
e8ad7dd
address minor cubic nits
seefeldb Jun 20, 2025
3bb1565
upgrade google oauth flows to use new link format
seefeldb Jun 20, 2025
16f5641
# Add createSigilLinkFromParsedLink function with comprehensive test …
seefeldb Jun 20, 2025
ab35bda
refactor: unify link handling in storage with isLink/parseLink utilities
seefeldb Jun 20, 2025
512d33a
fix test post-rebase
seefeldb Jun 20, 2025
1e8b3d6
extracted type declarations into sigil-types.ts
seefeldb Jun 20, 2025
55a35f8
- rename `id` to `space` in sigil link and normalized link
seefeldb Jun 20, 2025
6b50efa
fix code fencing in README.md
seefeldb Jun 20, 2025
894185d
increase timeout for @v step
seefeldb Jun 20, 2025
f2e09fa
- getEntityId now supports new sigil format as well
seefeldb Jun 20, 2025
40a857a
deno fmt
seefeldb Jun 20, 2025
9fa16dd
make running integration tests in the browser an env variable
seefeldb Jun 20, 2025
f891fb4
handle more id confusion: new is `of:...` but we still create `{"/":"…
seefeldb Jun 20, 2025
1e67821
- **Type System Refactoring**: Renamed `CellLink` to `LegacyCellLink` to
seefeldb Jun 23, 2025
2ae936a
minor moving around of helpers
seefeldb Jun 23, 2025
4e92d77
rename `space` to `id` in `SigilLink` and `NormalizedLink`.
seefeldb Jun 23, 2025
2878b20
refactor: update createJsonSchema to handle sigil links and improve a…
seefeldb Jun 23, 2025
aa81d77
moved is* other than isCell and isStream from cell.ts to link-utils.ts
seefeldb Jun 23, 2025
a830626
minor type improvements and other removals of redundancies
seefeldb Jun 23, 2025
d8402fd
support any kind of link in data-updating.ts
seefeldb Jun 23, 2025
06df0db
improve typescript types to mark return values and properties as non-…
seefeldb Jun 24, 2025
909238d
support any links in `asCell` creation of cells
seefeldb Jun 24, 2025
c584b09
remove deprecation warning from logs
seefeldb Jun 24, 2025
2ee1338
decrease timeout again, so generatePreview doesn't trigger
seefeldb Jun 25, 2025
14eaed5
Cell.set() understands cells and turns them into links already, so re…
seefeldb Jun 25, 2025
be2a42f
remove no longer necessary `!` in `parseLink(...)!`
seefeldb Jun 25, 2025
8b0bab4
fix(link-utils): stricter isSigilValue and comprehensive tests
seefeldb Jun 25, 2025
0a703d9
renaming of `Alias` to either `WriteRedirect` or `LegacyAlias`
seefeldb Jun 25, 2025
3c4af4b
remove unused imports
seefeldb Jun 25, 2025
3211294
updated README.md to new terminology
seefeldb Jun 25, 2025
eba69c8
Cell.equal now understands all new link formats as well.
seefeldb Jun 25, 2025
5a40d61
cleaned up types
seefeldb Jun 25, 2025
2b1803d
.push signature accepts only Cell now, but still supports any type of…
seefeldb Jun 25, 2025
6eaabf3
renamed more CellLink to LegacyCellLink
seefeldb Jun 25, 2025
8d60bbd
Fixed:
seefeldb Jun 26, 2025
6d37fa9
refactored tests to sigils and removed now redundant test-helpers
seefeldb Jun 26, 2025
ed6ba07
post rebase fix: add Mutable import back
seefeldb Jun 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/background-charm-service/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export async function setBGCharm({

console.log(
"charmsCell",
JSON.stringify(charmsCell.getAsCellLink(), null, 2),
JSON.stringify(charmsCell.getAsLink(), null, 2),
);

const charms = charmsCell.get() || [];
Expand Down
8 changes: 6 additions & 2 deletions packages/charm/src/iframe/recipe.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { JSONSchema } from "@commontools/runner";
import { Cell, getEntityId, type Runtime } from "@commontools/runner";
import {
Cell,
getEntityId,
type JSONSchema,
type Runtime,
} from "@commontools/runner";
import { Charm, getRecipeIdFromCharm } from "../manager.ts";

export type IFrameRecipe = {
Expand Down
22 changes: 14 additions & 8 deletions packages/charm/src/iterate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,21 @@ export function scrub(data: any): any {
}

/**
* Turn cells references into aliases, this forces writes to go back
* to the original cell.
* Turn cells references into writes redirects, this forces writes to go back to
* the original cell.
* @param data The data to process
* @param baseSpace Optional base space DID to make links relative to
*/
function turnCellsIntoAliases(data: any): any {
function turnCellsIntoWriteRedirects(data: any, baseSpace?: MemorySpace): any {
if (isCell(data)) {
return { $alias: data.getAsCellLink() };
return data.getAsWriteRedirectLink(baseSpace ? { baseSpace } : undefined);
} else if (Array.isArray(data)) {
return data.map((value) => turnCellsIntoAliases(value));
return data.map((value) => turnCellsIntoWriteRedirects(value, baseSpace));
} else if (isObject(data)) {
return Object.fromEntries(
Object.entries(data).map((
[key, value],
) => [key, turnCellsIntoAliases(value)]),
) => [key, turnCellsIntoWriteRedirects(value, baseSpace)]),
);
} else return data;
}
Expand Down Expand Up @@ -478,15 +480,19 @@ export async function castNewRecipe(
const scrubbed = scrub(form.input.references);

// First, extract any existing schema if we have data
const existingSchema = createJsonSchema(scrubbed);
const existingSchema = createJsonSchema(
scrubbed,
false,
charmManager.runtime,
);

// Prototype workflow: combine steps
const { newSpec, newRecipeSrc, llmRequestId } =
form.classification?.workflowType === "imagine-single-phase"
? await singlePhaseCodeGeneration(form, existingSchema)
: await twoPhaseCodeGeneration(form, existingSchema);

const input = turnCellsIntoAliases(scrubbed);
const input = turnCellsIntoWriteRedirects(scrubbed, charmManager.getSpace());

globalThis.dispatchEvent(
new CustomEvent("job-update", {
Expand Down
Loading