|
|
@@ -50,7 +50,7 @@ export function PaasGeneratedFiles(props: {
|
|
|
api.request({ action: "run-files", agentID: props.agentID, runID }).catch(() => undefined),
|
|
|
]).then(([run, work]) => {
|
|
|
if (current !== request) return
|
|
|
- const artifacts = paasRows(run, "artifacts").flatMap((value) => {
|
|
|
+ const artifacts = (Array.isArray(paasRecord(run)?.artifacts) ? paasRows(run, "artifacts") : []).flatMap((value) => {
|
|
|
const file = paasRecord(value)
|
|
|
const name = paasText(file?.name) || paasText(file?.artifact_id)
|
|
|
if (!file || !name) return []
|
|
|
@@ -64,7 +64,7 @@ export function PaasGeneratedFiles(props: {
|
|
|
]
|
|
|
})
|
|
|
const artifactNames = new Set(artifacts.map((file) => file.name))
|
|
|
- const workspace = paasRows(work, "files").flatMap((value) => {
|
|
|
+ const workspace = (Array.isArray(paasRecord(work)?.files) ? paasRows(work, "files") : []).flatMap((value) => {
|
|
|
const file = paasRecord(value)
|
|
|
const name = paasText(file?.name) || paasText(file?.path)?.split("/").at(-1)
|
|
|
if (!file || !name || internal.has(name.toLowerCase()) || artifactNames.has(name)) return []
|