@hopping-dev/hub 0.1.1 → 0.1.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.
@@ -1,48 +0,0 @@
1
- "use strict";
2
- // ============================================
3
- // HopPing 共享型別定義
4
- // 跨 Hub / Backend / Mobile / Hooks 共用
5
- // ============================================
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.STATS_RESPONSE_ERRORS = exports.DETAIL_RESPONSE_ERRORS = void 0;
8
- exports.identifyAgentType = identifyAgentType;
9
- /**
10
- * 根據 clientInfo.name 識別 Agent 類型
11
- */
12
- function identifyAgentType(clientName) {
13
- const normalized = clientName.toLowerCase();
14
- const mapping = {
15
- cursor: 'cursor',
16
- 'cursor-agent': 'cursor',
17
- 'claude-code': 'claude_code',
18
- claudecode: 'claude_code',
19
- 'claude code': 'claude_code',
20
- };
21
- if (mapping[normalized]) {
22
- return mapping[normalized];
23
- }
24
- for (const [key, type] of Object.entries(mapping)) {
25
- if (normalized.includes(key)) {
26
- return type;
27
- }
28
- }
29
- return 'generic_mcp';
30
- }
31
- // --- Hub → Cloud → Mobile(回應)---
32
- /** detail_response 錯誤碼 — Gateway 透傳層產生 */
33
- exports.DETAIL_RESPONSE_ERRORS = {
34
- INVALID_OPERATION_ID: 'INVALID_OPERATION_ID',
35
- NOT_FOUND: 'NOT_FOUND',
36
- FORBIDDEN: 'FORBIDDEN',
37
- HUB_OFFLINE: 'HUB_OFFLINE',
38
- INTERNAL_ERROR: 'INTERNAL_ERROR',
39
- };
40
- /** stats_response 錯誤碼 — Gateway 透傳層產生 */
41
- exports.STATS_RESPONSE_ERRORS = {
42
- INVALID_AGENT_ID: 'INVALID_AGENT_ID',
43
- AGENT_NOT_FOUND: 'AGENT_NOT_FOUND',
44
- HUB_OFFLINE: 'HUB_OFFLINE',
45
- TIMEOUT: 'TIMEOUT',
46
- INTERNAL_ERROR: 'INTERNAL_ERROR',
47
- };
48
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,iBAAiB;AACjB,sCAAsC;AACtC,+CAA+C;;;AAgD/C,8CAsBC;AAzBD;;GAEG;AACH,SAAgB,iBAAiB,CAAC,UAAkB;IAClD,MAAM,UAAU,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IAE5C,MAAM,OAAO,GAA8B;QACzC,MAAM,EAAE,QAAQ;QAChB,cAAc,EAAE,QAAQ;QACxB,aAAa,EAAE,aAAa;QAC5B,UAAU,EAAE,aAAa;QACzB,aAAa,EAAE,aAAa;KAC7B,CAAC;IAEF,IAAI,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAClD,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAoRD,kCAAkC;AAElC,0CAA0C;AAC7B,QAAA,sBAAsB,GAAG;IACpC,oBAAoB,EAAE,sBAAsB;IAC5C,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,cAAc,EAAE,gBAAgB;CACxB,CAAC;AA4BX,yCAAyC;AAC5B,QAAA,qBAAqB,GAAG;IACnC,gBAAgB,EAAE,kBAAkB;IACpC,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;CACxB,CAAC"}