@rubytech/create-maxy-code 0.1.328 → 0.1.330

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 (55) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-authoring-skill-gate.test.js +2 -2
  3. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-authoring-skill-gate.test.js.map +1 -1
  4. package/payload/platform/plugins/admin/mcp/dist/content-producer-authoring-skills.d.ts +1 -1
  5. package/payload/platform/plugins/admin/mcp/dist/content-producer-authoring-skills.d.ts.map +1 -1
  6. package/payload/platform/plugins/admin/mcp/dist/content-producer-authoring-skills.js +18 -6
  7. package/payload/platform/plugins/admin/mcp/dist/content-producer-authoring-skills.js.map +1 -1
  8. package/payload/platform/plugins/slides/skills/deck-system/SKILL.md +1 -1
  9. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  10. package/payload/platform/services/claude-session-manager/dist/http-server.js +14 -0
  11. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  12. package/payload/platform/services/claude-session-manager/dist/index.js +34 -1
  13. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  14. package/payload/platform/services/claude-session-manager/dist/rc-child-log.d.ts +13 -0
  15. package/payload/platform/services/claude-session-manager/dist/rc-child-log.d.ts.map +1 -0
  16. package/payload/platform/services/claude-session-manager/dist/rc-child-log.js +52 -0
  17. package/payload/platform/services/claude-session-manager/dist/rc-child-log.js.map +1 -0
  18. package/payload/platform/services/claude-session-manager/dist/stuck-turn.d.ts +64 -0
  19. package/payload/platform/services/claude-session-manager/dist/stuck-turn.d.ts.map +1 -0
  20. package/payload/platform/services/claude-session-manager/dist/stuck-turn.js +201 -0
  21. package/payload/platform/services/claude-session-manager/dist/stuck-turn.js.map +1 -0
  22. package/payload/platform/templates/specialists/agents/content-producer.md +1 -1
  23. package/payload/premium-plugins/management-consulting/skills/pitch-deck/SKILL.md +44 -37
  24. package/payload/premium-plugins/writer-craft/mcp/dist/index.d.ts.map +1 -1
  25. package/payload/premium-plugins/writer-craft/mcp/dist/index.js +7 -2
  26. package/payload/premium-plugins/writer-craft/mcp/dist/index.js.map +1 -1
  27. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.d.ts.map +1 -1
  28. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.js +9 -7
  29. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.js.map +1 -1
  30. package/payload/premium-plugins/writer-craft/mcp/scripts/smoke.mjs +38 -2
  31. package/payload/premium-plugins/writer-craft/mcp/src/index.ts +7 -2
  32. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-retrieve-conditioning.ts +9 -7
  33. package/payload/premium-plugins/writer-craft/skills/voice-mirror/SKILL.md +1 -1
  34. package/payload/server/public/assets/{AdminLoginScreens-DstNf4M-.js → AdminLoginScreens-BnuaXvxN.js} +1 -1
  35. package/payload/server/public/assets/{AdminShell-B5EcXCYR.js → AdminShell-Br0DJQNu.js} +1 -1
  36. package/payload/server/public/assets/{Checkbox-DWGpkJD5.js → Checkbox-1flpB9H0.js} +1 -1
  37. package/payload/server/public/assets/{OperatorConversations-BWu6GMQM.css → OperatorConversations-DrPqB9Ym.css} +1 -1
  38. package/payload/server/public/assets/{admin-CnIlm4Yi.js → admin-BWJTvagN.js} +1 -1
  39. package/payload/server/public/assets/{browser-ePr5LxPd.js → browser-XM5e-fn1.js} +1 -1
  40. package/payload/server/public/assets/chat-COFMxaoC.js +1 -0
  41. package/payload/server/public/assets/{data-DuObS80U.js → data-BHtJozT2.js} +1 -1
  42. package/payload/server/public/assets/{graph-B5uxt5YB.js → graph-CIIz9Dmh.js} +1 -1
  43. package/payload/server/public/assets/{graph-labels-fx-bv3Y-.js → graph-labels-BRKvhE0e.js} +1 -1
  44. package/payload/server/public/assets/{operator-CIGXegWd.js → operator-9hbxrXKm.js} +1 -1
  45. package/payload/server/public/assets/{page-BVOAwj-e.js → page-CXkBfOhG.js} +2 -2
  46. package/payload/server/public/assets/{public-DXAdRKJe.js → public-BPlZnopr.js} +1 -1
  47. package/payload/server/public/browser.html +4 -4
  48. package/payload/server/public/chat.html +5 -5
  49. package/payload/server/public/data.html +4 -4
  50. package/payload/server/public/graph.html +6 -6
  51. package/payload/server/public/index.html +6 -6
  52. package/payload/server/public/operator.html +7 -7
  53. package/payload/server/public/public.html +5 -5
  54. package/payload/server/public/assets/chat-XjXSornk.js +0 -1
  55. /package/payload/server/public/assets/{OperatorConversations-CSQnX7Dx.js → OperatorConversations-C8sITz2_.js} +0 -0
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  name: pitch-deck
3
- description: Composes a presentation deck in the operator's own voice. It states plainly what is being proposed and how it works; it does not sell or perform. Three kinds: a deck that wins new work, a deck that presents findings and a recommendation, and a deck that sets out a point of view. Use for a consulting pitch deck, a capabilities or credentials deck, a client findings or recommendation deck, a board or steering-committee deck, or a thought-leadership deck. Writes the full text of the deck first and gets the operator to approve it before building anything; only then chooses light or dark mode and applies the brand's design tokens. Never invents a number. Not a founder fundraise deck; that is `venture-studio:investor-data-room`. Not a generic renderer for arbitrary HTML slides; that is `admin:deck-pages`.
3
+ description: Composes a presentation deck in the operator's own voice. It states plainly what is being proposed and how it works; it does not sell or perform. Three kinds: a deck that wins new work, a deck that presents findings and a recommendation, and a deck that sets out a point of view. Use for a consulting pitch deck, a capabilities or credentials deck, a client findings or recommendation deck, a board or steering-committee deck, or a thought-leadership deck. The admin runs it: it asks the operator the deck kind, light or dark, and the colour set, then delegates composing the words and rendering to `specialists:content-producer`, with the words approved before anything is built. Never invents a number. Not a founder fundraise deck; that is `venture-studio:investor-data-room`. Not a generic renderer for arbitrary HTML slides; that is `admin:deck-pages`.
4
4
  ---
5
5
 
6
6
  # Pitch Deck
7
7
 
8
- The consulting bundle's deck. It states plainly what is being proposed and how it works. The words come first, and the operator approves them before any deck is built. It composes only from facts the operator already curated, and it never invents a number.
8
+ The consulting bundle's deck. It states plainly what is being proposed and how it works. The admin runs this skill and owns every choice the operator must make; content-producer does the composing and the rendering. The words are approved before anything is built. It composes only from facts the operator already curated, and it never invents a number.
9
9
 
10
10
  ## When to use
11
11
 
12
- Pick the kind of deck from the brief. All three are built the same way: words first, approved, then rendered.
12
+ Pick the kind of deck from the brief.
13
13
 
14
14
  | Kind | Use it when |
15
15
  |------|-------------|
@@ -22,65 +22,70 @@ Pick the kind of deck from the brief. All three are built the same way: words fi
22
22
  - **Founder fundraise deck** (seed or Series raise, investor pitch under the founder's own name) routes to `venture-studio:investor-data-room`.
23
23
  - **A deck the operator already wrote, an arbitrary fixed-dimension slide layout, "save this HTML as a deck"** routes to `admin:deck-pages` (the format spec and generic slide renderer).
24
24
 
25
- ## Where this runs
25
+ ## Who does what
26
26
 
27
- Invoked from `specialists:content-producer`. The admin seat delegates the deck from the first point: it is refused this skill and dispatches content-producer (Agent tool, `subagent_type: content-producer`). Everything then happens on the one seat. content-producer carries `voice-retrieve-conditioning`, loads `plainly`, and holds the render tools, so the words, the voice, and the build all run together.
27
+ Invoked by the admin agent. The split exists because only the admin can ask the operator a question; a specialist cannot.
28
28
 
29
- ## How it works: words first, then the deck
29
+ - **The admin** owns every operator decision: the deck kind, light or dark, the colour set, and approval of the words. It asks the operator directly and never relies on the subagent to raise these.
30
+ - **content-producer** does the two mechanical steps the admin delegates: write the words to a file, and render with the choices passed in. It owns no question to the operator.
30
31
 
31
- The order matters and it is not optional.
32
+ ## The order (fixed)
32
33
 
33
- 1. **Write the words.** Compose the full text of every slide: the header and the body and any lists. Write it in the matter-of-fact register and gate it on voice first (both below). This is the whole deck as plain text, with no layout.
34
- 2. **Get the words approved.** Show the operator the text, every slide. Iterate until they approve it. Build nothing before then. A deck built on words the operator has not signed off wastes the build, and layout hides wording problems instead of surfacing them.
35
- 3. **Build the deck.** Only after the words are approved: decide light or dark mode, apply the brand's design tokens, then render through `slides:deck-system` to HTML and a PDF.
34
+ 1. **Intake (admin).** Ask the operator three things: which kind of deck (win the work, findings, point of view), light or dark, and the colour set (the brand default, or a set the operator names). These are the same questions for every deck, so ask them up front. Do not delegate anything until you have the answers.
35
+ 2. **Compose (delegate to content-producer).** Dispatch content-producer (Agent tool, `subagent_type: content-producer`) with the kind, the topic, and the source facts. It writes the full deck text to a file, voice-conditioned (below), and returns the file path. It makes no visual choice and does not render.
36
+ 3. **Approve (admin).** Read the words file back to the operator. Take their edits, iterate, until they approve.
37
+ 4. **Render (delegate to content-producer).** Dispatch content-producer again with the approved-words file path, the kind, the mode (light or dark), and the colour set. It renders and exports the PDF.
36
38
 
37
- ## Writing the words
39
+ ## Writing the words (content-producer, compose step)
38
40
 
39
- Load `plainly` and write in its **statement register**: say what each thing is, in a sensible order, with no selling, no story arc, and no performance. `plainly` carries the full rule and the habits to strip; do not restate them here, apply them. The points that matter most for a deck:
41
+ Load `plainly` and write in its **statement register**: say what each thing is, in a sensible order, with no selling, no story arc, and no performance. `plainly` carries the full rule and the habits to strip; apply them, do not restate them. The points that matter most for a deck:
40
42
 
41
43
  - **Each slide's header says what the slide is, or states its one fact.** "Using AI to handle insurance rejections", not a slogan. Never bend a header to land a word in a set place or to match the shape of another header.
42
44
  - **Put the point first.** Say what you are proposing, then explain it. Do not build up to it.
43
- - **Order the slides so the whole thing is clear:** where they are now, what you would do, how it works, what it costs to start, what you are asking for. Read the headers on their own, in order. They should lay the whole thing out plainly.
45
+ - **Order the slides so the whole thing is clear:** where they are now, what you would do, how it works, what it costs to start, what you are asking for. Read the headers on their own, in order; they should lay the whole thing out plainly.
44
46
  - **Each section covers something the others do not.** No overlap, no gaps. If two slides say the same thing, merge them.
45
47
  - **One point per slide.** Cut any slide that does not say something the reader needs.
46
48
  - **Every slide with a number shows where the number came from:** a graph node, a named source, or the operator's own figures. A number with no source is a defect.
47
49
  - **Never invent a number.** If one is missing, leave a visible gap and ask for it. Do not fill it.
48
50
 
51
+ Write the words to a file under `output/` and return the path. Do not render, and do not choose light or dark or a colour set; those are the admin's, passed back to you at the render step.
52
+
49
53
  ### Voice (hard gate)
50
54
 
51
- A deck goes out under the business name, so it uses the **house voice**, not any one person's personal voice. Before writing any of the words, call `voice-retrieve-conditioning` with `format: "article"`, `length: "long"`, `scope: "org"`, and `topic` set to the engagement domain. The tool emits its own `[voice-retrieve] …` line; you do not write that line.
55
+ A deck goes out under the business name, so it uses the **house voice**. A deck is mostly short copy with some longer prose, so retrieve both profiles and condition each part on the right one:
56
+
57
+ - **`marketing-copy`** for the short copy: headlines, taglines, calls to action, the one-line slide points.
58
+ - **`article`** for any longer body prose: a paragraph of context, an executive summary.
52
59
 
53
- Then gate on `status`. This diverges from the sibling composers, which silently degrade to a default register; this skill stops instead.
60
+ Call `voice-retrieve-conditioning` for each, with `length: "long"`, `scope: "org"`, and `topic` set to the engagement domain. The tool emits its own `[voice-retrieve] …` line per call.
54
61
 
55
- - **`ok`** (a style card or exemplars came back): write every line conditioned on the style card and exemplars.
56
- - **`no-data` | `error`**: stop. Write no slide text. Tell the operator the deck voice is not established, and offer two routes: establish the house voice through the voice-mirror skill, then re-run; or supply the words themselves, which this skill will only structure and run through `plainly`, never generate.
62
+ Gate on the `marketing-copy` result, since the deck is mostly short copy:
57
63
 
58
- A `scope: "org"` request returns only `ok`, `no-data`, or `error`. Emit one decision line after the gate:
64
+ - **`ok`**: condition the short copy on the marketing-copy style card and the body on the article style card, then write.
65
+ - **`no-data` | `error`**: stop. Write no slide text. Return to the admin: the deck voice is not established, and offer two routes. Establish the house voice through the voice-mirror skill then re-run, or have the operator supply the words, which this skill only structures and runs through `plainly`, never generates.
66
+
67
+ Emit one decision line after the gate:
59
68
 
60
69
  ```
61
70
  [pitch-deck] voice-gate status=<ok|no-data|error> action=<conditioned|stopped|operator-prose>
62
71
  ```
63
72
 
64
- ## Get the words approved
65
-
66
- Show the operator the full text of the deck, every slide, before building anything. Take their edits and fold them in. Repeat until they approve. The approval is the gate to the build step; do not render a deck the operator has not signed off.
73
+ ## Rendering (content-producer, render step)
67
74
 
68
- ## Build the deck
75
+ Render only when the admin has handed you all three inputs: the approved-words file, the mode (light or dark), and the colour set. **If any of the three is missing, do not render.** Return to the admin naming what is missing and emit:
69
76
 
70
- Only after the words are approved.
71
-
72
- 1. **Choose light or dark mode.** Ask the operator, or take it from the brand if the brand sets one. The choice is made once, here, before rendering.
73
- 2. **Apply the brand's design tokens.** Read `brand.json` and take the colours and fonts from it. This is a prerequisite of the build, not a finishing pass. Do not invent colours; if the brand omits a value, fall back to the default brand's value.
74
- 3. **Render.** Hand the approved words to `slides:deck-system`, which carries the components, the themes, and the PDF export. content-producer renders on the same seat and exports the PDF through the existing path. There is no new renderer.
77
+ ```
78
+ [pitch-deck] render-refused missing=<words|mode|colour>
79
+ ```
75
80
 
76
- If `slides` is not enabled, say so and fall back to the always-present `admin:deck-pages` format spec. Never return a blank turn because a dependency is absent. Build in the operator's own brand; never embed a named firm's branded template or assets.
81
+ With all three present: apply the brand's design tokens for the chosen colour set (read `brand.json`; do not invent colours, fall back to the default brand's value for any missing token), render the approved words through `slides:deck-system` in the chosen mode, and export the PDF through the existing path. There is no new renderer. If `slides` is not enabled, say so and fall back to the always-present `admin:deck-pages` format spec. Build in the operator's own brand; never embed a named firm's branded template or assets.
77
82
 
78
83
  ## The three kinds, and how each is ordered
79
84
 
80
- The voice and register are the same for all three. They differ only in what slides they hold and in what order.
85
+ The voice and register are the same for all three. They differ only in which slides they hold and in what order.
81
86
 
82
- - **Win the work.** A fixed set of slides, plus a few specific to the engagement: who you are, how you work, what you do, the work you have done before, the people, how to reach you. Add only the sections this prospect needs. Aim for eleven to fourteen slides.
83
- - **Present findings and a recommendation.** One slide that states the recommendation and the few facts behind it, then where things stand now, what is wrong, what you found, what you recommend, how it would roll out, and what happens next. The first slide stands on its own: a reader who sees only it knows the recommendation, the reason, and the next step.
87
+ - **Win the work.** A fixed set of slides plus a few specific to the engagement: who you are, how you work, what you do, the work you have done before, the people, how to reach you. Add only the sections this prospect needs. Aim for eleven to fourteen slides.
88
+ - **Present findings and a recommendation.** One slide that states the recommendation and the few facts behind it, then where things stand now, what is wrong, what you found, what you recommend, how it would roll out, and what happens next. The first slide stands on its own.
84
89
  - **Set out a point of view.** The topic first, then the data, then what it means and what to do about it, then a short note on who you are at the end. No client-specific recommendation and no sell.
85
90
 
86
91
  ## Charts
@@ -109,16 +114,18 @@ The deck composes the outputs of the other consulting skills. Numbers come from
109
114
 
110
115
  ## Done when
111
116
 
112
- - Every line passes the said-aloud test in `plainly`'s statement register: read it to a colleague across the table and you would say it that way. It states what the thing is, with no selling, no arc, and none of the habits `plainly` strips.
113
- - The operator approved the words before the deck was built.
114
- - Light or dark mode was chosen and the brand's design tokens were applied before rendering.
115
- - Every slide with a number shows its source, and every number traces to the brief or a sibling output.
116
- - The deck renders to HTML and exports a PDF.
117
+ - The admin asked the operator the kind, the mode, and the colour set before delegating.
118
+ - content-producer wrote the words to a file and the operator approved them before any render.
119
+ - The render ran only with the approved words, the mode, and the colour set all present.
120
+ - The short copy was conditioned on `marketing-copy` and the body on `article`.
121
+ - Every line passes the said-aloud test in `plainly`'s statement register.
122
+ - Every slide with a number shows its source, and the deck renders to HTML and exports a PDF.
117
123
 
118
124
  ## Observability
119
125
 
120
126
  ```
121
127
  [pitch-deck] voice-gate status=<ok|no-data|error> action=<conditioned|stopped|operator-prose>
128
+ [pitch-deck] render-refused missing=<words|mode|colour>
122
129
  ```
123
130
 
124
- The `[voice-retrieve] …` line is emitted by the voice tool. A render or export failure surfaces through `content-producer`'s existing `[tool-failure-diag]` line. A misroute shows as the absence of a `skill-load skillName=pitch-deck` line in a consulting-deck turn.
131
+ The `[voice-retrieve] …` line is emitted by the voice tool, once per profile. A `render-refused` line means the admin tried to build without all three inputs, which is the guard working. A render or export failure surfaces through `content-producer`'s existing `[tool-failure-diag]` line.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuC,gBAAgB,EAAuB,MAAM,8BAA8B,CAAC;AA4b1H,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuC,gBAAgB,EAAuB,MAAM,8BAA8B,CAAC;AAic1H,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -224,7 +224,11 @@ lifelineTool(server, "voice-retrieve-conditioning", "Return the operator's per-f
224
224
  if (!accountId)
225
225
  return refuseNoAccount("voice-retrieve-conditioning");
226
226
  const resolvedUserId = userId ?? resolveUserId();
227
- if (!resolvedUserId) {
227
+ // org scope is account-wide (keyed on ORG_USER_ID + accountId) and never
228
+ // reads a userId, so a specialist spawn that carries ACCOUNT_ID but no
229
+ // ADMIN_USER_ID can still retrieve the house voice. Only personal scope
230
+ // requires a resolved userId (Task 975).
231
+ if ((scope ?? "personal") !== "org" && !resolvedUserId) {
228
232
  // Soft (no isError) so drafting degrades, but status:error keeps this
229
233
  // distinct from genuine no-data (Task 493).
230
234
  return {
@@ -244,7 +248,8 @@ lifelineTool(server, "voice-retrieve-conditioning", "Return the operator's per-f
244
248
  try {
245
249
  const result = await voiceRetrieveConditioning({
246
250
  accountId,
247
- userId: resolvedUserId,
251
+ // org scope ignores userId; pass through for personal scope.
252
+ userId: resolvedUserId ?? "",
248
253
  brief: {
249
254
  format: format,
250
255
  topic,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACnF,aAAa,CAAC,cAAc,CAAC,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAA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ACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,6EAA6E;iBACpF;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC;YAC1C,KAAK;YACL,SAAS;YACT,MAAM,EAAE,cAAc;YACtB,SAAS;SACV,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,4CAA4C,MAAM,CAAC,aAAa,iBAAiB,MAAM,CAAC,YAAY,cAAc,MAAM,CAAC,SAAS,IAAI,SAAS,EAAE;iBACxJ;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,qCAAqC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;iBAC9F;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEhC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IAC/B,MAAM,WAAW,EAAE,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,0DAA0D;AAC1D,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"voice-retrieve-conditioning.d.ts","sourceRoot":"","sources":["../../src/tools/voice-retrieve-conditioning.ts"],"names":[],"mappings":"AA+BA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAMhC,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;;WAGG;QACH,MAAM,EAAE,WAAW,CAAC;QACpB;;;;WAIG;QACH,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;;;WAKG;QACH,KAAK,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9E,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,+BAA+B,CAAC,CA4J1C"}
1
+ {"version":3,"file":"voice-retrieve-conditioning.d.ts","sourceRoot":"","sources":["../../src/tools/voice-retrieve-conditioning.ts"],"names":[],"mappings":"AA+BA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAMhC,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;;WAGG;QACH,MAAM,EAAE,WAAW,CAAC;QACpB;;;;WAIG;QACH,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;;;WAKG;QACH,KAAK,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9E,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,+BAA+B,CAAC,CA8J1C"}
@@ -38,12 +38,15 @@ function errorResult(error) {
38
38
  }
39
39
  export async function voiceRetrieveConditioning(params) {
40
40
  const { accountId, userId, brief } = params;
41
- // Blank identity is an error, never genuine no-data — index.ts guards both
42
- // accountId and userId before calling, so a blank value reaching here is a
43
- // precondition failure, not "you have no profile". Emit a line so this path
44
- // is no longer silent (Task 493 closes the 06:46 path-1 ambiguity).
45
- if (!accountId || !userId) {
46
- process.stderr.write(`[voice-retrieve] error: missing-identity accountId=${Boolean(accountId)} userId=${Boolean(userId)}\n`);
41
+ const scope = brief.scope ?? "personal";
42
+ // Blank identity is an error, never genuine no-data — a blank value reaching
43
+ // here is a precondition failure, not "you have no profile". `accountId` is
44
+ // always required. `userId` is required only for personal scope: org scope is
45
+ // account-wide and keyed on the reserved ORG_USER_ID, so it resolves identity
46
+ // from `accountId` alone and never reads `userId` (Task 975). Emit a line so
47
+ // this path is no longer silent (Task 493 — closes the 06:46 path-1 ambiguity).
48
+ if (!accountId || (scope !== "org" && !userId)) {
49
+ process.stderr.write(`[voice-retrieve] error: missing-identity scope=${scope} accountId=${Boolean(accountId)} userId=${Boolean(userId)}\n`);
47
50
  return errorResult("missing accountId/userId");
48
51
  }
49
52
  const length = brief.length ?? "short";
@@ -52,7 +55,6 @@ export async function voiceRetrieveConditioning(params) {
52
55
  (length === "long" ? DEFAULT_TOKEN_BUDGET_LONG : DEFAULT_TOKEN_BUDGET_SHORT);
53
56
  const charBudget = tokenBudget * CHARS_PER_TOKEN;
54
57
  const format = brief.format;
55
- const scope = brief.scope ?? "personal";
56
58
  const topic = (brief.topic ?? "").trim();
57
59
  const usesTopic = topic.length > 0;
58
60
  // Body resolution (Task 471): for :KnowledgeDocument with HAS_SECTION
@@ -1 +1 @@
1
- {"version":3,"file":"voice-retrieve-conditioning.js","sourceRoot":"","sources":["../../src/tools/voice-retrieve-conditioning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAuB,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EACL,0BAA0B,EAC1B,mCAAmC,EACnC,WAAW,GAGZ,MAAM,wBAAwB,CAAC;AAEhC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAC1C,MAAM,yBAAyB,GAAG,MAAM,CAAC;AACzC,MAAM,eAAe,GAAG,CAAC,CAAC;AAgE1B,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,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task 493):
17
17
  * status:"error" on blank identity and on a forced lookup throw, never
18
- * collapsing a failed lookup into the no-data payload.
18
+ * collapsing a failed lookup into the no-data payload. Personal scope
19
+ * requires the caller's userId; org scope is account-wide and resolves
20
+ * identity from accountId alone, so a blank userId must not trip the
21
+ * missing-identity guard for org scope (Task 975).
19
22
  * 9. voice-tag-content validates mode and format enums, requires format,
20
23
  * returns zero counts on empty nodeIds, and requires voiceAuthor when
21
24
  * there are nodes to tag; resolveVoiceAuthor defaults to the operator
@@ -205,18 +208,51 @@ await check(
205
208
  },
206
209
  );
207
210
  await check(
208
- "voice-retrieve-conditioning returns status:error on missing userId",
211
+ "voice-retrieve-conditioning returns status:error on missing userId (personal scope)",
209
212
  async () => {
213
+ // Default scope is personal, which genuinely needs the caller's userId.
210
214
  const result = await retrieveMod.voiceRetrieveConditioning({
211
215
  accountId: "acc",
212
216
  userId: "",
213
217
  brief: { format: "email", length: "long" },
214
218
  });
215
219
  assert.equal(result.status, "error");
220
+ assert.equal(result.error, "missing accountId/userId");
216
221
  assert.equal(result.styleCard, null);
217
222
  assert.deepEqual(result.exemplars, []);
218
223
  },
219
224
  );
225
+ await check(
226
+ "voice-retrieve-conditioning org scope does not require a userId (Task 975)",
227
+ async () => {
228
+ // org scope is account-wide (keyed on ORG_USER_ID + accountId) and never
229
+ // reads a userId, so a blank userId must NOT trip the missing-identity
230
+ // guard. Force the Neo4j lookup to fail so the guard's absence is provable:
231
+ // the call reaches the lookup and returns the connection error, never
232
+ // "missing accountId/userId". Save/restore the env + reset the singleton.
233
+ const { closeDriver } = await import("../dist/lib/neo4j.js");
234
+ const savedUri = process.env.NEO4J_URI;
235
+ try {
236
+ process.env.NEO4J_URI = "";
237
+ await closeDriver();
238
+ const result = await retrieveMod.voiceRetrieveConditioning({
239
+ accountId: "acc",
240
+ userId: "",
241
+ brief: { format: "article", length: "long", scope: "org" },
242
+ });
243
+ assert.equal(result.status, "error");
244
+ assert.notEqual(
245
+ result.error,
246
+ "missing accountId/userId",
247
+ "org scope must not trip the missing-identity guard on a blank userId",
248
+ );
249
+ } finally {
250
+ if (savedUri === undefined) delete process.env.NEO4J_URI;
251
+ else process.env.NEO4J_URI = savedUri;
252
+ await closeDriver();
253
+ }
254
+ },
255
+ );
220
256
  await check(
221
257
  "voice-retrieve-conditioning returns status:error (not no-data) when the lookup throws",
222
258
  async () => {
@@ -268,7 +268,11 @@ lifelineTool(server,
268
268
  async ({ userId, format, topic, length, register, scope, tokenBudget }) => {
269
269
  if (!accountId) return refuseNoAccount("voice-retrieve-conditioning");
270
270
  const resolvedUserId = userId ?? resolveUserId();
271
- if (!resolvedUserId) {
271
+ // org scope is account-wide (keyed on ORG_USER_ID + accountId) and never
272
+ // reads a userId, so a specialist spawn that carries ACCOUNT_ID but no
273
+ // ADMIN_USER_ID can still retrieve the house voice. Only personal scope
274
+ // requires a resolved userId (Task 975).
275
+ if ((scope ?? "personal") !== "org" && !resolvedUserId) {
272
276
  // Soft (no isError) so drafting degrades, but status:error keeps this
273
277
  // distinct from genuine no-data (Task 493).
274
278
  return {
@@ -288,7 +292,8 @@ lifelineTool(server,
288
292
  try {
289
293
  const result = await voiceRetrieveConditioning({
290
294
  accountId,
291
- userId: resolvedUserId,
295
+ // org scope ignores userId; pass through for personal scope.
296
+ userId: resolvedUserId ?? "",
292
297
  brief: {
293
298
  format: format as import("./lib/voice-corpus.js").VoiceFormat,
294
299
  topic,
@@ -111,13 +111,16 @@ export async function voiceRetrieveConditioning(
111
111
  params: VoiceRetrieveConditioningParams,
112
112
  ): Promise<VoiceRetrieveConditioningResult> {
113
113
  const { accountId, userId, brief } = params;
114
- // Blank identity is an error, never genuine no-data — index.ts guards both
115
- // accountId and userId before calling, so a blank value reaching here is a
116
- // precondition failure, not "you have no profile". Emit a line so this path
117
- // is no longer silent (Task 493 closes the 06:46 path-1 ambiguity).
118
- if (!accountId || !userId) {
114
+ const scope: VoiceScope = brief.scope ?? "personal";
115
+ // Blank identity is an error, never genuine no-data — a blank value reaching
116
+ // here is a precondition failure, not "you have no profile". `accountId` is
117
+ // always required. `userId` is required only for personal scope: org scope is
118
+ // account-wide and keyed on the reserved ORG_USER_ID, so it resolves identity
119
+ // from `accountId` alone and never reads `userId` (Task 975). Emit a line so
120
+ // this path is no longer silent (Task 493 — closes the 06:46 path-1 ambiguity).
121
+ if (!accountId || (scope !== "org" && !userId)) {
119
122
  process.stderr.write(
120
- `[voice-retrieve] error: missing-identity accountId=${Boolean(accountId)} userId=${Boolean(userId)}\n`,
123
+ `[voice-retrieve] error: missing-identity scope=${scope} accountId=${Boolean(accountId)} userId=${Boolean(userId)}\n`,
121
124
  );
122
125
  return errorResult("missing accountId/userId");
123
126
  }
@@ -129,7 +132,6 @@ export async function voiceRetrieveConditioning(
129
132
  (length === "long" ? DEFAULT_TOKEN_BUDGET_LONG : DEFAULT_TOKEN_BUDGET_SHORT);
130
133
  const charBudget = tokenBudget * CHARS_PER_TOKEN;
131
134
  const format = brief.format;
132
- const scope: VoiceScope = brief.scope ?? "personal";
133
135
  const topic = (brief.topic ?? "").trim();
134
136
  const usesTopic = topic.length > 0;
135
137
 
@@ -21,7 +21,7 @@ The skill is built on five deterministic MCP tools served by the `writer-craft`
21
21
 
22
22
  The four **establishment** tools (`voice-tag-content`, `voice-distil-profile`, `voice-ingest-session-text`, `voice-record-feedback`) are admin-allowlisted and exist only on the admin agent's tool surface. No specialist carries them, by design: `format` and `authorshipMode` are editorial choices the operator makes, so building and curating a voice profile is an operator-interactive admin flow, not a step a specialist runs unattended.
23
23
 
24
- `voice-retrieve-conditioning` is different. It is the **drafting-time** conditioning tool: a drafting skill calls it to pull the style card and exemplars and condition its prose. It is on the admin surface and is also carried by `specialists:content-producer` (the authoring seat, which holds `plainly` and `prose-craft`), so voice-conditioned drafting can run on whichever seat composes the prose. The consulting prose deliverables (`decision-memo`, `narrative-builder`, `pitch-deck`) compose on content-producer and condition there. The split that holds: the operator curates voice with the four establishment tools on the admin seat; any drafting seat only retrieves it.
24
+ `voice-retrieve-conditioning` is different. It is the **drafting-time** conditioning tool: a drafting skill calls it to pull the style card and exemplars and condition its prose. It is on the admin surface and is also carried by `specialists:content-producer` (the authoring seat, which holds `plainly` and `prose-craft`), so voice-conditioned drafting can run on whichever seat composes the prose. The consulting prose deliverables (`decision-memo`, `narrative-builder`, `pitch-deck`) and the property brochure (`property-brochure`) compose on content-producer and condition there. The split that holds: the operator curates voice with the four establishment tools on the admin seat; any drafting seat only retrieves it.
25
25
 
26
26
  This matters most right after an ingest. When a specialist (the librarian) files a document and the operator then asks to tag it — "mark that as me / human-only / marketing-copy" — the tagging is yours to run, not the specialist's. The specialist cannot call `voice-tag-content` and will hand back the created node's identifier instead. Take that id and run `voice-tag-content` here. If the id is not in context (a later turn, the librarian's return scrolled off), fall back to the unknown-authorship query in the backfill flow below to find the just-filed node. Never route the tag back into a specialist; a specialist reporting "voice-tag-content is not in my tools" is the boundary working as intended, not a failure to escalate.
27
27
 
@@ -1 +1 @@
1
- import{o as e}from"./chunk-Pqm5yXtL.js";import{L as t,O as n,V as r,b as i,x as a,y as o}from"./OperatorConversations-CSQnX7Dx.js";import{i as s}from"./admin-types-CJrGd46U.js";import{h as c,l}from"./AdminShell-B5EcXCYR.js";import{t as u}from"./Checkbox-DWGpkJD5.js";var d=`admin-landing-redirected`,f=`/graph`;function p(e){return e.variant===`operator`?!1:e.appState===`chat`&&!e.alreadyRedirected}var m=e(r(),1);function h(e=`admin`){let[n,r]=(0,m.useState)(`loading`),[i,a]=(0,m.useState)(``),[o,l]=(0,m.useState)(``),[u,h]=(0,m.useState)(``),[g,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)(!1),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(!1),[E,D]=(0,m.useState)(null),[O,k]=(0,m.useState)(null),[A,j]=(0,m.useState)(void 0),[M,N]=(0,m.useState)(null),[P,F]=(0,m.useState)(void 0),[I,L]=(0,m.useState)(null),[ee,R]=(0,m.useState)(null),[z,B]=(0,m.useState)([]),[V,H]=(0,m.useState)(!1),[U,W]=(0,m.useState)(void 0),G=(0,m.useRef)(void 0),[K,q]=(0,m.useState)(!1);(0,m.useEffect)(()=>{typeof window>`u`||fetch(`/api/remote-auth/status`).then(e=>e.ok?e.json():null).then(e=>{e?.configured&&q(!0)}).catch(()=>{})},[]);let J=(0,m.useRef)(null),Y=(0,m.useRef)(null);(0,m.useEffect)(()=>{async function e(){let e=null;try{e=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!e)return!1;try{let t=await fetch(`/api/admin/session?session_key=${encodeURIComponent(e)}`);if(t.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}return!1}if(!t.ok)return!1;let n=await t.json();D(n.session_key),R(n.sessionId??null),j(n.businessName),N(n.role??null),F(n.userName===void 0?null:n.userName),L(n.avatar??null);let i=s(n.thinkingView);return G.current=i,W(i),r(`chat`),!0}catch(e){return console.error(`[admin] session restore failed:`,e),!1}}async function t(n=2){try{let i=await fetch(`/api/health`);if(!i.ok){if(n>0)return await new Promise(e=>setTimeout(e,1500)),t(n-1);console.error(`[admin] health check returned ${i.status} after retries`),r(`set-pin`);return}let a=await i.json();if(!a.pin_configured){r(`set-pin`);return}if(!a.claude_authenticated){r(`connect-claude`);return}if(await e())return;r(`enter-pin`)}catch(e){if(n>0)return await new Promise(e=>setTimeout(e,1500)),t(n-1);console.error(`[admin] health check failed:`,e),r(`set-pin`)}}t()},[]),(0,m.useEffect)(()=>{n===`chat`&&fetch(`/api/admin/claude-info`).then(e=>{if(e.ok)return e.json()}).then(e=>{e&&k(e)}).catch(()=>{})},[n]),(0,m.useEffect)(()=>{if(typeof window>`u`)return;let t=!1;try{t=sessionStorage.getItem(d)===`1`}catch{}if(p({appState:n,alreadyRedirected:t,variant:e})){try{sessionStorage.setItem(d,`1`)}catch{}console.info(`[admin-ui] landing-redirect target=${f}`),window.location.replace(f)}},[n,e]);let X=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(n!==`chat`)return;let e=setInterval(async()=>{try{let e=await fetch(`/api/health`);if(e.ok){let t=await e.json();if(t.auth_status===`dead`||t.auth_status===`missing`){r(`connect-claude`);return}}}catch{}if(E)try{let e=await fetch(`/api/admin/session?session_key=${encodeURIComponent(E)}`);if(e.status!==401)return;let n=(await e.clone().json().catch(()=>null))?.code??`unknown-401`;if(n===`remote-auth-required`){t(`heartbeat`,`/api/admin/session`);return}console.warn(`[admin-auth] outcome=heartbeat-detected-expiry code=${n}`),X.current?.()}catch{}},300*1e3);return()=>clearInterval(e)},[n,E]),(0,m.useEffect)(()=>{n===`connect-claude`&&fetch(`/api/health`).then(e=>e.ok?e.json():null).then(e=>{e?.claude_authenticated&&r(`enter-pin`)}).catch(()=>{})},[n]);async function Z(e,t){y(!0);try{let n=await fetch(`/api/admin/session`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:e,...t?{accountId:t}:{}})});if(!n.ok){h((await n.json().catch(()=>({}))).error||`Invalid PIN`);return}let i=await n.json();if(i.accounts&&!i.session_key){console.log(`[admin] account picker shown: userId=${i.userId} accountCount=${i.accounts.length}`),B(i.accounts),r(`account-picker`);return}D(i.session_key),R(i.sessionId??null),j(i.businessName),N(i.role??null),F(i.userName===void 0?null:i.userName),L(i.avatar??null);let o=s(i.thinkingView);if(G.current=o,W(o),t)try{sessionStorage.setItem(`maxy-account-id`,t)}catch{}try{sessionStorage.setItem(`maxy-admin-session-key`,i.session_key)}catch{}a(``),r(`chat`)}catch(e){console.error(`[admin] connection error:`,e),h(`Could not connect.`)}finally{y(!1),H(!1)}}let Q=(0,m.useCallback)(async e=>{if(e.preventDefault(),v)return;h(``);let t=o.trim();if(!t){h(`Please enter your name.`);return}if(i.length<4){h(`PIN must be at least 4 characters.`);return}let n=i;y(!0);try{let e=await fetch(`/api/onboarding/set-pin`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:n,name:t})});if(!e.ok){let t=await e.json().catch(()=>({}));if(e.status===409){console.log(`[admin] PIN already configured — re-checking health`);try{let e=await fetch(`/api/health`);if(e.ok){let n=await e.json();n.pin_configured&&n.claude_authenticated?r(`enter-pin`):n.pin_configured?r(`connect-claude`):h(t.error||`Failed to set PIN.`)}else r(`enter-pin`)}catch{r(`enter-pin`)}return}h(t.error||`Failed to set PIN.`);return}let i=await fetch(`/api/health`);if((i.ok?await i.json():null)?.claude_authenticated){await Z(n);return}a(``),r(`connect-claude`)}catch(e){console.error(`[admin] connection error:`,e),h(`Could not connect.`)}finally{y(!1)}},[i,v,o]),te=(0,m.useCallback)(async e=>{e.preventDefault(),h(``),await Z(i)},[i]),ne=(0,m.useCallback)(async()=>{T(!0);try{if(!await c())return console.warn(`[admin-ui] claude-disconnect not verified — credentials may persist; staying put`),!1;D(null),N(null),F(void 0),L(null);try{sessionStorage.removeItem(`maxy-admin-session-key`),sessionStorage.removeItem(`maxy-account-id`),sessionStorage.removeItem(d)}catch{}return r(`connect-claude`),!0}finally{T(!1)}},[]),$=(0,m.useCallback)(()=>{D(null),N(null),F(void 0),L(null);try{sessionStorage.removeItem(`maxy-admin-session-key`),sessionStorage.removeItem(`maxy-account-id`),sessionStorage.removeItem(d)}catch{}a(``),h(``),r(`enter-pin`)},[]);return(0,m.useEffect)(()=>{X.current=$},[$]),{appState:n,setAppState:r,pin:i,setPin:a,operatorName:o,setOperatorName:l,pinError:u,setPinError:h,showPin:g,setShowPin:_,pinLoading:v,authPolling:b,setAuthPolling:x,authLoading:S,setAuthLoading:C,disconnecting:w,cacheKey:E,setCacheKey:D,claudeInfo:O,setClaudeInfo:k,businessName:A,role:M,userName:P,userAvatar:I,sessionId:ee,setSessionId:R,accounts:z,accountPickerLoading:V,expandAll:U,setExpandAll:W,expandAllDefaultRef:G,remoteAuthEnabled:K,pinInputRef:J,setPinFormRef:Y,handleSetPin:Q,handleLogin:te,handleAccountSelect:(0,m.useCallback)(async e=>{H(!0),h(``),await Z(i,e)},[i]),handleDisconnect:ne,handleLogout:$,handleChangePin:(0,m.useCallback)(async()=>{if(!i){h(`Enter your current PIN first.`);return}y(!0),h(``);try{let e=await fetch(`/api/onboarding/set-pin`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({currentPin:i})});if(!e.ok){h((await e.json().catch(()=>({error:`Incorrect PIN.`}))).error||`Incorrect PIN.`);return}a(``),h(``),r(`set-pin`)}catch(e){console.error(`[admin-auth] change pin failed:`,e),h(e instanceof Error?e.message:String(e))}finally{y(!1)}},[i])}}var g=a();function _({inputRef:e,value:t,onChange:n,onComplete:r,showPin:i,autoFocus:a}){let o=(0,m.useRef)([]);function s(e,r){r.key===`Backspace`?(r.preventDefault(),t[e]?n(t.slice(0,e)+t.slice(e+1)):e>0&&(n(t.slice(0,e-1)+t.slice(e)),o.current[e-1]?.focus())):r.key===`ArrowLeft`&&e>0?o.current[e-1]?.focus():r.key===`ArrowRight`&&e<5?o.current[e+1]?.focus():r.key===`Enter`&&(r.preventDefault(),r.currentTarget.form?.requestSubmit())}function c(e,i){let a=i.nativeEvent.data;if(!a||!/^\d$/.test(a))return;let s=t.split(``);for(s[e]=a;s.length<e;)s.push(``);let c=s.join(``).replace(/\D/g,``).slice(0,6);n(c),c.length===6?r?.(c):e<5&&o.current[e+1]?.focus()}function l(e){e.preventDefault();let t=e.clipboardData.getData(`text`).replace(/\D/g,``).slice(0,6);t&&(n(t),t.length===6?r?.(t):o.current[t.length]?.focus())}return(0,g.jsx)(`div`,{className:`pin-field`,children:Array.from({length:6}).map((n,r)=>(0,g.jsx)(`input`,{ref:t=>{o.current[r]=t,r===0&&e&&(e.current=t)},type:`text`,inputMode:`numeric`,className:`pin-box${t[r]?` pin-box-filled`:``}`,value:t[r]?i?t[r]:`•`:``,onKeyDown:e=>s(r,e),onInput:e=>c(r,e),onPaste:l,onFocus:e=>e.target.select(),autoFocus:a&&r===0,autoComplete:`off`,maxLength:1,"aria-label":`PIN digit ${r+1}`},r))})}function v(e){let{pin:t,setPin:n,showPin:r,setShowPin:a,pinLoading:s,pinError:c,pinInputRef:d,setPinFormRef:f,onSubmit:p,operatorName:m,setOperatorName:h}=e;return(0,g.jsx)(`div`,{className:`connect-page`,children:(0,g.jsxs)(`div`,{className:`connect-content`,children:[(0,g.jsx)(`img`,{src:i,alt:o.productName,className:`connect-logo connect-logo--maxy`}),!o.logoContainsName&&(0,g.jsxs)(`h1`,{className:`connect-title`,children:[`Welcome to `,o.productName]}),(0,g.jsxs)(`p`,{className:`connect-subtitle`,children:[`Tell `,o.productName,` who you are, then choose a PIN.`]}),(0,g.jsxs)(`form`,{ref:f,onSubmit:p,className:`connect-pin-form`,children:[(0,g.jsxs)(`div`,{className:`pin-input-row`,children:[(0,g.jsx)(`input`,{type:`text`,className:`connect-name-input`,placeholder:`Your full name`,value:m,onChange:e=>h(e.target.value),autoComplete:`name`,autoFocus:!0,required:!0,"aria-label":`Your full name`}),(0,g.jsx)(`div`,{style:{width:38,flexShrink:0},"aria-hidden":`true`})]}),(0,g.jsxs)(`div`,{className:`pin-input-row`,children:[(0,g.jsx)(_,{inputRef:d,value:t,onChange:n,onComplete:()=>{},showPin:r}),(0,g.jsx)(l,{variant:`send`,type:`submit`,disabled:!t||!m.trim(),loading:s,"aria-label":`Set PIN`,children:(0,g.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,g.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,g.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,g.jsx)(u,{checked:r,onChange:()=>a(e=>!e),label:`Show PIN`})]}),c&&(0,g.jsx)(`p`,{className:`admin-pin-error`,children:c})]})})}function y(e){let{pin:t,setPin:n,showPin:r,setShowPin:a,pinLoading:s,pinError:c,pinInputRef:d,onSubmit:f,onChangePin:p,remoteAuthEnabled:m,onSignOutRemote:h}=e;return(0,g.jsxs)(`div`,{className:`connect-page`,children:[m&&h&&(0,g.jsx)(`button`,{type:`button`,className:`connect-signout`,onClick:h,children:`Sign out`}),(0,g.jsxs)(`div`,{className:`connect-content`,children:[(0,g.jsx)(`img`,{src:i,alt:o.productName,className:`connect-logo connect-logo--maxy`}),!o.logoContainsName&&(0,g.jsx)(`h1`,{className:`connect-title`,children:o.productName}),(0,g.jsxs)(`form`,{onSubmit:f,className:`connect-pin-form`,children:[(0,g.jsxs)(`div`,{className:`pin-input-row`,children:[(0,g.jsx)(_,{inputRef:d,value:t,onChange:n,onComplete:()=>{},showPin:r,autoFocus:!0}),(0,g.jsx)(l,{variant:`send`,type:`submit`,disabled:!t,loading:s,children:(0,g.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,g.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,g.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,g.jsxs)(`div`,{className:`pin-options`,children:[(0,g.jsx)(u,{checked:r,onChange:()=>a(e=>!e),label:`Show PIN`}),(0,g.jsx)(l,{type:`button`,variant:`ghost`,onClick:p,children:`Change PIN`})]})]}),c&&(0,g.jsx)(`p`,{className:`admin-pin-error`,children:c})]})]})}function b(e){let{accounts:t,loading:r,error:a,onSelect:s}=e;return(0,g.jsx)(`div`,{className:`connect-page`,children:(0,g.jsxs)(`div`,{className:`connect-content`,children:[(0,g.jsx)(`img`,{src:i,alt:o.productName,className:`connect-logo connect-logo--maxy`}),!o.logoContainsName&&(0,g.jsx)(`h1`,{className:`connect-title`,children:o.productName}),(0,g.jsx)(`p`,{className:`connect-subtitle`,children:`Select an account`}),(0,g.jsx)(`div`,{className:`account-picker-list`,children:t.map(e=>(0,g.jsxs)(`button`,{className:`account-picker-card`,onClick:()=>s(e.accountId),disabled:r,type:`button`,children:[(0,g.jsx)(`span`,{className:`account-picker-name`,children:e.businessName||e.accountId}),(0,g.jsx)(`span`,{className:`account-picker-role`,children:e.role}),r&&(0,g.jsx)(n,{className:`account-picker-spinner`,size:16})]},e.accountId))}),a&&(0,g.jsx)(`p`,{className:`admin-pin-error`,children:a})]})})}function x(e){let{authPolling:t,setAuthPolling:n,authLoading:r,setAuthLoading:a,pinError:s,setPinError:c,setAppState:u}=e,[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)(!1);async function _(){h(!0),c(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`launch-browser`})})).json();e.launched?f(!0):e.error&&c(e.error)}catch(e){console.error(`[admin] browser launch error:`,e),c(`Could not launch browser.`)}h(!1)}async function v(){a(!0),c(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`})).json();if(e.started){n(!0),f(!0),a(!1);for(let e=0;e<120;e++)if(await new Promise(e=>setTimeout(e,2e3)),(await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`wait`})})).json()).authenticated){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),u(`enter-pin`);return}c(`Timed out waiting for sign-in. Try again.`),n(!1)}else e.error&&c(e.error)}catch(e){console.error(`[admin] auth flow error:`,e),c(`Could not start auth flow.`)}a(!1)}async function y(){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),n(!1),c(``)}return t||d?(0,g.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100dvh`,overflow:`auto`},children:[(0,g.jsxs)(`header`,{className:`chat-header`,style:{paddingBottom:`12px`,flexShrink:0,position:`relative`,maxWidth:`680px`,width:`100%`,margin:`0 auto`,padding:`24px 20px 12px`},children:[t?(0,g.jsx)(`button`,{onClick:y,style:{position:`absolute`,top:`12px`,right:`12px`,background:`none`,border:`none`,color:`#999`,fontSize:`13px`,cursor:`pointer`,padding:`4px 8px`},"aria-label":`Cancel`,children:`✕`}):(0,g.jsx)(`button`,{onClick:()=>f(!1),style:{position:`absolute`,top:`12px`,right:`12px`,background:`none`,border:`none`,color:`#999`,fontSize:`13px`,cursor:`pointer`,padding:`4px 8px`},"aria-label":`Close browser`,children:`✕`}),(0,g.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`chat-logo`}),(0,g.jsx)(`h1`,{className:`chat-tagline`,children:`Connect Claude`}),(0,g.jsx)(`p`,{className:`chat-intro`,children:t?`Sign in and authorize in the browser below.`:`Open your email or prepare your accounts, then sign in.`}),!t&&(0,g.jsx)(`div`,{style:{marginTop:`12px`},children:(0,g.jsx)(l,{variant:`primary`,onClick:v,disabled:r,children:r?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`})})]}),(0,g.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0,gap:`10px`,padding:`0 0 16px`},children:(0,g.jsx)(`iframe`,{src:`/vnc-viewer.html`,style:{flex:1,width:`100%`,minHeight:0,border:`none`,background:`#111`,display:`block`},title:`Claude Sign-in`})}),s&&(0,g.jsx)(`p`,{className:`admin-pin-error`,style:{textAlign:`center`,padding:`0 20px 16px`},children:s})]}):(0,g.jsx)(`div`,{className:`connect-page`,children:(0,g.jsxs)(`div`,{className:`connect-content`,children:[(0,g.jsxs)(`div`,{className:`connect-logos`,children:[(0,g.jsx)(`div`,{className:`connect-logo-wrap`,children:(0,g.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`connect-logo`})}),(0,g.jsx)(`svg`,{className:`connect-arrow`,viewBox:`0 0 48 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,g.jsx)(`path`,{d:`M0 12h44m0 0l-8-8m8 8l-8 8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,g.jsxs)(`div`,{className:`connect-logo-wrap`,children:[(0,g.jsx)(`img`,{src:i,alt:o.productName,className:`connect-logo connect-logo--maxy`}),!o.logoContainsName&&(0,g.jsx)(`span`,{className:`connect-logo-label`,children:o.productName})]})]}),(0,g.jsxs)(`h1`,{className:`connect-title`,children:[`Connect Claude to power `,o.productName]}),(0,g.jsx)(`p`,{className:`connect-subtitle`,children:`Sign in with your Anthropic account to get started.`}),(0,g.jsx)(l,{variant:`primary`,onClick:v,disabled:r,children:r?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`}),(0,g.jsx)(`p`,{style:{marginTop:`6px`,fontSize:`11px`,color:`#999`,maxWidth:`300px`,textAlign:`center`,lineHeight:`1.4`},children:`First time? You may need to sign into your email and Anthropic account in the browser before connecting.`}),(0,g.jsx)(`button`,{onClick:_,disabled:p,style:{marginTop:`12px`,background:`none`,border:`none`,color:`var(--color-primary, #666)`,fontSize:`13px`,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:`3px`},children:p?`Launching…`:`Open browser first`}),s&&(0,g.jsx)(`p`,{className:`admin-pin-error`,children:s})]})})}function S({auth:e}){return e.appState===`loading`?(0,g.jsx)(`div`,{className:`connect-page`}):e.appState===`set-pin`?(0,g.jsx)(v,{pin:e.pin,setPin:e.setPin,showPin:e.showPin,setShowPin:e.setShowPin,pinLoading:e.pinLoading,pinError:e.pinError,pinInputRef:e.pinInputRef,setPinFormRef:e.setPinFormRef,onSubmit:e.handleSetPin,operatorName:e.operatorName,setOperatorName:e.setOperatorName}):e.appState===`connect-claude`?(0,g.jsx)(x,{authPolling:e.authPolling,setAuthPolling:e.setAuthPolling,authLoading:e.authLoading,setAuthLoading:e.setAuthLoading,pinError:e.pinError,setPinError:e.setPinError,setAppState:e.setAppState}):e.appState===`enter-pin`?(0,g.jsx)(y,{pin:e.pin,setPin:e.setPin,showPin:e.showPin,setShowPin:e.setShowPin,pinLoading:e.pinLoading,pinError:e.pinError,pinInputRef:e.pinInputRef,onSubmit:e.handleLogin,onChangePin:e.handleChangePin,remoteAuthEnabled:e.remoteAuthEnabled,onSignOutRemote:()=>{console.info(`[admin-ui] remote-auth sign-out → /__remote-auth/logout`),window.location.href=`/__remote-auth/logout`}}):e.appState===`account-picker`?(0,g.jsx)(b,{accounts:e.accounts,loading:e.accountPickerLoading,error:e.pinError,onSelect:e.handleAccountSelect}):null}export{h as n,S as t};
1
+ import{o as e}from"./chunk-Pqm5yXtL.js";import{L as t,O as n,V as r,b as i,x as a,y as o}from"./OperatorConversations-C8sITz2_.js";import{i as s}from"./admin-types-CJrGd46U.js";import{h as c,l}from"./AdminShell-Br0DJQNu.js";import{t as u}from"./Checkbox-1flpB9H0.js";var d=`admin-landing-redirected`,f=`/graph`;function p(e){return e.variant===`operator`?!1:e.appState===`chat`&&!e.alreadyRedirected}var m=e(r(),1);function h(e=`admin`){let[n,r]=(0,m.useState)(`loading`),[i,a]=(0,m.useState)(``),[o,l]=(0,m.useState)(``),[u,h]=(0,m.useState)(``),[g,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)(!1),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(!1),[E,D]=(0,m.useState)(null),[O,k]=(0,m.useState)(null),[A,j]=(0,m.useState)(void 0),[M,N]=(0,m.useState)(null),[P,F]=(0,m.useState)(void 0),[I,L]=(0,m.useState)(null),[ee,R]=(0,m.useState)(null),[z,B]=(0,m.useState)([]),[V,H]=(0,m.useState)(!1),[U,W]=(0,m.useState)(void 0),G=(0,m.useRef)(void 0),[K,q]=(0,m.useState)(!1);(0,m.useEffect)(()=>{typeof window>`u`||fetch(`/api/remote-auth/status`).then(e=>e.ok?e.json():null).then(e=>{e?.configured&&q(!0)}).catch(()=>{})},[]);let J=(0,m.useRef)(null),Y=(0,m.useRef)(null);(0,m.useEffect)(()=>{async function e(){let e=null;try{e=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!e)return!1;try{let t=await fetch(`/api/admin/session?session_key=${encodeURIComponent(e)}`);if(t.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}return!1}if(!t.ok)return!1;let n=await t.json();D(n.session_key),R(n.sessionId??null),j(n.businessName),N(n.role??null),F(n.userName===void 0?null:n.userName),L(n.avatar??null);let i=s(n.thinkingView);return G.current=i,W(i),r(`chat`),!0}catch(e){return console.error(`[admin] session restore failed:`,e),!1}}async function t(n=2){try{let i=await fetch(`/api/health`);if(!i.ok){if(n>0)return await new Promise(e=>setTimeout(e,1500)),t(n-1);console.error(`[admin] health check returned ${i.status} after retries`),r(`set-pin`);return}let a=await i.json();if(!a.pin_configured){r(`set-pin`);return}if(!a.claude_authenticated){r(`connect-claude`);return}if(await e())return;r(`enter-pin`)}catch(e){if(n>0)return await new Promise(e=>setTimeout(e,1500)),t(n-1);console.error(`[admin] health check failed:`,e),r(`set-pin`)}}t()},[]),(0,m.useEffect)(()=>{n===`chat`&&fetch(`/api/admin/claude-info`).then(e=>{if(e.ok)return e.json()}).then(e=>{e&&k(e)}).catch(()=>{})},[n]),(0,m.useEffect)(()=>{if(typeof window>`u`)return;let t=!1;try{t=sessionStorage.getItem(d)===`1`}catch{}if(p({appState:n,alreadyRedirected:t,variant:e})){try{sessionStorage.setItem(d,`1`)}catch{}console.info(`[admin-ui] landing-redirect target=${f}`),window.location.replace(f)}},[n,e]);let X=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(n!==`chat`)return;let e=setInterval(async()=>{try{let e=await fetch(`/api/health`);if(e.ok){let t=await e.json();if(t.auth_status===`dead`||t.auth_status===`missing`){r(`connect-claude`);return}}}catch{}if(E)try{let e=await fetch(`/api/admin/session?session_key=${encodeURIComponent(E)}`);if(e.status!==401)return;let n=(await e.clone().json().catch(()=>null))?.code??`unknown-401`;if(n===`remote-auth-required`){t(`heartbeat`,`/api/admin/session`);return}console.warn(`[admin-auth] outcome=heartbeat-detected-expiry code=${n}`),X.current?.()}catch{}},300*1e3);return()=>clearInterval(e)},[n,E]),(0,m.useEffect)(()=>{n===`connect-claude`&&fetch(`/api/health`).then(e=>e.ok?e.json():null).then(e=>{e?.claude_authenticated&&r(`enter-pin`)}).catch(()=>{})},[n]);async function Z(e,t){y(!0);try{let n=await fetch(`/api/admin/session`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:e,...t?{accountId:t}:{}})});if(!n.ok){h((await n.json().catch(()=>({}))).error||`Invalid PIN`);return}let i=await n.json();if(i.accounts&&!i.session_key){console.log(`[admin] account picker shown: userId=${i.userId} accountCount=${i.accounts.length}`),B(i.accounts),r(`account-picker`);return}D(i.session_key),R(i.sessionId??null),j(i.businessName),N(i.role??null),F(i.userName===void 0?null:i.userName),L(i.avatar??null);let o=s(i.thinkingView);if(G.current=o,W(o),t)try{sessionStorage.setItem(`maxy-account-id`,t)}catch{}try{sessionStorage.setItem(`maxy-admin-session-key`,i.session_key)}catch{}a(``),r(`chat`)}catch(e){console.error(`[admin] connection error:`,e),h(`Could not connect.`)}finally{y(!1),H(!1)}}let Q=(0,m.useCallback)(async e=>{if(e.preventDefault(),v)return;h(``);let t=o.trim();if(!t){h(`Please enter your name.`);return}if(i.length<4){h(`PIN must be at least 4 characters.`);return}let n=i;y(!0);try{let e=await fetch(`/api/onboarding/set-pin`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:n,name:t})});if(!e.ok){let t=await e.json().catch(()=>({}));if(e.status===409){console.log(`[admin] PIN already configured — re-checking health`);try{let e=await fetch(`/api/health`);if(e.ok){let n=await e.json();n.pin_configured&&n.claude_authenticated?r(`enter-pin`):n.pin_configured?r(`connect-claude`):h(t.error||`Failed to set PIN.`)}else r(`enter-pin`)}catch{r(`enter-pin`)}return}h(t.error||`Failed to set PIN.`);return}let i=await fetch(`/api/health`);if((i.ok?await i.json():null)?.claude_authenticated){await Z(n);return}a(``),r(`connect-claude`)}catch(e){console.error(`[admin] connection error:`,e),h(`Could not connect.`)}finally{y(!1)}},[i,v,o]),te=(0,m.useCallback)(async e=>{e.preventDefault(),h(``),await Z(i)},[i]),ne=(0,m.useCallback)(async()=>{T(!0);try{if(!await c())return console.warn(`[admin-ui] claude-disconnect not verified — credentials may persist; staying put`),!1;D(null),N(null),F(void 0),L(null);try{sessionStorage.removeItem(`maxy-admin-session-key`),sessionStorage.removeItem(`maxy-account-id`),sessionStorage.removeItem(d)}catch{}return r(`connect-claude`),!0}finally{T(!1)}},[]),$=(0,m.useCallback)(()=>{D(null),N(null),F(void 0),L(null);try{sessionStorage.removeItem(`maxy-admin-session-key`),sessionStorage.removeItem(`maxy-account-id`),sessionStorage.removeItem(d)}catch{}a(``),h(``),r(`enter-pin`)},[]);return(0,m.useEffect)(()=>{X.current=$},[$]),{appState:n,setAppState:r,pin:i,setPin:a,operatorName:o,setOperatorName:l,pinError:u,setPinError:h,showPin:g,setShowPin:_,pinLoading:v,authPolling:b,setAuthPolling:x,authLoading:S,setAuthLoading:C,disconnecting:w,cacheKey:E,setCacheKey:D,claudeInfo:O,setClaudeInfo:k,businessName:A,role:M,userName:P,userAvatar:I,sessionId:ee,setSessionId:R,accounts:z,accountPickerLoading:V,expandAll:U,setExpandAll:W,expandAllDefaultRef:G,remoteAuthEnabled:K,pinInputRef:J,setPinFormRef:Y,handleSetPin:Q,handleLogin:te,handleAccountSelect:(0,m.useCallback)(async e=>{H(!0),h(``),await Z(i,e)},[i]),handleDisconnect:ne,handleLogout:$,handleChangePin:(0,m.useCallback)(async()=>{if(!i){h(`Enter your current PIN first.`);return}y(!0),h(``);try{let e=await fetch(`/api/onboarding/set-pin`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({currentPin:i})});if(!e.ok){h((await e.json().catch(()=>({error:`Incorrect PIN.`}))).error||`Incorrect PIN.`);return}a(``),h(``),r(`set-pin`)}catch(e){console.error(`[admin-auth] change pin failed:`,e),h(e instanceof Error?e.message:String(e))}finally{y(!1)}},[i])}}var g=a();function _({inputRef:e,value:t,onChange:n,onComplete:r,showPin:i,autoFocus:a}){let o=(0,m.useRef)([]);function s(e,r){r.key===`Backspace`?(r.preventDefault(),t[e]?n(t.slice(0,e)+t.slice(e+1)):e>0&&(n(t.slice(0,e-1)+t.slice(e)),o.current[e-1]?.focus())):r.key===`ArrowLeft`&&e>0?o.current[e-1]?.focus():r.key===`ArrowRight`&&e<5?o.current[e+1]?.focus():r.key===`Enter`&&(r.preventDefault(),r.currentTarget.form?.requestSubmit())}function c(e,i){let a=i.nativeEvent.data;if(!a||!/^\d$/.test(a))return;let s=t.split(``);for(s[e]=a;s.length<e;)s.push(``);let c=s.join(``).replace(/\D/g,``).slice(0,6);n(c),c.length===6?r?.(c):e<5&&o.current[e+1]?.focus()}function l(e){e.preventDefault();let t=e.clipboardData.getData(`text`).replace(/\D/g,``).slice(0,6);t&&(n(t),t.length===6?r?.(t):o.current[t.length]?.focus())}return(0,g.jsx)(`div`,{className:`pin-field`,children:Array.from({length:6}).map((n,r)=>(0,g.jsx)(`input`,{ref:t=>{o.current[r]=t,r===0&&e&&(e.current=t)},type:`text`,inputMode:`numeric`,className:`pin-box${t[r]?` pin-box-filled`:``}`,value:t[r]?i?t[r]:`•`:``,onKeyDown:e=>s(r,e),onInput:e=>c(r,e),onPaste:l,onFocus:e=>e.target.select(),autoFocus:a&&r===0,autoComplete:`off`,maxLength:1,"aria-label":`PIN digit ${r+1}`},r))})}function v(e){let{pin:t,setPin:n,showPin:r,setShowPin:a,pinLoading:s,pinError:c,pinInputRef:d,setPinFormRef:f,onSubmit:p,operatorName:m,setOperatorName:h}=e;return(0,g.jsx)(`div`,{className:`connect-page`,children:(0,g.jsxs)(`div`,{className:`connect-content`,children:[(0,g.jsx)(`img`,{src:i,alt:o.productName,className:`connect-logo connect-logo--maxy`}),!o.logoContainsName&&(0,g.jsxs)(`h1`,{className:`connect-title`,children:[`Welcome to `,o.productName]}),(0,g.jsxs)(`p`,{className:`connect-subtitle`,children:[`Tell `,o.productName,` who you are, then choose a PIN.`]}),(0,g.jsxs)(`form`,{ref:f,onSubmit:p,className:`connect-pin-form`,children:[(0,g.jsxs)(`div`,{className:`pin-input-row`,children:[(0,g.jsx)(`input`,{type:`text`,className:`connect-name-input`,placeholder:`Your full name`,value:m,onChange:e=>h(e.target.value),autoComplete:`name`,autoFocus:!0,required:!0,"aria-label":`Your full name`}),(0,g.jsx)(`div`,{style:{width:38,flexShrink:0},"aria-hidden":`true`})]}),(0,g.jsxs)(`div`,{className:`pin-input-row`,children:[(0,g.jsx)(_,{inputRef:d,value:t,onChange:n,onComplete:()=>{},showPin:r}),(0,g.jsx)(l,{variant:`send`,type:`submit`,disabled:!t||!m.trim(),loading:s,"aria-label":`Set PIN`,children:(0,g.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,g.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,g.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,g.jsx)(u,{checked:r,onChange:()=>a(e=>!e),label:`Show PIN`})]}),c&&(0,g.jsx)(`p`,{className:`admin-pin-error`,children:c})]})})}function y(e){let{pin:t,setPin:n,showPin:r,setShowPin:a,pinLoading:s,pinError:c,pinInputRef:d,onSubmit:f,onChangePin:p,remoteAuthEnabled:m,onSignOutRemote:h}=e;return(0,g.jsxs)(`div`,{className:`connect-page`,children:[m&&h&&(0,g.jsx)(`button`,{type:`button`,className:`connect-signout`,onClick:h,children:`Sign out`}),(0,g.jsxs)(`div`,{className:`connect-content`,children:[(0,g.jsx)(`img`,{src:i,alt:o.productName,className:`connect-logo connect-logo--maxy`}),!o.logoContainsName&&(0,g.jsx)(`h1`,{className:`connect-title`,children:o.productName}),(0,g.jsxs)(`form`,{onSubmit:f,className:`connect-pin-form`,children:[(0,g.jsxs)(`div`,{className:`pin-input-row`,children:[(0,g.jsx)(_,{inputRef:d,value:t,onChange:n,onComplete:()=>{},showPin:r,autoFocus:!0}),(0,g.jsx)(l,{variant:`send`,type:`submit`,disabled:!t,loading:s,children:(0,g.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,g.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,g.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,g.jsxs)(`div`,{className:`pin-options`,children:[(0,g.jsx)(u,{checked:r,onChange:()=>a(e=>!e),label:`Show PIN`}),(0,g.jsx)(l,{type:`button`,variant:`ghost`,onClick:p,children:`Change PIN`})]})]}),c&&(0,g.jsx)(`p`,{className:`admin-pin-error`,children:c})]})]})}function b(e){let{accounts:t,loading:r,error:a,onSelect:s}=e;return(0,g.jsx)(`div`,{className:`connect-page`,children:(0,g.jsxs)(`div`,{className:`connect-content`,children:[(0,g.jsx)(`img`,{src:i,alt:o.productName,className:`connect-logo connect-logo--maxy`}),!o.logoContainsName&&(0,g.jsx)(`h1`,{className:`connect-title`,children:o.productName}),(0,g.jsx)(`p`,{className:`connect-subtitle`,children:`Select an account`}),(0,g.jsx)(`div`,{className:`account-picker-list`,children:t.map(e=>(0,g.jsxs)(`button`,{className:`account-picker-card`,onClick:()=>s(e.accountId),disabled:r,type:`button`,children:[(0,g.jsx)(`span`,{className:`account-picker-name`,children:e.businessName||e.accountId}),(0,g.jsx)(`span`,{className:`account-picker-role`,children:e.role}),r&&(0,g.jsx)(n,{className:`account-picker-spinner`,size:16})]},e.accountId))}),a&&(0,g.jsx)(`p`,{className:`admin-pin-error`,children:a})]})})}function x(e){let{authPolling:t,setAuthPolling:n,authLoading:r,setAuthLoading:a,pinError:s,setPinError:c,setAppState:u}=e,[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)(!1);async function _(){h(!0),c(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`launch-browser`})})).json();e.launched?f(!0):e.error&&c(e.error)}catch(e){console.error(`[admin] browser launch error:`,e),c(`Could not launch browser.`)}h(!1)}async function v(){a(!0),c(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`})).json();if(e.started){n(!0),f(!0),a(!1);for(let e=0;e<120;e++)if(await new Promise(e=>setTimeout(e,2e3)),(await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`wait`})})).json()).authenticated){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),u(`enter-pin`);return}c(`Timed out waiting for sign-in. Try again.`),n(!1)}else e.error&&c(e.error)}catch(e){console.error(`[admin] auth flow error:`,e),c(`Could not start auth flow.`)}a(!1)}async function y(){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),n(!1),c(``)}return t||d?(0,g.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100dvh`,overflow:`auto`},children:[(0,g.jsxs)(`header`,{className:`chat-header`,style:{paddingBottom:`12px`,flexShrink:0,position:`relative`,maxWidth:`680px`,width:`100%`,margin:`0 auto`,padding:`24px 20px 12px`},children:[t?(0,g.jsx)(`button`,{onClick:y,style:{position:`absolute`,top:`12px`,right:`12px`,background:`none`,border:`none`,color:`#999`,fontSize:`13px`,cursor:`pointer`,padding:`4px 8px`},"aria-label":`Cancel`,children:`✕`}):(0,g.jsx)(`button`,{onClick:()=>f(!1),style:{position:`absolute`,top:`12px`,right:`12px`,background:`none`,border:`none`,color:`#999`,fontSize:`13px`,cursor:`pointer`,padding:`4px 8px`},"aria-label":`Close browser`,children:`✕`}),(0,g.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`chat-logo`}),(0,g.jsx)(`h1`,{className:`chat-tagline`,children:`Connect Claude`}),(0,g.jsx)(`p`,{className:`chat-intro`,children:t?`Sign in and authorize in the browser below.`:`Open your email or prepare your accounts, then sign in.`}),!t&&(0,g.jsx)(`div`,{style:{marginTop:`12px`},children:(0,g.jsx)(l,{variant:`primary`,onClick:v,disabled:r,children:r?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`})})]}),(0,g.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0,gap:`10px`,padding:`0 0 16px`},children:(0,g.jsx)(`iframe`,{src:`/vnc-viewer.html`,style:{flex:1,width:`100%`,minHeight:0,border:`none`,background:`#111`,display:`block`},title:`Claude Sign-in`})}),s&&(0,g.jsx)(`p`,{className:`admin-pin-error`,style:{textAlign:`center`,padding:`0 20px 16px`},children:s})]}):(0,g.jsx)(`div`,{className:`connect-page`,children:(0,g.jsxs)(`div`,{className:`connect-content`,children:[(0,g.jsxs)(`div`,{className:`connect-logos`,children:[(0,g.jsx)(`div`,{className:`connect-logo-wrap`,children:(0,g.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`connect-logo`})}),(0,g.jsx)(`svg`,{className:`connect-arrow`,viewBox:`0 0 48 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,g.jsx)(`path`,{d:`M0 12h44m0 0l-8-8m8 8l-8 8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,g.jsxs)(`div`,{className:`connect-logo-wrap`,children:[(0,g.jsx)(`img`,{src:i,alt:o.productName,className:`connect-logo connect-logo--maxy`}),!o.logoContainsName&&(0,g.jsx)(`span`,{className:`connect-logo-label`,children:o.productName})]})]}),(0,g.jsxs)(`h1`,{className:`connect-title`,children:[`Connect Claude to power `,o.productName]}),(0,g.jsx)(`p`,{className:`connect-subtitle`,children:`Sign in with your Anthropic account to get started.`}),(0,g.jsx)(l,{variant:`primary`,onClick:v,disabled:r,children:r?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`}),(0,g.jsx)(`p`,{style:{marginTop:`6px`,fontSize:`11px`,color:`#999`,maxWidth:`300px`,textAlign:`center`,lineHeight:`1.4`},children:`First time? You may need to sign into your email and Anthropic account in the browser before connecting.`}),(0,g.jsx)(`button`,{onClick:_,disabled:p,style:{marginTop:`12px`,background:`none`,border:`none`,color:`var(--color-primary, #666)`,fontSize:`13px`,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:`3px`},children:p?`Launching…`:`Open browser first`}),s&&(0,g.jsx)(`p`,{className:`admin-pin-error`,children:s})]})})}function S({auth:e}){return e.appState===`loading`?(0,g.jsx)(`div`,{className:`connect-page`}):e.appState===`set-pin`?(0,g.jsx)(v,{pin:e.pin,setPin:e.setPin,showPin:e.showPin,setShowPin:e.setShowPin,pinLoading:e.pinLoading,pinError:e.pinError,pinInputRef:e.pinInputRef,setPinFormRef:e.setPinFormRef,onSubmit:e.handleSetPin,operatorName:e.operatorName,setOperatorName:e.setOperatorName}):e.appState===`connect-claude`?(0,g.jsx)(x,{authPolling:e.authPolling,setAuthPolling:e.setAuthPolling,authLoading:e.authLoading,setAuthLoading:e.setAuthLoading,pinError:e.pinError,setPinError:e.setPinError,setAppState:e.setAppState}):e.appState===`enter-pin`?(0,g.jsx)(y,{pin:e.pin,setPin:e.setPin,showPin:e.showPin,setShowPin:e.setShowPin,pinLoading:e.pinLoading,pinError:e.pinError,pinInputRef:e.pinInputRef,onSubmit:e.handleLogin,onChangePin:e.handleChangePin,remoteAuthEnabled:e.remoteAuthEnabled,onSignOutRemote:()=>{console.info(`[admin-ui] remote-auth sign-out → /__remote-auth/logout`),window.location.href=`/__remote-auth/logout`}}):e.appState===`account-picker`?(0,g.jsx)(b,{accounts:e.accounts,loading:e.accountPickerLoading,error:e.pinError,onSelect:e.handleAccountSelect}):null}export{h as n,S as t};