@contractspec/example.agent-console 1.44.1 → 1.45.0

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.
Files changed (48) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +26 -26
  2. package/.turbo/turbo-build.log +34 -34
  3. package/CHANGELOG.md +29 -0
  4. package/dist/agent/agent.event.js +4 -4
  5. package/dist/agent/agent.event.js.map +1 -1
  6. package/dist/agent/agent.operation.d.ts +1 -1
  7. package/dist/agent/agent.operation.js +7 -7
  8. package/dist/agent/agent.operation.js.map +1 -1
  9. package/dist/agent/agent.presentation.js +3 -3
  10. package/dist/agent/agent.presentation.js.map +1 -1
  11. package/dist/agent.feature.js +60 -60
  12. package/dist/agent.feature.js.map +1 -1
  13. package/dist/example.d.ts +3 -36
  14. package/dist/example.d.ts.map +1 -1
  15. package/dist/example.js +16 -11
  16. package/dist/example.js.map +1 -1
  17. package/dist/run/run.entity.d.ts +56 -56
  18. package/dist/run/run.enum.d.ts +5 -5
  19. package/dist/run/run.event.d.ts +71 -71
  20. package/dist/run/run.event.js +7 -7
  21. package/dist/run/run.event.js.map +1 -1
  22. package/dist/run/run.operation.d.ts +177 -177
  23. package/dist/run/run.operation.js +9 -9
  24. package/dist/run/run.operation.js.map +1 -1
  25. package/dist/run/run.presentation.js +2 -2
  26. package/dist/run/run.presentation.js.map +1 -1
  27. package/dist/tool/tool.entity.d.ts +24 -24
  28. package/dist/tool/tool.enum.d.ts +4 -4
  29. package/dist/tool/tool.event.js +3 -3
  30. package/dist/tool/tool.event.js.map +1 -1
  31. package/dist/tool/tool.operation.d.ts +2 -2
  32. package/dist/tool/tool.operation.js +7 -7
  33. package/dist/tool/tool.operation.js.map +1 -1
  34. package/dist/tool/tool.presentation.js +2 -2
  35. package/dist/tool/tool.presentation.js.map +1 -1
  36. package/package.json +8 -8
  37. package/src/agent/agent.event.ts +4 -4
  38. package/src/agent/agent.operation.ts +8 -8
  39. package/src/agent/agent.presentation.ts +3 -3
  40. package/src/agent.feature.ts +60 -60
  41. package/src/example.ts +16 -9
  42. package/src/run/run.event.ts +7 -7
  43. package/src/run/run.operation.ts +9 -9
  44. package/src/run/run.presentation.ts +2 -2
  45. package/src/tool/tool.event.ts +3 -3
  46. package/src/tool/tool.operation.ts +7 -7
  47. package/src/tool/tool.presentation.ts +2 -2
  48. package/tsconfig.tsbuildinfo +1 -1
@@ -11,7 +11,7 @@ const OWNERS = ["@agent-console-team"];
11
11
  const ExecuteAgentCommand = defineCommand({
12
12
  meta: {
13
13
  key: "agent.run.execute",
14
- version: 1,
14
+ version: "1.0.0",
15
15
  stability: "stable",
16
16
  owners: [...OWNERS],
17
17
  tags: ["run", "execute"],
@@ -89,7 +89,7 @@ const ExecuteAgentCommand = defineCommand({
89
89
  sideEffects: {
90
90
  emits: [{
91
91
  key: "run.started",
92
- version: 1,
92
+ version: "1.0.0",
93
93
  stability: "stable",
94
94
  owners: [...OWNERS],
95
95
  tags: ["run", "started"],
@@ -130,7 +130,7 @@ const ExecuteAgentCommand = defineCommand({
130
130
  const CancelRunCommand = defineCommand({
131
131
  meta: {
132
132
  key: "agent.run.cancel",
133
- version: 1,
133
+ version: "1.0.0",
134
134
  stability: "stable",
135
135
  owners: [...OWNERS],
136
136
  tags: ["run", "cancel"],
@@ -184,7 +184,7 @@ const CancelRunCommand = defineCommand({
184
184
  sideEffects: {
185
185
  emits: [{
186
186
  key: "run.cancelled",
187
- version: 1,
187
+ version: "1.0.0",
188
188
  stability: "stable",
189
189
  owners: [...OWNERS],
190
190
  tags: ["run", "cancelled"],
@@ -224,7 +224,7 @@ const CancelRunCommand = defineCommand({
224
224
  const GetRunQuery = defineQuery({
225
225
  meta: {
226
226
  key: "agent.run.get",
227
- version: 1,
227
+ version: "1.0.0",
228
228
  stability: "stable",
229
229
  owners: [...OWNERS],
230
230
  tags: ["run", "get"],
@@ -287,7 +287,7 @@ const GetRunQuery = defineQuery({
287
287
  const ListRunsQuery = defineQuery({
288
288
  meta: {
289
289
  key: "agent.run.list",
290
- version: 1,
290
+ version: "1.0.0",
291
291
  stability: "stable",
292
292
  owners: [...OWNERS],
293
293
  tags: ["run", "list"],
@@ -387,7 +387,7 @@ const ListRunsQuery = defineQuery({
387
387
  const GetRunStepsQuery = defineQuery({
388
388
  meta: {
389
389
  key: "agent.run.getSteps",
390
- version: 1,
390
+ version: "1.0.0",
391
391
  stability: "stable",
392
392
  owners: [...OWNERS],
393
393
  tags: ["run", "steps"],
@@ -433,7 +433,7 @@ const GetRunStepsQuery = defineQuery({
433
433
  const GetRunLogsQuery = defineQuery({
434
434
  meta: {
435
435
  key: "agent.run.getLogs",
436
- version: 1,
436
+ version: "1.0.0",
437
437
  stability: "stable",
438
438
  owners: [...OWNERS],
439
439
  tags: ["run", "logs"],
@@ -517,7 +517,7 @@ const GetRunLogsQuery = defineQuery({
517
517
  const GetRunMetricsQuery = defineQuery({
518
518
  meta: {
519
519
  key: "agent.run.getMetrics",
520
- version: 1,
520
+ version: "1.0.0",
521
521
  stability: "stable",
522
522
  owners: [...OWNERS],
523
523
  tags: ["run", "metrics"],
@@ -1 +1 @@
1
- {"version":3,"file":"run.operation.js","names":[],"sources":["../../src/run/run.operation.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n} from '@contractspec/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@contractspec/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":";;;;;;AAeA,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,QA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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;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
+ {"version":3,"file":"run.operation.js","names":[],"sources":["../../src/run/run.operation.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n} from '@contractspec/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@contractspec/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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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":";;;;;;AAeA,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,M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AM,eAAe,gBAAgB;KACrC,YAAY;KACb;IACD,UAAU;KACR,MAAM;KACN,SAAS;KACT,YAAY;KACb;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"}
@@ -8,7 +8,7 @@ import { StabilityEnum } from "@contractspec/lib.contracts";
8
8
  const RunListPresentation = {
9
9
  meta: {
10
10
  key: "agent-console.run.list",
11
- version: 1,
11
+ version: "1.0.0",
12
12
  title: "Run List",
13
13
  description: "List view of agent runs with status, tokens, and duration info",
14
14
  goal: "Provide an overview of agent execution history and performance.",
@@ -41,7 +41,7 @@ const RunListPresentation = {
41
41
  const RunDetailPresentation = {
42
42
  meta: {
43
43
  key: "agent-console.run.detail",
44
- version: 1,
44
+ version: "1.0.0",
45
45
  title: "Run Details",
46
46
  description: "Detailed view of an agent run with steps, logs, and metrics",
47
47
  goal: "Allow users to inspect and debug a specific agent run.",
@@ -1 +1 @@
1
- {"version":3,"file":"run.presentation.js","names":["RunListPresentation: PresentationSpec","RunDetailPresentation: PresentationSpec"],"sources":["../../src/run/run.presentation.ts"],"sourcesContent":["import type { PresentationSpec } from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\nimport { RunSummaryModel } from './run.schema';\n\n/**\n * Presentation for displaying a list of agent runs.\n */\nexport const RunListPresentation: PresentationSpec = {\n meta: {\n key: 'agent-console.run.list',\n version: 1,\n title: 'Run List',\n description:\n 'List view of agent runs with status, tokens, and duration info',\n goal: 'Provide an overview of agent execution history and performance.',\n context: 'Run history dashboard.',\n domain: 'agent-console',\n owners: ['@agent-console-team'],\n tags: ['run', 'list', 'dashboard'],\n stability: StabilityEnum.Experimental,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'RunListView',\n props: RunSummaryModel,\n },\n targets: ['react', 'markdown', 'application/json'],\n policy: { flags: ['agent-console.enabled'] },\n};\n\n/**\n * Presentation for run detail view.\n */\nexport const RunDetailPresentation: PresentationSpec = {\n meta: {\n key: 'agent-console.run.detail',\n version: 1,\n title: 'Run Details',\n description: 'Detailed view of an agent run with steps, logs, and metrics',\n goal: 'Allow users to inspect and debug a specific agent run.',\n context: 'Detailed view of an agent run.',\n domain: 'agent-console',\n owners: ['@agent-console-team'],\n tags: ['run', 'detail'],\n stability: StabilityEnum.Experimental,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'RunDetailView',\n },\n targets: ['react', 'markdown'],\n policy: { flags: ['agent-console.enabled'] },\n};\n"],"mappings":";;;;;;;AAOA,MAAaA,sBAAwC;CACnD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,SAAS;EACT,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM;GAAC;GAAO;GAAQ;GAAY;EAClC,WAAW,cAAc;EAC1B;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS;EAAC;EAAS;EAAY;EAAmB;CAClD,QAAQ,EAAE,OAAO,CAAC,wBAAwB,EAAE;CAC7C;;;;AAKD,MAAaC,wBAA0C;CACrD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM,CAAC,OAAO,SAAS;EACvB,WAAW,cAAc;EAC1B;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EAAE,OAAO,CAAC,wBAAwB,EAAE;CAC7C"}
1
+ {"version":3,"file":"run.presentation.js","names":["RunListPresentation: PresentationSpec","RunDetailPresentation: PresentationSpec"],"sources":["../../src/run/run.presentation.ts"],"sourcesContent":["import type { PresentationSpec } from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\nimport { RunSummaryModel } from './run.schema';\n\n/**\n * Presentation for displaying a list of agent runs.\n */\nexport const RunListPresentation: PresentationSpec = {\n meta: {\n key: 'agent-console.run.list',\n version: '1.0.0',\n title: 'Run List',\n description:\n 'List view of agent runs with status, tokens, and duration info',\n goal: 'Provide an overview of agent execution history and performance.',\n context: 'Run history dashboard.',\n domain: 'agent-console',\n owners: ['@agent-console-team'],\n tags: ['run', 'list', 'dashboard'],\n stability: StabilityEnum.Experimental,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'RunListView',\n props: RunSummaryModel,\n },\n targets: ['react', 'markdown', 'application/json'],\n policy: { flags: ['agent-console.enabled'] },\n};\n\n/**\n * Presentation for run detail view.\n */\nexport const RunDetailPresentation: PresentationSpec = {\n meta: {\n key: 'agent-console.run.detail',\n version: '1.0.0',\n title: 'Run Details',\n description: 'Detailed view of an agent run with steps, logs, and metrics',\n goal: 'Allow users to inspect and debug a specific agent run.',\n context: 'Detailed view of an agent run.',\n domain: 'agent-console',\n owners: ['@agent-console-team'],\n tags: ['run', 'detail'],\n stability: StabilityEnum.Experimental,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'RunDetailView',\n },\n targets: ['react', 'markdown'],\n policy: { flags: ['agent-console.enabled'] },\n};\n"],"mappings":";;;;;;;AAOA,MAAaA,sBAAwC;CACnD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,SAAS;EACT,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM;GAAC;GAAO;GAAQ;GAAY;EAClC,WAAW,cAAc;EAC1B;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS;EAAC;EAAS;EAAY;EAAmB;CAClD,QAAQ,EAAE,OAAO,CAAC,wBAAwB,EAAE;CAC7C;;;;AAKD,MAAaC,wBAA0C;CACrD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM,CAAC,OAAO,SAAS;EACvB,WAAW,cAAc;EAC1B;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EAAE,OAAO,CAAC,wBAAwB,EAAE;CAC7C"}
@@ -1,41 +1,41 @@
1
- import * as _contractspec_lib_schema727 from "@contractspec/lib.schema";
1
+ import * as _contractspec_lib_schema724 from "@contractspec/lib.schema";
2
2
 
3
3
  //#region src/tool/tool.entity.d.ts
4
4
  /**
5
5
  * Tool category enum for entities.
6
6
  */
7
- declare const ToolCategoryEntityEnum: _contractspec_lib_schema727.EntityEnumDef;
7
+ declare const ToolCategoryEntityEnum: _contractspec_lib_schema724.EntityEnumDef;
8
8
  /**
9
9
  * Tool status enum for entities.
10
10
  */
11
- declare const ToolStatusEntityEnum: _contractspec_lib_schema727.EntityEnumDef;
11
+ declare const ToolStatusEntityEnum: _contractspec_lib_schema724.EntityEnumDef;
12
12
  /**
13
13
  * Implementation type enum for entities.
14
14
  */
15
- declare const ImplementationTypeEntityEnum: _contractspec_lib_schema727.EntityEnumDef;
15
+ declare const ImplementationTypeEntityEnum: _contractspec_lib_schema724.EntityEnumDef;
16
16
  /**
17
17
  * Tool entity - Represents an AI tool definition.
18
18
  */
19
- declare const ToolEntity: _contractspec_lib_schema727.EntitySpec<{
20
- id: _contractspec_lib_schema727.EntityScalarField;
21
- organizationId: _contractspec_lib_schema727.EntityScalarField;
22
- name: _contractspec_lib_schema727.EntityScalarField;
23
- slug: _contractspec_lib_schema727.EntityScalarField;
24
- description: _contractspec_lib_schema727.EntityScalarField;
25
- category: _contractspec_lib_schema727.EntityEnumField;
26
- status: _contractspec_lib_schema727.EntityEnumField;
27
- parametersSchema: _contractspec_lib_schema727.EntityScalarField;
28
- outputSchema: _contractspec_lib_schema727.EntityScalarField;
29
- implementationType: _contractspec_lib_schema727.EntityEnumField;
30
- implementationConfig: _contractspec_lib_schema727.EntityScalarField;
31
- maxInvocationsPerMinute: _contractspec_lib_schema727.EntityScalarField;
32
- timeoutMs: _contractspec_lib_schema727.EntityScalarField;
33
- version: _contractspec_lib_schema727.EntityScalarField;
34
- tags: _contractspec_lib_schema727.EntityScalarField;
35
- createdAt: _contractspec_lib_schema727.EntityScalarField;
36
- updatedAt: _contractspec_lib_schema727.EntityScalarField;
37
- createdById: _contractspec_lib_schema727.EntityScalarField;
38
- agents: _contractspec_lib_schema727.EntityRelationField;
19
+ declare const ToolEntity: _contractspec_lib_schema724.EntitySpec<{
20
+ id: _contractspec_lib_schema724.EntityScalarField;
21
+ organizationId: _contractspec_lib_schema724.EntityScalarField;
22
+ name: _contractspec_lib_schema724.EntityScalarField;
23
+ slug: _contractspec_lib_schema724.EntityScalarField;
24
+ description: _contractspec_lib_schema724.EntityScalarField;
25
+ category: _contractspec_lib_schema724.EntityEnumField;
26
+ status: _contractspec_lib_schema724.EntityEnumField;
27
+ parametersSchema: _contractspec_lib_schema724.EntityScalarField;
28
+ outputSchema: _contractspec_lib_schema724.EntityScalarField;
29
+ implementationType: _contractspec_lib_schema724.EntityEnumField;
30
+ implementationConfig: _contractspec_lib_schema724.EntityScalarField;
31
+ maxInvocationsPerMinute: _contractspec_lib_schema724.EntityScalarField;
32
+ timeoutMs: _contractspec_lib_schema724.EntityScalarField;
33
+ version: _contractspec_lib_schema724.EntityScalarField;
34
+ tags: _contractspec_lib_schema724.EntityScalarField;
35
+ createdAt: _contractspec_lib_schema724.EntityScalarField;
36
+ updatedAt: _contractspec_lib_schema724.EntityScalarField;
37
+ createdById: _contractspec_lib_schema724.EntityScalarField;
38
+ agents: _contractspec_lib_schema724.EntityRelationField;
39
39
  }>;
40
40
  //#endregion
41
41
  export { ImplementationTypeEntityEnum, ToolCategoryEntityEnum, ToolEntity, ToolStatusEntityEnum };
@@ -1,18 +1,18 @@
1
- import * as _contractspec_lib_schema724 from "@contractspec/lib.schema";
1
+ import * as _contractspec_lib_schema747 from "@contractspec/lib.schema";
2
2
 
3
3
  //#region src/tool/tool.enum.d.ts
4
4
  /**
5
5
  * Tool category enum.
6
6
  */
7
- declare const ToolCategoryEnum: _contractspec_lib_schema724.EnumType<[string, string, string, string, string, string]>;
7
+ declare const ToolCategoryEnum: _contractspec_lib_schema747.EnumType<[string, string, string, string, string, string]>;
8
8
  /**
9
9
  * Tool status enum.
10
10
  */
11
- declare const ToolStatusEnum: _contractspec_lib_schema724.EnumType<[string, string, string, string]>;
11
+ declare const ToolStatusEnum: _contractspec_lib_schema747.EnumType<[string, string, string, string]>;
12
12
  /**
13
13
  * Implementation type enum.
14
14
  */
15
- declare const ImplementationTypeEnum: _contractspec_lib_schema724.EnumType<[string, string, string]>;
15
+ declare const ImplementationTypeEnum: _contractspec_lib_schema747.EnumType<[string, string, string]>;
16
16
  //#endregion
17
17
  export { ImplementationTypeEnum, ToolCategoryEnum, ToolStatusEnum };
18
18
  //# sourceMappingURL=tool.enum.d.ts.map
@@ -50,7 +50,7 @@ const ToolCreatedPayload = defineSchemaModel$1({
50
50
  const ToolCreatedEvent = defineEvent({
51
51
  meta: {
52
52
  key: "agent.tool.created",
53
- version: 1,
53
+ version: "1.0.0",
54
54
  description: "A new AI tool was created.",
55
55
  stability: "stable",
56
56
  owners: [...OWNERS],
@@ -98,7 +98,7 @@ const ToolUpdatedPayload = defineSchemaModel$1({
98
98
  const ToolUpdatedEvent = defineEvent({
99
99
  meta: {
100
100
  key: "agent.tool.updated",
101
- version: 1,
101
+ version: "1.0.0",
102
102
  description: "An AI tool configuration was updated.",
103
103
  stability: "stable",
104
104
  owners: [...OWNERS],
@@ -145,7 +145,7 @@ const ToolStatusChangedPayload = defineSchemaModel$1({
145
145
  const ToolStatusChangedEvent = defineEvent({
146
146
  meta: {
147
147
  key: "agent.tool.statusChanged",
148
- version: 1,
148
+ version: "1.0.0",
149
149
  description: "An AI tool status was changed (activated, deprecated, disabled).",
150
150
  stability: "stable",
151
151
  owners: [...OWNERS],
@@ -1 +1 @@
1
- {"version":3,"file":"tool.event.js","names":["defineSchemaModel"],"sources":["../../src/tool/tool.event.ts"],"sourcesContent":["import { defineEvent, defineSchemaModel } from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum } from '@contractspec/lib.schema';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * Payload for tool created event.\n */\nconst ToolCreatedPayload = defineSchemaModel({\n name: 'ToolCreatedPayload',\n description: 'Payload for tool created event',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n implementationType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n createdById: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * ToolCreatedEvent - A new tool was created.\n */\nexport const ToolCreatedEvent = defineEvent({\n meta: {\n key: 'agent.tool.created',\n version: 1,\n description: 'A new AI tool was created.',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'created'],\n },\n payload: ToolCreatedPayload,\n});\n\n/**\n * Payload for tool updated event.\n */\nconst ToolUpdatedPayload = defineSchemaModel({\n name: 'ToolUpdatedPayload',\n description: 'Payload for tool updated event',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n updatedFields: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: false,\n },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * ToolUpdatedEvent - A tool was updated.\n */\nexport const ToolUpdatedEvent = defineEvent({\n meta: {\n key: 'agent.tool.updated',\n version: 1,\n description: 'An AI tool configuration was updated.',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'updated'],\n },\n payload: ToolUpdatedPayload,\n});\n\n/**\n * Payload for tool status changed event.\n */\nconst ToolStatusChangedPayload = defineSchemaModel({\n name: 'ToolStatusChangedPayload',\n description: 'Payload for tool status changed event',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n previousStatus: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * ToolStatusChangedEvent - A tool's status was changed.\n */\nexport const ToolStatusChangedEvent = defineEvent({\n meta: {\n key: 'agent.tool.statusChanged',\n version: 1,\n description:\n 'An AI tool status was changed (activated, deprecated, disabled).',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'status'],\n },\n payload: ToolStatusChangedPayload,\n});\n"],"mappings":";;;;AAGA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAM,qBAAqBA,oBAAkB;CAC3C,MAAM;CACN,aAAa;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;EAC1B;CACD,SAAS;CACV,CAAC;;;;AAKF,MAAM,2BAA2BA,oBAAkB;CACjD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,yBAAyB,YAAY;CAChD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aACE;EACF,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,QAAQ,SAAS;EACzB;CACD,SAAS;CACV,CAAC"}
1
+ {"version":3,"file":"tool.event.js","names":["defineSchemaModel"],"sources":["../../src/tool/tool.event.ts"],"sourcesContent":["import { defineEvent, defineSchemaModel } from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum } from '@contractspec/lib.schema';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * Payload for tool created event.\n */\nconst ToolCreatedPayload = defineSchemaModel({\n name: 'ToolCreatedPayload',\n description: 'Payload for tool created event',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n implementationType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n createdById: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * ToolCreatedEvent - A new tool was created.\n */\nexport const ToolCreatedEvent = defineEvent({\n meta: {\n key: 'agent.tool.created',\n version: '1.0.0',\n description: 'A new AI tool was created.',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'created'],\n },\n payload: ToolCreatedPayload,\n});\n\n/**\n * Payload for tool updated event.\n */\nconst ToolUpdatedPayload = defineSchemaModel({\n name: 'ToolUpdatedPayload',\n description: 'Payload for tool updated event',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n updatedFields: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: false,\n },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * ToolUpdatedEvent - A tool was updated.\n */\nexport const ToolUpdatedEvent = defineEvent({\n meta: {\n key: 'agent.tool.updated',\n version: '1.0.0',\n description: 'An AI tool configuration was updated.',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'updated'],\n },\n payload: ToolUpdatedPayload,\n});\n\n/**\n * Payload for tool status changed event.\n */\nconst ToolStatusChangedPayload = defineSchemaModel({\n name: 'ToolStatusChangedPayload',\n description: 'Payload for tool status changed event',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n previousStatus: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * ToolStatusChangedEvent - A tool's status was changed.\n */\nexport const ToolStatusChangedEvent = defineEvent({\n meta: {\n key: 'agent.tool.statusChanged',\n version: '1.0.0',\n description:\n 'An AI tool status was changed (activated, deprecated, disabled).',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['tool', 'status'],\n },\n payload: ToolStatusChangedPayload,\n});\n"],"mappings":";;;;AAGA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAM,qBAAqBA,oBAAkB;CAC3C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,oBAAoB;GAClB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,mBAAmB,YAAY;CAC1C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,QAAQ,UAAU;EAC1B;CACD,SAAS;CACV,CAAC;;;;AAKF,MAAM,qBAAqBA,oBAAkB;CAC3C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,SAAS;GACT,YAAY;GACb;EACD,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,mBAAmB,YAAY;CAC1C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,QAAQ,UAAU;EAC1B;CACD,SAAS;CACV,CAAC;;;;AAKF,MAAM,2BAA2BA,oBAAkB;CACjD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,yBAAyB,YAAY;CAChD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aACE;EACF,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,QAAQ,SAAS;EACzB;CACD,SAAS;CACV,CAAC"}
@@ -74,7 +74,7 @@ declare const CreateToolCommand: _contractspec_lib_contracts27.OperationSpec<_co
74
74
  };
75
75
  }>, {
76
76
  key: string;
77
- version: number;
77
+ version: string;
78
78
  stability: string;
79
79
  owners: "@agent-console-team"[];
80
80
  tags: string[];
@@ -178,7 +178,7 @@ declare const UpdateToolCommand: _contractspec_lib_contracts27.OperationSpec<_co
178
178
  };
179
179
  }>, {
180
180
  key: string;
181
- version: number;
181
+ version: string;
182
182
  stability: string;
183
183
  owners: "@agent-console-team"[];
184
184
  tags: string[];
@@ -11,7 +11,7 @@ const OWNERS = ["@agent-console-team"];
11
11
  const CreateToolCommand = defineCommand({
12
12
  meta: {
13
13
  key: "agent.tool.create",
14
- version: 1,
14
+ version: "1.0.0",
15
15
  stability: "stable",
16
16
  owners: [...OWNERS],
17
17
  tags: ["tool", "create"],
@@ -53,7 +53,7 @@ const CreateToolCommand = defineCommand({
53
53
  sideEffects: {
54
54
  emits: [{
55
55
  key: "tool.created",
56
- version: 1,
56
+ version: "1.0.0",
57
57
  stability: "stable",
58
58
  owners: [...OWNERS],
59
59
  tags: ["tool", "created"],
@@ -97,7 +97,7 @@ const CreateToolCommand = defineCommand({
97
97
  const UpdateToolCommand = defineCommand({
98
98
  meta: {
99
99
  key: "agent.tool.update",
100
- version: 1,
100
+ version: "1.0.0",
101
101
  stability: "stable",
102
102
  owners: [...OWNERS],
103
103
  tags: ["tool", "update"],
@@ -139,7 +139,7 @@ const UpdateToolCommand = defineCommand({
139
139
  sideEffects: {
140
140
  emits: [{
141
141
  key: "tool.updated",
142
- version: 1,
142
+ version: "1.0.0",
143
143
  stability: "stable",
144
144
  owners: [...OWNERS],
145
145
  tags: ["tool", "updated"],
@@ -176,7 +176,7 @@ const UpdateToolCommand = defineCommand({
176
176
  const GetToolQuery = defineQuery({
177
177
  meta: {
178
178
  key: "agent.tool.get",
179
- version: 1,
179
+ version: "1.0.0",
180
180
  stability: "stable",
181
181
  owners: [...OWNERS],
182
182
  tags: ["tool", "get"],
@@ -226,7 +226,7 @@ const GetToolQuery = defineQuery({
226
226
  const ListToolsQuery = defineQuery({
227
227
  meta: {
228
228
  key: "agent.tool.list",
229
- version: 1,
229
+ version: "1.0.0",
230
230
  stability: "stable",
231
231
  owners: [...OWNERS],
232
232
  tags: ["tool", "list"],
@@ -314,7 +314,7 @@ const ListToolsQuery = defineQuery({
314
314
  const TestToolCommand = defineCommand({
315
315
  meta: {
316
316
  key: "agent.tool.test",
317
- version: 1,
317
+ version: "1.0.0",
318
318
  stability: "stable",
319
319
  owners: [...OWNERS],
320
320
  tags: ["tool", "test"],
@@ -1 +1 @@
1
- {"version":3,"file":"tool.operation.js","names":[],"sources":["../../src/tool/tool.operation.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n} from '@contractspec/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@contractspec/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":";;;;;;AAaA,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;CACD,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,C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AAM,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"}
1
+ {"version":3,"file":"tool.operation.js","names":[],"sources":["../../src/tool/tool.operation.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n} from '@contractspec/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@contractspec/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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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":";;;;;;AAaA,M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,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"}
@@ -8,7 +8,7 @@ import { StabilityEnum } from "@contractspec/lib.contracts";
8
8
  const ToolListPresentation = {
9
9
  meta: {
10
10
  key: "agent-console.tool.list",
11
- version: 1,
11
+ version: "1.0.0",
12
12
  title: "Tool List",
13
13
  description: "List view of AI tools with category, status, and version info",
14
14
  goal: "Provide an overview of all available tools for agents.",
@@ -41,7 +41,7 @@ const ToolListPresentation = {
41
41
  const ToolDetailPresentation = {
42
42
  meta: {
43
43
  key: "agent-console.tool.detail",
44
- version: 1,
44
+ version: "1.0.0",
45
45
  title: "Tool Details",
46
46
  description: "Detailed view of an AI tool with configuration and test panel",
47
47
  goal: "Allow users to inspect and test a specific tool.",
@@ -1 +1 @@
1
- {"version":3,"file":"tool.presentation.js","names":["ToolListPresentation: PresentationSpec","ToolDetailPresentation: PresentationSpec"],"sources":["../../src/tool/tool.presentation.ts"],"sourcesContent":["import type { PresentationSpec } from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\nimport { ToolSummaryModel } from './tool.schema';\n\n/**\n * Presentation for displaying a list of tools.\n */\nexport const ToolListPresentation: PresentationSpec = {\n meta: {\n key: 'agent-console.tool.list',\n version: 1,\n title: 'Tool List',\n description:\n 'List view of AI tools with category, status, and version info',\n goal: 'Provide an overview of all available tools for agents.',\n context: 'Tool management dashboard.',\n domain: 'agent-console',\n owners: ['@agent-console-team'],\n tags: ['tool', 'list', 'dashboard'],\n stability: StabilityEnum.Experimental,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ToolListView',\n props: ToolSummaryModel,\n },\n targets: ['react', 'markdown', 'application/json'],\n policy: { flags: ['agent-console.enabled'] },\n};\n\n/**\n * Presentation for tool detail view.\n */\nexport const ToolDetailPresentation: PresentationSpec = {\n meta: {\n key: 'agent-console.tool.detail',\n version: 1,\n title: 'Tool Details',\n description:\n 'Detailed view of an AI tool with configuration and test panel',\n goal: 'Allow users to inspect and test a specific tool.',\n context: 'Detailed view of a tool.',\n domain: 'agent-console',\n owners: ['@agent-console-team'],\n tags: ['tool', 'detail'],\n stability: StabilityEnum.Experimental,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ToolDetailView',\n },\n targets: ['react', 'markdown'],\n policy: { flags: ['agent-console.enabled'] },\n};\n"],"mappings":";;;;;;;AAOA,MAAaA,uBAAyC;CACpD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,SAAS;EACT,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM;GAAC;GAAQ;GAAQ;GAAY;EACnC,WAAW,cAAc;EAC1B;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS;EAAC;EAAS;EAAY;EAAmB;CAClD,QAAQ,EAAE,OAAO,CAAC,wBAAwB,EAAE;CAC7C;;;;AAKD,MAAaC,yBAA2C;CACtD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,SAAS;EACT,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM,CAAC,QAAQ,SAAS;EACxB,WAAW,cAAc;EAC1B;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EAAE,OAAO,CAAC,wBAAwB,EAAE;CAC7C"}
1
+ {"version":3,"file":"tool.presentation.js","names":["ToolListPresentation: PresentationSpec","ToolDetailPresentation: PresentationSpec"],"sources":["../../src/tool/tool.presentation.ts"],"sourcesContent":["import type { PresentationSpec } from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\nimport { ToolSummaryModel } from './tool.schema';\n\n/**\n * Presentation for displaying a list of tools.\n */\nexport const ToolListPresentation: PresentationSpec = {\n meta: {\n key: 'agent-console.tool.list',\n version: '1.0.0',\n title: 'Tool List',\n description:\n 'List view of AI tools with category, status, and version info',\n goal: 'Provide an overview of all available tools for agents.',\n context: 'Tool management dashboard.',\n domain: 'agent-console',\n owners: ['@agent-console-team'],\n tags: ['tool', 'list', 'dashboard'],\n stability: StabilityEnum.Experimental,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ToolListView',\n props: ToolSummaryModel,\n },\n targets: ['react', 'markdown', 'application/json'],\n policy: { flags: ['agent-console.enabled'] },\n};\n\n/**\n * Presentation for tool detail view.\n */\nexport const ToolDetailPresentation: PresentationSpec = {\n meta: {\n key: 'agent-console.tool.detail',\n version: '1.0.0',\n title: 'Tool Details',\n description:\n 'Detailed view of an AI tool with configuration and test panel',\n goal: 'Allow users to inspect and test a specific tool.',\n context: 'Detailed view of a tool.',\n domain: 'agent-console',\n owners: ['@agent-console-team'],\n tags: ['tool', 'detail'],\n stability: StabilityEnum.Experimental,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ToolDetailView',\n },\n targets: ['react', 'markdown'],\n policy: { flags: ['agent-console.enabled'] },\n};\n"],"mappings":";;;;;;;AAOA,MAAaA,uBAAyC;CACpD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,SAAS;EACT,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM;GAAC;GAAQ;GAAQ;GAAY;EACnC,WAAW,cAAc;EAC1B;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS;EAAC;EAAS;EAAY;EAAmB;CAClD,QAAQ,EAAE,OAAO,CAAC,wBAAwB,EAAE;CAC7C;;;;AAKD,MAAaC,yBAA2C;CACtD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,SAAS;EACT,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM,CAAC,QAAQ,SAAS;EACxB,WAAW,cAAc;EAC1B;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EAAE,OAAO,CAAC,wBAAwB,EAAE;CAC7C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.agent-console",
3
- "version": "1.44.1",
3
+ "version": "1.45.0",
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,16 +57,16 @@
57
57
  "test": "bun run"
58
58
  },
59
59
  "dependencies": {
60
- "@contractspec/lib.schema": "1.44.1",
61
- "@contractspec/lib.contracts": "1.44.1",
62
- "@contractspec/lib.identity-rbac": "1.44.1",
63
- "@contractspec/module.audit-trail": "1.44.1",
64
- "@contractspec/lib.jobs": "1.44.1",
60
+ "@contractspec/lib.schema": "1.45.0",
61
+ "@contractspec/lib.contracts": "1.45.0",
62
+ "@contractspec/lib.identity-rbac": "1.45.0",
63
+ "@contractspec/module.audit-trail": "1.45.0",
64
+ "@contractspec/lib.jobs": "1.45.0",
65
65
  "zod": "^4.1.13"
66
66
  },
67
67
  "devDependencies": {
68
- "@contractspec/tool.tsdown": "1.44.1",
69
- "@contractspec/tool.typescript": "1.44.1",
68
+ "@contractspec/tool.tsdown": "1.45.0",
69
+ "@contractspec/tool.typescript": "1.45.0",
70
70
  "tsdown": "^0.18.3",
71
71
  "typescript": "^5.9.3"
72
72
  },