@agimon-ai/po-native-dashboard 0.0.0-alpha.65 → 0.0.0-alpha.67

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 (44) hide show
  1. package/LICENSE +21 -149
  2. package/dist/components/CaptureTray.d.mts.map +1 -1
  3. package/dist/components/CaptureTray.mjs +5 -3
  4. package/dist/components/CaptureTray.mjs.map +1 -1
  5. package/dist/components/CompletionSheet.d.mts.map +1 -1
  6. package/dist/components/CompletionSheet.mjs +35 -29
  7. package/dist/components/CompletionSheet.mjs.map +1 -1
  8. package/dist/components/Composer.d.mts.map +1 -1
  9. package/dist/components/Composer.mjs +26 -24
  10. package/dist/components/Composer.mjs.map +1 -1
  11. package/dist/components/DialogSheet.d.mts.map +1 -1
  12. package/dist/components/DialogSheet.mjs +4 -2
  13. package/dist/components/DialogSheet.mjs.map +1 -1
  14. package/dist/components/MessageActionsSheet.d.mts.map +1 -1
  15. package/dist/components/MessageActionsSheet.mjs +3 -1
  16. package/dist/components/MessageActionsSheet.mjs.map +1 -1
  17. package/dist/components/MoveSessionSheet.d.mts.map +1 -1
  18. package/dist/components/MoveSessionSheet.mjs +23 -29
  19. package/dist/components/MoveSessionSheet.mjs.map +1 -1
  20. package/dist/components/SessionMenus.d.mts +1 -1
  21. package/dist/components/SessionMenus.d.mts.map +1 -1
  22. package/dist/components/SessionMenus.mjs +109 -123
  23. package/dist/components/SessionMenus.mjs.map +1 -1
  24. package/dist/components/TimelineItem.d.mts +2 -0
  25. package/dist/components/TimelineItem.d.mts.map +1 -1
  26. package/dist/components/TimelineItem.mjs +57 -49
  27. package/dist/components/TimelineItem.mjs.map +1 -1
  28. package/dist/components/richText.mjs +18 -0
  29. package/dist/components/richText.mjs.map +1 -0
  30. package/dist/components/sessionGroups.mjs +5 -3
  31. package/dist/components/sessionGroups.mjs.map +1 -1
  32. package/dist/components/sessionTimeline.mjs +4 -2
  33. package/dist/components/sessionTimeline.mjs.map +1 -1
  34. package/dist/components/slotProps.d.mts.map +1 -1
  35. package/dist/components/slotProps.mjs +3 -2
  36. package/dist/components/slotProps.mjs.map +1 -1
  37. package/dist/screens/SessionScreen.d.mts +1 -1
  38. package/dist/screens/SessionScreen.d.mts.map +1 -1
  39. package/dist/screens/SessionScreen.mjs +42 -20
  40. package/dist/screens/SessionScreen.mjs.map +1 -1
  41. package/dist/screens/SessionsScreen.d.mts.map +1 -1
  42. package/dist/screens/SessionsScreen.mjs +153 -114
  43. package/dist/screens/SessionsScreen.mjs.map +1 -1
  44. package/package.json +8 -8
package/LICENSE CHANGED
@@ -1,149 +1,21 @@
1
- License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
2
- "Business Source License" is a trademark of MariaDB Corporation Ab.
3
-
4
- Parameters
5
-
6
- Licensor: Agimon Pty Ltd
7
- Licensed Work: Po, the software in the Po source repository and the
8
- packages released from it, in each version released by
9
- the Licensor.
10
- The Licensed Work is (c) 2026 Agimon Pty Ltd.
11
- Material identified as third-party in the "Third-party
12
- components" section at the end of this file or in a
13
- NOTICE file, and any package or directory whose own
14
- license file grants a different license, is not part of
15
- the Licensed Work and remains under its own license.
16
- Additional Use Grant: You may make production use of the Licensed Work if
17
- your use is Eligible Use. "Eligible Use" is production use that falls
18
- within at least one of the following:
19
-
20
- (a) Personal Use. Use by an individual for their own personal purposes,
21
- and not on behalf of, or for the benefit of, an employer, client, or
22
- other Organization. Use by an individual in the course of employment
23
- or engagement by an Organization is use by that Organization.
24
-
25
- (b) Small Organization Use. Use by or on behalf of an Organization whose
26
- Annual Revenue is less than USD 1,000,000.
27
-
28
- (c) Non-profit, Education and Research Use. Use, regardless of Annual
29
- Revenue, by (i) an Organization registered or recognized as a
30
- non-profit or charitable organization under the laws of its
31
- jurisdiction, for its non-profit purposes; (ii) an accredited school,
32
- college, or university, for teaching, learning, or academic research;
33
- or (iii) a publicly funded research institution, for its research.
34
-
35
- (d) Service Provider Use. Use by a consultant, contractor, agency, or other
36
- service provider, regardless of its own Annual Revenue, solely to
37
- build, deploy, host, operate, or support the Licensed Work for a client
38
- whose own use would be Eligible Use under (a), (b), or (c). A service
39
- provider's use for its own purposes is Eligible Use only if the service
40
- provider itself qualifies under (b) or (c).
41
-
42
-
43
- Hosted services. Offering the Licensed Work to third parties as a hosted
44
- or managed service whose primary value is the Licensed Work is Eligible
45
- Use only if each such third party's own use would be Eligible Use.
46
-
47
- Definitions. "Organization" means any company, partnership, sole
48
- proprietorship, trust, association, government body, or other entity, and
49
- includes an individual acting in a business or professional capacity.
50
- "Affiliate" means any entity that directly or indirectly controls, is
51
- controlled by, or is under common control with an Organization, where
52
- "control" means ownership of more than 50% of the voting interests of an
53
- entity or the power to direct its management and policies by contract or
54
- otherwise. "Annual Revenue" means the total gross revenue of an
55
- Organization and all of its Affiliates combined, from all sources and
56
- whether or not related to the Licensed Work, for its most recently
57
- completed fiscal year, or, if it has not completed a fiscal year, for the
58
- twelve months before the use (or since its formation, if shorter),
59
- converted into US dollars at the average exchange rate for that period.
60
- Proceeds of equity or debt financing are not revenue.
61
-
62
- Threshold. If an Organization stops qualifying under (b), its existing
63
- production use remains Eligible Use for 90 days after it stops
64
- qualifying, after which it must obtain a commercial license or stop
65
- production use. Use that was Eligible Use when it occurred never requires
66
- a commercial license after the fact.
67
- Change Date: Four years from the date a version of the Licensed Work
68
- is first publicly released by the Licensor.
69
- Change License: Apache License, Version 2.0
70
-
71
- For information about alternative licensing arrangements for the Licensed
72
- Work, please visit: https://agimon.ai/licensing
73
-
74
- Notice
75
-
76
- The Business Source License (this document, or the "License") is not an Open
77
- Source license. However, the Licensed Work will eventually be made available
78
- under an Open Source License, as stated in this License.
79
-
80
- -----------------------------------------------------------------------------
81
-
82
- Business Source License 1.1
83
-
84
- Terms
85
-
86
- The Licensor hereby grants you the right to copy, modify, create derivative
87
- works, redistribute, and make non-production use of the Licensed Work. The
88
- Licensor may make an Additional Use Grant, above, permitting limited
89
- production use.
90
-
91
- Effective on the Change Date, or the fourth anniversary of the first publicly
92
- available distribution of a specific version of the Licensed Work under this
93
- License, whichever comes first, the Licensor hereby grants you rights under
94
- the terms of the Change License, and the rights granted in the paragraph
95
- above terminate.
96
-
97
- If your use of the Licensed Work does not comply with the requirements
98
- currently in effect as described in this License, you must purchase a
99
- commercial license from the Licensor, its affiliated entities, or authorized
100
- resellers, or you must refrain from using the Licensed Work.
101
-
102
- All copies of the original and modified Licensed Work, and derivative works
103
- of the Licensed Work, are subject to this License. This License applies
104
- separately for each version of the Licensed Work and the Change Date may vary
105
- for each version of the Licensed Work released by Licensor.
106
-
107
- You must conspicuously display this License on each original or modified copy
108
- of the Licensed Work. If you receive the Licensed Work in original or
109
- modified form from a third party, the terms and conditions set forth in this
110
- License apply to your use of that work.
111
-
112
- Any use of the Licensed Work in violation of this License will automatically
113
- terminate your rights under this License for the current and all other
114
- versions of the Licensed Work.
115
-
116
- This License does not grant you any right in any trademark or logo of
117
- Licensor or its affiliates (provided that you may use a trademark or logo of
118
- Licensor as expressly required by this License).
119
-
120
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
121
- AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
122
- EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
123
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
124
- TITLE.
125
-
126
- MariaDB hereby grants you permission to use this License’s text to license
127
- your works, and to refer to it using the trademark “Business Source License”,
128
- as long as you comply with the Covenants of Licensor below.
129
-
130
- Covenants of Licensor
131
-
132
- In consideration of the right to use this License’s text and the “Business
133
- Source License” name and trademark, Licensor covenants to MariaDB, and to all
134
- other recipients of the licensed work to be provided by Licensor:
135
-
136
- 1. To specify as the Change License the GPL Version 2.0 or any later version,
137
- or a license that is compatible with GPL Version 2.0 or a later version,
138
- where “compatible” means that software provided under the Change License can
139
- be included in a program with software provided under GPL Version 2.0 or a
140
- later version. Licensor may specify additional Change Licenses without
141
- limitation.
142
-
143
- 2. To either: (a) specify an additional grant of rights to use that does not
144
- impose any additional restriction on the right granted in this License, as
145
- the Additional Use Grant; or (b) insert the text “None”.
146
-
147
- 3. To specify a Change Date.
148
-
149
- 4. Not to modify this License in any other way.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agimon Pty Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1 +1 @@
1
- {"version":3,"file":"CaptureTray.d.mts","names":[],"sources":["../../src/components/CaptureTray.tsx"],"mappings":";;iBAQiB;EACf,mBAAmB;;EAEnB;EACA,WAAW,SAAS;;;wBAIN,cAAc,UAAU,SAAS,YAAY,mCAAgB,IAAA"}
1
+ {"version":3,"file":"CaptureTray.d.mts","names":[],"sources":["../../src/components/CaptureTray.tsx"],"mappings":";;iBASiB;EACf,mBAAmB;;EAEnB;EACA,WAAW,SAAS;;;wBAIN,cAAc,UAAU,SAAS,YAAY,mCAAgB,IAAA"}
@@ -6,12 +6,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { ScrollView } from "react-native-unistyles/components/native/ScrollView";
7
7
  import { Pressable } from "react-native-unistyles/components/native/Pressable";
8
8
  import { Image } from "react-native-unistyles/components/native/Image";
9
+ import { useT } from "@agimon-ai/po-core/native";
9
10
 
10
11
  //#region src/components/CaptureTray.tsx
11
12
  const TILE = 64;
12
13
  const REMOVE = 22;
13
14
  /** The images staged for the next message as thumbnails, led by a Paste tile while the clipboard holds one. */
14
15
  function CaptureTray({ captures, onPaste, onRemove }) {
16
+ const t = useT();
15
17
  if (!onPaste && captures.length === 0) return null;
16
18
  return /* @__PURE__ */ jsxs(ScrollView, {
17
19
  horizontal: true,
@@ -19,7 +21,7 @@ function CaptureTray({ captures, onPaste, onRemove }) {
19
21
  contentContainerStyle: styles.tray,
20
22
  children: [onPaste ? /* @__PURE__ */ jsxs(Pressable, {
21
23
  accessibilityRole: "button",
22
- accessibilityLabel: "Paste image",
24
+ accessibilityLabel: t("nativeDashboard.captureTray.pasteImage", "Paste image"),
23
25
  onPress: onPaste,
24
26
  style: ({ pressed }) => [
25
27
  styles.tile,
@@ -31,7 +33,7 @@ function CaptureTray({ captures, onPaste, onRemove }) {
31
33
  color: "magenta"
32
34
  }), /* @__PURE__ */ jsx(Text, {
33
35
  style: styles.pasteText,
34
- children: "Paste"
36
+ children: t("nativeDashboard.captureTray.paste", "Paste")
35
37
  })]
36
38
  }) : null, captures.map((capture) => /* @__PURE__ */ jsxs(View, {
37
39
  style: styles.tile,
@@ -41,7 +43,7 @@ function CaptureTray({ captures, onPaste, onRemove }) {
41
43
  accessibilityLabel: capture.context.label
42
44
  }), /* @__PURE__ */ jsx(Pressable, {
43
45
  accessibilityRole: "button",
44
- accessibilityLabel: `Remove ${capture.context.label}`,
46
+ accessibilityLabel: t("nativeDashboard.captureTray.remove", "Remove {label}", { label: capture.context.label }),
45
47
  onPress: () => onRemove(capture),
46
48
  hitSlop: 11,
47
49
  style: styles.remove,
@@ -1 +1 @@
1
- {"version":3,"file":"CaptureTray.mjs","names":["ComposerCapture","CloseIcon","fontOf","ImageIcon","StyleSheet","TILE","REMOVE","CaptureTrayProps","captures","onPaste","onRemove","capture","CaptureTray","length","styles","tray","pressed","tile","paste","pasteText","map","context","source","id","uri","mimeType","data","image","label","remove","create","theme","gap","spacing","paddingTop","paddingRight","uni__dependencies","width","height","borderRadius","lg","borderWidth","borderColor","colors","border","backgroundColor","panel","alignItems","justifyContent","borderStyle","opacity","fontFamily","sans","fontSize","xs","lineHeight","fontWeight","semibold","color","magenta","position","top","right","hi"],"sources":["../../src/components/CaptureTray.tsx"],"sourcesContent":["import type { ComposerCapture } from '@agimon-ai/po-core/web';\nimport { CloseIcon, fontOf, ImageIcon } from '@agimon-ai/po-native-components';\nimport { Image, Pressable, ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nconst TILE = 64;\nconst REMOVE = 22;\n\nexport interface CaptureTrayProps {\n captures: readonly ComposerCapture[];\n /** Shows the Paste tile first; omit it when there is nothing to paste or no room left. */\n onPaste?: () => void;\n onRemove: (capture: ComposerCapture) => void;\n}\n\n/** The images staged for the next message as thumbnails, led by a Paste tile while the clipboard holds one. */\nexport function CaptureTray({ captures, onPaste, onRemove }: CaptureTrayProps) {\n if (!onPaste && captures.length === 0) return null;\n return (\n <ScrollView horizontal keyboardShouldPersistTaps=\"handled\" contentContainerStyle={styles.tray}>\n {onPaste ? (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Paste image\"\n onPress={onPaste}\n style={({ pressed }) => [styles.tile, styles.paste, pressed && styles.pressed]}\n >\n <ImageIcon size={20} color=\"magenta\" />\n <Text style={styles.pasteText}>Paste</Text>\n </Pressable>\n ) : null}\n {captures.map((capture) => (\n <View key={`${capture.context.source}:${capture.context.id}`} style={styles.tile}>\n <Image\n source={{ uri: `data:${capture.mimeType};base64,${capture.data}` }}\n style={styles.image}\n accessibilityLabel={capture.context.label}\n />\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={`Remove ${capture.context.label}`}\n onPress={() => onRemove(capture)}\n // The visible dot is small; the slop keeps a 44pt target.\n hitSlop={(44 - REMOVE) / 2}\n style={styles.remove}\n >\n <CloseIcon size={12} color=\"bg\" />\n </Pressable>\n </View>\n ))}\n </ScrollView>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n tray: { gap: theme.spacing(2), paddingTop: theme.spacing(1.5), paddingRight: theme.spacing(1.5) },\n tile: {\n width: TILE,\n height: TILE,\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: theme.colors.panel,\n },\n paste: {\n alignItems: 'center',\n justifyContent: 'center',\n gap: theme.spacing(1),\n borderStyle: 'dashed',\n borderColor: theme.colors['edge-magenta'],\n backgroundColor: theme.colors['tint-magenta'],\n },\n pressed: { opacity: 0.7 },\n pasteText: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.xs,\n lineHeight: theme.lineHeight.xs,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.magenta,\n },\n image: { width: '100%', height: '100%', borderRadius: theme.borderRadius.lg - 1 },\n remove: {\n position: 'absolute',\n top: -theme.spacing(1.5),\n right: -theme.spacing(1.5),\n width: REMOVE,\n height: REMOVE,\n borderRadius: REMOVE / 2,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.hi,\n },\n}));\n"],"mappings":";;;;;;;;;;AAKA,MAAMK,OAAO;AACb,MAAMC,SAAS;;AAUf,SAAgBM,YAAY,EAAEJ,UAAUC,SAASC,YAA8B;CAC7E,IAAI,CAACD,WAAWD,SAASK,WAAW,GAAG,OAAO;CAC9C,OACE,qBAAC,YAAD;EAAY;EAAW,2BAA0B;EAAU,uBAAuBC,OAAOC;YAAzF,CACGN,UACC,qBAAC,WAAD;GACE,mBAAkB;GAClB,oBAAmB;GACnB,SAASA;GACT,Q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CACApB,SAAS,EAAEkC,SAAS,GAAI;CACxB/B,WAAW;EACTgC,YAAYjD,OAAO6B,MAAMoB,WAAWC,IAAI;EACxCC,UAAUtB,MAAMsB,SAASC;EACzBC,YAAYxB,MAAMwB,WAAWD;EAC7BE,YAAYzB,MAAMyB,WAAWC;EAC7BC,OAAO3B,MAAMY,OAAOgB;EAAOvB,mBAAA,CAAA,CAAA;CAC7B;CACAT,OAAO;EAAEU,OAAO;EAAQC,QAAQ;EAAQC,cAAcR,MAAMQ,aAAaC,KAAK;EAACJ,mBAAA,CAAA,CAAA;CAAC;CAChFP,QAAQ;EACN+B,UAAU;EACVC,KAAK,CAAC9B,MAAME,QAAQ,GAAG;EACvB6B,OAAO,CAAC/B,MAAME,QAAQ,GAAG;EACzBI,OAAO/B;EACPgC,QAAQhC;EACRiC,cAAcjC,SAAS;EACvByC,YAAY;EACZC,gBAAgB;EAChBH,iBAAiBd,MAAMY,OAAOoB;EAAE3B,mBAAA,CAAA,CAAA;CAClC;AACF,EAAE"}
1
+ {"version":3,"file":"CaptureTray.mjs","names":["useT","ComposerCapture","CloseIcon","fontOf","ImageIcon","StyleSheet","TILE","REMOVE","CaptureTrayProps","captures","onPaste","onRemove","capture","CaptureTray","t","length","styles","tray","pressed","tile","paste","pasteText","map","context","source","id","uri","mimeType","data","image","label","remove","create","theme","gap","spacing","paddingTop","paddingRight","uni__dependencies","width","height","borderRadius","lg","borderWidth","borderColor","colors","border","backgroundColor","panel","alignItems","justifyContent","borderStyle","opacity","fontFamily","sans","fontSize","xs","lineHeight","fontWeight","semibold","color","magenta","position","top","right","hi"],"sources":["../../src/components/CaptureTray.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/native';\nimport type { ComposerCapture } from '@agimon-ai/po-core/web';\nimport { CloseIcon, fontOf, ImageIcon } from '@agimon-ai/po-native-components';\nimport { Image, Pressable, ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nconst TILE = 64;\nconst REMOVE = 22;\n\nexport interface CaptureTrayProps {\n captures: readonly ComposerCapture[];\n /** Shows the Paste tile first; omit it when there is nothing to paste or no room left. */\n onPaste?: () => void;\n onRemove: (capture: ComposerCapture) => void;\n}\n\n/** The images staged for the next message as thumbnails, led by a Paste tile while the clipboard holds one. */\nexport function CaptureTray({ captures, onPaste, onRemove }: CaptureTrayProps) {\n const t = useT();\n if (!onPaste && captures.length === 0) return null;\n return (\n <ScrollView horizontal keyboardShouldPersistTaps=\"handled\" contentContainerStyle={styles.tray}>\n {onPaste ? (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.captureTray.pasteImage', 'Paste image')}\n onPress={onPaste}\n style={({ pressed }) => [styles.tile, styles.paste, pressed && styles.pressed]}\n >\n <ImageIcon size={20} color=\"magenta\" />\n <Text style={styles.pasteText}>{t('nativeDashboard.captureTray.paste', 'Paste')}</Text>\n </Pressable>\n ) : null}\n {captures.map((capture) => (\n <View key={`${capture.context.source}:${capture.context.id}`} style={styles.tile}>\n <Image\n source={{ uri: `data:${capture.mimeType};base64,${capture.data}` }}\n style={styles.image}\n accessibilityLabel={capture.context.label}\n />\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.captureTray.remove', 'Remove {label}', {\n label: capture.context.label,\n })}\n onPress={() => onRemove(capture)}\n // The visible dot is small; the slop keeps a 44pt target.\n hitSlop={(44 - REMOVE) / 2}\n style={styles.remove}\n >\n <CloseIcon size={12} color=\"bg\" />\n </Pressable>\n </View>\n ))}\n </ScrollView>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n tray: { gap: theme.spacing(2), paddingTop: theme.spacing(1.5), paddingRight: theme.spacing(1.5) },\n tile: {\n width: TILE,\n height: TILE,\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: theme.colors.panel,\n },\n paste: {\n alignItems: 'center',\n justifyContent: 'center',\n gap: theme.spacing(1),\n borderStyle: 'dashed',\n borderColor: theme.colors['edge-magenta'],\n backgroundColor: theme.colors['tint-magenta'],\n },\n pressed: { opacity: 0.7 },\n pasteText: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.xs,\n lineHeight: theme.lineHeight.xs,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.magenta,\n },\n image: { width: '100%', height: '100%', borderRadius: theme.borderRadius.lg - 1 },\n remove: {\n position: 'absolute',\n top: -theme.spacing(1.5),\n right: -theme.spacing(1.5),\n width: REMOVE,\n height: REMOVE,\n borderRadius: REMOVE / 2,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.hi,\n },\n}));\n"],"mappings":";;;;;;;;;;;AAMA,MAAMM,OAAO;AACb,MAAMC,SAAS;;AAUf,SAAgBM,YAAY,EAAEJ,UAAUC,SAASC,YAA8B;CAC7E,MAAMG,IAAId,KAAK;CACf,IAAI,CAACU,WAAWD,SAASM,WAAW,GAAG,OAAO;CAC9C,OACE,qBAAC,YAAD;EAAY;EAAW,2BAA0B;EAAU,uBAAuBC,OAAOC;YAAzF,CACGP,UACC,qBAAC,WAAD;GACE,mBAAkB;GAClB,oBAAoBI,EAAE,0CAA0C,aAAa;GAC7E,SAASJ;GACT,QAAQ,EAAEQ,cAAc;IAACF,OAAOG;IAAMH,OAAOI;IAAOF,WAAWF,OAAOE;GAAO;aAJ/E,CAME,oBAAC,WAAD;IAAW,MAAM;IAAI,OAAM;GAAS,IACpC,oBAAC,MAAD;IAAM,OAAOF,OAAOK;cAAYP,EAAE,qCAAqC,OAAO;GAAQ,EAC7E;OACT,MACHL,SAASa,KAAKV,YACb,qBAAC,MAAD;GAA8D,OAAOI,OAAOG;aAA5E,CACE,oBAAC,OAAD;IACE,QAAQ,EAAEO,KAAK,QAAQd,QAAQe,SAAQ,UAAWf,QAAQgB,OAAO;IACjE,OAAOZ,OAAOa;IACd,oBAAoBjB,QAAQW,QAAQO;GAAM,IAE5C,oBAAC,WAAD;IACE,mBAAkB;I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VC,KAAK,CAAC9B,MAAME,QAAQ,GAAG;EACvB6B,OAAO,CAAC/B,MAAME,QAAQ,GAAG;EACzBI,OAAOhC;EACPiC,QAAQjC;EACRkC,cAAclC,SAAS;EACvB0C,YAAY;EACZC,gBAAgB;EAChBH,iBAAiBd,MAAMY,OAAOoB;EAAE3B,mBAAA,CAAA,CAAA;CAClC;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"CompletionSheet.d.mts","names":[],"sources":["../../src/components/CompletionSheet.tsx"],"mappings":";;;iBA+CiB;EACf,mBAAmB;EACnB,cAAc,kBAAkB;;EAEhC,cAAc;IAA6B;IAAc;;;EAEzD,0BAA0B;;;wBAiCZ,mBACd,QAAQ,8BACR,MAAM,uBACN,gBACC;;wBA4Ba,iBACd,OACA;EAEA,gBAAgB;EAChB,SAAS,MAAM;oBAChB,IAAA;iBA2BgB;EACf;EACA,eAAe;EACf,QAAQ;EACR,SAAS,MAAM,gBAAgB,MAAM;;EAErC,cAAc;EACd;;EAEA;;EAEA,YAAY;;EAEZ,mBAAmB;;iBAGJ;EACf;EACA;EACA;EACA;EACA;;;wBAIc,kBACd,MACA,cACA,QACA,QACA,aACA,cACA,aACA,WACA,WACC,uCAAoB,IAAA;;wBA2HP,mBAAmB;EAAa;oBAAqB,IAAA"}
1
+ {"version":3,"file":"CompletionSheet.d.mts","names":[],"sources":["../../src/components/CompletionSheet.tsx"],"mappings":";;;iBA4DiB;EACf,mBAAmB;EACnB,cAAc,kBAAkB;;EAEhC,cAAc;IAA6B;IAAc;;;EAEzD,0BAA0B;;;wBAiCZ,mBACd,QAAQ,8BACR,MAAM,uBACN,gBACC;;wBA4Ba,iBACd,OACA;EAEA,gBAAgB;EAChB,SAAS,MAAM;oBAChB,IAAA;iBA2BgB;EACf;EACA,eAAe;EACf,QAAQ;EACR,SAAS,MAAM,gBAAgB,MAAM;;EAErC,cAAc;EACd;;EAEA;;EAEA,YAAY;;EAEZ,mBAAmB;;iBAGJ;EACf;EACA;EACA;EACA;EACA;;;wBAIc,kBACd,MACA,cACA,QACA,QACA,aACA,cACA,aACA,WACA,WACC,uCAAoB,IAAA;;wBA6HP,mBAAmB;EAAa;oBAAqB,IAAA"}
@@ -4,34 +4,37 @@ import { ChevronRightIcon, Input, Sheet, SheetContent, SparklesIcon, Spinner, fo
4
4
  import { StyleSheet } from "react-native-unistyles";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Pressable } from "react-native-unistyles/components/native/Pressable";
7
+ import { useT } from "@agimon-ai/po-core/native";
7
8
  import { HOST_SLOTS, TRIGGER_CHARS, commandCompletions, fileCompletions, sessionCompletions, slotFills } from "@agimon-ai/po-web-dashboard/core";
8
9
  import { useEffect, useEffectEvent, useState } from "react";
9
10
 
10
11
  //#region src/components/CompletionSheet.tsx
11
12
  /** The phone's way into `@`, `$` and `/`: what each kind is called and what it is for. */
12
- const KINDS = [
13
- {
14
- kind: "file",
15
- title: "Files and sessions",
16
- hint: "Point Po at a file in this folder or another session",
17
- search: "Search files and sessions",
18
- none: "No files or sessions match"
19
- },
20
- {
21
- kind: "skill",
22
- title: "Skills",
23
- hint: "Use one of your skills",
24
- search: "Search skills",
25
- none: "No skills match"
26
- },
27
- {
28
- kind: "command",
29
- title: "Slash commands",
30
- hint: "Run a session command",
31
- search: "Search commands",
32
- none: "No commands match"
33
- }
34
- ];
13
+ function completionKinds(t) {
14
+ return [
15
+ {
16
+ kind: "file",
17
+ title: t("nativeDashboard.completion.filesTitle", "Files and sessions"),
18
+ hint: t("nativeDashboard.completion.filesHint", "Point Po at a file in this folder or another session"),
19
+ search: t("nativeDashboard.completion.filesSearch", "Search files and sessions"),
20
+ none: t("nativeDashboard.completion.filesNone", "No files or sessions match")
21
+ },
22
+ {
23
+ kind: "skill",
24
+ title: t("nativeDashboard.completion.skillsTitle", "Skills"),
25
+ hint: t("nativeDashboard.completion.skillsHint", "Use one of your skills"),
26
+ search: t("nativeDashboard.completion.skillsSearch", "Search skills"),
27
+ none: t("nativeDashboard.completion.skillsNone", "No skills match")
28
+ },
29
+ {
30
+ kind: "command",
31
+ title: t("nativeDashboard.completion.commandsTitle", "Slash commands"),
32
+ hint: t("nativeDashboard.completion.commandsHint", "Run a session command"),
33
+ search: t("nativeDashboard.completion.commandsSearch", "Search commands"),
34
+ none: t("nativeDashboard.completion.commandsNone", "No commands match")
35
+ }
36
+ ];
37
+ }
35
38
  /** The hub is a tunnel away, so wait for a pause in typing before asking it. */
36
39
  const FILE_SEARCH_DEBOUNCE_MS = 150;
37
40
  function textField(data, key) {
@@ -122,11 +125,13 @@ function CompletionRows({ items, onPick }) {
122
125
  }
123
126
  /** The magic button's sheet: choose Files, Skills, Slash commands, a plugin page or an attachment, then pick one. */
124
127
  function CompletionSheet({ open, onOpenChange, source, onPick, defaultKind, defaultQuery = "", defaultPage, slotProps, actions = [] }) {
128
+ const t = useT();
129
+ const kinds = completionKinds(t);
125
130
  const [kind, setKind] = useState(defaultKind ?? null);
126
131
  const [pageKey, setPageKey] = useState(defaultPage ?? null);
127
132
  const [query, setQuery] = useState(defaultQuery);
128
133
  const items = useCompletionItems(source, kind, query);
129
- const page = KINDS.find((entry) => entry.kind === kind);
134
+ const page = kinds.find((entry) => entry.kind === kind);
130
135
  const pages = slotProps ? insertPages(slotProps.sessionId) : [];
131
136
  const plugin = pages.find((entry) => entry.key === pageKey);
132
137
  const choose = (next) => {
@@ -139,7 +144,7 @@ function CompletionSheet({ open, onOpenChange, source, onPick, defaultKind, defa
139
144
  onOpenChange(next);
140
145
  };
141
146
  const rows = [
142
- ...KINDS.map((entry) => ({
147
+ ...kinds.map((entry) => ({
143
148
  key: entry.kind,
144
149
  glyph: TRIGGER_CHARS[entry.kind],
145
150
  title: entry.title,
@@ -166,7 +171,7 @@ function CompletionSheet({ open, onOpenChange, source, onPick, defaultKind, defa
166
171
  children: [
167
172
  /* @__PURE__ */ jsx(Pressable, {
168
173
  accessibilityRole: "button",
169
- accessibilityLabel: "Back to insert",
174
+ accessibilityLabel: t("nativeDashboard.completion.back", "Back to insert"),
170
175
  onPress: () => choose(null),
171
176
  disabled: page === void 0 && plugin === void 0,
172
177
  style: [styles.back, page === void 0 && plugin === void 0 && styles.hidden],
@@ -181,7 +186,7 @@ function CompletionSheet({ open, onOpenChange, source, onPick, defaultKind, defa
181
186
  /* @__PURE__ */ jsx(Text, {
182
187
  style: styles.title,
183
188
  accessibilityRole: "header",
184
- children: page?.title ?? plugin?.title ?? "Insert"
189
+ children: page?.title ?? plugin?.title ?? t("nativeDashboard.completion.title", "Insert")
185
190
  }),
186
191
  /* @__PURE__ */ jsx(View, { style: [styles.back, styles.hidden] })
187
192
  ]
@@ -241,7 +246,7 @@ function CompletionSheet({ open, onOpenChange, source, onPick, defaultKind, defa
241
246
  children: /* @__PURE__ */ jsx(Spinner, {
242
247
  size: "small",
243
248
  color: "dim",
244
- label: "Searching"
249
+ label: t("nativeDashboard.completion.searching", "Searching")
245
250
  })
246
251
  }) : items.length === 0 ? /* @__PURE__ */ jsx(Text, {
247
252
  style: styles.none,
@@ -258,9 +263,10 @@ function CompletionSheet({ open, onOpenChange, source, onPick, defaultKind, defa
258
263
  }
259
264
  /** The composer's round button that opens the sheet. */
260
265
  function CompletionButton({ onPress }) {
266
+ const t = useT();
261
267
  return /* @__PURE__ */ jsx(Pressable, {
262
268
  accessibilityRole: "button",
263
- accessibilityLabel: "Insert or attach",
269
+ accessibilityLabel: t("nativeDashboard.completion.open", "Insert or attach"),
264
270
  onPress,
265
271
  hitSlop: 6,
266
272
  style: ({ pressed }) => [styles.magic, pressed && styles.magicPressed],
@@ -1 +1 @@
1
- {"version":3,"file":"CompletionSheet.mjs","names":["WebPluginSlotProps","ChevronRightIcon","fontOf","Input","Sheet","SheetContent","SparklesIcon","Spinner","CommandInfo","CompletionItem","CompletionKind","commandCompletions","fileCompletions","HOST_SLOTS","MentionableSession","sessionCompletions","slotFills","TRIGGER_CHARS","ComponentType","useEffect","useEffectEvent","useState","StyleSheet","KINDS","kind","title","hint","search","none","FILE_SEARCH_DEBOUNCE_MS","CompletionSource","commands","searchFiles","query","Promise","references","path","detail","sessions","InsertPage","key","glyph","component","textField","data","undefined","value","Reflect","get","insertPages","sessionId","composerMenu","flatMap","pluginId","id","charAt","useCompletionItems","source","files","setFiles","items","searchable","text","resolve","current","timer","setTimeout","then","found","clearTimeout","length","CompletionRows","onPick","item","styles","list","map","index","insert","label","pressed","divider","flex","itemLabel","meta","CompletionSheetProps","open","onOpenChange","defaultKind","defaultQuery","defaultPage","slotProps","actions","InsertAction","onPress","CompletionSheet","setKind","pageKey","setPageKey","setQuery","page","find","entry","pages","plugin","choose","next","close","rows","head","back","hidden","flip","appendComposerDraft","body","glyphText","kindLabel","waiting","CompletionButton","magic","magicPressed","create","theme","sans","fontFamily","mono","size","color","fontSize","lineHeight","minWidth","opacity","transform","rotate","flexDirection","alignItems","paddingHorizontal","spacing","paddingBottom","uni__dependencies","width","height","justifyContent","colors","hi","fontWeight","semibold","textAlign","gap","borderRadius","lg","borderWidth","borderColor","backgroundColor","bg","overflow","minHeight","paddingVertical","borderTopWidth","hairlineWidth","borderTopColor","green","medium","dim"],"sources":["../../src/components/CompletionSheet.tsx"],"sourcesContent":["import type { WebPluginSlotProps } from '@agimon-ai/po-core/web';\nimport {\n ChevronRightIcon,\n fontOf,\n Input,\n Sheet,\n SheetContent,\n SparklesIcon,\n Spinner,\n} from '@agimon-ai/po-native-components';\nimport {\n type CommandInfo,\n type CompletionItem,\n type CompletionKind,\n commandCompletions,\n fileCompletions,\n HOST_SLOTS,\n type MentionableSession,\n sessionCompletions,\n slotFills,\n TRIGGER_CHARS,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { type ComponentType, useEffect, useEffectEvent, useState } from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\n/** The phone's way into `@`, `$` and `/`: what each kind is called and what it is for. */\nconst KINDS: readonly { kind: CompletionKind; title: string; hint: string; search: string; none: string }[] = [\n {\n kind: 'file',\n title: 'Files and sessions',\n hint: 'Point Po at a file in this folder or another session',\n search: 'Search files and sessions',\n none: 'No files or sessions match',\n },\n { kind: 'skill', title: 'Skills', hint: 'Use one of your skills', search: 'Search skills', none: 'No skills match' },\n {\n kind: 'command',\n title: 'Slash commands',\n hint: 'Run a session command',\n search: 'Search commands',\n none: 'No commands match',\n },\n];\n/** The hub is a tunnel away, so wait for a pause in typing before asking it. */\nconst FILE_SEARCH_DEBOUNCE_MS = 150;\n\nexport interface CompletionSource {\n commands: readonly CommandInfo[];\n searchFiles: (query: string) => Promise<string[]>;\n /** References plugins offer before workspace files. */\n references?: (query: string) => readonly { path: string; detail?: string }[];\n /** Sessions `@` may name, offered before files. */\n sessions?: () => readonly MentionableSession[];\n}\n\n/** A row a plugin adds after the three kinds, and the page it opens in this sheet. */\ninterface InsertPage {\n key: string;\n title: string;\n hint: string;\n glyph: string;\n component: ComponentType<WebPluginSlotProps>;\n}\n\nfunction textField(data: unknown, key: string): string | undefined {\n if (typeof data !== 'object' || data === null) return undefined;\n const value: unknown = Reflect.get(data, key);\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * The phone's `composer-menu` fills. The cockpit draws a fill's component as the\n * menu row itself; a sheet has room for a page, so here `data.title` (with\n * optional `hint` and `glyph`) is the row and the component is the page.\n */\nfunction insertPages(sessionId: string | null): InsertPage[] {\n return slotFills(HOST_SLOTS.composerMenu, sessionId).flatMap(({ pluginId, id, data, component }) => {\n const title = textField(data, 'title');\n if (!component || title === undefined) return [];\n const hint = textField(data, 'hint') ?? '';\n const glyph = textField(data, 'glyph') ?? title.charAt(0);\n return [{ key: `${pluginId}:${id}`, title, hint, glyph, component }];\n });\n}\n/** The items one kind offers for a query; files come from the hub, the rest from the session's commands. */\nexport function useCompletionItems(\n source: CompletionSource | undefined,\n kind: CompletionKind | null,\n query: string,\n): CompletionItem[] | undefined {\n const [files, setFiles] = useState<{ query: string; items: string[] }>();\n const searchable = source?.searchFiles !== undefined;\n // Hosts rebuild searchFiles every render; an effect event keeps a streaming session from restarting the debounce forever.\n const searchFiles = useEffectEvent((text: string) => source?.searchFiles(text) ?? Promise.resolve([]));\n useEffect(() => {\n if (kind !== 'file' || !searchable) return;\n let current = true;\n const timer = setTimeout(() => {\n void searchFiles(query).then((found) => {\n if (current) setFiles({ query, items: found });\n });\n }, FILE_SEARCH_DEBOUNCE_MS);\n return () => {\n current = false;\n clearTimeout(timer);\n };\n }, [kind, query, searchable]);\n if (source === undefined || kind === null) return [];\n if (kind !== 'file') return commandCompletions(source.commands, kind, query);\n // Sessions come from memory, so they show at once; files join them when the hub answers.\n const sessions = sessionCompletions(source.sessions?.() ?? [], query);\n const references = source.references?.(query) ?? [];\n const items = [...sessions, ...fileCompletions(files?.query === query ? files.items : [], references)];\n return files?.query === query || items.length > 0 ? items : undefined;\n}\n\n/** Completion items as tappable rows: the name in mono, what it does beneath. */\nexport function CompletionRows({\n items,\n onPick,\n}: {\n items: readonly CompletionItem[];\n onPick: (item: CompletionItem) => void;\n}) {\n return (\n <View style={styles.list}>\n {items.map((item, index) => (\n <Pressable\n key={item.insert}\n accessibilityRole=\"button\"\n accessibilityLabel={item.detail ? `${item.label}, ${item.detail}` : item.label}\n onPress={() => onPick(item)}\n style={({ pressed }) => [styles.item, index > 0 && styles.divider, pressed && styles.pressed]}\n >\n <View style={styles.flex}>\n <Text style={styles.itemLabel} numberOfLines={1} ellipsizeMode=\"middle\">\n {item.label}\n </Text>\n {item.detail ? (\n <Text style={styles.meta} numberOfLines={1}>\n {item.detail}\n </Text>\n ) : null}\n </View>\n </Pressable>\n ))}\n </View>\n );\n}\n\nexport interface CompletionSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n source: CompletionSource;\n onPick: (kind: CompletionKind, item: CompletionItem) => void;\n /** Opens on one kind's search rather than the choice of kinds. */\n defaultKind?: CompletionKind;\n defaultQuery?: string;\n /** Opens on a plugin page, keyed `<pluginId>:<fillId>`. */\n defaultPage?: string;\n /** The session's plugin props; with them, its `composer-menu` fills join the list. */\n slotProps?: WebPluginSlotProps;\n /** Rows after the pages that close the sheet and run, such as attaching a photo or file. */\n actions?: readonly InsertAction[];\n}\n\nexport interface InsertAction {\n key: string;\n glyph: string;\n title: string;\n hint: string;\n onPress: () => void;\n}\n\n/** The magic button's sheet: choose Files, Skills, Slash commands, a plugin page or an attachment, then pick one. */\nexport function CompletionSheet({\n open,\n onOpenChange,\n source,\n onPick,\n defaultKind,\n defaultQuery = '',\n defaultPage,\n slotProps,\n actions = [],\n}: CompletionSheetProps) {\n const [kind, setKind] = useState<CompletionKind | null>(defaultKind ?? null);\n const [pageKey, setPageKey] = useState<string | null>(defaultPage ?? null);\n const [query, setQuery] = useState(defaultQuery);\n const items = useCompletionItems(source, kind, query);\n const page = KINDS.find((entry) => entry.kind === kind);\n const pages = slotProps ? insertPages(slotProps.sessionId) : [];\n const plugin = pages.find((entry) => entry.key === pageKey);\n\n const choose = (next: CompletionKind | null) => {\n setKind(next);\n setPageKey(null);\n setQuery('');\n };\n const close = (next: boolean) => {\n if (!next) choose(null);\n onOpenChange(next);\n };\n const rows = [\n ...KINDS.map((entry) => ({\n key: entry.kind,\n glyph: TRIGGER_CHARS[entry.kind],\n title: entry.title,\n hint: entry.hint,\n onPress: () => choose(entry.kind),\n })),\n ...pages.map((entry) => ({ ...entry, onPress: () => setPageKey(entry.key) })),\n ...actions.map((entry) => ({\n ...entry,\n onPress: () => {\n close(false);\n entry.onPress();\n },\n })),\n ];\n\n return (\n <Sheet open={open} onOpenChange={close}>\n <SheetContent>\n <View style={styles.head}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Back to insert\"\n onPress={() => choose(null)}\n disabled={page === undefined && plugin === undefined}\n style={[styles.back, page === undefined && plugin === undefined && styles.hidden]}\n >\n <View style={styles.flip}>\n <ChevronRightIcon size={18} color=\"hi\" />\n </View>\n </Pressable>\n <Text style={styles.title} accessibilityRole=\"header\">\n {page?.title ?? plugin?.title ?? 'Insert'}\n </Text>\n <View style={[styles.back, styles.hidden]} />\n </View>\n {plugin && slotProps ? (\n <plugin.component\n {...slotProps}\n appendComposerDraft={(text) => {\n slotProps.appendComposerDraft(text);\n close(false);\n }}\n />\n ) : (\n <View style={styles.body}>\n {page === undefined ? (\n <View style={styles.list}>\n {rows.map((entry, index) => (\n <Pressable\n key={entry.key}\n accessibilityRole=\"button\"\n accessibilityLabel={entry.hint ? `${entry.title}, ${entry.hint}` : entry.title}\n onPress={entry.onPress}\n style={({ pressed }) => [styles.item, index > 0 && styles.divider, pressed && styles.pressed]}\n >\n <View style={styles.glyph}>\n <Text style={styles.glyphText}>{entry.glyph}</Text>\n </View>\n <View style={styles.flex}>\n <Text style={styles.kindLabel}>{entry.title}</Text>\n {entry.hint ? <Text style={styles.meta}>{entry.hint}</Text> : null}\n </View>\n <ChevronRightIcon size={16} color=\"faint\" />\n </Pressable>\n ))}\n </View>\n ) : (\n <>\n <Input\n value={query}\n onChangeText={setQuery}\n placeholder={page.search}\n accessibilityLabel={page.search}\n autoFocus\n autoCapitalize=\"none\"\n autoCorrect={false}\n />\n {items === undefined ? (\n <View style={styles.waiting}>\n <Spinner size=\"small\" color=\"dim\" label=\"Searching\" />\n </View>\n ) : items.length === 0 ? (\n <Text style={styles.none}>{page.none}</Text>\n ) : (\n <CompletionRows\n items={items}\n onPick={(item) => {\n onPick(page.kind, item);\n close(false);\n }}\n />\n )}\n </>\n )}\n </View>\n )}\n </SheetContent>\n </Sheet>\n );\n}\n\n/** The composer's round button that opens the sheet. */\nexport function CompletionButton({ onPress }: { onPress: () => void }) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Insert or attach\"\n onPress={onPress}\n hitSlop={6}\n style={({ pressed }) => [styles.magic, pressed && styles.magicPressed]}\n >\n <SparklesIcon size={16} color=\"green\" />\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => {\n const sans = fontOf(theme.fontFamily.sans);\n const mono = fontOf(theme.fontFamily.mono);\n const text = (size: 'sm' | 'base' | 'lg', color: string) => ({\n fontFamily: sans,\n fontSize: theme.fontSize[size],\n lineHeight: theme.lineHeight[size],\n color,\n });\n return {\n flex: { flex: 1, minWidth: 0 },\n hidden: { opacity: 0 },\n flip: { transform: [{ rotate: '180deg' }] },\n head: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: theme.spacing(3),\n paddingBottom: theme.spacing(2),\n },\n back: { width: 36, height: 36, alignItems: 'center', justifyContent: 'center' },\n title: { ...text('lg', theme.colors.hi), fontWeight: theme.fontWeight.semibold, flex: 1, textAlign: 'center' },\n body: { gap: theme.spacing(3), paddingHorizontal: theme.spacing(4), paddingBottom: theme.spacing(4) },\n list: {\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.bg,\n overflow: 'hidden',\n },\n item: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(3),\n minHeight: 48,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2.5),\n },\n divider: { borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: theme.colors['border-soft'] },\n pressed: { backgroundColor: theme.colors['tint-green'] },\n glyph: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n glyphText: { ...text('lg', theme.colors.green), fontFamily: mono, fontWeight: theme.fontWeight.semibold },\n kindLabel: { ...text('base', theme.colors.hi), fontWeight: theme.fontWeight.medium },\n itemLabel: { ...text('base', theme.colors.hi), fontFamily: mono },\n meta: text('sm', theme.colors.dim),\n none: { ...text('base', theme.colors.dim), textAlign: 'center', paddingVertical: theme.spacing(4) },\n waiting: { alignItems: 'center', paddingVertical: theme.spacing(6) },\n magic: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n magicPressed: { opacity: 0.7 },\n };\n});\n"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Props","ChevronRightIcon","fontOf","Input","Sheet","SheetContent","SparklesIcon","Spinner","CommandInfo","CompletionItem","CompletionKind","commandCompletions","fileCompletions","HOST_SLOTS","MentionableSession","sessionCompletions","slotFills","TRIGGER_CHARS","ComponentType","useEffect","useEffectEvent","useState","StyleSheet","Translate","key","fallback","completionKinds","t","kind","title","hint","search","none","FILE_SEARCH_DEBOUNCE_MS","CompletionSource","commands","searchFiles","query","Promise","references","path","detail","sessions","InsertPage","glyph","component","textField","data","undefined","value","Reflect","get","insertPages","sessionId","composerMenu","flatMap","pluginId","id","charAt","useCompletionItems","source","files","setFiles","items","searchable","text","resolve","current","timer","setTimeout","then","found","clearTimeout","length","CompletionRows","onPick","item","styles","list","map","index","insert","label","pressed","divider","flex","itemLabel","meta","CompletionSheetProps","open","onOpenChange","defaultKind","defaultQuery","defaultPage","slotProps","actions","InsertAction","onPress","CompletionSheet","kinds","setKind","pageKey","setPageKey","setQuery","page","find","entry","pages","plugin","choose","next","close","rows","head","back","hidden","flip","appendComposerDraft","body","glyphText","kindLabel","waiting","CompletionButton","magic","magicPressed","create","theme","sans","fontFamily","mono","size","color","fontSize","lineHeight","minWidth","opacity","transform","rotate","flexDirection","alignItems","paddingHorizontal","spacing","paddingBottom","uni__dependencies","width","height","justifyContent","colors","hi","fontWeight","semibold","textAlign","gap","borderRadius","lg","borderWidth","borderColor","backgroundColor","bg","overflow","minHeight","paddingVertical","borderTopWidth","hairlineWidth","borderTopColor","green","medium","dim"],"sources":["../../src/components/CompletionSheet.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/native';\nimport type { WebPluginSlotProps } from '@agimon-ai/po-core/web';\nimport {\n ChevronRightIcon,\n fontOf,\n Input,\n Sheet,\n SheetContent,\n SparklesIcon,\n Spinner,\n} from '@agimon-ai/po-native-components';\nimport {\n type CommandInfo,\n type CompletionItem,\n type CompletionKind,\n commandCompletions,\n fileCompletions,\n HOST_SLOTS,\n type MentionableSession,\n sessionCompletions,\n slotFills,\n TRIGGER_CHARS,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { type ComponentType, useEffect, useEffectEvent, useState } from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\ntype Translate = (key: string, fallback: string) => string;\n\n/** The phone's way into `@`, `$` and `/`: what each kind is called and what it is for. */\nfunction completionKinds(\n t: Translate,\n): readonly { kind: CompletionKind; title: string; hint: string; search: string; none: string }[] {\n return [\n {\n kind: 'file',\n title: t('nativeDashboard.completion.filesTitle', 'Files and sessions'),\n hint: t('nativeDashboard.completion.filesHint', 'Point Po at a file in this folder or another session'),\n search: t('nativeDashboard.completion.filesSearch', 'Search files and sessions'),\n none: t('nativeDashboard.completion.filesNone', 'No files or sessions match'),\n },\n {\n kind: 'skill',\n title: t('nativeDashboard.completion.skillsTitle', 'Skills'),\n hint: t('nativeDashboard.completion.skillsHint', 'Use one of your skills'),\n search: t('nativeDashboard.completion.skillsSearch', 'Search skills'),\n none: t('nativeDashboard.completion.skillsNone', 'No skills match'),\n },\n {\n kind: 'command',\n title: t('nativeDashboard.completion.commandsTitle', 'Slash commands'),\n hint: t('nativeDashboard.completion.commandsHint', 'Run a session command'),\n search: t('nativeDashboard.completion.commandsSearch', 'Search commands'),\n none: t('nativeDashboard.completion.commandsNone', 'No commands match'),\n },\n ];\n}\n/** The hub is a tunnel away, so wait for a pause in typing before asking it. */\nconst FILE_SEARCH_DEBOUNCE_MS = 150;\n\nexport interface CompletionSource {\n commands: readonly CommandInfo[];\n searchFiles: (query: string) => Promise<string[]>;\n /** References plugins offer before workspace files. */\n references?: (query: string) => readonly { path: string; detail?: string }[];\n /** Sessions `@` may name, offered before files. */\n sessions?: () => readonly MentionableSession[];\n}\n\n/** A row a plugin adds after the three kinds, and the page it opens in this sheet. */\ninterface InsertPage {\n key: string;\n title: string;\n hint: string;\n glyph: string;\n component: ComponentType<WebPluginSlotProps>;\n}\n\nfunction textField(data: unknown, key: string): string | undefined {\n if (typeof data !== 'object' || data === null) return undefined;\n const value: unknown = Reflect.get(data, key);\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * The phone's `composer-menu` fills. The cockpit draws a fill's component as the\n * menu row itself; a sheet has room for a page, so here `data.title` (with\n * optional `hint` and `glyph`) is the row and the component is the page.\n */\nfunction insertPages(sessionId: string | null): InsertPage[] {\n return slotFills(HOST_SLOTS.composerMenu, sessionId).flatMap(({ pluginId, id, data, component }) => {\n const title = textField(data, 'title');\n if (!component || title === undefined) return [];\n const hint = textField(data, 'hint') ?? '';\n const glyph = textField(data, 'glyph') ?? title.charAt(0);\n return [{ key: `${pluginId}:${id}`, title, hint, glyph, component }];\n });\n}\n/** The items one kind offers for a query; files come from the hub, the rest from the session's commands. */\nexport function useCompletionItems(\n source: CompletionSource | undefined,\n kind: CompletionKind | null,\n query: string,\n): CompletionItem[] | undefined {\n const [files, setFiles] = useState<{ query: string; items: string[] }>();\n const searchable = source?.searchFiles !== undefined;\n // Hosts rebuild searchFiles every render; an effect event keeps a streaming session from restarting the debounce forever.\n const searchFiles = useEffectEvent((text: string) => source?.searchFiles(text) ?? Promise.resolve([]));\n useEffect(() => {\n if (kind !== 'file' || !searchable) return;\n let current = true;\n const timer = setTimeout(() => {\n void searchFiles(query).then((found) => {\n if (current) setFiles({ query, items: found });\n });\n }, FILE_SEARCH_DEBOUNCE_MS);\n return () => {\n current = false;\n clearTimeout(timer);\n };\n }, [kind, query, searchable]);\n if (source === undefined || kind === null) return [];\n if (kind !== 'file') return commandCompletions(source.commands, kind, query);\n // Sessions come from memory, so they show at once; files join them when the hub answers.\n const sessions = sessionCompletions(source.sessions?.() ?? [], query);\n const references = source.references?.(query) ?? [];\n const items = [...sessions, ...fileCompletions(files?.query === query ? files.items : [], references)];\n return files?.query === query || items.length > 0 ? items : undefined;\n}\n\n/** Completion items as tappable rows: the name in mono, what it does beneath. */\nexport function CompletionRows({\n items,\n onPick,\n}: {\n items: readonly CompletionItem[];\n onPick: (item: CompletionItem) => void;\n}) {\n return (\n <View style={styles.list}>\n {items.map((item, index) => (\n <Pressable\n key={item.insert}\n accessibilityRole=\"button\"\n accessibilityLabel={item.detail ? `${item.label}, ${item.detail}` : item.label}\n onPress={() => onPick(item)}\n style={({ pressed }) => [styles.item, index > 0 && styles.divider, pressed && styles.pressed]}\n >\n <View style={styles.flex}>\n <Text style={styles.itemLabel} numberOfLines={1} ellipsizeMode=\"middle\">\n {item.label}\n </Text>\n {item.detail ? (\n <Text style={styles.meta} numberOfLines={1}>\n {item.detail}\n </Text>\n ) : null}\n </View>\n </Pressable>\n ))}\n </View>\n );\n}\n\nexport interface CompletionSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n source: CompletionSource;\n onPick: (kind: CompletionKind, item: CompletionItem) => void;\n /** Opens on one kind's search rather than the choice of kinds. */\n defaultKind?: CompletionKind;\n defaultQuery?: string;\n /** Opens on a plugin page, keyed `<pluginId>:<fillId>`. */\n defaultPage?: string;\n /** The session's plugin props; with them, its `composer-menu` fills join the list. */\n slotProps?: WebPluginSlotProps;\n /** Rows after the pages that close the sheet and run, such as attaching a photo or file. */\n actions?: readonly InsertAction[];\n}\n\nexport interface InsertAction {\n key: string;\n glyph: string;\n title: string;\n hint: string;\n onPress: () => void;\n}\n\n/** The magic button's sheet: choose Files, Skills, Slash commands, a plugin page or an attachment, then pick one. */\nexport function CompletionSheet({\n open,\n onOpenChange,\n source,\n onPick,\n defaultKind,\n defaultQuery = '',\n defaultPage,\n slotProps,\n actions = [],\n}: CompletionSheetProps) {\n const t = useT();\n const kinds = completionKinds(t);\n const [kind, setKind] = useState<CompletionKind | null>(defaultKind ?? null);\n const [pageKey, setPageKey] = useState<string | null>(defaultPage ?? null);\n const [query, setQuery] = useState(defaultQuery);\n const items = useCompletionItems(source, kind, query);\n const page = kinds.find((entry) => entry.kind === kind);\n const pages = slotProps ? insertPages(slotProps.sessionId) : [];\n const plugin = pages.find((entry) => entry.key === pageKey);\n\n const choose = (next: CompletionKind | null) => {\n setKind(next);\n setPageKey(null);\n setQuery('');\n };\n const close = (next: boolean) => {\n if (!next) choose(null);\n onOpenChange(next);\n };\n const rows = [\n ...kinds.map((entry) => ({\n key: entry.kind,\n glyph: TRIGGER_CHARS[entry.kind],\n title: entry.title,\n hint: entry.hint,\n onPress: () => choose(entry.kind),\n })),\n ...pages.map((entry) => ({ ...entry, onPress: () => setPageKey(entry.key) })),\n ...actions.map((entry) => ({\n ...entry,\n onPress: () => {\n close(false);\n entry.onPress();\n },\n })),\n ];\n\n return (\n <Sheet open={open} onOpenChange={close}>\n <SheetContent>\n <View style={styles.head}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.completion.back', 'Back to insert')}\n onPress={() => choose(null)}\n disabled={page === undefined && plugin === undefined}\n style={[styles.back, page === undefined && plugin === undefined && styles.hidden]}\n >\n <View style={styles.flip}>\n <ChevronRightIcon size={18} color=\"hi\" />\n </View>\n </Pressable>\n <Text style={styles.title} accessibilityRole=\"header\">\n {page?.title ?? plugin?.title ?? t('nativeDashboard.completion.title', 'Insert')}\n </Text>\n <View style={[styles.back, styles.hidden]} />\n </View>\n {plugin && slotProps ? (\n <plugin.component\n {...slotProps}\n appendComposerDraft={(text) => {\n slotProps.appendComposerDraft(text);\n close(false);\n }}\n />\n ) : (\n <View style={styles.body}>\n {page === undefined ? (\n <View style={styles.list}>\n {rows.map((entry, index) => (\n <Pressable\n key={entry.key}\n accessibilityRole=\"button\"\n accessibilityLabel={entry.hint ? `${entry.title}, ${entry.hint}` : entry.title}\n onPress={entry.onPress}\n style={({ pressed }) => [styles.item, index > 0 && styles.divider, pressed && styles.pressed]}\n >\n <View style={styles.glyph}>\n <Text style={styles.glyphText}>{entry.glyph}</Text>\n </View>\n <View style={styles.flex}>\n <Text style={styles.kindLabel}>{entry.title}</Text>\n {entry.hint ? <Text style={styles.meta}>{entry.hint}</Text> : null}\n </View>\n <ChevronRightIcon size={16} color=\"faint\" />\n </Pressable>\n ))}\n </View>\n ) : (\n <>\n <Input\n value={query}\n onChangeText={setQuery}\n placeholder={page.search}\n accessibilityLabel={page.search}\n autoFocus\n autoCapitalize=\"none\"\n autoCorrect={false}\n />\n {items === undefined ? (\n <View style={styles.waiting}>\n <Spinner size=\"small\" color=\"dim\" label={t('nativeDashboard.completion.searching', 'Searching')} />\n </View>\n ) : items.length === 0 ? (\n <Text style={styles.none}>{page.none}</Text>\n ) : (\n <CompletionRows\n items={items}\n onPick={(item) => {\n onPick(page.kind, item);\n close(false);\n }}\n />\n )}\n </>\n )}\n </View>\n )}\n </SheetContent>\n </Sheet>\n );\n}\n\n/** The composer's round button that opens the sheet. */\nexport function CompletionButton({ onPress }: { onPress: () => void }) {\n const t = useT();\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.completion.open', 'Insert or attach')}\n onPress={onPress}\n hitSlop={6}\n style={({ pressed }) => [styles.magic, pressed && styles.magicPressed]}\n >\n <SparklesIcon size={16} color=\"green\" />\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => {\n const sans = fontOf(theme.fontFamily.sans);\n const mono = fontOf(theme.fontFamily.mono);\n const text = (size: 'sm' | 'base' | 'lg', color: string) => ({\n fontFamily: sans,\n fontSize: theme.fontSize[size],\n lineHeight: theme.lineHeight[size],\n color,\n });\n return {\n flex: { flex: 1, minWidth: 0 },\n hidden: { opacity: 0 },\n flip: { transform: [{ rotate: '180deg' }] },\n head: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: theme.spacing(3),\n paddingBottom: theme.spacing(2),\n },\n back: { width: 36, height: 36, alignItems: 'center', justifyContent: 'center' },\n title: { ...text('lg', theme.colors.hi), fontWeight: theme.fontWeight.semibold, flex: 1, textAlign: 'center' },\n body: { gap: theme.spacing(3), paddingHorizontal: theme.spacing(4), paddingBottom: theme.spacing(4) },\n list: {\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.bg,\n overflow: 'hidden',\n },\n item: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(3),\n minHeight: 48,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2.5),\n },\n divider: { borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: theme.colors['border-soft'] },\n pressed: { backgroundColor: theme.colors['tint-green'] },\n glyph: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n glyphText: { ...text('lg', theme.colors.green), fontFamily: mono, fontWeight: theme.fontWeight.semibold },\n kindLabel: { ...text('base', theme.colors.hi), fontWeight: theme.fontWeight.medium },\n itemLabel: { ...text('base', theme.colors.hi), fontFamily: mono },\n meta: text('sm', theme.colors.dim),\n none: { ...text('base', theme.colors.dim), textAlign: 'center', paddingVertical: theme.spacing(4) },\n waiting: { alignItems: 'center', paddingVertical: theme.spacing(6) },\n magic: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n magicPressed: { opacity: 0.7 },\n };\n});\n"],"mappings":";;;;;;;;;;;;AA8BA,SAAS2B,gBACPC,GACgG;CAChG,OAAO;EACL;GACEC,MAAM;GACNC,OAAOF,EAAE,yCAAyC,oBAAoB;GACtEG,MAAMH,EAAE,wCAAwC,sDAAsD;GACtGI,QAAQJ,EAAE,0CAA0C,2BAA2B;GAC/EK,MAAML,EAAE,wCAAwC,4BAA4B;EAC9E;EACA;GACEC,MAAM;GACNC,OAAOF,EAAE,0CAA0C,QAAQ;GAC3DG,MAAMH,EAAE,yCAAyC,wBAAwB;GACzEI,QAAQJ,EAAE,2CAA2C,eAAe;GACpEK,MAAML,EAAE,yCAAyC,iBAAiB;EACpE;EACA;GACEC,MAAM;GACNC,OAAOF,EAAE,4CAA4C,gBAAgB;GACrEG,MAAMH,EAAE,2CAA2C,uBAAuB;GAC1EI,QAAQJ,EAAE,6CAA6C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"],"mappings":";;;;iBAiDiB;;EAEf,SAAS;EACT;EACA;;EAEA;EACA,gBAAgB;EAChB,aAAa,MAAM;EACnB;;EAEA;EACA,eAAe,kBAAkB;;EAEjC,aAAa;;EAEb,kBAAkB;;EAElB,oBACE,mBACA;IAAQ;IAAc;IAAkB,OAAO,WAAW;QACvD;IAAU;IAAc;IAAkB;;;EAE/C;EACA;;EAEA;EACA;;EAEA,aAAa;;EAEb,YAAY;;EAEZ,oBAAoB;EACpB,mBAAmB,SAAS;;EAE5B;;EAEA;;;wBAkBc,WACd,QACA,UACA,aACA,OACA,cACA,SAAS,iBACT,SACA,QAAQ,gBACR,eACA,YAAY,oBACZ,YACA,WACA,MACA,aACA,iBACA,YACA,kBACA,WACA,UACA,iBACA,OACA,aACC,qEAAa,IAAA,UAAA,yBAAA,aAAA,6DAAA,8BAAA,+CAAA,8BAAA,yBAAA"}
1
+ {"version":3,"file":"Composer.d.mts","names":[],"sources":["../../src/components/Composer.tsx"],"mappings":";;;;iBAkDiB;;EAEf,SAAS;EACT;EACA;;EAEA;EACA,gBAAgB;EAChB,aAAa,MAAM;EACnB;;EAEA;EACA,eAAe,kBAAkB;;EAEjC,aAAa;;EAEb,kBAAkB;;EAElB,oBACE,mBACA;IAAQ;IAAc;IAAkB,OAAO,WAAW;QACvD;IAAU;IAAc;IAAkB;;;EAE/C;EACA;;EAEA;EACA;;EAEA,aAAa;;EAEb,YAAY;;EAEZ,oBAAoB;EACpB,mBAAmB,SAAS;;EAE5B;;EAEA;;;wBAkBc,WACd,QACA,UACA,aACA,OACA,cACA,SAAS,iBACT,SACA,QAAQ,gBACR,eACA,YAAY,oBACZ,YACA,WACA,MACA,aACA,iBACA,YACA,kBACA,WACA,UACA,iBACA,OACA,aACC,qEAAa,IAAA,UAAA,yBAAA,aAAA,6DAAA,8BAAA,+CAAA,8BAAA,yBAAA"}