@plaud-ai/cli 0.3.3 → 0.3.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/index.js +29 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19980,6 +19980,8 @@ var EMAIL_REGEX = /[\w.+-]+@[\w-]+\.[\w.-]+/;
|
|
|
19980
19980
|
var ALLOWED_PROPERTIES = /* @__PURE__ */ new Set([
|
|
19981
19981
|
// Global common properties (Plaud Common Event Properties + Spec §2)
|
|
19982
19982
|
"user_id",
|
|
19983
|
+
"client_user_id",
|
|
19984
|
+
// per-OAuth-client user id (JWT sub, `client_user_…`); DA common param across web/CLI/stdio/HTTP (Mirela 2026-06-29)
|
|
19983
19985
|
"member_id",
|
|
19984
19986
|
// fill-if-present; OAuth /users/current doesn't return it yet (Q16)
|
|
19985
19987
|
"workspace_id",
|
|
@@ -20110,6 +20112,7 @@ var state = {
|
|
|
20110
20112
|
memberId: null,
|
|
20111
20113
|
workspaceId: null,
|
|
20112
20114
|
role: null,
|
|
20115
|
+
clientUserId: null,
|
|
20113
20116
|
mcpHost: null
|
|
20114
20117
|
};
|
|
20115
20118
|
async function initTelemetry(options) {
|
|
@@ -20130,6 +20133,7 @@ async function initTelemetry(options) {
|
|
|
20130
20133
|
state.memberId = identity?.memberId ?? null;
|
|
20131
20134
|
state.workspaceId = identity?.workspaceId ?? null;
|
|
20132
20135
|
state.role = identity?.role ?? null;
|
|
20136
|
+
state.clientUserId = identity?.clientUserId ?? null;
|
|
20133
20137
|
state.currentDistinctId = identity?.idHash || userId || await getAnonymousId();
|
|
20134
20138
|
state.initialised = true;
|
|
20135
20139
|
}
|
|
@@ -20141,6 +20145,7 @@ async function setUser(userId, identity) {
|
|
|
20141
20145
|
state.memberId = identity?.memberId ?? null;
|
|
20142
20146
|
state.workspaceId = identity?.workspaceId ?? null;
|
|
20143
20147
|
state.role = identity?.role ?? null;
|
|
20148
|
+
state.clientUserId = identity?.clientUserId ?? null;
|
|
20144
20149
|
if (state.surface) {
|
|
20145
20150
|
try {
|
|
20146
20151
|
await saveUserIdentity(state.surface, userId, identity);
|
|
@@ -20166,6 +20171,7 @@ async function clearUser() {
|
|
|
20166
20171
|
state.memberId = null;
|
|
20167
20172
|
state.workspaceId = null;
|
|
20168
20173
|
state.role = null;
|
|
20174
|
+
state.clientUserId = null;
|
|
20169
20175
|
if (state.surface) {
|
|
20170
20176
|
try {
|
|
20171
20177
|
await clearUserIdentity(state.surface);
|
|
@@ -20208,6 +20214,8 @@ function buildCommonProperties() {
|
|
|
20208
20214
|
out.transport = state.transport;
|
|
20209
20215
|
if (state.currentUserId)
|
|
20210
20216
|
out.user_id = state.currentUserId;
|
|
20217
|
+
if (state.clientUserId)
|
|
20218
|
+
out.client_user_id = state.clientUserId;
|
|
20211
20219
|
if (state.memberId)
|
|
20212
20220
|
out.member_id = state.memberId;
|
|
20213
20221
|
if (state.workspaceId)
|
|
@@ -20356,7 +20364,7 @@ function isNewer(current, latest) {
|
|
|
20356
20364
|
return false;
|
|
20357
20365
|
}
|
|
20358
20366
|
var updateCommand = new Command("update").description("Check npm for the latest Plaud CLI and print the upgrade command").action(async () => {
|
|
20359
|
-
const current = "0.3.
|
|
20367
|
+
const current = "0.3.4";
|
|
20360
20368
|
const spinner = ora("Checking npm for latest version...").start();
|
|
20361
20369
|
const latest = await fetchLatestVersion();
|
|
20362
20370
|
spinner.stop();
|
|
@@ -20411,10 +20419,10 @@ async function checkForUpdate(current) {
|
|
|
20411
20419
|
return isNewer(current, latest) ? latest : null;
|
|
20412
20420
|
}
|
|
20413
20421
|
var versionCommand = new Command2("version").description("Show CLI version information").action(async () => {
|
|
20414
|
-
const current = "0.3.
|
|
20422
|
+
const current = "0.3.4";
|
|
20415
20423
|
console.log(`plaud ${current}`);
|
|
20416
|
-
if ("
|
|
20417
|
-
if ("2026-06-
|
|
20424
|
+
if ("f7c7d70") console.log(`commit ${"f7c7d70"}`);
|
|
20425
|
+
if ("2026-06-29T07:35:15.095Z") console.log(`built ${"2026-06-29T07:35:15.095Z"}`);
|
|
20418
20426
|
if (current === "unknown") return;
|
|
20419
20427
|
const newer = await checkForUpdate(current);
|
|
20420
20428
|
if (newer) {
|
|
@@ -20515,6 +20523,16 @@ function oauthCallbackErrorType(status) {
|
|
|
20515
20523
|
}
|
|
20516
20524
|
|
|
20517
20525
|
// ../shared/dist/oauth.js
|
|
20526
|
+
function clientUserIdFromAccessToken(token) {
|
|
20527
|
+
if (!token)
|
|
20528
|
+
return void 0;
|
|
20529
|
+
try {
|
|
20530
|
+
const payload = JSON.parse(Buffer.from(token.split(".")[1], "base64url").toString());
|
|
20531
|
+
return typeof payload.sub === "string" && payload.sub.length > 0 ? payload.sub : void 0;
|
|
20532
|
+
} catch {
|
|
20533
|
+
return void 0;
|
|
20534
|
+
}
|
|
20535
|
+
}
|
|
20518
20536
|
var DEFAULT_AUTHORIZATION_URL = "https://web.plaud.ai/platform/oauth";
|
|
20519
20537
|
var DEFAULT_TOKEN_URL = "https://platform.plaud.ai/developer/api/oauth/third-party/access-token";
|
|
20520
20538
|
var DEFAULT_REFRESH_URL = "https://platform.plaud.ai/developer/api/oauth/third-party/access-token/refresh";
|
|
@@ -20981,7 +20999,11 @@ Opening browser for authentication...
|
|
|
20981
20999
|
try {
|
|
20982
21000
|
const user = await client2.getCurrentUser();
|
|
20983
21001
|
if (user && typeof user.id === "string") {
|
|
20984
|
-
await
|
|
21002
|
+
const token = await client2.auth.getAccessToken();
|
|
21003
|
+
await setUser(user.id, {
|
|
21004
|
+
...extractIdentity(user),
|
|
21005
|
+
clientUserId: clientUserIdFromAccessToken(token)
|
|
21006
|
+
});
|
|
20985
21007
|
}
|
|
20986
21008
|
} catch {
|
|
20987
21009
|
}
|
|
@@ -21637,7 +21659,7 @@ async function runWizard() {
|
|
|
21637
21659
|
try {
|
|
21638
21660
|
await initTelemetry({
|
|
21639
21661
|
surface: "cli",
|
|
21640
|
-
appVersion: "0.3.
|
|
21662
|
+
appVersion: "0.3.4"
|
|
21641
21663
|
});
|
|
21642
21664
|
} catch {
|
|
21643
21665
|
}
|
|
@@ -21646,7 +21668,7 @@ async function notifyUpdate() {
|
|
|
21646
21668
|
if (sub === "version" || sub === "update") return;
|
|
21647
21669
|
if (process.env.PLAUD_NO_UPDATE_NOTIFIER) return;
|
|
21648
21670
|
if (!process.stderr.isTTY) return;
|
|
21649
|
-
const current = "0.3.
|
|
21671
|
+
const current = "0.3.4";
|
|
21650
21672
|
if (current === "0.0.0") return;
|
|
21651
21673
|
try {
|
|
21652
21674
|
const newer = await checkForUpdate(current);
|