@design.estate/dees-catalog 21.32.3 → 21.33.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/dist_bundle/bundle.js +1545 -332
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-ZRD47DC6.js → chunk-B3NM6BL3.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-EL3KNDIB.js → chunk-BDUZ7I23.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-LDC2GECY.js → chunk-IK5OF7M4.js} +33 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-LDC2GECY.js.map → chunk-IK5OF7M4.js.map} +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-YOX3NS2W.js → de-PTMMQ5DA.js} +33 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-PTMMQ5DA.js.map +1 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-7LJGK5SK.js → dees-modal-BZIJFVRI.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-O3NEQ4DO.js → dees-workspace-terminal-EU377EZY.js} +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-chart/dees-chart-area/component.d.ts +18 -0
- package/dist_ts_web/elements/00group-chart/dees-chart-area/component.js +60 -2
- package/dist_ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.d.ts +24 -0
- package/dist_ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.js +80 -0
- package/dist_ts_web/elements/00group-feedback/dees-hint/dees-hint.d.ts +1 -0
- package/dist_ts_web/elements/00group-feedback/dees-hint/dees-hint.js +13 -3
- package/dist_ts_web/elements/00group-harness/dees-harness-message-list/dees-harness-message-list.js +7 -5
- package/dist_ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.d.ts +0 -3
- package/dist_ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.js +10 -182
- package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.d.ts +64 -1
- package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.demo.js +221 -22
- package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.js +544 -66
- package/dist_ts_web/elements/00group-harness/harness.helpers.d.ts +16 -1
- package/dist_ts_web/elements/00group-harness/harness.helpers.js +25 -1
- package/dist_ts_web/elements/00group-harness/harness.records.d.ts +27 -0
- package/dist_ts_web/elements/00group-harness/harness.records.js +193 -0
- package/dist_ts_web/elements/00group-harness/interfaces.d.ts +93 -4
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.d.ts +39 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.js +22 -8
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.js +265 -25
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.d.ts +5 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.js +70 -11
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.d.ts +16 -1
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.js +188 -5
- package/dist_ts_web/elements/00group-kanban/interfaces.d.ts +47 -2
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.d.ts +7 -1
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.js +49 -7
- package/dist_ts_web/elements/00group-kanban/kanban.dragcontroller.js +6 -1
- package/dist_ts_web/elements/00group-kanban/kanban.helpers.d.ts +15 -1
- package/dist_ts_web/elements/00group-kanban/kanban.helpers.js +31 -1
- package/dist_ts_web/i18n/de.d.ts +124 -0
- package/dist_ts_web/i18n/de.js +32 -1
- package/dist_ts_web/i18n/messages.d.ts +124 -0
- package/dist_ts_web/i18n/messages.js +32 -1
- package/package.json +1 -1
- package/readme.md +76 -13
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-chart/dees-chart-area/component.ts +59 -1
- package/ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.ts +97 -0
- package/ts_web/elements/00group-feedback/dees-hint/dees-hint.ts +16 -3
- package/ts_web/elements/00group-harness/dees-harness-message-list/dees-harness-message-list.ts +6 -4
- package/ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.ts +16 -186
- package/ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.demo.ts +261 -55
- package/ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.ts +575 -88
- package/ts_web/elements/00group-harness/harness.helpers.ts +39 -0
- package/ts_web/elements/00group-harness/harness.records.ts +210 -0
- package/ts_web/elements/00group-harness/interfaces.ts +99 -4
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.ts +21 -5
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.ts +256 -24
- package/ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.ts +67 -6
- package/ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.ts +202 -1
- package/ts_web/elements/00group-kanban/interfaces.ts +55 -3
- package/ts_web/elements/00group-kanban/kanban.demodata.ts +62 -6
- package/ts_web/elements/00group-kanban/kanban.dragcontroller.ts +5 -0
- package/ts_web/elements/00group-kanban/kanban.helpers.ts +53 -0
- package/ts_web/i18n/de.ts +31 -0
- package/ts_web/i18n/messages.ts +31 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-YOX3NS2W.js.map +0 -1
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-ZRD47DC6.js.map → chunk-B3NM6BL3.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-EL3KNDIB.js.map → chunk-BDUZ7I23.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-7LJGK5SK.js.map → dees-modal-BZIJFVRI.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-O3NEQ4DO.js.map → dees-workspace-terminal-EU377EZY.js.map} +0 -0
|
@@ -5,9 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type {
|
|
7
7
|
IHarnessMessage,
|
|
8
|
+
IHarnessQuestionRequest,
|
|
8
9
|
IHarnessTodoItem,
|
|
9
10
|
IHarnessToolCall,
|
|
10
11
|
THarnessMessageStreamDelta,
|
|
12
|
+
THarnessProposalState,
|
|
13
|
+
THarnessQuestionSeverity,
|
|
11
14
|
THarnessToolStatus,
|
|
12
15
|
} from './interfaces.js';
|
|
13
16
|
import { dcSourceWords, type TDcLocalizer, type TDcTranslator } from '../../i18n/messages.js';
|
|
@@ -24,6 +27,42 @@ import {
|
|
|
24
27
|
export const harnessMaxAttachmentBytes = 10 * 1024 * 1024;
|
|
25
28
|
export const harnessMaxTotalAttachmentBytes = 30 * 1024 * 1024;
|
|
26
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Where a proposal stands: the host's `state` once it set one past pending, else what the answer
|
|
32
|
+
* tells (`responseArg`, the request's own by default): `['confirm']` confirmed, any other answer
|
|
33
|
+
* declined, none pending. Changes under way (a `running` outcome) were confirmed, answer or not.
|
|
34
|
+
*/
|
|
35
|
+
export const harnessProposalState = (
|
|
36
|
+
requestArg: IHarnessQuestionRequest,
|
|
37
|
+
responseArg: readonly string[] | undefined = requestArg.response,
|
|
38
|
+
): THarnessProposalState => {
|
|
39
|
+
if (requestArg.state && requestArg.state !== 'pending') return requestArg.state;
|
|
40
|
+
if (responseArg === undefined) return requestArg.outcome?.tone === 'running' ? 'confirmed' : 'pending';
|
|
41
|
+
return responseArg[0] === 'confirm' ? 'confirmed' : 'declined';
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** Whether a question still waits for the reader: unanswered, and for a proposal neither expired nor failed. */
|
|
45
|
+
export const harnessQuestionPending = (requestArg: IHarnessQuestionRequest): boolean =>
|
|
46
|
+
requestArg.kind === 'proposal' ? harnessProposalState(requestArg) === 'pending' : requestArg.response === undefined;
|
|
47
|
+
|
|
48
|
+
const SEVERITY_RANK: Record<THarnessQuestionSeverity, number> = { info: 0, warning: 1, danger: 2 };
|
|
49
|
+
|
|
50
|
+
/** How much attention a question or proposal asks for: the highest of its own `severity` and its changes'. */
|
|
51
|
+
export const harnessQuestionSeverity = (requestArg: IHarnessQuestionRequest): THarnessQuestionSeverity =>
|
|
52
|
+
(requestArg.items ?? []).reduce<THarnessQuestionSeverity>(
|
|
53
|
+
(highest, item) => SEVERITY_RANK[item.severity ?? 'info'] > SEVERITY_RANK[highest] ? item.severity! : highest,
|
|
54
|
+
requestArg.severity ?? 'info',
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The request without the secrets its changes issued: what may leave the reader's screen, to an
|
|
59
|
+
* event, a log or the model. The same object when no change carries a `credential`.
|
|
60
|
+
*/
|
|
61
|
+
export const harnessWithoutCredentials = (requestArg: IHarnessQuestionRequest): IHarnessQuestionRequest =>
|
|
62
|
+
requestArg.items?.some((item) => item.credential !== undefined)
|
|
63
|
+
? { ...requestArg, items: requestArg.items.map(({ credential: _credential, ...item }) => item) }
|
|
64
|
+
: requestArg;
|
|
65
|
+
|
|
27
66
|
/** A host may withdraw only a prompt that is still in its own queue or held locally. */
|
|
28
67
|
export const harnessCanWithdrawPending = (messageArg: IHarnessMessage): boolean =>
|
|
29
68
|
messageArg.role === 'user'
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { css, html, type CSSResult, type TemplateResult } from '@design.estate/dees-element';
|
|
2
|
+
import type { TDcLocalizer } from '../../i18n/messages.js';
|
|
3
|
+
import { visuallyHidden } from '../00visuallyhidden.js';
|
|
4
|
+
import type {
|
|
5
|
+
IHarnessPermissionChange,
|
|
6
|
+
IHarnessPermissionOutcome,
|
|
7
|
+
THarnessPermissionOutcomeTone,
|
|
8
|
+
} from './interfaces.js';
|
|
9
|
+
import '../00group-utility/dees-icon/dees-icon.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The records a permission request or a proposal acts on, as both cards list them: each record a
|
|
13
|
+
* row with its name (a link where it opens), the fields it changes before and after, and what
|
|
14
|
+
* came of it. The rows share one bordered list; a long list shows its first records and the rest
|
|
15
|
+
* behind "Show more".
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** How many records a list shows before the rest wait behind "Show more". */
|
|
19
|
+
export const harnessRecordsShown = 5;
|
|
20
|
+
|
|
21
|
+
const OUTCOME_ICON: Record<THarnessPermissionOutcomeTone, string> = {
|
|
22
|
+
running: 'lucide:LoaderCircle',
|
|
23
|
+
success: 'lucide:CircleCheck',
|
|
24
|
+
warning: 'lucide:TriangleAlert',
|
|
25
|
+
error: 'lucide:CircleX',
|
|
26
|
+
neutral: 'lucide:Info',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const harnessRecordStyles: CSSResult = css`
|
|
30
|
+
.items {
|
|
31
|
+
list-style: none;
|
|
32
|
+
margin: 12px 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
border: var(--dees-line-width-hairline) solid var(--dees-color-control-border);
|
|
35
|
+
border-radius: var(--dees-radius-lg);
|
|
36
|
+
background: var(--dees-color-control-bg);
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.item {
|
|
41
|
+
display: grid;
|
|
42
|
+
gap: 4px;
|
|
43
|
+
padding: 8px 12px;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.item + .item {
|
|
48
|
+
border-top: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.itemHead {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: var(--dees-spacing-sm);
|
|
55
|
+
min-width: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.itemLabel {
|
|
59
|
+
flex: 1;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
color: var(--dees-color-text-primary);
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
overflow-wrap: anywhere;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
a.itemLabel {
|
|
67
|
+
color: var(--dees-color-accent-primary);
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
border-radius: var(--dees-radius-xs);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
a.itemLabel:hover {
|
|
73
|
+
text-decoration: underline;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
a.itemLabel:focus-visible {
|
|
77
|
+
outline: var(--dees-line-width-focus-ring) solid var(--dees-color-focus-ring);
|
|
78
|
+
outline-offset: 2px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.changes {
|
|
82
|
+
display: grid;
|
|
83
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
84
|
+
gap: var(--dees-spacing-2xs) var(--dees-spacing-md);
|
|
85
|
+
margin: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.changes dt {
|
|
89
|
+
color: var(--dees-color-text-secondary);
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.changes dd {
|
|
94
|
+
margin: 0;
|
|
95
|
+
color: var(--dees-color-text-primary);
|
|
96
|
+
overflow-wrap: anywhere;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.before {
|
|
100
|
+
color: var(--dees-color-text-secondary);
|
|
101
|
+
text-decoration: line-through;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.arrow {
|
|
105
|
+
margin: 0 4px;
|
|
106
|
+
color: var(--dees-color-text-secondary);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.moreItems {
|
|
110
|
+
margin: -4px 0 12px;
|
|
111
|
+
padding: 0;
|
|
112
|
+
border: none;
|
|
113
|
+
background: none;
|
|
114
|
+
color: var(--dees-color-accent-primary);
|
|
115
|
+
font: inherit;
|
|
116
|
+
font-size: var(--dees-font-caption1-size, 11px);
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
border-radius: var(--dees-radius-xs);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.moreItems:hover {
|
|
122
|
+
text-decoration: underline;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.outcome {
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 6px;
|
|
129
|
+
min-width: 0;
|
|
130
|
+
color: var(--dees-color-text-secondary);
|
|
131
|
+
font-size: var(--dees-font-caption1-size, 11px);
|
|
132
|
+
overflow-wrap: anywhere;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.item .outcome {
|
|
136
|
+
flex: 0 1 auto;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.outcome dees-icon {
|
|
140
|
+
flex: 0 0 auto;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.outcome.tone-running dees-icon { color: var(--dees-color-accent-primary); }
|
|
144
|
+
.outcome.tone-success dees-icon { color: var(--dees-color-accent-success); }
|
|
145
|
+
.outcome.tone-warning dees-icon { color: var(--dees-color-accent-warning); }
|
|
146
|
+
.outcome.tone-error dees-icon { color: var(--dees-color-accent-error); }
|
|
147
|
+
.outcome.tone-error { color: var(--dees-color-text-primary); }
|
|
148
|
+
|
|
149
|
+
.srOnly { ${visuallyHidden} }
|
|
150
|
+
`;
|
|
151
|
+
|
|
152
|
+
/** The records a list shows: all while expanded or short, else the first few. */
|
|
153
|
+
export const harnessShownRecords = <T>(recordsArg: readonly T[], expandedArg: boolean): readonly T[] =>
|
|
154
|
+
expandedArg || recordsArg.length <= harnessRecordsShown ? recordsArg : recordsArg.slice(0, harnessRecordsShown);
|
|
155
|
+
|
|
156
|
+
/** "Show N more" under a long list, or "Show fewer" once it shows every record; nothing under a short one. */
|
|
157
|
+
export const renderHarnessMoreRecords = (
|
|
158
|
+
tArg: TDcLocalizer,
|
|
159
|
+
countArg: number,
|
|
160
|
+
expandedArg: boolean,
|
|
161
|
+
toggleArg: () => void,
|
|
162
|
+
): TemplateResult | string => {
|
|
163
|
+
const hidden = countArg - harnessRecordsShown;
|
|
164
|
+
if (hidden <= 0) return '';
|
|
165
|
+
return html`
|
|
166
|
+
<button class="moreItems" type="button" aria-expanded=${expandedArg ? 'true' : 'false'} @click=${toggleArg}>
|
|
167
|
+
${expandedArg ? tArg('permission.fewerItems') : tArg('permission.moreItems', { count: hidden })}
|
|
168
|
+
</button>
|
|
169
|
+
`;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/** What changes in a record: each field, its value before struck through, and after. */
|
|
173
|
+
export const renderHarnessChanges = (tArg: TDcLocalizer, changesArg: readonly IHarnessPermissionChange[]): TemplateResult => html`
|
|
174
|
+
<dl class="changes">
|
|
175
|
+
${changesArg.map((change) => html`
|
|
176
|
+
<dt>${change.label}</dt>
|
|
177
|
+
<dd>
|
|
178
|
+
<span aria-hidden="true">${change.before !== undefined
|
|
179
|
+
? html`<span class="before">${change.before}</span><span class="arrow">→</span>`
|
|
180
|
+
: ''}<span class="after">${change.after}</span></span>
|
|
181
|
+
<span class="srOnly">${change.before !== undefined
|
|
182
|
+
? tArg('permission.change', { label: change.label, before: change.before, after: change.after })
|
|
183
|
+
: tArg('permission.changeNew', { label: change.label, after: change.after })}</span>
|
|
184
|
+
</dd>
|
|
185
|
+
`)}
|
|
186
|
+
</dl>
|
|
187
|
+
`;
|
|
188
|
+
|
|
189
|
+
/** What came of a request or a record: its tone's icon (a spinner while under way) and the host's words. */
|
|
190
|
+
export const renderHarnessOutcome = (outcomeArg: IHarnessPermissionOutcome): TemplateResult => html`
|
|
191
|
+
<span class="outcome tone-${outcomeArg.tone}" role="status">
|
|
192
|
+
<dees-icon
|
|
193
|
+
class=${outcomeArg.tone === 'running' ? 'harnessActivity' : ''}
|
|
194
|
+
icon=${OUTCOME_ICON[outcomeArg.tone]}
|
|
195
|
+
iconSize="13"
|
|
196
|
+
aria-hidden="true"
|
|
197
|
+
></dees-icon>
|
|
198
|
+
<span>${outcomeArg.text}</span>
|
|
199
|
+
</span>
|
|
200
|
+
`;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* A record's link was activated: the host may route it itself, so the card emits its cancelable
|
|
204
|
+
* event first (`dispatchArg` answers whether it went uncanceled) and follows the link only then.
|
|
205
|
+
* A modified or other-button click is left to the browser.
|
|
206
|
+
*/
|
|
207
|
+
export const routeHarnessRecordLink = (eventArg: MouseEvent, dispatchArg: () => boolean): void => {
|
|
208
|
+
if (eventArg.button !== 0 || eventArg.metaKey || eventArg.ctrlKey || eventArg.shiftKey || eventArg.altKey) return;
|
|
209
|
+
if (!dispatchArg()) eventArg.preventDefault();
|
|
210
|
+
};
|
|
@@ -92,6 +92,10 @@ export interface IHarnessQuestionViewState {
|
|
|
92
92
|
answered?: string[];
|
|
93
93
|
selected?: string[];
|
|
94
94
|
customText?: string;
|
|
95
|
+
/** the reader showed every change of a long proposal */
|
|
96
|
+
itemsExpanded?: boolean;
|
|
97
|
+
/** the changes the reader left out of a proposal, by item id */
|
|
98
|
+
declinedItemIds?: string[];
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
/** Complete interaction state for rows that a virtual transcript may evict. */
|
|
@@ -450,30 +454,121 @@ export interface IHarnessQuestionOption {
|
|
|
450
454
|
description?: string;
|
|
451
455
|
}
|
|
452
456
|
|
|
457
|
+
/** What a card asks of the reader: an answer (`question`), or a decision on changes the agent proposes (`proposal`). */
|
|
458
|
+
export type THarnessQuestionKind = 'question' | 'proposal';
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* How much attention a card or a proposed change asks for: `info` as any question, `warning`
|
|
462
|
+
* (orange) for a change that is hard to take back, `danger` (red) for one that deletes, sends or
|
|
463
|
+
* cannot be taken back. The card shows it by its icon and border, and names it to assistive
|
|
464
|
+
* technology; a proposal asks for the highest of its own and its changes'.
|
|
465
|
+
*/
|
|
466
|
+
export type THarnessQuestionSeverity = 'info' | 'warning' | 'danger';
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Where a proposal stands: `pending` until the reader decides, `confirmed` or `declined` by the
|
|
470
|
+
* reader's answer, `expired` once it can no longer be decided, `failed` when carrying it out
|
|
471
|
+
* failed. Every state but `pending` is read-only.
|
|
472
|
+
*/
|
|
473
|
+
export type THarnessProposalState = 'pending' | 'confirmed' | 'declined' | 'expired' | 'failed';
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* A secret a carried-out change issued, such as a new API key: for the reader's eyes only. The
|
|
477
|
+
* card shows it masked until the reader asks to see it, copies it on request, and never puts it
|
|
478
|
+
* in an event it emits; keep it out of what goes back to the model with `harnessWithoutCredentials()`.
|
|
479
|
+
*/
|
|
480
|
+
export interface IHarnessProposalCredential {
|
|
481
|
+
/** what it is: "API key" */
|
|
482
|
+
label: string;
|
|
483
|
+
/** the secret itself */
|
|
484
|
+
value: string;
|
|
485
|
+
/** under it, in the host's words: "Shown once. Store it now." Unset, the catalog's: only the reader sees it */
|
|
486
|
+
note?: string;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* One change a proposal makes: what will happen, in words; the record it acts on, a link where it
|
|
491
|
+
* opens (the card emits the cancelable `harness-question-link` first); its fields before and
|
|
492
|
+
* after, where the host gives them; and what came of it once carried out.
|
|
493
|
+
*/
|
|
494
|
+
export interface IHarnessProposalItem {
|
|
495
|
+
/** stable across updates of the proposal: the reader leaves a change out by it (`declinedItemIds`) */
|
|
496
|
+
id: string;
|
|
497
|
+
/** what will happen, in the host's words: "Books the invoice to 8400 Revenue" */
|
|
498
|
+
summary: string;
|
|
499
|
+
/** the record it acts on: "Invoice R-2026-0142" */
|
|
500
|
+
label?: string;
|
|
501
|
+
href?: string;
|
|
502
|
+
/** unset, `info`; the proposal asks for the highest severity among its own and its changes' */
|
|
503
|
+
severity?: THarnessQuestionSeverity;
|
|
504
|
+
changes?: IHarnessPermissionChange[];
|
|
505
|
+
outcome?: IHarnessPermissionOutcome;
|
|
506
|
+
/** a secret the change issued, once carried out: shown to the reader only */
|
|
507
|
+
credential?: IHarnessProposalCredential;
|
|
508
|
+
}
|
|
509
|
+
|
|
453
510
|
/**
|
|
454
|
-
* A question the agent asks the user mid-run
|
|
455
|
-
*
|
|
456
|
-
* ones persist showing the
|
|
511
|
+
* A question the agent asks the user mid-run, or a proposal of changes it would make once the
|
|
512
|
+
* user confirms them (`kind: 'proposal'`). Renders inline in the transcript like permissions:
|
|
513
|
+
* pending ones pin to the end, answered and decided ones persist showing the answer(s).
|
|
457
514
|
*/
|
|
458
515
|
export interface IHarnessQuestionRequest {
|
|
459
516
|
id: string;
|
|
460
517
|
sessionId?: string;
|
|
461
518
|
/** epoch ms */
|
|
462
519
|
createdAt?: number;
|
|
520
|
+
/** the question, or what the proposal asks to confirm: "Book these three invoices?" */
|
|
463
521
|
question: string;
|
|
522
|
+
/** unset, `question` */
|
|
523
|
+
kind?: THarnessQuestionKind;
|
|
524
|
+
/** unset, `info` */
|
|
525
|
+
severity?: THarnessQuestionSeverity;
|
|
464
526
|
options?: IHarnessQuestionOption[];
|
|
465
527
|
multiSelect?: boolean;
|
|
466
528
|
/** allow a free-text answer alongside the options (default true) */
|
|
467
529
|
allowCustom?: boolean;
|
|
468
|
-
/**
|
|
530
|
+
/** a proposal's changes: one, or several collected into one decision */
|
|
531
|
+
items?: IHarnessProposalItem[];
|
|
532
|
+
/**
|
|
533
|
+
* the reader may leave single changes out of a proposal of two or more before confirming it;
|
|
534
|
+
* the confirmation then names them (`declinedItemIds`). Unset, the proposal is decided whole.
|
|
535
|
+
*/
|
|
536
|
+
itemsDeclinable?: boolean;
|
|
537
|
+
/** the words of a proposal's buttons; unset, the catalog's "Confirm" and "Decline" */
|
|
538
|
+
confirmLabel?: string;
|
|
539
|
+
declineLabel?: string;
|
|
540
|
+
/**
|
|
541
|
+
* set once answered — the card stays in the transcript showing the answer. A proposal is
|
|
542
|
+
* answered `['confirm']` or `['decline']`.
|
|
543
|
+
*/
|
|
469
544
|
response?: string[];
|
|
470
545
|
/** epoch ms */
|
|
471
546
|
respondedAt?: number;
|
|
547
|
+
/** the changes the reader left out of a confirmed proposal, as the response named them */
|
|
548
|
+
declinedItemIds?: string[];
|
|
549
|
+
/**
|
|
550
|
+
* a proposal's state, set by the host where the answer does not tell it: `expired` or
|
|
551
|
+
* `failed`. Unset, the answer tells it: `['confirm']` confirmed, `['decline']` declined, none
|
|
552
|
+
* pending.
|
|
553
|
+
*/
|
|
554
|
+
state?: THarnessProposalState;
|
|
555
|
+
/** what came of a proposal, in the host's words, beside its state: being carried out, done, failed */
|
|
556
|
+
outcome?: IHarnessPermissionOutcome;
|
|
472
557
|
}
|
|
473
558
|
|
|
474
559
|
export interface IHarnessQuestionResponseDetail {
|
|
475
560
|
requestId: string;
|
|
476
561
|
answers: string[];
|
|
562
|
+
/** with `['confirm']` of a proposal whose reader left changes out: their item ids */
|
|
563
|
+
declinedItemIds?: string[];
|
|
564
|
+
/** the request, without any `credential` of its items */
|
|
565
|
+
request: IHarnessQuestionRequest;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/** Detail of the cancelable `harness-question-link`: a proposed change's link was activated. Neither carries a `credential`. */
|
|
569
|
+
export interface IHarnessQuestionLinkDetail {
|
|
570
|
+
requestId: string;
|
|
571
|
+
item: IHarnessProposalItem;
|
|
477
572
|
request: IHarnessQuestionRequest;
|
|
478
573
|
}
|
|
479
574
|
|
|
@@ -5,12 +5,13 @@ import {
|
|
|
5
5
|
kanbanDemoColumns,
|
|
6
6
|
kanbanDemoPeople,
|
|
7
7
|
kanbanDemoProjects,
|
|
8
|
+
kanbanDemoReleasedColumn,
|
|
8
9
|
} from '../kanban.demodata.js';
|
|
9
10
|
import type { DeesKanban } from './dees-kanban.js';
|
|
10
11
|
import '../../00group-button/dees-button/dees-button.js';
|
|
11
12
|
|
|
12
13
|
export const demoFunc = () => {
|
|
13
|
-
const demo = createKanbanDemo();
|
|
14
|
+
const demo = createKanbanDemo({ released: true });
|
|
14
15
|
const [mara, jonas, alex] = kanbanDemoPeople;
|
|
15
16
|
// A teammate's changes, one per click: the board fetches them through `refresh()`.
|
|
16
17
|
const teammate = [
|
|
@@ -23,24 +24,39 @@ export const demoFunc = () => {
|
|
|
23
24
|
() => demo.provider.moveTicket!({ ticketId: 'task-2', columnId: 'review' }),
|
|
24
25
|
];
|
|
25
26
|
let step = 0;
|
|
26
|
-
const
|
|
27
|
-
|
|
27
|
+
const boardOf = (event: Event) =>
|
|
28
|
+
(event.currentTarget as HTMLElement)
|
|
28
29
|
.closest('.dees-demo-app')!
|
|
29
30
|
.querySelector<DeesKanban>('dees-kanban')!;
|
|
31
|
+
const simulate = async (event: Event) => {
|
|
32
|
+
const board = boardOf(event);
|
|
30
33
|
demo.actAs(step % 2 ? alex : jonas);
|
|
31
34
|
await teammate[step++ % teammate.length]();
|
|
32
35
|
demo.actAs(mara);
|
|
33
36
|
await board.refresh();
|
|
34
37
|
};
|
|
38
|
+
// Edit CAT-102, close it, let Jonas rename it, then save: the provider refuses the stale edit.
|
|
39
|
+
let renames = 0;
|
|
40
|
+
const rename = async (event: Event) => {
|
|
41
|
+
const board = boardOf(event);
|
|
42
|
+
demo.actAs(jonas);
|
|
43
|
+
await demo.provider.updateTicket!({
|
|
44
|
+
ticketId: 'task-2',
|
|
45
|
+
changes: { title: `Connect related tickets (${++renames})` },
|
|
46
|
+
});
|
|
47
|
+
demo.actAs(mara);
|
|
48
|
+
await board.refresh();
|
|
49
|
+
};
|
|
35
50
|
return demoApp(html`<div class="dees-demo-row" style="padding: 0 24px 4px">
|
|
36
|
-
<p class="dees-demo-caption">Signed in as Mara Chen. Jonas and Alex work on the same board.</p>
|
|
51
|
+
<p class="dees-demo-caption">Signed in as Mara Chen. Jonas and Alex work on the same board. To see a refused stale edit, start editing CAT-102, close it, let Jonas rename it and save.</p>
|
|
37
52
|
<dees-button type="outline" size="sm" text="Simulate a teammate's change" @clicked=${simulate}></dees-button>
|
|
53
|
+
<dees-button type="outline" size="sm" text="Jonas renames CAT-102" @clicked=${rename}></dees-button>
|
|
38
54
|
</div>
|
|
39
55
|
<dees-kanban
|
|
40
56
|
heading="Product workspace"
|
|
41
57
|
currentPersonId=${mara.id}
|
|
42
58
|
.tickets=${demo.tickets}
|
|
43
|
-
.columns=${kanbanDemoColumns}
|
|
59
|
+
.columns=${[...kanbanDemoColumns, kanbanDemoReleasedColumn]}
|
|
44
60
|
.people=${kanbanDemoPeople}
|
|
45
61
|
.projects=${kanbanDemoProjects}
|
|
46
62
|
.revision=${demo.revision}
|