OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Lists runs with optional filtering.
Goal
Browse and search run history.
Context
Run history/dashboard view.
Source Definition
import {
defineCommand,
defineQuery,
} from '@lssm-tech/lib.contracts-spec/operations';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
import { GranularityEnum, LogLevelEnum, RunStatusEnum } from './run.enum';
import {
RunInputModel,
RunLogModel,
RunModel,
RunStepModel,
RunSummaryModel,
TimelineDataPointModel,
} from './run.schema';
export const ListRunsQuery = defineQuery({
meta: {
key: 'agent.run.list',
version: '1.0.0',
stability: 'stable',
owners: ['@agent-console-team'],
tags: ['run', 'list'],
description: 'Lists runs with optional filtering.',
goal: 'Browse and search run history.',
context: 'Run history/dashboard view.',
},
io: {
input: defineSchemaModel({
name: 'ListRunsInput',
fields: {
organizationId: {
type: ScalarTypeEnum.String_unsecure(),
isOptional: true,
},
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
status: { type: RunStatusEnum, isOptional: true },
startDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
endDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
limit: {
type: ScalarTypeEnum.Int_unsecure(),
isOptional: true,
defaultValue: 20,
},
offset: {
type: ScalarTypeEnum.Int_unsecure(),
isOptional: true,
defaultValue: 0,
},
},
}),
output: defineSchemaModel({
name: 'ListRunsOutput',
fields: {
items: { type: RunSummaryModel, isArray: true, isOptional: false },
total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false },
},
}),
},
policy: { auth: 'user' },
acceptance: {
scenarios: [
{
key: 'list-runs-happy-path',
given: ['Organization has runs'],
when: ['User lists runs'],
then: ['Paginated list of runs is returned'],
},
],
examples: [
{
key: 'list-by-agent',
input: { agentId: 'agent-123', limit: 20, offset: 0 },
output: { items: [], total: 0, hasMore: false },
},
],
},
});