noonsight 0.0.1 → 0.1.0

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 (114) hide show
  1. package/.claude-plugin/marketplace.json +19 -0
  2. package/.claude-plugin/plugin.json +14 -0
  3. package/README.md +271 -9
  4. package/dist/src/adapters/claude-code/classifier.js +138 -0
  5. package/dist/src/adapters/claude-code/code-edit.js +108 -0
  6. package/dist/src/adapters/claude-code/compat.js +31 -0
  7. package/dist/src/adapters/claude-code/definitions.js +347 -0
  8. package/dist/src/adapters/claude-code/fork.js +132 -0
  9. package/dist/src/adapters/claude-code/hook.js +652 -0
  10. package/dist/src/adapters/claude-code/install.js +186 -0
  11. package/dist/src/adapters/claude-code/launch.js +270 -0
  12. package/dist/src/adapters/claude-code/launcher.js +252 -0
  13. package/dist/src/adapters/claude-code/locations.js +115 -0
  14. package/dist/src/adapters/claude-code/managed.js +75 -0
  15. package/dist/src/adapters/claude-code/plugin-files.js +88 -0
  16. package/dist/src/adapters/claude-code/plugins.js +117 -0
  17. package/dist/src/adapters/claude-code/pointer.js +48 -0
  18. package/dist/src/adapters/claude-code/predict.js +271 -0
  19. package/dist/src/adapters/claude-code/routing.js +88 -0
  20. package/dist/src/adapters/claude-code/settings.js +189 -0
  21. package/dist/src/adapters/claude-code/subagents.js +666 -0
  22. package/dist/src/adapters/claude-code/triggers.js +88 -0
  23. package/dist/src/cli.js +157 -0
  24. package/dist/src/commands/accept.js +115 -0
  25. package/dist/src/commands/check.js +529 -0
  26. package/dist/src/commands/hook.js +73 -0
  27. package/dist/src/commands/init.js +29 -0
  28. package/dist/src/commands/install.js +370 -0
  29. package/dist/src/commands/models.js +213 -0
  30. package/dist/src/commands/receives.js +84 -0
  31. package/dist/src/commands/report.js +386 -0
  32. package/dist/src/commands/resolve.js +32 -0
  33. package/dist/src/commands/run.js +168 -0
  34. package/dist/src/commands/trust.js +70 -0
  35. package/dist/src/commands/usage.js +10 -0
  36. package/dist/src/commands/watch.js +154 -0
  37. package/dist/src/config/create.js +51 -0
  38. package/dist/src/config/json-schema.js +207 -0
  39. package/dist/src/config/load.js +758 -0
  40. package/dist/src/config/paths.js +42 -0
  41. package/dist/src/config/preset-changes.js +190 -0
  42. package/dist/src/config/project.js +354 -0
  43. package/dist/src/config/rewrite.js +112 -0
  44. package/dist/src/core/backtracking.js +330 -0
  45. package/dist/src/core/classify.js +66 -0
  46. package/dist/src/core/normalize.js +24 -0
  47. package/dist/src/core/overlap.js +39 -0
  48. package/dist/src/core/regex-sample.js +278 -0
  49. package/dist/src/core/resolve.js +201 -0
  50. package/dist/src/core/route.js +93 -0
  51. package/dist/src/core/scope.js +77 -0
  52. package/dist/src/core/triggers.js +30 -0
  53. package/dist/src/core/types.js +74 -0
  54. package/dist/src/state/agents.js +200 -0
  55. package/dist/src/state/claims.js +80 -0
  56. package/dist/src/state/files.js +84 -0
  57. package/dist/src/state/installs.js +29 -0
  58. package/dist/src/state/log.js +90 -0
  59. package/dist/src/state/node.js +35 -0
  60. package/dist/src/state/sessions.js +109 -0
  61. package/dist/src/state/triggers.js +57 -0
  62. package/dist/src/version.js +24 -0
  63. package/dist/src/watch/service.js +172 -0
  64. package/dist/src/watch/watcher.js +130 -0
  65. package/dist/src/wording.js +11 -0
  66. package/hooks/hooks.json +118 -0
  67. package/package.json +57 -7
  68. package/presets/claude/SOURCES.md +485 -0
  69. package/presets/claude/preset.json +432 -0
  70. package/presets/claude/rules/fable-5-2/code-ownership.md +1 -0
  71. package/presets/claude/rules/fable-5-2/finish-work.md +1 -0
  72. package/presets/claude/rules/fable-5-2/low-context-report.md +1 -0
  73. package/presets/claude/rules/fable-5-2/progress-updates.md +1 -0
  74. package/presets/claude/rules/haiku-5-5/carry-through.md +1 -0
  75. package/presets/claude/rules/haiku-5-5/search-recent-facts.md +1 -0
  76. package/presets/claude/rules/haiku-5-5/verify-changes.md +1 -0
  77. package/presets/claude/rules/opus-5-5/explore-before-acting.md +1 -0
  78. package/presets/claude/rules/opus-5-5/progress-updates.md +1 -0
  79. package/presets/claude/rules/opus-5-5/unattended-run.md +1 -0
  80. package/presets/claude/rules/sonnet-5-5/carry-through.md +1 -0
  81. package/presets/claude/rules/sonnet-5-5/check-current-facts.md +1 -0
  82. package/presets/claude/rules/sonnet-5-5/ideas-first.md +1 -0
  83. package/presets/claude/rules/sonnet-5-5/no-self-review-rounds.md +1 -0
  84. package/presets/claude/rules/sonnet-5-5/stay-in-scope.md +1 -0
  85. package/presets/claude/rules/sonnet-5-5/verify-changes.md +1 -0
  86. package/presets/claude/versions/1.3.0/preset.json +432 -0
  87. package/presets/claude/versions/1.3.0/rules/fable-5-2/code-ownership.md +1 -0
  88. package/presets/claude/versions/1.3.0/rules/fable-5-2/finish-work.md +1 -0
  89. package/presets/claude/versions/1.3.0/rules/fable-5-2/low-context-report.md +1 -0
  90. package/presets/claude/versions/1.3.0/rules/fable-5-2/progress-updates.md +1 -0
  91. package/presets/claude/versions/1.3.0/rules/haiku-5-5/carry-through.md +1 -0
  92. package/presets/claude/versions/1.3.0/rules/haiku-5-5/search-recent-facts.md +1 -0
  93. package/presets/claude/versions/1.3.0/rules/haiku-5-5/verify-changes.md +1 -0
  94. package/presets/claude/versions/1.3.0/rules/opus-5-5/explore-before-acting.md +1 -0
  95. package/presets/claude/versions/1.3.0/rules/opus-5-5/progress-updates.md +1 -0
  96. package/presets/claude/versions/1.3.0/rules/opus-5-5/unattended-run.md +1 -0
  97. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/carry-through.md +1 -0
  98. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/check-current-facts.md +1 -0
  99. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/ideas-first.md +1 -0
  100. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/no-self-review-rounds.md +1 -0
  101. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/stay-in-scope.md +1 -0
  102. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/verify-changes.md +1 -0
  103. package/schema/noonsight-project.schema.json +394 -0
  104. package/schema/noonsight.schema.json +425 -0
  105. package/schema/preset.schema.json +194 -0
  106. package/scripts/noonsight +68 -0
  107. package/skills/accept/SKILL.md +11 -0
  108. package/skills/check/SKILL.md +11 -0
  109. package/skills/models/SKILL.md +11 -0
  110. package/skills/report/SKILL.md +11 -0
  111. package/skills/resolve/SKILL.md +12 -0
  112. package/skills/setup/SKILL.md +15 -0
  113. package/skills/trust/SKILL.md +12 -0
  114. package/skills/untrust/SKILL.md +12 -0
@@ -0,0 +1,394 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://unpkg.com/noonsight@0/schema/noonsight-project.schema.json",
4
+ "title": "noonsight project configuration",
5
+ "description": "A project's noonsight configuration, committed at .noonsight/noonsight.json in the repository. It is laid over the machine's configuration for the sessions that run in the project, once the account trusts the project with noonsight trust, and only as far as the machine's \"projects.allow\" permits. It takes the keys of the machine's configuration except preset, preset_version and on_preset_change, which follow the installed package, and projects. Paths inside the file are relative to the file itself.",
6
+ "type": "object",
7
+ "required": ["version"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "$schema": { "type": "string" },
11
+ "version": {
12
+ "description": "Format version of this file.",
13
+ "const": 1
14
+ },
15
+ "models": {
16
+ "description": "The models declared active, keyed by full model identifier (for example claude-fable-5-2). A model missing from this map is undeclared.",
17
+ "type": "object",
18
+ "propertyNames": {
19
+ "pattern": "^(?:(?=.*[0-9])[a-z0-9]+(?:[-.][a-z0-9]+)*|[a-z0-9.*?-]*[*?][a-z0-9.*?-]*)$",
20
+ "x-hint": "a model key is a full lowercase model identifier with its version, such as claude-fable-5-2, or a wildcard pattern such as claude-opus-4-*"
21
+ },
22
+ "patternProperties": {
23
+ "^(?=.*[0-9])[a-z0-9]+(?:[-.][a-z0-9]+)*$": { "$ref": "#/$defs/modelEntry" },
24
+ "^[a-z0-9.*?-]*[*?][a-z0-9.*?-]*$": { "$ref": "#/$defs/wildcardEntry" }
25
+ },
26
+ "additionalProperties": false,
27
+ "default": {}
28
+ },
29
+ "all_models": {
30
+ "description": "Rules for every model, in one place: team conventions, commit style, anything that is not specific to a model. They go to every model declared under \"models\" with \"use\": \"preset\" or \"use\": \"custom\", after the preset's rules and before the model's own \"add\". A model declared with \"use\": \"none\", and a wildcard key, receive none of them. A rule id must be new for every such model.",
31
+ "type": "object",
32
+ "required": ["add"],
33
+ "additionalProperties": false,
34
+ "properties": {
35
+ "add": {
36
+ "description": "The user's own rule files, with the same keys as \"models.<id>.add\".",
37
+ "type": "array",
38
+ "minItems": 1,
39
+ "items": { "$ref": "#/$defs/userRule" }
40
+ }
41
+ }
42
+ },
43
+ "on_undeclared": {
44
+ "description": "What to do when a model has no entry in \"models\". There is deliberately no option to block.",
45
+ "enum": ["warn", "ignore"],
46
+ "default": "warn"
47
+ },
48
+ "scopes": {
49
+ "description": "Task scopes the user declares, added to the preset's scopes. A scope with the same name as a preset scope replaces only the keys given here. A session takes its scope from NOONSIGHT_SCOPE; a subagent from the scope whose matcher matches earliest in its task.",
50
+ "type": "object",
51
+ "propertyNames": {
52
+ "pattern": "^[a-z][a-z0-9-]*$",
53
+ "x-hint": "a scope name is lowercase letters, digits and hyphens, starting with a letter"
54
+ },
55
+ "additionalProperties": { "$ref": "#/$defs/scope" },
56
+ "default": {}
57
+ },
58
+ "session": {
59
+ "description": "How a session, as opposed to a subagent, is told apart.",
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "properties": {
63
+ "unattended_when_env": {
64
+ "description": "Environment variables that mark a session as unattended (the place \"unattended\") when any of them is set and not empty in the environment Claude Code runs in. With none set, a session is in the place \"attended\", unless it runs headless and \"headless_is_unattended\" is true.",
65
+ "type": "array",
66
+ "uniqueItems": true,
67
+ "items": {
68
+ "type": "string",
69
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
70
+ "x-hint": "an environment variable name is letters, digits and underscores, not starting with a digit"
71
+ },
72
+ "default": []
73
+ },
74
+ "headless_is_unattended": {
75
+ "description": "Whether a headless run, such as claude -p or the Agent SDK, is in the place \"unattended\": nobody can answer it mid-turn. Claude Code marks such a run in the environment of its hooks. false leaves it in the place \"attended\" unless a variable of \"unattended_when_env\" is set.",
76
+ "type": "boolean",
77
+ "default": true
78
+ }
79
+ },
80
+ "default": {}
81
+ },
82
+ "subagents": {
83
+ "description": "How the subagents a session opens get the rules for the model each one runs on.",
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "properties": {
87
+ "delivery": {
88
+ "description": "prompt: each subagent receives the rules for the model it runs on when it starts. off: subagents are left alone.",
89
+ "enum": ["prompt", "off"],
90
+ "default": "prompt"
91
+ },
92
+ "permission": {
93
+ "description": "The permission decision returned with a call whose model or effort routing changed. allow: the call runs without a permission prompt, though deny and ask rules still apply. ask: the person confirms each such call. passthrough: no decision, so the session's permission mode decides, and auto mode can deny a changed call.",
94
+ "enum": ["allow", "ask", "passthrough"],
95
+ "default": "allow"
96
+ },
97
+ "on_mismatch": {
98
+ "description": "What to do when a subagent starts on another model than the one noonsight chose its rules for. The decision log records it either way.",
99
+ "enum": ["warn", "ignore"],
100
+ "default": "warn"
101
+ }
102
+ },
103
+ "default": {}
104
+ },
105
+ "routing": {
106
+ "description": "Optional routing: choose the model and effort for a task from its scope. Off unless enabled. Whether or not a route applies, the scope and the rules are decided the same way, and the rules follow the model the task runs on.",
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "properties": {
110
+ "enabled": {
111
+ "description": "Turns routing on. With false, noonsight only delivers rules and never changes a model or an effort.",
112
+ "type": "boolean",
113
+ "default": false
114
+ },
115
+ "targets": {
116
+ "description": "Where routing acts. launcher: noonsight run adds --model and --effort to the claude command line. subagents: the agent call hook sets the call's model and effort.",
117
+ "type": "array",
118
+ "minItems": 1,
119
+ "uniqueItems": true,
120
+ "items": { "enum": ["launcher", "subagents"] },
121
+ "default": ["launcher", "subagents"]
122
+ },
123
+ "respect_explicit": {
124
+ "description": "With true, a model the caller already chose wins over the table: a --model on the claude command line, the model parameter of an agent call, or the model a subagent definition or a built-in subagent sets. An effort the caller set is kept too.",
125
+ "type": "boolean",
126
+ "default": true
127
+ },
128
+ "yield_when_env": {
129
+ "description": "Environment variables that mark a session someone else routes, such as an orchestrator's. When any of them is set and not empty, routing yields; the rules are still delivered.",
130
+ "type": "array",
131
+ "uniqueItems": true,
132
+ "items": {
133
+ "type": "string",
134
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
135
+ "x-hint": "an environment variable name is letters, digits and underscores, not starting with a digit"
136
+ },
137
+ "default": []
138
+ },
139
+ "table": {
140
+ "description": "Scope name to a row of options in order of preference. Each row replaces the preset's row for the same scope. The first option whose model is declared under \"models\" wins.",
141
+ "type": "object",
142
+ "propertyNames": {
143
+ "pattern": "^[a-z][a-z0-9-]*$",
144
+ "x-hint": "a scope name is lowercase letters, digits and hyphens, starting with a letter"
145
+ },
146
+ "additionalProperties": { "type": ["array", "object"], "$ref": "#/$defs/routeRow" },
147
+ "default": {}
148
+ },
149
+ "default": {
150
+ "description": "The row for a task with no scope, or whose scope has no row for the target. inherit leaves the model and the effort as they are.",
151
+ "type": ["string", "array", "object"],
152
+ "$ref": "#/$defs/routeRow",
153
+ "if": { "type": "string" },
154
+ "then": { "const": "inherit", "x-hint": "the only text value is \"inherit\"" },
155
+ "default": "inherit"
156
+ }
157
+ },
158
+ "default": {}
159
+ },
160
+ "classifier": {
161
+ "description": "Optional: a small model, asked through `claude -p` with the login Claude Code already has, picks the scope of a task that no explicit scope placed. Off unless a mode is set. A classification that fails, takes longer than timeout_ms, or answers outside the declared scopes gives the task no scope, and the decision log records why.",
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "properties": {
165
+ "mode": {
166
+ "description": "off: never classify. fallback: classify a task that no explicit scope and no matcher placed. always: classify every task without an explicit scope, over the matchers; meant for comparing the two.",
167
+ "enum": ["off", "fallback", "always"],
168
+ "default": "off"
169
+ },
170
+ "model": {
171
+ "description": "The model the classifier runs on, as claude --model takes it: an alias such as haiku, or a model identifier.",
172
+ "type": "string",
173
+ "minLength": 1,
174
+ "default": "haiku"
175
+ },
176
+ "effort": {
177
+ "description": "The effort level the classifier runs at.",
178
+ "enum": ["low", "medium", "high", "xhigh", "max"],
179
+ "default": "low"
180
+ },
181
+ "timeout_ms": {
182
+ "description": "How long, in milliseconds, a classification may take before the task gets no scope. At most 8000, so that the agent call hook, which Claude Code stops after 10 seconds, still answers in time.",
183
+ "type": "integer",
184
+ "minimum": 1000,
185
+ "maximum": 8000,
186
+ "default": 8000
187
+ }
188
+ },
189
+ "default": {}
190
+ }
191
+ },
192
+ "$defs": {
193
+ "modelEntry": {
194
+ "description": "How a model gets its rules in this project. An entry with the machine's \"use\", or with none, is merged into the machine's entry: enable and disable by rule id, the project's choice winning, and add after the machine's rules. An entry with another \"use\" replaces the machine's entry.",
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "properties": {
198
+ "use": {
199
+ "description": "preset: the preset's rules for this exact model. custom: only the rules in \"add\". none: decided that this model needs no rules. Left out, the machine's \"use\" applies, and the entry applies only where the machine declares the model with \"preset\" or \"custom\".",
200
+ "enum": ["preset", "custom", "none"]
201
+ },
202
+ "enable": {
203
+ "description": "Preset rules, off by default, to turn on.",
204
+ "type": "array",
205
+ "uniqueItems": true,
206
+ "items": { "$ref": "#/$defs/ruleId" }
207
+ },
208
+ "disable": {
209
+ "description": "Preset rules, on by default, to turn off.",
210
+ "type": "array",
211
+ "uniqueItems": true,
212
+ "items": { "$ref": "#/$defs/ruleId" }
213
+ },
214
+ "add": {
215
+ "description": "The user's own rule files, delivered after the preset's rules and the rules of \"all_models\". A rule that replaces a preset rule is delivered in that rule's place instead.",
216
+ "type": "array",
217
+ "items": { "$ref": "#/$defs/modelRule" }
218
+ }
219
+ },
220
+ "allOf": [
221
+ {
222
+ "if": { "required": ["use"], "properties": { "use": { "const": "none" } } },
223
+ "then": {
224
+ "properties": { "use": true },
225
+ "additionalProperties": false,
226
+ "x-hint": "a model declared with \"use\": \"none\" takes no other key"
227
+ }
228
+ },
229
+ {
230
+ "if": { "required": ["use"], "properties": { "use": { "const": "custom" } } },
231
+ "then": {
232
+ "required": ["add"],
233
+ "properties": {
234
+ "use": true,
235
+ "add": {
236
+ "minItems": 1,
237
+ "items": {
238
+ "properties": { "id": true, "file": true, "scopes": true, "where": true, "triggers": true },
239
+ "additionalProperties": false,
240
+ "x-hint": "\"replaces\" names a preset rule, so it is only for a model declared with \"use\": \"preset\""
241
+ }
242
+ }
243
+ },
244
+ "additionalProperties": false,
245
+ "x-hint": "a model declared with \"use\": \"custom\" takes only \"add\", with at least one rule"
246
+ }
247
+ }
248
+ ]
249
+ },
250
+ "wildcardEntry": {
251
+ "description": "A wildcard key only declares models that need no rules. Rules always need the exact model identifier, so a new model version never inherits rules written for an earlier one.",
252
+ "type": "object",
253
+ "required": ["use"],
254
+ "additionalProperties": false,
255
+ "properties": {
256
+ "use": {
257
+ "const": "none",
258
+ "x-hint": "a wildcard key only accepts {\"use\": \"none\"}; give rules under the exact model identifier"
259
+ }
260
+ },
261
+ "x-hint": "a wildcard key only accepts {\"use\": \"none\"}; give rules under the exact model identifier"
262
+ },
263
+ "userRule": {
264
+ "type": "object",
265
+ "required": ["id", "file"],
266
+ "additionalProperties": false,
267
+ "properties": {
268
+ "id": { "$ref": "#/$defs/ruleId" },
269
+ "file": {
270
+ "description": "Path to the rule text, relative to this configuration file. It must stay inside the project directory, symlinks followed: a trusted project must not read other files of the account into the model's context, and a path outside the repository exists only on one person's machine.",
271
+ "type": "string",
272
+ "minLength": 1
273
+ },
274
+ "scopes": {
275
+ "description": "Scopes the rule applies to, or [\"*\"] for every scope.",
276
+ "$ref": "#/$defs/ruleScopes",
277
+ "default": ["*"]
278
+ },
279
+ "where": {
280
+ "description": "Places the rule applies to: \"attended\", \"unattended\" and \"subagent\", or [\"all\"] for every place.",
281
+ "$ref": "#/$defs/ruleWhere",
282
+ "default": ["all"]
283
+ },
284
+ "triggers": {
285
+ "description": "Actions that also deliver the rule to a session whose scope is not one of the rule's scopes, once the session does one of them. code-edit: the session edited a code file the project's git already tracks. Only for a rule that is cheap when the action was not what the scopes mean, and never for a rule for every scope.",
286
+ "$ref": "#/$defs/ruleTriggers",
287
+ "default": []
288
+ }
289
+ }
290
+ },
291
+ "ruleScopes": {
292
+ "type": "array",
293
+ "minItems": 1,
294
+ "uniqueItems": true,
295
+ "items": { "$ref": "#/$defs/scopeRef" }
296
+ },
297
+ "ruleWhere": {
298
+ "type": "array",
299
+ "minItems": 1,
300
+ "uniqueItems": true,
301
+ "items": { "$ref": "#/$defs/place" }
302
+ },
303
+ "ruleTriggers": {
304
+ "type": "array",
305
+ "uniqueItems": true,
306
+ "items": { "$ref": "#/$defs/trigger" }
307
+ },
308
+ "modelRule": {
309
+ "description": "A rule of a model's own \"add\": a user rule, which may also replace one of the model's preset rules.",
310
+ "type": "object",
311
+ "required": ["id", "file"],
312
+ "additionalProperties": false,
313
+ "properties": {
314
+ "id": { "$ref": "#/$defs/userRule/properties/id" },
315
+ "file": { "$ref": "#/$defs/userRule/properties/file" },
316
+ "scopes": {
317
+ "$ref": "#/$defs/ruleScopes",
318
+ "description": "Scopes the rule applies to, or [\"*\"] for every scope. Defaults to [\"*\"], or, with \"replaces\", to the scopes of the rule it replaces."
319
+ },
320
+ "where": {
321
+ "$ref": "#/$defs/ruleWhere",
322
+ "description": "Places the rule applies to. Defaults to all three, or, with \"replaces\", to the places of the rule it replaces."
323
+ },
324
+ "triggers": {
325
+ "$ref": "#/$defs/ruleTriggers",
326
+ "description": "Actions that also deliver the rule to a session whose scope is not one of the rule's scopes, once the session does one of them; see \"triggers\" of a user rule. Defaults to none, or, with \"replaces\", to the triggers of the rule it replaces."
327
+ },
328
+ "replaces": {
329
+ "description": "The id of a preset rule of this model that this rule replaces: the preset rule is off, and this rule is delivered in its place, with its scopes, places and triggers unless this rule gives its own. An id the preset rule had before a rename still names it. Only for a model declared with \"use\": \"preset\".",
330
+ "$ref": "#/$defs/ruleId"
331
+ }
332
+ }
333
+ },
334
+ "scope": {
335
+ "type": "object",
336
+ "additionalProperties": false,
337
+ "properties": {
338
+ "description": {
339
+ "description": "What kind of task this scope covers.",
340
+ "type": "string",
341
+ "minLength": 1
342
+ },
343
+ "match": {
344
+ "description": "Regular expressions (JavaScript syntax, case-insensitive, Unicode-aware) matched against a subagent's description and task text. The scope whose matcher matches earliest wins; at the same place, the scope declared first.",
345
+ "type": "array",
346
+ "uniqueItems": true,
347
+ "items": { "type": "string", "minLength": 1 }
348
+ }
349
+ }
350
+ },
351
+ "routeRow": {
352
+ "description": "Options in order of preference: one list for every target, or an object with a list for each target it routes. A target the object leaves out falls to routing.default; an empty list means that target is not routed.",
353
+ "items": { "$ref": "#/$defs/routeOption" },
354
+ "properties": {
355
+ "launcher": { "type": "array", "items": { "$ref": "#/$defs/routeOption" } },
356
+ "subagents": { "type": "array", "items": { "$ref": "#/$defs/routeOption" } }
357
+ },
358
+ "additionalProperties": false
359
+ },
360
+ "routeOption": {
361
+ "type": "object",
362
+ "required": ["model"],
363
+ "additionalProperties": false,
364
+ "properties": {
365
+ "model": {
366
+ "description": "A model alias (fable, opus, sonnet, haiku) or a model identifier declared under \"models\". An option is used only when the model it selects is declared.",
367
+ "type": "string",
368
+ "pattern": "^[a-z0-9]+(?:[-.][a-z0-9]+)*$"
369
+ },
370
+ "effort": {
371
+ "description": "The effort level to set with the model. Left out, the effort is not changed.",
372
+ "enum": ["low", "medium", "high", "xhigh", "max"]
373
+ }
374
+ }
375
+ },
376
+ "ruleId": {
377
+ "type": "string",
378
+ "pattern": "^[a-z0-9][a-z0-9._-]*(?:/[a-z0-9][a-z0-9._-]*)*$",
379
+ "x-hint": "a rule id is lowercase segments separated by \"/\", such as team/commit-style"
380
+ },
381
+ "scopeRef": {
382
+ "type": "string",
383
+ "pattern": "^(?:\\*|[a-z][a-z0-9-]*)$"
384
+ },
385
+ "trigger": {
386
+ "description": "code-edit: the session edited, with Edit or Write, a file with a code extension that the git repository of the session's project, or of one of its worktrees, already tracks.",
387
+ "enum": ["code-edit"]
388
+ },
389
+ "place": {
390
+ "description": "attended: a session someone is watching. unattended: a session nobody is watching. subagent: a subagent's task. all: every place, listed alone. session: the earlier name of attended, still read.",
391
+ "enum": ["attended", "unattended", "subagent", "all", "session"]
392
+ }
393
+ }
394
+ }