omni-ai-cli 0.0.0-stage → 1.0.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 (177) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +615 -2
  3. package/bin/ai.js +84 -0
  4. package/docs/README.en.md +615 -0
  5. package/docs/README.es.md +618 -0
  6. package/docs/README.fr.md +630 -0
  7. package/omni_ai/__init__.py +1 -0
  8. package/omni_ai/__main__.py +6 -0
  9. package/omni_ai/chat.py +1458 -0
  10. package/omni_ai/cli.py +991 -0
  11. package/omni_ai/config.py +531 -0
  12. package/omni_ai/deepseek.py +57 -0
  13. package/omni_ai/grok.py +111 -0
  14. package/omni_ai/onboarding.py +196 -0
  15. package/omni_ai/openrouter.py +335 -0
  16. package/omni_ai/osutils.py +86 -0
  17. package/omni_ai/pii.py +281 -0
  18. package/omni_ai/profiles.json +69 -0
  19. package/omni_ai/skills.py +124 -0
  20. package/omni_ai/sync.py +199 -0
  21. package/omni_ai/tools.py +75 -0
  22. package/omni_ai/ui.py +595 -0
  23. package/omni_ai/usage.py +305 -0
  24. package/omni_ai/vendor/prompt_toolkit/LICENSE +27 -0
  25. package/omni_ai/vendor/prompt_toolkit/__init__.py +52 -0
  26. package/omni_ai/vendor/prompt_toolkit/application/__init__.py +32 -0
  27. package/omni_ai/vendor/prompt_toolkit/application/application.py +1626 -0
  28. package/omni_ai/vendor/prompt_toolkit/application/current.py +195 -0
  29. package/omni_ai/vendor/prompt_toolkit/application/dummy.py +55 -0
  30. package/omni_ai/vendor/prompt_toolkit/application/run_in_terminal.py +114 -0
  31. package/omni_ai/vendor/prompt_toolkit/auto_suggest.py +177 -0
  32. package/omni_ai/vendor/prompt_toolkit/buffer.py +2029 -0
  33. package/omni_ai/vendor/prompt_toolkit/cache.py +127 -0
  34. package/omni_ai/vendor/prompt_toolkit/clipboard/__init__.py +17 -0
  35. package/omni_ai/vendor/prompt_toolkit/clipboard/base.py +109 -0
  36. package/omni_ai/vendor/prompt_toolkit/clipboard/in_memory.py +44 -0
  37. package/omni_ai/vendor/prompt_toolkit/clipboard/pyperclip.py +42 -0
  38. package/omni_ai/vendor/prompt_toolkit/completion/__init__.py +43 -0
  39. package/omni_ai/vendor/prompt_toolkit/completion/base.py +438 -0
  40. package/omni_ai/vendor/prompt_toolkit/completion/deduplicate.py +45 -0
  41. package/omni_ai/vendor/prompt_toolkit/completion/filesystem.py +118 -0
  42. package/omni_ai/vendor/prompt_toolkit/completion/fuzzy_completer.py +213 -0
  43. package/omni_ai/vendor/prompt_toolkit/completion/nested.py +109 -0
  44. package/omni_ai/vendor/prompt_toolkit/completion/word_completer.py +94 -0
  45. package/omni_ai/vendor/prompt_toolkit/contrib/__init__.py +0 -0
  46. package/omni_ai/vendor/prompt_toolkit/contrib/completers/__init__.py +5 -0
  47. package/omni_ai/vendor/prompt_toolkit/contrib/completers/system.py +64 -0
  48. package/omni_ai/vendor/prompt_toolkit/contrib/regular_languages/__init__.py +80 -0
  49. package/omni_ai/vendor/prompt_toolkit/contrib/regular_languages/compiler.py +579 -0
  50. package/omni_ai/vendor/prompt_toolkit/contrib/regular_languages/completion.py +100 -0
  51. package/omni_ai/vendor/prompt_toolkit/contrib/regular_languages/lexer.py +94 -0
  52. package/omni_ai/vendor/prompt_toolkit/contrib/regular_languages/regex_parser.py +279 -0
  53. package/omni_ai/vendor/prompt_toolkit/contrib/regular_languages/validation.py +60 -0
  54. package/omni_ai/vendor/prompt_toolkit/contrib/ssh/__init__.py +8 -0
  55. package/omni_ai/vendor/prompt_toolkit/contrib/ssh/server.py +178 -0
  56. package/omni_ai/vendor/prompt_toolkit/contrib/telnet/__init__.py +7 -0
  57. package/omni_ai/vendor/prompt_toolkit/contrib/telnet/log.py +13 -0
  58. package/omni_ai/vendor/prompt_toolkit/contrib/telnet/protocol.py +209 -0
  59. package/omni_ai/vendor/prompt_toolkit/contrib/telnet/server.py +428 -0
  60. package/omni_ai/vendor/prompt_toolkit/cursor_shapes.py +117 -0
  61. package/omni_ai/vendor/prompt_toolkit/data_structures.py +18 -0
  62. package/omni_ai/vendor/prompt_toolkit/document.py +1182 -0
  63. package/omni_ai/vendor/prompt_toolkit/enums.py +19 -0
  64. package/omni_ai/vendor/prompt_toolkit/eventloop/__init__.py +31 -0
  65. package/omni_ai/vendor/prompt_toolkit/eventloop/async_generator.py +125 -0
  66. package/omni_ai/vendor/prompt_toolkit/eventloop/inputhook.py +191 -0
  67. package/omni_ai/vendor/prompt_toolkit/eventloop/utils.py +101 -0
  68. package/omni_ai/vendor/prompt_toolkit/eventloop/win32.py +72 -0
  69. package/omni_ai/vendor/prompt_toolkit/filters/__init__.py +71 -0
  70. package/omni_ai/vendor/prompt_toolkit/filters/app.py +419 -0
  71. package/omni_ai/vendor/prompt_toolkit/filters/base.py +261 -0
  72. package/omni_ai/vendor/prompt_toolkit/filters/cli.py +65 -0
  73. package/omni_ai/vendor/prompt_toolkit/filters/utils.py +41 -0
  74. package/omni_ai/vendor/prompt_toolkit/formatted_text/__init__.py +59 -0
  75. package/omni_ai/vendor/prompt_toolkit/formatted_text/ansi.py +297 -0
  76. package/omni_ai/vendor/prompt_toolkit/formatted_text/base.py +179 -0
  77. package/omni_ai/vendor/prompt_toolkit/formatted_text/html.py +145 -0
  78. package/omni_ai/vendor/prompt_toolkit/formatted_text/pygments.py +32 -0
  79. package/omni_ai/vendor/prompt_toolkit/formatted_text/utils.py +103 -0
  80. package/omni_ai/vendor/prompt_toolkit/history.py +306 -0
  81. package/omni_ai/vendor/prompt_toolkit/input/__init__.py +14 -0
  82. package/omni_ai/vendor/prompt_toolkit/input/ansi_escape_sequences.py +344 -0
  83. package/omni_ai/vendor/prompt_toolkit/input/base.py +153 -0
  84. package/omni_ai/vendor/prompt_toolkit/input/defaults.py +79 -0
  85. package/omni_ai/vendor/prompt_toolkit/input/posix_pipe.py +118 -0
  86. package/omni_ai/vendor/prompt_toolkit/input/posix_utils.py +97 -0
  87. package/omni_ai/vendor/prompt_toolkit/input/typeahead.py +78 -0
  88. package/omni_ai/vendor/prompt_toolkit/input/vt100.py +309 -0
  89. package/omni_ai/vendor/prompt_toolkit/input/vt100_parser.py +250 -0
  90. package/omni_ai/vendor/prompt_toolkit/input/win32.py +749 -0
  91. package/omni_ai/vendor/prompt_toolkit/input/win32_pipe.py +156 -0
  92. package/omni_ai/vendor/prompt_toolkit/key_binding/__init__.py +22 -0
  93. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/__init__.py +0 -0
  94. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/auto_suggest.py +66 -0
  95. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/basic.py +257 -0
  96. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/completion.py +206 -0
  97. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/cpr.py +30 -0
  98. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/emacs.py +563 -0
  99. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/focus.py +26 -0
  100. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/mouse.py +348 -0
  101. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/named_commands.py +691 -0
  102. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/open_in_editor.py +52 -0
  103. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/page_navigation.py +85 -0
  104. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/scroll.py +190 -0
  105. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/search.py +96 -0
  106. package/omni_ai/vendor/prompt_toolkit/key_binding/bindings/vi.py +2233 -0
  107. package/omni_ai/vendor/prompt_toolkit/key_binding/defaults.py +63 -0
  108. package/omni_ai/vendor/prompt_toolkit/key_binding/digraphs.py +1378 -0
  109. package/omni_ai/vendor/prompt_toolkit/key_binding/emacs_state.py +36 -0
  110. package/omni_ai/vendor/prompt_toolkit/key_binding/key_bindings.py +670 -0
  111. package/omni_ai/vendor/prompt_toolkit/key_binding/key_processor.py +526 -0
  112. package/omni_ai/vendor/prompt_toolkit/key_binding/vi_state.py +107 -0
  113. package/omni_ai/vendor/prompt_toolkit/keys.py +222 -0
  114. package/omni_ai/vendor/prompt_toolkit/layout/__init__.py +147 -0
  115. package/omni_ai/vendor/prompt_toolkit/layout/containers.py +2738 -0
  116. package/omni_ai/vendor/prompt_toolkit/layout/controls.py +945 -0
  117. package/omni_ai/vendor/prompt_toolkit/layout/dimension.py +220 -0
  118. package/omni_ai/vendor/prompt_toolkit/layout/dummy.py +40 -0
  119. package/omni_ai/vendor/prompt_toolkit/layout/layout.py +412 -0
  120. package/omni_ai/vendor/prompt_toolkit/layout/margins.py +304 -0
  121. package/omni_ai/vendor/prompt_toolkit/layout/menus.py +748 -0
  122. package/omni_ai/vendor/prompt_toolkit/layout/mouse_handlers.py +56 -0
  123. package/omni_ai/vendor/prompt_toolkit/layout/processors.py +1010 -0
  124. package/omni_ai/vendor/prompt_toolkit/layout/screen.py +323 -0
  125. package/omni_ai/vendor/prompt_toolkit/layout/scrollable_pane.py +494 -0
  126. package/omni_ai/vendor/prompt_toolkit/layout/utils.py +80 -0
  127. package/omni_ai/vendor/prompt_toolkit/lexers/__init__.py +21 -0
  128. package/omni_ai/vendor/prompt_toolkit/lexers/base.py +85 -0
  129. package/omni_ai/vendor/prompt_toolkit/lexers/pygments.py +328 -0
  130. package/omni_ai/vendor/prompt_toolkit/log.py +13 -0
  131. package/omni_ai/vendor/prompt_toolkit/mouse_events.py +85 -0
  132. package/omni_ai/vendor/prompt_toolkit/output/__init__.py +15 -0
  133. package/omni_ai/vendor/prompt_toolkit/output/base.py +332 -0
  134. package/omni_ai/vendor/prompt_toolkit/output/color_depth.py +64 -0
  135. package/omni_ai/vendor/prompt_toolkit/output/conemu.py +65 -0
  136. package/omni_ai/vendor/prompt_toolkit/output/defaults.py +106 -0
  137. package/omni_ai/vendor/prompt_toolkit/output/flush_stdout.py +87 -0
  138. package/omni_ai/vendor/prompt_toolkit/output/plain_text.py +143 -0
  139. package/omni_ai/vendor/prompt_toolkit/output/vt100.py +748 -0
  140. package/omni_ai/vendor/prompt_toolkit/output/win32.py +683 -0
  141. package/omni_ai/vendor/prompt_toolkit/output/windows10.py +128 -0
  142. package/omni_ai/vendor/prompt_toolkit/patch_stdout.py +297 -0
  143. package/omni_ai/vendor/prompt_toolkit/py.typed +0 -0
  144. package/omni_ai/vendor/prompt_toolkit/renderer.py +814 -0
  145. package/omni_ai/vendor/prompt_toolkit/search.py +226 -0
  146. package/omni_ai/vendor/prompt_toolkit/selection.py +58 -0
  147. package/omni_ai/vendor/prompt_toolkit/shortcuts/__init__.py +46 -0
  148. package/omni_ai/vendor/prompt_toolkit/shortcuts/dialogs.py +330 -0
  149. package/omni_ai/vendor/prompt_toolkit/shortcuts/progress_bar/__init__.py +33 -0
  150. package/omni_ai/vendor/prompt_toolkit/shortcuts/progress_bar/base.py +449 -0
  151. package/omni_ai/vendor/prompt_toolkit/shortcuts/progress_bar/formatters.py +431 -0
  152. package/omni_ai/vendor/prompt_toolkit/shortcuts/prompt.py +1513 -0
  153. package/omni_ai/vendor/prompt_toolkit/shortcuts/utils.py +239 -0
  154. package/omni_ai/vendor/prompt_toolkit/styles/__init__.py +67 -0
  155. package/omni_ai/vendor/prompt_toolkit/styles/base.py +184 -0
  156. package/omni_ai/vendor/prompt_toolkit/styles/defaults.py +236 -0
  157. package/omni_ai/vendor/prompt_toolkit/styles/named_colors.py +162 -0
  158. package/omni_ai/vendor/prompt_toolkit/styles/pygments.py +70 -0
  159. package/omni_ai/vendor/prompt_toolkit/styles/style.py +401 -0
  160. package/omni_ai/vendor/prompt_toolkit/styles/style_transformation.py +374 -0
  161. package/omni_ai/vendor/prompt_toolkit/token.py +9 -0
  162. package/omni_ai/vendor/prompt_toolkit/utils.py +327 -0
  163. package/omni_ai/vendor/prompt_toolkit/validation.py +192 -0
  164. package/omni_ai/vendor/prompt_toolkit/widgets/__init__.py +63 -0
  165. package/omni_ai/vendor/prompt_toolkit/widgets/base.py +995 -0
  166. package/omni_ai/vendor/prompt_toolkit/widgets/dialogs.py +108 -0
  167. package/omni_ai/vendor/prompt_toolkit/widgets/menus.py +374 -0
  168. package/omni_ai/vendor/prompt_toolkit/widgets/toolbars.py +370 -0
  169. package/omni_ai/vendor/prompt_toolkit/win32_types.py +229 -0
  170. package/omni_ai/vendor/wcwidth/LICENSE +27 -0
  171. package/omni_ai/vendor/wcwidth/__init__.py +29 -0
  172. package/omni_ai/vendor/wcwidth/table_vs16.py +125 -0
  173. package/omni_ai/vendor/wcwidth/table_wide.py +1493 -0
  174. package/omni_ai/vendor/wcwidth/table_zero.py +4843 -0
  175. package/omni_ai/vendor/wcwidth/unicode_versions.py +38 -0
  176. package/omni_ai/vendor/wcwidth/wcwidth.py +345 -0
  177. package/package.json +40 -4
@@ -0,0 +1,38 @@
1
+ """
2
+ Exports function list_versions() for unicode version level support.
3
+
4
+ This code generated by wcwidth/bin/update-tables.py on 2023-09-14 15:45:33 UTC.
5
+ """
6
+
7
+
8
+ def list_versions():
9
+ """
10
+ Return Unicode version levels supported by this module release.
11
+
12
+ Any of the version strings returned may be used as keyword argument
13
+ ``unicode_version`` to the ``wcwidth()`` family of functions.
14
+
15
+ :returns: Supported Unicode version numbers in ascending sorted order.
16
+ :rtype: list[str]
17
+ """
18
+ return (
19
+ "4.1.0",
20
+ "5.0.0",
21
+ "5.1.0",
22
+ "5.2.0",
23
+ "6.0.0",
24
+ "6.1.0",
25
+ "6.2.0",
26
+ "6.3.0",
27
+ "7.0.0",
28
+ "8.0.0",
29
+ "9.0.0",
30
+ "10.0.0",
31
+ "11.0.0",
32
+ "12.0.0",
33
+ "12.1.0",
34
+ "13.0.0",
35
+ "14.0.0",
36
+ "15.0.0",
37
+ "15.1.0",
38
+ )
@@ -0,0 +1,345 @@
1
+ """
2
+ This is a python implementation of wcwidth() and wcswidth().
3
+
4
+ https://github.com/jquast/wcwidth
5
+
6
+ from Markus Kuhn's C code, retrieved from:
7
+
8
+ http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
9
+
10
+ This is an implementation of wcwidth() and wcswidth() (defined in
11
+ IEEE Std 1002.1-2001) for Unicode.
12
+
13
+ http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html
14
+ http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html
15
+
16
+ In fixed-width output devices, Latin characters all occupy a single
17
+ "cell" position of equal width, whereas ideographic CJK characters
18
+ occupy two such cells. Interoperability between terminal-line
19
+ applications and (teletype-style) character terminals using the
20
+ UTF-8 encoding requires agreement on which character should advance
21
+ the cursor by how many cell positions. No established formal
22
+ standards exist at present on which Unicode character shall occupy
23
+ how many cell positions on character terminals. These routines are
24
+ a first attempt of defining such behavior based on simple rules
25
+ applied to data provided by the Unicode Consortium.
26
+
27
+ For some graphical characters, the Unicode standard explicitly
28
+ defines a character-cell width via the definition of the East Asian
29
+ FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes.
30
+ In all these cases, there is no ambiguity about which width a
31
+ terminal shall use. For characters in the East Asian Ambiguous (A)
32
+ class, the width choice depends purely on a preference of backward
33
+ compatibility with either historic CJK or Western practice.
34
+ Choosing single-width for these characters is easy to justify as
35
+ the appropriate long-term solution, as the CJK practice of
36
+ displaying these characters as double-width comes from historic
37
+ implementation simplicity (8-bit encoded characters were displayed
38
+ single-width and 16-bit ones double-width, even for Greek,
39
+ Cyrillic, etc.) and not any typographic considerations.
40
+
41
+ Much less clear is the choice of width for the Not East Asian
42
+ (Neutral) class. Existing practice does not dictate a width for any
43
+ of these characters. It would nevertheless make sense
44
+ typographically to allocate two character cells to characters such
45
+ as for instance EM SPACE or VOLUME INTEGRAL, which cannot be
46
+ represented adequately with a single-width glyph. The following
47
+ routines at present merely assign a single-cell width to all
48
+ neutral characters, in the interest of simplicity. This is not
49
+ entirely satisfactory and should be reconsidered before
50
+ establishing a formal standard in this area. At the moment, the
51
+ decision which Not East Asian (Neutral) characters should be
52
+ represented by double-width glyphs cannot yet be answered by
53
+ applying a simple rule from the Unicode database content. Setting
54
+ up a proper standard for the behavior of UTF-8 character terminals
55
+ will require a careful analysis not only of each Unicode character,
56
+ but also of each presentation form, something the author of these
57
+ routines has avoided to do so far.
58
+
59
+ http://www.unicode.org/unicode/reports/tr11/
60
+
61
+ Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
62
+ """
63
+ from __future__ import division
64
+
65
+ # std imports
66
+ import os
67
+ import sys
68
+ import warnings
69
+
70
+ # local
71
+ from .table_vs16 import VS16_NARROW_TO_WIDE
72
+ from .table_wide import WIDE_EASTASIAN
73
+ from .table_zero import ZERO_WIDTH
74
+ from .unicode_versions import list_versions
75
+
76
+ try:
77
+ # std imports
78
+ from functools import lru_cache
79
+ except ImportError:
80
+ # lru_cache was added in Python 3.2
81
+ # 3rd party
82
+ from backports.functools_lru_cache import lru_cache
83
+
84
+ # global cache
85
+ _PY3 = sys.version_info[0] >= 3
86
+
87
+
88
+ def _bisearch(ucs, table):
89
+ """
90
+ Auxiliary function for binary search in interval table.
91
+
92
+ :arg int ucs: Ordinal value of unicode character.
93
+ :arg list table: List of starting and ending ranges of ordinal values,
94
+ in form of ``[(start, end), ...]``.
95
+ :rtype: int
96
+ :returns: 1 if ordinal value ucs is found within lookup table, else 0.
97
+ """
98
+ lbound = 0
99
+ ubound = len(table) - 1
100
+
101
+ if ucs < table[0][0] or ucs > table[ubound][1]:
102
+ return 0
103
+ while ubound >= lbound:
104
+ mid = (lbound + ubound) // 2
105
+ if ucs > table[mid][1]:
106
+ lbound = mid + 1
107
+ elif ucs < table[mid][0]:
108
+ ubound = mid - 1
109
+ else:
110
+ return 1
111
+
112
+ return 0
113
+
114
+
115
+ @lru_cache(maxsize=1000)
116
+ def wcwidth(wc, unicode_version='auto'):
117
+ r"""
118
+ Given one Unicode character, return its printable length on a terminal.
119
+
120
+ :param str wc: A single Unicode character.
121
+ :param str unicode_version: A Unicode version number, such as
122
+ ``'6.0.0'``. A list of version levels suported by wcwidth
123
+ is returned by :func:`list_versions`.
124
+
125
+ Any version string may be specified without error -- the nearest
126
+ matching version is selected. When ``latest`` (default), the
127
+ highest Unicode version level is used.
128
+ :return: The width, in cells, necessary to display the character of
129
+ Unicode string character, ``wc``. Returns 0 if the ``wc`` argument has
130
+ no printable effect on a terminal (such as NUL '\0'), -1 if ``wc`` is
131
+ not printable, or has an indeterminate effect on the terminal, such as
132
+ a control character. Otherwise, the number of column positions the
133
+ character occupies on a graphic terminal (1 or 2) is returned.
134
+ :rtype: int
135
+
136
+ See :ref:`Specification` for details of cell measurement.
137
+ """
138
+ ucs = ord(wc) if wc else 0
139
+
140
+ # small optimization: early return of 1 for printable ASCII, this provides
141
+ # approximately 40% performance improvement for mostly-ascii documents, with
142
+ # less than 1% impact to others.
143
+ if 32 <= ucs < 0x7f:
144
+ return 1
145
+
146
+ # C0/C1 control characters are -1 for compatibility with POSIX-like calls
147
+ if ucs and ucs < 32 or 0x07F <= ucs < 0x0A0:
148
+ return -1
149
+
150
+ _unicode_version = _wcmatch_version(unicode_version)
151
+
152
+ # Zero width
153
+ if _bisearch(ucs, ZERO_WIDTH[_unicode_version]):
154
+ return 0
155
+
156
+ # 1 or 2 width
157
+ return 1 + _bisearch(ucs, WIDE_EASTASIAN[_unicode_version])
158
+
159
+
160
+ def wcswidth(pwcs, n=None, unicode_version='auto'):
161
+ """
162
+ Given a unicode string, return its printable length on a terminal.
163
+
164
+ :param str pwcs: Measure width of given unicode string.
165
+ :param int n: When ``n`` is None (default), return the length of the entire
166
+ string, otherwise only the first ``n`` characters are measured. This
167
+ argument exists only for compatibility with the C POSIX function
168
+ signature. It is suggested instead to use python's string slicing
169
+ capability, ``wcswidth(pwcs[:n])``
170
+ :param str unicode_version: An explicit definition of the unicode version
171
+ level to use for determination, may be ``auto`` (default), which uses
172
+ the Environment Variable, ``UNICODE_VERSION`` if defined, or the latest
173
+ available unicode version, otherwise.
174
+ :rtype: int
175
+ :returns: The width, in cells, needed to display the first ``n`` characters
176
+ of the unicode string ``pwcs``. Returns ``-1`` for C0 and C1 control
177
+ characters!
178
+
179
+ See :ref:`Specification` for details of cell measurement.
180
+ """
181
+ # this 'n' argument is a holdover for POSIX function
182
+ _unicode_version = None
183
+ end = len(pwcs) if n is None else n
184
+ width = 0
185
+ idx = 0
186
+ last_measured_char = None
187
+ while idx < end:
188
+ char = pwcs[idx]
189
+ if char == u'\u200D':
190
+ # Zero Width Joiner, do not measure this or next character
191
+ idx += 2
192
+ continue
193
+ if char == u'\uFE0F' and last_measured_char:
194
+ # on variation selector 16 (VS16) following another character,
195
+ # conditionally add '1' to the measured width if that character is
196
+ # known to be converted from narrow to wide by the VS16 character.
197
+ if _unicode_version is None:
198
+ _unicode_version = _wcversion_value(_wcmatch_version(unicode_version))
199
+ if _unicode_version >= (9, 0, 0):
200
+ width += _bisearch(ord(last_measured_char), VS16_NARROW_TO_WIDE["9.0.0"])
201
+ last_measured_char = None
202
+ idx += 1
203
+ continue
204
+ # measure character at current index
205
+ wcw = wcwidth(char, unicode_version)
206
+ if wcw < 0:
207
+ # early return -1 on C0 and C1 control characters
208
+ return wcw
209
+ if wcw > 0:
210
+ # track last character measured to contain a cell, so that
211
+ # subsequent VS-16 modifiers may be understood
212
+ last_measured_char = char
213
+ width += wcw
214
+ idx += 1
215
+ return width
216
+
217
+
218
+ @lru_cache(maxsize=128)
219
+ def _wcversion_value(ver_string):
220
+ """
221
+ Integer-mapped value of given dotted version string.
222
+
223
+ :param str ver_string: Unicode version string, of form ``n.n.n``.
224
+ :rtype: tuple(int)
225
+ :returns: tuple of digit tuples, ``tuple(int, [...])``.
226
+ """
227
+ retval = tuple(map(int, (ver_string.split('.'))))
228
+ return retval
229
+
230
+
231
+ @lru_cache(maxsize=8)
232
+ def _wcmatch_version(given_version):
233
+ """
234
+ Return nearest matching supported Unicode version level.
235
+
236
+ If an exact match is not determined, the nearest lowest version level is
237
+ returned after a warning is emitted. For example, given supported levels
238
+ ``4.1.0`` and ``5.0.0``, and a version string of ``4.9.9``, then ``4.1.0``
239
+ is selected and returned:
240
+
241
+ >>> _wcmatch_version('4.9.9')
242
+ '4.1.0'
243
+ >>> _wcmatch_version('8.0')
244
+ '8.0.0'
245
+ >>> _wcmatch_version('1')
246
+ '4.1.0'
247
+
248
+ :param str given_version: given version for compare, may be ``auto``
249
+ (default), to select Unicode Version from Environment Variable,
250
+ ``UNICODE_VERSION``. If the environment variable is not set, then the
251
+ latest is used.
252
+ :rtype: str
253
+ :returns: unicode string, or non-unicode ``str`` type for python 2
254
+ when given ``version`` is also type ``str``.
255
+ """
256
+ # Design note: the choice to return the same type that is given certainly
257
+ # complicates it for python 2 str-type, but allows us to define an api that
258
+ # uses 'string-type' for unicode version level definitions, so all of our
259
+ # example code works with all versions of python.
260
+ #
261
+ # That, along with the string-to-numeric and comparisons of earliest,
262
+ # latest, matching, or nearest, greatly complicates this function.
263
+ # Performance is somewhat curbed by memoization.
264
+ _return_str = not _PY3 and isinstance(given_version, str)
265
+
266
+ if _return_str:
267
+ # avoid list-comprehension to work around a coverage issue:
268
+ # https://github.com/nedbat/coveragepy/issues/753
269
+ unicode_versions = list(map(lambda ucs: ucs.encode(), list_versions()))
270
+ else:
271
+ unicode_versions = list_versions()
272
+ latest_version = unicode_versions[-1]
273
+
274
+ if given_version in (u'auto', 'auto'):
275
+ given_version = os.environ.get(
276
+ 'UNICODE_VERSION',
277
+ 'latest' if not _return_str else latest_version.encode())
278
+
279
+ if given_version in (u'latest', 'latest'):
280
+ # default match, when given as 'latest', use the most latest unicode
281
+ # version specification level supported.
282
+ return latest_version if not _return_str else latest_version.encode()
283
+
284
+ if given_version in unicode_versions:
285
+ # exact match, downstream has specified an explicit matching version
286
+ # matching any value of list_versions().
287
+ return given_version if not _return_str else given_version.encode()
288
+
289
+ # The user's version is not supported by ours. We return the newest unicode
290
+ # version level that we support below their given value.
291
+ try:
292
+ cmp_given = _wcversion_value(given_version)
293
+
294
+ except ValueError:
295
+ # submitted value raises ValueError in int(), warn and use latest.
296
+ warnings.warn("UNICODE_VERSION value, {given_version!r}, is invalid. "
297
+ "Value should be in form of `integer[.]+', the latest "
298
+ "supported unicode version {latest_version!r} has been "
299
+ "inferred.".format(given_version=given_version,
300
+ latest_version=latest_version))
301
+ return latest_version if not _return_str else latest_version.encode()
302
+
303
+ # given version is less than any available version, return earliest
304
+ # version.
305
+ earliest_version = unicode_versions[0]
306
+ cmp_earliest_version = _wcversion_value(earliest_version)
307
+
308
+ if cmp_given <= cmp_earliest_version:
309
+ # this probably isn't what you wanted, the oldest wcwidth.c you will
310
+ # find in the wild is likely version 5 or 6, which we both support,
311
+ # but it's better than not saying anything at all.
312
+ warnings.warn("UNICODE_VERSION value, {given_version!r}, is lower "
313
+ "than any available unicode version. Returning lowest "
314
+ "version level, {earliest_version!r}".format(
315
+ given_version=given_version,
316
+ earliest_version=earliest_version))
317
+ return earliest_version if not _return_str else earliest_version.encode()
318
+
319
+ # create list of versions which are less than our equal to given version,
320
+ # and return the tail value, which is the highest level we may support,
321
+ # or the latest value we support, when completely unmatched or higher
322
+ # than any supported version.
323
+ #
324
+ # function will never complete, always returns.
325
+ for idx, unicode_version in enumerate(unicode_versions):
326
+ # look ahead to next value
327
+ try:
328
+ cmp_next_version = _wcversion_value(unicode_versions[idx + 1])
329
+ except IndexError:
330
+ # at end of list, return latest version
331
+ return latest_version if not _return_str else latest_version.encode()
332
+
333
+ # Maybe our given version has less parts, as in tuple(8, 0), than the
334
+ # next compare version tuple(8, 0, 0). Test for an exact match by
335
+ # comparison of only the leading dotted piece(s): (8, 0) == (8, 0).
336
+ if cmp_given == cmp_next_version[:len(cmp_given)]:
337
+ return unicode_versions[idx + 1]
338
+
339
+ # Or, if any next value is greater than our given support level
340
+ # version, return the current value in index. Even though it must
341
+ # be less than the given value, its our closest possible match. That
342
+ # is, 4.1 is returned for given 4.9.9, where 4.1 and 5.0 are available.
343
+ if cmp_next_version > cmp_given:
344
+ return unicode_version
345
+ assert False, ("Code path unreachable", given_version, unicode_versions) # pragma: no cover
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "omni-ai-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "One chat for Claude Code, Codex, Antigravity and OpenRouter, with automatic routing, account fallback, API keys, permission modes and MCP/skill sync.",
5
+ "bin": {
6
+ "ai": "bin/ai.js",
7
+ "omni-ai": "bin/ai.js",
8
+ "smart-ai": "bin/ai.js"
9
+ },
10
+ "files": [
11
+ "bin/",
12
+ "omni_ai/",
13
+ "!omni_ai/**/__pycache__",
14
+ "docs/",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
18
+ "optionalDependencies": {
19
+ "@anthropic-ai/claude-code": "*"
20
+ },
21
+ "engines": {
22
+ "node": ">=18"
23
+ },
24
+ "keywords": [
25
+ "ai",
26
+ "cli",
27
+ "claude",
28
+ "codex",
29
+ "antigravity",
30
+ "openrouter",
31
+ "mcp",
32
+ "router"
33
+ ],
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/samuelrms/omni-ai-cli.git"
37
+ },
38
+ "homepage": "https://github.com/samuelrms/omni-ai-cli#readme",
39
+ "bugs": "https://github.com/samuelrms/omni-ai-cli/issues",
40
+ "author": "samuelrms",
41
+ "license": "MIT"
42
+ }