@unity-china/codely-cli 1.0.0-rc.5 → 1.0.0-rc.52

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 (28) hide show
  1. package/README.md +34 -0
  2. package/bundle/builtin/codely-guide/SKILL.md +77 -0
  3. package/bundle/builtin/codely-guide/references/app.md +125 -0
  4. package/bundle/builtin/skill-creator/scripts/package_skill.cjs +1 -3
  5. package/bundle/builtin/tuanjie-cli/SKILL.md +145 -0
  6. package/bundle/builtin/tuanjie-cli/references/commands.md +138 -0
  7. package/bundle/builtin-agents/explore.toml +62 -0
  8. package/bundle/builtin-agents/general-purpose.toml +34 -0
  9. package/bundle/builtin-agents/plan.toml +69 -0
  10. package/bundle/builtin-agents/unity-insight.toml +102 -0
  11. package/bundle/example-prompts/analyze.toml +3 -3
  12. package/bundle/gemini.js +3985 -6204
  13. package/bundle/gemini.js.LEGAL.txt +314 -80
  14. package/bundle/loop-detection-policies/default.toml +76 -0
  15. package/bundle/node_modules/@silvia-odwyer/photon-node/LICENSE.md +201 -0
  16. package/bundle/node_modules/@silvia-odwyer/photon-node/README.md +158 -0
  17. package/bundle/node_modules/@silvia-odwyer/photon-node/package.json +23 -0
  18. package/bundle/node_modules/@silvia-odwyer/photon-node/photon_rs.d.ts +3226 -0
  19. package/bundle/node_modules/@silvia-odwyer/photon-node/photon_rs.js +4521 -0
  20. package/bundle/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js +4270 -0
  21. package/bundle/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm +0 -0
  22. package/bundle/policies/plan.toml +35 -19
  23. package/bundle/policies/read-only.toml +0 -10
  24. package/bundle/policies/write.toml +0 -5
  25. package/bundle/web-ui/dist/public/app.css +63 -0
  26. package/bundle/web-ui/dist/public/app.js +48 -48
  27. package/package.json +9 -6
  28. package/bundle/tiktoken_bg.wasm +0 -0
@@ -5,7 +5,7 @@
5
5
  */
6
6
  /**
7
7
  * @license
8
- * Copyright 2026
8
+ * Copyright 2026 Google LLC
9
9
  * SPDX-License-Identifier: Apache-2.0
10
10
  */
11
11
  /**
@@ -13,6 +13,21 @@
13
13
  * Copyright 2025 Qwen
14
14
  * SPDX-License-Identifier: Apache-2.0
15
15
  */
16
+ /**
17
+ * @license
18
+ * Copyright 2025 Codely
19
+ * SPDX-License-Identifier: Apache-2.0
20
+ *
21
+ * Organization management API service for multi-org support.
22
+ * Provides functions to list organizations and switch to active organization.
23
+ *
24
+ * The server API uses `team_*` field names, but this service maps them to
25
+ * `org_*` at the boundary so that all consumers use consistent org terminology.
26
+ *
27
+ * CodelyOrgService is a stateless data layer — it does NOT track "current
28
+ * user" or "active user". It only provides get/set by user_id. The caller
29
+ * (CodelyOAuth2Client) owns user_id and passes it explicitly.
30
+ */
16
31
  /**
17
32
  * @license
18
33
  * Copyright 2025 Codely
@@ -28,23 +43,286 @@
28
43
  * Copyright 2025 Codely
29
44
  * SPDX-License-Identifier: Apache-2.0
30
45
  */
46
+ /**
47
+ * @license
48
+ * Copyright 2025 Codely
49
+ * SPDX-License-Identifier: Apache-2.0
50
+ *
51
+ * LiteLLMLogger: Reports API call data to LiteLLM Proxy Report API.
52
+ *
53
+ * Features:
54
+ * - Triggers Langfuse callbacks for observability
55
+ * - Writes to LiteLLM DB SpendLogs for cost tracking
56
+ * - Records TTFT (Time to First Token) for streaming responses
57
+ *
58
+ * Design:
59
+ * - Always enabled (same as CodelyLogger)
60
+ * - Uses Codely OAuth cli_api_key for authentication
61
+ * - All network errors are silently handled to not affect CLI operation
62
+ */
63
+ /**
64
+ * @license
65
+ * Copyright 2026
66
+ * SPDX-License-Identifier: Apache-2.0
67
+ */
68
+ /**
69
+ * @license
70
+ * Copyright 2026 Codely
71
+ * SPDX-License-Identifier: Apache-2.0
72
+ */
31
73
  /**
32
74
  * @license
33
75
  * Copyright 2026 Google LLC
76
+ * ---
77
+ * Ported from packages/cli/src/ui/scheduling/commandQueue.ts as part of
78
+ * Phase 2 (Queue Ownership) migration. The CLI file now re-exports these
79
+ * symbols and keeps scope helpers for its own use.
34
80
  * SPDX-License-Identifier: Apache-2.0
35
81
  */
36
82
  /**
37
83
  * @license
38
84
  * Copyright 2026 Codely
39
85
  * SPDX-License-Identifier: Apache-2.0
86
+ *
87
+ * Absolute physical anchor for the non-alt (main-screen Static-split) live
88
+ * region.
89
+ *
90
+ * Every normal frame positions the floating dock with RELATIVE cursor moves
91
+ * (`parkBackToBottom` + `cursorUp(prevHeight)`), which assumes the physical
92
+ * cursor is exactly where ink parked it. Recovery paths (sleep/stall
93
+ * self-heal, focus regain) inherit that assumption, so if anything moved the
94
+ * physical cursor out of band the repaint lands on the wrong rows — it can
95
+ * stack a second dock or paint over committed transcript.
96
+ *
97
+ * The insight that makes recovery fixable: out-of-band cursor moves relocate
98
+ * the CURSOR, not the CONTENT. The dock's physical rows are still where ink
99
+ * wrote them. So if ink remembers the live region's absolute TOP row, a
100
+ * recovery repaint can address it with an absolute CUP instead of relative
101
+ * moves and is then immune to cursor drift.
102
+ *
103
+ * Tracking rules (all derived from data ink already has per frame):
104
+ *
105
+ * - The absolute row is unknowable at startup: the CLI begins wherever the
106
+ * shell prompt happened to be. `top` therefore starts as `null` and callers
107
+ * must fall back to the legacy relative behavior while it is null.
108
+ * - Once ink has emitted at least `terminalRows` scrollback rows, everything
109
+ * it wrote has scrolled the cursor to the bottom row, so the live region
110
+ * provably occupies the last `liveHeight` rows — that is the one moment an
111
+ * exact absolute claim can be made, and it seeds the anchor.
112
+ * - Afterwards the anchor moves incrementally: appended static rows push it
113
+ * down (bounded by the screen bottom), a growing live region pushes it up,
114
+ * and a shrinking one leaves it where it is — `serializeFrameForOverwrite`
115
+ * keeps the region top fixed on a shrink and erases the vacated rows below,
116
+ * so the dock is NOT bottom-pinned after shrinking.
117
+ * - Anything that invalidates ink's picture of the screen (resize, ED2/clear,
118
+ * external-program handoff, alt-screen transitions) resets the anchor to
119
+ * unknown rather than guessing.
120
+ */
121
+ /**
122
+ * @license
123
+ * Copyright 2026 Codely
124
+ * SPDX-License-Identifier: Apache-2.0
125
+ *
126
+ * Renderer-owned main-screen Static-split footer transaction.
127
+ *
128
+ * When non-alt `<Static>` is active the renderer yields both
129
+ * `frame.staticScreen` (append-only scrollback delta) and `frame.screen`
130
+ * (the floating live footer). This helper owns the ordered stdout write
131
+ * for that split so ink.tsx does not assemble park/erase/append/overwrite
132
+ * patches ad-hoc.
133
+ *
134
+ * Activation: caller only invokes this for `!altScreenActive`. The
135
+ * no-`<Static>` main-screen path and alt-screen remain outside this
136
+ * contract.
137
+ */
138
+ /**
139
+ * @license
140
+ * Copyright 2026 Codely
141
+ * SPDX-License-Identifier: Apache-2.0
142
+ *
143
+ * Terminal output ownership for the non-alt Static-split / LiveRoot path.
144
+ *
145
+ * While ownership mode is `split-footer`, the Ink renderer is the only
146
+ * writer allowed to touch the TTY. Normal child output is already piped into
147
+ * tool/history events; interactive external programs must use
148
+ * `withTerminalHandoff` so ownership is suspended for the handoff.
149
+ */
150
+ /**
151
+ * @license
152
+ * Copyright 2026 Google LLC
153
+ * SPDX-License-Identifier: Apache-2.0
154
+ *
155
+ * ---
156
+ * Phase 2 (Queue Ownership) migration: this file is now a thin CLI-side
157
+ * adapter. The command-queue singleton and its API live in
158
+ * `@codely/codely-cli-core` (`packages/core/src/core/messageQueueManager.ts`)
159
+ * so the core agent loop can consume the same queue the CLI UI observes.
160
+ *
161
+ * This module re-exports the core API 1:1 and narrows the transparent
162
+ * `completionEvent?: unknown` field on `QueuedCommand` to the CLI-specific
163
+ * `TaskCompletionEvent` shape — preserving the existing CLI type surface
164
+ * and keeping all current imports source-compatible.
165
+ */
166
+ /*
167
+ * @license
168
+ * Copyright 2025 Google LLC
169
+ * SPDX-License-Identifier: Apache-2.0
170
+ */
171
+ /**
172
+ * @license
173
+ * Copyright 2026 Codely
174
+ * SPDX-License-Identifier: Apache-2.0
175
+ *
176
+ * LiveRoot fixed-max budget (TDD plan Phase 1). Pure, statically computable
177
+ * height budget for the non-alt (main-screen Static-split) LiveRoot.
178
+ *
179
+ * Model (see plans/liveroot-fixed-max-erase-tdd-plan.md):
180
+ *
181
+ * liveRootMax = min(LIVE_ROOT_MAX_ROWS, terminalHeight − 1)
182
+ * pendingMax = max(0, liveRootMax − dockDeclaredHeight) // streaming tools
183
+ *
184
+ * TWO physical bounds compose here:
185
+ *
186
+ * 1. `LIVE_ROOT_MAX_ROWS` — the FIXED WINDOW. Bounds the ENTIRE live region
187
+ * (pending streaming transcript + BottomDock) and, equivalently, the
188
+ * physical row span the renderer must refresh per frame. Capping to a fixed
189
+ * window (à la openTUI's固定 footerHeight) means pending can never grow tall
190
+ * enough that an incremental print scrolls the previous frame (dock
191
+ * included) off-screen into native scrollback. Binds on tall terminals.
192
+ *
193
+ * 2. `terminalHeight − 1` — the ENGINE bound. The ink renderer crops the
194
+ * non-alt live screen to `terminalRows − 1`
195
+ * (renderer.ts `cropLiveScreenForMainScreenStaticSplit`), and that crop
196
+ * drops rows from the TOP. Budgeting the full `terminalHeight` would let
197
+ * Yoga lay out one row more than the engine can display, so the engine
198
+ * would silently eat the live region's first row — the pending headline,
199
+ * or the dock's top row when the dock alone fills the window. The `-1` is
200
+ * therefore a geometric bound, not merely the legacy erase patch row, and
201
+ * must be honored until the engine's crop changes. Binds below 31 rows.
202
+ *
203
+ * The dock is the MUST-KEEP region — it drives its own compaction via
204
+ * resolveDockLayoutPlan (fold attachments → hide → reduce chrome → single-line
205
+ * input + "terminal too short" hint). Pending takes whatever is left inside
206
+ * the window and yields to 0 on tiny terminals / tall docks.
207
+ */
208
+ /**
209
+ * @license
210
+ * Copyright 2026 Codely
211
+ * SPDX-License-Identifier: Apache-2.0
212
+ *
213
+ * Non-alt Shared LiveRoot (LiveRoot plan §2/§4.1). The single Yoga subtree
214
+ * that bounds the ENTIRE non-alt live region — pending (streaming) transcript
215
+ * + BottomDock — to a FIXED physical window in one layout pass:
216
+ *
217
+ * <LiveRoot maxHeight> // hard physical bound
218
+ * <PendingClip shrink hidden> // pending yields to the dock
219
+ * <PendingContent shrink=0> // natural layout, then TAIL-cropped
220
+ * <Dock shrink=0> // never squeezed by pending
221
+ *
222
+ * `maxHeight` is the fixed-window bound `min(LIVE_ROOT_MAX_ROWS, terminalHeight − 1)`
223
+ * (see liveRootBudget.ts / App.getLiveRootMaxHeight) — NOT the legacy
224
+ * `terminalHeight − 1`. The old `-1` was a patch row for the model-height
225
+ * erase mechanism, not a geometric bound; capping the whole live region to a
226
+ * fixed window keeps a batch of streaming tool groups from growing tall
227
+ * enough that an incremental print scrolls the previous frame (dock included)
228
+ * off-screen into native scrollback.
229
+ *
230
+ * Invariants (plan §2.1):
231
+ * - LiveRoot rendered height <= maxHeight (= min(LIVE_ROOT_MAX_ROWS,
232
+ * terminalHeight));
233
+ * - PendingClip rendered height = max(0, maxHeight − dock actual height),
234
+ * computed by Yoga from the dock's REAL height — no measured-state
235
+ * feedback loop, no DOCK_CAP contract required for correctness;
236
+ * - the dock is flexShrink=0: pending can NEVER squeeze it. If the dock
237
+ * ALONE exceeds maxHeight (tiny terminal + tall dialog), the root's
238
+ * overflow clipping crops the dock from the BOTTOM (decision 2) — the
239
+ * accepted extreme-case fallback that still prevents the offscreen
240
+ * full-reset;
241
+ * - maxHeight, not height: idle/small frames keep their natural height and
242
+ * never pad blank rows that push the physical cursor to the viewport
243
+ * bottom.
244
+ */
245
+ /**
246
+ * @license
247
+ * Copyright 2026 Codely
248
+ * SPDX-License-Identifier: Apache-2.0
249
+ *
250
+ * Selection-key helpers, ported from Claude Code's ScrollKeybindingHandler.
251
+ * Used by the alt-screen keyboard handler to decide, for a keypress arriving
252
+ * while a text selection exists, whether to clear the selection and whether
253
+ * the key extends it (shift+nav). Operates on the cli `Key` (useCliInput) —
254
+ * that is the authoritative keyboard path where ctrl+c/Esc are already owned.
255
+ */
256
+ /**
257
+ * @license
258
+ * Copyright 2026 Codely
259
+ * SPDX-License-Identifier: Apache-2.0
260
+ *
261
+ * Auto-copy a text selection to the clipboard when the user finishes dragging
262
+ * (mouse-up with a non-empty selection) or multi-clicks to select a word/line.
263
+ * Mirrors iTerm2's "Copy to pasteboard on selection" — the highlight is left
264
+ * intact so the user can see what was copied. Ported from Claude Code's
265
+ * useCopyOnSelect.
266
+ *
267
+ * This is what makes copy "just work" in alt-screen: mouse tracking disables
268
+ * the terminal's native selection, and cmd+c is intercepted by the terminal's
269
+ * Edit > Copy before the pty sees it. Auto-copying on mouse-up leaves the
270
+ * system clipboard holding the right content, so cmd+c / paste behave as the
271
+ * user expects. ctrl+c (when a selection exists) also copies via the handler.
272
+ *
273
+ * Only meaningful in alt-screen mode: outside it, useSelection returns a stub
274
+ * whose hasSelection() is always false, so the subscribe callback no-ops.
275
+ */
276
+ /**
277
+ * @license
278
+ * Copyright 2026 Codely
279
+ * SPDX-License-Identifier: Apache-2.0
280
+ *
281
+ * Drag-to-scroll: auto-scroll the transcript ScrollBox when the user drags a
282
+ * text selection past its top or bottom edge (mode-1002 mouse tracking only
283
+ * reports on cell change, so a drag held off-edge needs a timer to keep
284
+ * scrolling). Ported from Claude Code's ScrollKeybindingHandler
285
+ * (dragScrollDirection + useDragToScroll).
286
+ *
287
+ * The anchor is shifted opposite the scroll so it stays on the same content,
288
+ * and rows about to scroll out are captured into the selection's
289
+ * scrolledOffAbove/Below accumulators (engine-owned) so getSelectedText can
290
+ * rejoin them — the screen buffer only holds the current viewport.
291
+ */
292
+ /**
293
+ * @license
294
+ * Copyright 2025 Codely
295
+ * SPDX-License-Identifier: Apache-2.0
296
+ *
297
+ * ACP extension methods for organization management.
298
+ * Allows external clients (e.g., VS Code extensions) to list and switch
299
+ * organizations through the ACP protocol.
40
300
  */
41
301
 
42
302
  Bundled license information:
43
303
 
304
+ web-streams-polyfill/dist/ponyfill.es2018.js:
305
+ /**
306
+ * @license
307
+ * web-streams-polyfill v3.3.3
308
+ * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
309
+ * This code is released under the MIT license.
310
+ * SPDX-License-Identifier: MIT
311
+ */
312
+
313
+ fetch-blob/index.js:
314
+ /*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
315
+
316
+ formdata-polyfill/esm.min.js:
317
+ undici/lib/web/fetch/body.js:
318
+ /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
319
+
320
+ node-domexception/index.js:
321
+ /*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
322
+
44
323
  safe-buffer/index.js:
45
324
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
46
325
 
47
- @google/genai/dist/node/index.mjs:
48
326
  @google/genai/dist/node/index.mjs:
49
327
  /**
50
328
  * @license
@@ -52,6 +330,22 @@ safe-buffer/index.js:
52
330
  * SPDX-License-Identifier: Apache-2.0
53
331
  */
54
332
 
333
+ mime-db/index.js:
334
+ /*!
335
+ * mime-db
336
+ * Copyright(c) 2014 Jonathan Ong
337
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
338
+ * MIT Licensed
339
+ */
340
+
341
+ mime-types/index.js:
342
+ /*!
343
+ * mime-types
344
+ * Copyright(c) 2014 Jonathan Ong
345
+ * Copyright(c) 2015 Douglas Christopher Wilson
346
+ * MIT Licensed
347
+ */
348
+
55
349
  @grpc/proto-loader/build/src/util.js:
56
350
  @grpc/proto-loader/build/src/index.js:
57
351
  /**
@@ -93,25 +387,6 @@ long/umd/index.js:
93
387
  * SPDX-License-Identifier: Apache-2.0
94
388
  */
95
389
 
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
- mime-db/index.js:
100
- /*!
101
- * mime-db
102
- * Copyright(c) 2014 Jonathan Ong
103
- * Copyright(c) 2015-2022 Douglas Christopher Wilson
104
- * MIT Licensed
105
- */
106
-
107
- mime-types/index.js:
108
- /*!
109
- * mime-types
110
- * Copyright(c) 2014 Jonathan Ong
111
- * Copyright(c) 2015 Douglas Christopher Wilson
112
- * MIT Licensed
113
- */
114
-
115
390
  is-extglob/index.js:
116
391
  /*!
117
392
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
@@ -158,13 +433,12 @@ queue-microtask/index.js:
158
433
  run-parallel/index.js:
159
434
  /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
160
435
 
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
436
  undici/lib/web/websocket/frame.js:
166
437
  /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
167
438
 
439
+ chokidar/esm/index.js:
440
+ /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
441
+
168
442
  fzf/dist/fzf.es.js:
169
443
  /** @license
170
444
  * fzf v0.5.2
@@ -200,21 +474,6 @@ mcp-proxy/dist/stdio-CfAxSAGj.js:
200
474
  */
201
475
  /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
202
476
 
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
477
  react/cjs/react.production.js:
219
478
  /**
220
479
  * @license React
@@ -237,28 +496,6 @@ react/cjs/react.development.js:
237
496
  * LICENSE file in the root directory of this source tree.
238
497
  */
239
498
 
240
- react/cjs/react-jsx-runtime.production.js:
241
- /**
242
- * @license React
243
- * react-jsx-runtime.production.js
244
- *
245
- * Copyright (c) Meta Platforms, Inc. and affiliates.
246
- *
247
- * This source code is licensed under the MIT license found in the
248
- * LICENSE file in the root directory of this source tree.
249
- */
250
-
251
- react/cjs/react-jsx-runtime.development.js:
252
- /**
253
- * @license React
254
- * react-jsx-runtime.development.js
255
- *
256
- * Copyright (c) Meta Platforms, Inc. and affiliates.
257
- *
258
- * This source code is licensed under the MIT license found in the
259
- * LICENSE file in the root directory of this source tree.
260
- */
261
-
262
499
  react-reconciler/cjs/react-reconciler-constants.production.js:
263
500
  /**
264
501
  * @license React
@@ -325,19 +562,21 @@ react-reconciler/cjs/react-reconciler.development.js:
325
562
  * LICENSE file in the root directory of this source tree.
326
563
  */
327
564
 
328
- react-devtools-core/dist/backend.js:
565
+ react/cjs/react-compiler-runtime.production.js:
329
566
  /**
330
567
  * @license React
331
- * react-debug-tools.production.js
568
+ * react-compiler-runtime.production.js
332
569
  *
333
570
  * Copyright (c) Meta Platforms, Inc. and affiliates.
334
571
  *
335
572
  * This source code is licensed under the MIT license found in the
336
573
  * LICENSE file in the root directory of this source tree.
337
574
  */
575
+
576
+ react/cjs/react-compiler-runtime.development.js:
338
577
  /**
339
578
  * @license React
340
- * react.production.js
579
+ * react-compiler-runtime.development.js
341
580
  *
342
581
  * Copyright (c) Meta Platforms, Inc. and affiliates.
343
582
  *
@@ -345,29 +584,24 @@ react-devtools-core/dist/backend.js:
345
584
  * LICENSE file in the root directory of this source tree.
346
585
  */
347
586
 
348
- react-is/cjs/react-is.production.min.js:
349
- /** @license React v16.13.1
350
- * react-is.production.min.js
587
+ react/cjs/react-jsx-runtime.production.js:
588
+ /**
589
+ * @license React
590
+ * react-jsx-runtime.production.js
351
591
  *
352
- * Copyright (c) Facebook, Inc. and its affiliates.
592
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
353
593
  *
354
594
  * This source code is licensed under the MIT license found in the
355
595
  * LICENSE file in the root directory of this source tree.
356
596
  */
357
597
 
358
- react-is/cjs/react-is.development.js:
359
- /** @license React v16.13.1
360
- * react-is.development.js
598
+ react/cjs/react-jsx-runtime.development.js:
599
+ /**
600
+ * @license React
601
+ * react-jsx-runtime.development.js
361
602
  *
362
- * Copyright (c) Facebook, Inc. and its affiliates.
603
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
363
604
  *
364
605
  * This source code is licensed under the MIT license found in the
365
606
  * LICENSE file in the root directory of this source tree.
366
607
  */
367
-
368
- object-assign/index.js:
369
- /*
370
- object-assign
371
- (c) Sindre Sorhus
372
- @license MIT
373
- */
@@ -0,0 +1,76 @@
1
+ # Codely built-in loop-detection evidence policy (DEFAULT tier).
2
+ # Override by placing files in:
3
+ # ~/.codely-cli/loop-detection-policies/*.toml
4
+ # (system) .../loop-detection-policies/*.toml
5
+ #
6
+ # judge_system_prompt configures only the policy body. The code always wraps it
7
+ # in fixed diagnostic, untrusted-data, non-execution, and response guardrails.
8
+ # Placeholders in this policy body:
9
+ # {{ignored_tools}} — comma-separated ignored tool patterns
10
+ # {{ignored_tools_section}} — full ignored-tools paragraph (or empty)
11
+ # {{analysis_max_chars}} — analysis length budget
12
+ #
13
+ # Threshold fields below are the shipped defaults (keep in sync with
14
+ # DEFAULT_LOOP_CYCLE_THRESHOLD_CONFIG in loopEvidencePolicy.ts). Higher-tier
15
+ # TOML may override individual fields; omitted fields keep these defaults.
16
+ #
17
+ # Content detection layers (not all TOML-configurable):
18
+ # - Short fast-path (code): identical short chunks / same line ×10
19
+ # - Long-stream probe (TOML): tail needle grep → discover period length
20
+
21
+ version = 1
22
+
23
+ # Enable periodic tool-call cycle detection (A→B→A→B, k=2..tool_cycle_max_period).
24
+ # Does NOT disable content/reasoning probe detection.
25
+ enable_cycle_detection = true
26
+
27
+ # Max tool-cycle period length k (detect cycles of length 2..k). Range: 2–10.
28
+ tool_cycle_max_period = 5
29
+
30
+ # Optional fixed repeat count for tool cycles. When omitted (default), required
31
+ # repeats are derived from each tool's effective threshold (e.g. 5 for normal
32
+ # tools, higher for read_file / read-only). Uncomment to force a fixed count:
33
+ # tool_cycle_repeat_count = 5
34
+
35
+ # Long-stream content/reasoning: how many full periods after probe finds a cycle.
36
+ # Range: 2–20. Short chanting still uses the code fast-path (×10).
37
+ content_probe_repeat_threshold = 3
38
+
39
+ # Minimum discovered period length (chars). Must be > short fast-path max (30)
40
+ # so probe does not false-trigger on short repeats. Range: 31–2000. Default: 48.
41
+ # Feasibility: min_period × content_probe_repeat_threshold ≤ 8192 (probe buffer).
42
+ content_probe_min_period_chars = 48
43
+
44
+ # Models matching these patterns disable ALL loop detection for that model
45
+ # instance (stream tool/content/reasoning, LLM judge, strike/recovery/halt).
46
+ # Exact match or a single trailing *; case-insensitive. Highest-tier TOML
47
+ # replaces the whole list (`[]` clears). Main and subagent each evaluate their
48
+ # own active model independently.
49
+ # Example: ["codely-core*", "gpt-5*", "claude-*"]
50
+ loop_detection_exempt_model = ["codely-core*"]
51
+
52
+ judge_system_prompt = """
53
+ An unproductive state is characterized by one or more of the following patterns over the last 5 or more assistant turns:
54
+
55
+ Repetitive Actions: The assistant repeats the same tool calls or conversational responses a decent number of times. This includes simple loops (e.g., tool_A, tool_A, tool_A) and alternating patterns (e.g., tool_A, tool_B, tool_A, tool_B, ...).
56
+
57
+ Cognitive Loop: The assistant seems unable to determine the next logical step. It might express confusion, repeatedly ask the same questions, or generate responses that don't logically follow from the previous turns, indicating it's stuck and not advancing the task.
58
+
59
+ Crucially, differentiate between a true unproductive state and legitimate, incremental progress.
60
+ For example, a series of 'tool_A' or 'tool_B' tool calls that make small, distinct changes to the same file (like adding docstrings to functions one by one) is considered forward progress and is NOT a loop. A loop would be repeatedly replacing the same text with the same content, or cycling between a small set of files with no net change.
61
+ Batch edits across files, different regions of the same file, re-testing after edits, and searches with different parameters are NOT loops.
62
+
63
+ {{ignored_tools_section}}
64
+ """
65
+
66
+ [[loop_detection_rule]]
67
+ name = "ignore builtin Unity TCP tools"
68
+ toolName = "unity_*"
69
+ action = "ignore_as_evidence"
70
+ priority = 500
71
+
72
+ [[loop_detection_rule]]
73
+ name = "ignore Unity bridge entry points"
74
+ toolName = ["execute_custom_tool", "execute_csharp_script"]
75
+ action = "ignore_as_evidence"
76
+ priority = 500