@lssm/example.agent-console 0.0.0-canary-20251225044228 → 0.0.0-canary-20251225070736

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.
@@ -97,6 +97,31 @@ const ExecuteAgentCommand = defineCommand({
97
97
  payload: RunSummaryModel
98
98
  }],
99
99
  audit: ["run.started"]
100
+ },
101
+ acceptance: {
102
+ scenarios: [{
103
+ key: "execute-agent-happy-path",
104
+ given: ["Agent exists", "Agent is active"],
105
+ when: ["User submits execution request"],
106
+ then: ["Run is created", "RunStarted event is emitted"]
107
+ }, {
108
+ key: "execute-agent-not-active",
109
+ given: ["Agent exists but is not active"],
110
+ when: ["User attempts to execute"],
111
+ then: ["AGENT_NOT_ACTIVE error is returned"]
112
+ }],
113
+ examples: [{
114
+ key: "basic-execute",
115
+ input: {
116
+ agentId: "agent-123",
117
+ input: { message: "Hello" }
118
+ },
119
+ output: {
120
+ runId: "run-456",
121
+ status: "pending",
122
+ estimatedWaitMs: 5e3
123
+ }
124
+ }]
100
125
  }
101
126
  });
102
127
  /**
@@ -167,6 +192,30 @@ const CancelRunCommand = defineCommand({
167
192
  payload: RunSummaryModel
168
193
  }],
169
194
  audit: ["run.cancelled"]
195
+ },
196
+ acceptance: {
197
+ scenarios: [{
198
+ key: "cancel-run-happy-path",
199
+ given: ["Run exists", "Run is in progress"],
200
+ when: ["User cancels run"],
201
+ then: ["Run is cancelled", "RunCancelled event is emitted"]
202
+ }, {
203
+ key: "cancel-run-already-completed",
204
+ given: ["Run exists but is already completed"],
205
+ when: ["User attempts to cancel"],
206
+ then: ["RUN_NOT_CANCELLABLE error is returned"]
207
+ }],
208
+ examples: [{
209
+ key: "cancel-basic",
210
+ input: {
211
+ runId: "run-456",
212
+ reason: "User requested"
213
+ },
214
+ output: {
215
+ success: true,
216
+ status: "cancelled"
217
+ }
218
+ }]
170
219
  }
171
220
  });
172
221
  /**
@@ -209,7 +258,28 @@ const GetRunQuery = defineQuery({
209
258
  when: "Run ID is invalid"
210
259
  } }
211
260
  },
212
- policy: { auth: "user" }
261
+ policy: { auth: "user" },
262
+ acceptance: {
263
+ scenarios: [{
264
+ key: "get-run-happy-path",
265
+ given: ["Run exists"],
266
+ when: ["User requests run by ID"],
267
+ then: ["Run details are returned"]
268
+ }],
269
+ examples: [{
270
+ key: "get-with-steps",
271
+ input: {
272
+ runId: "run-456",
273
+ includeSteps: true,
274
+ includeLogs: false
275
+ },
276
+ output: {
277
+ id: "run-456",
278
+ status: "completed",
279
+ steps: []
280
+ }
281
+ }]
282
+ }
213
283
  });
214
284
  /**
215
285
  * ListRunsQuery - Lists runs for an organization or agent.
@@ -288,7 +358,28 @@ const ListRunsQuery = defineQuery({
288
358
  }
289
359
  })
290
360
  },
291
- policy: { auth: "user" }
361
+ policy: { auth: "user" },
362
+ acceptance: {
363
+ scenarios: [{
364
+ key: "list-runs-happy-path",
365
+ given: ["Organization has runs"],
366
+ when: ["User lists runs"],
367
+ then: ["Paginated list of runs is returned"]
368
+ }],
369
+ examples: [{
370
+ key: "list-by-agent",
371
+ input: {
372
+ agentId: "agent-123",
373
+ limit: 20,
374
+ offset: 0
375
+ },
376
+ output: {
377
+ items: [],
378
+ total: 0,
379
+ hasMore: false
380
+ }
381
+ }]
382
+ }
292
383
  });
293
384
  /**
294
385
  * GetRunStepsQuery - Retrieves steps for a run.
@@ -321,7 +412,20 @@ const GetRunStepsQuery = defineQuery({
321
412
  } }
322
413
  })
323
414
  },
324
- policy: { auth: "user" }
415
+ policy: { auth: "user" },
416
+ acceptance: {
417
+ scenarios: [{
418
+ key: "get-run-steps-happy-path",
419
+ given: ["Run exists with steps"],
420
+ when: ["User requests steps"],
421
+ then: ["Steps list is returned"]
422
+ }],
423
+ examples: [{
424
+ key: "get-steps-basic",
425
+ input: { runId: "run-456" },
426
+ output: { steps: [] }
427
+ }]
428
+ }
325
429
  });
326
430
  /**
327
431
  * GetRunLogsQuery - Retrieves logs for a run.
@@ -384,7 +488,28 @@ const GetRunLogsQuery = defineQuery({
384
488
  }
385
489
  })
386
490
  },
387
- policy: { auth: "user" }
491
+ policy: { auth: "user" },
492
+ acceptance: {
493
+ scenarios: [{
494
+ key: "get-run-logs-happy-path",
495
+ given: ["Run exists with logs"],
496
+ when: ["User requests logs"],
497
+ then: ["Paginated logs list is returned"]
498
+ }],
499
+ examples: [{
500
+ key: "get-logs-filtered",
501
+ input: {
502
+ runId: "run-456",
503
+ level: "error",
504
+ limit: 50
505
+ },
506
+ output: {
507
+ items: [],
508
+ total: 0,
509
+ hasMore: false
510
+ }
511
+ }]
512
+ }
388
513
  });
389
514
  /**
390
515
  * GetRunMetricsQuery - Retrieves aggregated metrics for runs.
@@ -466,7 +591,34 @@ const GetRunMetricsQuery = defineQuery({
466
591
  }
467
592
  })
468
593
  },
469
- policy: { auth: "user" }
594
+ policy: { auth: "user" },
595
+ acceptance: {
596
+ scenarios: [{
597
+ key: "get-run-metrics-happy-path",
598
+ given: ["Organization has run history"],
599
+ when: ["User requests metrics for date range"],
600
+ then: ["Aggregated metrics are returned"]
601
+ }],
602
+ examples: [{
603
+ key: "get-daily-metrics",
604
+ input: {
605
+ organizationId: "org-123",
606
+ startDate: "2025-01-01",
607
+ endDate: "2025-01-31",
608
+ granularity: "day"
609
+ },
610
+ output: {
611
+ totalRuns: 100,
612
+ completedRuns: 90,
613
+ failedRuns: 10,
614
+ totalTokens: 5e4,
615
+ totalCostUsd: 5,
616
+ averageDurationMs: 2500,
617
+ successRate: .9,
618
+ timeline: []
619
+ }
620
+ }]
621
+ }
470
622
  });
471
623
 
472
624
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"run.operation.js","names":[],"sources":["../../src/run/run.operation.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { GranularityEnum, LogLevelEnum, RunStatusEnum } from './run.enum';\nimport {\n RunInputModel,\n RunLogModel,\n RunModel,\n RunStepModel,\n RunSummaryModel,\n TimelineDataPointModel,\n} from './run.schema';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * ExecuteAgentCommand - Starts a new agent run.\n */\nexport const ExecuteAgentCommand = defineCommand({\n meta: {\n key: 'agent.run.execute',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'execute'],\n description: 'Starts a new agent run with the given input.',\n goal: 'Execute an AI agent with user input.',\n context: 'Called from chat interface or API.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ExecuteAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n input: { type: RunInputModel, isOptional: false },\n sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n stream: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n maxIterations: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'ExecuteAgentOutput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: RunStatusEnum, isOptional: false },\n estimatedWaitMs: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\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 AGENT_NOT_ACTIVE: {\n description: 'The specified agent is not active',\n http: 400,\n gqlCode: 'AGENT_NOT_ACTIVE',\n when: 'Agent is in draft/paused/archived state',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'run.started',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'started'],\n when: 'Run is queued',\n payload: RunSummaryModel,\n },\n ],\n audit: ['run.started'],\n },\n});\n\n/**\n * CancelRunCommand - Cancels an in-progress run.\n */\nexport const CancelRunCommand = defineCommand({\n meta: {\n key: 'agent.run.cancel',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'cancel'],\n description: 'Cancels an in-progress agent run.',\n goal: 'Stop a running agent execution.',\n context: 'Called when user wants to abort a long-running task.',\n },\n io: {\n input: defineSchemaModel({\n name: 'CancelRunInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'CancelRunOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n status: { type: RunStatusEnum, isOptional: false },\n },\n }),\n errors: {\n RUN_NOT_FOUND: {\n description: 'The specified run does not exist',\n http: 404,\n gqlCode: 'RUN_NOT_FOUND',\n when: 'Run ID is invalid',\n },\n RUN_NOT_CANCELLABLE: {\n description: 'The run cannot be cancelled',\n http: 400,\n gqlCode: 'RUN_NOT_CANCELLABLE',\n when: 'Run is already completed/failed/cancelled',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'run.cancelled',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'cancelled'],\n when: 'Run is cancelled',\n payload: RunSummaryModel,\n },\n ],\n audit: ['run.cancelled'],\n },\n});\n\n/**\n * GetRunQuery - Retrieves a run by ID.\n */\nexport const GetRunQuery = defineQuery({\n meta: {\n key: 'agent.run.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'get'],\n description: 'Retrieves a run by its ID with optional details.',\n goal: 'View detailed run information.',\n context: 'Run details page or monitoring.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n includeSteps: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n includeLogs: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n }),\n output: RunModel,\n errors: {\n RUN_NOT_FOUND: {\n description: 'The specified run does not exist',\n http: 404,\n gqlCode: 'RUN_NOT_FOUND',\n when: 'Run ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n});\n\n/**\n * ListRunsQuery - Lists runs for an organization or agent.\n */\nexport const ListRunsQuery = defineQuery({\n meta: {\n key: 'agent.run.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'list'],\n description: 'Lists runs with optional filtering.',\n goal: 'Browse and search run history.',\n context: 'Run history/dashboard view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListRunsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: RunStatusEnum, isOptional: true },\n startDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n endDate: { type: ScalarTypeEnum.DateTime(), 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: 'ListRunsOutput',\n fields: {\n items: { type: RunSummaryModel, 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});\n\n/**\n * GetRunStepsQuery - Retrieves steps for a run.\n */\nexport const GetRunStepsQuery = defineQuery({\n meta: {\n key: 'agent.run.getSteps',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'steps'],\n description: 'Retrieves all steps for a specific run.',\n goal: 'View step-by-step execution details.',\n context: 'Run details page - steps tab.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunStepsInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'GetRunStepsOutput',\n fields: {\n steps: { type: RunStepModel, isArray: true, isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n});\n\n/**\n * GetRunLogsQuery - Retrieves logs for a run.\n */\nexport const GetRunLogsQuery = defineQuery({\n meta: {\n key: 'agent.run.getLogs',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'logs'],\n description: 'Retrieves all logs for a specific run.',\n goal: 'Debug and audit run execution.',\n context: 'Run details page - logs tab.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunLogsInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n level: { type: LogLevelEnum, isOptional: true },\n stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 100,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'GetRunLogsOutput',\n fields: {\n items: { type: RunLogModel, 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});\n\n/**\n * GetRunMetricsQuery - Retrieves aggregated metrics for runs.\n */\nexport const GetRunMetricsQuery = defineQuery({\n meta: {\n key: 'agent.run.getMetrics',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'metrics'],\n description: 'Retrieves aggregated metrics for runs within a time period.',\n goal: 'Monitor and analyze agent usage.',\n context: 'Analytics dashboard.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunMetricsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n startDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n endDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n granularity: {\n type: GranularityEnum,\n isOptional: true,\n defaultValue: 'day',\n },\n },\n }),\n output: defineSchemaModel({\n name: 'GetRunMetricsOutput',\n fields: {\n totalRuns: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n completedRuns: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n },\n failedRuns: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n totalCostUsd: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n averageDurationMs: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n successRate: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n timeline: {\n type: TimelineDataPointModel,\n isArray: true,\n isOptional: false,\n },\n },\n }),\n },\n policy: { auth: 'user' },\n});\n"],"mappings":";;;;;;AAYA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAa,sBAAsB,cAAc;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,OAAO,UAAU;EACxB,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,OAAO;KAAE,MAAM;KAAe,YAAY;KAAO;IACjD,WAAW;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAM;IACvE,UAAU;KAAE,MAAM,eAAe,YAAY;KAAE,YAAY;KAAM;IACjE,QAAQ;KAAE,MAAM,eAAe,SAAS;KAAE,YAAY;KAAM;IAC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GACF,CAAC;EACF,QAAQ,kBAAkB;GACxB,MAAM;GACN,QAAQ;IACN,WAAW;KAAE,MAAM,eAAe,cAAc;KAAE,YAAY;KAAO;IACrE,eAAe;KACb,MAAM,eAAe,cAAc;KACnC,YAAY;KACb;IACD,YAAY;KAAE,MAAM,eAAe,cAAc;KAAE,YAAY;KAAO;IACtE,aAAa;KAAE,MAAM,eAAe,cAAc;KAAE,YAAY;KAAO;IACvE,cAAc;KACZ,MAAM,eAAe,gBAAgB;KACrC,YAAY;KACb;IACD,mBAAmB;KACjB,MAAM,eAAe,gBAAgB;KACrC,YAAY;KACb;IACD,aAAa;KACX,MAAM,eAAe,gBAAgB;KACrC,YAAY;KACb;IACD,UAAU;KACR,MAAM;KACN,SAAS;KACT,YAAY;KACb;IACF;GACF,CAAC;EACH;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC"}
1
+ {"version":3,"file":"run.operation.js","names":[],"sources":["../../src/run/run.operation.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { GranularityEnum, LogLevelEnum, RunStatusEnum } from './run.enum';\nimport {\n RunInputModel,\n RunLogModel,\n RunModel,\n RunStepModel,\n RunSummaryModel,\n TimelineDataPointModel,\n} from './run.schema';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * ExecuteAgentCommand - Starts a new agent run.\n */\nexport const ExecuteAgentCommand = defineCommand({\n meta: {\n key: 'agent.run.execute',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'execute'],\n description: 'Starts a new agent run with the given input.',\n goal: 'Execute an AI agent with user input.',\n context: 'Called from chat interface or API.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ExecuteAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n input: { type: RunInputModel, isOptional: false },\n sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n stream: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n maxIterations: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'ExecuteAgentOutput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: RunStatusEnum, isOptional: false },\n estimatedWaitMs: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\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 AGENT_NOT_ACTIVE: {\n description: 'The specified agent is not active',\n http: 400,\n gqlCode: 'AGENT_NOT_ACTIVE',\n when: 'Agent is in draft/paused/archived state',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'run.started',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'started'],\n when: 'Run is queued',\n payload: RunSummaryModel,\n },\n ],\n audit: ['run.started'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'execute-agent-happy-path',\n given: ['Agent exists', 'Agent is active'],\n when: ['User submits execution request'],\n then: ['Run is created', 'RunStarted event is emitted'],\n },\n {\n key: 'execute-agent-not-active',\n given: ['Agent exists but is not active'],\n when: ['User attempts to execute'],\n then: ['AGENT_NOT_ACTIVE error is returned'],\n },\n ],\n examples: [\n {\n key: 'basic-execute',\n input: { agentId: 'agent-123', input: { message: 'Hello' } },\n output: { runId: 'run-456', status: 'pending', estimatedWaitMs: 5000 },\n },\n ],\n },\n});\n\n/**\n * CancelRunCommand - Cancels an in-progress run.\n */\nexport const CancelRunCommand = defineCommand({\n meta: {\n key: 'agent.run.cancel',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'cancel'],\n description: 'Cancels an in-progress agent run.',\n goal: 'Stop a running agent execution.',\n context: 'Called when user wants to abort a long-running task.',\n },\n io: {\n input: defineSchemaModel({\n name: 'CancelRunInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'CancelRunOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n status: { type: RunStatusEnum, isOptional: false },\n },\n }),\n errors: {\n RUN_NOT_FOUND: {\n description: 'The specified run does not exist',\n http: 404,\n gqlCode: 'RUN_NOT_FOUND',\n when: 'Run ID is invalid',\n },\n RUN_NOT_CANCELLABLE: {\n description: 'The run cannot be cancelled',\n http: 400,\n gqlCode: 'RUN_NOT_CANCELLABLE',\n when: 'Run is already completed/failed/cancelled',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'run.cancelled',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'cancelled'],\n when: 'Run is cancelled',\n payload: RunSummaryModel,\n },\n ],\n audit: ['run.cancelled'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'cancel-run-happy-path',\n given: ['Run exists', 'Run is in progress'],\n when: ['User cancels run'],\n then: ['Run is cancelled', 'RunCancelled event is emitted'],\n },\n {\n key: 'cancel-run-already-completed',\n given: ['Run exists but is already completed'],\n when: ['User attempts to cancel'],\n then: ['RUN_NOT_CANCELLABLE error is returned'],\n },\n ],\n examples: [\n {\n key: 'cancel-basic',\n input: { runId: 'run-456', reason: 'User requested' },\n output: { success: true, status: 'cancelled' },\n },\n ],\n },\n});\n\n/**\n * GetRunQuery - Retrieves a run by ID.\n */\nexport const GetRunQuery = defineQuery({\n meta: {\n key: 'agent.run.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'get'],\n description: 'Retrieves a run by its ID with optional details.',\n goal: 'View detailed run information.',\n context: 'Run details page or monitoring.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n includeSteps: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n includeLogs: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n }),\n output: RunModel,\n errors: {\n RUN_NOT_FOUND: {\n description: 'The specified run does not exist',\n http: 404,\n gqlCode: 'RUN_NOT_FOUND',\n when: 'Run ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-run-happy-path',\n given: ['Run exists'],\n when: ['User requests run by ID'],\n then: ['Run details are returned'],\n },\n ],\n examples: [\n {\n key: 'get-with-steps',\n input: { runId: 'run-456', includeSteps: true, includeLogs: false },\n output: { id: 'run-456', status: 'completed', steps: [] },\n },\n ],\n },\n});\n\n/**\n * ListRunsQuery - Lists runs for an organization or agent.\n */\nexport const ListRunsQuery = defineQuery({\n meta: {\n key: 'agent.run.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'list'],\n description: 'Lists runs with optional filtering.',\n goal: 'Browse and search run history.',\n context: 'Run history/dashboard view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListRunsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: RunStatusEnum, isOptional: true },\n startDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n endDate: { type: ScalarTypeEnum.DateTime(), 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: 'ListRunsOutput',\n fields: {\n items: { type: RunSummaryModel, 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-runs-happy-path',\n given: ['Organization has runs'],\n when: ['User lists runs'],\n then: ['Paginated list of runs is returned'],\n },\n ],\n examples: [\n {\n key: 'list-by-agent',\n input: { agentId: 'agent-123', limit: 20, offset: 0 },\n output: { items: [], total: 0, hasMore: false },\n },\n ],\n },\n});\n\n/**\n * GetRunStepsQuery - Retrieves steps for a run.\n */\nexport const GetRunStepsQuery = defineQuery({\n meta: {\n key: 'agent.run.getSteps',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'steps'],\n description: 'Retrieves all steps for a specific run.',\n goal: 'View step-by-step execution details.',\n context: 'Run details page - steps tab.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunStepsInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'GetRunStepsOutput',\n fields: {\n steps: { type: RunStepModel, isArray: true, isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-run-steps-happy-path',\n given: ['Run exists with steps'],\n when: ['User requests steps'],\n then: ['Steps list is returned'],\n },\n ],\n examples: [\n {\n key: 'get-steps-basic',\n input: { runId: 'run-456' },\n output: { steps: [] },\n },\n ],\n },\n});\n\n/**\n * GetRunLogsQuery - Retrieves logs for a run.\n */\nexport const GetRunLogsQuery = defineQuery({\n meta: {\n key: 'agent.run.getLogs',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'logs'],\n description: 'Retrieves all logs for a specific run.',\n goal: 'Debug and audit run execution.',\n context: 'Run details page - logs tab.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunLogsInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n level: { type: LogLevelEnum, isOptional: true },\n stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 100,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'GetRunLogsOutput',\n fields: {\n items: { type: RunLogModel, 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: 'get-run-logs-happy-path',\n given: ['Run exists with logs'],\n when: ['User requests logs'],\n then: ['Paginated logs list is returned'],\n },\n ],\n examples: [\n {\n key: 'get-logs-filtered',\n input: { runId: 'run-456', level: 'error', limit: 50 },\n output: { items: [], total: 0, hasMore: false },\n },\n ],\n },\n});\n\n/**\n * GetRunMetricsQuery - Retrieves aggregated metrics for runs.\n */\nexport const GetRunMetricsQuery = defineQuery({\n meta: {\n key: 'agent.run.getMetrics',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'metrics'],\n description: 'Retrieves aggregated metrics for runs within a time period.',\n goal: 'Monitor and analyze agent usage.',\n context: 'Analytics dashboard.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunMetricsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n startDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n endDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n granularity: {\n type: GranularityEnum,\n isOptional: true,\n defaultValue: 'day',\n },\n },\n }),\n output: defineSchemaModel({\n name: 'GetRunMetricsOutput',\n fields: {\n totalRuns: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n completedRuns: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n },\n failedRuns: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n totalCostUsd: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n averageDurationMs: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n successRate: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n timeline: {\n type: TimelineDataPointModel,\n isArray: true,\n isOptional: false,\n },\n },\n }),\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-run-metrics-happy-path',\n given: ['Organization has run history'],\n when: ['User requests metrics for date range'],\n then: ['Aggregated metrics are returned'],\n },\n ],\n examples: [\n {\n key: 'get-daily-metrics',\n input: {\n organizationId: 'org-123',\n startDate: '2025-01-01',\n endDate: '2025-01-31',\n granularity: 'day',\n },\n output: {\n totalRuns: 100,\n completedRuns: 90,\n failedRuns: 10,\n totalTokens: 50000,\n totalCostUsd: 5.0,\n averageDurationMs: 2500,\n successRate: 0.9,\n timeline: [],\n },\n },\n ],\n },\n});\n"],"mappings":";;;;;;AAYA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAa,sBAAsB,cAAc;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,OAAO,UAAU;EACxB,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,OAAO;KAAE,MAAM;KAAe,YAAY;KAAO;IACjD,WAAW;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAM;IACv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IACF;GACF,CAAC;EACH;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,+BAA+B;GACvC,MAAM,CAAC,uCAAuC;GAC9C,MAAM,CAAC,kCAAkC;GAC1C,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IACL,gBAAgB;IAChB,WAAW;IACX,SAAS;IACT,aAAa;IACd;GACD,QAAQ;IACN,WAAW;IACX,eAAe;IACf,YAAY;IACZ,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,aAAa;IACb,UAAU,EAAE;IACb;GACF,CACF;EACF;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tool.operation.d.ts","names":[],"sources":["../../src/tool/tool.operation.ts"],"sourcesContent":[],"mappings":";;;;;;;cAea,yCAAiB,kCAAA;EAAjB,cAAA,EAAA;IA8CX,IAAA,EAAA,mBAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;EA9C4B,gBAAA,EAAA;;;;;;;;;;;;;;;;EAAA,uBAAA,EAAA;IAmDjB,IAAA,+BA8CX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;;;;;;;UAjG4B,mBAAA,CAAA;;;;IAmDA,IAAA,+BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;EAAA,IAAA,EAAA,MAAA;EAmDjB,OAAA,iCA6BX,CAAA;IAAA,EAAA,EAAA;yCA7BuB,CAAA,MAAA,EAAA,MAAA,CAAA;MAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA,IAAA,+BAAA,KAAA,EAAA,MAAA,CAAA;MAkCZ,UA4CX,EAAA,KAAA;IAAA,CAAA;;;;;;cAjIW,iBAqFc,wBArFG,aAqFH,qBArFG,WAqFH,CAAA;EAAA,MAAA,EAAA;UAvCzB,mBAAA,CAA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+61,34 @@ const CreateToolCommand = defineCommand({
61
61
  payload: ToolSummaryModel
62
62
  }],
63
63
  audit: ["tool.created"]
64
+ },
65
+ acceptance: {
66
+ scenarios: [{
67
+ key: "create-tool-happy-path",
68
+ given: ["User is authenticated", "Organization exists"],
69
+ when: ["User submits valid tool configuration"],
70
+ then: ["New tool is created", "ToolCreated event is emitted"]
71
+ }, {
72
+ key: "create-tool-slug-conflict",
73
+ given: ["Tool with same slug exists"],
74
+ when: ["User submits tool with duplicate slug"],
75
+ then: ["SLUG_EXISTS error is returned"]
76
+ }],
77
+ examples: [{
78
+ key: "create-api-tool",
79
+ input: {
80
+ name: "Weather API",
81
+ slug: "weather-api",
82
+ category: "api",
83
+ description: "Fetches weather data"
84
+ },
85
+ output: {
86
+ id: "tool-123",
87
+ name: "Weather API",
88
+ slug: "weather-api",
89
+ status: "draft"
90
+ }
91
+ }]
64
92
  }
65
93
  });
66
94
  /**
@@ -119,6 +147,27 @@ const UpdateToolCommand = defineCommand({
119
147
  payload: ToolSummaryModel
120
148
  }],
121
149
  audit: ["tool.updated"]
150
+ },
151
+ acceptance: {
152
+ scenarios: [{
153
+ key: "update-tool-happy-path",
154
+ given: ["Tool exists", "User owns the tool"],
155
+ when: ["User submits updated configuration"],
156
+ then: ["Tool is updated", "ToolUpdated event is emitted"]
157
+ }],
158
+ examples: [{
159
+ key: "update-description",
160
+ input: {
161
+ toolId: "tool-123",
162
+ description: "Updated weather API tool"
163
+ },
164
+ output: {
165
+ id: "tool-123",
166
+ name: "Weather API",
167
+ status: "draft",
168
+ updatedAt: "2025-01-01T00:00:00Z"
169
+ }
170
+ }]
122
171
  }
123
172
  });
124
173
  /**
@@ -151,7 +200,25 @@ const GetToolQuery = defineQuery({
151
200
  when: "Tool ID is invalid"
152
201
  } }
153
202
  },
154
- policy: { auth: "user" }
203
+ policy: { auth: "user" },
204
+ acceptance: {
205
+ scenarios: [{
206
+ key: "get-tool-happy-path",
207
+ given: ["Tool exists"],
208
+ when: ["User requests tool by ID"],
209
+ then: ["Tool details are returned"]
210
+ }],
211
+ examples: [{
212
+ key: "get-basic",
213
+ input: { toolId: "tool-123" },
214
+ output: {
215
+ id: "tool-123",
216
+ name: "Weather API",
217
+ status: "active",
218
+ category: "api"
219
+ }
220
+ }]
221
+ }
155
222
  });
156
223
  /**
157
224
  * ListToolsQuery - Lists tools for an organization.
@@ -218,7 +285,28 @@ const ListToolsQuery = defineQuery({
218
285
  }
219
286
  })
220
287
  },
221
- policy: { auth: "user" }
288
+ policy: { auth: "user" },
289
+ acceptance: {
290
+ scenarios: [{
291
+ key: "list-tools-happy-path",
292
+ given: ["Organization has tools"],
293
+ when: ["User lists tools"],
294
+ then: ["Paginated list of tools is returned"]
295
+ }],
296
+ examples: [{
297
+ key: "list-by-category",
298
+ input: {
299
+ organizationId: "org-123",
300
+ category: "api",
301
+ limit: 10
302
+ },
303
+ output: {
304
+ items: [],
305
+ total: 0,
306
+ hasMore: false
307
+ }
308
+ }]
309
+ }
222
310
  });
223
311
  /**
224
312
  * TestToolCommand - Tests a tool with sample input.
@@ -285,7 +373,32 @@ const TestToolCommand = defineCommand({
285
373
  }
286
374
  },
287
375
  policy: { auth: "user" },
288
- sideEffects: { audit: ["tool.tested"] }
376
+ sideEffects: { audit: ["tool.tested"] },
377
+ acceptance: {
378
+ scenarios: [{
379
+ key: "test-tool-success",
380
+ given: ["Tool exists", "Tool is configured correctly"],
381
+ when: ["User runs test with valid input"],
382
+ then: ["Tool executes successfully", "Output is returned"]
383
+ }, {
384
+ key: "test-tool-failure",
385
+ given: ["Tool exists", "Tool has configuration error"],
386
+ when: ["User runs test"],
387
+ then: ["TOOL_EXECUTION_ERROR is returned"]
388
+ }],
389
+ examples: [{
390
+ key: "test-weather-api",
391
+ input: {
392
+ toolId: "tool-123",
393
+ testInput: { city: "Paris" }
394
+ },
395
+ output: {
396
+ success: true,
397
+ output: { temperature: 22 },
398
+ durationMs: 150
399
+ }
400
+ }]
401
+ }
289
402
  });
290
403
 
291
404
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"tool.operation.js","names":[],"sources":["../../src/tool/tool.operation.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { ToolCategoryEnum, ToolStatusEnum } from './tool.enum';\nimport {\n CreateToolInputModel,\n ToolModel,\n ToolSummaryModel,\n UpdateToolInputModel,\n} from './tool.schema';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * CreateToolCommand - Creates a new tool definition.\n */\nexport const CreateToolCommand = defineCommand({\n meta: {\n key: 'agent.tool.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'create'],\n description: 'Creates a new AI tool definition.',\n goal: 'Allow users to define new tools that agents can use.',\n context: 'Called from the tool builder UI when creating a new tool.',\n },\n io: {\n input: CreateToolInputModel,\n output: defineSchemaModel({\n name: 'CreateToolOutput',\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: ToolStatusEnum, isOptional: false },\n },\n }),\n errors: {\n SLUG_EXISTS: {\n description: 'A tool 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 key: 'tool.created',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'created'],\n when: 'Tool is successfully created',\n payload: ToolSummaryModel,\n },\n ],\n audit: ['tool.created'],\n },\n});\n\n/**\n * UpdateToolCommand - Updates an existing tool.\n */\nexport const UpdateToolCommand = defineCommand({\n meta: {\n key: 'agent.tool.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'update'],\n description: 'Updates an existing AI tool definition.',\n goal: 'Allow users to modify tool settings and configuration.',\n context: 'Called from the tool settings UI.',\n },\n io: {\n input: UpdateToolInputModel,\n output: defineSchemaModel({\n name: 'UpdateToolOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n status: { type: ToolStatusEnum, isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n }),\n errors: {\n TOOL_NOT_FOUND: {\n description: 'The specified tool does not exist',\n http: 404,\n gqlCode: 'TOOL_NOT_FOUND',\n when: 'Tool ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'tool.updated',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'updated'],\n when: 'Tool is updated',\n payload: ToolSummaryModel,\n },\n ],\n audit: ['tool.updated'],\n },\n});\n\n/**\n * GetToolQuery - Retrieves a tool by ID.\n */\nexport const GetToolQuery = defineQuery({\n meta: {\n key: 'agent.tool.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'get'],\n description: 'Retrieves a tool by its ID.',\n goal: 'View detailed tool configuration.',\n context: 'Called when viewing tool details or editing.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetToolInput',\n fields: {\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: ToolModel,\n errors: {\n TOOL_NOT_FOUND: {\n description: 'The specified tool does not exist',\n http: 404,\n gqlCode: 'TOOL_NOT_FOUND',\n when: 'Tool ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n});\n\n/**\n * ListToolsQuery - Lists tools for an organization.\n */\nexport const ListToolsQuery = defineQuery({\n meta: {\n key: 'agent.tool.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'list'],\n description: 'Lists tools for an organization with optional filtering.',\n goal: 'Browse and search available tools.',\n context: 'Tool list/dashboard view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListToolsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n category: { type: ToolCategoryEnum, isOptional: true },\n status: { type: ToolStatusEnum, 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: 'ListToolsOutput',\n fields: {\n items: { type: ToolSummaryModel, 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});\n\n/**\n * TestToolCommand - Tests a tool with sample input.\n */\nexport const TestToolCommand = defineCommand({\n meta: {\n key: 'agent.tool.test',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'test'],\n description: 'Tests a tool with sample input to verify it works correctly.',\n goal: 'Validate tool configuration before deployment.',\n context: 'Tool builder UI - test panel.',\n },\n io: {\n input: defineSchemaModel({\n name: 'TestToolInput',\n fields: {\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n testInput: { type: ScalarTypeEnum.JSONObject(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'TestToolOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n error: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n }),\n errors: {\n TOOL_NOT_FOUND: {\n description: 'The specified tool does not exist',\n http: 404,\n gqlCode: 'TOOL_NOT_FOUND',\n when: 'Tool ID is invalid',\n },\n TOOL_EXECUTION_ERROR: {\n description: 'Tool execution failed',\n http: 500,\n gqlCode: 'TOOL_EXECUTION_ERROR',\n when: 'Tool returns an error',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['tool.tested'] },\n});\n"],"mappings":";;;;;;AAUA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAa,oBAAoB,cAAc;CAC7C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,QAAQ,SAAS;EACxB,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;KAAgB,YAAY;KAAO;IACpD;GACF,CAAC;EACF,QAAQ,EACN,aAAa;GACX,aAAa;GACb,MAAM;GACN,SAAS;GACT,MAAM;GACP,EACF;EACF;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa;EACX,OAAO,CACL;GACE,KAAK;GACL,SAAS;GACT,WAAW;GACX,QAAQ,CAAC,GAAG,OAAO;GACnB,MAAM,CAAC,QAAQ,UAAU;GACzB,MAAM;GACN,SAAS;GACV,CACF;EACD,OAAO,CAAC,eAAe;EACxB;CACF,CAAC;;;;AAKF,MAAa,oBAAoB,cAAc;CAC7C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,QAAQ,SAAS;EACxB,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;K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AAS;IACT,MAAM;IACP;GACD,sBAAsB;IACpB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACF;EACF;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa,EAAE,OAAO,CAAC,cAAc,EAAE;CACxC,CAAC"}
1
+ {"version":3,"file":"tool.operation.js","names":[],"sources":["../../src/tool/tool.operation.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { ToolCategoryEnum, ToolStatusEnum } from './tool.enum';\nimport {\n CreateToolInputModel,\n ToolModel,\n ToolSummaryModel,\n UpdateToolInputModel,\n} from './tool.schema';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * CreateToolCommand - Creates a new tool definition.\n */\nexport const CreateToolCommand = defineCommand({\n meta: {\n key: 'agent.tool.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'create'],\n description: 'Creates a new AI tool definition.',\n goal: 'Allow users to define new tools that agents can use.',\n context: 'Called from the tool builder UI when creating a new tool.',\n },\n io: {\n input: CreateToolInputModel,\n output: defineSchemaModel({\n name: 'CreateToolOutput',\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: ToolStatusEnum, isOptional: false },\n },\n }),\n errors: {\n SLUG_EXISTS: {\n description: 'A tool 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 key: 'tool.created',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'created'],\n when: 'Tool is successfully created',\n payload: ToolSummaryModel,\n },\n ],\n audit: ['tool.created'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'create-tool-happy-path',\n given: ['User is authenticated', 'Organization exists'],\n when: ['User submits valid tool configuration'],\n then: ['New tool is created', 'ToolCreated event is emitted'],\n },\n {\n key: 'create-tool-slug-conflict',\n given: ['Tool with same slug exists'],\n when: ['User submits tool with duplicate slug'],\n then: ['SLUG_EXISTS error is returned'],\n },\n ],\n examples: [\n {\n key: 'create-api-tool',\n input: {\n name: 'Weather API',\n slug: 'weather-api',\n category: 'api',\n description: 'Fetches weather data',\n },\n output: {\n id: 'tool-123',\n name: 'Weather API',\n slug: 'weather-api',\n status: 'draft',\n },\n },\n ],\n },\n});\n\n/**\n * UpdateToolCommand - Updates an existing tool.\n */\nexport const UpdateToolCommand = defineCommand({\n meta: {\n key: 'agent.tool.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'update'],\n description: 'Updates an existing AI tool definition.',\n goal: 'Allow users to modify tool settings and configuration.',\n context: 'Called from the tool settings UI.',\n },\n io: {\n input: UpdateToolInputModel,\n output: defineSchemaModel({\n name: 'UpdateToolOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n status: { type: ToolStatusEnum, isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n }),\n errors: {\n TOOL_NOT_FOUND: {\n description: 'The specified tool does not exist',\n http: 404,\n gqlCode: 'TOOL_NOT_FOUND',\n when: 'Tool ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'tool.updated',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'updated'],\n when: 'Tool is updated',\n payload: ToolSummaryModel,\n },\n ],\n audit: ['tool.updated'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'update-tool-happy-path',\n given: ['Tool exists', 'User owns the tool'],\n when: ['User submits updated configuration'],\n then: ['Tool is updated', 'ToolUpdated event is emitted'],\n },\n ],\n examples: [\n {\n key: 'update-description',\n input: { toolId: 'tool-123', description: 'Updated weather API tool' },\n output: {\n id: 'tool-123',\n name: 'Weather API',\n status: 'draft',\n updatedAt: '2025-01-01T00:00:00Z',\n },\n },\n ],\n },\n});\n\n/**\n * GetToolQuery - Retrieves a tool by ID.\n */\nexport const GetToolQuery = defineQuery({\n meta: {\n key: 'agent.tool.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'get'],\n description: 'Retrieves a tool by its ID.',\n goal: 'View detailed tool configuration.',\n context: 'Called when viewing tool details or editing.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetToolInput',\n fields: {\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: ToolModel,\n errors: {\n TOOL_NOT_FOUND: {\n description: 'The specified tool does not exist',\n http: 404,\n gqlCode: 'TOOL_NOT_FOUND',\n when: 'Tool ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-tool-happy-path',\n given: ['Tool exists'],\n when: ['User requests tool by ID'],\n then: ['Tool details are returned'],\n },\n ],\n examples: [\n {\n key: 'get-basic',\n input: { toolId: 'tool-123' },\n output: {\n id: 'tool-123',\n name: 'Weather API',\n status: 'active',\n category: 'api',\n },\n },\n ],\n },\n});\n\n/**\n * ListToolsQuery - Lists tools for an organization.\n */\nexport const ListToolsQuery = defineQuery({\n meta: {\n key: 'agent.tool.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'list'],\n description: 'Lists tools for an organization with optional filtering.',\n goal: 'Browse and search available tools.',\n context: 'Tool list/dashboard view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListToolsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n category: { type: ToolCategoryEnum, isOptional: true },\n status: { type: ToolStatusEnum, 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: 'ListToolsOutput',\n fields: {\n items: { type: ToolSummaryModel, 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-tools-happy-path',\n given: ['Organization has tools'],\n when: ['User lists tools'],\n then: ['Paginated list of tools is returned'],\n },\n ],\n examples: [\n {\n key: 'list-by-category',\n input: { organizationId: 'org-123', category: 'api', limit: 10 },\n output: { items: [], total: 0, hasMore: false },\n },\n ],\n },\n});\n\n/**\n * TestToolCommand - Tests a tool with sample input.\n */\nexport const TestToolCommand = defineCommand({\n meta: {\n key: 'agent.tool.test',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'test'],\n description: 'Tests a tool with sample input to verify it works correctly.',\n goal: 'Validate tool configuration before deployment.',\n context: 'Tool builder UI - test panel.',\n },\n io: {\n input: defineSchemaModel({\n name: 'TestToolInput',\n fields: {\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n testInput: { type: ScalarTypeEnum.JSONObject(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'TestToolOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n error: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n }),\n errors: {\n TOOL_NOT_FOUND: {\n description: 'The specified tool does not exist',\n http: 404,\n gqlCode: 'TOOL_NOT_FOUND',\n when: 'Tool ID is invalid',\n },\n TOOL_EXECUTION_ERROR: {\n description: 'Tool execution failed',\n http: 500,\n gqlCode: 'TOOL_EXECUTION_ERROR',\n when: 'Tool returns an error',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['tool.tested'] },\n acceptance: {\n scenarios: [\n {\n key: 'test-tool-success',\n given: ['Tool exists', 'Tool is configured correctly'],\n when: ['User runs test with valid input'],\n then: ['Tool executes successfully', 'Output is returned'],\n },\n {\n key: 'test-tool-failure',\n given: ['Tool exists', 'Tool has configuration error'],\n when: ['User runs test'],\n then: ['TOOL_EXECUTION_ERROR is returned'],\n },\n ],\n examples: [\n {\n key: 'test-weather-api',\n input: { toolId: 'tool-123', testInput: { city: 'Paris' } },\n output: { success: true, output: { temperature: 22 }, durationMs: 150 },\n },\n ],\n },\n});\n"],"mappings":";;;;;;AAUA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAa,oBAAoB,cAAc;CAC7C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,QAAQ,SAAS;EACxB,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;KAAgB,YAAY;KAAO;IACpD;GACF,CAAC;EACF,QAAQ,EACN,aAAa;GACX,aAAa;GACb,MAAM;GACN,SAAS;GACT,MAAM;GACP,EACF;EACF;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa;EACX,OAAO,CACL;GACE,KAAK;GACL,SAAS;GACT,WAAW;GACX,QAAQ,CAAC,GAAG,OAAO;GACnB,MAAM,CAAC,QAAQ,UAAU;GACzB,MAAM;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;KAAE,YAAY;KAAO;IACpE;GACF,CAAC;EACF,QAAQ,kBAAkB;GACxB,MAAM;GACN,QAAQ;IACN,SAAS;KAAE,MAAM,eAAe,SAAS;KAAE,YAAY;KAAO;IAC9D,QAAQ;KAAE,MAAM,eAAe,YAAY;KAAE,YAAY;KAAM;IAC/D,OAAO;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAM;IACnE,YAAY;KAAE,MAAM,eAAe,cAAc;KAAE,YAAY;KAAO;IACvE;GACF,CAAC;EACF,QAAQ;GACN,gBAAgB;IACd,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,sBAAsB;IACpB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACF;EACF;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa,EAAE,OAAO,CAAC,cAAc,EAAE;CACvC,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,eAAe,+BAA+B;GACtD,MAAM,CAAC,kCAAkC;GACzC,MAAM,CAAC,8BAA8B,qBAAqB;GAC3D,EACD;GACE,KAAK;GACL,OAAO,CAAC,eAAe,+BAA+B;GACtD,MAAM,CAAC,iBAAiB;GACxB,MAAM,CAAC,mCAAmC;GAC3C,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IAAE,QAAQ;IAAY,WAAW,EAAE,MAAM,SAAS;IAAE;GAC3D,QAAQ;IAAE,SAAS;IAAM,QAAQ,EAAE,aAAa,IAAI;IAAE,YAAY;IAAK;GACxE,CACF;EACF;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/example.agent-console",
3
- "version": "0.0.0-canary-20251225044228",
3
+ "version": "0.0.0-canary-20251225070736",
4
4
  "description": "Agent Console example - AI agent orchestration with tools, runs, and logs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -57,17 +57,17 @@
57
57
  "test": "bun run"
58
58
  },
59
59
  "dependencies": {
60
- "@lssm/lib.schema": "0.0.0-canary-20251225044228",
61
- "@lssm/lib.contracts": "0.0.0-canary-20251225044228",
62
- "@lssm/lib.identity-rbac": "0.0.0-canary-20251225044228",
63
- "@lssm/module.audit-trail": "0.0.0-canary-20251225044228",
64
- "@lssm/lib.jobs": "0.0.0-canary-20251225044228",
60
+ "@lssm/lib.schema": "0.0.0-canary-20251225070736",
61
+ "@lssm/lib.contracts": "0.0.0-canary-20251225070736",
62
+ "@lssm/lib.identity-rbac": "0.0.0-canary-20251225070736",
63
+ "@lssm/module.audit-trail": "0.0.0-canary-20251225070736",
64
+ "@lssm/lib.jobs": "0.0.0-canary-20251225070736",
65
65
  "zod": "^4.1.13"
66
66
  },
67
67
  "devDependencies": {
68
- "@lssm/tool.tsdown": "0.0.0-canary-20251225044228",
69
- "@lssm/tool.typescript": "0.0.0-canary-20251225044228",
70
- "tsdown": "^0.18.1",
68
+ "@lssm/tool.tsdown": "0.0.0-canary-20251225070736",
69
+ "@lssm/tool.typescript": "0.0.0-canary-20251225070736",
70
+ "tsdown": "^0.18.3",
71
71
  "typescript": "^5.9.3"
72
72
  },
73
73
  "module": "./dist/index.js",