Skip to content

Commands ​

Discover and execute Host-exposed commands through typed action contracts. A command ID names a public operation, not an arbitrary shell command or executable.

Contract: nexa.commands/100. API index.

Typical sequence ​

List or describe the command, validate its input schema, then Execute with the same target and inputs the user reviewed. Execution returns an operation to observe.

Behavior and limits ​

An unavailable command remains unavailable even if a similarly named UI control exists. Do not fall back to process execution or private UI access.

The recorded Host maps 3 of 3 operations in this group. A mapping is subject to permission, phase, scope, platform and business preconditions. Host snapshot identifies the source revision; negotiate against the actual installed Host.

Operations ​

List · Describe · Execute

List ​

PageRequest → Page<ActionDescriptor> (wrapper, item)

PropertyContract
Local SDK method ID1
KindQuery
Permissionnexa.commands.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
Cursorstring?Opaque continuation or observation cursor. Reuse only in the issuing query/scope; absence and invalidity are different. Nullable; omission is distinct from an empty value. No implicit default is promised by this type.
LimitlongRequested bound on returned items. The Host may impose a smaller domain-specific limit.

Successful result

Read Items and continue with NextCursor while preserving the original query. An absent cursor ends the sequence; an invalid cursor is an error.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Commands_List(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Commands_List_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Describe ​

QualifiedRequest → ActionDescriptor

PropertyContract
Local SDK method ID2
KindQuery
Permissionnexa.commands.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdQualifiedIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Commands_Describe(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Commands_Describe_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Execute ​

ActionRequest → OperationRef

PropertyContract
Local SDK method ID3
KindOperation
Permissionnexa.commands.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
ActionQualifiedIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
TargetScopedTargetStructured ScopedTarget value; follow its linked field contract.
InputsAbiValueTyped input value encoded under the declared input schema.
ExpectedRevisionRevision?Revision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target. Nullable; omission is distinct from an empty value. No implicit default is promised by this type.
IdempotencyKeystringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Commands_Execute(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Commands_Execute_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.


Source: NexaCL-Plugin-SDK · Apache-2.0.

Site documentation: CC BY-SA 4.0. Imported SDK documents: Apache-2.0 as marked.