@pickaxeproject/react 6.19.0-beta.0 → 6.20.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/dist/cjs/components/Core/Modal/Body.js +1 -1
- package/dist/cjs/components/Core/Modal/CloseButton.js +1 -0
- package/dist/cjs/components/Icons/terminal.svg.js +1 -0
- package/dist/cjs/components/Pickaxe/Addons/Auth/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/Questions/Submit.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/Questions/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/ResponseProvider.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeEmbedHead.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMCPButton.js +1 -0
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/index.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js +1 -1
- package/dist/cjs/node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js +1 -1
- package/dist/cjs/node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js +1 -1
- package/dist/cjs/node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js +1 -1
- package/dist/cjs/src/components/Core/Modal/Body.d.ts +2 -0
- package/dist/cjs/src/components/Pickaxe/Addons/Auth/Provider.d.ts +2 -1
- package/dist/cjs/src/components/Pickaxe/Form/Questions/Submit.d.ts +1 -5
- package/dist/cjs/src/components/Pickaxe/Provider.d.ts +5 -3
- package/dist/cjs/src/components/Pickaxe/ResponseProvider.d.ts +0 -3
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMCPButton.d.ts +2 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMessageParts/index.d.ts +1 -4
- package/dist/cjs/src/hooks/pickaxe/usePickaxeContext.d.ts +1 -2
- package/dist/cjs/src/hooks/pickaxe/useResponseContext.d.ts +0 -10
- package/dist/cjs/src/index.d.ts +0 -2
- package/dist/cjs/src/types/form.d.ts +0 -2
- package/dist/cjs/src/types/history.d.ts +2 -7
- package/dist/cjs/src/types/pickaxe.d.ts +0 -18
- package/dist/esm/components/Core/Modal/Body.js +1 -1
- package/dist/esm/components/Core/Modal/CloseButton.js +1 -0
- package/dist/esm/components/Icons/terminal.svg.js +1 -0
- package/dist/esm/components/Pickaxe/Addons/Auth/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/index.js +1 -1
- package/dist/esm/components/Pickaxe/Form/Questions/Submit.js +1 -1
- package/dist/esm/components/Pickaxe/Form/Questions/index.js +1 -1
- package/dist/esm/components/Pickaxe/Form/index.js +1 -1
- package/dist/esm/components/Pickaxe/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/ResponseProvider.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeEmbedHead.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMCPButton.js +1 -0
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js +1 -1
- package/dist/esm/node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js +1 -1
- package/dist/esm/node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js +1 -1
- package/dist/esm/node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js +1 -1
- package/dist/esm/src/components/Core/Modal/Body.d.ts +2 -0
- package/dist/esm/src/components/Pickaxe/Addons/Auth/Provider.d.ts +2 -1
- package/dist/esm/src/components/Pickaxe/Form/Questions/Submit.d.ts +1 -5
- package/dist/esm/src/components/Pickaxe/Provider.d.ts +5 -3
- package/dist/esm/src/components/Pickaxe/ResponseProvider.d.ts +0 -3
- package/dist/esm/src/components/Pickaxe/common/PickaxeMCPButton.d.ts +2 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeMessageParts/index.d.ts +1 -4
- package/dist/esm/src/hooks/pickaxe/usePickaxeContext.d.ts +1 -2
- package/dist/esm/src/hooks/pickaxe/useResponseContext.d.ts +0 -10
- package/dist/esm/src/index.d.ts +0 -2
- package/dist/esm/src/types/form.d.ts +0 -2
- package/dist/esm/src/types/history.d.ts +2 -7
- package/dist/esm/src/types/pickaxe.d.ts +0 -18
- package/package.json +206 -207
- package/dist/cjs/common/actionApproval.js +0 -1
- package/dist/cjs/common/formInputOrder.js +0 -1
- package/dist/cjs/common/formQuestionValidation.js +0 -1
- package/dist/cjs/components/Pickaxe/common/EndUserModelPicker.js +0 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/ActionApprovalPart.js +0 -1
- package/dist/cjs/hooks/pickaxe/useActionApprovals.js +0 -1
- package/dist/cjs/hooks/pickaxe/useEndUserModel.js +0 -1
- package/dist/cjs/src/common/actionApproval.d.ts +0 -16
- package/dist/cjs/src/common/formInputOrder.d.ts +0 -4
- package/dist/cjs/src/common/formQuestionValidation.d.ts +0 -2
- package/dist/cjs/src/components/Pickaxe/common/EndUserModelPicker.d.ts +0 -3
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMessageParts/ActionApprovalPart.d.ts +0 -6
- package/dist/cjs/src/hooks/pickaxe/useActionApprovals.d.ts +0 -10
- package/dist/cjs/src/hooks/pickaxe/useEndUserModel.d.ts +0 -10
- package/dist/esm/common/actionApproval.js +0 -1
- package/dist/esm/common/formInputOrder.js +0 -1
- package/dist/esm/common/formQuestionValidation.js +0 -1
- package/dist/esm/components/Pickaxe/common/EndUserModelPicker.js +0 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/ActionApprovalPart.js +0 -1
- package/dist/esm/hooks/pickaxe/useActionApprovals.js +0 -1
- package/dist/esm/hooks/pickaxe/useEndUserModel.js +0 -1
- package/dist/esm/src/common/actionApproval.d.ts +0 -16
- package/dist/esm/src/common/formInputOrder.d.ts +0 -4
- package/dist/esm/src/common/formQuestionValidation.d.ts +0 -2
- package/dist/esm/src/components/Pickaxe/common/EndUserModelPicker.d.ts +0 -3
- package/dist/esm/src/components/Pickaxe/common/PickaxeMessageParts/ActionApprovalPart.d.ts +0 -6
- package/dist/esm/src/hooks/pickaxe/useActionApprovals.d.ts +0 -10
- package/dist/esm/src/hooks/pickaxe/useEndUserModel.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,208 +1,207 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
2
|
+
"name": "@pickaxeproject/react",
|
|
3
|
+
"version": "6.20.0",
|
|
4
|
+
"description": "Client utility library for Pickaxe",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/pickaxeproject/v2-pickaxe-react.git"
|
|
8
|
+
},
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/esm/index.js",
|
|
13
|
+
"require": "./dist/cjs/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./embed": {
|
|
16
|
+
"import": "./dist/esm/embed/index.js",
|
|
17
|
+
"require": "./dist/cjs/embed/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./prose.css": "./dist/esm/prose.css"
|
|
20
|
+
},
|
|
21
|
+
"main": "dist/cjs/index.js",
|
|
22
|
+
"module": "dist/esm/index.js",
|
|
23
|
+
"types": "dist/esm/src/index.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"browserslist": [
|
|
28
|
+
"> 1%",
|
|
29
|
+
"not dead",
|
|
30
|
+
"not edge <= 18",
|
|
31
|
+
"not ie 11",
|
|
32
|
+
"not op_mini all"
|
|
33
|
+
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@babel/runtime": "^7.20.7",
|
|
36
|
+
"@modelcontextprotocol/sdk": "1.20.2",
|
|
37
|
+
"@radix-ui/react-avatar": "^1.1.11",
|
|
38
|
+
"franc-min": "^6.2.0",
|
|
39
|
+
"jose": "^6.1.3",
|
|
40
|
+
"lucide-react": "^0.563.0",
|
|
41
|
+
"pkce-challenge": "3.0.0",
|
|
42
|
+
"remove-markdown": "^0.6.3",
|
|
43
|
+
"tldts": "^7.0.23"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@babel/core": "^7.20.12",
|
|
47
|
+
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
48
|
+
"@babel/preset-env": "^7.20.2",
|
|
49
|
+
"@babel/preset-react": "^7.18.6",
|
|
50
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
51
|
+
"@changesets/cli": "^2.26.0",
|
|
52
|
+
"@chromatic-com/storybook": "3.2.3",
|
|
53
|
+
"@mdx-js/react": "^3.1.0",
|
|
54
|
+
"@nem035/gpt-3-encoder": "^1.1.7",
|
|
55
|
+
"@prettier/plugin-xml": "^3.4.1",
|
|
56
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
57
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
58
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
59
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
60
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
61
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
62
|
+
"@rollup/plugin-terser": "^0.3.0",
|
|
63
|
+
"@storybook/addon-a11y": "^8.5.3",
|
|
64
|
+
"@storybook/addon-docs": "^8.5.3",
|
|
65
|
+
"@storybook/addon-essentials": "^8.5.3",
|
|
66
|
+
"@storybook/addon-interactions": "^8.5.3",
|
|
67
|
+
"@storybook/addon-links": "^8.5.3",
|
|
68
|
+
"@storybook/addon-themes": "^8.5.3",
|
|
69
|
+
"@storybook/blocks": "^8.5.3",
|
|
70
|
+
"@storybook/react": "^8.5.3",
|
|
71
|
+
"@storybook/react-vite": "^8.5.3",
|
|
72
|
+
"@storybook/test": "^8.5.3",
|
|
73
|
+
"@stripe/react-stripe-js": "^4.0.2",
|
|
74
|
+
"@stripe/stripe-js": "^7.9.0",
|
|
75
|
+
"@svgr/rollup": "^8.1.0",
|
|
76
|
+
"@tailwindcss/container-queries": "^0.1.1",
|
|
77
|
+
"@tanstack/react-query": "^4.36.1",
|
|
78
|
+
"@types/hast": "^3.0.4",
|
|
79
|
+
"@types/katex": "^0.16.7",
|
|
80
|
+
"@types/node": "^18.11.18",
|
|
81
|
+
"@types/react": "^18.0.26",
|
|
82
|
+
"@types/react-dom": "^18.0.10",
|
|
83
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
84
|
+
"@types/uuid": "^10.0.0",
|
|
85
|
+
"@types/webfontloader": "^1.6.38",
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
|
87
|
+
"@typescript-eslint/parser": "^5.48.1",
|
|
88
|
+
"@zerollup/ts-transform-paths": "^1.7.18",
|
|
89
|
+
"autoprefixer": "^10.4.20",
|
|
90
|
+
"axios": "^1.7.9",
|
|
91
|
+
"babel-loader": "^9.1.2",
|
|
92
|
+
"clsx": "^2.1.1",
|
|
93
|
+
"copy-to-clipboard": "^3.3.3",
|
|
94
|
+
"cross-env": "^7.0.3",
|
|
95
|
+
"csv-to-markdown-table": "^1.5.0",
|
|
96
|
+
"date-fns": "^3.6.0",
|
|
97
|
+
"docx": "^9.5.1",
|
|
98
|
+
"eslint": "8.31.0",
|
|
99
|
+
"eslint-config-prettier": "^8.6.0",
|
|
100
|
+
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
101
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
102
|
+
"eslint-plugin-react": "^7.32.0",
|
|
103
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
104
|
+
"eslint-plugin-storybook": "^0.11.2",
|
|
105
|
+
"eventsource-parser": "^3.0.2",
|
|
106
|
+
"file-saver": "^2.0.5",
|
|
107
|
+
"framer-motion": "^11.17.0",
|
|
108
|
+
"husky": "^8.0.3",
|
|
109
|
+
"isomorphic-dompurify": "^2.20.0",
|
|
110
|
+
"katex": "^0.16.19",
|
|
111
|
+
"lottie-react": "^2.4.0",
|
|
112
|
+
"mermaid": "^11.7.0",
|
|
113
|
+
"microsoft-cognitiveservices-speech-sdk": "^1.48.0",
|
|
114
|
+
"postcss": "^8.4.49",
|
|
115
|
+
"prettier": "^3.5.3",
|
|
116
|
+
"prismjs": "^1.29.0",
|
|
117
|
+
"react": "^18.2.0",
|
|
118
|
+
"react-dom": "^18.2.0",
|
|
119
|
+
"react-intersection-observer": "^9.14.1",
|
|
120
|
+
"react-markdown": "^9.0.3",
|
|
121
|
+
"react-resizable-panels": "^3.0.3",
|
|
122
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
123
|
+
"react-textarea-autosize": "^8.5.9",
|
|
124
|
+
"react-to-print": "^3.1.1",
|
|
125
|
+
"react-tooltip": "^5.28.0",
|
|
126
|
+
"react-virtualized-auto-sizer": "^1.0.25",
|
|
127
|
+
"rehype-katex": "^7.0.1",
|
|
128
|
+
"rehype-raw": "^7.0.0",
|
|
129
|
+
"remark-gfm": "^4.0.0",
|
|
130
|
+
"remark-math": "^6.0.0",
|
|
131
|
+
"rollup": "^2.79.1",
|
|
132
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
133
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
134
|
+
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
135
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
136
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
137
|
+
"storybook": "^8.5.3",
|
|
138
|
+
"tailwind-merge": "^2.6.0",
|
|
139
|
+
"tailwind-scrollbar": "^3.1.0",
|
|
140
|
+
"tailwindcss": "^3.4.17",
|
|
141
|
+
"tslib": "^2.4.1",
|
|
142
|
+
"ttypescript": "^1.5.15",
|
|
143
|
+
"typescript": "^4.9.4",
|
|
144
|
+
"typescript-transform-paths": "^3.4.6",
|
|
145
|
+
"unist-util-visit": "^5.0.0",
|
|
146
|
+
"uuid": "^11.1.0",
|
|
147
|
+
"vite": "^6.0.7",
|
|
148
|
+
"vite-plugin-node-polyfills": "^0.24.0",
|
|
149
|
+
"vite-plugin-svgr": "^4.3.0",
|
|
150
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
151
|
+
"webfontloader": "^1.6.28",
|
|
152
|
+
"webpack": "^5.75.0",
|
|
153
|
+
"webpack-cli": "^5.0.1"
|
|
154
|
+
},
|
|
155
|
+
"peerDependencies": {
|
|
156
|
+
"@nem035/gpt-3-encoder": "^1.1.7",
|
|
157
|
+
"@tailwindcss/container-queries": "^0.1.1",
|
|
158
|
+
"@tanstack/react-query": "^4.36.1",
|
|
159
|
+
"axios": "^1.7.9",
|
|
160
|
+
"clsx": "^2.1.1",
|
|
161
|
+
"copy-to-clipboard": "^3.3.3",
|
|
162
|
+
"csv-to-markdown-table": "^1.5.0",
|
|
163
|
+
"date-fns": "^3.6.0",
|
|
164
|
+
"docx": "^9.5.1",
|
|
165
|
+
"eventsource-parser": "^3.0.2",
|
|
166
|
+
"file-saver": "^2.0.5",
|
|
167
|
+
"framer-motion": "^11.17.0",
|
|
168
|
+
"isomorphic-dompurify": "^2.20.0",
|
|
169
|
+
"katex": "^0.16.19",
|
|
170
|
+
"lottie-react": "^2.4.0",
|
|
171
|
+
"microsoft-cognitiveservices-speech-sdk": "^1.48.0",
|
|
172
|
+
"prismjs": "^1.29.0",
|
|
173
|
+
"react": "^16.8.0 || ^17 || ^18",
|
|
174
|
+
"react-dom": "^16.8.0 || ^17 || ^18",
|
|
175
|
+
"react-intersection-observer": "^9.14.1",
|
|
176
|
+
"react-markdown": "^9.0.3",
|
|
177
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
178
|
+
"react-textarea-autosize": "^8.5.9",
|
|
179
|
+
"react-to-print": "^3.1.1",
|
|
180
|
+
"react-tooltip": "^5.28.0",
|
|
181
|
+
"react-virtualized-auto-sizer": "^1.0.25",
|
|
182
|
+
"rehype-katex": "^7.0.1",
|
|
183
|
+
"rehype-raw": "^7.0.0",
|
|
184
|
+
"remark-gfm": "^4.0.0",
|
|
185
|
+
"remark-math": "^6.0.0",
|
|
186
|
+
"tailwind-merge": "^2.6.0",
|
|
187
|
+
"tailwind-scrollbar": "^3.1.0",
|
|
188
|
+
"unist-util-visit": "^5.0.0",
|
|
189
|
+
"uuid": "^11.1.0",
|
|
190
|
+
"webfontloader": "^1.6.28"
|
|
191
|
+
},
|
|
192
|
+
"engines": {
|
|
193
|
+
"node": ">=18"
|
|
194
|
+
},
|
|
195
|
+
"scripts": {
|
|
196
|
+
"build": "cross-env NODE_ENV=production rollup -c",
|
|
197
|
+
"lint": "eslint . --ext .ts,.tsx,.js,.jsx",
|
|
198
|
+
"lint:format": "prettier --check src/**/*",
|
|
199
|
+
"lint:staged": "pnpm run lint && pnpm run lint:format",
|
|
200
|
+
"format": "prettier --write .",
|
|
201
|
+
"changeset": "changeset",
|
|
202
|
+
"release": "changeset publish",
|
|
203
|
+
"dev": "storybook dev -p 6006",
|
|
204
|
+
"storybook": "storybook dev -p 6006",
|
|
205
|
+
"build-storybook": "storybook build"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function t(t){try{const e=JSON.parse(t);return e&&"string"==typeof e.id&&"string"==typeof e.name&&"string"==typeof e.pickaxeId&&"number"==typeof e.expiresAt&&["action","mcp"].includes(e.kind)&&["pending","approved","declined","expired","cancelled"].includes(e.status)&&(void 0===e.arguments||"string"==typeof e.arguments)?e:null}catch(t){return null}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseActionApproval=t,exports.updateStreamTextPart=function(t,e,n){for(let r=t.length-1;r>=0;r--)if(t[r].type===e)return void(t[r].content=n)},exports.upsertActionApprovalPart=function(e,n){const r=e.findIndex((e=>{var r;return"data-action-approval"===e.type&&(null===(r=t(e.content))||void 0===r?void 0:r.id)===n.id})),i={type:"data-action-approval",content:JSON.stringify(n),isVisible:!0};r<0?e.push(i):e[r]=i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sortFormInputs=function(r){const e=r=>"number"==typeof r.order&&Number.isFinite(r.order)&&r.order>=0?r.order:1/0;return[...r].sort(((r,o)=>e(r)-e(o)))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@nem035/gpt-3-encoder");exports.getFormQuestionError=function(t){return"Knowledge Upload"===t.type||"userinput:documentupload"===t.id?null:!["Multiple Choice","Checkbox"].includes(t.type)&&e.encode(t.input).length>t.maxLength?"response-too-long":t.isRequired&&!t.input.trim()?"required-fields-missing":null};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),o=require("../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../hooks/pickaxe/useEndUserModel.js"),i=require("../../../hooks/pickaxe/useResponseContext.js"),s=require("../../../hooks/studio/useStyleInput.js"),r=require("../../Core/Menu/index.js"),l=require("../../Core/Menu/List.js");function a({compact:a}){var d,u,c,p,x,m,b,f;const{options:g,value:v,setValue:h,defaultModel:w}=t.useEndUserModel(),{translations:y,styles:j,colors:k}=o.usePickaxeContext(),{isGenerating:C}=i.useResponseContext(),{id:O,isOpen:q,setIsOpen:D}=n.useContext(r.MenuContext),E=s.useStyleInput(),I=null!==(d=null==y?void 0:y["ai-model"])&&void 0!==d?d:"AI model",A=null!==(p=null!==(c=null===(u=g.find((e=>e.id===w)))||void 0===u?void 0:u.label)&&void 0!==c?c:w)&&void 0!==p?p:"",M=a?A:(null!==(x=null==y?void 0:y["default-ai-model"])&&void 0!==x?x:"Default ({model})").replace("{model}",A),N=[{id:"",label:M},...g.filter((e=>e.id!==w))],R=null!==(b=null===(m=N.find((e=>e.id===v)))||void 0===m?void 0:m.label)&&void 0!==b?b:M,S=()=>{var e;D(!1),null===(e=document.getElementById(O))||void 0===e||e.focus()};return e.jsxs(e.Fragment,{children:[!a&&e.jsx("span",{children:I}),e.jsxs("button",Object.assign({id:O,type:"button","aria-label":I,"aria-haspopup":"menu","aria-expanded":q,"aria-controls":`${O}-options`,disabled:C,className:a?"flex min-w-0 max-w-full items-center gap-1 rounded-lg border-0 bg-transparent px-1 py-2 text-xs outline-none focus:ring-0 focus-visible:underline disabled:cursor-not-allowed disabled:opacity-50":"flex min-w-0 max-w-full items-center gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm outline-none focus:ring-0 focus-visible:underline disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>D(!q),onKeyDown:e=>{"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),D(!0)),"Escape"===e.key&&S()}},{children:[e.jsx("span",Object.assign({className:"truncate"},{children:R})),e.jsx("svg",Object.assign({"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-3.5 w-3.5 shrink-0"},{children:e.jsx("path",{d:"m6 9 6 6 6-6",strokeLinecap:"round",strokeLinejoin:"round"})}))]})),e.jsx(l.default,Object.assign({align:a?"top-end":"bottom-end",width:"auto",maxHeight:"min(200px, calc(100dvh - 96px))",className:"min-w-0 overflow-x-hidden p-3 shadow-md",border:"#ffffff"===k.secondaryText.toLowerCase()?"1px solid rgba(255,255,255,0.7)":"1px solid rgba(0,0,0,0.7)",style:Object.assign(Object.assign({},E),{backgroundColor:E.backgroundColor&&"transparent"!==E.backgroundColor?E.backgroundColor:k.primary,color:null!==(f=E.color)&&void 0!==f?f:k.text,borderRadius:j.cornerRadius,maxWidth:"min(360px, calc(100vw - 32px))",minWidth:"min(200px, calc(100vw - 32px))"}),afterShow:()=>{var e,n;return null===(n=null===(e=document.getElementById(`${O}-options`))||void 0===e?void 0:e.querySelector('[aria-checked="true"]'))||void 0===n?void 0:n.focus()}},{children:e.jsx("div",Object.assign({id:`${O}-options`,role:"menu",tabIndex:-1,"aria-label":I,onKeyDown:e=>{var n;if("Escape"===e.key)return e.preventDefault(),e.stopPropagation(),void S();if("Tab"===e.key)return void D(!1);const o=Array.from(e.currentTarget.querySelectorAll("button")),t=o.indexOf(document.activeElement),i="Home"===e.key?0:"End"===e.key?o.length-1:"ArrowDown"===e.key?(t+1)%o.length:"ArrowUp"===e.key?(t-1+o.length)%o.length:-1;i>=0&&(e.preventDefault(),null===(n=o[i])||void 0===n||n.focus())}},{children:N.map((n=>e.jsxs("button",Object.assign({type:"button",role:"menuitemradio","aria-checked":n.id===v,tabIndex:-1,disabled:C,className:"flex min-w-0 w-full items-center gap-2 rounded px-2 py-2 text-left text-sm outline-none hover:bg-black/10 focus:bg-black/10 focus:ring-0 disabled:opacity-50",onClick:()=>{C||(h(n.id),S())}},{children:[e.jsx("span",Object.assign({"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center"},{children:n.id===v?"✓":""})),e.jsx("span",Object.assign({className:"min-w-0 whitespace-normal",style:{overflowWrap:"anywhere"}},{children:n.label}))]}),n.id)))}))}))]})}exports.default=function({compact:o=!1}){const{enabled:s}=t.useEndUserModel(),{isGenerating:l}=i.useResponseContext(),d=`pxe-model-${n.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`;return s?e.jsx(r.default,Object.assign({id:d,isDisabled:l,isOpen:!l&&void 0,className:o?"relative ms-auto flex min-w-0 max-w-full":"relative my-2 flex flex-wrap min-w-0 max-w-full items-center gap-2 text-xs"},{children:e.jsx(a,{compact:o})})):null};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("../../../../hooks/pickaxe/usePickaxeContext.js"),i=require("../../../../common/actionApproval.js");exports.ActionApprovalPart=function({content:l,isStreaming:o=!1,approval:a}){var t,s,r,d,c,u,p,v,m,x,b,j;const{translations:g}=n.usePickaxeContext(),f=i.parseActionApproval(l);if(!f)return null;const y=null!==(t=null==a?void 0:a.decisions[f.id])&&void 0!==t?t:f.status,h="pending"===y&&o&&(null==a?void 0:a.enabled)&&1e3*f.expiresAt>Date.now(),N=Boolean(null==a?void 0:a.busyId),O="pending"===y?h?null!==(s=null==g?void 0:g["action-confirmation-needed"])&&void 0!==s?s:"Confirmation needed":null!==(r=null==g?void 0:g["action-confirmation-unavailable"])&&void 0!==r?r:"Confirmation unavailable":{approved:null!==(d=null==g?void 0:g["action-approved"])&&void 0!==d?d:"Approved",declined:null!==(c=null==g?void 0:g["action-declined"])&&void 0!==c?c:"Declined",expired:null!==(u=null==g?void 0:g["action-expired"])&&void 0!==u?u:"Expired",cancelled:null!==(p=null==g?void 0:g["action-not-run"])&&void 0!==p?p:"Not run"}[y];let w=f.arguments;try{w&&(w=JSON.stringify(JSON.parse(w),null,2))}catch(e){}return e.jsxs("section",Object.assign({"aria-label":(null!==(v=null==g?void 0:g["action-label"])&&void 0!==v?v:"Action: {name}").replace("{name}",f.name),className:"my-2 w-full min-w-0 rounded-xl border p-4 text-sm",style:{borderColor:"color-mix(in srgb, currentColor 20%, transparent)"}},{children:[e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-2"},{children:[e.jsx("span",Object.assign({className:"break-words font-semibold"},{children:f.name})),e.jsx("span",Object.assign({role:"status",className:"rounded-full border px-2 py-0.5 text-xs"},{children:O}))]})),h&&e.jsx("p",Object.assign({className:"mt-2 opacity-70"},{children:null!==(m=null==g?void 0:g["action-confirmation-description"])&&void 0!==m?m:"Review this action before it runs. Your decision applies only to this call."})),w&&e.jsxs("details",Object.assign({className:"mt-3",open:"pending"===y},{children:[e.jsx("summary",Object.assign({className:"cursor-pointer text-xs font-medium"},{children:null!==(x=null==g?void 0:g["action-inputs"])&&void 0!==x?x:"Action inputs"})),e.jsx("pre",Object.assign({className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-black/5 p-3 text-xs"},{children:w}))]})),h&&e.jsxs("div",Object.assign({className:"mt-4 flex flex-wrap justify-end gap-2"},{children:[e.jsx("button",Object.assign({type:"button",className:"rounded-lg border px-3 py-2 font-semibold transition-opacity hover:opacity-70 disabled:opacity-50",disabled:N,onClick:()=>{null==a||a.decide(f.id,"declined")}},{children:null!==(b=null==g?void 0:g["decline-action"])&&void 0!==b?b:"Decline"})),e.jsx("button",Object.assign({type:"button",className:"rounded-lg border px-3 py-2 font-semibold transition-opacity hover:opacity-70 disabled:opacity-50",disabled:N,onClick:()=>{null==a||a.decide(f.id,"approved")}},{children:null!==(j=null==g?void 0:g["approve-action"])&&void 0!==j?j:"Approve action"}))]})),(null==a?void 0:a.errors[f.id])&&e.jsx("p",Object.assign({role:"alert",className:"mt-2 text-xs"},{children:a.errors[f.id]}))]}))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("./usePickaxeContext.js"),n=require("react");exports.useActionApprovals=function(r){var s,o;const{translations:i}=t.usePickaxeContext(),a=null!==(s=null==i?void 0:i["action-decision-failed"])&&void 0!==s?s:"Could not save your decision. Please try again.",l=null!==(o=null==i?void 0:i["action-confirmation-resolved"])&&void 0!==o?o:"This confirmation has expired or already been resolved.",[u,c]=n.useState(null),[d,v]=n.useState(null),[b,f]=n.useState({}),[p,y]=n.useState({}),g=n.useRef(null);n.useEffect((()=>(v(null),f({}),y({}),()=>{var e;null===(e=g.current)||void 0===e||e.abort(),g.current=null})),[u,r]);const j=n.useCallback(((t,n)=>e.__awaiter(this,void 0,void 0,(function*(){if(!r||!u||g.current)return;let e=a;const s=new AbortController;g.current=s;const o=setTimeout((()=>s.abort()),15e3);v(t),f((e=>Object.assign(Object.assign({},e),{[t]:""})));try{const r=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API2_URL}/response/action-approvals/${t}`,{method:"POST",headers:{Authorization:`Bearer ${u}`,"Content-Type":"application/json"},body:JSON.stringify({decision:n}),signal:s.signal});if(!r.ok)throw e=409===r.status?l:a,new Error(e);g.current===s&&y((e=>Object.assign(Object.assign({},e),{[t]:n})))}catch(n){g.current===s&&f((n=>Object.assign(Object.assign({},n),{[t]:e})))}finally{clearTimeout(o),g.current===s&&(g.current=null,v(null))}}))),[r,u,a,l]);return{setToken:c,enabled:r&&Boolean(u),busyId:d,errors:b,decisions:p,decide:j}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./usePickaxeContext.js");exports.useEndUserModel=function(){var l;const{pickaxe:o,selectedModel:d,setSelectedModel:t}=e.usePickaxeContext(),s=null!==(l=null==o?void 0:o.availableEndUserModels)&&void 0!==l?l:[],n=!0===(null==o?void 0:o.allowEndUserModelSelection),u=n&&s.some((e=>e.id===d))?d:"";return{options:s,enabled:n,value:u,setValue:t,defaultModel:null==o?void 0:o.model}};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { PickaxeHistoryMessagePart } from "../types/history";
|
|
2
|
-
export type ActionApprovalStatus = "pending" | "approved" | "declined" | "expired" | "cancelled";
|
|
3
|
-
export type ActionApprovalData = {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
kind: "action" | "mcp";
|
|
7
|
-
pickaxeId: string;
|
|
8
|
-
status: ActionApprovalStatus;
|
|
9
|
-
expiresAt: number;
|
|
10
|
-
arguments?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare function parseActionApproval(content: string): ActionApprovalData | null;
|
|
13
|
-
/** Replace an existing approval in place so decisions never duplicate cards. */
|
|
14
|
-
export declare function upsertActionApprovalPart(parts: PickaxeHistoryMessagePart[], data: ActionApprovalData): void;
|
|
15
|
-
/** Approval updates can arrive while a text/reasoning part is still streaming. */
|
|
16
|
-
export declare function updateStreamTextPart(parts: PickaxeHistoryMessagePart[], type: "text" | "reasoning", content: string): void;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { useActionApprovals } from "../../../../hooks/pickaxe/useActionApprovals";
|
|
2
|
-
export declare function ActionApprovalPart({ content, isStreaming, approval, }: {
|
|
3
|
-
content: string;
|
|
4
|
-
isStreaming?: boolean;
|
|
5
|
-
approval?: ReturnType<typeof useActionApprovals>;
|
|
6
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/** The decision capability stays in memory, never in saved response parts. */
|
|
3
|
-
export declare function useActionApprovals(active: boolean): {
|
|
4
|
-
setToken: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
5
|
-
enabled: boolean;
|
|
6
|
-
busyId: string | null;
|
|
7
|
-
errors: Record<string, string>;
|
|
8
|
-
decisions: Record<string, "approved" | "declined">;
|
|
9
|
-
decide: (id: string, decision: "approved" | "declined") => Promise<void>;
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function useEndUserModel(): {
|
|
2
|
-
options: {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
}[];
|
|
6
|
-
enabled: boolean;
|
|
7
|
-
value: string;
|
|
8
|
-
setValue: import("../../types/common").SetState<string>;
|
|
9
|
-
defaultModel: import("../../types/pickaxe").PickaxeModel | undefined;
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(n){try{const t=JSON.parse(n);return t&&"string"==typeof t.id&&"string"==typeof t.name&&"string"==typeof t.pickaxeId&&"number"==typeof t.expiresAt&&["action","mcp"].includes(t.kind)&&["pending","approved","declined","expired","cancelled"].includes(t.status)&&(void 0===t.arguments||"string"==typeof t.arguments)?t:null}catch(n){return null}}function t(t,e){const i=t.findIndex((t=>{var i;return"data-action-approval"===t.type&&(null===(i=n(t.content))||void 0===i?void 0:i.id)===e.id})),r={type:"data-action-approval",content:JSON.stringify(e),isVisible:!0};i<0?t.push(r):t[i]=r}function e(n,t,e){for(let i=n.length-1;i>=0;i--)if(n[i].type===t)return void(n[i].content=e)}export{n as parseActionApproval,e as updateStreamTextPart,t as upsertActionApprovalPart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function r(r){const e=r=>"number"==typeof r.order&&Number.isFinite(r.order)&&r.order>=0?r.order:1/0;return[...r].sort(((r,o)=>e(r)-e(o)))}export{r as sortFormInputs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{encode as e}from"@nem035/gpt-3-encoder";function n(n){return"Knowledge Upload"===n.type||"userinput:documentupload"===n.id?null:!["Multiple Choice","Checkbox"].includes(n.type)&&e(n.input).length>n.maxLength?"response-too-long":n.isRequired&&!n.input.trim()?"required-fields-missing":null}export{n as getFormQuestionError};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{useId as i,useContext as t}from"react";import{usePickaxeContext as l}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useEndUserModel as r}from"../../../hooks/pickaxe/useEndUserModel.js";import{useResponseContext as a}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as s}from"../../../hooks/studio/useStyleInput.js";import d,{MenuContext as c}from"../../Core/Menu/index.js";import u from"../../Core/Menu/List.js";function p({compact:i}){var d,p,m,f,b,x,g,v;const{options:h,value:w,setValue:k,defaultModel:y}=r(),{translations:j,styles:O,colors:C}=l(),{isGenerating:D}=a(),{id:A,isOpen:N,setIsOpen:E}=t(c),I=s(),L=null!==(d=null==j?void 0:j["ai-model"])&&void 0!==d?d:"AI model",M=null!==(f=null!==(m=null===(p=h.find((e=>e.id===y)))||void 0===p?void 0:p.label)&&void 0!==m?m:y)&&void 0!==f?f:"",S=i?M:(null!==(b=null==j?void 0:j["default-ai-model"])&&void 0!==b?b:"Default ({model})").replace("{model}",M),W=[{id:"",label:S},...h.filter((e=>e.id!==y))],$=null!==(g=null===(x=W.find((e=>e.id===w)))||void 0===x?void 0:x.label)&&void 0!==g?g:S,B=()=>{var e;E(!1),null===(e=document.getElementById(A))||void 0===e||e.focus()};return o(n,{children:[!i&&e("span",{children:L}),o("button",Object.assign({id:A,type:"button","aria-label":L,"aria-haspopup":"menu","aria-expanded":N,"aria-controls":`${A}-options`,disabled:D,className:i?"flex min-w-0 max-w-full items-center gap-1 rounded-lg border-0 bg-transparent px-1 py-2 text-xs outline-none focus:ring-0 focus-visible:underline disabled:cursor-not-allowed disabled:opacity-50":"flex min-w-0 max-w-full items-center gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm outline-none focus:ring-0 focus-visible:underline disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>E(!N),onKeyDown:e=>{"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),E(!0)),"Escape"===e.key&&B()}},{children:[e("span",Object.assign({className:"truncate"},{children:$})),e("svg",Object.assign({"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-3.5 w-3.5 shrink-0"},{children:e("path",{d:"m6 9 6 6 6-6",strokeLinecap:"round",strokeLinejoin:"round"})}))]})),e(u,Object.assign({align:i?"top-end":"bottom-end",width:"auto",maxHeight:"min(200px, calc(100dvh - 96px))",className:"min-w-0 overflow-x-hidden p-3 shadow-md",border:"#ffffff"===C.secondaryText.toLowerCase()?"1px solid rgba(255,255,255,0.7)":"1px solid rgba(0,0,0,0.7)",style:Object.assign(Object.assign({},I),{backgroundColor:I.backgroundColor&&"transparent"!==I.backgroundColor?I.backgroundColor:C.primary,color:null!==(v=I.color)&&void 0!==v?v:C.text,borderRadius:O.cornerRadius,maxWidth:"min(360px, calc(100vw - 32px))",minWidth:"min(200px, calc(100vw - 32px))"}),afterShow:()=>{var e,o;return null===(o=null===(e=document.getElementById(`${A}-options`))||void 0===e?void 0:e.querySelector('[aria-checked="true"]'))||void 0===o?void 0:o.focus()}},{children:e("div",Object.assign({id:`${A}-options`,role:"menu",tabIndex:-1,"aria-label":L,onKeyDown:e=>{var o;if("Escape"===e.key)return e.preventDefault(),e.stopPropagation(),void B();if("Tab"===e.key)return void E(!1);const n=Array.from(e.currentTarget.querySelectorAll("button")),i=n.indexOf(document.activeElement),t="Home"===e.key?0:"End"===e.key?n.length-1:"ArrowDown"===e.key?(i+1)%n.length:"ArrowUp"===e.key?(i-1+n.length)%n.length:-1;t>=0&&(e.preventDefault(),null===(o=n[t])||void 0===o||o.focus())}},{children:W.map((n=>o("button",Object.assign({type:"button",role:"menuitemradio","aria-checked":n.id===w,tabIndex:-1,disabled:D,className:"flex min-w-0 w-full items-center gap-2 rounded px-2 py-2 text-left text-sm outline-none hover:bg-black/10 focus:bg-black/10 focus:ring-0 disabled:opacity-50",onClick:()=>{D||(k(n.id),B())}},{children:[e("span",Object.assign({"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center"},{children:n.id===w?"✓":""})),e("span",Object.assign({className:"min-w-0 whitespace-normal",style:{overflowWrap:"anywhere"}},{children:n.label}))]}),n.id)))}))}))]})}function m({compact:o=!1}){const{enabled:n}=r(),{isGenerating:t}=a(),l=`pxe-model-${i().replace(/[^a-zA-Z0-9_-]/g,"")}`;return n?e(d,Object.assign({id:l,isDisabled:t,isOpen:!t&&void 0,className:o?"relative ms-auto flex min-w-0 max-w-full":"relative my-2 flex flex-wrap min-w-0 max-w-full items-center gap-2 text-xs"},{children:e(p,{compact:o})})):null}export{m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n}from"react/jsx-runtime";import{usePickaxeContext as i}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{parseActionApproval as l}from"../../../../common/actionApproval.js";function o({content:o,isStreaming:a=!1,approval:t}){var d,r,s,c,p,u,m,v,b,x,f,g;const{translations:y}=i(),h=l(o);if(!h)return null;const j=null!==(d=null==t?void 0:t.decisions[h.id])&&void 0!==d?d:h.status,N="pending"===j&&a&&(null==t?void 0:t.enabled)&&1e3*h.expiresAt>Date.now(),O=Boolean(null==t?void 0:t.busyId),w="pending"===j?N?null!==(r=null==y?void 0:y["action-confirmation-needed"])&&void 0!==r?r:"Confirmation needed":null!==(s=null==y?void 0:y["action-confirmation-unavailable"])&&void 0!==s?s:"Confirmation unavailable":{approved:null!==(c=null==y?void 0:y["action-approved"])&&void 0!==c?c:"Approved",declined:null!==(p=null==y?void 0:y["action-declined"])&&void 0!==p?p:"Declined",expired:null!==(u=null==y?void 0:y["action-expired"])&&void 0!==u?u:"Expired",cancelled:null!==(m=null==y?void 0:y["action-not-run"])&&void 0!==m?m:"Not run"}[j];let k=h.arguments;try{k&&(k=JSON.stringify(JSON.parse(k),null,2))}catch(e){}return e("section",Object.assign({"aria-label":(null!==(v=null==y?void 0:y["action-label"])&&void 0!==v?v:"Action: {name}").replace("{name}",h.name),className:"my-2 w-full min-w-0 rounded-xl border p-4 text-sm",style:{borderColor:"color-mix(in srgb, currentColor 20%, transparent)"}},{children:[e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-2"},{children:[n("span",Object.assign({className:"break-words font-semibold"},{children:h.name})),n("span",Object.assign({role:"status",className:"rounded-full border px-2 py-0.5 text-xs"},{children:w}))]})),N&&n("p",Object.assign({className:"mt-2 opacity-70"},{children:null!==(b=null==y?void 0:y["action-confirmation-description"])&&void 0!==b?b:"Review this action before it runs. Your decision applies only to this call."})),k&&e("details",Object.assign({className:"mt-3",open:"pending"===j},{children:[n("summary",Object.assign({className:"cursor-pointer text-xs font-medium"},{children:null!==(x=null==y?void 0:y["action-inputs"])&&void 0!==x?x:"Action inputs"})),n("pre",Object.assign({className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-black/5 p-3 text-xs"},{children:k}))]})),N&&e("div",Object.assign({className:"mt-4 flex flex-wrap justify-end gap-2"},{children:[n("button",Object.assign({type:"button",className:"rounded-lg border px-3 py-2 font-semibold transition-opacity hover:opacity-70 disabled:opacity-50",disabled:O,onClick:()=>{null==t||t.decide(h.id,"declined")}},{children:null!==(f=null==y?void 0:y["decline-action"])&&void 0!==f?f:"Decline"})),n("button",Object.assign({type:"button",className:"rounded-lg border px-3 py-2 font-semibold transition-opacity hover:opacity-70 disabled:opacity-50",disabled:O,onClick:()=>{null==t||t.decide(h.id,"approved")}},{children:null!==(g=null==y?void 0:y["approve-action"])&&void 0!==g?g:"Approve action"}))]})),(null==t?void 0:t.errors[h.id])&&n("p",Object.assign({role:"alert",className:"mt-2 text-xs"},{children:t.errors[h.id]}))]}))}export{o as ActionApprovalPart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__awaiter as n}from"../../_virtual/_tslib.js";import{usePickaxeContext as e}from"./usePickaxeContext.js";import{useState as o,useRef as t,useEffect as r,useCallback as i}from"react";function s(s){var l,a;const{translations:c}=e(),u=null!==(l=null==c?void 0:c["action-decision-failed"])&&void 0!==l?l:"Could not save your decision. Please try again.",d=null!==(a=null==c?void 0:c["action-confirmation-resolved"])&&void 0!==a?a:"This confirmation has expired or already been resolved.",[v,b]=o(null),[f,p]=o(null),[m,g]=o({}),[y,h]=o({}),j=t(null);r((()=>(p(null),g({}),h({}),()=>{var n;null===(n=j.current)||void 0===n||n.abort(),j.current=null})),[v,s]);const O=i(((e,o)=>n(this,void 0,void 0,(function*(){if(!s||!v||j.current)return;let n=u;const t=new AbortController;j.current=t;const r=setTimeout((()=>t.abort()),15e3);p(e),g((n=>Object.assign(Object.assign({},n),{[e]:""})));try{const r=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API2_URL}/response/action-approvals/${e}`,{method:"POST",headers:{Authorization:`Bearer ${v}`,"Content-Type":"application/json"},body:JSON.stringify({decision:o}),signal:t.signal});if(!r.ok)throw n=409===r.status?d:u,new Error(n);j.current===t&&h((n=>Object.assign(Object.assign({},n),{[e]:o})))}catch(o){j.current===t&&g((o=>Object.assign(Object.assign({},o),{[e]:n})))}finally{clearTimeout(r),j.current===t&&(j.current=null,p(null))}}))),[s,v,u,d]);return{setToken:b,enabled:s&&Boolean(v),busyId:f,errors:m,decisions:y,decide:O}}export{s as useActionApprovals};
|