@lssm/example.agent-console 0.0.0-canary-20251210082611 → 0.0.0-canary-20251212004227

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.
@@ -2,7 +2,7 @@ $ bun build:bundle && bun build:types
2
2
  $ tsdown
3
3
  ℹ tsdown v0.17.0 powered by rolldown v1.0.0-beta.53
4
4
  ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/agent-console/tsdown.config.js
5
- ℹ entry: src/events.ts, src/feature.ts, src/index.ts, src/entities/agent.ts, src/entities/index.ts, src/entities/log.ts, src/entities/run.ts, src/entities/tool.ts, src/handlers/agent.handlers.ts, src/handlers/index.ts, src/handlers/mock-data.ts, src/handlers/run.handlers.ts, src/handlers/tool.handlers.ts, src/contracts/agent.ts, src/contracts/index.ts, src/contracts/run.ts, src/contracts/tool.ts, src/presentations/agent-list.ts, src/presentations/dashboard.ts, src/presentations/index.ts, src/presentations/run-list.ts, src/presentations/tool-registry.ts
5
+ ℹ entry: src/events.ts, src/feature.ts, src/index.ts, src/contracts/agent.ts, src/contracts/index.ts, src/contracts/run.ts, src/contracts/tool.ts, src/docs/agent-console.docblock.ts, src/docs/index.ts, src/entities/agent.ts, src/entities/index.ts, src/entities/log.ts, src/entities/run.ts, src/entities/tool.ts, src/handlers/agent.handlers.ts, src/handlers/index.ts, src/handlers/mock-data.ts, src/handlers/run.handlers.ts, src/handlers/tool.handlers.ts, src/presentations/agent-list.ts, src/presentations/dashboard.ts, src/presentations/index.ts, src/presentations/run-list.ts, src/presentations/tool-registry.ts
6
6
  ℹ target: esnext
7
7
  ℹ tsconfig: tsconfig.json
8
8
  ℹ Build start
@@ -11,8 +11,9 @@ $ tsdown
11
11
  ℹ dist/events.js  8.95 kB │ gzip: 1.37 kB
12
12
  ℹ dist/handlers/mock-data.js  8.88 kB │ gzip: 2.49 kB
13
13
  ℹ dist/contracts/tool.js  7.03 kB │ gzip: 1.66 kB
14
- ℹ dist/index.js  4.93 kB │ gzip: 1.27 kB
14
+ ℹ dist/index.js  4.95 kB │ gzip: 1.28 kB
15
15
  ℹ dist/entities/run.js  4.34 kB │ gzip: 1.35 kB
16
+ ℹ dist/docs/agent-console.docblock.js  3.37 kB │ gzip: 1.36 kB
16
17
  ℹ dist/entities/agent.js  2.85 kB │ gzip: 1.12 kB
17
18
  ℹ dist/feature.js  2.75 kB │ gzip: 0.60 kB
18
19
  ℹ dist/handlers/run.handlers.js  2.32 kB │ gzip: 1.00 kB
@@ -28,6 +29,7 @@ $ tsdown
28
29
  ℹ dist/presentations/index.js  0.65 kB │ gzip: 0.24 kB
29
30
  ℹ dist/entities/index.js  0.58 kB │ gzip: 0.24 kB
30
31
  ℹ dist/presentations/dashboard.js  0.44 kB │ gzip: 0.28 kB
31
- ℹ 22 files, total: 74.15 kB
32
- ✔ Build complete in 63ms
32
+ ℹ dist/docs/index.js  0.04 kB │ gzip: 0.06 kB
33
+ ℹ 24 files, total: 77.58 kB
34
+ ✔ Build complete in 62ms
33
35
  $ tsc --noEmit
package/CHANGELOG.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # @lssm/example.agent-console
2
2
 
3
- ## 0.0.0-canary-20251210082611
3
+ ## 0.0.0-canary-20251212004227
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 3086383: refactor: dependencies upgrade
8
8
  - Updated dependencies [3086383]
9
- - @lssm/lib.contracts@0.0.0-canary-20251210082611
10
- - @lssm/lib.schema@0.0.0-canary-20251210082611
11
- - @lssm/lib.jobs@0.0.0-canary-20251210082611
12
- - @lssm/lib.identity-rbac@0.0.0-canary-20251210082611
13
- - @lssm/module.audit-trail@0.0.0-canary-20251210082611
9
+ - @lssm/lib.contracts@0.0.0-canary-20251212004227
10
+ - @lssm/lib.schema@0.0.0-canary-20251212004227
11
+ - @lssm/lib.jobs@0.0.0-canary-20251212004227
12
+ - @lssm/lib.identity-rbac@0.0.0-canary-20251212004227
13
+ - @lssm/module.audit-trail@0.0.0-canary-20251212004227
package/README.md CHANGED
@@ -80,4 +80,4 @@ This example builds on the following cross-cutting modules:
80
80
 
81
81
  - `@lssm/lib.identity-rbac` - User and organization management
82
82
  - `@lssm/lib.jobs` - Async job processing for long-running agents
83
- - `@lssm/modules.audit-trail` - Audit logging for compliance
83
+ - `@lssm/module.audit-trail` - Audit logging for compliance
@@ -0,0 +1,49 @@
1
+ import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.examples.agent-console.goal`,title:`Agent Console — Goal`,summary:`AI agent ops console: tools, agents, runs, logs, and metrics.`,kind:`goal`,visibility:`public`,route:`/docs/examples/agent-console/goal`,tags:[`ai`,`agents`,`goal`],body:`## Why it matters
2
+ - Provides a regenerable agent operations surface with tool registry and run history.
3
+ - Prevents drift between tool schemas, agent configs, and execution logs.
4
+
5
+ ## Business/Product goal
6
+ - Safely manage tools/agents/runs with auditability and observability.
7
+ - Enable staged rollout of tools and metrics via feature flags.
8
+
9
+ ## Success criteria
10
+ - Tool/agent/run specs regenerate UI/API/events cleanly.
11
+ - Logs/metrics stay aligned and PII is scoped.`},{id:`docs.examples.agent-console.usage`,title:`Agent Console — Usage`,summary:`How to operate, extend, and regenerate the agent console safely.`,kind:`usage`,visibility:`public`,route:`/docs/examples/agent-console/usage`,tags:[`ai`,`agents`,`usage`],body:`## Setup
12
+ 1) Seed (if available) or create tools and agents; define run configs.
13
+ 2) Configure Notifications for run completion/failure; Audit for changes.
14
+
15
+ ## Extend & regenerate
16
+ 1) Adjust tool schemas (inputs/outputs), agent configs, run metrics in spec.
17
+ 2) Regenerate to sync UI/API/events/logs; mark PII paths for run payloads.
18
+ 3) Use Feature Flags to gate risky tools or execution policies.
19
+
20
+ ## Guardrails
21
+ - Emit events for run lifecycle; store logs with redaction where needed.
22
+ - Enforce tool input validation; avoid unsafe arbitrary code exec in handlers.
23
+ - Keep tenant/user scoping explicit for ops data.`},{id:`docs.examples.agent-console.reference`,title:`Agent Console — Reference`,summary:`Entities, contracts, events, and presentations for the agent console.`,kind:`reference`,visibility:`public`,route:`/docs/examples/agent-console`,tags:[`ai`,`agents`,`reference`],body:`## Entities
24
+ - Tool, Agent, AgentTool, Run, RunStep, RunLog, RunMetric.
25
+
26
+ ## Contracts
27
+ - tool/create, agent/create, agent/execute, run/get, run/logs, run/metrics.
28
+
29
+ ## Events
30
+ - tool.created, agent.created, run.started/completed/failed, tool.invoked.
31
+
32
+ ## Presentations
33
+ - Tool registry, agent list/detail, run list/detail, metrics dashboards.
34
+
35
+ ## Notes
36
+ - Keep tool schemas explicit; enforce validation in spec.
37
+ - Use Audit Trail for agent/run changes; Notifications for run outcomes.`},{id:`docs.examples.agent-console.constraints`,title:`Agent Console — Constraints & Safety`,summary:`Internal guardrails for tool/agent/run safety, PII, and regeneration.`,kind:`reference`,visibility:`internal`,route:`/docs/examples/agent-console/constraints`,tags:[`ai`,`agents`,`constraints`,`internal`],body:`## Constraints
38
+ - Tool schemas (inputs/outputs) must be explicit in spec; no arbitrary untyped payloads.
39
+ - Events to emit: tool.created, agent.created, run.started/completed/failed, tool.invoked.
40
+ - Regeneration must not loosen execution policies or logging without explicit spec diff.
41
+
42
+ ## Safety & PII
43
+ - Mark PII in run payloads/logs; redact in markdown/JSON targets.
44
+ - Avoid exposing raw tool outputs to MCP/web without policy checks.
45
+
46
+ ## Verification
47
+ - Add fixtures for tool schema changes and run lifecycle.
48
+ - Ensure Audit/Notifications remain wired for runs; metrics collection unchanged.
49
+ - Use Feature Flags to gate risky tools; default safe/off.`}]);
@@ -0,0 +1 @@
1
+ import"./agent-console.docblock.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{AgentCreatedEvent as e,AgentCreatedPayload as t,AgentToolAssignedEvent as n,AgentToolAssignedPayload as r,AgentToolRemovedEvent as i,AgentToolRemovedPayload as a,AgentUpdatedEvent as o,AgentUpdatedPayload as s,MessageGeneratedEvent as c,MessageGeneratedPayload as l,MessageTypeEnum as u,RunCancelledEvent as d,RunCancelledPayload as f,RunCompletedEvent as p,RunCompletedPayload as m,RunFailedEvent as h,RunFailedPayload as g,RunStartedEvent as _,RunStartedPayload as v,ToolCompletedEvent as y,ToolCompletedPayload as b,ToolCreatedEvent as x,ToolCreatedPayload as S,ToolInvokedEvent as C,ToolInvokedPayload as w,ToolStatusChangedEvent as T,ToolStatusChangedPayload as E,ToolUpdatedEvent as D,ToolUpdatedPayload as O}from"./events.js";import{AgentConsoleFeature as k}from"./feature.js";import{ToolCategoryEnum as A,ToolEntity as j,ToolStatusEnum as M}from"./entities/tool.js";import{AgentEntity as N,AgentStatusEnum as P,AgentToolEntity as F,ModelProviderEnum as I}from"./entities/agent.js";import{LogLevelEnum as L,RunEntity as R,RunLogEntity as z,RunStatusEnum as B,RunStepEntity as V,RunStepTypeEnum as H}from"./entities/run.js";import"./entities/index.js";import{CreateToolCommand as U,GetToolQuery as W,ListToolsQuery as G,TestToolCommand as K,UpdateToolCommand as q}from"./contracts/tool.js";import{AssignToolToAgentCommand as J,CreateAgentCommand as Y,GetAgentQuery as X,ListAgentsQuery as Z,RemoveToolFromAgentCommand as Q,UpdateAgentCommand as $}from"./contracts/agent.js";import{CancelRunCommand as ee,ExecuteAgentCommand as te,GetRunLogsQuery as ne,GetRunMetricsQuery as re,GetRunQuery as ie,GetRunStepsQuery as ae,ListRunsQuery as oe}from"./contracts/run.js";import"./contracts/index.js";import{MOCK_AGENTS as se,MOCK_RUNS as ce,MOCK_RUN_LOGS as le,MOCK_RUN_STEPS as ue,MOCK_TOOLS as de}from"./handlers/mock-data.js";import{mockCreateAgentHandler as fe,mockGetAgentHandler as pe,mockListAgentsHandler as me,mockUpdateAgentHandler as he}from"./handlers/agent.handlers.js";import{mockCreateToolHandler as ge,mockGetToolHandler as _e,mockListToolsHandler as ve,mockTestToolHandler as ye}from"./handlers/tool.handlers.js";import{mockCancelRunHandler as be,mockExecuteAgentHandler as xe,mockGetRunHandler as Se,mockGetRunMetricsHandler as Ce,mockListRunsHandler as we}from"./handlers/run.handlers.js";import{AgentDetailPresentation as Te,AgentListPresentation as Ee}from"./presentations/agent-list.js";import{RunDetailPresentation as De,RunListPresentation as Oe,RunMetricsPresentation as ke}from"./presentations/run-list.js";import{ToolDetailPresentation as Ae,ToolRegistryPresentation as je}from"./presentations/tool-registry.js";import{AgentConsoleDashboardPresentation as Me}from"./presentations/dashboard.js";import{AgentConsolePresentations as Ne}from"./presentations/index.js";export{Me as AgentConsoleDashboardPresentation,k as AgentConsoleFeature,Ne as AgentConsolePresentations,e as AgentCreatedEvent,t as AgentCreatedPayload,Te as AgentDetailPresentation,N as AgentEntity,Ee as AgentListPresentation,P as AgentStatusEnum,n as AgentToolAssignedEvent,r as AgentToolAssignedPayload,F as AgentToolEntity,i as AgentToolRemovedEvent,a as AgentToolRemovedPayload,o as AgentUpdatedEvent,s as AgentUpdatedPayload,J as AssignToolToAgentCommand,ee as CancelRunCommand,Y as CreateAgentCommand,U as CreateToolCommand,te as ExecuteAgentCommand,X as GetAgentQuery,ne as GetRunLogsQuery,re as GetRunMetricsQuery,ie as GetRunQuery,ae as GetRunStepsQuery,W as GetToolQuery,Z as ListAgentsQuery,oe as ListRunsQuery,G as ListToolsQuery,L as LogLevelEnum,se as MOCK_AGENTS,ce as MOCK_RUNS,le as MOCK_RUN_LOGS,ue as MOCK_RUN_STEPS,de as MOCK_TOOLS,c as MessageGeneratedEvent,l as MessageGeneratedPayload,u as MessageTypeEnum,I as ModelProviderEnum,Q as RemoveToolFromAgentCommand,d as RunCancelledEvent,f as RunCancelledPayload,p as RunCompletedEvent,m as RunCompletedPayload,De as RunDetailPresentation,R as RunEntity,h as RunFailedEvent,g as RunFailedPayload,Oe as RunListPresentation,z as RunLogEntity,ke as RunMetricsPresentation,_ as RunStartedEvent,v as RunStartedPayload,B as RunStatusEnum,V as RunStepEntity,H as RunStepTypeEnum,K as TestToolCommand,A as ToolCategoryEnum,y as ToolCompletedEvent,b as ToolCompletedPayload,x as ToolCreatedEvent,S as ToolCreatedPayload,Ae as ToolDetailPresentation,j as ToolEntity,C as ToolInvokedEvent,w as ToolInvokedPayload,je as ToolRegistryPresentation,T as ToolStatusChangedEvent,E as ToolStatusChangedPayload,M as ToolStatusEnum,D as ToolUpdatedEvent,O as ToolUpdatedPayload,$ as UpdateAgentCommand,q as UpdateToolCommand,be as mockCancelRunHandler,fe as mockCreateAgentHandler,ge as mockCreateToolHandler,xe as mockExecuteAgentHandler,pe as mockGetAgentHandler,Se as mockGetRunHandler,Ce as mockGetRunMetricsHandler,_e as mockGetToolHandler,me as mockListAgentsHandler,we as mockListRunsHandler,ve as mockListToolsHandler,ye as mockTestToolHandler,he as mockUpdateAgentHandler};
1
+ import{AgentCreatedEvent as e,AgentCreatedPayload as t,AgentToolAssignedEvent as n,AgentToolAssignedPayload as r,AgentToolRemovedEvent as i,AgentToolRemovedPayload as a,AgentUpdatedEvent as o,AgentUpdatedPayload as s,MessageGeneratedEvent as c,MessageGeneratedPayload as l,MessageTypeEnum as u,RunCancelledEvent as d,RunCancelledPayload as f,RunCompletedEvent as p,RunCompletedPayload as m,RunFailedEvent as h,RunFailedPayload as g,RunStartedEvent as _,RunStartedPayload as v,ToolCompletedEvent as y,ToolCompletedPayload as b,ToolCreatedEvent as x,ToolCreatedPayload as S,ToolInvokedEvent as C,ToolInvokedPayload as w,ToolStatusChangedEvent as T,ToolStatusChangedPayload as E,ToolUpdatedEvent as D,ToolUpdatedPayload as O}from"./events.js";import{AgentConsoleFeature as k}from"./feature.js";import{ToolCategoryEnum as A,ToolEntity as j,ToolStatusEnum as M}from"./entities/tool.js";import{AgentEntity as N,AgentStatusEnum as P,AgentToolEntity as F,ModelProviderEnum as I}from"./entities/agent.js";import{LogLevelEnum as L,RunEntity as R,RunLogEntity as z,RunStatusEnum as B,RunStepEntity as V,RunStepTypeEnum as H}from"./entities/run.js";import"./entities/index.js";import{CreateToolCommand as U,GetToolQuery as W,ListToolsQuery as G,TestToolCommand as K,UpdateToolCommand as q}from"./contracts/tool.js";import{AssignToolToAgentCommand as J,CreateAgentCommand as Y,GetAgentQuery as X,ListAgentsQuery as Z,RemoveToolFromAgentCommand as Q,UpdateAgentCommand as $}from"./contracts/agent.js";import{CancelRunCommand as ee,ExecuteAgentCommand as te,GetRunLogsQuery as ne,GetRunMetricsQuery as re,GetRunQuery as ie,GetRunStepsQuery as ae,ListRunsQuery as oe}from"./contracts/run.js";import"./contracts/index.js";import{MOCK_AGENTS as se,MOCK_RUNS as ce,MOCK_RUN_LOGS as le,MOCK_RUN_STEPS as ue,MOCK_TOOLS as de}from"./handlers/mock-data.js";import{mockCreateAgentHandler as fe,mockGetAgentHandler as pe,mockListAgentsHandler as me,mockUpdateAgentHandler as he}from"./handlers/agent.handlers.js";import{mockCreateToolHandler as ge,mockGetToolHandler as _e,mockListToolsHandler as ve,mockTestToolHandler as ye}from"./handlers/tool.handlers.js";import{mockCancelRunHandler as be,mockExecuteAgentHandler as xe,mockGetRunHandler as Se,mockGetRunMetricsHandler as Ce,mockListRunsHandler as we}from"./handlers/run.handlers.js";import{AgentDetailPresentation as Te,AgentListPresentation as Ee}from"./presentations/agent-list.js";import{RunDetailPresentation as De,RunListPresentation as Oe,RunMetricsPresentation as ke}from"./presentations/run-list.js";import{ToolDetailPresentation as Ae,ToolRegistryPresentation as je}from"./presentations/tool-registry.js";import{AgentConsoleDashboardPresentation as Me}from"./presentations/dashboard.js";import{AgentConsolePresentations as Ne}from"./presentations/index.js";import"./docs/index.js";export{Me as AgentConsoleDashboardPresentation,k as AgentConsoleFeature,Ne as AgentConsolePresentations,e as AgentCreatedEvent,t as AgentCreatedPayload,Te as AgentDetailPresentation,N as AgentEntity,Ee as AgentListPresentation,P as AgentStatusEnum,n as AgentToolAssignedEvent,r as AgentToolAssignedPayload,F as AgentToolEntity,i as AgentToolRemovedEvent,a as AgentToolRemovedPayload,o as AgentUpdatedEvent,s as AgentUpdatedPayload,J as AssignToolToAgentCommand,ee as CancelRunCommand,Y as CreateAgentCommand,U as CreateToolCommand,te as ExecuteAgentCommand,X as GetAgentQuery,ne as GetRunLogsQuery,re as GetRunMetricsQuery,ie as GetRunQuery,ae as GetRunStepsQuery,W as GetToolQuery,Z as ListAgentsQuery,oe as ListRunsQuery,G as ListToolsQuery,L as LogLevelEnum,se as MOCK_AGENTS,ce as MOCK_RUNS,le as MOCK_RUN_LOGS,ue as MOCK_RUN_STEPS,de as MOCK_TOOLS,c as MessageGeneratedEvent,l as MessageGeneratedPayload,u as MessageTypeEnum,I as ModelProviderEnum,Q as RemoveToolFromAgentCommand,d as RunCancelledEvent,f as RunCancelledPayload,p as RunCompletedEvent,m as RunCompletedPayload,De as RunDetailPresentation,R as RunEntity,h as RunFailedEvent,g as RunFailedPayload,Oe as RunListPresentation,z as RunLogEntity,ke as RunMetricsPresentation,_ as RunStartedEvent,v as RunStartedPayload,B as RunStatusEnum,V as RunStepEntity,H as RunStepTypeEnum,K as TestToolCommand,A as ToolCategoryEnum,y as ToolCompletedEvent,b as ToolCompletedPayload,x as ToolCreatedEvent,S as ToolCreatedPayload,Ae as ToolDetailPresentation,j as ToolEntity,C as ToolInvokedEvent,w as ToolInvokedPayload,je as ToolRegistryPresentation,T as ToolStatusChangedEvent,E as ToolStatusChangedPayload,M as ToolStatusEnum,D as ToolUpdatedEvent,O as ToolUpdatedPayload,$ as UpdateAgentCommand,q as UpdateToolCommand,be as mockCancelRunHandler,fe as mockCreateAgentHandler,ge as mockCreateToolHandler,xe as mockExecuteAgentHandler,pe as mockGetAgentHandler,Se as mockGetRunHandler,Ce as mockGetRunMetricsHandler,_e as mockGetToolHandler,me as mockListAgentsHandler,we as mockListRunsHandler,ve as mockListToolsHandler,ye as mockTestToolHandler,he as mockUpdateAgentHandler};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/example.agent-console",
3
- "version": "0.0.0-canary-20251210082611",
3
+ "version": "0.0.0-canary-20251212004227",
4
4
  "description": "Agent Console example - AI agent orchestration with tools, runs, and logs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,6 +11,8 @@
11
11
  "./contracts/agent": "./src/contracts/agent.ts",
12
12
  "./contracts/run": "./src/contracts/run.ts",
13
13
  "./contracts/tool": "./src/contracts/tool.ts",
14
+ "./docs": "./src/docs/index.ts",
15
+ "./docs/agent-console.docblock": "./src/docs/agent-console.docblock.ts",
14
16
  "./entities": "./src/entities/index.ts",
15
17
  "./entities/agent": "./src/entities/agent.ts",
16
18
  "./entities/log": "./src/entities/log.ts",
@@ -63,6 +65,8 @@
63
65
  "./contracts/agent": "./dist/contracts/agent.js",
64
66
  "./contracts/run": "./dist/contracts/run.js",
65
67
  "./contracts/tool": "./dist/contracts/tool.js",
68
+ "./docs": "./dist/docs/index.js",
69
+ "./docs/agent-console.docblock": "./dist/docs/agent-console.docblock.js",
66
70
  "./entities": "./dist/entities/index.js",
67
71
  "./entities/agent": "./dist/entities/agent.js",
68
72
  "./entities/log": "./dist/entities/log.js",
@@ -0,0 +1,97 @@
1
+ import type { DocBlock } from '@lssm/lib.contracts/docs';
2
+ import { registerDocBlocks } from '@lssm/lib.contracts/docs';
3
+
4
+ const agentConsoleDocBlocks: DocBlock[] = [
5
+ {
6
+ id: 'docs.examples.agent-console.goal',
7
+ title: 'Agent Console — Goal',
8
+ summary: 'AI agent ops console: tools, agents, runs, logs, and metrics.',
9
+ kind: 'goal',
10
+ visibility: 'public',
11
+ route: '/docs/examples/agent-console/goal',
12
+ tags: ['ai', 'agents', 'goal'],
13
+ body: `## Why it matters
14
+ - Provides a regenerable agent operations surface with tool registry and run history.
15
+ - Prevents drift between tool schemas, agent configs, and execution logs.
16
+
17
+ ## Business/Product goal
18
+ - Safely manage tools/agents/runs with auditability and observability.
19
+ - Enable staged rollout of tools and metrics via feature flags.
20
+
21
+ ## Success criteria
22
+ - Tool/agent/run specs regenerate UI/API/events cleanly.
23
+ - Logs/metrics stay aligned and PII is scoped.`,
24
+ },
25
+ {
26
+ id: 'docs.examples.agent-console.usage',
27
+ title: 'Agent Console — Usage',
28
+ summary: 'How to operate, extend, and regenerate the agent console safely.',
29
+ kind: 'usage',
30
+ visibility: 'public',
31
+ route: '/docs/examples/agent-console/usage',
32
+ tags: ['ai', 'agents', 'usage'],
33
+ body: `## Setup
34
+ 1) Seed (if available) or create tools and agents; define run configs.
35
+ 2) Configure Notifications for run completion/failure; Audit for changes.
36
+
37
+ ## Extend & regenerate
38
+ 1) Adjust tool schemas (inputs/outputs), agent configs, run metrics in spec.
39
+ 2) Regenerate to sync UI/API/events/logs; mark PII paths for run payloads.
40
+ 3) Use Feature Flags to gate risky tools or execution policies.
41
+
42
+ ## Guardrails
43
+ - Emit events for run lifecycle; store logs with redaction where needed.
44
+ - Enforce tool input validation; avoid unsafe arbitrary code exec in handlers.
45
+ - Keep tenant/user scoping explicit for ops data.`,
46
+ },
47
+ {
48
+ id: 'docs.examples.agent-console.reference',
49
+ title: 'Agent Console — Reference',
50
+ summary:
51
+ 'Entities, contracts, events, and presentations for the agent console.',
52
+ kind: 'reference',
53
+ visibility: 'public',
54
+ route: '/docs/examples/agent-console',
55
+ tags: ['ai', 'agents', 'reference'],
56
+ body: `## Entities
57
+ - Tool, Agent, AgentTool, Run, RunStep, RunLog, RunMetric.
58
+
59
+ ## Contracts
60
+ - tool/create, agent/create, agent/execute, run/get, run/logs, run/metrics.
61
+
62
+ ## Events
63
+ - tool.created, agent.created, run.started/completed/failed, tool.invoked.
64
+
65
+ ## Presentations
66
+ - Tool registry, agent list/detail, run list/detail, metrics dashboards.
67
+
68
+ ## Notes
69
+ - Keep tool schemas explicit; enforce validation in spec.
70
+ - Use Audit Trail for agent/run changes; Notifications for run outcomes.`,
71
+ },
72
+ {
73
+ id: 'docs.examples.agent-console.constraints',
74
+ title: 'Agent Console — Constraints & Safety',
75
+ summary:
76
+ 'Internal guardrails for tool/agent/run safety, PII, and regeneration.',
77
+ kind: 'reference',
78
+ visibility: 'internal',
79
+ route: '/docs/examples/agent-console/constraints',
80
+ tags: ['ai', 'agents', 'constraints', 'internal'],
81
+ body: `## Constraints
82
+ - Tool schemas (inputs/outputs) must be explicit in spec; no arbitrary untyped payloads.
83
+ - Events to emit: tool.created, agent.created, run.started/completed/failed, tool.invoked.
84
+ - Regeneration must not loosen execution policies or logging without explicit spec diff.
85
+
86
+ ## Safety & PII
87
+ - Mark PII in run payloads/logs; redact in markdown/JSON targets.
88
+ - Avoid exposing raw tool outputs to MCP/web without policy checks.
89
+
90
+ ## Verification
91
+ - Add fixtures for tool schema changes and run lifecycle.
92
+ - Ensure Audit/Notifications remain wired for runs; metrics collection unchanged.
93
+ - Use Feature Flags to gate risky tools; default safe/off.`,
94
+ },
95
+ ];
96
+
97
+ registerDocBlocks(agentConsoleDocBlocks);
@@ -0,0 +1 @@
1
+ import './agent-console.docblock';
package/src/index.ts CHANGED
@@ -32,3 +32,4 @@ export * from './presentations';
32
32
 
33
33
  // Feature spec export
34
34
  export * from './feature';
35
+ import './docs';