@unity-china/codely-cli 1.0.0-rc.55 → 1.0.0-rc.58

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.
@@ -33,6 +33,19 @@
33
33
  * user" or "active user". It only provides get/set by user_id. The caller
34
34
  * (CodelyOAuth2Client) owns user_id and passes it explicitly.
35
35
  */
36
+ /**
37
+ * @license
38
+ * Copyright 2025 Codely
39
+ * SPDX-License-Identifier: Apache-2.0
40
+ *
41
+ * Account & usage API service.
42
+ *
43
+ * Thin stateless data layer over two server endpoints:
44
+ * - GET /auth/me — identity of the authenticated user
45
+ * - GET /api/user/usage/summary — credit balance summary for the user
46
+ *
47
+ * The caller (CodelyOAuth2Client) owns the access token and passes it in.
48
+ */
36
49
  /**
37
50
  * @license
38
51
  * Copyright 2025 Codely
@@ -77,8 +77,9 @@ content_probe_min_period_chars = 48
77
77
  # Exact match or a single trailing *; case-insensitive. Highest-tier TOML
78
78
  # replaces the whole list (`[]` clears). Main and subagent each evaluate their
79
79
  # own active model independently.
80
- # Example: ["codely-core*", "gpt-5*", "claude-*"]
81
- loop_detection_exempt_model = ["codely-core*"]
80
+ # Empty by default: no model is exempt out of the box. Opt in per model, e.g.
81
+ # loop_detection_exempt_model = ["codely-core*", "gpt-5*", "claude-*"]
82
+ loop_detection_exempt_model = []
82
83
 
83
84
  judge_system_prompt = """
84
85
  An unproductive state is characterized by one or more of the following patterns over the last 5 or more assistant turns:
@@ -86,18 +86,10 @@ decision = "allow"
86
86
  priority = 70
87
87
  modes = ["plan"]
88
88
 
89
- # --- Allow writing plan files (.md) to the plans directory only ---
90
- # The argsPattern matches the JSON-serialized file_path within:
91
- # ~/.codely-cli/tmp/<64-hex-project-hash>/plans/<name>.md
92
- # Supports both / and escaped \\ separators.
93
- [[rule]]
94
- toolName = "write_file"
95
- decision = "allow"
96
- priority = 70
97
- modes = ["plan"]
98
- argsPattern = "\"file_path\"\\s*:\\s*\"[^\"]*[/\\\\]+\\.codely-cli[/\\\\]+tmp[/\\\\]+[a-f0-9]{64}[/\\\\]+plans[/\\\\]+[a-zA-Z0-9_\\-][a-zA-Z0-9_\\-.]*\\.md\""
99
-
100
- # write_file outside the plans directory requires approval (interactive)
89
+ # --- Plan file writes ---
90
+ # The path-specific ALLOW rules are added at runtime by policy-config.ts because
91
+ # the user-level Codely home can be relocated via CODELY_CLI_HOME.
92
+ # write_file outside the resolved plans root requires approval (interactive)
101
93
  # or is denied (non-interactive via ask-downgrade)
102
94
  [[rule]]
103
95
  toolName = "write_file"
@@ -105,14 +97,7 @@ decision = "ask_user"
105
97
  priority = 65
106
98
  modes = ["plan"]
107
99
 
108
- [[rule]]
109
- toolName = "replace"
110
- decision = "allow"
111
- priority = 70
112
- modes = ["plan"]
113
- argsPattern = "\"file_path\"\\s*:\\s*\"[^\"]*[/\\\\]+\\.codely-cli[/\\\\]+tmp[/\\\\]+[a-f0-9]{64}[/\\\\]+plans[/\\\\]+[a-zA-Z0-9_\\-][a-zA-Z0-9_\\-.]*\\.md\""
114
-
115
- # replace outside the plans directory requires approval (interactive)
100
+ # replace outside the resolved plans root requires approval (interactive)
116
101
  # or is denied (non-interactive via ask-downgrade)
117
102
  [[rule]]
118
103
  toolName = "replace"
@@ -9,7 +9,7 @@
9
9
  (subpath (param "TARGET_DIR"))
10
10
  (subpath (param "TMP_DIR"))
11
11
  (subpath (param "CACHE_DIR"))
12
- (subpath (string-append (param "HOME_DIR") "/.codely-cli"))
12
+ (subpath (param "CODELY_HOME_DIR"))
13
13
  (subpath (string-append (param "HOME_DIR") "/.npm"))
14
14
  (subpath (string-append (param "HOME_DIR") "/.cache"))
15
15
  (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
@@ -9,7 +9,7 @@
9
9
  (subpath (param "TARGET_DIR"))
10
10
  (subpath (param "TMP_DIR"))
11
11
  (subpath (param "CACHE_DIR"))
12
- (subpath (string-append (param "HOME_DIR") "/.codely-cli"))
12
+ (subpath (param "CODELY_HOME_DIR"))
13
13
  (subpath (string-append (param "HOME_DIR") "/.npm"))
14
14
  (subpath (string-append (param "HOME_DIR") "/.cache"))
15
15
  (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
@@ -9,7 +9,7 @@
9
9
  (subpath (param "TARGET_DIR"))
10
10
  (subpath (param "TMP_DIR"))
11
11
  (subpath (param "CACHE_DIR"))
12
- (subpath (string-append (param "HOME_DIR") "/.codely-cli"))
12
+ (subpath (param "CODELY_HOME_DIR"))
13
13
  (subpath (string-append (param "HOME_DIR") "/.npm"))
14
14
  (subpath (string-append (param "HOME_DIR") "/.cache"))
15
15
  (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
@@ -29,7 +29,7 @@
29
29
  (allow network-inbound (local ip "localhost:9229"))
30
30
 
31
31
  ;; deny all outbound network traffic EXCEPT through proxy on localhost:8877
32
- ;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
32
+ ;; set `CODELY_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
33
33
  ;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
34
34
  (deny network-outbound)
35
35
  (allow network-outbound (remote tcp "localhost:8877"))
@@ -67,7 +67,7 @@
67
67
  (subpath (param "TARGET_DIR"))
68
68
  (subpath (param "TMP_DIR"))
69
69
  (subpath (param "CACHE_DIR"))
70
- (subpath (string-append (param "HOME_DIR") "/.codely-cli"))
70
+ (subpath (param "CODELY_HOME_DIR"))
71
71
  (subpath (string-append (param "HOME_DIR") "/.npm"))
72
72
  (subpath (string-append (param "HOME_DIR") "/.cache"))
73
73
  (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
@@ -67,7 +67,7 @@
67
67
  (subpath (param "TARGET_DIR"))
68
68
  (subpath (param "TMP_DIR"))
69
69
  (subpath (param "CACHE_DIR"))
70
- (subpath (string-append (param "HOME_DIR") "/.codely-cli"))
70
+ (subpath (param "CODELY_HOME_DIR"))
71
71
  (subpath (string-append (param "HOME_DIR") "/.npm"))
72
72
  (subpath (string-append (param "HOME_DIR") "/.cache"))
73
73
  (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
@@ -67,7 +67,7 @@
67
67
  (subpath (param "TARGET_DIR"))
68
68
  (subpath (param "TMP_DIR"))
69
69
  (subpath (param "CACHE_DIR"))
70
- (subpath (string-append (param "HOME_DIR") "/.codely-cli"))
70
+ (subpath (param "CODELY_HOME_DIR"))
71
71
  (subpath (string-append (param "HOME_DIR") "/.npm"))
72
72
  (subpath (string-append (param "HOME_DIR") "/.cache"))
73
73
  (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
@@ -93,6 +93,6 @@
93
93
  (allow network-inbound (local ip "localhost:9229"))
94
94
 
95
95
  ;; allow outbound network traffic through proxy on localhost:8877
96
- ;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
96
+ ;; set `CODELY_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
97
97
  ;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
98
98
  (allow network-outbound (remote tcp "localhost:8877"))