ccjk 12.0.0 → 12.0.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/chunks/agent-teams.mjs +17 -18
- package/dist/chunks/agent.mjs +105 -102
- package/dist/chunks/agents.mjs +87 -77
- package/dist/chunks/api-cli.mjs +41 -27
- package/dist/chunks/api-providers.mjs +2 -4
- package/dist/chunks/api.mjs +22 -11
- package/dist/chunks/auto-bootstrap.mjs +3 -5
- package/dist/chunks/auto-init.mjs +3 -4
- package/dist/chunks/auto-updater.mjs +103 -91
- package/dist/chunks/banner.mjs +41 -42
- package/dist/chunks/boost.mjs +30 -31
- package/dist/chunks/ccjk-agents.mjs +6 -9
- package/dist/chunks/ccjk-all.mjs +703 -85
- package/dist/chunks/ccjk-config.mjs +6 -6
- package/dist/chunks/ccjk-hooks.mjs +20 -9
- package/dist/chunks/ccjk-mcp.mjs +64 -52
- package/dist/chunks/ccjk-setup.mjs +35 -25
- package/dist/chunks/ccjk-skills.mjs +51 -41
- package/dist/chunks/ccr.mjs +42 -32
- package/dist/chunks/ccu.mjs +16 -12
- package/dist/chunks/check-updates.mjs +30 -19
- package/dist/chunks/claude-code-config-manager.mjs +25 -10
- package/dist/chunks/claude-code-incremental-manager.mjs +65 -51
- package/dist/chunks/claude-config.mjs +2 -2
- package/dist/chunks/claude-wrapper.mjs +9 -6
- package/dist/chunks/cleanup-migration.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +10 -3
- package/dist/chunks/cloud-sync.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +58 -45
- package/dist/chunks/codex-provider-manager.mjs +29 -16
- package/dist/chunks/codex-uninstaller.mjs +5 -6
- package/dist/chunks/codex.mjs +89 -89
- package/dist/chunks/commands.mjs +28 -29
- package/dist/chunks/commands2.mjs +4 -3
- package/dist/chunks/commit.mjs +42 -23
- package/dist/chunks/completion.mjs +46 -47
- package/dist/chunks/config-consolidator.mjs +12 -13
- package/dist/chunks/config-switch.mjs +66 -53
- package/dist/chunks/config.mjs +10 -10
- package/dist/chunks/config2.mjs +53 -42
- package/dist/chunks/config3.mjs +107 -93
- package/dist/chunks/constants.mjs +2 -4
- package/dist/chunks/context-loader.mjs +5 -4
- package/dist/chunks/context.mjs +77 -76
- package/dist/chunks/convoy-manager.mjs +4 -4
- package/dist/chunks/dashboard.mjs +28 -29
- package/dist/chunks/doctor.mjs +68 -54
- package/dist/chunks/evolution.mjs +37 -38
- package/dist/chunks/features.mjs +103 -92
- package/dist/chunks/fs-operations.mjs +1 -1
- package/dist/chunks/health-alerts.mjs +1 -1
- package/dist/chunks/health-check.mjs +1 -1
- package/dist/chunks/help.mjs +117 -116
- package/dist/chunks/hook-installer.mjs +3 -2
- package/dist/chunks/index.mjs +20 -6
- package/dist/chunks/index10.mjs +1171 -0
- package/dist/chunks/index11.mjs +1008 -0
- package/dist/chunks/index12.mjs +193 -0
- package/dist/chunks/index13.mjs +218 -0
- package/dist/chunks/index14.mjs +663 -0
- package/dist/chunks/index2.mjs +19 -10
- package/dist/chunks/index3.mjs +19079 -164
- package/dist/chunks/index4.mjs +8 -1171
- package/dist/chunks/index5.mjs +7479 -884
- package/dist/chunks/index6.mjs +160 -184
- package/dist/chunks/index7.mjs +3573 -653
- package/dist/chunks/index8.mjs +19 -0
- package/dist/chunks/index9.mjs +616 -0
- package/dist/chunks/init.mjs +173 -173
- package/dist/chunks/installer.mjs +92 -82
- package/dist/chunks/installer2.mjs +3 -2
- package/dist/chunks/interview.mjs +118 -107
- package/dist/chunks/json-config.mjs +3 -2
- package/dist/chunks/linux.mjs +3863 -0
- package/dist/chunks/macos.mjs +69 -0
- package/dist/chunks/main.mjs +635 -0
- package/dist/chunks/marketplace.mjs +69 -66
- package/dist/chunks/mcp-cli.mjs +61 -48
- package/dist/chunks/mcp.mjs +140 -127
- package/dist/chunks/menu.mjs +85 -85
- package/dist/chunks/metrics-display.mjs +41 -40
- package/dist/chunks/migrator.mjs +4 -5
- package/dist/chunks/monitor.mjs +95 -95
- package/dist/chunks/notification.mjs +151 -141
- package/dist/chunks/onboarding.mjs +26 -15
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/paradigm.mjs +24 -23
- package/dist/chunks/permission-manager.mjs +10 -11
- package/dist/chunks/permissions.mjs +72 -57
- package/dist/chunks/persistence-manager.mjs +97 -84
- package/dist/chunks/persistence.mjs +1 -1
- package/dist/chunks/platform.mjs +29 -29
- package/dist/chunks/plugin.mjs +104 -105
- package/dist/chunks/prompts.mjs +36 -25
- package/dist/chunks/providers.mjs +68 -69
- package/dist/chunks/quick-actions.mjs +71 -72
- package/dist/chunks/quick-provider.mjs +56 -40
- package/dist/chunks/quick-setup.mjs +71 -60
- package/dist/chunks/remote.mjs +21 -12
- package/dist/chunks/session.mjs +116 -103
- package/dist/chunks/sessions.mjs +29 -28
- package/dist/chunks/silent-updater.mjs +8 -10
- package/dist/chunks/simple-config.mjs +13 -10
- package/dist/chunks/skill.mjs +8560 -103
- package/dist/chunks/skills-sync.mjs +5212 -79
- package/dist/chunks/skills.mjs +105 -94
- package/dist/chunks/slash-commands.mjs +36 -37
- package/dist/chunks/smart-defaults.mjs +7 -3
- package/dist/chunks/smart-guide.mjs +1 -1
- package/dist/chunks/startup.mjs +2 -4
- package/dist/chunks/stats.mjs +41 -42
- package/dist/chunks/status.mjs +49 -50
- package/dist/chunks/team.mjs +24 -12
- package/dist/chunks/thinking.mjs +74 -63
- package/dist/chunks/trace.mjs +20 -19
- package/dist/chunks/uninstall.mjs +69 -56
- package/dist/chunks/update.mjs +39 -28
- package/dist/chunks/upgrade-manager.mjs +24 -18
- package/dist/chunks/version-checker.mjs +45 -41
- package/dist/chunks/vim.mjs +81 -69
- package/dist/chunks/windows.mjs +14 -0
- package/dist/chunks/workflows.mjs +15 -15
- package/dist/chunks/wsl.mjs +129 -0
- package/dist/chunks/zero-config.mjs +45 -34
- package/dist/cli.mjs +20 -20
- package/dist/index.mjs +41 -31
- package/dist/shared/ccjk.BAGoDD49.mjs +36 -0
- package/dist/shared/ccjk.BBtCGd_g.mjs +899 -0
- package/dist/shared/{ccjk.CGcy7cNM.mjs → ccjk.BDKUdmLk.mjs} +1 -1
- package/dist/shared/{ccjk.DtMBiwVG.mjs → ccjk.BFxsJM0k.mjs} +1 -1
- package/dist/shared/{ccjk.j4uut26D.mjs → ccjk.BIxuVL3_.mjs} +5 -5
- package/dist/shared/ccjk.BRZ9ww8S.mjs +142 -0
- package/dist/shared/{ccjk.CN0edl87.mjs → ccjk.BSYWk9ML.mjs} +1 -1
- package/dist/shared/{ccjk.Dk1HDseQ.mjs → ccjk.BnpWvs9V.mjs} +75 -75
- package/dist/shared/ccjk.BoApaI4j.mjs +28 -0
- package/dist/shared/{ccjk.DKojSRzw.mjs → ccjk.BrPUmTqm.mjs} +1 -1
- package/dist/shared/{ccjk.C10pepYx.mjs → ccjk.BxSmJ8B7.mjs} +1 -1
- package/dist/shared/ccjk.Bx_rmYfN.mjs +69 -0
- package/dist/shared/ccjk.COweQ1RR.mjs +5 -0
- package/dist/shared/{ccjk.BN90X6oc.mjs → ccjk.CePkJq2S.mjs} +17 -17
- package/dist/shared/{ccjk.Bvoex4TZ.mjs → ccjk.CfKKcvWy.mjs} +1 -1
- package/dist/shared/ccjk.Cjgrln_h.mjs +297 -0
- package/dist/shared/ccjk.CxpGa6MC.mjs +2724 -0
- package/dist/shared/{ccjk.DfwJOEok.mjs → ccjk.D5MFQT7w.mjs} +1 -1
- package/dist/shared/{ccjk.cChAaGgT.mjs → ccjk.DG_o24cZ.mjs} +6 -6
- package/dist/shared/{ccjk.bhFAMRyc.mjs → ccjk.DLLw-h4Y.mjs} +32 -32
- package/dist/shared/ccjk.DOwtZMk8.mjs +4019 -0
- package/dist/shared/{ccjk.BsXQugfY.mjs → ccjk.DTdjs-qK.mjs} +13 -13
- package/dist/shared/{ccjk.Bdhyg3X-.mjs → ccjk.DsYaCCx4.mjs} +1 -1
- package/dist/shared/ccjk.KfSWcGlE.mjs +38 -0
- package/dist/shared/ccjk.RyizuzOI.mjs +21 -0
- package/dist/shared/{ccjk.h7_W-wTs.mjs → ccjk.SPoXMvZD.mjs} +1 -1
- package/dist/shared/ccjk.T_cX87dY.mjs +15 -0
- package/dist/shared/{ccjk.CrB6OYHv.mjs → ccjk._dESH4Rk.mjs} +2 -2
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +249 -0
- package/dist/shared/{ccjk.CBhIZiPz.mjs → ccjk.hoqrwWdN.mjs} +1 -1
- package/dist/shared/{ccjk.BNwRnWYx.mjs → ccjk.s7OCVzdd.mjs} +1230 -33
- package/dist/shared/{ccjk.BOIUTf5z.mjs → ccjk.waa2ikKJ.mjs} +8 -9
- package/package.json +31 -30
- package/dist/shared/ccjk.DHbrGcgg.mjs +0 -13
- package/dist/shared/ccjk.DntgA8fQ.mjs +0 -42
package/dist/chunks/index6.mjs
CHANGED
|
@@ -1,195 +1,171 @@
|
|
|
1
|
-
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import process__default from 'node:process';
|
|
4
|
-
import { join } from 'pathe';
|
|
5
|
-
import { i as installSuperpowers } from '../shared/ccjk.CrB6OYHv.mjs';
|
|
6
|
-
import 'node:child_process';
|
|
7
|
-
import 'node:fs/promises';
|
|
8
|
-
import 'node:util';
|
|
9
|
-
import './index3.mjs';
|
|
10
|
-
import 'node:url';
|
|
11
|
-
import 'i18next';
|
|
12
|
-
import 'i18next-fs-backend';
|
|
1
|
+
export { T as TomlDate, a as TomlError, p as parse } from '../shared/ccjk.BBtCGd_g.mjs';
|
|
13
2
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
if (!result.success) {
|
|
53
|
-
if (process__default.env.DEBUG) {
|
|
54
|
-
console.error("[CCJK Zero-Config] Installation failed:", result.error || result.message);
|
|
55
|
-
}
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
return isSuperpowersInstalled() && areCoreSkillsInstalled();
|
|
59
|
-
} catch (error) {
|
|
60
|
-
if (process__default.env.DEBUG) {
|
|
61
|
-
console.error("[CCJK Zero-Config] Auto-install failed:", error);
|
|
62
|
-
}
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function getSkillsDir() {
|
|
68
|
-
return join(homedir(), ".claude", "plugins", "superpowers", "skills");
|
|
69
|
-
}
|
|
70
|
-
function isSkillInstalled(skillName) {
|
|
71
|
-
const skillPath = join(getSkillsDir(), skillName);
|
|
72
|
-
return existsSync(skillPath) && existsSync(join(skillPath, "skill.json"));
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
|
9
|
+
*
|
|
10
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
11
|
+
* list of conditions and the following disclaimer.
|
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
* this list of conditions and the following disclaimer in the
|
|
14
|
+
* documentation and/or other materials provided with the distribution.
|
|
15
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
16
|
+
* may be used to endorse or promote products derived from this software without
|
|
17
|
+
* specific prior written permission.
|
|
18
|
+
*
|
|
19
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
*/
|
|
30
|
+
let BARE_KEY = /^[a-z0-9-_]+$/i;
|
|
31
|
+
function extendedTypeOf(obj) {
|
|
32
|
+
let type = typeof obj;
|
|
33
|
+
if (type === 'object') {
|
|
34
|
+
if (Array.isArray(obj))
|
|
35
|
+
return 'array';
|
|
36
|
+
if (obj instanceof Date)
|
|
37
|
+
return 'date';
|
|
38
|
+
}
|
|
39
|
+
return type;
|
|
73
40
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
error: "Skill not installed"
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
const skillJsonPath = join(getSkillsDir(), skillName, "skill.json");
|
|
84
|
-
const skillJson = JSON.parse(readFileSync(skillJsonPath, "utf-8"));
|
|
85
|
-
if (!skillJson.name || !skillJson.version) {
|
|
86
|
-
return {
|
|
87
|
-
skill: skillName,
|
|
88
|
-
success: false,
|
|
89
|
-
error: "Invalid skill.json format"
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
skill: skillName,
|
|
94
|
-
success: true
|
|
95
|
-
};
|
|
96
|
-
} catch (error) {
|
|
97
|
-
return {
|
|
98
|
-
skill: skillName,
|
|
99
|
-
success: false,
|
|
100
|
-
error: error instanceof Error ? error.message : "Unknown error"
|
|
101
|
-
};
|
|
102
|
-
}
|
|
41
|
+
function isArrayOfTables(obj) {
|
|
42
|
+
for (let i = 0; i < obj.length; i++) {
|
|
43
|
+
if (extendedTypeOf(obj[i]) !== 'object')
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return obj.length != 0;
|
|
103
47
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
CORE_SKILLS.map((skill) => loadSkill(skill))
|
|
107
|
-
);
|
|
108
|
-
if (process__default.env.DEBUG) {
|
|
109
|
-
const successful = results.filter((r) => r.success);
|
|
110
|
-
const failed = results.filter((r) => !r.success);
|
|
111
|
-
console.log(`[Zero-Config] Loaded ${successful.length}/${CORE_SKILLS.length} core skills`);
|
|
112
|
-
if (failed.length > 0) {
|
|
113
|
-
console.log(`[Zero-Config] Failed skills: ${failed.map((r) => r.skill).join(", ")}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return results;
|
|
48
|
+
function formatString(s) {
|
|
49
|
+
return JSON.stringify(s).replace(/\x7f/g, '\\u007f');
|
|
117
50
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
51
|
+
function stringifyValue(val, type, depth, numberAsFloat) {
|
|
52
|
+
if (depth === 0) {
|
|
53
|
+
throw new Error('Could not stringify the object: maximum object depth exceeded');
|
|
54
|
+
}
|
|
55
|
+
if (type === 'number') {
|
|
56
|
+
if (isNaN(val))
|
|
57
|
+
return 'nan';
|
|
58
|
+
if (val === Infinity)
|
|
59
|
+
return 'inf';
|
|
60
|
+
if (val === -Infinity)
|
|
61
|
+
return '-inf';
|
|
62
|
+
if (numberAsFloat && Number.isInteger(val))
|
|
63
|
+
return val.toFixed(1);
|
|
64
|
+
return val.toString();
|
|
65
|
+
}
|
|
66
|
+
if (type === 'bigint' || type === 'boolean') {
|
|
67
|
+
return val.toString();
|
|
68
|
+
}
|
|
69
|
+
if (type === 'string') {
|
|
70
|
+
return formatString(val);
|
|
71
|
+
}
|
|
72
|
+
if (type === 'date') {
|
|
73
|
+
if (isNaN(val.getTime())) {
|
|
74
|
+
throw new TypeError('cannot serialize invalid date');
|
|
75
|
+
}
|
|
76
|
+
return val.toISOString();
|
|
77
|
+
}
|
|
78
|
+
if (type === 'object') {
|
|
79
|
+
return stringifyInlineTable(val, depth, numberAsFloat);
|
|
80
|
+
}
|
|
81
|
+
if (type === 'array') {
|
|
82
|
+
return stringifyArray(val, depth, numberAsFloat);
|
|
83
|
+
}
|
|
121
84
|
}
|
|
122
|
-
function
|
|
123
|
-
|
|
85
|
+
function stringifyInlineTable(obj, depth, numberAsFloat) {
|
|
86
|
+
let keys = Object.keys(obj);
|
|
87
|
+
if (keys.length === 0)
|
|
88
|
+
return '{}';
|
|
89
|
+
let res = '{ ';
|
|
90
|
+
for (let i = 0; i < keys.length; i++) {
|
|
91
|
+
let k = keys[i];
|
|
92
|
+
if (i)
|
|
93
|
+
res += ', ';
|
|
94
|
+
res += BARE_KEY.test(k) ? k : formatString(k);
|
|
95
|
+
res += ' = ';
|
|
96
|
+
res += stringifyValue(obj[k], extendedTypeOf(obj[k]), depth - 1, numberAsFloat);
|
|
97
|
+
}
|
|
98
|
+
return res + ' }';
|
|
124
99
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
return
|
|
138
|
-
}
|
|
100
|
+
function stringifyArray(array, depth, numberAsFloat) {
|
|
101
|
+
if (array.length === 0)
|
|
102
|
+
return '[]';
|
|
103
|
+
let res = '[ ';
|
|
104
|
+
for (let i = 0; i < array.length; i++) {
|
|
105
|
+
if (i)
|
|
106
|
+
res += ', ';
|
|
107
|
+
if (array[i] === null || array[i] === void 0) {
|
|
108
|
+
throw new TypeError('arrays cannot contain null or undefined values');
|
|
109
|
+
}
|
|
110
|
+
res += stringifyValue(array[i], extendedTypeOf(array[i]), depth - 1, numberAsFloat);
|
|
111
|
+
}
|
|
112
|
+
return res + ' ]';
|
|
139
113
|
}
|
|
140
|
-
function
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
114
|
+
function stringifyArrayTable(array, key, depth, numberAsFloat) {
|
|
115
|
+
if (depth === 0) {
|
|
116
|
+
throw new Error('Could not stringify the object: maximum object depth exceeded');
|
|
117
|
+
}
|
|
118
|
+
let res = '';
|
|
119
|
+
for (let i = 0; i < array.length; i++) {
|
|
120
|
+
res += `${res && '\n'}[[${key}]]\n`;
|
|
121
|
+
res += stringifyTable(0, array[i], key, depth, numberAsFloat);
|
|
122
|
+
}
|
|
123
|
+
return res;
|
|
149
124
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
125
|
+
function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {
|
|
126
|
+
if (depth === 0) {
|
|
127
|
+
throw new Error('Could not stringify the object: maximum object depth exceeded');
|
|
128
|
+
}
|
|
129
|
+
let preamble = '';
|
|
130
|
+
let tables = '';
|
|
131
|
+
let keys = Object.keys(obj);
|
|
132
|
+
for (let i = 0; i < keys.length; i++) {
|
|
133
|
+
let k = keys[i];
|
|
134
|
+
if (obj[k] !== null && obj[k] !== void 0) {
|
|
135
|
+
let type = extendedTypeOf(obj[k]);
|
|
136
|
+
if (type === 'symbol' || type === 'function') {
|
|
137
|
+
throw new TypeError(`cannot serialize values of type '${type}'`);
|
|
138
|
+
}
|
|
139
|
+
let key = BARE_KEY.test(k) ? k : formatString(k);
|
|
140
|
+
if (type === 'array' && isArrayOfTables(obj[k])) {
|
|
141
|
+
tables += (tables && '\n') + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);
|
|
142
|
+
}
|
|
143
|
+
else if (type === 'object') {
|
|
144
|
+
let tblKey = prefix ? `${prefix}.${key}` : key;
|
|
145
|
+
tables += (tables && '\n') + stringifyTable(tblKey, obj[k], tblKey, depth - 1, numberAsFloat);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
preamble += key;
|
|
149
|
+
preamble += ' = ';
|
|
150
|
+
preamble += stringifyValue(obj[k], type, depth, numberAsFloat);
|
|
151
|
+
preamble += '\n';
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (tableKey && (preamble || !tables)) // Create table only if necessary
|
|
156
|
+
preamble = preamble ? `[${tableKey}]\n${preamble}` : `[${tableKey}]`;
|
|
157
|
+
return preamble && tables
|
|
158
|
+
? `${preamble}\n${tables}`
|
|
159
|
+
: preamble || tables;
|
|
163
160
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return {
|
|
173
|
-
isInstalled: false,
|
|
174
|
-
coreSkillsLoaded: false,
|
|
175
|
-
loadedSkills: [],
|
|
176
|
-
needsActivation: true,
|
|
177
|
-
lastActivation: void 0
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
const loadResults = await loadCoreSkills(lang);
|
|
182
|
-
const successfulLoads = loadResults.filter((r) => r.success);
|
|
183
|
-
const allCoreSkillsLoaded = successfulLoads.length === loadResults.length;
|
|
184
|
-
const newStatus = {
|
|
185
|
-
isInstalled: true,
|
|
186
|
-
coreSkillsLoaded: allCoreSkillsLoaded,
|
|
187
|
-
loadedSkills: successfulLoads.map((r) => r.skill),
|
|
188
|
-
needsActivation: false,
|
|
189
|
-
lastActivation: (/* @__PURE__ */ new Date()).toISOString()
|
|
190
|
-
};
|
|
191
|
-
saveActivationState(newStatus);
|
|
192
|
-
return newStatus;
|
|
161
|
+
function stringify(obj, { maxDepth = 1000, numbersAsFloat = false } = {}) {
|
|
162
|
+
if (extendedTypeOf(obj) !== 'object') {
|
|
163
|
+
throw new TypeError('stringify can only be called with an object');
|
|
164
|
+
}
|
|
165
|
+
let str = stringifyTable(0, obj, '', maxDepth, numbersAsFloat);
|
|
166
|
+
if (str[str.length - 1] !== '\n')
|
|
167
|
+
return str + '\n';
|
|
168
|
+
return str;
|
|
193
169
|
}
|
|
194
170
|
|
|
195
|
-
export {
|
|
171
|
+
export { stringify };
|