@unity-china/codely-cli 1.0.0-rc.6 → 1.0.0-rc.60

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 (40) 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 +3752 -6224
  13. package/bundle/gemini.js.LEGAL.txt +352 -105
  14. package/bundle/gemini.nologgers.js.LEGAL.txt +607 -0
  15. package/bundle/gemini.nosentry.js.LEGAL.txt +607 -0
  16. package/bundle/loop-detection-policies/default.toml +112 -0
  17. package/bundle/node_modules/@silvia-odwyer/photon-node/LICENSE.md +201 -0
  18. package/bundle/node_modules/@silvia-odwyer/photon-node/README.md +158 -0
  19. package/bundle/node_modules/@silvia-odwyer/photon-node/package.json +23 -0
  20. package/bundle/node_modules/@silvia-odwyer/photon-node/photon_rs.d.ts +3226 -0
  21. package/bundle/node_modules/@silvia-odwyer/photon-node/photon_rs.js +4521 -0
  22. package/bundle/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js +4270 -0
  23. package/bundle/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm +0 -0
  24. package/bundle/node_modules/tree-sitter-bash/package.json +60 -0
  25. package/bundle/node_modules/tree-sitter-bash/tree-sitter-bash.wasm +0 -0
  26. package/bundle/node_modules/web-tree-sitter/package.json +98 -0
  27. package/bundle/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
  28. package/bundle/policies/plan.toml +30 -29
  29. package/bundle/policies/read-only.toml +0 -10
  30. package/bundle/policies/write.toml +0 -5
  31. package/bundle/sandbox-macos-permissive-closed.sb +1 -1
  32. package/bundle/sandbox-macos-permissive-open.sb +1 -1
  33. package/bundle/sandbox-macos-permissive-proxied.sb +2 -2
  34. package/bundle/sandbox-macos-restrictive-closed.sb +1 -1
  35. package/bundle/sandbox-macos-restrictive-open.sb +1 -1
  36. package/bundle/sandbox-macos-restrictive-proxied.sb +2 -2
  37. package/bundle/web-ui/dist/public/app.css +63 -0
  38. package/bundle/web-ui/dist/public/app.js +48 -48
  39. package/package.json +12 -11
  40. package/bundle/tiktoken_bg.wasm +0 -0
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "tree-sitter-bash",
3
+ "version": "0.25.0",
4
+ "description": "Bash grammar for tree-sitter",
5
+ "repository": "https://github.com/tree-sitter/tree-sitter-bash",
6
+ "license": "MIT",
7
+ "author": {
8
+ "name": "Max Brunsfeld",
9
+ "email": "maxbrunsfeld@gmail.com"
10
+ },
11
+ "maintainers": [
12
+ {
13
+ "name": "Amaan Qureshi",
14
+ "email": "amaanq12@gmail.com"
15
+ }
16
+ ],
17
+ "main": "bindings/node",
18
+ "types": "bindings/node",
19
+ "keywords": [
20
+ "incremental",
21
+ "parsing",
22
+ "tree-sitter",
23
+ "bash"
24
+ ],
25
+ "files": [
26
+ "grammar.js",
27
+ "tree-sitter.json",
28
+ "binding.gyp",
29
+ "prebuilds/**",
30
+ "bindings/node/*",
31
+ "queries/*",
32
+ "src/**",
33
+ "*.wasm"
34
+ ],
35
+ "dependencies": {
36
+ "node-addon-api": "^8.2.1",
37
+ "node-gyp-build": "^4.8.2"
38
+ },
39
+ "devDependencies": {
40
+ "eslint": "^9.12.0",
41
+ "eslint-config-treesitter": "^1.0.2",
42
+ "tree-sitter-cli": "^0.25.5",
43
+ "prebuildify": "^6.0.1"
44
+ },
45
+ "peerDependencies": {
46
+ "tree-sitter": "^0.25.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "tree-sitter": {
50
+ "optional": true
51
+ }
52
+ },
53
+ "scripts": {
54
+ "install": "node-gyp-build",
55
+ "lint": "eslint grammar.js",
56
+ "prestart": "tree-sitter build --wasm",
57
+ "start": "tree-sitter playground",
58
+ "test": "node --test bindings/node/*_test.js"
59
+ }
60
+ }
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "web-tree-sitter",
3
+ "version": "0.25.10",
4
+ "description": "Tree-sitter bindings for the web",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/tree-sitter/tree-sitter.git",
8
+ "directory": "lib/binding_web"
9
+ },
10
+ "license": "MIT",
11
+ "author": {
12
+ "name": "Max Brunsfeld",
13
+ "email": "maxbrunsfeld@gmail.com"
14
+ },
15
+ "maintainers": [
16
+ {
17
+ "name": "Amaan Qureshi",
18
+ "email": "amaanq12@gmail.com"
19
+ }
20
+ ],
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "import": "./tree-sitter.js",
25
+ "require": "./tree-sitter.cjs",
26
+ "types": "./web-tree-sitter.d.ts"
27
+ },
28
+ "./tree-sitter.wasm": "./tree-sitter.wasm",
29
+ "./debug": {
30
+ "import": "./debug/tree-sitter.js",
31
+ "require": "./debug/tree-sitter.cjs",
32
+ "types": "./web-tree-sitter.d.ts"
33
+ },
34
+ "./debug/tree-sitter.wasm": "./debug/tree-sitter.wasm"
35
+ },
36
+ "types": "web-tree-sitter.d.ts",
37
+ "keywords": [
38
+ "incremental",
39
+ "parsing",
40
+ "tree-sitter",
41
+ "wasm"
42
+ ],
43
+ "files": [
44
+ "README.md",
45
+ "tree-sitter.cjs",
46
+ "tree-sitter.cjs.map",
47
+ "tree-sitter.js",
48
+ "tree-sitter.js.map",
49
+ "tree-sitter.wasm",
50
+ "tree-sitter.wasm.map",
51
+ "debug/tree-sitter.cjs",
52
+ "debug/tree-sitter.cjs.map",
53
+ "debug/tree-sitter.js",
54
+ "debug/tree-sitter.js.map",
55
+ "debug/tree-sitter.wasm",
56
+ "debug/tree-sitter.wasm.map",
57
+ "web-tree-sitter.d.ts",
58
+ "web-tree-sitter.d.ts.map",
59
+ "src/**/*.ts",
60
+ "lib/*.c",
61
+ "lib/*.h"
62
+ ],
63
+ "devDependencies": {
64
+ "@eslint/js": "^9.20.0",
65
+ "@types/node": "^22.13.1",
66
+ "@vitest/coverage-v8": "^3.0.5",
67
+ "dts-buddy": "^0.5.4",
68
+ "esbuild": "^0.24.2",
69
+ "eslint": "^9.19.0",
70
+ "source-map": "^0.7.4",
71
+ "tsx": "^4.19.2",
72
+ "typescript": "^5.7.3",
73
+ "typescript-eslint": "^8.22.0",
74
+ "vitest": "^3.0.4"
75
+ },
76
+ "peerDependencies": {
77
+ "@types/emscripten": "^1.40.0"
78
+ },
79
+ "peerDependenciesMeta": {
80
+ "@types/emscripten": {
81
+ "optional": true
82
+ }
83
+ },
84
+ "scripts": {
85
+ "build:ts": "tsc -b . && node script/build.js",
86
+ "build:wasm": "cd ../../ && cargo xtask build-wasm",
87
+ "build:wasm:debug": "cd ../../ && cargo xtask build-wasm --debug",
88
+ "build": "npm run build:wasm && npm run build:ts",
89
+ "build:debug": "npm run build:wasm:debug && npm run build:ts -- --debug",
90
+ "build:dts": "node script/generate-dts.js",
91
+ "lint": "eslint src/*.ts script/*.ts test/*.ts",
92
+ "lint:fix": "eslint src/*.ts script/*.ts test/*.ts --fix",
93
+ "test": "vitest run",
94
+ "test:watch": "vitest",
95
+ "prepack": "cp ../../LICENSE .",
96
+ "prepublishOnly": "tsx script/check-artifacts-fresh.ts"
97
+ }
98
+ }
@@ -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"
@@ -86,23 +86,24 @@ 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.
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)
93
+ # or is denied (non-interactive via ask-downgrade)
93
94
  [[rule]]
94
95
  toolName = "write_file"
95
- decision = "allow"
96
- priority = 70
96
+ decision = "ask_user"
97
+ priority = 65
97
98
  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
99
 
100
+ # replace outside the resolved plans root requires approval (interactive)
101
+ # or is denied (non-interactive via ask-downgrade)
100
102
  [[rule]]
101
103
  toolName = "replace"
102
- decision = "allow"
103
- priority = 70
104
+ decision = "ask_user"
105
+ priority = 65
104
106
  modes = ["plan"]
105
- argsPattern = "\"file_path\"\\s*:\\s*\"[^\"]*[/\\\\]+\\.codely-cli[/\\\\]+tmp[/\\\\]+[a-f0-9]{64}[/\\\\]+plans[/\\\\]+[a-zA-Z0-9_\\-][a-zA-Z0-9_\\-.]*\\.md\""
106
107
 
107
108
  # --- exit_plan_mode requires user approval ---
108
109
  [[rule]]
@@ -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"
@@ -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"))
@@ -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(