pinglet-cli 0.2.1 → 0.2.3
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/adapters/claude.js +4 -1
- package/dist/adapters/codex.js +2 -1
- package/dist/commands/install.js +65 -2
- package/dist/commands/post.js +11 -4
- package/package.json +1 -1
package/dist/adapters/claude.js
CHANGED
|
@@ -286,9 +286,12 @@ function installClaudeIntegration(config, options = {}) {
|
|
|
286
286
|
const existing = settings.statusLine;
|
|
287
287
|
const isOurs = existing?.command?.includes("pinglet");
|
|
288
288
|
if (existing && !isOurs && !options.force) {
|
|
289
|
+
// needsForce: 호출부(install 커맨드)가 대화형이면 사용자에게 물어보고
|
|
290
|
+
// force로 재시도할 수 있다.
|
|
289
291
|
return {
|
|
290
292
|
ok: false,
|
|
291
|
-
|
|
293
|
+
needsForce: true,
|
|
294
|
+
reason: "기존 statusLine 설정이 있습니다 (백업 후 교체하려면 --force).",
|
|
292
295
|
};
|
|
293
296
|
}
|
|
294
297
|
config.adapters.claude = {
|
package/dist/adapters/codex.js
CHANGED
|
@@ -90,7 +90,8 @@ function installCodexIntegration(config, options = {}) {
|
|
|
90
90
|
if (existing && !isOurs && !options.force) {
|
|
91
91
|
return {
|
|
92
92
|
ok: false,
|
|
93
|
-
|
|
93
|
+
needsForce: true,
|
|
94
|
+
reason: "기존 notify 설정이 있습니다 (백업 후 교체하려면 --force).",
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
97
|
config.adapters.codex = {
|
package/dist/commands/install.js
CHANGED
|
@@ -1,11 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.runInstall = runInstall;
|
|
37
|
+
const readline = __importStar(require("readline"));
|
|
4
38
|
const config_1 = require("../config");
|
|
5
39
|
const api_1 = require("../api");
|
|
6
40
|
const cache_1 = require("../cache");
|
|
7
41
|
const claude_1 = require("../adapters/claude");
|
|
8
42
|
const codex_1 = require("../adapters/codex");
|
|
43
|
+
/**
|
|
44
|
+
* 기존 설정 교체 확인. Enter 또는 y면 진행(기본 Yes — 설치 의도가 명확하므로).
|
|
45
|
+
* non-TTY(postinstall, CI)에서는 묻지 않고 false — 사용자 설정을 말없이
|
|
46
|
+
* 바꾸지 않는다.
|
|
47
|
+
*/
|
|
48
|
+
function confirmReplace(question) {
|
|
49
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
50
|
+
return Promise.resolve(false);
|
|
51
|
+
}
|
|
52
|
+
const rl = readline.createInterface({
|
|
53
|
+
input: process.stdin,
|
|
54
|
+
output: process.stdout,
|
|
55
|
+
});
|
|
56
|
+
return new Promise((resolve) => rl.question(question, (answer) => {
|
|
57
|
+
rl.close();
|
|
58
|
+
const trimmed = answer.trim();
|
|
59
|
+
resolve(trimmed === "" || /^y(es)?$/i.test(trimmed));
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
9
62
|
async function runInstall(args) {
|
|
10
63
|
const force = args.includes("--force");
|
|
11
64
|
// --claude / --codex로 대상을 고를 수 있다. 둘 다 없으면 감지된 전부.
|
|
@@ -45,14 +98,24 @@ async function runInstall(args) {
|
|
|
45
98
|
};
|
|
46
99
|
if (hasClaude) {
|
|
47
100
|
await register("CLAUDE");
|
|
48
|
-
|
|
101
|
+
let result = (0, claude_1.installClaudeIntegration)(config, { force });
|
|
102
|
+
if (!result.ok && result.needsForce) {
|
|
103
|
+
const yes = await confirmReplace(" 기존 statusLine 설정이 있습니다. 백업 후 교체할까요? (uninstall 시 복원) (Y/n) ");
|
|
104
|
+
if (yes)
|
|
105
|
+
result = (0, claude_1.installClaudeIntegration)(config, { force: true });
|
|
106
|
+
}
|
|
49
107
|
console.log(result.ok
|
|
50
108
|
? "✓ Claude integration installed"
|
|
51
109
|
: `✗ Claude integration skipped — ${result.reason}`);
|
|
52
110
|
}
|
|
53
111
|
if (hasCodex) {
|
|
54
112
|
await register("CODEX");
|
|
55
|
-
|
|
113
|
+
let result = (0, codex_1.installCodexIntegration)(config, { force });
|
|
114
|
+
if (!result.ok && result.needsForce) {
|
|
115
|
+
const yes = await confirmReplace(" 기존 notify 설정이 있습니다. 백업 후 교체할까요? (uninstall 시 복원) (Y/n) ");
|
|
116
|
+
if (yes)
|
|
117
|
+
result = (0, codex_1.installCodexIntegration)(config, { force: true });
|
|
118
|
+
}
|
|
56
119
|
console.log(result.ok
|
|
57
120
|
? "✓ Codex integration installed (experimental)"
|
|
58
121
|
: `✗ Codex integration skipped — ${result.reason}`);
|
package/dist/commands/post.js
CHANGED
|
@@ -33,8 +33,11 @@ async function runPost(args) {
|
|
|
33
33
|
}
|
|
34
34
|
const text = rest.join(" ").trim();
|
|
35
35
|
if (!text) {
|
|
36
|
-
console.log(
|
|
37
|
-
|
|
36
|
+
console.log(quiet
|
|
37
|
+
? "✗ 메시지가 비어 있습니다. /pinglet 뒤에 보낼 메시지를 적어주세요."
|
|
38
|
+
: '사용법: pinglet post "메시지" [--category <카테고리>]');
|
|
39
|
+
if (!quiet)
|
|
40
|
+
process.exitCode = 1;
|
|
38
41
|
return;
|
|
39
42
|
}
|
|
40
43
|
const config = (0, config_1.loadConfig)();
|
|
@@ -56,7 +59,10 @@ async function runPost(args) {
|
|
|
56
59
|
default:
|
|
57
60
|
console.log("✗ 메시지 등록에 실패했습니다.");
|
|
58
61
|
}
|
|
59
|
-
|
|
62
|
+
// --quiet(/pinglet slash command)에서는 exit 0 유지 — exit 1이면 Claude Code가
|
|
63
|
+
// 안내 문구 대신 "Shell command failed" 에러 덤프를 보여준다.
|
|
64
|
+
if (!quiet)
|
|
65
|
+
process.exitCode = 1;
|
|
60
66
|
return;
|
|
61
67
|
}
|
|
62
68
|
// statusline 도달 표시용으로 이 기기에서 쓴 메시지를 기록해 둔다.
|
|
@@ -80,7 +86,8 @@ async function runPost(args) {
|
|
|
80
86
|
break;
|
|
81
87
|
case "REJECTED":
|
|
82
88
|
console.log(`✗ 메시지가 거절됐습니다${reason ? ` — ${reason}` : ""}.`);
|
|
83
|
-
|
|
89
|
+
if (!quiet)
|
|
90
|
+
process.exitCode = 1;
|
|
84
91
|
break;
|
|
85
92
|
}
|
|
86
93
|
}
|