@quiel/cli 0.5.0 → 0.5.2

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 (4) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +4 -2
  3. package/dist/cli.js +415 -169
  4. package/package.json +4 -3
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Quiel
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -133,8 +133,10 @@ quiel status
133
133
 
134
134
  ## About this repository
135
135
 
136
- This repository is the documentation and the issue tracker for `@quiel/cli`. Quiel is a commercial hosted product: the client is distributed as a built package under a proprietary licence, and its source is not published here. What the client does to your machine is documented above — and every file it writes lands in your project directory, where you can read it.
136
+ This repository is the documentation and the issue tracker for `@quiel/cli`. Quiel is a commercial hosted product: the platform runs on our servers and its source is not published. The client is the part that runs on your machine, and it ships under a permissive licence so that installing it needs no legal review. What the client does to your machine is documented above — and every file it writes lands in your project directory, where you can read it.
137
137
 
138
138
  ## Licence
139
139
 
140
- Proprietary (`UNLICENSED`). Copyright © Quiel. All rights reserved.
140
+ The client — this package — is licensed under Apache-2.0; the full text is in `LICENSE`. That covers the command-line client only: the Quiel platform is a hosted service, not a published codebase.
141
+
142
+ Copyright © 2026 Quiel.
package/dist/cli.js CHANGED
@@ -115,6 +115,51 @@ var maskKeyValue = maskValueGroup(KEY_VALUE_RE);
115
115
  var maskFlagSpace = maskValueGroup(FLAG_SPACE_RE);
116
116
  var maskAuthHeader = maskValueGroup(AUTH_HEADER_RE);
117
117
 
118
+ // ../shared/src/deploy/affected-services.ts
119
+ var RULES = [
120
+ // Приложения — каждое только в свой образ.
121
+ { prefix: "apps/web/", services: ["web"] },
122
+ { prefix: "apps/realtime/", services: ["realtime"] },
123
+ { prefix: "apps/worker/", services: ["worker"] },
124
+ { prefix: "apps/docs/", services: ["docs"] },
125
+ // Клиент публикуется в npm и на стенде не работает.
126
+ //
127
+ // ПУТЬ — `packages/mcp-client/`, и это не придирка: раньше здесь стояло
128
+ // `packages/cli/`, каталога с таким именем в репозитории нет никогда не
129
+ // было, и правило не совпадало ни с чем. Правка клиента молча
130
+ // проваливалась в «закрыто по умолчанию» и пересобирала все образы.
131
+ // Тест это подтверждал — он спрашивал про такой же выдуманный путь.
132
+ { prefix: "packages/mcp-client/", services: [] },
133
+ // Схема и клиент БД: три сервиса ходят в базу, плюс сам мигратор.
134
+ { prefix: "packages/db/", services: ["web", "realtime", "worker", "migrate"] },
135
+ // Клиент GitHub App: веб (подключение, список репозиториев) и realtime
136
+ // (открытие pull request диспетчером).
137
+ { prefix: "packages/github/", services: ["web", "realtime"] },
138
+ // Письма: веб шлёт magic link и подтверждения, воркер — уведомления и
139
+ // дайджест. Realtime почту не трогает.
140
+ { prefix: "packages/mail/", services: ["web", "worker"] },
141
+ // Общие типы и общий конфиг — под ними все.
142
+ { prefix: "packages/shared/", services: "all" },
143
+ { prefix: "packages/config/", services: "all" },
144
+ // Сборка и окружение — тоже все.
145
+ { prefix: "docker/", services: "all" },
146
+ // Комплект логотипа: аватар для GitHub и правила использования. Сам
147
+ // логотип в продукте живёт не здесь — разметка встроена в компоненты
148
+ // (`apps/*/src/components/brand/`), иконки лежат в `apps/*/public/`, и
149
+ // оба пути закрыты правилами приложений выше. Тут только справочные
150
+ // файлы для людей.
151
+ { prefix: "brand/", services: [] },
152
+ // Вспомогательные скрипты выкладки исполняются в CI, из проверенного
153
+ // коммита, и ни в один образ не попадают. Их правка меняет то, КАК
154
+ // считается список сервисов, но не содержимое стенда.
155
+ { prefix: "scripts/", services: [] },
156
+ // Документы проекта и настройки CI стенда не касаются.
157
+ { prefix: "docs/", services: [] },
158
+ { prefix: ".github/", services: [] },
159
+ { prefix: ".claude/", services: [] }
160
+ ];
161
+ var RULE_PREFIXES = RULES.map((rule) => rule.prefix);
162
+
118
163
  // ../shared/src/docs/links.ts
119
164
  var DocsPage = {
120
165
  START: "start",
@@ -384,6 +429,11 @@ var ReorderMilestonesSchema = z9.object({
384
429
  import { z as z10 } from "zod";
385
430
 
386
431
  // ../shared/src/enums/organization.ts
432
+ var Plan = {
433
+ FREE: "FREE",
434
+ TEAM: "TEAM",
435
+ ENTERPRISE: "ENTERPRISE"
436
+ };
387
437
  var OrgRole = {
388
438
  OWNER: "OWNER",
389
439
  ADMIN: "ADMIN",
@@ -1470,6 +1520,9 @@ var taskUsagePayloadSchema = z23.object({
1470
1520
  entries: z23.array(taskUsageEntrySchema).min(1).max(10)
1471
1521
  });
1472
1522
  var taskUsageAckSchema = z23.object({ ok: z23.boolean() });
1523
+ var sessionLimitReachedPayloadSchema = z23.object({
1524
+ tasksCompletedInSession: z23.number().int().nonnegative()
1525
+ });
1473
1526
  var taskCreatePayloadSchema = z23.object({
1474
1527
  title: z23.string().min(1),
1475
1528
  descriptionMd: z23.string(),
@@ -1788,9 +1841,201 @@ var ImportTasksRequestSchema = z26.object({
1788
1841
  tasks: z26.array(ImportTaskInputSchema).min(1, "\u041D\u0443\u0436\u043D\u0430 \u0445\u043E\u0442\u044F \u0431\u044B \u043E\u0434\u043D\u0430 \u0437\u0430\u0434\u0430\u0447\u0430").max(500, "\u041D\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 500 \u0437\u0430\u0434\u0430\u0447 \u0437\u0430 \u043E\u0434\u0438\u043D \u0438\u043C\u043F\u043E\u0440\u0442")
1789
1842
  });
1790
1843
 
1791
- // ../shared/src/settings/org-settings.ts
1844
+ // ../shared/src/integrations/registry.ts
1845
+ var IntegrationStatus = {
1846
+ /** Работает и проверена вживую. */
1847
+ READY: "ready",
1848
+ /** Запланирована, но ещё не сделана. Показываем, чтобы не обещать голосом. */
1849
+ PLANNED: "planned"
1850
+ };
1851
+ var IntegrationKey = {
1852
+ GITHUB: "github",
1853
+ TELEGRAM: "telegram",
1854
+ WEBHOOKS: "webhooks"
1855
+ };
1856
+ var INTEGRATIONS = [
1857
+ {
1858
+ key: IntegrationKey.GITHUB,
1859
+ status: IntegrationStatus.READY,
1860
+ scope: "org",
1861
+ requiresOrgAdmin: true
1862
+ },
1863
+ {
1864
+ // Организация может принести СВОЙ токен бота (платные тарифы), а
1865
+ // привязку чата каждый делает себе сам — отсюда `both`.
1866
+ key: IntegrationKey.TELEGRAM,
1867
+ status: IntegrationStatus.READY,
1868
+ scope: "both",
1869
+ requiresOrgAdmin: false
1870
+ },
1871
+ {
1872
+ // Одна механика вместо десяти интеграций: Zapier, n8n, Make и любой
1873
+ // свой эндпоинт. Пока не сделана — и список об этом честно говорит.
1874
+ key: IntegrationKey.WEBHOOKS,
1875
+ status: IntegrationStatus.PLANNED,
1876
+ scope: "org",
1877
+ requiresOrgAdmin: true
1878
+ }
1879
+ ];
1880
+ var PLANS_WITH_OWN_TELEGRAM_BOT = [Plan.TEAM, Plan.ENTERPRISE];
1881
+ var BY_KEY = new Map(INTEGRATIONS.map((info) => [info.key, info]));
1882
+
1883
+ // ../shared/src/notifications/kinds.ts
1884
+ var NotificationChannel = {
1885
+ INAPP: "inapp",
1886
+ TELEGRAM: "telegram",
1887
+ EMAIL: "email",
1888
+ PUSH: "push"
1889
+ };
1890
+ var NOTIFICATION_CHANNELS = Object.values(NotificationChannel);
1891
+ var NotificationUrgency = {
1892
+ BLOCKING: "blocking",
1893
+ ACTIONABLE: "actionable",
1894
+ INFORMATIONAL: "informational",
1895
+ SCHEDULED: "scheduled"
1896
+ };
1897
+ var ALL = [
1898
+ NotificationChannel.INAPP,
1899
+ NotificationChannel.TELEGRAM,
1900
+ NotificationChannel.EMAIL,
1901
+ NotificationChannel.PUSH
1902
+ ];
1903
+ var FAST = [
1904
+ NotificationChannel.INAPP,
1905
+ NotificationChannel.TELEGRAM,
1906
+ NotificationChannel.PUSH
1907
+ ];
1908
+ var QUIET = [NotificationChannel.INAPP];
1909
+ var SLOW = [
1910
+ NotificationChannel.INAPP,
1911
+ NotificationChannel.TELEGRAM,
1912
+ NotificationChannel.EMAIL
1913
+ ];
1914
+ function defaultsFor(urgency) {
1915
+ if (urgency === NotificationUrgency.BLOCKING) return FAST;
1916
+ if (urgency === NotificationUrgency.ACTIONABLE) return ALL;
1917
+ if (urgency === NotificationUrgency.SCHEDULED) return SLOW;
1918
+ return QUIET;
1919
+ }
1920
+ function kind(value, label, description, urgency) {
1921
+ return { kind: value, label, description, urgency, defaultChannels: defaultsFor(urgency) };
1922
+ }
1923
+ var NOTIFICATION_KINDS = [
1924
+ kind(
1925
+ "question",
1926
+ "\u0412\u043E\u043F\u0440\u043E\u0441 \u043E\u0442 \u0430\u0433\u0435\u043D\u0442\u0430",
1927
+ "\u0410\u0433\u0435\u043D\u0442 \u0443\u043F\u0451\u0440\u0441\u044F \u0432 \u0442\u043E, \u0447\u0435\u0433\u043E \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044C \u0441\u0430\u043C, \u0438 \u0436\u0434\u0451\u0442 \u043E\u0442\u0432\u0435\u0442\u0430.",
1928
+ NotificationUrgency.BLOCKING
1929
+ ),
1930
+ kind(
1931
+ "approval_requested",
1932
+ "\u0417\u0430\u043F\u0440\u043E\u0441 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F",
1933
+ "\u0410\u0433\u0435\u043D\u0442 \u043F\u0440\u043E\u0441\u0438\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043E\u043F\u0430\u0441\u043D\u0443\u044E \u043A\u043E\u043C\u0430\u043D\u0434\u0443. \u041F\u043E\u043A\u0430 \u043D\u0435 \u043E\u0442\u0432\u0435\u0442\u0438\u0442\u0435 \u2014 \u043E\u043D\u0430 \u043D\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u0441\u044F.",
1934
+ NotificationUrgency.BLOCKING
1935
+ ),
1936
+ kind(
1937
+ "task_assigned",
1938
+ "\u0412\u0430\u043C \u043D\u0430\u0437\u043D\u0430\u0447\u0438\u043B\u0438 \u0437\u0430\u0434\u0430\u0447\u0443",
1939
+ "\u0417\u0430\u0434\u0430\u0447\u0443 \u043D\u0430\u0437\u043D\u0430\u0447\u0438\u043B\u0438 \u043B\u0438\u0447\u043D\u043E \u043D\u0430 \u0432\u0430\u0441.",
1940
+ NotificationUrgency.ACTIONABLE
1941
+ ),
1942
+ kind(
1943
+ "task_review",
1944
+ "\u0417\u0430\u0434\u0430\u0447\u0430 \u043D\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0435",
1945
+ "\u0420\u0430\u0431\u043E\u0442\u0430 \u0441\u0434\u0430\u043D\u0430 \u0438 \u0436\u0434\u0451\u0442 \u0432\u0430\u0448\u0435\u0439 \u043F\u0440\u0438\u0451\u043C\u043A\u0438.",
1946
+ NotificationUrgency.ACTIONABLE
1947
+ ),
1948
+ kind(
1949
+ "task_returned",
1950
+ "\u0417\u0430\u0434\u0430\u0447\u0443 \u0432\u0435\u0440\u043D\u0443\u043B\u0438 \u0441 \u043F\u0440\u0430\u0432\u043A\u0430\u043C\u0438",
1951
+ "\u0412\u0430\u0448\u0443 \u0440\u0430\u0431\u043E\u0442\u0443 \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u043B\u0438 \u043D\u0430 \u0434\u043E\u0440\u0430\u0431\u043E\u0442\u043A\u0443.",
1952
+ NotificationUrgency.ACTIONABLE
1953
+ ),
1954
+ kind(
1955
+ "task_failed",
1956
+ "\u0417\u0430\u0434\u0430\u0447\u0430 \u043F\u0440\u043E\u0432\u0430\u043B\u0435\u043D\u0430",
1957
+ "\u0422\u0440\u0435\u0442\u0438\u0439 \u0432\u043E\u0437\u0432\u0440\u0430\u0442 \u043F\u043E\u0434\u0440\u044F\u0434 \u2014 \u0437\u0430\u0434\u0430\u0447\u0430 \u0443\u0448\u043B\u0430 \u0432 \xAB\u041F\u0440\u043E\u0432\u0430\u043B\u0435\u043D\u0430\xBB.",
1958
+ NotificationUrgency.ACTIONABLE
1959
+ ),
1960
+ kind(
1961
+ "AGENT_LEASE_EXPIRED",
1962
+ "\u0410\u0433\u0435\u043D\u0442 \u043F\u043E\u0442\u0435\u0440\u044F\u043B \u0437\u0430\u0434\u0430\u0447\u0443",
1963
+ "\u0410\u0440\u0435\u043D\u0434\u0430 \u0438\u0441\u0442\u0435\u043A\u043B\u0430: \u0430\u0433\u0435\u043D\u0442 \u043E\u0442\u0432\u0430\u043B\u0438\u043B\u0441\u044F, \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u0435\u0440\u043D\u0443\u043B\u0430\u0441\u044C \u0432 \u043E\u0447\u0435\u0440\u0435\u0434\u044C.",
1964
+ NotificationUrgency.ACTIONABLE
1965
+ ),
1966
+ kind(
1967
+ "AGENT_RATE_LIMITED_REQUEUE",
1968
+ "\u0410\u0433\u0435\u043D\u0442 \u0443\u043F\u0451\u0440\u0441\u044F \u0432 \u043B\u0438\u043C\u0438\u0442",
1969
+ "\u041F\u043E\u0434\u043F\u0438\u0441\u043A\u0430 \u0430\u0433\u0435\u043D\u0442\u0430 \u0438\u0441\u0447\u0435\u0440\u043F\u0430\u043D\u0430, \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0435\u043D\u0430 \u0432 \u043E\u0447\u0435\u0440\u0435\u0434\u044C.",
1970
+ NotificationUrgency.ACTIONABLE
1971
+ ),
1972
+ kind(
1973
+ "agent_session_limit",
1974
+ "\u0421\u0435\u0441\u0441\u0438\u044F \u0430\u0433\u0435\u043D\u0442\u0430 \u0438\u0441\u0447\u0435\u0440\u043F\u0430\u043D\u0430",
1975
+ "\u0410\u0433\u0435\u043D\u0442 \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u043B \u043F\u043E\u0434\u0440\u044F\u0434 \u0441\u0442\u043E\u043B\u044C\u043A\u043E \u0437\u0430\u0434\u0430\u0447, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u043E \u0434\u043E \u043E\u0447\u0438\u0441\u0442\u043A\u0438 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430.",
1976
+ NotificationUrgency.INFORMATIONAL
1977
+ ),
1978
+ kind(
1979
+ "task_auto_accepted",
1980
+ "\u0417\u0430\u0434\u0430\u0447\u0430 \u043F\u0440\u0438\u043D\u044F\u0442\u0430 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438",
1981
+ "\u041F\u0440\u043E\u0435\u043A\u0442 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043D \u043D\u0430 \u0430\u0432\u0442\u043E\u043F\u0440\u0438\u0451\u043C\u043A\u0443 \u2014 \u0440\u0430\u0431\u043E\u0442\u0430 \u0437\u0430\u0447\u0442\u0435\u043D\u0430 \u0431\u0435\u0437 \u0432\u0430\u0448\u0435\u0433\u043E \u0443\u0447\u0430\u0441\u0442\u0438\u044F.",
1982
+ NotificationUrgency.INFORMATIONAL
1983
+ ),
1984
+ kind(
1985
+ "DAILY_DIGEST",
1986
+ "\u0415\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u044B\u0439 \u0434\u0430\u0439\u0434\u0436\u0435\u0441\u0442",
1987
+ "\u0421\u0432\u043E\u0434\u043A\u0430 \u0437\u0430 \u0441\u0443\u0442\u043A\u0438: \u0447\u0442\u043E \u0441\u043B\u0443\u0447\u0438\u043B\u043E\u0441\u044C \u0438 \u0447\u0442\u043E \u043E\u0442 \u0432\u0430\u0441 \u0436\u0434\u0443\u0442. \u041F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u043F\u043E \u043F\u043E\u0434\u043F\u0438\u0441\u043A\u0435.",
1988
+ NotificationUrgency.SCHEDULED
1989
+ )
1990
+ ];
1991
+ var BY_KIND2 = new Map(NOTIFICATION_KINDS.map((info) => [info.kind, info]));
1992
+
1993
+ // ../shared/src/notifications/prefs.ts
1792
1994
  import { z as z27 } from "zod";
1793
- var OrgSettingsSchema = z27.object({}).passthrough();
1995
+ var NotificationChannelFlagsSchema = z27.object({
1996
+ inapp: z27.boolean().optional(),
1997
+ telegram: z27.boolean().optional(),
1998
+ email: z27.boolean().optional(),
1999
+ push: z27.boolean().optional()
2000
+ }).partial();
2001
+ var NotificationPrefsSchema = z27.object({
2002
+ /** Подписка на ежедневный дайджест. Ключ существует с фазы 5, читает `jobs/digest.ts`. */
2003
+ digest: z27.boolean().optional(),
2004
+ /**
2005
+ * Выключатели каналов целиком: «почту мне не слать никогда».
2006
+ * Отсутствие ключа означает «по умолчанию», а не «выключено».
2007
+ */
2008
+ channels: NotificationChannelFlagsSchema.optional(),
2009
+ /**
2010
+ * Точечно по видам: `{ task_review: { email: false } }`.
2011
+ *
2012
+ * Ключ — `Notification.kind` как строка, а не enum: в базе уже лежат
2013
+ * виды, а список будет расти. Неизвестный вид здесь никого не ломает
2014
+ * — он просто ни с чем не совпадёт.
2015
+ */
2016
+ kinds: z27.record(z27.string(), NotificationChannelFlagsSchema).optional()
2017
+ }).passthrough();
2018
+
2019
+ // ../shared/src/onboarding/steps.ts
2020
+ var OnboardingStep = {
2021
+ /** Создать организацию. Без неё в системе не работает ничего. */
2022
+ ORGANIZATION: "organization",
2023
+ PROJECT: "project",
2024
+ AGENT: "agent",
2025
+ TEAM: "team",
2026
+ NOTIFICATIONS: "notifications"
2027
+ };
2028
+ var ONBOARDING_STEPS = [
2029
+ { step: OnboardingStep.ORGANIZATION, required: true, ownerOnly: false },
2030
+ { step: OnboardingStep.PROJECT, required: false, ownerOnly: true },
2031
+ { step: OnboardingStep.AGENT, required: false, ownerOnly: false },
2032
+ { step: OnboardingStep.TEAM, required: false, ownerOnly: true },
2033
+ { step: OnboardingStep.NOTIFICATIONS, required: false, ownerOnly: false }
2034
+ ];
2035
+
2036
+ // ../shared/src/settings/org-settings.ts
2037
+ import { z as z28 } from "zod";
2038
+ var OrgSettingsSchema = z28.object({}).passthrough();
1794
2039
 
1795
2040
  // ../shared/src/task-state.ts
1796
2041
  var TASK_TRANSITIONS = [
@@ -3022,24 +3267,24 @@ function upsertClaudeMdSection(existingContent) {
3022
3267
  // src/config/claude-settings.ts
3023
3268
  import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
3024
3269
  import { join as join2 } from "path";
3025
- import { z as z28 } from "zod";
3026
- var HookCommandEntrySchema = z28.object({
3027
- type: z28.literal("command"),
3028
- command: z28.string().min(1),
3029
- timeout: z28.number().int().positive().optional()
3270
+ import { z as z29 } from "zod";
3271
+ var HookCommandEntrySchema = z29.object({
3272
+ type: z29.literal("command"),
3273
+ command: z29.string().min(1),
3274
+ timeout: z29.number().int().positive().optional()
3030
3275
  }).passthrough();
3031
- var HookMatcherGroupSchema = z28.object({
3032
- matcher: z28.string().optional(),
3033
- hooks: z28.array(HookCommandEntrySchema)
3276
+ var HookMatcherGroupSchema = z29.object({
3277
+ matcher: z29.string().optional(),
3278
+ hooks: z29.array(HookCommandEntrySchema)
3034
3279
  }).passthrough();
3035
- var McpServerEntrySchema = z28.object({
3036
- command: z28.string().min(1),
3037
- args: z28.array(z28.string()).optional()
3280
+ var McpServerEntrySchema = z29.object({
3281
+ command: z29.string().min(1),
3282
+ args: z29.array(z29.string()).optional()
3038
3283
  }).passthrough();
3039
- var ClaudeSettingsSchema = z28.object({
3040
- mcpServers: z28.record(z28.string(), McpServerEntrySchema).optional(),
3041
- hooks: z28.record(z28.string(), z28.array(HookMatcherGroupSchema)).optional(),
3042
- env: z28.record(z28.string(), z28.string()).optional()
3284
+ var ClaudeSettingsSchema = z29.object({
3285
+ mcpServers: z29.record(z29.string(), McpServerEntrySchema).optional(),
3286
+ hooks: z29.record(z29.string(), z29.array(HookMatcherGroupSchema)).optional(),
3287
+ env: z29.record(z29.string(), z29.string()).optional()
3043
3288
  }).passthrough();
3044
3289
  var CLAUDE_SETTINGS_RELATIVE_PATH = join2(".claude", "settings.json");
3045
3290
  var CLI_BIN = "quiel";
@@ -3144,13 +3389,13 @@ function clearPendingApproval(state, approvalId) {
3144
3389
  }
3145
3390
 
3146
3391
  // src/state/schema.ts
3147
- import { z as z29 } from "zod";
3392
+ import { z as z30 } from "zod";
3148
3393
  var STATE_SCHEMA_VERSION = 1;
3149
- var CurrentTaskSchema = z29.object({
3150
- taskId: z29.string().min(1),
3394
+ var CurrentTaskSchema = z30.object({
3395
+ taskId: z30.string().min(1),
3151
3396
  /** Человекочитаемый ключ вроде `REL-42` — для текста в хуках. Необязателен: на первых порах может быть неизвестен. */
3152
- taskKey: z29.string().min(1).optional(),
3153
- resumeToken: z29.string().min(1),
3397
+ taskKey: z30.string().min(1).optional(),
3398
+ resumeToken: z30.string().min(1),
3154
3399
  /**
3155
3400
  * Каталог, в котором агент работает над этой задачей (`.claude/worktrees/…`).
3156
3401
  *
@@ -3164,7 +3409,7 @@ var CurrentTaskSchema = z29.object({
3164
3409
  * в чекауте), а у состояний, записанных прежними версиями клиента,
3165
3410
  * поля просто нет.
3166
3411
  */
3167
- worktreeDir: z29.string().min(1).optional(),
3412
+ worktreeDir: z30.string().min(1).optional(),
3168
3413
  /**
3169
3414
  * Git-режим проекта (§13.1 ТЗ) — `DIRECT` или `PR`.
3170
3415
  *
@@ -3178,56 +3423,56 @@ var CurrentTaskSchema = z29.object({
3178
3423
  * Необязательно: состояния, записанные прежними версиями клиента, поля
3179
3424
  * не имеют — тогда `submit_work` работает как раньше, в режиме DIRECT.
3180
3425
  */
3181
- gitMode: z29.enum([GitMode.DIRECT, GitMode.PR]).optional()
3182
- });
3183
- var TrustCacheSchema = z29.object({
3184
- profileKey: z29.string().min(1),
3185
- updatedAt: z29.string(),
3186
- rules: z29.object({
3187
- bash: z29.object({
3188
- mode: z29.enum(["allow", "approve", "deny"]),
3189
- stopPatterns: z29.array(z29.string()).default([]),
3190
- allowPatterns: z29.array(z29.string()).optional()
3426
+ gitMode: z30.enum([GitMode.DIRECT, GitMode.PR]).optional()
3427
+ });
3428
+ var TrustCacheSchema = z30.object({
3429
+ profileKey: z30.string().min(1),
3430
+ updatedAt: z30.string(),
3431
+ rules: z30.object({
3432
+ bash: z30.object({
3433
+ mode: z30.enum(["allow", "approve", "deny"]),
3434
+ stopPatterns: z30.array(z30.string()).default([]),
3435
+ allowPatterns: z30.array(z30.string()).optional()
3191
3436
  }),
3192
- files: z29.object({
3193
- mode: z29.enum(["allow", "approve"]),
3194
- protectedPaths: z29.array(z29.string()).default([])
3437
+ files: z30.object({
3438
+ mode: z30.enum(["allow", "approve"]),
3439
+ protectedPaths: z30.array(z30.string()).default([])
3195
3440
  }).optional(),
3196
- git: z29.object({ allowPushDefault: z29.boolean(), allowForcePush: z29.boolean() }).optional(),
3197
- network: z29.object({ allowSsh: z29.boolean(), sshHostsAllow: z29.array(z29.string()).optional() }).optional(),
3198
- approvalTtlMin: z29.number().int().positive().optional()
3441
+ git: z30.object({ allowPushDefault: z30.boolean(), allowForcePush: z30.boolean() }).optional(),
3442
+ network: z30.object({ allowSsh: z30.boolean(), sshHostsAllow: z30.array(z30.string()).optional() }).optional(),
3443
+ approvalTtlMin: z30.number().int().positive().optional()
3199
3444
  }).passthrough()
3200
3445
  }).nullable();
3201
- var ApprovedCommandSchema = z29.object({
3202
- token: z29.string().min(1),
3203
- command: z29.string().min(1),
3204
- cwd: z29.string().min(1),
3205
- expiresAt: z29.string(),
3206
- createdAt: z29.string()
3446
+ var ApprovedCommandSchema = z30.object({
3447
+ token: z30.string().min(1),
3448
+ command: z30.string().min(1),
3449
+ cwd: z30.string().min(1),
3450
+ expiresAt: z30.string(),
3451
+ createdAt: z30.string()
3207
3452
  });
3208
- var PendingApprovalSchema = z29.object({
3209
- command: z29.string().min(1),
3210
- cwd: z29.string().min(1),
3211
- createdAt: z29.string()
3453
+ var PendingApprovalSchema = z30.object({
3454
+ command: z30.string().min(1),
3455
+ cwd: z30.string().min(1),
3456
+ createdAt: z30.string()
3212
3457
  });
3213
- var AgentModeSchema = z29.enum([AgentMode.AUTONOMOUS, AgentMode.MANUAL]);
3458
+ var AgentModeSchema = z30.enum([AgentMode.AUTONOMOUS, AgentMode.MANUAL]);
3214
3459
  var DEFAULT_CONTEXT_RESET_AFTER_TASKS = ProjectSettingsSchema.parse({}).contextResetAfterTasks;
3215
- var ClientStateSchema = z29.object({
3216
- version: z29.literal(STATE_SCHEMA_VERSION).default(STATE_SCHEMA_VERSION),
3460
+ var ClientStateSchema = z30.object({
3461
+ version: z30.literal(STATE_SCHEMA_VERSION).default(STATE_SCHEMA_VERSION),
3217
3462
  mode: AgentModeSchema.default(AgentMode.MANUAL),
3218
3463
  currentTask: CurrentTaskSchema.nullable().default(null),
3219
3464
  /** Счётчик сдач задач в текущей «сессии» (§10.4 ТЗ). Сбрасывается `SessionStart` при `source ∈ {startup, clear}` — см. src/hooks/session-start.ts. */
3220
- tasksCompletedInSession: z29.number().int().nonnegative().default(0),
3465
+ tasksCompletedInSession: z30.number().int().nonnegative().default(0),
3221
3466
  /** Кэш `ProjectSettings.contextResetAfterTasks` (§7.2 ТЗ) — сколько задач подряд можно сдать, прежде чем `Stop`-хук попросит `/clear`. */
3222
- contextResetAfterTasks: z29.number().int().positive().default(DEFAULT_CONTEXT_RESET_AFTER_TASKS),
3467
+ contextResetAfterTasks: z30.number().int().positive().default(DEFAULT_CONTEXT_RESET_AFTER_TASKS),
3223
3468
  /** Кэш стоп-паттернов/правил доверия для `PreToolUse` фазы 4. */
3224
3469
  trust: TrustCacheSchema.default(null),
3225
3470
  /** Снимок задачи на момент последнего `PreCompact` — пишет src/hooks/pre-compact.ts, читает SessionStart(source="compact"), чтобы напомнить модели, чем она занималась. */
3226
- lastPreCompact: CurrentTaskSchema.extend({ savedAt: z29.string() }).nullable().default(null),
3471
+ lastPreCompact: CurrentTaskSchema.extend({ savedAt: z30.string() }).nullable().default(null),
3227
3472
  /** Кэш одноразовых токенов подтверждения (§14.4 ТЗ), ключ — `hashCommandKey(command, cwd)`. Читает/жжёт `PreToolUse` (`hooks/pre-tool-use.ts`), пишут `request_approval`/`wait_approval` и пуш `approval:decided` (`socket/client.ts`). */
3228
- approvedCommands: z29.record(z29.string(), ApprovedCommandSchema).default({}),
3473
+ approvedCommands: z30.record(z30.string(), ApprovedCommandSchema).default({}),
3229
3474
  /** Незавершённые запросы подтверждения, ключ — `approvalId`. См. `PendingApprovalSchema`. */
3230
- pendingApprovals: z29.record(z29.string(), PendingApprovalSchema).default({}),
3475
+ pendingApprovals: z30.record(z30.string(), PendingApprovalSchema).default({}),
3231
3476
  /**
3232
3477
  * Сколько байтов транскрипта уже посчитано в расход токенов (вопрос
3233
3478
  * владельца 18.09.2026).
@@ -3240,9 +3485,9 @@ var ClientStateSchema = z29.object({
3240
3485
  * расход задачи рос бы квадратично — по числам это выглядело бы как
3241
3486
  * «агент потратил в сто раз больше», и проверить было бы нечем.
3242
3487
  */
3243
- usageOffsets: z29.record(z29.string(), z29.number().int().nonnegative()).default({}),
3488
+ usageOffsets: z30.record(z30.string(), z30.number().int().nonnegative()).default({}),
3244
3489
  /** Штамп последней записи файла — выставляется в state/store.ts при каждом `writeState`. */
3245
- updatedAt: z29.string().default(() => (/* @__PURE__ */ new Date()).toISOString())
3490
+ updatedAt: z30.string().default(() => (/* @__PURE__ */ new Date()).toISOString())
3246
3491
  });
3247
3492
  function createDefaultState() {
3248
3493
  return ClientStateSchema.parse({});
@@ -3294,18 +3539,18 @@ function updateState(patch, filePath = getStateFilePath()) {
3294
3539
  }
3295
3540
 
3296
3541
  // src/config/schema.ts
3297
- import { z as z30 } from "zod";
3542
+ import { z as z31 } from "zod";
3298
3543
  var PROJECT_CONFIG_SCHEMA_VERSION = 1;
3299
- var ProjectConfigSchema = z30.object({
3300
- version: z30.literal(PROJECT_CONFIG_SCHEMA_VERSION).default(PROJECT_CONFIG_SCHEMA_VERSION),
3544
+ var ProjectConfigSchema = z31.object({
3545
+ version: z31.literal(PROJECT_CONFIG_SCHEMA_VERSION).default(PROJECT_CONFIG_SCHEMA_VERSION),
3301
3546
  /** URL платформы (§10.1 ТЗ), например `https://quiel.example.com`. */
3302
- url: z30.string().trim().url("\u041D\u0443\u0436\u0435\u043D \u043F\u043E\u043B\u043D\u044B\u0439 URL, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 https://quiel.example.com"),
3547
+ url: z31.string().trim().url("\u041D\u0443\u0436\u0435\u043D \u043F\u043E\u043B\u043D\u044B\u0439 URL, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 https://quiel.example.com"),
3303
3548
  /** Ключ проекта на платформе (OQ-11), например `REL`. */
3304
- projectKey: z30.string().trim().min(1, "\u041A\u043B\u044E\u0447 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u0435\u043D"),
3549
+ projectKey: z31.string().trim().min(1, "\u041A\u043B\u044E\u0447 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u0435\u043D"),
3305
3550
  /** Идентификатор агента — см. комментарий выше. */
3306
- agentId: z30.string().trim().min(1, "ID \u0430\u0433\u0435\u043D\u0442\u0430 \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u0435\u043D"),
3551
+ agentId: z31.string().trim().min(1, "ID \u0430\u0433\u0435\u043D\u0442\u0430 \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u0435\u043D"),
3307
3552
  /** Человекочитаемое имя агента (§7.4 ТЗ: «odya-macbook») — необязательно, только для локального отображения. */
3308
- agentName: z30.string().trim().min(1).optional(),
3553
+ agentName: z31.string().trim().min(1).optional(),
3309
3554
  /** Роли, с которыми агент забирает задачи — подмножество ролей участника (§7.4 ТЗ). */
3310
3555
  roleKeys: AgentRoleKeysSchema,
3311
3556
  /**
@@ -3338,19 +3583,19 @@ var ProjectConfigSchema = z30.object({
3338
3583
  * абсолютный путь вроде `/Users/odya/...` у коллеги на другой машине
3339
3584
  * оказался бы битым. Режим переносим — это соглашение проекта.
3340
3585
  */
3341
- worktrees: z30.enum(["isolated", "checkout"]).default("isolated")
3586
+ worktrees: z31.enum(["isolated", "checkout"]).default("isolated")
3342
3587
  });
3343
- var CredentialsEntrySchema = z30.object({
3344
- url: z30.string().trim().url(),
3345
- token: z30.string().min(1),
3346
- projectKey: z30.string().min(1),
3588
+ var CredentialsEntrySchema = z31.object({
3589
+ url: z31.string().trim().url(),
3590
+ token: z31.string().min(1),
3591
+ projectKey: z31.string().min(1),
3347
3592
  /** Когда записали — для диагностики (`quiel status`), не для логики. */
3348
- savedAt: z30.string()
3593
+ savedAt: z31.string()
3349
3594
  });
3350
3595
  var CREDENTIALS_SCHEMA_VERSION = 1;
3351
- var CredentialsFileSchema = z30.object({
3352
- version: z30.literal(CREDENTIALS_SCHEMA_VERSION).default(CREDENTIALS_SCHEMA_VERSION),
3353
- agents: z30.record(z30.string(), CredentialsEntrySchema).default({})
3596
+ var CredentialsFileSchema = z31.object({
3597
+ version: z31.literal(CREDENTIALS_SCHEMA_VERSION).default(CREDENTIALS_SCHEMA_VERSION),
3598
+ agents: z31.record(z31.string(), CredentialsEntrySchema).default({})
3354
3599
  });
3355
3600
  function createEmptyCredentialsFile() {
3356
3601
  return CredentialsFileSchema.parse({});
@@ -3431,13 +3676,13 @@ function ensureWorktreesIgnored(dir) {
3431
3676
  // src/config/mcp-json.ts
3432
3677
  import { existsSync as existsSync6, readFileSync as readFileSync6, writeFileSync as writeFileSync6 } from "fs";
3433
3678
  import { join as join6 } from "path";
3434
- import { z as z31 } from "zod";
3435
- var McpServerEntrySchema2 = z31.object({
3436
- command: z31.string().min(1).optional(),
3437
- args: z31.array(z31.string()).optional()
3679
+ import { z as z32 } from "zod";
3680
+ var McpServerEntrySchema2 = z32.object({
3681
+ command: z32.string().min(1).optional(),
3682
+ args: z32.array(z32.string()).optional()
3438
3683
  }).passthrough();
3439
- var McpJsonSchema = z31.object({
3440
- mcpServers: z31.record(z31.string(), McpServerEntrySchema2).optional()
3684
+ var McpJsonSchema = z32.object({
3685
+ mcpServers: z32.record(z32.string(), McpServerEntrySchema2).optional()
3441
3686
  }).passthrough();
3442
3687
  var MCP_JSON_RELATIVE_PATH = ".mcp.json";
3443
3688
  function mergeQuielMcpJson(existing) {
@@ -3626,11 +3871,11 @@ var claudeCodeInstaller = {
3626
3871
  };
3627
3872
 
3628
3873
  // src/agents/codex.ts
3629
- import { z as z32 } from "zod";
3874
+ import { z as z33 } from "zod";
3630
3875
  var CODEX_HOOKS_PATH = ".codex/hooks.json";
3631
3876
  var CODEX_CONFIG_PATH = ".codex/config.toml";
3632
- var CodexHooksFileSchema = z32.object({
3633
- hooks: z32.record(z32.string(), z32.array(z32.object({}).passthrough())).optional()
3877
+ var CodexHooksFileSchema = z33.object({
3878
+ hooks: z33.record(z33.string(), z33.array(z33.object({}).passthrough())).optional()
3634
3879
  }).passthrough();
3635
3880
  function mcpServerTable() {
3636
3881
  return [
@@ -3680,16 +3925,16 @@ var codexInstaller = {
3680
3925
  };
3681
3926
 
3682
3927
  // src/agents/cursor.ts
3683
- import { z as z33 } from "zod";
3928
+ import { z as z34 } from "zod";
3684
3929
  var CURSOR_HOOKS_PATH = ".cursor/hooks.json";
3685
3930
  var CURSOR_MCP_PATH = ".cursor/mcp.json";
3686
- var CursorHookEntrySchema = z33.object({ command: z33.string().min(1) }).passthrough();
3687
- var CursorHooksFileSchema = z33.object({
3688
- version: z33.number().optional(),
3689
- hooks: z33.record(z33.string(), z33.array(CursorHookEntrySchema)).optional()
3931
+ var CursorHookEntrySchema = z34.object({ command: z34.string().min(1) }).passthrough();
3932
+ var CursorHooksFileSchema = z34.object({
3933
+ version: z34.number().optional(),
3934
+ hooks: z34.record(z34.string(), z34.array(CursorHookEntrySchema)).optional()
3690
3935
  }).passthrough();
3691
- var CursorMcpFileSchema = z33.object({
3692
- mcpServers: z33.record(z33.string(), z33.object({}).passthrough()).optional()
3936
+ var CursorMcpFileSchema = z34.object({
3937
+ mcpServers: z34.record(z34.string(), z34.object({}).passthrough()).optional()
3693
3938
  }).passthrough();
3694
3939
  var CURSOR_HOOKS = {
3695
3940
  sessionStart: `${CLI_BIN} hook session-start --format cursor`,
@@ -3753,7 +3998,7 @@ var cursorInstaller = {
3753
3998
  };
3754
3999
 
3755
4000
  // src/agents/opencode.ts
3756
- import { z as z34 } from "zod";
4001
+ import { z as z35 } from "zod";
3757
4002
 
3758
4003
  // src/agents/opencode-plugin.ts
3759
4004
  var OPENCODE_PLUGIN_FILENAME = "quiel.js";
@@ -3803,9 +4048,9 @@ export const QuielPlugin = async ({ directory }) => {
3803
4048
  // src/agents/opencode.ts
3804
4049
  var OPENCODE_CONFIG_PATH = "opencode.json";
3805
4050
  var OPENCODE_SCHEMA_URL = "https://opencode.ai/config.json";
3806
- var OpencodeConfigSchema = z34.object({
3807
- $schema: z34.string().optional(),
3808
- mcp: z34.record(z34.string(), z34.object({}).passthrough()).optional()
4051
+ var OpencodeConfigSchema = z35.object({
4052
+ $schema: z35.string().optional(),
4053
+ mcp: z35.record(z35.string(), z35.object({}).passthrough()).optional()
3809
4054
  }).passthrough();
3810
4055
  var opencodeInstaller = {
3811
4056
  kind: AgentKind.OPENCODE,
@@ -3850,8 +4095,8 @@ var VERSION_ENV = {
3850
4095
  [AgentKind.CLAUDE_CODE]: "CLAUDE_CODE_VERSION"
3851
4096
  };
3852
4097
  var UNKNOWN_AGENT_VERSION = "unknown";
3853
- function readAgentVersion(kind, env = process.env) {
3854
- const name = VERSION_ENV[kind];
4098
+ function readAgentVersion(kind2, env = process.env) {
4099
+ const name = VERSION_ENV[kind2];
3855
4100
  const value = name ? env[name] : void 0;
3856
4101
  return value && value.trim().length > 0 ? value.trim() : UNKNOWN_AGENT_VERSION;
3857
4102
  }
@@ -3863,12 +4108,12 @@ var INSTALLERS = [
3863
4108
  cursorInstaller,
3864
4109
  opencodeInstaller
3865
4110
  ];
3866
- var BY_KIND2 = new Map(INSTALLERS.map((i) => [i.kind, i]));
3867
- function installerFor(kind) {
3868
- const installer = BY_KIND2.get(kind);
4111
+ var BY_KIND3 = new Map(INSTALLERS.map((i) => [i.kind, i]));
4112
+ function installerFor(kind2) {
4113
+ const installer = BY_KIND3.get(kind2);
3869
4114
  if (!installer) {
3870
4115
  throw new Error(
3871
- `\u0414\u043B\u044F \u0432\u0438\u0434\u0430 \u0430\u0433\u0435\u043D\u0442\u0430 ${kind} \u043D\u0435\u0442 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0449\u0438\u043A\u0430. \u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 @quiel/cli: \u0432\u0438\u0434\u0438\u043C\u043E, \u0440\u0435\u0435\u0441\u0442\u0440 \u043D\u043E\u0432\u0435\u0435 \u044D\u0442\u043E\u0433\u043E \u043F\u0430\u043A\u0435\u0442\u0430.`
4116
+ `\u0414\u043B\u044F \u0432\u0438\u0434\u0430 \u0430\u0433\u0435\u043D\u0442\u0430 ${kind2} \u043D\u0435\u0442 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0449\u0438\u043A\u0430. \u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 @quiel/cli: \u0432\u0438\u0434\u0438\u043C\u043E, \u0440\u0435\u0435\u0441\u0442\u0440 \u043D\u043E\u0432\u0435\u0435 \u044D\u0442\u043E\u0433\u043E \u043F\u0430\u043A\u0435\u0442\u0430.`
3872
4117
  );
3873
4118
  }
3874
4119
  return installer;
@@ -3930,7 +4175,7 @@ var createSocket = (url, options) => io(url, {
3930
4175
  // src/hooks/audit-sender.ts
3931
4176
  var DEFAULT_CONNECT_TIMEOUT_MS = 3e3;
3932
4177
  var DEFAULT_FLUSH_GRACE_MS = 150;
3933
- var WIRE_EVENTS = /* @__PURE__ */ new Set(["audit:command", "task:usage"]);
4178
+ var WIRE_EVENTS = /* @__PURE__ */ new Set(["audit:command", "task:usage", "session-limit-reached"]);
3934
4179
  function sendHookActions(actions, options = {}) {
3935
4180
  const wireActions = actions.filter((action) => WIRE_EVENTS.has(action.type));
3936
4181
  if (wireActions.length === 0) return;
@@ -3966,7 +4211,7 @@ function trimTrailingSlash(url) {
3966
4211
  }
3967
4212
 
3968
4213
  // src/hooks/format.ts
3969
- import { z as z35 } from "zod";
4214
+ import { z as z36 } from "zod";
3970
4215
  var HOOK_FORMATS = ["claude", "cursor", "opencode"];
3971
4216
  function asHookFormat(raw) {
3972
4217
  const value = raw.trim().toLowerCase();
@@ -3979,18 +4224,18 @@ var CLAUDE_EVENT = {
3979
4224
  "pre-tool-use": "PreToolUse",
3980
4225
  "pre-compact": "PreCompact"
3981
4226
  };
3982
- var CursorShellInputSchema = z35.object({ command: z35.string(), cwd: z35.string().optional() }).passthrough();
3983
- var CursorStopInputSchema = z35.object({ status: z35.string().optional(), loop_count: z35.number().optional() }).passthrough();
4227
+ var CursorShellInputSchema = z36.object({ command: z36.string(), cwd: z36.string().optional() }).passthrough();
4228
+ var CursorStopInputSchema = z36.object({ status: z36.string().optional(), loop_count: z36.number().optional() }).passthrough();
3984
4229
  function cursorPermission(decision) {
3985
4230
  if (decision === "deny") return "deny";
3986
4231
  if (decision === "allow") return "allow";
3987
4232
  return "ask";
3988
4233
  }
3989
- var OpencodePayloadSchema = z35.object({
3990
- directory: z35.string().optional(),
3991
- input: z35.object({ tool: z35.string().optional() }).passthrough().optional(),
3992
- output: z35.object({ args: z35.record(z35.string(), z35.unknown()).optional() }).passthrough().optional(),
3993
- event: z35.object({ type: z35.string().optional() }).passthrough().optional()
4234
+ var OpencodePayloadSchema = z36.object({
4235
+ directory: z36.string().optional(),
4236
+ input: z36.object({ tool: z36.string().optional() }).passthrough().optional(),
4237
+ output: z36.object({ args: z36.record(z36.string(), z36.unknown()).optional() }).passthrough().optional(),
4238
+ event: z36.object({ type: z36.string().optional() }).passthrough().optional()
3994
4239
  }).passthrough();
3995
4240
  var OPENCODE_TOOLS = {
3996
4241
  bash: { name: "Bash", arg: "command", field: "command" },
@@ -4795,7 +5040,7 @@ ${question.answerMd ?? ""}${describeAnswerAttachments(question)}`;
4795
5040
  // package.json
4796
5041
  var package_default = {
4797
5042
  name: "@quiel/cli",
4798
- version: "0.5.0",
5043
+ version: "0.5.2",
4799
5044
  description: "CLI \u0438 MCP-\u0441\u0435\u0440\u0432\u0435\u0440 Quiel: \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0430\u0433\u0435\u043D\u0442\u0430 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 (Claude Code, Codex, Cursor, OpenCode) \u043A \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u0435",
4800
5045
  homepage: "https://quiel.app",
4801
5046
  repository: {
@@ -4816,14 +5061,15 @@ var package_default = {
4816
5061
  "ai-agents",
4817
5062
  "task-tracker"
4818
5063
  ],
4819
- license: "UNLICENSED",
5064
+ license: "Apache-2.0",
4820
5065
  type: "module",
4821
5066
  bin: {
4822
5067
  quiel: "dist/cli.js"
4823
5068
  },
4824
5069
  files: [
4825
5070
  "dist",
4826
- "README.md"
5071
+ "README.md",
5072
+ "LICENSE"
4827
5073
  ],
4828
5074
  engines: {
4829
5075
  node: ">=22"
@@ -5764,7 +6010,7 @@ async function settleApproval(ack, commandCwd, runtime, waitSecUsed) {
5764
6010
  }
5765
6011
 
5766
6012
  // src/mcp/set-mode.ts
5767
- import { z as z36 } from "zod";
6013
+ import { z as z37 } from "zod";
5768
6014
 
5769
6015
  // src/cli/mode.ts
5770
6016
  function parseModeArg(raw) {
@@ -5805,7 +6051,7 @@ async function requestModeChange(modeArg, options = {}) {
5805
6051
 
5806
6052
  // src/mcp/set-mode.ts
5807
6053
  var setModeInputShape = {
5808
- mode: z36.enum(["auto", "manual"]).describe("auto \u2014 \u0432\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C \u0430\u0433\u0435\u043D\u0442\u0430, manual \u2014 \u0432\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u044C (\xA710.2 \u0422\u0417)")
6054
+ mode: z37.enum(["auto", "manual"]).describe("auto \u2014 \u0432\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C \u0430\u0433\u0435\u043D\u0442\u0430, manual \u2014 \u0432\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u044C (\xA710.2 \u0422\u0417)")
5809
6055
  };
5810
6056
  async function setModeHandler(args, runtime) {
5811
6057
  const result = await requestModeChange(args.mode, {
@@ -5820,20 +6066,20 @@ async function setModeHandler(args, runtime) {
5820
6066
  }
5821
6067
 
5822
6068
  // src/mcp/submit-work.ts
5823
- import { z as z37 } from "zod";
6069
+ import { z as z38 } from "zod";
5824
6070
  var submitWorkInputShape = {
5825
- branchName: z37.string().min(1).describe(
6071
+ branchName: z38.string().min(1).describe(
5826
6072
  "\u0418\u043C\u044F \u0432\u0435\u0442\u043A\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u0431\u0435\u0440\u0438 \u0440\u043E\u0432\u043D\u043E \u0438\u0437 project.branchName \u0432 TaskPayload, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0432\u0435\u0440\u043D\u0443\u043B next_task. \u041D\u0435 \u043F\u0440\u0438\u0434\u0443\u043C\u044B\u0432\u0430\u0439 \u0441\u0432\u043E\u0451."
5827
6073
  ),
5828
- defaultBranch: z37.string().min(1).describe("\u041E\u0441\u043D\u043E\u0432\u043D\u0430\u044F \u0432\u0435\u0442\u043A\u0430 \u0440\u0435\u043F\u043E\u0437\u0438\u0442\u043E\u0440\u0438\u044F \u2014 \u0438\u0437 project.repos[].defaultBranch."),
5829
- commitPrefix: z37.string().min(1).describe('\u041F\u0440\u0435\u0444\u0438\u043A\u0441 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043A\u043E\u043C\u043C\u0438\u0442\u0430 \u2014 \u0438\u0437 project.commitPrefix, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 "ATL-42:".'),
5830
- taskKey: z37.string().min(1).describe("\u041A\u043B\u044E\u0447 \u0437\u0430\u0434\u0430\u0447\u0438, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 ATL-42 \u2014 \u0438\u0437 task.key."),
5831
- taskTitle: z37.string().min(1).describe("\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u0438\u0437 task.title."),
5832
- repoRoot: z37.string().min(1).optional().describe("\u041A\u043E\u0440\u0435\u043D\u044C git-\u0440\u0435\u043F\u043E\u0437\u0438\u0442\u043E\u0440\u0438\u044F. \u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u2014 \u0440\u0430\u0431\u043E\u0447\u0438\u0439 \u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430."),
5833
- testsPassed: z37.boolean().optional().describe(
6074
+ defaultBranch: z38.string().min(1).describe("\u041E\u0441\u043D\u043E\u0432\u043D\u0430\u044F \u0432\u0435\u0442\u043A\u0430 \u0440\u0435\u043F\u043E\u0437\u0438\u0442\u043E\u0440\u0438\u044F \u2014 \u0438\u0437 project.repos[].defaultBranch."),
6075
+ commitPrefix: z38.string().min(1).describe('\u041F\u0440\u0435\u0444\u0438\u043A\u0441 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043A\u043E\u043C\u043C\u0438\u0442\u0430 \u2014 \u0438\u0437 project.commitPrefix, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 "ATL-42:".'),
6076
+ taskKey: z38.string().min(1).describe("\u041A\u043B\u044E\u0447 \u0437\u0430\u0434\u0430\u0447\u0438, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 ATL-42 \u2014 \u0438\u0437 task.key."),
6077
+ taskTitle: z38.string().min(1).describe("\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u0438\u0437 task.title."),
6078
+ repoRoot: z38.string().min(1).optional().describe("\u041A\u043E\u0440\u0435\u043D\u044C git-\u0440\u0435\u043F\u043E\u0437\u0438\u0442\u043E\u0440\u0438\u044F. \u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u2014 \u0440\u0430\u0431\u043E\u0447\u0438\u0439 \u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430."),
6079
+ testsPassed: z38.boolean().optional().describe(
5834
6080
  "\u041F\u0440\u043E\u0448\u043B\u0438 \u043B\u0438 \u0442\u0435\u0441\u0442\u044B. \u0415\u0441\u043B\u0438 \u043F\u0440\u043E\u0435\u043A\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0437\u0435\u043B\u0451\u043D\u044B\u0445 \u0442\u0435\u0441\u0442\u043E\u0432, \u0430 \u0437\u0434\u0435\u0441\u044C false \u2014 \u0441\u0434\u0430\u0447\u0430 \u043D\u0435 \u0441\u043E\u0441\u0442\u043E\u0438\u0442\u0441\u044F, \u0438 \u044D\u0442\u043E \u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u043E."
5835
6081
  ),
5836
- requireTestsPassed: z37.boolean().optional().describe("ProjectSettings.requireTests \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u2014 \u0438\u0437 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0438.")
6082
+ requireTestsPassed: z38.boolean().optional().describe("ProjectSettings.requireTests \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u2014 \u0438\u0437 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0438.")
5837
6083
  };
5838
6084
  async function submitWorkHandler(args, runtime) {
5839
6085
  const state = readState(runtime.stateFilePath);
@@ -6307,13 +6553,13 @@ function formatConnectResult(result) {
6307
6553
  }
6308
6554
 
6309
6555
  // src/hooks/pre-compact.ts
6310
- import { z as z38 } from "zod";
6311
- var PreCompactInputSchema = z38.object({
6312
- hook_event_name: z38.literal("PreCompact"),
6313
- session_id: z38.string(),
6314
- cwd: z38.string(),
6315
- trigger: z38.enum(["manual", "auto"]),
6316
- custom_instructions: z38.string().nullable()
6556
+ import { z as z39 } from "zod";
6557
+ var PreCompactInputSchema = z39.object({
6558
+ hook_event_name: z39.literal("PreCompact"),
6559
+ session_id: z39.string(),
6560
+ cwd: z39.string(),
6561
+ trigger: z39.enum(["manual", "auto"]),
6562
+ custom_instructions: z39.string().nullable()
6317
6563
  }).passthrough();
6318
6564
  function preCompactHook(_input, state, now = () => (/* @__PURE__ */ new Date()).toISOString()) {
6319
6565
  const lastPreCompact = state.currentTask ? { ...state.currentTask, savedAt: now() } : null;
@@ -6322,14 +6568,14 @@ function preCompactHook(_input, state, now = () => (/* @__PURE__ */ new Date()).
6322
6568
 
6323
6569
  // src/hooks/pre-tool-use.ts
6324
6570
  import { isAbsolute as isAbsolute2, relative as relative2, resolve as resolve3 } from "path";
6325
- import { z as z39 } from "zod";
6326
- var PreToolUseInputSchema = z39.object({
6327
- hook_event_name: z39.literal("PreToolUse"),
6328
- session_id: z39.string(),
6329
- cwd: z39.string(),
6330
- tool_name: z39.string(),
6331
- tool_input: z39.record(z39.string(), z39.unknown()),
6332
- tool_use_id: z39.string()
6571
+ import { z as z40 } from "zod";
6572
+ var PreToolUseInputSchema = z40.object({
6573
+ hook_event_name: z40.literal("PreToolUse"),
6574
+ session_id: z40.string(),
6575
+ cwd: z40.string(),
6576
+ tool_name: z40.string(),
6577
+ tool_input: z40.record(z40.string(), z40.unknown()),
6578
+ tool_use_id: z40.string()
6333
6579
  }).passthrough();
6334
6580
  var NO_TRUST_CACHE_REASON = "\u041A\u044D\u0448 \u043F\u0440\u0430\u0432\u0438\u043B \u0434\u043E\u0432\u0435\u0440\u0438\u044F (TrustRules) \u043F\u0443\u0441\u0442 \u2014 \u043A\u043B\u0438\u0435\u043D\u0442 \u043D\u0438 \u0440\u0430\u0437\u0443 \u043D\u0435 \u043F\u043E\u043B\u0443\u0447\u0430\u043B \u0438\u0445 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u043D\u0435\u0442 agent:hello/trust:updated). \u041E\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u043F\u0440\u043E\u0444\u0438\u043B\u044C (full/guarded/approve-all) \u0431\u0435\u0437 \u043D\u0435\u0433\u043E \u043D\u0435\u043B\u044C\u0437\u044F, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043F\u043E \u043F\u0440\u0430\u0432\u0438\u043B\u0443 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 (fail-closed \u043F\u0440\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E\u0441\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \xA710.4 \u0422\u0417) \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F. \u041F\u043E\u0434\u043D\u0438\u043C\u0438 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435: `quiel connect` (\u044D\u0442\u0430 \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0430 \u0438\u043C\u0435\u043D\u043D\u043E \u0434\u043B\u044F \u0442\u0430\u043A\u043E\u0433\u043E \u0441\u043B\u0443\u0447\u0430\u044F, \u0441\u043C. isBootstrapCommand) \u2014 \u043F\u043E\u0441\u043B\u0435 \u0440\u0443\u043A\u043E\u043F\u043E\u0436\u0430\u0442\u0438\u044F \u043F\u0440\u0430\u0432\u0438\u043B\u0430 \u043F\u0440\u0438\u0434\u0443\u0442, \u0438 \u043A\u043E\u043C\u0430\u043D\u0434\u044B \u043D\u0430\u0447\u043D\u0443\u0442 \u043F\u0440\u043E\u0445\u043E\u0434\u0438\u0442\u044C. \u0415\u0441\u043B\u0438 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044C, \u0432\u044B\u0437\u043E\u0432\u0438 request_approval.";
6335
6581
  var BOOTSTRAP_COMMAND_RE = /^quiel\s+(connect|status)\b/;
@@ -6474,7 +6720,7 @@ function handleFileWrite(input, state, now) {
6474
6720
  }
6475
6721
 
6476
6722
  // src/hooks/run.ts
6477
- import { z as z43 } from "zod";
6723
+ import { z as z44 } from "zod";
6478
6724
 
6479
6725
  // src/usage/read.ts
6480
6726
  import { closeSync, openSync, readSync, statSync } from "fs";
@@ -6561,13 +6807,13 @@ function readNewUsage(transcriptPath, offset) {
6561
6807
  }
6562
6808
 
6563
6809
  // src/hooks/session-start.ts
6564
- import { z as z40 } from "zod";
6565
- var SessionStartInputSchema = z40.object({
6566
- hook_event_name: z40.literal("SessionStart"),
6567
- session_id: z40.string(),
6568
- cwd: z40.string(),
6569
- source: z40.enum(["startup", "resume", "clear", "compact", "fork"]),
6570
- model: z40.string().optional()
6810
+ import { z as z41 } from "zod";
6811
+ var SessionStartInputSchema = z41.object({
6812
+ hook_event_name: z41.literal("SessionStart"),
6813
+ session_id: z41.string(),
6814
+ cwd: z41.string(),
6815
+ source: z41.enum(["startup", "resume", "clear", "compact", "fork"]),
6816
+ model: z41.string().optional()
6571
6817
  }).passthrough();
6572
6818
  var SESSION_RESET_SOURCES = /* @__PURE__ */ new Set([
6573
6819
  "startup",
@@ -6606,13 +6852,13 @@ function sessionStartHook(input, state) {
6606
6852
  }
6607
6853
 
6608
6854
  // src/hooks/stop.ts
6609
- import { z as z41 } from "zod";
6610
- var StopInputSchema = z41.object({
6611
- hook_event_name: z41.literal("Stop"),
6612
- session_id: z41.string(),
6613
- cwd: z41.string(),
6614
- stop_hook_active: z41.boolean(),
6615
- last_assistant_message: z41.string().optional()
6855
+ import { z as z42 } from "zod";
6856
+ var StopInputSchema = z42.object({
6857
+ hook_event_name: z42.literal("Stop"),
6858
+ session_id: z42.string(),
6859
+ cwd: z42.string(),
6860
+ stop_hook_active: z42.boolean(),
6861
+ last_assistant_message: z42.string().optional()
6616
6862
  }).passthrough();
6617
6863
  function taskLabel(state) {
6618
6864
  if (!state.currentTask) return "";
@@ -6656,8 +6902,8 @@ function stopHook(input, state) {
6656
6902
  }
6657
6903
 
6658
6904
  // src/hooks/stop-failure.ts
6659
- import { z as z42 } from "zod";
6660
- var StopFailureErrorTypeSchema = z42.enum([
6905
+ import { z as z43 } from "zod";
6906
+ var StopFailureErrorTypeSchema = z43.enum([
6661
6907
  "rate_limit",
6662
6908
  "overloaded",
6663
6909
  "authentication_failed",
@@ -6670,13 +6916,13 @@ var StopFailureErrorTypeSchema = z42.enum([
6670
6916
  "max_output_tokens",
6671
6917
  "unknown"
6672
6918
  ]);
6673
- var StopFailureInputSchema = z42.object({
6674
- hook_event_name: z42.literal("StopFailure"),
6675
- session_id: z42.string(),
6676
- cwd: z42.string(),
6919
+ var StopFailureInputSchema = z43.object({
6920
+ hook_event_name: z43.literal("StopFailure"),
6921
+ session_id: z43.string(),
6922
+ cwd: z43.string(),
6677
6923
  error: StopFailureErrorTypeSchema,
6678
- error_details: z42.unknown().optional(),
6679
- last_assistant_message: z42.string().optional()
6924
+ error_details: z43.unknown().optional(),
6925
+ last_assistant_message: z43.string().optional()
6680
6926
  }).passthrough();
6681
6927
  function extractRetryAfterSec(errorDetails) {
6682
6928
  if (typeof errorDetails === "number" && Number.isFinite(errorDetails) && errorDetails >= 0) {
@@ -6705,7 +6951,7 @@ function stopFailureHook(input, _state) {
6705
6951
  }
6706
6952
 
6707
6953
  // src/hooks/run.ts
6708
- var HookInputSchema = z43.discriminatedUnion("hook_event_name", [
6954
+ var HookInputSchema = z44.discriminatedUnion("hook_event_name", [
6709
6955
  SessionStartInputSchema,
6710
6956
  StopInputSchema,
6711
6957
  StopFailureInputSchema,
@@ -6857,13 +7103,13 @@ var FIELD_PROMPTS = {
6857
7103
  async function askAgentKind(options, prompter, interactive, cwd) {
6858
7104
  const fromFlag = options.agent?.trim();
6859
7105
  if (fromFlag && fromFlag.length > 0) {
6860
- const kind = agentKindFromCliKey(fromFlag);
6861
- if (!kind) {
7106
+ const kind2 = agentKindFromCliKey(fromFlag);
7107
+ if (!kind2) {
6862
7108
  throw new Error(
6863
7109
  `\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 --agent: ${fromFlag}. \u0414\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E: ${agentKindCliKeys().join(", ")}.`
6864
7110
  );
6865
7111
  }
6866
- return kind;
7112
+ return kind2;
6867
7113
  }
6868
7114
  if (!interactive) return DEFAULT_AGENT_KIND;
6869
7115
  const detected = detectAgentKinds((relative3) => existsSync10(join10(cwd, relative3)));
@@ -7065,9 +7311,9 @@ async function getStatus(options = {}, deps = {}) {
7065
7311
  reachability
7066
7312
  };
7067
7313
  }
7068
- function describeAgentKindLine(kind) {
7069
- const info = describeAgentKind(kind);
7070
- if (!info) return `${kind} (\u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u0439 \u0430\u0433\u0435\u043D\u0442 \u2014 \u043A\u043B\u0438\u0435\u043D\u0442 \u043D\u043E\u0432\u0435\u0435 \u0440\u0435\u0435\u0441\u0442\u0440\u0430?)`;
7314
+ function describeAgentKindLine(kind2) {
7315
+ const info = describeAgentKind(kind2);
7316
+ if (!info) return `${kind2} (\u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u0439 \u0430\u0433\u0435\u043D\u0442 \u2014 \u043A\u043B\u0438\u0435\u043D\u0442 \u043D\u043E\u0432\u0435\u0435 \u0440\u0435\u0435\u0441\u0442\u0440\u0430?)`;
7071
7317
  const beta = info.support === "documented" ? ", \u0431\u0435\u0442\u0430: \u0436\u0438\u0432\u044C\u0451\u043C \u043D\u0435 \u043F\u0440\u043E\u0432\u0435\u0440\u0435\u043D\u043E" : "";
7072
7318
  return `${info.label} \u2014 ${info.vendor}${beta}`;
7073
7319
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quiel/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "CLI и MCP-сервер Quiel: подключает агента участника (Claude Code, Codex, Cursor, OpenCode) к платформе",
5
5
  "homepage": "https://quiel.app",
6
6
  "repository": {
@@ -21,14 +21,15 @@
21
21
  "ai-agents",
22
22
  "task-tracker"
23
23
  ],
24
- "license": "UNLICENSED",
24
+ "license": "Apache-2.0",
25
25
  "type": "module",
26
26
  "bin": {
27
27
  "quiel": "dist/cli.js"
28
28
  },
29
29
  "files": [
30
30
  "dist",
31
- "README.md"
31
+ "README.md",
32
+ "LICENSE"
32
33
  ],
33
34
  "engines": {
34
35
  "node": ">=22"