@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
@@ -1,17 +1,29 @@
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."
25
+ allow_redirection = true
26
+ allow_command_substitution = true
15
27
 
16
28
  # --- Read-only tools allowed in plan mode ---
17
29
  [[rule]]
@@ -38,12 +50,6 @@ decision = "allow"
38
50
  priority = 70
39
51
  modes = ["plan"]
40
52
 
41
- [[rule]]
42
- toolName = "read_many_files"
43
- decision = "allow"
44
- priority = 70
45
- modes = ["plan"]
46
-
47
53
  [[rule]]
48
54
  toolName = "analyze_multimedia"
49
55
  decision = "allow"
@@ -56,12 +62,6 @@ decision = "allow"
56
62
  priority = 70
57
63
  modes = ["plan"]
58
64
 
59
- [[rule]]
60
- toolName = "sequential_thinking"
61
- decision = "allow"
62
- priority = 70
63
- modes = ["plan"]
64
-
65
65
  [[rule]]
66
66
  toolName = "job_create"
67
67
  decision = "allow"
@@ -97,6 +97,14 @@ priority = 70
97
97
  modes = ["plan"]
98
98
  argsPattern = "\"file_path\"\\s*:\\s*\"[^\"]*[/\\\\]+\\.codely-cli[/\\\\]+tmp[/\\\\]+[a-f0-9]{64}[/\\\\]+plans[/\\\\]+[a-zA-Z0-9_\\-][a-zA-Z0-9_\\-.]*\\.md\""
99
99
 
100
+ # write_file outside the plans directory requires approval (interactive)
101
+ # or is denied (non-interactive via ask-downgrade)
102
+ [[rule]]
103
+ toolName = "write_file"
104
+ decision = "ask_user"
105
+ priority = 65
106
+ modes = ["plan"]
107
+
100
108
  [[rule]]
101
109
  toolName = "replace"
102
110
  decision = "allow"
@@ -104,6 +112,14 @@ priority = 70
104
112
  modes = ["plan"]
105
113
  argsPattern = "\"file_path\"\\s*:\\s*\"[^\"]*[/\\\\]+\\.codely-cli[/\\\\]+tmp[/\\\\]+[a-f0-9]{64}[/\\\\]+plans[/\\\\]+[a-zA-Z0-9_\\-][a-zA-Z0-9_\\-.]*\\.md\""
106
114
 
115
+ # replace outside the plans directory requires approval (interactive)
116
+ # or is denied (non-interactive via ask-downgrade)
117
+ [[rule]]
118
+ toolName = "replace"
119
+ decision = "ask_user"
120
+ priority = 65
121
+ modes = ["plan"]
122
+
107
123
  # --- exit_plan_mode requires user approval ---
108
124
  [[rule]]
109
125
  toolName = "exit_plan_mode"
@@ -26,21 +26,11 @@ toolName = "read_file"
26
26
  decision = "allow"
27
27
  priority = 50
28
28
 
29
- [[rule]]
30
- toolName = "read_many_files"
31
- decision = "allow"
32
- priority = 50
33
-
34
29
  [[rule]]
35
30
  toolName = "web_search"
36
31
  decision = "allow"
37
32
  priority = 50
38
33
 
39
- [[rule]]
40
- toolName = "sequential_thinking"
41
- decision = "allow"
42
- priority = 50
43
-
44
34
  [[rule]]
45
35
  toolName = "analyze_multimedia"
46
36
  decision = "allow"
@@ -33,11 +33,6 @@ toolName = "run_shell_command"
33
33
  decision = "ask_user"
34
34
  priority = 10
35
35
 
36
- [[rule]]
37
- toolName = "save_memory"
38
- decision = "ask_user"
39
- priority = 10
40
-
41
36
  [[rule]]
42
37
  toolName = "activate_skill"
43
38
  decision = "ask_user"
@@ -796,6 +796,69 @@ textarea {
796
796
  gap: 10px;
797
797
  }
798
798
 
799
+ .ask-user-countdown {
800
+ display: grid;
801
+ grid-template-columns: 1fr auto;
802
+ gap: 4px 12px;
803
+ align-items: center;
804
+ padding: 10px 12px;
805
+ border: 1px solid rgba(224, 175, 104, 0.58);
806
+ border-radius: 12px;
807
+ background: rgba(224, 175, 104, 0.12);
808
+ box-shadow: inset 0 0 0 1px rgba(224, 175, 104, 0.08);
809
+ }
810
+ .ask-user-countdown-label {
811
+ color: var(--warn);
812
+ font-size: 12px;
813
+ font-weight: 700;
814
+ text-transform: uppercase;
815
+ letter-spacing: 0.06em;
816
+ }
817
+ .ask-user-countdown-time {
818
+ grid-row: span 2;
819
+ min-width: 56px;
820
+ padding: 6px 10px;
821
+ border: 1px solid rgba(224, 175, 104, 0.6);
822
+ border-radius: 999px;
823
+ color: #ffd089;
824
+ background: rgba(224, 175, 104, 0.16);
825
+ font-family: var(--mono);
826
+ font-size: 16px;
827
+ font-weight: 800;
828
+ text-align: center;
829
+ }
830
+ .ask-user-countdown-message {
831
+ color: var(--muted);
832
+ font-size: 12px;
833
+ }
834
+ .ask-user-option {
835
+ position: relative;
836
+ gap: 8px;
837
+ }
838
+ .ask-user-option-default {
839
+ border-color: rgba(224, 175, 104, 0.85) !important;
840
+ background: rgba(224, 175, 104, 0.12) !important;
841
+ box-shadow: inset 0 0 0 1px rgba(224, 175, 104, 0.25);
842
+ }
843
+ .ask-user-option-checkbox {
844
+ display: flex;
845
+ align-items: center;
846
+ gap: 8px;
847
+ padding: 8px 10px;
848
+ border: 1px solid var(--border);
849
+ border-radius: var(--radius-sm);
850
+ }
851
+ .ask-user-default-badge {
852
+ padding: 2px 6px;
853
+ border: 1px solid rgba(224, 175, 104, 0.68);
854
+ border-radius: 999px;
855
+ color: var(--warn);
856
+ background: rgba(224, 175, 104, 0.1);
857
+ font-size: 11px;
858
+ font-weight: 700;
859
+ line-height: 1;
860
+ }
861
+
799
862
  /* Subagent card styles */
800
863
  .subagent-card {
801
864
  background: linear-gradient(