@hanzo/app 0.2.32 → 0.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Chat.js CHANGED
@@ -75,7 +75,7 @@ import { first } from './lib/first.js';
75
75
  import { BAD } from "./lib/mix.js";
76
76
  import { brand } from './where.js';
77
77
  import { ThinkingEffort } from './ThinkingEffort.js';
78
- import { useChatPreferences } from './lib/chatPreferences.js';
78
+ import { shared, useChatPreferences } from './lib/chatPreferences.js';
79
79
  // NO REASONING PANEL HERE. Every assistant turn opened a "Thinking" disclosure
80
80
  // listing seven steps — "Planning CSS extraction for chat styles", "Designing
81
81
  // responsive top bar grid layout" — typed into this file as a literal array.
@@ -511,17 +511,10 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
511
511
  const { limits, notice, reload: reread } = useLimits(!anonymous, org(), (id) => nameOf(id, catalog.current));
512
512
  const mind = useMind(target, anonymous ? "free" : limits?.plan);
513
513
  catalog.current = mind.models;
514
+ // Chat's effort is its own (ThinkingEffort, sent as `reasoning_effort`); a
515
+ // pick of one Dev offers too moves Dev's, where it is made, and opening Chat
516
+ // never resets Dev's.
514
517
  const [chatPrefs, setChatPrefs] = useChatPreferences();
515
- useEffect(() => {
516
- const eff = chatPrefs.effort || "high";
517
- if (eff === "low" || eff === "medium" || eff === "high") {
518
- mind.pace(eff);
519
- }
520
- else if (eff === "xhigh" || eff === "max") {
521
- mind.pace("high");
522
- }
523
- // eslint-disable-next-line react-hooks/exhaustive-deps
524
- }, [chatPrefs.effort]);
525
518
  const ai = useAi();
526
519
  // In the app's frame the composer floats on the pane as a pane of its own.
527
520
  const framed = useContext(Framed);
@@ -1460,8 +1453,9 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
1460
1453
  at: anonymous ? undefined : carry.plugins,
1461
1454
  // Auto vs Manual approval lives in Settings rather than floating under the composer.
1462
1455
  mode: null,
1463
- // The model, the effort and the mode under the frame (@hanzo/build).
1464
- mind,
1456
+ // The model under the frame (@hanzo/build) only where Settings' model
1457
+ // selector is on; the effort is ThinkingEffort, beside send.
1458
+ model: chatPrefs.showModelSelector ? mind : null,
1465
1459
  limits,
1466
1460
  onUpgrade: (id) => setAsk({ model: nameOf(id, listed) }),
1467
1461
  voice,
@@ -1591,19 +1585,15 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
1591
1585
  column: { maxW: MEASURE }, composer: (() => {
1592
1586
  const basePrompt = prompt({
1593
1587
  ...composing,
1594
- mind: chatPrefs.showModelSelector ? mind : null,
1595
1588
  field: mention.field,
1596
1589
  }, mention.state);
1597
1590
  return {
1598
1591
  ...basePrompt,
1599
1592
  send: (_jsxs(XStack, { items: "center", gap: "$1.5", shrink: 0, children: [chatPrefs.showTurboApproval ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$1", rounded: 999, borderWidth: 1, borderColor: "$borderColor", bg: "$background", "aria-label": t("Turbo Approval: {mode}", { mode: chatPrefs.approvalMode }), children: [_jsx(Zap, { size: 12, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: chatPrefs.approvalMode === "manual" ? t("Manual") : t("Turbo") })] })) : null, _jsx(ThinkingEffort, { effort: chatPrefs.effort || 'high', onChange: (eff) => {
1600
1593
  setChatPrefs({ effort: eff });
1601
- if (eff === 'low' || eff === 'medium' || eff === 'high') {
1602
- mind.pace(eff);
1603
- }
1604
- else if (eff === 'xhigh' || eff === 'max') {
1605
- mind.pace('high');
1606
- }
1594
+ const next = shared(eff);
1595
+ if (next)
1596
+ mind.pace(next);
1607
1597
  }, disabled: chat.streaming || talk.open }), basePrompt.send] })),
1608
1598
  };
1609
1599
  })() }), _jsx(AgentMaker, {}), carry.dialog, _jsx(Upgrade, { ask: ask, onClose: () => setAsk(null) })] }));
package/dist/Directory.js CHANGED
@@ -21,7 +21,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
21
21
  // install flow — one `+` everywhere, branching internally.
22
22
  //
23
23
  // TWO TABS, and the channels are tiles. A channel is a provider the org can
24
- // hold an account with, read from `/v1/integrations` — which says whether this
24
+ // hold an account with, read from `/v1/provider` — which says whether this
25
25
  // deployment can open a connection and whether this org has one — and every
26
26
  // tile's button is a call to that registry. The Inbox's "Connect an app" opens
27
27
  // this same directory on this tab; there is no second grid. Skills, plugins and
@@ -36,7 +36,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
36
36
  //
37
37
  // SIGNED IN, EACH TAB READS ITS OWN REGISTRY. Apps is this site's public catalog
38
38
  // AND the org's connected accounts; Channels is the org's own list at
39
- // `/v1/integrations`. That one needs the bearer, so signed-out asks the reader to
39
+ // `/v1/provider`. That one needs the bearer, so signed-out asks the reader to
40
40
  // sign in rather than drawing a catalogue nobody can connect from, and a
41
41
  // registry that cannot be reached says so rather than claiming the list is
42
42
  // empty. Nothing stands in for an answer: no row is drawn that the registry did
@@ -65,7 +65,7 @@ const TABS = [
65
65
  { id: 'channels', label: phrase('Channels') },
66
66
  ];
67
67
  /** The org-plane catalogue: every provider the platform can connect an account to, with THIS org's connection and whether the deployment can open one. */
68
- const CHANNELS = '/v1/integrations';
68
+ const CHANNELS = '/v1/provider';
69
69
  /**
70
70
  * Under a channel's name, what the registry knows, in the reader's order of
71
71
  * interest: the account connected, else whether a connection can be opened here
@@ -173,7 +173,7 @@ export function Catalog({ tab }) {
173
173
  if (auth) {
174
174
  Promise.all([
175
175
  apps(),
176
- fetch(`${api()}/v1/integrations/connectors`, { headers: auth }).then((r) => (r.ok ? r.json() : null)),
176
+ fetch(`${api()}/v1/connection`, { headers: auth }).then((r) => (r.ok ? r.json() : null)),
177
177
  ])
178
178
  .then(([list, j]) => {
179
179
  if (!live || !j?.connectors)
@@ -263,7 +263,7 @@ function Channel({ row, onChange }) {
263
263
  setBusy(true);
264
264
  setWrong(null);
265
265
  try {
266
- const r = await fetch(`${api()}/v1/integrations/${encodeURIComponent(row.id)}/${verb}`, {
266
+ const r = await fetch(`${api()}/v1/provider/${encodeURIComponent(row.id)}/${verb}`, {
267
267
  method: 'POST',
268
268
  headers: { ...scope(), 'Content-Type': 'application/json' },
269
269
  body: '{}',
package/dist/RightPane.js CHANGED
@@ -132,7 +132,7 @@ const Note = ({ children }) => (_jsx(DropdownMenuLabel, { children: _jsx(Text, {
132
132
  * EVERY ROW DOES SOMETHING. Files come off the reader's own disk. Skills are
133
133
  * `GET /v1/tools/skills` and toggling one is `PUT /v1/tools/activation`, the
134
134
  * one write path that turns skills, plugins and connectors into callable tools.
135
- * Services are `GET /v1/integrations/connectors/providers`, connected by the
135
+ * Services are `GET /v1/connection/providers`, connected by the
136
136
  * device flow their cards declare. One panel, not flyouts: it hangs off the
137
137
  * right edge of the window, where a submenu has no room to open.
138
138
  */
@@ -6,7 +6,7 @@ import { useMemo, useState } from 'react';
6
6
  import { phrase } from '@hanzo/i18n';
7
7
  import { useI18n } from '@hanzo/i18n/react';
8
8
  import { ArrowUpRight, Check, ExternalLink, Lock, Sparkles } from 'lucide-react';
9
- import { useChatPreferences } from './lib/chatPreferences.js';
9
+ import { shared, useChatPreferences } from './lib/chatPreferences.js';
10
10
  import { EFFORT_STEPS } from './ThinkingEffort.js';
11
11
  import { Box, Button, Input, Separator, Text, XStack, YStack, } from '@hanzo/ui';
12
12
  import { tap } from './lib/tap.js';
@@ -90,9 +90,9 @@ function Model() {
90
90
  const active = (chatPrefs.effort || 'high') === step.id;
91
91
  return (_jsx(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => {
92
92
  setChatPrefs({ effort: step.id });
93
- if (step.id === 'low' || step.id === 'medium' || step.id === 'high') {
94
- choose({ effort: step.id });
95
- }
93
+ const next = shared(step.id);
94
+ if (next)
95
+ choose({ effort: next });
96
96
  }, ...CHOICE, bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', py: 6, px: 12, children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Text, { fontSize: "$2", fontWeight: active ? '600' : '400', color: active ? '$ink' : '$soft', children: step.label }), active ? _jsx(Check, { size: 12, color: "var(--primary)", "aria-hidden": true }) : null] }) }, step.id));
97
97
  }) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", "data-slot": "settings-approval-mode", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Tool & action approval') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Choose whether agents run tools and connectors automatically or ask for manual approval before each action.') }), _jsx(XStack, { gap: "$2", pt: "$1", children: [
98
98
  { id: 'auto', label: t('Auto'), desc: t('Runs tools on its own; pauses only for anything risky.') },
package/dist/Setup.js CHANGED
@@ -89,10 +89,10 @@ export function Setup({ go } = {}) {
89
89
  let live = true;
90
90
  const auth = scope();
91
91
  Promise.all([
92
- fetch(`${api()}/v1/integrations`, { headers: auth })
92
+ fetch(`${api()}/v1/provider`, { headers: auth })
93
93
  .then((r) => (r.ok ? r.json() : null))
94
94
  .catch(() => null),
95
- fetch(`${api()}/v1/integrations/connectors`, { headers: auth })
95
+ fetch(`${api()}/v1/connection`, { headers: auth })
96
96
  .then((r) => (r.ok ? r.json() : null))
97
97
  .catch(() => null),
98
98
  fetch(`${api()}/v1/tool/plugins/authored`, { headers: auth })
@@ -235,7 +235,7 @@ export function Setup({ go } = {}) {
235
235
  }
236
236
  return;
237
237
  }
238
- const res = await fetch(`${api()}/v1/integrations/${provider}/connect`, {
238
+ const res = await fetch(`${api()}/v1/provider/${provider}/connect`, {
239
239
  method: 'POST',
240
240
  headers: { ...scope(), 'Content-Type': 'application/json' },
241
241
  body: '{}',
@@ -98,7 +98,7 @@ export interface Secret {
98
98
  scheme?: string;
99
99
  }
100
100
  export declare const secrets: (c: Client, path: string, signal?: AbortSignal) => Promise<Secret[]>;
101
- /** A connector as `/v1/integrations/connectors` answers it. Held by the PERSON
101
+ /** A connector as `/v1/connection` answers it. Held by the PERSON
102
102
  * who signed in to it: the contract publishes no per-agent binding. */
103
103
  export interface Connector {
104
104
  id: string;
package/dist/bots/api.js CHANGED
@@ -71,5 +71,5 @@ export const call = (c, name, op, input = {}) => rpc(c, 'tools/call', { name, ar
71
71
  export const workOn = (c, params) => c.http.json({ method: 'POST', path: '/v1/agents/coding', body: params });
72
72
  export const projects = (c, signal) => c.http.json({ path: '/v1/project', signal });
73
73
  export const secrets = (c, path, signal) => c.http.collection('secrets', { path: '/v1/kms/secrets', query: { path }, signal });
74
- export const connectors = (c, signal) => c.http.collection('connectors', { path: '/v1/integrations/connectors', signal });
74
+ export const connectors = (c, signal) => c.http.collection('connectors', { path: '/v1/connection', signal });
75
75
  export const grant = (c, id, kind) => c.http.json({ method: 'POST', path: `/v1/sandbox/${encodeURIComponent(id)}/${kind}/ticket` });
@@ -312,7 +312,7 @@ function Secrets({ bot, keys, why }) {
312
312
  * The one thing that is NOT this Bot's.
313
313
  *
314
314
  * A connector is held by the person who signed in to it.
315
- * `/v1/integrations/connectors` answers one set for the caller and no route in
315
+ * `/v1/connection` answers one set for the caller and no route in
316
316
  * the contract narrows it to one agent — so it is listed as what it is, and
317
317
  * there is no switch to press.
318
318
  */
package/dist/connect.d.ts CHANGED
@@ -21,7 +21,7 @@ export interface Device {
21
21
  *
22
22
  * THE PANE STARTS IT AND DOES NOT WATCH IT. Polling belongs where the result is
23
23
  * used — the connector appears in the Directory's own list, which reads
24
- * `/v1/integrations/connectors` — and a menu that closes the moment the reader
24
+ * `/v1/connection` — and a menu that closes the moment the reader
25
25
  * leaves for the provider's page has nowhere to put a result anyway. Starting
26
26
  * the flow, showing the code and opening the page is the whole of this control's
27
27
  * job; `flow` is returned so a surface that does want to watch has the id.
package/dist/connect.js CHANGED
@@ -51,13 +51,13 @@ export async function activate(name, on) {
51
51
  *
52
52
  * THE PANE STARTS IT AND DOES NOT WATCH IT. Polling belongs where the result is
53
53
  * used — the connector appears in the Directory's own list, which reads
54
- * `/v1/integrations/connectors` — and a menu that closes the moment the reader
54
+ * `/v1/connection` — and a menu that closes the moment the reader
55
55
  * leaves for the provider's page has nowhere to put a result anyway. Starting
56
56
  * the flow, showing the code and opening the page is the whole of this control's
57
57
  * job; `flow` is returned so a surface that does want to watch has the id.
58
58
  */
59
59
  export async function startDevice(provider) {
60
- const begun = await ask(`/v1/integrations/connectors/${encodeURIComponent(provider)}/device`, {});
60
+ const begun = await ask(`/v1/connection/${encodeURIComponent(provider)}/device`, {});
61
61
  if (!begun.userCode || !begun.verifyUrl)
62
62
  throw new Error('This service did not start a sign-in.');
63
63
  return { userCode: begun.userCode, verifyUrl: begun.verifyUrl, flow: begun.flow ?? '' };
package/dist/dev.js CHANGED
@@ -41,6 +41,7 @@ import { CAST } from './agents.js';
41
41
  import { app, place, settings, visit } from './lib/host.js';
42
42
  import { link } from './lib/tags.js';
43
43
  import { payUrl } from './lib/pay.js';
44
+ import { useChatPreferences } from './lib/chatPreferences.js';
44
45
  /** Where the builder links out: every one of them an address of this site. */
45
46
  const LINKS = {
46
47
  github: app('-/sync'),
@@ -80,6 +81,7 @@ export function useDevHost() {
80
81
  const { router, path: pathname } = useRooms();
81
82
  const here = path(route(at(pathname)));
82
83
  const look = useLook();
84
+ const [prefs] = useChatPreferences();
83
85
  // The token's claims change only when the token does: a sign-in, a refresh.
84
86
  const memberships = useMemo(() => orgs(), [accessToken]); // eslint-disable-line react-hooks/exhaustive-deps
85
87
  const scoped = useMemo(() => org(), [accessToken]); // eslint-disable-line react-hooks/exhaustive-deps
@@ -111,6 +113,8 @@ export function useDevHost() {
111
113
  links: LINKS,
112
114
  // The sidebar lists Settings' sections and Customize's tabs (Column.tsx), and Customize › Agents offers the cast.
113
115
  sections: true,
116
+ // The model is named, and its picker offered, only where Settings' model selector is on (as in Chat).
117
+ models: prefs.showModelSelector,
114
118
  cast: CAST,
115
119
  // An address of the app moves the app, another of this site moves in the
116
120
  // router, and another origin is left in this tab. platform.hanzo.ai is
@@ -134,5 +138,5 @@ export function useDevHost() {
134
138
  },
135
139
  signIn: () => enter(),
136
140
  signOut: () => void logout(),
137
- }), [scoped, memberships, look.pref.theme, look.set, name, email, avatar, here, router, logout]);
141
+ }), [scoped, memberships, look.pref.theme, look.set, prefs.showModelSelector, name, email, avatar, here, router, logout]);
138
142
  }
@@ -1,3 +1,4 @@
1
+ import { type Effort } from '@hanzo/build/mind';
1
2
  import { type EffortLevel } from '../ThinkingEffort.js';
2
3
  export type ApprovalMode = 'auto' | 'manual';
3
4
  export interface ChatPreferences {
@@ -9,6 +10,8 @@ export interface ChatPreferences {
9
10
  showTurboApproval?: boolean;
10
11
  effortVersion?: number;
11
12
  }
13
+ /** The effort Dev takes for one chosen here (@hanzo/build `EFFORTS`: Auto, High, XHigh, Max), or null for Low and Medium, which only Chat offers. */
14
+ export declare function shared(effort: EffortLevel): Effort | null;
12
15
  export declare function getChatPreferences(): ChatPreferences;
13
16
  export declare function setChatPreferences(patch: Partial<ChatPreferences>): ChatPreferences;
14
17
  export declare function useChatPreferences(): [ChatPreferences, (patch: Partial<ChatPreferences>) => void];
@@ -5,6 +5,7 @@
5
5
  * - approvalMode: whether tools/actions run automatically ('auto') or ask for confirmation first ('manual') (default: 'auto')
6
6
  */
7
7
  import { useEffect, useState } from 'react';
8
+ import { EFFORTS } from '@hanzo/build/mind';
8
9
  import { DEFAULT_EFFORT, EFFORT_STEPS } from '../ThinkingEffort.js';
9
10
  const STORAGE_KEY = 'hanzo.chat.preferences';
10
11
  const AUTONOMY_KEY = 'hanzo.agent.autonomy';
@@ -19,6 +20,10 @@ const DEFAULT_PREFERENCES = {
19
20
  showTurboApproval: false,
20
21
  effortVersion: EFFORT_SCHEMA_VERSION,
21
22
  };
23
+ /** The effort Dev takes for one chosen here (@hanzo/build `EFFORTS`: Auto, High, XHigh, Max), or null for Low and Medium, which only Chat offers. */
24
+ export function shared(effort) {
25
+ return EFFORTS.some((e) => e.id === effort) ? effort : null;
26
+ }
22
27
  function validEffort(v) {
23
28
  return EFFORT_STEPS.some((s) => s.id === v) ? v : DEFAULT_EFFORT;
24
29
  }
package/dist/lib/gmail.js CHANGED
@@ -146,7 +146,7 @@ export function buildGoogleWorkspaceAuthorizeUrl(origin, clientId = DEFAULT_GOOG
146
146
  async function authorizeUrl() {
147
147
  let clientId = DEFAULT_GOOGLE_CLIENT_ID;
148
148
  try {
149
- const res = await fetch(`${api()}/v1/integrations/google/connect`, {
149
+ const res = await fetch(`${api()}/v1/provider/google/connect`, {
150
150
  method: 'POST',
151
151
  headers: { ...scope(), 'Content-Type': 'application/json' },
152
152
  body: '{}',
@@ -188,7 +188,7 @@ async function complete(accessToken, granted, expiresIn) {
188
188
  /* an unnamed account is kept as `default` */
189
189
  }
190
190
  keep(email, { accessToken, scope: granted || GOOGLE_WORKSPACE_SCOPES, expiresIn });
191
- fetch(`${api()}/v1/integrations/google/connect`, {
191
+ fetch(`${api()}/v1/provider/google/connect`, {
192
192
  method: 'POST',
193
193
  headers: { ...scope(), 'Content-Type': 'application/json' },
194
194
  body: JSON.stringify({ token: accessToken, accountId: email }),
package/dist/lib/home.js CHANGED
@@ -50,6 +50,6 @@ export async function projects(client, signal) {
50
50
  * counts rather than being told a number.
51
51
  */
52
52
  export async function apps(client, signal) {
53
- const out = await client.http.json({ path: '/v1/integrations', signal });
53
+ const out = await client.http.json({ path: '/v1/provider', signal });
54
54
  return out?.providers ?? [];
55
55
  }
package/dist/tools.js CHANGED
@@ -3,7 +3,7 @@
3
3
  //
4
4
  // TWO READS, AND THEY ARE NOT THE SAME LIST. `/v1/tools/skills` is what THIS
5
5
  // org's agents already know how to do, each with the flag saying whether it is
6
- // switched on; `/v1/integrations/connectors/providers` is the catalogue of what
6
+ // switched on; `/v1/connection/providers` is the catalogue of what
7
7
  // a person could connect that they have not. One answers "use something", the
8
8
  // other "connect something", which is why the menu has two rows and not one
9
9
  // list with a mixed meaning in it.
@@ -147,5 +147,5 @@ export function useSkills() {
147
147
  }
148
148
  /** What this account could connect and has not. */
149
149
  export function useProviders() {
150
- return useList('/v1/integrations/connectors/providers', asProviders);
150
+ return useList('/v1/connection/providers', asProviders);
151
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/app",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
4
4
  "description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -51,7 +51,7 @@
51
51
  "peerDependencies": {
52
52
  "@hanzo/ai": ">=0.6.23",
53
53
  "@hanzo/appearance": ">=0.2.6",
54
- "@hanzo/build": ">=0.2.81",
54
+ "@hanzo/build": ">=0.2.83",
55
55
  "@hanzo/composer": ">=0.2.0",
56
56
  "@hanzo/event": ">=0.3.56",
57
57
  "@hanzo/gui": "^8.3.5",
@@ -71,7 +71,7 @@
71
71
  "devDependencies": {
72
72
  "@hanzo/ai": "0.6.23",
73
73
  "@hanzo/appearance": "0.2.8",
74
- "@hanzo/build": "0.2.81",
74
+ "@hanzo/build": "0.2.83",
75
75
  "@hanzo/composer": "0.2.0",
76
76
  "@hanzo/design": "0.5.34",
77
77
  "@hanzo/event": "0.3.56",