@treasuredata/tdx 0.1.7 → 0.1.9
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/README.md +85 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.d.ts +24 -0
- package/dist/commands/llm-proxy.d.ts.map +1 -0
- package/dist/commands/llm-proxy.js +1 -0
- package/dist/commands/llm-proxy.js.map +1 -0
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.d.ts +79 -0
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -0
- package/dist/proxy/anthropic-adapter.js +1 -0
- package/dist/proxy/anthropic-adapter.js.map +1 -0
- package/dist/proxy/server.d.ts +59 -0
- package/dist/proxy/server.d.ts.map +1 -0
- package/dist/proxy/server.js +1 -0
- package/dist/proxy/server.js.map +1 -0
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/anthropic.d.ts +139 -0
- package/dist/types/anthropic.d.ts.map +1 -0
- package/dist/types/anthropic.js +1 -0
- package/dist/types/anthropic.js.map +1 -0
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript types for Anthropic Messages API
|
|
3
|
+
* Based on: https://docs.anthropic.com/en/api/messages
|
|
4
|
+
*/
|
|
5
|
+
export interface AnthropicMessage {
|
|
6
|
+
role: 'user' | 'assistant';
|
|
7
|
+
content: string | AnthropicContentBlock[];
|
|
8
|
+
}
|
|
9
|
+
export interface AnthropicContentBlock {
|
|
10
|
+
type: 'text' | 'image' | 'tool_use' | 'tool_result';
|
|
11
|
+
text?: string;
|
|
12
|
+
source?: {
|
|
13
|
+
type: 'base64';
|
|
14
|
+
media_type: string;
|
|
15
|
+
data: string;
|
|
16
|
+
};
|
|
17
|
+
id?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
input?: Record<string, unknown>;
|
|
20
|
+
tool_use_id?: string;
|
|
21
|
+
content?: string | AnthropicContentBlock[];
|
|
22
|
+
is_error?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface AnthropicTool {
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
input_schema: {
|
|
28
|
+
type: 'object';
|
|
29
|
+
properties?: Record<string, unknown>;
|
|
30
|
+
required?: string[];
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface AnthropicMessagesRequest {
|
|
34
|
+
model: string;
|
|
35
|
+
messages: AnthropicMessage[];
|
|
36
|
+
max_tokens: number;
|
|
37
|
+
metadata?: {
|
|
38
|
+
user_id?: string;
|
|
39
|
+
};
|
|
40
|
+
stop_sequences?: string[];
|
|
41
|
+
stream?: boolean;
|
|
42
|
+
system?: string | AnthropicContentBlock[];
|
|
43
|
+
temperature?: number;
|
|
44
|
+
tool_choice?: {
|
|
45
|
+
type: 'auto' | 'any' | 'tool';
|
|
46
|
+
name?: string;
|
|
47
|
+
};
|
|
48
|
+
tools?: AnthropicTool[];
|
|
49
|
+
top_k?: number;
|
|
50
|
+
top_p?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface AnthropicUsage {
|
|
53
|
+
input_tokens: number;
|
|
54
|
+
output_tokens: number;
|
|
55
|
+
}
|
|
56
|
+
export interface AnthropicMessagesResponse {
|
|
57
|
+
id: string;
|
|
58
|
+
type: 'message';
|
|
59
|
+
role: 'assistant';
|
|
60
|
+
content: AnthropicContentBlock[];
|
|
61
|
+
model: string;
|
|
62
|
+
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
|
|
63
|
+
stop_sequence: string | null;
|
|
64
|
+
usage: AnthropicUsage;
|
|
65
|
+
}
|
|
66
|
+
export type AnthropicStreamEvent = AnthropicMessageStartEvent | AnthropicContentBlockStartEvent | AnthropicContentBlockDeltaEvent | AnthropicContentBlockStopEvent | AnthropicMessageDeltaEvent | AnthropicMessageStopEvent | AnthropicPingEvent | AnthropicErrorEvent;
|
|
67
|
+
export interface AnthropicMessageStartEvent {
|
|
68
|
+
type: 'message_start';
|
|
69
|
+
message: {
|
|
70
|
+
id: string;
|
|
71
|
+
type: 'message';
|
|
72
|
+
role: 'assistant';
|
|
73
|
+
content: [];
|
|
74
|
+
model: string;
|
|
75
|
+
stop_reason: null;
|
|
76
|
+
stop_sequence: null;
|
|
77
|
+
usage: {
|
|
78
|
+
input_tokens: number;
|
|
79
|
+
output_tokens: number;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface AnthropicContentBlockStartEvent {
|
|
84
|
+
type: 'content_block_start';
|
|
85
|
+
index: number;
|
|
86
|
+
content_block: {
|
|
87
|
+
type: 'text' | 'tool_use';
|
|
88
|
+
text?: string;
|
|
89
|
+
id?: string;
|
|
90
|
+
name?: string;
|
|
91
|
+
input?: Record<string, unknown>;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export interface AnthropicContentBlockDeltaEvent {
|
|
95
|
+
type: 'content_block_delta';
|
|
96
|
+
index: number;
|
|
97
|
+
delta: {
|
|
98
|
+
type: 'text_delta' | 'input_json_delta';
|
|
99
|
+
text?: string;
|
|
100
|
+
partial_json?: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface AnthropicContentBlockStopEvent {
|
|
104
|
+
type: 'content_block_stop';
|
|
105
|
+
index: number;
|
|
106
|
+
}
|
|
107
|
+
export interface AnthropicMessageDeltaEvent {
|
|
108
|
+
type: 'message_delta';
|
|
109
|
+
delta: {
|
|
110
|
+
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
|
|
111
|
+
stop_sequence: string | null;
|
|
112
|
+
};
|
|
113
|
+
usage: {
|
|
114
|
+
output_tokens: number;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export interface AnthropicMessageStopEvent {
|
|
118
|
+
type: 'message_stop';
|
|
119
|
+
}
|
|
120
|
+
export interface AnthropicPingEvent {
|
|
121
|
+
type: 'ping';
|
|
122
|
+
}
|
|
123
|
+
export interface AnthropicErrorEvent {
|
|
124
|
+
type: 'error';
|
|
125
|
+
error: {
|
|
126
|
+
type: string;
|
|
127
|
+
message: string;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export interface AnthropicCountTokensRequest {
|
|
131
|
+
model: string;
|
|
132
|
+
messages: AnthropicMessage[];
|
|
133
|
+
system?: string | AnthropicContentBlock[];
|
|
134
|
+
tools?: AnthropicTool[];
|
|
135
|
+
}
|
|
136
|
+
export interface AnthropicCountTokensResponse {
|
|
137
|
+
input_tokens: number;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=anthropic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/types/anthropic.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/types/anthropic.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/dist/types/endpoints.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a44_0x4219(_0x14f1a9,_0x456117){const _0xad84e6=a44_0xad84();return a44_0x4219=function(_0x4219b1,_0x19e08c){_0x4219b1=_0x4219b1-0x79;let _0x2591f1=_0xad84e6[_0x4219b1];return _0x2591f1;},a44_0x4219(_0x14f1a9,_0x456117);}const a44_0x5f96=a44_0x4219;(function(_0x38ab4a,_0x221e7b){const _0x3966f9=a44_0x4219,_0x203b5e=_0x38ab4a();while(!![]){try{const _0x47c9a3=-parseInt(_0x3966f9(0x9e))/0x1+parseInt(_0x3966f9(0x8c))/0x2*(-parseInt(_0x3966f9(0xa3))/0x3)+-parseInt(_0x3966f9(0x7e))/0x4*(parseInt(_0x3966f9(0x9b))/0x5)+parseInt(_0x3966f9(0xa4))/0x6*(-parseInt(_0x3966f9(0x90))/0x7)+-parseInt(_0x3966f9(0x85))/0x8*(parseInt(_0x3966f9(0x9f))/0x9)+parseInt(_0x3966f9(0x98))/0xa*(parseInt(_0x3966f9(0x8d))/0xb)+parseInt(_0x3966f9(0x9a))/0xc;if(_0x47c9a3===_0x221e7b)break;else _0x203b5e['push'](_0x203b5e['shift']());}catch(_0x1c3b8f){_0x203b5e['push'](_0x203b5e['shift']());}}}(a44_0xad84,0x29528));export const TD_ENDPOINTS={'us01':a44_0x5f96(0x81),'jp01':a44_0x5f96(0x82),'eu01':a44_0x5f96(0x8b),'ap02':a44_0x5f96(0x94),'ap03':a44_0x5f96(0x79),'dev-us01':'https://api-development.us01.treasuredata.com','dev-eu01':a44_0x5f96(0x93),'stg-us01':a44_0x5f96(0x7d),'stg-jp01':a44_0x5f96(0x84),'stg-ap03':a44_0x5f96(0x88)};export const CDP_ENDPOINTS={'us01':'https://api-cdp.treasuredata.com','jp01':a44_0x5f96(0xa0),'eu01':a44_0x5f96(0x97),'ap02':'https://api-cdp.ap02.treasuredata.com','ap03':a44_0x5f96(0x8f),'dev-us01':'https://api-development-cdp.us01.treasuredata.com','dev-eu01':'https://api-development-cdp.eu01.treasuredata.com','stg-us01':a44_0x5f96(0x92),'stg-jp01':a44_0x5f96(0x95),'stg-ap03':a44_0x5f96(0x8a)};function a44_0xad84(){const _0x5e0bfe=['https://api.treasuredata.co.jp','https://llm-api-staging.us01.treasuredata.com','https://api-staging.treasuredata.co.jp','85808yPNDwS','https://api-development-workflow.eu01.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://api-staging.ap03.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','https://api.eu01.treasuredata.com','2HtrBRI','11bdCoRe','https://llm-api.eu01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','17031CcoBct','https://llm-api-staging.treasuredata.co.jp','https://api-staging-cdp.us01.treasuredata.com','https://api-development.eu01.treasuredata.com','https://api.ap02.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://api-development-workflow.us01.treasuredata.com','https://api-cdp.eu01.treasuredata.com','1075540OaqfEr','https://api-workflow.eu01.treasuredata.com','7275012vCLrbL','3905EaJGTE','https://llm-api.treasuredata.com','https://llm-api.ap03.treasuredata.com','211436MJsxFs','18CaOqKd','https://api-cdp.treasuredata.co.jp','https://api-workflow.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','306093fpQfSE','438rymjpG','https://api-workflow.ap02.treasuredata.com','https://api.ap03.treasuredata.com','https://api-presto.treasuredata.com','https://api-presto.ap03.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://api-staging.us01.treasuredata.com','164ixoPpS','https://api-staging-presto.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','https://api.treasuredata.com'];a44_0xad84=function(){return _0x5e0bfe;};return a44_0xad84();}export const WORKFLOW_ENDPOINTS={'us01':a44_0x5f96(0xa1),'jp01':'https://api-workflow.treasuredata.co.jp','eu01':a44_0x5f96(0x99),'ap02':a44_0x5f96(0xa5),'ap03':'https://api-workflow.ap03.treasuredata.com','dev-us01':a44_0x5f96(0x96),'dev-eu01':a44_0x5f96(0x86),'stg-us01':'https://api-staging-workflow.us01.treasuredata.com','stg-jp01':a44_0x5f96(0x80),'stg-ap03':'https://api-staging-workflow.ap03.treasuredata.com'};export const TRINO_ENDPOINTS={'us01':a44_0x5f96(0x7a),'jp01':'https://api-presto.treasuredata.co.jp','eu01':'https://api-presto.eu01.treasuredata.com','ap02':'https://api-presto.ap02.treasuredata.com','ap03':a44_0x5f96(0x7b),'dev-us01':'https://api-development-presto.treasuredata.com','dev-eu01':a44_0x5f96(0x89),'stg-us01':a44_0x5f96(0x7f),'stg-jp01':a44_0x5f96(0x7c),'stg-ap03':a44_0x5f96(0xa2)};export const LLM_ENDPOINTS={'us01':a44_0x5f96(0x9c),'jp01':'https://llm-api.treasuredata.co.jp','eu01':a44_0x5f96(0x8e),'ap02':'https://llm-api.ap02.treasuredata.com','ap03':a44_0x5f96(0x9d),'dev-us01':'https://llm-api-development.us01.treasuredata.com','dev-eu01':'https://llm-api-development.eu01.treasuredata.com','stg-us01':a44_0x5f96(0x83),'stg-jp01':a44_0x5f96(0x91),'stg-ap03':a44_0x5f96(0x87)};export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS};export function getEndpoint(_0x30740a,_0x19f9ff='td'){const _0x48355a=API_ENDPOINTS[_0x19f9ff]?.[_0x30740a];if(!_0x48355a)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x19f9ff+'\x27\x20and\x20site\x20\x27'+_0x30740a+'\x27');return _0x48355a;}
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x497db7=a45_0x3532;function a45_0x2cee(){const _0x19a5c9=['5615520NBHHxo','900208bJVQjk','us01','3610194jhaNsX','2902578CAKtLF','stg-us01','36lUAPCT','846137otbmEd','jp01','18wIrmQD','3710133JpnxaC','1535825AOxXDa'];a45_0x2cee=function(){return _0x19a5c9;};return a45_0x2cee();}function a45_0x3532(_0x541c6d,_0xfd210){const _0x2cee72=a45_0x2cee();return a45_0x3532=function(_0x353202,_0x3d72fc){_0x353202=_0x353202-0xc2;let _0x49851a=_0x2cee72[_0x353202];return _0x49851a;},a45_0x3532(_0x541c6d,_0xfd210);}(function(_0x34567c,_0x5cc070){const _0x2bda03=a45_0x3532,_0x4d6d26=_0x34567c();while(!![]){try{const _0x16848f=-parseInt(_0x2bda03(0xca))/0x1+parseInt(_0x2bda03(0xc7))/0x2+-parseInt(_0x2bda03(0xcd))/0x3+parseInt(_0x2bda03(0xc3))/0x4+-parseInt(_0x2bda03(0xc2))/0x5*(-parseInt(_0x2bda03(0xcc))/0x6)+-parseInt(_0x2bda03(0xc6))/0x7+-parseInt(_0x2bda03(0xc4))/0x8*(parseInt(_0x2bda03(0xc9))/0x9);if(_0x16848f===_0x5cc070)break;else _0x4d6d26['push'](_0x4d6d26['shift']());}catch(_0x2e6b46){_0x4d6d26['push'](_0x4d6d26['shift']());}}}(a45_0x2cee,0xb1ba2));export const SITE_ALIASES={'us':a45_0x497db7(0xc5),'aws':'us01','jp':a45_0x497db7(0xcb),'aws-tokyo':a45_0x497db7(0xcb),'dev':'dev-us01','stg':a45_0x497db7(0xc8)};export{getEndpoint,API_ENDPOINTS}from'./endpoints.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a48_0x5c96(_0x268055,_0x5c7a5f){const _0x515df1=a48_0x515d();return a48_0x5c96=function(_0x5c969d,_0x3050fc){_0x5c969d=_0x5c969d-0x1e9;let _0x2c20f9=_0x515df1[_0x5c969d];return _0x2c20f9;},a48_0x5c96(_0x268055,_0x5c7a5f);}function a48_0x515d(){const _0x4f500e=['3909045xXykzQ','Agent\x20reference\x20cannot\x20be\x20empty','426ryzRaB','114lWKhez','length','63020zRylpV','321yZkjjP','Project\x20name\x20cannot\x20be\x20empty','33nHrwaY','10277120AbKMKP','2005860phzFEB','5266LGXaOD','Invalid\x20agent\x20reference\x20format:\x20','Agent\x20name\x20cannot\x20be\x20empty','8eXsMVj','5343255OVWxLW','trim','split','3340KmcnHf'];a48_0x515d=function(){return _0x4f500e;};return a48_0x515d();}(function(_0x5f184b,_0x44a856){const _0x48f9e1=a48_0x5c96,_0x3d78f3=_0x5f184b();while(!![]){try{const _0x5170a7=-parseInt(_0x48f9e1(0x1ed))/0x1*(-parseInt(_0x48f9e1(0x1f6))/0x2)+parseInt(_0x48f9e1(0x1f1))/0x3*(-parseInt(_0x48f9e1(0x1ea))/0x4)+-parseInt(_0x48f9e1(0x1f0))/0x5*(-parseInt(_0x48f9e1(0x1ee))/0x6)+-parseInt(_0x48f9e1(0x1eb))/0x7*(parseInt(_0x48f9e1(0x1f9))/0x8)+-parseInt(_0x48f9e1(0x1fa))/0x9+parseInt(_0x48f9e1(0x1f4))/0xa+-parseInt(_0x48f9e1(0x1f3))/0xb*(parseInt(_0x48f9e1(0x1f5))/0xc);if(_0x5170a7===_0x44a856)break;else _0x3d78f3['push'](_0x3d78f3['shift']());}catch(_0x4c81b6){_0x3d78f3['push'](_0x3d78f3['shift']());}}}(a48_0x515d,0x9db12));export function parseAgentRef(_0x133fa4){const _0x2cd8b6=a48_0x5c96;if(!_0x133fa4||_0x133fa4['trim']()==='')throw new Error(_0x2cd8b6(0x1ec));const _0xcb283d=_0x133fa4[_0x2cd8b6(0x1fb)](),_0x85e67=_0xcb283d[_0x2cd8b6(0x1e9)]('/');if(_0x85e67[_0x2cd8b6(0x1ef)]===0x1)return{'projectName':_0x85e67[0x0],'agentName':undefined};else{if(_0x85e67[_0x2cd8b6(0x1ef)]===0x2){const [_0x45a2ae,_0x115b68]=_0x85e67;if(!_0x45a2ae||_0x45a2ae[_0x2cd8b6(0x1fb)]()==='')throw new Error(_0x2cd8b6(0x1f2));if(!_0x115b68||_0x115b68[_0x2cd8b6(0x1fb)]()==='')throw new Error(_0x2cd8b6(0x1f8));return{'projectName':_0x45a2ae[_0x2cd8b6(0x1fb)](),'agentName':_0x115b68[_0x2cd8b6(0x1fb)]()};}else throw new Error(_0x2cd8b6(0x1f7)+_0x133fa4+'.\x20Expected\x20\x22project_name\x22\x20or\x20\x22project_name/agent_name\x22');}}
|
package/dist/utils/chat-cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12c3e4,_0x5bf618){const _0x2fa9b1=a49_0x50a9,_0x47f864=_0x12c3e4();while(!![]){try{const _0x51098d=parseInt(_0x2fa9b1(0x122))/0x1+-parseInt(_0x2fa9b1(0x121))/0x2+parseInt(_0x2fa9b1(0x123))/0x3*(-parseInt(_0x2fa9b1(0x11f))/0x4)+parseInt(_0x2fa9b1(0x119))/0x5*(parseInt(_0x2fa9b1(0x11e))/0x6)+parseInt(_0x2fa9b1(0x120))/0x7*(-parseInt(_0x2fa9b1(0x116))/0x8)+-parseInt(_0x2fa9b1(0x11b))/0x9*(-parseInt(_0x2fa9b1(0x11d))/0xa)+parseInt(_0x2fa9b1(0x124))/0xb;if(_0x51098d===_0x5bf618)break;else _0x47f864['push'](_0x47f864['shift']());}catch(_0xe14784){_0x47f864['push'](_0x47f864['shift']());}}}(a49_0x3eba,0x770e7));function a49_0x50a9(_0x2b91ad,_0x131e46){const _0x3ebad7=a49_0x3eba();return a49_0x50a9=function(_0x50a967,_0x11f2d2){_0x50a967=_0x50a967-0x116;let _0x31761c=_0x3ebad7[_0x50a967];return _0x31761c;},a49_0x50a9(_0x2b91ad,_0x131e46);}import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{join}from'path';function getCacheDir(){const _0x45a11f=a49_0x50a9;return join(process['cwd'](),_0x45a11f(0x117),_0x45a11f(0x11a));}function getLastChatIdPath(){const _0x181600=a49_0x50a9;return join(getCacheDir(),_0x181600(0x118));}function a49_0x3eba(){const _0x3d0798=['70ZePyAt','6UqcXUY','28NrnBjI','287pzFzwz','834120ORdvdA','406536hameUP','153183ZrOVqo','8480802RcPwAQ','trim','97776GouOWY','.cache','last_chat_id','210355KqilAh','tdx','698985IOYWEw','utf-8'];a49_0x3eba=function(){return _0x3d0798;};return a49_0x3eba();}function ensureCacheDir(){const _0x91ee66=getCacheDir();!existsSync(_0x91ee66)&&mkdirSync(_0x91ee66,{'recursive':!![]});}export function saveLastChatId(_0x1484b7){const _0x499e1a=a49_0x50a9;ensureCacheDir();const _0xb7f8fe=getLastChatIdPath();writeFileSync(_0xb7f8fe,_0x1484b7,_0x499e1a(0x11c));}export function loadLastChatId(){const _0x1f61c6=a49_0x50a9,_0x1c58a8=getLastChatIdPath();if(!existsSync(_0x1c58a8))return undefined;try{const _0x44b15e=readFileSync(_0x1c58a8,_0x1f61c6(0x11c))[_0x1f61c6(0x125)]();return _0x44b15e||undefined;}catch{return undefined;}}export function clearLastChatId(){const _0x5dfa03=a49_0x50a9,_0x388b76=getLastChatIdPath();if(existsSync(_0x388b76))try{writeFileSync(_0x388b76,'',_0x5dfa03(0x11c));}catch{}}
|
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3cb68e,_0x57ca7a){const _0x1ece8e=a50_0x1d3f,_0x24c1b3=_0x3cb68e();while(!![]){try{const _0x4cc07f=-parseInt(_0x1ece8e(0x1c3))/0x1+parseInt(_0x1ece8e(0x1bb))/0x2+parseInt(_0x1ece8e(0x1c4))/0x3+-parseInt(_0x1ece8e(0x1bc))/0x4*(parseInt(_0x1ece8e(0x1d4))/0x5)+-parseInt(_0x1ece8e(0x1c9))/0x6+-parseInt(_0x1ece8e(0x1be))/0x7*(-parseInt(_0x1ece8e(0x1d7))/0x8)+-parseInt(_0x1ece8e(0x1c1))/0x9;if(_0x4cc07f===_0x57ca7a)break;else _0x24c1b3['push'](_0x24c1b3['shift']());}catch(_0x2634e8){_0x24c1b3['push'](_0x24c1b3['shift']());}}}(a50_0x306b,0x5c878));import{Chalk}from'chalk';function a50_0x1d3f(_0x2b3647,_0x3c880a){const _0x306bd4=a50_0x306b();return a50_0x1d3f=function(_0x1d3f13,_0x403e0f){_0x1d3f13=_0x1d3f13-0x1ba;let _0x59d19b=_0x306bd4[_0x1d3f13];return _0x59d19b;},a50_0x1d3f(_0x2b3647,_0x3c880a);}export function shouldUseColor(_0x383f1b={}){const _0x539103=a50_0x1d3f;if(_0x383f1b[_0x539103(0x1ce)]===!![])return![];if(_0x383f1b['color']===!![])return!![];if(process[_0x539103(0x1c0)][_0x539103(0x1c2)]!==undefined)return![];return process[_0x539103(0x1bf)][_0x539103(0x1bd)]??![];}function getChalk(_0x10ade5={}){if(shouldUseColor(_0x10ade5))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0x2f06a3,_0xfaee3a={}){const _0x221624=a50_0x1d3f;return getChalk(_0xfaee3a)[_0x221624(0x1d1)](_0x2f06a3);}export function colorHeader(_0x1546bf,_0xdb379={}){const _0x477cfb=a50_0x1d3f;return getChalk(_0xdb379)[_0x477cfb(0x1d0)](_0x1546bf);}function a50_0x306b(){const _0x89f60b=['dim','repeat','stringify','2205485eLIcqb','join','null','15408hAlWGI','map','738166GTdiLN','4lgEkdf','isTTY','1589PGZBGk','stdout','env','1734669xAeCxV','NO_COLOR','42801niSPqv','1077651kELLRi','green','yellow','number','isArray','659178tLlgMb','object','boolean','blue','string','noColor','length','cyan'];a50_0x306b=function(){return _0x89f60b;};return a50_0x306b();}export function colorType(_0x53a100,_0x4620ef={}){const _0x322df1=a50_0x1d3f;return getChalk(_0x4620ef)[_0x322df1(0x1d1)](_0x53a100);}export function colorJSONKey(_0x26afc5,_0xe24b5c={}){const _0x1e3044=a50_0x1d3f;return getChalk(_0xe24b5c)[_0x1e3044(0x1cc)](_0x26afc5);}export function colorJSONString(_0x1a90a7,_0x26cced={}){const _0x7ba76f=a50_0x1d3f;return getChalk(_0x26cced)[_0x7ba76f(0x1c5)](_0x1a90a7);}export function colorJSONNumber(_0x391029,_0x328328={}){const _0x5181d4=a50_0x1d3f;return getChalk(_0x328328)[_0x5181d4(0x1d0)](_0x391029);}export function colorJSONBoolean(_0x20c9cf,_0x55d8d1={}){const _0x796db4=a50_0x1d3f;return getChalk(_0x55d8d1)[_0x796db4(0x1c6)](_0x20c9cf);}export function colorJSONNull(_0x376486,_0x247a2b={}){const _0x164451=a50_0x1d3f;return getChalk(_0x247a2b)[_0x164451(0x1d1)](_0x376486);}export function colorizeJSONCompact(_0x14bc86,_0x5ccacb={}){const _0x5c15a4=a50_0x1d3f;if(!shouldUseColor(_0x5ccacb))return JSON[_0x5c15a4(0x1d3)](_0x14bc86);if(_0x14bc86===null)return colorJSONNull('null',_0x5ccacb);if(typeof _0x14bc86===_0x5c15a4(0x1cb))return colorJSONBoolean(String(_0x14bc86),_0x5ccacb);if(typeof _0x14bc86===_0x5c15a4(0x1c7))return colorJSONNumber(String(_0x14bc86),_0x5ccacb);if(typeof _0x14bc86===_0x5c15a4(0x1cd))return colorJSONString(JSON[_0x5c15a4(0x1d3)](_0x14bc86),_0x5ccacb);if(Array[_0x5c15a4(0x1c8)](_0x14bc86)){if(_0x14bc86[_0x5c15a4(0x1cf)]===0x0)return'[]';const _0x5f1db5=_0x14bc86['map'](_0xda10f2=>colorizeJSONCompact(_0xda10f2,_0x5ccacb));return'['+_0x5f1db5[_0x5c15a4(0x1d5)](',')+']';}if(typeof _0x14bc86===_0x5c15a4(0x1ca)){const _0x38e736=Object['entries'](_0x14bc86);if(_0x38e736[_0x5c15a4(0x1cf)]===0x0)return'{}';const _0x461b2c=_0x38e736[_0x5c15a4(0x1ba)](([_0xd4baab,_0x450212])=>{const _0x4403d9=colorJSONKey(JSON['stringify'](_0xd4baab),_0x5ccacb),_0x52fd88=colorizeJSONCompact(_0x450212,_0x5ccacb);return _0x4403d9+':'+_0x52fd88;});return'{'+_0x461b2c[_0x5c15a4(0x1d5)](',')+'}';}return String(_0x14bc86);}export function colorizeJSON(_0x3e2d52,_0x2cb431={},_0x49af95=0x0){const _0x34a624=a50_0x1d3f;if(!shouldUseColor(_0x2cb431))return JSON[_0x34a624(0x1d3)](_0x3e2d52,null,0x2);const _0x2de035='\x20'[_0x34a624(0x1d2)](_0x49af95),_0x176c19=_0x49af95+0x2;if(_0x3e2d52===null)return colorJSONNull(_0x34a624(0x1d6),_0x2cb431);if(typeof _0x3e2d52===_0x34a624(0x1cb))return colorJSONBoolean(String(_0x3e2d52),_0x2cb431);if(typeof _0x3e2d52===_0x34a624(0x1c7))return colorJSONNumber(String(_0x3e2d52),_0x2cb431);if(typeof _0x3e2d52===_0x34a624(0x1cd))return colorJSONString(JSON[_0x34a624(0x1d3)](_0x3e2d52),_0x2cb431);if(Array[_0x34a624(0x1c8)](_0x3e2d52)){if(_0x3e2d52[_0x34a624(0x1cf)]===0x0)return'[]';const _0x17e3f0=_0x3e2d52[_0x34a624(0x1ba)](_0x32ad59=>{const _0x5191e8=_0x34a624,_0x1fb71b=colorizeJSON(_0x32ad59,_0x2cb431,_0x176c19);return''+'\x20'[_0x5191e8(0x1d2)](_0x176c19)+_0x1fb71b;});return'[\x0a'+_0x17e3f0[_0x34a624(0x1d5)](',\x0a')+('\x0a'+_0x2de035+']');}if(typeof _0x3e2d52===_0x34a624(0x1ca)){const _0x5c2458=Object['entries'](_0x3e2d52);if(_0x5c2458[_0x34a624(0x1cf)]===0x0)return'{}';const _0x205714=_0x5c2458[_0x34a624(0x1ba)](([_0x3616e0,_0x312c20])=>{const _0x558250=_0x34a624,_0x1aa8fa=colorJSONKey(JSON[_0x558250(0x1d3)](_0x3616e0),_0x2cb431),_0x2203ec=colorizeJSON(_0x312c20,_0x2cb431,_0x176c19);return''+'\x20'[_0x558250(0x1d2)](_0x176c19)+_0x1aa8fa+':\x20'+_0x2203ec;});return'{\x0a'+_0x205714[_0x34a624(0x1d5)](',\x0a')+('\x0a'+_0x2de035+'}');}return String(_0x3e2d52);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a51_0x4b81(){const _0x3e8d43=['length','2361651eDgSGE','12572270oXCKNB','color','double','noColor','isInteger','format','table','error','entries','json','sdk-result','stdout','output','FINISHED','end','resolve','isTTY','close','less','6BnaKBz','pipe','717345yDAUpW','11fSVVGg','3408436bGNgQD','6882410hgAWEv','329196HApAKR','spawn','Results\x20saved\x20to\x20','boolean','log','number','11929FWmUbF','./formatters.js','limit','94IrEhkl','stdin','8VxhFNl'];a51_0x4b81=function(){return _0x3e8d43;};return a51_0x4b81();}(function(_0x93a752,_0x48c938){const _0x58ba5a=a51_0x3b2a,_0xd83836=_0x93a752();while(!![]){try{const _0x26a30c=parseInt(_0x58ba5a(0x1c4))/0x1*(parseInt(_0x58ba5a(0x1c7))/0x2)+parseInt(_0x58ba5a(0x1cb))/0x3+-parseInt(_0x58ba5a(0x1bc))/0x4+parseInt(_0x58ba5a(0x1bd))/0x5*(parseInt(_0x58ba5a(0x1b8))/0x6)+parseInt(_0x58ba5a(0x1be))/0x7+-parseInt(_0x58ba5a(0x1c9))/0x8*(-parseInt(_0x58ba5a(0x1ba))/0x9)+parseInt(_0x58ba5a(0x1cc))/0xa*(-parseInt(_0x58ba5a(0x1bb))/0xb);if(_0x26a30c===_0x48c938)break;else _0xd83836['push'](_0xd83836['shift']());}catch(_0x17823c){_0xd83836['push'](_0xd83836['shift']());}}}(a51_0x4b81,0xb517f));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';export function parseOutputOptions(_0x21252d){const _0x159fe0=a51_0x3b2a;return{'format':_0x21252d[_0x159fe0(0x1d1)]||_0x159fe0(0x1d2),'output':_0x21252d[_0x159fe0(0x1d8)]||'','limit':_0x21252d[_0x159fe0(0x1c6)],'color':_0x21252d['color'],'noColor':_0x21252d[_0x159fe0(0x1cf)]};}function convertSDKResultToQueryResult(_0x103033){const _0x579e3c=a51_0x3b2a,_0x18053a=[];if(_0x103033[_0x579e3c(0x1ca)]>0x0){const _0x564af4=_0x103033[0x0];for(const [_0x2d7400,_0x24b37d]of Object[_0x579e3c(0x1d4)](_0x564af4)){let _0x47bb33='varchar';if(typeof _0x24b37d===_0x579e3c(0x1c3))_0x47bb33=Number[_0x579e3c(0x1d0)](_0x24b37d)?'bigint':_0x579e3c(0x1ce);else{if(typeof _0x24b37d===_0x579e3c(0x1c1))_0x47bb33=_0x579e3c(0x1c1);else _0x24b37d===null&&(_0x47bb33='varchar');}_0x18053a['push']({'name':_0x2d7400,'type':_0x47bb33});}}return{'queryId':_0x579e3c(0x1d6),'columns':_0x18053a,'data':_0x103033,'stats':{'state':_0x579e3c(0x1d9),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x103033[_0x579e3c(0x1ca)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}function a51_0x3b2a(_0x5e1330,_0x1f7966){const _0x4b814e=a51_0x4b81();return a51_0x3b2a=function(_0x3b2a3a,_0x20f871){_0x3b2a3a=_0x3b2a3a-0x1b8;let _0x3ccb5d=_0x4b814e[_0x3b2a3a];return _0x3ccb5d;},a51_0x3b2a(_0x5e1330,_0x1f7966);}export async function formatSDKOutput(_0x470b94,_0xc2f26){const _0x3f1473=convertSDKResultToQueryResult(_0x470b94);return formatQueryOutput(_0x3f1473,_0xc2f26);}export async function formatQueryOutput(_0x2b7162,_0x5ab932){const _0xbb90b6=a51_0x3b2a,{format:_0x2f5a84,limit:_0x5cdc16,output:_0x526b8c,color:_0xbd7ea8,noColor:_0x43c88f}=_0x5ab932,_0x308473=Boolean(_0x526b8c)&&!_0xbd7ea8,_0x2d892d={'color':_0xbd7ea8,'noColor':_0x43c88f||_0x308473};if(_0x2f5a84==='table'){const {formatAsTable:_0x4b6d23}=await import(_0xbb90b6(0x1c5)),_0x20e16c=shouldUseLess(_0x2f5a84,_0x526b8c);return _0x4b6d23(_0x2b7162,_0x5cdc16,_0x20e16c,_0x2d892d);}else{if(_0x2f5a84===_0xbb90b6(0x1d5)){const {formatAsJSON:_0x2983cd}=await import(_0xbb90b6(0x1c5));return _0x2983cd(_0x2b7162,_0x2d892d);}else{if(_0x2f5a84==='jsonl'){const {formatAsJSONL:_0xb2b324}=await import(_0xbb90b6(0x1c5));return _0xb2b324(_0x2b7162,_0x2d892d);}else{const {formatQueryResult:_0x5a7164}=await import(_0xbb90b6(0x1c5));return _0x5a7164(_0x2b7162,_0x2f5a84);}}}}function shouldUseLess(_0x10ad78,_0x311ea4){const _0x3d8c06=a51_0x3b2a;return _0x10ad78===_0x3d8c06(0x1d2)&&process[_0x3d8c06(0x1d7)][_0x3d8c06(0x1dc)]&&!_0x311ea4;}export function resolveOutputOptions(_0x4ee226){const _0x39ad51=a51_0x3b2a,_0x18499e=resolveOutputFormat(_0x4ee226[_0x39ad51(0x1d1)],_0x4ee226['output'],'table');let _0x670643=typeof _0x4ee226[_0x39ad51(0x1c6)]===_0x39ad51(0x1c3)?_0x4ee226[_0x39ad51(0x1c6)]:parseInt(_0x4ee226['limit']||'40',0xa);const _0x17419b=_0x4ee226[_0x39ad51(0x1d8)]||'';return shouldUseLess(_0x18499e,_0x17419b)&&(_0x670643=Infinity),{'format':_0x18499e,'output':_0x17419b,'limit':_0x670643,'color':_0x4ee226[_0x39ad51(0x1cd)],'noColor':_0x4ee226['noColor']};}export function writeOutput(_0x44edce,_0x21d62f,_0x1e2e26){const _0x2c939e=a51_0x3b2a;return _0x21d62f?(writeFileSync(_0x21d62f,_0x44edce),console[_0x2c939e(0x1d3)](_0x2c939e(0x1c0)+_0x21d62f),Promise[_0x2c939e(0x1db)]()):shouldUseLess(_0x1e2e26||'','')?new Promise(_0x54354b=>{const _0x2cfb05=_0x2c939e,_0x9d0604=spawn(_0x2cfb05(0x1de),['-FXRSn'],{'stdio':[_0x2cfb05(0x1b9),'inherit','inherit']});let _0x15a4a1=![];_0x9d0604['on'](_0x2cfb05(0x1d3),()=>{const _0xd806ea=_0x2cfb05;!_0x15a4a1&&(_0x15a4a1=!![],console[_0xd806ea(0x1c2)](_0x44edce),_0x54354b());}),_0x9d0604['on'](_0x2cfb05(0x1dd),()=>{!_0x15a4a1&&(_0x15a4a1=!![],_0x54354b());}),_0x9d0604['on'](_0x2cfb05(0x1bf),()=>{const _0x2510c3=_0x2cfb05;!_0x15a4a1&&_0x9d0604[_0x2510c3(0x1c8)]&&(_0x9d0604['stdin']['on'](_0x2510c3(0x1d3),()=>{}),_0x9d0604['stdin']['write'](_0x44edce),_0x9d0604[_0x2510c3(0x1c8)][_0x2510c3(0x1da)]());}),!_0x9d0604[_0x2cfb05(0x1c8)]&&(!_0x15a4a1&&(_0x15a4a1=!![],console['log'](_0x44edce),_0x54354b()));}):(console[_0x2c939e(0x1c2)](_0x44edce),Promise[_0x2c939e(0x1db)]());}export async function handleSDKOutput(_0x2a767a,_0x2a02a2){const _0x8254fe=a51_0x3b2a,_0x800308=resolveOutputOptions(_0x2a02a2),_0x56f83b=await formatSDKOutput(_0x2a767a,_0x800308);await writeOutput(_0x56f83b,_0x800308[_0x8254fe(0x1d8)]||undefined,_0x800308['format']);}export async function handleQueryOutput(_0x1f785b,_0x22b782){const _0x1ffa30=a51_0x3b2a,_0x50066b=resolveOutputOptions(_0x22b782),_0x3513ca=await formatQueryOutput(_0x1f785b,_0x50066b);await writeOutput(_0x3513ca,_0x50066b[_0x1ffa30(0x1d8)]||undefined,_0x50066b[_0x1ffa30(0x1d1)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x590e3a,_0x29e673){const _0x2eeb1d=a52_0xb125,_0x1e7a2b=_0x590e3a();while(!![]){try{const _0x279fc2=parseInt(_0x2eeb1d(0xc7))/0x1+parseInt(_0x2eeb1d(0xb1))/0x2*(parseInt(_0x2eeb1d(0xba))/0x3)+-parseInt(_0x2eeb1d(0xb7))/0x4*(-parseInt(_0x2eeb1d(0xc4))/0x5)+parseInt(_0x2eeb1d(0xb2))/0x6*(parseInt(_0x2eeb1d(0xb5))/0x7)+-parseInt(_0x2eeb1d(0xb8))/0x8*(-parseInt(_0x2eeb1d(0xc2))/0x9)+-parseInt(_0x2eeb1d(0xc0))/0xa*(parseInt(_0x2eeb1d(0xb6))/0xb)+-parseInt(_0x2eeb1d(0xbc))/0xc;if(_0x279fc2===_0x29e673)break;else _0x1e7a2b['push'](_0x1e7a2b['shift']());}catch(_0x442bbc){_0x1e7a2b['push'](_0x1e7a2b['shift']());}}}(a52_0x30a9,0xa951f));import*as a52_0x5a1c0c from'node:fs';function a52_0xb125(_0x3847be,_0xb1f516){const _0x30a90b=a52_0x30a9();return a52_0xb125=function(_0xb1256b,_0x1ead66){_0xb1256b=_0xb1256b-0xb1;let _0x1542b7=_0x30a90b[_0xb1256b];return _0x1542b7;},a52_0xb125(_0x3847be,_0xb1f516);}import*as a52_0x1ca46d from'node:path';export function setSecureFilePermissions(_0x465d04){const _0x34d739=a52_0xb125;try{a52_0x5a1c0c['chmodSync'](_0x465d04,0x180);}catch{console[_0x34d739(0xbd)](_0x34d739(0xb9)+_0x465d04);}}export function setSecureDirectoryPermissions(_0x279ef4){const _0x4dd3dd=a52_0xb125;try{a52_0x5a1c0c[_0x4dd3dd(0xc5)](_0x279ef4,0x1c0);}catch{console['warn'](_0x4dd3dd(0xb9)+_0x279ef4);}}export function createSecureDirectory(_0x50e632){const _0x1a9e10=a52_0xb125;!a52_0x5a1c0c['existsSync'](_0x50e632)&&(a52_0x5a1c0c[_0x1a9e10(0xbe)](_0x50e632,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x50e632));}export function validateSecureFilePermissions(_0x365903){const _0x121dea=a52_0xb125;try{const _0x484852=a52_0x5a1c0c['statSync'](_0x365903),_0x4322cb=_0x484852[_0x121dea(0xc3)]&0x1ff,_0x2438ce=(_0x4322cb&0x3f)!==0x0;if(_0x2438ce)return console[_0x121dea(0xbd)]('Warning:\x20'+_0x365903+_0x121dea(0xc6)+_0x4322cb[_0x121dea(0xc1)](0x8)+_0x121dea(0xbf)+_0x121dea(0xbb)),![];return!![];}catch{return!![];}}function a52_0x30a9(){const _0x313a6a=['6120KVfegx','dirname','writeFileSync','2758gInUYX','6303SDreNe','3544CuXLgp','552YtDcEJ','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','60svwRww','Should\x20be\x200600\x20or\x20more\x20restrictive.','28527936YljkKw','warn','mkdirSync',').\x20','10310RAwRtQ','toString','135243McnlwV','mode','3005aeEMTz','chmodSync','\x20has\x20insecure\x20permissions\x20(','725797eHNlzN','96460qPbXzA'];a52_0x30a9=function(){return _0x313a6a;};return a52_0x30a9();}export function writeSecureFile(_0x17b329,_0x2c3d2a){const _0x2f5673=a52_0xb125,_0x3f4486=a52_0x1ca46d[_0x2f5673(0xb3)](_0x17b329);createSecureDirectory(_0x3f4486),a52_0x5a1c0c[_0x2f5673(0xb4)](_0x17b329,_0x2c3d2a,{'mode':0x180}),setSecureFilePermissions(_0x17b329);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3dd74a,_0x2ba76d){const _0x199054=a53_0x1657,_0x29c72b=_0x3dd74a();while(!![]){try{const _0x3bfb28=-parseInt(_0x199054(0x140))/0x1*(parseInt(_0x199054(0x13e))/0x2)+-parseInt(_0x199054(0x142))/0x3+-parseInt(_0x199054(0x145))/0x4*(-parseInt(_0x199054(0x133))/0x5)+parseInt(_0x199054(0x138))/0x6+-parseInt(_0x199054(0x141))/0x7*(parseInt(_0x199054(0x139))/0x8)+-parseInt(_0x199054(0x13a))/0x9*(parseInt(_0x199054(0x13f))/0xa)+-parseInt(_0x199054(0x13b))/0xb*(-parseInt(_0x199054(0x136))/0xc);if(_0x3bfb28===_0x2ba76d)break;else _0x29c72b['push'](_0x29c72b['shift']());}catch(_0x1eee3a){_0x29c72b['push'](_0x29c72b['shift']());}}}(a53_0x19b7,0x49811));export function detectFormatFromExtension(_0x21ba6f){const _0x12d117=a53_0x1657,_0x52e976=_0x21ba6f[_0x12d117(0x144)]()[_0x12d117(0x137)]('.')[_0x12d117(0x135)]();switch(_0x52e976){case _0x12d117(0x146):return _0x12d117(0x146);case _0x12d117(0x13d):return _0x12d117(0x13d);case _0x12d117(0x134):case _0x12d117(0x132):return _0x12d117(0x134);case'txt':case _0x12d117(0x13c):return _0x12d117(0x143);default:return undefined;}}function a53_0x1657(_0x1d420b,_0xfa8a77){const _0x19b7cc=a53_0x19b7();return a53_0x1657=function(_0x1657cd,_0x79da36){_0x1657cd=_0x1657cd-0x132;let _0x190c8d=_0x19b7cc[_0x1657cd];return _0x190c8d;},a53_0x1657(_0x1d420b,_0xfa8a77);}function a53_0x19b7(){const _0x12f82a=['537840YzUEHH','8CHVxCb','52659ITQZCX','66PynhxV','text','jsonl','2OJYMbQ','530WeMXiM','173961kNRpcP','4095966UKcYYa','821874hXpUjk','table','toLowerCase','418892PdxPvY','json','tab','5GGMLSA','tsv','pop','2899740pYCuMZ','split'];a53_0x19b7=function(){return _0x12f82a;};return a53_0x19b7();}export function resolveOutputFormat(_0x31e35,_0x235fa9,_0x37fc76){if(_0x31e35)return _0x31e35;if(_0x235fa9){const _0x104f0f=detectFormatFromExtension(_0x235fa9);if(_0x104f0f)return _0x104f0f;}return _0x37fc76;}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4e9616,_0x417cba){const _0x4115bd=a54_0x5480,_0x5738b0=_0x4e9616();while(!![]){try{const _0x4067d9=-parseInt(_0x4115bd(0x12d))/0x1*(-parseInt(_0x4115bd(0x136))/0x2)+-parseInt(_0x4115bd(0x11b))/0x3+parseInt(_0x4115bd(0x13a))/0x4+-parseInt(_0x4115bd(0x12e))/0x5*(parseInt(_0x4115bd(0x128))/0x6)+-parseInt(_0x4115bd(0x10f))/0x7*(parseInt(_0x4115bd(0x126))/0x8)+parseInt(_0x4115bd(0x139))/0x9*(-parseInt(_0x4115bd(0x11a))/0xa)+-parseInt(_0x4115bd(0x11f))/0xb*(-parseInt(_0x4115bd(0x131))/0xc);if(_0x4067d9===_0x417cba)break;else _0x5738b0['push'](_0x5738b0['shift']());}catch(_0x50e21c){_0x5738b0['push'](_0x5738b0['shift']());}}}(a54_0x4c24,0x3d75f));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';function a54_0x5480(_0x467486,_0x169b29){const _0x4c24f0=a54_0x4c24();return a54_0x5480=function(_0x5480e1,_0x1841de){_0x5480e1=_0x5480e1-0x10a;let _0x61e365=_0x4c24f0[_0x5480e1];return _0x61e365;},a54_0x5480(_0x467486,_0x169b29);}const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x1c9fa7=a54_0x5480;return process[_0x1c9fa7(0x13b)][_0x1c9fa7(0x137)]||Infinity;}export function formatAsTable(_0x34d96e,_0x46a868=DEFAULT_MAX_DISPLAY_ROWS,_0x37dce5=![],_0x49f831={}){const _0x355f64=a54_0x5480;if(_0x34d96e[_0x355f64(0x119)][_0x355f64(0x130)]===0x0)return _0x355f64(0x13c);const _0x4edf38=_0x34d96e[_0x355f64(0x137)]['map'](_0x39c810=>_0x39c810[_0x355f64(0x13d)]),_0x2018f8=_0x34d96e[_0x355f64(0x137)][_0x355f64(0x121)](_0x170390=>simplifyType(_0x170390[_0x355f64(0x123)])),_0x33475c=_0x34d96e[_0x355f64(0x119)][_0x355f64(0x129)](0x0,_0x46a868),_0x6ed9b8=_0x34d96e[_0x355f64(0x119)]['length'],_0x131454=_0x6ed9b8>_0x46a868,_0x31f47d=[],_0x5efc21=getTerminalWidth(),_0x5f1ee7=_0x5efc21!==Infinity,_0x48e313=0x32;let _0x8b9390=_0x4edf38[_0x355f64(0x121)]((_0xb4f692,_0x318b4a)=>{const _0x45a2ec=_0x355f64,_0x2980ca=stringWidth(_0x2018f8[_0x318b4a]),_0x292254=Math[_0x45a2ec(0x113)](..._0x33475c['map'](_0x177eb5=>{const _0x307c5c=_0x177eb5[_0xb4f692];return stringWidth(formatValue(_0x307c5c));})),_0x2ca79d=Math[_0x45a2ec(0x113)](stringWidth(_0xb4f692),_0x2980ca,_0x292254);return _0x37dce5?_0x2ca79d:Math[_0x45a2ec(0x133)](_0x2ca79d,_0x48e313);});if(_0x5f1ee7&&!_0x37dce5&&_0x4edf38[_0x355f64(0x130)]>0x0){const _0x47cb7d=_0x5185dd=>{let _0xfe24c9=0x1;for(const _0x4d9783 of _0x5185dd){_0xfe24c9+=_0x4d9783+0x3;}return _0xfe24c9+0x1;};let _0x55ff7c=_0x47cb7d(_0x8b9390);if(_0x55ff7c>_0x5efc21){const _0x5a330b=0x3;for(let _0x42373f=_0x8b9390[_0x355f64(0x130)]-0x1;_0x42373f>=0x0;_0x42373f--){_0x55ff7c=_0x47cb7d(_0x8b9390);if(_0x55ff7c<=_0x5efc21)break;const _0x3090b4=_0x8b9390[_0x42373f],_0x3aae40=_0x55ff7c-_0x5efc21,_0xff3e44=_0x3090b4-_0x5a330b,_0x219a29=Math[_0x355f64(0x133)](_0x3aae40,_0xff3e44);_0x219a29>0x0&&(_0x8b9390[_0x42373f]=_0x3090b4-_0x219a29);}}}const _0x426903=_0x4edf38,_0x5f2b97=_0x2018f8,_0x20f6a6=_0x8b9390,_0x1f86ba=_0x8b9390;_0x31f47d[_0x355f64(0x12c)](colorBorder('┌'+_0x1f86ba['map'](_0x577ebf=>'─'[_0x355f64(0x11d)](_0x577ebf+0x2))[_0x355f64(0x110)]('┬')+'┐',_0x49f831));const _0xc8c1e0=_0x426903[_0x355f64(0x121)]((_0x4ec0d7,_0x4613b6)=>centerAlign(_0x4ec0d7,_0x20f6a6[_0x4613b6]));_0x31f47d[_0x355f64(0x12c)](colorBorder('│',_0x49f831)+'\x20'+_0xc8c1e0[_0x355f64(0x110)]('\x20'+colorBorder('│',_0x49f831)+'\x20')+'\x20'+colorBorder('│',_0x49f831));const _0x237ebd=_0x5f2b97['map']((_0x13a316,_0x23ed04)=>colorType(centerAlign(_0x13a316,_0x20f6a6[_0x23ed04]),_0x49f831));_0x31f47d[_0x355f64(0x12c)](colorBorder('│',_0x49f831)+'\x20'+_0x237ebd[_0x355f64(0x110)]('\x20'+colorBorder('│',_0x49f831)+'\x20')+'\x20'+colorBorder('│',_0x49f831)),_0x31f47d[_0x355f64(0x12c)](colorBorder('├'+_0x1f86ba[_0x355f64(0x121)](_0x177dba=>'─'[_0x355f64(0x11d)](_0x177dba+0x2))[_0x355f64(0x110)]('┼')+'┤',_0x49f831));const _0x386fdc=(_0x4e0e73,_0x53b344)=>{const _0x484602=_0x355f64,_0x60b2cc=stringWidth(_0x4e0e73);if(_0x60b2cc<=_0x53b344)return _0x4e0e73;let _0x8b5c7e=_0x4e0e73;while(stringWidth(_0x8b5c7e+'…')>_0x53b344&&_0x8b5c7e[_0x484602(0x130)]>0x0){_0x8b5c7e=_0x8b5c7e[_0x484602(0x129)](0x0,-0x1);}return _0x8b5c7e+'…';};_0x33475c[_0x355f64(0x11c)](_0x5e11e1=>{const _0x35eca8=_0x355f64,_0x54ccbd=_0x4edf38[_0x35eca8(0x121)]((_0x1d0124,_0x3e1a7d)=>{const _0x36936f=_0x35eca8,_0x2717a8=_0x5e11e1[_0x1d0124],_0x2937eb=formatValue(_0x2717a8),_0x32671c=_0x20f6a6[_0x3e1a7d],_0x4dc2e7=_0x386fdc(_0x2937eb,_0x32671c),_0x40613=typeof _0x2717a8==='number'||typeof _0x2717a8===_0x36936f(0x127)&&/^-?\d+$/[_0x36936f(0x111)](_0x2717a8);return _0x40613?padStart(_0x4dc2e7,_0x32671c):padEnd(_0x4dc2e7,_0x32671c);});_0x31f47d[_0x35eca8(0x12c)](colorBorder('│',_0x49f831)+'\x20'+_0x54ccbd[_0x35eca8(0x110)]('\x20'+colorBorder('│',_0x49f831)+'\x20')+'\x20'+colorBorder('│',_0x49f831));});const _0x8c159d=_0x1f86ba[_0x355f64(0x10e)]((_0x4246a6,_0x104e4c)=>_0x4246a6+_0x104e4c+0x3,-0x1);_0x31f47d[_0x355f64(0x12c)](colorBorder('├'+_0x1f86ba[_0x355f64(0x121)](_0x258aa4=>'─'['repeat'](_0x258aa4+0x2))[_0x355f64(0x110)]('┴')+'┤',_0x49f831));let _0x405072;_0x131454?_0x405072=_0x6ed9b8+_0x355f64(0x135)+_0x46a868+_0x355f64(0x10d):_0x405072=_0x6ed9b8+_0x355f64(0x10b)+(_0x6ed9b8===0x1?'':'s');const _0x8c0712=_0x405072[_0x355f64(0x132)](_0x8c159d-0x2);return _0x31f47d[_0x355f64(0x12c)](colorBorder('│',_0x49f831)+'\x20'+_0x8c0712+'\x20'+colorBorder('│',_0x49f831)),_0x31f47d[_0x355f64(0x12c)](colorBorder('└'+'─'[_0x355f64(0x11d)](_0x8c159d)+'┘',_0x49f831)),_0x31f47d['join']('\x0a');}function a54_0x4c24(){const _0x2798b7=['stringify','toISOString','object','data','1450lsRoja','215682LGPIMN','forEach','repeat','startsWith','3338819GEbhcf','false','map','bool','type','tsv','number','1672PQktTU','string','29586IncjLn','slice','true','double','push','3WynYBH','285IdqQoP','timestamp','length','12CtFgQx','padEnd','min','substring','\x20rows\x20(','222962jswKck','columns','toLowerCase','810htBaXv','655644dvWONu','stdout','No\x20rows\x20returned','name','date','\x20row','replace','\x20shown)','reduce','6167ttGuWY','join','test','int','max','long','boolean'];a54_0x4c24=function(){return _0x2798b7;};return a54_0x4c24();}function simplifyType(_0x2d09c6){const _0x262eda=a54_0x5480,_0x51e001={'varchar':_0x262eda(0x127),'bigint':_0x262eda(0x114),'integer':_0x262eda(0x112),'double':_0x262eda(0x12b),'boolean':_0x262eda(0x122),'date':_0x262eda(0x10a),'timestamp':_0x262eda(0x12f),'array':'array','map':_0x262eda(0x121),'row':'row'},_0x6adbdb=_0x2d09c6[_0x262eda(0x138)]();for(const [_0x5edb9f,_0xa7e302]of Object['entries'](_0x51e001)){if(_0x6adbdb[_0x262eda(0x11e)](_0x5edb9f))return _0xa7e302;}return _0x2d09c6[_0x262eda(0x130)]>0xa?_0x2d09c6[_0x262eda(0x134)](0x0,0xa):_0x2d09c6;}export function formatAsJSON(_0x47d712,_0x4539a8={}){const _0x35eb4e=a54_0x5480;if(_0x47d712[_0x35eb4e(0x119)]['length']===0x0)return'[]';if(shouldUseColor(_0x4539a8))return colorizeJSON(_0x47d712['data'],_0x4539a8);const _0x572c66=_0x47d712[_0x35eb4e(0x119)][_0x35eb4e(0x121)](_0x26e435=>'\x20\x20'+JSON[_0x35eb4e(0x116)](_0x26e435));return'[\x0a'+_0x572c66[_0x35eb4e(0x110)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x3efae0,_0x4088cd={}){const _0x49500a=a54_0x5480;if(_0x3efae0['data'][_0x49500a(0x130)]===0x0)return'';if(shouldUseColor(_0x4088cd))return _0x3efae0[_0x49500a(0x119)][_0x49500a(0x121)](_0x206766=>colorizeJSONCompact(_0x206766,_0x4088cd))['join']('\x0a');return _0x3efae0[_0x49500a(0x119)][_0x49500a(0x121)](_0x156914=>JSON[_0x49500a(0x116)](_0x156914))[_0x49500a(0x110)]('\x0a');}export function formatAsTSV(_0x4120ae){const _0x170661=a54_0x5480;if(_0x4120ae['data']['length']===0x0)return'';const _0x26845=[],_0x3e1348=_0x4120ae['columns'][_0x170661(0x121)](_0x1d1f5f=>_0x1d1f5f[_0x170661(0x13d)]);return _0x26845['push'](_0x3e1348['join']('\x09')),_0x4120ae[_0x170661(0x119)][_0x170661(0x11c)](_0x1b052d=>{const _0x32078f=_0x170661,_0x1bb7ef=_0x3e1348[_0x32078f(0x121)](_0x1419fa=>{const _0x5673c9=_0x1b052d[_0x1419fa];return formatValueForTSV(_0x5673c9);});_0x26845[_0x32078f(0x12c)](_0x1bb7ef[_0x32078f(0x110)]('\x09'));}),_0x26845['join']('\x0a');}function formatValue(_0x2b6434){const _0x1263d9=a54_0x5480;if(_0x2b6434===null||_0x2b6434===undefined)return'';if(typeof _0x2b6434===_0x1263d9(0x127)){const _0x4d0d09=_0x2b6434['replace'](/\n/g,'\x5cn')[_0x1263d9(0x10c)](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x4d0d09;}if(typeof _0x2b6434===_0x1263d9(0x125))return String(_0x2b6434);if(typeof _0x2b6434===_0x1263d9(0x115))return _0x2b6434?_0x1263d9(0x12a):_0x1263d9(0x120);if(_0x2b6434 instanceof Date)return _0x2b6434['toISOString']();if(typeof _0x2b6434===_0x1263d9(0x118))return JSON[_0x1263d9(0x116)](_0x2b6434);return String(_0x2b6434);}function formatValueForTSV(_0x3a5e80){const _0x4c558e=a54_0x5480;if(_0x3a5e80===null||_0x3a5e80===undefined)return'';if(typeof _0x3a5e80==='string')return _0x3a5e80[_0x4c558e(0x10c)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x3a5e80===_0x4c558e(0x125)||typeof _0x3a5e80===_0x4c558e(0x115))return String(_0x3a5e80);if(_0x3a5e80 instanceof Date)return _0x3a5e80[_0x4c558e(0x117)]();if(typeof _0x3a5e80===_0x4c558e(0x118))return JSON[_0x4c558e(0x116)](_0x3a5e80);return String(_0x3a5e80);}export function formatQueryResult(_0x464596,_0x28b287){const _0x131f5=a54_0x5480;switch(_0x28b287){case'table':return formatAsTable(_0x464596);case'json':return formatAsJSON(_0x464596);case'jsonl':return formatAsJSONL(_0x464596);case _0x131f5(0x124):return formatAsTSV(_0x464596);default:return formatAsJSON(_0x464596);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a55_0x159b4b=a55_0x11b3;(function(_0x8f0f8a,_0x8c8107){const _0x5ccecb=a55_0x11b3,_0x16f38b=_0x8f0f8a();while(!![]){try{const _0x2707ba=parseInt(_0x5ccecb(0xea))/0x1+-parseInt(_0x5ccecb(0xe6))/0x2*(-parseInt(_0x5ccecb(0xe7))/0x3)+-parseInt(_0x5ccecb(0xe0))/0x4*(-parseInt(_0x5ccecb(0xe8))/0x5)+parseInt(_0x5ccecb(0xe9))/0x6+parseInt(_0x5ccecb(0xe5))/0x7+parseInt(_0x5ccecb(0xe1))/0x8+-parseInt(_0x5ccecb(0xe4))/0x9;if(_0x2707ba===_0x8c8107)break;else _0x16f38b['push'](_0x16f38b['shift']());}catch(_0x4a6194){_0x16f38b['push'](_0x16f38b['shift']());}}}(a55_0xc152,0x3d8f8));function a55_0xc152(){const _0x13ab48=['22ydpwSg','100923OuTaKg','1563585Cpkfiq','1274586uxgfWy','308095gqxsfW','4TbKbPU','3083600KLMwXy','toLowerCase','claude-4.5-haiku','13697712LosXYH','1297632ZkCmZu'];a55_0xc152=function(){return _0x13ab48;};return a55_0xc152();}const MODEL_ALIASES={'haiku':a55_0x159b4b(0xe3),'sonnet':'claude-4.5-sonnet'};function a55_0x11b3(_0x5e055f,_0x46707b){const _0xc1523c=a55_0xc152();return a55_0x11b3=function(_0x11b382,_0x41dc8e){_0x11b382=_0x11b382-0xe0;let _0x1259e9=_0xc1523c[_0x11b382];return _0x1259e9;},a55_0x11b3(_0x5e055f,_0x46707b);}export function resolveModelAlias(_0x1d041c){const _0x3b9b98=a55_0x159b4b;return MODEL_ALIASES[_0x1d041c[_0x3b9b98(0xe2)]()]||_0x1d041c;}export function getModelAliases(){return{...MODEL_ALIASES};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1c310d,_0x83f2f2){const _0x4a991f=a56_0x7851,_0x3c90aa=_0x1c310d();while(!![]){try{const _0x4454f2=-parseInt(_0x4a991f(0x1d1))/0x1*(parseInt(_0x4a991f(0x1cd))/0x2)+parseInt(_0x4a991f(0x1c1))/0x3*(parseInt(_0x4a991f(0x1d0))/0x4)+-parseInt(_0x4a991f(0x1c3))/0x5+-parseInt(_0x4a991f(0x1c8))/0x6*(-parseInt(_0x4a991f(0x1c7))/0x7)+parseInt(_0x4a991f(0x1ce))/0x8*(parseInt(_0x4a991f(0x1c2))/0x9)+-parseInt(_0x4a991f(0x1cb))/0xa*(parseInt(_0x4a991f(0x1c4))/0xb)+parseInt(_0x4a991f(0x1c6))/0xc*(-parseInt(_0x4a991f(0x1c5))/0xd);if(_0x4454f2===_0x83f2f2)break;else _0x3c90aa['push'](_0x3c90aa['shift']());}catch(_0x135af6){_0x3c90aa['push'](_0x3c90aa['shift']());}}}(a56_0xb6d1,0xb4f3d));function a56_0x7851(_0xa6603a,_0x46891d){const _0xb6d11f=a56_0xb6d1();return a56_0x7851=function(_0x78511c,_0x24c3ad){_0x78511c=_0x78511c-0x1c1;let _0x3fa8be=_0xb6d11f[_0x78511c];return _0x3fa8be;},a56_0x7851(_0xa6603a,_0x46891d);}export function validateLimitOption(_0x606f9e){const _0x14647b=a56_0x7851;if(!Number['isInteger'](_0x606f9e))return{'isValid':![],'error':_0x14647b(0x1ca)+_0x606f9e+'.\x20Must\x20be\x20an\x20integer.'};if(_0x606f9e<=0x0)return{'isValid':![],'error':_0x14647b(0x1ca)+_0x606f9e+_0x14647b(0x1cf)};return{'isValid':!![],'value':_0x606f9e};}function a56_0xb6d1(){const _0x1d6782=['1628235SbAczL','18oPhFxv','.\x20Must\x20be\x20a\x20number.','Invalid\x20limit\x20value:\x20','13862550FbqgFk','Invalid\x20timeout\x20value:\x20','92014WsOxqF','8SSfipJ','.\x20Must\x20be\x20a\x20positive\x20integer.','1716PUQqvX','7kXPSXs','4401TfYDJh','11763963sDFVKj','223805BTRJtd','11wxqbcy','13hZynLa','1680228pdxsLl'];a56_0xb6d1=function(){return _0x1d6782;};return a56_0xb6d1();}export function validateTimeoutOption(_0x126a93,_0x25cf31=0x1e){const _0x529fab=a56_0x7851;if(_0x126a93===undefined)return{'isValid':!![],'value':_0x25cf31};const _0x135029=typeof _0x126a93==='number'?_0x126a93:parseFloat(_0x126a93);if(isNaN(_0x135029))return{'isValid':![],'error':_0x529fab(0x1cc)+_0x126a93+_0x529fab(0x1c9)};if(_0x135029<=0x0)return{'isValid':![],'error':_0x529fab(0x1cc)+_0x135029+'.\x20Must\x20be\x20a\x20positive\x20number.'};return{'isValid':!![],'value':_0x135029};}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a57_0x280b(){var _0x4f8ccc=['7612LbMVeF','kill','137796eokLks','2429523DePLeW','ppid','778425gGbwbj','301554PPuxRh','329TlylNb','40557sbIzWW','8320USEmDe','6CiVXnR','1095BoLJDM','8IQvjSa'];a57_0x280b=function(){return _0x4f8ccc;};return a57_0x280b();}function a57_0x5d8d(_0x5d6e5,_0x2a624f){var _0x280b9a=a57_0x280b();return a57_0x5d8d=function(_0x5d8da7,_0x5cd4ab){_0x5d8da7=_0x5d8da7-0xe0;var _0x55406c=_0x280b9a[_0x5d8da7];return _0x55406c;},a57_0x5d8d(_0x5d6e5,_0x2a624f);}(function(_0x3da64c,_0x49d36c){var _0x238ff1=a57_0x5d8d,_0x44d68a=_0x3da64c();while(!![]){try{var _0x332836=-parseInt(_0x238ff1(0xe2))/0x1*(parseInt(_0x238ff1(0xeb))/0x2)+-parseInt(_0x238ff1(0xea))/0x3+-parseInt(_0x238ff1(0xe5))/0x4*(-parseInt(_0x238ff1(0xe3))/0x5)+parseInt(_0x238ff1(0xe7))/0x6*(parseInt(_0x238ff1(0xec))/0x7)+-parseInt(_0x238ff1(0xe4))/0x8*(-parseInt(_0x238ff1(0xe8))/0x9)+-parseInt(_0x238ff1(0xe1))/0xa+-parseInt(_0x238ff1(0xe0))/0xb;if(_0x332836===_0x49d36c)break;else _0x44d68a['push'](_0x44d68a['shift']());}catch(_0x318f1c){_0x44d68a['push'](_0x44d68a['shift']());}}}(a57_0x280b,0x91dca));export function getPPID(){var _0x2fc782=a57_0x5d8d;return process[_0x2fc782(0xe9)];}export function isProcessRunning(_0x5eaa22){var _0x11ecfd=a57_0x5d8d;try{return process[_0x11ecfd(0xe6)](_0x5eaa22,0x0),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a58_0x4565(_0x5af9ed,_0x3211f4){const _0x1fd33b=a58_0x1fd3();return a58_0x4565=function(_0x456564,_0x1848fa){_0x456564=_0x456564-0xf6;let _0x2d4dd7=_0x1fd33b[_0x456564];return _0x2d4dd7;},a58_0x4565(_0x5af9ed,_0x3211f4);}(function(_0x4fe5d2,_0x294dfc){const _0x49f719=a58_0x4565,_0x430165=_0x4fe5d2();while(!![]){try{const _0x1da186=-parseInt(_0x49f719(0xf8))/0x1+-parseInt(_0x49f719(0xfb))/0x2*(parseInt(_0x49f719(0xf7))/0x3)+-parseInt(_0x49f719(0x100))/0x4+-parseInt(_0x49f719(0xfa))/0x5*(parseInt(_0x49f719(0xfe))/0x6)+parseInt(_0x49f719(0xfd))/0x7+parseInt(_0x49f719(0xff))/0x8+-parseInt(_0x49f719(0x103))/0x9*(-parseInt(_0x49f719(0x102))/0xa);if(_0x1da186===_0x294dfc)break;else _0x430165['push'](_0x430165['shift']());}catch(_0x3612f2){_0x430165['push'](_0x430165['shift']());}}}(a58_0x1fd3,0x9de74));function a58_0x1fd3(){const _0x1011f7=['366LwlXGW','indexOf','2915318vnFcXj','23862MgztAc','2575264Hcdrrl','3638824UEkjIv','substring','30GUypHX','9761571QZCggq','Invalid\x20segment\x20reference\x20format:\x20','9264fdTark','625856fuEvOh','.\x20Parent\x20name\x20cannot\x20be\x20empty','1565ESQXBc'];a58_0x1fd3=function(){return _0x1011f7;};return a58_0x1fd3();}export function parseSegmentRef(_0x2ffcfd){const _0x538201=a58_0x4565,_0xcde3d1=_0x2ffcfd[_0x538201(0xfc)]('/');if(_0xcde3d1===-0x1)return{'parentId':_0x2ffcfd};if(_0xcde3d1===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2ffcfd+_0x538201(0xf9));const _0x424451=_0x2ffcfd[_0x538201(0x101)](0x0,_0xcde3d1),_0x595477=_0x2ffcfd[_0x538201(0x101)](_0xcde3d1+0x1);if(_0x595477==='')throw new Error(_0x538201(0xf6)+_0x2ffcfd+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x424451,'childId':_0x595477};}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a431b,_0x59b3da){const _0x1d926e=a59_0x1b56,_0x4fd608=_0x2a431b();while(!![]){try{const _0x24334d=-parseInt(_0x1d926e(0x1a5))/0x1+-parseInt(_0x1d926e(0x194))/0x2+-parseInt(_0x1d926e(0x192))/0x3*(-parseInt(_0x1d926e(0x19f))/0x4)+parseInt(_0x1d926e(0x199))/0x5+-parseInt(_0x1d926e(0x1a0))/0x6*(parseInt(_0x1d926e(0x1a6))/0x7)+parseInt(_0x1d926e(0x197))/0x8*(-parseInt(_0x1d926e(0x1a2))/0x9)+parseInt(_0x1d926e(0x193))/0xa*(parseInt(_0x1d926e(0x18c))/0xb);if(_0x24334d===_0x59b3da)break;else _0x4fd608['push'](_0x4fd608['shift']());}catch(_0x3d0346){_0x4fd608['push'](_0x4fd608['shift']());}}}(a59_0x5a4b,0xa90a2));function a59_0x1b56(_0x2864a8,_0xdb57cc){const _0x5a4b00=a59_0x5a4b();return a59_0x1b56=function(_0x1b5644,_0x5e3cab){_0x1b5644=_0x1b5644-0x18b;let _0x597a18=_0x5a4b00[_0x1b5644];return _0x597a18;},a59_0x1b56(_0x2864a8,_0xdb57cc);}import a59_0x5116f1 from'ora';export function createCommandSpinner(_0x45f07b,_0x3affbf={}){const _0x40c494=a59_0x1b56,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0x3affbf;return a59_0x5116f1({'text':_0x45f07b,'color':_0x40c494(0x18e),'isEnabled':forceEnabled||process[_0x40c494(0x190)][_0x40c494(0x18f)]&&!verbose});}export async function withSpinner(_0x4c23c1,_0x11eb29,_0x392b2e={}){const _0x179de5=a59_0x1b56,_0x4a0176=_0x392b2e[_0x179de5(0x19e)]??(()=>Date['now']()),_0x2420ad=createCommandSpinner(_0x4c23c1,_0x392b2e);_0x2420ad[_0x179de5(0x195)]();const _0x5922eb=_0x4a0176();try{const _0x1e4344=await _0x11eb29(),_0x55f468=_0x4a0176()-_0x5922eb;return _0x2420ad[_0x179de5(0x1a4)](),{'data':_0x1e4344,'elapsedMs':_0x55f468};}catch(_0x2ee475){_0x2420ad[_0x179de5(0x1a4)]();throw _0x2ee475;}}function a59_0x5a4b(){const _0x5352d0=['jobId','cyan','isTTY','stdout','\x20[Job\x20ID:\x20','3MLDMCa','190qBCSzh','1153856KXfuLm','start','intervalFactory','4461432AGaVgs','now','5138450poptuA','extra','text','phase','...','clock','419412uXwKDx','237696eVoxpY','toFixed','9Wglway','isSpinning','stop','674770NGUNTU','105rpFcHQ','replace','1136740KPGIjD'];a59_0x5a4b=function(){return _0x5352d0;};return a59_0x5a4b();}export async function withQuerySpinner(_0x3c8c3d,_0x88e47c,_0x50d8e9={}){const _0x4557d9=a59_0x1b56,_0x526dd7=_0x50d8e9[_0x4557d9(0x19e)]??(()=>Date[_0x4557d9(0x198)]()),_0x42accb=_0x50d8e9[_0x4557d9(0x196)]??setInterval,_0x831097=createCommandSpinner(_0x3c8c3d,_0x50d8e9);_0x831097[_0x4557d9(0x195)]();const _0x33af03=_0x526dd7(),_0x139cb6=_0x3c8c3d[_0x4557d9(0x18b)](_0x4557d9(0x19d),''),_0x5e5a85={},_0x2954cc=()=>{const _0x30c8d5=_0x4557d9;if(!_0x831097[_0x30c8d5(0x1a3)])return;const _0x283973=((_0x526dd7()-_0x33af03)/0x3e8)[_0x30c8d5(0x1a1)](0x1),_0x3f1297=_0x5e5a85[_0x30c8d5(0x19c)]??_0x139cb6,_0x1635ea=_0x5e5a85[_0x30c8d5(0x18d)]?_0x30c8d5(0x191)+_0x5e5a85[_0x30c8d5(0x18d)]+']':'',_0x5e8b62=_0x5e5a85['extra']?'\x20'+_0x5e5a85['extra']:'';_0x831097[_0x30c8d5(0x19b)]=_0x3f1297+'\x20('+_0x283973+'s)'+_0x5e8b62+_0x1635ea;},_0x37cab1=_0x42accb(()=>{_0x2954cc();},0x3e8),_0x1473c7={'setPhase':_0xcce038=>{_0x5e5a85['phase']=_0xcce038,_0x2954cc();},'setJobId':_0x328d0e=>{const _0x1682af=_0x4557d9;_0x5e5a85[_0x1682af(0x18d)]=_0x328d0e,_0x2954cc();},'setExtra':_0xe7c03b=>{const _0x2d661e=_0x4557d9;_0x5e5a85[_0x2d661e(0x19a)]=_0xe7c03b,_0x2954cc();}};_0x2954cc();try{const _0x53aa8b=await _0x88e47c(_0x1473c7),_0x3926b9=_0x526dd7()-_0x33af03;return{'data':_0x53aa8b,'elapsedMs':_0x3926b9};}finally{clearInterval(_0x37cab1),_0x831097[_0x4557d9(0x1a4)]();}}export function formatElapsed(_0xbcaaf2){const _0xe4b4eb=a59_0x1b56;return(_0xbcaaf2/0x3e8)[_0xe4b4eb(0x1a1)](0x2)+'s';}
|