@cursor/july 0.1.21 → 0.1.22

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 (66) hide show
  1. package/dist/channels/slack/bot-mentions.d.ts +2 -0
  2. package/dist/channels/slack/bot-mentions.d.ts.map +1 -1
  3. package/dist/channels/slack/bot-mentions.js +29 -8
  4. package/dist/channels/slack/types.d.ts +13 -2
  5. package/dist/channels/slack/types.d.ts.map +1 -1
  6. package/dist/docs/404.html +1 -1
  7. package/dist/docs/ab.html +2 -2
  8. package/dist/docs/assets/{app.jDxLzWv4.js → app.BKNKMLp4.js} +1 -1
  9. package/dist/docs/assets/chunks/@localSearchIndexroot.YFE6WoMB.js +1 -0
  10. package/dist/docs/assets/chunks/{VPLocalSearchBox.Y6bDR1-a.js → VPLocalSearchBox.sOSfEZR6.js} +1 -1
  11. package/dist/docs/assets/chunks/{theme.CLazCWlJ.js → theme.BvCHT5lj.js} +2 -2
  12. package/dist/docs/building-with-agents.html +2 -2
  13. package/dist/docs/concepts.html +2 -2
  14. package/dist/docs/deployment.html +2 -2
  15. package/dist/docs/evals.html +2 -2
  16. package/dist/docs/example-agents/approval-buddy.html +2 -2
  17. package/dist/docs/example-agents/benny.html +2 -2
  18. package/dist/docs/example-agents/bugbot.html +2 -2
  19. package/dist/docs/example-agents/codebase-wiki.html +2 -2
  20. package/dist/docs/example-agents/codeowners-review.html +2 -2
  21. package/dist/docs/example-agents/concierge.html +2 -2
  22. package/dist/docs/example-agents/fsd.html +2 -2
  23. package/dist/docs/example-agents/index.html +2 -2
  24. package/dist/docs/example-agents/knowledge-base.html +2 -2
  25. package/dist/docs/example-agents/oncall.html +2 -2
  26. package/dist/docs/example-agents/security-reviewer.html +2 -2
  27. package/dist/docs/example-agents/slack-agent.html +2 -2
  28. package/dist/docs/example-agents/weather-agent.html +2 -2
  29. package/dist/docs/guides/agent-to-agent.html +2 -2
  30. package/dist/docs/guides/cloud-runtime.html +2 -2
  31. package/dist/docs/guides/github.html +2 -2
  32. package/dist/docs/guides/human-in-the-loop.html +2 -2
  33. package/dist/docs/guides/mcp-oauth.html +2 -2
  34. package/dist/docs/guides/slack.html +2 -2
  35. package/dist/docs/guides/webhooks.html +2 -2
  36. package/dist/docs/hillclimbing.html +2 -2
  37. package/dist/docs/index.html +2 -2
  38. package/dist/docs/quickstart.html +2 -2
  39. package/dist/docs/reference/agent-config.html +2 -2
  40. package/dist/docs/reference/channels.html +2 -2
  41. package/dist/docs/reference/cli.html +2 -2
  42. package/dist/docs/reference/connections.html +2 -2
  43. package/dist/docs/reference/hooks.html +2 -2
  44. package/dist/docs/reference/http-api.html +2 -2
  45. package/dist/docs/reference/instructions.html +2 -2
  46. package/dist/docs/reference/playground.html +2 -2
  47. package/dist/docs/reference/project-layout.html +2 -2
  48. package/dist/docs/reference/prompt.html +2 -2
  49. package/dist/docs/reference/schedules.html +2 -2
  50. package/dist/docs/reference/sessions.html +2 -2
  51. package/dist/docs/reference/skills.html +2 -2
  52. package/dist/docs/reference/subagents.html +2 -2
  53. package/dist/docs/reference/tools.html +2 -2
  54. package/dist/docs/scaffolding-agents.html +2 -2
  55. package/dist/docs/storage.html +2 -2
  56. package/dist/docs/troubleshooting.html +2 -2
  57. package/dist/internal/local-env.d.ts +6 -4
  58. package/dist/internal/local-env.d.ts.map +1 -1
  59. package/dist/internal/local-env.js +14 -6
  60. package/package.json +1 -1
  61. package/src/channels/slack/bot-mentions.test.ts +50 -0
  62. package/src/channels/slack/bot-mentions.ts +26 -2
  63. package/src/channels/slack/types.ts +13 -2
  64. package/src/internal/local-env.test.ts +20 -0
  65. package/src/internal/local-env.ts +14 -6
  66. package/dist/docs/assets/chunks/@localSearchIndexroot.DoJHJjqF.js +0 -1
@@ -327,8 +327,19 @@ export interface SlackChannelPostsOptions {
327
327
  */
328
328
  export interface SlackBotMentionsOptions {
329
329
  /**
330
- * Bots whose mentions may wake this agent: `bot_id`s (`B…`) and/or bot
331
- * *user* ids (`U…`). Must be non-empty (empty is a definition error).
330
+ * Bots whose mentions may wake this agent. Three entry forms:
331
+ *
332
+ * - `"B…"` — a `bot_id` (dedicated Slack app).
333
+ * - `"U…"` — a bot *user* id.
334
+ * - `"<botId>:<username>"` — compound: the posting app's `bot_id` AND its
335
+ * message `username` must both match (case-insensitive username). Use
336
+ * this for shared multi-tenant apps like the Cursor Slack connection,
337
+ * where every agent posts under one `bot_id` but the backend pins each
338
+ * agent's `username` server-side — `"B0CURSOR…:Lasso"` trusts only the
339
+ * Cursor app posting as Lasso, not every Cursor-connected agent.
340
+ * Fails closed when the event carries no username.
341
+ *
342
+ * Must be non-empty (empty is a definition error).
332
343
  */
333
344
  allowFrom: string[];
334
345
  /**
@@ -55,6 +55,26 @@ describe("loadAgentLocalEnv", () => {
55
55
  expect(process.env.LOCALENV_NODE_MODULES).toBeUndefined();
56
56
  });
57
57
 
58
+ it("loads checked-in .env defaults under .env.local", async () => {
59
+ const dir = await makeDir();
60
+ await writeFile(
61
+ join(dir, ".env"),
62
+ "LOCALENV_DEFAULT=fromenv\nLOCALENV_BOTH=fromenv\n"
63
+ );
64
+ await writeFile(
65
+ join(dir, ".env.local"),
66
+ "LOCALENV_BOTH=fromlocal\nLOCALENV_ONLY_LOCAL=local\n"
67
+ );
68
+ setKeys.push("LOCALENV_DEFAULT", "LOCALENV_BOTH", "LOCALENV_ONLY_LOCAL");
69
+
70
+ const loaded = loadAgentLocalEnv(dir);
71
+
72
+ expect(loaded).toEqual([join(dir, ".env.local"), join(dir, ".env")]);
73
+ expect(process.env.LOCALENV_DEFAULT).toBe("fromenv");
74
+ expect(process.env.LOCALENV_BOTH).toBe("fromlocal");
75
+ expect(process.env.LOCALENV_ONLY_LOCAL).toBe("local");
76
+ });
77
+
58
78
  it("never overrides real environment variables", async () => {
59
79
  const dir = await makeDir();
60
80
  await writeFile(join(dir, ".env.local"), "LOCALENV_PRECEDENCE=fromfile\n");
@@ -1,8 +1,10 @@
1
1
  /**
2
- * Loads an agent directory's `.env.local` (and each immediate child's,
3
- * for multi-agent hosts) into process.env. Real env always wins
4
- * `process.loadEnvFile` never overrides. Values a previous call loaded are
5
- * refreshed, so a reload picks up edits made since.
2
+ * Loads an agent directory's env files (and each immediate child's, for
3
+ * multi-agent hosts) into process.env. Load order per directory is
4
+ * `.env.local` then `.env` — `process.loadEnvFile` never overrides, so
5
+ * real env wins over both, and `.env.local` wins over checked-in `.env`
6
+ * defaults. Values a previous call loaded are refreshed, so a reload
7
+ * picks up edits made since.
6
8
  */
7
9
 
8
10
  import { existsSync, readdirSync } from "node:fs";
@@ -30,8 +32,14 @@ export function loadAgentLocalEnv(dir: string): string[] {
30
32
  Object.keys(process.env).filter((key) => !realKeys.has(key))
31
33
  );
32
34
  };
35
+ const tryLoadDir = (agentDir: string): void => {
36
+ // `.env.local` first so its values win over checked-in `.env` defaults
37
+ // under loadEnvFile's no-override semantics.
38
+ tryLoad(join(agentDir, ".env.local"));
39
+ tryLoad(join(agentDir, ".env"));
40
+ };
33
41
 
34
- tryLoad(join(dir, ".env.local"));
42
+ tryLoadDir(dir);
35
43
 
36
44
  let children: string[];
37
45
  try {
@@ -46,7 +54,7 @@ export function loadAgentLocalEnv(dir: string): string[] {
46
54
  if (child === "node_modules") {
47
55
  continue;
48
56
  }
49
- tryLoad(join(dir, child, ".env.local"));
57
+ tryLoadDir(join(dir, child));
50
58
  }
51
59
  trackLoadedKeys();
52
60
  return loaded;