@pellux/goodvibes-tui 1.24.2 → 1.26.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +1 -1
  3. package/bin/goodvibes-daemon +24 -0
  4. package/docs/foundation-artifacts/operator-contract.json +18234 -12253
  5. package/package.json +8 -7
  6. package/src/cli/help.ts +10 -0
  7. package/src/cli/redaction.ts +68 -3
  8. package/src/config/goodvibes-home.ts +149 -0
  9. package/src/config/secret-config.ts +64 -8
  10. package/src/core/turn-event-wiring.ts +7 -16
  11. package/src/core/workstream-notification.ts +69 -0
  12. package/src/daemon/cli.ts +62 -7
  13. package/src/daemon/handlers/credentials.ts +15 -5
  14. package/src/daemon/handlers/index.ts +7 -6
  15. package/src/daemon/send/channels.ts +200 -0
  16. package/src/daemon/send/command.ts +332 -0
  17. package/src/daemon/send/composition.ts +99 -0
  18. package/src/daemon/send/failure-text.ts +93 -0
  19. package/src/daemon/send/inert-text.ts +225 -0
  20. package/src/daemon/send/stdin.ts +24 -0
  21. package/src/input/commands/calendar-runtime.ts +245 -0
  22. package/src/input/commands/config.ts +68 -2
  23. package/src/input/commands/connection-status.ts +258 -0
  24. package/src/input/commands/local-provider-runtime.ts +9 -1
  25. package/src/input/commands/mail-runtime.ts +267 -0
  26. package/src/input/commands/operator-runtime.ts +6 -1
  27. package/src/input/commands/payment-card-intake.ts +200 -0
  28. package/src/input/commands/profile-render.ts +250 -0
  29. package/src/input/commands/profile-runtime.ts +362 -0
  30. package/src/input/commands/profile-types.ts +381 -0
  31. package/src/input/commands/review-runtime.ts +13 -1
  32. package/src/input/commands.ts +11 -0
  33. package/src/input/composer-editor.ts +4 -0
  34. package/src/input/onboarding/onboarding-wizard-apply.ts +13 -1
  35. package/src/input/payments-config.ts +167 -0
  36. package/src/input/provider-key-intake.ts +10 -2
  37. package/src/input/settings-modal-commit.ts +146 -0
  38. package/src/input/settings-modal-connections.ts +102 -0
  39. package/src/input/settings-modal-data.ts +30 -0
  40. package/src/input/settings-modal-reset.ts +6 -2
  41. package/src/input/settings-modal-secrets.ts +9 -2
  42. package/src/input/settings-modal-types.ts +19 -3
  43. package/src/input/settings-modal.ts +54 -107
  44. package/src/main.ts +7 -2
  45. package/src/panels/modals/marketplace-modal.ts +5 -0
  46. package/src/panels/modals/skills-modal.ts +5 -0
  47. package/src/renderer/settings-modal-connections.ts +63 -0
  48. package/src/renderer/settings-modal-helpers.ts +6 -0
  49. package/src/renderer/settings-modal.ts +21 -1
  50. package/src/runtime/bootstrap-core.ts +1 -1
  51. package/src/runtime/bootstrap.ts +2 -2
  52. package/src/runtime/context.ts +9 -0
  53. package/src/runtime/credential-composition.ts +54 -0
  54. package/src/runtime/daemon-handler-composition.ts +0 -4
  55. package/src/runtime/install-self-check-startup.ts +23 -0
  56. package/src/runtime/mail-composition.ts +65 -0
  57. package/src/runtime/onboarding/types.ts +6 -1
  58. package/src/runtime/path-shadow-startup.ts +243 -0
  59. package/src/runtime/path-shadow.ts +418 -0
  60. package/src/runtime/reachability-notice.ts +100 -0
  61. package/src/runtime/runtime-services-types.ts +243 -0
  62. package/src/runtime/services.ts +30 -224
  63. package/src/shell/ui-openers.ts +7 -0
  64. package/src/verification/verification-ledger.ts +158 -0
  65. package/src/version.ts +1 -1
  66. package/src/daemon/handlers/calendar/caldav-client.ts +0 -662
  67. package/src/daemon/handlers/calendar/ics.ts +0 -556
  68. package/src/daemon/handlers/calendar/index.ts +0 -316
  69. package/src/daemon/handlers/email/config.ts +0 -164
  70. package/src/daemon/handlers/email/imap-connector.ts +0 -441
  71. package/src/daemon/handlers/email/imap-parsing.ts +0 -499
  72. package/src/daemon/handlers/email/index.ts +0 -43
  73. package/src/daemon/handlers/email/read-handlers.ts +0 -80
  74. package/src/daemon/handlers/email/runtime.ts +0 -140
  75. package/src/daemon/handlers/email/smtp-connector.ts +0 -557
  76. package/src/daemon/handlers/email/validation.ts +0 -147
  77. package/src/daemon/handlers/email/write-handlers.ts +0 -133
@@ -48,6 +48,96 @@ const SETTINGS_BEHAVIOR_BASELINE = 184;
48
48
  * `src/test/verification/feature-knob-settings-persistence.test.ts`. They are
49
49
  * therefore genuinely behavior-verified locally and counted as such here.
50
50
  */
51
+ /**
52
+ * The daemon's own mailbox and calendar keys (`surfaces.email.*`,
53
+ * `surfaces.calendar.*`), promoted into CONFIG_SCHEMA so the settings modal —
54
+ * which renders from that schema — can actually show them. Before, the
55
+ * daemon's handlers named these keys in their own error messages
56
+ * ("Set surfaces.calendar.caldavUrl and surfaces.calendar.caldavUser") while
57
+ * the UI that told an operator to set them could not display one of them.
58
+ *
59
+ * Declaring 25 keys raised the settings inventory `total` with no matching
60
+ * behavior coverage, which dropped `localBehaviorPercent` below its floor —
61
+ * the same arrival shape as the two lists above.
62
+ *
63
+ * THIS CONSTANT IS NOT A DIAL. Every key below is counted because
64
+ * `src/test/verification/daemon-mailbox-settings-persistence.test.ts` runs the
65
+ * same four-part persistence contract the other counted sets are counted for:
66
+ * schema default exposure, `set()` through the key's own validator to disk,
67
+ * reload into a fresh ConfigManager with read-back equality, and
68
+ * reset-to-default that also survives reload. That test also asserts this list
69
+ * is exactly the `surfaces.email.*` + `surfaces.calendar.*` schema key set and
70
+ * overlaps neither other counted set, so nothing is double-counted and nothing
71
+ * drifts in uncounted.
72
+ *
73
+ * PER-KEY EVIDENCE. All 42 are read by a LIVE consumer, which is why they were
74
+ * declared at all: the SDK's mail and calendar gateway compositions
75
+ * (platform/email/surface-config.ts and platform/calendar/caldav-gateway-config.ts)
76
+ * resolve every one of them when the daemon serves `email.*` and `calendar.*`,
77
+ * and the `surfaces.email.inbound.*` block is read by the daemon's inbound mail
78
+ * reader — the poller/IDLE path that makes incoming mail visible at all.
79
+ * The five password keys (email.password, email.imapPassword,
80
+ * email.imap.password, email.smtp.password, calendar.caldavPassword)
81
+ * additionally resolve through the daemon secret tier rather than from config,
82
+ * and carry no secret value in config themselves. That is now enforced on the
83
+ * write side too: all five are in `config/secret-config.ts`'s
84
+ * SECRET_CONFIG_KEYS, so the settings modal and `/config set` route an entered
85
+ * value into the secret store and leave only a `goodvibes://` reference in
86
+ * config, rather than writing the password itself into a settings file.
87
+ */
88
+ export const DAEMON_MAILBOX_LOCAL_SETTINGS = [
89
+ 'surfaces.email.host',
90
+ 'surfaces.email.user',
91
+ 'surfaces.email.username',
92
+ 'surfaces.email.from',
93
+ 'surfaces.email.password',
94
+ 'surfaces.email.imapHost',
95
+ 'surfaces.email.imapPort',
96
+ 'surfaces.email.imapUser',
97
+ 'surfaces.email.imapPassword',
98
+ 'surfaces.email.imap.host',
99
+ 'surfaces.email.imap.port',
100
+ 'surfaces.email.imap.user',
101
+ 'surfaces.email.imap.password',
102
+ 'surfaces.email.imap.secure',
103
+ 'surfaces.email.imap.mailbox',
104
+ 'surfaces.email.imap.draftsMailbox',
105
+ 'surfaces.email.smtp.host',
106
+ 'surfaces.email.smtp.port',
107
+ 'surfaces.email.smtp.password',
108
+ 'surfaces.email.smtp.secure',
109
+ // Inbound mail — the poller/IDLE reader the daemon runs to actually READ mail,
110
+ // which arrived with the platform runtime. These are counted for exactly the
111
+ // reason the keys above are: the same four-part persistence contract runs over
112
+ // every one of them in
113
+ // src/test/verification/daemon-mailbox-settings-persistence.test.ts, and the
114
+ // list is asserted there to be the complete surfaces.email.*/surfaces.calendar.*
115
+ // schema set. Arriving uncounted is what dropped localBehaviorPercent through
116
+ // its floor when the schema grew.
117
+ 'surfaces.email.inbound.enabled',
118
+ 'surfaces.email.inbound.accounts',
119
+ 'surfaces.email.inbound.source',
120
+ 'surfaces.email.inbound.gmailPollSecondsExpecting',
121
+ 'surfaces.email.inbound.gmailPollSecondsIdle',
122
+ 'surfaces.email.inbound.mode',
123
+ 'surfaces.email.inbound.pollIntervalSeconds',
124
+ 'surfaces.email.inbound.idleReissueMinutes',
125
+ 'surfaces.email.inbound.reconnect.maxBackoffSeconds',
126
+ 'surfaces.email.inbound.notice.route',
127
+ 'surfaces.email.inbound.notice.mode',
128
+ 'surfaces.email.inbound.expectationWindowMinutes',
129
+ 'surfaces.email.inbound.dedupTtlMinutes',
130
+ 'surfaces.email.inbound.retentionDays',
131
+ 'surfaces.email.inbound.maxRecords',
132
+ 'surfaces.email.inbound.capabilityRecheckMinutes',
133
+ 'surfaces.email.inbound.onInsufficientCapability',
134
+ 'surfaces.calendar.caldavUrl',
135
+ 'surfaces.calendar.caldavUser',
136
+ 'surfaces.calendar.caldavPassword',
137
+ 'surfaces.calendar.defaultCalendarId',
138
+ 'surfaces.calendar.calendars',
139
+ ] as const;
140
+
51
141
  export const FEATURE_KNOB_LOCAL_SETTINGS = [
52
142
  'provider.optimizerMode',
53
143
  'provider.optimizerPinnedModel',
@@ -243,10 +333,78 @@ export const CLUSTER_GROUP_LOCAL_SETTINGS = [
243
333
  'cluster.rosterGossipSeconds',
244
334
  ] as const;
245
335
 
336
+ /**
337
+ * Config keys for the daemon's payment capability: the master switch, which
338
+ * card to use by default, the settlement currency, CVV handling, the six
339
+ * budget knobs, the shipping-tier preference, the fourteen billing/shipping
340
+ * address sub-fields, the two approval/veto windows, and the notify-channel
341
+ * list. Card MATERIAL (number, expiry, CVV, cardholder name) is intentionally
342
+ * NOT here — see the SDK's schema-domain-payments.ts header and this repo's
343
+ * own input/payments-config.ts: that material lives write-only in the daemon
344
+ * secret store, never in CONFIG_SCHEMA, so there is nothing for a persistence
345
+ * contract to count.
346
+ *
347
+ * THIS CONSTANT IS NOT A DIAL, for the same reason as the sets above. Every
348
+ * key below is counted because
349
+ * `src/test/verification/payments-settings-persistence.test.ts` runs the same
350
+ * four-part persistence contract the other counted sets are counted for:
351
+ * schema default exposure, `set()` through the key's own validator to disk,
352
+ * reload into a fresh ConfigManager with read-back equality, and
353
+ * reset-to-default that also survives reload. That test also asserts this
354
+ * list is exactly the CONFIG_SCHEMA's `payments.*` key set, so a future SDK
355
+ * addition under this domain is caught (fails the inventory-integrity test)
356
+ * rather than silently uncounted.
357
+ *
358
+ * PER-KEY EVIDENCE. All 28 are read by the daemon's own payment capability
359
+ * (platform/payments, platform/control-plane/routes/payments.ts): the budget
360
+ * keys size the daily/overage/tolerance pools, the window keys size the
361
+ * veto/approval timers, cvvHandling and shipping.preferredTier select the
362
+ * enum behaviors `platform/payments` documents, and the address sub-fields
363
+ * are read directly by the daemon's shipping-address-required refusal and the
364
+ * card-issuer address-verification path. `enabled` and `defaultCardId` gate
365
+ * and select, respectively, whether/which card a purchase uses.
366
+ */
367
+ export const PAYMENTS_LOCAL_SETTINGS = [
368
+ 'payments.enabled',
369
+ 'payments.defaultCardId',
370
+ 'payments.currency',
371
+ 'payments.cvvHandling',
372
+ 'payments.budget.dailyItemCents',
373
+ 'payments.budget.dailyOverageCents',
374
+ 'payments.budget.perPurchaseCeilingEnabled',
375
+ 'payments.budget.perPurchaseCeilingCents',
376
+ 'payments.budget.overageToleranceEnabled',
377
+ 'payments.budget.overageToleranceDailyAllowanceCents',
378
+ 'payments.shipping.preferredTier',
379
+ 'payments.billingAddress.name',
380
+ 'payments.billingAddress.line1',
381
+ 'payments.billingAddress.line2',
382
+ 'payments.billingAddress.city',
383
+ 'payments.billingAddress.region',
384
+ 'payments.billingAddress.postalCode',
385
+ 'payments.billingAddress.country',
386
+ 'payments.shippingAddress.name',
387
+ 'payments.shippingAddress.line1',
388
+ 'payments.shippingAddress.line2',
389
+ 'payments.shippingAddress.city',
390
+ 'payments.shippingAddress.region',
391
+ 'payments.shippingAddress.postalCode',
392
+ 'payments.shippingAddress.country',
393
+ 'payments.windows.vetoMinutes',
394
+ 'payments.windows.approvalMinutes',
395
+ 'payments.majorRetailersAdditional',
396
+ 'payments.majorRetailersExcluded',
397
+ 'payments.ebayMinSellerFeedbackCount',
398
+ 'payments.ebayMinSellerPositivePercent',
399
+ 'payments.notifyChannels',
400
+ ] as const;
401
+
246
402
  const SETTINGS_BEHAVIOR_VERIFIED = SETTINGS_BEHAVIOR_BASELINE
247
403
  + FEATURE_KNOB_LOCAL_SETTINGS.length
248
404
  + DEVICE_AND_TRIGGER_LOCAL_SETTINGS.length
249
405
  + CLUSTER_GROUP_LOCAL_SETTINGS.length
406
+ + DAEMON_MAILBOX_LOCAL_SETTINGS.length
407
+ + PAYMENTS_LOCAL_SETTINGS.length
250
408
  + ENABLEMENT_KEYS_BEHAVIOR_VERIFIED;
251
409
 
252
410
  const EXTERNAL_SLASH_COMMANDS = new Set([
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 = '1.24.2';
9
+ let _version = '1.26.0';
10
10
  try {
11
11
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', 'package.json'), 'utf-8'));
12
12
  // Only trust a version read from OUR OWN package.json. A Bun single-file