@rubytech/create-maxy-code 0.1.472 → 0.1.474

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 (142) hide show
  1. package/dist/__tests__/google-client-id-env.test.js +15 -12
  2. package/dist/index.js +6 -29
  3. package/dist/port-resolution.js +5 -5
  4. package/package.json +1 -1
  5. package/payload/platform/config/brand.json +1 -0
  6. package/payload/platform/docs/superpowers/plans/2026-07-18-ledger-write-path-fix.md +109 -0
  7. package/payload/platform/lib/ledger-core/dist/reconcile.d.ts +7 -0
  8. package/payload/platform/lib/ledger-core/dist/reconcile.d.ts.map +1 -1
  9. package/payload/platform/lib/ledger-core/dist/reconcile.js +5 -2
  10. package/payload/platform/lib/ledger-core/dist/reconcile.js.map +1 -1
  11. package/payload/platform/lib/ledger-core/src/__tests__/reconcile.test.ts +20 -0
  12. package/payload/platform/lib/ledger-core/src/reconcile.ts +12 -2
  13. package/payload/platform/neo4j/schema.cypher +4 -1
  14. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +37 -14
  15. package/payload/platform/plugins/docs/references/admin-ui.md +1 -1
  16. package/payload/platform/plugins/docs/references/google-guide.md +20 -9
  17. package/payload/platform/plugins/docs/references/ledger.md +9 -1
  18. package/payload/platform/plugins/docs/references/troubleshooting.md +4 -0
  19. package/payload/platform/plugins/docs/references/voice-mirror-guide.md +2 -2
  20. package/payload/platform/plugins/google/.claude-plugin/plugin.json +1 -1
  21. package/payload/platform/plugins/google/PLUGIN.md +28 -14
  22. package/payload/platform/plugins/google/mcp/dist/__tests__/account-register.test.js +79 -28
  23. package/payload/platform/plugins/google/mcp/dist/__tests__/account-register.test.js.map +1 -1
  24. package/payload/platform/plugins/google/mcp/dist/__tests__/boot.test.d.ts +2 -0
  25. package/payload/platform/plugins/google/mcp/dist/__tests__/boot.test.d.ts.map +1 -0
  26. package/payload/platform/plugins/google/mcp/dist/__tests__/boot.test.js +54 -0
  27. package/payload/platform/plugins/google/mcp/dist/__tests__/boot.test.js.map +1 -0
  28. package/payload/platform/plugins/google/mcp/dist/__tests__/google-client.test.js +26 -1
  29. package/payload/platform/plugins/google/mcp/dist/__tests__/google-client.test.js.map +1 -1
  30. package/payload/platform/plugins/google/mcp/dist/__tests__/index-registration.test.js +3 -2
  31. package/payload/platform/plugins/google/mcp/dist/__tests__/index-registration.test.js.map +1 -1
  32. package/payload/platform/plugins/google/mcp/dist/index.d.ts +9 -5
  33. package/payload/platform/plugins/google/mcp/dist/index.d.ts.map +1 -1
  34. package/payload/platform/plugins/google/mcp/dist/index.js +38 -37
  35. package/payload/platform/plugins/google/mcp/dist/index.js.map +1 -1
  36. package/payload/platform/plugins/google/mcp/dist/lib/google-client.d.ts +10 -7
  37. package/payload/platform/plugins/google/mcp/dist/lib/google-client.d.ts.map +1 -1
  38. package/payload/platform/plugins/google/mcp/dist/lib/google-client.js +25 -13
  39. package/payload/platform/plugins/google/mcp/dist/lib/google-client.js.map +1 -1
  40. package/payload/platform/plugins/google/mcp/dist/tools/account-register.d.ts +58 -17
  41. package/payload/platform/plugins/google/mcp/dist/tools/account-register.d.ts.map +1 -1
  42. package/payload/platform/plugins/google/mcp/dist/tools/account-register.js +143 -37
  43. package/payload/platform/plugins/google/mcp/dist/tools/account-register.js.map +1 -1
  44. package/payload/platform/plugins/google/references/auth.md +264 -362
  45. package/payload/platform/plugins/ledger/PLUGIN.md +13 -1
  46. package/payload/platform/plugins/ledger/mcp/dist/index.js +23 -15
  47. package/payload/platform/plugins/ledger/mcp/dist/index.js.map +1 -1
  48. package/payload/platform/plugins/ledger/mcp/dist/lib/read.d.ts +11 -1
  49. package/payload/platform/plugins/ledger/mcp/dist/lib/read.d.ts.map +1 -1
  50. package/payload/platform/plugins/ledger/mcp/dist/lib/read.js +20 -1
  51. package/payload/platform/plugins/ledger/mcp/dist/lib/read.js.map +1 -1
  52. package/payload/platform/plugins/ledger/mcp/dist/lib/types.d.ts +14 -11
  53. package/payload/platform/plugins/ledger/mcp/dist/lib/types.d.ts.map +1 -1
  54. package/payload/platform/plugins/ledger/mcp/dist/lib/types.js.map +1 -1
  55. package/payload/platform/plugins/ledger/mcp/dist/lib/write-rejects.d.ts +12 -0
  56. package/payload/platform/plugins/ledger/mcp/dist/lib/write-rejects.d.ts.map +1 -0
  57. package/payload/platform/plugins/ledger/mcp/dist/lib/write-rejects.js +50 -0
  58. package/payload/platform/plugins/ledger/mcp/dist/lib/write-rejects.js.map +1 -0
  59. package/payload/platform/plugins/ledger/mcp/dist/tools/cash-record.d.ts +5 -5
  60. package/payload/platform/plugins/ledger/mcp/dist/tools/cash-record.d.ts.map +1 -1
  61. package/payload/platform/plugins/ledger/mcp/dist/tools/cash-record.js +11 -11
  62. package/payload/platform/plugins/ledger/mcp/dist/tools/cash-record.js.map +1 -1
  63. package/payload/platform/plugins/ledger/mcp/dist/tools/invoice-record.d.ts +7 -2
  64. package/payload/platform/plugins/ledger/mcp/dist/tools/invoice-record.d.ts.map +1 -1
  65. package/payload/platform/plugins/ledger/mcp/dist/tools/invoice-record.js +9 -3
  66. package/payload/platform/plugins/ledger/mcp/dist/tools/invoice-record.js.map +1 -1
  67. package/payload/platform/plugins/ledger/mcp/dist/tools/payment-record.d.ts +7 -0
  68. package/payload/platform/plugins/ledger/mcp/dist/tools/payment-record.d.ts.map +1 -1
  69. package/payload/platform/plugins/ledger/mcp/dist/tools/payment-record.js +3 -4
  70. package/payload/platform/plugins/ledger/mcp/dist/tools/payment-record.js.map +1 -1
  71. package/payload/platform/plugins/ledger/mcp/dist/tools/reconcile.d.ts +1 -1
  72. package/payload/platform/plugins/ledger/mcp/dist/tools/reconcile.d.ts.map +1 -1
  73. package/payload/platform/plugins/ledger/mcp/dist/tools/reconcile.js +4 -1
  74. package/payload/platform/plugins/ledger/mcp/dist/tools/reconcile.js.map +1 -1
  75. package/payload/platform/plugins/voice-mirror/PLUGIN.md +1 -1
  76. package/payload/platform/plugins/voice-mirror/mcp/dist/index.js +3 -3
  77. package/payload/platform/plugins/voice-mirror/mcp/dist/index.js.map +1 -1
  78. package/payload/platform/plugins/voice-mirror/mcp/dist/lib/voice-corpus.d.ts +14 -1
  79. package/payload/platform/plugins/voice-mirror/mcp/dist/lib/voice-corpus.d.ts.map +1 -1
  80. package/payload/platform/plugins/voice-mirror/mcp/dist/lib/voice-corpus.js +15 -0
  81. package/payload/platform/plugins/voice-mirror/mcp/dist/lib/voice-corpus.js.map +1 -1
  82. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.d.ts.map +1 -1
  83. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.js +3 -1
  84. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.js.map +1 -1
  85. package/payload/platform/plugins/voice-mirror/mcp/scripts/smoke.mjs +51 -4
  86. package/payload/platform/plugins/voice-mirror/skills/voice-mirror/SKILL.md +4 -0
  87. package/payload/platform/scripts/backfill-task-ids.sh +206 -0
  88. package/payload/platform/services/claude-session-manager/dist/activity-rows.d.ts +27 -2
  89. package/payload/platform/services/claude-session-manager/dist/activity-rows.d.ts.map +1 -1
  90. package/payload/platform/services/claude-session-manager/dist/activity-rows.js +33 -2
  91. package/payload/platform/services/claude-session-manager/dist/activity-rows.js.map +1 -1
  92. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  93. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +1 -0
  94. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  95. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  96. package/payload/platform/services/claude-session-manager/dist/http-server.js +3 -0
  97. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  98. package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
  99. package/payload/server/{chunk-BSTIQX52.js → chunk-Y6V45R6M.js} +1 -12
  100. package/payload/server/maxy-edge.js +1 -1
  101. package/payload/server/public/activity.html +6 -6
  102. package/payload/server/public/assets/{AdminLoginScreens-BfamGqS7.js → AdminLoginScreens-B44KbEuC.js} +1 -1
  103. package/payload/server/public/assets/{AdminShell-5nHOAzXO.js → AdminShell-BjxV2qkb.js} +2 -2
  104. package/payload/server/public/assets/{Checkbox-CD6aHwac.js → Checkbox-DSeZNGNA.js} +1 -1
  105. package/payload/server/public/assets/activity-CdipMTDp.js +1 -0
  106. package/payload/server/public/assets/{admin-Cpcw_YE-.js → admin-B4LpTCur.js} +1 -1
  107. package/payload/server/public/assets/{browser-0znOwk1W.js → browser-CEFvaWwI.js} +1 -1
  108. package/payload/server/public/assets/{calendar-CykigHdg.js → calendar-B3zo6V34.js} +1 -1
  109. package/payload/server/public/assets/chat-5tJdo9i_.js +1 -0
  110. package/payload/server/public/assets/chevron-left-BJllrPBj.js +1 -0
  111. package/payload/server/public/assets/data-Du79EgR-.js +1 -0
  112. package/payload/server/public/assets/{graph-JV5_xF3V.js → graph-RaOrnSf2.js} +1 -1
  113. package/payload/server/public/assets/{graph-labels-DPYORjBH.js → graph-labels-GlTEIYJj.js} +1 -1
  114. package/payload/server/public/assets/{maximize-2-8vKr3h21.js → maximize-2-CHDa8p5h.js} +1 -1
  115. package/payload/server/public/assets/{operator-Liul1QEq.js → operator-DtqHY4jV.js} +1 -1
  116. package/payload/server/public/assets/{page-CYRA87CB.js → page-CkhFj8GQ.js} +1 -1
  117. package/payload/server/public/assets/{page-Cg7B1RQx.js → page-DxnWgPtd.js} +1 -1
  118. package/payload/server/public/assets/{public-B4HMtpjt.js → public-D5TUfQ3I.js} +1 -1
  119. package/payload/server/public/assets/{rotate-ccw-sz5IQSnr.js → rotate-ccw-BJjVAQQY.js} +1 -1
  120. package/payload/server/public/assets/tasks-CM9pYYG1.js +1 -0
  121. package/payload/server/public/assets/{time-entry-format-CSuCexpM.js → time-entry-format-C5RYEYjM.js} +1 -1
  122. package/payload/server/public/assets/{triangle-alert-ClS81-CU.js → triangle-alert-DLfIsuo_.js} +1 -1
  123. package/payload/server/public/assets/{useCopyFeedback-Cn6YgeNx.js → useCopyFeedback-7yKeiAzV.js} +1 -1
  124. package/payload/server/public/assets/{useSelectionMode-BaD-ZZRk.js → useSelectionMode-CWlh6AEq.js} +1 -1
  125. package/payload/server/public/assets/{useSubAccountSwitcher-CNZL3PKn.css → useSubAccountSwitcher-B2n9QPVI.css} +1 -1
  126. package/payload/server/public/assets/{useVoiceRecorder-BOzHrDAU.js → useVoiceRecorder-j3ZArZ2H.js} +1 -1
  127. package/payload/server/public/browser.html +5 -5
  128. package/payload/server/public/calendar.html +6 -6
  129. package/payload/server/public/chat.html +12 -12
  130. package/payload/server/public/data.html +11 -11
  131. package/payload/server/public/graph.html +11 -11
  132. package/payload/server/public/index.html +14 -14
  133. package/payload/server/public/operator.html +14 -14
  134. package/payload/server/public/public.html +12 -12
  135. package/payload/server/public/tasks.html +5 -5
  136. package/payload/server/server.js +1837 -1695
  137. package/payload/server/public/assets/activity-Dj2nJzPw.js +0 -1
  138. package/payload/server/public/assets/chat-DIOJZ411.js +0 -1
  139. package/payload/server/public/assets/chevron-left-Cq7UvOI0.js +0 -1
  140. package/payload/server/public/assets/data-lHgqlhmu.js +0 -1
  141. package/payload/server/public/assets/tasks-D9oYgEzs.js +0 -1
  142. /package/payload/server/public/assets/{useSubAccountSwitcher-CvjWJSGv.js → useSubAccountSwitcher-CBlKgwms.js} +0 -0
@@ -2,10 +2,11 @@
2
2
  * Register flow: authorization-code + PKCE.
3
3
  *
4
4
  * `runAccountRegisterStart` mints the PKCE pair and `state`, persists them, and
5
- * returns a consent URL the operator opens on any device. Google redirects to
6
- * platform/ui's /api/google/oauth/callback, which holds the client secret,
7
- * exchanges the code, and writes tokens. `runAccountRegisterPoll` then reports
8
- * the outcome from local state only — no network.
5
+ * returns a consent URL the user opens on any device. Google redirects to a
6
+ * loopback address nothing listens on, so the page fails to load and the user
7
+ * copies the code from the address bar; `runAccountRegisterSubmit` exchanges it
8
+ * here, in-process, using the brand-config client secret.
9
+ * `runAccountRegisterPoll` reports the outcome from local state only.
9
10
  */
10
11
  import { createHash, randomBytes } from "node:crypto";
11
12
  import { existsSync, readdirSync } from "node:fs";
@@ -15,6 +16,8 @@ import { TokenStore } from "../auth/token-store.js";
15
16
  import { log } from "../lib/log.js";
16
17
  export const CALENDAR_SCOPE = "https://www.googleapis.com/auth/calendar";
17
18
  const AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
19
+ const TOKEN_URL = "https://oauth2.googleapis.com/token";
20
+ const PRIMARY_CALENDAR_URL = "https://www.googleapis.com/calendar/v3/calendars/primary";
18
21
  /** Google refuses an authorization code older than roughly ten minutes; a
19
22
  * pending entry past that is stranded, not live. */
20
23
  export const PENDING_LIFETIME_SEC = 600;
@@ -22,33 +25,34 @@ export function newPkce() {
22
25
  const verifier = randomBytes(48).toString("base64url");
23
26
  return { verifier, challenge: createHash("sha256").update(verifier).digest("base64url") };
24
27
  }
25
- /** The `state` value carries BOTH the account id and the nonce, as
26
- * `<accountId>.<nonce>`.
28
+ /** Desktop (installed app) clients permit ONLY loopback redirects. https is
29
+ * rejected outright and custom URI schemes are withdrawn, so this is the whole
30
+ * option space.
27
31
  *
28
- * It cannot ride on the redirect_uri: Google requires redirect_uri to match a
29
- * registered value EXACTLY, so a per-request query parameter makes every
30
- * authorization request fail with redirect_uri_mismatch. Google's own guidance
31
- * names `state` as the mechanism for per-request application state.
32
+ * The IP literal is mandatory. RFC 8252 s7.3 makes the port irrelevant when
33
+ * matching a loopback redirect, but only for `127.0.0.1` / `::1` — NOT for the
34
+ * hostname `localhost`, which strict servers match literally.
32
35
  *
33
- * Putting the account id in an attacker-visible field is safe because it is
34
- * routing information, not authorisation: the callback still requires the
35
- * nonce half to equal the one stored in that account's pending entry, and an
36
- * attacker cannot produce a valid nonce for an account they do not control. */
37
- export function encodeState(accountId, nonce) {
38
- return `${accountId}.${nonce}`;
39
- }
40
- export function decodeState(state) {
41
- const idx = state.lastIndexOf(".");
42
- if (idx <= 0 || idx === state.length - 1)
43
- return null;
44
- return { accountId: state.slice(0, idx), nonce: state.slice(idx + 1) };
45
- }
36
+ * Nothing listens on this port, by design: the consenting browser is on the
37
+ * user's own phone, so the redirect fails to load and the user copies the code
38
+ * out of the address bar. The value is fixed so the consent URL is
39
+ * deterministic and one register's logs compare against another's. */
40
+ export const LOOPBACK_REDIRECT_URI = "http://127.0.0.1:8571";
41
+ /** `state` is an opaque CSRF nonce and nothing more.
42
+ *
43
+ * It deliberately does NOT carry the account id. Under the Desktop flow the
44
+ * pending entry is keyed on the spawn's own ACCOUNT_ID, so submit can only ever
45
+ * read its own account's pending, and PKCE binds the code to that entry's
46
+ * verifier. Routing information in `state` would therefore buy nothing, while
47
+ * putting an account uuid into a URL opened on a personal phone, stored in
48
+ * browser history and Google's logs, and pasted back through chat.
49
+ *
50
+ * (Task 1761 encoded `<accountId>.<nonce>` because a shared hosted callback had
51
+ * to route an inbound request to an account. That callback is gone.) */
46
52
  export function buildConsentUrl(args) {
47
- // redirect_uri is sent VERBATIM — no query string. See encodeState above.
48
- const redirect = args.redirectUri;
49
53
  const q = new URLSearchParams({
50
54
  client_id: args.clientId,
51
- redirect_uri: redirect,
55
+ redirect_uri: LOOPBACK_REDIRECT_URI,
52
56
  response_type: "code",
53
57
  scope: CALENDAR_SCOPE,
54
58
  access_type: "offline",
@@ -91,24 +95,18 @@ export async function runAccountRegisterStart(args) {
91
95
  });
92
96
  return { status: "in-progress", ageSec: age };
93
97
  }
94
- const nonce = randomBytes(16).toString("hex");
95
- const state = encodeState(args.accountId, nonce);
98
+ const state = randomBytes(16).toString("hex");
96
99
  const { verifier, challenge } = newPkce();
97
- log({ tag: "[google-oauth]", op: "register", account: args.accountId, reg: nonce });
98
- // The pending entry stores the NONCE, not the composed state: the account is
99
- // already implied by which account's store this is, and comparing the nonce
100
- // alone keeps the check independent of the encoding.
101
- pending.write({ state: nonce, verifier, createdAt: Date.now() });
102
- log({ tag: "[google-oauth]", op: "pending-write", reg: nonce, account: args.accountId });
103
- const redirectUri = `${args.publicBase}/api/google/oauth/callback`;
100
+ log({ tag: "[google-oauth]", op: "register", account: args.accountId, reg: state });
101
+ pending.write({ state, verifier, createdAt: Date.now() });
102
+ log({ tag: "[google-oauth]", op: "pending-write", reg: state, account: args.accountId });
104
103
  const consentUrl = buildConsentUrl({
105
104
  clientId: args.clientId,
106
- redirectUri,
107
105
  state,
108
106
  challenge,
109
107
  accountId: args.accountId,
110
108
  });
111
- log({ tag: "[google-oauth]", op: "consent-url", reg: nonce, scopes: CALENDAR_SCOPE, redirect: redirectUri });
109
+ log({ tag: "[google-oauth]", op: "consent-url", reg: state, scopes: CALENDAR_SCOPE, redirect: LOOPBACK_REDIRECT_URI });
112
110
  return { status: "pending", consentUrl };
113
111
  }
114
112
  export async function runAccountRegisterPoll(args) {
@@ -123,4 +121,112 @@ export async function runAccountRegisterPoll(args) {
123
121
  }
124
122
  return { status: "pending", accounts, ageSec: age };
125
123
  }
124
+ /** Users paste what they can see, and what they can see is Google's loopback
125
+ * redirect — which ALWAYS carries `scope` alongside `code`, and often
126
+ * `authuser` and `prompt` too. So the realistic pastes are a whole URL or a
127
+ * `code=…&scope=…` fragment, not a bare value.
128
+ *
129
+ * Extracting `code` properly matters because a mangled value reaches Google as
130
+ * an opaque string and comes back `invalid_grant`, which reads to the user as
131
+ * "your code expired" and sends them round the consent loop again. It never
132
+ * says the paste was the problem.
133
+ *
134
+ * A malformed percent escape must not throw either: `decodeURIComponent` raises
135
+ * URIError on a stray `%`, and surfacing that instead of Google's own error
136
+ * would be our parser blaming the user for a value Google would have explained.
137
+ */
138
+ export function normalisePastedCode(raw) {
139
+ const s = raw.trim();
140
+ // A full URL, or a query fragment carrying more than one parameter.
141
+ if (s.includes("://") || s.startsWith("?") || s.includes("&")) {
142
+ const query = s.slice(s.indexOf("?") >= 0 ? s.indexOf("?") + 1 : 0);
143
+ const fromQuery = new URLSearchParams(query).get("code");
144
+ if (fromQuery)
145
+ return fromQuery.trim();
146
+ }
147
+ let out = s;
148
+ if (out.startsWith("code="))
149
+ out = out.slice("code=".length);
150
+ if (out.includes("%")) {
151
+ try {
152
+ out = decodeURIComponent(out);
153
+ }
154
+ catch {
155
+ // Leave it as pasted; Google's error is more useful than ours.
156
+ }
157
+ }
158
+ return out.trim();
159
+ }
160
+ /**
161
+ * Finish a registration from the code the user pasted back.
162
+ *
163
+ * The exchange happens HERE, in the plugin, because a Desktop client's secret
164
+ * ships in brand config — there is no server-side holder to delegate to. The
165
+ * redirect_uri sent here is the same constant the consent URL carried; Google
166
+ * compares them byte for byte.
167
+ */
168
+ export async function runAccountRegisterSubmit(args) {
169
+ const doFetch = args.fetchImpl ?? fetch;
170
+ const pending = new PendingStore(args.accountId, args.accountsDir);
171
+ const held = pending.read();
172
+ if (!held) {
173
+ throw new Error("no registration in progress; run google-account-register first");
174
+ }
175
+ const code = normalisePastedCode(args.code);
176
+ log({ tag: "[google-oauth]", op: "submit", account: args.accountId, reg: held.state });
177
+ const res = await doFetch(TOKEN_URL, {
178
+ method: "POST",
179
+ headers: { "content-type": "application/x-www-form-urlencoded" },
180
+ body: new URLSearchParams({
181
+ code,
182
+ client_id: args.clientId,
183
+ client_secret: args.clientSecret,
184
+ redirect_uri: LOOPBACK_REDIRECT_URI,
185
+ grant_type: "authorization_code",
186
+ code_verifier: held.verifier,
187
+ }),
188
+ });
189
+ const text = await res.text();
190
+ if (!res.ok) {
191
+ // Never discard the body: invalid_grant means expired or already used,
192
+ // redirect_uri_mismatch means the sent and registered redirects diverged.
193
+ log({
194
+ tag: "[google-oauth]", op: "submit", reg: held.state,
195
+ outcome: "error", status: res.status, body: text.slice(0, 300),
196
+ });
197
+ throw new Error(`token exchange failed (${res.status}): ${text.slice(0, 300)}`);
198
+ }
199
+ const tok = JSON.parse(text);
200
+ // Identity comes from the primary calendar's id, which IS the address, so the
201
+ // identity scopes are never requested.
202
+ const calRes = await doFetch(PRIMARY_CALENDAR_URL, {
203
+ headers: { authorization: `Bearer ${tok.access_token}` },
204
+ });
205
+ const calText = await calRes.text();
206
+ if (!calRes.ok) {
207
+ throw new Error(`identity lookup failed (${calRes.status}): ${calText.slice(0, 200)}`);
208
+ }
209
+ const email = JSON.parse(calText).id;
210
+ const stored = new TokenStore(args.accountId, args.accountsDir, email).store(tok.access_token, tok.refresh_token ?? null, tok.expires_in, { email, scopes: tok.scope ? tok.scope.split(" ") : [] });
211
+ log({
212
+ tag: "[google-oauth]", op: "tokens-write", reg: held.state,
213
+ account: args.accountId, refreshIssued: tok.refresh_token ? "true" : "false",
214
+ });
215
+ pending.clear();
216
+ log({ tag: "[google-oauth]", op: "registered", reg: held.state, account: args.accountId, email });
217
+ // A connection with no refresh token works for about an hour and then dies.
218
+ // Reporting only in the log would tell the operator "connected" and leave the
219
+ // failure to surface later as an unexplained loss of access.
220
+ const refreshTokenIssued = Boolean(stored.refreshToken);
221
+ return {
222
+ status: "registered",
223
+ email,
224
+ refreshTokenIssued,
225
+ ...(refreshTokenIssued
226
+ ? {}
227
+ : {
228
+ warning: "Google returned no refresh token, so this connection will stop working when the access token expires in about an hour. Re-run google-account-register to reconnect.",
229
+ }),
230
+ };
231
+ }
126
232
  //# sourceMappingURL=account-register.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"account-register.js","sourceRoot":"","sources":["../../src/tools/account-register.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,CAAC,MAAM,cAAc,GAAG,0CAA0C,CAAC;AACzE,MAAM,QAAQ,GAA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