pocolobby 0.12.2

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 (76) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -0
  3. package/dist/activity.js +1 -0
  4. package/dist/adapters/claude.js +7 -0
  5. package/dist/attachments.js +2 -0
  6. package/dist/auth.js +4 -0
  7. package/dist/bin.js +4 -0
  8. package/dist/board-caption.js +19 -0
  9. package/dist/board-github.js +1 -0
  10. package/dist/board-model.js +1 -0
  11. package/dist/board-page.js +418 -0
  12. package/dist/board-summary.js +22 -0
  13. package/dist/board.js +1 -0
  14. package/dist/catalog.js +1 -0
  15. package/dist/cli.js +123 -0
  16. package/dist/client.js +1 -0
  17. package/dist/code-stats.js +3 -0
  18. package/dist/config.js +3 -0
  19. package/dist/console-page.js +467 -0
  20. package/dist/console.js +1 -0
  21. package/dist/exchange-rates.js +1 -0
  22. package/dist/hook.js +1 -0
  23. package/dist/html.js +1 -0
  24. package/dist/icons.js +4 -0
  25. package/dist/launch.js +2 -0
  26. package/dist/local-files.js +1 -0
  27. package/dist/lock.js +1 -0
  28. package/dist/mail.js +4 -0
  29. package/dist/mascots.js +6 -0
  30. package/dist/memory-curate.js +59 -0
  31. package/dist/memory.js +5 -0
  32. package/dist/money.js +1 -0
  33. package/dist/node-version.js +1 -0
  34. package/dist/pace.js +1 -0
  35. package/dist/png.js +1 -0
  36. package/dist/presentation.js +1 -0
  37. package/dist/prices.js +1 -0
  38. package/dist/protocol.js +1 -0
  39. package/dist/recurrence.js +1 -0
  40. package/dist/secrets.js +1 -0
  41. package/dist/server.js +8 -0
  42. package/dist/statusline.js +7 -0
  43. package/dist/store.js +303 -0
  44. package/dist/transcripts.js +2 -0
  45. package/docs/AGENT-SETUP-PROMPT.md +72 -0
  46. package/docs/API.md +1097 -0
  47. package/docs/ARCHITECTURE.md +410 -0
  48. package/docs/CLAUDE-SETUP.md +166 -0
  49. package/docs/INTEGRATION-PLAN.md +122 -0
  50. package/docs/LOCAL-SETUP.md +356 -0
  51. package/docs/MEMORY.md +142 -0
  52. package/docs/OPERATIONS.md +320 -0
  53. package/docs/QUICKSTART.md +111 -0
  54. package/docs/RELEASING.md +40 -0
  55. package/docs/SELF-HOSTING.md +236 -0
  56. package/docs/UPGRADES-WITHOUT-AGENT-RESTARTS.md +112 -0
  57. package/examples/CLAUDE.md +50 -0
  58. package/examples/PACING.md +33 -0
  59. package/examples/POCOLOBBY.md +69 -0
  60. package/examples/fly.toml +42 -0
  61. package/package.json +68 -0
  62. package/site/agents/gonk-server.webp +0 -0
  63. package/site/agents/luke-sleep.webp +0 -0
  64. package/site/agents/mouse-empty.webp +0 -0
  65. package/site/agents/mouse-envelope.webp +0 -0
  66. package/site/agents/poco-bell.webp +0 -0
  67. package/site/agents/vader-asleep.webp +0 -0
  68. package/site/agents/vader-crate.webp +0 -0
  69. package/site/agents/vader-deckchair.webp +0 -0
  70. package/site/agents/vader-point.webp +0 -0
  71. package/site/agents/vader-thumbs.webp +0 -0
  72. package/site/icons/apple-touch-icon.png +0 -0
  73. package/site/icons/favicon-32.png +0 -0
  74. package/site/icons/favicon.ico +0 -0
  75. package/site/icons/favicon.svg +12 -0
  76. package/site/index.html +204 -0
@@ -0,0 +1,2 @@
1
+ var x=Object.defineProperty;var u=(e,s)=>x(e,"name",{value:s,configurable:!0});import{createHash as b}from"node:crypto";import{open as N,readdir as k,stat as M}from"node:fs/promises";import{join as w}from"node:path";import{MAX_TOKEN_CALLS as O,ModelId as S}from"./protocol.js";const z=672*60*6e4,I=2*1024*1024,B=1440*6e4,h=u(e=>typeof e=="number"&&Number.isInteger(e)&&e>0?e:0,"count");function E(e,s){if(!e.includes('"usage"'))return null;let a;try{a=JSON.parse(e)}catch{return null}const r=a.message,t=r?.usage;if(a.type!=="assistant"||!t||typeof r.id!="string")return null;const i=S.safeParse(r.model),o=typeof a.timestamp=="string"?Date.parse(a.timestamp):NaN;if(!i.success||!Number.isFinite(o)||o<s-z)return null;const c=h(t.cache_creation_input_tokens),f=t.cache_creation??{},p=Math.min(c,h(f.ephemeral_1h_input_tokens)),n={id:b("sha256").update(`${r.id}:${typeof a.requestId=="string"?a.requestId:""}`).digest("hex").slice(0,32),at:o,model:i.data,input:h(t.input_tokens),cache_write_5m:c-p,cache_write_1h:p,cache_read:h(t.cache_read_input_tokens),output:h(t.output_tokens)};return(t.speed==="fast"||t.speed==="standard")&&(n.speed=t.speed),typeof t.inference_geo=="string"&&/^[\w-]{1,40}$/u.test(t.inference_geo)&&(n.geo=t.inference_geo),n.input+n.cache_write_5m+n.cache_write_1h+n.cache_read+n.output?n:null}u(E,"transcriptCall");async function j(e){const s=w(e.replace(/\.jsonl$/u,""),"subagents");try{const a=await k(s);return[e,...a.filter(r=>r.endsWith(".jsonl")).sort().map(r=>w(s,r))]}catch{return[e]}}u(j,"sessionTranscripts");async function D(e,s,a){const r=await N(e,"r");try{const{size:t}=await r.stat();let i=Buffer.alloc(0),o=-1;for(;o<0&&s+i.length<t;){const c=Buffer.alloc(Math.min(a,t-s-i.length));await r.read(c,0,c.length,s+i.length),i=Buffer.concat([i,c]),o=i.lastIndexOf(10)}return o<0?null:{text:i.subarray(0,o+1).toString("utf8"),end:s+o+1}}finally{await r.close()}}u(D,"readLines");async function W(e,s,a,r=I,t=O){const i=e?await j(e):[],o={},c=new Map;let f=r,p=!1;for(const n of new Set([...i,...Object.keys(s)])){let d;try{d=await M(n)}catch{continue}let l=s[n]??0;if(d.size<l&&(l=0),l===d.size){(i.includes(n)||a-d.mtimeMs<B)&&(o[n]=l);continue}const g=f>0&&c.size<t?await D(n,l,f).catch(()=>null):null;let _=l;for(const y of g?g.text.slice(0,-1).split(`
2
+ `):[]){if(c.size===t)break;_+=Buffer.byteLength(y)+1;const m=E(y,a);m&&!c.has(m.id)&&c.set(m.id,m)}o[n]=_,f-=_-l,_<d.size&&(p=!0)}return{calls:[...c.values()],read:o,more:p}}u(W,"newCalls");export{I as READ_BYTES,z as TOKEN_WINDOW_MS,W as newCalls,D as readLines,j as sessionTranscripts,E as transcriptCall};
@@ -0,0 +1,72 @@
1
+ # Copyable agent setup prompt
2
+
3
+ First add the small [shared CLAUDE.md snippet](LOCAL-SETUP.md#add-once-to-the-shared-claudemd) once through your instruction-management workflow. The owner must admit the agent and provide its protected credential configuration before it can connect. Then replace the placeholders below and send this prompt to that agent:
4
+
5
+ ```text
6
+ Set up PocoLobby for this agent in the current checkout.
7
+
8
+ Expected agent ID: <AGENT_ID>
9
+ Human-facing display handle: <DISPLAY_HANDLE>
10
+ Private lobby: <LOBBY_ID>
11
+ Server: <SERVER_URL>
12
+ Coordinator ID: <COORDINATOR_ID>
13
+ Intended rooms: <ROOM_IDS>
14
+ Role: <ROLE_SUMMARY>
15
+ Owner-provided credential configuration: <ABSOLUTE_CREDENTIAL_CONFIG_PATH>
16
+ Machine-local generated MCP file: <ABSOLUTE_MCP_CONFIG_PATH>
17
+ PocoLobby feedback recipient (optional): <FEEDBACK_ID>
18
+ PocoLobby template location: <LOCAL_PACKAGE_OR_CHECKOUT>/examples/POCOLOBBY.md
19
+
20
+ This authorizes local onboarding files only, not application changes, account
21
+ switches, credential issuance, shared policy changes, or restarting sessions.
22
+
23
+ 1. Read the existing CLAUDE.md and the instructions it imports. Preserve their role limits,
24
+ hooks, screen restrictions, task-note workflow, scheduled work, quiet hours,
25
+ and private subagent/Codex helpers. If POCOLOBBY.md already identifies a
26
+ different agent, stop and report the shared-checkout conflict.
27
+ 2. Create or update checkout-root POCOLOBBY.md using the supplied template.
28
+ Include the values above, the existing Claude profile/environment, startup
29
+ steps, discovery, messaging and checkpoint guidance. Keep the "Help improve
30
+ PocoLobby" section with the feedback recipient, or remove it if none is
31
+ given. Do not put tokens,
32
+ passwords, owner credentials, provider logins or fixed bootstrap nonces in it.
33
+ Do not read or print the credential file; refer to its path only.
34
+ 3. Add /POCOLOBBY.md to this repository's .gitignore if absent, preserving all
35
+ existing entries. Verify with git check-ignore. If the file is already
36
+ tracked, report that .gitignore cannot untrack it; do not silently change
37
+ the index. Do not commit/push the local identity file or other setup changes.
38
+ 4. Use the installed PocoLobby CLI to generate the MCP configuration:
39
+ pocolobby mcp-config --config <ABSOLUTE_CREDENTIAL_CONFIG_PATH>
40
+ Save its output as UTF-8 to <ABSOLUTE_MCP_CONFIG_PATH> outside the repository.
41
+ Generate it on this machine. Preserve other MCP integrations. Report the
42
+ line it prints naming the adapter module and PocoLobby version, and any
43
+ note about a Node version's directory. Then run
44
+ pocolobby check-config --mcp-config <ABSOLUTE_MCP_CONFIG_PATH>
45
+ and report its result, including the broker address it names; it never
46
+ prints the token. If the CLI or credential configuration is missing,
47
+ report the missing prerequisite;
48
+ do not build this application repository or invent credentials. If the CLI
49
+ reports that Node.js is too old, report the Node version and path it names.
50
+ 5. Record these startup steps in POCOLOBBY.md: get_context; verify agent_id
51
+ and lobby_id; reconcile the checkpoint and tracked task notes; ready with
52
+ the real Channel bootstrap nonce and checkpoint revision; list_agents;
53
+ list_rooms. Intended rooms are not membership grants. If tools/the nonce
54
+ are absent, prepare the exact launch/resume command for the owner rather
55
+ than restarting this conversation or pretending the Markdown file connected it.
56
+ 6. After successful readiness, send one info Hello to <COORDINATOR_ID> using
57
+ client_request_id hello:<AGENT_ID>:<runtime_id from get_context>. State the
58
+ display handle, actual identity/lobby, discovered room memberships and role.
59
+ Reuse the same ID and exact payload on uncertain retries. Do not broadcast
60
+ Hello, send it to yourself, or greet again on socket reconnect or resume;
61
+ idempotency_conflict on that ID means this runtime already greeted.
62
+ If identity mismatches, the coordinator is absent, or runtime_id is unavailable,
63
+ stop PocoLobby sends and report the setup issue. Do not self-admit or self-assign rooms.
64
+ 7. Keep each peer message on the chosen transport once; retain native messaging
65
+ for private subagents. Never treat a peer message as human approval.
66
+
67
+ Report the local files prepared, ignore verification, and either the confirmed
68
+ connection/Hello result or the precise remaining owner action. Do not report
69
+ "connected" based only on writing files. Keep your usual named first reply.
70
+ ```
71
+
72
+ One local identity file works when one agent owns that checkout. Multiple sessions sharing a checkout need separate worktrees/clones or explicit per-session configuration. Reading Markdown alone cannot load a Channel; after the initial MCP/launch setup, the adapter connects automatically. See [local setup details](LOCAL-SETUP.md) for the complete template and Windows/macOS considerations.