@unity-china/codely-cli 1.0.0-alpha.1
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.
- package/LICENSE +203 -0
- package/README.md +332 -0
- package/README.zh-CN.md +336 -0
- package/bundle/example-prompts/README.md +56 -0
- package/bundle/example-prompts/analyze.toml +47 -0
- package/bundle/example-prompts/explain-code.toml +200 -0
- package/bundle/example-prompts/git-commit.toml +48 -0
- package/bundle/gemini.js +7161 -0
- package/bundle/gemini.js.LEGAL.txt +374 -0
- package/bundle/policies/plan.toml +131 -0
- package/bundle/policies/read-only.toml +75 -0
- package/bundle/policies/write.toml +44 -0
- package/bundle/policies/yolo.toml +9 -0
- package/bundle/sandbox-macos-permissive-closed.sb +32 -0
- package/bundle/sandbox-macos-permissive-open.sb +25 -0
- package/bundle/sandbox-macos-permissive-proxied.sb +37 -0
- package/bundle/sandbox-macos-restrictive-closed.sb +93 -0
- package/bundle/sandbox-macos-restrictive-open.sb +96 -0
- package/bundle/sandbox-macos-restrictive-proxied.sb +98 -0
- package/bundle/tiktoken_bg.wasm +0 -0
- package/bundle/web-ui/dist/public/app.css +2188 -0
- package/bundle/web-ui/dist/public/app.js +122 -0
- package/bundle/web-ui/dist/public/index.html +17 -0
- package/package.json +119 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2025 Qwen
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* @license
|
|
13
|
+
* Copyright 2025 Codely
|
|
14
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
|
+
*
|
|
16
|
+
* Modified OAuth2 implementation using direct token callback:
|
|
17
|
+
* - Instead of using redirect_uri, the callback URL is passed in the state parameter
|
|
18
|
+
* - The server returns tokens directly in the callback as base64-encoded code parameter
|
|
19
|
+
* - No token exchange step is needed, tokens are decoded directly from the callback
|
|
20
|
+
* - Implements credential caching and automatic token refresh similar to qwenOAuth2.ts
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* @license
|
|
24
|
+
* Copyright 2025 Codely
|
|
25
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2026 Google LLC
|
|
30
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* @license
|
|
34
|
+
* Copyright 2026
|
|
35
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright 2026 Codely
|
|
40
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
Bundled license information:
|
|
44
|
+
|
|
45
|
+
safe-buffer/index.js:
|
|
46
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
47
|
+
|
|
48
|
+
@google/genai/dist/node/index.mjs:
|
|
49
|
+
@google/genai/dist/node/index.mjs:
|
|
50
|
+
/**
|
|
51
|
+
* @license
|
|
52
|
+
* Copyright 2025 Google LLC
|
|
53
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
@grpc/proto-loader/build/src/util.js:
|
|
57
|
+
@grpc/proto-loader/build/src/index.js:
|
|
58
|
+
/**
|
|
59
|
+
* @license
|
|
60
|
+
* Copyright 2018 gRPC authors.
|
|
61
|
+
*
|
|
62
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
63
|
+
* you may not use this file except in compliance with the License.
|
|
64
|
+
* You may obtain a copy of the License at
|
|
65
|
+
*
|
|
66
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
67
|
+
*
|
|
68
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
69
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
70
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
71
|
+
* See the License for the specific language governing permissions and
|
|
72
|
+
* limitations under the License.
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
long/umd/index.js:
|
|
77
|
+
/**
|
|
78
|
+
* @license
|
|
79
|
+
* Copyright 2009 The Closure Library Authors
|
|
80
|
+
* Copyright 2020 Daniel Wirtz / The long.js Authors.
|
|
81
|
+
*
|
|
82
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
83
|
+
* you may not use this file except in compliance with the License.
|
|
84
|
+
* You may obtain a copy of the License at
|
|
85
|
+
*
|
|
86
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
87
|
+
*
|
|
88
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
89
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
90
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
91
|
+
* See the License for the specific language governing permissions and
|
|
92
|
+
* limitations under the License.
|
|
93
|
+
*
|
|
94
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
uri-js/dist/es5/uri.all.js:
|
|
98
|
+
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
99
|
+
|
|
100
|
+
mime-db/index.js:
|
|
101
|
+
/*!
|
|
102
|
+
* mime-db
|
|
103
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
104
|
+
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
105
|
+
* MIT Licensed
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
mime-types/index.js:
|
|
109
|
+
/*!
|
|
110
|
+
* mime-types
|
|
111
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
112
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
113
|
+
* MIT Licensed
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
is-extglob/index.js:
|
|
117
|
+
/*!
|
|
118
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
119
|
+
*
|
|
120
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
121
|
+
* Licensed under the MIT License.
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
is-glob/index.js:
|
|
125
|
+
/*!
|
|
126
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
127
|
+
*
|
|
128
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
129
|
+
* Released under the MIT License.
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
is-number/index.js:
|
|
133
|
+
/*!
|
|
134
|
+
* is-number <https://github.com/jonschlinkert/is-number>
|
|
135
|
+
*
|
|
136
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
137
|
+
* Released under the MIT License.
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
to-regex-range/index.js:
|
|
141
|
+
/*!
|
|
142
|
+
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
143
|
+
*
|
|
144
|
+
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
145
|
+
* Released under the MIT License.
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
fill-range/index.js:
|
|
149
|
+
/*!
|
|
150
|
+
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
151
|
+
*
|
|
152
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
153
|
+
* Licensed under the MIT License.
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
queue-microtask/index.js:
|
|
157
|
+
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
158
|
+
|
|
159
|
+
run-parallel/index.js:
|
|
160
|
+
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
161
|
+
|
|
162
|
+
undici/lib/web/fetch/body.js:
|
|
163
|
+
formdata-polyfill/esm.min.js:
|
|
164
|
+
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
165
|
+
|
|
166
|
+
undici/lib/web/websocket/frame.js:
|
|
167
|
+
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
|
|
168
|
+
|
|
169
|
+
fzf/dist/fzf.es.js:
|
|
170
|
+
/** @license
|
|
171
|
+
* fzf v0.5.2
|
|
172
|
+
* Copyright (c) 2021 Ajit
|
|
173
|
+
* Licensed under BSD 3-Clause
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
yargs-parser/build/lib/string-utils.js:
|
|
177
|
+
yargs-parser/build/lib/tokenize-arg-string.js:
|
|
178
|
+
yargs-parser/build/lib/yargs-parser-types.js:
|
|
179
|
+
yargs-parser/build/lib/yargs-parser.js:
|
|
180
|
+
/**
|
|
181
|
+
* @license
|
|
182
|
+
* Copyright (c) 2016, Contributors
|
|
183
|
+
* SPDX-License-Identifier: ISC
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
yargs-parser/build/lib/index.js:
|
|
187
|
+
/**
|
|
188
|
+
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
|
189
|
+
* CJS and ESM environments.
|
|
190
|
+
*
|
|
191
|
+
* @license
|
|
192
|
+
* Copyright (c) 2016, Contributors
|
|
193
|
+
* SPDX-License-Identifier: ISC
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
mcp-proxy/dist/stdio-CfAxSAGj.js:
|
|
197
|
+
/*!
|
|
198
|
+
* depd
|
|
199
|
+
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
|
200
|
+
* MIT Licensed
|
|
201
|
+
*/
|
|
202
|
+
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
203
|
+
|
|
204
|
+
web-streams-polyfill/dist/ponyfill.es2018.js:
|
|
205
|
+
/**
|
|
206
|
+
* @license
|
|
207
|
+
* web-streams-polyfill v3.3.3
|
|
208
|
+
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
|
|
209
|
+
* This code is released under the MIT license.
|
|
210
|
+
* SPDX-License-Identifier: MIT
|
|
211
|
+
*/
|
|
212
|
+
|
|
213
|
+
fetch-blob/index.js:
|
|
214
|
+
/*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
215
|
+
|
|
216
|
+
node-domexception/index.js:
|
|
217
|
+
/*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
218
|
+
|
|
219
|
+
react/cjs/react.production.js:
|
|
220
|
+
/**
|
|
221
|
+
* @license React
|
|
222
|
+
* react.production.js
|
|
223
|
+
*
|
|
224
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the MIT license found in the
|
|
227
|
+
* LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/
|
|
229
|
+
|
|
230
|
+
react/cjs/react.development.js:
|
|
231
|
+
/**
|
|
232
|
+
* @license React
|
|
233
|
+
* react.development.js
|
|
234
|
+
*
|
|
235
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the MIT license found in the
|
|
238
|
+
* LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/
|
|
240
|
+
|
|
241
|
+
react-reconciler/cjs/react-reconciler-constants.production.js:
|
|
242
|
+
/**
|
|
243
|
+
* @license React
|
|
244
|
+
* react-reconciler-constants.production.js
|
|
245
|
+
*
|
|
246
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the MIT license found in the
|
|
249
|
+
* LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
react-reconciler/cjs/react-reconciler-constants.development.js:
|
|
253
|
+
/**
|
|
254
|
+
* @license React
|
|
255
|
+
* react-reconciler-constants.development.js
|
|
256
|
+
*
|
|
257
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the MIT license found in the
|
|
260
|
+
* LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
scheduler/cjs/scheduler.production.js:
|
|
264
|
+
/**
|
|
265
|
+
* @license React
|
|
266
|
+
* scheduler.production.js
|
|
267
|
+
*
|
|
268
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the MIT license found in the
|
|
271
|
+
* LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/
|
|
273
|
+
|
|
274
|
+
scheduler/cjs/scheduler.development.js:
|
|
275
|
+
/**
|
|
276
|
+
* @license React
|
|
277
|
+
* scheduler.development.js
|
|
278
|
+
*
|
|
279
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the MIT license found in the
|
|
282
|
+
* LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/
|
|
284
|
+
|
|
285
|
+
react-reconciler/cjs/react-reconciler.production.js:
|
|
286
|
+
/**
|
|
287
|
+
* @license React
|
|
288
|
+
* react-reconciler.production.js
|
|
289
|
+
*
|
|
290
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the MIT license found in the
|
|
293
|
+
* LICENSE file in the root directory of this source tree.
|
|
294
|
+
*/
|
|
295
|
+
|
|
296
|
+
react-reconciler/cjs/react-reconciler.development.js:
|
|
297
|
+
/**
|
|
298
|
+
* @license React
|
|
299
|
+
* react-reconciler.development.js
|
|
300
|
+
*
|
|
301
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the MIT license found in the
|
|
304
|
+
* LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/
|
|
306
|
+
|
|
307
|
+
react-devtools-core/dist/backend.js:
|
|
308
|
+
/**
|
|
309
|
+
* @license React
|
|
310
|
+
* react-debug-tools.production.js
|
|
311
|
+
*
|
|
312
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the MIT license found in the
|
|
315
|
+
* LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/
|
|
317
|
+
/**
|
|
318
|
+
* @license React
|
|
319
|
+
* react.production.js
|
|
320
|
+
*
|
|
321
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the MIT license found in the
|
|
324
|
+
* LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
328
|
+
/**
|
|
329
|
+
* @license React
|
|
330
|
+
* react-jsx-runtime.production.js
|
|
331
|
+
*
|
|
332
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
333
|
+
*
|
|
334
|
+
* This source code is licensed under the MIT license found in the
|
|
335
|
+
* LICENSE file in the root directory of this source tree.
|
|
336
|
+
*/
|
|
337
|
+
|
|
338
|
+
react/cjs/react-jsx-runtime.development.js:
|
|
339
|
+
/**
|
|
340
|
+
* @license React
|
|
341
|
+
* react-jsx-runtime.development.js
|
|
342
|
+
*
|
|
343
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the MIT license found in the
|
|
346
|
+
* LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/
|
|
348
|
+
|
|
349
|
+
react-is/cjs/react-is.production.min.js:
|
|
350
|
+
/** @license React v16.13.1
|
|
351
|
+
* react-is.production.min.js
|
|
352
|
+
*
|
|
353
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the MIT license found in the
|
|
356
|
+
* LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/
|
|
358
|
+
|
|
359
|
+
react-is/cjs/react-is.development.js:
|
|
360
|
+
/** @license React v16.13.1
|
|
361
|
+
* react-is.development.js
|
|
362
|
+
*
|
|
363
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
364
|
+
*
|
|
365
|
+
* This source code is licensed under the MIT license found in the
|
|
366
|
+
* LICENSE file in the root directory of this source tree.
|
|
367
|
+
*/
|
|
368
|
+
|
|
369
|
+
object-assign/index.js:
|
|
370
|
+
/*
|
|
371
|
+
object-assign
|
|
372
|
+
(c) Sindre Sorhus
|
|
373
|
+
@license MIT
|
|
374
|
+
*/
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Plan Mode policy: deny-all + read-only whitelist + plans dir write exception.
|
|
2
|
+
# Active only when ApprovalMode = "plan".
|
|
3
|
+
#
|
|
4
|
+
# Priority bands (tiers):
|
|
5
|
+
# - 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)
|
|
8
|
+
|
|
9
|
+
# --- Catch-all deny for plan mode ---
|
|
10
|
+
[[rule]]
|
|
11
|
+
decision = "deny"
|
|
12
|
+
priority = 60
|
|
13
|
+
modes = ["plan"]
|
|
14
|
+
deny_message = "You are in Plan Mode. Only read/search tools and writing plans to the plans directory are allowed. Use exit_plan_mode to request approval for your plan."
|
|
15
|
+
|
|
16
|
+
# --- Read-only tools allowed in plan mode ---
|
|
17
|
+
[[rule]]
|
|
18
|
+
toolName = "glob"
|
|
19
|
+
decision = "allow"
|
|
20
|
+
priority = 70
|
|
21
|
+
modes = ["plan"]
|
|
22
|
+
|
|
23
|
+
[[rule]]
|
|
24
|
+
toolName = "search_file_content"
|
|
25
|
+
decision = "allow"
|
|
26
|
+
priority = 70
|
|
27
|
+
modes = ["plan"]
|
|
28
|
+
|
|
29
|
+
[[rule]]
|
|
30
|
+
toolName = "list_directory"
|
|
31
|
+
decision = "allow"
|
|
32
|
+
priority = 70
|
|
33
|
+
modes = ["plan"]
|
|
34
|
+
|
|
35
|
+
[[rule]]
|
|
36
|
+
toolName = "read_file"
|
|
37
|
+
decision = "allow"
|
|
38
|
+
priority = 70
|
|
39
|
+
modes = ["plan"]
|
|
40
|
+
|
|
41
|
+
[[rule]]
|
|
42
|
+
toolName = "read_many_files"
|
|
43
|
+
decision = "allow"
|
|
44
|
+
priority = 70
|
|
45
|
+
modes = ["plan"]
|
|
46
|
+
|
|
47
|
+
[[rule]]
|
|
48
|
+
toolName = "web_search"
|
|
49
|
+
decision = "allow"
|
|
50
|
+
priority = 70
|
|
51
|
+
modes = ["plan"]
|
|
52
|
+
|
|
53
|
+
[[rule]]
|
|
54
|
+
toolName = "sequential_thinking"
|
|
55
|
+
decision = "allow"
|
|
56
|
+
priority = 70
|
|
57
|
+
modes = ["plan"]
|
|
58
|
+
|
|
59
|
+
[[rule]]
|
|
60
|
+
toolName = "job_create"
|
|
61
|
+
decision = "allow"
|
|
62
|
+
priority = 70
|
|
63
|
+
modes = ["plan"]
|
|
64
|
+
|
|
65
|
+
[[rule]]
|
|
66
|
+
toolName = "job_get"
|
|
67
|
+
decision = "allow"
|
|
68
|
+
priority = 70
|
|
69
|
+
modes = ["plan"]
|
|
70
|
+
|
|
71
|
+
[[rule]]
|
|
72
|
+
toolName = "job_update"
|
|
73
|
+
decision = "allow"
|
|
74
|
+
priority = 70
|
|
75
|
+
modes = ["plan"]
|
|
76
|
+
|
|
77
|
+
[[rule]]
|
|
78
|
+
toolName = "job_list"
|
|
79
|
+
decision = "allow"
|
|
80
|
+
priority = 70
|
|
81
|
+
modes = ["plan"]
|
|
82
|
+
|
|
83
|
+
# --- Allow writing plan files (.md) to the plans directory only ---
|
|
84
|
+
# The argsPattern matches the JSON-serialized file_path within:
|
|
85
|
+
# ~/.codely-cli/tmp/<64-hex-project-hash>/plans/<name>.md
|
|
86
|
+
# Supports both / and escaped \\ separators.
|
|
87
|
+
[[rule]]
|
|
88
|
+
toolName = "write_file"
|
|
89
|
+
decision = "allow"
|
|
90
|
+
priority = 70
|
|
91
|
+
modes = ["plan"]
|
|
92
|
+
argsPattern = "\"file_path\"\\s*:\\s*\"[^\"]*[/\\\\]+\\.codely-cli[/\\\\]+tmp[/\\\\]+[a-f0-9]{64}[/\\\\]+plans[/\\\\]+[a-zA-Z0-9_\\-][a-zA-Z0-9_\\-.]*\\.md\""
|
|
93
|
+
|
|
94
|
+
[[rule]]
|
|
95
|
+
toolName = "replace"
|
|
96
|
+
decision = "allow"
|
|
97
|
+
priority = 70
|
|
98
|
+
modes = ["plan"]
|
|
99
|
+
argsPattern = "\"file_path\"\\s*:\\s*\"[^\"]*[/\\\\]+\\.codely-cli[/\\\\]+tmp[/\\\\]+[a-f0-9]{64}[/\\\\]+plans[/\\\\]+[a-zA-Z0-9_\\-][a-zA-Z0-9_\\-.]*\\.md\""
|
|
100
|
+
|
|
101
|
+
# --- exit_plan_mode requires user approval ---
|
|
102
|
+
[[rule]]
|
|
103
|
+
toolName = "exit_plan_mode"
|
|
104
|
+
decision = "ask_user"
|
|
105
|
+
priority = 70
|
|
106
|
+
modes = ["plan"]
|
|
107
|
+
|
|
108
|
+
[[rule]]
|
|
109
|
+
toolName = "ask_user"
|
|
110
|
+
decision = "ask_user"
|
|
111
|
+
priority = 70
|
|
112
|
+
modes = ["plan"]
|
|
113
|
+
|
|
114
|
+
# --- Task dispatch allowed in plan mode (for exploration / context gathering) ---
|
|
115
|
+
[[rule]]
|
|
116
|
+
toolName = "task"
|
|
117
|
+
decision = "allow"
|
|
118
|
+
priority = 70
|
|
119
|
+
modes = ["plan"]
|
|
120
|
+
|
|
121
|
+
[[rule]]
|
|
122
|
+
toolName = "task_output"
|
|
123
|
+
decision = "allow"
|
|
124
|
+
priority = 70
|
|
125
|
+
modes = ["plan"]
|
|
126
|
+
|
|
127
|
+
[[rule]]
|
|
128
|
+
toolName = "task_stop"
|
|
129
|
+
decision = "allow"
|
|
130
|
+
priority = 70
|
|
131
|
+
modes = ["plan"]
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Read-only tools that are always allowed without confirmation.
|
|
2
|
+
# These tools only read data and cannot modify the filesystem or execute commands.
|
|
3
|
+
#
|
|
4
|
+
# Priority bands (tiers):
|
|
5
|
+
# - Default policies (TOML): 1 + priority/1000 (e.g., priority 50 → 1.050)
|
|
6
|
+
# - User policies (TOML): 2 + priority/1000
|
|
7
|
+
# - Admin policies (TOML): 3 + priority/1000
|
|
8
|
+
|
|
9
|
+
[[rule]]
|
|
10
|
+
toolName = "glob"
|
|
11
|
+
decision = "allow"
|
|
12
|
+
priority = 50
|
|
13
|
+
|
|
14
|
+
[[rule]]
|
|
15
|
+
toolName = "search_file_content"
|
|
16
|
+
decision = "allow"
|
|
17
|
+
priority = 50
|
|
18
|
+
|
|
19
|
+
[[rule]]
|
|
20
|
+
toolName = "list_directory"
|
|
21
|
+
decision = "allow"
|
|
22
|
+
priority = 50
|
|
23
|
+
|
|
24
|
+
[[rule]]
|
|
25
|
+
toolName = "read_file"
|
|
26
|
+
decision = "allow"
|
|
27
|
+
priority = 50
|
|
28
|
+
|
|
29
|
+
[[rule]]
|
|
30
|
+
toolName = "read_many_files"
|
|
31
|
+
decision = "allow"
|
|
32
|
+
priority = 50
|
|
33
|
+
|
|
34
|
+
[[rule]]
|
|
35
|
+
toolName = "web_search"
|
|
36
|
+
decision = "allow"
|
|
37
|
+
priority = 50
|
|
38
|
+
|
|
39
|
+
[[rule]]
|
|
40
|
+
toolName = "sequential_thinking"
|
|
41
|
+
decision = "allow"
|
|
42
|
+
priority = 50
|
|
43
|
+
|
|
44
|
+
[[rule]]
|
|
45
|
+
toolName = "analyze_multimedia"
|
|
46
|
+
decision = "allow"
|
|
47
|
+
priority = 50
|
|
48
|
+
|
|
49
|
+
# Job tools are planning/tracking tools that don't modify the filesystem.
|
|
50
|
+
[[rule]]
|
|
51
|
+
toolName = "job_create"
|
|
52
|
+
decision = "allow"
|
|
53
|
+
priority = 50
|
|
54
|
+
|
|
55
|
+
[[rule]]
|
|
56
|
+
toolName = "job_get"
|
|
57
|
+
decision = "allow"
|
|
58
|
+
priority = 50
|
|
59
|
+
|
|
60
|
+
[[rule]]
|
|
61
|
+
toolName = "job_update"
|
|
62
|
+
decision = "allow"
|
|
63
|
+
priority = 50
|
|
64
|
+
|
|
65
|
+
[[rule]]
|
|
66
|
+
toolName = "job_list"
|
|
67
|
+
decision = "allow"
|
|
68
|
+
priority = 50
|
|
69
|
+
|
|
70
|
+
# web_fetch is a read operation (fetching content from the web).
|
|
71
|
+
# It was auto-approved in autoEdit mode; treating it as read-equivalent.
|
|
72
|
+
[[rule]]
|
|
73
|
+
toolName = "web_fetch"
|
|
74
|
+
decision = "allow"
|
|
75
|
+
priority = 50
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Write/mutating tools that require user confirmation by default.
|
|
2
|
+
# In autoEdit mode, replace and write_file are auto-approved.
|
|
3
|
+
#
|
|
4
|
+
# Priority bands (tiers):
|
|
5
|
+
# - Default policies (TOML): 1 + priority/1000
|
|
6
|
+
# 10: Write tools default to ASK_USER (becomes 1.010)
|
|
7
|
+
# 15: Auto-edit tool override (becomes 1.015)
|
|
8
|
+
|
|
9
|
+
[[rule]]
|
|
10
|
+
toolName = "replace"
|
|
11
|
+
decision = "ask_user"
|
|
12
|
+
priority = 10
|
|
13
|
+
|
|
14
|
+
[[rule]]
|
|
15
|
+
toolName = "replace"
|
|
16
|
+
decision = "allow"
|
|
17
|
+
priority = 15
|
|
18
|
+
modes = ["autoEdit"]
|
|
19
|
+
|
|
20
|
+
[[rule]]
|
|
21
|
+
toolName = "write_file"
|
|
22
|
+
decision = "ask_user"
|
|
23
|
+
priority = 10
|
|
24
|
+
|
|
25
|
+
[[rule]]
|
|
26
|
+
toolName = "write_file"
|
|
27
|
+
decision = "allow"
|
|
28
|
+
priority = 15
|
|
29
|
+
modes = ["autoEdit"]
|
|
30
|
+
|
|
31
|
+
[[rule]]
|
|
32
|
+
toolName = "run_shell_command"
|
|
33
|
+
decision = "ask_user"
|
|
34
|
+
priority = 10
|
|
35
|
+
|
|
36
|
+
[[rule]]
|
|
37
|
+
toolName = "save_memory"
|
|
38
|
+
decision = "ask_user"
|
|
39
|
+
priority = 10
|
|
40
|
+
|
|
41
|
+
[[rule]]
|
|
42
|
+
toolName = "activate_skill"
|
|
43
|
+
decision = "ask_user"
|
|
44
|
+
priority = 10
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# YOLO mode: allow all tools without confirmation.
|
|
2
|
+
# This rule has the highest default-tier priority (999 → 1.999).
|
|
3
|
+
# It only applies when the approval mode is "yolo".
|
|
4
|
+
|
|
5
|
+
[[rule]]
|
|
6
|
+
decision = "allow"
|
|
7
|
+
priority = 999
|
|
8
|
+
modes = ["yolo"]
|
|
9
|
+
allow_redirection = true
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
(version 1)
|
|
2
|
+
|
|
3
|
+
;; allow everything by default
|
|
4
|
+
(allow default)
|
|
5
|
+
|
|
6
|
+
;; deny all writes EXCEPT under specific paths
|
|
7
|
+
(deny file-write*)
|
|
8
|
+
(allow file-write*
|
|
9
|
+
(subpath (param "TARGET_DIR"))
|
|
10
|
+
(subpath (param "TMP_DIR"))
|
|
11
|
+
(subpath (param "CACHE_DIR"))
|
|
12
|
+
(subpath (string-append (param "HOME_DIR") "/.codely-cli"))
|
|
13
|
+
(subpath (string-append (param "HOME_DIR") "/.npm"))
|
|
14
|
+
(subpath (string-append (param "HOME_DIR") "/.cache"))
|
|
15
|
+
(subpath (string-append (param "HOME_DIR") "/.gitconfig"))
|
|
16
|
+
;; Allow writes to included directories from --include-directories
|
|
17
|
+
(subpath (param "INCLUDE_DIR_0"))
|
|
18
|
+
(subpath (param "INCLUDE_DIR_1"))
|
|
19
|
+
(subpath (param "INCLUDE_DIR_2"))
|
|
20
|
+
(subpath (param "INCLUDE_DIR_3"))
|
|
21
|
+
(subpath (param "INCLUDE_DIR_4"))
|
|
22
|
+
(literal "/dev/stdout")
|
|
23
|
+
(literal "/dev/stderr")
|
|
24
|
+
(literal "/dev/null")
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
;; deny all inbound network traffic EXCEPT on debugger port
|
|
28
|
+
(deny network-inbound)
|
|
29
|
+
(allow network-inbound (local ip "localhost:9229"))
|
|
30
|
+
|
|
31
|
+
;; deny all outbound network traffic
|
|
32
|
+
(deny network-outbound)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
(version 1)
|
|
2
|
+
|
|
3
|
+
;; allow everything by default
|
|
4
|
+
(allow default)
|
|
5
|
+
|
|
6
|
+
;; deny all writes EXCEPT under specific paths
|
|
7
|
+
(deny file-write*)
|
|
8
|
+
(allow file-write*
|
|
9
|
+
(subpath (param "TARGET_DIR"))
|
|
10
|
+
(subpath (param "TMP_DIR"))
|
|
11
|
+
(subpath (param "CACHE_DIR"))
|
|
12
|
+
(subpath (string-append (param "HOME_DIR") "/.codely-cli"))
|
|
13
|
+
(subpath (string-append (param "HOME_DIR") "/.npm"))
|
|
14
|
+
(subpath (string-append (param "HOME_DIR") "/.cache"))
|
|
15
|
+
(subpath (string-append (param "HOME_DIR") "/.gitconfig"))
|
|
16
|
+
;; Allow writes to included directories from --include-directories
|
|
17
|
+
(subpath (param "INCLUDE_DIR_0"))
|
|
18
|
+
(subpath (param "INCLUDE_DIR_1"))
|
|
19
|
+
(subpath (param "INCLUDE_DIR_2"))
|
|
20
|
+
(subpath (param "INCLUDE_DIR_3"))
|
|
21
|
+
(subpath (param "INCLUDE_DIR_4"))
|
|
22
|
+
(literal "/dev/stdout")
|
|
23
|
+
(literal "/dev/stderr")
|
|
24
|
+
(literal "/dev/null")
|
|
25
|
+
)
|