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.
Files changed (161) hide show
  1. package/dist/chunks/agent-teams.mjs +17 -18
  2. package/dist/chunks/agent.mjs +105 -102
  3. package/dist/chunks/agents.mjs +87 -77
  4. package/dist/chunks/api-cli.mjs +41 -27
  5. package/dist/chunks/api-providers.mjs +2 -4
  6. package/dist/chunks/api.mjs +22 -11
  7. package/dist/chunks/auto-bootstrap.mjs +3 -5
  8. package/dist/chunks/auto-init.mjs +3 -4
  9. package/dist/chunks/auto-updater.mjs +103 -91
  10. package/dist/chunks/banner.mjs +41 -42
  11. package/dist/chunks/boost.mjs +30 -31
  12. package/dist/chunks/ccjk-agents.mjs +6 -9
  13. package/dist/chunks/ccjk-all.mjs +703 -85
  14. package/dist/chunks/ccjk-config.mjs +6 -6
  15. package/dist/chunks/ccjk-hooks.mjs +20 -9
  16. package/dist/chunks/ccjk-mcp.mjs +64 -52
  17. package/dist/chunks/ccjk-setup.mjs +35 -25
  18. package/dist/chunks/ccjk-skills.mjs +51 -41
  19. package/dist/chunks/ccr.mjs +42 -32
  20. package/dist/chunks/ccu.mjs +16 -12
  21. package/dist/chunks/check-updates.mjs +30 -19
  22. package/dist/chunks/claude-code-config-manager.mjs +25 -10
  23. package/dist/chunks/claude-code-incremental-manager.mjs +65 -51
  24. package/dist/chunks/claude-config.mjs +2 -2
  25. package/dist/chunks/claude-wrapper.mjs +9 -6
  26. package/dist/chunks/cleanup-migration.mjs +1 -1
  27. package/dist/chunks/cli-hook.mjs +10 -3
  28. package/dist/chunks/cloud-sync.mjs +1 -1
  29. package/dist/chunks/codex-config-switch.mjs +58 -45
  30. package/dist/chunks/codex-provider-manager.mjs +29 -16
  31. package/dist/chunks/codex-uninstaller.mjs +5 -6
  32. package/dist/chunks/codex.mjs +89 -89
  33. package/dist/chunks/commands.mjs +28 -29
  34. package/dist/chunks/commands2.mjs +4 -3
  35. package/dist/chunks/commit.mjs +42 -23
  36. package/dist/chunks/completion.mjs +46 -47
  37. package/dist/chunks/config-consolidator.mjs +12 -13
  38. package/dist/chunks/config-switch.mjs +66 -53
  39. package/dist/chunks/config.mjs +10 -10
  40. package/dist/chunks/config2.mjs +53 -42
  41. package/dist/chunks/config3.mjs +107 -93
  42. package/dist/chunks/constants.mjs +2 -4
  43. package/dist/chunks/context-loader.mjs +5 -4
  44. package/dist/chunks/context.mjs +77 -76
  45. package/dist/chunks/convoy-manager.mjs +4 -4
  46. package/dist/chunks/dashboard.mjs +28 -29
  47. package/dist/chunks/doctor.mjs +68 -54
  48. package/dist/chunks/evolution.mjs +37 -38
  49. package/dist/chunks/features.mjs +103 -92
  50. package/dist/chunks/fs-operations.mjs +1 -1
  51. package/dist/chunks/health-alerts.mjs +1 -1
  52. package/dist/chunks/health-check.mjs +1 -1
  53. package/dist/chunks/help.mjs +117 -116
  54. package/dist/chunks/hook-installer.mjs +3 -2
  55. package/dist/chunks/index.mjs +20 -6
  56. package/dist/chunks/index10.mjs +1171 -0
  57. package/dist/chunks/index11.mjs +1008 -0
  58. package/dist/chunks/index12.mjs +193 -0
  59. package/dist/chunks/index13.mjs +218 -0
  60. package/dist/chunks/index14.mjs +663 -0
  61. package/dist/chunks/index2.mjs +19 -10
  62. package/dist/chunks/index3.mjs +19079 -164
  63. package/dist/chunks/index4.mjs +8 -1171
  64. package/dist/chunks/index5.mjs +7479 -884
  65. package/dist/chunks/index6.mjs +160 -184
  66. package/dist/chunks/index7.mjs +3573 -653
  67. package/dist/chunks/index8.mjs +19 -0
  68. package/dist/chunks/index9.mjs +616 -0
  69. package/dist/chunks/init.mjs +173 -173
  70. package/dist/chunks/installer.mjs +92 -82
  71. package/dist/chunks/installer2.mjs +3 -2
  72. package/dist/chunks/interview.mjs +118 -107
  73. package/dist/chunks/json-config.mjs +3 -2
  74. package/dist/chunks/linux.mjs +3863 -0
  75. package/dist/chunks/macos.mjs +69 -0
  76. package/dist/chunks/main.mjs +635 -0
  77. package/dist/chunks/marketplace.mjs +69 -66
  78. package/dist/chunks/mcp-cli.mjs +61 -48
  79. package/dist/chunks/mcp.mjs +140 -127
  80. package/dist/chunks/menu.mjs +85 -85
  81. package/dist/chunks/metrics-display.mjs +41 -40
  82. package/dist/chunks/migrator.mjs +4 -5
  83. package/dist/chunks/monitor.mjs +95 -95
  84. package/dist/chunks/notification.mjs +151 -141
  85. package/dist/chunks/onboarding.mjs +26 -15
  86. package/dist/chunks/package.mjs +1 -1
  87. package/dist/chunks/paradigm.mjs +24 -23
  88. package/dist/chunks/permission-manager.mjs +10 -11
  89. package/dist/chunks/permissions.mjs +72 -57
  90. package/dist/chunks/persistence-manager.mjs +97 -84
  91. package/dist/chunks/persistence.mjs +1 -1
  92. package/dist/chunks/platform.mjs +29 -29
  93. package/dist/chunks/plugin.mjs +104 -105
  94. package/dist/chunks/prompts.mjs +36 -25
  95. package/dist/chunks/providers.mjs +68 -69
  96. package/dist/chunks/quick-actions.mjs +71 -72
  97. package/dist/chunks/quick-provider.mjs +56 -40
  98. package/dist/chunks/quick-setup.mjs +71 -60
  99. package/dist/chunks/remote.mjs +21 -12
  100. package/dist/chunks/session.mjs +116 -103
  101. package/dist/chunks/sessions.mjs +29 -28
  102. package/dist/chunks/silent-updater.mjs +8 -10
  103. package/dist/chunks/simple-config.mjs +13 -10
  104. package/dist/chunks/skill.mjs +8560 -103
  105. package/dist/chunks/skills-sync.mjs +5212 -79
  106. package/dist/chunks/skills.mjs +105 -94
  107. package/dist/chunks/slash-commands.mjs +36 -37
  108. package/dist/chunks/smart-defaults.mjs +7 -3
  109. package/dist/chunks/smart-guide.mjs +1 -1
  110. package/dist/chunks/startup.mjs +2 -4
  111. package/dist/chunks/stats.mjs +41 -42
  112. package/dist/chunks/status.mjs +49 -50
  113. package/dist/chunks/team.mjs +24 -12
  114. package/dist/chunks/thinking.mjs +74 -63
  115. package/dist/chunks/trace.mjs +20 -19
  116. package/dist/chunks/uninstall.mjs +69 -56
  117. package/dist/chunks/update.mjs +39 -28
  118. package/dist/chunks/upgrade-manager.mjs +24 -18
  119. package/dist/chunks/version-checker.mjs +45 -41
  120. package/dist/chunks/vim.mjs +81 -69
  121. package/dist/chunks/windows.mjs +14 -0
  122. package/dist/chunks/workflows.mjs +15 -15
  123. package/dist/chunks/wsl.mjs +129 -0
  124. package/dist/chunks/zero-config.mjs +45 -34
  125. package/dist/cli.mjs +20 -20
  126. package/dist/index.mjs +41 -31
  127. package/dist/shared/ccjk.BAGoDD49.mjs +36 -0
  128. package/dist/shared/ccjk.BBtCGd_g.mjs +899 -0
  129. package/dist/shared/{ccjk.CGcy7cNM.mjs → ccjk.BDKUdmLk.mjs} +1 -1
  130. package/dist/shared/{ccjk.DtMBiwVG.mjs → ccjk.BFxsJM0k.mjs} +1 -1
  131. package/dist/shared/{ccjk.j4uut26D.mjs → ccjk.BIxuVL3_.mjs} +5 -5
  132. package/dist/shared/ccjk.BRZ9ww8S.mjs +142 -0
  133. package/dist/shared/{ccjk.CN0edl87.mjs → ccjk.BSYWk9ML.mjs} +1 -1
  134. package/dist/shared/{ccjk.Dk1HDseQ.mjs → ccjk.BnpWvs9V.mjs} +75 -75
  135. package/dist/shared/ccjk.BoApaI4j.mjs +28 -0
  136. package/dist/shared/{ccjk.DKojSRzw.mjs → ccjk.BrPUmTqm.mjs} +1 -1
  137. package/dist/shared/{ccjk.C10pepYx.mjs → ccjk.BxSmJ8B7.mjs} +1 -1
  138. package/dist/shared/ccjk.Bx_rmYfN.mjs +69 -0
  139. package/dist/shared/ccjk.COweQ1RR.mjs +5 -0
  140. package/dist/shared/{ccjk.BN90X6oc.mjs → ccjk.CePkJq2S.mjs} +17 -17
  141. package/dist/shared/{ccjk.Bvoex4TZ.mjs → ccjk.CfKKcvWy.mjs} +1 -1
  142. package/dist/shared/ccjk.Cjgrln_h.mjs +297 -0
  143. package/dist/shared/ccjk.CxpGa6MC.mjs +2724 -0
  144. package/dist/shared/{ccjk.DfwJOEok.mjs → ccjk.D5MFQT7w.mjs} +1 -1
  145. package/dist/shared/{ccjk.cChAaGgT.mjs → ccjk.DG_o24cZ.mjs} +6 -6
  146. package/dist/shared/{ccjk.bhFAMRyc.mjs → ccjk.DLLw-h4Y.mjs} +32 -32
  147. package/dist/shared/ccjk.DOwtZMk8.mjs +4019 -0
  148. package/dist/shared/{ccjk.BsXQugfY.mjs → ccjk.DTdjs-qK.mjs} +13 -13
  149. package/dist/shared/{ccjk.Bdhyg3X-.mjs → ccjk.DsYaCCx4.mjs} +1 -1
  150. package/dist/shared/ccjk.KfSWcGlE.mjs +38 -0
  151. package/dist/shared/ccjk.RyizuzOI.mjs +21 -0
  152. package/dist/shared/{ccjk.h7_W-wTs.mjs → ccjk.SPoXMvZD.mjs} +1 -1
  153. package/dist/shared/ccjk.T_cX87dY.mjs +15 -0
  154. package/dist/shared/{ccjk.CrB6OYHv.mjs → ccjk._dESH4Rk.mjs} +2 -2
  155. package/dist/shared/ccjk.bQ7Dh1g4.mjs +249 -0
  156. package/dist/shared/{ccjk.CBhIZiPz.mjs → ccjk.hoqrwWdN.mjs} +1 -1
  157. package/dist/shared/{ccjk.BNwRnWYx.mjs → ccjk.s7OCVzdd.mjs} +1230 -33
  158. package/dist/shared/{ccjk.BOIUTf5z.mjs → ccjk.waa2ikKJ.mjs} +8 -9
  159. package/package.json +31 -30
  160. package/dist/shared/ccjk.DHbrGcgg.mjs +0 -13
  161. package/dist/shared/ccjk.DntgA8fQ.mjs +0 -42
@@ -1,195 +1,171 @@
1
- import { existsSync, readFileSync, writeFileSync } from 'node:fs';
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
- const CORE_SKILLS = [
15
- "agent-browser",
16
- "tdd",
17
- "debugging",
18
- "code-review",
19
- "git-worktrees"
20
- ];
21
-
22
- function getSuperpowersDir$1() {
23
- return join(homedir(), ".claude", "plugins", "superpowers");
24
- }
25
- function isSuperpowersInstalled() {
26
- const superpowersDir = getSuperpowersDir$1();
27
- return existsSync(superpowersDir) && existsSync(join(superpowersDir, "skills"));
28
- }
29
- function areCoreSkillsInstalled() {
30
- const skillsDir = join(getSuperpowersDir$1(), "skills");
31
- if (!existsSync(skillsDir)) {
32
- return false;
33
- }
34
- for (const skill of CORE_SKILLS) {
35
- const skillPath = join(skillsDir, skill);
36
- if (!existsSync(skillPath) || !existsSync(join(skillPath, "skill.json"))) {
37
- return false;
38
- }
39
- }
40
- return true;
41
- }
42
- async function autoInstallSuperpowers(lang = "zh-CN") {
43
- try {
44
- if (isSuperpowersInstalled() && areCoreSkillsInstalled()) {
45
- return true;
46
- }
47
- const result = await installSuperpowers({
48
- lang,
49
- skipPrompt: true
50
- // Skip user prompts for silent installation
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
- async function loadSkill(skillName) {
75
- try {
76
- if (!isSkillInstalled(skillName)) {
77
- return {
78
- skill: skillName,
79
- success: false,
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
- async function loadCoreSkills(_lang = "zh-CN") {
105
- const results = await Promise.all(
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
- function getActivationStatePath() {
120
- return join(homedir(), ".claude", "plugins", "superpowers", ".activation-state.json");
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 getSuperpowersDir() {
123
- return join(homedir(), ".claude", "plugins", "superpowers");
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 loadActivationState() {
126
- try {
127
- const statePath = getActivationStatePath();
128
- if (!existsSync(statePath)) {
129
- return null;
130
- }
131
- const stateJson = readFileSync(statePath, "utf-8");
132
- return JSON.parse(stateJson);
133
- } catch (error) {
134
- if (process__default.env.DEBUG) {
135
- console.error("[Zero-Config] Failed to load activation state:", error);
136
- }
137
- return null;
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 saveActivationState(status) {
141
- try {
142
- const statePath = getActivationStatePath();
143
- writeFileSync(statePath, JSON.stringify(status, null, 2), "utf-8");
144
- } catch (error) {
145
- if (process__default.env.DEBUG) {
146
- console.error("[Zero-Config] Failed to save activation state:", error);
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 checkActivationStatus() {
151
- const superpowersInstalled = existsSync(getSuperpowersDir());
152
- const savedState = loadActivationState();
153
- if (savedState) {
154
- return savedState;
155
- }
156
- return {
157
- isInstalled: superpowersInstalled,
158
- coreSkillsLoaded: false,
159
- loadedSkills: [],
160
- needsActivation: true,
161
- lastActivation: void 0
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
- async function activateSuperpowers(lang = "zh-CN") {
165
- const currentStatus = checkActivationStatus();
166
- if (!currentStatus.needsActivation) {
167
- return currentStatus;
168
- }
169
- if (!currentStatus.isInstalled) {
170
- const installSuccess = await autoInstallSuperpowers(lang);
171
- if (!installSuccess) {
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 { activateSuperpowers, autoInstallSuperpowers, checkActivationStatus, loadCoreSkills, loadSkill };
171
+ export { stringify };