@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.
- package/.turbo/turbo-build.log +6 -4
- package/CHANGELOG.md +6 -6
- package/README.md +1 -1
- package/dist/docs/agent-console.docblock.js +49 -0
- package/dist/docs/index.js +1 -0
- package/dist/index.js +1 -1
- package/package.json +5 -1
- package/src/docs/agent-console.docblock.ts +97 -0
- package/src/docs/index.ts +1 -0
- package/src/index.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -2,7 +2,7 @@ $ bun build:bundle && bun build:types
|
|
|
2
2
|
$ tsdown
|
|
3
3
|
[34mℹ[39m tsdown [2mv0.17.0[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
4
4
|
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/agent-console/tsdown.config.js[24m
|
|
5
|
-
[34mℹ[39m entry: [34msrc/events.ts, src/feature.ts, src/index.ts, src/
|
|
5
|
+
[34mℹ[39m entry: [34msrc/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[39m
|
|
6
6
|
[34mℹ[39m target: [34mesnext[39m
|
|
7
7
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
8
|
[34mℹ[39m Build start
|
|
@@ -11,8 +11,9 @@ $ tsdown
|
|
|
11
11
|
[34mℹ[39m [2mdist/[22m[1mevents.js[22m [2m 8.95 kB[22m [2m│ gzip: 1.37 kB[22m
|
|
12
12
|
[34mℹ[39m [2mdist/[22m[1mhandlers/mock-data.js[22m [2m 8.88 kB[22m [2m│ gzip: 2.49 kB[22m
|
|
13
13
|
[34mℹ[39m [2mdist/[22m[1mcontracts/tool.js[22m [2m 7.03 kB[22m [2m│ gzip: 1.66 kB[22m
|
|
14
|
-
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m 4.
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m 4.95 kB[22m [2m│ gzip: 1.28 kB[22m
|
|
15
15
|
[34mℹ[39m [2mdist/[22m[1mentities/run.js[22m [2m 4.34 kB[22m [2m│ gzip: 1.35 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/agent-console.docblock.js[22m [2m 3.37 kB[22m [2m│ gzip: 1.36 kB[22m
|
|
16
17
|
[34mℹ[39m [2mdist/[22m[1mentities/agent.js[22m [2m 2.85 kB[22m [2m│ gzip: 1.12 kB[22m
|
|
17
18
|
[34mℹ[39m [2mdist/[22m[1mfeature.js[22m [2m 2.75 kB[22m [2m│ gzip: 0.60 kB[22m
|
|
18
19
|
[34mℹ[39m [2mdist/[22m[1mhandlers/run.handlers.js[22m [2m 2.32 kB[22m [2m│ gzip: 1.00 kB[22m
|
|
@@ -28,6 +29,7 @@ $ tsdown
|
|
|
28
29
|
[34mℹ[39m [2mdist/[22m[1mpresentations/index.js[22m [2m 0.65 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
29
30
|
[34mℹ[39m [2mdist/[22m[1mentities/index.js[22m [2m 0.58 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
30
31
|
[34mℹ[39m [2mdist/[22m[1mpresentations/dashboard.js[22m [2m 0.44 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
31
|
-
[34mℹ[39m
|
|
32
|
-
[
|
|
32
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m 0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
33
|
+
[34mℹ[39m 24 files, total: 77.58 kB
|
|
34
|
+
[32m✔[39m Build complete in [32m62ms[39m
|
|
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-
|
|
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-
|
|
10
|
-
- @lssm/lib.schema@0.0.0-canary-
|
|
11
|
-
- @lssm/lib.jobs@0.0.0-canary-
|
|
12
|
-
- @lssm/lib.identity-rbac@0.0.0-canary-
|
|
13
|
-
- @lssm/module.audit-trail@0.0.0-canary-
|
|
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/
|
|
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-
|
|
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