@adecore/agents-react 0.55.2 → 0.56.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.
@@ -45,11 +45,11 @@ function Elapsed(t0) {
45
45
  }
46
46
  /*
47
47
  * One agent of a workflow: its label, what it does or did, and its time. It opens the agent's
48
- * conversation when `onOpen` is given and the agent started; one still waiting has no transcript yet.
49
- * `selected` marks the agent whose conversation is open beside it.
48
+ * conversation when `onOpen` is given and the agent started; one still waiting has no transcript yet
49
+ * and, like a line without `onOpen`, draws no arrow. `selected` marks the agent whose conversation is open beside it.
50
50
  */
51
51
  export function WorkflowAgentLine(t0) {
52
- const $ = _c(56);
52
+ const $ = _c(54);
53
53
  const {
54
54
  view,
55
55
  provider,
@@ -235,63 +235,54 @@ export function WorkflowAgentLine(t0) {
235
235
  } else {
236
236
  t20 = $[37];
237
237
  }
238
- const t21 = open === undefined && "invisible";
239
- let t22;
240
- if ($[38] !== t21) {
241
- t22 = clsx("shrink-0 text-text-faint", t21);
242
- $[38] = t21;
243
- $[39] = t22;
244
- } else {
245
- t22 = $[39];
246
- }
247
- let t23;
248
- if ($[40] !== t22) {
249
- t23 = /*#__PURE__*/_jsx(Icon, {
238
+ let t21;
239
+ if ($[38] !== open) {
240
+ t21 = open !== undefined && /*#__PURE__*/_jsx(Icon, {
250
241
  icon: ChevronRight,
251
242
  size: 12,
252
- className: t22
243
+ className: "shrink-0 text-text-faint"
253
244
  });
254
- $[40] = t22;
255
- $[41] = t23;
245
+ $[38] = open;
246
+ $[39] = t21;
256
247
  } else {
257
- t23 = $[41];
248
+ t21 = $[39];
258
249
  }
259
- let t24;
260
- if ($[42] !== t19 || $[43] !== t20 || $[44] !== t23) {
261
- t24 = /*#__PURE__*/_jsxs("span", {
250
+ let t22;
251
+ if ($[40] !== t19 || $[41] !== t20 || $[42] !== t21) {
252
+ t22 = /*#__PURE__*/_jsxs("span", {
262
253
  className: "flex h-5 shrink-0 items-center gap-2",
263
- children: [t19, t20, t23]
254
+ children: [t19, t20, t21]
264
255
  });
265
- $[42] = t19;
266
- $[43] = t20;
267
- $[44] = t23;
268
- $[45] = t24;
256
+ $[40] = t19;
257
+ $[41] = t20;
258
+ $[42] = t21;
259
+ $[43] = t22;
269
260
  } else {
270
- t24 = $[45];
261
+ t22 = $[43];
271
262
  }
272
- let t25;
273
- if ($[46] !== agent.index || $[47] !== open || $[48] !== ref || $[49] !== selected || $[50] !== t13 || $[51] !== t18 || $[52] !== t24 || $[53] !== t6 || $[54] !== t7) {
274
- t25 = /*#__PURE__*/_jsxs("button", {
263
+ let t23;
264
+ if ($[44] !== agent.index || $[45] !== open || $[46] !== ref || $[47] !== selected || $[48] !== t13 || $[49] !== t18 || $[50] !== t22 || $[51] !== t6 || $[52] !== t7) {
265
+ t23 = /*#__PURE__*/_jsxs("button", {
275
266
  ref: ref,
276
267
  "data-workflow-agent": t4,
277
268
  "aria-pressed": selected,
278
269
  className: t6,
279
270
  disabled: t7,
280
271
  onClick: open,
281
- children: [t13, t18, t24]
272
+ children: [t13, t18, t22]
282
273
  });
283
- $[46] = agent.index;
284
- $[47] = open;
285
- $[48] = ref;
286
- $[49] = selected;
287
- $[50] = t13;
288
- $[51] = t18;
289
- $[52] = t24;
290
- $[53] = t6;
291
- $[54] = t7;
292
- $[55] = t25;
274
+ $[44] = agent.index;
275
+ $[45] = open;
276
+ $[46] = ref;
277
+ $[47] = selected;
278
+ $[48] = t13;
279
+ $[49] = t18;
280
+ $[50] = t22;
281
+ $[51] = t6;
282
+ $[52] = t7;
283
+ $[53] = t23;
293
284
  } else {
294
- t25 = $[55];
285
+ t23 = $[53];
295
286
  }
296
- return t25;
287
+ return t23;
297
288
  }
@@ -35,4 +35,5 @@ export declare function useHostReplyAuthor(...args: Parameters<ChatHost['useRepl
35
35
  export declare function useHostMapSource(maps: NonNullable<ChatHost['maps']>, scopeId: string): ReturnType<NonNullable<ChatHost['maps']>['useSource']>;
36
36
  export declare function useCommandNames(look: Required<Pick<CommandLook, 'useNames'>>, scopeId: string, chatId: string): ReturnType<NonNullable<CommandLook['useNames']>>;
37
37
  export declare function useHostCanReorderAccounts(scopeId: string): boolean;
38
+ export declare function useHostCanShareAccountConfig(scopeId: string): boolean;
38
39
  export declare function useHostAccountRule(scopeId: string, chatId: string): AccountRule | null;
@@ -109,6 +109,10 @@ export function useHostCanReorderAccounts(scopeId) {
109
109
  const useCanReorder = useChatHost().useCanReorderAccounts ?? (() => true);
110
110
  return useCanReorder(scopeId);
111
111
  }
112
+ export function useHostCanShareAccountConfig(scopeId) {
113
+ const useCanShare = useChatHost().useCanShareAccountConfig ?? (() => false);
114
+ return useCanShare(scopeId);
115
+ }
112
116
  export function useHostAccountRule(scopeId, chatId) {
113
117
  const useRule = useChatHost().useAccountRule ?? (() => null);
114
118
  return useRule(scopeId, chatId);
package/dist/host.d.ts CHANGED
@@ -377,6 +377,7 @@ export interface ChatHost {
377
377
  openLogin: ((scopeId: string, kind: AgentKind, accountId: string, name: string) => Promise<void>) | null;
378
378
  useLoginBlocked(scopeId: string): string | null;
379
379
  useCanReorderAccounts?(scopeId: string): boolean;
380
+ useCanShareAccountConfig?(scopeId: string): boolean;
380
381
  useAccountRule?(scopeId: string, chatId: string): AccountRule | null;
381
382
  runProviderCommand?(scopeId: string, kind: AgentKind, command: string): void;
382
383
  useMachinePlatform?(scopeId: string): ProviderPlatform | null;
@@ -150,6 +150,11 @@ declare const _default: {
150
150
  };
151
151
  saveFailed: string;
152
152
  reorderFailed: string;
153
+ shareConfigFailed: string;
154
+ shareConfig: {
155
+ label: string;
156
+ description: string;
157
+ };
153
158
  };
154
159
  add: {
155
160
  title: string;
@@ -149,7 +149,12 @@ export default {
149
149
  confirm: 'Remove account'
150
150
  },
151
151
  saveFailed: 'Could not save the account',
152
- reorderFailed: 'Could not change the order of the accounts'
152
+ reorderFailed: 'Could not change the order of the accounts',
153
+ shareConfigFailed: 'Could not change what this account shares',
154
+ shareConfig: {
155
+ label: 'Use the setup of the default account',
156
+ description: 'Instructions, skills, agents and commands come from the default {{provider}} account. Sign-in and history stay apart.'
157
+ }
153
158
  },
154
159
  add: {
155
160
  title: 'Add {{provider}} account',
@@ -150,6 +150,11 @@ declare const _default: {
150
150
  };
151
151
  saveFailed: string;
152
152
  reorderFailed: string;
153
+ shareConfigFailed: string;
154
+ shareConfig: {
155
+ label: string;
156
+ description: string;
157
+ };
153
158
  };
154
159
  add: {
155
160
  title: string;
@@ -149,7 +149,12 @@ export default {
149
149
  confirm: 'Account verwijderen'
150
150
  },
151
151
  saveFailed: 'Kon het account niet opslaan',
152
- reorderFailed: 'Kon de volgorde van de accounts niet wijzigen'
152
+ reorderFailed: 'Kon de volgorde van de accounts niet wijzigen',
153
+ shareConfigFailed: 'Kon niet wijzigen wat dit account deelt',
154
+ shareConfig: {
155
+ label: 'De opzet van het standaardaccount gebruiken',
156
+ description: "Instructies, skills, agents en commando's komen van het standaardaccount van {{provider}}. Inloggen en geschiedenis blijven apart."
157
+ }
153
158
  },
154
159
  add: {
155
160
  title: '{{provider}}-account toevoegen',