@standardagents/code 0.6.3 → 0.6.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 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -305,6 +305,20 @@ var ApiClient = class {
|
|
|
305
305
|
} catch {
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
+
/** Mint a pre-authed standardcode.ai account-dashboard URL for this thread's
|
|
309
|
+
* user. Returns null when the chain is unavailable — the caller falls back
|
|
310
|
+
* to the plain dashboard URL (sign-in by inbox link). */
|
|
311
|
+
async accountLink(threadId) {
|
|
312
|
+
try {
|
|
313
|
+
const res = await this.json(
|
|
314
|
+
`/api/threads/${threadId}/account_link`,
|
|
315
|
+
{ method: "POST" }
|
|
316
|
+
);
|
|
317
|
+
return res?.url ? { url: res.url, preauthed: res.preauthed === true } : null;
|
|
318
|
+
} catch {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
308
322
|
// ── skills (instance-global Agent Skills library) ─────────────────────────
|
|
309
323
|
/** Installed skills — metadata only. Includes disabled skills. */
|
|
310
324
|
async listSkills() {
|
|
@@ -5134,6 +5148,15 @@ ${c.bold}why: ${req.requestPermission}${c.reset}` : ""}`,
|
|
|
5134
5148
|
tui.print(`${c.red}\u2717${c.reset} couldn't start compaction: ${err.message}`);
|
|
5135
5149
|
}
|
|
5136
5150
|
};
|
|
5151
|
+
const runAccountCommand = async () => {
|
|
5152
|
+
tui.print(`${c.gray}Opening your account\u2026${c.reset}`);
|
|
5153
|
+
const link = await api.accountLink(threadId).catch(() => null);
|
|
5154
|
+
const target = link?.url ?? "https://standardcode.ai/account";
|
|
5155
|
+
openUrl(target);
|
|
5156
|
+
tui.print(
|
|
5157
|
+
link?.preauthed ? `${c.gray}\u2192 account dashboard opened in your browser (signed in)${c.reset}` : `${c.gray}\u2192 opened ${target} \u2014 sign in with your account email${c.reset}`
|
|
5158
|
+
);
|
|
5159
|
+
};
|
|
5137
5160
|
const skillsCtl = {
|
|
5138
5161
|
list: () => api.listSkills(),
|
|
5139
5162
|
setEnabled: (name, enabled) => api.setSkillEnabled(name, enabled),
|
|
@@ -5185,6 +5208,12 @@ ${c.bold}why: ${req.requestPermission}${c.reset}` : ""}`,
|
|
|
5185
5208
|
hint: "list / install / manage",
|
|
5186
5209
|
run: () => runSkillsMenu(tui, skillsCtl)
|
|
5187
5210
|
},
|
|
5211
|
+
{
|
|
5212
|
+
name: "account",
|
|
5213
|
+
label: "Manage your account",
|
|
5214
|
+
hint: "billing & sessions, opens in browser",
|
|
5215
|
+
run: () => runAccountCommand()
|
|
5216
|
+
},
|
|
5188
5217
|
{ name: "background", label: "Background processes", hint: "list / stop", run: () => runProcessMenu(tui, bgMgr) },
|
|
5189
5218
|
{ name: "keybindings", label: "Keyboard shortcuts", run: () => showKeybindings(tui) },
|
|
5190
5219
|
{ name: "update", label: "Check for updates", hint: "check for a newer version", run: () => runUpdateCommand(tui) },
|