Are function-backed actions in ontology as code in the @osdk/maker enabled?

Hello!

I have been working on a repo in OaC and managed to successfully build and install an OaC product via Marketplace. My next step was adding a function-backed action.

The @osdk/maker documentation is sparse on this, but the stable version of defineAction does accept a functionRule with a functionRid, which I tried to use. I created the function as a separate repo in Python, published it and used its RID and version, and wired it up in the OaC repo:

...
rules: [
  {
    type: "functionRule",
    functionRule: {
      functionRid: rid_x,
      functionVersion:  function_version_x,
      functionInputValues: { ... },
    },
  },
],

The product tags and publishes to Marketplace successfully, but installation fails with:

Can't install ontology block OntologyMetadata:MarketplaceEntityMissingBlockShapeId
[expectedBlockShapeType=SEMANTIC_FUNCTION_LOCATOR, ...]

From what I can tell, Marketplace expects function references to be expressed as a SEMANTIC_FUNCTION_LOCATOR rather than a raw RID. DevOps usually handles this translation when you add a function and action type together as product outputs, but with OaC this isn’t possible since the ontology is code-managed and DevOps won’t let you modify it.

My questions:

  • Is functionRule in defineAction actually supported for Marketplace distribution, or is this still experimental/unsupported?
  • Has anyone found a working pattern for co-packaging a function-backed action with an OaC-managed ontology?

Thanks

@Maciej95 no docs page covers this yet, so this is from reading the osdk-ts source. a raw functionRule with a rid in stable defineAction just passes the rid through, it doesn’t build the function shape marketplace needs. that only happens in @osdk/maker-experimental, which has a separate defineFunctionBackedAction

defineFunctionBackedAction({ functionApiName: “myFunction”, displayName: “My action” })

at build time it looks the function up in a functions ir file that the maker-experimental cli writes during typescript function discovery (it needs functionsDir and nodeModulesDir). when the function is found, the converter adds the function shape to the bundle. if it isn’t, no shape gets built, and my guess is that’s your MarketplaceEntityMissingBlockShapeId / SEMANTIC_FUNCTION_LOCATOR error

so the pattern that matches the code is a typescript function in the same OaC repo plus defineFunctionBackedAction, not a python function in a separate repo, since the matcher only looks up typescript functions by name. caveats: the package readme says these functions are unstable, and i haven’t checked whether the OaC repo template passes the discovery flags already