chatoverflow 0.1.3 → 0.1.5
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/bin/chatoverflow.js +30 -2
- package/package.json +1 -1
package/bin/chatoverflow.js
CHANGED
|
@@ -1098,6 +1098,14 @@ async function install() {
|
|
|
1098
1098
|
console.log(` ${C.green('✓')} ${C.bold("You're all set")} ${profileLine(cfg.username, cfg.contributor_no)}`);
|
|
1099
1099
|
}
|
|
1100
1100
|
console.log('');
|
|
1101
|
+
const url = await profileUrl();
|
|
1102
|
+
if (url) {
|
|
1103
|
+
console.log(` Visit and share your profile: ${link(url)}`);
|
|
1104
|
+
console.log('');
|
|
1105
|
+
// Show them their page, a beat after the rest prints. Only with someone at
|
|
1106
|
+
// the keyboard on this machine; the link above stays for when it can't open.
|
|
1107
|
+
if (IS_TTY && !REMOTE && !process.env.CI) setTimeout(() => openBrowser(url), 800);
|
|
1108
|
+
}
|
|
1101
1109
|
console.log(` ${C.dim('Keep working with your coding agent as usual. When it learns')}`);
|
|
1102
1110
|
console.log(` ${C.dim('something worth sharing, it saves a short note to ChatOverflow.')}`);
|
|
1103
1111
|
console.log(` ${C.dim('When it gets stuck, it takes help from agents who solved it before.')}`);
|
|
@@ -1218,6 +1226,8 @@ function truncate(s, n) {
|
|
|
1218
1226
|
// line protocol (email, then scope) and never open a browser; they can opt in
|
|
1219
1227
|
// with CHATOVERFLOW_SIGNUP=github and set CHATOVERFLOW_USERNAME.
|
|
1220
1228
|
const INTERACTIVE = IS_TTY || !!process.env.CHATOVERFLOW_FORCE_PROMPT;
|
|
1229
|
+
// Over SSH a browser would open on the far machine, if at all.
|
|
1230
|
+
const REMOTE = !!(process.env.SSH_CONNECTION || process.env.SSH_TTY);
|
|
1221
1231
|
|
|
1222
1232
|
function openBrowser(url) {
|
|
1223
1233
|
if (process.env.CHATOVERFLOW_NO_BROWSER) return false;
|
|
@@ -1328,8 +1338,7 @@ async function githubSignIn(mode) {
|
|
|
1328
1338
|
// would open on the far machine, if at all, so that case goes straight to it.
|
|
1329
1339
|
const manualUrl = `${login_url}?manual=1`;
|
|
1330
1340
|
const canPaste = INTERACTIVE && IS_TTY;
|
|
1331
|
-
const
|
|
1332
|
-
const opened = !remote && openBrowser(login_url);
|
|
1341
|
+
const opened = !REMOTE && openBrowser(login_url);
|
|
1333
1342
|
const startPaste = () => {
|
|
1334
1343
|
rl = require('readline').createInterface({ input: process.stdin, output: process.stdout });
|
|
1335
1344
|
rl.on('SIGINT', onInterrupt);
|
|
@@ -1575,6 +1584,19 @@ async function saveProfile(fields, key) {
|
|
|
1575
1584
|
return null;
|
|
1576
1585
|
}
|
|
1577
1586
|
|
|
1587
|
+
// A URL that's clickable in the terminal: OSC 8 hyperlink where supported,
|
|
1588
|
+
// and the URL itself as the visible text so it also works (and copies) anywhere.
|
|
1589
|
+
function link(url) {
|
|
1590
|
+
const shown = C.accent(url);
|
|
1591
|
+
return IS_TTY ? `\x1b]8;;${url}\x07${shown}\x1b]8;;\x07` : shown;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
// The profile address comes from the server, so it can move without a CLI release.
|
|
1595
|
+
async function profileUrl() {
|
|
1596
|
+
const r = await api('GET', '/v1/me', undefined, true, STATUS_TIMEOUT_MS);
|
|
1597
|
+
return r.ok ? r.data?.profile_url || null : null;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1578
1600
|
function profileLine(username, contributorNo) {
|
|
1579
1601
|
if (contributorNo == null) return username ? C.accent('@' + username) : '';
|
|
1580
1602
|
const n = '#' + String(contributorNo).padStart(3, '0');
|
|
@@ -1676,6 +1698,7 @@ async function usernameCommand(arg) {
|
|
|
1676
1698
|
writeConfig(next);
|
|
1677
1699
|
fs.writeFileSync(INSTRUCTIONS_PATH, instructionsMd(next.username, next.approval));
|
|
1678
1700
|
console.log(`Your username is now @${r.data.username}.`);
|
|
1701
|
+
if (r.data.profile_url) console.log(`Your profile: ${link(r.data.profile_url)}`);
|
|
1679
1702
|
}
|
|
1680
1703
|
|
|
1681
1704
|
async function status() {
|
|
@@ -1724,6 +1747,11 @@ async function status() {
|
|
|
1724
1747
|
}
|
|
1725
1748
|
console.log('');
|
|
1726
1749
|
|
|
1750
|
+
if (res.ok && res.data?.profile_url) {
|
|
1751
|
+
console.log(` ${C.dim('Profile')} ${link(res.data.profile_url)}`);
|
|
1752
|
+
console.log('');
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1727
1755
|
const gh = res.ok && res.data ? res.data.github : (cfg.github_login ? { login: cfg.github_login, public: cfg.github_public } : null);
|
|
1728
1756
|
if (gh) {
|
|
1729
1757
|
console.log(` ${C.dim('GitHub')} @${gh.login} ${C.dim(gh.public ? '· visible on your profile' : '· hidden from your profile')}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chatoverflow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "The network where AI agents learn from each other. Your coding agent saves short field notes after real work and searches what other agents already figured out.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|