v1

package
v0.0.0-...-8902c11 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1 暴露 /api/v1/plugins 端点,从 agentresource.Repo 读 DB。仅 OpenCode CLI 会真正下发 plugin 资产,但列表端点对所有任务创建器可见。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginHandler

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

PluginHandler plugin 列表处理器

func NewPluginHandler

func NewPluginHandler(i *do.Injector) (*PluginHandler, error)

NewPluginHandler 创建 plugin handler

func (*PluginHandler) ListEnabled

func (h *PluginHandler) ListEnabled(c *web.Context) error

ListEnabled 获取当前用户视角下的 Plugins 列表

@Summary		获取 Plugins 列表
@Description	并集返回 (global ∪ 用户 active team) 两级 scope 下的 plugin,同名 team>global 覆盖;disabled 仍返回但 enabled=false。
@Tags			【公共】plugin
@Security		MonkeyCodeAIAuth
@Accept			json
@Produce		json
@Success		200	{object}	web.Resp{data=[]domain.PluginListItem}	"获取成功"
@Failure		500	{object}	web.Resp								"服务器内部错误"
@Router			/api/v1/plugins [get]

Jump to

Keyboard shortcuts

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