@contractspec/example.agent-console 3.8.4 → 3.8.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.
@@ -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=73 noBundle=false
6
- Bundled 79 modules in 121ms
6
+ Bundled 79 modules in 167ms
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 233.57 KB (entry point)
14
- ui/index.js 105.30 KB (entry point)
13
+ ./index.js 233.69 KB (entry point)
14
+ ui/index.js 105.42 KB (entry point)
15
15
  ui/views/index.js 27.89 KB (entry point)
16
16
  ui/overlays/index.js 1.46 KB (entry point)
17
17
  ui/renderers/index.js 21.0 KB (entry point)
@@ -23,7 +23,7 @@ Bundled 79 modules in 121ms
23
23
  ui/views/AgentListView.js 5.35 KB (entry point)
24
24
  ui/modals/index.js 22.55 KB (entry point)
25
25
  ui/overlays/demo-overlays.js 1.46 KB (entry point)
26
- ui/AgentDashboard.js 89.18 KB (entry point)
26
+ ui/AgentDashboard.js 89.30 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/AgentDashboard.visualizations.js 6.67 KB (entry point)
@@ -80,15 +80,15 @@ Bundled 79 modules in 121ms
80
80
  agent/agent.enum.js 467 bytes (entry point)
81
81
 
82
82
  [contractspec-bun-build] transpile target=node root=src entries=73 noBundle=false
83
- Bundled 79 modules in 127ms
83
+ Bundled 79 modules in 113ms
84
84
 
85
85
  ./agent.capability.js 434 bytes (entry point)
86
86
  tool/tool.test-spec.js 1.38 KB (entry point)
87
87
  shared/overlay-types.js 0 KB (entry point)
88
88
  run/run.test-spec.js 1.36 KB (entry point)
89
89
  seeders/index.js 0.63 KB (entry point)
90
- ./index.js 233.51 KB (entry point)
91
- ui/index.js 105.25 KB (entry point)
90
+ ./index.js 233.63 KB (entry point)
91
+ ui/index.js 105.37 KB (entry point)
92
92
  ui/views/index.js 27.88 KB (entry point)
93
93
  ui/overlays/index.js 1.45 KB (entry point)
94
94
  ui/renderers/index.js 21.0 KB (entry point)
@@ -100,7 +100,7 @@ Bundled 79 modules in 127ms
100
100
  ui/views/AgentListView.js 5.34 KB (entry point)
101
101
  ui/modals/index.js 22.53 KB (entry point)
102
102
  ui/overlays/demo-overlays.js 1.45 KB (entry point)
103
- ui/AgentDashboard.js 89.14 KB (entry point)
103
+ ui/AgentDashboard.js 89.26 KB (entry point)
104
104
  ui/modals/AgentActionsModal.js 12.29 KB (entry point)
105
105
  ui/modals/CreateAgentModal.js 10.17 KB (entry point)
106
106
  ui/AgentDashboard.visualizations.js 6.66 KB (entry point)
@@ -157,15 +157,15 @@ Bundled 79 modules in 127ms
157
157
  agent/agent.enum.js 459 bytes (entry point)
158
158
 
159
159
  [contractspec-bun-build] transpile target=browser root=src entries=73 noBundle=false
160
- Bundled 79 modules in 104ms
160
+ Bundled 79 modules in 132ms
161
161
 
162
162
  ./agent.capability.js 434 bytes (entry point)
163
163
  tool/tool.test-spec.js 1.38 KB (entry point)
164
164
  shared/overlay-types.js 0 KB (entry point)
165
165
  run/run.test-spec.js 1.36 KB (entry point)
166
166
  seeders/index.js 0.63 KB (entry point)
167
- ./index.js 233.51 KB (entry point)
168
- ui/index.js 105.25 KB (entry point)
167
+ ./index.js 233.63 KB (entry point)
168
+ ui/index.js 105.37 KB (entry point)
169
169
  ui/views/index.js 27.88 KB (entry point)
170
170
  ui/overlays/index.js 1.45 KB (entry point)
171
171
  ui/renderers/index.js 21.0 KB (entry point)
@@ -177,7 +177,7 @@ Bundled 79 modules in 104ms
177
177
  ui/views/AgentListView.js 5.34 KB (entry point)
178
178
  ui/modals/index.js 22.53 KB (entry point)
179
179
  ui/overlays/demo-overlays.js 1.45 KB (entry point)
180
- ui/AgentDashboard.js 89.14 KB (entry point)
180
+ ui/AgentDashboard.js 89.26 KB (entry point)
181
181
  ui/modals/AgentActionsModal.js 12.29 KB (entry point)
182
182
  ui/modals/CreateAgentModal.js 10.17 KB (entry point)
183
183
  ui/AgentDashboard.visualizations.js 6.66 KB (entry point)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @contractspec/example.agent-console
2
2
 
3
+ ## 3.8.7
4
+
5
+ ### Patch Changes
6
+
7
+ - cce2b13: Fix the agent console smoke test by awaiting async button handlers, splitting the flow into smaller smoke cases, and wiring dashboard mutation refreshes so the visible agents and runs tabs update after create and execute actions. Also make the harness lab browser smoke tests skip when Chromium cannot launch in this environment and apply explicit timeouts for the browser evaluation paths.
8
+ - cce2b13: Add first-class Workflow DevKit support for `WorkflowSpec`, including new runtime metadata, stricter validation for Workflow-backed workflows, a dedicated Workflow DevKit integration package, CLI artifact generation, and Workflow-aware chat route helpers exposed from `@contractspec/module.ai-chat/core/workflow` so standard chat imports do not pull Workflow-only runtime assets into non-Workflow builds.
9
+
10
+ Also harden supporting runtime surfaces by reusing Playwright browser instances in the harness runtime, mapping design-system button `onPress` handlers correctly to DOM clicks, and switching the workspace git adapter to argument-safe subprocess calls while tightening slow test coverage around those flows.
11
+
12
+ - Updated dependencies [cce2b13]
13
+ - @contractspec/lib.presentation-runtime-core@3.9.3
14
+ - @contractspec/lib.example-shared-ui@6.0.15
15
+ - @contractspec/lib.runtime-sandbox@2.7.12
16
+ - @contractspec/lib.contracts-spec@5.0.3
17
+ - @contractspec/lib.design-system@3.8.8
18
+ - @contractspec/lib.schema@3.7.12
19
+
20
+ ## 3.8.6
21
+
22
+ ### Patch Changes
23
+
24
+ - chore: stability & release
25
+ - Updated dependencies
26
+ - Updated dependencies [dd6e074]
27
+ - @contractspec/lib.presentation-runtime-core@3.9.2
28
+ - @contractspec/lib.example-shared-ui@6.0.14
29
+ - @contractspec/lib.runtime-sandbox@2.7.11
30
+ - @contractspec/lib.contracts-spec@5.0.2
31
+ - @contractspec/lib.design-system@3.8.7
32
+ - @contractspec/lib.schema@3.7.11
33
+
34
+ ## 3.8.5
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies [dd6e074]
39
+ - @contractspec/lib.contracts-spec@5.0.1
40
+ - @contractspec/lib.design-system@3.8.6
41
+ - @contractspec/lib.example-shared-ui@6.0.13
42
+ - @contractspec/lib.presentation-runtime-core@3.9.1
43
+
3
44
  ## 3.8.4
4
45
 
5
46
  ### Patch Changes
@@ -5669,12 +5669,14 @@ function AgentDashboard() {
5669
5669
  const [isCreateModalOpen, setIsCreateModalOpen] = useState8(false);
5670
5670
  const [selectedAgent, setSelectedAgent] = useState8(null);
5671
5671
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState8(false);
5672
+ const [refreshVersion, setRefreshVersion] = useState8(0);
5672
5673
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
5673
5674
  const { refetch: refetchAgents } = useAgentList();
5674
5675
  const mutations = useAgentMutations({
5675
5676
  onSuccess: () => {
5676
5677
  refetchAgents();
5677
5678
  refetchRuns();
5679
+ setRefreshVersion((current) => current + 1);
5678
5680
  }
5679
5681
  });
5680
5682
  const handleAgentClick = useCallback5((agent) => {
@@ -5772,10 +5774,10 @@ function AgentDashboard() {
5772
5774
  className: "min-h-[400px]",
5773
5775
  role: "tabpanel",
5774
5776
  children: [
5775
- activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, undefined, false, undefined, this),
5777
+ activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, refreshVersion, false, undefined, this),
5776
5778
  activeTab === "agents" && /* @__PURE__ */ jsxDEV9(AgentListViewWithActions, {
5777
5779
  onAgentClick: handleAgentClick
5778
- }, undefined, false, undefined, this),
5780
+ }, refreshVersion, false, undefined, this),
5779
5781
  activeTab === "tools" && /* @__PURE__ */ jsxDEV9(ToolRegistryView, {}, undefined, false, undefined, this),
5780
5782
  activeTab === "metrics" && /* @__PURE__ */ jsxDEV9(MetricsView, {
5781
5783
  metrics
@@ -2035,12 +2035,14 @@ function AgentDashboard() {
2035
2035
  const [isCreateModalOpen, setIsCreateModalOpen] = useState8(false);
2036
2036
  const [selectedAgent, setSelectedAgent] = useState8(null);
2037
2037
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState8(false);
2038
+ const [refreshVersion, setRefreshVersion] = useState8(0);
2038
2039
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
2039
2040
  const { refetch: refetchAgents } = useAgentList();
2040
2041
  const mutations = useAgentMutations({
2041
2042
  onSuccess: () => {
2042
2043
  refetchAgents();
2043
2044
  refetchRuns();
2045
+ setRefreshVersion((current) => current + 1);
2044
2046
  }
2045
2047
  });
2046
2048
  const handleAgentClick = useCallback5((agent) => {
@@ -2138,10 +2140,10 @@ function AgentDashboard() {
2138
2140
  className: "min-h-[400px]",
2139
2141
  role: "tabpanel",
2140
2142
  children: [
2141
- activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, undefined, false, undefined, this),
2143
+ activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, refreshVersion, false, undefined, this),
2142
2144
  activeTab === "agents" && /* @__PURE__ */ jsxDEV9(AgentListViewWithActions, {
2143
2145
  onAgentClick: handleAgentClick
2144
- }, undefined, false, undefined, this),
2146
+ }, refreshVersion, false, undefined, this),
2145
2147
  activeTab === "tools" && /* @__PURE__ */ jsxDEV9(ToolRegistryView, {}, undefined, false, undefined, this),
2146
2148
  activeTab === "metrics" && /* @__PURE__ */ jsxDEV9(MetricsView, {
2147
2149
  metrics
@@ -2035,12 +2035,14 @@ function AgentDashboard() {
2035
2035
  const [isCreateModalOpen, setIsCreateModalOpen] = useState8(false);
2036
2036
  const [selectedAgent, setSelectedAgent] = useState8(null);
2037
2037
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState8(false);
2038
+ const [refreshVersion, setRefreshVersion] = useState8(0);
2038
2039
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
2039
2040
  const { refetch: refetchAgents } = useAgentList();
2040
2041
  const mutations = useAgentMutations({
2041
2042
  onSuccess: () => {
2042
2043
  refetchAgents();
2043
2044
  refetchRuns();
2045
+ setRefreshVersion((current) => current + 1);
2044
2046
  }
2045
2047
  });
2046
2048
  const handleAgentClick = useCallback5((agent) => {
@@ -2138,10 +2140,10 @@ function AgentDashboard() {
2138
2140
  className: "min-h-[400px]",
2139
2141
  role: "tabpanel",
2140
2142
  children: [
2141
- activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, undefined, false, undefined, this),
2143
+ activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, refreshVersion, false, undefined, this),
2142
2144
  activeTab === "agents" && /* @__PURE__ */ jsxDEV9(AgentListViewWithActions, {
2143
2145
  onAgentClick: handleAgentClick
2144
- }, undefined, false, undefined, this),
2146
+ }, refreshVersion, false, undefined, this),
2145
2147
  activeTab === "tools" && /* @__PURE__ */ jsxDEV9(ToolRegistryView, {}, undefined, false, undefined, this),
2146
2148
  activeTab === "metrics" && /* @__PURE__ */ jsxDEV9(MetricsView, {
2147
2149
  metrics
package/dist/index.js CHANGED
@@ -5670,12 +5670,14 @@ function AgentDashboard() {
5670
5670
  const [isCreateModalOpen, setIsCreateModalOpen] = useState8(false);
5671
5671
  const [selectedAgent, setSelectedAgent] = useState8(null);
5672
5672
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState8(false);
5673
+ const [refreshVersion, setRefreshVersion] = useState8(0);
5673
5674
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
5674
5675
  const { refetch: refetchAgents } = useAgentList();
5675
5676
  const mutations = useAgentMutations({
5676
5677
  onSuccess: () => {
5677
5678
  refetchAgents();
5678
5679
  refetchRuns();
5680
+ setRefreshVersion((current) => current + 1);
5679
5681
  }
5680
5682
  });
5681
5683
  const handleAgentClick = useCallback5((agent) => {
@@ -5773,10 +5775,10 @@ function AgentDashboard() {
5773
5775
  className: "min-h-[400px]",
5774
5776
  role: "tabpanel",
5775
5777
  children: [
5776
- activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, undefined, false, undefined, this),
5778
+ activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, refreshVersion, false, undefined, this),
5777
5779
  activeTab === "agents" && /* @__PURE__ */ jsxDEV9(AgentListViewWithActions, {
5778
5780
  onAgentClick: handleAgentClick
5779
- }, undefined, false, undefined, this),
5781
+ }, refreshVersion, false, undefined, this),
5780
5782
  activeTab === "tools" && /* @__PURE__ */ jsxDEV9(ToolRegistryView, {}, undefined, false, undefined, this),
5781
5783
  activeTab === "metrics" && /* @__PURE__ */ jsxDEV9(MetricsView, {
5782
5784
  metrics
@@ -5669,12 +5669,14 @@ function AgentDashboard() {
5669
5669
  const [isCreateModalOpen, setIsCreateModalOpen] = useState8(false);
5670
5670
  const [selectedAgent, setSelectedAgent] = useState8(null);
5671
5671
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState8(false);
5672
+ const [refreshVersion, setRefreshVersion] = useState8(0);
5672
5673
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
5673
5674
  const { refetch: refetchAgents } = useAgentList();
5674
5675
  const mutations = useAgentMutations({
5675
5676
  onSuccess: () => {
5676
5677
  refetchAgents();
5677
5678
  refetchRuns();
5679
+ setRefreshVersion((current) => current + 1);
5678
5680
  }
5679
5681
  });
5680
5682
  const handleAgentClick = useCallback5((agent) => {
@@ -5772,10 +5774,10 @@ function AgentDashboard() {
5772
5774
  className: "min-h-[400px]",
5773
5775
  role: "tabpanel",
5774
5776
  children: [
5775
- activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, undefined, false, undefined, this),
5777
+ activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, refreshVersion, false, undefined, this),
5776
5778
  activeTab === "agents" && /* @__PURE__ */ jsxDEV9(AgentListViewWithActions, {
5777
5779
  onAgentClick: handleAgentClick
5778
- }, undefined, false, undefined, this),
5780
+ }, refreshVersion, false, undefined, this),
5779
5781
  activeTab === "tools" && /* @__PURE__ */ jsxDEV9(ToolRegistryView, {}, undefined, false, undefined, this),
5780
5782
  activeTab === "metrics" && /* @__PURE__ */ jsxDEV9(MetricsView, {
5781
5783
  metrics
@@ -2035,12 +2035,14 @@ function AgentDashboard() {
2035
2035
  const [isCreateModalOpen, setIsCreateModalOpen] = useState8(false);
2036
2036
  const [selectedAgent, setSelectedAgent] = useState8(null);
2037
2037
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState8(false);
2038
+ const [refreshVersion, setRefreshVersion] = useState8(0);
2038
2039
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
2039
2040
  const { refetch: refetchAgents } = useAgentList();
2040
2041
  const mutations = useAgentMutations({
2041
2042
  onSuccess: () => {
2042
2043
  refetchAgents();
2043
2044
  refetchRuns();
2045
+ setRefreshVersion((current) => current + 1);
2044
2046
  }
2045
2047
  });
2046
2048
  const handleAgentClick = useCallback5((agent) => {
@@ -2138,10 +2140,10 @@ function AgentDashboard() {
2138
2140
  className: "min-h-[400px]",
2139
2141
  role: "tabpanel",
2140
2142
  children: [
2141
- activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, undefined, false, undefined, this),
2143
+ activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, refreshVersion, false, undefined, this),
2142
2144
  activeTab === "agents" && /* @__PURE__ */ jsxDEV9(AgentListViewWithActions, {
2143
2145
  onAgentClick: handleAgentClick
2144
- }, undefined, false, undefined, this),
2146
+ }, refreshVersion, false, undefined, this),
2145
2147
  activeTab === "tools" && /* @__PURE__ */ jsxDEV9(ToolRegistryView, {}, undefined, false, undefined, this),
2146
2148
  activeTab === "metrics" && /* @__PURE__ */ jsxDEV9(MetricsView, {
2147
2149
  metrics
@@ -2035,12 +2035,14 @@ function AgentDashboard() {
2035
2035
  const [isCreateModalOpen, setIsCreateModalOpen] = useState8(false);
2036
2036
  const [selectedAgent, setSelectedAgent] = useState8(null);
2037
2037
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState8(false);
2038
+ const [refreshVersion, setRefreshVersion] = useState8(0);
2038
2039
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
2039
2040
  const { refetch: refetchAgents } = useAgentList();
2040
2041
  const mutations = useAgentMutations({
2041
2042
  onSuccess: () => {
2042
2043
  refetchAgents();
2043
2044
  refetchRuns();
2045
+ setRefreshVersion((current) => current + 1);
2044
2046
  }
2045
2047
  });
2046
2048
  const handleAgentClick = useCallback5((agent) => {
@@ -2138,10 +2140,10 @@ function AgentDashboard() {
2138
2140
  className: "min-h-[400px]",
2139
2141
  role: "tabpanel",
2140
2142
  children: [
2141
- activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, undefined, false, undefined, this),
2143
+ activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, refreshVersion, false, undefined, this),
2142
2144
  activeTab === "agents" && /* @__PURE__ */ jsxDEV9(AgentListViewWithActions, {
2143
2145
  onAgentClick: handleAgentClick
2144
- }, undefined, false, undefined, this),
2146
+ }, refreshVersion, false, undefined, this),
2145
2147
  activeTab === "tools" && /* @__PURE__ */ jsxDEV9(ToolRegistryView, {}, undefined, false, undefined, this),
2146
2148
  activeTab === "metrics" && /* @__PURE__ */ jsxDEV9(MetricsView, {
2147
2149
  metrics
@@ -2036,12 +2036,14 @@ function AgentDashboard() {
2036
2036
  const [isCreateModalOpen, setIsCreateModalOpen] = useState8(false);
2037
2037
  const [selectedAgent, setSelectedAgent] = useState8(null);
2038
2038
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState8(false);
2039
+ const [refreshVersion, setRefreshVersion] = useState8(0);
2039
2040
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
2040
2041
  const { refetch: refetchAgents } = useAgentList();
2041
2042
  const mutations = useAgentMutations({
2042
2043
  onSuccess: () => {
2043
2044
  refetchAgents();
2044
2045
  refetchRuns();
2046
+ setRefreshVersion((current) => current + 1);
2045
2047
  }
2046
2048
  });
2047
2049
  const handleAgentClick = useCallback5((agent) => {
@@ -2139,10 +2141,10 @@ function AgentDashboard() {
2139
2141
  className: "min-h-[400px]",
2140
2142
  role: "tabpanel",
2141
2143
  children: [
2142
- activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, undefined, false, undefined, this),
2144
+ activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, refreshVersion, false, undefined, this),
2143
2145
  activeTab === "agents" && /* @__PURE__ */ jsxDEV9(AgentListViewWithActions, {
2144
2146
  onAgentClick: handleAgentClick
2145
- }, undefined, false, undefined, this),
2147
+ }, refreshVersion, false, undefined, this),
2146
2148
  activeTab === "tools" && /* @__PURE__ */ jsxDEV9(ToolRegistryView, {}, undefined, false, undefined, this),
2147
2149
  activeTab === "metrics" && /* @__PURE__ */ jsxDEV9(MetricsView, {
2148
2150
  metrics
package/dist/ui/index.js CHANGED
@@ -2036,12 +2036,14 @@ function AgentDashboard() {
2036
2036
  const [isCreateModalOpen, setIsCreateModalOpen] = useState8(false);
2037
2037
  const [selectedAgent, setSelectedAgent] = useState8(null);
2038
2038
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState8(false);
2039
+ const [refreshVersion, setRefreshVersion] = useState8(0);
2039
2040
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
2040
2041
  const { refetch: refetchAgents } = useAgentList();
2041
2042
  const mutations = useAgentMutations({
2042
2043
  onSuccess: () => {
2043
2044
  refetchAgents();
2044
2045
  refetchRuns();
2046
+ setRefreshVersion((current) => current + 1);
2045
2047
  }
2046
2048
  });
2047
2049
  const handleAgentClick = useCallback5((agent) => {
@@ -2139,10 +2141,10 @@ function AgentDashboard() {
2139
2141
  className: "min-h-[400px]",
2140
2142
  role: "tabpanel",
2141
2143
  children: [
2142
- activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, undefined, false, undefined, this),
2144
+ activeTab === "runs" && /* @__PURE__ */ jsxDEV9(RunListView, {}, refreshVersion, false, undefined, this),
2143
2145
  activeTab === "agents" && /* @__PURE__ */ jsxDEV9(AgentListViewWithActions, {
2144
2146
  onAgentClick: handleAgentClick
2145
- }, undefined, false, undefined, this),
2147
+ }, refreshVersion, false, undefined, this),
2146
2148
  activeTab === "tools" && /* @__PURE__ */ jsxDEV9(ToolRegistryView, {}, undefined, false, undefined, this),
2147
2149
  activeTab === "metrics" && /* @__PURE__ */ jsxDEV9(MetricsView, {
2148
2150
  metrics
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.agent-console",
3
- "version": "3.8.4",
3
+ "version": "3.8.7",
4
4
  "description": "Agent Console example - AI agent orchestration with tools, runs, and logs",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -535,22 +535,22 @@
535
535
  "typecheck": "tsc --noEmit"
536
536
  },
537
537
  "dependencies": {
538
- "@contractspec/lib.schema": "3.7.10",
539
- "@contractspec/lib.contracts-spec": "5.0.0",
540
- "@contractspec/lib.example-shared-ui": "6.0.12",
541
- "@contractspec/lib.design-system": "3.8.5",
542
- "@contractspec/lib.runtime-sandbox": "2.7.10",
538
+ "@contractspec/lib.schema": "3.7.12",
539
+ "@contractspec/lib.contracts-spec": "5.0.3",
540
+ "@contractspec/lib.example-shared-ui": "6.0.15",
541
+ "@contractspec/lib.design-system": "3.8.8",
542
+ "@contractspec/lib.runtime-sandbox": "2.7.12",
543
543
  "react": "19.2.0",
544
544
  "react-dom": "19.2.0",
545
- "@contractspec/lib.presentation-runtime-core": "3.9.0"
545
+ "@contractspec/lib.presentation-runtime-core": "3.9.3"
546
546
  },
547
547
  "devDependencies": {
548
- "@contractspec/lib.harness": "0.2.5",
549
- "@contractspec/tool.bun": "3.7.9",
550
- "@contractspec/tool.typescript": "3.7.9",
548
+ "@contractspec/lib.harness": "0.2.8",
549
+ "@contractspec/tool.bun": "3.7.11",
550
+ "@contractspec/tool.typescript": "3.7.11",
551
551
  "@types/react": "^19.2.14",
552
552
  "@types/react-dom": "^19.2.2",
553
- "happy-dom": "^20.8.4",
553
+ "happy-dom": "^20.8.8",
554
554
  "typescript": "^5.9.3"
555
555
  },
556
556
  "publishConfig": {
@@ -15,6 +15,8 @@ import {
15
15
  import { AgentDashboard } from './AgentDashboard';
16
16
 
17
17
  const PROJECT_ID = 'agent-console-sandbox-smoke';
18
+ const DASHBOARD_TEST_TIMEOUT_MS = 10_000;
19
+ const MUTATION_TEST_TIMEOUT_MS = 15_000;
18
20
  const TEMPLATE: TemplateDefinition = {
19
21
  id: 'agent-console',
20
22
  name: 'Agent Console',
@@ -121,6 +123,13 @@ async function waitFor(assertion: () => boolean, timeoutMs = 3000) {
121
123
  throw new Error('Timed out waiting for dashboard state.');
122
124
  }
123
125
 
126
+ async function waitForTextToDisappear(text: string, timeoutMs = 3000) {
127
+ await waitFor(
128
+ () => document.body.textContent?.includes(text) !== true,
129
+ timeoutMs
130
+ );
131
+ }
132
+
124
133
  function findButton(container: HTMLElement, label: string) {
125
134
  return [...container.getElementsByTagName('button')].find((element) =>
126
135
  element.textContent?.includes(label)
@@ -162,11 +171,13 @@ async function click(element: Element | null | undefined) {
162
171
  );
163
172
  await act(async () => {
164
173
  if (typeof onPress === 'function') {
165
- onPress();
174
+ await Promise.resolve(onPress());
166
175
  return;
167
176
  }
168
177
  if (typeof onClick === 'function') {
169
- onClick(new MouseEvent('click', { bubbles: true }));
178
+ await Promise.resolve(
179
+ onClick(new MouseEvent('click', { bubbles: true }))
180
+ );
170
181
  return;
171
182
  }
172
183
  if ('click' in element && typeof element.click === 'function') {
@@ -211,102 +222,131 @@ async function fill(selector: string, value: string) {
211
222
  }
212
223
 
213
224
  describe('AgentDashboard sandbox smoke', () => {
214
- it('loads seeded state, renders tabs, creates an agent, and executes a run', async () => {
215
- const { container, root } = await renderDashboard();
216
- await waitFor(
217
- () => container.textContent?.includes('AI Agent Console') === true
218
- );
219
- await waitFor(
220
- () =>
221
- container.textContent?.includes(
222
- 'Affichage de 1 à 3 sur 5 résultats'
223
- ) === true
224
- );
225
+ it(
226
+ 'loads seeded state and renders the dashboard tabs',
227
+ async () => {
228
+ const { container, root } = await renderDashboard();
225
229
 
226
- expect(container.textContent).toContain('Runs');
227
- expect(container.textContent).toContain('Agents');
228
- expect(container.textContent).toContain('Tools');
229
- expect(container.textContent).toContain('Metrics');
230
- expect(container.textContent).toContain('Run History');
230
+ await waitFor(
231
+ () => container.textContent?.includes('AI Agent Console') === true
232
+ );
233
+ await waitFor(
234
+ () =>
235
+ container.textContent?.includes(
236
+ 'Affichage de 1 à 3 sur 5 résultats'
237
+ ) === true
238
+ );
231
239
 
232
- await click(findButton(container, 'Tools'));
233
- await waitFor(
234
- () => container.textContent?.includes('Total Tools') === true
235
- );
236
- await click(findButton(container, 'Metrics'));
237
- await waitFor(
238
- () => container.textContent?.includes('Usage Analytics') === true
239
- );
240
- await click(findButton(container, 'Agents'));
241
- await waitFor(() => container.textContent?.includes('Total: 4') === true);
240
+ expect(container.textContent).toContain('Runs');
241
+ expect(container.textContent).toContain('Agents');
242
+ expect(container.textContent).toContain('Tools');
243
+ expect(container.textContent).toContain('Metrics');
244
+ expect(container.textContent).toContain('Run History');
242
245
 
243
- await click(findButton(container, 'New Agent'));
244
- await waitFor(
245
- () => document.body.textContent?.includes('Create New Agent') === true
246
- );
247
- await fill('#agent-name', 'Paris Meetup UI Agent');
248
- await fill(
249
- '#agent-description',
250
- 'Smoke test agent for the sandbox walkthrough.'
251
- );
252
- await click(findButton(document.body, 'Create Agent'));
253
- await click(findButton(container, 'Runs'));
254
- await waitFor(
255
- () =>
256
- container.textContent?.includes(
257
- 'Affichage de 1 à 3 sur 5 résultats'
258
- ) === true
259
- );
260
- await click(findButton(container, 'Agents'));
261
- await waitFor(
262
- () => container.textContent?.includes('Paris Meetup UI Agent') === true
263
- );
264
- await waitFor(() => container.textContent?.includes('Total: 5') === true);
246
+ await click(findButton(container, 'Tools'));
247
+ await waitFor(
248
+ () => container.textContent?.includes('Total Tools') === true
249
+ );
250
+ await click(findButton(container, 'Metrics'));
251
+ await waitFor(
252
+ () => container.textContent?.includes('Usage Analytics') === true
253
+ );
254
+ await click(findButton(container, 'Runs'));
255
+ await waitFor(
256
+ () => container.textContent?.includes('Run History') === true
257
+ );
265
258
 
266
- const agentCard = findAgentCard(container, 'Paris Meetup UI Agent');
267
- await click(agentCard);
268
- await waitFor(
269
- () => document.body.textContent?.includes('Activate Agent') === true
270
- );
271
- await click(findButton(document.body, 'Activate Agent'));
272
- await click(findButton(container, 'Runs'));
273
- await waitFor(
274
- () => container.textContent?.includes('Run History') === true
275
- );
276
- await click(findButton(container, 'Agents'));
277
- await waitFor(
278
- () =>
279
- findAgentCard(
280
- container,
281
- 'Paris Meetup UI Agent'
282
- )?.textContent?.includes('ACTIVE') === true
283
- );
259
+ await act(async () => {
260
+ root.unmount();
261
+ });
262
+ },
263
+ DASHBOARD_TEST_TIMEOUT_MS
264
+ );
284
265
 
285
- const activeAgentCard = findAgentCard(container, 'Paris Meetup UI Agent');
286
- await click(activeAgentCard);
287
- await waitFor(
288
- () => document.body.textContent?.includes('Execute Agent') === true
289
- );
290
- await click(findButton(document.body, 'Execute Agent'));
291
- await waitFor(
292
- () => document.body.textContent?.includes('Message *') === true
293
- );
294
- await fill('#execute-message', 'Summarize the meetup smoke test.');
295
- await click(findButton(document.body, 'Execute'));
266
+ it(
267
+ 'creates an agent, activates it, and executes a run',
268
+ async () => {
269
+ const { container, root } = await renderDashboard();
296
270
 
297
- await click(findButton(container, 'Runs'));
298
- await waitFor(
299
- () =>
300
- container.textContent?.includes(
301
- 'Affichage de 1 à 3 sur 6 résultats'
302
- ) === true
303
- );
304
- await waitFor(
305
- () => container.textContent?.includes('Paris Meetup UI Agent') === true
306
- );
271
+ await waitFor(
272
+ () => container.textContent?.includes('AI Agent Console') === true
273
+ );
274
+ await waitFor(
275
+ () =>
276
+ container.textContent?.includes(
277
+ 'Affichage de 1 à 3 sur 5 résultats'
278
+ ) === true
279
+ );
307
280
 
308
- await act(async () => {
309
- root.unmount();
310
- });
311
- });
281
+ await click(findButton(container, 'Agents'));
282
+ await waitFor(() => container.textContent?.includes('Total: 4') === true);
283
+
284
+ await click(findButton(container, 'New Agent'));
285
+ await waitFor(
286
+ () => document.body.textContent?.includes('Create New Agent') === true
287
+ );
288
+ await fill('#agent-name', 'Paris Meetup UI Agent');
289
+ await fill(
290
+ '#agent-description',
291
+ 'Smoke test agent for the sandbox walkthrough.'
292
+ );
293
+ await click(findButton(document.body, 'Create Agent'));
294
+ await waitForTextToDisappear('Create New Agent');
295
+ await waitFor(
296
+ () => container.textContent?.includes('Paris Meetup UI Agent') === true,
297
+ 7000
298
+ );
299
+ await waitFor(
300
+ () => container.textContent?.includes('Total: 5') === true,
301
+ 7000
302
+ );
303
+
304
+ const agentCard = findAgentCard(container, 'Paris Meetup UI Agent');
305
+ await click(agentCard);
306
+ await waitFor(
307
+ () => document.body.textContent?.includes('Activate Agent') === true
308
+ );
309
+ await click(findButton(document.body, 'Activate Agent'));
310
+ await waitForTextToDisappear('Activate Agent');
311
+ await waitFor(
312
+ () =>
313
+ findAgentCard(
314
+ container,
315
+ 'Paris Meetup UI Agent'
316
+ )?.textContent?.includes('ACTIVE') === true,
317
+ 7000
318
+ );
319
+
320
+ const activeAgentCard = findAgentCard(container, 'Paris Meetup UI Agent');
321
+ await click(activeAgentCard);
322
+ await waitFor(
323
+ () => document.body.textContent?.includes('Execute Agent') === true
324
+ );
325
+ await click(findButton(document.body, 'Execute Agent'));
326
+ await waitFor(
327
+ () => document.body.textContent?.includes('Message *') === true
328
+ );
329
+ await fill('#execute-message', 'Summarize the meetup smoke test.');
330
+ await click(findButton(document.body, 'Execute'));
331
+ await waitForTextToDisappear('Message *');
332
+
333
+ await click(findButton(container, 'Runs'));
334
+ await waitFor(
335
+ () =>
336
+ container.textContent?.includes(
337
+ 'Affichage de 1 à 3 sur 6 résultats'
338
+ ) === true,
339
+ 7000
340
+ );
341
+ await waitFor(
342
+ () => container.textContent?.includes('Paris Meetup UI Agent') === true,
343
+ 7000
344
+ );
345
+
346
+ await act(async () => {
347
+ root.unmount();
348
+ });
349
+ },
350
+ MUTATION_TEST_TIMEOUT_MS
351
+ );
312
352
  });
@@ -34,6 +34,7 @@ export function AgentDashboard() {
34
34
  const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
35
35
  const [selectedAgent, setSelectedAgent] = useState<Agent | null>(null);
36
36
  const [isAgentActionsOpen, setIsAgentActionsOpen] = useState(false);
37
+ const [refreshVersion, setRefreshVersion] = useState(0);
37
38
 
38
39
  const { data: runData, metrics, refetch: refetchRuns } = useRunList();
39
40
  const { refetch: refetchAgents } = useAgentList();
@@ -42,6 +43,7 @@ export function AgentDashboard() {
42
43
  onSuccess: () => {
43
44
  refetchAgents();
44
45
  refetchRuns();
46
+ setRefreshVersion((current) => current + 1);
45
47
  },
46
48
  });
47
49
 
@@ -141,9 +143,12 @@ export function AgentDashboard() {
141
143
 
142
144
  {/* Tab Content */}
143
145
  <div className="min-h-[400px]" role="tabpanel">
144
- {activeTab === 'runs' && <RunListView />}
146
+ {activeTab === 'runs' && <RunListView key={refreshVersion} />}
145
147
  {activeTab === 'agents' && (
146
- <AgentListViewWithActions onAgentClick={handleAgentClick} />
148
+ <AgentListViewWithActions
149
+ key={refreshVersion}
150
+ onAgentClick={handleAgentClick}
151
+ />
147
152
  )}
148
153
  {activeTab === 'tools' && <ToolRegistryView />}
149
154
  {activeTab === 'metrics' && <MetricsView metrics={metrics} />}