@oxy-hq/sdk 2.11.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +44 -4
  2. package/dist/function-context-D8eyZuw_.d.cts +720 -0
  3. package/dist/function-context-D8eyZuw_.d.cts.map +1 -0
  4. package/dist/function-context-D8eyZuw_.d.mts +720 -0
  5. package/dist/function-context-D8eyZuw_.d.mts.map +1 -0
  6. package/dist/index.cjs +156 -11
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.cts +338 -638
  9. package/dist/index.d.cts.map +1 -1
  10. package/dist/index.d.mts +338 -638
  11. package/dist/index.d.mts.map +1 -1
  12. package/dist/index.mjs +155 -12
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/ops.cjs +85 -0
  15. package/dist/ops.cjs.map +1 -0
  16. package/dist/ops.d.cts +61 -0
  17. package/dist/ops.d.cts.map +1 -0
  18. package/dist/ops.d.mts +61 -0
  19. package/dist/ops.d.mts.map +1 -0
  20. package/dist/ops.mjs +79 -0
  21. package/dist/ops.mjs.map +1 -0
  22. package/dist/{react-DqnINwTi.mjs → react-BXGyzgz0.mjs} +8 -3
  23. package/dist/react-BXGyzgz0.mjs.map +1 -0
  24. package/dist/{react-CLONxcnA.d.cts → react-DW7Z96sD.d.cts} +8 -1
  25. package/dist/{react-CLONxcnA.d.cts.map → react-DW7Z96sD.d.cts.map} +1 -1
  26. package/dist/{react-CLONxcnA.d.mts → react-DW7Z96sD.d.mts} +8 -1
  27. package/dist/{react-CLONxcnA.d.mts.map → react-DW7Z96sD.d.mts.map} +1 -1
  28. package/dist/{react-riTxd9ce.cjs → react-DcT-mUPj.cjs} +8 -3
  29. package/dist/react-DcT-mUPj.cjs.map +1 -0
  30. package/dist/shell.cjs +34 -4
  31. package/dist/shell.cjs.map +1 -1
  32. package/dist/shell.d.cts +39 -7
  33. package/dist/shell.d.cts.map +1 -1
  34. package/dist/shell.d.mts +39 -7
  35. package/dist/shell.d.mts.map +1 -1
  36. package/dist/shell.mjs +34 -5
  37. package/dist/shell.mjs.map +1 -1
  38. package/package.json +12 -1
  39. package/dist/react-DqnINwTi.mjs.map +0 -1
  40. package/dist/react-riTxd9ce.cjs.map +0 -1
package/dist/shell.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
- import { a as AppFetcher, n as AgentRunEvent } from "./react-CLONxcnA.cjs";
2
+ import { a as AppFetcher, n as AgentRunEvent } from "./react-DW7Z96sD.cjs";
3
+ import { _ as OxyReach } from "./function-context-D8eyZuw_.cjs";
3
4
  import * as React from "react";
4
5
  import { ReactNode } from "react";
5
6
  //#region src/shell/AnswerChart.d.ts
@@ -234,11 +235,23 @@ interface ShellContextData {
234
235
  settings?: string;
235
236
  };
236
237
  /** Viewer display identity; null on unauthenticated/local modes. */
237
- user: {
238
- name: string;
239
- email: string;
240
- picture?: string | null;
241
- } | null;
238
+ user: ShellContextUser | null;
239
+ }
240
+ /**
241
+ * The viewer, for display. `id`, `kind` and `reach` arrive on servers that
242
+ * carry the operating graph (2026-09-07 on) and are absent before — read them
243
+ * through `useIdentity()`, which fills the gaps with the fail-closed answer.
244
+ * None of this is a gate: the function's `ctx.user` is.
245
+ */
246
+ interface ShellContextUser {
247
+ name: string;
248
+ /** Empty for a frontline worker, who has no mailbox. */
249
+ email: string;
250
+ picture?: string | null;
251
+ id?: string;
252
+ /** `member` holds an org membership; `frontline` is a crew member. */
253
+ kind?: "member" | "frontline";
254
+ reach?: OxyReach | null;
242
255
  }
243
256
  interface UseShellContextResult {
244
257
  data: ShellContextData | null;
@@ -252,6 +265,25 @@ interface UseShellContextResult {
252
265
  * endpoint), so errors are surfaced on the result, never thrown.
253
266
  */
254
267
  declare function useShellContext(): UseShellContextResult;
268
+ /** What `useIdentity()` returns. */
269
+ interface ViewerIdentity {
270
+ id: string | null;
271
+ name: string;
272
+ /** `null` for a frontline worker — the crew signal, as in `ctx.user.email`. */
273
+ email: string | null;
274
+ picture: string | null;
275
+ kind: "member" | "frontline" | null;
276
+ /** Display-only reach; the fail-closed answer until the server says otherwise. */
277
+ reach: OxyReach;
278
+ loading: boolean;
279
+ }
280
+ /**
281
+ * The viewer, in one shape, on every server version: who is signed in, the
282
+ * crew-or-office signal, and where they work — for a greeting, a "your
283
+ * store" default, or hiding a tab. Never for authorization: a browser can
284
+ * edit what it renders, and the function's `ctx.user.reach` is the gate.
285
+ */
286
+ declare function useIdentity(): ViewerIdentity;
255
287
  //#endregion
256
288
  //#region src/shell/Tooltip.d.ts
257
289
  /**
@@ -342,5 +374,5 @@ declare function WorkspaceTile({ name, logoUrl }: {
342
374
  logoUrl?: string;
343
375
  }): import("react").JSX.Element;
344
376
  //#endregion
345
- export { AnswerChart, type AnswerChartProps, AskDock, type AskDockProps, Breadcrumb, type ChartBlock, type ChartBlockConfig, OXY_MARK_PATH, OxyMark, OxyShell, type OxyShellProps, OxygenFactoryMark, type RailItem, ReasoningTrace, type ReasoningTraceProps, type ShellContextApp, type ShellContextData, ShellRail, ShellTooltip, SystemIndicator, type ThreadSummary, type ThreadTranscript, TopBar, type TraceItem, type TraceStep, type TraceStepStatus, type TranscriptTurn, type UseShellContextResult, type UseThreadHistoryResult, WorkspaceClock, WorkspaceTile, buildTraceSteps, fetchThreadTranscript, useShellContext, useThreadHistory, workspaceLogoUrl };
377
+ export { AnswerChart, type AnswerChartProps, AskDock, type AskDockProps, Breadcrumb, type ChartBlock, type ChartBlockConfig, OXY_MARK_PATH, OxyMark, OxyShell, type OxyShellProps, OxygenFactoryMark, type RailItem, ReasoningTrace, type ReasoningTraceProps, type ShellContextApp, type ShellContextData, type ShellContextUser, ShellRail, ShellTooltip, SystemIndicator, type ThreadSummary, type ThreadTranscript, TopBar, type TraceItem, type TraceStep, type TraceStepStatus, type TranscriptTurn, type UseShellContextResult, type UseThreadHistoryResult, type ViewerIdentity, WorkspaceClock, WorkspaceTile, buildTraceSteps, fetchThreadTranscript, useIdentity, useShellContext, useThreadHistory, workspaceLogoUrl };
346
378
  //# sourceMappingURL=shell.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.cts","names":[],"sources":["../src/shell/AnswerChart.tsx","../src/shell/AskDock.tsx","../src/shell/logoUrl.ts","../src/shell/marks.tsx","../src/shell/OxyShell.tsx","../src/shell/trace.ts","../src/shell/ReasoningTrace.tsx","../src/shell/ShellRail.tsx","../src/shell/shellContext.ts","../src/shell/Tooltip.tsx","../src/shell/TopBar.tsx","../src/shell/threadHistory.ts","../src/shell/WorkspaceTile.tsx"],"mappings":";;;;;UAYiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;EACA;;UA8ce;EACf,OAAO;EACP;;;;;iBAMc,cAAc,OAAO,aAAa,mBAAgB,MAAA,IAAA;;;UCzUjD;;EAEf;;EAEA;;EAEA;;EAEA;EACA;EACA;EACA;;;;;;iBAuEc,UACd,SACA,eACA,aACA,aACA,MACA,SACA,aACC,eAAY,MAAA,IAAA;;;;;;;;cC7PF,mBAAgB,oBAAsB,qBAAqB;;;;cCA3D;;;iBAKG,UAAU;EAAe;oBAAoB,IAAA;;;;;;iBAyB7C,oBAAoB;EAAe;oBAAoB,IAAA;;;UC+BtD;EACf,UAAU;;EAEV;;;;;EAKA,aAAa;;;EAGb,cAAc;;;EAGd,aAAa;;EAEb;;;EAGA;;;;;;;;EAQA;EACA;;;;;EAKA;;;;EAIA;;;;;;iBAsDc,WACd,UACA,WACA,YACA,aACA,YACA,YACA,WACA,gBACA,WACA,kBACA,oBACC,gCAAa,IAAA;;;KC9JJ;UAEK;EACf;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA,QAAQ;EACR,OAAO;;;;iBA8IO,gBAAgB,QAAQ,kBAAkB;;;UCvDzC;EACf,OAAO;;EAEP;;EAEA;IAAQ;IAAe;;EACvB;;;;iBAKc,iBAAiB,OAAO,WAAmB,KAAK,aAAa,sCAAmB,IAAA;;;;;;;KCxHpF;EACV;EACA;;;EAGA;EACA;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;;;;;;;iBAuDc,YACd,KACA,QACA,aACA,QACA;EAEA,MAAM;EACN,QAAQ;EACR,cAAc;EACd,SAAS;EACT;oBACD,IAAA;;;UC9EgB;EACf;EACA;EACA;;EAEA;EACA;;;EAGA;;EAEA;;UAGe;EACf;IAAa;IAAY;;EACzB;IAAO;IAAY;IAAc;;;EAEjC;;EAEA,MAAM;;;;EAIN;IAAS;IAAc;IAAiB;;;EAExC;IAAQ;IAAc;IAAe;;;UAGtB;EACf,MAAM;EACN;EACA,OAAO;;;;;;;;iBASO,mBAAmB;;;;;;;;iBC/CnB,eACd,SACA,MACA;EAEA,SAAS,MAAM;EACf;EACA,UAAU,MAAM;IACjB,MAAA,IAAA;;;;;iBCNe,SACd,MACA,OACA;EAEA,OAAO;EACP,QAAQ;EACR;oBACD,IAAA;;;;;;iBAqBe,aACd,gBACA,WACA,UACA;EAEA;EACA;EACA;EACA;oBACD,IAAA;;;;;;;iBAmDe,mCAAe,IAAA;;;;;;iBA+Bf,iBAAiB;EAAc;oBAAmB,IAAA;;;UCrHjD;EACf;EACA;EACA;;UAGe;EACf;EACA,QAAQ;;UAGO;EACf;EACA,OAAO;;UAGQ;EACf,SAAS;EACT;EACA,OAAO;;EAEP;;;;;;;iBAQc,oBAAoB;;;;;iBAyCd,sBACpB,SAAS,YACT,mBACA,mBACC,QAAQ;;;;;;iBCnFK,gBAAgB,MAAM;EAAa;EAAc;oBAAkB,IAAA"}
1
+ {"version":3,"file":"shell.d.cts","names":[],"sources":["../src/shell/AnswerChart.tsx","../src/shell/AskDock.tsx","../src/shell/logoUrl.ts","../src/shell/marks.tsx","../src/shell/OxyShell.tsx","../src/shell/trace.ts","../src/shell/ReasoningTrace.tsx","../src/shell/ShellRail.tsx","../src/shell/shellContext.ts","../src/shell/Tooltip.tsx","../src/shell/TopBar.tsx","../src/sh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;;EAEjC;;EAEA,MAAM;;;;EAIN;IAAS;IAAc;IAAiB;;;EAExC,MAAM;;;;;;;;UASS;EACf;;EAEA;EACA;EACA;;EAEA;EACA,QAAQ;;UAGO;EACf,MAAM;EACN;EACA,OAAO;;;;;;;;iBASO,mBAAmB;;UA4ClB;EACf;EACA;;EAEA;EACA;EACA;;EAEA,OAAO;EACP;;;;;;;;iBAWc,eAAe;;;;;;;;iBCjIf,eACd,SACA,MACA;EAEA,SAAS,MAAM;EACf;EACA,UAAU,MAAM;IACjB,MAAA,IAAA;;;;;iBCNe,SACd,MACA,OACA;EAEA,OAAO;EACP,QAAQ;EACR;oBACD,IAAA;;;;;;iBAqBe,aACd,gBACA,WACA,UACA;EAEA;EACA;EACA;EACA;oBACD,IAAA;;;;;;;iBAmDe,mCAAe,IAAA;;;;;;iBA+Bf,iBAAiB;EAAc;oBAAmB,IAAA;;;UCrHjD;EACf;EACA;EACA;;UAGe;EACf;EACA,QAAQ;;UAGO;EACf;EACA,OAAO;;UAGQ;EACf,SAAS;EACT;EACA,OAAO;;EAEP;;;;;;;iBAQc,oBAAoB;;;;;iBAyCd,sBACpB,SAAS,YACT,mBACA,mBACC,QAAQ;;;;;;iBCnFK,gBAAgB,MAAM;EAAa;EAAc;oBAAkB,IAAA"}
package/dist/shell.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
- import { a as AppFetcher, n as AgentRunEvent } from "./react-CLONxcnA.mjs";
2
+ import { a as AppFetcher, n as AgentRunEvent } from "./react-DW7Z96sD.mjs";
3
+ import { _ as OxyReach } from "./function-context-D8eyZuw_.mjs";
3
4
  import * as React from "react";
4
5
  import { ReactNode } from "react";
5
6
  //#region src/shell/AnswerChart.d.ts
@@ -234,11 +235,23 @@ interface ShellContextData {
234
235
  settings?: string;
235
236
  };
236
237
  /** Viewer display identity; null on unauthenticated/local modes. */
237
- user: {
238
- name: string;
239
- email: string;
240
- picture?: string | null;
241
- } | null;
238
+ user: ShellContextUser | null;
239
+ }
240
+ /**
241
+ * The viewer, for display. `id`, `kind` and `reach` arrive on servers that
242
+ * carry the operating graph (2026-09-07 on) and are absent before — read them
243
+ * through `useIdentity()`, which fills the gaps with the fail-closed answer.
244
+ * None of this is a gate: the function's `ctx.user` is.
245
+ */
246
+ interface ShellContextUser {
247
+ name: string;
248
+ /** Empty for a frontline worker, who has no mailbox. */
249
+ email: string;
250
+ picture?: string | null;
251
+ id?: string;
252
+ /** `member` holds an org membership; `frontline` is a crew member. */
253
+ kind?: "member" | "frontline";
254
+ reach?: OxyReach | null;
242
255
  }
243
256
  interface UseShellContextResult {
244
257
  data: ShellContextData | null;
@@ -252,6 +265,25 @@ interface UseShellContextResult {
252
265
  * endpoint), so errors are surfaced on the result, never thrown.
253
266
  */
254
267
  declare function useShellContext(): UseShellContextResult;
268
+ /** What `useIdentity()` returns. */
269
+ interface ViewerIdentity {
270
+ id: string | null;
271
+ name: string;
272
+ /** `null` for a frontline worker — the crew signal, as in `ctx.user.email`. */
273
+ email: string | null;
274
+ picture: string | null;
275
+ kind: "member" | "frontline" | null;
276
+ /** Display-only reach; the fail-closed answer until the server says otherwise. */
277
+ reach: OxyReach;
278
+ loading: boolean;
279
+ }
280
+ /**
281
+ * The viewer, in one shape, on every server version: who is signed in, the
282
+ * crew-or-office signal, and where they work — for a greeting, a "your
283
+ * store" default, or hiding a tab. Never for authorization: a browser can
284
+ * edit what it renders, and the function's `ctx.user.reach` is the gate.
285
+ */
286
+ declare function useIdentity(): ViewerIdentity;
255
287
  //#endregion
256
288
  //#region src/shell/Tooltip.d.ts
257
289
  /**
@@ -342,5 +374,5 @@ declare function WorkspaceTile({ name, logoUrl }: {
342
374
  logoUrl?: string;
343
375
  }): import("react").JSX.Element;
344
376
  //#endregion
345
- export { AnswerChart, type AnswerChartProps, AskDock, type AskDockProps, Breadcrumb, type ChartBlock, type ChartBlockConfig, OXY_MARK_PATH, OxyMark, OxyShell, type OxyShellProps, OxygenFactoryMark, type RailItem, ReasoningTrace, type ReasoningTraceProps, type ShellContextApp, type ShellContextData, ShellRail, ShellTooltip, SystemIndicator, type ThreadSummary, type ThreadTranscript, TopBar, type TraceItem, type TraceStep, type TraceStepStatus, type TranscriptTurn, type UseShellContextResult, type UseThreadHistoryResult, WorkspaceClock, WorkspaceTile, buildTraceSteps, fetchThreadTranscript, useShellContext, useThreadHistory, workspaceLogoUrl };
377
+ export { AnswerChart, type AnswerChartProps, AskDock, type AskDockProps, Breadcrumb, type ChartBlock, type ChartBlockConfig, OXY_MARK_PATH, OxyMark, OxyShell, type OxyShellProps, OxygenFactoryMark, type RailItem, ReasoningTrace, type ReasoningTraceProps, type ShellContextApp, type ShellContextData, type ShellContextUser, ShellRail, ShellTooltip, SystemIndicator, type ThreadSummary, type ThreadTranscript, TopBar, type TraceItem, type TraceStep, type TraceStepStatus, type TranscriptTurn, type UseShellContextResult, type UseThreadHistoryResult, type ViewerIdentity, WorkspaceClock, WorkspaceTile, buildTraceSteps, fetchThreadTranscript, useIdentity, useShellContext, useThreadHistory, workspaceLogoUrl };
346
378
  //# sourceMappingURL=shell.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.mts","names":[],"sources":["../src/shell/AnswerChart.tsx","../src/shell/AskDock.tsx","../src/shell/logoUrl.ts","../src/shell/marks.tsx","../src/shell/OxyShell.tsx","../src/shell/trace.ts","../src/shell/ReasoningTrace.tsx","../src/shell/ShellRail.tsx","../src/shell/shellContext.ts","../src/shell/Tooltip.tsx","../src/shell/TopBar.tsx","../src/shell/threadHistory.ts","../src/shell/WorkspaceTile.tsx"],"mappings":";;;;;UAYiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;EACA;;UA8ce;EACf,OAAO;EACP;;;;;iBAMc,cAAc,OAAO,aAAa,mBAAgB,MAAA,IAAA;;;UCzUjD;;EAEf;;EAEA;;EAEA;;EAEA;EACA;EACA;EACA;;;;;;iBAuEc,UACd,SACA,eACA,aACA,aACA,MACA,SAC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AqBe,aACd,gBACA,WACA,UACA;EAEA;EACA;EACA;EACA;oBACD,IAAA;;;;;;;iBAmDe,mCAAe,IAAA;;;;;;iBA+Bf,iBAAiB;EAAc;oBAAmB,IAAA;;;UCrHjD;EACf;EACA;EACA;;UAGe;EACf;EACA,QAAQ;;UAGO;EACf;EACA,OAAO;;UAGQ;EACf,SAAS;EACT;EACA,OAAO;;EAEP;;;;;;;iBAQc,oBAAoB;;;;;iBAyCd,sBACpB,SAAS,YACT,mBACA,mBACC,QAAQ;;;;;;iBCnFK,gBAAgB,MAAM;EAAa;EAAc;oBAAkB,IAAA"}
1
+ {"version":3,"file":"shell.d.mts","names":[],"sources":["../src/shell/AnswerChart.tsx","../src/shell/AskDock.tsx","../src/shell/logoUrl.ts","../src/shell/marks.tsx","../src/shell/OxyShell.tsx","../src/shell/trace.ts","../src/shell/ReasoningTrace.tsx","../src/shell/ShellRail.tsx","../src/shell/shellContext.ts","../src/shell/Tooltip.tsx","../src/shell/TopBar.tsx","../src/shell/threadHistory.ts","../src/shell/WorkspaceTile.tsx"],"mappings":";;;;;;UAYiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;EACA;;UA8ce;EACf,OAAO;EACP;;;;;iBAMc,cAAc,OAAO,aAAa,mBAAgB,MAAA,IAAA;;;UCzUjD;;EAEf;;EAEA;;EAEA;;EAEA;EACA;EACA;EACA;;;;;;iBAuEc,UACd,SACA,eACA,aACA,aACA,MACA,SACA,aACC,eAAY,MAAA,IAAA;;;;;;;;cC7PF,mBAAgB,oBAAsB,qBAAqB;;;;cCA3D;;;iBAKG,UAAU;EAAe;oBAAoB,IAAA;;;;;;iBAyB7C,oBAAoB;EAAe;oBAAoB,IAAA;;;UC+BtD;EACf,UAAU;;EAEV;;;;;EAKA,aAAa;;;EAGb,cAAc;;;EAGd,aAAa;;EAEb;;;EAGA;;;;;;;;EAQA;EACA;;;;;EAKA;;;;EAIA;;;;;;iBAsDc,WACd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;EACA,OAAO;;UAGQ;EACf,SAAS;EACT;EACA,OAAO;;EAEP;;;;;;;iBAQc,oBAAoB;;;;;iBAyCd,sBACpB,SAAS,YACT,mBACA,mBACC,QAAQ;;;;;;iBCnFK,gBAAgB,MAAM;EAAa;EAAc;oBAAkB,IAAA"}
package/dist/shell.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // @oxy/sdk - TypeScript SDK for Oxy data platform
2
- import { i as useAgentRun, l as useResolvedManifest, o as useOxyApp, t as OxyAnswer, v as getOxyAppLogger } from "./react-DqnINwTi.mjs";
2
+ import { i as useAgentRun, l as useResolvedManifest, o as useOxyApp, t as OxyAnswer, v as getOxyAppLogger } from "./react-BXGyzgz0.mjs";
3
3
  import * as React from "react";
4
4
  import { Fragment, useEffect, useMemo, useState } from "react";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1785,7 +1785,7 @@ function ShellRail({ top, groups, footerItems, bottom, className }) {
1785
1785
  * endpoint), so errors are surfaced on the result, never thrown.
1786
1786
  */
1787
1787
  function useShellContext() {
1788
- const { projectId, fetcher } = useOxyApp();
1788
+ const { projectId, appId, fetcher } = useOxyApp();
1789
1789
  const [state, setState] = React.useState({
1790
1790
  data: null,
1791
1791
  loading: true,
@@ -1801,7 +1801,8 @@ function useShellContext() {
1801
1801
  return;
1802
1802
  }
1803
1803
  let cancelled = false;
1804
- fetcher(`/api/projects/${projectId}/shell-context`, { method: "GET" }).then(async (resp) => {
1804
+ const query = appId ? `?app=${encodeURIComponent(appId)}` : "";
1805
+ fetcher(`/api/projects/${projectId}/shell-context${query}`, { method: "GET" }).then(async (resp) => {
1805
1806
  if (!resp.ok) throw new Error(`shell-context failed: HTTP ${resp.status}`);
1806
1807
  const data = await resp.json();
1807
1808
  if (!cancelled) setState({
@@ -1821,9 +1822,37 @@ function useShellContext() {
1821
1822
  return () => {
1822
1823
  cancelled = true;
1823
1824
  };
1824
- }, [projectId, fetcher]);
1825
+ }, [
1826
+ projectId,
1827
+ appId,
1828
+ fetcher
1829
+ ]);
1825
1830
  return state;
1826
1831
  }
1832
+ const NOWHERE = {
1833
+ everywhere: false,
1834
+ via: null,
1835
+ locations: []
1836
+ };
1837
+ /**
1838
+ * The viewer, in one shape, on every server version: who is signed in, the
1839
+ * crew-or-office signal, and where they work — for a greeting, a "your
1840
+ * store" default, or hiding a tab. Never for authorization: a browser can
1841
+ * edit what it renders, and the function's `ctx.user.reach` is the gate.
1842
+ */
1843
+ function useIdentity() {
1844
+ const { data, loading } = useShellContext();
1845
+ const u = data?.user ?? null;
1846
+ return {
1847
+ id: u?.id ?? null,
1848
+ name: u?.name ?? "",
1849
+ email: u?.email ? u.email : null,
1850
+ picture: u?.picture ?? null,
1851
+ kind: u?.kind ?? null,
1852
+ reach: u?.reach ?? NOWHERE,
1853
+ loading
1854
+ };
1855
+ }
1827
1856
 
1828
1857
  //#endregion
1829
1858
  //#region src/shell/TopBar.tsx
@@ -2150,5 +2179,5 @@ function OxyShell({ children, pageLabel, topBarLeft, topBarExtra, railBottom, hi
2150
2179
  }
2151
2180
 
2152
2181
  //#endregion
2153
- export { AnswerChart, AskDock, Breadcrumb, OXY_MARK_PATH, OxyMark, OxyShell, OxygenFactoryMark, ReasoningTrace, ShellRail, ShellTooltip, SystemIndicator, TopBar, WorkspaceClock, WorkspaceTile, buildTraceSteps, fetchThreadTranscript, useShellContext, useThreadHistory, workspaceLogoUrl };
2182
+ export { AnswerChart, AskDock, Breadcrumb, OXY_MARK_PATH, OxyMark, OxyShell, OxygenFactoryMark, ReasoningTrace, ShellRail, ShellTooltip, SystemIndicator, TopBar, WorkspaceClock, WorkspaceTile, buildTraceSteps, fetchThreadTranscript, useIdentity, useShellContext, useThreadHistory, workspaceLogoUrl };
2154
2183
  //# sourceMappingURL=shell.mjs.map