@pellux/goodvibes-agent 0.1.8 → 0.1.10

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -1
  3. package/docs/getting-started.md +1 -1
  4. package/docs/release-and-publishing.md +2 -2
  5. package/package.json +4 -1
  6. package/src/cli/agent-knowledge-command.ts +43 -21
  7. package/src/cli/help.ts +17 -4
  8. package/src/cli/management-commands.ts +3 -3
  9. package/src/cli/management.ts +7 -1
  10. package/src/cli/parser.ts +3 -0
  11. package/src/cli/service-posture.ts +6 -6
  12. package/src/cli/status.ts +9 -9
  13. package/src/cli/surface-command.ts +3 -3
  14. package/src/cli/types.ts +2 -0
  15. package/src/input/commands/experience-runtime.ts +1 -1
  16. package/src/input/commands/hooks-runtime.ts +30 -2
  17. package/src/input/handler.ts +1 -0
  18. package/src/input/onboarding/onboarding-runtime-status.ts +8 -8
  19. package/src/input/onboarding/onboarding-wizard-apply.ts +13 -53
  20. package/src/input/onboarding/onboarding-wizard-cloudflare-step.ts +4 -4
  21. package/src/input/onboarding/onboarding-wizard-cloudflare.ts +1 -1
  22. package/src/input/onboarding/onboarding-wizard-constants.ts +7 -7
  23. package/src/input/onboarding/onboarding-wizard-external-surface-extra-specs.ts +4 -4
  24. package/src/input/onboarding/onboarding-wizard-steps.ts +13 -13
  25. package/src/input/settings-modal-agent-policy.ts +18 -0
  26. package/src/input/settings-modal-types.ts +17 -0
  27. package/src/input/settings-modal.ts +30 -29
  28. package/src/main.ts +3 -26
  29. package/src/renderer/process-indicator.ts +7 -6
  30. package/src/renderer/process-modal.ts +17 -8
  31. package/src/renderer/settings-modal.ts +12 -8
  32. package/src/renderer/ui-factory.ts +4 -32
  33. package/src/runtime/bootstrap-shell.ts +0 -13
  34. package/src/runtime/bootstrap.ts +0 -10
  35. package/src/runtime/onboarding/derivation.ts +6 -6
  36. package/src/verification/live-verifier.ts +148 -13
  37. package/src/version.ts +10 -3
  38. package/src/input/commands/quit-shared.ts +0 -162
  39. package/src/renderer/git-status.ts +0 -89
@@ -1,89 +0,0 @@
1
- import { GitService } from '@pellux/goodvibes-sdk/platform/git';
2
- import { logger } from '@pellux/goodvibes-sdk/platform/utils';
3
- import { summarizeError } from '@pellux/goodvibes-sdk/platform/utils';
4
-
5
- /** Git state shown in the header bar. */
6
- export interface GitHeaderInfo {
7
- branch: string;
8
- dirty: boolean;
9
- ahead: number;
10
- behind: number;
11
- }
12
-
13
- const FALLBACK: GitHeaderInfo = { branch: '?', dirty: false, ahead: 0, behind: 0 };
14
-
15
- /**
16
- * GitStatusProvider — Fetches git state for the header bar.
17
- *
18
- * Results are cached for 2 seconds (TTL). The next call after expiry triggers
19
- * a fresh fetch and returns the cached value immediately (stale-while-revalidate).
20
- * Never throws — returns FALLBACK on any error.
21
- */
22
- export class GitStatusProvider {
23
- private cache: GitHeaderInfo = { ...FALLBACK };
24
- private lastFetch = 0;
25
- private readonly ttlMs = 2000;
26
- private fetching = false;
27
-
28
- constructor(private readonly workingDirectory: string) {}
29
-
30
- /** Returns cached info immediately; refreshes in background if TTL expired. */
31
- async getStatus(): Promise<GitHeaderInfo> {
32
- const now = Date.now();
33
- if (now - this.lastFetch < this.ttlMs) {
34
- return this.cache;
35
- }
36
- // Fetch synchronously on first call (no cache yet), otherwise return stale
37
- if (this.lastFetch === 0) {
38
- await this._fetch().catch(() => {
39
- // Ensure fallback is set if _fetch failed before setting lastFetch
40
- if (this.lastFetch === 0) {
41
- this.lastFetch = Date.now();
42
- }
43
- });
44
- } else if (!this.fetching) {
45
- this._fetch().catch(err => { logger.debug('GitStatusProvider: background refresh failed', { error: summarizeError(err) }); });
46
- }
47
- return this.cache;
48
- }
49
-
50
- /** Force a fresh fetch and update the cache. Returns updated info. */
51
- async refresh(): Promise<GitHeaderInfo> {
52
- await this._fetch();
53
- return this.cache;
54
- }
55
-
56
- private async _fetch(): Promise<void> {
57
- if (this.fetching) return;
58
- this.fetching = true;
59
- try {
60
- const git = new GitService(this.workingDirectory);
61
- const [statusResult, branchResult] = await Promise.all([
62
- git.status(),
63
- git.branch(),
64
- ]);
65
- const dirty =
66
- statusResult.modified.length > 0 ||
67
- statusResult.created.length > 0 ||
68
- statusResult.deleted.length > 0 ||
69
- statusResult.renamed.length > 0 ||
70
- statusResult.conflicted.length > 0 ||
71
- statusResult.not_added.length > 0;
72
- this.cache = {
73
- branch: branchResult.current || '?',
74
- dirty,
75
- ahead: statusResult.ahead ?? 0,
76
- behind: statusResult.behind ?? 0,
77
- };
78
- this.lastFetch = Date.now();
79
- } catch {
80
- // Never throw — return fallback
81
- if (this.lastFetch === 0) {
82
- this.cache = { ...FALLBACK };
83
- this.lastFetch = Date.now();
84
- }
85
- } finally {
86
- this.fetching = false;
87
- }
88
- }
89
- }