chore: import upstream snapshot with attribution
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import type { LogsGetExecutionParams, LogsGetExecutionResponse } from '@/tools/logs/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const logsGetExecutionTool: ToolConfig<LogsGetExecutionParams, LogsGetExecutionResponse> = {
|
||||
id: 'logs_get_execution',
|
||||
name: 'Get Execution Details',
|
||||
description:
|
||||
'Fetch full execution details for a workflow run, including the per-block state snapshot.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
executionId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Execution ID returned by a workflow run',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `/api/logs/execution/${encodeURIComponent(params.executionId)}`,
|
||||
method: 'GET',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response): Promise<LogsGetExecutionResponse> => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data?.error || `Request failed with status ${response.status}`)
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: data,
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
executionId: { type: 'string', description: 'Execution ID' },
|
||||
workflowId: { type: 'string', description: 'Workflow ID this execution belongs to' },
|
||||
workflowState: { type: 'json', description: 'Per-block state snapshot for the execution' },
|
||||
childWorkflowSnapshots: {
|
||||
type: 'json',
|
||||
description: 'Snapshots for any child workflows invoked during the run',
|
||||
optional: true,
|
||||
},
|
||||
executionMetadata: {
|
||||
type: 'json',
|
||||
description: 'Trigger, timestamps, totalDurationMs, and cost for the run',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import type { LogsGetParams, LogsGetResponse } from '@/tools/logs/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const logsGetTool: ToolConfig<LogsGetParams, LogsGetResponse> = {
|
||||
id: 'logs_get',
|
||||
name: 'Get Log by ID',
|
||||
description: 'Fetch a single workflow execution log entry by its log ID.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
id: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Log entry ID',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const workspaceId = params._context?.workspaceId
|
||||
if (!workspaceId) {
|
||||
throw new Error('workspaceId is required in execution context')
|
||||
}
|
||||
const qs = new URLSearchParams({ workspaceId })
|
||||
return `/api/logs/${encodeURIComponent(params.id)}?${qs.toString()}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response): Promise<LogsGetResponse> => {
|
||||
const result = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(result?.error || `Request failed with status ${response.status}`)
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
log: result.data,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
log: { type: 'json', description: 'Workflow execution log entry' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import type { WorkflowLogDetail } from '@/lib/api/contracts/logs'
|
||||
import { dollarsToCredits } from '@/lib/billing/credits/conversion'
|
||||
import type { LogsGetRunDetailsParams, LogsGetRunDetailsResponse } from '@/tools/logs/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const logsGetRunDetailsTool: ToolConfig<LogsGetRunDetailsParams, LogsGetRunDetailsResponse> =
|
||||
{
|
||||
id: 'logs_get_run_details',
|
||||
name: 'Get Run Details',
|
||||
description:
|
||||
'Fetch details for a single workflow run by its run ID, including the full trace spans.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
runId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The run ID to fetch details for',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const workspaceId = params._context?.workspaceId
|
||||
if (!workspaceId) {
|
||||
throw new Error('workspaceId is required in execution context')
|
||||
}
|
||||
const qs = new URLSearchParams({ workspaceId })
|
||||
return `/api/logs/by-execution/${encodeURIComponent(params.runId)}?${qs.toString()}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response): Promise<LogsGetRunDetailsResponse> => {
|
||||
const result = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(result?.error || `Request failed with status ${response.status}`)
|
||||
}
|
||||
const detail: WorkflowLogDetail = result.data
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
runId: detail.executionId ?? '',
|
||||
workflowId: detail.workflowId ?? null,
|
||||
workflowName: detail.workflow?.name ?? null,
|
||||
status: detail.status ?? detail.level,
|
||||
trigger: detail.trigger ?? null,
|
||||
startedAt: detail.createdAt,
|
||||
durationMs: detail.executionData?.totalDuration ?? null,
|
||||
// Costs are stored in dollars; credits are the user-facing unit.
|
||||
cost: detail.cost?.total != null ? dollarsToCredits(detail.cost.total) : null,
|
||||
traceSpans: detail.executionData?.traceSpans ?? [],
|
||||
finalOutput: detail.executionData?.finalOutput ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
runId: { type: 'string', description: 'The run ID' },
|
||||
workflowId: { type: 'string', description: 'Workflow ID this run belongs to' },
|
||||
workflowName: { type: 'string', description: 'Workflow name' },
|
||||
status: { type: 'string', description: 'Run status' },
|
||||
trigger: { type: 'string', description: 'How the run was triggered' },
|
||||
startedAt: { type: 'string', description: 'Run start time (ISO 8601)' },
|
||||
durationMs: { type: 'number', description: 'Run duration in milliseconds' },
|
||||
cost: { type: 'number', description: 'Run cost in credits' },
|
||||
traceSpans: { type: 'array', description: 'Full trace spans for the run' },
|
||||
finalOutput: { type: 'json', description: 'Final output of the run' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export { logsGetExecutionTool } from '@/tools/logs/get_execution'
|
||||
export { logsGetTool } from '@/tools/logs/get_log'
|
||||
export { logsGetRunDetailsTool } from '@/tools/logs/get_run_details'
|
||||
export { logsQueryTool } from '@/tools/logs/query'
|
||||
export { logsQueryRunsTool } from '@/tools/logs/query_runs'
|
||||
@@ -0,0 +1,132 @@
|
||||
import type { LogsQueryParams, LogsQueryResponse } from '@/tools/logs/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const logsQueryTool: ToolConfig<LogsQueryParams, LogsQueryResponse> = {
|
||||
id: 'logs_query',
|
||||
name: 'Query Logs',
|
||||
description: 'Query workflow execution logs in the current workspace with filters.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
workflowIds: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated workflow IDs to filter by',
|
||||
},
|
||||
executionId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter logs to a single execution ID',
|
||||
},
|
||||
level: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
"Log level filter: 'all', 'info', 'error', 'running', 'pending'. Comma-separated for multiple.",
|
||||
},
|
||||
triggers: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated triggers (api, webhook, schedule, manual, chat, mothership)',
|
||||
},
|
||||
limit: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Max logs to return (default 100, max 200)',
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Opaque pagination cursor returned by a previous query',
|
||||
},
|
||||
sortBy: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: "Sort field: 'date' (default), 'duration', 'cost', 'status'",
|
||||
},
|
||||
sortOrder: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: "Sort order: 'desc' (default) or 'asc'",
|
||||
},
|
||||
startDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'ISO 8601 timestamp; only logs at or after this time',
|
||||
},
|
||||
endDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'ISO 8601 timestamp; only logs at or before this time',
|
||||
},
|
||||
search: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Free-text search across log fields',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const workspaceId = params._context?.workspaceId
|
||||
if (!workspaceId) {
|
||||
throw new Error('workspaceId is required in execution context')
|
||||
}
|
||||
const qs = new URLSearchParams({ workspaceId })
|
||||
if (params.workflowIds) qs.set('workflowIds', params.workflowIds)
|
||||
if (params.executionId) qs.set('executionId', params.executionId)
|
||||
if (params.level && params.level !== 'all') qs.set('level', params.level)
|
||||
if (params.triggers) qs.set('triggers', params.triggers)
|
||||
if (params.startDate) qs.set('startDate', params.startDate)
|
||||
if (params.endDate) qs.set('endDate', params.endDate)
|
||||
if (params.search) qs.set('search', params.search)
|
||||
if (params.cursor) qs.set('cursor', params.cursor)
|
||||
if (params.sortBy) qs.set('sortBy', params.sortBy)
|
||||
if (params.sortOrder) qs.set('sortOrder', params.sortOrder)
|
||||
if (params.limit !== undefined && params.limit !== null) {
|
||||
qs.set('limit', String(params.limit))
|
||||
}
|
||||
return `/api/logs?${qs.toString()}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response): Promise<LogsQueryResponse> => {
|
||||
const result = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(result?.error || `Request failed with status ${response.status}`)
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
logs: result.data || [],
|
||||
nextCursor: result.nextCursor ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
logs: {
|
||||
type: 'array',
|
||||
description: 'Array of workflow execution log entries',
|
||||
},
|
||||
nextCursor: {
|
||||
type: 'string',
|
||||
description: 'Pagination cursor for the next page; null when no more results',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
import { creditsToDollars } from '@/lib/billing/credits/conversion'
|
||||
import type { LogsQueryRunsParams, LogsQueryRunsResponse } from '@/tools/logs/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const logsQueryRunsTool: ToolConfig<LogsQueryRunsParams, LogsQueryRunsResponse> = {
|
||||
id: 'logs_query_runs',
|
||||
name: 'Query Logs',
|
||||
description:
|
||||
'Query workflow run logs in the current workspace with the full Logs-page filter set. Returns matching run IDs.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
workflowIds: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated workflow IDs to filter by',
|
||||
},
|
||||
folderIds: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated folder IDs to filter by (descendants included)',
|
||||
},
|
||||
level: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
"Comma-separated statuses: 'info', 'error', 'running', 'pending', 'cancelled'. Omit for all.",
|
||||
},
|
||||
triggers: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Comma-separated trigger types (api, webhook, schedule, manual, chat, mcp, workflow, sim, …)',
|
||||
},
|
||||
startDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'ISO 8601 timestamp; only runs at or after this time',
|
||||
},
|
||||
endDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'ISO 8601 timestamp; only runs at or before this time',
|
||||
},
|
||||
search: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Free-text search across log fields',
|
||||
},
|
||||
costOperator: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: "Cost comparison operator: '=', '>', '<', '>=', '<=', '!='",
|
||||
},
|
||||
costValue: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Cost threshold in credits, compared using costOperator',
|
||||
},
|
||||
durationOperator: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: "Duration comparison operator: '=', '>', '<', '>=', '<=', '!='",
|
||||
},
|
||||
durationValue: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Duration threshold in milliseconds, compared using durationOperator',
|
||||
},
|
||||
limit: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Max run IDs to return (default 100, max 200)',
|
||||
},
|
||||
sortBy: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: "Sort field: 'date' (default), 'duration', 'cost', 'status'",
|
||||
},
|
||||
sortOrder: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: "Sort order: 'desc' (default) or 'asc'",
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const workspaceId = params._context?.workspaceId
|
||||
if (!workspaceId) {
|
||||
throw new Error('workspaceId is required in execution context')
|
||||
}
|
||||
const qs = new URLSearchParams({ workspaceId })
|
||||
if (params.workflowIds) qs.set('workflowIds', params.workflowIds)
|
||||
if (params.folderIds) qs.set('folderIds', params.folderIds)
|
||||
if (params.level && params.level !== 'all') qs.set('level', params.level)
|
||||
if (params.triggers) qs.set('triggers', params.triggers)
|
||||
if (params.startDate) qs.set('startDate', params.startDate)
|
||||
if (params.endDate) qs.set('endDate', params.endDate)
|
||||
if (params.search) qs.set('search', params.search)
|
||||
if (params.costOperator && params.costValue !== undefined && params.costValue !== null) {
|
||||
qs.set('costOperator', params.costOperator)
|
||||
// Costs are credit-denominated for users; the API filters in dollars.
|
||||
qs.set('costValue', String(creditsToDollars(params.costValue)))
|
||||
}
|
||||
if (
|
||||
params.durationOperator &&
|
||||
params.durationValue !== undefined &&
|
||||
params.durationValue !== null
|
||||
) {
|
||||
qs.set('durationOperator', params.durationOperator)
|
||||
qs.set('durationValue', String(params.durationValue))
|
||||
}
|
||||
if (params.limit !== undefined && params.limit !== null) {
|
||||
qs.set('limit', String(params.limit))
|
||||
}
|
||||
if (params.sortBy) qs.set('sortBy', params.sortBy)
|
||||
if (params.sortOrder) qs.set('sortOrder', params.sortOrder)
|
||||
return `/api/logs?${qs.toString()}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response): Promise<LogsQueryRunsResponse> => {
|
||||
const result = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(result?.error || `Request failed with status ${response.status}`)
|
||||
}
|
||||
const rows: Array<{ executionId?: string | null }> = result.data || []
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
runIds: rows
|
||||
.map((row) => row.executionId)
|
||||
.filter((runId): runId is string => Boolean(runId)),
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
runIds: {
|
||||
type: 'array',
|
||||
description: 'IDs of the runs matching the filters',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
import type {
|
||||
ExecutionSnapshotData,
|
||||
WorkflowLogDetail,
|
||||
WorkflowLogSummary,
|
||||
} from '@/lib/api/contracts/logs'
|
||||
import type { ToolResponse, WorkflowToolExecutionContext } from '@/tools/types'
|
||||
|
||||
export interface LogsQueryParams {
|
||||
workflowIds?: string
|
||||
executionId?: string
|
||||
level?: string
|
||||
triggers?: string
|
||||
limit?: number
|
||||
cursor?: string
|
||||
sortBy?: 'date' | 'duration' | 'cost' | 'status'
|
||||
sortOrder?: 'asc' | 'desc'
|
||||
startDate?: string
|
||||
endDate?: string
|
||||
search?: string
|
||||
_context?: WorkflowToolExecutionContext
|
||||
}
|
||||
|
||||
export interface LogsGetParams {
|
||||
id: string
|
||||
_context?: WorkflowToolExecutionContext
|
||||
}
|
||||
|
||||
export interface LogsGetExecutionParams {
|
||||
executionId: string
|
||||
_context?: WorkflowToolExecutionContext
|
||||
}
|
||||
|
||||
export type LogsComparisonOperator = '=' | '>' | '<' | '>=' | '<=' | '!='
|
||||
|
||||
export interface LogsQueryRunsParams {
|
||||
workflowIds?: string
|
||||
folderIds?: string
|
||||
level?: string
|
||||
triggers?: string
|
||||
startDate?: string
|
||||
endDate?: string
|
||||
search?: string
|
||||
costOperator?: LogsComparisonOperator
|
||||
costValue?: number
|
||||
durationOperator?: LogsComparisonOperator
|
||||
durationValue?: number
|
||||
limit?: number
|
||||
sortBy?: 'date' | 'duration' | 'cost' | 'status'
|
||||
sortOrder?: 'asc' | 'desc'
|
||||
_context?: WorkflowToolExecutionContext
|
||||
}
|
||||
|
||||
export interface LogsGetRunDetailsParams {
|
||||
runId: string
|
||||
_context?: WorkflowToolExecutionContext
|
||||
}
|
||||
|
||||
export interface LogsQueryResponse extends ToolResponse {
|
||||
output: {
|
||||
logs: WorkflowLogSummary[]
|
||||
nextCursor: string | null
|
||||
}
|
||||
}
|
||||
|
||||
export interface LogsQueryRunsResponse extends ToolResponse {
|
||||
output: {
|
||||
runIds: string[]
|
||||
}
|
||||
}
|
||||
|
||||
export interface LogsGetRunDetailsResponse extends ToolResponse {
|
||||
output: {
|
||||
runId: string
|
||||
workflowId: string | null
|
||||
workflowName: string | null
|
||||
status: string
|
||||
trigger: string | null
|
||||
startedAt: string
|
||||
durationMs: number | null
|
||||
cost: number | null
|
||||
traceSpans: unknown[]
|
||||
finalOutput: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export interface LogsGetResponse extends ToolResponse {
|
||||
output: {
|
||||
log: WorkflowLogDetail
|
||||
}
|
||||
}
|
||||
|
||||
export interface LogsGetExecutionResponse extends ToolResponse {
|
||||
output: ExecutionSnapshotData
|
||||
}
|
||||
Reference in New Issue
Block a user