@ritualai/cli 0.7.9 → 0.7.10
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/commands/init.js +74 -45
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.js +20 -18
- package/dist/commands/login.js.map +1 -1
- package/dist/lib/identity-banner.js +2 -1
- package/dist/lib/identity-banner.js.map +1 -1
- package/dist/lib/oidc.js +19 -10
- package/dist/lib/oidc.js.map +1 -1
- package/dist/lib/welcome-banner.js +9 -12
- package/dist/lib/welcome-banner.js.map +1 -1
- package/dist/lib/workspace-flow.js +11 -5
- package/dist/lib/workspace-flow.js.map +1 -1
- package/package.json +1 -1
- package/skills/claude-code/ritual/references/async-polling.md +43 -9
- package/skills/claude-code/ritual/references/build-flow.md +695 -144
- package/skills/claude-code/ritual/references/cli-output-contract.md +181 -8
- package/skills/claude-code/ritual/references/context-pulse-flow.md +3 -3
- package/skills/claude-code/ritual/references/discovery-classification.md +3 -3
- package/skills/claude-code/ritual/references/resume-flow.md +2 -0
- package/skills/codex/ritual/references/async-polling.md +43 -9
- package/skills/codex/ritual/references/build-flow.md +695 -144
- package/skills/codex/ritual/references/cli-output-contract.md +181 -8
- package/skills/codex/ritual/references/context-pulse-flow.md +3 -3
- package/skills/codex/ritual/references/discovery-classification.md +3 -3
- package/skills/codex/ritual/references/resume-flow.md +2 -0
- package/skills/cursor/ritual/references/async-polling.md +43 -9
- package/skills/cursor/ritual/references/build-flow.md +695 -144
- package/skills/cursor/ritual/references/cli-output-contract.md +181 -8
- package/skills/cursor/ritual/references/context-pulse-flow.md +3 -3
- package/skills/cursor/ritual/references/discovery-classification.md +3 -3
- package/skills/cursor/ritual/references/resume-flow.md +2 -0
- package/skills/gemini/ritual/references/async-polling.md +43 -9
- package/skills/gemini/ritual/references/build-flow.md +695 -144
- package/skills/gemini/ritual/references/cli-output-contract.md +181 -8
- package/skills/gemini/ritual/references/context-pulse-flow.md +3 -3
- package/skills/gemini/ritual/references/discovery-classification.md +3 -3
- package/skills/gemini/ritual/references/resume-flow.md +2 -0
- package/skills/kiro/ritual/references/async-polling.md +43 -9
- package/skills/kiro/ritual/references/build-flow.md +695 -144
- package/skills/kiro/ritual/references/cli-output-contract.md +181 -8
- package/skills/kiro/ritual/references/context-pulse-flow.md +3 -3
- package/skills/kiro/ritual/references/discovery-classification.md +3 -3
- package/skills/kiro/ritual/references/resume-flow.md +2 -0
- package/skills/vscode/ritual/references/async-polling.md +43 -9
- package/skills/vscode/ritual/references/build-flow.md +695 -144
- package/skills/vscode/ritual/references/cli-output-contract.md +181 -8
- package/skills/vscode/ritual/references/context-pulse-flow.md +3 -3
- package/skills/vscode/ritual/references/discovery-classification.md +3 -3
- package/skills/vscode/ritual/references/resume-flow.md +2 -0
|
@@ -23,10 +23,15 @@ async function resolveProjectWorkspace(opts) {
|
|
|
23
23
|
const detection = (0, repo_name_1.detectRepoName)(opts.projectDir);
|
|
24
24
|
console.log('');
|
|
25
25
|
console.log(' No Ritual workspace is bound to this project yet.');
|
|
26
|
-
console.log(
|
|
26
|
+
console.log('');
|
|
27
|
+
console.log(' A workspace is this project\'s persistent memory in Ritual — explorations,');
|
|
28
|
+
console.log(' decisions, build briefs, and context agents can reuse across sessions.');
|
|
29
|
+
console.log('');
|
|
30
|
+
console.log(` Detected project name: ${detection.name} (from ${detection.source}${detection.originUrl ? ` — ${detection.originUrl}` : ''})`);
|
|
31
|
+
console.log('');
|
|
27
32
|
let answer;
|
|
28
33
|
try {
|
|
29
|
-
answer = await (0, prompt_1.prompt)(` Create workspace "${detection.name}" for this project? (Y/n/<custom name>): `);
|
|
34
|
+
answer = await (0, prompt_1.prompt)(` Create new workspace "${detection.name}" for this project? (Y/n/<custom name>): `);
|
|
30
35
|
}
|
|
31
36
|
catch {
|
|
32
37
|
// stdin closed / Ctrl-D — treat as skip.
|
|
@@ -59,7 +64,7 @@ async function resolveProjectWorkspace(opts) {
|
|
|
59
64
|
}
|
|
60
65
|
catch (err) {
|
|
61
66
|
console.error(` ✗ Could not create workspace: ${err.message}`);
|
|
62
|
-
console.error('
|
|
67
|
+
console.error(' Workspace not bound. Re-run `ritual init` to retry.');
|
|
63
68
|
return null;
|
|
64
69
|
}
|
|
65
70
|
// ── Persist to .ritual/config.json. ────────────────────────────
|
|
@@ -70,8 +75,9 @@ async function resolveProjectWorkspace(opts) {
|
|
|
70
75
|
createdAt: new Date().toISOString(),
|
|
71
76
|
};
|
|
72
77
|
(0, project_config_1.saveProjectConfig)(opts.projectDir, config);
|
|
73
|
-
console.log(` ✓ Created workspace "${created.name}"
|
|
74
|
-
console.log(` ✓
|
|
78
|
+
console.log(` ✓ Created workspace "${created.name}"`);
|
|
79
|
+
console.log(` ✓ Bound this repo in .ritual/config.json`);
|
|
80
|
+
console.log(` Commit this file so your team uses the same workspace.`);
|
|
75
81
|
console.log('');
|
|
76
82
|
return {
|
|
77
83
|
workspaceId: created.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-flow.js","sourceRoot":"","sources":["../../src/lib/workspace-flow.ts"],"names":[],"mappings":";;AAsEA,
|
|
1
|
+
{"version":3,"file":"workspace-flow.js","sourceRoot":"","sources":["../../src/lib/workspace-flow.ts"],"names":[],"mappings":";;AAsEA,0DAoGC;AAzKD,qDAI0B;AAC1B,2CAA6C;AAC7C,qCAAkC;AA+D3B,KAAK,UAAU,uBAAuB,CAC5C,IAA6B;IAE7B,kEAAkE;IAClE,MAAM,QAAQ,GAAG,IAAA,kCAAiB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpD,IAAI,QAAQ,EAAE,CAAC;QACd,OAAO;YACN,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,OAAO,EAAE,KAAK;SACd,CAAC;IACH,CAAC;IAED,kEAAkE;IAClE,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,OAAO,CAAC,KAAK,CAAC,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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ritualai/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.10",
|
|
4
4
|
"description": "Ritual CLI — scaffold AI coding agent skills + register MCP servers. Connects Claude Code, Cursor, Windsurf, Kiro, Gemini CLI, VS Code/Copilot, and Codex to Ritual Cloud.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -2,18 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
Use this for every long-running Ritual/MCP operation: discovery generation, agentic runs, requirement generation, build brief generation, and future async status surfaces.
|
|
4
4
|
|
|
5
|
-
## Standard poll loop
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
5
|
+
## Standard poll loop — single short sleep per turn, never escalate
|
|
6
|
+
|
|
7
|
+
- **`Bash sleep 5` per poll iteration. Always 5. Never escalate.** Even if the operation has been running for minutes, the value stays `5`. The reason: the harness blocks "chained shorter sleeps" — successive `sleep N` calls across turns at increasing N (e.g. `sleep 5` → `sleep 15` → `sleep 20` → `sleep 25`) trip the same guard as `sleep 30+`. Treat the sleep duration as a constant, NOT a backoff knob.
|
|
8
|
+
- **One sleep per turn**, not multiple in sequence. After `sleep 5`, take a fresh turn → call the status tool → decide continue or exit.
|
|
9
|
+
- **`sleep ≥ 30` is hard-blocked**, regardless of context.
|
|
10
|
+
- **Do NOT use semicolons to chain** (`sleep 5; sleep 5`) — also blocked.
|
|
11
|
+
- **The user sees progress every 5 seconds, total wall time is the same.** A slow operation taking 2 minutes is 24 turns of `sleep 5` + status, not 4 turns of `sleep 30`.
|
|
12
|
+
- Print progress only when status/progress/current_step changes, or every ~3 polls (~15s) if unchanged.
|
|
12
13
|
- Keep updates to one line unless an error occurs.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
### Wrong vs right
|
|
16
|
+
|
|
17
|
+
**Wrong** (this is what trips the harness — note each call is a separate turn, the sleep duration creeps up):
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Turn 1: Bash sleep 5 → status: still running
|
|
21
|
+
Turn 2: Bash sleep 15 → status: still running ← creeping up
|
|
22
|
+
Turn 3: Bash sleep 20 → status: still running ← creeping up
|
|
23
|
+
Turn 4: Bash sleep 25 → BLOCKED ✗ "standalone sleep 25"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The harness sees the pattern and blocks. The error message literally says: *"Do not chain shorter sleeps to work around this block."*
|
|
27
|
+
|
|
28
|
+
**Right** — sleep stays at 5s every iteration; the loop ends when status reports done:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Turn 1: Bash sleep 5 → status: still running
|
|
32
|
+
Turn 2: Bash sleep 5 → status: still running
|
|
33
|
+
Turn 3: Bash sleep 5 → status: still running
|
|
34
|
+
Turn 4: Bash sleep 5 → status: still running
|
|
35
|
+
...
|
|
36
|
+
Turn N: Bash sleep 5 → status: COMPLETED → exit loop
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
User-facing: print `Still generating… ({percent}% if available)` every ~3 turns (~15s) when status hasn't changed, ONE line per progress change otherwise.
|
|
40
|
+
|
|
41
|
+
## Long waits — when polling >5 min, use Monitor + `until` loop instead
|
|
42
|
+
|
|
43
|
+
For genuinely long waits (>5 minutes), DO NOT keep the standard poll loop running for that long — switch to the harness's `Monitor` tool with an `until <check>; do sleep 2; done` pattern. The `until` loop is one Bash call that internally checks + sleeps + retries, so it doesn't trip the "chained successive sleeps across turns" guard.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Inside a Monitor / single Bash call — NOT chained across turns.
|
|
47
|
+
until [ "$(curl -s ...status... | jq -r .status)" = "COMPLETED" ]; do sleep 2; done
|
|
48
|
+
```
|
|
15
49
|
|
|
16
|
-
|
|
50
|
+
Pair this with `run_in_background: true` if appropriate — start the long-running watch, get a task id back, check on it later via TaskOutput rather than blocking the conversation.
|
|
17
51
|
|
|
18
52
|
## Timeout recovery
|
|
19
53
|
|