Skip to content

Template programs: extend, promote, upgrade

The Template Verbs extend, promote, upgrade as MCP do programs, with inputs, result, refusals and an example.

Reference for Template, one group of Template programs.

Template.extend

Extend adds a Template to a Startup’s bases, pinned to a Version, so the Startup inherits its definition. Verb page.

Text
do: return await $.Template.extend(input)

Emits Template.extended.

Inputs

InputTypeRequiredDescription
templateTemplaterequiredThe Template to inherit.
startupStartuprequiredThe Startup that extends it.

Returns

OutputTypeRequiredDescription
startupStartuprequiredThe Startup with the Template among its bases.
templateTemplaterequiredThe Template extended.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.
A clash between two bases until the Startup settles itrefusedClear what the check names, then call it again.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Template.extend({ template: 'template_THRQF1h9uX', startup: 'startup_l3hr1EnUGY' })"
  }
}

Template.promote

Promote moves one Startup’s refinement into a Template, so every Startup that extends the Template inherits it. Verb page.

Text
do: return await $.Template.promote(input)

Emits Template.promoted.

Inputs

InputTypeRequiredDescription
templateTemplaterequiredThe Template that receives the refinement.
startupStartuprequiredThe Startup that holds the refinement.

Returns

OutputTypeRequiredDescription
changeChangerequiredThe Change against the Template.
templateTemplaterequiredThe Template that received the refinement.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Template.promote({ template: 'template_THRQF1h9uX', startup: 'startup_l3hr1EnUGY' })"
  }
}

Template.upgrade

Upgrade moves a Startup to a newer Version of a Template it extends, through a Change it can review. Verb page.

Text
do: return await $.Template.upgrade(input)

Emits Template.upgraded.

Inputs

InputTypeRequiredDescription
templateTemplaterequiredThe Template to upgrade.
startupStartuprequiredThe Startup that extends it.
versionVersionThe target Version. Defaults to the latest.

Returns

OutputTypeRequiredDescription
changeChangerequiredThe Change that moves the pin.
templateTemplaterequiredThe Template upgraded to.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Template.upgrade({ template: 'template_THRQF1h9uX', startup: 'startup_l3hr1EnUGY' })"
  }
}