common

package
v0.52.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOrchestratorContext

func BuildOrchestratorContext(name, transport, event string, workspace *WorkspaceContext, task map[string]interface{}) map[string]interface{}

BuildOrchestratorContext creates a standard orchestrator context object. name is the orchestrator name (e.g. "symphony", "kanban"). transport is "hook" or "bridge". event is the lifecycle event name. workspace contains path/key info (may be nil). task contains task metadata (may be nil).

func BuildOrchestratorLabels

func BuildOrchestratorLabels(name, state string, flags ...string) []string

BuildOrchestratorLabels builds the standard label set for integration messages.

Label rules from spec:

  • Always: "orchestrator", "orchestrator:<name>"
  • When state is known: "task-state:<state>"
  • Add "handoff" for review-ready / awaiting-review messages
  • Add "blocking" for failed / interrupted / blocked messages

func DeliverIntegrationMessage

func DeliverIntegrationMessage(root, from, to, subject, body string, ctx map[string]interface{}, labels []string, thread, kind, priority string) (string, error)

DeliverIntegrationMessage builds and delivers a standard integration message to the specified recipient's inbox. It uses the same Maildir atomic delivery as the rest of AMQ.

Parameters:

  • root: AMQ root directory
  • from: sender handle
  • to: recipient handle (single; self-delivery for hooks)
  • subject: message subject line
  • body: markdown body
  • ctx: message context (should contain "orchestrator" key)
  • labels: message labels
  • thread: thread ID (e.g. "task/<workspace_key>")
  • kind: message kind (e.g. "status", "todo")
  • priority: message priority (e.g. "normal", "low")

Types

type OrchestratorContext

type OrchestratorContext struct {
	Version   int                    `json:"version"`
	Name      string                 `json:"name"`
	Transport string                 `json:"transport"`
	Event     string                 `json:"event"`
	Workspace *WorkspaceContext      `json:"workspace,omitempty"`
	Task      map[string]interface{} `json:"task,omitempty"`
}

OrchestratorContext builds the context.orchestrator JSON object used by all integration messages. The returned map is meant to be nested under a "orchestrator" key in the message context.

Spec reference: "All integration metadata lives under context.orchestrator."

type WorkspaceContext

type WorkspaceContext struct {
	Path string `json:"path"`
	Key  string `json:"key"`
}

WorkspaceContext describes the workspace portion of orchestrator context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL