crewx-pi-kit 0.1.14 → 0.1.15

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.
@@ -11,8 +11,24 @@ type JsonRecord = Record<string, unknown>;
11
11
  const CONTROL_PATH_PATTERN = /(?:\/proc\/[^/]+\/environ|\.config\/crewx(?:-cloud)?\/|\.local\/state\/crewx\/|bootstrap\.env|bridge\/config\.json)/i;
12
12
  const CONTROL_VALUE_PATTERN = /\bCREWX_(?:TOKEN|URL|CLI_PATH|RUNTIME_PROXY_[A-Z0-9_]+)\b/;
13
13
 
14
- function containsControlCredential(value: unknown): boolean {
15
- const serialized = JSON.stringify(value);
14
+ function containsControlCredential(value: unknown, toolName: string): boolean {
15
+ // The work CLI path is managed configuration, but executing the documented
16
+ // work commands is intentional. Exempt only that executable-position token;
17
+ // still inspect all arguments, extra input fields and subsequent commands.
18
+ let inspected = value;
19
+ if (toolName === "bash" && value && typeof value === "object") {
20
+ const input = value as JsonRecord;
21
+ if (typeof input.command === "string") {
22
+ inspected = {
23
+ ...input,
24
+ command: input.command.replace(
25
+ /^(\s*node\s+)"\$(?:CREWX_CLI_PATH|\{CREWX_CLI_PATH\})"(?=\s+(?:task|doc|memory|integration|file|preview)(?:\s|$))/,
26
+ '$1"[CrewX work CLI]"',
27
+ ),
28
+ };
29
+ }
30
+ }
31
+ const serialized = JSON.stringify(inspected);
16
32
  return CONTROL_PATH_PATTERN.test(serialized) || CONTROL_VALUE_PATTERN.test(serialized);
17
33
  }
18
34
 
@@ -214,7 +230,7 @@ export default function crewxTools(pi: ExtensionAPI) {
214
230
  pi.on("tool_call", async (event, ctx) => {
215
231
  if (
216
232
  ["bash", "read", "write", "edit"].includes(event.toolName) &&
217
- containsControlCredential(event.input)
233
+ containsControlCredential(event.input, event.toolName)
218
234
  ) {
219
235
  return {
220
236
  block: true,
package/package.json CHANGED
@@ -1,19 +1,16 @@
1
1
  {
2
2
  "name": "crewx-pi-kit",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Typed CrewX tools and operating skills for managed Pi agents.",
5
5
  "type": "module",
6
- "files": [
7
- "extensions",
8
- "skills"
9
- ],
6
+ "files": ["extensions", "skills"],
10
7
  "pi": {
11
- "extensions": [
12
- "extensions"
13
- ],
14
- "skills": [
15
- "skills"
16
- ]
8
+ "extensions": ["extensions"],
9
+ "skills": ["skills"]
10
+ },
11
+ "scripts": {
12
+ "types:check": "tsc --noEmit",
13
+ "test": "tsc --noEmit && node --experimental-strip-types --test test/*.test.mjs"
17
14
  },
18
15
  "peerDependencies": {
19
16
  "@earendil-works/pi-coding-agent": "*",
@@ -25,15 +22,7 @@
25
22
  "typebox": "^1.0.55",
26
23
  "typescript": "^5.9.3"
27
24
  },
28
- "engines": {
29
- "node": ">=22"
30
- },
31
- "publishConfig": {
32
- "access": "public"
33
- },
34
- "license": "MIT",
35
- "scripts": {
36
- "types:check": "tsc --noEmit",
37
- "test": "tsc --noEmit && node --experimental-strip-types --test test/*.test.mjs"
38
- }
39
- }
25
+ "engines": {"node": ">=22"},
26
+ "publishConfig": {"access": "public"},
27
+ "license": "MIT"
28
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 CrewX contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.