@skillre/dsh-plugin-work-dashboard 0.0.0-stage → 0.6.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/LICENSE +21 -0
- package/README.en.md +253 -0
- package/README.md +347 -2
- package/UNINSTALL.md +7 -0
- package/compatibility.json +155 -0
- package/cordis.patch.yml +24 -0
- package/docs/DESIGN-0.3.md +122 -0
- package/docs/DETAIL.md +1 -0
- package/docs/DETAIL.zh.md +1 -0
- package/docs/preview.svg +254 -0
- package/docs/preview.zh.svg +254 -0
- package/icon.svg +17 -0
- package/lib/client/api.d.ts +35 -0
- package/lib/client/api.js +44 -0
- package/lib/client/contracts.d.ts +94 -0
- package/lib/client/contracts.js +21 -0
- package/lib/client/css/base.d.ts +31 -0
- package/lib/client/css/base.js +422 -0
- package/lib/client/css/charts.d.ts +14 -0
- package/lib/client/css/charts.js +191 -0
- package/lib/client/css/detail.d.ts +21 -0
- package/lib/client/css/detail.js +399 -0
- package/lib/client/css/insights.d.ts +27 -0
- package/lib/client/css/insights.js +660 -0
- package/lib/client/css/overview.d.ts +22 -0
- package/lib/client/css/overview.js +338 -0
- package/lib/client/preferences.d.ts +56 -0
- package/lib/client/preferences.js +118 -0
- package/lib/client/styles.d.ts +17 -0
- package/lib/client/styles.js +22 -0
- package/lib/client/text.d.ts +32 -0
- package/lib/client/text.js +934 -0
- package/lib/client/view-contract.d.ts +110 -0
- package/lib/client/view-contract.js +28 -0
- package/lib/client.js +5389 -0
- package/lib/config.d.ts +61 -0
- package/lib/config.js +67 -0
- package/lib/gap.d.ts +60 -0
- package/lib/gap.js +227 -0
- package/lib/index.d.ts +40 -0
- package/lib/index.js +130 -0
- package/lib/repo.d.ts +124 -0
- package/lib/repo.js +407 -0
- package/lib/risks.d.ts +24 -0
- package/lib/risks.js +85 -0
- package/lib/skill.d.ts +94 -0
- package/lib/skill.js +220 -0
- package/lib/store.d.ts +63 -0
- package/lib/store.js +494 -0
- package/lib/timeline.d.ts +23 -0
- package/lib/timeline.js +93 -0
- package/lib/transport.d.ts +61 -0
- package/lib/transport.js +121 -0
- package/lib/types.d.ts +612 -0
- package/lib/types.js +62 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +117 -4
- package/skills/poc-export/SKILL.md +81 -0
- package/skills/poc-export/scripts/export-form.mjs +654 -0
- package/skills/poc-ledger/SKILL.md +171 -0
- package/skills/poc-submit/SKILL.md +186 -0
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire vocabulary shared by the Host and Client halves of the POC console.
|
|
3
|
+
*
|
|
4
|
+
* Everything here is plain, lossless JSON: the Host owns the repository cache
|
|
5
|
+
* and the YAML parse, the Client owns only view state, and only these shapes
|
|
6
|
+
* cross the Connection RPC boundary. Both halves compile from this file, so the
|
|
7
|
+
* Client bundle carries the same literals without importing Host code.
|
|
8
|
+
*
|
|
9
|
+
* Localized copy is deliberately NOT here: the Host sends stable rule ids and
|
|
10
|
+
* field names, and the Client maps them onto dictionary keys. One dictionary
|
|
11
|
+
* therefore covers both halves, and a new rule never needs a Host release note.
|
|
12
|
+
*/
|
|
13
|
+
/** RPC endpoint path under the shared `/api` channel. */
|
|
14
|
+
export declare const ENDPOINT = "skillre-work-dashboard/execute";
|
|
15
|
+
/** Sidebar panel id, main panel key, and locale namespace. */
|
|
16
|
+
export declare const PANEL_ID = "skillre-work-dashboard";
|
|
17
|
+
export declare const LOCALE_NAMESPACE = "skillreWorkDashboard";
|
|
18
|
+
/**
|
|
19
|
+
* Browser-local refresh settings. They are a user preference, not plugin
|
|
20
|
+
* configuration, so they live in `localStorage` and never reach the Host.
|
|
21
|
+
*/
|
|
22
|
+
export declare const REFRESH_INTERVAL_KEY = "work-dashboard.refreshInterval";
|
|
23
|
+
export declare const CUSTOM_MINUTES_KEY = "work-dashboard.customMinutes";
|
|
24
|
+
/** The refresh cadences the settings dialog offers. */
|
|
25
|
+
export declare const REFRESH_INTERVALS: readonly ["off", "10m", "1h", "custom"];
|
|
26
|
+
export type RefreshInterval = (typeof REFRESH_INTERVALS)[number];
|
|
27
|
+
/** Default custom cadence, in minutes, when the user picks `custom` first. */
|
|
28
|
+
export declare const DEFAULT_CUSTOM_MINUTES = 30;
|
|
29
|
+
/** Bounds of the custom cadence, in minutes. */
|
|
30
|
+
export declare const CUSTOM_MINUTES_MIN = 1;
|
|
31
|
+
export declare const CUSTOM_MINUTES_MAX = 1440;
|
|
32
|
+
/** The four stages of a POC plus the closed state. */
|
|
33
|
+
export declare const STAGES: readonly ["G0", "G1", "G2", "G3", "G4"];
|
|
34
|
+
export type StageId = (typeof STAGES)[number];
|
|
35
|
+
/** The four dimensions that must be tracked separately, never merged. */
|
|
36
|
+
export declare const DIMENSIONS: readonly ["achievement", "evidence", "recognition", "nextMilestone"];
|
|
37
|
+
export type DimensionKey = (typeof DIMENSIONS)[number];
|
|
38
|
+
/**
|
|
39
|
+
* How the overview renders the same project list.
|
|
40
|
+
*
|
|
41
|
+
* One dataset, three readings: `cards` answers "what needs me", `board` answers
|
|
42
|
+
* "where is everything sitting", `table` answers "show me the numbers". Switching
|
|
43
|
+
* never refetches and never drops the active filters.
|
|
44
|
+
*/
|
|
45
|
+
export declare const VIEW_MODES: readonly ["cards", "board", "table"];
|
|
46
|
+
export type ViewMode = (typeof VIEW_MODES)[number];
|
|
47
|
+
/** The overview's sort orders. */
|
|
48
|
+
export declare const SORT_KEYS: readonly ["attention", "amount", "progress", "stage"];
|
|
49
|
+
export type SortKey = (typeof SORT_KEYS)[number];
|
|
50
|
+
/** Browser-local view preference key (search/filters are session-only). */
|
|
51
|
+
export declare const VIEW_MODE_KEY = "work-dashboard.viewMode";
|
|
52
|
+
export declare const SORT_KEY_KEY = "work-dashboard.sortKey";
|
|
53
|
+
/** Every gap rule id this plugin knows. */
|
|
54
|
+
export declare const GAP_RULES: readonly ["R1-gate0-missing", "R2-large-amount-no-g0", "R3-g0-passed-no-plan", "R4-criteria-count", "R5-scenarios-count", "R6-risks-overflow", "R7-g2-not-ready", "R8-progress-no-evidence", "R9-evidence-no-recognition", "R10-g3-1-without-g3-2", "R11-no-next-milestone", "R12-stage-stalled"];
|
|
55
|
+
export type GapRule = (typeof GAP_RULES)[number];
|
|
56
|
+
/** Severity a gap carries; `high` sorts first and paints red. */
|
|
57
|
+
export type GapLevel = 'high' | 'medium';
|
|
58
|
+
/** One evidence artefact attached to a progress entry. */
|
|
59
|
+
export interface EvidenceRecord {
|
|
60
|
+
title?: string | null;
|
|
61
|
+
link?: string | null;
|
|
62
|
+
type?: string | null;
|
|
63
|
+
}
|
|
64
|
+
/** One success criterion (`plan.criteria[]`). */
|
|
65
|
+
export interface CriterionRecord {
|
|
66
|
+
name?: string | null;
|
|
67
|
+
metric?: string | null;
|
|
68
|
+
baseline?: string | number | null;
|
|
69
|
+
target?: string | number | null;
|
|
70
|
+
}
|
|
71
|
+
/** One tracked risk (`plan.risks[]`). */
|
|
72
|
+
export interface RiskRecord {
|
|
73
|
+
name?: string | null;
|
|
74
|
+
level?: string | null;
|
|
75
|
+
mitigation?: string | null;
|
|
76
|
+
}
|
|
77
|
+
/** One progress entry (`progress[]`) — the centre of the v3 model. */
|
|
78
|
+
export interface ProgressRecord {
|
|
79
|
+
seq?: number | null;
|
|
80
|
+
date?: string | null;
|
|
81
|
+
type?: string | null;
|
|
82
|
+
goal?: string | null;
|
|
83
|
+
items?: (string | null)[] | null;
|
|
84
|
+
actual?: string | null;
|
|
85
|
+
completion?: string | null;
|
|
86
|
+
evidence?: EvidenceRecord[] | null;
|
|
87
|
+
customer?: {
|
|
88
|
+
synced_with?: string | null;
|
|
89
|
+
feedback?: string | null;
|
|
90
|
+
recognition?: string | null;
|
|
91
|
+
} | null;
|
|
92
|
+
gate3_1?: string | null;
|
|
93
|
+
gate3_2?: string | null;
|
|
94
|
+
next?: {
|
|
95
|
+
goal?: string | null;
|
|
96
|
+
owner?: string | null;
|
|
97
|
+
deadline?: string | null;
|
|
98
|
+
} | null;
|
|
99
|
+
}
|
|
100
|
+
/** The G0 block: whether the project is worth doing. */
|
|
101
|
+
export interface Gate0Record {
|
|
102
|
+
why_customer?: string | null;
|
|
103
|
+
why_us?: string | null;
|
|
104
|
+
decision_chain?: string | null;
|
|
105
|
+
post_poc_decision?: string | null;
|
|
106
|
+
competitor?: string | null;
|
|
107
|
+
review?: {
|
|
108
|
+
conclusion?: string | null;
|
|
109
|
+
reviewer?: string | null;
|
|
110
|
+
reviewed_at?: string | null;
|
|
111
|
+
} | null;
|
|
112
|
+
/** Computed by the ledger; `null` when absent. */
|
|
113
|
+
missing?: (string | null)[] | null;
|
|
114
|
+
complete?: boolean | null;
|
|
115
|
+
}
|
|
116
|
+
/** The plan block: how to win (G1/G2). */
|
|
117
|
+
export interface PlanRecord {
|
|
118
|
+
customer_pain?: string | null;
|
|
119
|
+
expected_recognition?: string | null;
|
|
120
|
+
criteria?: CriterionRecord[] | null;
|
|
121
|
+
scenarios?: (string | null)[] | null;
|
|
122
|
+
our_edge?: string | null;
|
|
123
|
+
timeline?: {
|
|
124
|
+
start?: string | null;
|
|
125
|
+
end?: string | null;
|
|
126
|
+
} | null;
|
|
127
|
+
risks?: RiskRecord[] | null;
|
|
128
|
+
report_nodes?: (string | null)[] | null;
|
|
129
|
+
gate1?: {
|
|
130
|
+
conclusion?: string | null;
|
|
131
|
+
reviewed_at?: string | null;
|
|
132
|
+
} | null;
|
|
133
|
+
gate2?: {
|
|
134
|
+
ready?: string | null;
|
|
135
|
+
checked_at?: string | null;
|
|
136
|
+
prerequisites?: unknown[] | null;
|
|
137
|
+
} | null;
|
|
138
|
+
}
|
|
139
|
+
/** The outcome block: the conclusion, mostly derived from the last progress. */
|
|
140
|
+
export interface OutcomeRecord {
|
|
141
|
+
achievement?: string | null;
|
|
142
|
+
customer_recognition?: string | null;
|
|
143
|
+
our_proof?: string | null;
|
|
144
|
+
remaining_risks?: string | null;
|
|
145
|
+
conclusion?: {
|
|
146
|
+
proved?: string | null;
|
|
147
|
+
recognized?: string | null;
|
|
148
|
+
next_business?: string | null;
|
|
149
|
+
} | null;
|
|
150
|
+
business?: {
|
|
151
|
+
milestone?: string | null;
|
|
152
|
+
owner?: string | null;
|
|
153
|
+
deadline?: string | null;
|
|
154
|
+
status?: string | null;
|
|
155
|
+
} | null;
|
|
156
|
+
overall?: string | null;
|
|
157
|
+
reviewed_at?: string | null;
|
|
158
|
+
}
|
|
159
|
+
/** The identity block. */
|
|
160
|
+
export interface OrgRecord {
|
|
161
|
+
system?: string | null;
|
|
162
|
+
company?: string | null;
|
|
163
|
+
department?: string | null;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* One parsed `projects/<poc_id>.yaml` in the v3 model.
|
|
167
|
+
*
|
|
168
|
+
* Every field is optional: the repository is hand-edited, so a partially filled
|
|
169
|
+
* project is normal input, not a malformed record. The gap scanner is what turns
|
|
170
|
+
* absence into a finding.
|
|
171
|
+
*/
|
|
172
|
+
export interface PocRecord {
|
|
173
|
+
poc_id?: string | null;
|
|
174
|
+
name?: string | null;
|
|
175
|
+
org?: OrgRecord | null;
|
|
176
|
+
amount_wan?: number | null;
|
|
177
|
+
poc_type?: string | null;
|
|
178
|
+
priority?: string | null;
|
|
179
|
+
owner?: string | null;
|
|
180
|
+
sales?: string | null;
|
|
181
|
+
tech_owner?: string | null;
|
|
182
|
+
exec_sponsor?: string | null;
|
|
183
|
+
stage?: string | null;
|
|
184
|
+
status?: string | null;
|
|
185
|
+
stage_since?: string | null;
|
|
186
|
+
gate0?: Gate0Record | null;
|
|
187
|
+
plan?: PlanRecord | null;
|
|
188
|
+
progress?: ProgressRecord[] | null;
|
|
189
|
+
outcome?: OutcomeRecord | null;
|
|
190
|
+
/** Unknown extra keys survive the parse so a future schema still loads. */
|
|
191
|
+
[key: string]: unknown;
|
|
192
|
+
}
|
|
193
|
+
/** The four dimensions resolved to presence flags. */
|
|
194
|
+
export type Dimensions = Record<DimensionKey, boolean>;
|
|
195
|
+
/** One row of the project table. */
|
|
196
|
+
export interface ProjectSummary {
|
|
197
|
+
pocId: string;
|
|
198
|
+
name: string;
|
|
199
|
+
/** `org.system` — the top grouping dimension. */
|
|
200
|
+
system: string;
|
|
201
|
+
/** `org.company` — the company under a system. */
|
|
202
|
+
company: string;
|
|
203
|
+
/** `org.department`, or `''`. */
|
|
204
|
+
department: string;
|
|
205
|
+
/** `poc_type` enum value. */
|
|
206
|
+
pocType: string;
|
|
207
|
+
/** `amount_wan`; `0` when the ledger left it blank. */
|
|
208
|
+
amountWan: number;
|
|
209
|
+
/** `priority`, or `''` when not set. */
|
|
210
|
+
priority: string;
|
|
211
|
+
/** Raw `stage` string, e.g. `G0-立项`. */
|
|
212
|
+
stageLabel: string;
|
|
213
|
+
/** Normalized stage id; `null` when unrecognized or `closed`. */
|
|
214
|
+
stage: StageId | null;
|
|
215
|
+
/** `true` when `stage` is `closed`. */
|
|
216
|
+
closed: boolean;
|
|
217
|
+
/** `status` enum value, e.g. 进行中. */
|
|
218
|
+
status: string;
|
|
219
|
+
/** `stage_since`, or `null`. */
|
|
220
|
+
stageSince: string | null;
|
|
221
|
+
/** Whole days in the current stage; `null` without `stage_since`. */
|
|
222
|
+
daysInStage: number | null;
|
|
223
|
+
owner: string;
|
|
224
|
+
techOwner: string;
|
|
225
|
+
/** G0 review conclusion, or `''`. */
|
|
226
|
+
g0Conclusion: string;
|
|
227
|
+
/** `true` when `gate0.review.conclusion` is 通过. */
|
|
228
|
+
g0Passed: boolean;
|
|
229
|
+
/** `true` when `gate0.complete` is true. */
|
|
230
|
+
g0Complete: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Per-stage done flags derived from the v3 gate fields, in G0..G4 order.
|
|
233
|
+
*
|
|
234
|
+
* v3 has no `gates.G0..G4.complete` array any more, so each stage reads its
|
|
235
|
+
* own source: G0 from `gate0.complete`, G1 from `plan.gate1.conclusion`,
|
|
236
|
+
* G2 from `plan.gate2.ready`, G3 from the newest progress `gate3_2`, and G4
|
|
237
|
+
* from `outcome.achievement`. Deriving from position instead would report
|
|
238
|
+
* stages as done that were never actually signed off.
|
|
239
|
+
*/
|
|
240
|
+
stageDone: [boolean, boolean, boolean, boolean, boolean];
|
|
241
|
+
/** How many of the five G0 prerequisites are missing. */
|
|
242
|
+
g0MissingCount: number;
|
|
243
|
+
dimensions: Dimensions;
|
|
244
|
+
/** How many of the four dimensions are present. */
|
|
245
|
+
dimensionCount: number;
|
|
246
|
+
gapCount: number;
|
|
247
|
+
highGapCount: number;
|
|
248
|
+
/** Number of progress entries. */
|
|
249
|
+
progressCount: number;
|
|
250
|
+
/** Date of the newest progress entry, or `null`. */
|
|
251
|
+
lastProgressDate: string | null;
|
|
252
|
+
/** One-line summary of the newest progress entry, or `''`. */
|
|
253
|
+
lastProgressSummary: string;
|
|
254
|
+
/** Whole days since the newest progress entry; `null` when there is none. */
|
|
255
|
+
daysSinceProgress: number | null;
|
|
256
|
+
/** Raw `outcome.achievement`; `''` when unset. Used for the success counter. */
|
|
257
|
+
outcomeAchievement: string;
|
|
258
|
+
/** Raw `outcome.customer_recognition`; `''` when unset. */
|
|
259
|
+
outcomeRecognition: string;
|
|
260
|
+
}
|
|
261
|
+
/** One gap finding, addressed to a project and a rule. */
|
|
262
|
+
export interface GapItem {
|
|
263
|
+
rule: GapRule;
|
|
264
|
+
/** Rule number 1-12, as numbered in the v3 schema. */
|
|
265
|
+
ruleNo: number;
|
|
266
|
+
level: GapLevel;
|
|
267
|
+
/** Sort weight: higher is more urgent. */
|
|
268
|
+
priority: number;
|
|
269
|
+
pocId: string;
|
|
270
|
+
pocName: string;
|
|
271
|
+
/** The offending YAML field, when the rule targets exactly one. */
|
|
272
|
+
field?: string;
|
|
273
|
+
/** Rule-specific values the Client interpolates into its copy. */
|
|
274
|
+
params?: Record<string, number | string>;
|
|
275
|
+
}
|
|
276
|
+
/** The headline counters above the project table (v3). */
|
|
277
|
+
export interface Stats {
|
|
278
|
+
/** Every project in the ledger. */
|
|
279
|
+
total: number;
|
|
280
|
+
/** `gate0.review.conclusion === '通过'`. */
|
|
281
|
+
g0Passed: number;
|
|
282
|
+
/** `status === '进行中'`. */
|
|
283
|
+
inProgress: number;
|
|
284
|
+
/** Sum of `amount_wan`, in 万元. */
|
|
285
|
+
amountTotalWan: number;
|
|
286
|
+
/** `gate0.complete === true`. */
|
|
287
|
+
g0Complete: number;
|
|
288
|
+
/** Projects whose newest progress is waiting on the customer. */
|
|
289
|
+
awaitingCustomer: number;
|
|
290
|
+
/** `outcome.achievement === '达成'` and the customer recognised it. */
|
|
291
|
+
succeeded: number;
|
|
292
|
+
/** `status === '暂停' | '已关闭' | '已取消'`. */
|
|
293
|
+
stopped: number;
|
|
294
|
+
}
|
|
295
|
+
/** One stage column of the funnel: how many projects, and how much money. */
|
|
296
|
+
export interface StageBucket {
|
|
297
|
+
/** `G0`..`G4`, or `closed` for the terminal state. */
|
|
298
|
+
key: StageId | 'closed' | 'unknown';
|
|
299
|
+
/** Projects whose current stage is this bucket. */
|
|
300
|
+
count: number;
|
|
301
|
+
/** Summed `amount_wan` of those projects. */
|
|
302
|
+
amountWan: number;
|
|
303
|
+
/** Projects in this bucket that still carry a high-severity gap. */
|
|
304
|
+
highGapCount: number;
|
|
305
|
+
}
|
|
306
|
+
/** One row of the 体系 / 公司 breakdown. */
|
|
307
|
+
export interface OrgBucket {
|
|
308
|
+
/** `org.system`, or `''` when unset. */
|
|
309
|
+
system: string;
|
|
310
|
+
/** `org.company`, or `''` when unset. */
|
|
311
|
+
company: string;
|
|
312
|
+
count: number;
|
|
313
|
+
amountWan: number;
|
|
314
|
+
/** Projects under this company carrying at least one high gap. */
|
|
315
|
+
highGapCount: number;
|
|
316
|
+
}
|
|
317
|
+
/** One row of the `poc_type` composition. */
|
|
318
|
+
export interface TypeBucket {
|
|
319
|
+
pocType: string;
|
|
320
|
+
count: number;
|
|
321
|
+
amountWan: number;
|
|
322
|
+
}
|
|
323
|
+
/** One bar of the amount-concentration list. */
|
|
324
|
+
export interface AmountRow {
|
|
325
|
+
pocId: string;
|
|
326
|
+
pocName: string;
|
|
327
|
+
amountWan: number;
|
|
328
|
+
/** Share of the portfolio total, `0..1`. */
|
|
329
|
+
share: number;
|
|
330
|
+
stage: StageId | null;
|
|
331
|
+
closed: boolean;
|
|
332
|
+
}
|
|
333
|
+
/** Coverage of one of the four dimensions across the portfolio. */
|
|
334
|
+
export interface DimensionCoverage {
|
|
335
|
+
key: DimensionKey;
|
|
336
|
+
/** Projects where the dimension is present. */
|
|
337
|
+
present: number;
|
|
338
|
+
/** Projects where it is missing. */
|
|
339
|
+
missing: number;
|
|
340
|
+
/** `present / total`, `0..1`; `0` when there are no projects. */
|
|
341
|
+
ratio: number;
|
|
342
|
+
}
|
|
343
|
+
/** How often one gap rule fires across the portfolio. */
|
|
344
|
+
export interface GapRuleCount {
|
|
345
|
+
rule: GapRule;
|
|
346
|
+
ruleNo: number;
|
|
347
|
+
level: GapLevel;
|
|
348
|
+
count: number;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* The portfolio analysis the overview band renders.
|
|
352
|
+
*
|
|
353
|
+
* Every number here is a pure aggregation of the same `projects` rows the
|
|
354
|
+
* table shows, so the charts and the list can never disagree. It is computed
|
|
355
|
+
* once on the Host and shipped as JSON; the Client never re-derives it.
|
|
356
|
+
*/
|
|
357
|
+
export interface PortfolioAnalysis {
|
|
358
|
+
/** Stage funnel, in G0→G4→closed order. */
|
|
359
|
+
stages: StageBucket[];
|
|
360
|
+
/** 体系/公司 breakdown, biggest amount first. */
|
|
361
|
+
orgs: OrgBucket[];
|
|
362
|
+
/** `poc_type` composition, biggest count first. */
|
|
363
|
+
types: TypeBucket[];
|
|
364
|
+
/** Largest projects by amount, biggest first (at most 5). */
|
|
365
|
+
topAmounts: AmountRow[];
|
|
366
|
+
/** The four dimensions in `DIMENSIONS` order. */
|
|
367
|
+
dimensions: DimensionCoverage[];
|
|
368
|
+
/** Gap rules that fired at least once, most frequent first. */
|
|
369
|
+
gapRules: GapRuleCount[];
|
|
370
|
+
/** Amount held by the largest single project, `0..1` of the total. */
|
|
371
|
+
concentration: number;
|
|
372
|
+
/** Projects with no amount recorded. */
|
|
373
|
+
amountMissing: number;
|
|
374
|
+
/** Projects with at least one progress entry. */
|
|
375
|
+
withProgress: number;
|
|
376
|
+
/** Newest progress date across the portfolio, or `null`. */
|
|
377
|
+
lastActivity: string | null;
|
|
378
|
+
}
|
|
379
|
+
/** Everything the overview page renders. */
|
|
380
|
+
export interface Snapshot {
|
|
381
|
+
/** `true` once a clone exists and parsed without a fatal error. */
|
|
382
|
+
cacheReady: boolean;
|
|
383
|
+
/** `owner/name` of the configured data source. */
|
|
384
|
+
repository: string;
|
|
385
|
+
/** ISO timestamp of the last successful refresh in this process. */
|
|
386
|
+
fetchedAt: string | null;
|
|
387
|
+
/** Absolute path of the local clone the data came from. */
|
|
388
|
+
cachePath: string;
|
|
389
|
+
projects: ProjectSummary[];
|
|
390
|
+
stats: Stats;
|
|
391
|
+
gaps: GapItem[];
|
|
392
|
+
/** Aggregated portfolio view; empty buckets when there are no projects. */
|
|
393
|
+
analysis: PortfolioAnalysis;
|
|
394
|
+
/** Non-fatal findings: unreadable files, unparsable YAML, duplicates. */
|
|
395
|
+
warnings: string[];
|
|
396
|
+
}
|
|
397
|
+
/** One progress entry as the detail page receives it: every field present. */
|
|
398
|
+
export interface ProgressView {
|
|
399
|
+
seq: number | null;
|
|
400
|
+
date: string;
|
|
401
|
+
type: string;
|
|
402
|
+
goal: string;
|
|
403
|
+
items: string[];
|
|
404
|
+
actual: string;
|
|
405
|
+
completion: string;
|
|
406
|
+
evidence: Array<{
|
|
407
|
+
title: string;
|
|
408
|
+
link: string;
|
|
409
|
+
type: string;
|
|
410
|
+
}>;
|
|
411
|
+
customer: {
|
|
412
|
+
syncedWith: string;
|
|
413
|
+
feedback: string;
|
|
414
|
+
recognition: string;
|
|
415
|
+
};
|
|
416
|
+
gate3_1: string;
|
|
417
|
+
gate3_2: string;
|
|
418
|
+
next: {
|
|
419
|
+
goal: string;
|
|
420
|
+
owner: string;
|
|
421
|
+
deadline: string;
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
/** The outcome block as the detail page receives it: every field present. */
|
|
425
|
+
export interface OutcomeView {
|
|
426
|
+
achievement: string;
|
|
427
|
+
customerRecognition: string;
|
|
428
|
+
ourProof: string;
|
|
429
|
+
remainingRisks: string;
|
|
430
|
+
proved: string;
|
|
431
|
+
recognized: string;
|
|
432
|
+
nextBusiness: string;
|
|
433
|
+
milestone: string;
|
|
434
|
+
businessOwner: string;
|
|
435
|
+
businessDeadline: string;
|
|
436
|
+
businessStatus: string;
|
|
437
|
+
overall: string;
|
|
438
|
+
reviewedAt: string;
|
|
439
|
+
}
|
|
440
|
+
/** One G0 prerequisite, resolved for the completeness meter. */
|
|
441
|
+
export interface Gate0CheckItem {
|
|
442
|
+
/** The YAML field name, e.g. `why_customer`. */
|
|
443
|
+
field: string;
|
|
444
|
+
/** `true` when the field carries content. */
|
|
445
|
+
present: boolean;
|
|
446
|
+
/** The field's current text, or `''`. */
|
|
447
|
+
value: string;
|
|
448
|
+
}
|
|
449
|
+
/** The G0 block as the detail page receives it. */
|
|
450
|
+
export interface Gate0View {
|
|
451
|
+
whyCustomer: string;
|
|
452
|
+
whyUs: string;
|
|
453
|
+
decisionChain: string;
|
|
454
|
+
postPocDecision: string;
|
|
455
|
+
competitor: string;
|
|
456
|
+
conclusion: string;
|
|
457
|
+
reviewer: string;
|
|
458
|
+
reviewedAt: string;
|
|
459
|
+
missing: string[];
|
|
460
|
+
complete: boolean;
|
|
461
|
+
/**
|
|
462
|
+
* The five G0 prerequisites in schema order, each with its own presence flag.
|
|
463
|
+
*
|
|
464
|
+
* v3 counts `tech_owner` as one of the five, and it lives in the identity
|
|
465
|
+
* block rather than under `gate0`, so the meter cannot be derived from
|
|
466
|
+
* `gate0.missing` alone without losing that row.
|
|
467
|
+
*/
|
|
468
|
+
checklist: Gate0CheckItem[];
|
|
469
|
+
}
|
|
470
|
+
/** The plan block as the detail page receives it. */
|
|
471
|
+
export interface PlanView {
|
|
472
|
+
customerPain: string;
|
|
473
|
+
expectedRecognition: string;
|
|
474
|
+
criteria: Array<{
|
|
475
|
+
name: string;
|
|
476
|
+
metric: string;
|
|
477
|
+
baseline: string;
|
|
478
|
+
target: string;
|
|
479
|
+
}>;
|
|
480
|
+
scenarios: string[];
|
|
481
|
+
ourEdge: string;
|
|
482
|
+
timelineStart: string;
|
|
483
|
+
timelineEnd: string;
|
|
484
|
+
risks: Array<{
|
|
485
|
+
name: string;
|
|
486
|
+
level: string;
|
|
487
|
+
mitigation: string;
|
|
488
|
+
}>;
|
|
489
|
+
reportNodes: string[];
|
|
490
|
+
gate1Conclusion: string;
|
|
491
|
+
gate2Ready: string;
|
|
492
|
+
}
|
|
493
|
+
/** Everything the detail page renders. */
|
|
494
|
+
export interface ProjectDetail {
|
|
495
|
+
summary: ProjectSummary;
|
|
496
|
+
org: OrgRecord;
|
|
497
|
+
sales: string;
|
|
498
|
+
execSponsor: string;
|
|
499
|
+
gate0: Gate0View;
|
|
500
|
+
plan: PlanView;
|
|
501
|
+
progress: ProgressView[];
|
|
502
|
+
outcome: OutcomeView;
|
|
503
|
+
gaps: GapItem[];
|
|
504
|
+
}
|
|
505
|
+
/** One endpoint outcome, mirroring the Connection RPC result envelope. */
|
|
506
|
+
export type PocResult<T> = {
|
|
507
|
+
ok: true;
|
|
508
|
+
value: T;
|
|
509
|
+
} | {
|
|
510
|
+
ok: false;
|
|
511
|
+
error: {
|
|
512
|
+
code: string;
|
|
513
|
+
message: string;
|
|
514
|
+
details: Record<string, unknown>;
|
|
515
|
+
};
|
|
516
|
+
};
|
|
517
|
+
/** Request kinds accepted by the Host endpoint. */
|
|
518
|
+
export type PocRequest = {
|
|
519
|
+
action: 'list';
|
|
520
|
+
} | {
|
|
521
|
+
action: 'refresh';
|
|
522
|
+
} | {
|
|
523
|
+
action: 'detail';
|
|
524
|
+
pocId: string;
|
|
525
|
+
} | {
|
|
526
|
+
action: 'risks';
|
|
527
|
+
} | {
|
|
528
|
+
action: 'timeline';
|
|
529
|
+
};
|
|
530
|
+
/** One risk row on the risk board. */
|
|
531
|
+
export interface RiskRow {
|
|
532
|
+
pocId: string;
|
|
533
|
+
pocName: string;
|
|
534
|
+
stage: StageId | null;
|
|
535
|
+
/** `high` | `medium` | `low`, or `''` when the ledger left it blank. */
|
|
536
|
+
level: string;
|
|
537
|
+
/** Normalized severity rank: higher sorts first. */
|
|
538
|
+
rank: number;
|
|
539
|
+
name: string;
|
|
540
|
+
mitigation: string;
|
|
541
|
+
/** A high-severity gap on the same project, for context. */
|
|
542
|
+
gapCount: number;
|
|
543
|
+
highGapCount: number;
|
|
544
|
+
}
|
|
545
|
+
/** The risk board. */
|
|
546
|
+
export interface RiskBoard {
|
|
547
|
+
rows: RiskRow[];
|
|
548
|
+
counts: {
|
|
549
|
+
high: number;
|
|
550
|
+
medium: number;
|
|
551
|
+
low: number;
|
|
552
|
+
unset: number;
|
|
553
|
+
total: number;
|
|
554
|
+
};
|
|
555
|
+
/** Projects that carry at least one risk row. */
|
|
556
|
+
projectsWithRisks: number;
|
|
557
|
+
/** Total projects scanned, so the board can say "3 of 3". */
|
|
558
|
+
projectsTotal: number;
|
|
559
|
+
}
|
|
560
|
+
/** One round on the global timeline. */
|
|
561
|
+
export interface TimelineEntry {
|
|
562
|
+
pocId: string;
|
|
563
|
+
pocName: string;
|
|
564
|
+
stage: StageId | null;
|
|
565
|
+
date: string;
|
|
566
|
+
/** `progress[].seq`; `null` when the ledger left it blank. */
|
|
567
|
+
seq: number | null;
|
|
568
|
+
/** `progress[].type` — 内部Review / 客户阶段同步 / Checkpoint. */
|
|
569
|
+
type: string;
|
|
570
|
+
goal: string;
|
|
571
|
+
actual: string;
|
|
572
|
+
completion: string;
|
|
573
|
+
/** Evidence titles, joined for one-line display. */
|
|
574
|
+
evidence: string;
|
|
575
|
+
/** How many evidence artefacts this entry carries. */
|
|
576
|
+
evidenceCount: number;
|
|
577
|
+
customerFeedback: string;
|
|
578
|
+
recognition: string;
|
|
579
|
+
gate3_1: string;
|
|
580
|
+
gate3_2: string;
|
|
581
|
+
nextGoal: string;
|
|
582
|
+
nextOwner: string;
|
|
583
|
+
nextDeadline: string;
|
|
584
|
+
}
|
|
585
|
+
/** The global timeline view. */
|
|
586
|
+
export interface GlobalTimeline {
|
|
587
|
+
entries: TimelineEntry[];
|
|
588
|
+
/** Oldest and newest dates actually present, or `null` when empty. */
|
|
589
|
+
range: {
|
|
590
|
+
from: string;
|
|
591
|
+
to: string;
|
|
592
|
+
} | null;
|
|
593
|
+
/** Entries per month, newest month first, for the summary strip. */
|
|
594
|
+
months: Array<{
|
|
595
|
+
month: string;
|
|
596
|
+
count: number;
|
|
597
|
+
}>;
|
|
598
|
+
/** Projects with no timeline at all — the "invisible work" list. */
|
|
599
|
+
silentProjects: Array<{
|
|
600
|
+
pocId: string;
|
|
601
|
+
pocName: string;
|
|
602
|
+
}>;
|
|
603
|
+
}
|
|
604
|
+
/** Reply to `refresh`: the outcome plus what the Host did to the cache. */
|
|
605
|
+
export interface RefreshOutcome {
|
|
606
|
+
/** `clone` on a first pull, `fetch` when the clone already existed. */
|
|
607
|
+
mode: 'clone' | 'fetch';
|
|
608
|
+
/** Milliseconds the git work took. */
|
|
609
|
+
durationMs: number;
|
|
610
|
+
/** ISO timestamp of the moment the refresh finished. */
|
|
611
|
+
finishedAt: string;
|
|
612
|
+
}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire vocabulary shared by the Host and Client halves of the POC console.
|
|
3
|
+
*
|
|
4
|
+
* Everything here is plain, lossless JSON: the Host owns the repository cache
|
|
5
|
+
* and the YAML parse, the Client owns only view state, and only these shapes
|
|
6
|
+
* cross the Connection RPC boundary. Both halves compile from this file, so the
|
|
7
|
+
* Client bundle carries the same literals without importing Host code.
|
|
8
|
+
*
|
|
9
|
+
* Localized copy is deliberately NOT here: the Host sends stable rule ids and
|
|
10
|
+
* field names, and the Client maps them onto dictionary keys. One dictionary
|
|
11
|
+
* therefore covers both halves, and a new rule never needs a Host release note.
|
|
12
|
+
*/
|
|
13
|
+
/** RPC endpoint path under the shared `/api` channel. */
|
|
14
|
+
export const ENDPOINT = 'skillre-work-dashboard/execute';
|
|
15
|
+
/** Sidebar panel id, main panel key, and locale namespace. */
|
|
16
|
+
export const PANEL_ID = 'skillre-work-dashboard';
|
|
17
|
+
export const LOCALE_NAMESPACE = 'skillreWorkDashboard';
|
|
18
|
+
/**
|
|
19
|
+
* Browser-local refresh settings. They are a user preference, not plugin
|
|
20
|
+
* configuration, so they live in `localStorage` and never reach the Host.
|
|
21
|
+
*/
|
|
22
|
+
export const REFRESH_INTERVAL_KEY = 'work-dashboard.refreshInterval';
|
|
23
|
+
export const CUSTOM_MINUTES_KEY = 'work-dashboard.customMinutes';
|
|
24
|
+
/** The refresh cadences the settings dialog offers. */
|
|
25
|
+
export const REFRESH_INTERVALS = Object.freeze(['off', '10m', '1h', 'custom']);
|
|
26
|
+
/** Default custom cadence, in minutes, when the user picks `custom` first. */
|
|
27
|
+
export const DEFAULT_CUSTOM_MINUTES = 30;
|
|
28
|
+
/** Bounds of the custom cadence, in minutes. */
|
|
29
|
+
export const CUSTOM_MINUTES_MIN = 1;
|
|
30
|
+
export const CUSTOM_MINUTES_MAX = 1440;
|
|
31
|
+
/** The four stages of a POC plus the closed state. */
|
|
32
|
+
export const STAGES = Object.freeze(['G0', 'G1', 'G2', 'G3', 'G4']);
|
|
33
|
+
/** The four dimensions that must be tracked separately, never merged. */
|
|
34
|
+
export const DIMENSIONS = Object.freeze(['achievement', 'evidence', 'recognition', 'nextMilestone']);
|
|
35
|
+
/**
|
|
36
|
+
* How the overview renders the same project list.
|
|
37
|
+
*
|
|
38
|
+
* One dataset, three readings: `cards` answers "what needs me", `board` answers
|
|
39
|
+
* "where is everything sitting", `table` answers "show me the numbers". Switching
|
|
40
|
+
* never refetches and never drops the active filters.
|
|
41
|
+
*/
|
|
42
|
+
export const VIEW_MODES = Object.freeze(['cards', 'board', 'table']);
|
|
43
|
+
/** The overview's sort orders. */
|
|
44
|
+
export const SORT_KEYS = Object.freeze(['attention', 'amount', 'progress', 'stage']);
|
|
45
|
+
/** Browser-local view preference key (search/filters are session-only). */
|
|
46
|
+
export const VIEW_MODE_KEY = 'work-dashboard.viewMode';
|
|
47
|
+
export const SORT_KEY_KEY = 'work-dashboard.sortKey';
|
|
48
|
+
/** Every gap rule id this plugin knows. */
|
|
49
|
+
export const GAP_RULES = Object.freeze([
|
|
50
|
+
'R1-gate0-missing',
|
|
51
|
+
'R2-large-amount-no-g0',
|
|
52
|
+
'R3-g0-passed-no-plan',
|
|
53
|
+
'R4-criteria-count',
|
|
54
|
+
'R5-scenarios-count',
|
|
55
|
+
'R6-risks-overflow',
|
|
56
|
+
'R7-g2-not-ready',
|
|
57
|
+
'R8-progress-no-evidence',
|
|
58
|
+
'R9-evidence-no-recognition',
|
|
59
|
+
'R10-g3-1-without-g3-2',
|
|
60
|
+
'R11-no-next-milestone',
|
|
61
|
+
'R12-stage-stalled',
|
|
62
|
+
]);
|
package/locale/en.json
ADDED