@orkestrel/scaffold 0.0.2 → 0.0.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.
Files changed (78) hide show
  1. package/README.md +29 -15
  2. package/dist/bin/scaffold.js +1162 -1200
  3. package/dist/bin/scaffold.js.map +1 -1
  4. package/dist/host/AGENTS.md +124 -925
  5. package/dist/host/CLAUDE.md +260 -495
  6. package/dist/host/agents/skills/orkestrel-align-packages/SKILL.md +53 -0
  7. package/dist/host/agents/skills/orkestrel-align-packages/agents/openai.yaml +4 -0
  8. package/dist/host/agents/skills/orkestrel-align-packages/references/fleet.md +50 -0
  9. package/dist/host/agents/skills/orkestrel-align-packages/references/integration.md +56 -0
  10. package/dist/host/agents/skills/orkestrel-build-application/SKILL.md +64 -0
  11. package/dist/host/agents/skills/orkestrel-build-application/agents/openai.yaml +4 -0
  12. package/dist/host/agents/skills/orkestrel-build-application/references/application.md +129 -0
  13. package/dist/host/agents/skills/orkestrel-harden-package/SKILL.md +64 -0
  14. package/dist/host/agents/skills/orkestrel-harden-package/agents/openai.yaml +4 -0
  15. package/dist/host/agents/skills/orkestrel-harden-package/references/centralization.md +85 -0
  16. package/dist/host/agents/skills/orkestrel-harden-package/references/contract.md +57 -0
  17. package/dist/host/agents/skills/orkestrel-harden-package/references/hardening.md +93 -0
  18. package/dist/host/agents/skills/orkestrel-harden-package/references/research.md +61 -0
  19. package/dist/host/claude/agents/application.md +32 -0
  20. package/dist/host/claude/agents/builder.md +12 -7
  21. package/dist/host/claude/agents/checker.md +15 -8
  22. package/dist/host/claude/agents/codex.md +40 -0
  23. package/dist/host/claude/agents/grok.md +20 -37
  24. package/dist/host/claude/agents/orkestrel.md +89 -223
  25. package/dist/host/claude/agents/planner.md +14 -34
  26. package/dist/host/claude/agents/reviewer.md +39 -24
  27. package/dist/host/claude/agents/verifier.md +15 -10
  28. package/dist/host/claude/rules/application.md +57 -0
  29. package/dist/host/claude/rules/architecture.md +179 -0
  30. package/dist/host/claude/rules/browser.md +28 -0
  31. package/dist/host/claude/rules/documentation.md +64 -0
  32. package/dist/host/claude/rules/names.md +209 -0
  33. package/dist/host/claude/rules/patterns.md +130 -0
  34. package/dist/host/claude/rules/quality.md +45 -0
  35. package/dist/host/claude/rules/styles.md +64 -0
  36. package/dist/host/claude/rules/tests.md +123 -0
  37. package/dist/host/claude/rules/typescript.md +78 -0
  38. package/dist/host/claude/rules/workspace.md +180 -0
  39. package/dist/host/claude/settings.json +116 -0
  40. package/dist/host/claude/skills/orkestrel-align-packages/SKILL.md +10 -0
  41. package/dist/host/claude/skills/orkestrel-build-application/SKILL.md +12 -0
  42. package/dist/host/claude/skills/orkestrel-harden-package/SKILL.md +10 -0
  43. package/dist/host/codex/agents/analyst.toml +15 -0
  44. package/dist/host/codex/agents/application.toml +25 -0
  45. package/dist/host/codex/agents/builder.toml +24 -0
  46. package/dist/host/codex/agents/checker.toml +15 -0
  47. package/dist/host/codex/agents/grok.toml +17 -0
  48. package/dist/host/codex/agents/implementer.toml +17 -0
  49. package/dist/host/codex/agents/orkestrel.toml +16 -0
  50. package/dist/host/codex/agents/planner.toml +20 -0
  51. package/dist/host/codex/agents/reviewer.toml +18 -0
  52. package/dist/host/codex/agents/verifier.toml +14 -0
  53. package/dist/host/codex/config.toml +64 -0
  54. package/dist/host/dotfiles/oxlintrc.json +307 -1
  55. package/dist/host/guides/src/scaffold.md +2059 -2007
  56. package/dist/host/manifest.json +355 -137
  57. package/dist/host/scripts/codex.sh +49 -0
  58. package/dist/host/scripts/cursor.sh +33 -47
  59. package/dist/host/scripts/deps.sh +34 -16
  60. package/dist/host/scripts/ollama.sh +6 -149
  61. package/dist/host/tests/setupPolicy.ts +354 -0
  62. package/dist/src/core/index.cjs +6600 -1199
  63. package/dist/src/core/index.cjs.map +1 -1
  64. package/dist/src/core/index.d.cts +801 -266
  65. package/dist/src/core/index.d.ts +801 -266
  66. package/dist/src/core/index.js +6518 -1191
  67. package/dist/src/core/index.js.map +1 -1
  68. package/dist/src/server/index.cjs +3132 -593
  69. package/dist/src/server/index.cjs.map +1 -1
  70. package/dist/src/server/index.d.cts +643 -95
  71. package/dist/src/server/index.d.ts +643 -95
  72. package/dist/src/server/index.js +3054 -594
  73. package/dist/src/server/index.js.map +1 -1
  74. package/package.json +15 -12
  75. package/dist/host/claude/agents/composer.md +0 -64
  76. package/dist/host/claude/agents/researcher.md +0 -38
  77. package/dist/host/claude/agents/scout.md +0 -35
  78. package/dist/host/github/workflows/ci.yml +0 -64
@@ -1,137 +1,355 @@
1
- [
2
- {
3
- "storage": "claude/agents/builder.md",
4
- "destination": ".claude/agents/builder.md",
5
- "executable": false
6
- },
7
- {
8
- "storage": "claude/agents/checker.md",
9
- "destination": ".claude/agents/checker.md",
10
- "executable": false
11
- },
12
- {
13
- "storage": "claude/agents/composer.md",
14
- "destination": ".claude/agents/composer.md",
15
- "executable": false
16
- },
17
- {
18
- "storage": "claude/agents/grok.md",
19
- "destination": ".claude/agents/grok.md",
20
- "executable": false
21
- },
22
- {
23
- "storage": "claude/agents/orkestrel.md",
24
- "destination": ".claude/agents/orkestrel.md",
25
- "executable": false
26
- },
27
- {
28
- "storage": "claude/agents/planner.md",
29
- "destination": ".claude/agents/planner.md",
30
- "executable": false
31
- },
32
- {
33
- "storage": "claude/agents/researcher.md",
34
- "destination": ".claude/agents/researcher.md",
35
- "executable": false
36
- },
37
- {
38
- "storage": "claude/agents/reviewer.md",
39
- "destination": ".claude/agents/reviewer.md",
40
- "executable": false
41
- },
42
- {
43
- "storage": "claude/agents/scout.md",
44
- "destination": ".claude/agents/scout.md",
45
- "executable": false
46
- },
47
- {
48
- "storage": "claude/agents/verifier.md",
49
- "destination": ".claude/agents/verifier.md",
50
- "executable": false
51
- },
52
- {
53
- "storage": "claude/settings.json",
54
- "destination": ".claude/settings.json",
55
- "executable": false
56
- },
57
- {
58
- "storage": "dotfiles/editorconfig",
59
- "destination": ".editorconfig",
60
- "executable": false
61
- },
62
- {
63
- "storage": "dotfiles/gitattributes",
64
- "destination": ".gitattributes",
65
- "executable": false
66
- },
67
- {
68
- "storage": "github/workflows/ci.yml",
69
- "destination": ".github/workflows/ci.yml",
70
- "executable": false
71
- },
72
- {
73
- "storage": "dotfiles/gitignore",
74
- "destination": ".gitignore",
75
- "executable": false
76
- },
77
- {
78
- "storage": "dotfiles/oxfmtrc.json",
79
- "destination": ".oxfmtrc.json",
80
- "executable": false
81
- },
82
- {
83
- "storage": "dotfiles/oxlintignore",
84
- "destination": ".oxlintignore",
85
- "executable": false
86
- },
87
- {
88
- "storage": "dotfiles/oxlintrc.json",
89
- "destination": ".oxlintrc.json",
90
- "executable": false
91
- },
92
- {
93
- "storage": "dotfiles/prettierignore",
94
- "destination": ".prettierignore",
95
- "executable": false
96
- },
97
- {
98
- "storage": "AGENTS.md",
99
- "destination": "AGENTS.md",
100
- "executable": false
101
- },
102
- {
103
- "storage": "CLAUDE.md",
104
- "destination": "CLAUDE.md",
105
- "executable": false
106
- },
107
- {
108
- "storage": "LICENSE",
109
- "destination": "LICENSE",
110
- "executable": false
111
- },
112
- {
113
- "storage": "guides/src/guide.md",
114
- "destination": "guides/src/guide.md",
115
- "executable": false
116
- },
117
- {
118
- "storage": "guides/src/scaffold.md",
119
- "destination": "guides/src/scaffold.md",
120
- "executable": false
121
- },
122
- {
123
- "storage": "scripts/cursor.sh",
124
- "destination": "scripts/cursor.sh",
125
- "executable": true
126
- },
127
- {
128
- "storage": "scripts/deps.sh",
129
- "destination": "scripts/deps.sh",
130
- "executable": true
131
- },
132
- {
133
- "storage": "scripts/ollama.sh",
134
- "destination": "scripts/ollama.sh",
135
- "executable": true
136
- }
137
- ]
1
+ {
2
+ "entries": [
3
+ {
4
+ "storage": "agents/skills/orkestrel-align-packages/SKILL.md",
5
+ "destination": ".agents/skills/orkestrel-align-packages/SKILL.md",
6
+ "executable": false
7
+ },
8
+ {
9
+ "storage": "agents/skills/orkestrel-align-packages/agents/openai.yaml",
10
+ "destination": ".agents/skills/orkestrel-align-packages/agents/openai.yaml",
11
+ "executable": false
12
+ },
13
+ {
14
+ "storage": "agents/skills/orkestrel-align-packages/references/fleet.md",
15
+ "destination": ".agents/skills/orkestrel-align-packages/references/fleet.md",
16
+ "executable": false
17
+ },
18
+ {
19
+ "storage": "agents/skills/orkestrel-align-packages/references/integration.md",
20
+ "destination": ".agents/skills/orkestrel-align-packages/references/integration.md",
21
+ "executable": false
22
+ },
23
+ {
24
+ "storage": "agents/skills/orkestrel-build-application/SKILL.md",
25
+ "destination": ".agents/skills/orkestrel-build-application/SKILL.md",
26
+ "executable": false
27
+ },
28
+ {
29
+ "storage": "agents/skills/orkestrel-build-application/agents/openai.yaml",
30
+ "destination": ".agents/skills/orkestrel-build-application/agents/openai.yaml",
31
+ "executable": false
32
+ },
33
+ {
34
+ "storage": "agents/skills/orkestrel-build-application/references/application.md",
35
+ "destination": ".agents/skills/orkestrel-build-application/references/application.md",
36
+ "executable": false
37
+ },
38
+ {
39
+ "storage": "agents/skills/orkestrel-harden-package/SKILL.md",
40
+ "destination": ".agents/skills/orkestrel-harden-package/SKILL.md",
41
+ "executable": false
42
+ },
43
+ {
44
+ "storage": "agents/skills/orkestrel-harden-package/agents/openai.yaml",
45
+ "destination": ".agents/skills/orkestrel-harden-package/agents/openai.yaml",
46
+ "executable": false
47
+ },
48
+ {
49
+ "storage": "agents/skills/orkestrel-harden-package/references/centralization.md",
50
+ "destination": ".agents/skills/orkestrel-harden-package/references/centralization.md",
51
+ "executable": false
52
+ },
53
+ {
54
+ "storage": "agents/skills/orkestrel-harden-package/references/contract.md",
55
+ "destination": ".agents/skills/orkestrel-harden-package/references/contract.md",
56
+ "executable": false
57
+ },
58
+ {
59
+ "storage": "agents/skills/orkestrel-harden-package/references/hardening.md",
60
+ "destination": ".agents/skills/orkestrel-harden-package/references/hardening.md",
61
+ "executable": false
62
+ },
63
+ {
64
+ "storage": "agents/skills/orkestrel-harden-package/references/research.md",
65
+ "destination": ".agents/skills/orkestrel-harden-package/references/research.md",
66
+ "executable": false
67
+ },
68
+ {
69
+ "storage": "claude/agents/application.md",
70
+ "destination": ".claude/agents/application.md",
71
+ "executable": false
72
+ },
73
+ {
74
+ "storage": "claude/agents/builder.md",
75
+ "destination": ".claude/agents/builder.md",
76
+ "executable": false
77
+ },
78
+ {
79
+ "storage": "claude/agents/checker.md",
80
+ "destination": ".claude/agents/checker.md",
81
+ "executable": false
82
+ },
83
+ {
84
+ "storage": "claude/agents/codex.md",
85
+ "destination": ".claude/agents/codex.md",
86
+ "executable": false
87
+ },
88
+ {
89
+ "storage": "claude/agents/grok.md",
90
+ "destination": ".claude/agents/grok.md",
91
+ "executable": false
92
+ },
93
+ {
94
+ "storage": "claude/agents/orkestrel.md",
95
+ "destination": ".claude/agents/orkestrel.md",
96
+ "executable": false
97
+ },
98
+ {
99
+ "storage": "claude/agents/planner.md",
100
+ "destination": ".claude/agents/planner.md",
101
+ "executable": false
102
+ },
103
+ {
104
+ "storage": "claude/agents/reviewer.md",
105
+ "destination": ".claude/agents/reviewer.md",
106
+ "executable": false
107
+ },
108
+ {
109
+ "storage": "claude/agents/verifier.md",
110
+ "destination": ".claude/agents/verifier.md",
111
+ "executable": false
112
+ },
113
+ {
114
+ "storage": "claude/rules/application.md",
115
+ "destination": ".claude/rules/application.md",
116
+ "executable": false
117
+ },
118
+ {
119
+ "storage": "claude/rules/architecture.md",
120
+ "destination": ".claude/rules/architecture.md",
121
+ "executable": false
122
+ },
123
+ {
124
+ "storage": "claude/rules/browser.md",
125
+ "destination": ".claude/rules/browser.md",
126
+ "executable": false
127
+ },
128
+ {
129
+ "storage": "claude/rules/documentation.md",
130
+ "destination": ".claude/rules/documentation.md",
131
+ "executable": false
132
+ },
133
+ {
134
+ "storage": "claude/rules/names.md",
135
+ "destination": ".claude/rules/names.md",
136
+ "executable": false
137
+ },
138
+ {
139
+ "storage": "claude/rules/patterns.md",
140
+ "destination": ".claude/rules/patterns.md",
141
+ "executable": false
142
+ },
143
+ {
144
+ "storage": "claude/rules/quality.md",
145
+ "destination": ".claude/rules/quality.md",
146
+ "executable": false
147
+ },
148
+ {
149
+ "storage": "claude/rules/styles.md",
150
+ "destination": ".claude/rules/styles.md",
151
+ "executable": false
152
+ },
153
+ {
154
+ "storage": "claude/rules/tests.md",
155
+ "destination": ".claude/rules/tests.md",
156
+ "executable": false
157
+ },
158
+ {
159
+ "storage": "claude/rules/typescript.md",
160
+ "destination": ".claude/rules/typescript.md",
161
+ "executable": false
162
+ },
163
+ {
164
+ "storage": "claude/rules/workspace.md",
165
+ "destination": ".claude/rules/workspace.md",
166
+ "executable": false
167
+ },
168
+ {
169
+ "storage": "claude/settings.json",
170
+ "destination": ".claude/settings.json",
171
+ "executable": false
172
+ },
173
+ {
174
+ "storage": "claude/skills/orkestrel-align-packages/SKILL.md",
175
+ "destination": ".claude/skills/orkestrel-align-packages/SKILL.md",
176
+ "executable": false
177
+ },
178
+ {
179
+ "storage": "claude/skills/orkestrel-build-application/SKILL.md",
180
+ "destination": ".claude/skills/orkestrel-build-application/SKILL.md",
181
+ "executable": false
182
+ },
183
+ {
184
+ "storage": "claude/skills/orkestrel-harden-package/SKILL.md",
185
+ "destination": ".claude/skills/orkestrel-harden-package/SKILL.md",
186
+ "executable": false
187
+ },
188
+ {
189
+ "storage": "codex/agents/analyst.toml",
190
+ "destination": ".codex/agents/analyst.toml",
191
+ "executable": false
192
+ },
193
+ {
194
+ "storage": "codex/agents/application.toml",
195
+ "destination": ".codex/agents/application.toml",
196
+ "executable": false
197
+ },
198
+ {
199
+ "storage": "codex/agents/builder.toml",
200
+ "destination": ".codex/agents/builder.toml",
201
+ "executable": false
202
+ },
203
+ {
204
+ "storage": "codex/agents/checker.toml",
205
+ "destination": ".codex/agents/checker.toml",
206
+ "executable": false
207
+ },
208
+ {
209
+ "storage": "codex/agents/grok.toml",
210
+ "destination": ".codex/agents/grok.toml",
211
+ "executable": false
212
+ },
213
+ {
214
+ "storage": "codex/agents/implementer.toml",
215
+ "destination": ".codex/agents/implementer.toml",
216
+ "executable": false
217
+ },
218
+ {
219
+ "storage": "codex/agents/orkestrel.toml",
220
+ "destination": ".codex/agents/orkestrel.toml",
221
+ "executable": false
222
+ },
223
+ {
224
+ "storage": "codex/agents/planner.toml",
225
+ "destination": ".codex/agents/planner.toml",
226
+ "executable": false
227
+ },
228
+ {
229
+ "storage": "codex/agents/reviewer.toml",
230
+ "destination": ".codex/agents/reviewer.toml",
231
+ "executable": false
232
+ },
233
+ {
234
+ "storage": "codex/agents/verifier.toml",
235
+ "destination": ".codex/agents/verifier.toml",
236
+ "executable": false
237
+ },
238
+ {
239
+ "storage": "codex/config.toml",
240
+ "destination": ".codex/config.toml",
241
+ "executable": false
242
+ },
243
+ {
244
+ "storage": "dotfiles/editorconfig",
245
+ "destination": ".editorconfig",
246
+ "executable": false
247
+ },
248
+ {
249
+ "storage": "dotfiles/gitattributes",
250
+ "destination": ".gitattributes",
251
+ "executable": false
252
+ },
253
+ {
254
+ "storage": "dotfiles/gitignore",
255
+ "destination": ".gitignore",
256
+ "executable": false
257
+ },
258
+ {
259
+ "storage": "dotfiles/oxfmtrc.json",
260
+ "destination": ".oxfmtrc.json",
261
+ "executable": false
262
+ },
263
+ {
264
+ "storage": "dotfiles/oxlintignore",
265
+ "destination": ".oxlintignore",
266
+ "executable": false
267
+ },
268
+ {
269
+ "storage": "dotfiles/oxlintrc.json",
270
+ "destination": ".oxlintrc.json",
271
+ "executable": false
272
+ },
273
+ {
274
+ "storage": "dotfiles/prettierignore",
275
+ "destination": ".prettierignore",
276
+ "executable": false
277
+ },
278
+ {
279
+ "storage": "AGENTS.md",
280
+ "destination": "AGENTS.md",
281
+ "executable": false
282
+ },
283
+ {
284
+ "storage": "CLAUDE.md",
285
+ "destination": "CLAUDE.md",
286
+ "executable": false
287
+ },
288
+ {
289
+ "storage": "LICENSE",
290
+ "destination": "LICENSE",
291
+ "executable": false
292
+ },
293
+ {
294
+ "storage": "guides/src/guide.md",
295
+ "destination": "guides/src/guide.md",
296
+ "executable": false
297
+ },
298
+ {
299
+ "storage": "guides/src/scaffold.md",
300
+ "destination": "guides/src/scaffold.md",
301
+ "executable": false
302
+ },
303
+ {
304
+ "storage": "scripts/codex.sh",
305
+ "destination": "scripts/codex.sh",
306
+ "executable": true
307
+ },
308
+ {
309
+ "storage": "scripts/cursor.sh",
310
+ "destination": "scripts/cursor.sh",
311
+ "executable": true
312
+ },
313
+ {
314
+ "storage": "scripts/deps.sh",
315
+ "destination": "scripts/deps.sh",
316
+ "executable": true
317
+ },
318
+ {
319
+ "storage": "scripts/ollama.sh",
320
+ "destination": "scripts/ollama.sh",
321
+ "executable": true
322
+ },
323
+ {
324
+ "storage": "tests/setupPolicy.ts",
325
+ "destination": "tests/setupPolicy.ts",
326
+ "executable": false
327
+ }
328
+ ],
329
+ "roots": [
330
+ ".agents",
331
+ ".agents/skills",
332
+ ".agents/skills/orkestrel-align-packages",
333
+ ".agents/skills/orkestrel-align-packages/agents",
334
+ ".agents/skills/orkestrel-align-packages/references",
335
+ ".agents/skills/orkestrel-build-application",
336
+ ".agents/skills/orkestrel-build-application/agents",
337
+ ".agents/skills/orkestrel-build-application/references",
338
+ ".agents/skills/orkestrel-harden-package",
339
+ ".agents/skills/orkestrel-harden-package/agents",
340
+ ".agents/skills/orkestrel-harden-package/references",
341
+ ".claude",
342
+ ".claude/agents",
343
+ ".claude/rules",
344
+ ".claude/skills",
345
+ ".claude/skills/orkestrel-align-packages",
346
+ ".claude/skills/orkestrel-build-application",
347
+ ".claude/skills/orkestrel-harden-package",
348
+ ".codex",
349
+ ".codex/agents",
350
+ "guides",
351
+ "guides/src",
352
+ "scripts",
353
+ "tests"
354
+ ]
355
+ }
@@ -0,0 +1,49 @@
1
+ #!/bin/bash
2
+ # SessionStart capability probe for the Codex bench. External command output
3
+ # and route identifiers never cross the hook-to-context boundary.
4
+
5
+ if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
6
+ exit 0
7
+ fi
8
+
9
+ if ! command -v codex >/dev/null 2>&1; then
10
+ echo "codex.sh: bench unavailable."
11
+ exit 0
12
+ fi
13
+
14
+ analyst_model="${CODEX_ANALYST_MODEL:-gpt-5.6-sol}"
15
+ analyst_effort="${CODEX_ANALYST_EFFORT:-high}"
16
+ implementer_model="${CODEX_IMPLEMENTER_MODEL:-gpt-5.6-sol}"
17
+ implementer_effort="${CODEX_IMPLEMENTER_EFFORT:-high}"
18
+
19
+ valid_model() {
20
+ case "$1" in
21
+ ''|*[!A-Za-z0-9._-]*) return 1 ;;
22
+ esac
23
+ [ "${#1}" -le 128 ]
24
+ }
25
+
26
+ valid_effort() {
27
+ case "$1" in
28
+ low|medium|high|xhigh|max|ultra) return 0 ;;
29
+ *) return 1 ;;
30
+ esac
31
+ }
32
+
33
+ if codex login status >/dev/null 2>&1; then
34
+ auth="authentication ready"
35
+ else
36
+ auth="authentication unavailable"
37
+ fi
38
+
39
+ if valid_model "$analyst_model" &&
40
+ valid_model "$implementer_model" &&
41
+ valid_effort "$analyst_effort" &&
42
+ valid_effort "$implementer_effort"; then
43
+ routes="routes configured"
44
+ else
45
+ routes="routes invalid"
46
+ fi
47
+
48
+ echo "codex.sh: bench detected; ${auth}; ${routes}."
49
+ exit 0
@@ -1,74 +1,60 @@
1
1
  #!/bin/bash
2
- # ============================================================================
3
- # scripts/cursor.sh SessionStart hook: Cursor bench ONLY
4
- # ----------------------------------------------------------------------------
5
- # The Cursor CLI has no daemon to launch: `agent` is invoked on demand by the
6
- # composer/grok dispatchers. This hook SENSES the bench at session start and
7
- # announces the result into Claude's context (SessionStart stdout).
8
- #
9
- # AUTH SENSING — evidence-based, in order of authority:
10
- # 1. `agent status` exits 0 even when it prints "Not logged in" — its exit
11
- # code proves nothing, and under CURSOR_API_KEY auth "Not logged in" is
12
- # COSMETIC on headless hosts (status reflects interactive login only;
13
- # key auth here is verified end-to-end and works regardless).
14
- # 2. The per-session functional signal is `agent models`: reachable + pins
15
- # present on the account ⇒ the bench is usable. A live dispatch remains
16
- # the final arbiter; only USER API keys work (admin/org keys fail at
17
- # dispatch time).
18
- # NEVER prints CURSOR_API_KEY. Always exits 0 — problems are announcements,
19
- # not session blockers.
20
- # ============================================================================
2
+ # SessionStart capability probe for the Cursor bench. External command output,
3
+ # model identifiers, and credentials never cross the hook-to-context boundary.
21
4
 
22
5
  if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
23
6
  exit 0
24
7
  fi
25
8
 
26
9
  if ! command -v agent >/dev/null 2>&1; then
27
- echo "cursor.sh: bench dark Cursor CLI not installed in this environment; route external-bench units to their Claude counterparts."
10
+ echo "cursor.sh: bench unavailable; use an in-session research route."
28
11
  exit 0
29
12
  fi
30
13
 
31
- # --- evidence gathering ------------------------------------------------------
32
- agent status >/tmp/cursor-status.log 2>&1 || true
33
- status_line="$(head -n 1 /tmp/cursor-status.log 2>/dev/null)"
14
+ MODELS_LOG="$(mktemp /tmp/orkestrel-cursor-models.XXXXXX)" || exit 0
15
+ chmod 600 "$MODELS_LOG"
16
+ cleanup_cursor_log() {
17
+ rm -f -- "$MODELS_LOG"
18
+ }
19
+ trap cleanup_cursor_log EXIT
34
20
 
35
21
  models_ok=0
36
- if agent models >/tmp/cursor-models.log 2>&1; then
22
+ if agent models >"$MODELS_LOG" 2>&1; then
37
23
  models_ok=1
38
24
  fi
39
25
 
40
- # Exact-token match so a pin can't false-positive on a longer variant
41
- # (e.g. pin "composer-2.5" must not be satisfied by "composer-2.5-fast").
26
+ valid_pin() {
27
+ case "$1" in
28
+ ''|-*|*[!A-Za-z0-9._-]*) return 1 ;;
29
+ esac
30
+ [ "${#1}" -le 128 ]
31
+ }
32
+
42
33
  id_ok() {
43
- esc="$(printf '%s' "$1" | sed 's/[][\.^$*+?(){}|]/\\&/g')"
44
- grep -Eq "${esc}([^A-Za-z0-9._-]|$)" /tmp/cursor-models.log
34
+ escaped="$(printf '%s' "$1" | sed 's/[][\.^$*+?(){}|]/\\&/g')"
35
+ grep -Eq -- "${escaped}([^A-Za-z0-9._-]|$)" "$MODELS_LOG"
45
36
  }
46
37
 
47
- # --- pins verdict ------------------------------------------------------------
48
- pins="pins ok (composer=${CURSOR_COMPOSER_MODEL:-}, grok=${CURSOR_GROK_MODEL:-})"
49
- if [ -z "${CURSOR_COMPOSER_MODEL:-}" ] || [ -z "${CURSOR_GROK_MODEL:-}" ]; then
50
- pins="PINS MISSING run \`agent models\` and record CURSOR_COMPOSER_MODEL / CURSOR_GROK_MODEL in the environment variables"
38
+ pins="pins ready"
39
+ if [ -z "${CURSOR_GROK_MODEL:-}" ]; then
40
+ pins="pins missing"
41
+ elif ! valid_pin "$CURSOR_GROK_MODEL"; then
42
+ pins="pins invalid"
51
43
  elif [ "$models_ok" = "1" ]; then
52
- for id in "$CURSOR_COMPOSER_MODEL" "$CURSOR_GROK_MODEL"; do
53
- if ! id_ok "$id"; then
54
- pins="PIN NOT FOUND on this account: ${id} — re-run \`agent models\` and update the environment variable"
55
- break
56
- fi
57
- done
44
+ if ! id_ok "$CURSOR_GROK_MODEL"; then
45
+ pins="pins unavailable"
46
+ fi
58
47
  else
59
- pins="pins set (composer=${CURSOR_COMPOSER_MODEL}, grok=${CURSOR_GROK_MODEL}) — unvalidated (\`agent models\` unreachable)"
48
+ pins="pins unverified"
60
49
  fi
61
50
 
62
- # --- auth verdict: functional evidence over status text ----------------------
63
- if [ -s /tmp/cursor-status.log ] && ! grep -qi "not logged in" /tmp/cursor-status.log; then
64
- auth="interactive login present (${status_line})"
51
+ if [ "$models_ok" = "1" ]; then
52
+ auth="authentication reachable"
65
53
  elif [ -z "${CURSOR_API_KEY:-}" ]; then
66
- auth="AUTH DARK — no interactive login and no CURSOR_API_KEY set; add a USER API key in the environment settings"
67
- elif [ "$models_ok" = "1" ]; then
68
- auth="key-auth reachable (status 'Not logged in' is cosmetic under key auth)"
54
+ auth="authentication unavailable"
69
55
  else
70
- auth="key-auth UNVERIFIED — \`agent models\` unreachable (auth or network; see /tmp/cursor-models.log); if dispatches auth-fail, confirm the key is a USER API key, not admin"
56
+ auth="authentication unverified"
71
57
  fi
72
58
 
73
- echo "cursor.sh: bench lit — $(agent --version 2>/dev/null | head -n 1); ${auth}; ${pins}."
59
+ echo "cursor.sh: bench detected; ${auth}; ${pins}."
74
60
  exit 0