Help us shape the future of Go! Take the 2026 Go Developer Survey

task

package
v1.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ToolTaskManage = "task_manage"

Variables

This section is empty.

Functions

func InputSchema added in v0.8.2

func InputSchema(name string, cfg config.Config) (map[string]any, bool)

func ManageInputSchema added in v0.8.2

func ManageInputSchema(cfg config.Config) map[string]any

func ManageOutputSchema added in v0.8.2

func ManageOutputSchema(cfg config.Config) map[string]any

func OutputSchema added in v0.8.2

func OutputSchema(name string, cfg config.Config) (map[string]any, bool)

Types

type ConfigProvider

type ConfigProvider func() config.Config

type LearningCheckRequest added in v0.8.2

type LearningCheckRequest struct {
	EvolutionID string `json:"evolution_id"`
	OnSuccess   string `json:"on_success"`
	OnFailure   string `json:"on_failure"`
}

type ManageRequest added in v0.8.2

type ManageRequest struct {
	Action               string                 `json:"action"`
	Title                string                 `json:"title,omitempty"`
	Goal                 string                 `json:"goal,omitempty"`
	Project              string                 `json:"project,omitempty"`
	Device               string                 `json:"device,omitempty"`
	CompletionConditions []string               `json:"completion_conditions,omitempty"`
	Steps                []StepRequest          `json:"steps,omitempty"`
	TemplateID           string                 `json:"template_id,omitempty"`
	SourceTemplateIDs    []string               `json:"source_template_ids,omitempty"`
	LearningChecks       []LearningCheckRequest `json:"learning_checks,omitempty"`
	Status               string                 `json:"status,omitempty"`
	Limit                *int                   `json:"limit,omitempty"`
	TaskID               string                 `json:"task_id,omitempty"`
	StepID               string                 `json:"step_id,omitempty"`
	CompletedStepIDs     *[]string              `json:"completed_step_ids,omitempty"`
	CurrentStepID        string                 `json:"current_step_id,omitempty"`
	Summary              string                 `json:"summary,omitempty"`
	Verified             []string               `json:"verified,omitempty"`
	Risks                []string               `json:"risks,omitempty"`
}

ManageRequest 只表达 task_manage 对模型公开的输入字段。 持久化状态中的 phase、bound_at 等内部字段在规范化阶段由 Task 域模型补齐,不能从边界注入。

type Result

type Result = toolcore.Result

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(configProvider ConfigProvider, tasks *taskstate.Store, evolution ...EvolutionProvider) *Service

func (*Service) Manage

func (s *Service) Manage(ctx context.Context, request ManageRequest) (Result, error)

func (*Service) RuntimeOverview added in v1.0.0

func (s *Service) RuntimeOverview() (map[string]int, error)

RuntimeOverview 返回控制面板需要的 Task 轻量统计,避免为了几个数字把完整 Task 列表跨 Nexus Bridge 传输。统计上限与既有 Runtime 概览保持一致。

func (*Service) RuntimeTask

func (s *Service) RuntimeTask(id string) (Result, error)

func (*Service) RuntimeTaskDelete

func (s *Service) RuntimeTaskDelete(id string) (Result, error)

func (*Service) RuntimeTasks

func (s *Service) RuntimeTasks(status string, limit int) (Result, error)

func (*Service) WorkflowManage

func (s *Service) WorkflowManage(ctx context.Context, request WorkflowRequest) (Result, error)

type StepRequest added in v0.8.2

type StepRequest struct {
	ID    string `json:"id"`
	Title string `json:"title"`
}

type ToolError

type ToolError = toolcore.ToolError

type WorkflowRequest added in v0.8.2

type WorkflowRequest struct {
	Action             string              `json:"action"`
	TemplateID         string              `json:"template_id,omitempty"`
	TemplateIDs        []string            `json:"template_ids,omitempty"`
	TemplateVersion    string              `json:"template_version,omitempty"`
	TemplateStatus     string              `json:"template_status,omitempty"`
	Goal               string              `json:"goal,omitempty"`
	Device             string              `json:"device,omitempty"`
	Type               string              `json:"type,omitempty"`
	Template           *taskstate.Template `json:"template,omitempty"`
	AllowLongTemplate  *bool               `json:"allow_long_template,omitempty"`
	LongTemplateReason string              `json:"long_template_reason,omitempty"`
}

WorkflowRequest 是 workflow_template_manage 的强类型输入。

Jump to

Keyboard shortcuts

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