@cursor/july 0.1.103 → 0.1.104

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 (186) hide show
  1. package/dist/channels/change-monitors/change-monitors-channel.d.ts +5 -0
  2. package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -0
  3. package/dist/channels/change-monitors/change-monitors-channel.js +41 -0
  4. package/dist/channels/change-monitors/index.d.ts +4 -0
  5. package/dist/channels/change-monitors/index.d.ts.map +1 -0
  6. package/dist/channels/change-monitors/index.js +2 -0
  7. package/dist/channels/change-monitors/types.d.ts +39 -0
  8. package/dist/channels/change-monitors/types.d.ts.map +1 -0
  9. package/dist/channels/change-monitors/types.js +1 -0
  10. package/dist/channels/github/defaults.d.ts.map +1 -1
  11. package/dist/channels/github/defaults.js +4 -0
  12. package/dist/channels/github/progress.d.ts +22 -0
  13. package/dist/channels/github/progress.d.ts.map +1 -1
  14. package/dist/channels/github/progress.js +32 -5
  15. package/dist/channels/issues/index.d.ts +4 -0
  16. package/dist/channels/issues/index.d.ts.map +1 -0
  17. package/dist/channels/issues/index.js +2 -0
  18. package/dist/channels/issues/issues-channel.d.ts +5 -0
  19. package/dist/channels/issues/issues-channel.d.ts.map +1 -0
  20. package/dist/channels/issues/issues-channel.js +37 -0
  21. package/dist/channels/issues/types.d.ts +33 -0
  22. package/dist/channels/issues/types.d.ts.map +1 -0
  23. package/dist/channels/issues/types.js +1 -0
  24. package/dist/docs/404.html +2 -2
  25. package/dist/docs/ab.html +4 -4
  26. package/dist/docs/assets/{app.DW9pXkpL.js → app.DbMWUyGb.js} +1 -1
  27. package/dist/docs/assets/chunks/@localSearchIndexroot.Bqsulb9K.js +1 -0
  28. package/dist/docs/assets/chunks/{VPLocalSearchBox.CdEIUwDg.js → VPLocalSearchBox.DcNeTh9o.js} +1 -1
  29. package/dist/docs/assets/chunks/{theme.YZMHgPgg.js → theme.DMjhY3gl.js} +2 -2
  30. package/dist/docs/assets/{guides_github.md.DKYiT9do.js → guides_github.md.c0gdGJ-D.js} +1 -1
  31. package/dist/docs/assets/{guides_github.md.DKYiT9do.lean.js → guides_github.md.c0gdGJ-D.lean.js} +1 -1
  32. package/dist/docs/assets/{reference_channels.md.Dz8Cnudp.js → reference_channels.md.DBGcaB7m.js} +2 -2
  33. package/dist/docs/assets/{reference_channels.md.Dz8Cnudp.lean.js → reference_channels.md.DBGcaB7m.lean.js} +1 -1
  34. package/dist/docs/building-with-agents.html +4 -4
  35. package/dist/docs/concepts.html +4 -4
  36. package/dist/docs/deployment.html +4 -4
  37. package/dist/docs/design/filesystem.md +376 -0
  38. package/dist/docs/evals.html +4 -4
  39. package/dist/docs/guides/agent-to-agent.html +4 -4
  40. package/dist/docs/guides/cloud-agents.html +4 -4
  41. package/dist/docs/guides/convert-automation.html +4 -4
  42. package/dist/docs/guides/github.html +6 -6
  43. package/dist/docs/guides/github.md +5 -0
  44. package/dist/docs/guides/human-in-the-loop.html +4 -4
  45. package/dist/docs/guides/mcp-oauth.html +4 -4
  46. package/dist/docs/guides/opentelemetry.html +4 -4
  47. package/dist/docs/guides/slack.html +4 -4
  48. package/dist/docs/guides/webhooks.html +4 -4
  49. package/dist/docs/hashmap.json +1 -1
  50. package/dist/docs/hillclimbing.html +4 -4
  51. package/dist/docs/index.html +4 -4
  52. package/dist/docs/llms-full.txt +406 -0
  53. package/dist/docs/llms.txt +1 -0
  54. package/dist/docs/quickstart.html +4 -4
  55. package/dist/docs/reference/agent-config.html +4 -4
  56. package/dist/docs/reference/artifacts.html +4 -4
  57. package/dist/docs/reference/channels.html +6 -6
  58. package/dist/docs/reference/channels.md +20 -0
  59. package/dist/docs/reference/cli.html +4 -4
  60. package/dist/docs/reference/connections.html +4 -4
  61. package/dist/docs/reference/extensions.html +4 -4
  62. package/dist/docs/reference/hooks.html +4 -4
  63. package/dist/docs/reference/http-api.html +4 -4
  64. package/dist/docs/reference/instructions.html +4 -4
  65. package/dist/docs/reference/playground.html +4 -4
  66. package/dist/docs/reference/project-layout.html +4 -4
  67. package/dist/docs/reference/prompt.html +4 -4
  68. package/dist/docs/reference/result.html +4 -4
  69. package/dist/docs/reference/schedules.html +4 -4
  70. package/dist/docs/reference/sessions.html +4 -4
  71. package/dist/docs/reference/skills.html +4 -4
  72. package/dist/docs/reference/subagents.html +4 -4
  73. package/dist/docs/reference/tools.html +4 -4
  74. package/dist/docs/scaffolding-agents.html +4 -4
  75. package/dist/docs/skills/ab.html +4 -4
  76. package/dist/docs/skills/create-agent.html +4 -4
  77. package/dist/docs/skills/debug.html +4 -4
  78. package/dist/docs/skills/evals.html +4 -4
  79. package/dist/docs/skills/framework-map.html +4 -4
  80. package/dist/docs/skills/github.html +4 -4
  81. package/dist/docs/skills/hillclimb.html +4 -4
  82. package/dist/docs/skills/index.html +4 -4
  83. package/dist/docs/skills/mcp-auth.html +4 -4
  84. package/dist/docs/skills/otel.html +4 -4
  85. package/dist/docs/skills/setup-slack.html +4 -4
  86. package/dist/docs/storage.html +4 -4
  87. package/dist/docs/templates/agentic-owners.html +4 -4
  88. package/dist/docs/templates/agents-md.html +4 -4
  89. package/dist/docs/templates/code-wiki.html +4 -4
  90. package/dist/docs/templates/demo.html +4 -4
  91. package/dist/docs/templates/pr-autofixer.html +4 -4
  92. package/dist/docs/templates/security-help.html +4 -4
  93. package/dist/docs/templates/security-reviewer.html +4 -4
  94. package/dist/docs/templates/triage.html +4 -4
  95. package/dist/docs/troubleshooting.html +4 -4
  96. package/dist/filesystem.d.ts +440 -0
  97. package/dist/filesystem.d.ts.map +1 -0
  98. package/dist/filesystem.js +1694 -0
  99. package/dist/index.d.ts +2 -0
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +1 -0
  102. package/dist/internal/continuation-channel.d.ts +4 -2
  103. package/dist/internal/continuation-channel.d.ts.map +1 -1
  104. package/dist/internal/continuation-channel.js +21 -12
  105. package/dist/internal/continuation-identity.d.ts +13 -5
  106. package/dist/internal/continuation-identity.d.ts.map +1 -1
  107. package/dist/internal/continuation-identity.js +74 -35
  108. package/dist/internal/discovery/agent.d.ts.map +1 -1
  109. package/dist/internal/discovery/agent.js +80 -8
  110. package/dist/internal/discovery/info.d.ts.map +1 -1
  111. package/dist/internal/discovery/info.js +3 -0
  112. package/dist/internal/factory-resource-channel.d.ts +33 -0
  113. package/dist/internal/factory-resource-channel.d.ts.map +1 -0
  114. package/dist/internal/factory-resource-channel.js +77 -0
  115. package/dist/internal/filesystem/errors.d.ts +64 -0
  116. package/dist/internal/filesystem/errors.d.ts.map +1 -0
  117. package/dist/internal/filesystem/errors.js +175 -0
  118. package/dist/internal/filesystem/format.d.ts +28 -0
  119. package/dist/internal/filesystem/format.d.ts.map +1 -0
  120. package/dist/internal/filesystem/format.js +213 -0
  121. package/dist/internal/filesystem/merge.d.ts +34 -0
  122. package/dist/internal/filesystem/merge.d.ts.map +1 -0
  123. package/dist/internal/filesystem/merge.js +196 -0
  124. package/dist/internal/filesystem/scratch.d.ts +59 -0
  125. package/dist/internal/filesystem/scratch.d.ts.map +1 -0
  126. package/dist/internal/filesystem/scratch.js +212 -0
  127. package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
  128. package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
  129. package/dist/internal/filesystem/sdk-schemas.js +153 -0
  130. package/dist/internal/filesystem/tools.d.ts +42 -0
  131. package/dist/internal/filesystem/tools.d.ts.map +1 -0
  132. package/dist/internal/filesystem/tools.js +618 -0
  133. package/dist/internal/filesystem/walk.d.ts +74 -0
  134. package/dist/internal/filesystem/walk.d.ts.map +1 -0
  135. package/dist/internal/filesystem/walk.js +339 -0
  136. package/dist/internal/guest-network.d.ts +5 -2
  137. package/dist/internal/guest-network.d.ts.map +1 -1
  138. package/dist/internal/guest-network.js +7 -2
  139. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  140. package/dist/internal/hosted-delivery.js +12 -2
  141. package/dist/internal/sdk-runner.d.ts +1 -1
  142. package/dist/internal/sdk-runner.d.ts.map +1 -1
  143. package/dist/internal/sdk-runner.js +3 -1
  144. package/dist/internal/session-engine.d.ts +22 -0
  145. package/dist/internal/session-engine.d.ts.map +1 -1
  146. package/dist/internal/session-engine.js +362 -40
  147. package/dist/internal/testing/factory-resource-fixtures.d.ts +48 -0
  148. package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
  149. package/dist/internal/testing/factory-resource-fixtures.js +41 -0
  150. package/dist/playground/assets/{index-59KvgREd.js → index-8YiozU89.js} +38 -38
  151. package/dist/playground/index.html +1 -1
  152. package/dist/types.d.ts +51 -3
  153. package/dist/types.d.ts.map +1 -1
  154. package/docs/design/filesystem.md +376 -0
  155. package/docs/guides/github.md +5 -0
  156. package/docs/reference/channels.md +20 -0
  157. package/package.json +16 -2
  158. package/src/channels/change-monitors/change-monitors-channel.ts +62 -0
  159. package/src/channels/change-monitors/index.ts +8 -0
  160. package/src/channels/change-monitors/types.ts +44 -0
  161. package/src/channels/github/defaults.ts +4 -0
  162. package/src/channels/github/progress.ts +76 -10
  163. package/src/channels/issues/index.ts +9 -0
  164. package/src/channels/issues/issues-channel.ts +51 -0
  165. package/src/channels/issues/types.ts +41 -0
  166. package/src/filesystem.ts +2074 -0
  167. package/src/index.ts +28 -0
  168. package/src/internal/continuation-channel.ts +29 -12
  169. package/src/internal/continuation-identity.ts +122 -37
  170. package/src/internal/discovery/agent.ts +87 -1
  171. package/src/internal/discovery/info.ts +3 -0
  172. package/src/internal/factory-resource-channel.ts +122 -0
  173. package/src/internal/filesystem/errors.ts +220 -0
  174. package/src/internal/filesystem/format.ts +276 -0
  175. package/src/internal/filesystem/merge.ts +195 -0
  176. package/src/internal/filesystem/scratch.ts +255 -0
  177. package/src/internal/filesystem/sdk-schemas.ts +204 -0
  178. package/src/internal/filesystem/tools.ts +821 -0
  179. package/src/internal/filesystem/walk.ts +369 -0
  180. package/src/internal/guest-network.ts +8 -2
  181. package/src/internal/hosted-delivery.ts +18 -1
  182. package/src/internal/sdk-runner.ts +4 -0
  183. package/src/internal/session-engine.ts +439 -29
  184. package/src/internal/testing/factory-resource-fixtures.ts +85 -0
  185. package/src/types.ts +49 -3
  186. package/dist/docs/assets/chunks/@localSearchIndexroot.nrl1ifBq.js +0 -1
@@ -1089,6 +1089,387 @@ Continue with these pages:
1089
1089
 
1090
1090
  ---
1091
1091
 
1092
+ Source: /docs/design/filesystem.md
1093
+
1094
+ # One FileSystem for every Agent SDK agent
1095
+
1096
+ > **Status:** first implementation, this PR. `@cursor/july` only.
1097
+ > No Cursor SDK change.
1098
+ > **Audience:** Agent SDK maintainers.
1099
+
1100
+ Every local turn binds a **FileSystem** and synthesizes native file
1101
+ tools from it. There is no "is there an override?" branch on the
1102
+ tool path. Authors pick the tree with `root`. Omit `root` and the
1103
+ tree is the host disk, through internal `localFileSystem`.
1104
+
1105
+ ```ts
1106
+ // Host disk. Relative paths resolve against the harness cwd.
1107
+ export default defineAgent({
1108
+ name: "reviewer",
1109
+ });
1110
+
1111
+ // Override. The model sees only this tree. Paths are posix `/`.
1112
+ export default defineAgent({
1113
+ name: "notes",
1114
+ root: tempFs({ "/notes.md": "hello" }),
1115
+ });
1116
+ ```
1117
+
1118
+ ---
1119
+
1120
+ ## Names
1121
+
1122
+ | Name | Kind | Meaning |
1123
+ | --- | --- | --- |
1124
+ | `FileSystem` | Type on `@cursor/july` | Path verbs. Authors provide this. |
1125
+ | `root` | Field on `defineAgent` | The FileSystem the agent runs on. Omit it and the root is the host disk. |
1126
+
1127
+ No `root()` method and no public `Workspace` type.
1128
+ `local.workspaceDir` stays the harness cwd. `workspaceFiles` stays
1129
+ per-send seed files. Those names are not the path namespace.
1130
+
1131
+ Do not pass `local.root` into `Agent.create`. The published SDK
1132
+ does not have that field.
1133
+
1134
+ ---
1135
+
1136
+ ## FileSystem
1137
+
1138
+ ```ts
1139
+ interface FileSystem {
1140
+ list(prefix?: string): AsyncIterable<DirEntry>;
1141
+ stat(path: string): Promise<FileInfo>;
1142
+ glob(pattern: string, dir?: string): AsyncIterable<DirEntry>;
1143
+ read(path: string): Promise<string | Uint8Array>;
1144
+ grep(query: GrepQuery): AsyncIterable<GrepResult>;
1145
+ write(path: string, contents: string): Promise<void>;
1146
+ delete(path: string): Promise<void>;
1147
+ search(query: SearchQuery): AsyncIterable<SearchResult>;
1148
+ }
1149
+ ```
1150
+
1151
+ Every method is required. A tree without an index yields nothing
1152
+ from `search`. Methods do not fall back to the host tree.
1153
+ Diagnostics are not a FileSystem verb.
1154
+
1155
+ Path verbs take a path (and contents for `write`). Bags with two
1156
+ or more independent options (`grep`, `search`) take a
1157
+ named query object.
1158
+
1159
+ `read` returns text as a string, or image bytes as a
1160
+ `Uint8Array` (`jpeg` / `png` / `gif` / `webp`). Native Read
1161
+ applies `offset` / `limit` and numbers lines on text. Images
1162
+ become a base64 image content part, the same shape the Cursor
1163
+ harness sends the model.
1164
+
1165
+ FileSystem methods throw; they do not return a status envelope.
1166
+ `@cursor/july` does not export `FileSystemResult`.
1167
+
1168
+ ### Paths
1169
+
1170
+ Authored `root` (`tempFs`, `unionFs`, `overlayFs`, `hostFs`, a custom tree) is one posix
1171
+ namespace rooted at `/`. Query paths and yielded paths are
1172
+ absolute (`/src/a.ts`). No trailing slash except `/`. `""`, `"/"`,
1173
+ and an omitted optional scope mean the root. Prefix tests are
1174
+ path-segment: `/agent` matches `/agent/skills`, not
1175
+ `/agent-tools`. `normalizeFsPath` resolves `..`. `/tmp` is
1176
+ reserved for turn-local scratch. See `/tmp` scratch.
1177
+
1178
+ Host-default `localFileSystem` follows Cursor SDK natives:
1179
+ relative paths resolve against the harness cwd; absolute paths
1180
+ are used as-is. Yielded paths are host paths, not rewritten to
1181
+ `/`. `search` is empty (no host index).
1182
+
1183
+ ### Iterators
1184
+
1185
+ Async iterators are already sorted. `unionFs` k-way merges them
1186
+ and does not re-sort a source.
1187
+
1188
+ - `list` / `glob`: lexicographic by `path`. Paths are unique.
1189
+ - `grep`: by `path`, then `lineNumber` ascending. Keep every hit.
1190
+ - `search`: by `score` descending, then `path` ascending.
1191
+
1192
+ A file is not under itself, so listing a file path is empty.
1193
+ Empty `list` is not "missing"; `stat` answers that.
1194
+
1195
+ `glob(pattern, dir?)` matches relative to `dir`, not
1196
+ basename-anywhere (`*.ts` under `/src` is `/src/a.ts`, not
1197
+ `/src/nested/c.ts`).
1198
+
1199
+ `grep` has no `output_mode` or `offset`. A slash-free `glob`
1200
+ (`*.ts`) matches the basename at any depth under `path`.
1201
+ `grep` / `search` take optional `maxResults` as predicate
1202
+ pushdown; implementations should stop after that many hits.
1203
+ Composers push the same cap to children and apply it again
1204
+ after the merge.
1205
+
1206
+ Native-tool pagination (`head_limit`, `offset`, `output_mode`,
1207
+ `numResults`) stays on synthesized tools. Native `LS` is built
1208
+ from `list` + `stat`; there is no `ls` method.
1209
+
1210
+ ### Errors
1211
+
1212
+ FileSystem methods throw `PathError`. `path` is the absolute
1213
+ posix path the error is about. Messages stay these contract
1214
+ strings so synthesized tools can show them as-is.
1215
+
1216
+ - `list` / `stat` / `glob` must not throw for a missing path.
1217
+ Missing is an empty iterator or `{ kind: "missing" }`.
1218
+ - `read` / `delete` missing file: `FileNotFoundError`
1219
+ (`not found: ${path}`).
1220
+ - `write` has no `not found`. I/O uses the OS message or
1221
+ `WriteFailedError` (`write failed: ${path}`). A read-only
1222
+ mount uses `ReadOnlyMountError` (`read-only mount: ${path}`).
1223
+ - Synthesized StrReplace is `read` + exact replace + `write`.
1224
+ Uniqueness failures throw `EditError` (`oldText is empty`,
1225
+ `oldText and newText are exactly the same`, `The string to
1226
+ replace was not found in the file`, and `The string to replace
1227
+ was found multiple times in the file. Use replace_all to replace
1228
+ all occurrences, or include more context to only edit one
1229
+ occurrence.`). Write-back failures are `WriteFailedError`.
1230
+ - `grep` throws `InvalidGrepPatternError`
1231
+ (`invalid grep pattern: ${pattern}`). A missing host search
1232
+ root throws. A missing virtual path yields nothing.
1233
+ - `search` without an index is empty success.
1234
+ - `unionFs` with no mount throws `NoMountError`
1235
+ (`no mount for path: ${path}`) on `read` / `write` /
1236
+ `delete`. Walk verbs stay empty or missing.
1237
+ - `unionFs` catches `PathError` from a child and rethrows
1238
+ `error.withPath(mountPrefix + childPath)`. Untyped `Error` still
1239
+ gets a best-effort message rewrite.
1240
+
1241
+ Invoke wraps FileSystem throws into the executor success / error
1242
+ envelope.
1243
+
1244
+ ### Write and StrReplace
1245
+
1246
+ `write(path, contents)` creates or overwrites a file. Success is
1247
+ empty. Native Write maps `fileText` onto `contents` and prints
1248
+ `Wrote contents to ${path}`.
1249
+
1250
+ StrReplace is not a FileSystem verb. The synthesized tool reads
1251
+ the file, applies an exact non-overlapping replace, and writes
1252
+ the result. It fails when `oldText` is empty, equals `newText`,
1253
+ is missing, or occurs more than once without `replaceAll`.
1254
+ Success is `{ occurrencesModified }`. Splice is literal; do not
1255
+ use `String.prototype.replace`. Native aliases (`old_string`,
1256
+ `new_string`, `replace_all`) map onto those fields at invoke
1257
+ time.
1258
+
1259
+ ---
1260
+
1261
+ ## Helpers
1262
+
1263
+ | Helper | Role |
1264
+ | --- | --- |
1265
+ | `emptyFs()` | No files. Overlay leaf or missing catalog. Reads miss; writes are read-only. |
1266
+ | `tempFs(files)` | In-memory snapshot. Tests and fixtures. |
1267
+ | `unionFs({ "/repo": a, "/plans": b })` | Longest-prefix compose, path-segment match. Children are FileSystems rooted at `/`; `unionFs` strips the mount prefix on the way in and re-prefixes yields. List and glob use `unique` so an earlier mount shadows a later one. Grep and search keep every hit. Grep and search at `/` fan out to every child. |
1268
+ | `overlayFs([upper, lower])` | Same-root overlay. Earlier layers win. Read-only. A downed layer costs its own files, not the overlay — `stat` / `grep` / `search` only fail when no layer served. |
1269
+ | `hostFs(files, scope)` | `HostFilesApi` as a FileSystem rooted at `/`. Mount with `unionFs({ "/host": hostFs(files, scope) })`. `search` is empty (no index). Write without a cached etag is unconditional; after a successful read or write, write is CAS on that etag. |
1270
+
1271
+ `localFileSystem({ cwd })` is the host-default handle. It is not
1272
+ exported from `@cursor/july`. Name helpers and `mergeSorted`
1273
+ stay private. `emptyFs`, `tempFs`, `unionFs`, `overlayFs`, `hostFs`, and
1274
+ the `PathError` classes (`FileNotFoundError`,
1275
+ `ReadOnlyMountError`, `NoMountError`, `InvalidGrepPatternError`,
1276
+ `WriteFailedError`, `EditError`,
1277
+ `DeleteNotSupportedError`) are the public helpers.
1278
+
1279
+ ---
1280
+
1281
+ ## Tool synthesis
1282
+
1283
+ Local turns synthesize these natives from the bound FileSystem:
1284
+ `Read`, `LS`, `Grep`, `Glob`, `Write`, `StrReplace`, `Delete`,
1285
+ `SemanticSearch`. `list` + `stat` synthesize `LS`. `search`
1286
+ synthesizes `SemanticSearch`. `StrReplace` is `read` + exact
1287
+ replace + `write`. Other execute bodies call the matching
1288
+ FileSystem method.
1289
+
1290
+ Authored `tools` can filter that set. `tools: ["read", "shell"]`
1291
+ on a host-default agent synthesizes `Read` only.
1292
+ `tools: ["edit"]` synthesizes `Write` and `StrReplace`.
1293
+ `tools: ["semSearch"]` synthesizes `SemanticSearch`.
1294
+ `tools: []` synthesizes nothing.
1295
+
1296
+ Host-default does not synthesize `SemanticSearch`. Native
1297
+ `semSearch` stays on so the host index can run;
1298
+ `localFileSystem.search` is empty. Authored `root` synthesizes
1299
+ `SemanticSearch` from `FileSystem.search` and does not advertise
1300
+ native `semSearch`. `search` is not an allowlist alias, so an
1301
+ authored `search` tool is not treated as SemanticSearch.
1302
+ `ReadLints` is not a FileSystem verb. Authored
1303
+ `tools: ["readLints"]` fails closed so the host language service
1304
+ cannot run.
1305
+
1306
+ Do not also ship `agent/tools/Read.ts` (and the other synthesized
1307
+ names). Discovery fails closed on that clash for host-default and
1308
+ authored `root`.
1309
+
1310
+ A factory root re-resolves the handle before a turn. The session
1311
+ cache is the handle, not a tree snapshot. Unscoped `callTool`
1312
+ uses the invocation id and does not cache, so factories cannot
1313
+ share one tree across callers. A static `root` is the authored
1314
+ object on every session — Write / StrReplace / Delete /
1315
+ `workspaceFiles` are shared. Return a new handle from
1316
+ `(ctx) => …` when a session should have its own tree. A factory
1317
+ that returns the same object still shares.
1318
+
1319
+ Per-send `workspaceFiles` write through the FileSystem.
1320
+ `memory/` is reserved (same as the host-default workspace
1321
+ symlink into durable agent memory) and is refused after
1322
+ normalize, including `./memory/x` and `foo/../memory/x`.
1323
+ Host-default `list` / `glob` / `grep` do not follow directory
1324
+ symlinks, including `memory/` — same as native LS/Glob/Grep.
1325
+ Exact-path `read` / `stat` still follow.
1326
+
1327
+ Authored `root` skips session-directory materialize, git init,
1328
+ and host-cwd checks. First turns prepend `buildAgentsMdContent`
1329
+ and print `Workspace Path: /`. Host-default agents keep today's
1330
+ materialize path.
1331
+
1332
+ ---
1333
+
1334
+ ## Allowlist
1335
+
1336
+ | `root` | `tools` | Model-facing harness |
1337
+ | --- | --- | --- |
1338
+ | omitted | omitted | The seven host-disk file tools (no synthesized `SemanticSearch`). Host shell / webSearch / sandbox / native `semSearch` stay. Host file natives are hidden with `disallowedTools: ["read","ls","grep","glob","edit","delete"]`. |
1339
+ | omitted | `["read", "shell"]` | Synthesized `Read` + SDK `shell` + `mcp`. |
1340
+ | omitted | `[]` | No synthesized file tools. |
1341
+ | set | omitted | All eight synthesized file tools (including `SemanticSearch`) + webSearch + webFetch + updateTodos + readTodos + `mcp`. Bind `/tmp` scratch. Not the host-default full catalog (no shell / sandbox / task / native semSearch). |
1342
+ | set | `["updateTodos"]` | All eight synthesized file tools + `updateTodos` + `mcp`. |
1343
+ | set | `["semSearch"]` | Synthesized `SemanticSearch` + `mcp`. Native host index stays off. |
1344
+ | set | `[]` | No synthesized file tools. Legal and empty. |
1345
+ | set | `["shell"]` / `["task"]` / `["readLints"]` | Fail closed. |
1346
+ | set | `["webSearch"]` / `["webFetch"]` | All eight synthesized file tools + the listed web tool + `mcp`. Bind `/tmp` scratch. |
1347
+
1348
+ `mcp` is granted when any tools ride that path. File-family
1349
+ allowlist names are omitted from the SDK allowlist; the
1350
+ synthesized tools replace them.
1351
+
1352
+ `local.sandbox` is Cursor's process sandbox around child
1353
+ processes on the host-default path. It is not a FileSystem.
1354
+
1355
+ ---
1356
+
1357
+ ## Fail closed
1358
+
1359
+ | Combination | Result |
1360
+ | --- | --- |
1361
+ | `root` + `local.cwd` / `workspaceDir` / `sandbox` | Fail closed |
1362
+ | `root` + `runtime: "cloud"` or `"grokbot"` | Fail closed |
1363
+ | `root` + `tools` containing `"shell"` | Fail closed |
1364
+ | `root` + `tools` containing `"task"` | Fail closed. A child keeps the host toolset. Sharing `root` needs a Cursor SDK inherit, not an overridden Task. |
1365
+ | `root` + `tools` containing `"readLints"` | Fail closed. Diagnostics are not a FileSystem verb. |
1366
+ | `agent/tools/Read.ts` (etc.) | Fail closed on host-default and authored `root`. |
1367
+
1368
+ ---
1369
+
1370
+ ## `/tmp` scratch for webSearch and webFetch
1371
+
1372
+ Native `WebSearch` and `WebFetch` stay native. They still scratch
1373
+ large output to `{harnessCwd}/agent-tools/{uuid}.txt` on the host
1374
+ disk. Under `root`, the turn composes
1375
+ `unionFs({ "/": authored, "/tmp": tempFs() })`, copies only the file
1376
+ the native tool wrote this turn, and drops that composed root at
1377
+ end of turn.
1378
+
1379
+ ### Why `/tmp`
1380
+
1381
+ The FileSystem is the model's disk. Host `{cwd}/agent-tools/` is a
1382
+ harness path. Under `root`, the model never sees it.
1383
+
1384
+ `/tmp` is the reserved scratch prefix. An authored `/tmp` is
1385
+ shadowed. Do not put durable files there. `{cwd}/agent-tools/` and
1386
+ `/tmp` are different namespaces.
1387
+
1388
+ `/agent-tools` is not reserved. Prefix `/agent` does not cover
1389
+ `/agent-tools`. Those notes are path-prefix tests, not a mount.
1390
+
1391
+ Process or VM death also loses `/tmp`. Same as POSIX `/tmp`. That
1392
+ is acceptable. Do not persist scratch across turns or process
1393
+ restarts.
1394
+
1395
+ ### Overlay
1396
+
1397
+ | Piece | Rule |
1398
+ | --- | --- |
1399
+ | Native tool | Still searches and fetches. |
1400
+ | Bind | Per turn: `unionFs({ "/": authored, "/tmp": tempFs() })`. `/tmp` is a mount, not a FileSystem type. |
1401
+ | Session cache | Authored handle may stay cached. The composed root does not. |
1402
+ | Drop | End of turn. Next turn gets a new empty `/tmp`. |
1403
+ | Small results | Stay inline. No disk, no rewrite. |
1404
+ | Copy | Only a file the native tool wrote this turn under `{cwd}/agent-tools/`. |
1405
+ | Dest | `/tmp/{uuid}.txt`. Same uuid as the host file. |
1406
+ | Host file | Delete after copy. |
1407
+ | Other paths | Ignore. Do not copy from the result text at large. |
1408
+
1409
+ Do not put that composed root on the session handle. A later turn
1410
+ must not read another turn's `/tmp`.
1411
+
1412
+ ### Result rewrite
1413
+
1414
+ Keep the native tool descriptions. They do not mention spill.
1415
+
1416
+ This package does not change the Cursor SDK. Native WebSearch /
1417
+ WebFetch results land in the AgentService conversation inside
1418
+ the local executor. That transcript is not rewritten here.
1419
+
1420
+ What this package rewrites:
1421
+
1422
+ | Surface | Overlay (`root` set) |
1423
+ | --- | --- |
1424
+ | `webSearch` / `webFetch` result | Host path and follow-up, in strings or structured fields (`output_location`). Other tools are untouched. |
1425
+ | Synthesized Read / Grep input | `{cwd}/agent-tools/{uuid}.txt` → `/tmp/{uuid}.txt` |
1426
+
1427
+ | Field | Host path (`root` unset) | Overlay (`root` set) |
1428
+ | --- | --- | --- |
1429
+ | Path | `{cwd}/agent-tools/{uuid}.txt` | `/tmp/{uuid}.txt` |
1430
+ | Follow-up | Native text (today: shell / grep / `read_file`) | Read / Grep |
1431
+
1432
+ Two modes, two paths. Do not invent a third.
1433
+
1434
+ WebFetch proto has `output_location`. WebSearch only embeds the
1435
+ path in the chunk string. Rewrite whichever form the native tool
1436
+ used.
1437
+
1438
+ The model follow path is Read / Grep on `/tmp/{uuid}.txt`,
1439
+ including when the model still holds the host path.
1440
+
1441
+ ### Out of scope here
1442
+
1443
+ MCP `spillLargeMcpTextOutput` uses the same host `agent-tools`
1444
+ directory. The same overlay can cover it later. This section is
1445
+ webSearch and webFetch only.
1446
+
1447
+ ---
1448
+
1449
+ ## Live `root`
1450
+
1451
+ When the tree depends on the conversation, pass a factory. The
1452
+ factory returns a handle. Agent SDK may reuse the object for the
1453
+ session. Reuse is not a snapshot of mount contents.
1454
+
1455
+ ```ts
1456
+ export default defineAgent({
1457
+ name: "notes",
1458
+ root: (ctx) => notesForSession(ctx.sessionId),
1459
+ });
1460
+ ```
1461
+
1462
+ ```ts
1463
+ interface RootContext {
1464
+ sessionId: string;
1465
+ agentName?: string;
1466
+ continuationKey?: string;
1467
+ host?: { files: HostFilesApi; reminders?: ReminderHostApi };
1468
+ }
1469
+ ```
1470
+
1471
+ ---
1472
+
1092
1473
  Source: /docs/design/runtime-abstraction.md
1093
1474
 
1094
1475
  # Replacing `runtime: "local" | "cloud"` with a code interface
@@ -3966,6 +4347,11 @@ behavior. Reactions still default on; set `reactions: false` when the
3966
4347
  eyes emoji is noise. Descriptions are optional; defaults derive from
3967
4348
  `botName` or the check `context`.
3968
4349
 
4350
+ To match dashboard automations, set `detailsUrl(sessionId)`,
4351
+ `summaryLinkText: "View agent"`, and `outputTitle: "context"` so the
4352
+ check title is the check name, the summary includes `[View agent](…)`,
4353
+ and Details opens the session.
4354
+
3969
4355
  A comment-only first wake has no head SHA, so the check waits for a
3970
4356
  PR or CI event. The banner still posts. A later turn on the same SHA
3971
4357
  creates a new check run; GitHub cannot reopen a completed run.
@@ -6496,6 +6882,26 @@ rather than dropping events. An empty `deploySourceUris` list mounts
6496
6882
  the channel but starts no pull, so an env-configured agent stays inert
6497
6883
  until its deploy sources are set.
6498
6884
 
6885
+ **Change Monitors** (`@cursor/july/channels/change-monitors`): Change
6886
+ Monitor Checkpoint events. The channel publishes Factory
6887
+ `checkpoint.created` for every Checkpoint create. The agent filters the
6888
+ result (for example to the `issues` arm). The payload contains the
6889
+ full Checkpoint resource. This channel is scoped to Change Monitors,
6890
+ not generic Factory Checkpoints. There is no repository filter or
6891
+ resource filter. Author `agent/channels/change-monitors.ts` with
6892
+ `changeMonitorsChannel()`. It uses the host credential. The v1 omitted
6893
+ continuation is `none/v1`. A v2 agent defaults to
6894
+ `change_monitors.checkpoint/v2`, which keys the session as
6895
+ `cont:change_monitors:{checkpointName}`.
6896
+
6897
+ **Issues** (`@cursor/july/channels/issues`): Factory issue events.
6898
+ The channel publishes `issue.created` for every Issue create. The
6899
+ agent filters if it needs a subset. The payload contains the full
6900
+ Issue resource. There is no repository filter or resource filter.
6901
+ Author `agent/channels/issues.ts` with `issuesChannel()`. It uses the
6902
+ host credential. The v1 omitted continuation is `none/v1`. A v2 agent
6903
+ defaults to `issues.issue/v2`, which keys the session by issue name.
6904
+
6499
6905
  For other platforms like Discord or Teams, use the authored
6500
6906
  `defineChannel` webhook form.
6501
6907
 
@@ -12,6 +12,7 @@
12
12
  - [Building agents with agents](/docs/building-with-agents.md): Use the built-in skills to have a coding agent create, verify, and improve your agent.
13
13
  - [How the Agent SDK works](/docs/concepts.md): Understand projects, sessions, event streams, channels, and runtimes in plain language.
14
14
  - [Deployment](/docs/deployment.md): Deploy the Agent SDK with Cursor-managed hosting or on infrastructure you control.
15
+ - [One FileSystem for every Agent SDK agent](/docs/design/filesystem.md)
15
16
  - [Replacing `runtime: "local" | "cloud"` with a code interface](/docs/design/runtime-abstraction.md)
16
17
  - [Evals](/docs/evals.md): Define repeatable checks with defineEval, run them with agent-sdk eval, and use them as regression checks.
17
18
  - [Hillclimbing](/docs/hillclimbing.md): Improve an agent one measured round at a time, with the hillclimb skill running the loop with you.