@agentdeploymentco/bishop 0.9.0 → 0.11.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 (80) hide show
  1. package/README.md +2 -0
  2. package/dist/agent-env.js +1 -0
  3. package/dist/cli.js +25 -22
  4. package/dist/commands/run.js +5 -3
  5. package/dist/config.js +4 -4
  6. package/dist/db.js +62 -12
  7. package/dist/decision/model.js +1 -0
  8. package/dist/decision/providers.js +1 -0
  9. package/dist/env.js +6 -7
  10. package/dist/gmail/authorize.js +1 -1
  11. package/dist/gmail/create.js +1 -1
  12. package/dist/gmail/destination.js +1 -1
  13. package/dist/gmail/history.js +1 -1
  14. package/dist/gmail/interface.js +2 -2
  15. package/dist/gmail/route.js +1 -1
  16. package/dist/gmail/setup.js +8 -8
  17. package/dist/harness/claude-options.js +1 -1
  18. package/dist/harness/claude-processes.js +1 -1
  19. package/dist/harness/claude.js +7 -7
  20. package/dist/harness/codex.js +4 -4
  21. package/dist/harness/create.js +1 -1
  22. package/dist/harness/layers.js +1 -1
  23. package/dist/harness/principal.js +16 -13
  24. package/dist/interface/authorize.js +1 -1
  25. package/dist/interface/etiquette.js +1 -1
  26. package/dist/interface/phrases.js +1 -1
  27. package/dist/interface/reply-gate.js +2 -0
  28. package/dist/interface/search.js +1 -0
  29. package/dist/outgoing.js +2 -2
  30. package/dist/permissions/cli.js +12 -0
  31. package/dist/permissions/entry.js +1 -0
  32. package/dist/permissions/instructions.js +2 -0
  33. package/dist/permissions/levels.js +1 -0
  34. package/dist/permissions/offline.js +1 -0
  35. package/dist/permissions/permissions.js +1 -0
  36. package/dist/permissions/refusal.js +1 -0
  37. package/dist/permissions/store.js +30 -0
  38. package/dist/permissions/subjects.js +1 -0
  39. package/dist/principals.js +3 -3
  40. package/dist/sandbox.js +11 -11
  41. package/dist/schedule/cli.js +10 -10
  42. package/dist/schedule/runner.js +4 -4
  43. package/dist/sessions/store.js +7 -6
  44. package/dist/setup.js +34 -26
  45. package/dist/slack/agent-session.js +1 -1
  46. package/dist/slack/app.js +2 -2
  47. package/dist/slack/bots.js +1 -1
  48. package/dist/slack/destination.js +1 -1
  49. package/dist/slack/groups.js +1 -0
  50. package/dist/slack/handlers.js +1 -1
  51. package/dist/slack/history.js +1 -1
  52. package/dist/slack/interface.js +2 -2
  53. package/dist/slack/presence.js +3 -3
  54. package/dist/slack/read.js +1 -1
  55. package/dist/slack/search.js +1 -0
  56. package/dist/slack/sockets.js +1 -0
  57. package/dist/slack/subjects.js +1 -0
  58. package/dist/slack/users.js +1 -1
  59. package/dist/slack/working.js +1 -0
  60. package/dist/teams/create.js +2 -2
  61. package/dist/teams/destination.js +1 -1
  62. package/dist/teams/history.js +1 -1
  63. package/dist/teams/interface.js +4 -3
  64. package/dist/teams/mentions.js +1 -1
  65. package/dist/teams/permissions.js +1 -0
  66. package/dist/teams/server.js +1 -1
  67. package/dist/teams/setup.js +81 -81
  68. package/dist/tools/conversations.js +2 -0
  69. package/dist/tools/found.js +3 -0
  70. package/dist/tools/history.js +2 -0
  71. package/dist/tools/messages.js +2 -2
  72. package/dist/tools/schedules.js +6 -6
  73. package/dist/tools/server.js +1 -1
  74. package/dist/transcript.js +26 -3
  75. package/dist/turn.js +2 -2
  76. package/package.json +5 -4
  77. package/dist/slack/authorize.js +0 -2
  78. package/dist/slack/authorizer.js +0 -3
  79. package/dist/slack/directory.js +0 -1
  80. package/dist/teams/authorize.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentdeploymentco/bishop",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "An agent gateway. Connects an agent to Slack, email, and Microsoft Teams.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -45,11 +45,12 @@
45
45
  "docs:preview": "npm --prefix docs run preview --"
46
46
  },
47
47
  "dependencies": {
48
- "@anthropic-ai/claude-agent-sdk": "0.3.316",
49
- "@microsoft/teams.apps": "^2.0.16",
48
+ "@anthropic-ai/claude-agent-sdk": "0.3.327",
49
+ "@microsoft/teams.apps": "^2.2.0",
50
50
  "@modelcontextprotocol/sdk": "^1.30.0",
51
- "@openai/codex-sdk": "0.166.0",
51
+ "@openai/codex-sdk": "0.170.0",
52
52
  "@slack/bolt": "^5.1.0",
53
+ "@slack/socket-mode": "^3.1.0",
53
54
  "@slack/types": "^3.2.0",
54
55
  "@slack/web-api": "^8.2.0",
55
56
  "commander": "^13",
@@ -1,2 +0,0 @@
1
- function p(t){const n=t.trim().replace(/^@+/,"");return{kind:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)?"email":"name",value:n}}function $(t){return t.some(n=>p(n).kind==="name")}function s(t){return t?.trim().toLowerCase()||void 0}function g(t,n){const o=new Set,d=[],c=[];for(const r of t){const{kind:l,value:u}=p(r);if(!u)continue;const i=u.toLowerCase(),a=n.users.filter(e=>l==="email"?s(e.email)===i:s(e.name)===i||s(e.displayName)===i||s(e.realName)===i),m=l==="email"?[]:n.groups.filter(e=>s(e.handle)===i||s(e.name)===i),f=[...a.map(e=>`user ${e.id}${e.name?` (@${e.name})`:""}`),...m.map(e=>`group ${e.id}${e.handle?` (@${e.handle})`:""}`)];if(f.length===0){d.push(r);continue}if(a.length+m.length>1){c.push({entry:r,candidates:f});continue}for(const e of a)o.add(e.id);for(const e of m)for(const h of e.memberIds)o.add(h)}return{allowed:o,unresolved:d,ambiguous:c}}function w(t){return t.map(n=>` "${n.entry}" matches ${n.candidates.length}: ${n.candidates.join(", ")}`).join(`
2
- `)}export{p as classifyEntry,w as describeAmbiguities,$ as entriesNeedingUserList,g as resolveAllowList};
@@ -1,3 +0,0 @@
1
- import{BishopError as w}from"../errors.js";import{log as r}from"../log.js";import{describeAmbiguities as g,resolveAllowList as m}from"./authorize.js";import{loadDirectory as f}from"./directory.js";const p=300*1e3;class c extends w{constructor(t){super(t,"AuthorizationConfigError")}}async function A(l,t){if(!t||t.length===0)return r.warn("no allow list configured; anyone who can reach the bot can use this agent"),{allows:()=>!0,open:!0,stop:()=>{}};const s=t;let n=new Set;async function i(o){const h=await f(l,s),e=m(s,h);if(e.ambiguous.length>0){const d=`These allow-list entries match more than one thing:
2
- ${g(e.ambiguous)}
3
- Use an email address or a distinct group handle to say which you mean.`;if(o)throw new c(d);r.error({ambiguous:e.ambiguous},"allow list became ambiguous; keeping previous");return}if(e.unresolved.length>0&&r.warn({unresolved:e.unresolved},"some allow-list entries matched nobody; they are being ignored"),e.allowed.size===0){const u=`None of the ${s.length} allow-list entries resolved to a Slack user. Nobody would be able to use the agent.`;if(o)throw new c(u);r.error("allow list resolved to nobody; keeping previous");return}n=e.allowed,r.info({allowed:n.size,entries:s.length},"resolved the allow list")}await i(!0);const a=setInterval(()=>{i(!1).catch(o=>{r.error({err:o},"allow-list refresh failed; keeping the previous set")})},p);return a.unref(),{allows:o=>n.has(o),open:!1,stop:()=>clearInterval(a)}}export{c as AuthorizationConfigError,A as createAuthorizer};
@@ -1 +0,0 @@
1
- import{log as l}from"../log.js";import{classifyEntry as t,entriesNeedingUserList as u}from"./authorize.js";import{listMembers as d,toUser as c}from"./members.js";async function h(e,a){const i=[],s=[],m=a.map(t).filter(r=>r.kind==="email");if(u(a))for(const r of await d(e))i.push(n(r));else for(const{value:r}of m)try{const o=await e.users.lookupByEmail({email:r});o.user&&i.push(n(c(o.user)))}catch(o){l.debug({email:r,err:o},"email lookup failed")}if(a.some(r=>t(r).kind==="name"))try{const r=await e.usergroups.list({include_users:!0});for(const o of r.usergroups??[])o.id&&s.push({id:o.id,...o.handle?{handle:o.handle}:{},...o.name?{name:o.name}:{},memberIds:o.users??[]})}catch(r){l.warn({err:r},"could not list usergroups; group entries will not resolve")}return{users:i,groups:s}}function n(e){return{id:e.userId,...e.handle?{name:e.handle}:{},...e.displayName?{displayName:e.displayName}:{},...e.realName?{realName:e.realName}:{},...e.email?{email:e.email}:{}}}export{h as loadDirectory};
@@ -1 +0,0 @@
1
- import{BishopError as n}from"../errors.js";class l extends n{constructor(t){super(t,"TeamsAllowListError")}}const i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,c=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,f=/^@[^\s@]+\.[^\s@]+$/;function u(o){const t=o.trim().toLowerCase();if(i.test(t)||c.test(t)||f.test(t))return t;throw new l(`"${o}" is not an Entra object ID, a user principal name, or a domain. Write a principal name like person@example.com, @example.com for everyone at a domain, or the object ID from the user\u2019s Entra profile.`)}function p(o){if(!o||o.length===0)return{allows:()=>!0,open:!0};const t=new Set,s=new Set;for(const r of o){const e=u(r);e.startsWith("@")?s.add(e.slice(1)):t.add(e)}return{open:!1,allows(r){const e=r.trim().toLowerCase();if(!e)return!1;if(t.has(e))return!0;const a=e.lastIndexOf("@");return a>0&&s.has(e.slice(a+1))}}}export{l as TeamsAllowListError,p as teamsAllowList,u as validateAllowEntry};