@lssm/example.agent-console 0.0.0-canary-20251225052113 → 0.0.0-canary-20251225071908

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.
@@ -1 +1 @@
1
- {"version":3,"file":"agent.operation.js","names":[],"sources":["../../src/agent/agent.operation.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { AgentStatusEnum, ModelProviderEnum } from './agent.enum';\nimport {\n AgentSummaryModel,\n AgentWithToolsModel,\n CreateAgentInputModel,\n UpdateAgentInputModel,\n} from './agent.schema';\nimport { AgentCreatedEvent } from './agent.event';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * CreateAgentCommand - Creates a new agent configuration.\n */\nexport const CreateAgentCommand = defineCommand({\n meta: {\n key: 'agent-console.agent.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'create'],\n description: 'Creates a new AI agent configuration.',\n goal: 'Allow users to define new AI agents with specific models and tools.',\n context: 'Called from the agent builder UI when creating a new agent.',\n },\n io: {\n input: CreateAgentInputModel,\n output: defineSchemaModel({\n name: 'CreateAgentOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: AgentStatusEnum, isOptional: false },\n },\n }),\n errors: {\n SLUG_EXISTS: {\n description:\n 'An agent with this slug already exists in the organization',\n http: 409,\n gqlCode: 'SLUG_EXISTS',\n when: 'Slug is already taken',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n // name: 'agent.created',\n // version: 1,\n // payload: AgentSummaryModel,\n ref: AgentCreatedEvent.meta,\n when: 'Agent is successfully created',\n },\n ],\n audit: ['agent-console.agent.created'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'create-agent-happy-path',\n given: ['User is authenticated', 'Organization exists'],\n when: ['User submits valid agent configuration'],\n then: ['New agent is created with DRAFT status', 'AgentCreated event is emitted'],\n },\n {\n key: 'create-agent-slug-conflict',\n given: ['User is authenticated', 'Agent with same slug exists'],\n when: ['User submits agent with duplicate slug'],\n then: ['SLUG_EXISTS error is returned with 409 status'],\n },\n ],\n examples: [\n {\n key: 'basic-create',\n input: { name: 'Support Assistant', slug: 'support-assistant', modelProvider: 'openai', modelId: 'gpt-4' },\n output: { id: 'agent-123', name: 'Support Assistant', slug: 'support-assistant', status: 'draft' },\n },\n ],\n },\n});\n\n/**\n * UpdateAgentCommand - Updates an existing agent.\n */\nexport const UpdateAgentCommand = defineCommand({\n meta: {\n key: 'agent-console.agent.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'update'],\n description: 'Updates an existing AI agent configuration.',\n goal: 'Allow users to modify agent settings and configuration.',\n context: 'Called from the agent settings UI.',\n },\n io: {\n input: UpdateAgentInputModel,\n output: defineSchemaModel({\n name: 'UpdateAgentOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n status: { type: AgentStatusEnum, isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n }),\n errors: {\n AGENT_NOT_FOUND: {\n description: 'The specified agent does not exist',\n http: 404,\n gqlCode: 'AGENT_NOT_FOUND',\n when: 'Agent ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'agent.updated',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'updated'],\n when: 'Agent is updated',\n payload: AgentSummaryModel,\n },\n ],\n audit: ['agent.updated'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'update-agent-happy-path',\n given: ['Agent exists', 'User owns the agent'],\n when: ['User submits updated configuration'],\n then: ['Agent is updated', 'AgentUpdated event is emitted'],\n },\n {\n key: 'update-agent-not-found',\n given: ['Agent does not exist'],\n when: ['User attempts to update'],\n then: ['AGENT_NOT_FOUND error is returned'],\n },\n ],\n examples: [\n {\n key: 'update-name',\n input: { agentId: 'agent-123', name: 'Updated Assistant', systemPrompt: 'You are a helpful assistant.' },\n output: { id: 'agent-123', name: 'Updated Assistant', status: 'draft', updatedAt: '2025-01-01T00:00:00Z' },\n },\n ],\n },\n});\n\n/**\n * GetAgentQuery - Retrieves an agent by ID.\n */\nexport const GetAgentQuery = defineQuery({\n meta: {\n key: 'agent-console.agent.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'get'],\n description: 'Retrieves an agent by its ID.',\n goal: 'View detailed agent configuration.',\n context: 'Called when viewing agent details or editing.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n includeTools: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n }),\n output: AgentWithToolsModel,\n errors: {\n AGENT_NOT_FOUND: {\n description: 'The specified agent does not exist',\n http: 404,\n gqlCode: 'AGENT_NOT_FOUND',\n when: 'Agent ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-agent-happy-path',\n given: ['Agent exists'],\n when: ['User requests agent by ID'],\n then: ['Agent details are returned'],\n },\n {\n key: 'get-agent-with-tools',\n given: ['Agent exists with assigned tools'],\n when: ['User requests agent with includeTools=true'],\n then: ['Agent details with tools list are returned'],\n },\n ],\n examples: [\n {\n key: 'get-basic',\n input: { agentId: 'agent-123', includeTools: false },\n output: { id: 'agent-123', name: 'Support Assistant', status: 'active', tools: [] },\n },\n ],\n },\n});\n\n/**\n * ListAgentsQuery - Lists agents for an organization.\n */\nexport const ListAgentsQuery = defineQuery({\n meta: {\n key: 'agent-console.agent.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'list'],\n description: 'Lists agents for an organization with optional filtering.',\n goal: 'Browse and search available agents.',\n context: 'Agent list/dashboard view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListAgentsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n status: { type: AgentStatusEnum, isOptional: true },\n modelProvider: { type: ModelProviderEnum, isOptional: true },\n search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'ListAgentsOutput',\n fields: {\n items: { type: AgentSummaryModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'list-agents-happy-path',\n given: ['Organization has agents'],\n when: ['User lists agents'],\n then: ['Paginated list of agents is returned'],\n },\n {\n key: 'list-agents-filter-by-status',\n given: ['Organization has agents with mixed statuses'],\n when: ['User filters by status=active'],\n then: ['Only active agents are returned'],\n },\n ],\n examples: [\n {\n key: 'list-basic',\n input: { organizationId: 'org-123', limit: 10, offset: 0 },\n output: { items: [], total: 0, hasMore: false },\n },\n ],\n },\n});\n\n/**\n * AssignToolToAgentCommand - Assigns a tool to an agent.\n */\nexport const AssignToolToAgentCommand = defineCommand({\n meta: {\n key: 'agent-console.agent.assignTool',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'tool', 'assign'],\n description: 'Assigns a tool to an agent with optional configuration.',\n goal: 'Enable agents to use specific tools.',\n context: 'Agent configuration UI - tool selection.',\n },\n io: {\n input: defineSchemaModel({\n name: 'AssignToolToAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n config: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'AssignToolToAgentOutput',\n fields: {\n agentToolId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n errors: {\n TOOL_ALREADY_ASSIGNED: {\n description: 'This tool is already assigned to the agent',\n http: 409,\n gqlCode: 'TOOL_ALREADY_ASSIGNED',\n when: 'Tool assignment already exists',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['agent.tool.assigned'] },\n acceptance: {\n scenarios: [\n {\n key: 'assign-tool-happy-path',\n given: ['Agent exists', 'Tool exists and is not assigned'],\n when: ['User assigns tool to agent'],\n then: ['Tool is assigned', 'Assignment ID is returned'],\n },\n {\n key: 'assign-tool-already-assigned',\n given: ['Tool is already assigned to agent'],\n when: ['User attempts to assign again'],\n then: ['TOOL_ALREADY_ASSIGNED error is returned'],\n },\n ],\n examples: [\n {\n key: 'assign-basic',\n input: { agentId: 'agent-123', toolId: 'tool-456' },\n output: { agentToolId: 'at-789', agentId: 'agent-123', toolId: 'tool-456' },\n },\n ],\n },\n});\n\n/**\n * RemoveToolFromAgentCommand - Removes a tool from an agent.\n */\nexport const RemoveToolFromAgentCommand = defineCommand({\n meta: {\n key: 'agent-console.agent.removeTool',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'tool', 'remove'],\n description: 'Removes a tool assignment from an agent.',\n goal: 'Disable specific tools for an agent.',\n context: 'Agent configuration UI - tool management.',\n },\n io: {\n input: defineSchemaModel({\n name: 'RemoveToolFromAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'RemoveToolFromAgentOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['agent.tool.removed'] },\n acceptance: {\n scenarios: [\n {\n key: 'remove-tool-happy-path',\n given: ['Agent exists', 'Tool is assigned to agent'],\n when: ['User removes tool from agent'],\n then: ['Tool is unassigned', 'Success is returned'],\n },\n ],\n examples: [\n {\n key: 'remove-basic',\n input: { agentId: 'agent-123', toolId: 'tool-456' },\n output: { success: true },\n },\n ],\n },\n});\n"],"mappings":";;;;;;;AAWA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAa,qBAAqB,cAAc;CAC9C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,SAAS,SAAS;EACzB,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ,kBAAkB;GACxB,MAAM;GACN,QAAQ;IACN,IAAI;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAO;IACjE,MAAM;KAAE,MAAM,eAAe,gBAAgB;KAAE,YAAY;KAAO;IAClE,MAAM;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAO;IACnE,QAAQ;KAAE,MAAM;KAAiB,YAAY;KAAO;IACrD;GACF,CAAC;EACF,QAAQ,EACN,aAAa;GACX,aACE;GACF,MAAM;GACN,SAAS;GACT,MAAM;GACP,EACF;EACF;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa;EACX,OAAO,CACL;GAIE,KAAK,kBAAkB;GACvB,MAAM;GACP,CACF;EACD,OAAO,CAAC,8BAA8B;EACvC;CACD,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,yBAAyB,sBAAsB;GACvD,MAAM,CAAC,yCAA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;;;AAKF,MAAa,6BAA6B,cAAc;CACtD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAS;GAAQ;GAAS;EACjC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO,kBAAkB;GACvB,MAAM;GACN,QAAQ;IACN,SAAS;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAO;IACtE,QAAQ;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAO;IACtE;GACF,CAAC;EACF,QAAQ,kBAAkB;GACxB,MAAM;GACN,QAAQ,EACN,SAAS;IAAE,MAAM,eAAe,SAAS;IAAE,YAAY;IAAO,EAC/D;GACF,CAAC;EACH;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa,EAAE,OAAO,CAAC,qBAAqB,EAAE;CAC9C,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,gBAAgB,4BAA4B;GACpD,MAAM,CAAC,+BAA+B;GACtC,MAAM,CAAC,sBAAsB,sBAAsB;GACpD,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IAAE,SAAS;IAAa,QAAQ;IAAY;GACnD,QAAQ,EAAE,SAAS,MAAM;GAC1B,CACF;EACF;CACF,CAAC"}
1
+ {"version":3,"file":"agent.operation.js","names":[],"sources":["../../src/agent/agent.operation.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { AgentStatusEnum, ModelProviderEnum } from './agent.enum';\nimport {\n AgentSummaryModel,\n AgentWithToolsModel,\n CreateAgentInputModel,\n UpdateAgentInputModel,\n} from './agent.schema';\nimport { AgentCreatedEvent } from './agent.event';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * CreateAgentCommand - Creates a new agent configuration.\n */\nexport const CreateAgentCommand = defineCommand({\n meta: {\n key: 'agent-console.agent.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'create'],\n description: 'Creates a new AI agent configuration.',\n goal: 'Allow users to define new AI agents with specific models and tools.',\n context: 'Called from the agent builder UI when creating a new agent.',\n },\n io: {\n input: CreateAgentInputModel,\n output: defineSchemaModel({\n name: 'CreateAgentOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: AgentStatusEnum, isOptional: false },\n },\n }),\n errors: {\n SLUG_EXISTS: {\n description:\n 'An agent with this slug already exists in the organization',\n http: 409,\n gqlCode: 'SLUG_EXISTS',\n when: 'Slug is already taken',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n // name: 'agent.created',\n // version: 1,\n // payload: AgentSummaryModel,\n ref: AgentCreatedEvent.meta,\n when: 'Agent is successfully created',\n },\n ],\n audit: ['agent-console.agent.created'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'create-agent-happy-path',\n given: ['User is authenticated', 'Organization exists'],\n when: ['User submits valid agent configuration'],\n then: [\n 'New agent is created with DRAFT status',\n 'AgentCreated event is emitted',\n ],\n },\n {\n key: 'create-agent-slug-conflict',\n given: ['User is authenticated', 'Agent with same slug exists'],\n when: ['User submits agent with duplicate slug'],\n then: ['SLUG_EXISTS error is returned with 409 status'],\n },\n ],\n examples: [\n {\n key: 'basic-create',\n input: {\n name: 'Support Assistant',\n slug: 'support-assistant',\n modelProvider: 'openai',\n modelId: 'gpt-4',\n },\n output: {\n id: 'agent-123',\n name: 'Support Assistant',\n slug: 'support-assistant',\n status: 'draft',\n },\n },\n ],\n },\n});\n\n/**\n * UpdateAgentCommand - Updates an existing agent.\n */\nexport const UpdateAgentCommand = defineCommand({\n meta: {\n key: 'agent-console.agent.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'update'],\n description: 'Updates an existing AI agent configuration.',\n goal: 'Allow users to modify agent settings and configuration.',\n context: 'Called from the agent settings UI.',\n },\n io: {\n input: UpdateAgentInputModel,\n output: defineSchemaModel({\n name: 'UpdateAgentOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n status: { type: AgentStatusEnum, isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n }),\n errors: {\n AGENT_NOT_FOUND: {\n description: 'The specified agent does not exist',\n http: 404,\n gqlCode: 'AGENT_NOT_FOUND',\n when: 'Agent ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'agent.updated',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'updated'],\n when: 'Agent is updated',\n payload: AgentSummaryModel,\n },\n ],\n audit: ['agent.updated'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'update-agent-happy-path',\n given: ['Agent exists', 'User owns the agent'],\n when: ['User submits updated configuration'],\n then: ['Agent is updated', 'AgentUpdated event is emitted'],\n },\n {\n key: 'update-agent-not-found',\n given: ['Agent does not exist'],\n when: ['User attempts to update'],\n then: ['AGENT_NOT_FOUND error is returned'],\n },\n ],\n examples: [\n {\n key: 'update-name',\n input: {\n agentId: 'agent-123',\n name: 'Updated Assistant',\n systemPrompt: 'You are a helpful assistant.',\n },\n output: {\n id: 'agent-123',\n name: 'Updated Assistant',\n status: 'draft',\n updatedAt: '2025-01-01T00:00:00Z',\n },\n },\n ],\n },\n});\n\n/**\n * GetAgentQuery - Retrieves an agent by ID.\n */\nexport const GetAgentQuery = defineQuery({\n meta: {\n key: 'agent-console.agent.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'get'],\n description: 'Retrieves an agent by its ID.',\n goal: 'View detailed agent configuration.',\n context: 'Called when viewing agent details or editing.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n includeTools: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n }),\n output: AgentWithToolsModel,\n errors: {\n AGENT_NOT_FOUND: {\n description: 'The specified agent does not exist',\n http: 404,\n gqlCode: 'AGENT_NOT_FOUND',\n when: 'Agent ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-agent-happy-path',\n given: ['Agent exists'],\n when: ['User requests agent by ID'],\n then: ['Agent details are returned'],\n },\n {\n key: 'get-agent-with-tools',\n given: ['Agent exists with assigned tools'],\n when: ['User requests agent with includeTools=true'],\n then: ['Agent details with tools list are returned'],\n },\n ],\n examples: [\n {\n key: 'get-basic',\n input: { agentId: 'agent-123', includeTools: false },\n output: {\n id: 'agent-123',\n name: 'Support Assistant',\n status: 'active',\n tools: [],\n },\n },\n ],\n },\n});\n\n/**\n * ListAgentsQuery - Lists agents for an organization.\n */\nexport const ListAgentsQuery = defineQuery({\n meta: {\n key: 'agent-console.agent.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'list'],\n description: 'Lists agents for an organization with optional filtering.',\n goal: 'Browse and search available agents.',\n context: 'Agent list/dashboard view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListAgentsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n status: { type: AgentStatusEnum, isOptional: true },\n modelProvider: { type: ModelProviderEnum, isOptional: true },\n search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'ListAgentsOutput',\n fields: {\n items: { type: AgentSummaryModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'list-agents-happy-path',\n given: ['Organization has agents'],\n when: ['User lists agents'],\n then: ['Paginated list of agents is returned'],\n },\n {\n key: 'list-agents-filter-by-status',\n given: ['Organization has agents with mixed statuses'],\n when: ['User filters by status=active'],\n then: ['Only active agents are returned'],\n },\n ],\n examples: [\n {\n key: 'list-basic',\n input: { organizationId: 'org-123', limit: 10, offset: 0 },\n output: { items: [], total: 0, hasMore: false },\n },\n ],\n },\n});\n\n/**\n * AssignToolToAgentCommand - Assigns a tool to an agent.\n */\nexport const AssignToolToAgentCommand = defineCommand({\n meta: {\n key: 'agent-console.agent.assignTool',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'tool', 'assign'],\n description: 'Assigns a tool to an agent with optional configuration.',\n goal: 'Enable agents to use specific tools.',\n context: 'Agent configuration UI - tool selection.',\n },\n io: {\n input: defineSchemaModel({\n name: 'AssignToolToAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n config: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'AssignToolToAgentOutput',\n fields: {\n agentToolId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n errors: {\n TOOL_ALREADY_ASSIGNED: {\n description: 'This tool is already assigned to the agent',\n http: 409,\n gqlCode: 'TOOL_ALREADY_ASSIGNED',\n when: 'Tool assignment already exists',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['agent.tool.assigned'] },\n acceptance: {\n scenarios: [\n {\n key: 'assign-tool-happy-path',\n given: ['Agent exists', 'Tool exists and is not assigned'],\n when: ['User assigns tool to agent'],\n then: ['Tool is assigned', 'Assignment ID is returned'],\n },\n {\n key: 'assign-tool-already-assigned',\n given: ['Tool is already assigned to agent'],\n when: ['User attempts to assign again'],\n then: ['TOOL_ALREADY_ASSIGNED error is returned'],\n },\n ],\n examples: [\n {\n key: 'assign-basic',\n input: { agentId: 'agent-123', toolId: 'tool-456' },\n output: {\n agentToolId: 'at-789',\n agentId: 'agent-123',\n toolId: 'tool-456',\n },\n },\n ],\n },\n});\n\n/**\n * RemoveToolFromAgentCommand - Removes a tool from an agent.\n */\nexport const RemoveToolFromAgentCommand = defineCommand({\n meta: {\n key: 'agent-console.agent.removeTool',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'tool', 'remove'],\n description: 'Removes a tool assignment from an agent.',\n goal: 'Disable specific tools for an agent.',\n context: 'Agent configuration UI - tool management.',\n },\n io: {\n input: defineSchemaModel({\n name: 'RemoveToolFromAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'RemoveToolFromAgentOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['agent.tool.removed'] },\n acceptance: {\n scenarios: [\n {\n key: 'remove-tool-happy-path',\n given: ['Agent exists', 'Tool is assigned to agent'],\n when: ['User removes tool from agent'],\n then: ['Tool is unassigned', 'Success is returned'],\n },\n ],\n examples: [\n {\n key: 'remove-basic',\n input: { agentId: 'agent-123', toolId: 'tool-456' },\n output: { success: true },\n },\n ],\n },\n});\n"],"mappings":";;;;;;;AAWA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MA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