@hosty-sdk/app 0.44.0 → 0.46.1

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.
@@ -106,6 +106,7 @@ export interface DecisionRecord {
106
106
  resolutionRevision: number;
107
107
  receivedAt: string | null;
108
108
  } | null;
109
+ notificationPending?: boolean | null;
109
110
  continuation: DecisionContinuation | null;
110
111
  reason?: string | null;
111
112
  contentRemovedAt?: string | null;
@@ -1,5 +1,5 @@
1
1
  import type { ProviderServerOptions } from "@hosty-sdk/app/providers/server";
2
- import { type FeedbackCapabilities, type FeedbackSubmit, type FeedbackReport, type FeedbackCollection, type FeedbackDispatch, type FeedbackDispatchInput, type FeedbackDelivery, type FeedbackOutcome } from "@hosty-sdk/app/feedback";
2
+ import { type FeedbackCapabilities, type FeedbackSubmit, type FeedbackReport, type FeedbackCollection, type FeedbackDispatch, type FeedbackDispatchInput, type FeedbackDelivery, type FeedbackOutcome, type FeedbackEdit, type FeedbackDelete } from "@hosty-sdk/app/feedback";
3
3
  export declare class FeedbackServerClient {
4
4
  private readonly appId;
5
5
  private readonly core;
@@ -24,6 +24,11 @@ export declare class FeedbackServerClient {
24
24
  workspaceId: string | null;
25
25
  disposition?: string | null;
26
26
  }, token: string): Promise<FeedbackReport>;
27
+ edit(id: string, input: FeedbackEdit, token: string): Promise<FeedbackReport>;
28
+ remove(id: string, input: FeedbackDelete, token: string): Promise<{
29
+ id: string;
30
+ status: "deleted";
31
+ }>;
27
32
  reserve(input: FeedbackDispatchInput, token: string): Promise<FeedbackDispatch>;
28
33
  delivery(id: string, input: FeedbackDelivery, token: string): Promise<FeedbackDispatch>;
29
34
  outcomes(id: string, outcomes: FeedbackOutcome[], token: string): Promise<FeedbackDispatch>;
@@ -10,7 +10,7 @@ export class FeedbackServerClient {
10
10
  if (!this.appId || !this.service)
11
11
  throw new FeedbackError("hosty_misconfigured", "Hosty app credentials are unavailable.", 503);
12
12
  }
13
- async response(path, token, body, signal) {
13
+ async response(path, token, body, signal, mutation) {
14
14
  if (!token)
15
15
  throw new FeedbackError("identity_required", "Sign in to use feedback.", 401);
16
16
  const response = await fetch(new URL("/api/internal/apps/" + encodeURIComponent(this.appId) + "/" + path, this.core), {
@@ -21,12 +21,14 @@ export class FeedbackServerClient {
21
21
  });
22
22
  if (!response.ok) {
23
23
  const error = await response.json().catch(() => null);
24
+ if (mutation && error === null && (response.status === 404 || response.status === 405))
25
+ throw new FeedbackError("feedback_mutation_unsupported", `This Core does not support ${mutation} feedback. Update Core and retry.`, response.status);
24
26
  throw new FeedbackError(error?.code ?? "feedback_unavailable", error?.message ?? "Feedback is unavailable. Your draft is retained.", response.status);
25
27
  }
26
28
  return response;
27
29
  }
28
- async request(path, token, body, signal) {
29
- return (await this.response(path, token, body, signal)).json();
30
+ async request(path, token, body, signal, mutation) {
31
+ return (await this.response(path, token, body, signal, mutation)).json();
30
32
  }
31
33
  capabilities(token, signal) { return this.request("ui/feedback", token, undefined, signal); }
32
34
  submit(input, token, signal) { return this.request("ui/feedback", token, input, signal); }
@@ -35,6 +37,12 @@ export class FeedbackServerClient {
35
37
  change(id, input, token) {
36
38
  return this.request("feedback/" + encodeURIComponent(id), token, input);
37
39
  }
40
+ edit(id, input, token) {
41
+ return this.request("feedback/" + encodeURIComponent(id) + "/edit", token, input, undefined, "editing");
42
+ }
43
+ remove(id, input, token) {
44
+ return this.request("feedback/" + encodeURIComponent(id) + "/delete", token, input, undefined, "deleting");
45
+ }
38
46
  reserve(input, token) { return this.request("feedback/dispatches", token, input); }
39
47
  delivery(id, input, token) {
40
48
  return this.request("feedback/dispatches/" + encodeURIComponent(id) + "/delivery", token, input);
@@ -76,6 +76,19 @@ export type FeedbackSelection = {
76
76
  id: string;
77
77
  revision: number;
78
78
  };
79
+ export type FeedbackEdit = {
80
+ requestId: string;
81
+ expectedRevision: number;
82
+ comment: string;
83
+ annotations: {
84
+ id: string;
85
+ text: string;
86
+ }[];
87
+ };
88
+ export type FeedbackDelete = {
89
+ requestId: string;
90
+ expectedRevision: number;
91
+ };
79
92
  export type FeedbackDispatchInput = {
80
93
  requestId: string;
81
94
  sessionId: string;
@@ -30,6 +30,8 @@ export class TaskClient {
30
30
  query.set("parentTaskRef", taskReferenceKey(options.parentTaskRef));
31
31
  if (options.rootTaskRef)
32
32
  query.set("rootTaskRef", taskReferenceKey(options.rootTaskRef));
33
+ if (options.removed !== undefined)
34
+ query.set("removed", String(options.removed));
33
35
  if (options.rootsOnly !== undefined)
34
36
  query.set("rootsOnly", String(options.rootsOnly));
35
37
  return this.call(`/tasks?${query}`, "GET", undefined, options.signal);
package/dist/tasks.d.ts CHANGED
@@ -129,6 +129,11 @@ export type TaskCoordination = {
129
129
  executionId: string;
130
130
  };
131
131
  export type TaskRecord = TaskInput & {
132
+ removed?: {
133
+ batchId: string;
134
+ at: string;
135
+ by: TaskActor;
136
+ };
132
137
  coordination?: TaskCoordination;
133
138
  ref: TaskRef;
134
139
  number: string;
@@ -172,12 +177,16 @@ export type TaskEdit = TaskMutation & {
172
177
  expectedGraphRevision?: number;
173
178
  };
174
179
  export type TaskAction = TaskMutation & {
175
- action: "ready" | "draft" | "start" | "complete" | "cancel" | "accept" | "request_changes" | "retry" | "disposition";
180
+ action: "ready" | "draft" | "start" | "complete" | "cancel" | "accept" | "request_changes" | "retry" | "disposition" | "remove" | "restore";
176
181
  result?: TaskResult;
177
182
  resultRef?: TaskOutcomeRef;
178
183
  feedback?: string;
179
184
  selection?: TaskSelection;
180
185
  disposition?: TaskDisposition;
186
+ removalScope?: Array<{
187
+ taskRef: TaskRef;
188
+ revision: number;
189
+ }>;
181
190
  };
182
191
  export type TaskRequestReceipt = {
183
192
  requestId: string;
@@ -196,6 +205,7 @@ export type TaskListOptions = {
196
205
  parentTaskRef?: TaskRef;
197
206
  rootTaskRef?: TaskRef;
198
207
  rootsOnly?: boolean;
208
+ removed?: boolean;
199
209
  };
200
210
  export type TaskCapabilities = {
201
211
  version: 1;
@@ -0,0 +1,4 @@
1
+ /** Panel manifests carry Lucide names, including legacy component-name spellings. */
2
+ export declare function UiPanelIcon({ name }: {
3
+ name: string | null;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { DynamicIcon, iconNames } from "lucide-react/dynamic.mjs";
4
+ import { SdkIcon } from "./sdk-chrome.js";
5
+ const normalize = (name) => name.replace(/[-_\s]/g, "").toLowerCase();
6
+ const names = new Map(iconNames.map(name => [normalize(name), name]));
7
+ const fallback = () => _jsx(SdkIcon, { name: "tools" });
8
+ /** Panel manifests carry Lucide names, including legacy component-name spellings. */
9
+ export function UiPanelIcon({ name }) {
10
+ const icon = name ? names.get(normalize(name.trim())) : undefined;
11
+ return icon ? _jsx(DynamicIcon, { name: icon, fallback: fallback, className: "hosty-sdk-icon", "aria-hidden": "true", focusable: "false" }, icon) : fallback();
12
+ }
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { createContext, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
4
4
  import { SdkIcon } from "./sdk-chrome.js";
5
+ import { UiPanelIcon } from "./ui-panel-icon.js";
5
6
  import { UiHostContext } from "./ui-context.js";
6
7
  import { useHostyChrome, useHostyNavigation } from "./ui-navigation-react.js";
7
8
  import { StandaloneNavigationContext } from "./ui-standalone-context.js";
@@ -43,5 +44,5 @@ export function StandaloneHeader({ panels, selected, expanded, onSelect, onChoos
43
44
  const icon = app?.iconUrl && /^(https?:\/\/|\/(?!\/))/.test(app.iconUrl) ? app.iconUrl : null;
44
45
  const showNavigation = canNavigate && chrome.navigation === "show" && (navigation.status !== "ready" || navigation.entries.length > 0);
45
46
  const toolsVisible = chrome.tools.enabled && chrome.tools.launcher !== "hide";
46
- return _jsxs("header", { "data-hosty-sdk": true, className: "hosty-standalone-header", children: [_jsxs("div", { className: "hosty-standalone-identity", children: [showNavigation && nav && _jsx("button", { ref: nav.opener, type: "button", className: "hosty-standalone-navigation", disabled: !prefs.ready, "aria-label": nav.narrow ? nav.open ? "Hide navigation" : "Show navigation" : prefs.collapsed ? "Show navigation" : "Hide navigation", title: nav.narrow ? "Page navigation" : prefs.collapsed ? "Show navigation" : "Hide navigation", "aria-expanded": nav.narrow ? nav.open : !prefs.collapsed, onClick: () => nav.narrow ? nav.setOpen(!nav.open) : prefs.setCollapsed(!prefs.collapsed), children: _jsx(SdkIcon, { name: "sidebar" }) }), icon && icon !== failedIcon ? _jsx("img", { src: icon, alt: "", draggable: false, onError: () => setFailedIcon(icon) }) : _jsx(SdkIcon, { name: "app" }), _jsx("strong", { title: name, children: name })] }), toolsVisible && _jsxs("div", { className: "hosty-standalone-tools", children: [_jsx("nav", { className: "hosty-pinned-tools", "aria-label": "Pinned tools", children: prefs.pins.map(key => panels.find(panel => panelKey(panel.panel) === key)).filter((panel) => !!panel).map(panel => _jsxs("button", { type: "button", "aria-label": `Open ${panel.appName} — ${panel.label}`, title: `${panel.appName}: ${panel.label}`, "aria-expanded": expanded && selected === panelKey(panel.panel), onClick: () => onSelect(panel), children: [_jsx(SdkIcon, { name: "tools" }), _jsx("span", { children: panel.label }), attention(panel) && _jsx("span", { className: "hosty-panel-attention", "aria-label": "Needs attention", children: _jsx(SdkIcon, { name: "warning" }) })] }, panelKey(panel.panel))) }), _jsxs("button", { type: "button", "aria-label": "Tools", "aria-haspopup": "dialog", "aria-expanded": chooserOpen, onClick: onChoose, children: [_jsx(SdkIcon, { name: "tools" }), _jsx("span", { children: "Tools" }), _jsx(SdkIcon, { name: "chevron" })] })] })] });
47
+ return _jsxs("header", { "data-hosty-sdk": true, className: "hosty-standalone-header", children: [_jsxs("div", { className: "hosty-standalone-identity", children: [showNavigation && nav && _jsx("button", { ref: nav.opener, type: "button", className: "hosty-standalone-navigation", disabled: !prefs.ready, "aria-label": nav.narrow ? nav.open ? "Hide navigation" : "Show navigation" : prefs.collapsed ? "Show navigation" : "Hide navigation", title: nav.narrow ? "Page navigation" : prefs.collapsed ? "Show navigation" : "Hide navigation", "aria-expanded": nav.narrow ? nav.open : !prefs.collapsed, onClick: () => nav.narrow ? nav.setOpen(!nav.open) : prefs.setCollapsed(!prefs.collapsed), children: _jsx(SdkIcon, { name: "sidebar" }) }), icon && icon !== failedIcon ? _jsx("img", { src: icon, alt: "", draggable: false, onError: () => setFailedIcon(icon) }) : _jsx(SdkIcon, { name: "app" }), _jsx("strong", { title: name, children: name })] }), toolsVisible && _jsxs("div", { className: "hosty-standalone-tools", children: [_jsx("nav", { className: "hosty-pinned-tools", "aria-label": "Pinned tools", children: prefs.pins.map(key => panels.find(panel => panelKey(panel.panel) === key)).filter((panel) => !!panel).map(panel => _jsxs("button", { type: "button", "aria-label": `Open ${panel.appName} — ${panel.label}`, title: `${panel.appName}: ${panel.label}`, "aria-expanded": expanded && selected === panelKey(panel.panel), onClick: () => onSelect(panel), children: [_jsx(UiPanelIcon, { name: panel.icon }), _jsx("span", { children: panel.label }), attention(panel) && _jsx("span", { className: "hosty-panel-attention", "aria-label": "Needs attention", children: _jsx(SdkIcon, { name: "warning" }) })] }, panelKey(panel.panel))) }), _jsxs("button", { type: "button", "aria-label": "Tools", "aria-haspopup": "dialog", "aria-expanded": chooserOpen, onClick: onChoose, children: [_jsx(SdkIcon, { name: "tools" }), _jsx("span", { children: "Tools" }), _jsx(SdkIcon, { name: "chevron" })] })] })] });
47
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hosty-sdk/app",
3
- "version": "0.44.0",
3
+ "version": "0.46.1",
4
4
  "description": "Hosty app auth: session state machine, recovery bridge, Core revalidation, and the embedder responder.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -176,6 +176,7 @@
176
176
  },
177
177
  "dependencies": {
178
178
  "@noble/hashes": "^2.4.0",
179
+ "lucide-react": "^1.55.0",
179
180
  "server-only": "^0.0.1"
180
181
  },
181
182
  "peerDependencies": {