khala-cli 0.4.0 → 0.4.2
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/dist/{chunk-THNGKHZD.mjs → chunk-2OO725IZ.mjs} +14 -6
- package/dist/{chunk-H2INZPFK.mjs → chunk-46PTKRZC.mjs} +92 -39
- package/dist/chunk-5GLTKWJ5.mjs +1 -0
- package/dist/{chunk-3YSVED2R.mjs → chunk-7MQAMABY.mjs} +2 -2
- package/dist/{chunk-ZXJIFFFU.mjs → chunk-A3LJU4JA.mjs} +1 -1
- package/dist/{chunk-AYPFL33Q.mjs → chunk-B5BFL7OD.mjs} +2 -2
- package/dist/{chunk-3WTRQEVS.mjs → chunk-BZ53MZEE.mjs} +176 -229
- package/dist/{chunk-IKHXRKJQ.mjs → chunk-CDHHFC6C.mjs} +1 -1
- package/dist/{chunk-IVPQJSFO.mjs → chunk-JRZZVTQ4.mjs} +34 -7
- package/dist/{chunk-G3SVNU4N.mjs → chunk-K4MDSFHU.mjs} +21 -14
- package/dist/{chunk-ENNXMNKZ.mjs → chunk-MHZWR4A3.mjs} +1 -1
- package/dist/{chunk-SMCTSZYU.mjs → chunk-N6LMHR7P.mjs} +12 -0
- package/dist/{chunk-BNT6YPFR.mjs → chunk-NUS6M27N.mjs} +58 -22
- package/dist/{chunk-NX27G3SB.mjs → chunk-RW3DXWNC.mjs} +1 -1
- package/dist/{chunk-7272YXO6.mjs → chunk-T6RZE5IQ.mjs} +28 -16
- package/dist/{chunk-K2SZLOBE.mjs → chunk-U5ZMOPUK.mjs} +2 -2
- package/dist/chunk-YP45XTOH.mjs +144 -0
- package/dist/khala.mjs +8 -8
- package/dist/web/assets/local-CVA9799w.js +9 -0
- package/dist/web/index.html +1 -1
- package/package.json +10 -2
- package/dist/chunk-AAX35R7C.mjs +0 -91
- package/dist/web/assets/local-CzaQ3d5Z.js +0 -9
package/dist/web/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
6
|
<meta name="color-scheme" content="dark light" />
|
|
7
7
|
<title>Khala · local</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/local-
|
|
8
|
+
<script type="module" crossorigin src="/assets/local-CVA9799w.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/local-DHYvcQG0.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "khala-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Khala channels for Claude Code, Codex and Cursor sessions: the khala MCP server, delivery hooks and local channels.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/aiur-team/khala/tree/main/packages/agent#readme",
|
|
@@ -10,7 +10,15 @@
|
|
|
10
10
|
"url": "git+https://github.com/aiur-team/khala.git",
|
|
11
11
|
"directory": "packages/agent/npm"
|
|
12
12
|
},
|
|
13
|
-
"keywords": [
|
|
13
|
+
"keywords": [
|
|
14
|
+
"khala",
|
|
15
|
+
"mcp",
|
|
16
|
+
"claude-code",
|
|
17
|
+
"codex",
|
|
18
|
+
"cursor",
|
|
19
|
+
"agents",
|
|
20
|
+
"chat"
|
|
21
|
+
],
|
|
14
22
|
"type": "module",
|
|
15
23
|
"bin": {
|
|
16
24
|
"khala": "dist/khala.mjs"
|
package/dist/chunk-AAX35R7C.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
fail,
|
|
4
|
-
reserved
|
|
5
|
-
} from "./chunk-SMCTSZYU.mjs";
|
|
6
|
-
|
|
7
|
-
// src/client.ts
|
|
8
|
-
var KhalaClientError = class extends Error {
|
|
9
|
-
code;
|
|
10
|
-
constructor(code, message) {
|
|
11
|
-
super(message ?? code);
|
|
12
|
-
this.name = "KhalaClientError";
|
|
13
|
-
this.code = code;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// ../contracts/src/m1/colors.ts
|
|
18
|
-
var HUMAN_COLOR_IDS = ["red", "orange", "amber", "lime", "green", "teal", "blue", "indigo", "purple", "pink"];
|
|
19
|
-
function isHumanColorId(value) {
|
|
20
|
-
return typeof value === "string" && HUMAN_COLOR_IDS.includes(value);
|
|
21
|
-
}
|
|
22
|
-
function fnv1a(value) {
|
|
23
|
-
let hash = 2166136261;
|
|
24
|
-
for (const byte of new TextEncoder().encode(value)) {
|
|
25
|
-
hash ^= byte;
|
|
26
|
-
hash = Math.imul(hash, 16777619) >>> 0;
|
|
27
|
-
}
|
|
28
|
-
return hash >>> 0;
|
|
29
|
-
}
|
|
30
|
-
function defaultHumanColor(ownerId) {
|
|
31
|
-
return HUMAN_COLOR_IDS[fnv1a(ownerId) % HUMAN_COLOR_IDS.length];
|
|
32
|
-
}
|
|
33
|
-
function readHumanColorId(input, path) {
|
|
34
|
-
if (!isHumanColorId(input)) return fail(path, "invalid_value");
|
|
35
|
-
return input;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// ../contracts/src/m1/initials.ts
|
|
39
|
-
function normalizeInitials(input) {
|
|
40
|
-
if (typeof input !== "string") return null;
|
|
41
|
-
const nfc = input.normalize("NFC");
|
|
42
|
-
if ([...nfc].length !== 2) return null;
|
|
43
|
-
const up = nfc.toLocaleUpperCase("en-US");
|
|
44
|
-
return /^[\p{L}\p{Nd}]{2}$/u.test(up) ? up : null;
|
|
45
|
-
}
|
|
46
|
-
function isCanonicalInitials(value) {
|
|
47
|
-
return typeof value === "string" && normalizeInitials(value) === value;
|
|
48
|
-
}
|
|
49
|
-
function readHumanInitials(input, path) {
|
|
50
|
-
if (!isCanonicalInitials(input)) return fail(path, "invalid_value");
|
|
51
|
-
return input;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// ../contracts/src/m1/names.ts
|
|
55
|
-
var USERNAME_MIN = 2;
|
|
56
|
-
var USERNAME_MAX = 24;
|
|
57
|
-
var AGENT_NAME_MIN = 2;
|
|
58
|
-
var AGENT_NAME_MAX = 40;
|
|
59
|
-
var mentionName = /^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/u;
|
|
60
|
-
var adjacentSeparators = /[._-]{2}/u;
|
|
61
|
-
var agentSuffix = /-(?:claude|codex|cursor)(?:-\d+)?$/iu;
|
|
62
|
-
function checkName(input, kind) {
|
|
63
|
-
if (typeof input !== "string") return { ok: false, error: "invalid_characters" };
|
|
64
|
-
const name = input.trim();
|
|
65
|
-
if (name.length < (kind === "username" ? USERNAME_MIN : AGENT_NAME_MIN)) return { ok: false, error: "too_short" };
|
|
66
|
-
if (name.length > (kind === "username" ? USERNAME_MAX : AGENT_NAME_MAX)) return { ok: false, error: "too_long" };
|
|
67
|
-
if (!mentionName.test(name) || adjacentSeparators.test(name)) return { ok: false, error: "invalid_characters" };
|
|
68
|
-
if (reserved.test(name) || kind === "username" && agentSuffix.test(name)) return { ok: false, error: "reserved" };
|
|
69
|
-
return { ok: true, name };
|
|
70
|
-
}
|
|
71
|
-
var MODEL_NAMES = { claude: "Claude", codex: "Codex", cursor: "Cursor" };
|
|
72
|
-
function defaultAgentName(username, harness, n = 1) {
|
|
73
|
-
return `${username}-${MODEL_NAMES[harness]}${n === 1 ? "" : `-${n}`}`;
|
|
74
|
-
}
|
|
75
|
-
function isDefaultAgentName(name, username, harness) {
|
|
76
|
-
const escaped = `${username}-${MODEL_NAMES[harness]}`.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
77
|
-
return new RegExp(`^${escaped}(?:-\\d+)?$`, "iu").test(name);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export {
|
|
81
|
-
KhalaClientError,
|
|
82
|
-
isHumanColorId,
|
|
83
|
-
defaultHumanColor,
|
|
84
|
-
readHumanColorId,
|
|
85
|
-
normalizeInitials,
|
|
86
|
-
readHumanInitials,
|
|
87
|
-
checkName,
|
|
88
|
-
MODEL_NAMES,
|
|
89
|
-
defaultAgentName,
|
|
90
|
-
isDefaultAgentName
|
|
91
|
-
};
|