@percena/weft 0.4.0-next.4 → 0.4.0-next.6

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.
Files changed (71) hide show
  1. package/dist/chat.cjs +7 -883
  2. package/dist/chat.d.cts +13 -13
  3. package/dist/chat.d.ts +13 -13
  4. package/dist/chat.js +7 -883
  5. package/dist/index.cjs +96 -103
  6. package/dist/index.js +96 -103
  7. package/dist/providers-flitro.cjs +2 -276
  8. package/dist/providers-flitro.d.cts +2 -1
  9. package/dist/providers-flitro.d.ts +2 -1
  10. package/dist/providers-flitro.js +1 -260
  11. package/dist/styles/fonts/KaTeX_AMS-Regular.ttf +0 -0
  12. package/dist/styles/fonts/KaTeX_AMS-Regular.woff +0 -0
  13. package/dist/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  14. package/dist/styles/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  15. package/dist/styles/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  16. package/dist/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  17. package/dist/styles/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  18. package/dist/styles/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  19. package/dist/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  20. package/dist/styles/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  21. package/dist/styles/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  22. package/dist/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  23. package/dist/styles/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  24. package/dist/styles/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  25. package/dist/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  26. package/dist/styles/fonts/KaTeX_Main-Bold.ttf +0 -0
  27. package/dist/styles/fonts/KaTeX_Main-Bold.woff +0 -0
  28. package/dist/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
  29. package/dist/styles/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  30. package/dist/styles/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  31. package/dist/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  32. package/dist/styles/fonts/KaTeX_Main-Italic.ttf +0 -0
  33. package/dist/styles/fonts/KaTeX_Main-Italic.woff +0 -0
  34. package/dist/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
  35. package/dist/styles/fonts/KaTeX_Main-Regular.ttf +0 -0
  36. package/dist/styles/fonts/KaTeX_Main-Regular.woff +0 -0
  37. package/dist/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
  38. package/dist/styles/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  39. package/dist/styles/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  40. package/dist/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  41. package/dist/styles/fonts/KaTeX_Math-Italic.ttf +0 -0
  42. package/dist/styles/fonts/KaTeX_Math-Italic.woff +0 -0
  43. package/dist/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
  44. package/dist/styles/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  45. package/dist/styles/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  46. package/dist/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  47. package/dist/styles/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  48. package/dist/styles/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  49. package/dist/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  50. package/dist/styles/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  51. package/dist/styles/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  52. package/dist/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  53. package/dist/styles/fonts/KaTeX_Script-Regular.ttf +0 -0
  54. package/dist/styles/fonts/KaTeX_Script-Regular.woff +0 -0
  55. package/dist/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
  56. package/dist/styles/fonts/KaTeX_Size1-Regular.ttf +0 -0
  57. package/dist/styles/fonts/KaTeX_Size1-Regular.woff +0 -0
  58. package/dist/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  59. package/dist/styles/fonts/KaTeX_Size2-Regular.ttf +0 -0
  60. package/dist/styles/fonts/KaTeX_Size2-Regular.woff +0 -0
  61. package/dist/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  62. package/dist/styles/fonts/KaTeX_Size3-Regular.ttf +0 -0
  63. package/dist/styles/fonts/KaTeX_Size3-Regular.woff +0 -0
  64. package/dist/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  65. package/dist/styles/fonts/KaTeX_Size4-Regular.ttf +0 -0
  66. package/dist/styles/fonts/KaTeX_Size4-Regular.woff +0 -0
  67. package/dist/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  68. package/dist/styles/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  69. package/dist/styles/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  70. package/dist/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  71. package/package.json +1 -1
package/dist/chat.d.cts CHANGED
@@ -1,30 +1,30 @@
1
1
  export { EN_FALLBACK };
2
- import { AgentRuntime } from '@weft/runtime-core';
2
+ import { AgentRuntime, AgentRuntimeKind } from '@weft/runtime-core';
3
3
  import '@weft/timeline';
4
4
  import '@weft/provider-flitro';
5
5
 
6
6
  /**
7
- * useAgentSession — the official L1 runtime-configuration API.
7
+ * useAgentSession — runtime-agnostic hook for managing an agent session.
8
8
  *
9
- * Wraps `createFlitroEmbedRuntime` in a hook: the host backend mints
10
- * `{ server, token, sessionId }` via `POST /v1/embed/sessions` and the
11
- * component renders `<TimelineAgentChatPanel runtime={session.runtime} />`.
9
+ * The hook is provider-agnostic: the caller supplies a `createRuntime`
10
+ * factory that returns any `AgentRuntime` implementation (Flitro, Claude
11
+ * Code, Codex, or a custom one). The hook wraps it in a deferred
12
+ * lifecycle suitable for React 19 StrictMode.
12
13
  */
13
14
 
14
15
  interface UseAgentSessionOptions {
15
- /** Agent server base URL, as returned by the embed bootstrap. */
16
- server: string;
17
- /** Scoped session token from the embed bootstrap. */
18
- token: string;
19
- /** Session bound to the token. */
16
+ /** Stable session identifier runtime is recreated when this changes. */
20
17
  sessionId: string;
21
- /** Fetch a fresh token from your backend when the current one expires. */
22
- onTokenExpired?: () => Promise<string | undefined> | string | undefined;
18
+ /** Factory that produces the `AgentRuntime`. Called lazily on first interaction. */
19
+ createRuntime: () => AgentRuntime;
20
+ /** Provider name surfaced in the returned `AgentSession` (default `"agent"`). */
21
+ provider?: string;
22
+ /** Runtime kind surfaced before the real runtime is created (default `"app-server"`). */
23
+ runtimeKind?: AgentRuntimeKind;
23
24
  }
24
25
  interface AgentSession {
25
26
  runtime: AgentRuntime;
26
27
  sessionId: string;
27
- server: string;
28
28
  }
29
29
  declare function useAgentSession(options: UseAgentSessionOptions): AgentSession;
30
30
 
package/dist/chat.d.ts CHANGED
@@ -1,30 +1,30 @@
1
1
  export { EN_FALLBACK };
2
- import { AgentRuntime } from '@weft/runtime-core';
2
+ import { AgentRuntime, AgentRuntimeKind } from '@weft/runtime-core';
3
3
  import '@weft/timeline';
4
4
  import '@weft/provider-flitro';
5
5
 
6
6
  /**
7
- * useAgentSession — the official L1 runtime-configuration API.
7
+ * useAgentSession — runtime-agnostic hook for managing an agent session.
8
8
  *
9
- * Wraps `createFlitroEmbedRuntime` in a hook: the host backend mints
10
- * `{ server, token, sessionId }` via `POST /v1/embed/sessions` and the
11
- * component renders `<TimelineAgentChatPanel runtime={session.runtime} />`.
9
+ * The hook is provider-agnostic: the caller supplies a `createRuntime`
10
+ * factory that returns any `AgentRuntime` implementation (Flitro, Claude
11
+ * Code, Codex, or a custom one). The hook wraps it in a deferred
12
+ * lifecycle suitable for React 19 StrictMode.
12
13
  */
13
14
 
14
15
  interface UseAgentSessionOptions {
15
- /** Agent server base URL, as returned by the embed bootstrap. */
16
- server: string;
17
- /** Scoped session token from the embed bootstrap. */
18
- token: string;
19
- /** Session bound to the token. */
16
+ /** Stable session identifier runtime is recreated when this changes. */
20
17
  sessionId: string;
21
- /** Fetch a fresh token from your backend when the current one expires. */
22
- onTokenExpired?: () => Promise<string | undefined> | string | undefined;
18
+ /** Factory that produces the `AgentRuntime`. Called lazily on first interaction. */
19
+ createRuntime: () => AgentRuntime;
20
+ /** Provider name surfaced in the returned `AgentSession` (default `"agent"`). */
21
+ provider?: string;
22
+ /** Runtime kind surfaced before the real runtime is created (default `"app-server"`). */
23
+ runtimeKind?: AgentRuntimeKind;
23
24
  }
24
25
  interface AgentSession {
25
26
  runtime: AgentRuntime;
26
27
  sessionId: string;
27
- server: string;
28
28
  }
29
29
  declare function useAgentSession(options: UseAgentSessionOptions): AgentSession;
30
30