chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
60158935f4
commit
6519682885
15831 files changed
+3063428
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package agentcli
|
||||
|
||||
import "context"
|
||||
|
||||
// StubClient abstracts Agent Stub HTTP control-plane and file data-plane operations.
|
||||
type StubClient interface {
|
||||
// HTTP control-plane
|
||||
Connect(ctx context.Context, argv []string, metadataJSON string) (*ConnectResponse, error)
|
||||
CreateFileUploadURL(ctx context.Context, filename, mimetype string) (string, error)
|
||||
CreateToolFileUploadURL(ctx context.Context, filename, mimetype string) (string, error)
|
||||
CreateFileDownloadURL(ctx context.Context, transferMethod string, reference, url *string, forFrontend bool) (*FileDownloadResponse, error)
|
||||
|
||||
// Config operations (HTTP-only control-plane)
|
||||
GetConfigManifest(ctx context.Context) ([]byte, error)
|
||||
CreateConfigDownloadURL(ctx context.Context, kind, name string) (*FileDownloadResponse, error)
|
||||
PushConfig(ctx context.Context, payload any) ([]byte, error)
|
||||
PatchConfigEnv(ctx context.Context, envText string) ([]byte, error)
|
||||
PutConfigNote(ctx context.Context, note string) ([]byte, error)
|
||||
GetConfigPrompt(ctx context.Context) ([]byte, error)
|
||||
PutConfigPrompt(ctx context.Context, prompt string) ([]byte, error)
|
||||
|
||||
// Data-plane (always HTTP, signed URLs)
|
||||
UploadFileToURL(uploadURL, filePath, filename, mimetype string) ([]byte, error)
|
||||
DownloadFromURL(downloadURL string) ([]byte, error)
|
||||
|
||||
Close() error
|
||||
}
|
||||
|
||||
// NewStubClient creates the HTTP Agent Stub client.
|
||||
func NewStubClient(env *Environment) (StubClient, error) {
|
||||
endpoint, err := ParseEndpoint(env.URL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
normalizedEnv := *env
|
||||
normalizedEnv.URL = endpoint.URL
|
||||
return newHTTPStubClient(&normalizedEnv), nil
|
||||
}
|
||||
Reference in new issue
Block a user