pinokiod 8.3.29 → 8.3.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "8.3.29",
3
+ "version": "8.3.31",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -180,6 +180,16 @@ header.navheader.agent-bar-raised {
180
180
  background: var(--agent-bar-chip);
181
181
  color: var(--agent-bar-text);
182
182
  }
183
+ /* it opens a list: the same caret as the agent picker beside it */
184
+ .agent-bar__running::after {
185
+ content: "\f078";
186
+ font-family: "Font Awesome 7 Free";
187
+ font-weight: 900;
188
+ font-size: 8px;
189
+ line-height: 1;
190
+ margin-left: -2px;
191
+ opacity: 0.6;
192
+ }
183
193
  .agent-bar__dot {
184
194
  width: 7px;
185
195
  height: 7px;
@@ -1008,7 +1008,9 @@
1008
1008
  api.refresh = () => render();
1009
1009
  // the modes and choosing one, for the row that names them all (agent-bar-modes.js)
1010
1010
  api.modes = () => Object.keys(ITEMS).map((key) => ({ key, label: ITEMS[key].label }));
1011
- api.choose = (key) => { setItem(key); focusInputAtEnd(); };
1011
+ // (This can be the first thing done in the bar, so the agents are read here
1012
+ // too: going to the text afterwards no longer does it, the bar is already in use.)
1013
+ api.choose = (key) => { loadTools(); setItem(key); focusInputAtEnd(); };
1012
1014
 
1013
1015
  function toggleMenu(which) {
1014
1016
  if (state.busy) return;
@@ -1454,6 +1456,9 @@
1454
1456
 
1455
1457
  render();
1456
1458
  syncActive();
1459
+ // The agents are read as the bar goes in, so the one that is remembered is
1460
+ // shown from the start, not only once the bar is first used.
1461
+ loadTools();
1457
1462
  return true;
1458
1463
  }
1459
1464
 
@@ -578,10 +578,6 @@ document.addEventListener("click", async (e) => {
578
578
  socket.close()
579
579
  target.querySelector("i.fa-stop").className = "fa-solid fa-check"
580
580
  target.querySelector("i.fa-spin").classList.add("hidden")
581
- n.Noty({
582
- text: `stopped ${src}`,
583
- silent: true
584
- })
585
581
  setTimeout(() => {
586
582
  location.href = location.href
587
583
  }, 1000)
@@ -3803,10 +3803,6 @@ document.addEventListener("click", async (e) => {
3803
3803
  if (resultSpinIcon) {
3804
3804
  resultSpinIcon.classList.add("hidden")
3805
3805
  }
3806
- n.Noty({
3807
- text: `stopped`,
3808
- silent: true
3809
- })
3810
3806
  setTimeout(() => {
3811
3807
  location.href = location.href
3812
3808
  }, 500)
@@ -3825,10 +3821,6 @@ document.addEventListener("click", async (e) => {
3825
3821
  if (resultSpinIcon) {
3826
3822
  resultSpinIcon.classList.add("hidden")
3827
3823
  }
3828
- n.Noty({
3829
- text: `stopped ${src}`,
3830
- silent: true
3831
- })
3832
3824
  setTimeout(() => {
3833
3825
  if (typeof refreshHomeStatusOnce === "function") {
3834
3826
  const stoppedLine = target.closest(".home-app-line")
@@ -2174,10 +2174,6 @@ document.addEventListener("click", async (e) => {
2174
2174
  socket.close()
2175
2175
  target.querySelector("i.fa-stop").className = "fa-solid fa-check"
2176
2176
  target.querySelector("i.fa-spin").classList.add("hidden")
2177
- n.Noty({
2178
- text: `stopped`,
2179
- silent: true
2180
- })
2181
2177
  setTimeout(() => {
2182
2178
  location.href = location.href
2183
2179
  }, 500)
@@ -2193,10 +2189,6 @@ document.addEventListener("click", async (e) => {
2193
2189
  socket.close()
2194
2190
  target.querySelector("i.fa-stop").className = "fa-solid fa-check"
2195
2191
  target.querySelector("i.fa-spin").classList.add("hidden")
2196
- n.Noty({
2197
- text: `stopped ${src}`,
2198
- silent: true
2199
- })
2200
2192
  setTimeout(() => {
2201
2193
  location.href = location.href
2202
2194
  }, 500)
@@ -131,6 +131,20 @@ test('a click on a row\'s button points the bar at that app and does not open th
131
131
  assert.deepEqual(p.posts, [])
132
132
  })
133
133
 
134
+ test('the remembered agent is shown as soon as the page opens, before the bar is used', async (t) => {
135
+ const p = await home(t)
136
+ assert.equal(p.bar.tool().value, 'codex')
137
+ assert.match(p.root.querySelector('.agent-bar__agent').textContent, /Codex/)
138
+ assert.equal(p.root.dataset.engaged, 'false')
139
+ })
140
+
141
+ test('the click is the first thing done in the bar: the remembered agent is shown, not only used', async (t) => {
142
+ const p = await home(t)
143
+ await p.click(p.askButton('demo'))
144
+ assert.equal(p.bar.tool().value, 'codex')
145
+ assert.match(p.root.querySelector('.agent-bar__agent').textContent, /Codex/)
146
+ })
147
+
134
148
  test('the open view has a chip with the app\'s name and icon; its x makes it an ordinary Ask', async (t) => {
135
149
  const p = await home(t)
136
150
  await p.click(p.askButton('demo'))