@jsonstudio/rcc 0.89.1136 → 0.89.1189
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/build-info.js +2 -2
- package/dist/cli/commands/clean.d.ts +16 -0
- package/dist/cli/commands/clean.js +58 -0
- package/dist/cli/commands/clean.js.map +1 -0
- package/dist/cli/commands/code.d.ts +55 -0
- package/dist/cli/commands/code.js +376 -0
- package/dist/cli/commands/code.js.map +1 -0
- package/dist/cli/commands/config.d.ts +31 -0
- package/dist/cli/commands/config.js +168 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/env.d.ts +20 -0
- package/dist/cli/commands/env.js +73 -0
- package/dist/cli/commands/env.js.map +1 -0
- package/dist/cli/commands/examples.d.ts +5 -0
- package/dist/cli/commands/examples.js +66 -0
- package/dist/cli/commands/examples.js.map +1 -0
- package/dist/cli/commands/port.d.ts +24 -0
- package/dist/cli/commands/port.js +85 -0
- package/dist/cli/commands/port.js.map +1 -0
- package/dist/cli/commands/restart.d.ts +50 -0
- package/dist/cli/commands/restart.js +176 -0
- package/dist/cli/commands/restart.js.map +1 -0
- package/dist/cli/commands/start.d.ts +68 -0
- package/dist/cli/commands/start.js +295 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/status.d.ts +16 -0
- package/dist/cli/commands/status.js +104 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/stop.d.ts +35 -0
- package/dist/cli/commands/stop.js +95 -0
- package/dist/cli/commands/stop.js.map +1 -0
- package/dist/cli/logger.d.ts +8 -0
- package/dist/cli/logger.js +9 -0
- package/dist/cli/logger.js.map +1 -0
- package/dist/cli/main.d.ts +6 -0
- package/dist/cli/main.js +16 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/program.d.ts +8 -0
- package/dist/cli/program.js +16 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli/register/basic-commands.d.ts +30 -0
- package/dist/cli/register/basic-commands.js +11 -0
- package/dist/cli/register/basic-commands.js.map +1 -0
- package/dist/cli/register/code-command.d.ts +3 -0
- package/dist/cli/register/code-command.js +5 -0
- package/dist/cli/register/code-command.js.map +1 -0
- package/dist/cli/register/restart-command.d.ts +3 -0
- package/dist/cli/register/restart-command.js +5 -0
- package/dist/cli/register/restart-command.js.map +1 -0
- package/dist/cli/register/start-command.d.ts +3 -0
- package/dist/cli/register/start-command.js +5 -0
- package/dist/cli/register/start-command.js.map +1 -0
- package/dist/cli/register/status-config-commands.d.ts +16 -0
- package/dist/cli/register/status-config-commands.js +7 -0
- package/dist/cli/register/status-config-commands.js.map +1 -0
- package/dist/cli/register/stop-command.d.ts +3 -0
- package/dist/cli/register/stop-command.js +5 -0
- package/dist/cli/register/stop-command.js.map +1 -0
- package/dist/cli/runtime.d.ts +5 -0
- package/dist/cli/runtime.js +11 -0
- package/dist/cli/runtime.js.map +1 -0
- package/dist/cli/server/port-utils.d.ts +52 -0
- package/dist/cli/server/port-utils.js +193 -0
- package/dist/cli/server/port-utils.js.map +1 -0
- package/dist/cli/spinner.d.ts +10 -0
- package/dist/cli/spinner.js +59 -0
- package/dist/cli/spinner.js.map +1 -0
- package/dist/cli/utils/normalize.d.ts +2 -0
- package/dist/cli/utils/normalize.js +22 -0
- package/dist/cli/utils/normalize.js.map +1 -0
- package/dist/cli/utils/safe-read-json.d.ts +1 -0
- package/dist/cli/utils/safe-read-json.js +11 -0
- package/dist/cli/utils/safe-read-json.js.map +1 -0
- package/dist/cli.js +148 -1775
- package/dist/cli.js.map +1 -1
- package/dist/client/anthropic/anthropic-protocol-client.js +4 -3
- package/dist/client/anthropic/anthropic-protocol-client.js.map +1 -1
- package/dist/client/gemini-cli/gemini-cli-protocol-client.d.ts +1 -1
- package/dist/client/gemini-cli/gemini-cli-protocol-client.js +10 -3
- package/dist/client/gemini-cli/gemini-cli-protocol-client.js.map +1 -1
- package/dist/commands/quota-daemon.js +2 -2
- package/dist/commands/quota-daemon.js.map +1 -1
- package/dist/config/provider-v2-loader.js +4 -2
- package/dist/config/provider-v2-loader.js.map +1 -1
- package/dist/manager/modules/quota/index.js +21 -4
- package/dist/manager/modules/quota/index.js.map +1 -1
- package/dist/manager/modules/routing/index.js.map +1 -1
- package/dist/manager/storage/file-store.js +1 -1
- package/dist/manager/storage/file-store.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle.js +2 -2
- package/dist/providers/auth/oauth-lifecycle.js.map +1 -1
- package/dist/providers/core/api/provider-config.d.ts +2 -0
- package/dist/providers/core/api/provider-types.d.ts +2 -0
- package/dist/providers/core/runtime/base-provider.js +21 -27
- package/dist/providers/core/runtime/base-provider.js.map +1 -1
- package/dist/providers/core/runtime/gemini-cli-http-provider.d.ts +1 -0
- package/dist/providers/core/runtime/gemini-cli-http-provider.js +37 -5
- package/dist/providers/core/runtime/gemini-cli-http-provider.js.map +1 -1
- package/dist/providers/core/runtime/http-request-executor.js +23 -29
- package/dist/providers/core/runtime/http-request-executor.js.map +1 -1
- package/dist/providers/core/runtime/http-transport-provider.js +20 -0
- package/dist/providers/core/runtime/http-transport-provider.js.map +1 -1
- package/dist/providers/core/utils/http-client.d.ts +9 -0
- package/dist/providers/core/utils/http-client.js +9 -11
- package/dist/providers/core/utils/http-client.js.map +1 -1
- package/dist/providers/core/utils/provider-error-reporter.js +2 -6
- package/dist/providers/core/utils/provider-error-reporter.js.map +1 -1
- package/dist/providers/mock/mock-provider-runtime.js +19 -5
- package/dist/providers/mock/mock-provider-runtime.js.map +1 -1
- package/dist/server/runtime/http-server/index.d.ts +1 -0
- package/dist/server/runtime/http-server/index.js +70 -11
- package/dist/server/runtime/http-server/index.js.map +1 -1
- package/dist/server/runtime/http-server/request-executor.js +9 -1
- package/dist/server/runtime/http-server/request-executor.js.map +1 -1
- package/dist/server/runtime/http-server/routes.js +8 -4
- package/dist/server/runtime/http-server/routes.js.map +1 -1
- package/dist/server/runtime/http-server/stats-manager.js +9 -3
- package/dist/server/runtime/http-server/stats-manager.js.map +1 -1
- package/package.json +10 -4
- package/scripts/anthropic-compare-modes.mjs +40 -3
- package/scripts/antigravity-smoke.mjs +180 -0
- package/scripts/backfill-apply-patch-exec-errorsamples.mjs +225 -0
- package/scripts/compare-codex-rccx.mjs +59 -1
- package/scripts/compare-responses-request.mjs +50 -4
- package/scripts/lib/errorsamples.mjs +23 -0
- package/scripts/mock-provider/run-regressions.mjs +12 -2
- package/scripts/policy-violations-report.mjs +257 -0
- package/scripts/publish-rcc.mjs +16 -2
- package/scripts/tests/unified-hub-responses-enforce-safe.mjs +37 -0
- package/scripts/tests/unified-hub-shadow-regression.mjs +55 -0
- package/scripts/unified-hub-shadow-compare.mjs +359 -0
- package/scripts/verify-e2e-gemini-followup-sample.mjs +269 -0
- package/scripts/virtual-router-shadow-v2-real.mjs +71 -1
- package/scripts/virtual-router-shadow-v2.mjs +41 -0
|
@@ -15,6 +15,7 @@ import fs from 'node:fs/promises';
|
|
|
15
15
|
import os from 'node:os';
|
|
16
16
|
import path from 'node:path';
|
|
17
17
|
import { fileURLToPath } from 'node:url';
|
|
18
|
+
import { writeErrorSampleJson } from './lib/errorsamples.mjs';
|
|
18
19
|
|
|
19
20
|
async function resolveConfigPath() {
|
|
20
21
|
const explicit = process.env.ROUTECODEX_CONFIG || process.env.RCC_CONFIG;
|
|
@@ -47,6 +48,18 @@ function diffKeys(a, b) {
|
|
|
47
48
|
return { onlyA, onlyB };
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
function redactSecrets(value) {
|
|
52
|
+
const secretKeyRe = /key|token|secret|password|authorization/i;
|
|
53
|
+
if (Array.isArray(value)) return value.map(redactSecrets);
|
|
54
|
+
if (!value || typeof value !== 'object') return value;
|
|
55
|
+
const out = {};
|
|
56
|
+
for (const [k, v] of Object.entries(value)) {
|
|
57
|
+
if (secretKeyRe.test(k)) out[k] = '[REDACTED]';
|
|
58
|
+
else out[k] = redactSecrets(v);
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
|
|
50
63
|
async function main() {
|
|
51
64
|
const __filename = fileURLToPath(import.meta.url);
|
|
52
65
|
const __dirname = path.dirname(__filename);
|
|
@@ -66,6 +79,19 @@ async function main() {
|
|
|
66
79
|
'[virtual-router-shadow-v2-real] Failed to load dist modules. Please run `npm run build` or tsc first.',
|
|
67
80
|
error instanceof Error ? error.message : String(error)
|
|
68
81
|
);
|
|
82
|
+
try {
|
|
83
|
+
const file = await writeErrorSampleJson({
|
|
84
|
+
group: 'virtual-router-shadow-v2-real',
|
|
85
|
+
kind: 'fatal',
|
|
86
|
+
payload: {
|
|
87
|
+
kind: 'virtual-router-shadow-v2-real-fatal',
|
|
88
|
+
stamp: new Date().toISOString(),
|
|
89
|
+
error: String(error instanceof Error ? error.stack || error.message : String(error))
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
// eslint-disable-next-line no-console
|
|
93
|
+
console.error(`[virtual-router-shadow-v2-real] wrote errorsample: ${file}`);
|
|
94
|
+
} catch {}
|
|
69
95
|
process.exitCode = 1;
|
|
70
96
|
return;
|
|
71
97
|
}
|
|
@@ -79,6 +105,19 @@ async function main() {
|
|
|
79
105
|
'[virtual-router-shadow-v2-real] Failed to load user config:',
|
|
80
106
|
error instanceof Error ? error.message : String(error)
|
|
81
107
|
);
|
|
108
|
+
try {
|
|
109
|
+
const file = await writeErrorSampleJson({
|
|
110
|
+
group: 'virtual-router-shadow-v2-real',
|
|
111
|
+
kind: 'fatal',
|
|
112
|
+
payload: {
|
|
113
|
+
kind: 'virtual-router-shadow-v2-real-fatal',
|
|
114
|
+
stamp: new Date().toISOString(),
|
|
115
|
+
error: String(error instanceof Error ? error.stack || error.message : String(error))
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
// eslint-disable-next-line no-console
|
|
119
|
+
console.error(`[virtual-router-shadow-v2-real] wrote errorsample: ${file}`);
|
|
120
|
+
} catch {}
|
|
82
121
|
process.exitCode = 1;
|
|
83
122
|
return;
|
|
84
123
|
}
|
|
@@ -131,6 +170,29 @@ async function main() {
|
|
|
131
170
|
console.log('[virtual-router-shadow-v2-real] routing equal:', routingEqual);
|
|
132
171
|
|
|
133
172
|
if (!providersEqual || !providerPayloadEqual || !routingEqual) {
|
|
173
|
+
try {
|
|
174
|
+
const file = await writeErrorSampleJson({
|
|
175
|
+
group: 'virtual-router-shadow-v2-real',
|
|
176
|
+
kind: 'diff',
|
|
177
|
+
payload: {
|
|
178
|
+
kind: 'virtual-router-shadow-v2-real-diff',
|
|
179
|
+
stamp: new Date().toISOString(),
|
|
180
|
+
configPath: await resolveConfigPath(),
|
|
181
|
+
providerKeyDiff,
|
|
182
|
+
providersEqual,
|
|
183
|
+
providerPayloadEqual,
|
|
184
|
+
routingEqual,
|
|
185
|
+
v1ProvidersKeys: Object.keys(v1Providers),
|
|
186
|
+
v2ProvidersKeys: Object.keys(v2Providers),
|
|
187
|
+
v1Routing: redactSecrets(v1Input.routing || {}),
|
|
188
|
+
v2Routing: redactSecrets(v2Input.routing || {}),
|
|
189
|
+
v1Providers: redactSecrets(v1Providers),
|
|
190
|
+
v2Providers: redactSecrets(v2Providers)
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
// eslint-disable-next-line no-console
|
|
194
|
+
console.error(`[virtual-router-shadow-v2-real] wrote errorsample: ${file}`);
|
|
195
|
+
} catch {}
|
|
134
196
|
process.exitCode = 1;
|
|
135
197
|
}
|
|
136
198
|
}
|
|
@@ -138,6 +200,14 @@ async function main() {
|
|
|
138
200
|
main().catch((error) => {
|
|
139
201
|
// eslint-disable-next-line no-console
|
|
140
202
|
console.error('[virtual-router-shadow-v2-real] failed:', error);
|
|
203
|
+
void writeErrorSampleJson({
|
|
204
|
+
group: 'virtual-router-shadow-v2-real',
|
|
205
|
+
kind: 'fatal',
|
|
206
|
+
payload: {
|
|
207
|
+
kind: 'virtual-router-shadow-v2-real-fatal',
|
|
208
|
+
stamp: new Date().toISOString(),
|
|
209
|
+
error: String(error instanceof Error ? error.stack || error.message : String(error))
|
|
210
|
+
}
|
|
211
|
+
}).catch(() => {});
|
|
141
212
|
process.exit(1);
|
|
142
213
|
});
|
|
143
|
-
|
|
@@ -15,6 +15,7 @@ import fs from 'node:fs/promises';
|
|
|
15
15
|
import os from 'node:os';
|
|
16
16
|
import path from 'node:path';
|
|
17
17
|
import { fileURLToPath } from 'node:url';
|
|
18
|
+
import { writeErrorSampleJson } from './lib/errorsamples.mjs';
|
|
18
19
|
|
|
19
20
|
async function main() {
|
|
20
21
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -38,6 +39,19 @@ async function main() {
|
|
|
38
39
|
'[virtual-router-shadow-v2] Failed to load dist modules. Please run `npm run build` first.',
|
|
39
40
|
error instanceof Error ? error.message : String(error)
|
|
40
41
|
);
|
|
42
|
+
try {
|
|
43
|
+
const file = await writeErrorSampleJson({
|
|
44
|
+
group: 'virtual-router-shadow-v2',
|
|
45
|
+
kind: 'fatal',
|
|
46
|
+
payload: {
|
|
47
|
+
kind: 'virtual-router-shadow-v2-fatal',
|
|
48
|
+
stamp: new Date().toISOString(),
|
|
49
|
+
error: String(error instanceof Error ? error.stack || error.message : String(error))
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
// eslint-disable-next-line no-console
|
|
53
|
+
console.error(`[virtual-router-shadow-v2] wrote errorsample: ${file}`);
|
|
54
|
+
} catch {}
|
|
41
55
|
process.exitCode = 1;
|
|
42
56
|
return;
|
|
43
57
|
}
|
|
@@ -111,6 +125,24 @@ async function main() {
|
|
|
111
125
|
console.log('[virtual-router-shadow-v2] routing equal:', routingEqual);
|
|
112
126
|
|
|
113
127
|
if (!providersEqual || !routingEqual) {
|
|
128
|
+
try {
|
|
129
|
+
const file = await writeErrorSampleJson({
|
|
130
|
+
group: 'virtual-router-shadow-v2',
|
|
131
|
+
kind: 'diff',
|
|
132
|
+
payload: {
|
|
133
|
+
kind: 'virtual-router-shadow-v2-diff',
|
|
134
|
+
stamp: new Date().toISOString(),
|
|
135
|
+
v1Providers,
|
|
136
|
+
v2Providers,
|
|
137
|
+
providersEqual,
|
|
138
|
+
routingEqual,
|
|
139
|
+
v1Routing: v1Input.routing,
|
|
140
|
+
v2Routing: v2Input.routing
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
// eslint-disable-next-line no-console
|
|
144
|
+
console.error(`[virtual-router-shadow-v2] wrote errorsample: ${file}`);
|
|
145
|
+
} catch {}
|
|
114
146
|
process.exitCode = 1;
|
|
115
147
|
}
|
|
116
148
|
}
|
|
@@ -118,5 +150,14 @@ async function main() {
|
|
|
118
150
|
main().catch((error) => {
|
|
119
151
|
// eslint-disable-next-line no-console
|
|
120
152
|
console.error('[virtual-router-shadow-v2] failed:', error);
|
|
153
|
+
void writeErrorSampleJson({
|
|
154
|
+
group: 'virtual-router-shadow-v2',
|
|
155
|
+
kind: 'fatal',
|
|
156
|
+
payload: {
|
|
157
|
+
kind: 'virtual-router-shadow-v2-fatal',
|
|
158
|
+
stamp: new Date().toISOString(),
|
|
159
|
+
error: String(error instanceof Error ? error.stack || error.message : String(error))
|
|
160
|
+
}
|
|
161
|
+
}).catch(() => {});
|
|
121
162
|
process.exit(1);
|
|
122
163
|
});
|