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.

agent-console.agent.update

Updates an existing AI agent configuration.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @agent-console-team
  • Tags: agent, update
  • File: packages/examples/agent-console/src/agent/agent.operation.ts
  • field.key.label
    agent-console.agent.update
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    agent-console.agent.update
    field.description.label

    Updates an existing AI agent configuration.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @agent-console-team
  • Tags: agent, update
  • File: packages/examples/agent-console/src/agent/agent.operation.ts
  • field.tags.label
    agent,update
    field.owners.label
    @agent-console-team
    field.stability.label
    stable

    Updates an existing AI agent configuration.

    Goal

    Allow users to modify agent settings and configuration.

    Context

    Called from the agent settings UI.

    Source Definition

    import {
    	defineCommand,
    	defineQuery,
    } from '@lssm-tech/lib.contracts-spec/operations';
    import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
    import { AgentStatusEnum, ModelProviderEnum } from './agent.enum';
    import { AgentCreatedEvent } from './agent.event';
    import {
    	AgentSummaryModel,
    	AgentWithToolsModel,
    	CreateAgentInputModel,
    	UpdateAgentInputModel,
    } from './agent.schema';
    
    export const UpdateAgentCommand = defineCommand({
    	meta: {
    		key: 'agent-console.agent.update',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@agent-console-team'],
    		tags: ['agent', 'update'],
    		description: 'Updates an existing AI agent configuration.',
    		goal: 'Allow users to modify agent settings and configuration.',
    		context: 'Called from the agent settings UI.',
    	},
    	io: {
    		input: UpdateAgentInputModel,
    		output: defineSchemaModel({
    			name: 'UpdateAgentOutput',
    			fields: {
    				id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
    				name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
    				status: { type: AgentStatusEnum, isOptional: false },
    				updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
    			},
    		}),
    		errors: {
    			AGENT_NOT_FOUND: {
    				description: 'The specified agent does not exist',
    				http: 404,
    				gqlCode: 'AGENT_NOT_FOUND',
    				when: 'Agent ID is invalid',
    			},
    		},
    	},
    	policy: { auth: 'user' },
    	sideEffects: {
    		emits: [
    			{
    				key: 'agent.updated',
    				version: '1.0.0',
    				stability: 'stable',
    				owners: ['@agent-console-team'],
    				tags: ['agent', 'updated'],
    				when: 'Agent is updated',
    				payload: AgentSummaryModel,
    			},
    		],
    		audit: ['agent.updated'],
    	},
    	acceptance: {
    		scenarios: [
    			{
    				key: 'update-agent-happy-path',
    				given: ['Agent exists', 'User owns the agent'],
    				when: ['User submits updated configuration'],
    				then: ['Agent is updated', 'AgentUpdated event is emitted'],
    			},
    			{
    				key: 'update-agent-not-found',
    				given: ['Agent does not exist'],
    				when: ['User attempts to update'],
    				then: ['AGENT_NOT_FOUND error is returned'],
    			},
    		],
    		examples: [
    			{
    				key: 'update-name',
    				input: {
    					agentId: 'agent-123',
    					name: 'Updated Assistant',
    					systemPrompt: 'You are a helpful assistant.',
    				},
    				output: {
    					id: 'agent-123',
    					name: 'Updated Assistant',
    					status: 'draft',
    					updatedAt: '2025-01-01T00:00:00Z',
    				},
    			},
    		],
    	},
    });