@lark-codem/codem-cli 0.1.281-dev.100104658625.0.g0f105de → 0.1.281-dev.100104666556.0.g558f98c
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/auth/index.d.ts +19 -0
- package/auth/index.js +5936 -0
- package/bin/codem-startup-logs.js +13 -14
- package/bin/codem.js +171 -55
- package/bin/slardar-pc-transport.js +0 -134
- package/bin/tt-env.js +1 -1
- package/bin/worker-runtime-telemetry.js +2 -1
- package/package.json +13 -9
- package/profile/credential-errors.js +3 -4
- package/profile/credential-metadata.js +2 -2
- package/profile/debug.js +12 -12
- package/profile/profile-snapshot.js +3 -2
- package/profile/realtime-log-id.js +9 -0
- package/profile/runtime-logs.js +208 -389
- package/profile/sandbox-observability.js +17 -0
- package/profile/slardar-pc-transport.js +0 -134
- package/profile/diagnostic-text.js +0 -49
- package/profile/http-read-diagnostics.js +0 -17
|
@@ -44,7 +44,8 @@ export async function readProfileSnapshot(home) {
|
|
|
44
44
|
return withCodeMConfigLock(join(home, "config.json"), () => readLockedProfileSnapshot(home));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
// Internal callers must already hold the canonical profile config lock.
|
|
48
|
+
export async function readLockedProfileSnapshot(home) {
|
|
48
49
|
const configPath = join(home, "config.json");
|
|
49
50
|
const config = await readProfileObject(configPath);
|
|
50
51
|
let metadata;
|
|
@@ -53,7 +54,7 @@ async function readLockedProfileSnapshot(home) {
|
|
|
53
54
|
} catch (error) {
|
|
54
55
|
if (!(error instanceof CredentialStorageError)) throw error;
|
|
55
56
|
const kind = ["oauth", "router-ak"].includes(error.kind) ? error.kind : null;
|
|
56
|
-
throw new CredentialStorageError(error.code.replace(/^credential_storage_/, ""), kind
|
|
57
|
+
throw new CredentialStorageError(error.code.replace(/^credential_storage_/, ""), kind);
|
|
57
58
|
}
|
|
58
59
|
if (!config && metadata && !metadata.loggedOut) throw new CredentialStorageError("config_missing", "oauth");
|
|
59
60
|
const device = record(config?.device);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Base bounds the JSON encoding of RPC IDs at 1024 bytes. Printable route
|
|
2
|
+
// keys include Go QueryEscape's percent escapes and plus sign. Only record
|
|
3
|
+
// identifier characters; never truncate two different IDs to the same value.
|
|
4
|
+
export function realtimeLogID(value) {
|
|
5
|
+
if (Number.isSafeInteger(value)) return value;
|
|
6
|
+
if (typeof value === "string" && value.length <= 1022 &&
|
|
7
|
+
/^[\p{L}\p{N}_.:%~+-]+$/u.test(value) && Buffer.byteLength(value) <= 1022) return value;
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|