@ssobig/writer-cli 0.2.0 → 0.2.1
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/README.md +6 -0
- package/package.json +1 -1
- package/tools/writer-cli/package-lock.json +2 -2
- package/tools/writer-cli/package.json +1 -1
- package/tools/writer-cli/skills/ssobig-writer-cli/references/errors.md +1 -1
- package/tools/writer-cli/skills/ssobig-writer-cli/references/install-auth.md +12 -0
- package/tools/writer-cli/src/diagnostics.cjs +9 -4
- package/tools/writer-cli/src/skill-manager.cjs +1 -1
- package/tools/writer-cli/src/update-gate.cjs +2 -5
- package/tools/writer-cli/src/update-remediation.cjs +25 -0
package/README.md
CHANGED
|
@@ -22,14 +22,20 @@ CLI는 stdout에 JSON 문서 하나를 출력한다. 원고 변경은 `plan ->
|
|
|
22
22
|
```bash
|
|
23
23
|
ssobig-writer version --check
|
|
24
24
|
npm install --global @ssobig/writer-cli@latest
|
|
25
|
+
ssobig-writer skills status --target <내-workspace>
|
|
26
|
+
ssobig-writer skills update --target <내-workspace>
|
|
25
27
|
|
|
26
28
|
ssobig-writer auth logout
|
|
27
29
|
ssobig-writer agent purge
|
|
30
|
+
ssobig-writer skills remove --target <내-workspace> --managed-only --dry-run
|
|
31
|
+
ssobig-writer skills remove --target <내-workspace> --managed-only
|
|
28
32
|
npm uninstall --global @ssobig/writer-cli
|
|
29
33
|
```
|
|
30
34
|
|
|
31
35
|
0.2.0부터 npm `latest`보다 낮은 CLI의 서버 접속 명령은 실행 전에 `E_CLI_UPDATE_REQUIRED`로 중단된다. help, targeted `command-schema`, `version --check`, `doctor`, `skills *`, logout과 daemon 정리 명령은 업데이트 전에도 사용할 수 있다. 0.1.0 사용자는 위 npm 설치 명령을 다시 실행해 0.2.0 이상으로 전환해야 한다. registry가 일시적으로 응답하지 않으면 새 작업을 차단하지 않지만, 로컬 cache가 이미 더 높은 버전을 확인했다면 계속 업데이트를 요구한다.
|
|
32
36
|
|
|
37
|
+
CLI를 업데이트한 뒤에는 각 작업공간에서 `skills status`를 확인하고, `missing`이면 `skills install`, `update-available`이면 `skills update`를 실행한다. 그다음 새 Codex 또는 Claude 작업을 열어 갱신된 프로젝트 로컬 스킬을 다시 탐색한다. CLI 설치는 작업공간을 자동 변경하지 않는다. ZIP 사용자는 다운로드 페이지에서 새 ZIP을 받아 그 안의 installer를 실행해야 하며, 보관 중인 예전 ZIP을 다시 실행하면 그 ZIP에 포함된 구버전이 재설치된다.
|
|
38
|
+
|
|
33
39
|
`doctor`는 설치·최신 버전·credential session 존재·Auth health·실행 backend 버전을 읽기 전용으로 진단하고 token, 이메일, 원고 값을 출력하지 않는다. macOS 세션은 Keychain에 저장되고 private Unix daemon을 사용한다. Windows 세션은 현재 Windows 사용자만 해독할 수 있도록 DPAPI CurrentUser로 보호되며 CLI는 background daemon 대신 in-process backend를 자동 사용한다. 따라서 Windows에서는 `agent start`와 `agent stop`이 지원되지 않는다.
|
|
34
40
|
|
|
35
41
|
상세 설치, 업데이트, 삭제 방법은 [SSOBIG WRITER 운영 가이드](https://writer.ssobig.com/)에서 확인한다.
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssobig/writer-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@ssobig/writer-cli",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@supabase/supabase-js": "2.110.9"
|
|
12
12
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Errors and boundaries
|
|
2
2
|
|
|
3
|
-
- `E_CLI_UPDATE_REQUIRED`:
|
|
3
|
+
- `E_CLI_UPDATE_REQUIRED`: the original operation was not sent. Follow the returned `installCommand` or download the newest ZIP from `downloadUrl`, then run the returned `skillCommands.status`. Use `skillCommands.install` when missing or `skillCommands.update` when `update-available`, and start a new agent task before retrying.
|
|
4
4
|
- `E_CODE_CHANGE_REQUIRED`: hard boundary; do not use SQL or another client. Separate a code or migration task.
|
|
5
5
|
- `E_CONFLICT`: authoritative data changed after the plan. Read again and create a new plan.
|
|
6
6
|
- `E_AUTH_REQUIRED`, `E_AUTH_EXPIRED`, `E_AUTHORIZATION`: use the supported login flow or ask an authorized staff member; never handle tokens directly.
|
|
@@ -4,4 +4,16 @@ Use targeted help for `version`, `doctor`, `auth`, and `skills`. Install the npm
|
|
|
4
4
|
|
|
5
5
|
Check `version --check` before long work. From CLI 0.2.0 onward, outdated server-access commands stop with `E_CLI_UPDATE_REQUIRED`; local help, schemas, diagnostics, logout, daemon cleanup, and skill management remain available. Registry outages fail open unless a cached newer version is already known.
|
|
6
6
|
|
|
7
|
+
Follow this complete lifecycle whenever the CLI reports an update:
|
|
8
|
+
|
|
9
|
+
1. Run `ssobig-writer version --check` and preserve its sanitized `registry.remediation` details. The equivalent `doctor` check exposes the same lifecycle as additive `remediationDetails`, while keeping its existing remediation string.
|
|
10
|
+
2. Update npm installations with `npm install --global @ssobig/writer-cli@latest`. ZIP users must download the newest macOS or Windows ZIP from `https://writer.ssobig.com/cli-download` and run the installer inside that new ZIP. Re-running an old downloaded ZIP only reinstalls its bundled old version.
|
|
11
|
+
3. Run `ssobig-writer skills status --target <workspace>` from the updated CLI.
|
|
12
|
+
4. If the skill is missing, run `ssobig-writer skills install --target <workspace>`. If it reports `update-available`, run `ssobig-writer skills update --target <workspace>`. Do nothing when it reports `current`.
|
|
13
|
+
5. Start a new Codex or Claude task so the agent reloads the updated project-local skill.
|
|
14
|
+
|
|
15
|
+
Updating the global CLI never silently changes a workspace. Keep this explicit sequence so managed-file conflicts remain visible and user-modified files are not overwritten.
|
|
16
|
+
|
|
17
|
+
Before uninstalling the CLI, preview project-local skill removal with `ssobig-writer skills remove --target <workspace> --managed-only --dry-run`. If the preview owns only the expected managed files, run it again without `--dry-run`, then uninstall the npm package. Never delete an entire `.agents/skills` or `.claude/skills` directory.
|
|
18
|
+
|
|
7
19
|
Authentication uses the supported staff flow. Never request, print, persist, or transmit access tokens. Use `doctor` for sanitized installation, credential-store, network, update, and daemon-version diagnostics.
|
|
@@ -6,6 +6,7 @@ const packageManifest = require("../package.json");
|
|
|
6
6
|
const { createCredentialStorage, createWindowsDpapiStorage, inspectStoredSession } = require("./auth.cjs");
|
|
7
7
|
const { probeDaemon } = require("./daemon-runner.cjs");
|
|
8
8
|
const { computeSourceFingerprint } = require("./source-fingerprint.cjs");
|
|
9
|
+
const { updateRemediation } = require("./update-remediation.cjs");
|
|
9
10
|
|
|
10
11
|
const REGISTRY_URL = "https://registry.npmjs.org/@ssobig%2Fwriter-cli/latest";
|
|
11
12
|
|
|
@@ -86,7 +87,9 @@ async function versionReport(options = {}) {
|
|
|
86
87
|
try {
|
|
87
88
|
const latestVersion = await (options.fetchLatest || fetchLatestVersion)({ fetch: options.fetch, timeoutMs: options.timeoutMs });
|
|
88
89
|
const comparison = compareSemver(latestVersion, currentVersion);
|
|
89
|
-
|
|
90
|
+
const updateAvailable = comparison !== null && comparison > 0;
|
|
91
|
+
report.registry = { status: updateAvailable ? "update-available" : "current", latestVersion, updateAvailable, error: null };
|
|
92
|
+
if (updateAvailable) report.registry.remediation = updateRemediation();
|
|
90
93
|
} catch (error) {
|
|
91
94
|
report.registry = { status: "unavailable", latestVersion: null, updateAvailable: null, error: "npm registry에서 최신 버전을 확인하지 못했습니다." };
|
|
92
95
|
}
|
|
@@ -94,8 +97,10 @@ async function versionReport(options = {}) {
|
|
|
94
97
|
return Object.freeze(report);
|
|
95
98
|
}
|
|
96
99
|
|
|
97
|
-
function check(id, status, message, code = null, remediation = null) {
|
|
98
|
-
|
|
100
|
+
function check(id, status, message, code = null, remediation = null, remediationDetails) {
|
|
101
|
+
const result = { id, status, code, message, remediation };
|
|
102
|
+
if (remediationDetails !== undefined) result.remediationDetails = remediationDetails;
|
|
103
|
+
return Object.freeze(result);
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
function overallStatus(checks) {
|
|
@@ -162,7 +167,7 @@ async function doctorReport(options = {}) {
|
|
|
162
167
|
try {
|
|
163
168
|
const currentVersion = String(options.currentVersion || packageManifest.version);
|
|
164
169
|
const latestVersion = await (options.fetchLatest || fetchLatestVersion)({ fetch: options.fetch, timeoutMs: options.timeoutMs });
|
|
165
|
-
if (compareSemver(latestVersion, currentVersion) > 0) checks.push(check("cli-update", "error", `Writer CLI ${currentVersion}보다 최신 필수 버전 ${latestVersion}이 있습니다.`, "E_CLI_UPDATE_REQUIRED", "npm install --global @ssobig/writer-cli@latest"));
|
|
170
|
+
if (compareSemver(latestVersion, currentVersion) > 0) checks.push(check("cli-update", "error", `Writer CLI ${currentVersion}보다 최신 필수 버전 ${latestVersion}이 있습니다.`, "E_CLI_UPDATE_REQUIRED", "npm install --global @ssobig/writer-cli@latest", updateRemediation()));
|
|
166
171
|
else checks.push(check("cli-update", "ok", `Writer CLI ${currentVersion}이 npm latest 기준 최신입니다.`));
|
|
167
172
|
} catch (error) {
|
|
168
173
|
checks.push(check("cli-update", "warning", "npm registry에서 최신 Writer CLI 버전을 확인하지 못했습니다.", "W_CLI_UPDATE_CHECK_UNAVAILABLE", "네트워크 연결 후 ssobig-writer version --check를 다시 실행해 주세요."));
|
|
@@ -7,7 +7,7 @@ const packageManifest = require("../package.json");
|
|
|
7
7
|
const { cliError } = require("./errors.cjs");
|
|
8
8
|
|
|
9
9
|
const SKILL_NAME = "ssobig-writer-cli";
|
|
10
|
-
const SKILL_VERSION =
|
|
10
|
+
const SKILL_VERSION = packageManifest.version;
|
|
11
11
|
const MANIFEST_NAME = ".ssobig-writer-skill-manifest.json";
|
|
12
12
|
const PAYLOAD_ROOT = path.resolve(__dirname, "../skills", SKILL_NAME);
|
|
13
13
|
const PLATFORM_PATHS = Object.freeze({ codex: [".agents", "skills"], claude: [".claude", "skills"] });
|
|
@@ -7,13 +7,11 @@ const packageManifest = require("../package.json");
|
|
|
7
7
|
const { resolveAgentPaths, ensurePrivateDirectory } = require("./agent-paths.cjs");
|
|
8
8
|
const { compareSemver, fetchLatestVersion, parseSemver } = require("./diagnostics.cjs");
|
|
9
9
|
const { cliError } = require("./errors.cjs");
|
|
10
|
+
const { INSTALL_COMMAND, DOWNLOAD_URL, updateRemediation } = require("./update-remediation.cjs");
|
|
10
11
|
|
|
11
12
|
const CACHE_FILE = "cli-version-check.json";
|
|
12
13
|
const CACHE_VERSION = 1;
|
|
13
14
|
const DEFAULT_TTL_MS = 5 * 60 * 1000;
|
|
14
|
-
const INSTALL_COMMAND = "npm install --global @ssobig/writer-cli@latest";
|
|
15
|
-
const DOWNLOAD_URL = "https://writer.ssobig.com/cli-download";
|
|
16
|
-
|
|
17
15
|
function clock(options = {}) {
|
|
18
16
|
const value = typeof options.now === "function" ? options.now() : Date.now();
|
|
19
17
|
return value instanceof Date ? value.getTime() : Number(value);
|
|
@@ -58,8 +56,7 @@ function updateRequired(currentVersion, latestVersion, source) {
|
|
|
58
56
|
throw cliError("E_CLI_UPDATE_REQUIRED", `Writer CLI ${currentVersion}은 최신 필수 버전 ${latestVersion}보다 낮아 서버 작업을 실행하지 않았습니다.`, {
|
|
59
57
|
currentVersion,
|
|
60
58
|
latestVersion,
|
|
61
|
-
|
|
62
|
-
downloadUrl: DOWNLOAD_URL,
|
|
59
|
+
...updateRemediation(),
|
|
63
60
|
source
|
|
64
61
|
});
|
|
65
62
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const INSTALL_COMMAND = "npm install --global @ssobig/writer-cli@latest";
|
|
4
|
+
const DOWNLOAD_URL = "https://writer.ssobig.com/cli-download";
|
|
5
|
+
const SKILL_COMMANDS = Object.freeze({
|
|
6
|
+
status: "ssobig-writer skills status --target <workspace>",
|
|
7
|
+
install: "ssobig-writer skills install --target <workspace>",
|
|
8
|
+
update: "ssobig-writer skills update --target <workspace>"
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
function updateRemediation() {
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
installCommand: INSTALL_COMMAND,
|
|
14
|
+
downloadUrl: DOWNLOAD_URL,
|
|
15
|
+
skillCommands: SKILL_COMMANDS,
|
|
16
|
+
agentReloadRequired: true
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = Object.freeze({
|
|
21
|
+
INSTALL_COMMAND,
|
|
22
|
+
DOWNLOAD_URL,
|
|
23
|
+
SKILL_COMMANDS,
|
|
24
|
+
updateRemediation
|
|
25
|
+
});
|