juneau 0.1.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.
Files changed (55) hide show
  1. package/README.md +320 -0
  2. package/dist/adapters/dashboardAdapter.d.ts +10 -0
  3. package/dist/adapters/dashboardAdapter.d.ts.map +1 -0
  4. package/dist/adapters/mockAdapter.d.ts +8 -0
  5. package/dist/adapters/mockAdapter.d.ts.map +1 -0
  6. package/dist/components/AiChat/AiChat.d.ts +39 -0
  7. package/dist/components/AiChat/AiChat.d.ts.map +1 -0
  8. package/dist/components/AiChatHeader/AiChatHeader.d.ts +10 -0
  9. package/dist/components/AiChatHeader/AiChatHeader.d.ts.map +1 -0
  10. package/dist/components/AiError/AiError.d.ts +7 -0
  11. package/dist/components/AiError/AiError.d.ts.map +1 -0
  12. package/dist/components/AiInput/AiInput.d.ts +29 -0
  13. package/dist/components/AiInput/AiInput.d.ts.map +1 -0
  14. package/dist/components/AiMessageBubble/AiMessageBubble.d.ts +12 -0
  15. package/dist/components/AiMessageBubble/AiMessageBubble.d.ts.map +1 -0
  16. package/dist/components/AiMessageList/AiMessageList.d.ts +13 -0
  17. package/dist/components/AiMessageList/AiMessageList.d.ts.map +1 -0
  18. package/dist/components/AiSidebar/AiSidebar.d.ts +26 -0
  19. package/dist/components/AiSidebar/AiSidebar.d.ts.map +1 -0
  20. package/dist/components/AiTypingIndicator/AiTypingIndicator.d.ts +2 -0
  21. package/dist/components/AiTypingIndicator/AiTypingIndicator.d.ts.map +1 -0
  22. package/dist/components/JuneauProvider/JuneauProvider.d.ts +43 -0
  23. package/dist/components/JuneauProvider/JuneauProvider.d.ts.map +1 -0
  24. package/dist/components/icons.d.ts +17 -0
  25. package/dist/components/icons.d.ts.map +1 -0
  26. package/dist/components/parts/AiMessagePartRenderer.d.ts +9 -0
  27. package/dist/components/parts/AiMessagePartRenderer.d.ts.map +1 -0
  28. package/dist/components/parts/AiProposalCard.d.ts +9 -0
  29. package/dist/components/parts/AiProposalCard.d.ts.map +1 -0
  30. package/dist/components/parts/AiTablePart.d.ts +7 -0
  31. package/dist/components/parts/AiTablePart.d.ts.map +1 -0
  32. package/dist/core/stream.d.ts +8 -0
  33. package/dist/core/stream.d.ts.map +1 -0
  34. package/dist/core/types.d.ts +59 -0
  35. package/dist/core/types.d.ts.map +1 -0
  36. package/dist/hooks/useAiChat.d.ts +33 -0
  37. package/dist/hooks/useAiChat.d.ts.map +1 -0
  38. package/dist/i18n/context.d.ts +8 -0
  39. package/dist/i18n/context.d.ts.map +1 -0
  40. package/dist/i18n/index.d.ts +4 -0
  41. package/dist/i18n/index.d.ts.map +1 -0
  42. package/dist/i18n/locales/cs.d.ts +3 -0
  43. package/dist/i18n/locales/cs.d.ts.map +1 -0
  44. package/dist/i18n/locales/en.d.ts +3 -0
  45. package/dist/i18n/locales/en.d.ts.map +1 -0
  46. package/dist/i18n/types.d.ts +24 -0
  47. package/dist/i18n/types.d.ts.map +1 -0
  48. package/dist/index.cjs +49 -0
  49. package/dist/index.cjs.map +1 -0
  50. package/dist/index.d.ts +21 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +9513 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/style.css +1 -0
  55. package/package.json +80 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/core/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CACE,CAAC;AAElD;;;GAGG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,EACtC,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,EACvC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAMf"}
@@ -0,0 +1,59 @@
1
+ export type AiMessageRole = 'user' | 'assistant' | 'system';
2
+ export type AiTextPart = {
3
+ type: 'text';
4
+ text: string;
5
+ };
6
+ export type AiTablePart = {
7
+ type: 'table';
8
+ columns: string[];
9
+ rows: Record<string, unknown>[];
10
+ };
11
+ export type AiProposal = {
12
+ id: string;
13
+ title: string;
14
+ description?: string;
15
+ /** Arbitrary payload — consumer decides how to handle it */
16
+ payload?: unknown;
17
+ confirmLabel?: string;
18
+ cancelLabel?: string;
19
+ };
20
+ export type AiProposalPart = {
21
+ type: 'proposal';
22
+ proposal: AiProposal;
23
+ };
24
+ export type AiErrorPart = {
25
+ type: 'error';
26
+ message: string;
27
+ };
28
+ export type AiMessagePart = AiTextPart | AiTablePart | AiProposalPart | AiErrorPart;
29
+ export type AiMessage = {
30
+ id: string;
31
+ role: AiMessageRole;
32
+ parts: AiMessagePart[];
33
+ createdAt: Date;
34
+ };
35
+ export type AiStreamTextEvent = {
36
+ type: 'text';
37
+ text: string;
38
+ };
39
+ export type AiStreamPartEvent = {
40
+ type: 'part';
41
+ part: AiTablePart | AiProposalPart | AiErrorPart;
42
+ };
43
+ export type AiStreamDoneEvent = {
44
+ type: 'done';
45
+ };
46
+ export type AiStreamErrorEvent = {
47
+ type: 'error';
48
+ message: string;
49
+ };
50
+ export type AiStreamEvent = AiStreamTextEvent | AiStreamPartEvent | AiStreamDoneEvent | AiStreamErrorEvent;
51
+ export type AiAdapterInput = {
52
+ messages: AiMessage[];
53
+ /** Optional application context passed through — adapter can use or ignore */
54
+ context?: Record<string, unknown>;
55
+ };
56
+ export interface AiBackendAdapter {
57
+ sendMessage(input: AiAdapterInput): AsyncIterable<AiStreamEvent>;
58
+ }
59
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAG5D,MAAM,MAAM,UAAU,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E,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACjD,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;CAClE"}
@@ -0,0 +1,33 @@
1
+ import type { AiMessage, AiBackendAdapter } from '../core/types';
2
+ export type UseAiChatOptions = {
3
+ adapter: AiBackendAdapter;
4
+ /** Optional context passed through to every adapter call */
5
+ context?: Record<string, unknown>;
6
+ /** Called when a proposal is confirmed */
7
+ onProposalConfirm?: (proposalId: string, payload: unknown) => void;
8
+ /** Called when a proposal is cancelled */
9
+ onProposalCancel?: (proposalId: string) => void;
10
+ };
11
+ export type UseAiChatReturn = {
12
+ messages: AiMessage[];
13
+ input: string;
14
+ setInput: (value: string) => void;
15
+ sendMessage: () => Promise<void>;
16
+ /** Sends a message with the given text without touching the input field. Useful for programmatic/init triggers. */
17
+ sendMessageWithText: (text: string) => Promise<void>;
18
+ /**
19
+ * Triggers the adapter with a synthetic context message and streams the response
20
+ * as an assistant message — no user bubble is shown. Use this for proactive
21
+ * greetings or page-load summaries where the AI speaks first.
22
+ */
23
+ sendGreeting: (contextHint: string) => Promise<void>;
24
+ /** Aborts the in-flight stream. No-op if nothing is streaming. */
25
+ stop: () => void;
26
+ isLoading: boolean;
27
+ error: string | null;
28
+ reset: () => void;
29
+ confirmProposal: (proposalId: string, payload: unknown) => void;
30
+ cancelProposal: (proposalId: string) => void;
31
+ };
32
+ export declare function useAiChat({ adapter, context, onProposalConfirm, onProposalCancel }: UseAiChatOptions): UseAiChatReturn;
33
+ //# sourceMappingURL=useAiChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAiChat.d.ts","sourceRoot":"","sources":["../../src/hooks/useAiChat.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EAET,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AAKvB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACnE,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,mHAAmH;IACnH,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD;;;;OAIG;IACH,YAAY,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,kEAAkE;IAClE,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChE,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,gBAAgB,EACjB,EAAE,gBAAgB,GAAG,eAAe,CA4LpC"}
@@ -0,0 +1,8 @@
1
+ import type { JuneauLabels } from './types';
2
+ export declare const JuneauLabelsContext: import("react").Context<JuneauLabels>;
3
+ /**
4
+ * Returns the active label set. Falls back to English defaults for any
5
+ * key not provided by the consumer's `labels` prop on `JuneauProvider`.
6
+ */
7
+ export declare function useLabels(): JuneauLabels;
8
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/i18n/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,eAAO,MAAM,mBAAmB,uCAAwC,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,SAAS,IAAI,YAAY,CAExC"}
@@ -0,0 +1,4 @@
1
+ export type { JuneauLabels } from './types';
2
+ export { juneauEn } from './locales/en';
3
+ export { juneauCs } from './locales/cs';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { JuneauLabels } from '../types';
2
+ export declare const juneauCs: JuneauLabels;
3
+ //# sourceMappingURL=cs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cs.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/cs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,QAAQ,EAAE,YAgBtB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { JuneauLabels } from '../types';
2
+ export declare const juneauEn: JuneauLabels;
3
+ //# sourceMappingURL=en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,QAAQ,EAAE,YAgBtB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * All user-facing strings rendered by Juneau components.
3
+ *
4
+ * Pass a partial or full object to `JuneauProvider` via the `labels` prop.
5
+ * Any key you omit falls back to the English default from `juneauEn`.
6
+ */
7
+ export type JuneauLabels = {
8
+ sidebarTitle: string;
9
+ clearConversation: string;
10
+ inputPlaceholder: string;
11
+ sendMessage: string;
12
+ stopMessage: string;
13
+ actionAddFile: string;
14
+ actionQuickActions: string;
15
+ actionNew: string;
16
+ actionHistory: string;
17
+ actionRules: string;
18
+ emptyStateText: string;
19
+ emptyStateHint: string;
20
+ proposalConfirm: string;
21
+ proposalCancel: string;
22
+ errorDismiss: string;
23
+ };
24
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG;IAEzB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IAGpB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IAGvB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IAGvB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}