@flamingo-stack/openframe-frontend-core 0.0.442-snapshot.20260717134227 → 0.0.442
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/{chunk-MG4AMIFX.js → chunk-2BTDPDME.js} +1 -4
- package/dist/chunk-2BTDPDME.js.map +1 -0
- package/dist/{chunk-3ZE55IH6.js → chunk-63TSTDME.js} +5 -5
- package/dist/{chunk-FQASXKBK.js → chunk-7KDR5P23.js} +2 -2
- package/dist/{chunk-RQVR7I73.js → chunk-7KNOHGMI.js} +2 -2
- package/dist/{chunk-RYKANQE6.cjs → chunk-7QP65IE4.cjs} +5 -5
- package/dist/{chunk-RYKANQE6.cjs.map → chunk-7QP65IE4.cjs.map} +1 -1
- package/dist/{chunk-LGMRNYTX.js → chunk-AGV26PUR.js} +3 -3
- package/dist/{chunk-IBIGXER5.cjs → chunk-DUQQEQ7G.cjs} +153 -191
- package/dist/chunk-DUQQEQ7G.cjs.map +1 -0
- package/dist/{chunk-A7MG4SBL.js → chunk-FPE3SQ5D.js} +3 -3
- package/dist/{chunk-6IPNXMB7.js → chunk-IAZ5AN2E.js} +6 -6
- package/dist/{chunk-ZVAAIP5Y.cjs → chunk-IPEIOR77.cjs} +40 -40
- package/dist/{chunk-ZVAAIP5Y.cjs.map → chunk-IPEIOR77.cjs.map} +1 -1
- package/dist/{chunk-KNNSS3CZ.cjs → chunk-IZ6A6K6N.cjs} +15 -15
- package/dist/{chunk-KNNSS3CZ.cjs.map → chunk-IZ6A6K6N.cjs.map} +1 -1
- package/dist/{chunk-2CJ734N2.cjs → chunk-J5NO7PAG.cjs} +3 -3
- package/dist/{chunk-2CJ734N2.cjs.map → chunk-J5NO7PAG.cjs.map} +1 -1
- package/dist/{chunk-VACXEUGF.cjs → chunk-JNC4LVD6.cjs} +29 -29
- package/dist/{chunk-VACXEUGF.cjs.map → chunk-JNC4LVD6.cjs.map} +1 -1
- package/dist/{chunk-PRJFSF4W.cjs → chunk-JOH5D76X.cjs} +73 -73
- package/dist/{chunk-PRJFSF4W.cjs.map → chunk-JOH5D76X.cjs.map} +1 -1
- package/dist/{chunk-DOVBNECK.js → chunk-JYI4R25Q.js} +3 -3
- package/dist/{chunk-OHKKI6EF.cjs → chunk-KUXGQ2FQ.cjs} +32 -32
- package/dist/{chunk-OHKKI6EF.cjs.map → chunk-KUXGQ2FQ.cjs.map} +1 -1
- package/dist/{chunk-H4W3NCR2.cjs → chunk-LFWPWIAC.cjs} +7 -7
- package/dist/{chunk-H4W3NCR2.cjs.map → chunk-LFWPWIAC.cjs.map} +1 -1
- package/dist/{chunk-YPFQ2UIH.cjs → chunk-LUKRPHEW.cjs} +73 -73
- package/dist/{chunk-YPFQ2UIH.cjs.map → chunk-LUKRPHEW.cjs.map} +1 -1
- package/dist/{chunk-UXJ47OJF.js → chunk-QAG357PE.js} +2 -2
- package/dist/{chunk-7CZ4MJSI.cjs → chunk-QO6MCQYE.cjs} +10 -13
- package/dist/chunk-QO6MCQYE.cjs.map +1 -0
- package/dist/{chunk-AZQOX2RS.js → chunk-SM26C2L7.js} +2 -2
- package/dist/{chunk-M6XUXQ5Q.cjs → chunk-TAQMYVO6.cjs} +40 -40
- package/dist/{chunk-M6XUXQ5Q.cjs.map → chunk-TAQMYVO6.cjs.map} +1 -1
- package/dist/{chunk-323TCNF3.cjs → chunk-UFBUQO7Z.cjs} +18 -18
- package/dist/{chunk-323TCNF3.cjs.map → chunk-UFBUQO7Z.cjs.map} +1 -1
- package/dist/{chunk-PVMPBWKX.js → chunk-W3JZXLJ2.js} +6 -6
- package/dist/{chunk-6NO4YYU7.cjs → chunk-XMCVUYKC.cjs} +12 -12
- package/dist/{chunk-6NO4YYU7.cjs.map → chunk-XMCVUYKC.cjs.map} +1 -1
- package/dist/{chunk-5U6OZ5FD.js → chunk-Y3NFB6HR.js} +4 -4
- package/dist/{chunk-LYYVTI34.js → chunk-YZJUHEPZ.js} +5 -5
- package/dist/{chunk-NQODKJ2F.js → chunk-ZQYFDYWV.js} +83 -121
- package/dist/{chunk-NQODKJ2F.js.map → chunk-ZQYFDYWV.js.map} +1 -1
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/faq/index.js +4 -4
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/features/policy-configuration-panel.d.ts +0 -11
- package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +135 -135
- package/dist/components/index.js +11 -11
- package/dist/components/navigation/index.cjs +3 -3
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/onboarding-guides/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.js +6 -6
- package/dist/components/related-content/index.cjs +5 -5
- package/dist/components/related-content/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/hooks/index.cjs +2 -2
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/dist/types/permissions.d.ts +6 -9
- package/dist/types/permissions.d.ts.map +1 -1
- package/dist/utils/embed-authed-fetch.d.ts +3 -19
- package/dist/utils/embed-authed-fetch.d.ts.map +1 -1
- package/dist/utils/index.cjs +0 -3
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +0 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/features/policy-configuration-panel.tsx +122 -185
- package/src/types/permissions.ts +7 -10
- package/src/utils/__tests__/embed-authed-fetch.test.ts +0 -39
- package/src/utils/embed-authed-fetch.ts +3 -27
- package/dist/chunk-7CZ4MJSI.cjs.map +0 -1
- package/dist/chunk-IBIGXER5.cjs.map +0 -1
- package/dist/chunk-MG4AMIFX.js.map +0 -1
- package/src/stories/PolicyConfigurationPanel.stories.tsx +0 -254
- /package/dist/{chunk-3ZE55IH6.js.map → chunk-63TSTDME.js.map} +0 -0
- /package/dist/{chunk-FQASXKBK.js.map → chunk-7KDR5P23.js.map} +0 -0
- /package/dist/{chunk-RQVR7I73.js.map → chunk-7KNOHGMI.js.map} +0 -0
- /package/dist/{chunk-LGMRNYTX.js.map → chunk-AGV26PUR.js.map} +0 -0
- /package/dist/{chunk-A7MG4SBL.js.map → chunk-FPE3SQ5D.js.map} +0 -0
- /package/dist/{chunk-6IPNXMB7.js.map → chunk-IAZ5AN2E.js.map} +0 -0
- /package/dist/{chunk-DOVBNECK.js.map → chunk-JYI4R25Q.js.map} +0 -0
- /package/dist/{chunk-UXJ47OJF.js.map → chunk-QAG357PE.js.map} +0 -0
- /package/dist/{chunk-AZQOX2RS.js.map → chunk-SM26C2L7.js.map} +0 -0
- /package/dist/{chunk-PVMPBWKX.js.map → chunk-W3JZXLJ2.js.map} +0 -0
- /package/dist/{chunk-5U6OZ5FD.js.map → chunk-Y3NFB6HR.js.map} +0 -0
- /package/dist/{chunk-LYYVTI34.js.map → chunk-YZJUHEPZ.js.map} +0 -0
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
|
2
|
-
import { useState } from 'react'
|
|
3
|
-
import { fn } from 'storybook/test'
|
|
4
|
-
import { PolicyConfigurationPanel } from '../components/features/policy-configuration-panel'
|
|
5
|
-
import type { ApprovalLevel, PermissionCategory } from '../types/permissions'
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'Features/PolicyConfigurationPanel',
|
|
9
|
-
component: PolicyConfigurationPanel,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'padded',
|
|
12
|
-
docs: {
|
|
13
|
-
description: {
|
|
14
|
-
component:
|
|
15
|
-
'Grouped list of AI guardrails permission categories with per-policy approval dropdowns. ' +
|
|
16
|
-
'Categories are pure data — the panel owns its presentation state internally: which categories ' +
|
|
17
|
-
'are expanded and the last bulk level picked per category (bulk selections reset when `editMode` ' +
|
|
18
|
-
'changes). In edit mode each category header offers a bulk "global permission" dropdown that ' +
|
|
19
|
-
'fires `onCategoryPermissionChange`; each policy row fires `onPolicyPermissionChange`. ' +
|
|
20
|
-
'Used by the OpenFrame AI Settings → Guardrails tab.',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
tags: ['autodocs'],
|
|
25
|
-
argTypes: {
|
|
26
|
-
editMode: { control: 'boolean' },
|
|
27
|
-
},
|
|
28
|
-
decorators: [
|
|
29
|
-
(Story) => (
|
|
30
|
-
<div style={{ maxWidth: '960px' }}>
|
|
31
|
-
<Story />
|
|
32
|
-
</div>
|
|
33
|
-
),
|
|
34
|
-
],
|
|
35
|
-
} satisfies Meta<typeof PolicyConfigurationPanel>
|
|
36
|
-
|
|
37
|
-
export default meta
|
|
38
|
-
type Story = StoryObj<typeof meta>
|
|
39
|
-
|
|
40
|
-
const deviceCategories: PermissionCategory[] = [
|
|
41
|
-
{
|
|
42
|
-
id: 'device-actions',
|
|
43
|
-
name: 'Device Actions',
|
|
44
|
-
policies: [
|
|
45
|
-
{
|
|
46
|
-
id: 'OPENFRAME_RMM:DEVICE_REBOOT',
|
|
47
|
-
naturalKey: 'OPENFRAME_RMM:DEVICE_REBOOT',
|
|
48
|
-
name: 'Reboot Device',
|
|
49
|
-
commandPattern: 'device.reboot --id {deviceId}',
|
|
50
|
-
toolName: 'OPENFRAME_RMM',
|
|
51
|
-
approvalLevel: 'ASK_USER',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'FLEET_MDM:DEVICE_LOCK',
|
|
55
|
-
naturalKey: 'FLEET_MDM:DEVICE_LOCK',
|
|
56
|
-
name: 'Lock Device',
|
|
57
|
-
commandPattern: 'fleet mdm lock --host {hostId}',
|
|
58
|
-
toolName: 'FLEET_MDM',
|
|
59
|
-
approvalLevel: 'ASK_TECHNICIAN',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: 'FLEET_MDM:DEVICE_WIPE',
|
|
63
|
-
naturalKey: 'FLEET_MDM:DEVICE_WIPE',
|
|
64
|
-
name: 'Wipe Device',
|
|
65
|
-
commandPattern: 'fleet mdm wipe --host {hostId}',
|
|
66
|
-
toolName: 'FLEET_MDM',
|
|
67
|
-
approvalLevel: 'DENY',
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: 'remote-access',
|
|
73
|
-
name: 'Remote Access',
|
|
74
|
-
policies: [
|
|
75
|
-
{
|
|
76
|
-
id: 'MESHCENTRAL:REMOTE_SHELL',
|
|
77
|
-
naturalKey: 'MESHCENTRAL:REMOTE_SHELL',
|
|
78
|
-
name: 'Open Remote Shell',
|
|
79
|
-
commandPattern: 'mesh.shell --node {nodeId}',
|
|
80
|
-
toolName: 'MESHCENTRAL',
|
|
81
|
-
approvalLevel: 'ASK_TECHNICIAN',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: 'MESHCENTRAL:FILE_TRANSFER',
|
|
85
|
-
naturalKey: 'MESHCENTRAL:FILE_TRANSFER',
|
|
86
|
-
name: 'Transfer Files',
|
|
87
|
-
commandPattern: 'mesh.files --node {nodeId} --upload|--download',
|
|
88
|
-
toolName: 'MESHCENTRAL',
|
|
89
|
-
approvalLevel: 'DENY',
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: 'scripts-automation',
|
|
95
|
-
name: 'Scripts & Automation',
|
|
96
|
-
policies: [
|
|
97
|
-
{
|
|
98
|
-
id: 'OPENFRAME_RMM:RUN_POWERSHELL',
|
|
99
|
-
naturalKey: 'OPENFRAME_RMM:RUN_POWERSHELL',
|
|
100
|
-
name: 'Run PowerShell Script',
|
|
101
|
-
commandPattern: 'powershell -ExecutionPolicy Bypass -File {script}',
|
|
102
|
-
toolName: 'OPENFRAME_RMM',
|
|
103
|
-
approvalLevel: 'ASK_USER',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
id: 'OPENFRAME_RMM:RUN_BASH',
|
|
107
|
-
naturalKey: 'OPENFRAME_RMM:RUN_BASH',
|
|
108
|
-
name: 'Run Bash Script',
|
|
109
|
-
commandPattern: 'bash -c {script}',
|
|
110
|
-
toolName: 'OPENFRAME_RMM',
|
|
111
|
-
approvalLevel: 'ASK_USER',
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
},
|
|
115
|
-
]
|
|
116
|
-
|
|
117
|
-
const dataCategories: PermissionCategory[] = [
|
|
118
|
-
{
|
|
119
|
-
id: 'data-read',
|
|
120
|
-
name: 'Read Access',
|
|
121
|
-
policies: [
|
|
122
|
-
{
|
|
123
|
-
id: 'OSQUERY:QUERY_INVENTORY',
|
|
124
|
-
naturalKey: 'OSQUERY:QUERY_INVENTORY',
|
|
125
|
-
name: 'Query Device Inventory',
|
|
126
|
-
commandPattern: 'SELECT * FROM system_info;',
|
|
127
|
-
toolName: 'OSQUERY',
|
|
128
|
-
approvalLevel: 'ALLOW',
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: 'SYSTEM:READ_LOGS',
|
|
132
|
-
naturalKey: 'SYSTEM:READ_LOGS',
|
|
133
|
-
name: 'Read System Logs',
|
|
134
|
-
commandPattern: 'logs.read --stream {stream} --since {ts}',
|
|
135
|
-
toolName: 'SYSTEM',
|
|
136
|
-
approvalLevel: 'ALLOW',
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
},
|
|
140
|
-
]
|
|
141
|
-
|
|
142
|
-
/** Applies a level to one policy; mirrors what the guardrails editor hook does. */
|
|
143
|
-
const applyPolicyLevel = (
|
|
144
|
-
categories: PermissionCategory[],
|
|
145
|
-
categoryId: string,
|
|
146
|
-
policyId: string,
|
|
147
|
-
level: ApprovalLevel,
|
|
148
|
-
): PermissionCategory[] =>
|
|
149
|
-
categories.map(category =>
|
|
150
|
-
category.id !== categoryId
|
|
151
|
-
? category
|
|
152
|
-
: {
|
|
153
|
-
...category,
|
|
154
|
-
policies: category.policies.map(policy =>
|
|
155
|
-
policy.id === policyId ? { ...policy, approvalLevel: level } : policy,
|
|
156
|
-
),
|
|
157
|
-
},
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
/** Bulk-applies a level to every policy in a category. */
|
|
161
|
-
const applyCategoryLevel = (
|
|
162
|
-
categories: PermissionCategory[],
|
|
163
|
-
categoryId: string,
|
|
164
|
-
level: ApprovalLevel,
|
|
165
|
-
): PermissionCategory[] =>
|
|
166
|
-
categories.map(category =>
|
|
167
|
-
category.id !== categoryId
|
|
168
|
-
? category
|
|
169
|
-
: { ...category, policies: category.policies.map(policy => ({ ...policy, approvalLevel: level })) },
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
/** Read-only view: approval levels render as text, no bulk dropdowns. */
|
|
173
|
-
export const ReadOnly: Story = {
|
|
174
|
-
args: {
|
|
175
|
-
categories: deviceCategories,
|
|
176
|
-
editMode: false,
|
|
177
|
-
onPolicyPermissionChange: fn(),
|
|
178
|
-
onCategoryPermissionChange: fn(),
|
|
179
|
-
},
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Interactive edit mode: per-policy dropdowns plus a bulk "global permission"
|
|
184
|
-
* dropdown per category header. The wrapper applies changes back into the
|
|
185
|
-
* category data the same way the OpenFrame guardrails editor does.
|
|
186
|
-
*/
|
|
187
|
-
export const EditMode: Story = {
|
|
188
|
-
args: {
|
|
189
|
-
categories: deviceCategories,
|
|
190
|
-
editMode: true,
|
|
191
|
-
onPolicyPermissionChange: fn(),
|
|
192
|
-
onCategoryPermissionChange: fn(),
|
|
193
|
-
},
|
|
194
|
-
render: args => {
|
|
195
|
-
const [categories, setCategories] = useState(args.categories)
|
|
196
|
-
|
|
197
|
-
return (
|
|
198
|
-
<PolicyConfigurationPanel
|
|
199
|
-
{...args}
|
|
200
|
-
categories={categories}
|
|
201
|
-
onPolicyPermissionChange={(categoryId, policyId, level) => {
|
|
202
|
-
args.onPolicyPermissionChange(categoryId, policyId, level)
|
|
203
|
-
setCategories(prev => applyPolicyLevel(prev, categoryId, policyId, level))
|
|
204
|
-
}}
|
|
205
|
-
onCategoryPermissionChange={(categoryId, level) => {
|
|
206
|
-
args.onCategoryPermissionChange(categoryId, level)
|
|
207
|
-
setCategories(prev => applyCategoryLevel(prev, categoryId, level))
|
|
208
|
-
}}
|
|
209
|
-
/>
|
|
210
|
-
)
|
|
211
|
-
},
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* How the guardrails tab composes the panel: one panel per policy group, each
|
|
216
|
-
* under a small secondary heading.
|
|
217
|
-
*/
|
|
218
|
-
export const GroupedPolicySections: Story = {
|
|
219
|
-
args: {
|
|
220
|
-
categories: deviceCategories,
|
|
221
|
-
editMode: true,
|
|
222
|
-
onPolicyPermissionChange: fn(),
|
|
223
|
-
onCategoryPermissionChange: fn(),
|
|
224
|
-
},
|
|
225
|
-
render: args => {
|
|
226
|
-
const [groups, setGroups] = useState<Record<string, PermissionCategory[]>>({
|
|
227
|
-
'Device Management': deviceCategories,
|
|
228
|
-
'Data Access': dataCategories,
|
|
229
|
-
})
|
|
230
|
-
|
|
231
|
-
const updateGroup = (groupName: string, next: (categories: PermissionCategory[]) => PermissionCategory[]) =>
|
|
232
|
-
setGroups(prev => ({ ...prev, [groupName]: next(prev[groupName]) }))
|
|
233
|
-
|
|
234
|
-
return (
|
|
235
|
-
<div className="flex flex-col gap-[var(--spacing-system-l)]">
|
|
236
|
-
{Object.entries(groups).map(([groupName, categories]) => (
|
|
237
|
-
<div key={groupName} className="flex flex-col gap-[var(--spacing-system-xxs)]">
|
|
238
|
-
<p className="text-h5 text-ods-text-secondary truncate">{groupName}</p>
|
|
239
|
-
<PolicyConfigurationPanel
|
|
240
|
-
categories={categories}
|
|
241
|
-
editMode={args.editMode}
|
|
242
|
-
onPolicyPermissionChange={(categoryId, policyId, level) =>
|
|
243
|
-
updateGroup(groupName, categories => applyPolicyLevel(categories, categoryId, policyId, level))
|
|
244
|
-
}
|
|
245
|
-
onCategoryPermissionChange={(categoryId, level) =>
|
|
246
|
-
updateGroup(groupName, categories => applyCategoryLevel(categories, categoryId, level))
|
|
247
|
-
}
|
|
248
|
-
/>
|
|
249
|
-
</div>
|
|
250
|
-
))}
|
|
251
|
-
</div>
|
|
252
|
-
)
|
|
253
|
-
},
|
|
254
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|