@pellux/goodvibes-tui 0.19.26 → 0.19.28
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/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/docs/foundation-artifacts/operator-contract.json +1 -1
- package/package.json +2 -2
- package/src/cli/bundle-command.ts +3 -2
- package/src/cli/entrypoint.ts +2 -2
- package/src/cli/help.ts +1 -1
- package/src/cli/status.ts +9 -9
- package/src/cli/tui-startup.ts +4 -4
- package/src/input/handler-interactions.ts +14 -1
- package/src/input/handler-onboarding.ts +18 -82
- package/src/input/handler.ts +1 -1
- package/src/input/onboarding/handler-onboarding-routes.ts +31 -15
- package/src/input/onboarding/onboarding-wizard-apply.ts +0 -17
- package/src/input/onboarding/onboarding-wizard-helpers.ts +1 -2
- package/src/input/onboarding/onboarding-wizard-rules.ts +18 -5
- package/src/input/onboarding/onboarding-wizard-state.ts +8 -2
- package/src/input/onboarding/onboarding-wizard-steps.ts +118 -59
- package/src/input/onboarding/onboarding-wizard-types.ts +5 -0
- package/src/input/onboarding/onboarding-wizard.ts +70 -5
- package/src/main.ts +2 -1
- package/src/renderer/onboarding/onboarding-wizard.ts +115 -48
- package/src/runtime/onboarding/apply.ts +9 -82
- package/src/runtime/onboarding/markers.ts +41 -55
- package/src/runtime/onboarding/state.ts +6 -6
- package/src/runtime/onboarding/types.ts +20 -26
- package/src/runtime/onboarding/verify.ts +2 -64
- package/src/version.ts +1 -1
|
@@ -26,9 +26,9 @@ export type OnboardingAcknowledgementReason =
|
|
|
26
26
|
|
|
27
27
|
export type OnboardingVerificationStatus = 'pass' | 'warn' | 'fail';
|
|
28
28
|
|
|
29
|
-
export type
|
|
29
|
+
export type OnboardingStateScope = 'user' | 'project';
|
|
30
30
|
|
|
31
|
-
export type
|
|
31
|
+
export type OnboardingCheckMarkerSource = 'wizard' | 'command' | 'import' | 'unknown';
|
|
32
32
|
|
|
33
33
|
export interface OnboardingConfigSnapshot {
|
|
34
34
|
readonly display: GoodVibesConfig['display'];
|
|
@@ -147,7 +147,7 @@ export interface OnboardingRuntimeDefaultsSnapshot {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
export interface OnboardingAcknowledgementSnapshot {
|
|
150
|
-
readonly scope:
|
|
150
|
+
readonly scope: OnboardingStateScope;
|
|
151
151
|
readonly exists: boolean;
|
|
152
152
|
readonly updatedAt: number | null;
|
|
153
153
|
readonly source: string | null;
|
|
@@ -258,12 +258,6 @@ export type OnboardingApplyOperation =
|
|
|
258
258
|
readonly kind: 'acknowledge';
|
|
259
259
|
readonly target: OnboardingAcknowledgementTarget;
|
|
260
260
|
readonly acknowledged: boolean;
|
|
261
|
-
}
|
|
262
|
-
| {
|
|
263
|
-
readonly kind: 'set-completion-marker';
|
|
264
|
-
readonly scope: OnboardingCompletionMarkerScope;
|
|
265
|
-
readonly completed: boolean;
|
|
266
|
-
readonly payload?: Partial<OnboardingCompletionMarkerPayload>;
|
|
267
261
|
};
|
|
268
262
|
|
|
269
263
|
export interface OnboardingApplyRequest {
|
|
@@ -316,34 +310,34 @@ export interface OnboardingAcknowledgementRuntimeState {
|
|
|
316
310
|
readonly acknowledgements: Partial<Record<OnboardingAcknowledgementTarget, boolean>>;
|
|
317
311
|
}
|
|
318
312
|
|
|
319
|
-
export interface
|
|
313
|
+
export interface OnboardingCheckMarkerPayload {
|
|
320
314
|
readonly version: 1;
|
|
321
|
-
readonly
|
|
315
|
+
readonly checkedAt: number;
|
|
322
316
|
readonly updatedAt: number;
|
|
323
|
-
readonly source:
|
|
317
|
+
readonly source: OnboardingCheckMarkerSource;
|
|
324
318
|
readonly mode?: OnboardingMode;
|
|
325
319
|
readonly workspaceRoot?: string;
|
|
326
320
|
}
|
|
327
321
|
|
|
328
|
-
export interface
|
|
329
|
-
readonly scope:
|
|
322
|
+
export interface OnboardingCheckMarkerState {
|
|
323
|
+
readonly scope: OnboardingStateScope;
|
|
330
324
|
readonly path: string;
|
|
331
325
|
readonly exists: boolean;
|
|
332
|
-
readonly payload:
|
|
326
|
+
readonly payload: OnboardingCheckMarkerPayload | null;
|
|
333
327
|
readonly parseError?: string;
|
|
334
328
|
}
|
|
335
329
|
|
|
336
|
-
export interface
|
|
337
|
-
readonly user:
|
|
338
|
-
readonly project:
|
|
339
|
-
readonly effective:
|
|
330
|
+
export interface OnboardingCheckMarkersState {
|
|
331
|
+
readonly user: OnboardingCheckMarkerState;
|
|
332
|
+
readonly project: OnboardingCheckMarkerState;
|
|
333
|
+
readonly effective: OnboardingCheckMarkerState | null;
|
|
340
334
|
}
|
|
341
335
|
|
|
342
|
-
export interface
|
|
343
|
-
readonly scope?:
|
|
344
|
-
readonly
|
|
336
|
+
export interface WriteOnboardingCheckMarkerOptions {
|
|
337
|
+
readonly scope?: OnboardingStateScope;
|
|
338
|
+
readonly checkedAt?: number;
|
|
345
339
|
readonly updatedAt?: number;
|
|
346
|
-
readonly source?:
|
|
340
|
+
readonly source?: OnboardingCheckMarkerSource;
|
|
347
341
|
readonly mode?: OnboardingMode;
|
|
348
342
|
readonly workspaceRoot?: string;
|
|
349
343
|
}
|
|
@@ -371,7 +365,7 @@ export interface OnboardingSnapshotDependencies {
|
|
|
371
365
|
readonly surfaces?: OnboardingSurfaceReadHelper;
|
|
372
366
|
readonly providerAccounts?: OnboardingProviderAccountReadHelper;
|
|
373
367
|
readonly shellPaths?: OnboardingShellPaths;
|
|
374
|
-
readonly acknowledgementScope?:
|
|
368
|
+
readonly acknowledgementScope?: OnboardingStateScope;
|
|
375
369
|
}
|
|
376
370
|
|
|
377
371
|
export interface OnboardingApplyDependencies {
|
|
@@ -389,7 +383,7 @@ export interface OnboardingApplyDependencies {
|
|
|
389
383
|
| 'revokeSession'
|
|
390
384
|
>;
|
|
391
385
|
readonly shellPaths: OnboardingShellPaths;
|
|
392
|
-
readonly acknowledgementScope?:
|
|
386
|
+
readonly acknowledgementScope?: OnboardingStateScope;
|
|
393
387
|
}
|
|
394
388
|
|
|
395
389
|
export interface OnboardingVerificationDependencies {
|
|
@@ -398,5 +392,5 @@ export interface OnboardingVerificationDependencies {
|
|
|
398
392
|
readonly secrets?: Pick<SecretsManager, 'get'>;
|
|
399
393
|
readonly auth?: Pick<UserAuthManager, 'inspect'>;
|
|
400
394
|
readonly shellPaths: OnboardingShellPaths;
|
|
401
|
-
readonly acknowledgementScope?:
|
|
395
|
+
readonly acknowledgementScope?: OnboardingStateScope;
|
|
402
396
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isSecretRefInput } from '@pellux/goodvibes-sdk/platform/config/secret-refs';
|
|
2
|
-
import { readOnboardingCompletionMarker } from './markers.ts';
|
|
3
2
|
import { readOnboardingRuntimeState } from './state.ts';
|
|
4
3
|
import type {
|
|
5
4
|
OnboardingApplyOperation,
|
|
@@ -13,11 +12,6 @@ function getNow(deps: Pick<OnboardingVerificationDependencies, 'clock'>): number
|
|
|
13
12
|
return deps.clock?.() ?? Date.now();
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
function normalizeCompletionSource(source: string): 'wizard' | 'command' | 'import' | 'unknown' {
|
|
17
|
-
if (source === 'wizard' || source === 'command' || source === 'import') return source;
|
|
18
|
-
return 'unknown';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
15
|
function isDeepEqual(left: unknown, right: unknown): boolean {
|
|
22
16
|
if (Object.is(left, right)) return true;
|
|
23
17
|
if (Array.isArray(left) && Array.isArray(right)) {
|
|
@@ -89,60 +83,6 @@ function verifyAcknowledgementOperation(
|
|
|
89
83
|
};
|
|
90
84
|
}
|
|
91
85
|
|
|
92
|
-
function verifyCompletionMarkerOperation(
|
|
93
|
-
deps: OnboardingVerificationDependencies,
|
|
94
|
-
request: OnboardingApplyRequest,
|
|
95
|
-
operation: Extract<OnboardingApplyOperation, { kind: 'set-completion-marker' }>,
|
|
96
|
-
): OnboardingVerificationItem {
|
|
97
|
-
const marker = readOnboardingCompletionMarker(deps.shellPaths, operation.scope);
|
|
98
|
-
if (marker.parseError) {
|
|
99
|
-
return {
|
|
100
|
-
id: `marker:${operation.scope}`,
|
|
101
|
-
status: 'fail',
|
|
102
|
-
message: `Onboarding completion marker could not be parsed: ${marker.parseError}`,
|
|
103
|
-
target: operation.scope,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (!operation.completed) {
|
|
108
|
-
return {
|
|
109
|
-
id: `marker:${operation.scope}`,
|
|
110
|
-
status: marker.exists ? 'fail' : 'pass',
|
|
111
|
-
message: marker.exists
|
|
112
|
-
? `${operation.scope} onboarding completion marker still exists.`
|
|
113
|
-
: `${operation.scope} onboarding completion marker is cleared.`,
|
|
114
|
-
target: operation.scope,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (!marker.payload) {
|
|
119
|
-
return {
|
|
120
|
-
id: `marker:${operation.scope}`,
|
|
121
|
-
status: 'fail',
|
|
122
|
-
message: `${operation.scope} onboarding completion marker is missing.`,
|
|
123
|
-
target: operation.scope,
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const expectedSource = operation.payload?.source ?? normalizeCompletionSource(request.source);
|
|
128
|
-
const expectedMode = operation.payload?.mode ?? request.mode;
|
|
129
|
-
const expectedWorkspaceRoot = operation.payload?.workspaceRoot ?? deps.shellPaths.workingDirectory;
|
|
130
|
-
const payloadMatches = marker.payload.source === expectedSource
|
|
131
|
-
&& (expectedMode === undefined || marker.payload.mode === expectedMode)
|
|
132
|
-
&& (expectedWorkspaceRoot === undefined || marker.payload.workspaceRoot === expectedWorkspaceRoot)
|
|
133
|
-
&& (operation.payload?.completedAt === undefined || marker.payload.completedAt === operation.payload.completedAt)
|
|
134
|
-
&& (operation.payload?.updatedAt === undefined || marker.payload.updatedAt === operation.payload.updatedAt);
|
|
135
|
-
|
|
136
|
-
return {
|
|
137
|
-
id: `marker:${operation.scope}`,
|
|
138
|
-
status: payloadMatches ? 'pass' : 'fail',
|
|
139
|
-
message: payloadMatches
|
|
140
|
-
? `${operation.scope} onboarding completion marker matches the requested state.`
|
|
141
|
-
: `${operation.scope} onboarding completion marker does not match the requested state.`,
|
|
142
|
-
target: operation.scope,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
|
|
146
86
|
async function verifySecretOperation(
|
|
147
87
|
deps: OnboardingVerificationDependencies,
|
|
148
88
|
operation: Extract<OnboardingApplyOperation, { kind: 'set-secret' }>,
|
|
@@ -209,21 +149,19 @@ function verifyAuthOperation(
|
|
|
209
149
|
|
|
210
150
|
async function verifyOperation(
|
|
211
151
|
deps: OnboardingVerificationDependencies,
|
|
212
|
-
request: OnboardingApplyRequest,
|
|
213
152
|
operation: OnboardingApplyOperation,
|
|
214
153
|
): Promise<OnboardingVerificationItem> {
|
|
215
154
|
if (operation.kind === 'set-config') return verifyConfigOperation(deps, operation);
|
|
216
155
|
if (operation.kind === 'set-secret') return verifySecretOperation(deps, operation);
|
|
217
156
|
if (operation.kind === 'ensure-auth-user') return verifyAuthOperation(deps, operation);
|
|
218
|
-
|
|
219
|
-
return verifyCompletionMarkerOperation(deps, request, operation);
|
|
157
|
+
return verifyAcknowledgementOperation(deps, operation);
|
|
220
158
|
}
|
|
221
159
|
|
|
222
160
|
export async function verifyOnboardingRequest(
|
|
223
161
|
deps: OnboardingVerificationDependencies,
|
|
224
162
|
request: OnboardingApplyRequest,
|
|
225
163
|
): Promise<OnboardingVerificationResult> {
|
|
226
|
-
const items = await Promise.all(request.operations.map((operation) => verifyOperation(deps,
|
|
164
|
+
const items = await Promise.all(request.operations.map((operation) => verifyOperation(deps, operation)));
|
|
227
165
|
|
|
228
166
|
return {
|
|
229
167
|
verifiedAt: getNow(deps),
|
package/src/version.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { join } from 'node:path';
|
|
|
6
6
|
// The prebuild script updates the fallback value before compilation.
|
|
7
7
|
// Uses import.meta.dir (Bun) to locate package.json relative to this file,
|
|
8
8
|
// which is correct regardless of the process working directory.
|
|
9
|
-
let _version = '0.19.
|
|
9
|
+
let _version = '0.19.28';
|
|
10
10
|
try {
|
|
11
11
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', 'package.json'), 'utf-8'));
|
|
12
12
|
_version = pkg.version ?? _version;
|