@ai4b-team/fsaos-gateway-sdk 3.41.0 → 4.0.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.
- package/README.md +10 -10
- package/dist/iife/gateway.js +4 -4
- package/dist/iife/gateway.js.map +3 -3
- package/dist/iife/ui.js +1 -1
- package/dist/index.cjs +21 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.js +21 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/iife/ui.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @fsaos/ui v2.0.0 — FSAOS UI Primitives — 2026-10-
|
|
1
|
+
/* @fsaos/ui v2.0.0 — FSAOS UI Primitives — 2026-10-29T23:34:38.879Z */
|
|
2
2
|
"use strict";var __FSAOS_UI__=(()=>{var m=Object.create;var r=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var y=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports),N=(e,i)=>{for(var a in i)r(e,a,{get:i[a],enumerable:!0})},s=(e,i,a,l)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of u(i))!h.call(e,t)&&t!==a&&r(e,t,{get:()=>i[t],enumerable:!(l=g(i,t))||l.enumerable});return e};var x=(e,i,a)=>(a=e!=null?m(f(e)):{},s(i||!e||!e.__esModule?r(a,"default",{value:e,enumerable:!0}):a,e)),b=e=>s(r({},"__esModule",{value:!0}),e);var d=y((V,c)=>{c.exports=React});var P={};N(P,{Badge:()=>z,Breadcrumbs:()=>A,Button:()=>D,Card:()=>w,DataView:()=>R,Detail:()=>_,Empty:()=>I,FilePreview:()=>O,Form:()=>F,Grid:()=>k,Image:()=>G,Link:()=>E,Page:()=>v,Router:()=>T,Sidebar:()=>S,Spinner:()=>B,Stack:()=>C,Table:()=>j,Tabs:()=>W,Video:()=>H});var n=x(d(),1);function o(){return(typeof window<"u"&&window.__FSAOS_CONFIG__||{}).edgeBaseUrl||""}function v(e){return(0,n.createElement)("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column"},className:e.className||""},e.children)}function C(e){let i=e.direction||"vertical";return(0,n.createElement)("div",{style:{display:"flex",flexDirection:i==="horizontal"?"row":"column",gap:e.gap||"0.5rem",padding:e.padding||"0",alignItems:e.align||"stretch",justifyContent:e.justify||"flex-start",flex:e.flex||"initial"},className:e.className||""},e.children)}function k(e){return(0,n.createElement)("div",{style:{display:"grid",gridTemplateColumns:"repeat("+(e.columns||3)+", 1fr)",gap:e.gap||"1rem",padding:e.padding||"0"},className:e.className||""},e.children)}function S(e){return(0,n.createElement)("div",{style:{display:"flex",flexDirection:"row",minHeight:"100vh"},className:e.className||""},e.children)}function w(e){return(0,n.createElement)("div",{style:{border:"1px solid var(--color-border, #e5e7eb)",borderRadius:"var(--border-radius, 0.5rem)",padding:e.padding||"1rem",background:"var(--color-surface, #fff)"},className:e.className||"",onClick:e.onClick},e.children)}function z(e){return(0,n.createElement)("span",{style:{display:"inline-flex",alignItems:"center",padding:"0.125rem 0.5rem",fontSize:"0.75rem",fontWeight:"500",borderRadius:"9999px",background:e.color||"#e5e7eb",color:e.textColor||"#374151"},className:e.className||""},e.children||e.label)}function B(e){let i=e.size||"1.5rem";return(0,n.createElement)("div",{style:{width:i,height:i,border:"2px solid #e5e7eb",borderTopColor:"var(--color-primary, #3b82f6)",borderRadius:"50%",animation:"fsaos-spin 0.6s linear infinite"}})}function D(e){return(0,n.createElement)("button",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0.5rem 1rem",fontSize:"0.875rem",fontWeight:"500",borderRadius:"var(--border-radius, 0.375rem)",border:e.variant==="outline"?"1px solid var(--color-border, #d1d5db)":"none",background:e.variant==="outline"||e.variant==="ghost"?"transparent":"var(--color-primary, #3b82f6)",color:e.variant==="outline"||e.variant==="ghost"?"var(--color-text, #1a1a1a)":"#fff",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?"0.5":"1",gap:"0.5rem"},className:e.className||"",onClick:e.onClick,disabled:e.disabled},e.children||e.label)}function I(e){return(0,n.createElement)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"3rem",color:"var(--color-text-secondary, #6b7280)",textAlign:"center"}},e.icon?(0,n.createElement)("div",{style:{fontSize:"2rem",marginBottom:"0.5rem"}},e.icon):null,(0,n.createElement)("div",{style:{fontWeight:500,marginBottom:"0.25rem"}},e.title||e.message||e.children||"No items"),e.description?(0,n.createElement)("div",{style:{fontSize:"0.875rem",opacity:.7}},e.description):null)}function R(e){return(0,n.createElement)("div",{className:e.className||""},e.children)}function j(e){return(0,n.createElement)("table",{className:e.className||""},e.children)}function F(e){return(0,n.createElement)("form",{className:e.className||"",onSubmit:e.onSubmit},e.children)}function _(e){return(0,n.createElement)("div",{className:e.className||""},e.children)}function T(e){return(0,n.createElement)("div",null,e.children)}function E(e){return(0,n.createElement)("a",{href:e.href||e.to,className:e.className||"",onClick:e.onClick},e.children)}function W(e){return(0,n.createElement)("div",{className:e.className||""},e.children)}function A(e){return(0,n.createElement)("nav",{className:e.className||""},e.children)}function G(e){return(0,n.createElement)("img",{src:e.src||(e.path?o()+e.path:""),alt:e.alt||"",className:e.className||"",style:e.style})}function H(e){return(0,n.createElement)("video",{src:e.src||(e.path?o()+e.path:""),controls:!0,className:e.className||""})}function O(e){return(0,n.createElement)("div",{className:e.className||""},e.children||"File preview")}return b(P);})();
|
|
3
3
|
//# sourceMappingURL=ui.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -40,6 +40,7 @@ var __export = (target, all) => {
|
|
|
40
40
|
// src/index.ts
|
|
41
41
|
var src_exports = {};
|
|
42
42
|
__export(src_exports, {
|
|
43
|
+
CHANNEL_AI_MODES: () => CHANNEL_AI_MODES,
|
|
43
44
|
ComponentRenderer: () => ComponentRenderer,
|
|
44
45
|
EnforcementDeniedError: () => EnforcementDeniedError,
|
|
45
46
|
FormSubmissionError: () => FormSubmissionError,
|
|
@@ -2077,6 +2078,7 @@ function parseChannelMessages(rawItems) {
|
|
|
2077
2078
|
cognition_event_id: typeof td.cognition_event_id === "string" ? td.cognition_event_id : void 0,
|
|
2078
2079
|
seq: td.seq || 0,
|
|
2079
2080
|
principal_id: td.principal_id,
|
|
2081
|
+
member_id: typeof td.member_id === "string" ? td.member_id : void 0,
|
|
2080
2082
|
reply_count: td.reply_count || 0,
|
|
2081
2083
|
parent_message_id: td.parent_message_id,
|
|
2082
2084
|
intent_card: metadata.intent_card,
|
|
@@ -2608,9 +2610,11 @@ function watchChannels(client2, key, normalize) {
|
|
|
2608
2610
|
displayName: item.displayName,
|
|
2609
2611
|
messageCount: item.messageCount,
|
|
2610
2612
|
aiMode: item.aiMode,
|
|
2613
|
+
activeAgentIds: item.activeAgentIds,
|
|
2611
2614
|
isPrivate: item.isPrivate,
|
|
2612
2615
|
isDm: item.isDm,
|
|
2613
2616
|
autoPilot: item.autoPilot,
|
|
2617
|
+
isArchived: item.isArchived,
|
|
2614
2618
|
updatedAt: item.updatedAt
|
|
2615
2619
|
};
|
|
2616
2620
|
if (checkRename.has(id) && (previous.name !== next.name || previous.displayName !== next.displayName || previous.path !== next.path)) {
|
|
@@ -4077,9 +4081,15 @@ function useInfiniteChannelMessages(options) {
|
|
|
4077
4081
|
isFetchingNextPage: query.isFetchingNextPage ?? false
|
|
4078
4082
|
};
|
|
4079
4083
|
}
|
|
4084
|
+
var CHANNEL_AI_MODES = ["open", "active", "strict", "hand_raise"];
|
|
4080
4085
|
function normalizeAiMode(value) {
|
|
4081
|
-
if (value === "
|
|
4082
|
-
return "
|
|
4086
|
+
if (value === "open" || value === "active" || value === "strict" || value === "hand_raise") return value;
|
|
4087
|
+
if (value === "on" || value === "auto") return "active";
|
|
4088
|
+
return "strict";
|
|
4089
|
+
}
|
|
4090
|
+
function normalizeActiveAgentIds(value) {
|
|
4091
|
+
if (!Array.isArray(value)) return void 0;
|
|
4092
|
+
return value.filter((v) => typeof v === "string");
|
|
4083
4093
|
}
|
|
4084
4094
|
function normalizeChannel(raw) {
|
|
4085
4095
|
const td = raw.type_data || {};
|
|
@@ -4091,6 +4101,7 @@ function normalizeChannel(raw) {
|
|
|
4091
4101
|
name: raw.name || "",
|
|
4092
4102
|
displayName: td.display_name || raw.name || "",
|
|
4093
4103
|
aiMode: normalizeAiMode(td.ai_mode),
|
|
4104
|
+
activeAgentIds: normalizeActiveAgentIds(td.active_agent_ids),
|
|
4094
4105
|
isPrivate: td.is_private || false,
|
|
4095
4106
|
isDm: td.is_dm || false,
|
|
4096
4107
|
messageCount: td.message_count || 0,
|
|
@@ -4109,12 +4120,13 @@ function normalizeChannel(raw) {
|
|
|
4109
4120
|
memberRole: reader.member_role || "member",
|
|
4110
4121
|
memberPath: "",
|
|
4111
4122
|
modePath: "",
|
|
4112
|
-
autoPilot: td.auto_pilot || false
|
|
4123
|
+
autoPilot: td.auto_pilot || false,
|
|
4124
|
+
isArchived: td.is_archived === true
|
|
4113
4125
|
};
|
|
4114
4126
|
}
|
|
4115
4127
|
function useAllChannels(options = {}) {
|
|
4116
4128
|
const scopeKey = useScopeKey();
|
|
4117
|
-
const { realtime = true, enabled: enabled2 = true } = options;
|
|
4129
|
+
const { realtime = true, enabled: enabled2 = true, includeArchived = false } = options;
|
|
4118
4130
|
const qc = reactQuery.useQueryClient();
|
|
4119
4131
|
const stableKey = React.useMemo(() => vfsKeys.channels("all"), [scopeKey]);
|
|
4120
4132
|
const query = reactQuery.useQuery({
|
|
@@ -4134,7 +4146,10 @@ function useAllChannels(options = {}) {
|
|
|
4134
4146
|
if (!realtime || !enabled2) return;
|
|
4135
4147
|
return watchChannels(qc, stableKey, normalizeChannel);
|
|
4136
4148
|
}, [realtime, enabled2, stableKey, qc]);
|
|
4137
|
-
const channels =
|
|
4149
|
+
const channels = React.useMemo(
|
|
4150
|
+
() => (query.data ?? []).filter((c) => includeArchived || !c.isArchived),
|
|
4151
|
+
[query.data, includeArchived]
|
|
4152
|
+
);
|
|
4138
4153
|
return {
|
|
4139
4154
|
channels,
|
|
4140
4155
|
isLoading: query.isLoading,
|
|
@@ -6262,6 +6277,7 @@ Object.defineProperty(exports, "QueryClientProvider", {
|
|
|
6262
6277
|
enumerable: true,
|
|
6263
6278
|
get: function () { return reactQuery.QueryClientProvider; }
|
|
6264
6279
|
});
|
|
6280
|
+
exports.CHANNEL_AI_MODES = CHANNEL_AI_MODES;
|
|
6265
6281
|
exports.ComponentRenderer = ComponentRenderer;
|
|
6266
6282
|
exports.EnforcementDeniedError = EnforcementDeniedError;
|
|
6267
6283
|
exports.FormSubmissionError = FormSubmissionError;
|