@adminforth/agent 1.16.3 → 1.17.0

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/build.log CHANGED
@@ -31,5 +31,5 @@ custom/skills/fetch_data/SKILL.md
31
31
  custom/skills/mutate_data/
32
32
  custom/skills/mutate_data/SKILL.md
33
33
 
34
- sent 184,918 bytes received 428 bytes 370,692.00 bytes/sec
35
- total size is 183,164 speedup is 0.99
34
+ sent 185,223 bytes received 432 bytes 371,310.00 bytes/sec
35
+ total size is 183,434 speedup is 0.99
@@ -193,6 +193,7 @@ const props = defineProps<{
193
193
  name: string;
194
194
  }>;
195
195
  defaultModeName: string | null;
196
+ stickByDefault: boolean;
196
197
  }
197
198
  }>();
198
199
 
@@ -245,6 +246,7 @@ onMounted(async () => {
245
246
  agentStore.setAvailableModes(props.meta.modes, props.meta.defaultModeName);
246
247
  agentStore.regisrerTextInput(textInput.value);
247
248
  textInput.value?.focus();
249
+ agentStore.setIsTeleportedToBody(props.meta.stickByDefault);
248
250
  await agentStore.fetchSessionsList();
249
251
  });
250
252
 
@@ -6,10 +6,16 @@
6
6
  "
7
7
  >
8
8
  <h3 :class="h3Style">{{ $t('Chat history') }}</h3>
9
- <Button @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();" :disabled="agentStore.isResponseInProgress" class="w-[360px] mx-4 my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200">
10
- <IconPlusOutline class="w-5 h-5" />
11
- {{ $t('New chat') }}
12
- </Button>
9
+ <div class="w-full flex items-center justify-center">
10
+ <Button
11
+ @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();"
12
+ :disabled="agentStore.isResponseInProgress"
13
+ class="w-[90%] my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200"
14
+ >
15
+ <IconPlusOutline class="w-5 h-5" />
16
+ {{ $t('New chat') }}
17
+ </Button>
18
+ </div>
13
19
  <div class="w-full border-b border-gray-200 dark:border-gray-700"/>
14
20
  <div class="absolute w-full h-full flex flex-col items-center justify-center bg-gray-100/50 dark:bg-gray-700/50 z-10" v-if="agentStore.isResponseInProgress">
15
21
  <Spinner class="w-8 h-8" v-if="agentStore.isResponseInProgress" />
@@ -23,11 +29,12 @@
23
29
  <button
24
30
  v-for="session in group.sessions"
25
31
  :key="session.sessionId"
26
- class="flex items-center justify-between w-full px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-200 ease-in-out text-gray-800 dark:text-gray-200"
32
+ class=" flex items-center justify-between w-full px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-200 ease-in-out text-gray-800 dark:text-gray-200"
27
33
  :class="{
28
34
  'bg-lightPrimary/20 hover:bg-lightPrimary/20 dark:bg-darkPrimary/20 dark:hover:bg-darkPrimary/20': agentStore.activeSessionId === session.sessionId,
29
- 'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress
30
- }"
35
+ 'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress,
36
+ 'pl-8': agentStore.isFullScreen
37
+ }"
31
38
  @click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false);"
32
39
  :disabled="agentStore.isResponseInProgress"
33
40
  >
@@ -25,7 +25,7 @@
25
25
  />
26
26
  </div>
27
27
  <transition name="expand">
28
- <div v-show="isInputOutputExpanded" class="max-h-72 space-y-3 overflow-y-auto pr-1">
28
+ <div v-if="isInputOutputExpanded" v-show="isInputOutputExpanded" class="max-h-72 space-y-3 overflow-y-auto pr-1">
29
29
  <section
30
30
  v-for="section in toolSections"
31
31
  :key="section.label"
@@ -193,6 +193,7 @@ const props = defineProps<{
193
193
  name: string;
194
194
  }>;
195
195
  defaultModeName: string | null;
196
+ stickByDefault: boolean;
196
197
  }
197
198
  }>();
198
199
 
@@ -245,6 +246,7 @@ onMounted(async () => {
245
246
  agentStore.setAvailableModes(props.meta.modes, props.meta.defaultModeName);
246
247
  agentStore.regisrerTextInput(textInput.value);
247
248
  textInput.value?.focus();
249
+ agentStore.setIsTeleportedToBody(props.meta.stickByDefault);
248
250
  await agentStore.fetchSessionsList();
249
251
  });
250
252
 
@@ -6,10 +6,16 @@
6
6
  "
7
7
  >
8
8
  <h3 :class="h3Style">{{ $t('Chat history') }}</h3>
9
- <Button @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();" :disabled="agentStore.isResponseInProgress" class="w-[360px] mx-4 my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200">
10
- <IconPlusOutline class="w-5 h-5" />
11
- {{ $t('New chat') }}
12
- </Button>
9
+ <div class="w-full flex items-center justify-center">
10
+ <Button
11
+ @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();"
12
+ :disabled="agentStore.isResponseInProgress"
13
+ class="w-[90%] my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200"
14
+ >
15
+ <IconPlusOutline class="w-5 h-5" />
16
+ {{ $t('New chat') }}
17
+ </Button>
18
+ </div>
13
19
  <div class="w-full border-b border-gray-200 dark:border-gray-700"/>
14
20
  <div class="absolute w-full h-full flex flex-col items-center justify-center bg-gray-100/50 dark:bg-gray-700/50 z-10" v-if="agentStore.isResponseInProgress">
15
21
  <Spinner class="w-8 h-8" v-if="agentStore.isResponseInProgress" />
@@ -23,11 +29,12 @@
23
29
  <button
24
30
  v-for="session in group.sessions"
25
31
  :key="session.sessionId"
26
- class="flex items-center justify-between w-full px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-200 ease-in-out text-gray-800 dark:text-gray-200"
32
+ class=" flex items-center justify-between w-full px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-200 ease-in-out text-gray-800 dark:text-gray-200"
27
33
  :class="{
28
34
  'bg-lightPrimary/20 hover:bg-lightPrimary/20 dark:bg-darkPrimary/20 dark:hover:bg-darkPrimary/20': agentStore.activeSessionId === session.sessionId,
29
- 'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress
30
- }"
35
+ 'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress,
36
+ 'pl-8': agentStore.isFullScreen
37
+ }"
31
38
  @click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false);"
32
39
  :disabled="agentStore.isResponseInProgress"
33
40
  >
@@ -25,7 +25,7 @@
25
25
  />
26
26
  </div>
27
27
  <transition name="expand">
28
- <div v-show="isInputOutputExpanded" class="max-h-72 space-y-3 overflow-y-auto pr-1">
28
+ <div v-if="isInputOutputExpanded" v-show="isInputOutputExpanded" class="max-h-72 space-y-3 overflow-y-auto pr-1">
29
29
  <section
30
30
  v-for="section in toolSections"
31
31
  :key="section.label"
package/dist/index.js CHANGED
@@ -100,7 +100,7 @@ export default class AdminForthAgentPlugin extends AdminForthPlugin {
100
100
  modifyResourceConfig: { get: () => super.modifyResourceConfig }
101
101
  });
102
102
  return __awaiter(this, void 0, void 0, function* () {
103
- var _a;
103
+ var _a, _b;
104
104
  _super.modifyResourceConfig.call(this, adminforth, resourceConfig);
105
105
  if (!((_a = this.options.modes) === null || _a === void 0 ? void 0 : _a.length)) {
106
106
  throw new Error("modes is required for AdminForthAgentPlugin");
@@ -114,6 +114,7 @@ export default class AdminForthAgentPlugin extends AdminForthPlugin {
114
114
  pluginInstanceId: this.pluginInstanceId,
115
115
  modes: this.options.modes.map((mode) => ({ name: mode.name })),
116
116
  defaultModeName: this.options.modes[0].name,
117
+ stickByDefault: (_b = this.options.stickByDefault) !== null && _b !== void 0 ? _b : false,
117
118
  }
118
119
  });
119
120
  if (!this.pluginOptions.sessionResource) {
package/index.ts CHANGED
@@ -130,6 +130,7 @@ export default class AdminForthAgentPlugin extends AdminForthPlugin {
130
130
  pluginInstanceId: this.pluginInstanceId,
131
131
  modes: this.options.modes.map((mode) => ({ name: mode.name })),
132
132
  defaultModeName: this.options.modes[0].name,
133
+ stickByDefault: this.options.stickByDefault ?? false,
133
134
  }
134
135
  });
135
136
  if (!this.pluginOptions.sessionResource) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.16.3",
3
+ "version": "1.17.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
package/types.ts CHANGED
@@ -70,4 +70,9 @@ export interface PluginOptions extends PluginsCommonOptions {
70
70
  * Resource configuration for turns.
71
71
  */
72
72
  turnResource: ITurnResource;
73
+
74
+ /**
75
+ * Makes chat sticky by default. By default this prop is false
76
+ */
77
+ stickByDefault?: boolean;
73
78
  }