cyc-stack 0.7.0 → 0.7.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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/INSTALL.md +2 -0
- package/bin/cyc.mjs +47 -3
- package/docs/installation.md +4 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
package/INSTALL.md
CHANGED
|
@@ -16,6 +16,8 @@ npx cyc-stack@latest init
|
|
|
16
16
|
|
|
17
17
|
Accept npm's download prompt if it appears. Add `--dry-run` to preview changes before installing. No source checkout or global installation is needed, and the command does not add a dependency to your application's `package.json`.
|
|
18
18
|
|
|
19
|
+
Interactive terminals show a short installation summary, setup notes and the next step. Add `--json` for the complete structured result; piped output and `--verbose` continue to use JSON. Previews and conflicts are labeled explicitly.
|
|
20
|
+
|
|
19
21
|
Installation adds CYC's engine, one public `cyc` skill and host hooks. CYC detects hosts from existing project files; if none are detected, it sets up all three supported hosts. It preserves existing project instructions and unrelated hooks, and refuses conflicts with unowned or customized files.
|
|
20
22
|
|
|
21
23
|
### 2. Set up CYC in your AI chat
|
package/bin/cyc.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { acceptFailure, activeRun, callerSession, inputPath, completeRun, contro
|
|
|
8
8
|
const args = process.argv.slice(2);
|
|
9
9
|
const positionals = [];
|
|
10
10
|
const options = {};
|
|
11
|
-
const flags = new Set(['dry-run', 'help', 'verbose', 'verify', 'reviewed', 'write', 'all', 'expanded']);
|
|
11
|
+
const flags = new Set(['dry-run', 'help', 'verbose', 'verify', 'reviewed', 'write', 'all', 'expanded', 'json']);
|
|
12
12
|
try {
|
|
13
13
|
for (let i = 0; i < args.length; i++) {
|
|
14
14
|
if (!args[i].startsWith('--')) { positionals.push(args[i]); continue; }
|
|
@@ -95,6 +95,9 @@ Deliver the reply:
|
|
|
95
95
|
(writes the review packet and runs the delivery gate's checks; the Stop gate checks your final reply itself.
|
|
96
96
|
Cursor needs --response, the exact reply, to find its session's packet)
|
|
97
97
|
|
|
98
|
+
Interactive init/install shows a short summary. Use --json for the complete structured result.
|
|
99
|
+
Piped output and --verbose retain JSON for automation and diagnostics.
|
|
100
|
+
|
|
98
101
|
All commands accept --project PATH. Criteria file: [{"id":"saved","description":"Survives reload"}].
|
|
99
102
|
Store handoff files under .cyc/runs/ID/ to avoid changing the source being verified.
|
|
100
103
|
New implementation runs require Scout, Verify, and Deliver assessments; run next lists required fields.
|
|
@@ -234,13 +237,54 @@ Hook activation/trust must be checked in your host; doctor does not certify it.`
|
|
|
234
237
|
}
|
|
235
238
|
} else throw new Error(`Unknown command ${command}. Use cyc help.`);
|
|
236
239
|
if (command === 'run' && !options.verbose) result = compact(action, result, root, options);
|
|
237
|
-
console.log(JSON.stringify(result, null, 2));
|
|
240
|
+
console.log(humanInstallOutput(command) ? formatInstall(result) : JSON.stringify(result, null, 2));
|
|
238
241
|
if (result?.ok === false || ['halted', 'exhausted', 'blocked'].includes(result?.status) || result?.passed === false) process.exitCode = 1;
|
|
239
242
|
} catch (error) {
|
|
240
|
-
|
|
243
|
+
const result = { ok: false, error: error.message };
|
|
244
|
+
console.error(humanInstallOutput(positionals[0]) ? formatInstall(result) : JSON.stringify(result));
|
|
241
245
|
process.exitCode = 1;
|
|
242
246
|
}
|
|
243
247
|
|
|
248
|
+
function humanInstallOutput(command) {
|
|
249
|
+
return process.stdout.isTTY && ['init', 'install'].includes(command) && !args.includes('--json') && !args.includes('--verbose');
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function formatInstall(result) {
|
|
253
|
+
// JSON escaped terminal controls in paths and diagnostics; keep them visible here too.
|
|
254
|
+
const text = value => String(value ?? '').replace(/[\u0000-\u001f\u007f-\u009f]/g, c => `\\u${c.charCodeAt(0).toString(16).padStart(4, '0')}`);
|
|
255
|
+
const version = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
256
|
+
const changes = result.changes ?? [];
|
|
257
|
+
const counts = Object.fromEntries(['create', 'update', 'remove'].map(action => [action, changes.filter(c => c.action === action).length]));
|
|
258
|
+
const title = !result.ok ? 'Installation stopped' : result.dryRun ? `CYC Stack ${version} — installation preview` : !changes.length ? `CYC Stack ${version} is up to date` : `CYC Stack ${version} installed`;
|
|
259
|
+
const lines = [title, ''];
|
|
260
|
+
if (result.projectRoot) lines.push(`Project: ${text(result.projectRoot)}`);
|
|
261
|
+
if (result.hosts?.length) {
|
|
262
|
+
const names = { claude: 'Claude Code', codex: 'Codex', cursor: 'Cursor' };
|
|
263
|
+
lines.push(`Hosts: ${result.hosts.map(host => names[host] ?? text(host)).join(', ')}`);
|
|
264
|
+
}
|
|
265
|
+
if (result.ok) {
|
|
266
|
+
if (result.dryRun) lines.push(counts.create || counts.update || counts.remove ? `Would create ${counts.create} files, update ${counts.update}, remove ${counts.remove}.` : 'No file changes planned.', 'No files changed.');
|
|
267
|
+
else lines.push(changes.length ? `Files: ${[['create', 'created'], ['update', 'updated'], ['remove', 'removed']].filter(([action]) => counts[action]).map(([action, label]) => `${counts[action]} ${label}`).join(', ')}` : 'No file changes.');
|
|
268
|
+
}
|
|
269
|
+
if (result.error) lines.push('', text(result.error));
|
|
270
|
+
if (result.conflicts?.length) lines.push('', 'Conflicts:', ...result.conflicts.map(c => ` - ${text(c.path)}: ${text(c.reason)}`));
|
|
271
|
+
if (result.warnings?.length) {
|
|
272
|
+
const heading = !result.ok ? 'Installer notes (changes described below are not confirmed):' : result.dryRun ? 'Preview notes (changes described below are planned only):' : 'Setup notes:';
|
|
273
|
+
lines.push('', heading);
|
|
274
|
+
const width = Math.max(40, Math.min(process.stdout.columns ?? 78, 100));
|
|
275
|
+
for (const warning of result.warnings) {
|
|
276
|
+
let line = ' -';
|
|
277
|
+
for (const word of text(warning).split(/\s+/)) {
|
|
278
|
+
if (line.length + word.length + 1 > width && line !== ' -') { lines.push(line); line = ' '; }
|
|
279
|
+
line += ` ${word}`;
|
|
280
|
+
}
|
|
281
|
+
lines.push(line);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (result.ok) lines.push('', 'Next:', ...(result.dryRun ? [' Rerun without --dry-run to apply this plan.'] : [' Reload your AI host and review any hook-trust prompt.', ' In your AI chat, run:', ' /cyc Set up CYC for this project.']));
|
|
285
|
+
return lines.join('\n');
|
|
286
|
+
}
|
|
287
|
+
|
|
244
288
|
function object(value) { return value !== null && typeof value === 'object' && !Array.isArray(value); }
|
|
245
289
|
// Hand-written JSON on Windows often has single backslashes in paths (C:\work), which JSON
|
|
246
290
|
// rejects. Retry once with only the invalid escapes doubled; valid escapes are left alone.
|
package/docs/installation.md
CHANGED
|
@@ -33,6 +33,10 @@ These functions return JSON-friendly objects. Inspect `ok` before proceeding. In
|
|
|
33
33
|
|
|
34
34
|
## Optional npm controls
|
|
35
35
|
|
|
36
|
+
Interactive `init`/`install` output summarizes the outcome, project, hosts and file counts, keeps setup warnings and conflicts visible, and points to the next step in your AI host. A preview says no files changed; an unchanged install says it is up to date. Notes produced while planning are explicitly qualified in previews and failed installs, since a planned migration may not have been applied. Neither installation nor that summary establishes host trust or real-session activation.
|
|
37
|
+
|
|
38
|
+
Use `--json` for the complete structured installer result. Redirected/piped output remains JSON automatically, preserving existing automation, and `--verbose` retains its existing detailed JSON behavior. Other command output and the installer API are unchanged. For example: `npx cyc-stack@latest init --json`.
|
|
39
|
+
|
|
36
40
|
These options are for specific needs; the normal install requires none of them.
|
|
37
41
|
|
|
38
42
|
| Need | Command |
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "cycstack",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.1",
|
|
5
5
|
"description": "Portable AI engineering workflows with shared project context and verifiable changes.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "CYC Stack contributors"
|