@ottocode/web-sdk 0.1.212 → 0.1.213

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SkillRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/renderers/SkillRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,wBAAgB,aAAa,CAAC,EAC7B,WAAW,EACX,cAAc,EACd,UAAU,EACV,QAAQ,EACR,OAAO,GACP,EAAE,aAAa,2CAmFf"}
1
+ {"version":3,"file":"SkillRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/renderers/SkillRenderer.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAe7C,wBAAgB,aAAa,CAAC,EAC7B,WAAW,EACX,cAAc,EACd,UAAU,EACV,QAAQ,EACR,OAAO,GACP,EAAE,aAAa,2CAuJf"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ChevronRight, AlertCircle, BookOpen } from 'lucide-react';
2
+ import { ChevronRight, AlertCircle, BookOpen, FileText, ShieldAlert, } from 'lucide-react';
3
3
  import { formatDuration } from './utils';
4
4
  import { ToolErrorDisplay } from './ToolErrorDisplay';
5
5
  export function SkillRenderer({ contentJson, toolDurationMs, isExpanded, onToggle, compact, }) {
@@ -13,11 +13,24 @@ export function SkillRenderer({ contentJson, toolDurationMs, isExpanded, onToggl
13
13
  const description = result.description;
14
14
  const content = result.content;
15
15
  const scope = result.scope;
16
+ const availableFiles = result.availableFiles;
17
+ const securityNotices = result.securityNotices;
18
+ const isSubFile = description?.startsWith('Sub-file:');
19
+ const fileCount = availableFiles?.length ?? 0;
20
+ const noticeCount = securityNotices?.length ?? 0;
16
21
  const canExpand = !!content || hasToolError;
17
22
  return (_jsxs("div", { className: "text-xs", children: [_jsxs("button", { type: "button", onClick: () => canExpand && onToggle(), className: `flex items-center gap-2 transition-colors w-full min-w-0 ${hasToolError
18
23
  ? 'text-red-700 dark:text-red-300 hover:text-red-600 dark:hover:text-red-200'
19
24
  : canExpand
20
25
  ? 'text-violet-700 dark:text-violet-300 hover:text-violet-600 dark:hover:text-violet-200'
21
- : 'text-violet-700 dark:text-violet-300'}`, children: [canExpand ? (_jsx(ChevronRight, { className: `h-3 w-3 flex-shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}` })) : (_jsx("div", { className: "w-3 flex-shrink-0" })), hasToolError && (_jsx(AlertCircle, { className: "h-3 w-3 flex-shrink-0 text-red-600 dark:text-red-400" })), _jsx(BookOpen, { className: "h-3 w-3 flex-shrink-0" }), _jsxs("span", { className: "font-medium flex-shrink-0", children: ["skill", hasToolError ? ' error' : ''] }), name && !compact && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground/70 flex-shrink-0", children: "\u00B7" }), _jsx("span", { className: "text-foreground/70 truncate", children: name })] })), scope && !compact && (_jsxs("span", { className: "text-muted-foreground/80 flex-shrink-0", children: ["\u00B7 ", scope] })), timeStr && !compact && (_jsxs("span", { className: "text-muted-foreground/80 flex-shrink-0", children: ["\u00B7 ", timeStr] }))] }), isExpanded && hasToolError && errorMessage && (_jsx(ToolErrorDisplay, { error: errorMessage })), isExpanded && !hasToolError && content && (_jsxs("div", { className: "mt-2 ml-5", children: [description && (_jsx("p", { className: "text-muted-foreground mb-2 italic", children: description })), _jsx("div", { className: "bg-card/60 border border-border rounded-lg overflow-hidden max-h-96 overflow-y-auto max-w-full", children: _jsx("div", { className: "p-3 whitespace-pre-wrap font-mono text-xs leading-relaxed", children: content }) })] }))] }));
26
+ : 'text-violet-700 dark:text-violet-300'}`, children: [canExpand ? (_jsx(ChevronRight, { className: `h-3 w-3 flex-shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}` })) : (_jsx("div", { className: "w-3 flex-shrink-0" })), hasToolError && (_jsx(AlertCircle, { className: "h-3 w-3 flex-shrink-0 text-red-600 dark:text-red-400" })), isSubFile ? (_jsx(FileText, { className: "h-3 w-3 flex-shrink-0" })) : (_jsx(BookOpen, { className: "h-3 w-3 flex-shrink-0" })), _jsxs("span", { className: "font-medium flex-shrink-0", children: ["skill", hasToolError ? ' error' : ''] }), name && !compact && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground/70 flex-shrink-0", children: "\u00B7" }), _jsx("span", { className: "text-foreground/70 truncate", children: isSubFile ? description?.replace('Sub-file: ', '') : name })] })), scope && !compact && !isSubFile && (_jsxs("span", { className: "text-muted-foreground/80 flex-shrink-0", children: ["\u00B7 ", scope] })), fileCount > 0 && !compact && (_jsxs("span", { className: "text-muted-foreground/80 flex-shrink-0", children: ["\u00B7 ", fileCount, " file", fileCount !== 1 ? 's' : ''] })), noticeCount > 0 && !compact && (_jsxs("span", { className: "text-amber-600 dark:text-amber-400 flex-shrink-0 flex items-center gap-0.5", children: ["\u00B7 ", _jsx(ShieldAlert, { className: "h-3 w-3 inline" }), " ", noticeCount] })), timeStr && !compact && (_jsxs("span", { className: "text-muted-foreground/80 flex-shrink-0", children: ["\u00B7 ", timeStr] }))] }), isExpanded && hasToolError && errorMessage && (_jsx(ToolErrorDisplay, { error: errorMessage })), isExpanded && !hasToolError && (_jsxs("div", { className: "mt-2 ml-5 space-y-2", children: [noticeCount > 0 && securityNotices && (_jsxs("div", { className: "bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-lg p-2.5 space-y-1", children: [_jsxs("div", { className: "flex items-center gap-1.5 text-amber-700 dark:text-amber-300 font-medium text-[11px]", children: [_jsx(ShieldAlert, { className: "h-3 w-3" }), "Security Notice", noticeCount > 1 ? 's' : ''] }), securityNotices.map((notice, i) => (_jsxs("div", { className: "text-amber-600 dark:text-amber-400 text-[11px] leading-snug", children: [_jsx("span", { className: "font-mono bg-amber-100 dark:bg-amber-900/40 rounded px-1 py-0.5", children: notice.type }), ' ', notice.description] }, `${notice.type}-${notice.line ?? i}`)))] })), description && !isSubFile && (_jsx("p", { className: "text-muted-foreground italic", children: description })), content && (_jsx("div", { className: "bg-card/60 border border-border rounded-lg overflow-hidden max-h-96 overflow-y-auto max-w-full", children: _jsx("div", { className: "p-3 whitespace-pre-wrap font-mono text-xs leading-relaxed", children: content }) })), fileCount > 0 && availableFiles && (_jsxs("details", { className: "group", children: [_jsxs("summary", { className: "text-muted-foreground cursor-pointer hover:text-foreground/80 text-[11px] select-none", children: [fileCount, " available sub-file", fileCount !== 1 ? 's' : ''] }), _jsx("div", { className: "mt-1.5 bg-card/40 border border-border rounded-lg p-2 space-y-0.5 max-h-48 overflow-y-auto", children: availableFiles.map((f) => (_jsxs("div", { className: "flex items-center justify-between gap-2 font-mono text-[11px]", children: [_jsx("span", { className: "text-foreground/80 truncate", children: f.relativePath }), _jsx("span", { className: "text-muted-foreground/60 flex-shrink-0 tabular-nums", children: formatFileSize(f.size) })] }, f.relativePath))) })] }))] }))] }));
27
+ }
28
+ function formatFileSize(bytes) {
29
+ if (bytes < 1024)
30
+ return `${bytes}B`;
31
+ const kb = bytes / 1024;
32
+ if (kb < 1024)
33
+ return `${kb.toFixed(1)}KB`;
34
+ return `${(kb / 1024).toFixed(1)}MB`;
22
35
  }
23
36
  //# sourceMappingURL=SkillRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SkillRenderer.js","sourceRoot":"","sources":["../../../../src/components/messages/renderers/SkillRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,UAAU,aAAa,CAAC,EAC7B,WAAW,EACX,cAAc,EACd,UAAU,EACV,QAAQ,EACR,O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,IAAC,SAAS,EAAC,uBAAuB,GAAG,EAC9C,gBAAM,SAAS,EAAC,2BAA2B,sBACpC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAC5B,EACN,IAAI,IAAI,CAAC,OAAO,IAAI,CACpB,8BACC,eAAM,SAAS,EAAC,wCAAwC,uBAAS,EACjE,eAAM,SAAS,EAAC,6BAA6B,YAAE,IAAI,GAAQ,IACzD,CACH,EACA,KAAK,IAAI,CAAC,OAAO,IAAI,CACrB,gBAAM,SAAS,EAAC,wCAAwC,wBACpD,KAAK,IACF,CACP,EACA,OAAO,IAAI,CAAC,OAAO,IAAI,CACvB,gBAAM,SAAS,EAAC,wCAAwC,wBACpD,OAAO,IACJ,CACP,IACO,EACR,UAAU,IAAI,YAAY,IAAI,YAAY,IAAI,CAC9C,KAAC,gBAAgB,IAAC,KAAK,EAAE,YAAY,GAAI,CACzC,EACA,UAAU,IAAI,CAAC,YAAY,IAAI,OAAO,IAAI,CAC1C,eAAK,SAAS,EAAC,WAAW,aACxB,WAAW,IAAI,CACf,YAAG,SAAS,EAAC,mCAAmC,YAAE,WAAW,GAAK,CAClE,EACD,cAAK,SAAS,EAAC,gGAAgG,YAC9G,cAAK,SAAS,EAAC,2DAA2D,YACxE,OAAO,GACH,GACD,IACD,CACN,IACI,CACN,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"SkillRenderer.js","sourceRoot":"","sources":["../../../../src/components/messages/renderers/SkillRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EACN,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,WAAW,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAatD,MAAM,UAAU,aAAa,CAAC,EAC7B,WAAW,EACX,cAAc,EACd,UAAU,EACV,QAAQ,EACR,OAAO,GACQ;IACf,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C,CAAC,EAAE,EAAE,CAAC,CAC1B,eAEC,SAAS,EAAC,+DAA+D,aAEzE,eAAM,SAAS,EAAC,6BAA6B,YAC3C,CAAC,CAAC,YAAY,GACT,EACP,eAAM,SAAS,EAAC,qDAAqD,YACnE,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,GACjB,KARF,CAAC,CAAC,YAAY,CASd,CACN,CAAC,GACG,IACG,CACV,IACI,CACN,IACI,CACN,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACpC,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,GAAG,KAAK,GAAG,CAAC;IACrC,MAAM,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3C,OAAO,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ottocode/web-sdk",
3
- "version": "0.1.212",
3
+ "version": "0.1.213",
4
4
  "description": "Reusable React components, hooks, and utilities for building ottocode web interfaces",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -58,8 +58,8 @@
58
58
  "directory": "packages/web-sdk"
59
59
  },
60
60
  "dependencies": {
61
- "@ottocode/api": "0.1.212",
62
- "@ottocode/sdk": "0.1.212",
61
+ "@ottocode/api": "0.1.213",
62
+ "@ottocode/sdk": "0.1.213",
63
63
  "axios": "^1.7.9",
64
64
  "fuse.js": "^7.1.0",
65
65
  "ghostty-web": "^0.4.0",