ai-ax 0.7.0 → 0.9.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 +5 -3
- package/dist/{react.d.ts → client/react.d.ts} +2 -2
- package/dist/{react.js → client/react.js} +1 -1
- package/dist/client/ui.d.ts +651 -0
- package/dist/client/ui.js +7 -0
- package/dist/client.d.ts +6 -6
- package/dist/client.js +2 -2
- package/dist/hono/d1.d.ts +137 -0
- package/dist/hono/d1.js +1 -0
- package/dist/hono/r2.d.ts +194 -0
- package/dist/hono/r2.js +1 -0
- package/dist/hono.d.ts +1 -1
- package/dist/hono.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/types.d.ts +4 -6
- package/package.json +33 -5
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ export class PartyServer extends Server {
|
|
|
89
89
|
|
|
90
90
|
```tsx
|
|
91
91
|
// client.tsx (browser)
|
|
92
|
-
import { useClient } from 'ai-ax/react'
|
|
92
|
+
import { useClient } from 'ai-ax/client/react'
|
|
93
93
|
import ai from './actions'
|
|
94
94
|
|
|
95
95
|
const App = () => {
|
|
@@ -127,7 +127,7 @@ Browsers always connect to the alias room `my-room`, and the worker rewrites it
|
|
|
127
127
|
| `ai-ax/react` | `useClient`, `Client`, `atom`, `setAtom`, `useAtomValue` | browser (React) |
|
|
128
128
|
| `ai-ax/const` | protocol constants (paths, header names) | both |
|
|
129
129
|
|
|
130
|
-
The worker expects a Durable Object binding named `v1` pointing at the exported `Server` class, and the environment needs `AUTH_SECRET`, the OAuth client credentials and `ANTHROPIC_API_KEY`. Config keys of `x(params, config)` and `hono(ai, extra)`:
|
|
130
|
+
The worker expects a Durable Object binding named `v1` pointing at the exported `Server` class, and the environment needs `AUTH_SECRET`, the OAuth client credentials and `ANTHROPIC_API_KEY`. Every environment-dependent value is a config resolver of the shape `(env) => string`, so the app decides which variable to read — `domain: (env) => env.AUTH_DOMAIN` is only a convention, not a requirement. `domain` returns the host tail that follows the service name (`.glre.dev` in production, `-dev.glre.dev` in staging) and shares the session cookie across every service of that environment: its first `.` onward becomes the cookie domain and the part before it becomes a per-environment cookie name suffix, so production and staging sessions never mix even under one apex. `apiKey` resolves the Claude API key the same way and has no built-in variable name at all; `secret` falls back to `AUTH_SECRET` only because Auth.js itself owns that convention (as it owns `AUTH_URL`). Config keys of `x(params, config)` and `hono(ai, extra)`:
|
|
131
131
|
|
|
132
132
|
| key | type | default | meaning |
|
|
133
133
|
| --------- | -------------------------- | ----------------------------------------- | ----------------------------------------------------- |
|
|
@@ -153,7 +153,9 @@ The worker expects a Durable Object binding named `v1` pointing at the exported
|
|
|
153
153
|
| version | `string` | `'1.0.0'` | MCP server version string |
|
|
154
154
|
| salt | `string` | `'authjs.mcp-token'` | grant jwt salt, separates services |
|
|
155
155
|
| maxAge | `number` | `43200` (12h) | grant jwt lifetime in seconds |
|
|
156
|
-
| cookie | `{ apex, services }` | none | services sharing a session cookie across subdomains |
|
|
157
156
|
| providers | `any[]` | Google | Auth.js providers |
|
|
157
|
+
| domain | `(env) => string` | none | host tail after the service name, shares the cookie |
|
|
158
|
+
| apiKey | `(env) => string` | none | Claude API key resolver |
|
|
159
|
+
| secret | `(env) => string` | `env.AUTH_SECRET` | Auth.js / grant jwt secret resolver |
|
|
158
160
|
|
|
159
161
|
The `x-user-sub` / `x-user-path` header names and the anthropic-version are internal protocol constants and intentionally not configurable, because both ends of each protocol must change together.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e,useEffect as t,useState as n}from"react";const r=e=>({value:e,listeners:new Set}),i=(e,t)=>{typeof t==`function`&&(t=t(e.value)),e.value=t,e.listeners.forEach(e=>e(t))},a=e=>{let[r,i]=n(()=>e.value);return t(()=>{let t=e=>i(e);return e.listeners.add(t),r!==e.value&&i(e.value),()=>void e.listeners.delete(t)},[e]),r},o=t=>[a(t),e(e=>i(t,e),[t])],s=({atom:e,children:t})=>t(a(e)),c=(e,r)=>{let[,i]=n(0);return t(()=>{import(
|
|
1
|
+
import{useCallback as e,useEffect as t,useState as n}from"react";const r=e=>({value:e,listeners:new Set}),i=(e,t)=>{typeof t==`function`&&(t=t(e.value)),e.value=t,e.listeners.forEach(e=>e(t))},a=e=>{let[r,i]=n(()=>e.value);return t(()=>{let t=e=>i(e);return e.listeners.add(t),r!==e.value&&i(e.value),()=>void e.listeners.delete(t)},[e]),r},o=t=>[a(t),e(e=>i(t,e),[t])],s=({atom:e,children:t})=>t(a(e)),c=(e,r)=>{let[,i]=n(0);return t(()=>{import(`../client.js`).then(({client:t})=>t(e,r));let t=e.data(),n=()=>i(e=>e+1);return t.observe(n),()=>t.unobserve(n)},[e]),e},l=({ai:e,route:t,children:n})=>n(c(e,t));export{s as AtomValue,l as Client,r as atom,i as setAtom,o as useAtom,a as useAtomValue,c as useClient};
|
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/client/ui/share/icon.d.ts
|
|
3
|
+
interface IconProps {
|
|
4
|
+
name: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const Icon: ({ name, size, color, className }: IconProps) => import("react").JSX.Element;
|
|
10
|
+
declare const stop: <T extends {
|
|
11
|
+
stopPropagation: () => void;
|
|
12
|
+
}>(e: T) => void;
|
|
13
|
+
declare const prev: <T extends {
|
|
14
|
+
preventDefault: () => void;
|
|
15
|
+
}>(e: T) => void;
|
|
16
|
+
declare const Slot: ({ show, children }: {
|
|
17
|
+
show?: boolean;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}) => import("react").JSX.Element | null;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/client/ui/share/types.d.ts
|
|
22
|
+
interface Item {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
icon?: string;
|
|
26
|
+
color?: string;
|
|
27
|
+
desc?: string;
|
|
28
|
+
top?: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface Point {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
}
|
|
34
|
+
interface Placed {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
h: number;
|
|
38
|
+
}
|
|
39
|
+
interface PlaceInput {
|
|
40
|
+
align?: 'left' | 'right';
|
|
41
|
+
point?: Point | null;
|
|
42
|
+
gap?: number;
|
|
43
|
+
margin?: number;
|
|
44
|
+
}
|
|
45
|
+
interface Service {
|
|
46
|
+
id: string;
|
|
47
|
+
label: string;
|
|
48
|
+
noun: string;
|
|
49
|
+
icon: string;
|
|
50
|
+
color: string;
|
|
51
|
+
}
|
|
52
|
+
interface Storage {
|
|
53
|
+
used: number;
|
|
54
|
+
total: number;
|
|
55
|
+
text: string;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/client/ui/share/pop.d.ts
|
|
59
|
+
interface PopProps {
|
|
60
|
+
items: Item[];
|
|
61
|
+
value?: string;
|
|
62
|
+
pick: (item: Item) => void;
|
|
63
|
+
align?: 'left' | 'right';
|
|
64
|
+
cls?: string;
|
|
65
|
+
point?: Point | null;
|
|
66
|
+
check: string;
|
|
67
|
+
}
|
|
68
|
+
declare const Pop: ({ cls, items, value, pick, style, check }: {
|
|
69
|
+
cls: string;
|
|
70
|
+
items: Item[];
|
|
71
|
+
value?: string;
|
|
72
|
+
pick: (m: Item) => void;
|
|
73
|
+
style?: any;
|
|
74
|
+
check: string;
|
|
75
|
+
}) => import("react").JSX.Element;
|
|
76
|
+
declare const Drop: ({ items, value, pick, align, cls, point, check }: PopProps) => import("react").JSX.Element;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/client/ui/share/place.d.ts
|
|
79
|
+
declare const place: (anchorEl?: Element | null, boxEl?: Element | null, input?: PlaceInput) => Placed | null;
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/client/ui/share/date.d.ts
|
|
82
|
+
declare const stamp: (iso: string | number | Date) => string;
|
|
83
|
+
declare const sizeOf: (bytes: number) => string;
|
|
84
|
+
declare const usageOf: (bytes: number) => string;
|
|
85
|
+
declare const ago: (at: string | number) => string;
|
|
86
|
+
declare const unique: (name: string, taken: Set<string>) => string;
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/client/ui/share/const.d.ts
|
|
89
|
+
declare const ink = "#1f1f21";
|
|
90
|
+
declare const mute = "#8b8b8b";
|
|
91
|
+
declare const line = "#ececec";
|
|
92
|
+
declare const edge = "#d9d9d9";
|
|
93
|
+
declare const pale = "#fafafa";
|
|
94
|
+
declare const band = "#f1f1f1";
|
|
95
|
+
declare const fill = "#202020";
|
|
96
|
+
declare const blue = "#4185f4";
|
|
97
|
+
declare const side: {
|
|
98
|
+
row: number;
|
|
99
|
+
indent: number;
|
|
100
|
+
slot: number;
|
|
101
|
+
icon: number;
|
|
102
|
+
gap: number;
|
|
103
|
+
brand: number;
|
|
104
|
+
width: number;
|
|
105
|
+
};
|
|
106
|
+
declare const grid: {
|
|
107
|
+
card: number;
|
|
108
|
+
suggest: number;
|
|
109
|
+
};
|
|
110
|
+
declare const quota = 15360;
|
|
111
|
+
declare const uploadMax = 104857600;
|
|
112
|
+
declare const uploadAlert = "ファイルサイズが大きすぎます (上限 100 MB)";
|
|
113
|
+
declare const SP_BREAK = 768;
|
|
114
|
+
declare const GB = 1073741824;
|
|
115
|
+
declare const MB = 1048576;
|
|
116
|
+
declare const KB = 1024;
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/client/ui/gesture/drag/drop.d.ts
|
|
119
|
+
declare const createFileDrag: (onDrop: (id: string, drop: string) => void) => (id: string, zone?: string) => (el: Element | null) => undefined;
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/client/ui/gesture/drop/files.d.ts
|
|
122
|
+
interface Dropped {
|
|
123
|
+
path: string;
|
|
124
|
+
file: File | null;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/client/ui/gesture/drop/drop.d.ts
|
|
128
|
+
declare const createFileDrop: (zone: string, onDrop: (items: Dropped[], drop: string) => void, canDrop?: () => boolean) => (el: Element | null) => void;
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/client/ui/gesture/utils.d.ts
|
|
131
|
+
declare const vec2: (x?: number, y?: number, out?: any[] | Float32Array<ArrayBuffer>) => Vec2;
|
|
132
|
+
type Vec2 = [x: number, y: number];
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/client/ui/gesture/drag.d.ts
|
|
135
|
+
declare const dragEvent: <El extends Element = Element>(onDrag?: () => void, canStart?: (event: Event) => boolean) => any;
|
|
136
|
+
type DragState = ReturnType<typeof dragEvent>;
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/client/ui/gesture/drop.d.ts
|
|
139
|
+
declare const dropEvent: <El extends Element = Element>(onDrop?: () => void, canStart?: (event: DragEvent) => boolean) => any;
|
|
140
|
+
type DropState = ReturnType<typeof dropEvent>;
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/client/ui/gesture/over/hit.d.ts
|
|
143
|
+
type Skip = (el: Element, drop: string) => boolean;
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/client/ui/gesture/over/over.d.ts
|
|
146
|
+
declare const createOver: () => {
|
|
147
|
+
begin(zone: string, skip?: Skip): void;
|
|
148
|
+
move(x: number, y: number): void;
|
|
149
|
+
read(): string | null;
|
|
150
|
+
end(): void;
|
|
151
|
+
};
|
|
152
|
+
type Over = ReturnType<typeof createOver>;
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/client/ui/gesture/drag/ghost.d.ts
|
|
155
|
+
declare const createGhost: () => {
|
|
156
|
+
start(source: Element | null, x?: number, y?: number): void;
|
|
157
|
+
move(x: number, y: number): void;
|
|
158
|
+
end(): void;
|
|
159
|
+
};
|
|
160
|
+
type Ghost = ReturnType<typeof createGhost>;
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/client/ui/gesture/drag/grab.d.ts
|
|
163
|
+
declare const createGrab: (id: string, zone: string, ghost: Ghost, over: Over, done: (drop: string) => void) => (el: Element | null) => undefined;
|
|
164
|
+
type Grab = ReturnType<typeof createGrab>;
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/client/ui/chat/index.d.ts
|
|
167
|
+
declare const AiChatButton: () => import("react").JSX.Element;
|
|
168
|
+
declare const AiChat: () => import("react").JSX.Element | null;
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/client/ui/chat/clicks.d.ts
|
|
171
|
+
declare const openChat: () => void;
|
|
172
|
+
declare const closeChat: () => void;
|
|
173
|
+
declare const toggleChat: () => void;
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/client/ui/chat/types.d.ts
|
|
176
|
+
interface ChatTool {
|
|
177
|
+
icon?: string;
|
|
178
|
+
label: string;
|
|
179
|
+
}
|
|
180
|
+
interface ChatMsg {
|
|
181
|
+
role: 'agent' | 'user';
|
|
182
|
+
text: string;
|
|
183
|
+
tools?: ChatTool[];
|
|
184
|
+
}
|
|
185
|
+
interface ChatPrompt {
|
|
186
|
+
icon?: string;
|
|
187
|
+
color?: string;
|
|
188
|
+
label: string;
|
|
189
|
+
prompt?: string;
|
|
190
|
+
}
|
|
191
|
+
interface ChatHello {
|
|
192
|
+
greet: string;
|
|
193
|
+
title: string;
|
|
194
|
+
desc: string;
|
|
195
|
+
prompts: ChatPrompt[];
|
|
196
|
+
}
|
|
197
|
+
interface ChatMenu {
|
|
198
|
+
useOpen: () => string;
|
|
199
|
+
flip: (id: string) => (e: any) => void;
|
|
200
|
+
close: () => void;
|
|
201
|
+
}
|
|
202
|
+
interface ChatCommand {
|
|
203
|
+
name: string;
|
|
204
|
+
desc: string;
|
|
205
|
+
label?: string;
|
|
206
|
+
run: () => any;
|
|
207
|
+
}
|
|
208
|
+
interface ChatStreamTool {
|
|
209
|
+
server: string;
|
|
210
|
+
name: string;
|
|
211
|
+
}
|
|
212
|
+
interface ChatStreamItem {
|
|
213
|
+
text: string;
|
|
214
|
+
tools: ChatStreamTool[];
|
|
215
|
+
error?: boolean;
|
|
216
|
+
}
|
|
217
|
+
interface ChatStreamSend {
|
|
218
|
+
prompt: string;
|
|
219
|
+
path?: string;
|
|
220
|
+
model?: string;
|
|
221
|
+
messages?: any[];
|
|
222
|
+
headers?: Record<string, string>;
|
|
223
|
+
}
|
|
224
|
+
interface ChatStreamUpdate {
|
|
225
|
+
items: ChatStreamItem[];
|
|
226
|
+
delta: string;
|
|
227
|
+
raw: string;
|
|
228
|
+
}
|
|
229
|
+
interface ChatStream {
|
|
230
|
+
parse: (raw: string) => ChatStreamItem[];
|
|
231
|
+
send: (input: ChatStreamSend, update?: (u: ChatStreamUpdate) => void) => Promise<ChatStreamItem[]>;
|
|
232
|
+
}
|
|
233
|
+
interface ChatConfig {
|
|
234
|
+
send: (input: {
|
|
235
|
+
prompt: string;
|
|
236
|
+
}) => Promise<string>;
|
|
237
|
+
stream: ChatStream;
|
|
238
|
+
icon: string;
|
|
239
|
+
path: string;
|
|
240
|
+
headers: Record<string, string>;
|
|
241
|
+
hello: () => ChatHello;
|
|
242
|
+
menu: ChatMenu;
|
|
243
|
+
commands: () => ChatCommand[];
|
|
244
|
+
hints: (msgs: ChatMsg[]) => ChatCommand[];
|
|
245
|
+
}
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/client/ui/chat/config.d.ts
|
|
248
|
+
declare const config: ChatConfig;
|
|
249
|
+
declare const configure: (next: Partial<ChatConfig>) => undefined;
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/client/ui/chat/stream.d.ts
|
|
252
|
+
declare const toMsg: (it: ChatStreamItem) => ChatMsg;
|
|
253
|
+
declare const restoreChat: (talks: {
|
|
254
|
+
prompt: string;
|
|
255
|
+
reply: string;
|
|
256
|
+
tools: string[];
|
|
257
|
+
}[]) => void;
|
|
258
|
+
declare const runChat: (prompt: string) => Promise<string>;
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/client/ui/chat/utils/commands/types.d.ts
|
|
261
|
+
interface Command {
|
|
262
|
+
name: string;
|
|
263
|
+
desc: string;
|
|
264
|
+
label?: string;
|
|
265
|
+
run: () => any;
|
|
266
|
+
}
|
|
267
|
+
interface Habit {
|
|
268
|
+
name: string;
|
|
269
|
+
part: number;
|
|
270
|
+
after: string;
|
|
271
|
+
count: number;
|
|
272
|
+
}
|
|
273
|
+
interface CommandConfig {
|
|
274
|
+
store: {
|
|
275
|
+
list: () => Promise<Habit[]>;
|
|
276
|
+
save: (habit: {
|
|
277
|
+
name: string;
|
|
278
|
+
part: number;
|
|
279
|
+
after: string;
|
|
280
|
+
}) => any;
|
|
281
|
+
};
|
|
282
|
+
deck: Command[];
|
|
283
|
+
greet: {
|
|
284
|
+
greet: string;
|
|
285
|
+
title: string;
|
|
286
|
+
desc: string;
|
|
287
|
+
};
|
|
288
|
+
starters: () => string[];
|
|
289
|
+
pinned: () => string[];
|
|
290
|
+
hinted: (msgs: any[]) => string[];
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region src/client/ui/chat/utils/commands/index.d.ts
|
|
294
|
+
declare const createCommands: (config: CommandConfig) => {
|
|
295
|
+
commands: () => Command[];
|
|
296
|
+
hello: () => {
|
|
297
|
+
greet: string;
|
|
298
|
+
title: string;
|
|
299
|
+
desc: string;
|
|
300
|
+
prompts: {
|
|
301
|
+
label: string;
|
|
302
|
+
prompt: string;
|
|
303
|
+
}[];
|
|
304
|
+
};
|
|
305
|
+
hints: (msgs: any[]) => Command[];
|
|
306
|
+
prime: () => Promise<void>;
|
|
307
|
+
};
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region src/client/ui/chat/utils/history/types.d.ts
|
|
310
|
+
interface HistoryTalk {
|
|
311
|
+
prompt: string;
|
|
312
|
+
reply: string;
|
|
313
|
+
tools: string[];
|
|
314
|
+
}
|
|
315
|
+
interface HistoryStore {
|
|
316
|
+
list: () => Promise<any[]>;
|
|
317
|
+
load: (chatId: string) => Promise<{
|
|
318
|
+
talks: any[];
|
|
319
|
+
tools: any[];
|
|
320
|
+
}>;
|
|
321
|
+
save: (chatId: string, body: any) => any;
|
|
322
|
+
}
|
|
323
|
+
interface HistoryConfig {
|
|
324
|
+
store: HistoryStore;
|
|
325
|
+
show: (talks: HistoryTalk[]) => void;
|
|
326
|
+
}
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/client/ui/chat/utils/history/index.d.ts
|
|
329
|
+
declare const createHistory: (config: HistoryConfig) => {
|
|
330
|
+
wrap: <T extends {
|
|
331
|
+
send: any;
|
|
332
|
+
}>(base: T) => T;
|
|
333
|
+
reset: () => void;
|
|
334
|
+
load: (id: string) => Promise<void>;
|
|
335
|
+
list: () => Promise<any[]>;
|
|
336
|
+
};
|
|
337
|
+
type History = ReturnType<typeof createHistory>;
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/client/ui/chat/utils/markdown.d.ts
|
|
340
|
+
declare const markdown: {
|
|
341
|
+
render: (text: string) => string;
|
|
342
|
+
plain: (text: string) => string;
|
|
343
|
+
};
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/client/ui/chat/state.d.ts
|
|
346
|
+
declare const isChatBusy: () => boolean;
|
|
347
|
+
declare const useChatBusy: () => boolean;
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/client/ui/chat/const.d.ts
|
|
350
|
+
declare const models: {
|
|
351
|
+
id: string;
|
|
352
|
+
label: string;
|
|
353
|
+
desc: string;
|
|
354
|
+
}[];
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/client/ui/shell/band.d.ts
|
|
357
|
+
interface CardItem extends Item {
|
|
358
|
+
menu?: boolean;
|
|
359
|
+
}
|
|
360
|
+
interface BandProps {
|
|
361
|
+
cards: CardItem[];
|
|
362
|
+
click: (card: CardItem) => (e: any) => void;
|
|
363
|
+
popup: (card: CardItem) => ReactNode;
|
|
364
|
+
count?: number;
|
|
365
|
+
}
|
|
366
|
+
declare const Strip: ({ count, min, cls, children }: {
|
|
367
|
+
count: number;
|
|
368
|
+
min: number;
|
|
369
|
+
cls?: string;
|
|
370
|
+
children: ReactNode;
|
|
371
|
+
}) => import("react").JSX.Element;
|
|
372
|
+
declare const Cards: ({ cards, click, popup, count }: BandProps) => import("react").JSX.Element;
|
|
373
|
+
declare const Band: (props: BandProps) => import("react").JSX.Element;
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region src/client/ui/shell/app.d.ts
|
|
376
|
+
interface AppProps {
|
|
377
|
+
drawer: boolean;
|
|
378
|
+
close: () => void;
|
|
379
|
+
dropRef?: any;
|
|
380
|
+
children: ReactNode;
|
|
381
|
+
}
|
|
382
|
+
declare const Frame: ({ drawer, close, dropRef, children }: AppProps) => import("react").JSX.Element;
|
|
383
|
+
declare const Main: ({ drop, from, children }: {
|
|
384
|
+
drop?: string;
|
|
385
|
+
from?: string;
|
|
386
|
+
children: ReactNode;
|
|
387
|
+
}) => import("react").JSX.Element;
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/client/ui/shell/head.d.ts
|
|
390
|
+
interface SpHeadProps {
|
|
391
|
+
icon: string;
|
|
392
|
+
color: string;
|
|
393
|
+
label: string;
|
|
394
|
+
home: () => void;
|
|
395
|
+
actions: ReactNode;
|
|
396
|
+
drawer: (e: any) => void;
|
|
397
|
+
}
|
|
398
|
+
interface MainHeadProps {
|
|
399
|
+
bar: boolean;
|
|
400
|
+
open: () => void;
|
|
401
|
+
title: ReactNode;
|
|
402
|
+
back?: () => void;
|
|
403
|
+
expand?: {
|
|
404
|
+
label: string;
|
|
405
|
+
icon: string;
|
|
406
|
+
on: boolean;
|
|
407
|
+
click: () => void;
|
|
408
|
+
};
|
|
409
|
+
actions: ReactNode;
|
|
410
|
+
}
|
|
411
|
+
declare const SpHead: ({ icon, color, label, home, actions, drawer }: SpHeadProps) => import("react").JSX.Element;
|
|
412
|
+
declare const MainHead: ({ bar, open, title, back, expand, actions }: MainHeadProps) => import("react").JSX.Element;
|
|
413
|
+
declare const HeadBtn: ({ icon, size, click, children }: {
|
|
414
|
+
icon: string;
|
|
415
|
+
size?: number;
|
|
416
|
+
click: (e: any) => void;
|
|
417
|
+
children?: ReactNode;
|
|
418
|
+
}) => import("react").JSX.Element;
|
|
419
|
+
declare const SpBtn: ({ icon, size, click, children }: {
|
|
420
|
+
icon: string;
|
|
421
|
+
size?: number;
|
|
422
|
+
click: (e: any) => void;
|
|
423
|
+
children?: ReactNode;
|
|
424
|
+
}) => import("react").JSX.Element;
|
|
425
|
+
declare const MoreIcon: string;
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region src/client/ui/shell/side.d.ts
|
|
428
|
+
interface BrandProps {
|
|
429
|
+
icon: string;
|
|
430
|
+
color: string;
|
|
431
|
+
label: string;
|
|
432
|
+
click: () => void;
|
|
433
|
+
}
|
|
434
|
+
interface SideProps {
|
|
435
|
+
brand: BrandProps;
|
|
436
|
+
bar: boolean;
|
|
437
|
+
drawer: boolean;
|
|
438
|
+
fold: () => void;
|
|
439
|
+
close: () => void;
|
|
440
|
+
press: (e: any) => void;
|
|
441
|
+
storage: Storage;
|
|
442
|
+
upgrade: () => void;
|
|
443
|
+
menu?: ReactNode;
|
|
444
|
+
more: (e: any) => void;
|
|
445
|
+
children: ReactNode;
|
|
446
|
+
}
|
|
447
|
+
declare const Brand: ({ icon, color, label, click }: BrandProps) => import("react").JSX.Element;
|
|
448
|
+
declare const Storage_: ({ storage, upgrade, menu, more }: Pick<SideProps, 'storage' | 'upgrade' | 'menu' | 'more'>) => import("react").JSX.Element;
|
|
449
|
+
declare const Side: ({ brand, bar, drawer, fold, close, press, storage, upgrade, menu, more, children }: SideProps) => import("react").JSX.Element;
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region src/client/ui/shell/row.d.ts
|
|
452
|
+
interface RowProps {
|
|
453
|
+
depth?: number;
|
|
454
|
+
on?: boolean;
|
|
455
|
+
open?: boolean;
|
|
456
|
+
turn?: (e: any) => void;
|
|
457
|
+
icon: string;
|
|
458
|
+
color?: string;
|
|
459
|
+
label: ReactNode;
|
|
460
|
+
drop?: string;
|
|
461
|
+
mark?: string;
|
|
462
|
+
from?: string;
|
|
463
|
+
click?: (e: any) => void;
|
|
464
|
+
dclick?: (e: any) => void;
|
|
465
|
+
rclick?: (e: any) => void;
|
|
466
|
+
dragRef?: any;
|
|
467
|
+
children?: ReactNode;
|
|
468
|
+
}
|
|
469
|
+
declare const rowCls: (on: boolean) => string;
|
|
470
|
+
declare const Fold: ({ open, turn }: {
|
|
471
|
+
open?: boolean;
|
|
472
|
+
turn?: (e: any) => void;
|
|
473
|
+
}) => import("react").JSX.Element;
|
|
474
|
+
declare const Row: ({ depth, on, open, turn, icon, color, label, drop, mark, from, click, dclick, rclick, dragRef, children }: RowProps) => import("react").JSX.Element;
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region src/client/ui/drive/types.d.ts
|
|
477
|
+
interface Obj {
|
|
478
|
+
path: string;
|
|
479
|
+
size: number;
|
|
480
|
+
date: string;
|
|
481
|
+
kind?: string;
|
|
482
|
+
etag?: string;
|
|
483
|
+
}
|
|
484
|
+
interface Entry {
|
|
485
|
+
id: string;
|
|
486
|
+
name: string;
|
|
487
|
+
kind: string;
|
|
488
|
+
owner: string;
|
|
489
|
+
date: string;
|
|
490
|
+
iso: string;
|
|
491
|
+
size: string;
|
|
492
|
+
bytes: number;
|
|
493
|
+
parent: string;
|
|
494
|
+
pinned?: boolean;
|
|
495
|
+
trashed?: boolean;
|
|
496
|
+
}
|
|
497
|
+
interface DriveConfig {
|
|
498
|
+
base: string;
|
|
499
|
+
trash: string;
|
|
500
|
+
editors: string[];
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/client/ui/shell/tree.d.ts
|
|
504
|
+
interface TreeProps {
|
|
505
|
+
files: Entry[];
|
|
506
|
+
parent: string;
|
|
507
|
+
depth: number;
|
|
508
|
+
expand: string[];
|
|
509
|
+
active: string;
|
|
510
|
+
kinds: Record<string, {
|
|
511
|
+
icon: string;
|
|
512
|
+
color: string;
|
|
513
|
+
}>;
|
|
514
|
+
fold: (id: string) => (e: any) => void;
|
|
515
|
+
enter: (id: string) => (e: any) => void;
|
|
516
|
+
open: (e: Entry) => (ev: any) => void;
|
|
517
|
+
menu: (e: Entry) => ReactNode;
|
|
518
|
+
rclick: (e: Entry) => (ev: any) => void;
|
|
519
|
+
drag: (id: string, zone?: string) => any;
|
|
520
|
+
}
|
|
521
|
+
declare const DriveTree: (props: TreeProps) => any;
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/client/ui/shell/clicks.d.ts
|
|
524
|
+
declare const openDrawer: (e: any) => void;
|
|
525
|
+
declare const closeDrawer: () => void;
|
|
526
|
+
declare const atPoint: (e: any) => void;
|
|
527
|
+
declare const noPoint: () => void;
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/client/ui/shell/state.d.ts
|
|
530
|
+
declare const isDrawerOpen: () => boolean;
|
|
531
|
+
declare const useDrawer: () => boolean;
|
|
532
|
+
declare const usePoint: () => Point | null;
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region src/client/ui/shell/const.d.ts
|
|
535
|
+
declare const storageName = "STORAGE";
|
|
536
|
+
declare const upgradeLabel = "アップグレード";
|
|
537
|
+
declare const upgradeUrl = "https://stripe.com";
|
|
538
|
+
declare const emptyTrashAsk = "ゴミ箱を空にしますか?中のアイテムは完全に削除されます";
|
|
539
|
+
declare const storageMenu: Item[];
|
|
540
|
+
declare const pageMenu: Item[];
|
|
541
|
+
declare const spMenu: Item[];
|
|
542
|
+
declare const moreItems: (on: boolean, label: string, items: Item[]) => Item[];
|
|
543
|
+
//#endregion
|
|
544
|
+
//#region src/client/ui/shell/icons.d.ts
|
|
545
|
+
declare const icons: {
|
|
546
|
+
add: string;
|
|
547
|
+
arrowBack: string;
|
|
548
|
+
arrowDropDown: string;
|
|
549
|
+
check: string;
|
|
550
|
+
chevronRight: string;
|
|
551
|
+
closeIcon: string;
|
|
552
|
+
cloud: string;
|
|
553
|
+
deleteIcon: string;
|
|
554
|
+
folder: string;
|
|
555
|
+
home: string;
|
|
556
|
+
keep: string;
|
|
557
|
+
keepFill: string;
|
|
558
|
+
leftPanelClose: string;
|
|
559
|
+
leftPanelOpen: string;
|
|
560
|
+
menuIcon: string;
|
|
561
|
+
moreVert: string;
|
|
562
|
+
redoIcon: string;
|
|
563
|
+
schedule: string;
|
|
564
|
+
searchIcon: string;
|
|
565
|
+
settings: string;
|
|
566
|
+
help: string;
|
|
567
|
+
keyboard: string;
|
|
568
|
+
sync: string;
|
|
569
|
+
undoIcon: string;
|
|
570
|
+
unfoldMore: string;
|
|
571
|
+
visibilityOff: string;
|
|
572
|
+
createNewFolder: string;
|
|
573
|
+
uploadFile: string;
|
|
574
|
+
driveFolderUpload: string;
|
|
575
|
+
edit: string;
|
|
576
|
+
download: string;
|
|
577
|
+
info: string;
|
|
578
|
+
openInNew: string;
|
|
579
|
+
restoreFromTrash: string;
|
|
580
|
+
description: string;
|
|
581
|
+
};
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region src/client/ui/drive/config.d.ts
|
|
584
|
+
declare const config$1: DriveConfig;
|
|
585
|
+
declare const configure$1: (next: Partial<DriveConfig>) => undefined;
|
|
586
|
+
//#endregion
|
|
587
|
+
//#region src/client/ui/drive/client.d.ts
|
|
588
|
+
declare const url: (path: string) => string;
|
|
589
|
+
declare const r2: {
|
|
590
|
+
list(prefix?: string): Promise<Obj[]>;
|
|
591
|
+
get(path: string): Promise<Response>;
|
|
592
|
+
put(path: string, body: any, meta?: {
|
|
593
|
+
kind?: string;
|
|
594
|
+
site?: string;
|
|
595
|
+
type?: string;
|
|
596
|
+
}): Promise<Obj>;
|
|
597
|
+
move(from: string, to: string): Promise<Response>;
|
|
598
|
+
remove(path: string): Promise<Response>;
|
|
599
|
+
};
|
|
600
|
+
//#endregion
|
|
601
|
+
//#region src/client/ui/drive/path.d.ts
|
|
602
|
+
declare const pathname: (name: string, parent: string) => string;
|
|
603
|
+
declare const parentOf: (id: string) => string;
|
|
604
|
+
declare const idOf: (o: Obj) => string;
|
|
605
|
+
declare const ancestors: (id: string) => string[];
|
|
606
|
+
declare const extOf: (name: string) => string;
|
|
607
|
+
declare const kindOf: (name: string) => "file" | "jpg" | "mp4" | "pdf" | "xlsx";
|
|
608
|
+
declare const entryOf: (o: Obj, prev?: Entry) => Entry;
|
|
609
|
+
declare const freeName: (name: string, rows: Entry[], parent: string, trashed?: boolean) => string;
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region src/client/ui/drive/tree.d.ts
|
|
612
|
+
declare const isFolder: (e: Entry) => boolean;
|
|
613
|
+
declare const treeOf: (files: Entry[], parent: string) => Entry[];
|
|
614
|
+
declare const kindRows: (files: Entry[], kind: string) => Entry[];
|
|
615
|
+
declare const recentRows: (files: Entry[]) => Entry[];
|
|
616
|
+
declare const trashRows: (files: Entry[]) => Entry[];
|
|
617
|
+
declare const storageRows: (files: Entry[]) => Entry[];
|
|
618
|
+
declare const folderRows: (files: Entry[], folder: string) => Entry[];
|
|
619
|
+
declare const crumbSegs: (path: string) => {
|
|
620
|
+
name: string;
|
|
621
|
+
path: string;
|
|
622
|
+
}[];
|
|
623
|
+
declare const usedOf: (files: Entry[]) => number;
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region src/client/ui/drive/acts.d.ts
|
|
626
|
+
declare const mirrorFile: (ai: any, o: any) => Entry;
|
|
627
|
+
declare const saveFile: (ai: any, kind: string, name: string, parent: string, body: any, site?: string) => Promise<Entry>;
|
|
628
|
+
declare const mkdirp: (ai: any, path: string, base?: string) => Promise<string>;
|
|
629
|
+
declare const storeFiles: (ai: any, items: {
|
|
630
|
+
path: string;
|
|
631
|
+
file: File | null;
|
|
632
|
+
}[], base: string) => Promise<void>;
|
|
633
|
+
declare const syncFiles: (_input: any, ai: any) => Promise<string>;
|
|
634
|
+
declare const moveFile: ({ id, dir }: {
|
|
635
|
+
id: string;
|
|
636
|
+
dir: string;
|
|
637
|
+
}, ai: any) => Promise<string>;
|
|
638
|
+
declare const removeFile: ({ id }: {
|
|
639
|
+
id: string;
|
|
640
|
+
}, ai: any) => Promise<string>;
|
|
641
|
+
declare const restoreFile: ({ id }: {
|
|
642
|
+
id: string;
|
|
643
|
+
}, ai: any) => Promise<string>;
|
|
644
|
+
declare const renameFile: ({ id, name }: {
|
|
645
|
+
id: string;
|
|
646
|
+
name: string;
|
|
647
|
+
}, ai: any) => Promise<string>;
|
|
648
|
+
declare const emptyTrash: (_input: any, ai: any) => Promise<string>;
|
|
649
|
+
declare const usedBytes: (ai: any) => number;
|
|
650
|
+
//#endregion
|
|
651
|
+
export { AiChat, AiChatButton, type AppProps, Band, type BandProps, Brand, type BrandProps, type CardItem, Cards, type ChatCommand, type ChatConfig, type ChatHello, type ChatMsg, type ChatPrompt, type ChatTool, type Command, type CommandConfig, type DragState, type DriveConfig, DriveTree, Drop, type DropState, type Dropped, type Entry, Fold, Frame, GB, type Grab, type Habit, HeadBtn, type History, type HistoryConfig, type HistoryStore, type HistoryTalk, Icon, type Item, KB, MB, Main, MainHead, type MainHeadProps, MoreIcon, type Obj, type Over, type PlaceInput, type Placed, type Point, Pop, Row, type RowProps, SP_BREAK, type Service, Side, type SideProps, type Skip, Slot, SpBtn, SpHead, type SpHeadProps, type Storage, Storage_ as StorageBox, Strip, type TreeProps, ago, ancestors, atPoint, band, blue, config as chatConfig, closeChat, closeDrawer, configure as configureChat, configure$1 as configureDrive, createCommands, createFileDrag, createFileDrop, createHistory, createOver, crumbSegs, dragEvent, config$1 as driveConfig, dropEvent, edge, emptyTrash, emptyTrashAsk, entryOf, extOf, fill, folderRows, freeName, grid, icons, idOf, ink, isChatBusy, isDrawerOpen, isFolder, kindOf, kindRows, line, markdown, mirrorFile, mkdirp, models, moreItems, moveFile, mute, noPoint, openChat, openDrawer, pageMenu, pale, parentOf, pathname, place, prev, quota, r2, recentRows, removeFile, renameFile, restoreChat, restoreFile, rowCls, runChat, saveFile, side, sizeOf, spMenu, stamp, stop, storageMenu, storageName, storageRows, storeFiles, syncFiles, toMsg, toggleChat, trashRows, treeOf, unique, upgradeLabel, upgradeUrl, uploadAlert, uploadMax, url, usageOf, useChatBusy, useDrawer, usePoint, usedBytes, usedOf, vec2 };
|