mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
feat(agent): Sandbox / CLI Agent (dify.shell) + read-only sandbox file inspector (#36984)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
autofix-ci[bot]
parent
d3058d63bd
commit
44725dde74
@@ -1103,6 +1103,70 @@ List workflow apps that reference this Agent App's bound Agent (read-only)
|
||||
| 200 | Referencing workflows listed successfully | [AgentReferencingWorkflowsResponse](#agentreferencingworkflowsresponse) |
|
||||
| 404 | App not found | |
|
||||
|
||||
### /apps/{app_id}/agent-workspace/files
|
||||
|
||||
#### GET
|
||||
##### Description
|
||||
|
||||
List a directory in an Agent App conversation's sandbox workspace (read-only)
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Located in | Description | Required | Schema |
|
||||
| ---- | ---------- | ----------- | -------- | ------ |
|
||||
| app_id | path | Application ID | Yes | string |
|
||||
| conversation_id | query | Agent App conversation ID | Yes | string |
|
||||
| path | query | Directory path relative to the sandbox workspace | No | string |
|
||||
|
||||
##### Responses
|
||||
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | Listing returned | [WorkspaceListResponse](#workspacelistresponse) |
|
||||
|
||||
### /apps/{app_id}/agent-workspace/files/download
|
||||
|
||||
#### GET
|
||||
##### Description
|
||||
|
||||
Download a file from an Agent App conversation's sandbox workspace (read-only)
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Located in | Description | Required | Schema |
|
||||
| ---- | ---------- | ----------- | -------- | ------ |
|
||||
| app_id | path | Application ID | Yes | string |
|
||||
| conversation_id | query | Agent App conversation ID | Yes | string |
|
||||
| path | query | File path relative to the sandbox workspace | Yes | string |
|
||||
|
||||
##### Responses
|
||||
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | File bytes | binary |
|
||||
| 413 | File exceeds the workspace download limit | |
|
||||
|
||||
### /apps/{app_id}/agent-workspace/files/preview
|
||||
|
||||
#### GET
|
||||
##### Description
|
||||
|
||||
Preview a text/binary file in an Agent App conversation's sandbox workspace
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Located in | Description | Required | Schema |
|
||||
| ---- | ---------- | ----------- | -------- | ------ |
|
||||
| app_id | path | Application ID | Yes | string |
|
||||
| conversation_id | query | Agent App conversation ID | Yes | string |
|
||||
| path | query | File path relative to the sandbox workspace | Yes | string |
|
||||
|
||||
##### Responses
|
||||
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | Preview returned | [WorkspacePreviewResponse](#workspacepreviewresponse) |
|
||||
|
||||
### /apps/{app_id}/agent/logs
|
||||
|
||||
#### GET
|
||||
@@ -2623,6 +2687,76 @@ Get workflow run node execution list
|
||||
| 200 | Node executions retrieved successfully | [WorkflowRunNodeExecutionListResponse](#workflowrunnodeexecutionlistresponse) |
|
||||
| 404 | Workflow run not found | |
|
||||
|
||||
### /apps/{app_id}/workflow-runs/{workflow_run_id}/agent-nodes/{node_id}/workspace/files
|
||||
|
||||
#### GET
|
||||
##### Description
|
||||
|
||||
List a directory in a Workflow Agent node's sandbox workspace (read-only)
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Located in | Description | Required | Schema |
|
||||
| ---- | ---------- | ----------- | -------- | ------ |
|
||||
| app_id | path | Application ID | Yes | string |
|
||||
| node_id | path | Workflow Agent node ID | Yes | string |
|
||||
| workflow_run_id | path | Workflow run ID | Yes | string |
|
||||
| node_execution_id | query | Optional workflow node execution ID. When omitted, the latest active session for the node is used. | No | string |
|
||||
| path | query | Directory path relative to the sandbox workspace | No | string |
|
||||
|
||||
##### Responses
|
||||
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | Listing returned | [WorkspaceListResponse](#workspacelistresponse) |
|
||||
|
||||
### /apps/{app_id}/workflow-runs/{workflow_run_id}/agent-nodes/{node_id}/workspace/files/download
|
||||
|
||||
#### GET
|
||||
##### Description
|
||||
|
||||
Download a file from a Workflow Agent node's sandbox workspace (read-only)
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Located in | Description | Required | Schema |
|
||||
| ---- | ---------- | ----------- | -------- | ------ |
|
||||
| app_id | path | Application ID | Yes | string |
|
||||
| node_id | path | Workflow Agent node ID | Yes | string |
|
||||
| workflow_run_id | path | Workflow run ID | Yes | string |
|
||||
| node_execution_id | query | Optional workflow node execution ID. When omitted, the latest active session for the node is used. | No | string |
|
||||
| path | query | File path relative to the sandbox workspace | Yes | string |
|
||||
|
||||
##### Responses
|
||||
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | File bytes | binary |
|
||||
| 413 | File exceeds the workspace download limit | |
|
||||
|
||||
### /apps/{app_id}/workflow-runs/{workflow_run_id}/agent-nodes/{node_id}/workspace/files/preview
|
||||
|
||||
#### GET
|
||||
##### Description
|
||||
|
||||
Preview a text/binary file in a Workflow Agent node's sandbox workspace
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Located in | Description | Required | Schema |
|
||||
| ---- | ---------- | ----------- | -------- | ------ |
|
||||
| app_id | path | Application ID | Yes | string |
|
||||
| node_id | path | Workflow Agent node ID | Yes | string |
|
||||
| workflow_run_id | path | Workflow run ID | Yes | string |
|
||||
| node_execution_id | query | Optional workflow node execution ID. When omitted, the latest active session for the node is used. | No | string |
|
||||
| path | query | File path relative to the sandbox workspace | Yes | string |
|
||||
|
||||
##### Responses
|
||||
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | Preview returned | [WorkspacePreviewResponse](#workspacepreviewresponse) |
|
||||
|
||||
### /apps/{app_id}/workflow/comments
|
||||
|
||||
#### GET
|
||||
@@ -16864,6 +16998,15 @@ Workflow tool configuration
|
||||
| remove_webapp_brand | boolean | | No |
|
||||
| replace_webapp_logo | string | | No |
|
||||
|
||||
#### WorkspaceFileEntryResponse
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| mtime | integer | | Yes |
|
||||
| name | string | | Yes |
|
||||
| size | integer | | Yes |
|
||||
| type | string | *Enum:* `"dir"`, `"file"`, `"symlink"` | Yes |
|
||||
|
||||
#### WorkspaceInfoPayload
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
@@ -16877,6 +17020,14 @@ Workflow tool configuration
|
||||
| limit | integer | | No |
|
||||
| page | integer | | No |
|
||||
|
||||
#### WorkspaceListResponse
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| entries | [ [WorkspaceFileEntryResponse](#workspacefileentryresponse) ] | | No |
|
||||
| path | string | | Yes |
|
||||
| truncated | boolean | | No |
|
||||
|
||||
#### WorkspacePermissionResponse
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
@@ -16885,6 +17036,16 @@ Workflow tool configuration
|
||||
| allow_owner_transfer | boolean | | Yes |
|
||||
| workspace_id | string | | Yes |
|
||||
|
||||
#### WorkspacePreviewResponse
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| binary | boolean | | Yes |
|
||||
| path | string | | Yes |
|
||||
| size | integer | | Yes |
|
||||
| text | string | | No |
|
||||
| truncated | boolean | | Yes |
|
||||
|
||||
#### _AnonymousInlineModel_b1954337d565
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|
||||
Reference in New Issue
Block a user