Resources and data files
A resource type is a kind of vendor object a company declares the state of, such as a GitHub repository. defineResource declares one, and derives its operations, so the runtime knows only operations:
import { defineConnector, defineResource } from "sanoma/workflows";
export const repository = defineResource({ vendor: "github", type: "repository", title: "Repository", identity: "name", // optional, with `find`: how `find` makes the identity, for people schema, // a z.object: the fields a read returns, and a data file declares (less the vendor-owned ones) fields: { immutable: [], vendorOwned: ["html_url", "node_id"], writeOnly: [], unordered: ["topics"] }, // and `references`, below find: ({ name }) => name, // optional: the import id that finds a declared resource before it is bound bindingId: (state) => String(state.node_id), // optional: the stable id a binding keeps; default `String(state.id)` normalize, // optional: the part of a state a drift check compares; default `compareDeclared` writable: true, // optional: apply may change its objects (the change operations, below) stateless: true, // optional: its objects hold no data, so apply makes one gone again without asking afterCreate: [{ op: "acme.repository.protect", input: ({ id, export: name }) => ({ id }), until: (out) => out.ok }], // optional});export const github = defineConnector("github", { repository });A resource type is a connector’s group under its own type; defineConnector refuses one of another vendor, or under another key, or on a connector without info.package (data files import the types from <package>/resources), and keeps the list on the connector, beside its vendor info. Its operations are <vendor>.<type>.import ({ id }, an identity or a binding id) and <vendor>.<type>.read ({ id, state?, handle? }, a state from an earlier call), both answering { id, gone: true } when the vendor has no such object and { id, gone: false, state, handle? } when it has, both effect read, idempotent, with the id as the policy’s target. “Missing” is part of the contract: the driver decides it, so a caller never parses a vendor’s error for it. A driver implements them like any other. handle is the driver’s own data about the object, opaque to everyone else, passed back unchanged (an OpenTofu driver keeps the provider’s private data and state version in it); the operations declare it opaque, so the ledger records it as "<handle>", never its bytes. Any operation may name such fields (opaque in its spec), and a nested one by a dotted path that goes into each item of a list (attachments.content: each attachment’s name kept, its bytes recorded as "<content>").
A writable type has four change operations besides. The built-in apply workflow (APPLY_WORKFLOW, "apply", a name a config’s own workflow may not take) calls them for the declared resources, and only it changes a declared object; any workflow may name them in its uses and call them for an object no data file declares, as a control plane makes and deletes a host per customer. Such a call is an ordinary write, held to the policy and recorded in the ledger like any other, and a run of any workflow but apply is refused (invalid_input, before the policy is asked) the call aimed at a declared object: an update or delete whose id the lockfile binds, or a create whose identity (what the type’s find makes of desired) a data file declares or the lockfile binds. A direct call of one is refused as for any write. plan (effect read, idempotent) takes { id?, state?, handle?, desired? } (no id for a create, no desired for a delete) and returns { action, planned?, unknown, replace }: none, create, update, replace or delete, the new state without write-only fields, the dotted paths known only after apply, and those whose change replaces the object. create (effect write, target new:<vendor>.<type>) takes { desired } and returns { id, state, handle? }, id its binding id; update takes { id, state?, handle?, desired, expect? } and returns the same, refusing with a DriverError whose vendorCode is plan_changed when the fresh plan’s action or replace differs from expect; delete (idempotent) takes { id, state?, handle? } and returns { id, gone: true }, an object already gone included. desired may hold secret markers at write-only fields, which the driver resolves (resolveSecrets) just before the vendor call (plan stores no generated secret: one not stored yet gets a throwaway value); no output holds a write-only value.
Calling the type declares one resource, which is what a data file does: repository({ owner: "acme", name: "sanoma" }) returns a frozen Declared, { vendor: "github", type: "repository", name: "acme/sanoma", desired: { owner: "acme", name: "sanoma" }, refs: {} }, branded with its <vendor>.<type> under the DECLARED symbol. It refuses a field the schema does not have, a field the vendor owns (unless identity names it), a value the schema rejects, or an empty identity. A type without find (Stripe’s, whose objects Stripe names) declares resources without a name: they are found only by their bindings (below).
A field may name another declared resource where the type’s fields.references says so, by dotted path, with the type it names and, in by, the fields of that resource the vendor may hold there instead: GitHub’s branch_protection has { repository_id: { type: "github.repository", by: ["name", "node_id"] } }, since GitHub holds a rule’s repository by its node id. So branch_protection({ repository_id: site, pattern: "main" }) takes the repository site. It stands for that resource’s name: desired holds repository_id: "acme/website" (a GitHub repository’s identity is <owner>/<name>), which the schema and find (the rule is acme/website:main) read, and a drift check takes any of the repository’s by values, read in the same run, as that name; and refs says where a resource was named, { repository_id: "github.repository:acme/website" } (a list item’s path has its index, teams.0). Anywhere else, or of another type, a resource is refused, and the constructor’s type (Declaring) says the same, so the editor marks it first. A resource whose type has no identity (a Neon project, which Neon names) stands for nothing a vendor could read, so only a field the runtime consumes by the reference itself may name it: a host’s database, as cloudflare.host({ database: store }) does, or a from reference. Then desired holds nothing there and refs has the type alone, { database: "neon.project" }, the loaded resource’s refs the declaration’s id, resources/sanoma/infra.ts#store.
A reference with from, a dotted path in the named resource’s state, takes that state instead: apply and drift give the field the resource’s state at that path, as a whole (a list or an object), read in the same run or made by an earlier step of it. So a sending domain’s DNS records go to the zone that holds them, the record set’s type declaring { records: { type: "resend.domain", from: "dns_records" } }:
export const mail = resend.domain({ name: "sanoma.work" });export const mailDns = cloudflare.records({ zone: "sanoma.work", name: "resend", records: mail });The resource stands for the whole field, never an item of a list (records: [mail] is refused), and a literal value is still allowed there; a reference has from or by, not both, and is refused at a write-only field or one that holds a write-only field. Resolving a config refuses a from path that is no field of a type the reference may name (checkFromRefs), naming that type’s fields. desired holds the resource’s name in its place, which the schema does not judge, and the declaration is applied after it. Where the same apply changes the resource at that path (creates or replaces it, or updates it with the path in its plan’s unknown or another value planned there; an update that touches other fields, such as a domain’s re-verify, changes nothing here), or, for a create, the resource has no state yet or nothing at that path, the value is known only after apply: the plan is given null there, so a type that takes a from field must accept null in its plan and report the path in unknown, and its update must keep what the vendor holds for a field left out of desired, and a change the new value makes (a replaced domain’s new DKIM key) is planned, and approved, with the rest; an update or replace step carries those paths in its own unknown. A plan of a bound object whose resource is absent, gone or unreadable and not about to change is given its fields without it, as drift compares them, and its step runs without it. A step planned with the field null is planned again at its step, with the value now known: none (the value turned out unchanged) leaves it done without a write, and otherwise its update expects the fresh plan’s action and replace, since the approval covered the change in kind. An empty list or object at the path counts as known: a vendor that answers [] while still filling the list makes the dependent write an empty one. At its step the field takes the resource’s state as the earlier step left it; one planned null whose value is still not known, as when the resource’s own step failed or waited, fails before its driver is called: its records come from resources/mail.ts#mail, which has no state yet (or whose state has no dns_records yet), and so does a step down the chain from it. A policy and an approval therefore see null for such a field: its value comes from another declared resource’s state at the vendor, known after apply. Drift compares the field against the bound resource’s state, read in the same run, and leaves it out while that resource is absent, gone, unreadable or has nothing at the path, which its own row reports. A bridge-backed type (tfConnector) cannot take a from field yet: an OpenTofu provider’s plan reads null as unset, not as known after apply. dnsRecord (DnsRecord), from the main entry, is the shape a DNS record passes in between two connectors: { type: "TXT" | "MX" | "CNAME" | "CAA", name, content, priority?, ttl? }, name the full name in lower case with no trailing dot, a TXT record’s content unquoted (each refused otherwise, never rewritten), and ttl 1 for automatic. Later, not yet: the cases apply hard-codes, a wakeup’s host (its host’s outputs(state).url) and a host’s source (a repository’s clone URL, by its by fields), could be from references, once from can name a host’s outputs as well as its state.
Only declared fields are compared for drift, as CloudFormation does: compareDeclared(fields, state, desired) keeps the fields desired declares, minus vendorOwned and writeOnly ones, picking objects field by field, list items against the declared item at the same index, and the items of an unordered list (a set) against what any declared item declares, sorted, so a set is compared as a multiset whatever order the vendor returns it in. A drift check compares normalize(actual, desired) with normalize(desired, desired), leaf by leaf: diffDeclared(resource, state, desired, accept?) returns each declared field that differs, { path, desired, actual }, where accept gives, by a reference’s path, the values that stand for the resource it names. withoutWriteOnly(fields, desired) drops write-only values from a declaration, keeping a secret’s marker, which names a stored value and holds none. So a field left out is never drift, which covers attributes an OpenTofu provider marks computed and optional (GitHub’s etag, topics): they are the user’s to set, so not vendorOwned, but the vendor fills them in when nobody does.
describeConfig lists the resource types as resourceTypes, each { id: "<vendor>.<type>", vendor, type, title, identity, fields, schema, ops, capabilities?, host? }: schema is its state as JSON Schema, with $id sanoma:resource-type/<id>, which its operations’ contracts $ref rather than repeat; capabilities the contracts it meets (host, database, wakeup, source), absent when it meets none; and host, for a host only, { lifetime }, its HostLifetime (long-lived or stops-on-exit), which Hosting shows on the Host’s card. sanoma/workflows/shared exports the Resource, ResourceSpec, ResourceFields, References, FieldReference, Declared, Declaring, DeclaredResource and ResourceProblem types.
Data files
Section titled “Data files”A company declares the resources it wants in TypeScript data files under resources/ beside its config, resources/<area>/<file>.ts, as its workflows are in workflows/. Sanoma loads each one, as Node imports a module, and reads what it exports:
import { github } from "@sanoma-ai/connector-github/resources";
export const website = github.repository({ owner: "acme", name: "website", visibility: "public", has_wiki: false });
export const websiteMain = github.branch_protection({ repository_id: website, // a reference: stands for the repository's identity, "acme/website" pattern: "main", enforce_admins: true,});
export default [website, websiteMain];Another data file names website by importing it: import { website } from "./github.ts".
A data file is TypeScript like any other: it may compute a value, spread a shared object or import a helper of its own. Each exported value that a resource type’s constructor made (<vendor>.<type>({ … }), the vendor’s constructors imported from its connector’s <info.package>/resources entry, the people’s from sanoma/resources) is one declaration, <file>#<export>, in the file that made it (another file re-exporting it declares nothing), under its non-default name when the file also exports it as default; anything else the file exports, such as the list export default [a, b] that Sanoma writes, declares nothing. A field the type’s fields.references allows a resource in is given the declared value itself, and names the declaration that exports that very object. A field the type’s fields.writeOnly lists takes secret("NAME") or secret("NAME", { generate: true }), imported from sanoma/resources (see Secrets). resources/data.ts is the exception: it holds the collections and nothing else.
The loader (loadModules) loads synchronously, since describeConfig and readPeople are: require of an ES module, Node’s type stripping and module.registerHooks, so a data file may not use top-level await. It serves the modules a company file imports from the runtime itself, from its own objects: each connector’s <package>/resources with the config’s constructors, sanoma/resources, sanoma/data (collection), sanoma/site (defineSite) and, to an app’s app.ts, sanoma (defineApp); so a data file never needs the package installed, and each value they make records where it was made. Each load is a generation: a file is loaded again, with what it imports, once it, a company file it imports or a directory they are in has changed (by size and modification time), so an edit is read without a restart; every other call answers from the generation, at the cost of a stat per file. liveDescription(config) (sanoma/workflows/describe) keeps a describeConfig and makes it again only once a file a load read (stampsOf), the lockfile, or a folder a new data file, app or site would appear in has changed: the app reads its description through it, so a saved field shows on the next page without a restart. A superseded generation’s modules stay in Node’s cache, a copy of the files per edit.
The data files are found from the config’s root: defineConfig records the file it is called from as the config’s file, and resolveConfig gives its directory as root. A config bundled into one file sets root itself. A config with neither has no data files, and says so, rather than guess the working directory.
loadDataFiles(root, connectors), from sanoma/workflows/describe, loads every regular .ts file under <root>/resources and each app’s apps/<app>/resources (but *.test.ts, *.d.ts and node_modules). It returns { resources, bindings, orphans, collections, problems } (collections: where each resources/data.ts declares each collection, { id, file, name, at }, never matched to a connector, a type or the lockfile): one DeclaredResource per declaration, by file and then in the order made, less any with a problem and any that names one, and the problems. Their shapes are the zod schemas DeclaredResourceSchema and ResourceProblemSchema in sanoma/workflows/description:
// A DeclaredResource{ "id": "resources/identity/github.ts#websiteMain", // <file>#<export>, the file relative to the root "file": "resources/identity/github.ts", "vendor": "github", "type": "branch_protection", "name": "acme/website:main", // what people call it: its identity, else its export's name "identity": "acme/website:main", // the import id that finds it unbound, from `find` "binding": "BPR_kwDOabc123", // the id of the object the lockfile binds it to "at": { "file": "resources/identity/github.ts", "export": "websiteMain" }, "desired": { "repository_id": "acme/website", "pattern": "main", "enforce_admins": true }, // as its type checked them "refs": { "repository_id": "resources/identity/github.ts#website" }, // where it names a resource, that resource's id}// A ResourceProblem, had `website` been written with `wiki: false`: at the line and column an error's stack gives, else at its export, else at its file{ "file": "resources/identity/github.ts", "line": 4, "column": 31, "message": "github.repository: no field wiki" }A problem is, at the line and column the error’s stack gives: a file that throws as it loads, a value its type refuses (a resource where it takes none among them) or a type its vendor does not declare, and a syntax error. V8 places a call at its method’s name, so the column above is at repository. A file stops at its first, so a broken file is one problem, and a file whose import threw is reported once, at the file that threw. At the file: an import Node cannot find (a constructors import of no connector in the config, a file that is not there), top-level await, and a resource made but never exported (written inline in a list, say). At file#export: one object exported under two names, a reference to a resource no data file exports, a type of no connector in the config, a resource declared in resources/data.ts or a collection in another data file, two resources of one type with one identity (and connection), and, from the lockfile (below), a binding of another type than its declaration’s or two declarations bound to one object; a lockfile that is not JSON or not bindings is the lockfile’s. describeConfig lists them, as resources and problems (and the lockfile’s orphans), so the app starts with the resources it could read and shows what is wrong in the rest; sanoma check prints them. No lint holds a data file to a form: what loads is read. readResources(config) is the strict reading, for a test or CI: it returns the resources, or throws one error listing every problem as problemLine prints it (file:line:column, file#export or file).
Bindings
Section titled “Bindings”Which vendor object a declaration means lives in a lockfile beside the data files, resources/sanoma.lock.json (LOCKFILE), not in the declaration, as package-lock.json is beside package.json: data files hold intent only, so an edit to a field cannot point a declaration at another object, copying a declaration copies no binding, and a rename is an update. Only apply writes it; it is committed.
{ "resources/identity/github.ts#website": { "type": "github.repository", "id": "R_kgDOabc123" }, "resources/billing/stripe.ts#pro": { "type": "stripe.product", "id": "prod_Rx2" },}loadDataFiles joins each declaration to its binding by its key, <file>#<export>, as binding, returns the lockfile’s bindings, and lists as orphans ({ key, type, id }) the bindings no data file declares, but those of a file that failed to load, whose declarations are not known. A missing lockfile binds nothing. sanoma/workflows/describe exports readLockfile(root) ({ bindings, problems }), serializeLockfile(bindings) (keys sorted, two-space JSON, a trailing newline), writeLockfile(root, bindings) (whole or not at all: written beside it, then renamed), and diffLockfiles(before, after), each change a Rebind: { key, type, kind: "bind" | "rebind" | "unbind", from?, to? }.
Writing a data file
Section titled “Writing a data file”Sanoma writes company files too, from sanoma/workflows/describe, by parsing them (with oxc-parser), not loading them: a written file must keep every byte it does not change. setFields(text, exportName, fields, options) returns the file’s text with fields of one declaration set, by dotted path as a drift report names them ({ has_wiki: true, "metadata.owner": "ops" }; a field the declaration lacks is added). The declaration is the object literal of export const <exportName> = …, or of export default … for "default": the object itself, or the first argument of the call it is (github.repository({ … }), collection({ … }), defineSite({ … }), defineApp({ … })). Only that statement changes, formatted with oxfmt, and every other byte of the file stays as it was. It writes literals only: a value the file computes (a name, a reference to another resource among them; a call but secret(…); a spread; a template with ${}), a path into an object or list that holds a spread, and a declaration that is no object literal throw NotLiteral, whose reason says what to edit in code instead (the value of has_wiki is computed in the file) and whose field names the field the file computes (none for a declaration that is no object literal). It refuses with a plain Error a file that does not parse, an export the file does not have, and a path through a value that is not an object or a list; a path whose segments name a field with a dot in its key (metadata: { "app.owner": … }) finds that field. renderDataFile({ imports, exports }, options) renders a whole new file, which, loaded, declares what it was given; a reference is a Reference, and a secret’s marker is written as secret("NAME") (or with { generate: true }), the file then importing secret from "sanoma/resources" (setFields adds that import after the file’s own when it sets one). formatOptions(root) reads the options from <root>/.oxfmtrc.json, oxfmt’s defaults without one. oxfmt is a dependency of this package, loaded only when a file is written. The app’s Adopt and its forms’ Save write through it (the app’s Hosting page).
Where Sanoma parses instead
Section titled “Where Sanoma parses instead”Everything a company file declares is read by loading it, but for these, which parse source with oxc and never run it: the workflow outline and the workflow lint (Keeping workflows replay-safe), since a run is held to its code’s shape, not to what it did once; a site’s pages and what they call (readSites: a site’s files are browser JSX, read as the site’s outline), though its site.ts is loaded; crossAppImports, a lint over imports; a draft’s files, never loaded, since a draft is someone’s unreviewed code: a change’s facts are told from their text (mayDeclarePeople, isRules), and updating an app reads main’s app.ts, never the draft’s; sanoma’s template, inside the installed package under node_modules where Node strips no types, whose people’s ids sanoma reads from its text when it starts a company; and the writer above.
drift is a built-in workflow: resolveConfig adds it to every config whose connectors declare resource types, so the worker runs it, describeConfig lists it (its entry has builtin: true, a label) and it starts like any other workflow, with the input {}. A config’s own workflow may not take its name. It uses the import of each resource type that has a driver, so its version moves with the connectors and drivers, not with the data files, and it is held to the same lint as any workflow: every vendor call goes through ctx, so the policy sees each as effect read and the ledger records it.
const runId = await client.drift({ startedBy: { id: "alice" } }); // start(drift, {}, …)const report = await client.driftReport(runId); // waits for it, as `result` does// { startedAt, finishedAt, problems: [], resources: [{ id, type, vendor, name, binding, status: "drifted", fields: [{ path: "has_wiki", desired: false, actual: true }] }, …] }The run reads the data files and the lockfile itself, in its first step (drift:data-files, recorded, so a replay checks the same list): its input is {}, and any other is refused, so no caller can hand it other resources. The step records each resource without its write-only values, and the files’ problems, which the report carries (problems; a file with problems contributes no resources, as in describeConfig). The worker loads the reader only then. Then the run imports each resource by its binding, else by its identity, one vendor call each (none for a resource with neither), in the files’ order (every run imports: no state is kept between runs yet), and compares the declared fields with diffDeclared (above), a reference against the state of the resource it names from the same run. Each resource’s status is clean, drifted (with fields, each leaf that differs: { path, desired, actual }, a list item’s path with its index, a list whose length changed or an unordered one whole), gone (the import of its binding says so), absent (it is not bound; found is the binding id of the object its identity found, if any, which apply may bind it to) or error (with error: the vendor’s error, a policy denial, or no driver for its type); one resource’s failure does not stop the others, but a failure that ends the run (isRunControlError: DBOS cancelling or stopping it) does. client.drift throws invalid_input when the connectors declare no resource types; client.driftReport(runId) throws invalid_input for another workflow’s run. DriftReport, DriftResult, DriftField and DriftStatus are the report’s types, also in sanoma/workflows/shared; client.runs({ workflow: "drift" }) lists drift runs.
A host’s revision is drift too (see Hosts): the run resolves its ref with the built-in sanoma.source.resolve, and a host whose state runs another commit is drifted, with a field at its revision path (desired the commit the ref names now). A bound host’s row also carries where its state says it answers (host: its url, wakeUrl and healthy, as the host’s outputs read them), which the app’s Hosting reads.
apply is the built-in workflow that makes the vendors match the data files, beside drift and listed the same way (builtin: true). It uses the import of each resource type with a driver, the change operations of each writable one, and approval; it is the only workflow that may call a change operation on a declared resource. Its input is { only?, bind?, answers? } (any other field refused): only the declared ids (<file>#<export>) or orphaned lockfile keys to plan, else all; bind, a declared id to the vendor’s id of the object to bind it to; answers, by id or key, recreate or forget for a gone object, forget or delete for an orphaned binding.
const runId = await client.apply( { answers: { "resources/infra.ts#store": "recreate" } }, { startedBy: { id: "alice" } },);const report = await client.applyReport(runId); // { plan: { problems, rebinds, steps }, results, lockfile: { written, revision?, bindings } }The run reads the data files and the lockfile in its first step (apply:data-files; a secret’s marker stays in desired, a plain write-only value does not), with the lockfile’s rebinds: what changed in it since apply last wrote it (diffLockfiles against the bindings the latest live apply run’s last apply:lockfile step wrote), changes someone else made. It imports each declared resource as drift does (by the binding bind gives, else the lockfile’s, else its identity), then plans each one only wants, each after the resources it names, as a PlanStep ({ id, vendor, type, action, … }): bind (to the object bind gives, or the one its identity found, by its binding id), create (unbound and nothing found: planned and unknown from its type’s plan), update or replace (its bound object as plan says, with drift’s fields, the paths that force a replace, and any unknown until it is done), none, gone (its bound object is no longer there: skipped unless answered, since a recreated database looks fine and has lost its data; a type with stateless: true, holding no data, is planned as a create instead, unless answered), and orphan for each binding no declaration has (skipped unless answered: deleting a declaration never deletes its object). What cannot be planned (a read-only type that is absent or drifted, an answer that cannot be done, an id the input names that nothing declares) is one of the plan’s problems, with no step.
When the policy would hold any change call the plan makes (asked ahead, in the step apply:policy, as each call would ask it), the run asks one approval of the first approver it names, titled “Apply resource changes”, covering every change operation in the plan, with the plan as JSON in its details; a policy that lets a covered call through once approved (approvedFor) then holds none of them again. Then each step runs, in order: create, update (with expect, the plan’s action and replace, so a vendor that now plans otherwise refuses with plan_changed), delete, or only the lockfile changed. A reference to a resource the vendor holds by another field (by) is given that resource’s binding id, one made earlier in the run included, and a from reference that resource’s state at its path, as found or as an earlier step left it (see Resources). Right after any step that changes a binding, that binding is changed on the lockfile as it is then (so another run’s change made meanwhile stays), written whole and committed through the worker’s source (apply:lockfile: Apply: create resources/infra.ts#store (supabase.project abcd…), by the person who started the run), so an object made is never left unbound. Right after a create’s binding is written, the run calls its type’s afterCreate operations in order, by id, each given the new object’s binding id and its export (a Supabase project waits for its health, then stores its database URL); one with until is called again every 5 seconds until its output passes, for up to 10 minutes, and one that never does fails the step, its object still bound. The approval covers the write ones among them too. Each step’s result is done, skipped (unanswered) or failed (with error; the run goes on); a host’s that it made or changed carries host, its outputs. A sandbox run writes nothing: the report’s lockfile.bindings is its copy. ApplyPlan, PlanStep, ApplyReport and ApplyResult are the types, also in sanoma/workflows/describe and /shared.
One live apply runs at a time for each app on a database. Every apply that is not a sandbox run goes on the apply queue, sanoma:<appName>:apply, which DBOS limits to one running run, counted in Postgres over every process and version of the app. This covers an apply started from the app (client.apply), a change’s deploy, a push to main and going live. A second apply waits as queued until the first ends, then plans the data files as they are by then. client.applyAhead(runId) names the apply it waits for: the one running or waiting for an approval, else the oldest queued before it. The app shows that apply on the queued run’s page and on Hosting. A sandbox apply calls fakes, so it runs on the app’s queue and never waits. An apply waiting at its approval keeps its place, and the ones behind it do not keep the worker up (idle). The limit assumes one live worker per database, as a deploy runs: a worker that starts as the latest version takes over or cancels the unfinished applies of other versions (Versions), so an older worker still running one of them then can overlap the next apply.
This package knows nothing of OpenTofu. Resource types from an OpenTofu provider are generated by sanoma/internal/bridge/tfschema, which turns the provider’s schema document into zod schemas and flagged fields (resources.gen.ts); sanoma/internal/bridge depends on this package, never the other way round.
These pages describe sanoma 0.11.24.