Documentation
¶
Overview ¶
Package mcp exposes rotari state through the Model Context Protocol.
Index ¶
- func NewServer(masterDir string, options Options) *mcpsdk.Server
- type ApplyImportInput
- type ApplyResetInput
- type ApplyUnlockInput
- type CheckProjectInput
- type CheckProjectOutput
- type CompareRunsInput
- type CompareRunsOutput
- type ControlJobsInput
- type ControlJobsOutput
- type ExportRunInput
- type ExportRunOutput
- type GetJobInfoInput
- type GetJobInfoOutput
- type ImportInput
- type ImportOutput
- type JobControlInput
- type JobControlPreview
- type ListProjectsInput
- type ListProjectsOutput
- type Options
- type PlannedJob
- type ProjectOverview
- type ResetInput
- type ResetOutput
- type RunInput
- type RunPreviewOutput
- type RunSummaryInput
- type RunSummaryOutput
- type StartRunInput
- type StartRunOutput
- type UnlockInput
- type UnlockOutput
- type UnreadableBaseDir
- type WaitRunInput
- type WaitRunOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplyImportInput ¶
type ApplyImportInput struct {
ImportInput
IfRevision string `json:"if_revision" jsonschema:"revision from rotari_preview_import; the import applies only if the project is still at it"`
}
type ApplyResetInput ¶
type ApplyResetInput struct {
ResetInput
IfRevision string `json:"if_revision" jsonschema:"revision from rotari_preview_reset; the reset applies only if the project is still at it"`
RecoverInterrupted *bool `` /* 148-byte string literal not displayed */
}
type ApplyUnlockInput ¶
type ApplyUnlockInput struct {
UnlockInput
IfRevision string `` /* 222-byte string literal not displayed */
}
type CheckProjectInput ¶
type CheckProjectOutput ¶
type CheckProjectOutput struct {
BaseDirRef string `json:"basedir_ref"`
Project string `json:"project"`
State string `json:"state" jsonschema:"ready, empty, running, locked (running on another host or in another PID namespace), or interrupted"`
Runnable bool `json:"runnable"`
Queued *int `json:"queued" jsonschema:"queued jobs; null when the queue of an active or interrupted project cannot be read"`
Lock string `json:"lock"`
RunID string `json:"run_id,omitempty"`
Revision string `json:"revision"`
}
type CompareRunsInput ¶
type CompareRunsOutput ¶
type CompareRunsOutput struct {
BaseDirRef string `json:"basedir_ref"`
Project string `json:"project"`
Comparison runlineage.Result `json:"comparison"`
// HiddenUnchanged counts the unchanged jobs left out of Comparison.Jobs.
HiddenUnchanged int `json:"hidden_unchanged,omitempty"`
// HiddenChanged counts the jobs left out beyond the limit, whose only
// change is their definition.
HiddenChanged int `json:"hidden_changed,omitempty"`
}
type ControlJobsInput ¶
type ControlJobsOutput ¶
type ExportRunInput ¶
type ExportRunOutput ¶
type GetJobInfoInput ¶
type GetJobInfoOutput ¶
type ImportInput ¶
type ImportInput struct {
BaseDirRef string `json:"basedir_ref" jsonschema:"basedir_ref of the destination state directory, from rotari_list_projects"`
Project string `json:"project" jsonschema:"destination project; created if it does not exist"`
Manifest string `json:"manifest" jsonschema:"workflow manifest text, as rotari export writes it"`
Format string `json:"format,omitempty" jsonschema:"manifest format: yaml (default), json, or toml"`
Overwrite bool `json:"overwrite,omitempty" jsonschema:"replace a queue that already has jobs"`
Detail bool `json:"detail,omitempty" jsonschema:"also return the full plan, with each job's command and each task's source attempt"`
}
type ImportOutput ¶
type ImportOutput struct {
workflowstate.PlanSummary
Plan *workflowstate.Plan `json:"plan,omitempty"`
}
ImportOutput is an import plan's summary and, when asked for, the plan.
type JobControlInput ¶
type JobControlPreview ¶
type ListProjectsInput ¶
type ListProjectsInput struct{}
type ListProjectsOutput ¶
type ListProjectsOutput struct {
Projects []ProjectOverview `json:"projects"`
// Unreadable lists registered basedirs whose projects could not be read.
Unreadable []UnreadableBaseDir `json:"unreadable,omitempty"`
}
type Options ¶
type Options struct {
// NewJobID returns a fresh job ID for an imported queue.
NewJobID func() string
// StartRun starts a supervisor for paths' project and sends it request,
// returning its response. Without it, runs cannot be started.
StartRun func(paths state.ProjectPaths, request server.Request) (server.Response, error)
// Actor labels the runs this server starts (ROTARI_ACTOR); empty leaves
// them unlabelled.
Actor string
}
Options supplies what the tools that change state need from the rotari process that serves them.
type PlannedJob ¶
type ProjectOverview ¶
type ProjectOverview struct {
BaseDirRef string `json:"basedir_ref" jsonschema:"path-free reference to the project's state directory"`
BaseDirName string `json:"basedir_name" jsonschema:"last element of the state directory's path"`
Project string `json:"project"`
State string `json:"state" jsonschema:"idle, running, or interrupted"`
Queued int `json:"queued"`
Runs int `json:"runs"`
LastRunID string `json:"last_run_id,omitempty"`
LastStatus string `json:"last_run_status,omitempty"`
LastJobs int `json:"last_run_jobs,omitempty"`
LastFailed int `json:"last_run_failed,omitempty"`
}
type ResetInput ¶
type ResetOutput ¶
type RunInput ¶
type RunInput struct {
BaseDirRef string `json:"basedir_ref" jsonschema:"basedir_ref of the project, from rotari_list_projects"`
Project string `json:"project" jsonschema:"project name"`
RunID string `` /* 128-byte string literal not displayed */
Retry bool `` /* 218-byte string literal not displayed */
}
type RunPreviewOutput ¶
type RunPreviewOutput struct {
Project string `json:"project"`
Execute []PlannedJob `json:"execute" jsonschema:"jobs the run would execute"`
Jobs int `json:"jobs" jsonschema:"jobs in the run snapshot"`
Carried int `json:"carried" jsonschema:"results the run would carry forward instead of executing"`
SourceRun string `json:"source_run,omitempty" jsonschema:"saved run whose results the selection references"`
OmittedSourceJobs []string `` /* 130-byte string literal not displayed */
Revision string `json:"revision" jsonschema:"revision to pass to rotari_start_run"`
}
type RunSummaryInput ¶
type RunSummaryOutput ¶
type RunSummaryOutput struct {
BaseDirRef string `json:"basedir_ref"`
Project string `json:"project"`
State project.RunPhase `` /* 166-byte string literal not displayed */
Summary runlineage.RunSummary `json:"summary"`
}
type StartRunInput ¶
type StartRunInput struct {
RunInput
IfRevision string `json:"if_revision" jsonschema:"revision from rotari_preview_run; the run starts only if the project is still at it"`
RunName string `json:"run_name,omitempty" jsonschema:"label for the run"`
Note string `json:"note,omitempty" jsonschema:"why the run is made, recorded with it and shown by rotari show and lineage"`
}
type StartRunOutput ¶
type UnlockInput ¶
type UnlockInput struct {
BaseDirRef string `json:"basedir_ref" jsonschema:"basedir_ref of the project, from rotari_list_projects"`
Project string `json:"project" jsonschema:"project name"`
RunID string `json:"run_id,omitempty" jsonschema:"the interrupted run to recover; by default the one the project's lock or metadata names"`
AssumeStopped bool `` /* 221-byte string literal not displayed */
}
type UnlockOutput ¶
type UnlockOutput struct {
ExecutionChecked bool `` /* 235-byte string literal not displayed */
Project string `json:"project"`
InterruptedRunID string `` /* 141-byte string literal not displayed */
InterruptedRun string `json:"interrupted_run,omitempty" jsonschema:"what the interrupted run's jobs last reported"`
JobsMayBeRunning bool `` /* 169-byte string literal not displayed */
Revision string `json:"revision" jsonschema:"for a preview, the revision to pass to rotari_unlock; after an unlock, the new revision"`
Coordinator project.CoordinatorAssessment `json:"coordinator"`
Allowed bool `json:"allowed"`
Applied bool `json:"applied"`
RefusalCode string `json:"refusal_code,omitempty"`
AssumeStopped bool `json:"assume_stopped"`
Action string `` /* 126-byte string literal not displayed */
Repair project.RepairAssessment `json:"repair"`
}
type UnreadableBaseDir ¶
type WaitRunInput ¶
type WaitRunInput struct {
RunID string `json:"run_id" jsonschema:"exact run ID, such as rotari_start_run returns"`
TimeoutSeconds int `json:"timeout_seconds,omitempty" jsonschema:"how long to wait, 1 to 300 seconds; default 30. Call again to keep waiting."`
UntilFailure bool `` /* 139-byte string literal not displayed */
AllJobs bool `json:"all_jobs,omitempty" jsonschema:"list every job of each failure group, as rotari_run_summary does with all_jobs"`
}
type WaitRunOutput ¶
type WaitRunOutput struct {
RunSummaryOutput
Reason string `` /* 182-byte string literal not displayed */
}