@contractspec/example.agent-console 3.7.6 → 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.
- package/.turbo/turbo-build.log +18 -18
- package/AGENTS.md +50 -31
- package/README.md +69 -77
- package/dist/agent/agent.event.js +1 -1
- package/dist/agent/agent.operation.js +1 -1
- package/dist/agent/index.d.ts +5 -5
- package/dist/agent/index.js +1 -1
- package/dist/browser/agent/agent.event.js +1 -1
- package/dist/browser/agent/agent.operation.js +1 -1
- package/dist/browser/agent/index.js +1 -1
- package/dist/browser/index.js +2145 -2145
- package/dist/browser/presentations/index.js +4 -4
- package/dist/browser/run/index.js +536 -536
- package/dist/browser/run/run.event.js +2 -2
- package/dist/browser/run/run.presentation.js +2 -2
- package/dist/browser/tool/index.js +260 -260
- package/dist/browser/tool/tool.event.js +1 -1
- package/dist/browser/tool/tool.presentation.js +2 -2
- package/dist/browser/ui/AgentDashboard.js +956 -956
- package/dist/browser/ui/AgentRunList.js +16 -16
- package/dist/browser/ui/AgentToolRegistry.js +9 -9
- package/dist/browser/ui/hooks/index.js +153 -153
- package/dist/browser/ui/hooks/useAgentList.js +1 -1
- package/dist/browser/ui/hooks/useAgentMutations.js +1 -1
- package/dist/browser/ui/hooks/useRunList.js +1 -1
- package/dist/browser/ui/hooks/useToolList.js +1 -1
- package/dist/browser/ui/index.js +1222 -1222
- package/dist/browser/ui/modals/AgentActionsModal.js +13 -13
- package/dist/browser/ui/modals/CreateAgentModal.js +15 -15
- package/dist/browser/ui/modals/index.js +297 -297
- package/dist/browser/ui/renderers/agent-list.renderer.js +7 -7
- package/dist/browser/ui/renderers/index.js +157 -157
- package/dist/browser/ui/views/AgentListView.js +7 -7
- package/dist/browser/ui/views/RunListView.js +16 -16
- package/dist/browser/ui/views/ToolRegistryView.js +9 -9
- package/dist/browser/ui/views/index.js +97 -97
- package/dist/handlers/index.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2145 -2145
- package/dist/node/agent/agent.event.js +1 -1
- package/dist/node/agent/agent.operation.js +1 -1
- package/dist/node/agent/index.js +1 -1
- package/dist/node/index.js +2145 -2145
- package/dist/node/presentations/index.js +4 -4
- package/dist/node/run/index.js +536 -536
- package/dist/node/run/run.event.js +2 -2
- package/dist/node/run/run.presentation.js +2 -2
- package/dist/node/tool/index.js +260 -260
- package/dist/node/tool/tool.event.js +1 -1
- package/dist/node/tool/tool.presentation.js +2 -2
- package/dist/node/ui/AgentDashboard.js +956 -956
- package/dist/node/ui/AgentRunList.js +16 -16
- package/dist/node/ui/AgentToolRegistry.js +9 -9
- package/dist/node/ui/hooks/index.js +153 -153
- package/dist/node/ui/hooks/useAgentList.js +1 -1
- package/dist/node/ui/hooks/useAgentMutations.js +1 -1
- package/dist/node/ui/hooks/useRunList.js +1 -1
- package/dist/node/ui/hooks/useToolList.js +1 -1
- package/dist/node/ui/index.js +1222 -1222
- package/dist/node/ui/modals/AgentActionsModal.js +13 -13
- package/dist/node/ui/modals/CreateAgentModal.js +15 -15
- package/dist/node/ui/modals/index.js +297 -297
- package/dist/node/ui/renderers/agent-list.renderer.js +7 -7
- package/dist/node/ui/renderers/index.js +157 -157
- package/dist/node/ui/views/AgentListView.js +7 -7
- package/dist/node/ui/views/RunListView.js +16 -16
- package/dist/node/ui/views/ToolRegistryView.js +9 -9
- package/dist/node/ui/views/index.js +97 -97
- package/dist/presentations/index.d.ts +3 -5
- package/dist/presentations/index.js +4 -4
- package/dist/run/index.d.ts +7 -7
- package/dist/run/index.js +536 -536
- package/dist/run/run.event.js +2 -2
- package/dist/run/run.handler.d.ts +3 -0
- package/dist/run/run.presentation.js +2 -2
- package/dist/shared/index.d.ts +1 -1
- package/dist/tool/index.d.ts +7 -7
- package/dist/tool/index.js +260 -260
- package/dist/tool/tool.event.js +1 -1
- package/dist/tool/tool.handler.d.ts +1 -1
- package/dist/tool/tool.presentation.js +2 -2
- package/dist/ui/AgentDashboard.js +956 -956
- package/dist/ui/AgentRunList.js +16 -16
- package/dist/ui/AgentToolRegistry.js +9 -9
- package/dist/ui/hooks/index.d.ts +4 -4
- package/dist/ui/hooks/index.js +153 -153
- package/dist/ui/hooks/useAgentList.d.ts +5 -0
- package/dist/ui/hooks/useAgentList.js +1 -1
- package/dist/ui/hooks/useAgentMutations.d.ts +9 -2
- package/dist/ui/hooks/useAgentMutations.js +1 -1
- package/dist/ui/hooks/useRunList.d.ts +5 -0
- package/dist/ui/hooks/useRunList.js +1 -1
- package/dist/ui/hooks/useToolList.d.ts +5 -0
- package/dist/ui/hooks/useToolList.js +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +1222 -1222
- package/dist/ui/modals/AgentActionsModal.js +13 -13
- package/dist/ui/modals/CreateAgentModal.js +15 -15
- package/dist/ui/modals/index.d.ts +1 -1
- package/dist/ui/modals/index.js +297 -297
- package/dist/ui/renderers/agent-list.markdown.d.ts +5 -0
- package/dist/ui/renderers/agent-list.renderer.js +7 -7
- package/dist/ui/renderers/dashboard.markdown.d.ts +5 -0
- package/dist/ui/renderers/index.d.ts +2 -2
- package/dist/ui/renderers/index.js +157 -157
- package/dist/ui/renderers/run-list.markdown.d.ts +5 -0
- package/dist/ui/renderers/tool-registry.markdown.d.ts +5 -0
- package/dist/ui/views/AgentListView.js +7 -7
- package/dist/ui/views/RunListView.js +16 -16
- package/dist/ui/views/ToolRegistryView.js +9 -9
- package/dist/ui/views/index.js +97 -97
- package/package.json +6 -6
- package/src/agent/agent.entity.ts +111 -111
- package/src/agent/agent.enum.ts +12 -12
- package/src/agent/agent.event.ts +91 -91
- package/src/agent/agent.handler.ts +123 -123
- package/src/agent/agent.operation.ts +400 -400
- package/src/agent/agent.presentation.ts +62 -62
- package/src/agent/agent.schema.ts +175 -175
- package/src/agent/agent.test-spec.ts +48 -48
- package/src/agent/index.ts +46 -51
- package/src/agent.capability.ts +11 -11
- package/src/agent.feature.ts +131 -131
- package/src/docs/agent-console.docblock.ts +42 -42
- package/src/example.ts +35 -35
- package/src/handlers/agent.handlers.ts +522 -521
- package/src/handlers/index.ts +12 -12
- package/src/index.ts +8 -9
- package/src/presentations/index.ts +11 -13
- package/src/run/index.ts +49 -54
- package/src/run/run.entity.ts +137 -137
- package/src/run/run.enum.ts +18 -18
- package/src/run/run.event.ts +174 -174
- package/src/run/run.handler.ts +92 -91
- package/src/run/run.operation.ts +474 -474
- package/src/run/run.presentation.ts +42 -42
- package/src/run/run.schema.ts +126 -126
- package/src/run/run.test-spec.ts +48 -48
- package/src/seeders/index.ts +21 -21
- package/src/shared/index.ts +1 -1
- package/src/shared/mock-agents.ts +76 -76
- package/src/shared/mock-runs.ts +102 -102
- package/src/shared/mock-tools.ts +140 -140
- package/src/shared/overlay-types.ts +23 -23
- package/src/tool/index.ts +39 -44
- package/src/tool/tool.entity.ts +73 -73
- package/src/tool/tool.enum.ts +13 -13
- package/src/tool/tool.event.ts +80 -80
- package/src/tool/tool.handler.ts +102 -102
- package/src/tool/tool.operation.ts +328 -328
- package/src/tool/tool.presentation.ts +43 -43
- package/src/tool/tool.schema.ts +106 -106
- package/src/tool/tool.test-spec.ts +48 -48
- package/src/ui/AgentDashboard.tsx +348 -348
- package/src/ui/hooks/index.ts +7 -7
- package/src/ui/hooks/useAgentList.ts +57 -56
- package/src/ui/hooks/useAgentMutations.ts +160 -159
- package/src/ui/hooks/useRunList.ts +58 -57
- package/src/ui/hooks/useToolList.ts +102 -101
- package/src/ui/index.ts +6 -9
- package/src/ui/modals/AgentActionsModal.tsx +262 -262
- package/src/ui/modals/CreateAgentModal.tsx +232 -232
- package/src/ui/modals/index.ts +1 -1
- package/src/ui/overlays/demo-overlays.ts +52 -52
- package/src/ui/renderers/agent-list.markdown.ts +61 -60
- package/src/ui/renderers/agent-list.renderer.tsx +14 -14
- package/src/ui/renderers/dashboard.markdown.ts +140 -139
- package/src/ui/renderers/index.ts +3 -4
- package/src/ui/renderers/run-list.markdown.ts +48 -47
- package/src/ui/renderers/tool-registry.markdown.ts +66 -65
- package/src/ui/views/AgentListView.tsx +90 -90
- package/src/ui/views/RunListView.tsx +141 -141
- package/src/ui/views/ToolRegistryView.tsx +113 -113
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -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
|
|
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.
|
|
14
|
-
ui/index.js 78.
|
|
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 143ms
|
|
|
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.
|
|
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.
|
|
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 143ms
|
|
|
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.
|
|
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 143ms
|
|
|
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
|
|
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.
|
|
84
|
-
ui/index.js 78.
|
|
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 111ms
|
|
|
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.
|
|
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.
|
|
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 111ms
|
|
|
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.
|
|
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 111ms
|
|
|
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
|
|
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.
|
|
154
|
-
ui/index.js 78.
|
|
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 108ms
|
|
|
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.
|
|
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.
|
|
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 108ms
|
|
|
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.
|
|
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
|
|
1
|
+
# AI Agent Guide — `@contractspec/example.agent-console`
|
|
2
2
|
|
|
3
3
|
Scope: `packages/examples/agent-console/*`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Agent Console example - AI agent orchestration with tools, runs, and logs.
|
|
6
6
|
|
|
7
7
|
## Quick Context
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
- `./
|
|
28
|
-
- `./
|
|
29
|
-
- `./
|
|
30
|
-
-
|
|
31
|
-
- `./
|
|
32
|
-
- `./
|
|
33
|
-
- `./
|
|
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
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
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/README.md
CHANGED
|
@@ -1,86 +1,78 @@
|
|
|
1
|
-
#
|
|
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
|
-
|
|
7
|
+
## What This Demonstrates
|
|
7
8
|
|
|
8
|
-
|
|
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
|
-
|
|
16
|
+
## Running Locally
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- `
|
|
67
|
-
- `
|
|
68
|
-
- `
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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 {
|
|
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 {
|
|
25
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
26
26
|
var OWNERS = ["@agent-console-team"];
|
|
27
27
|
var AgentCreatedPayload = defineSchemaModel({
|
|
28
28
|
name: "AgentCreatedPayload",
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/agent/index.js
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
146
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
147
147
|
var OWNERS = ["@agent-console-team"];
|
|
148
148
|
var AgentCreatedPayload = defineSchemaModel({
|
|
149
149
|
name: "AgentCreatedPayload",
|