@unity-china/codely-cli 1.0.0-rc.1 → 1.0.0-rc.10

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.
@@ -8,11 +8,6 @@
8
8
  * Copyright 2026
9
9
  * SPDX-License-Identifier: Apache-2.0
10
10
  */
11
- /**
12
- * @license
13
- * Copyright 2025 Qwen
14
- * SPDX-License-Identifier: Apache-2.0
15
- */
16
11
  /**
17
12
  * @license
18
13
  * Copyright 2025 Codely
@@ -28,6 +23,33 @@
28
23
  * Copyright 2025 Codely
29
24
  * SPDX-License-Identifier: Apache-2.0
30
25
  */
26
+ /**
27
+ * @license
28
+ * Copyright 2026 Codely
29
+ * SPDX-License-Identifier: Apache-2.0
30
+ */
31
+ /**
32
+ * @license
33
+ * Copyright 2025 Qwen
34
+ * SPDX-License-Identifier: Apache-2.0
35
+ */
36
+ /**
37
+ * @license
38
+ * Copyright 2025 Codely
39
+ * SPDX-License-Identifier: Apache-2.0
40
+ *
41
+ * LiteLLMLogger: Reports API call data to LiteLLM Proxy Report API.
42
+ *
43
+ * Features:
44
+ * - Triggers Langfuse callbacks for observability
45
+ * - Writes to LiteLLM DB SpendLogs for cost tracking
46
+ * - Records TTFT (Time to First Token) for streaming responses
47
+ *
48
+ * Design:
49
+ * - Always enabled (same as CodelyLogger)
50
+ * - Uses Codely OAuth cli_api_key for authentication
51
+ * - All network errors are silently handled to not affect CLI operation
52
+ */
31
53
  /**
32
54
  * @license
33
55
  * Copyright 2026 Google LLC
@@ -35,16 +57,54 @@
35
57
  */
36
58
  /**
37
59
  * @license
38
- * Copyright 2026 Codely
60
+ * Copyright 2026 Google LLC
61
+ * ---
62
+ * Ported from packages/cli/src/ui/scheduling/commandQueue.ts as part of
63
+ * Phase 2 (Queue Ownership) migration. The CLI file now re-exports these
64
+ * symbols and keeps scope helpers for its own use.
39
65
  * SPDX-License-Identifier: Apache-2.0
40
66
  */
67
+ /**
68
+ * @license
69
+ * Copyright 2026 Google LLC
70
+ * SPDX-License-Identifier: Apache-2.0
71
+ *
72
+ * ---
73
+ * Phase 2 (Queue Ownership) migration: this file is now a thin CLI-side
74
+ * adapter. The command-queue singleton and its API live in
75
+ * `@codely/codely-cli-core` (`packages/core/src/core/messageQueueManager.ts`)
76
+ * so the core agent loop can consume the same queue the CLI UI observes.
77
+ *
78
+ * This module re-exports the core API 1:1 and narrows the transparent
79
+ * `completionEvent?: unknown` field on `QueuedCommand` to the CLI-specific
80
+ * `TaskCompletionEvent` shape — preserving the existing CLI type surface
81
+ * and keeping all current imports source-compatible.
82
+ */
41
83
 
42
84
  Bundled license information:
43
85
 
86
+ web-streams-polyfill/dist/ponyfill.es2018.js:
87
+ /**
88
+ * @license
89
+ * web-streams-polyfill v3.3.3
90
+ * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
91
+ * This code is released under the MIT license.
92
+ * SPDX-License-Identifier: MIT
93
+ */
94
+
95
+ fetch-blob/index.js:
96
+ /*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
97
+
98
+ formdata-polyfill/esm.min.js:
99
+ undici/lib/web/fetch/body.js:
100
+ /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
101
+
102
+ node-domexception/index.js:
103
+ /*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
104
+
44
105
  safe-buffer/index.js:
45
106
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
46
107
 
47
- @google/genai/dist/node/index.mjs:
48
108
  @google/genai/dist/node/index.mjs:
49
109
  /**
50
110
  * @license
@@ -93,9 +153,6 @@ long/umd/index.js:
93
153
  * SPDX-License-Identifier: Apache-2.0
94
154
  */
95
155
 
96
- uri-js/dist/es5/uri.all.js:
97
- /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
98
-
99
156
  mime-db/index.js:
100
157
  /*!
101
158
  * mime-db
@@ -158,10 +215,6 @@ queue-microtask/index.js:
158
215
  run-parallel/index.js:
159
216
  /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
160
217
 
161
- undici/lib/web/fetch/body.js:
162
- formdata-polyfill/esm.min.js:
163
- /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
164
-
165
218
  undici/lib/web/websocket/frame.js:
166
219
  /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
167
220
 
@@ -200,21 +253,6 @@ mcp-proxy/dist/stdio-CfAxSAGj.js:
200
253
  */
201
254
  /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
202
255
 
203
- web-streams-polyfill/dist/ponyfill.es2018.js:
204
- /**
205
- * @license
206
- * web-streams-polyfill v3.3.3
207
- * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
208
- * This code is released under the MIT license.
209
- * SPDX-License-Identifier: MIT
210
- */
211
-
212
- fetch-blob/index.js:
213
- /*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
214
-
215
- node-domexception/index.js:
216
- /*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
217
-
218
256
  react/cjs/react.production.js:
219
257
  /**
220
258
  * @license React
@@ -237,10 +275,10 @@ react/cjs/react.development.js:
237
275
  * LICENSE file in the root directory of this source tree.
238
276
  */
239
277
 
240
- react-reconciler/cjs/react-reconciler-constants.production.js:
278
+ react/cjs/react-jsx-runtime.production.js:
241
279
  /**
242
280
  * @license React
243
- * react-reconciler-constants.production.js
281
+ * react-jsx-runtime.production.js
244
282
  *
245
283
  * Copyright (c) Meta Platforms, Inc. and affiliates.
246
284
  *
@@ -248,10 +286,10 @@ react-reconciler/cjs/react-reconciler-constants.production.js:
248
286
  * LICENSE file in the root directory of this source tree.
249
287
  */
250
288
 
251
- react-reconciler/cjs/react-reconciler-constants.development.js:
289
+ react/cjs/react-jsx-runtime.development.js:
252
290
  /**
253
291
  * @license React
254
- * react-reconciler-constants.development.js
292
+ * react-jsx-runtime.development.js
255
293
  *
256
294
  * Copyright (c) Meta Platforms, Inc. and affiliates.
257
295
  *
@@ -259,10 +297,10 @@ react-reconciler/cjs/react-reconciler-constants.development.js:
259
297
  * LICENSE file in the root directory of this source tree.
260
298
  */
261
299
 
262
- scheduler/cjs/scheduler.production.js:
300
+ react-reconciler/cjs/react-reconciler-constants.production.js:
263
301
  /**
264
302
  * @license React
265
- * scheduler.production.js
303
+ * react-reconciler-constants.production.js
266
304
  *
267
305
  * Copyright (c) Meta Platforms, Inc. and affiliates.
268
306
  *
@@ -270,10 +308,10 @@ scheduler/cjs/scheduler.production.js:
270
308
  * LICENSE file in the root directory of this source tree.
271
309
  */
272
310
 
273
- scheduler/cjs/scheduler.development.js:
311
+ react-reconciler/cjs/react-reconciler-constants.development.js:
274
312
  /**
275
313
  * @license React
276
- * scheduler.development.js
314
+ * react-reconciler-constants.development.js
277
315
  *
278
316
  * Copyright (c) Meta Platforms, Inc. and affiliates.
279
317
  *
@@ -281,10 +319,10 @@ scheduler/cjs/scheduler.development.js:
281
319
  * LICENSE file in the root directory of this source tree.
282
320
  */
283
321
 
284
- react-reconciler/cjs/react-reconciler.production.js:
322
+ scheduler/cjs/scheduler.production.js:
285
323
  /**
286
324
  * @license React
287
- * react-reconciler.production.js
325
+ * scheduler.production.js
288
326
  *
289
327
  * Copyright (c) Meta Platforms, Inc. and affiliates.
290
328
  *
@@ -292,10 +330,10 @@ react-reconciler/cjs/react-reconciler.production.js:
292
330
  * LICENSE file in the root directory of this source tree.
293
331
  */
294
332
 
295
- react-reconciler/cjs/react-reconciler.development.js:
333
+ scheduler/cjs/scheduler.development.js:
296
334
  /**
297
335
  * @license React
298
- * react-reconciler.development.js
336
+ * scheduler.development.js
299
337
  *
300
338
  * Copyright (c) Meta Platforms, Inc. and affiliates.
301
339
  *
@@ -303,19 +341,21 @@ react-reconciler/cjs/react-reconciler.development.js:
303
341
  * LICENSE file in the root directory of this source tree.
304
342
  */
305
343
 
306
- react-devtools-core/dist/backend.js:
344
+ react-reconciler/cjs/react-reconciler.production.js:
307
345
  /**
308
346
  * @license React
309
- * react-debug-tools.production.js
347
+ * react-reconciler.production.js
310
348
  *
311
349
  * Copyright (c) Meta Platforms, Inc. and affiliates.
312
350
  *
313
351
  * This source code is licensed under the MIT license found in the
314
352
  * LICENSE file in the root directory of this source tree.
315
353
  */
354
+
355
+ react-reconciler/cjs/react-reconciler.development.js:
316
356
  /**
317
357
  * @license React
318
- * react.production.js
358
+ * react-reconciler.development.js
319
359
  *
320
360
  * Copyright (c) Meta Platforms, Inc. and affiliates.
321
361
  *
@@ -323,21 +363,19 @@ react-devtools-core/dist/backend.js:
323
363
  * LICENSE file in the root directory of this source tree.
324
364
  */
325
365
 
326
- react/cjs/react-jsx-runtime.production.js:
366
+ react-devtools-core/dist/backend.js:
327
367
  /**
328
368
  * @license React
329
- * react-jsx-runtime.production.js
369
+ * react-debug-tools.production.js
330
370
  *
331
371
  * Copyright (c) Meta Platforms, Inc. and affiliates.
332
372
  *
333
373
  * This source code is licensed under the MIT license found in the
334
374
  * LICENSE file in the root directory of this source tree.
335
375
  */
336
-
337
- react/cjs/react-jsx-runtime.development.js:
338
376
  /**
339
377
  * @license React
340
- * react-jsx-runtime.development.js
378
+ * react.production.js
341
379
  *
342
380
  * Copyright (c) Meta Platforms, Inc. and affiliates.
343
381
  *
@@ -1,17 +1,27 @@
1
- # Plan Mode policy: deny-all + read-only whitelist + plans dir write exception.
1
+ # Plan Mode policy: default-ask + explicit allow for exploration/planning tools.
2
2
  # Active only when ApprovalMode = "plan".
3
3
  #
4
+ # Design:
5
+ # - No blanket deny-all: tools default to ASK_USER (interactive) or ALLOW (non-interactive).
6
+ # - Explicit ALLOW for exploration/planning tools (including shell).
7
+ # - Conditional ALLOW for write_file/replace (plans directory only).
8
+ #
4
9
  # Priority bands (tiers):
5
10
  # - Default policies (TOML): 1 + priority/1000
6
- # 60: Catch-all deny for plan mode (becomes 1.060)
7
- # 70: Explicit allows for plan mode (becomes 1.070, overrides deny)
11
+ # 70: Explicit allows and ask rules for plan mode (becomes 1.070, overrides deny)
12
+ #
13
+ # Non-interactive plan mode:
14
+ # The PolicyEngine converts ASK_USER → DENY for non-interactive sessions.
15
+ # When entering plan mode in non-interactive, Config.setApprovalMode()
16
+ # sets the PolicyEngine default decision to ALLOW, so tools without
17
+ # explicit rules are available by default.
8
18
 
9
- # --- Catch-all deny for plan mode ---
19
+ # --- Explicit allows for plan mode ---
10
20
  [[rule]]
11
- decision = "deny"
12
- priority = 60
21
+ toolName = "run_shell_command"
22
+ decision = "allow"
23
+ priority = 70
13
24
  modes = ["plan"]
14
- deny_message = "You are in Plan Mode. Only approved planning tools (including read/search/multimedia) and writing plans to the plans directory are allowed. Use exit_plan_mode to request approval for your plan."
15
25
 
16
26
  # --- Read-only tools allowed in plan mode ---
17
27
  [[rule]]
@@ -97,6 +107,14 @@ priority = 70
97
107
  modes = ["plan"]
98
108
  argsPattern = "\"file_path\"\\s*:\\s*\"[^\"]*[/\\\\]+\\.codely-cli[/\\\\]+tmp[/\\\\]+[a-f0-9]{64}[/\\\\]+plans[/\\\\]+[a-zA-Z0-9_\\-][a-zA-Z0-9_\\-.]*\\.md\""
99
109
 
110
+ # write_file outside the plans directory requires approval (interactive)
111
+ # or is denied (non-interactive via ask-downgrade)
112
+ [[rule]]
113
+ toolName = "write_file"
114
+ decision = "ask_user"
115
+ priority = 65
116
+ modes = ["plan"]
117
+
100
118
  [[rule]]
101
119
  toolName = "replace"
102
120
  decision = "allow"
@@ -104,6 +122,14 @@ priority = 70
104
122
  modes = ["plan"]
105
123
  argsPattern = "\"file_path\"\\s*:\\s*\"[^\"]*[/\\\\]+\\.codely-cli[/\\\\]+tmp[/\\\\]+[a-f0-9]{64}[/\\\\]+plans[/\\\\]+[a-zA-Z0-9_\\-][a-zA-Z0-9_\\-.]*\\.md\""
106
124
 
125
+ # replace outside the plans directory requires approval (interactive)
126
+ # or is denied (non-interactive via ask-downgrade)
127
+ [[rule]]
128
+ toolName = "replace"
129
+ decision = "ask_user"
130
+ priority = 65
131
+ modes = ["plan"]
132
+
107
133
  # --- exit_plan_mode requires user approval ---
108
134
  [[rule]]
109
135
  toolName = "exit_plan_mode"