@kb-labs/workflow-entry 2.118.2 → 2.119.0-canary.85d060ea6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/runs-status.js +2 -0
- package/dist/commands/runs-status.js.map +1 -1
- package/dist/commands/runs-view.js +4 -0
- package/dist/commands/runs-view.js.map +1 -1
- package/dist/commands/runs-watch.js +3 -1
- package/dist/commands/runs-watch.js.map +1 -1
- package/dist/index.js +2 -10
- package/dist/index.js.map +1 -1
- package/dist/manifest.js +2 -10
- package/dist/manifest.js.map +1 -1
- package/dist/manifest.json +2 -10
- package/dist/widgets/117.js +10 -3
- package/dist/widgets/165.js +1 -1
- package/dist/widgets/256.js +407 -0
- package/dist/widgets/370.js +1 -1
- package/dist/widgets/421.js +96 -0
- package/dist/widgets/46.js +1 -1
- package/dist/widgets/50.js +1 -1
- package/dist/widgets/546.js +1 -1
- package/dist/widgets/669.js +1 -1
- package/dist/widgets/716.js +1 -1
- package/dist/widgets/775.js +1 -1
- package/dist/widgets/78.js +1 -1
- package/dist/widgets/875.js +1 -1
- package/dist/widgets/997.js +1 -0
- package/dist/widgets/__federation_expose_Crons.js +1 -1
- package/dist/widgets/__federation_expose_DefinitionDetail.js +1 -1
- package/dist/widgets/__federation_expose_Definitions.js +1 -1
- package/dist/widgets/__federation_expose_Jobs.js +1 -1
- package/dist/widgets/__federation_expose_RunDetail.js +2 -2
- package/dist/widgets/__federation_expose_Runs.js +1 -1
- package/dist/widgets/mf-manifest.json +33 -42
- package/dist/widgets/mf-stats.json +45 -56
- package/dist/widgets/remoteEntry.js +2 -2
- package/dist/ws/logs-channel.js +66 -26
- package/dist/ws/logs-channel.js.map +1 -1
- package/dist/ws/progress-channel.js +42 -12
- package/dist/ws/progress-channel.js.map +1 -1
- package/package.json +4 -2
- package/dist/widgets/62.js +0 -96
- package/dist/widgets/__federation_expose_Dashboard.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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AU,aAAQ,OAAO,CAAA,CAAA,GAAK,EAAE,CAAA,CAAE,CAAA;AAGvF,cAAA,IAAI,KAAA,CAAM,SAAS,cAAA,IAAkB,KAAA,CAAM,SAAS,YAAA,IAAgB,KAAA,CAAM,SAAS,eAAA,EAAiB;AAClG,gBAAA,MAAM,WAAA,GAAc,KAAA,CAAM,OAAA,GAAU,QAAQ,CAAA,IAAe,MAAM,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA;AAClF,gBAAA,GAAA,CAAI,EAAA,EAAI,QAAQ,CAAA,IAAA,EAAO,WAAA,CAAY,aAAa,CAAA,6BAAA,EAAgC,KAAK,CAAA,cAAA,CAAgB,CAAA;AACrG,gBAAA,OAAO,WAAA,KAAgB,QAAA,GACnB,EAAE,EAAA,EAAI,KAAA,EAAO,OAAO,qBAAA,EAAsB,GAC1C,EAAE,EAAA,EAAI,IAAA,EAAK;AAAA,cACjB;AAAA,YACF,CAAA,CAAA,MAAQ;AAAA,YAER;AAAA,UACF;AAAA,QACF;AAEA,QAAA,OAAO,EAAE,IAAI,IAAA,EAAK;AAAA,MACpB,SAAS,KAAA,EAAO;AACd,QAAA,WAAA,CAAY,GAAA,EAAK,OAAO,UAAU,CAAA;AAClC,QAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,KAAA,EAAO,gBAAA,EAAiB;AAAA,MAC9C;AAAA,IACF;AAAA;AAEJ,CAAC","file":"runs-watch.js","sourcesContent":["/**\n * HTTP client for interacting with Workflow Daemon\n */\nimport type {\n WorkflowRerunRequest,\n WorkflowRestartRequest,\n WorkflowRestartResponse,\n WorkflowRunRequest,\n JobStatusInfo,\n JobStepsResponse,\n JobLogsResponse,\n CronListResponse,\n} from '@kb-labs/workflow-contracts';\nimport { useEnv } from '@kb-labs/sdk';\n\n/** Workflow run summary returned by GET /api/v1/runs */\nexport interface WorkflowRunSummary {\n id: string;\n name: string;\n version?: string;\n status: 'queued' | 'running' | 'success' | 'failed' | 'cancelled';\n trigger?: {\n type: string;\n actor?: string;\n payload?: unknown;\n parentRunId?: string;\n parentJobId?: string;\n parentStepId?: string;\n };\n createdAt?: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n inputs?: Record<string, unknown>;\n hasPendingApproval?: boolean;\n currentStepName?: string;\n}\n\n/** Full workflow run detail returned by GET /api/v1/runs/:runId */\nexport interface WorkflowRunDetail extends WorkflowRunSummary {\n env?: Record<string, string>;\n metadata?: Record<string, unknown>;\n result?: {\n status: string;\n summary?: string;\n error?: { message: string; code?: string };\n outputs?: Record<string, unknown>;\n };\n jobs?: Array<{\n id: string;\n jobName?: string;\n status: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n attempt?: number;\n error?: { message: string; code?: string; stack?: string } | string;\n steps?: Array<{\n id: string;\n name?: string;\n index?: number;\n status: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n attempt?: number;\n outputs?: Record<string, unknown>;\n resolvedInputs?: Record<string, unknown>;\n error?: { message: string; code?: string; details?: Record<string, unknown> } | string;\n spec?: Record<string, unknown>;\n }>;\n }>;\n}\n\n/** Metrics data returned by GET /metrics */\nexport interface WorkflowMetricsData {\n runs: {\n total: number;\n queued: number;\n running: number;\n completed: number;\n failed: number;\n cancelled: number;\n };\n jobs: {\n total: number;\n queued: number;\n running: number;\n completed: number;\n failed: number;\n };\n [key: string]: unknown;\n}\n\n/** Extended job status returned by GET /api/v1/jobs/:id — includes nested jobs/steps */\nexport interface JobStatusDetail extends Omit<JobStatusInfo, 'result'> {\n result?: {\n ok: boolean;\n summary?: string;\n error?: { code: string; message: string };\n };\n jobs?: Array<{\n id: string;\n name: string;\n status: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n error?: string;\n steps?: Array<{\n id: string;\n name: string;\n status: string;\n handler?: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n outputs?: Record<string, unknown>;\n error?: { message?: string } | string;\n }>;\n }>;\n}\n\nconst DEFAULT_DAEMON_URL = 'http://localhost:7778';\n\nexport interface DaemonClientOptions {\n url?: string;\n}\n\n/**\n * Get workflow daemon URL from environment or default\n */\nexport function getWorkflowDaemonUrl(): string {\n return useEnv('WORKFLOW_DAEMON_URL') ?? DEFAULT_DAEMON_URL;\n}\n\nexport class WorkflowDaemonClient {\n private readonly baseUrl: string;\n\n constructor(options: DaemonClientOptions = {}) {\n this.baseUrl = options.url ?? useEnv('WORKFLOW_DAEMON_URL') ?? DEFAULT_DAEMON_URL;\n }\n\n /**\n * Validate response Content-Type and parse JSON safely\n */\n private async parseJsonResponse<T>(response: Response): Promise<T> {\n const contentType = response.headers.get('content-type');\n if (!contentType?.includes('application/json')) {\n throw new Error(`Invalid Content-Type: expected application/json, got ${contentType}`);\n }\n return response.json() as Promise<T>;\n }\n\n private unwrapData<T>(payload: unknown): T {\n if (\n payload\n && typeof payload === 'object'\n && 'ok' in payload\n && (payload as { ok?: boolean }).ok === true\n && 'data' in payload\n ) {\n return (payload as { data: T }).data;\n }\n return payload as T;\n }\n\n /**\n * Validate and encode job ID to prevent path traversal attacks\n */\n private validateAndEncodeJobId(jobId: string): string {\n // Validate job ID format (alphanumeric, hyphens, underscores only)\n if (!/^[a-zA-Z0-9_-]+$/.test(jobId)) {\n throw new Error(`Invalid job ID format: ${jobId}`);\n }\n // Encode for URL safety (defense in depth)\n return encodeURIComponent(jobId);\n }\n\n /**\n * Health check\n */\n async health(): Promise<{ ok: boolean; service: string }> {\n const response = await fetch(`${this.baseUrl}/health`);\n if (!response.ok) {\n throw new Error(`Health check failed: ${response.statusText}`);\n }\n return this.parseJsonResponse(response);\n }\n\n /**\n * Get workflow metrics (raw metrics data from daemon)\n */\n async getMetrics(): Promise<WorkflowMetricsData> {\n const response = await fetch(`${this.baseUrl}/metrics`);\n if (!response.ok) {\n throw new Error(`Failed to get metrics: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n return this.unwrapData<WorkflowMetricsData>(data);\n }\n\n /**\n * Get job status with full details (jobs, steps, outputs)\n */\n async getJobStatus(jobId: string): Promise<JobStatusDetail> {\n const encodedJobId = this.validateAndEncodeJobId(jobId);\n const response = await fetch(`${this.baseUrl}/api/v1/jobs/${encodedJobId}`);\n if (response.status === 404) {\n throw new Error(`Job ${jobId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get job status: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n return this.unwrapData<JobStatusDetail>(data);\n }\n\n /**\n * Get job steps with outputs\n */\n async getJobSteps(jobId: string): Promise<JobStepsResponse> {\n const encodedJobId = this.validateAndEncodeJobId(jobId);\n const response = await fetch(`${this.baseUrl}/api/v1/jobs/${encodedJobId}/steps`);\n if (response.status === 404) {\n throw new Error(`Job ${jobId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get job steps: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n return this.unwrapData<JobStepsResponse>(data);\n }\n\n /**\n * Get job logs\n */\n async getJobLogs(jobId: string): Promise<JobLogsResponse['logs']> {\n const encodedJobId = this.validateAndEncodeJobId(jobId);\n const response = await fetch(`${this.baseUrl}/api/v1/jobs/${encodedJobId}/logs`);\n if (response.status === 404) {\n throw new Error(`Job ${jobId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get job logs: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n const unwrapped = this.unwrapData<JobLogsResponse>(data);\n return unwrapped.logs ?? [];\n }\n\n /**\n * Get active executions\n */\n async getExecutions(): Promise<JobStatusInfo[]> {\n const response = await fetch(`${this.baseUrl}/api/v1/jobs`);\n if (!response.ok) {\n throw new Error(`Failed to get executions: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n const unwrapped = this.unwrapData<{ jobs?: JobStatusInfo[] }>(data);\n const jobs = unwrapped.jobs ?? [];\n return jobs.filter((job) => job.status === 'running' || job.status === 'pending');\n }\n\n /**\n * Get cron jobs\n */\n async getCronJobs(): Promise<CronListResponse> {\n const response = await fetch(`${this.baseUrl}/api/v1/cron`);\n if (!response.ok) {\n throw new Error(`Failed to get cron jobs: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n return this.unwrapData<CronListResponse>(data);\n }\n\n /**\n * Submit a job for execution\n */\n async submitJob(params: {\n handler: string;\n input?: unknown;\n priority?: number;\n }): Promise<{ id: string; status: string }> {\n const response = await fetch(`${this.baseUrl}/api/v1/jobs`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n type: params.handler,\n payload: params.input,\n priority: params.priority,\n }),\n });\n\n if (!response.ok) {\n const error = (await response.json().catch(() => ({ error: response.statusText }))) as {\n error?: string;\n };\n throw new Error(error.error || `Failed to submit job: ${response.statusText}`);\n }\n\n const payload = await this.parseJsonResponse<unknown>(response);\n const data = this.unwrapData<{ jobId: string }>(payload);\n return { id: data.jobId, status: 'pending' };\n }\n\n /**\n * List workflow runs with optional status filter\n */\n async listRuns(params: {\n status?: string;\n limit?: number;\n workflowId?: string;\n } = {}): Promise<WorkflowRunSummary[]> {\n const query = new URLSearchParams();\n if (params.status) { query.set('status', params.status); }\n if (params.limit) { query.set('limit', String(params.limit)); }\n if (params.workflowId) { query.set('workflowId', params.workflowId); }\n\n const qs = query.toString();\n const response = await fetch(`${this.baseUrl}/api/v1/runs${qs ? `?${qs}` : ''}`);\n if (!response.ok) {\n throw new Error(`Failed to list runs: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n const unwrapped = this.unwrapData<{ runs?: WorkflowRunSummary[] }>(data);\n return unwrapped.runs ?? (Array.isArray(data) ? data as WorkflowRunSummary[] : []);\n }\n\n /**\n * Get a specific workflow run with full detail\n */\n async getRun(runId: string): Promise<WorkflowRunDetail> {\n const encodedId = encodeURIComponent(runId);\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}`);\n if (response.status === 404) {\n throw new Error(`Run ${runId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get run: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n // Response shape: { ok: true, data: { run: {...} } }\n const unwrapped = this.unwrapData<{ run?: WorkflowRunDetail } | WorkflowRunDetail>(data);\n return ('run' in (unwrapped as object) ? (unwrapped as { run: WorkflowRunDetail }).run : unwrapped) as WorkflowRunDetail;\n }\n\n /**\n * Get run logs, optionally filtered to failed steps only\n */\n async getRunLogs(runId: string, params: {\n stepId?: string;\n level?: string;\n limit?: number;\n failedOnly?: boolean;\n } = {}): Promise<Array<{ level: string; message: string; timestamp: string; stepId?: string; stepName?: string; stream?: string; [key: string]: unknown }>> {\n const query = new URLSearchParams();\n if (params.stepId) { query.set('stepId', params.stepId); }\n if (params.level) { query.set('level', params.level); }\n if (params.limit) { query.set('limit', String(params.limit)); }\n if (params.failedOnly) { query.set('failedOnly', 'true'); }\n\n const encodedId = encodeURIComponent(runId);\n const qs = query.toString();\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}/logs${qs ? `?${qs}` : ''}`);\n if (response.status === 404) {\n throw new Error(`Run ${runId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get run logs: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n const unwrapped = this.unwrapData<{ logs?: unknown[] }>(data);\n return (unwrapped.logs ?? []) as Array<{ level: string; message: string; timestamp: string; [key: string]: unknown }>;\n }\n\n /**\n * Stream run events via SSE (returns a ReadableStream or EventSource-compatible URL)\n */\n getRunEventsUrl(runId: string): string {\n return `${this.baseUrl}/api/v1/runs/${encodeURIComponent(runId)}/events`;\n }\n\n /**\n * List pending approval steps for a run\n */\n async listPendingApprovals(runId: string): Promise<{\n runId: string;\n pending: Array<{\n jobId: string;\n stepId: string;\n stepName: string;\n specId?: string;\n context: Record<string, unknown>;\n waitingSince?: string;\n }>;\n }> {\n const encodedId = encodeURIComponent(runId);\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}/approvals`);\n if (!response.ok) {\n const message = await response\n .json()\n .then((j: { error?: string }) => j?.error ?? '')\n .catch(() => response.text().catch(() => ''));\n throw new Error(`Failed to list pending approvals: ${message || response.statusText || response.status}`);\n }\n const payload = await this.parseJsonResponse<{\n ok: boolean;\n data?: {\n runId: string;\n pending: Array<{\n jobId: string;\n stepId: string;\n stepName: string;\n specId?: string;\n context: Record<string, unknown>;\n waitingSince?: string;\n }>;\n };\n }>(response);\n return this.unwrapData(payload);\n }\n\n /**\n * Resolve (approve or reject) a pending approval step\n */\n async resolveApproval(\n runId: string,\n jobId: string,\n stepId: string,\n action: 'approve' | 'reject',\n comment?: string,\n data?: Record<string, unknown>\n ): Promise<{ runId: string; jobId: string; stepId: string; action: string; resolved: boolean }> {\n const encodedId = encodeURIComponent(runId);\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}/approvals/resolve`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ jobId, stepId, action, comment, data }),\n });\n if (!response.ok) {\n const message = await response\n .json()\n .then((j: { error?: string }) => j?.error ?? '')\n .catch(() => response.text().catch(() => ''));\n throw new Error(`Failed to resolve approval: ${message || response.statusText || response.status}`);\n }\n const payload = await this.parseJsonResponse<{\n ok: boolean;\n data?: { runId: string; jobId: string; stepId: string; action: string; resolved: boolean };\n }>(response);\n return this.unwrapData(payload);\n }\n\n /**\n * Cancel a workflow run\n */\n async cancelRun(runId: string): Promise<void> {\n const encodedId = encodeURIComponent(runId);\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}/cancel`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: '{}',\n });\n if (!response.ok) {\n const message = await response\n .json()\n .then((j: { error?: string }) => j?.error ?? '')\n .catch(() => response.text().catch(() => ''));\n throw new Error(`Failed to cancel run: ${message || response.statusText || response.status}`);\n }\n }\n\n /**\n * Run workflow by ID\n */\n async runWorkflow(\n workflowId: string,\n request: WorkflowRunRequest = {}\n ): Promise<{ runId: string; status: string }> {\n const response = await fetch(\n `${this.baseUrl}/api/v1/workflows/${encodeURIComponent(workflowId)}/runs`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n }\n );\n\n if (!response.ok) {\n const error = (await response.json().catch(() => ({ error: response.statusText }))) as {\n error?: string;\n };\n throw new Error(error.error || `Failed to run workflow: ${response.statusText}`);\n }\n\n const payload = await this.parseJsonResponse<{ ok: boolean; data?: { runId: string; status: string } }>(response);\n return this.unwrapData<{ runId: string; status: string }>(payload);\n }\n\n /**\n * Rerun a workflow run by ID, optionally only failed jobs\n */\n async rerunWorkflow(\n runId: string,\n request: WorkflowRerunRequest = {},\n ): Promise<{ runId: string; status: string }> {\n const response = await fetch(\n `${this.baseUrl}/api/v1/runs/${encodeURIComponent(runId)}/rerun`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n },\n );\n\n if (!response.ok) {\n const error = (await response.json().catch(() => ({ error: response.statusText }))) as {\n error?: string;\n };\n throw new Error(error.error || `Failed to rerun workflow: ${response.statusText}`);\n }\n\n const payload = await this.parseJsonResponse<{ ok: boolean; data?: { runId: string; status: string } }>(response);\n return this.unwrapData<{ runId: string; status: string }>(payload);\n }\n\n /**\n * Restart a run from a snapshot, optionally resuming from a specific step.\n * Preceding steps inherit their stored outputs; only the target step and beyond are re-executed.\n */\n async restartRun(\n runId: string,\n request: WorkflowRestartRequest = {},\n ): Promise<WorkflowRestartResponse> {\n const response = await fetch(\n `${this.baseUrl}/api/v1/runs/${encodeURIComponent(runId)}/restart`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n },\n );\n\n if (!response.ok) {\n const error = (await response.json().catch(() => ({ error: response.statusText }))) as {\n error?: string;\n };\n throw new Error(error.error || `Failed to restart run: ${response.statusText}`);\n }\n\n const payload = await this.parseJsonResponse<{ ok: boolean; data?: WorkflowRestartResponse }>(response);\n return this.unwrapData<WorkflowRestartResponse>(payload);\n }\n}\n","/**\n * workflow:runs-watch <runId> command — like `gh run watch`\n *\n * Streams run events in real-time via SSE endpoint.\n */\n\nimport { defineCommand, handleError, type CLIInput, type PluginContextV3 , type CommandResult} from '@kb-labs/sdk';\nimport { WorkflowDaemonClient } from '../http-client.js';\n\ninterface RunsWatchFlags {\n 'run-id'?: string;\n json?: boolean;\n logs?: boolean;\n}\n\nconst STATUS_ICON: Record<string, string> = {\n success: '✓',\n failed: '✗',\n running: '⠿',\n queued: '○',\n cancelled: '⊘',\n waiting_approval: '⏳',\n};\n\nexport default defineCommand<unknown, CLIInput<RunsWatchFlags>, unknown>({\n id: 'workflow:runs-watch',\n description: 'Stream workflow run events in real-time',\n\n handler: {\n async execute(ctx: PluginContextV3, input: CLIInput<RunsWatchFlags>): Promise<CommandResult> {\n const { flags, argv = [] } = input;\n const outputJson = flags?.json ?? false;\n const logsOnly = flags?.logs ?? false;\n let runId = flags?.['run-id'] ?? argv[0];\n\n try {\n const client = new WorkflowDaemonClient();\n\n // No run ID supplied — watch the latest run (like `gh run watch`)\n if (!runId) {\n const latest = await client.listRuns({ limit: 1 });\n if (!latest.length) {\n ctx.ui?.info?.('No runs found');\n return { ok: true };\n }\n runId = latest[0]!.id!;\n ctx.ui?.info?.(`Watching latest run: ${runId}`);\n }\n\n const eventsUrl = client.getRunEventsUrl(runId);\n\n ctx.ui?.info?.(`Watching run ${runId} (Ctrl+C to stop)...`);\n\n // Use fetch with streaming to consume SSE\n const response = await fetch(eventsUrl, {\n headers: { Accept: 'text/event-stream' },\n });\n\n if (!response.ok || !response.body) {\n throw new Error(`Failed to connect to events stream: ${response.statusText}`);\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) { break; }\n\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split('\\n');\n buffer = lines.pop() ?? '';\n\n for (const line of lines) {\n if (!line.startsWith('data:')) { continue; }\n const raw = line.slice(5).trim();\n if (!raw || raw === '[DONE]') { continue; }\n\n try {\n const event = JSON.parse(raw) as { type: string; runId?: string; jobId?: string; stepId?: string; payload?: Record<string, unknown> };\n\n if (outputJson) {\n ctx.ui?.json?.({ event });\n continue;\n }\n\n // Stream log lines from handler (ctx.logger.* / ctx.ui.* / console.log)\n // Rendered as compact single lines, not boxes.\n // See: plugins/workflow/docs/adr/0019-log-stream-separation.md\n if (event.type === 'log.appended') {\n const p = event.payload as { level?: string; message?: string; stepName?: string } | undefined;\n const label = p?.stepName ?? (event.stepId ? event.stepId.slice(0, 8) : '');\n const prefix = label ? `[${label}] ` : '';\n ctx.ui?.log?.({\n level: (p?.level ?? 'info') as 'info' | 'warn' | 'error' | 'debug',\n message: `${prefix}${p?.message ?? ''}`,\n });\n continue;\n }\n\n // --logs: suppress non-log events\n if (logsOnly) { continue; }\n\n const icon = STATUS_ICON[(event.payload?.['status'] as string) ?? ''] ?? '·';\n const step = event.stepId ? ` step:${event.stepId.slice(0, 8)}` : '';\n const job = event.jobId ? ` job:${event.jobId.slice(0, 8)}` : '';\n const summary = event.payload?.['summary'] ?? event.payload?.['error'] ?? '';\n\n ctx.ui?.write?.(`${icon} ${event.type}${job}${step}${summary ? ` — ${summary}` : ''}`);\n\n // Terminal events\n if (event.type === 'run.finished' || event.type === 'run.failed' || event.type === 'run.cancelled') {\n const finalStatus = event.payload?.['status'] as string ?? event.type.split('.')[1];\n ctx.ui?.write?.(`Run ${finalStatus.toUpperCase()}. Use 'kb workflow runs-view ${runId}' for details.`);\n return finalStatus === 'failed'\n ? { ok: false, error: 'Workflow run failed' }\n : { ok: true };\n }\n } catch {\n // Ignore malformed events\n }\n }\n }\n\n return { ok: true };\n } catch (error) {\n handleError(ctx, error, outputJson);\n return { ok: false, error: 'Command failed' };\n }\n },\n },\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/http-client.ts","../../src/commands/runs-watch.ts"],"names":[],"mappings":";;;A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AU,aAAQ,OAAO,CAAA,CAAA,GAAK,EAAE,CAAA,CAAE,CAAA;AAGvF,cAAA,IAAI,KAAA,CAAM,SAAS,cAAA,IAAkB,KAAA,CAAM,SAAS,YAAA,IAAgB,KAAA,CAAM,SAAS,eAAA,EAAiB;AAClG,gBAAA,MAAM,WAAA,GAAc,KAAA,CAAM,OAAA,GAAU,QAAQ,CAAA,IAAe,MAAM,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA;AAClF,gBAAA,GAAA,CAAI,EAAA,EAAI,QAAQ,CAAA,IAAA,EAAO,WAAA,CAAY,aAAa,CAAA,6BAAA,EAAgC,KAAK,CAAA,cAAA,CAAgB,CAAA;AACrG,gBAAA,OAAO,WAAA,KAAgB,QAAA,GACnB,EAAE,EAAA,EAAI,KAAA,EAAO,OAAO,qBAAA,EAAsB,GAC1C,EAAE,EAAA,EAAI,IAAA,EAAK;AAAA,cACjB;AAAA,YACF,CAAA,CAAA,MAAQ;AAAA,YAER;AAAA,UACF;AAAA,QACF;AAEA,QAAA,OAAO,EAAE,IAAI,IAAA,EAAK;AAAA,MACpB,SAAS,KAAA,EAAO;AACd,QAAA,WAAA,CAAY,GAAA,EAAK,OAAO,UAAU,CAAA;AAClC,QAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,KAAA,EAAO,gBAAA,EAAiB;AAAA,MAC9C;AAAA,IACF;AAAA;AAEJ,CAAC","file":"runs-watch.js","sourcesContent":["/**\n * HTTP client for interacting with Workflow Daemon\n */\nimport type {\n WorkflowRerunRequest,\n WorkflowRestartRequest,\n WorkflowRestartResponse,\n WorkflowRunRequest,\n JobStatusInfo,\n JobStepsResponse,\n JobLogsResponse,\n CronListResponse,\n} from '@kb-labs/workflow-contracts';\nimport { useEnv } from '@kb-labs/sdk';\n\n/** Workflow run summary returned by GET /api/v1/runs */\nexport interface WorkflowRunSummary {\n id: string;\n name: string;\n version?: string;\n status: 'queued' | 'running' | 'success' | 'failed' | 'cancelled';\n trigger?: {\n type: string;\n actor?: string;\n payload?: unknown;\n parentRunId?: string;\n parentJobId?: string;\n parentStepId?: string;\n };\n createdAt?: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n inputs?: Record<string, unknown>;\n hasPendingApproval?: boolean;\n currentStepName?: string;\n}\n\n/** Full workflow run detail returned by GET /api/v1/runs/:runId */\nexport interface WorkflowRunDetail extends WorkflowRunSummary {\n env?: Record<string, string>;\n metadata?: Record<string, unknown>;\n result?: {\n status: string;\n summary?: string;\n error?: { message: string; code?: string };\n outputs?: Record<string, unknown>;\n };\n jobs?: Array<{\n id: string;\n jobName?: string;\n status: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n attempt?: number;\n error?: { message: string; code?: string; stack?: string } | string;\n steps?: Array<{\n id: string;\n name?: string;\n index?: number;\n status: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n attempt?: number;\n outputs?: Record<string, unknown>;\n resolvedInputs?: Record<string, unknown>;\n error?: { message: string; code?: string; details?: Record<string, unknown> } | string;\n spec?: Record<string, unknown>;\n }>;\n }>;\n}\n\n/** Metrics data returned by GET /metrics */\nexport interface WorkflowMetricsData {\n runs: {\n total: number;\n queued: number;\n running: number;\n completed: number;\n failed: number;\n cancelled: number;\n };\n jobs: {\n total: number;\n queued: number;\n running: number;\n completed: number;\n failed: number;\n };\n [key: string]: unknown;\n}\n\n/** Extended job status returned by GET /api/v1/jobs/:id — includes nested jobs/steps */\nexport interface JobStatusDetail extends Omit<JobStatusInfo, 'result'> {\n result?: {\n ok: boolean;\n summary?: string;\n error?: { code: string; message: string };\n };\n jobs?: Array<{\n id: string;\n name: string;\n status: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n error?: string;\n steps?: Array<{\n id: string;\n name: string;\n status: string;\n handler?: string;\n startedAt?: string;\n finishedAt?: string;\n durationMs?: number;\n outputs?: Record<string, unknown>;\n error?: { message?: string } | string;\n }>;\n }>;\n}\n\nconst DEFAULT_DAEMON_URL = 'http://localhost:7778';\n\nexport interface DaemonClientOptions {\n url?: string;\n}\n\n/**\n * Get workflow daemon URL from environment or default\n */\nexport function getWorkflowDaemonUrl(): string {\n return useEnv('WORKFLOW_DAEMON_URL') ?? DEFAULT_DAEMON_URL;\n}\n\nexport class WorkflowDaemonClient {\n private readonly baseUrl: string;\n\n constructor(options: DaemonClientOptions = {}) {\n this.baseUrl = options.url ?? useEnv('WORKFLOW_DAEMON_URL') ?? DEFAULT_DAEMON_URL;\n }\n\n /**\n * Validate response Content-Type and parse JSON safely\n */\n private async parseJsonResponse<T>(response: Response): Promise<T> {\n const contentType = response.headers.get('content-type');\n if (!contentType?.includes('application/json')) {\n throw new Error(`Invalid Content-Type: expected application/json, got ${contentType}`);\n }\n return response.json() as Promise<T>;\n }\n\n private unwrapData<T>(payload: unknown): T {\n if (\n payload\n && typeof payload === 'object'\n && 'ok' in payload\n && (payload as { ok?: boolean }).ok === true\n && 'data' in payload\n ) {\n return (payload as { data: T }).data;\n }\n return payload as T;\n }\n\n /**\n * Validate and encode job ID to prevent path traversal attacks\n */\n private validateAndEncodeJobId(jobId: string): string {\n // Validate job ID format (alphanumeric, hyphens, underscores only)\n if (!/^[a-zA-Z0-9_-]+$/.test(jobId)) {\n throw new Error(`Invalid job ID format: ${jobId}`);\n }\n // Encode for URL safety (defense in depth)\n return encodeURIComponent(jobId);\n }\n\n /**\n * Health check\n */\n async health(): Promise<{ ok: boolean; service: string }> {\n const response = await fetch(`${this.baseUrl}/health`);\n if (!response.ok) {\n throw new Error(`Health check failed: ${response.statusText}`);\n }\n return this.parseJsonResponse(response);\n }\n\n /**\n * Get workflow metrics (raw metrics data from daemon)\n */\n async getMetrics(): Promise<WorkflowMetricsData> {\n const response = await fetch(`${this.baseUrl}/metrics`);\n if (!response.ok) {\n throw new Error(`Failed to get metrics: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n return this.unwrapData<WorkflowMetricsData>(data);\n }\n\n /**\n * Get job status with full details (jobs, steps, outputs)\n */\n async getJobStatus(jobId: string): Promise<JobStatusDetail> {\n const encodedJobId = this.validateAndEncodeJobId(jobId);\n const response = await fetch(`${this.baseUrl}/api/v1/jobs/${encodedJobId}`);\n if (response.status === 404) {\n throw new Error(`Job ${jobId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get job status: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n return this.unwrapData<JobStatusDetail>(data);\n }\n\n /**\n * Get job steps with outputs\n */\n async getJobSteps(jobId: string): Promise<JobStepsResponse> {\n const encodedJobId = this.validateAndEncodeJobId(jobId);\n const response = await fetch(`${this.baseUrl}/api/v1/jobs/${encodedJobId}/steps`);\n if (response.status === 404) {\n throw new Error(`Job ${jobId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get job steps: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n return this.unwrapData<JobStepsResponse>(data);\n }\n\n /**\n * Get job logs\n */\n async getJobLogs(jobId: string): Promise<JobLogsResponse['logs']> {\n const encodedJobId = this.validateAndEncodeJobId(jobId);\n const response = await fetch(`${this.baseUrl}/api/v1/jobs/${encodedJobId}/logs`);\n if (response.status === 404) {\n throw new Error(`Job ${jobId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get job logs: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n const unwrapped = this.unwrapData<JobLogsResponse>(data);\n return unwrapped.logs ?? [];\n }\n\n /**\n * Get active executions\n */\n async getExecutions(): Promise<JobStatusInfo[]> {\n const response = await fetch(`${this.baseUrl}/api/v1/jobs`);\n if (!response.ok) {\n throw new Error(`Failed to get executions: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n const unwrapped = this.unwrapData<{ jobs?: JobStatusInfo[] }>(data);\n const jobs = unwrapped.jobs ?? [];\n return jobs.filter((job) => job.status === 'running' || job.status === 'pending');\n }\n\n /**\n * Get cron jobs\n */\n async getCronJobs(): Promise<CronListResponse> {\n const response = await fetch(`${this.baseUrl}/api/v1/cron`);\n if (!response.ok) {\n throw new Error(`Failed to get cron jobs: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n return this.unwrapData<CronListResponse>(data);\n }\n\n /**\n * Submit a job for execution\n */\n async submitJob(params: {\n handler: string;\n input?: unknown;\n priority?: number;\n }): Promise<{ id: string; status: string }> {\n const response = await fetch(`${this.baseUrl}/api/v1/jobs`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n type: params.handler,\n payload: params.input,\n priority: params.priority,\n }),\n });\n\n if (!response.ok) {\n const error = (await response.json().catch(() => ({ error: response.statusText }))) as {\n error?: string;\n };\n throw new Error(error.error || `Failed to submit job: ${response.statusText}`);\n }\n\n const payload = await this.parseJsonResponse<unknown>(response);\n const data = this.unwrapData<{ jobId: string }>(payload);\n return { id: data.jobId, status: 'pending' };\n }\n\n /**\n * List workflow runs with optional status filter\n */\n async listRuns(params: {\n status?: string;\n limit?: number;\n workflowId?: string;\n } = {}): Promise<WorkflowRunSummary[]> {\n const query = new URLSearchParams();\n if (params.status) { query.set('status', params.status); }\n if (params.limit) { query.set('limit', String(params.limit)); }\n if (params.workflowId) { query.set('workflowId', params.workflowId); }\n\n const qs = query.toString();\n const response = await fetch(`${this.baseUrl}/api/v1/runs${qs ? `?${qs}` : ''}`);\n if (!response.ok) {\n throw new Error(`Failed to list runs: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n const unwrapped = this.unwrapData<{ runs?: WorkflowRunSummary[] }>(data);\n return unwrapped.runs ?? (Array.isArray(data) ? data as WorkflowRunSummary[] : []);\n }\n\n /**\n * Get a specific workflow run with full detail\n */\n async getRun(runId: string): Promise<WorkflowRunDetail> {\n const encodedId = encodeURIComponent(runId);\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}`);\n if (response.status === 404) {\n throw new Error(`Run ${runId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get run: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n // Response shape: { ok: true, data: { run: {...} } }\n const unwrapped = this.unwrapData<{ run?: WorkflowRunDetail } | WorkflowRunDetail>(data);\n return ('run' in (unwrapped as object) ? (unwrapped as { run: WorkflowRunDetail }).run : unwrapped) as WorkflowRunDetail;\n }\n\n /**\n * Get run logs, optionally filtered to failed steps only\n */\n async getRunLogs(runId: string, params: {\n stepId?: string;\n level?: string;\n limit?: number;\n failedOnly?: boolean;\n } = {}): Promise<Array<{ level: string; message: string; timestamp: string; stepId?: string; stepName?: string; stream?: string; [key: string]: unknown }>> {\n const query = new URLSearchParams();\n if (params.stepId) { query.set('stepId', params.stepId); }\n if (params.level) { query.set('level', params.level); }\n if (params.limit) { query.set('limit', String(params.limit)); }\n if (params.failedOnly) { query.set('failedOnly', 'true'); }\n\n const encodedId = encodeURIComponent(runId);\n const qs = query.toString();\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}/logs${qs ? `?${qs}` : ''}`);\n if (response.status === 404) {\n throw new Error(`Run ${runId} not found`);\n }\n if (!response.ok) {\n throw new Error(`Failed to get run logs: ${response.statusText}`);\n }\n const data = await this.parseJsonResponse<unknown>(response);\n const unwrapped = this.unwrapData<{ logs?: unknown[] }>(data);\n return (unwrapped.logs ?? []) as Array<{ level: string; message: string; timestamp: string; [key: string]: unknown }>;\n }\n\n /**\n * Stream run events via SSE (returns a ReadableStream or EventSource-compatible URL)\n */\n getRunEventsUrl(runId: string): string {\n return `${this.baseUrl}/api/v1/runs/${encodeURIComponent(runId)}/events`;\n }\n\n /**\n * List pending approval steps for a run\n */\n async listPendingApprovals(runId: string): Promise<{\n runId: string;\n pending: Array<{\n jobId: string;\n stepId: string;\n stepName: string;\n specId?: string;\n context: Record<string, unknown>;\n waitingSince?: string;\n }>;\n }> {\n const encodedId = encodeURIComponent(runId);\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}/approvals`);\n if (!response.ok) {\n const message = await response\n .json()\n .then((j: { error?: string }) => j?.error ?? '')\n .catch(() => response.text().catch(() => ''));\n throw new Error(`Failed to list pending approvals: ${message || response.statusText || response.status}`);\n }\n const payload = await this.parseJsonResponse<{\n ok: boolean;\n data?: {\n runId: string;\n pending: Array<{\n jobId: string;\n stepId: string;\n stepName: string;\n specId?: string;\n context: Record<string, unknown>;\n waitingSince?: string;\n }>;\n };\n }>(response);\n return this.unwrapData(payload);\n }\n\n /**\n * Resolve (approve or reject) a pending approval step\n */\n async resolveApproval(\n runId: string,\n jobId: string,\n stepId: string,\n action: 'approve' | 'reject',\n comment?: string,\n data?: Record<string, unknown>\n ): Promise<{ runId: string; jobId: string; stepId: string; action: string; resolved: boolean }> {\n const encodedId = encodeURIComponent(runId);\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}/approvals/resolve`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ jobId, stepId, action, comment, data }),\n });\n if (!response.ok) {\n const message = await response\n .json()\n .then((j: { error?: string }) => j?.error ?? '')\n .catch(() => response.text().catch(() => ''));\n throw new Error(`Failed to resolve approval: ${message || response.statusText || response.status}`);\n }\n const payload = await this.parseJsonResponse<{\n ok: boolean;\n data?: { runId: string; jobId: string; stepId: string; action: string; resolved: boolean };\n }>(response);\n return this.unwrapData(payload);\n }\n\n /**\n * Cancel a workflow run\n */\n async cancelRun(runId: string): Promise<void> {\n const encodedId = encodeURIComponent(runId);\n const response = await fetch(`${this.baseUrl}/api/v1/runs/${encodedId}/cancel`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: '{}',\n });\n if (!response.ok) {\n const message = await response\n .json()\n .then((j: { error?: string }) => j?.error ?? '')\n .catch(() => response.text().catch(() => ''));\n throw new Error(`Failed to cancel run: ${message || response.statusText || response.status}`);\n }\n }\n\n /**\n * Run workflow by ID\n */\n async runWorkflow(\n workflowId: string,\n request: WorkflowRunRequest = {}\n ): Promise<{ runId: string; status: string }> {\n const response = await fetch(\n `${this.baseUrl}/api/v1/workflows/${encodeURIComponent(workflowId)}/runs`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n }\n );\n\n if (!response.ok) {\n const error = (await response.json().catch(() => ({ error: response.statusText }))) as {\n error?: string;\n };\n throw new Error(error.error || `Failed to run workflow: ${response.statusText}`);\n }\n\n const payload = await this.parseJsonResponse<{ ok: boolean; data?: { runId: string; status: string } }>(response);\n return this.unwrapData<{ runId: string; status: string }>(payload);\n }\n\n /**\n * Rerun a workflow run by ID, optionally only failed jobs\n */\n async rerunWorkflow(\n runId: string,\n request: WorkflowRerunRequest = {},\n ): Promise<{ runId: string; status: string }> {\n const response = await fetch(\n `${this.baseUrl}/api/v1/runs/${encodeURIComponent(runId)}/rerun`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n },\n );\n\n if (!response.ok) {\n const error = (await response.json().catch(() => ({ error: response.statusText }))) as {\n error?: string;\n };\n throw new Error(error.error || `Failed to rerun workflow: ${response.statusText}`);\n }\n\n const payload = await this.parseJsonResponse<{ ok: boolean; data?: { runId: string; status: string } }>(response);\n return this.unwrapData<{ runId: string; status: string }>(payload);\n }\n\n /**\n * Restart a run from a snapshot, optionally resuming from a specific step.\n * Preceding steps inherit their stored outputs; only the target step and beyond are re-executed.\n */\n async restartRun(\n runId: string,\n request: WorkflowRestartRequest = {},\n ): Promise<WorkflowRestartResponse> {\n const response = await fetch(\n `${this.baseUrl}/api/v1/runs/${encodeURIComponent(runId)}/restart`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n },\n );\n\n if (!response.ok) {\n const error = (await response.json().catch(() => ({ error: response.statusText }))) as {\n error?: string;\n };\n throw new Error(error.error || `Failed to restart run: ${response.statusText}`);\n }\n\n const payload = await this.parseJsonResponse<{ ok: boolean; data?: WorkflowRestartResponse }>(response);\n return this.unwrapData<WorkflowRestartResponse>(payload);\n }\n}\n","/**\n * workflow:runs-watch <runId> command — like `gh run watch`\n *\n * Streams run events in real-time via SSE endpoint.\n */\n\nimport { defineCommand, handleError, type CLIInput, type PluginContextV3 , type CommandResult} from '@kb-labs/sdk';\nimport { WorkflowDaemonClient } from '../http-client.js';\n\ninterface RunsWatchFlags {\n 'run-id'?: string;\n json?: boolean;\n logs?: boolean;\n}\n\nconst STATUS_ICON: Record<string, string> = {\n success: '✓',\n failed: '✗',\n running: '⠿',\n queued: '○',\n cancelled: '⊘',\n waiting_approval: '⏳',\n waiting_child: '⏳',\n interrupted: '‖',\n};\n\nexport default defineCommand<unknown, CLIInput<RunsWatchFlags>, unknown>({\n id: 'workflow:runs-watch',\n description: 'Stream workflow run events in real-time',\n\n handler: {\n async execute(ctx: PluginContextV3, input: CLIInput<RunsWatchFlags>): Promise<CommandResult> {\n const { flags, argv = [] } = input;\n const outputJson = flags?.json ?? false;\n const logsOnly = flags?.logs ?? false;\n let runId = flags?.['run-id'] ?? argv[0];\n\n try {\n const client = new WorkflowDaemonClient();\n\n // No run ID supplied — watch the latest run (like `gh run watch`)\n if (!runId) {\n const latest = await client.listRuns({ limit: 1 });\n if (!latest.length) {\n ctx.ui?.info?.('No runs found');\n return { ok: true };\n }\n runId = latest[0]!.id!;\n ctx.ui?.info?.(`Watching latest run: ${runId}`);\n }\n\n const eventsUrl = client.getRunEventsUrl(runId);\n\n ctx.ui?.info?.(`Watching run ${runId} (Ctrl+C to stop)...`);\n\n // Use fetch with streaming to consume SSE\n const response = await fetch(eventsUrl, {\n headers: { Accept: 'text/event-stream' },\n });\n\n if (!response.ok || !response.body) {\n throw new Error(`Failed to connect to events stream: ${response.statusText}`);\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) { break; }\n\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split('\\n');\n buffer = lines.pop() ?? '';\n\n for (const line of lines) {\n if (!line.startsWith('data:')) { continue; }\n const raw = line.slice(5).trim();\n if (!raw || raw === '[DONE]') { continue; }\n\n try {\n const event = JSON.parse(raw) as { type: string; runId?: string; jobId?: string; stepId?: string; payload?: Record<string, unknown> };\n\n if (outputJson) {\n ctx.ui?.json?.({ event });\n continue;\n }\n\n // Stream log lines from handler (ctx.logger.* / ctx.ui.* / console.log)\n // Rendered as compact single lines, not boxes.\n // See: plugins/workflow/docs/adr/0019-log-stream-separation.md\n if (event.type === 'log.appended') {\n const p = event.payload as { level?: string; message?: string; stepName?: string } | undefined;\n const label = p?.stepName ?? (event.stepId ? event.stepId.slice(0, 8) : '');\n const prefix = label ? `[${label}] ` : '';\n ctx.ui?.log?.({\n level: (p?.level ?? 'info') as 'info' | 'warn' | 'error' | 'debug',\n message: `${prefix}${p?.message ?? ''}`,\n });\n continue;\n }\n\n // --logs: suppress non-log events\n if (logsOnly) { continue; }\n\n const icon = STATUS_ICON[(event.payload?.['status'] as string) ?? ''] ?? '·';\n const step = event.stepId ? ` step:${event.stepId.slice(0, 8)}` : '';\n const job = event.jobId ? ` job:${event.jobId.slice(0, 8)}` : '';\n const summary = event.payload?.['summary'] ?? event.payload?.['error'] ?? '';\n\n ctx.ui?.write?.(`${icon} ${event.type}${job}${step}${summary ? ` — ${summary}` : ''}`);\n\n // Terminal events\n if (event.type === 'run.finished' || event.type === 'run.failed' || event.type === 'run.cancelled') {\n const finalStatus = event.payload?.['status'] as string ?? event.type.split('.')[1];\n ctx.ui?.write?.(`Run ${finalStatus.toUpperCase()}. Use 'kb workflow runs-view ${runId}' for details.`);\n return finalStatus === 'failed'\n ? { ok: false, error: 'Workflow run failed' }\n : { ok: true };\n }\n } catch {\n // Ignore malformed events\n }\n }\n }\n\n return { ok: true };\n } catch (error) {\n handleError(ctx, error, outputJson);\n return { ok: false, error: 'Command failed' };\n }\n },\n },\n});\n"]}
|
package/dist/index.js
CHANGED
|
@@ -732,7 +732,7 @@ var manifest = {
|
|
|
732
732
|
},
|
|
733
733
|
channels: [
|
|
734
734
|
{
|
|
735
|
-
path: "/logs/:
|
|
735
|
+
path: "/logs/:runId",
|
|
736
736
|
handler: "./ws/logs-channel.js#default",
|
|
737
737
|
description: "Real-time job logs streaming"
|
|
738
738
|
},
|
|
@@ -748,14 +748,6 @@ var manifest = {
|
|
|
748
748
|
version: 2,
|
|
749
749
|
remoteName: "workflowPlugin",
|
|
750
750
|
pages: [
|
|
751
|
-
{
|
|
752
|
-
id: "workflow.dashboard",
|
|
753
|
-
title: "Dashboard",
|
|
754
|
-
icon: "DashboardOutlined",
|
|
755
|
-
route: "/p/workflows",
|
|
756
|
-
entry: "./Dashboard",
|
|
757
|
-
order: 1
|
|
758
|
-
},
|
|
759
751
|
{
|
|
760
752
|
id: "workflow.runs",
|
|
761
753
|
title: "Runs",
|
|
@@ -810,7 +802,7 @@ var manifest = {
|
|
|
810
802
|
id: "workflows",
|
|
811
803
|
label: "Workflows",
|
|
812
804
|
icon: "ThunderboltOutlined",
|
|
813
|
-
target: "workflow.
|
|
805
|
+
target: "workflow.runs",
|
|
814
806
|
order: 10
|
|
815
807
|
},
|
|
816
808
|
{
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flags.ts","../src/manifest.ts"],"names":[],"mappings":";;;;;;AAMA,IAAM,uBAAA,GAA0B,uBAAA;AAKzB,IAAM,WAAA,GAAc;AAAA,EACzB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAAS;AAAA;AAEb,CAAA;AAOO,IAAM,YAAA,GAAe;AAAA,EAC1B,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAAS;AAAA;AAEb,CAAA;AAOO,IAAM,WAAA,GAAc;AAAA,EACzB,IAAA,EAAM;AAAA,IACJ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A,EAAU,WAAA;AAAA,QACV,KAAA,EAAO;AAAA,OACT;AAAA,MACA;AAAA,QACE,EAAA,EAAI,iBAAA;AAAA,QACJ,KAAA,EAAO,OAAA;AAAA,QACP,IAAA,EAAM,qBAAA;AAAA,QACN,MAAA,EAAQ,gBAAA;AAAA,QACR,QAAA,EAAU,WAAA;AAAA,QACV,KAAA,EAAO;AAAA;AACT;AACF,GACF;AAAA,EAEA,WAAA,EAAa;AACf","file":"index.js","sourcesContent":["/**\n * Shared command flags definitions\n *\n * DRY pattern: Define flags once, use in both manifest and command handlers.\n */\n\nconst OUTPUT_JSON_DESCRIPTION = 'Output result as JSON';\n\n/**\n * Flags for workflow:health command\n */\nexport const healthFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport type HealthFlags = typeof healthFlags;\n\n/**\n * Flags for workflow:metrics command\n */\nexport const metricsFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport type MetricsFlags = typeof metricsFlags;\n\n/**\n * Flags for workflow:status command\n */\nexport const statusFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n 'job-id': {\n type: 'string',\n description: 'Job ID to get status for',\n },\n} as const;\n\nexport type StatusFlags = typeof statusFlags;\n\n/**\n * Flags for workflow:logs command\n */\nexport const logsFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n 'job-id': {\n type: 'string',\n description: 'Job ID to get logs for (required)',\n },\n follow: {\n type: 'boolean',\n description: 'Follow log output (stream new logs)',\n default: false,\n },\n} as const;\n\nexport type LogsFlags = typeof logsFlags;\n\n/**\n * Flags for workflow:list command\n */\nexport const listFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n status: {\n type: 'string',\n description: 'Filter by status (running, completed, failed)',\n },\n type: {\n type: 'string',\n description: 'Filter by type: \"runs\" (active executions), \"cron\" (scheduled jobs)',\n },\n} as const;\n\nexport type ListFlags = typeof listFlags;\n\n/**\n * Flags for workflow:job-run command\n */\nexport const runFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n handler: {\n type: 'string',\n description: 'Plugin handler to run (e.g., \"mind:rag-query\")',\n },\n input: {\n type: 'string',\n description: 'JSON string of input parameters',\n },\n priority: {\n type: 'number',\n description: 'Job priority (1-10, default: 5)',\n },\n wait: {\n type: 'boolean',\n description: 'Wait for job completion',\n default: false,\n },\n} as const;\n\nexport type RunFlags = typeof runFlags;\n\n/**\n * Flags for workflow:run command\n */\nexport const workflowRunFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n 'workflow-id': {\n type: 'string',\n description: 'Workflow ID to run (e.g., \"release-manager/create-release\")',\n },\n input: {\n type: 'string',\n description: 'JSON string of workflow input payload',\n },\n inputs: {\n type: 'string',\n description: 'Deprecated alias for --input. Use --input instead.',\n },\n isolation: {\n type: 'string',\n description: 'Isolation profile: strict, balanced, or relaxed',\n },\n 'target-namespace': {\n type: 'string',\n description: 'Execution target namespace',\n },\n 'target-environment-id': {\n type: 'string',\n description: 'Execution target environment ID',\n },\n 'target-workspace-id': {\n type: 'string',\n description: 'Execution target workspace ID',\n },\n 'target-workdir': {\n type: 'string',\n description: 'Execution target workdir override',\n },\n 'trigger-type': {\n type: 'string',\n description: 'Trigger type: manual, api, or cron',\n },\n 'trigger-user': {\n type: 'string',\n description: 'Trigger user',\n },\n} as const;\n\nexport type WorkflowRunFlags = typeof workflowRunFlags;\n\n/**\n * Flags for workflow:runs-list command\n */\nexport const runsListFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n status: {\n type: 'string',\n description: 'Filter by status: failed, running, success, queued, cancelled',\n },\n limit: {\n type: 'number',\n description: 'Maximum number of runs to show (default: 20)',\n default: 20,\n },\n workflow: {\n type: 'string',\n description: 'Filter by workflow ID or name',\n },\n} as const;\n\nexport type RunsListFlags = typeof runsListFlags;\n\n/**\n * Flags for workflow:runs-view command\n */\nexport const runsViewFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to inspect (alias for positional argument)',\n },\n json: {\n type: 'string',\n description: 'Output specific fields as JSON. Use --json (no value) or --json=all for full output, or --json=field1,field2 for selective fields.',\n },\n log: {\n type: 'boolean',\n description: 'Show full run logs',\n default: false,\n },\n 'log-failed': {\n type: 'boolean',\n description: 'Show logs only from failed steps (most useful for investigation)',\n default: false,\n },\n step: {\n type: 'string',\n description: 'Filter logs to a specific step name',\n },\n} as const;\n\nexport type RunsViewFlags = typeof runsViewFlags;\n\n/**\n * Flags for workflow:runs-watch command\n */\nexport const runsWatchFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to watch (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: 'Output events as JSON',\n default: false,\n },\n} as const;\n\nexport type RunsWatchFlags = typeof runsWatchFlags;\n\n/**\n * Flags for workflow:runs-rerun command\n */\nexport const runsRerunFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to rerun (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n 'failed-only': {\n type: 'boolean',\n description: 'Rerun only jobs that failed or were interrupted',\n default: false,\n },\n} as const;\n\nexport interface RunsRerunFlags {\n 'run-id'?: string;\n json?: boolean;\n 'failed-only'?: boolean;\n 'dry-run'?: boolean;\n}\n\n/**\n * Flags for workflow:runs-restart command\n */\nexport const runsRestartFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to restart (alias for positional argument)',\n },\n 'from-step': {\n type: 'string',\n description: 'Step ID to restart from; all preceding steps inherit their stored outputs',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport interface RunsRestartFlags {\n 'run-id'?: string;\n 'from-step'?: string;\n json?: boolean;\n}\n\n/**\n * Flags for workflow:runs-cancel command\n */\nexport const runsCancelFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to cancel (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport interface RunsCancelFlags {\n 'run-id'?: string;\n json?: boolean;\n}\n\n/**\n * Flags for workflow:runs-approve command\n */\nexport const runsApproveFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to approve/reject (alias for positional argument)',\n },\n 'job-id': {\n type: 'string',\n description: 'Job ID containing the approval step',\n },\n 'step-id': {\n type: 'string',\n description: 'Step ID to approve or reject',\n },\n action: {\n type: 'string',\n description: 'Action to take: \"approve\" or \"reject\" (default: approve)',\n default: 'approve',\n },\n comment: {\n type: 'string',\n description: 'Optional comment to attach to the approval decision',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport interface RunsApproveFlags {\n 'run-id'?: string;\n 'job-id'?: string;\n 'step-id'?: string;\n action?: string;\n comment?: string;\n json?: boolean;\n}\n\n/**\n * Flags for workflow:runs-logs command\n */\nexport const runsLogsFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n step: {\n type: 'string',\n description: 'Filter logs to a specific step name',\n },\n 'log-failed': {\n type: 'boolean',\n description: 'Show only logs from failed steps',\n default: false,\n },\n} as const;\n\nexport interface RunsLogsFlags {\n 'run-id'?: string;\n json?: boolean;\n step?: string;\n 'log-failed'?: boolean;\n}\n\n/**\n * Flags for workflow:runs-status command\n */\nexport const runsStatusFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport interface RunsStatusFlags {\n 'run-id'?: string;\n json?: boolean;\n}\n\n/**\n * Flags for workflow:lint command\n */\nexport const lintFlags = {\n path: {\n type: 'string',\n description: 'File or directory to lint (default: .kb/workflows)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n strict: {\n type: 'boolean',\n description: 'Treat warnings as errors',\n default: false,\n },\n} as const;\n\nexport type LintFlags = typeof lintFlags;\n","/**\n * KB Labs Workflow CLI - Manifest V3\n *\n * Provides CLI commands for interacting with Workflow Daemon via HTTP API.\n */\n\nimport { defineCommandFlags, combinePermissions } from '@kb-labs/sdk';\nimport {\n healthFlags,\n metricsFlags,\n statusFlags,\n logsFlags,\n listFlags,\n runFlags,\n workflowRunFlags,\n runsListFlags,\n runsLogsFlags,\n runsStatusFlags,\n runsViewFlags,\n runsWatchFlags,\n runsRerunFlags,\n runsRestartFlags,\n runsCancelFlags,\n runsApproveFlags,\n lintFlags,\n} from './flags';\nimport {\n WORKFLOW_BASE_PATH,\n WORKFLOW_ROUTES,\n} from '@kb-labs/workflow-contracts';\n\n\n/**\n * Minimal permissions - workflow-cli only makes HTTP requests\n * No file system or git access needed\n */\nconst pluginPermissions = combinePermissions()\n .withEnv(['WORKFLOW_DAEMON_URL'])\n .withNetwork({\n fetch: ['http://localhost:*', 'http://127.0.0.1:*'],\n })\n .withQuotas({\n timeoutMs: 30000, // 30 seconds for HTTP requests\n memoryMb: 128,\n })\n .build();\n\nexport const manifest = {\n schema: 'kb.plugin/3',\n id: '@kb-labs/workflow',\n version: '1.0.0',\n\n display: {\n name: 'Workflow CLI',\n description: 'CLI commands for interacting with KB Labs Workflow Daemon',\n tags: ['workflow', 'daemon', 'jobs', 'orchestration'],\n },\n\n // No platform requirements - just HTTP client\n platform: {\n requires: [],\n optional: [],\n },\n\n cli: {\n groupMeta: [\n { path: 'workflow', describe: 'Workflow daemon commands' },\n { path: 'workflow runs', describe: 'Workflow run management (list, view, watch, rerun)' },\n { path: 'workflow job', describe: 'Raw job execution' },\n ],\n commands: [\n {\n path: 'workflow health',\n category: 'Daemon',\n operationType: 'read' as const,\n describe: 'Check workflow daemon health status.',\n longDescription:\n 'Performs a health check on the workflow daemon by making an HTTP request to /health endpoint. ' +\n 'Use this to verify the daemon is running and responding.',\n handler: './commands/health.js#default',\n flags: defineCommandFlags(healthFlags),\n examples: ['kb workflow health', 'kb workflow health --json'],\n },\n {\n path: 'workflow metrics',\n category: 'Daemon',\n operationType: 'read' as const,\n describe: 'Get workflow daemon metrics.',\n longDescription:\n 'Fetches comprehensive metrics from the workflow daemon including total runs, queued jobs, ' +\n 'running jobs, completed jobs, and failure counts.',\n handler: './commands/metrics.js#default',\n flags: defineCommandFlags(metricsFlags),\n examples: ['kb workflow metrics', 'kb workflow metrics --json'],\n },\n {\n path: 'workflow lint',\n category: 'Daemon',\n operationType: 'read' as const,\n describe: 'Validate workflow files against the schema.',\n longDescription:\n 'Statically validates workflow files under .kb/workflows (or a given --path) against ' +\n 'WorkflowSpecSchema, reporting per-file issues with their JSON-path. Runs locally without ' +\n 'the daemon. Exits non-zero if any file is invalid (or, with --strict, has warnings).',\n handler: './commands/lint.js#default',\n flags: defineCommandFlags(lintFlags),\n examples: [\n 'kb workflow lint',\n 'kb workflow lint --path .kb/workflows/03-dev-cycle.yml',\n 'kb workflow lint --json',\n 'kb workflow lint --strict',\n ],\n },\n {\n path: 'workflow status',\n category: 'Jobs',\n operationType: 'read' as const,\n describe: '(Deprecated) Get job status. Use: kb workflow runs status <runId>',\n longDescription:\n 'Retrieves detailed status information for a specific job by ID, including current state, ' +\n 'start time, and completion time if finished. ' +\n 'DEPRECATED: use \"kb workflow runs status <runId>\" for run-level status.',\n handler: './commands/status.js#default',\n flags: defineCommandFlags(statusFlags),\n examples: ['kb workflow status --job-id=abc123', 'kb workflow status --job-id=abc123 --json'],\n },\n {\n path: 'workflow logs',\n category: 'Jobs',\n operationType: 'read' as const,\n describe: '(Deprecated) Get job/run logs. Use: kb workflow runs logs <runId>',\n longDescription:\n 'Fetches execution logs for a specific job or run by ID. ' +\n 'DEPRECATED: use \"kb workflow runs logs <runId>\" for run-level logs.',\n handler: './commands/logs.js#default',\n flags: defineCommandFlags(logsFlags),\n examples: [\n 'kb workflow logs --job-id=abc123',\n 'kb workflow logs --job-id=abc123 --json',\n 'kb workflow logs --job-id=abc123 --follow',\n ],\n },\n {\n path: 'workflow list',\n category: 'Jobs',\n operationType: 'read' as const,\n describe: '(Deprecated) List active executions. Use: kb workflow runs list',\n longDescription:\n 'Lists all currently active workflow executions or cron jobs. Can be filtered by status (running, queued, ' +\n 'completed, failed, cancelled) or type (runs, cron). ' +\n 'DEPRECATED: use \"kb workflow runs list\" for run listing.',\n handler: './commands/list.js#default',\n flags: defineCommandFlags(listFlags),\n examples: [\n 'kb workflow list',\n 'kb workflow list --status=running',\n 'kb workflow list --type=cron',\n 'kb workflow list --json',\n ],\n },\n {\n path: 'workflow job run',\n category: 'Jobs',\n operationType: 'execute' as const,\n describe: 'Submit a raw job for execution.',\n longDescription:\n 'Submits a job to the workflow daemon for execution. Requires a handler (plugin command) and ' +\n 'optionally accepts input parameters as JSON. Can wait for job completion with --wait flag.',\n handler: './commands/run.js#default',\n flags: defineCommandFlags(runFlags),\n examples: [\n 'kb workflow job run --handler=mind:search --input=\\'{\"text\":\"test\"}\\'',\n 'kb workflow job run --handler=mind:search --input=\\'{\"text\":\"test\"}\\' --wait',\n 'kb workflow job run --handler=mind:search --input=\\'{\"text\":\"test\"}\\' --priority=8',\n 'kb workflow job run --handler=mind:search --input=\\'{\"text\":\"test\"}\\' --json',\n ],\n },\n {\n path: 'workflow runs list',\n category: 'Runs',\n operationType: 'read' as const,\n describe: 'List workflow runs.',\n longDescription:\n 'Lists workflow runs with status, trigger, and duration. Filter by status (failed, running, success) ' +\n 'or workflow ID. Use --json for machine-readable output.',\n handler: './commands/runs-list.js#default',\n flags: defineCommandFlags(runsListFlags),\n examples: [\n 'kb workflow runs list',\n 'kb workflow runs list --status=failed',\n 'kb workflow runs list --status=failed --limit=5',\n 'kb workflow runs list --workflow=my-workflow --json',\n ],\n },\n {\n path: 'workflow runs view',\n category: 'Runs',\n operationType: 'read' as const,\n describe: 'View run details for incident investigation.',\n longDescription:\n 'Shows full run details: jobs, steps, resolvedInputs, gate decisions, errors. ' +\n 'Without a run ID shows the latest run (like gh run view). ' +\n 'Use --log-failed to see only the logs from failed steps (fastest path to root cause). ' +\n 'Use --json=status,jobs for selective JSON output.',\n handler: './commands/runs-view.js#default',\n flags: defineCommandFlags(runsViewFlags),\n examples: [\n 'kb workflow runs view',\n 'kb workflow runs view <runId>',\n 'kb workflow runs view --run-id=<runId>',\n 'kb workflow runs view <runId> --log-failed',\n 'kb workflow runs view <runId> --log',\n 'kb workflow runs view <runId> --json=status,jobs',\n 'kb workflow runs view <runId> --json=all',\n ],\n },\n {\n path: 'workflow runs watch',\n category: 'Runs',\n operationType: 'execute' as const,\n describe: 'Stream workflow run events in real-time.',\n longDescription:\n 'Connects to the run event stream via SSE and prints events as they happen. ' +\n 'Without a run ID watches the latest run (like gh run watch). ' +\n 'Automatically exits when the run finishes.',\n handler: './commands/runs-watch.js#default',\n flags: defineCommandFlags(runsWatchFlags),\n examples: ['kb workflow runs watch', 'kb workflow runs watch <runId>', 'kb workflow runs watch --run-id=<runId>', 'kb workflow runs watch <runId> --json'],\n },\n {\n path: 'workflow runs rerun',\n category: 'Runs',\n operationType: 'mutate' as const,\n describe: 'Rerun a workflow run.',\n longDescription:\n 'Reruns a workflow by re-submitting it with the same inputs. ' +\n 'Use --failed-only to requeue only jobs that failed or were interrupted.',\n handler: './commands/runs-rerun.js#default',\n flags: defineCommandFlags(runsRerunFlags),\n examples: [\n 'kb workflow runs rerun <runId>',\n 'kb workflow runs rerun --run-id=<runId>',\n 'kb workflow runs rerun <runId> --failed-only',\n 'kb workflow runs rerun <runId> --json',\n ],\n },\n {\n path: 'workflow runs restart',\n category: 'Runs',\n operationType: 'mutate' as const,\n describe: 'Restart a run from a specific step.',\n longDescription:\n 'Restores the run from a snapshot and re-executes from the given step. ' +\n 'All preceding steps inherit their stored outputs without being re-run. ' +\n 'Omitting --from-step restarts from step 1 using the snapshot env.',\n handler: './commands/runs-restart.js#default',\n flags: defineCommandFlags(runsRestartFlags),\n examples: [\n 'kb workflow runs restart <runId>',\n 'kb workflow runs restart <runId> --from-step=<stepId>',\n 'kb workflow runs restart <runId> --from-step=<stepId> --json',\n ],\n },\n {\n path: 'workflow runs cancel',\n category: 'Runs',\n operationType: 'mutate' as const,\n describe: 'Cancel a workflow run.',\n longDescription:\n 'Cancels an active workflow run. If the run is not found or already finished, prints a clear error.',\n handler: './commands/runs-cancel.js#default',\n flags: defineCommandFlags(runsCancelFlags),\n examples: [\n 'kb workflow runs cancel <runId>',\n 'kb workflow runs cancel --run-id=<runId>',\n 'kb workflow runs cancel <runId> --json',\n ],\n },\n {\n path: 'workflow runs logs',\n category: 'Runs',\n operationType: 'read' as const,\n describe: 'Fetch logs for a workflow run.',\n longDescription:\n 'Fetches execution logs for a run. Use --log-failed to show only failed-step logs. ' +\n 'Use --step to filter to a specific step. Accepts a positional run ID or --run-id flag.',\n handler: './commands/runs-logs.js#default',\n flags: defineCommandFlags(runsLogsFlags),\n examples: [\n 'kb workflow runs logs <runId>',\n 'kb workflow runs logs <runId> --log-failed',\n 'kb workflow runs logs <runId> --step=build',\n 'kb workflow runs logs <runId> --json',\n ],\n },\n {\n path: 'workflow runs status',\n category: 'Runs',\n operationType: 'read' as const,\n describe: 'Show status summary for a workflow run.',\n longDescription:\n 'Displays the status of a run including jobs and steps. Accepts a positional run ID or --run-id flag.',\n handler: './commands/runs-status.js#default',\n flags: defineCommandFlags(runsStatusFlags),\n examples: [\n 'kb workflow runs status <runId>',\n 'kb workflow runs status --run-id=<runId>',\n 'kb workflow runs status <runId> --json',\n ],\n },\n {\n path: 'workflow runs approve',\n category: 'Runs',\n operationType: 'mutate' as const,\n describe: 'Approve or reject a pending approval step in a workflow run.',\n longDescription:\n 'Resolves a human-gate (approval) step that is waiting for a decision. ' +\n 'If the run has exactly one pending approval, it is resolved automatically. ' +\n 'If there are multiple, specify --job-id and --step-id to target the right one. ' +\n 'Use --action=reject to reject instead of approve (default: approve). ' +\n 'Use --comment to attach a note to the decision.',\n handler: './commands/runs-approve.js#default',\n flags: defineCommandFlags(runsApproveFlags),\n examples: [\n 'kb workflow runs approve <runId>',\n 'kb workflow runs approve <runId> --action=reject --comment=\"Needs rework\"',\n 'kb workflow runs approve <runId> --job-id=<jobId> --step-id=<stepId>',\n 'kb workflow runs approve <runId> --json',\n ],\n },\n {\n path: 'workflow run',\n category: 'Runs',\n operationType: 'execute' as const,\n describe: 'Run workflow by ID.',\n longDescription:\n 'Runs a workflow definition by workflow ID via /api/v1/workflows/:id/run endpoint. ' +\n 'Supports request-level target and isolation overrides.',\n handler: './commands/workflow-run.js#default',\n flags: defineCommandFlags(workflowRunFlags),\n examples: [\n 'kb workflow run --workflow-id=release-manager/create-release',\n 'kb workflow run --workflow-id=release-manager/create-release --isolation=strict --target-namespace=team-a/prod',\n 'kb workflow run --workflow-id=release-manager/create-release --target-environment-id=env-123 --json',\n ],\n },\n ],\n },\n\n // REST API routes (proxy to workflow daemon)\n rest: {\n basePath: WORKFLOW_BASE_PATH,\n routes: [\n // GET /stats - Dashboard statistics\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.STATS,\n handler: './rest/stats-handler.js#default',\n describe: 'Get dashboard statistics',\n output: {\n zod: '@kb-labs/workflow-contracts#DashboardStatsResponseSchema',\n },\n },\n // GET /workflows - List workflow definitions\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.WORKFLOWS,\n handler: './rest/workflows-list-handler.js#default',\n describe: 'List all workflow definitions',\n output: {\n zod: '@kb-labs/workflow-contracts#WorkflowListResponseSchema',\n },\n },\n // GET /workflows/:id - Get workflow detail\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.WORKFLOW_DETAIL,\n handler: './rest/workflow-detail-handler.js#default',\n describe: 'Get workflow definition details',\n output: {\n zod: '@kb-labs/workflow-contracts#WorkflowInfoSchema',\n },\n },\n // POST /workflows/:id/run - Run workflow\n {\n method: 'POST',\n path: WORKFLOW_ROUTES.WORKFLOW_RUN,\n handler: './rest/workflow-run-handler.js#default',\n describe: 'Run a workflow',\n input: {\n zod: '@kb-labs/workflow-contracts#WorkflowRunRequestSchema',\n },\n },\n // GET /workflows/:workflowId/runs - Get workflow run history\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.WORKFLOW_RUNS,\n handler: './rest/workflow-runs-handler.js#default',\n describe: 'Get workflow run history with pagination',\n output: {\n zod: '@kb-labs/workflow-contracts#WorkflowRunHistoryResponseSchema',\n },\n },\n // POST /workflows/runs/:runId/cancel - Cancel a workflow run\n {\n method: 'POST',\n path: WORKFLOW_ROUTES.WORKFLOW_RUN_CANCEL,\n handler: './rest/workflow-run-cancel-handler.js#default',\n describe: 'Cancel a running or queued workflow run',\n },\n // GET /runs - List all workflow runs\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.RUNS,\n handler: './rest/runs-list-handler.js#default',\n describe: 'List all workflow runs across all workflows',\n },\n // GET /runs/:runId - Get a specific workflow run\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.RUN_DETAIL,\n handler: './rest/run-detail-handler.js#default',\n describe: 'Get detailed information about a specific workflow run',\n },\n // GET /workflows/jobs - List jobs\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.JOBS,\n handler: './rest/jobs-list-handler.js#default',\n describe: 'List workflow jobs with optional filters',\n output: {\n zod: '@kb-labs/workflow-contracts#JobListResponseSchema',\n },\n },\n // GET /workflows/jobs/:jobId - Get job detail\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.JOB_DETAIL,\n handler: './rest/job-detail-handler.js#default',\n describe: 'Get detailed information about a specific job',\n output: {\n zod: '@kb-labs/workflow-contracts#JobStatusInfoSchema',\n },\n },\n // GET /workflows/jobs/:jobId/logs - Get job logs\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.JOB_LOGS,\n handler: './rest/job-logs-handler.js#default',\n describe: 'Get execution logs for a specific job',\n output: {\n zod: '@kb-labs/workflow-contracts#JobLogsResponseSchema',\n },\n },\n // GET /workflows/jobs/:jobId/steps - Get job steps\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.JOB_STEPS,\n handler: './rest/job-steps-handler.js#default',\n describe: 'Get execution steps and progress for a specific job',\n output: {\n zod: '@kb-labs/workflow-contracts#JobStepsResponseSchema',\n },\n },\n // POST /workflows/jobs/:jobId/cancel - Cancel job\n {\n method: 'POST',\n path: WORKFLOW_ROUTES.JOB_CANCEL,\n handler: './rest/job-cancel-handler.js#default',\n describe: 'Cancel a running or pending job',\n output: {\n zod: '@kb-labs/workflow-contracts#JobCancelResponseSchema',\n },\n },\n // GET /workflows/cron - List cron jobs\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.CRON,\n handler: './rest/cron-list-handler.js#default',\n describe: 'List all registered cron jobs',\n output: {\n zod: '@kb-labs/workflow-contracts#CronListResponseSchema',\n },\n },\n // GET /runs/:runId/pending-approvals - List pending approvals\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.PENDING_APPROVALS,\n handler: './rest/pending-approvals-handler.js#default',\n describe: 'List steps waiting for approval in a workflow run',\n },\n // POST /runs/:runId/approve - Resolve approval\n {\n method: 'POST',\n path: WORKFLOW_ROUTES.RESOLVE_APPROVAL,\n handler: './rest/resolve-approval-handler.js#default',\n describe: 'Approve or reject a pending approval step',\n },\n ],\n },\n\n // WebSocket channels for real-time updates\n ws: {\n basePath: '/v1/ws/plugins/workflow',\n defaults: {\n timeoutMs: 600000, // 10 minutes\n maxMessageSize: 1048576, // 1MB\n auth: 'none',\n idleTimeoutMs: 300000, // 5 minutes\n },\n channels: [\n {\n path: '/logs/:jobId',\n handler: './ws/logs-channel.js#default',\n description: 'Real-time job logs streaming',\n },\n {\n path: '/progress/:jobId',\n handler: './ws/progress-channel.js#default',\n description: 'Real-time job progress updates',\n },\n ],\n },\n\n // Studio V2 — Module Federation pages\n studio: {\n version: 2 as const,\n remoteName: 'workflowPlugin',\n pages: [\n {\n id: 'workflow.dashboard',\n title: 'Dashboard',\n icon: 'DashboardOutlined',\n route: '/p/workflows',\n entry: './Dashboard',\n order: 1,\n },\n {\n id: 'workflow.runs',\n title: 'Runs',\n icon: 'PlayCircleOutlined',\n route: '/p/workflows/runs',\n entry: './Runs',\n order: 2,\n },\n {\n id: 'workflow.run',\n title: 'Run Detail',\n icon: 'PlayCircleOutlined',\n route: '/p/workflows/runs/:runId',\n entry: './RunDetail',\n order: 3,\n },\n {\n id: 'workflow.defs',\n title: 'Definitions',\n icon: 'AppstoreOutlined',\n route: '/p/workflows/definitions',\n entry: './Definitions',\n order: 4,\n },\n {\n id: 'workflow.def',\n title: 'Definition Detail',\n icon: 'AppstoreOutlined',\n route: '/p/workflows/definitions/:workflowId',\n entry: './DefinitionDetail',\n order: 5,\n },\n {\n id: 'workflow.jobs',\n title: 'Jobs',\n icon: 'UnorderedListOutlined',\n route: '/p/workflows/jobs',\n entry: './Jobs',\n order: 6,\n },\n {\n id: 'workflow.crons',\n title: 'Crons',\n icon: 'ClockCircleOutlined',\n route: '/p/workflows/crons',\n entry: './Crons',\n order: 7,\n },\n ],\n menus: [\n {\n id: 'workflows',\n label: 'Workflows',\n icon: 'ThunderboltOutlined',\n target: 'workflow.dashboard',\n order: 10,\n },\n {\n id: 'workflows.runs',\n label: 'Runs',\n icon: 'PlayCircleOutlined',\n target: 'workflow.runs',\n parentId: 'workflows',\n order: 1,\n },\n {\n id: 'workflows.defs',\n label: 'Definitions',\n icon: 'AppstoreOutlined',\n target: 'workflow.defs',\n parentId: 'workflows',\n order: 2,\n },\n {\n id: 'workflows.jobs',\n label: 'Jobs',\n icon: 'UnorderedListOutlined',\n target: 'workflow.jobs',\n parentId: 'workflows',\n order: 3,\n },\n {\n id: 'workflows.crons',\n label: 'Crons',\n icon: 'ClockCircleOutlined',\n target: 'workflow.crons',\n parentId: 'workflows',\n order: 4,\n },\n ],\n },\n\n permissions: pluginPermissions,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/flags.ts","../src/manifest.ts"],"names":[],"mappings":";;;;;;AAMA,IAAM,uBAAA,GAA0B,uBAAA;AAKzB,IAAM,WAAA,GAAc;AAAA,EACzB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAAS;AAAA;AAEb,CAAA;AAOO,IAAM,YAAA,GAAe;AAAA,EAC1B,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAAS;AAAA;AAEb,CAAA;AAOO,IAAM,WAAA,GAAc;AAAA,EACzB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,QAAA;AAAA,IACN,WAAA,EAAa;AAAA;AAEjB,CAAA;AAOO,IAAM,SAAA,GAAY;AAAA,EACvB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,QAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa,qCAAA;AAAA,IACb,OAAA,EAAS;AAAA;AAEb,CAAA;AAOO,IAAM,SAAA,GAAY;AAAA,EACvB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAAS;AAAA,GACX;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAA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AAA,QACE,EAAA,EAAI,gBAAA;AAAA,QACJ,KAAA,EAAO,aAAA;AAAA,QACP,IAAA,EAAM,kBAAA;AAAA,QACN,MAAA,EAAQ,eAAA;AAAA,QACR,QAAA,EAAU,WAAA;AAAA,QACV,KAAA,EAAO;AAAA,OACT;AAAA,MACA;AAAA,QACE,EAAA,EAAI,gBAAA;AAAA,QACJ,KAAA,EAAO,MAAA;AAAA,QACP,IAAA,EAAM,uBAAA;AAAA,QACN,MAAA,EAAQ,eAAA;AAAA,QACR,QAAA,EAAU,WAAA;AAAA,QACV,KAAA,EAAO;AAAA,OACT;AAAA,MACA;AAAA,QACE,EAAA,EAAI,iBAAA;AAAA,QACJ,KAAA,EAAO,OAAA;AAAA,QACP,IAAA,EAAM,qBAAA;AAAA,QACN,MAAA,EAAQ,gBAAA;AAAA,QACR,QAAA,EAAU,WAAA;AAAA,QACV,KAAA,EAAO;AAAA;AACT;AACF,GACF;AAAA,EAEA,WAAA,EAAa;AACf","file":"index.js","sourcesContent":["/**\n * Shared command flags definitions\n *\n * DRY pattern: Define flags once, use in both manifest and command handlers.\n */\n\nconst OUTPUT_JSON_DESCRIPTION = 'Output result as JSON';\n\n/**\n * Flags for workflow:health command\n */\nexport const healthFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport type HealthFlags = typeof healthFlags;\n\n/**\n * Flags for workflow:metrics command\n */\nexport const metricsFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport type MetricsFlags = typeof metricsFlags;\n\n/**\n * Flags for workflow:status command\n */\nexport const statusFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n 'job-id': {\n type: 'string',\n description: 'Job ID to get status for',\n },\n} as const;\n\nexport type StatusFlags = typeof statusFlags;\n\n/**\n * Flags for workflow:logs command\n */\nexport const logsFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n 'job-id': {\n type: 'string',\n description: 'Job ID to get logs for (required)',\n },\n follow: {\n type: 'boolean',\n description: 'Follow log output (stream new logs)',\n default: false,\n },\n} as const;\n\nexport type LogsFlags = typeof logsFlags;\n\n/**\n * Flags for workflow:list command\n */\nexport const listFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n status: {\n type: 'string',\n description: 'Filter by status (running, completed, failed)',\n },\n type: {\n type: 'string',\n description: 'Filter by type: \"runs\" (active executions), \"cron\" (scheduled jobs)',\n },\n} as const;\n\nexport type ListFlags = typeof listFlags;\n\n/**\n * Flags for workflow:job-run command\n */\nexport const runFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n handler: {\n type: 'string',\n description: 'Plugin handler to run (e.g., \"mind:rag-query\")',\n },\n input: {\n type: 'string',\n description: 'JSON string of input parameters',\n },\n priority: {\n type: 'number',\n description: 'Job priority (1-10, default: 5)',\n },\n wait: {\n type: 'boolean',\n description: 'Wait for job completion',\n default: false,\n },\n} as const;\n\nexport type RunFlags = typeof runFlags;\n\n/**\n * Flags for workflow:run command\n */\nexport const workflowRunFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n 'workflow-id': {\n type: 'string',\n description: 'Workflow ID to run (e.g., \"release-manager/create-release\")',\n },\n input: {\n type: 'string',\n description: 'JSON string of workflow input payload',\n },\n inputs: {\n type: 'string',\n description: 'Deprecated alias for --input. Use --input instead.',\n },\n isolation: {\n type: 'string',\n description: 'Isolation profile: strict, balanced, or relaxed',\n },\n 'target-namespace': {\n type: 'string',\n description: 'Execution target namespace',\n },\n 'target-environment-id': {\n type: 'string',\n description: 'Execution target environment ID',\n },\n 'target-workspace-id': {\n type: 'string',\n description: 'Execution target workspace ID',\n },\n 'target-workdir': {\n type: 'string',\n description: 'Execution target workdir override',\n },\n 'trigger-type': {\n type: 'string',\n description: 'Trigger type: manual, api, or cron',\n },\n 'trigger-user': {\n type: 'string',\n description: 'Trigger user',\n },\n} as const;\n\nexport type WorkflowRunFlags = typeof workflowRunFlags;\n\n/**\n * Flags for workflow:runs-list command\n */\nexport const runsListFlags = {\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n status: {\n type: 'string',\n description: 'Filter by status: failed, running, success, queued, cancelled',\n },\n limit: {\n type: 'number',\n description: 'Maximum number of runs to show (default: 20)',\n default: 20,\n },\n workflow: {\n type: 'string',\n description: 'Filter by workflow ID or name',\n },\n} as const;\n\nexport type RunsListFlags = typeof runsListFlags;\n\n/**\n * Flags for workflow:runs-view command\n */\nexport const runsViewFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to inspect (alias for positional argument)',\n },\n json: {\n type: 'string',\n description: 'Output specific fields as JSON. Use --json (no value) or --json=all for full output, or --json=field1,field2 for selective fields.',\n },\n log: {\n type: 'boolean',\n description: 'Show full run logs',\n default: false,\n },\n 'log-failed': {\n type: 'boolean',\n description: 'Show logs only from failed steps (most useful for investigation)',\n default: false,\n },\n step: {\n type: 'string',\n description: 'Filter logs to a specific step name',\n },\n} as const;\n\nexport type RunsViewFlags = typeof runsViewFlags;\n\n/**\n * Flags for workflow:runs-watch command\n */\nexport const runsWatchFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to watch (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: 'Output events as JSON',\n default: false,\n },\n} as const;\n\nexport type RunsWatchFlags = typeof runsWatchFlags;\n\n/**\n * Flags for workflow:runs-rerun command\n */\nexport const runsRerunFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to rerun (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n 'failed-only': {\n type: 'boolean',\n description: 'Rerun only jobs that failed or were interrupted',\n default: false,\n },\n} as const;\n\nexport interface RunsRerunFlags {\n 'run-id'?: string;\n json?: boolean;\n 'failed-only'?: boolean;\n 'dry-run'?: boolean;\n}\n\n/**\n * Flags for workflow:runs-restart command\n */\nexport const runsRestartFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to restart (alias for positional argument)',\n },\n 'from-step': {\n type: 'string',\n description: 'Step ID to restart from; all preceding steps inherit their stored outputs',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport interface RunsRestartFlags {\n 'run-id'?: string;\n 'from-step'?: string;\n json?: boolean;\n}\n\n/**\n * Flags for workflow:runs-cancel command\n */\nexport const runsCancelFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to cancel (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport interface RunsCancelFlags {\n 'run-id'?: string;\n json?: boolean;\n}\n\n/**\n * Flags for workflow:runs-approve command\n */\nexport const runsApproveFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID to approve/reject (alias for positional argument)',\n },\n 'job-id': {\n type: 'string',\n description: 'Job ID containing the approval step',\n },\n 'step-id': {\n type: 'string',\n description: 'Step ID to approve or reject',\n },\n action: {\n type: 'string',\n description: 'Action to take: \"approve\" or \"reject\" (default: approve)',\n default: 'approve',\n },\n comment: {\n type: 'string',\n description: 'Optional comment to attach to the approval decision',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport interface RunsApproveFlags {\n 'run-id'?: string;\n 'job-id'?: string;\n 'step-id'?: string;\n action?: string;\n comment?: string;\n json?: boolean;\n}\n\n/**\n * Flags for workflow:runs-logs command\n */\nexport const runsLogsFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n step: {\n type: 'string',\n description: 'Filter logs to a specific step name',\n },\n 'log-failed': {\n type: 'boolean',\n description: 'Show only logs from failed steps',\n default: false,\n },\n} as const;\n\nexport interface RunsLogsFlags {\n 'run-id'?: string;\n json?: boolean;\n step?: string;\n 'log-failed'?: boolean;\n}\n\n/**\n * Flags for workflow:runs-status command\n */\nexport const runsStatusFlags = {\n 'run-id': {\n type: 'string',\n description: 'Run ID (alias for positional argument)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n} as const;\n\nexport interface RunsStatusFlags {\n 'run-id'?: string;\n json?: boolean;\n}\n\n/**\n * Flags for workflow:lint command\n */\nexport const lintFlags = {\n path: {\n type: 'string',\n description: 'File or directory to lint (default: .kb/workflows)',\n },\n json: {\n type: 'boolean',\n description: OUTPUT_JSON_DESCRIPTION,\n default: false,\n },\n strict: {\n type: 'boolean',\n description: 'Treat warnings as errors',\n default: false,\n },\n} as const;\n\nexport type LintFlags = typeof lintFlags;\n","/**\n * KB Labs Workflow CLI - Manifest V3\n *\n * Provides CLI commands for interacting with Workflow Daemon via HTTP API.\n */\n\nimport { defineCommandFlags, combinePermissions } from '@kb-labs/sdk';\nimport {\n healthFlags,\n metricsFlags,\n statusFlags,\n logsFlags,\n listFlags,\n runFlags,\n workflowRunFlags,\n runsListFlags,\n runsLogsFlags,\n runsStatusFlags,\n runsViewFlags,\n runsWatchFlags,\n runsRerunFlags,\n runsRestartFlags,\n runsCancelFlags,\n runsApproveFlags,\n lintFlags,\n} from './flags';\nimport {\n WORKFLOW_BASE_PATH,\n WORKFLOW_ROUTES,\n} from '@kb-labs/workflow-contracts';\n\n\n/**\n * Minimal permissions - workflow-cli only makes HTTP requests\n * No file system or git access needed\n */\nconst pluginPermissions = combinePermissions()\n .withEnv(['WORKFLOW_DAEMON_URL'])\n .withNetwork({\n fetch: ['http://localhost:*', 'http://127.0.0.1:*'],\n })\n .withQuotas({\n timeoutMs: 30000, // 30 seconds for HTTP requests\n memoryMb: 128,\n })\n .build();\n\nexport const manifest = {\n schema: 'kb.plugin/3',\n id: '@kb-labs/workflow',\n version: '1.0.0',\n\n display: {\n name: 'Workflow CLI',\n description: 'CLI commands for interacting with KB Labs Workflow Daemon',\n tags: ['workflow', 'daemon', 'jobs', 'orchestration'],\n },\n\n // No platform requirements - just HTTP client\n platform: {\n requires: [],\n optional: [],\n },\n\n cli: {\n groupMeta: [\n { path: 'workflow', describe: 'Workflow daemon commands' },\n { path: 'workflow runs', describe: 'Workflow run management (list, view, watch, rerun)' },\n { path: 'workflow job', describe: 'Raw job execution' },\n ],\n commands: [\n {\n path: 'workflow health',\n category: 'Daemon',\n operationType: 'read' as const,\n describe: 'Check workflow daemon health status.',\n longDescription:\n 'Performs a health check on the workflow daemon by making an HTTP request to /health endpoint. ' +\n 'Use this to verify the daemon is running and responding.',\n handler: './commands/health.js#default',\n flags: defineCommandFlags(healthFlags),\n examples: ['kb workflow health', 'kb workflow health --json'],\n },\n {\n path: 'workflow metrics',\n category: 'Daemon',\n operationType: 'read' as const,\n describe: 'Get workflow daemon metrics.',\n longDescription:\n 'Fetches comprehensive metrics from the workflow daemon including total runs, queued jobs, ' +\n 'running jobs, completed jobs, and failure counts.',\n handler: './commands/metrics.js#default',\n flags: defineCommandFlags(metricsFlags),\n examples: ['kb workflow metrics', 'kb workflow metrics --json'],\n },\n {\n path: 'workflow lint',\n category: 'Daemon',\n operationType: 'read' as const,\n describe: 'Validate workflow files against the schema.',\n longDescription:\n 'Statically validates workflow files under .kb/workflows (or a given --path) against ' +\n 'WorkflowSpecSchema, reporting per-file issues with their JSON-path. Runs locally without ' +\n 'the daemon. Exits non-zero if any file is invalid (or, with --strict, has warnings).',\n handler: './commands/lint.js#default',\n flags: defineCommandFlags(lintFlags),\n examples: [\n 'kb workflow lint',\n 'kb workflow lint --path .kb/workflows/03-dev-cycle.yml',\n 'kb workflow lint --json',\n 'kb workflow lint --strict',\n ],\n },\n {\n path: 'workflow status',\n category: 'Jobs',\n operationType: 'read' as const,\n describe: '(Deprecated) Get job status. Use: kb workflow runs status <runId>',\n longDescription:\n 'Retrieves detailed status information for a specific job by ID, including current state, ' +\n 'start time, and completion time if finished. ' +\n 'DEPRECATED: use \"kb workflow runs status <runId>\" for run-level status.',\n handler: './commands/status.js#default',\n flags: defineCommandFlags(statusFlags),\n examples: ['kb workflow status --job-id=abc123', 'kb workflow status --job-id=abc123 --json'],\n },\n {\n path: 'workflow logs',\n category: 'Jobs',\n operationType: 'read' as const,\n describe: '(Deprecated) Get job/run logs. Use: kb workflow runs logs <runId>',\n longDescription:\n 'Fetches execution logs for a specific job or run by ID. ' +\n 'DEPRECATED: use \"kb workflow runs logs <runId>\" for run-level logs.',\n handler: './commands/logs.js#default',\n flags: defineCommandFlags(logsFlags),\n examples: [\n 'kb workflow logs --job-id=abc123',\n 'kb workflow logs --job-id=abc123 --json',\n 'kb workflow logs --job-id=abc123 --follow',\n ],\n },\n {\n path: 'workflow list',\n category: 'Jobs',\n operationType: 'read' as const,\n describe: '(Deprecated) List active executions. Use: kb workflow runs list',\n longDescription:\n 'Lists all currently active workflow executions or cron jobs. Can be filtered by status (running, queued, ' +\n 'completed, failed, cancelled) or type (runs, cron). ' +\n 'DEPRECATED: use \"kb workflow runs list\" for run listing.',\n handler: './commands/list.js#default',\n flags: defineCommandFlags(listFlags),\n examples: [\n 'kb workflow list',\n 'kb workflow list --status=running',\n 'kb workflow list --type=cron',\n 'kb workflow list --json',\n ],\n },\n {\n path: 'workflow job run',\n category: 'Jobs',\n operationType: 'execute' as const,\n describe: 'Submit a raw job for execution.',\n longDescription:\n 'Submits a job to the workflow daemon for execution. Requires a handler (plugin command) and ' +\n 'optionally accepts input parameters as JSON. Can wait for job completion with --wait flag.',\n handler: './commands/run.js#default',\n flags: defineCommandFlags(runFlags),\n examples: [\n 'kb workflow job run --handler=mind:search --input=\\'{\"text\":\"test\"}\\'',\n 'kb workflow job run --handler=mind:search --input=\\'{\"text\":\"test\"}\\' --wait',\n 'kb workflow job run --handler=mind:search --input=\\'{\"text\":\"test\"}\\' --priority=8',\n 'kb workflow job run --handler=mind:search --input=\\'{\"text\":\"test\"}\\' --json',\n ],\n },\n {\n path: 'workflow runs list',\n category: 'Runs',\n operationType: 'read' as const,\n describe: 'List workflow runs.',\n longDescription:\n 'Lists workflow runs with status, trigger, and duration. Filter by status (failed, running, success) ' +\n 'or workflow ID. Use --json for machine-readable output.',\n handler: './commands/runs-list.js#default',\n flags: defineCommandFlags(runsListFlags),\n examples: [\n 'kb workflow runs list',\n 'kb workflow runs list --status=failed',\n 'kb workflow runs list --status=failed --limit=5',\n 'kb workflow runs list --workflow=my-workflow --json',\n ],\n },\n {\n path: 'workflow runs view',\n category: 'Runs',\n operationType: 'read' as const,\n describe: 'View run details for incident investigation.',\n longDescription:\n 'Shows full run details: jobs, steps, resolvedInputs, gate decisions, errors. ' +\n 'Without a run ID shows the latest run (like gh run view). ' +\n 'Use --log-failed to see only the logs from failed steps (fastest path to root cause). ' +\n 'Use --json=status,jobs for selective JSON output.',\n handler: './commands/runs-view.js#default',\n flags: defineCommandFlags(runsViewFlags),\n examples: [\n 'kb workflow runs view',\n 'kb workflow runs view <runId>',\n 'kb workflow runs view --run-id=<runId>',\n 'kb workflow runs view <runId> --log-failed',\n 'kb workflow runs view <runId> --log',\n 'kb workflow runs view <runId> --json=status,jobs',\n 'kb workflow runs view <runId> --json=all',\n ],\n },\n {\n path: 'workflow runs watch',\n category: 'Runs',\n operationType: 'execute' as const,\n describe: 'Stream workflow run events in real-time.',\n longDescription:\n 'Connects to the run event stream via SSE and prints events as they happen. ' +\n 'Without a run ID watches the latest run (like gh run watch). ' +\n 'Automatically exits when the run finishes.',\n handler: './commands/runs-watch.js#default',\n flags: defineCommandFlags(runsWatchFlags),\n examples: ['kb workflow runs watch', 'kb workflow runs watch <runId>', 'kb workflow runs watch --run-id=<runId>', 'kb workflow runs watch <runId> --json'],\n },\n {\n path: 'workflow runs rerun',\n category: 'Runs',\n operationType: 'mutate' as const,\n describe: 'Rerun a workflow run.',\n longDescription:\n 'Reruns a workflow by re-submitting it with the same inputs. ' +\n 'Use --failed-only to requeue only jobs that failed or were interrupted.',\n handler: './commands/runs-rerun.js#default',\n flags: defineCommandFlags(runsRerunFlags),\n examples: [\n 'kb workflow runs rerun <runId>',\n 'kb workflow runs rerun --run-id=<runId>',\n 'kb workflow runs rerun <runId> --failed-only',\n 'kb workflow runs rerun <runId> --json',\n ],\n },\n {\n path: 'workflow runs restart',\n category: 'Runs',\n operationType: 'mutate' as const,\n describe: 'Restart a run from a specific step.',\n longDescription:\n 'Restores the run from a snapshot and re-executes from the given step. ' +\n 'All preceding steps inherit their stored outputs without being re-run. ' +\n 'Omitting --from-step restarts from step 1 using the snapshot env.',\n handler: './commands/runs-restart.js#default',\n flags: defineCommandFlags(runsRestartFlags),\n examples: [\n 'kb workflow runs restart <runId>',\n 'kb workflow runs restart <runId> --from-step=<stepId>',\n 'kb workflow runs restart <runId> --from-step=<stepId> --json',\n ],\n },\n {\n path: 'workflow runs cancel',\n category: 'Runs',\n operationType: 'mutate' as const,\n describe: 'Cancel a workflow run.',\n longDescription:\n 'Cancels an active workflow run. If the run is not found or already finished, prints a clear error.',\n handler: './commands/runs-cancel.js#default',\n flags: defineCommandFlags(runsCancelFlags),\n examples: [\n 'kb workflow runs cancel <runId>',\n 'kb workflow runs cancel --run-id=<runId>',\n 'kb workflow runs cancel <runId> --json',\n ],\n },\n {\n path: 'workflow runs logs',\n category: 'Runs',\n operationType: 'read' as const,\n describe: 'Fetch logs for a workflow run.',\n longDescription:\n 'Fetches execution logs for a run. Use --log-failed to show only failed-step logs. ' +\n 'Use --step to filter to a specific step. Accepts a positional run ID or --run-id flag.',\n handler: './commands/runs-logs.js#default',\n flags: defineCommandFlags(runsLogsFlags),\n examples: [\n 'kb workflow runs logs <runId>',\n 'kb workflow runs logs <runId> --log-failed',\n 'kb workflow runs logs <runId> --step=build',\n 'kb workflow runs logs <runId> --json',\n ],\n },\n {\n path: 'workflow runs status',\n category: 'Runs',\n operationType: 'read' as const,\n describe: 'Show status summary for a workflow run.',\n longDescription:\n 'Displays the status of a run including jobs and steps. Accepts a positional run ID or --run-id flag.',\n handler: './commands/runs-status.js#default',\n flags: defineCommandFlags(runsStatusFlags),\n examples: [\n 'kb workflow runs status <runId>',\n 'kb workflow runs status --run-id=<runId>',\n 'kb workflow runs status <runId> --json',\n ],\n },\n {\n path: 'workflow runs approve',\n category: 'Runs',\n operationType: 'mutate' as const,\n describe: 'Approve or reject a pending approval step in a workflow run.',\n longDescription:\n 'Resolves a human-gate (approval) step that is waiting for a decision. ' +\n 'If the run has exactly one pending approval, it is resolved automatically. ' +\n 'If there are multiple, specify --job-id and --step-id to target the right one. ' +\n 'Use --action=reject to reject instead of approve (default: approve). ' +\n 'Use --comment to attach a note to the decision.',\n handler: './commands/runs-approve.js#default',\n flags: defineCommandFlags(runsApproveFlags),\n examples: [\n 'kb workflow runs approve <runId>',\n 'kb workflow runs approve <runId> --action=reject --comment=\"Needs rework\"',\n 'kb workflow runs approve <runId> --job-id=<jobId> --step-id=<stepId>',\n 'kb workflow runs approve <runId> --json',\n ],\n },\n {\n path: 'workflow run',\n category: 'Runs',\n operationType: 'execute' as const,\n describe: 'Run workflow by ID.',\n longDescription:\n 'Runs a workflow definition by workflow ID via /api/v1/workflows/:id/run endpoint. ' +\n 'Supports request-level target and isolation overrides.',\n handler: './commands/workflow-run.js#default',\n flags: defineCommandFlags(workflowRunFlags),\n examples: [\n 'kb workflow run --workflow-id=release-manager/create-release',\n 'kb workflow run --workflow-id=release-manager/create-release --isolation=strict --target-namespace=team-a/prod',\n 'kb workflow run --workflow-id=release-manager/create-release --target-environment-id=env-123 --json',\n ],\n },\n ],\n },\n\n // REST API routes (proxy to workflow daemon)\n rest: {\n basePath: WORKFLOW_BASE_PATH,\n routes: [\n // GET /stats - Dashboard statistics\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.STATS,\n handler: './rest/stats-handler.js#default',\n describe: 'Get dashboard statistics',\n output: {\n zod: '@kb-labs/workflow-contracts#DashboardStatsResponseSchema',\n },\n },\n // GET /workflows - List workflow definitions\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.WORKFLOWS,\n handler: './rest/workflows-list-handler.js#default',\n describe: 'List all workflow definitions',\n output: {\n zod: '@kb-labs/workflow-contracts#WorkflowListResponseSchema',\n },\n },\n // GET /workflows/:id - Get workflow detail\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.WORKFLOW_DETAIL,\n handler: './rest/workflow-detail-handler.js#default',\n describe: 'Get workflow definition details',\n output: {\n zod: '@kb-labs/workflow-contracts#WorkflowInfoSchema',\n },\n },\n // POST /workflows/:id/run - Run workflow\n {\n method: 'POST',\n path: WORKFLOW_ROUTES.WORKFLOW_RUN,\n handler: './rest/workflow-run-handler.js#default',\n describe: 'Run a workflow',\n input: {\n zod: '@kb-labs/workflow-contracts#WorkflowRunRequestSchema',\n },\n },\n // GET /workflows/:workflowId/runs - Get workflow run history\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.WORKFLOW_RUNS,\n handler: './rest/workflow-runs-handler.js#default',\n describe: 'Get workflow run history with pagination',\n output: {\n zod: '@kb-labs/workflow-contracts#WorkflowRunHistoryResponseSchema',\n },\n },\n // POST /workflows/runs/:runId/cancel - Cancel a workflow run\n {\n method: 'POST',\n path: WORKFLOW_ROUTES.WORKFLOW_RUN_CANCEL,\n handler: './rest/workflow-run-cancel-handler.js#default',\n describe: 'Cancel a running or queued workflow run',\n },\n // GET /runs - List all workflow runs\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.RUNS,\n handler: './rest/runs-list-handler.js#default',\n describe: 'List all workflow runs across all workflows',\n },\n // GET /runs/:runId - Get a specific workflow run\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.RUN_DETAIL,\n handler: './rest/run-detail-handler.js#default',\n describe: 'Get detailed information about a specific workflow run',\n },\n // GET /workflows/jobs - List jobs\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.JOBS,\n handler: './rest/jobs-list-handler.js#default',\n describe: 'List workflow jobs with optional filters',\n output: {\n zod: '@kb-labs/workflow-contracts#JobListResponseSchema',\n },\n },\n // GET /workflows/jobs/:jobId - Get job detail\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.JOB_DETAIL,\n handler: './rest/job-detail-handler.js#default',\n describe: 'Get detailed information about a specific job',\n output: {\n zod: '@kb-labs/workflow-contracts#JobStatusInfoSchema',\n },\n },\n // GET /workflows/jobs/:jobId/logs - Get job logs\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.JOB_LOGS,\n handler: './rest/job-logs-handler.js#default',\n describe: 'Get execution logs for a specific job',\n output: {\n zod: '@kb-labs/workflow-contracts#JobLogsResponseSchema',\n },\n },\n // GET /workflows/jobs/:jobId/steps - Get job steps\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.JOB_STEPS,\n handler: './rest/job-steps-handler.js#default',\n describe: 'Get execution steps and progress for a specific job',\n output: {\n zod: '@kb-labs/workflow-contracts#JobStepsResponseSchema',\n },\n },\n // POST /workflows/jobs/:jobId/cancel - Cancel job\n {\n method: 'POST',\n path: WORKFLOW_ROUTES.JOB_CANCEL,\n handler: './rest/job-cancel-handler.js#default',\n describe: 'Cancel a running or pending job',\n output: {\n zod: '@kb-labs/workflow-contracts#JobCancelResponseSchema',\n },\n },\n // GET /workflows/cron - List cron jobs\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.CRON,\n handler: './rest/cron-list-handler.js#default',\n describe: 'List all registered cron jobs',\n output: {\n zod: '@kb-labs/workflow-contracts#CronListResponseSchema',\n },\n },\n // GET /runs/:runId/pending-approvals - List pending approvals\n {\n method: 'GET',\n path: WORKFLOW_ROUTES.PENDING_APPROVALS,\n handler: './rest/pending-approvals-handler.js#default',\n describe: 'List steps waiting for approval in a workflow run',\n },\n // POST /runs/:runId/approve - Resolve approval\n {\n method: 'POST',\n path: WORKFLOW_ROUTES.RESOLVE_APPROVAL,\n handler: './rest/resolve-approval-handler.js#default',\n describe: 'Approve or reject a pending approval step',\n },\n ],\n },\n\n // WebSocket channels for real-time updates\n ws: {\n basePath: '/v1/ws/plugins/workflow',\n defaults: {\n timeoutMs: 600000, // 10 minutes\n maxMessageSize: 1048576, // 1MB\n auth: 'none',\n idleTimeoutMs: 300000, // 5 minutes\n },\n channels: [\n {\n path: '/logs/:runId',\n handler: './ws/logs-channel.js#default',\n description: 'Real-time job logs streaming',\n },\n {\n path: '/progress/:jobId',\n handler: './ws/progress-channel.js#default',\n description: 'Real-time job progress updates',\n },\n ],\n },\n\n // Studio V2 — Module Federation pages\n studio: {\n version: 2 as const,\n remoteName: 'workflowPlugin',\n pages: [\n {\n id: 'workflow.runs',\n title: 'Runs',\n icon: 'PlayCircleOutlined',\n route: '/p/workflows/runs',\n entry: './Runs',\n order: 2,\n },\n {\n id: 'workflow.run',\n title: 'Run Detail',\n icon: 'PlayCircleOutlined',\n route: '/p/workflows/runs/:runId',\n entry: './RunDetail',\n order: 3,\n },\n {\n id: 'workflow.defs',\n title: 'Definitions',\n icon: 'AppstoreOutlined',\n route: '/p/workflows/definitions',\n entry: './Definitions',\n order: 4,\n },\n {\n id: 'workflow.def',\n title: 'Definition Detail',\n icon: 'AppstoreOutlined',\n route: '/p/workflows/definitions/:workflowId',\n entry: './DefinitionDetail',\n order: 5,\n },\n {\n id: 'workflow.jobs',\n title: 'Jobs',\n icon: 'UnorderedListOutlined',\n route: '/p/workflows/jobs',\n entry: './Jobs',\n order: 6,\n },\n {\n id: 'workflow.crons',\n title: 'Crons',\n icon: 'ClockCircleOutlined',\n route: '/p/workflows/crons',\n entry: './Crons',\n order: 7,\n },\n ],\n menus: [\n {\n id: 'workflows',\n label: 'Workflows',\n icon: 'ThunderboltOutlined',\n target: 'workflow.runs',\n order: 10,\n },\n {\n id: 'workflows.runs',\n label: 'Runs',\n icon: 'PlayCircleOutlined',\n target: 'workflow.runs',\n parentId: 'workflows',\n order: 1,\n },\n {\n id: 'workflows.defs',\n label: 'Definitions',\n icon: 'AppstoreOutlined',\n target: 'workflow.defs',\n parentId: 'workflows',\n order: 2,\n },\n {\n id: 'workflows.jobs',\n label: 'Jobs',\n icon: 'UnorderedListOutlined',\n target: 'workflow.jobs',\n parentId: 'workflows',\n order: 3,\n },\n {\n id: 'workflows.crons',\n label: 'Crons',\n icon: 'ClockCircleOutlined',\n target: 'workflow.crons',\n parentId: 'workflows',\n order: 4,\n },\n ],\n },\n\n permissions: pluginPermissions,\n};\n"]}
|
package/dist/manifest.js
CHANGED
|
@@ -732,7 +732,7 @@ var manifest = {
|
|
|
732
732
|
},
|
|
733
733
|
channels: [
|
|
734
734
|
{
|
|
735
|
-
path: "/logs/:
|
|
735
|
+
path: "/logs/:runId",
|
|
736
736
|
handler: "./ws/logs-channel.js#default",
|
|
737
737
|
description: "Real-time job logs streaming"
|
|
738
738
|
},
|
|
@@ -748,14 +748,6 @@ var manifest = {
|
|
|
748
748
|
version: 2,
|
|
749
749
|
remoteName: "workflowPlugin",
|
|
750
750
|
pages: [
|
|
751
|
-
{
|
|
752
|
-
id: "workflow.dashboard",
|
|
753
|
-
title: "Dashboard",
|
|
754
|
-
icon: "DashboardOutlined",
|
|
755
|
-
route: "/p/workflows",
|
|
756
|
-
entry: "./Dashboard",
|
|
757
|
-
order: 1
|
|
758
|
-
},
|
|
759
751
|
{
|
|
760
752
|
id: "workflow.runs",
|
|
761
753
|
title: "Runs",
|
|
@@ -810,7 +802,7 @@ var manifest = {
|
|
|
810
802
|
id: "workflows",
|
|
811
803
|
label: "Workflows",
|
|
812
804
|
icon: "ThunderboltOutlined",
|
|
813
|
-
target: "workflow.
|
|
805
|
+
target: "workflow.runs",
|
|
814
806
|
order: 10
|
|
815
807
|
},
|
|
816
808
|
{
|