@contractspec/example.agent-console 3.7.5 → 3.7.7

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 (176) hide show
  1. package/.turbo/turbo-build.log +18 -18
  2. package/AGENTS.md +50 -31
  3. package/CHANGELOG.md +12 -0
  4. package/README.md +69 -77
  5. package/dist/agent/agent.event.js +1 -1
  6. package/dist/agent/agent.operation.js +1 -1
  7. package/dist/agent/index.d.ts +5 -5
  8. package/dist/agent/index.js +1 -1
  9. package/dist/browser/agent/agent.event.js +1 -1
  10. package/dist/browser/agent/agent.operation.js +1 -1
  11. package/dist/browser/agent/index.js +1 -1
  12. package/dist/browser/index.js +2145 -2145
  13. package/dist/browser/presentations/index.js +4 -4
  14. package/dist/browser/run/index.js +536 -536
  15. package/dist/browser/run/run.event.js +2 -2
  16. package/dist/browser/run/run.presentation.js +2 -2
  17. package/dist/browser/tool/index.js +260 -260
  18. package/dist/browser/tool/tool.event.js +1 -1
  19. package/dist/browser/tool/tool.presentation.js +2 -2
  20. package/dist/browser/ui/AgentDashboard.js +956 -956
  21. package/dist/browser/ui/AgentRunList.js +16 -16
  22. package/dist/browser/ui/AgentToolRegistry.js +9 -9
  23. package/dist/browser/ui/hooks/index.js +153 -153
  24. package/dist/browser/ui/hooks/useAgentList.js +1 -1
  25. package/dist/browser/ui/hooks/useAgentMutations.js +1 -1
  26. package/dist/browser/ui/hooks/useRunList.js +1 -1
  27. package/dist/browser/ui/hooks/useToolList.js +1 -1
  28. package/dist/browser/ui/index.js +1222 -1222
  29. package/dist/browser/ui/modals/AgentActionsModal.js +13 -13
  30. package/dist/browser/ui/modals/CreateAgentModal.js +15 -15
  31. package/dist/browser/ui/modals/index.js +297 -297
  32. package/dist/browser/ui/renderers/agent-list.renderer.js +7 -7
  33. package/dist/browser/ui/renderers/index.js +157 -157
  34. package/dist/browser/ui/views/AgentListView.js +7 -7
  35. package/dist/browser/ui/views/RunListView.js +16 -16
  36. package/dist/browser/ui/views/ToolRegistryView.js +9 -9
  37. package/dist/browser/ui/views/index.js +97 -97
  38. package/dist/handlers/index.d.ts +1 -1
  39. package/dist/index.d.ts +4 -4
  40. package/dist/index.js +2145 -2145
  41. package/dist/node/agent/agent.event.js +1 -1
  42. package/dist/node/agent/agent.operation.js +1 -1
  43. package/dist/node/agent/index.js +1 -1
  44. package/dist/node/index.js +2145 -2145
  45. package/dist/node/presentations/index.js +4 -4
  46. package/dist/node/run/index.js +536 -536
  47. package/dist/node/run/run.event.js +2 -2
  48. package/dist/node/run/run.presentation.js +2 -2
  49. package/dist/node/tool/index.js +260 -260
  50. package/dist/node/tool/tool.event.js +1 -1
  51. package/dist/node/tool/tool.presentation.js +2 -2
  52. package/dist/node/ui/AgentDashboard.js +956 -956
  53. package/dist/node/ui/AgentRunList.js +16 -16
  54. package/dist/node/ui/AgentToolRegistry.js +9 -9
  55. package/dist/node/ui/hooks/index.js +153 -153
  56. package/dist/node/ui/hooks/useAgentList.js +1 -1
  57. package/dist/node/ui/hooks/useAgentMutations.js +1 -1
  58. package/dist/node/ui/hooks/useRunList.js +1 -1
  59. package/dist/node/ui/hooks/useToolList.js +1 -1
  60. package/dist/node/ui/index.js +1222 -1222
  61. package/dist/node/ui/modals/AgentActionsModal.js +13 -13
  62. package/dist/node/ui/modals/CreateAgentModal.js +15 -15
  63. package/dist/node/ui/modals/index.js +297 -297
  64. package/dist/node/ui/renderers/agent-list.renderer.js +7 -7
  65. package/dist/node/ui/renderers/index.js +157 -157
  66. package/dist/node/ui/views/AgentListView.js +7 -7
  67. package/dist/node/ui/views/RunListView.js +16 -16
  68. package/dist/node/ui/views/ToolRegistryView.js +9 -9
  69. package/dist/node/ui/views/index.js +97 -97
  70. package/dist/presentations/index.d.ts +3 -5
  71. package/dist/presentations/index.js +4 -4
  72. package/dist/run/index.d.ts +7 -7
  73. package/dist/run/index.js +536 -536
  74. package/dist/run/run.event.js +2 -2
  75. package/dist/run/run.handler.d.ts +3 -0
  76. package/dist/run/run.presentation.js +2 -2
  77. package/dist/shared/index.d.ts +1 -1
  78. package/dist/tool/index.d.ts +7 -7
  79. package/dist/tool/index.js +260 -260
  80. package/dist/tool/tool.event.js +1 -1
  81. package/dist/tool/tool.handler.d.ts +1 -1
  82. package/dist/tool/tool.presentation.js +2 -2
  83. package/dist/ui/AgentDashboard.js +956 -956
  84. package/dist/ui/AgentRunList.js +16 -16
  85. package/dist/ui/AgentToolRegistry.js +9 -9
  86. package/dist/ui/hooks/index.d.ts +4 -4
  87. package/dist/ui/hooks/index.js +153 -153
  88. package/dist/ui/hooks/useAgentList.d.ts +5 -0
  89. package/dist/ui/hooks/useAgentList.js +1 -1
  90. package/dist/ui/hooks/useAgentMutations.d.ts +9 -2
  91. package/dist/ui/hooks/useAgentMutations.js +1 -1
  92. package/dist/ui/hooks/useRunList.d.ts +5 -0
  93. package/dist/ui/hooks/useRunList.js +1 -1
  94. package/dist/ui/hooks/useToolList.d.ts +5 -0
  95. package/dist/ui/hooks/useToolList.js +1 -1
  96. package/dist/ui/index.d.ts +3 -3
  97. package/dist/ui/index.js +1222 -1222
  98. package/dist/ui/modals/AgentActionsModal.js +13 -13
  99. package/dist/ui/modals/CreateAgentModal.js +15 -15
  100. package/dist/ui/modals/index.d.ts +1 -1
  101. package/dist/ui/modals/index.js +297 -297
  102. package/dist/ui/renderers/agent-list.markdown.d.ts +5 -0
  103. package/dist/ui/renderers/agent-list.renderer.js +7 -7
  104. package/dist/ui/renderers/dashboard.markdown.d.ts +5 -0
  105. package/dist/ui/renderers/index.d.ts +2 -2
  106. package/dist/ui/renderers/index.js +157 -157
  107. package/dist/ui/renderers/run-list.markdown.d.ts +5 -0
  108. package/dist/ui/renderers/tool-registry.markdown.d.ts +5 -0
  109. package/dist/ui/views/AgentListView.js +7 -7
  110. package/dist/ui/views/RunListView.js +16 -16
  111. package/dist/ui/views/ToolRegistryView.js +9 -9
  112. package/dist/ui/views/index.js +97 -97
  113. package/package.json +10 -10
  114. package/src/agent/agent.entity.ts +111 -111
  115. package/src/agent/agent.enum.ts +12 -12
  116. package/src/agent/agent.event.ts +91 -91
  117. package/src/agent/agent.handler.ts +123 -123
  118. package/src/agent/agent.operation.ts +400 -400
  119. package/src/agent/agent.presentation.ts +62 -62
  120. package/src/agent/agent.schema.ts +175 -175
  121. package/src/agent/agent.test-spec.ts +48 -48
  122. package/src/agent/index.ts +46 -51
  123. package/src/agent.capability.ts +11 -11
  124. package/src/agent.feature.ts +131 -131
  125. package/src/docs/agent-console.docblock.ts +42 -42
  126. package/src/example.ts +35 -35
  127. package/src/handlers/agent.handlers.ts +522 -521
  128. package/src/handlers/index.ts +12 -12
  129. package/src/index.ts +8 -9
  130. package/src/presentations/index.ts +11 -13
  131. package/src/run/index.ts +49 -54
  132. package/src/run/run.entity.ts +137 -137
  133. package/src/run/run.enum.ts +18 -18
  134. package/src/run/run.event.ts +174 -174
  135. package/src/run/run.handler.ts +92 -91
  136. package/src/run/run.operation.ts +474 -474
  137. package/src/run/run.presentation.ts +42 -42
  138. package/src/run/run.schema.ts +126 -126
  139. package/src/run/run.test-spec.ts +48 -48
  140. package/src/seeders/index.ts +21 -21
  141. package/src/shared/index.ts +1 -1
  142. package/src/shared/mock-agents.ts +76 -76
  143. package/src/shared/mock-runs.ts +102 -102
  144. package/src/shared/mock-tools.ts +140 -140
  145. package/src/shared/overlay-types.ts +23 -23
  146. package/src/tool/index.ts +39 -44
  147. package/src/tool/tool.entity.ts +73 -73
  148. package/src/tool/tool.enum.ts +13 -13
  149. package/src/tool/tool.event.ts +80 -80
  150. package/src/tool/tool.handler.ts +102 -102
  151. package/src/tool/tool.operation.ts +328 -328
  152. package/src/tool/tool.presentation.ts +43 -43
  153. package/src/tool/tool.schema.ts +106 -106
  154. package/src/tool/tool.test-spec.ts +48 -48
  155. package/src/ui/AgentDashboard.tsx +348 -348
  156. package/src/ui/hooks/index.ts +7 -7
  157. package/src/ui/hooks/useAgentList.ts +57 -56
  158. package/src/ui/hooks/useAgentMutations.ts +160 -159
  159. package/src/ui/hooks/useRunList.ts +58 -57
  160. package/src/ui/hooks/useToolList.ts +102 -101
  161. package/src/ui/index.ts +6 -9
  162. package/src/ui/modals/AgentActionsModal.tsx +262 -262
  163. package/src/ui/modals/CreateAgentModal.tsx +232 -232
  164. package/src/ui/modals/index.ts +1 -1
  165. package/src/ui/overlays/demo-overlays.ts +52 -52
  166. package/src/ui/renderers/agent-list.markdown.ts +61 -60
  167. package/src/ui/renderers/agent-list.renderer.tsx +14 -14
  168. package/src/ui/renderers/dashboard.markdown.ts +140 -139
  169. package/src/ui/renderers/index.ts +3 -4
  170. package/src/ui/renderers/run-list.markdown.ts +48 -47
  171. package/src/ui/renderers/tool-registry.markdown.ts +66 -65
  172. package/src/ui/views/AgentListView.tsx +90 -90
  173. package/src/ui/views/RunListView.tsx +141 -141
  174. package/src/ui/views/ToolRegistryView.tsx +113 -113
  175. package/tsconfig.json +7 -8
  176. package/tsdown.config.js +7 -3
@@ -3,15 +3,15 @@ $ bun run prebuild && bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build prebuild
4
4
  $ contractspec-bun-build transpile
5
5
  [contractspec-bun-build] transpile target=bun root=src entries=66 noBundle=false
6
- Bundled 66 modules in 104ms
6
+ Bundled 66 modules in 149ms
7
7
 
8
8
  ./agent.capability.js 442 bytes (entry point)
9
9
  tool/tool.test-spec.js 1.38 KB (entry point)
10
10
  shared/overlay-types.js 8 bytes (entry point)
11
11
  run/run.test-spec.js 1.37 KB (entry point)
12
12
  seeders/index.js 0.64 KB (entry point)
13
- ./index.js 202.99 KB (entry point)
14
- ui/index.js 78.23 KB (entry point)
13
+ ./index.js 202.97 KB (entry point)
14
+ ui/index.js 78.21 KB (entry point)
15
15
  ui/views/index.js 22.0 KB (entry point)
16
16
  ui/renderers/index.js 14.75 KB (entry point)
17
17
  ui/renderers/agent-list.markdown.js 1.49 KB (entry point)
@@ -20,10 +20,10 @@ Bundled 66 modules in 104ms
20
20
  ui/renderers/run-list.markdown.js 1.39 KB (entry point)
21
21
  ui/renderers/tool-registry.markdown.js 1.64 KB (entry point)
22
22
  ui/views/AgentListView.js 5.35 KB (entry point)
23
- ui/modals/index.js 22.57 KB (entry point)
23
+ ui/modals/index.js 22.55 KB (entry point)
24
24
  ui/overlays/index.js 1.46 KB (entry point)
25
25
  ui/overlays/demo-overlays.js 1.46 KB (entry point)
26
- ui/AgentDashboard.js 63.20 KB (entry point)
26
+ ui/AgentDashboard.js 63.18 KB (entry point)
27
27
  ui/modals/AgentActionsModal.js 12.32 KB (entry point)
28
28
  ui/modals/CreateAgentModal.js 10.18 KB (entry point)
29
29
  ui/AgentRunList.js 9.39 KB (entry point)
@@ -35,7 +35,7 @@ Bundled 66 modules in 104ms
35
35
  ui/hooks/useToolList.js 2.52 KB (entry point)
36
36
  ui/hooks/useAgentList.js 1.69 KB (entry point)
37
37
  ui/hooks/useAgentMutations.js 3.18 KB (entry point)
38
- tool/index.js 28.61 KB (entry point)
38
+ tool/index.js 28.63 KB (entry point)
39
39
  tool/tool.entity.js 2.65 KB (entry point)
40
40
  tool/tool.event.js 3.25 KB (entry point)
41
41
  tool/tool.operation.js 14.62 KB (entry point)
@@ -73,15 +73,15 @@ Bundled 66 modules in 104ms
73
73
  agent/agent.enum.js 467 bytes (entry point)
74
74
 
75
75
  [contractspec-bun-build] transpile target=node root=src entries=66 noBundle=false
76
- Bundled 66 modules in 124ms
76
+ Bundled 66 modules in 122ms
77
77
 
78
78
  ./agent.capability.js 434 bytes (entry point)
79
79
  tool/tool.test-spec.js 1.38 KB (entry point)
80
80
  shared/overlay-types.js 0 KB (entry point)
81
81
  run/run.test-spec.js 1.36 KB (entry point)
82
82
  seeders/index.js 0.63 KB (entry point)
83
- ./index.js 202.92 KB (entry point)
84
- ui/index.js 78.18 KB (entry point)
83
+ ./index.js 202.91 KB (entry point)
84
+ ui/index.js 78.16 KB (entry point)
85
85
  ui/views/index.js 22.00 KB (entry point)
86
86
  ui/renderers/index.js 14.73 KB (entry point)
87
87
  ui/renderers/agent-list.markdown.js 1.48 KB (entry point)
@@ -90,10 +90,10 @@ Bundled 66 modules in 124ms
90
90
  ui/renderers/run-list.markdown.js 1.39 KB (entry point)
91
91
  ui/renderers/tool-registry.markdown.js 1.62 KB (entry point)
92
92
  ui/views/AgentListView.js 5.34 KB (entry point)
93
- ui/modals/index.js 22.54 KB (entry point)
93
+ ui/modals/index.js 22.53 KB (entry point)
94
94
  ui/overlays/index.js 1.45 KB (entry point)
95
95
  ui/overlays/demo-overlays.js 1.45 KB (entry point)
96
- ui/AgentDashboard.js 63.16 KB (entry point)
96
+ ui/AgentDashboard.js 63.15 KB (entry point)
97
97
  ui/modals/AgentActionsModal.js 12.29 KB (entry point)
98
98
  ui/modals/CreateAgentModal.js 10.17 KB (entry point)
99
99
  ui/AgentRunList.js 9.38 KB (entry point)
@@ -105,7 +105,7 @@ Bundled 66 modules in 124ms
105
105
  ui/hooks/useToolList.js 2.51 KB (entry point)
106
106
  ui/hooks/useAgentList.js 1.68 KB (entry point)
107
107
  ui/hooks/useAgentMutations.js 3.18 KB (entry point)
108
- tool/index.js 28.60 KB (entry point)
108
+ tool/index.js 28.62 KB (entry point)
109
109
  tool/tool.entity.js 2.64 KB (entry point)
110
110
  tool/tool.event.js 3.24 KB (entry point)
111
111
  tool/tool.operation.js 14.62 KB (entry point)
@@ -143,15 +143,15 @@ Bundled 66 modules in 124ms
143
143
  agent/agent.enum.js 459 bytes (entry point)
144
144
 
145
145
  [contractspec-bun-build] transpile target=browser root=src entries=66 noBundle=false
146
- Bundled 66 modules in 106ms
146
+ Bundled 66 modules in 86ms
147
147
 
148
148
  ./agent.capability.js 434 bytes (entry point)
149
149
  tool/tool.test-spec.js 1.38 KB (entry point)
150
150
  shared/overlay-types.js 0 KB (entry point)
151
151
  run/run.test-spec.js 1.36 KB (entry point)
152
152
  seeders/index.js 0.63 KB (entry point)
153
- ./index.js 202.92 KB (entry point)
154
- ui/index.js 78.18 KB (entry point)
153
+ ./index.js 202.91 KB (entry point)
154
+ ui/index.js 78.16 KB (entry point)
155
155
  ui/views/index.js 22.00 KB (entry point)
156
156
  ui/renderers/index.js 14.73 KB (entry point)
157
157
  ui/renderers/agent-list.markdown.js 1.48 KB (entry point)
@@ -160,10 +160,10 @@ Bundled 66 modules in 106ms
160
160
  ui/renderers/run-list.markdown.js 1.39 KB (entry point)
161
161
  ui/renderers/tool-registry.markdown.js 1.62 KB (entry point)
162
162
  ui/views/AgentListView.js 5.34 KB (entry point)
163
- ui/modals/index.js 22.54 KB (entry point)
163
+ ui/modals/index.js 22.53 KB (entry point)
164
164
  ui/overlays/index.js 1.45 KB (entry point)
165
165
  ui/overlays/demo-overlays.js 1.45 KB (entry point)
166
- ui/AgentDashboard.js 63.16 KB (entry point)
166
+ ui/AgentDashboard.js 63.15 KB (entry point)
167
167
  ui/modals/AgentActionsModal.js 12.29 KB (entry point)
168
168
  ui/modals/CreateAgentModal.js 10.17 KB (entry point)
169
169
  ui/AgentRunList.js 9.38 KB (entry point)
@@ -175,7 +175,7 @@ Bundled 66 modules in 106ms
175
175
  ui/hooks/useToolList.js 2.51 KB (entry point)
176
176
  ui/hooks/useAgentList.js 1.68 KB (entry point)
177
177
  ui/hooks/useAgentMutations.js 3.18 KB (entry point)
178
- tool/index.js 28.60 KB (entry point)
178
+ tool/index.js 28.62 KB (entry point)
179
179
  tool/tool.entity.js 2.64 KB (entry point)
180
180
  tool/tool.event.js 3.24 KB (entry point)
181
181
  tool/tool.operation.js 14.62 KB (entry point)
package/AGENTS.md CHANGED
@@ -1,40 +1,59 @@
1
- # AI Agent Guide -- `@contractspec/example.agent-console`
1
+ # AI Agent Guide `@contractspec/example.agent-console`
2
2
 
3
3
  Scope: `packages/examples/agent-console/*`
4
4
 
5
- Demonstrates AI agent orchestration with tools, runs, and execution logs using the ContractSpec spec-first pattern.
5
+ Agent Console example - AI agent orchestration with tools, runs, and logs.
6
6
 
7
7
  ## Quick Context
8
8
 
9
- - **Layer**: example
10
- - **Related Packages**: `lib.schema`, `lib.contracts-spec`, `lib.example-shared-ui`, `lib.design-system`, `lib.runtime-sandbox`
11
-
12
- ## What This Demonstrates
13
-
14
- - Agent entity with lifecycle (create, configure, execute)
15
- - Run tracking with status enums and event-driven state transitions
16
- - Tool registry with typed schemas and operation handlers
17
- - Presentation layer with React UI components, hooks, modals, and overlays
18
- - Markdown and React renderers for multi-surface output
19
- - Seeders and mock data for demo scenarios
20
-
21
- ## Public Exports
22
-
23
- - `.` -- root barrel
24
- - `./agent` -- agent entity, enum, event, handler, operation, presentation, schema, test-spec
25
- - `./agent.capability`, `./agent.feature` -- capability and feature definitions
26
- - `./run` -- run entity, enum, event, handler, operation, presentation, schema, test-spec
27
- - `./tool` -- tool entity, enum, event, handler, operation, presentation, schema, test-spec
28
- - `./handlers` -- operation handlers
29
- - `./presentations` -- presentation definitions
30
- - `./seeders`, `./shared` -- mock data and shared types
31
- - `./ui` -- React components, hooks, modals, overlays, renderers, views
32
- - `./docs` -- DocBlock documentation
33
- - `./example` -- runnable example entry point
9
+ - Layer: `example`.
10
+ - Package visibility: published package.
11
+ - Primary consumers are example explorers, template authors, and documentation readers.
12
+ - Related packages: `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.runtime-sandbox`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, ...
13
+
14
+ ## Architecture
15
+
16
+ - `src/agent` is part of the package's public or composition surface.
17
+ - `src/agent.capability.ts` defines a capability surface.
18
+ - `src/agent.feature.ts` defines a feature entrypoint.
19
+ - `src/docs/` contains docblocks and documentation-facing exports.
20
+ - `src/example.ts` is the runnable example entrypoint.
21
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
22
+ - `src/index.ts` is the root public barrel and package entrypoint.
23
+
24
+ ## Public Surface
25
+
26
+ - Export `.` resolves through `./src/index.ts`.
27
+ - Export `./agent` resolves through `./src/agent/index.ts`.
28
+ - Export `./agent.capability` resolves through `./src/agent.capability.ts`.
29
+ - Export `./agent.feature` resolves through `./src/agent.feature.ts`.
30
+ - Export `./agent/agent.entity` resolves through `./src/agent/agent.entity.ts`.
31
+ - Export `./agent/agent.enum` resolves through `./src/agent/agent.enum.ts`.
32
+ - Export `./agent/agent.event` resolves through `./src/agent/agent.event.ts`.
33
+ - Export `./agent/agent.handler` resolves through `./src/agent/agent.handler.ts`.
34
+ - Export `./agent/agent.operation` resolves through `./src/agent/agent.operation.ts`.
35
+ - Export `./agent/agent.presentation` resolves through `./src/agent/agent.presentation.ts`.
36
+ - The package publishes 66 total export subpaths; keep docs aligned with `package.json`.
37
+
38
+ ## Guardrails
39
+
40
+ - Keep the example package demonstrative, buildable, and aligned with the exported feature surface.
41
+ - Do not add hidden production assumptions that are not actually implemented in the example.
42
+ - Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.runtime-sandbox`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, ....
43
+ - Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.runtime-sandbox`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, ...
34
44
 
35
45
  ## Local Commands
36
46
 
37
- - Build: `bun run build`
38
- - Dev: `bun run dev`
39
- - Test: `bun test`
40
- - Typecheck: `bun run typecheck`
47
+ - `bun run dev` — contractspec-bun-build dev
48
+ - `bun run build`bun run prebuild && bun run build:bundle && bun run build:types
49
+ - `bun run test`bun test --pass-with-no-tests
50
+ - `bun run lint` — bun lint:fix
51
+ - `bun run lint:check` — biome check .
52
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
53
+ - `bun run typecheck` — tsc --noEmit
54
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
55
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
56
+ - `bun run clean` — rimraf dist .turbo
57
+ - `bun run build:bundle` — contractspec-bun-build transpile
58
+ - `bun run build:types` — contractspec-bun-build types
59
+ - `bun run prebuild` — contractspec-bun-build prebuild
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @contractspec/example.agent-console
2
2
 
3
+ ## 3.7.6
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: release manifest
8
+ - Updated dependencies
9
+ - @contractspec/lib.example-shared-ui@6.0.6
10
+ - @contractspec/lib.runtime-sandbox@2.7.6
11
+ - @contractspec/lib.contracts-spec@3.7.6
12
+ - @contractspec/lib.design-system@3.7.6
13
+ - @contractspec/lib.schema@3.7.6
14
+
3
15
  ## 3.7.5
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -1,86 +1,78 @@
1
- # Agent Console Example
1
+ # @contractspec/example.agent-console
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
+ **Agent Console example - AI agent orchestration with tools, runs, and logs.**
5
6
 
6
- A ContractSpec example demonstrating AI agent orchestration with tools, runs, and execution logs.
7
+ ## What This Demonstrates
7
8
 
8
- ## Overview
9
+ - Agent entity with lifecycle (create, configure, execute).
10
+ - Run tracking with status enums and event-driven state transitions.
11
+ - Tool registry with typed schemas and operation handlers.
12
+ - Presentation layer with React UI components, hooks, modals, and overlays.
13
+ - Markdown and React renderers for multi-surface output.
14
+ - Seeders and mock data for demo scenarios.
9
15
 
10
- This example showcases how to build an AI agent management system using ContractSpec's spec-first approach. It includes:
16
+ ## Running Locally
11
17
 
12
- - **Tools**: Reusable AI functions/capabilities that agents can invoke
13
- - **Agents**: AI agent configurations with assigned tools and parameters
14
- - **Runs**: Execution instances of agents processing user requests
15
- - **Logs**: Detailed execution logs for debugging and auditing
16
-
17
- ## Features
18
-
19
- - Multi-tenant agent management
20
- - Tool registry with typed parameters
21
- - Agent composition with multiple tools
22
- - Run execution with step-by-step logging
23
- - Token usage tracking for billing
24
- - Event-driven architecture for real-time updates
18
+ From `packages/examples/agent-console`:
19
+ - `bun run dev`
20
+ - `bun run build`
21
+ - `bun run test`
22
+ - `bun run typecheck`
25
23
 
26
24
  ## Usage
27
25
 
28
- ```typescript
29
- import {
30
- ToolEntity,
31
- AgentEntity,
32
- RunEntity,
33
- CreateToolCommand,
34
- ExecuteAgentCommand
35
- } from '@contractspec/example.agent-console';
36
-
37
- // Define a tool
38
- const searchTool = {
39
- name: 'web-search',
40
- description: 'Search the web for information',
41
- parameters: {
42
- type: 'object',
43
- properties: {
44
- query: { type: 'string' }
45
- }
46
- }
47
- };
48
-
49
- // Create an agent with tools
50
- const agent = {
51
- name: 'Research Assistant',
52
- model: 'gpt-4',
53
- systemPrompt: 'You are a helpful research assistant.',
54
- toolIds: ['tool-web-search', 'tool-summarize']
55
- };
56
-
57
- // Execute the agent
58
- const run = await executeAgent({
59
- agentId: agent.id,
60
- input: { message: 'What are the latest AI developments?' }
61
- });
62
- ```
63
-
64
- ## Entities
65
-
66
- - `Tool` - AI tool/function definitions
67
- - `Agent` - Agent configurations
68
- - `Run` - Agent execution instances
69
- - `RunStep` - Individual steps within a run
70
- - `RunLog` - Detailed execution logs
71
-
72
- ## Events
73
-
74
- - `AgentCreated` - When a new agent is configured
75
- - `RunStarted` - When an agent run begins
76
- - `RunCompleted` - When an agent run finishes
77
- - `RunFailed` - When an agent run encounters an error
78
- - `ToolInvoked` - When a tool is called during execution
79
-
80
- ## Dependencies
81
-
82
- This example builds on the following cross-cutting modules:
83
-
84
- - `@contractspec/lib.identity-rbac` - User and organization management
85
- - `@contractspec/lib.jobs` - Async job processing for long-running agents
86
- - `@contractspec/module.audit-trail` - Audit logging for compliance
26
+ Use `@contractspec/example.agent-console` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
27
+
28
+ ## Architecture
29
+
30
+ - `src/agent` is part of the package's public or composition surface.
31
+ - `src/agent.capability.ts` defines a capability surface.
32
+ - `src/agent.feature.ts` defines a feature entrypoint.
33
+ - `src/docs/` contains docblocks and documentation-facing exports.
34
+ - `src/example.ts` is the runnable example entrypoint.
35
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
36
+ - `src/index.ts` is the root public barrel and package entrypoint.
37
+
38
+ ## Public Entry Points
39
+
40
+ - Export `.` resolves through `./src/index.ts`.
41
+ - Export `./agent` resolves through `./src/agent/index.ts`.
42
+ - Export `./agent.capability` resolves through `./src/agent.capability.ts`.
43
+ - Export `./agent.feature` resolves through `./src/agent.feature.ts`.
44
+ - Export `./agent/agent.entity` resolves through `./src/agent/agent.entity.ts`.
45
+ - Export `./agent/agent.enum` resolves through `./src/agent/agent.enum.ts`.
46
+ - Export `./agent/agent.event` resolves through `./src/agent/agent.event.ts`.
47
+ - Export `./agent/agent.handler` resolves through `./src/agent/agent.handler.ts`.
48
+ - Export `./agent/agent.operation` resolves through `./src/agent/agent.operation.ts`.
49
+ - Export `./agent/agent.presentation` resolves through `./src/agent/agent.presentation.ts`.
50
+ - The package publishes 66 total export subpaths; keep docs aligned with `package.json`.
51
+
52
+ ## Local Commands
53
+
54
+ - `bun run dev` — contractspec-bun-build dev
55
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
56
+ - `bun run test` bun test --pass-with-no-tests
57
+ - `bun run lint` — bun lint:fix
58
+ - `bun run lint:check` biome check .
59
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
60
+ - `bun run typecheck` — tsc --noEmit
61
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
62
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
63
+ - `bun run clean` — rimraf dist .turbo
64
+ - `bun run build:bundle` — contractspec-bun-build transpile
65
+ - `bun run build:types` — contractspec-bun-build types
66
+ - `bun run prebuild` — contractspec-bun-build prebuild
67
+
68
+ ## Recent Updates
69
+
70
+ - Replace eslint+prettier by biomejs to optimize speed.
71
+ - Package exports.
72
+ - Add latest models and align defaults.
73
+ - Resolve lint and build errors in workspace bundle and integrations lib.
74
+ - Missing contract layers.
75
+
76
+ ## Notes
77
+
78
+ - Works alongside `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.runtime-sandbox`, `@contractspec/lib.schema`, ...
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/agent/agent.event.ts
3
3
  import { defineEvent } from "@contractspec/lib.contracts-spec";
4
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
5
5
  var OWNERS = ["@agent-console-team"];
6
6
  var AgentCreatedPayload = defineSchemaModel({
7
7
  name: "AgentCreatedPayload",
@@ -22,7 +22,7 @@ var ToolChoiceEnum = defineEnum("ToolChoice", [
22
22
 
23
23
  // src/agent/agent.event.ts
24
24
  import { defineEvent } from "@contractspec/lib.contracts-spec";
25
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
25
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
26
26
  var OWNERS = ["@agent-console-team"];
27
27
  var AgentCreatedPayload = defineSchemaModel({
28
28
  name: "AgentCreatedPayload",
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Agent domain - AI agent configuration and management.
3
3
  */
4
+ export { AgentEntity, AgentStatusEntityEnum, AgentToolEntity, ModelProviderEntityEnum, } from './agent.entity';
4
5
  export { AgentStatusEnum, ModelProviderEnum, ToolChoiceEnum, } from './agent.enum';
6
+ export { AgentCreatedEvent, AgentToolAssignedEvent, AgentToolRemovedEvent, AgentUpdatedEvent, } from './agent.event';
7
+ export { type AgentSummary, type AgentToolRef, type AgentWithTools, type GetAgentInput, type ListAgentsInput, type ListAgentsOutput, mockCreateAgentHandler, mockGetAgentHandler, mockListAgentsHandler, mockUpdateAgentHandler, } from './agent.handler';
8
+ export { AssignToolToAgentCommand, CreateAgentCommand, GetAgentQuery, ListAgentsQuery, RemoveToolFromAgentCommand, UpdateAgentCommand, } from './agent.operation';
9
+ export { AgentConsoleDashboardPresentation, AgentDetailPresentation, AgentListPresentation, } from './agent.presentation';
5
10
  export { AgentModel, AgentSummaryModel, AgentToolRefModel, AgentWithToolsModel, CreateAgentInputModel, UpdateAgentInputModel, } from './agent.schema';
6
- export { CreateAgentCommand, UpdateAgentCommand, GetAgentQuery, ListAgentsQuery, AssignToolToAgentCommand, RemoveToolFromAgentCommand, } from './agent.operation';
7
- export { AgentCreatedEvent, AgentUpdatedEvent, AgentToolAssignedEvent, AgentToolRemovedEvent, } from './agent.event';
8
- export { AgentStatusEntityEnum, ModelProviderEntityEnum, AgentEntity, AgentToolEntity, } from './agent.entity';
9
- export { AgentListPresentation, AgentDetailPresentation, AgentConsoleDashboardPresentation, } from './agent.presentation';
10
- export { mockListAgentsHandler, mockGetAgentHandler, mockCreateAgentHandler, mockUpdateAgentHandler, type ListAgentsInput, type AgentSummary, type ListAgentsOutput, type GetAgentInput, type AgentToolRef, type AgentWithTools, } from './agent.handler';
@@ -144,7 +144,7 @@ var ToolChoiceEnum = defineEnum("ToolChoice", [
144
144
 
145
145
  // src/agent/agent.event.ts
146
146
  import { defineEvent } from "@contractspec/lib.contracts-spec";
147
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
147
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
148
148
  var OWNERS = ["@agent-console-team"];
149
149
  var AgentCreatedPayload = defineSchemaModel({
150
150
  name: "AgentCreatedPayload",
@@ -1,6 +1,6 @@
1
1
  // src/agent/agent.event.ts
2
2
  import { defineEvent } from "@contractspec/lib.contracts-spec";
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var OWNERS = ["@agent-console-team"];
5
5
  var AgentCreatedPayload = defineSchemaModel({
6
6
  name: "AgentCreatedPayload",
@@ -21,7 +21,7 @@ var ToolChoiceEnum = defineEnum("ToolChoice", [
21
21
 
22
22
  // src/agent/agent.event.ts
23
23
  import { defineEvent } from "@contractspec/lib.contracts-spec";
24
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
24
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
25
25
  var OWNERS = ["@agent-console-team"];
26
26
  var AgentCreatedPayload = defineSchemaModel({
27
27
  name: "AgentCreatedPayload",
@@ -143,7 +143,7 @@ var ToolChoiceEnum = defineEnum("ToolChoice", [
143
143
 
144
144
  // src/agent/agent.event.ts
145
145
  import { defineEvent } from "@contractspec/lib.contracts-spec";
146
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
146
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
147
147
  var OWNERS = ["@agent-console-team"];
148
148
  var AgentCreatedPayload = defineSchemaModel({
149
149
  name: "AgentCreatedPayload",