Documentation
¶
Overview ¶
Package authorsession runs one action author session on a runner device: it prepares the device with the pipeline's own code, runs the runner's Python agent as a child workflow, and cleans and releases the device on every exit.
Index ¶
- Constants
- type AuthoringBuild
- type AuthoringContext
- type AuthoringDevice
- type SessionInput
- type Workflow
- func (w *Workflow) ExecuteWorkflow(ctx workflow.Context, input workflowengine.WorkflowInput) (result workflowengine.WorkflowResult, finalErr error)
- func (w *Workflow) GetOptions() workflow.ActivityOptions
- func (w *Workflow) Name() string
- func (w *Workflow) Workflow(ctx workflow.Context, input workflowengine.WorkflowInput) (workflowengine.WorkflowResult, error)
Constants ¶
const ( // WorkflowName is the registered name of the session workflow. WorkflowName = activities.ActionAuthorSessionWorkflowName // AuthorWorkflowType is the Python agent's workflow on the runner. AuthorWorkflowType = activities.ActionAuthorWorkflowType // AuthorTaskQueueSuffix follows the runner ID in the Python agent's task queue. AuthorTaskQueueSuffix = "-ActionAuthor" // ReleaseDeviceActivityName is the Python agent's activity that deletes // the session's iOS simulator clones. ReleaseDeviceActivityName = "action_author.release_device" // StepID labels the prepared device in errors and run data. StepID = "action-author" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthoringBuild ¶
type AuthoringBuild struct {
WalletID string `json:"wallet_id"`
VersionID string `json:"version_id"`
VersionIdentifier string `json:"version_identifier"`
OwnerNamespace string `json:"owner_namespace"`
Platform string `json:"platform"`
InstallerSHA256 string `json:"installer_sha256"`
Source string `json:"source"`
PackageID string `json:"package_id,omitempty"`
StoreURL string `json:"store_url,omitempty"`
}
AuthoringBuild is the resolved build the agent authors against. Store builds have no version or installer digest: the agent installs PackageID from StoreURL at session start.
type AuthoringContext ¶
type AuthoringContext struct {
WalletVersionIdentifier string `json:"wallet_version_identifier"`
ActorID string `json:"actor_id"`
Platform string `json:"platform"`
Build AuthoringBuild `json:"build"`
Device AuthoringDevice `json:"device"`
}
AuthoringContext is the trusted session context passed to the Python agent; its JSON shape is the runner agent's contract. The agent sets each action's plan in the chat.
type AuthoringDevice ¶
type AuthoringDevice struct {
DeviceID string `json:"device_id"`
RunnerID string `json:"runner_id"`
Serial string `json:"serial"`
Type string `json:"type"`
PackageID string `json:"package_id"`
InstallerPath string `json:"installer_path"`
}
AuthoringDevice is the prepared runner device the agent drives.
type SessionInput ¶
type SessionInput struct {
DeviceID string `json:"device_id"`
// Platform is "android" or "ios", derived from the device type.
Platform string `json:"platform"`
WalletVersionIdentifier string `json:"wallet_version_identifier"`
ActorID string `json:"actor_id"`
// Namespace is the runner namespace the session runs in and
// Organization the canonified_name of the caller's organization. Both
// are bound by TicketGrant and Grant; the workflow does not read them.
Namespace string `json:"namespace"`
Organization string `json:"organization"`
// TicketGrant is Credimi's signature of the enqueued session
// (actionauthor.SignTicket), set by POST /api/action-author/sessions
// after its checks. The activity that starts the session accepts only a
// ticket signed for exactly the session it starts, and replaces it with
// Grant.
TicketGrant string `json:"ticket_grant,omitempty"`
// Grant is Credimi's signature of the session (actionauthor.SignSession),
// set by the activity that starts the session (never in the semaphore
// ticket) and checked by every Credimi activity the session and its
// agent call. The workflow never reads it.
Grant string `json:"grant,omitempty"`
}
SessionInput selects the device and build of a session.
type Workflow ¶
type Workflow struct {
WorkflowFunc workflowengine.WorkflowFn
}
Workflow is the "Action author session" workflow.
func (*Workflow) ExecuteWorkflow ¶
func (w *Workflow) ExecuteWorkflow( ctx workflow.Context, input workflowengine.WorkflowInput, ) (result workflowengine.WorkflowResult, finalErr error)
ExecuteWorkflow prepares the device, runs the agent until it ends and always cleans the device and releases the semaphore ticket. Any outcome of the agent ends the session normally.
func (*Workflow) GetOptions ¶
func (w *Workflow) GetOptions() workflow.ActivityOptions
GetOptions returns the pipeline's default activity options.
func (*Workflow) Workflow ¶
func (w *Workflow) Workflow( ctx workflow.Context, input workflowengine.WorkflowInput, ) (workflowengine.WorkflowResult, error)
Workflow runs the session.