@things-factory/ai-assistant 10.1.104 → 10.1.106

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.
@@ -64,7 +64,7 @@ import { isDifferentConversation, resolveConversation, type AssistantMode, type
64
64
  import { parseProposalOutcomeLine, parseProposalRequestLine, proposalCardState, type ParsedProposalOutcome } from './proposal-outcome-line.js'
65
65
  import { availableTriggers, type TriggerChip } from './chat-triggers.js'
66
66
  import './entry-review.js'
67
- import { entryGroupOf, entryReadyCount, isChangeProposal, isEntryProposal, latestEntryKeys } from '../utils/entry-proposal.js'
67
+ import { entryGroupOf, entryReadyCount, entryTitle, isChangeProposal, isEntryProposal, latestEntryKeys } from '../utils/entry-proposal.js'
68
68
  import { isWorkspaceProposal, versionOfCard, workspaceAddress } from '../utils/workspace.js'
69
69
 
70
70
  interface ChatLine {
@@ -3972,7 +3972,7 @@ export class OxAssistantChat extends LitElement {
3972
3972
  <div class="proposal ${sent ? 'sent' : ''}">
3973
3973
  <md-icon>${p.icon || (p.source ? 'view_in_ar' : 'bolt')}</md-icon>
3974
3974
  <span class="pbody">
3975
- <span class="plabel">${entry && p.labelKey ? i18next.t(p.labelKey) : p.label || p.command}</span>
3975
+ <span class="plabel">${entry ? entryTitle(p, (key, options) => i18next.t(key, options) as string) : p.label || p.command}</span>
3976
3976
  ${p.reason ? html`<span class="preason">${p.reason}</span>` : nothing}
3977
3977
  </span>
3978
3978
  ${/*
@@ -124,6 +124,17 @@ export function entryGroupOf(proposal: any): string {
124
124
  return `${proposal?.target}:${proposal?.op ?? 'create'}`
125
125
  }
126
126
 
127
+ /**
128
+ * The card's title - the record's name from the target (`부서`, `거래처`) and the kind of card from here, so a
129
+ * 수정안 is never titled as a 입력안.
130
+ */
131
+ export function entryTitle(proposal: any, t: (key: string, options?: any) => string): string {
132
+ const name = proposal?.labelKey ? t(proposal.labelKey) : proposal?.target ?? ''
133
+ return proposal?.op === 'update'
134
+ ? t('ai-assistant.entry.title-update', { defaultValue: '{name} to change', name })
135
+ : t('ai-assistant.entry.title-create', { defaultValue: '{name} to enter', name })
136
+ }
137
+
127
138
  export function isChangeProposal(proposal: any): boolean {
128
139
  return isEntryProposal(proposal) && proposal.op === 'update'
129
140
  }
@@ -48,7 +48,7 @@ import { isDifferentConversation, resolveConversation, pickInitialMode } from '.
48
48
  import { parseProposalOutcomeLine, parseProposalRequestLine, proposalCardState } from './proposal-outcome-line.js';
49
49
  import { availableTriggers } from './chat-triggers.js';
50
50
  import './entry-review.js';
51
- import { entryGroupOf, entryReadyCount, isChangeProposal, isEntryProposal, latestEntryKeys } from '../utils/entry-proposal.js';
51
+ import { entryGroupOf, entryReadyCount, entryTitle, isChangeProposal, isEntryProposal, latestEntryKeys } from '../utils/entry-proposal.js';
52
52
  import { isWorkspaceProposal, versionOfCard, workspaceAddress } from '../utils/workspace.js';
53
53
  function formatFileSize(bytes) {
54
54
  if (!bytes || bytes < 1024)
@@ -3527,7 +3527,7 @@ let OxAssistantChat = class OxAssistantChat extends LitElement {
3527
3527
  <div class="proposal ${sent ? 'sent' : ''}">
3528
3528
  <md-icon>${p.icon || (p.source ? 'view_in_ar' : 'bolt')}</md-icon>
3529
3529
  <span class="pbody">
3530
- <span class="plabel">${entry && p.labelKey ? i18next.t(p.labelKey) : p.label || p.command}</span>
3530
+ <span class="plabel">${entry ? entryTitle(p, (key, options) => i18next.t(key, options)) : p.label || p.command}</span>
3531
3531
  ${p.reason ? html `<span class="preason">${p.reason}</span>` : nothing}
3532
3532
  </span>
3533
3533
  ${ /*