@aliyunrds/ctxdb 0.0.3 → 0.0.4
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/cli/main.js +23 -1
- package/package.json +1 -1
package/dist/cli/main.js
CHANGED
|
@@ -100,6 +100,10 @@ function isSetupResult(v) {
|
|
|
100
100
|
if (typeof v !== "object" || v === null) return false;
|
|
101
101
|
return "steps" in v && Array.isArray(v.steps);
|
|
102
102
|
}
|
|
103
|
+
function isUpgradeResult(v) {
|
|
104
|
+
if (typeof v !== "object" || v === null) return false;
|
|
105
|
+
return "agents" in v && typeof v.agents === "object" && !("steps" in v);
|
|
106
|
+
}
|
|
103
107
|
function isStatusResult(v) {
|
|
104
108
|
if (typeof v !== "object" || v === null) return false;
|
|
105
109
|
return "agent" in v && "connected" in v;
|
|
@@ -115,6 +119,22 @@ function formatSetupResult(r) {
|
|
|
115
119
|
}
|
|
116
120
|
return lines.join("\n");
|
|
117
121
|
}
|
|
122
|
+
function formatUpgradeResult(r) {
|
|
123
|
+
const lines = [];
|
|
124
|
+
const agentNames = Object.keys(r.agents);
|
|
125
|
+
lines.push(`${r.ok ? CHECK : CROSS} ${BOLD}ctxdb upgrade${RESET} ${r.ok ? "completed" : "failed"} ${DIM}(${agentNames.length} agent${agentNames.length > 1 ? "s" : ""})${RESET}
|
|
126
|
+
`);
|
|
127
|
+
for (const [name, result] of Object.entries(r.agents)) {
|
|
128
|
+
const icon = result.ok ? CHECK : CROSS;
|
|
129
|
+
lines.push(` ${icon} ${BOLD}${name}${RESET}`);
|
|
130
|
+
for (const s of result.steps) {
|
|
131
|
+
const sIcon = s.ok ? CHECK : CROSS;
|
|
132
|
+
const detail = s.detail ? ` ${DIM}${s.detail}${RESET}` : "";
|
|
133
|
+
lines.push(` ${sIcon} ${s.step}${detail}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return lines.join("\n");
|
|
137
|
+
}
|
|
118
138
|
function formatStatusResult(r) {
|
|
119
139
|
const lines = [];
|
|
120
140
|
const ok = r.connected ? CHECK : CROSS;
|
|
@@ -143,6 +163,8 @@ function formatStatusResult(r) {
|
|
|
143
163
|
function printResult(value, json) {
|
|
144
164
|
if (json) {
|
|
145
165
|
process.stdout.write(JSON.stringify(value, null, 2) + "\n");
|
|
166
|
+
} else if (isUpgradeResult(value)) {
|
|
167
|
+
process.stdout.write(formatUpgradeResult(value) + "\n");
|
|
146
168
|
} else if (isSetupResult(value)) {
|
|
147
169
|
process.stdout.write(formatSetupResult(value) + "\n");
|
|
148
170
|
} else if (isStatusResult(value)) {
|
|
@@ -178,7 +200,7 @@ function fail(message, code = 1) {
|
|
|
178
200
|
`);
|
|
179
201
|
process.exit(code);
|
|
180
202
|
}
|
|
181
|
-
var PACKAGE_VERSION = "0.0.
|
|
203
|
+
var PACKAGE_VERSION = "0.0.4";
|
|
182
204
|
|
|
183
205
|
// src/setup/installer.ts
|
|
184
206
|
import {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliyunrds/ctxdb",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Unified access layer for RDS ContextDatabase: `ctxdb` CLI (memory + KB ops), one-shot `setup --agent <qoder|codex|claude>` installer, per-agent config, hooks, and SKILL.md.",
|
|
6
6
|
"license": "Apache-2.0",
|