commandmate 0.42.1 → 0.42.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.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +98 -98
- package/.next/app-path-routes-manifest.json +21 -21
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +12 -12
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route.js +1 -1
- package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/capabilities/route.js +1 -1
- package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +1 -1
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +21 -21
- package/.next/server/chunks/1501.js +3 -3
- package/.next/server/chunks/434.js +1 -1
- package/.next/server/chunks/5775.js +1 -1
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/8583.js +1 -1
- package/.next/server/chunks/8728.js +1 -1
- package/.next/server/chunks/9627.js +1 -1
- package/.next/server/chunks/964.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{2407-21fbf12d753b8d4d.js → 2407-6b9e12c099fa598c.js} +1 -1
- package/.next/static/chunks/app/{layout-8ff4c7c08ef1f621.js → layout-5b95e1236dcd9ef6.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/{page-3c946bd2875391fd.js → page-59f5337e031518c6.js} +1 -1
- package/.next/trace +13 -13
- package/dist/cli/commands/verify.d.ts.map +1 -1
- package/dist/cli/commands/verify.js +9 -0
- package/dist/cli/types/index.d.ts +2 -0
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/server/src/lib/db/worktree-db.js +1 -1
- package/dist/server/src/lib/verification/env-clean-gate.js +141 -4
- package/dist/server/src/lib/verification/env-snapshot.js +65 -1
- package/package.json +1 -1
- package/release-notes/0.42.2.json +20 -0
- /package/.next/static/{3M_S0B7dhEDdVE2XSJz1Y → MXZXkcFAnpELZnxxHB4iJ}/_buildManifest.js +0 -0
- /package/.next/static/{3M_S0B7dhEDdVE2XSJz1Y → MXZXkcFAnpELZnxxHB4iJ}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=5775,exports.ids=[964,2839,5220,5775,8583],exports.modules={15608:(a,b,c)=>{function d(){return globalThis.__cmLegacySessionAliases??=new Map}function e(a){return d().get(a)}function f(a){let b=d(),c=!1;for(let[d,e]of b)e===a&&(b.delete(d),c=!0);return c}c.d(b,{mc:()=>e,y:()=>f})},39687:(a,b,c)=>{c.d(b,{d:()=>s});var d=c(56791),e=c(43234),f=c(15194),g=c(95220),h=c(12462),i=c(43015),j=c(54325),k=c(72626),l=c(34331),m=c(40964),n=c(58707),o=c(41466);let p=(0,k.h)("session/send-user-message");function q(a){return a instanceof Error?a.message:String(a)}async function r(a,b){let c=`${a}:${b}`,d=Date.now()+5e3;for(;(0,g.getActivePollers)().includes(c);){if(Date.now()>=d)return!1;await new Promise(a=>setTimeout(a,100))}return!0}async function s(a,b){let{worktreeId:c,content:k,cliToolId:s,instanceId:t,absoluteImagePath:u,copilotModel:v}=b,w=b.messageType??"normal",x=t??s,y=e.CLIToolManager.getInstance().getTool(s),z=(0,m.mf)(s,c,t),A=await (0,l.L)(c,z,a);if(null===A||"foreign"===A.verdict)return p.warn("send-refused-foreign-session",{worktreeId:c,cliToolId:s,instanceId:x,sessionName:z,sessionPath:A?.sessionPath??null,reason:A?"foreign":"worktree_not_found"}),{ok:!1,stage:"foreign_session",error:A?`tmux session "${z}" belongs to another CommandMate server`:`Worktree '${c}' not found; cannot confirm tmux session "${z}" is this server's`};let B=await (0,n.a3)(c,s,t,{ignoreStructured:b.ignoreStructuredPromptGuard});if(B.waiting)return p.info("send-refused-prompt-waiting",{worktreeId:c,cliToolId:s,reason:B.reason,blockedBy:B.blockedBy}),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c,B.blockedBy)};if(v&&"copilot"===s){try{await y.sendModelCommand(c,v,t),p.info("copilot-model-command-sent",{model:v})}catch(a){return p.error("failed-to-send-model-command:",{error:q(a)}),{ok:!1,stage:"model",error:q(a)}}await r(c,x)||p.warn("previous-turn-poller-still-running",{worktreeId:c,instanceId:x,waitedMs:5e3})}let C=new Date;try{await (0,h.o4)(a,c,s,C,t)}catch(a){p.error("failed-to-save-pending-assistant-response:",{error:q(a)})}let D=null;try{let b=(0,d.getMessages)(a,c,{limit:1,cliToolId:s,instanceId:x,matchResolvedInstance:!0});b.length>0&&"user"===b[0].role&&b[0].content===k&&(D=b[0].id)}catch(a){p.error("failed-to-detect-orphaned-messages:",{error:q(a)})}try{u?(0,f._J)(y)?await y.sendMessageWithImage(c,k,u,t):await y.sendMessage(c,(0,o.TZ)(k,u),t):await y.sendMessage(c,k,t)}catch(a){return p.error("failed-to-send-message-to:",{error:q(a)}),{ok:!1,stage:"send",error:q(a)}}let E=(0,d.createMessage)(a,{worktreeId:c,role:"user",content:k,messageType:w,timestamp:C,cliToolId:s,instanceId:t,requestId:b.requestId});try{(0,i.broadcastMessage)("message",{worktreeId:c,message:{...E,cliToolId:s,instanceId:x}})}catch(a){p.warn("user-message-broadcast-failed",{error:q(a)})}if(D)try{if((0,d.deleteMessageById)(a,D)){p.info("cleaned-up-orphaned-user");try{(0,i.broadcastMessage)(j.dz,{worktreeId:c,cliToolId:s,instanceId:x,reason:"orphan_cleanup"})}catch(a){p.warn("orphan-cleanup-broadcast-failed",{error:q(a)})}}}catch(a){p.error("failed-to-clean-up-orphaned-message:",{error:q(a)})}return(0,d.updateLastUserMessage)(a,c,k,C),(0,d.clearInProgressMessageId)(a,c,s,t),p.info("cleared-in-progress-message-for"),(0,g.startPolling)(c,s,t),{ok:!0,message:E}}},40964:(a,b,c)=>{c.d(b,{s4:()=>k,NN:()=>
|
|
1
|
+
"use strict";exports.id=5775,exports.ids=[964,2839,5220,5775,8583],exports.modules={15608:(a,b,c)=>{function d(){return globalThis.__cmLegacySessionAliases??=new Map}function e(a){return d().get(a)}function f(a){let b=d(),c=!1;for(let[d,e]of b)e===a&&(b.delete(d),c=!0);return c}c.d(b,{mc:()=>e,y:()=>f})},39687:(a,b,c)=>{c.d(b,{d:()=>s});var d=c(56791),e=c(43234),f=c(15194),g=c(95220),h=c(12462),i=c(43015),j=c(54325),k=c(72626),l=c(34331),m=c(40964),n=c(58707),o=c(41466);let p=(0,k.h)("session/send-user-message");function q(a){return a instanceof Error?a.message:String(a)}async function r(a,b){let c=`${a}:${b}`,d=Date.now()+5e3;for(;(0,g.getActivePollers)().includes(c);){if(Date.now()>=d)return!1;await new Promise(a=>setTimeout(a,100))}return!0}async function s(a,b){let{worktreeId:c,content:k,cliToolId:s,instanceId:t,absoluteImagePath:u,copilotModel:v}=b,w=b.messageType??"normal",x=t??s,y=e.CLIToolManager.getInstance().getTool(s),z=(0,m.mf)(s,c,t),A=await (0,l.L)(c,z,a);if(null===A||"foreign"===A.verdict)return p.warn("send-refused-foreign-session",{worktreeId:c,cliToolId:s,instanceId:x,sessionName:z,sessionPath:A?.sessionPath??null,reason:A?"foreign":"worktree_not_found"}),{ok:!1,stage:"foreign_session",error:A?`tmux session "${z}" belongs to another CommandMate server`:`Worktree '${c}' not found; cannot confirm tmux session "${z}" is this server's`};let B=await (0,n.a3)(c,s,t,{ignoreStructured:b.ignoreStructuredPromptGuard});if(B.waiting)return p.info("send-refused-prompt-waiting",{worktreeId:c,cliToolId:s,reason:B.reason,blockedBy:B.blockedBy}),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c,B.blockedBy)};if(v&&"copilot"===s){try{await y.sendModelCommand(c,v,t),p.info("copilot-model-command-sent",{model:v})}catch(a){return p.error("failed-to-send-model-command:",{error:q(a)}),{ok:!1,stage:"model",error:q(a)}}await r(c,x)||p.warn("previous-turn-poller-still-running",{worktreeId:c,instanceId:x,waitedMs:5e3})}let C=new Date;try{await (0,h.o4)(a,c,s,C,t)}catch(a){p.error("failed-to-save-pending-assistant-response:",{error:q(a)})}let D=null;try{let b=(0,d.getMessages)(a,c,{limit:1,cliToolId:s,instanceId:x,matchResolvedInstance:!0});b.length>0&&"user"===b[0].role&&b[0].content===k&&(D=b[0].id)}catch(a){p.error("failed-to-detect-orphaned-messages:",{error:q(a)})}try{u?(0,f._J)(y)?await y.sendMessageWithImage(c,k,u,t):await y.sendMessage(c,(0,o.TZ)(k,u),t):await y.sendMessage(c,k,t)}catch(a){return p.error("failed-to-send-message-to:",{error:q(a)}),{ok:!1,stage:"send",error:q(a)}}let E=(0,d.createMessage)(a,{worktreeId:c,role:"user",content:k,messageType:w,timestamp:C,cliToolId:s,instanceId:t,requestId:b.requestId});try{(0,i.broadcastMessage)("message",{worktreeId:c,message:{...E,cliToolId:s,instanceId:x}})}catch(a){p.warn("user-message-broadcast-failed",{error:q(a)})}if(D)try{if((0,d.deleteMessageById)(a,D)){p.info("cleaned-up-orphaned-user");try{(0,i.broadcastMessage)(j.dz,{worktreeId:c,cliToolId:s,instanceId:x,reason:"orphan_cleanup"})}catch(a){p.warn("orphan-cleanup-broadcast-failed",{error:q(a)})}}}catch(a){p.error("failed-to-clean-up-orphaned-message:",{error:q(a)})}return(0,d.updateLastUserMessage)(a,c,k,C),(0,d.clearInProgressMessageId)(a,c,s,t),p.info("cleared-in-progress-message-for"),(0,g.startPolling)(c,s,t),{ok:!0,message:E}}},40964:(a,b,c)=>{c.d(b,{s4:()=>k,NN:()=>n,Ze:()=>l,mf:()=>m});var d=c(15194);let e=/^[a-zA-Z0-9_-]+$/;function f(a){if(!e.test(a))throw Error(`Invalid session name format: ${a}`)}var g=c(15608);let h="mcbd-",i=/^[0-9a-f]{8}$/,j=[...d.XH].sort((a,b)=>b.length-a.length);function k(){return globalThis.__cmTmuxSessionNamespace??null}function l(a,b,c,e){var g=null===a?h:`${h}${a}-`;let i=`${g}${b}-${c}`;if(!e||e===b)return f(i),i;let j=(0,d.pL)(e,b),k=j?`${i}-${j}`:i;return f(k),k}function m(a,b,c){let d=k(),e=l(d,a,b,c);return null===d?e:(0,g.mc)(e)??e}function n(a){if(!a.startsWith(h))return null;let b=a.slice(h.length),c=null,d=b.indexOf("-");d>0&&i.test(b.slice(0,d))&&(c=b.slice(0,d),b=b.slice(d+1));let e=j.find(a=>b.startsWith(`${a}-`));if(!e)return null;let f=b.slice(e.length+1);return""===f?null:{namespace:c,cliToolId:e,rest:f}}},58707:(a,b,c)=>{c.d(b,{$n:()=>k,a3:()=>l,br:()=>m});var d=c(43234),e=c(31990),f=c(95595),g=c(34405),h=c(72626),i=c(30008);let j=(0,h.h)("prompt-waiting-guard"),k="PROMPT_WAITING";async function l(a,b,c,h){try{let k=d.CLIToolManager.getInstance().getTool(b);if(!await k.isRunning(a,c))return{waiting:!1};let l=await (0,e.Wh)(a,b,g._,c),m=(0,f.WC)(l,b),n=(0,i._G)({worktreeId:a,cliToolId:b,instanceId:c,scraper:{status:m.status,reason:m.reason,hasActivePrompt:m.hasActivePrompt},ignoreStructured:h?.ignoreStructured});if(!n.blocksSend)return null!==n.structuredSendBlockSuppressed&&j.info("structured-send-guard-not-applied",{worktreeId:a,cliToolId:b,instanceId:c,suppressed:n.structuredSendBlockSuppressed,promptWaitingSince:n.structured?.at??null}),{waiting:!1};return{waiting:!0,reason:n.blockReason??void 0,blockedBy:n.blockedBy??void 0}}catch(c){return j.warn("prompt-waiting-check-failed",{worktreeId:a,cliToolId:b,error:c instanceof Error?c.message:String(c)}),{waiting:!1}}}function m(a,b){let c=`${a} is waiting on a prompt. Sending now would type into the prompt's input line instead of reaching the agent, and would leave that text in place for the next answer. Answer the prompt first: \`commandmate respond ${a} <answer>\`.`;if("structured"!==b)return c;let d=Math.round(i.j0/6e4);return`${c} This dialog was reported by the agent's own hooks and is not visible to the terminal scraper, so if the pane looks idle the record has outlived its dialog: it stops blocking sends ${d} minutes after it was reported, or immediately with \`commandmate send ${a} <message> --ignore-structured-prompt\` (server-wide: ${i.F1}=off).`}},85775:(a,b,c)=>{c.d(b,{Tm:()=>o,x4:()=>m,xJ:()=>n});var d=c(34129),e=c(43234),f=c(88807),g=c(72626),h=c(87374),i=c(39687);let j=(0,g.h)("timer-manager");function k(){return globalThis.__timerManagerState||(globalThis.__timerManagerState={timers:new Map,timerWorktrees:new Map,initialized:!1}),globalThis.__timerManagerState}async function l(a){let b=k(),c=(0,f.getDbInstance)();try{let b=(0,d.kx)(c,a);if(!b||"pending"!==b.status)return;let f=e.CLIToolManager.getInstance().getTool(b.cliToolId),g=b.instanceId;if(!await f.isRunning(b.worktreeId,g)){j.warn("timer:no-session",{timerId:a,worktreeId:b.worktreeId,instanceId:g}),(0,d.j2)(c,a,h.HR.NO_SESSION);return}(0,d.j2)(c,a,"sending");let k=await (0,i.d)(c,{worktreeId:b.worktreeId,content:b.message,cliToolId:b.cliToolId,instanceId:g});if(!k.ok){let b=`[${k.stage}] ${k.error}`;(0,d.j2)(c,a,"failed",void 0,b),j.error("timer:send-failed",{timerId:a,stage:k.stage,error:k.error});return}(0,d.j2)(c,a,"sent",Date.now()),j.info("timer:sent",{timerId:a,worktreeId:b.worktreeId})}catch(e){let b=e instanceof Error?e.message:String(e);try{(0,d.j2)(c,a,"failed",void 0,b)}catch{}j.error("timer:send-failed",{timerId:a,error:b})}finally{b.timers.delete(a),b.timerWorktrees.delete(a)}}function m(a,b,c){let d=k(),e=setTimeout(()=>{l(a)},c);d.timers.set(a,e),d.timerWorktrees.set(a,b)}function n(a){let b=k(),c=b.timers.get(a);c&&(clearTimeout(c),b.timers.delete(a),b.timerWorktrees.delete(a));let e=(0,f.getDbInstance)();(0,d.Ud)(e,a)}function o(a){let b=k(),c=(0,f.getDbInstance)();for(let[c,d]of b.timerWorktrees)if(d===a){let a=b.timers.get(c);a&&clearTimeout(a),b.timers.delete(c),b.timerWorktrees.delete(c)}(0,d.$$)(c,a)}},95220:(a,b,c)=>{c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.bE,migrateResponsePollerWorktreeIds:()=>d.sR,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,renamePromptHashCacheKey:()=>h.i2,resolveExtractionStartIndex:()=>e.QM,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{E2:()=>o,Mj:()=>m,Sw:()=>l,lX:()=>p});var d=c(29021),e=c(33873),f=c(54325),g=c(90164);let h=/^v?\d+\.\d+\.\d+$/,i=/^[a-zA-Z0-9.\-\s_v]+$/,j=[".next","required-server-files.json"],k=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function l(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.42.
|
|
1
|
+
"use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{E2:()=>o,Mj:()=>m,Sw:()=>l,lX:()=>p});var d=c(29021),e=c(33873),f=c(54325),g=c(90164);let h=/^v?\d+\.\d+\.\d+$/,i=/^[a-zA-Z0-9.\-\s_v]+$/,j=[".next","required-server-files.json"],k=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function l(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.42.2"}function m(){return l()}let n=null;function o(a){let b=n??=function(){{let a=function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),...j),"utf-8"),b=JSON.parse(a),c=b.config?.env?.NEXT_PUBLIC_APP_VERSION;if("string"==typeof c&&c.length>0)return c;return null}catch{return null}}();if(a)return a}return"0.42.2"}();return(0,f.LE)(b,a)?{serverVersion:b,clientVersion:a}:null}async function p(){try{var a,b,c;if(null!==k.result&&Date.now()-k.fetchedAt<36e5||k.rateLimitResetAt&&(!(Date.now()>=k.rateLimitResetAt)||(k.rateLimitResetAt=null,0)))return k.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${m()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?k.rateLimitResetAt=1e3*parseInt(b,10):k.rateLimitResetAt=Date.now()+36e5}(d),k.result;if(!d.ok)return k.result;let e=await d.json(),f=m(),j=e.tag_name.replace(/^v/,""),l={hasUpdate:function(a,b){if(!h.test(a)||!h.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[g,i,j]=c(b);return g!==d?g>d:i!==e?i>e:j>f}(f,e.tag_name),currentVersion:f,latestVersion:j,releaseUrl:(a=e.html_url).startsWith(g.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,i.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return k.result=l,k.fetchedAt=Date.now(),l}catch{return k.result}}},54325:(a,b,c)=>{c.d(b,{LE:()=>f,Oo:()=>e,ST:()=>d,T4:()=>k,dz:()=>j,r9:()=>h,rx:()=>i,rz:()=>g});let d="client_version",e="version_mismatch";function f(a,b){return!!a&&!!b&&"0.0.0"!==a&&"0.0.0"!==b&&a!==b}let g="chat_turn_progress",h=1e3;function i(a,b=65536){return b<=0?{body:"",truncated:a.length>0}:a.length<=b?{body:a,truncated:!1}:{body:a.slice(a.length-b),truncated:!0}}let j="messages_invalidated",k="model_changed"},88573:(a,b,c)=>{c.d(b,{Lw:()=>s});let d="https://raw.githubusercontent.com/Kewton/commandmate-skills/main/catalog/v1/catalog.json",e=[d],f=/^[A-Za-z0-9/+=_."-]{1,128}$/;var g=c(72626),h=c(13075);let i=(0,g.h)("lib/skills/catalog-client"),j={FETCH_FAILED:"SKILL_CATALOG_FETCH_FAILED",RATE_LIMITED:"SKILL_CATALOG_RATE_LIMITED",OVERSIZED:"SKILL_CATALOG_OVERSIZED",MALFORMED:"SKILL_CATALOG_MALFORMED",INVALID_SCHEMA:"SKILL_CATALOG_INVALID_SCHEMA"},k=globalThis.__skillCatalogCache??={catalog:null,validatedAt:0,confirmedAt:0,etag:null,revision:null,rateLimitResetAt:null,inflight:null};class l extends Error{}let m={[j.FETCH_FAILED]:"The Skill Catalog could not be retrieved.",[j.RATE_LIMITED]:"The Skill Catalog origin is rate limiting requests.",[j.OVERSIZED]:"The Skill Catalog response exceeded the allowed size.",[j.MALFORMED]:"The Skill Catalog response was not valid JSON.",[j.INVALID_SCHEMA]:"The Skill Catalog response did not match the supported Catalog schema."};function n(a){return new Date(a).toISOString()}function o(a,b,c){return{catalog:a,fetchedAt:n(k.validatedAt),revalidatedAt:n(k.confirmedAt),state:b,stale:"stale"===b,offline:"stale"===b,staleReason:c,source:{repository:"Kewton/commandmate-skills",ref:"main",revision:k.revision}}}function p(a,b=[]){return k.catalog?{ok:!0,snapshot:o(k.catalog,"stale",a)}:{ok:!1,failure:{code:a,message:m[a],errors:b}}}async function q(a,b){let c=a.headers.get("Content-Length");if(null!==c){let a=Number(c);if(!Number.isFinite(a)||a<0||a>b)throw new l("content-length out of bounds")}let d=a.body;if(!d||"function"!=typeof d.getReader){let c=await a.text();if(new TextEncoder().encode(c).length>b)throw new l("body exceeded size cap");return c}let e=d.getReader(),f=[],g=0;for(;;){let{done:a,value:c}=await e.read();if(a)break;if(c){if((g+=c.byteLength)>b)throw await e.cancel(),new l("body exceeded size cap");f.push(c)}}let h=new Uint8Array(g),i=0;for(let a of f)h.set(a,i),i+=a.byteLength;return new TextDecoder("utf-8").decode(h)}async function r(a){let b,c,g;if(!e.includes(d))return p(j.FETCH_FAILED);let m={Accept:"application/json","User-Agent":`CommandMate/${a}`};null!==k.catalog&&null!==k.etag&&(m["If-None-Match"]=k.etag);try{b=await fetch(d,{headers:m,cache:"no-store",signal:AbortSignal.timeout(5e3)})}catch{return i.warn("catalog-fetch-failed",{reason:j.FETCH_FAILED}),p(j.FETCH_FAILED)}if(304===b.status&&null!==k.catalog)return k.confirmedAt=Date.now(),{ok:!0,snapshot:o(k.catalog,"revalidated",null)};if(403===b.status||429===b.status)return!function(a){let b=Date.now(),c=b+864e5,d=a.headers.get("X-RateLimit-Reset");if(null!==d){let a=Number(d);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(1e3*a,c);return}}let e=a.headers.get("Retry-After");if(null!==e){let a=Number(e);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(b+1e3*a,c);return}}k.rateLimitResetAt=b+36e5}(b),i.warn("catalog-rate-limited",{status:b.status}),p(j.RATE_LIMITED);if(!b.ok)return i.warn("catalog-fetch-failed",{status:b.status}),p(j.FETCH_FAILED);try{c=await q(b,1048576)}catch(b){let a=b instanceof l?j.OVERSIZED:j.FETCH_FAILED;return i.warn("catalog-body-rejected",{reason:a}),p(a)}try{g=JSON.parse(c)}catch{return i.warn("catalog-malformed",{reason:j.MALFORMED}),p(j.MALFORMED)}let n=(0,h.JJ)(g);if(!n.ok)return i.warn("catalog-invalid-schema",{errorCount:n.errors.length}),p(j.INVALID_SCHEMA,n.errors);let r=Date.now();return k.catalog=n.value,k.validatedAt=r,k.confirmedAt=r,k.etag=b.headers.get("ETag"),k.revision=function(a){if(null===a)return null;let b=a.trim();return f.test(b)?b:null}(k.etag),{ok:!0,snapshot:o(n.value,"fresh",null)}}async function s(a={}){let{hostVersion:b="0.0.0",forceRevalidate:c=!1}=a;return!c&&null!==k.catalog&&Date.now()-k.confirmedAt<9e5&&null!==k.catalog?{ok:!0,snapshot:o(k.catalog,"cached",null)}:null!==k.rateLimitResetAt&&(!(Date.now()>=k.rateLimitResetAt)||(k.rateLimitResetAt=null,0))?p(j.RATE_LIMITED):(null===k.inflight&&(k.inflight=r(b).finally(()=>{k.inflight=null})),k.inflight)}},90164:(a,b,c)=>{c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=8583,exports.ids=[964,8583],exports.modules={15608:(a,b,c)=>{function d(){return globalThis.__cmLegacySessionAliases??=new Map}function e(a){return d().get(a)}function f(a){let b=d(),c=!1;for(let[d,e]of b)e===a&&(b.delete(d),c=!0);return c}c.d(b,{mc:()=>e,y:()=>f})},40964:(a,b,c)=>{c.d(b,{s4:()=>k,NN:()=>
|
|
1
|
+
"use strict";exports.id=8583,exports.ids=[964,8583],exports.modules={15608:(a,b,c)=>{function d(){return globalThis.__cmLegacySessionAliases??=new Map}function e(a){return d().get(a)}function f(a){let b=d(),c=!1;for(let[d,e]of b)e===a&&(b.delete(d),c=!0);return c}c.d(b,{mc:()=>e,y:()=>f})},40964:(a,b,c)=>{c.d(b,{s4:()=>k,NN:()=>n,Ze:()=>l,mf:()=>m});var d=c(15194);let e=/^[a-zA-Z0-9_-]+$/;function f(a){if(!e.test(a))throw Error(`Invalid session name format: ${a}`)}var g=c(15608);let h="mcbd-",i=/^[0-9a-f]{8}$/,j=[...d.XH].sort((a,b)=>b.length-a.length);function k(){return globalThis.__cmTmuxSessionNamespace??null}function l(a,b,c,e){var g=null===a?h:`${h}${a}-`;let i=`${g}${b}-${c}`;if(!e||e===b)return f(i),i;let j=(0,d.pL)(e,b),k=j?`${i}-${j}`:i;return f(k),k}function m(a,b,c){let d=k(),e=l(d,a,b,c);return null===d?e:(0,g.mc)(e)??e}function n(a){if(!a.startsWith(h))return null;let b=a.slice(h.length),c=null,d=b.indexOf("-");d>0&&i.test(b.slice(0,d))&&(c=b.slice(0,d),b=b.slice(d+1));let e=j.find(a=>b.startsWith(`${a}-`));if(!e)return null;let f=b.slice(e.length+1);return""===f?null:{namespace:c,cliToolId:e,rest:f}}}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.id=8728,exports.ids=[8728],exports.modules={3453:(a,b,c)=>{"use strict";c.d(b,{Rh:()=>r,T1:()=>o,Z2:()=>m,c$:()=>n,nu:()=>q});var d=c(72626),e=c(80438);let f=(0,d.h)("ip-restriction"),g="::ffff:",h=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,i=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,2})$/,j=process.env.CM_ALLOWED_IPS?.trim()||"",k=process.env.CM_TRUST_PROXY?.trim()||"";""!==k&&"true"!==k&&"false"!==k&&(0,e.h)(f,"trust-proxy-unexpected",{value:k});let l="true"===k;function m(a){return a?a.toLowerCase().startsWith(g)?a.substring(g.length):a:""}function n(a,b){if(0===b.length)return!1;let c=function(a){let b=a.match(h);if(!b)return null;let c=[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),parseInt(b[4],10)];for(let a of c)if(a<0||a>255)return null;return(c[0]<<24|c[1]<<16|c[2]<<8|c[3])>>>0}(m(a));if(null===c)return!1;for(let a of b)if((c&a.mask)>>>0===a.network)return!0;return!1}function o(a){if(l){let b=a.get("x-forwarded-for");if(b){let a=b.split(",")[0].trim();if(a)return a}}return a.get("x-real-ip")||null}let p=j.length>0?function(a){let b=a.trim();if(0===b.length)return[];let c=b.split(",").map(a=>a.trim()).filter(a=>a.length>0);if(c.length>256)throw Error(`CM_ALLOWED_IPS: too many entries (${c.length}). Maximum is 256.`);let d=[];for(let a of c){if(a.length>18)throw Error(`CM_ALLOWED_IPS: entry "${a}" exceeds maximum length of 18 characters.`);let b=a.match(i);if(b){let c=[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),parseInt(b[4],10)],e=parseInt(b[5],10);for(let b of c)if(b<0||b>255)throw Error(`CM_ALLOWED_IPS: invalid octet in "${a}". Octets must be 0-255.`);if(e<0||e>32)throw Error(`CM_ALLOWED_IPS: invalid prefix length in "${a}". Must be 0-32.`);let f=(c[0]<<24|c[1]<<16|c[2]<<8|c[3])>>>0,g=0===e?0:0xffffffff<<32-e>>>0;d.push({network:(f&g)>>>0,mask:g});continue}let c=a.match(h);if(c){let b=[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10),parseInt(c[4],10)];for(let c of b)if(c<0||c>255)throw Error(`CM_ALLOWED_IPS: invalid octet in "${a}". Octets must be 0-255.`);let e=(b[0]<<24|b[1]<<16|b[2]<<8|b[3])>>>0;d.push({network:e,mask:0xffffffff});continue}throw Error(`CM_ALLOWED_IPS: invalid entry "${a}". Expected IPv4 address or CIDR notation.`)}return d}(j):[];function q(){return p}function r(){return j.length>0}},7015:(a,b,c)=>{"use strict";c.d(b,{Ds:()=>g});var d=c(81719);class e{constructor(a,b=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=a,this.ttl=b}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let a=(0,d.$i)(this.db);for(let b of(this.cache.clear(),a))this.cache.set(b.pathPrefix,b);this.allAppsCache=a,this.lastRefresh=Date.now()}async getByPathPrefix(a){return this.isStale()&&await this.refresh(),this.cache.get(a)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(a){this.invalidate()}}let f=null;function g(a){if(!f){if(!a)throw Error("Database instance required to initialize cache");f=new e(a)}return f}},23854:(a,b,c)=>{"use strict";c.d(b,{$G:()=>f,AL:()=>h,DZ:()=>d,Qe:()=>g,ie:()=>e});let d=4e3,e=15e3;function f(a){var b,c;if(b=a.from,c=a.to,b.worktreeId===c.worktreeId&&b.instanceId===c.instanceId)return{code:"RELAY_SELF_TARGET",message:"A session cannot relay a reply to itself. --reply-to must name a different worktree or a different agent instance."};let d=null===a.parentHops?1:a.parentHops+1;return null===a.parentHops||a.allowRelayChain?d>3?{code:"RELAY_HOPS_EXCEEDED",message:`Relay chains stop at 3 hops; this one would be ${d}. Report the reply to whoever asked instead of forwarding it again.`}:a.openBetween>=1?{code:"RELAY_DUPLICATE_PENDING",message:"There is already an open relay between these two sessions. Wait for it, or withdraw it with `commandmate relays cancel <id>`."}:{ok:!0,hops:d}:{code:"RELAY_CHAIN_BLOCKED",message:"The last message this session was given arrived over a relay, so opening another one would chain two deliveries together. Pass --allow-relay-chain if that is what you mean."}}function g(a){return"code"in a}function h(a){return void 0!==a&&Number.isFinite(a)?Math.min(6048e5,Math.max(6e4,Math.trunc(a))):864e5}},26838:(a,b,c)=>{"use strict";c.d(b,{E2:()=>o,Mj:()=>m,Sw:()=>l,lX:()=>p});var d=c(29021),e=c(33873),f=c(54325),g=c(90164);let h=/^v?\d+\.\d+\.\d+$/,i=/^[a-zA-Z0-9.\-\s_v]+$/,j=[".next","required-server-files.json"],k=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function l(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.42.
|
|
1
|
+
exports.id=8728,exports.ids=[8728],exports.modules={3453:(a,b,c)=>{"use strict";c.d(b,{Rh:()=>r,T1:()=>o,Z2:()=>m,c$:()=>n,nu:()=>q});var d=c(72626),e=c(80438);let f=(0,d.h)("ip-restriction"),g="::ffff:",h=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,i=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,2})$/,j=process.env.CM_ALLOWED_IPS?.trim()||"",k=process.env.CM_TRUST_PROXY?.trim()||"";""!==k&&"true"!==k&&"false"!==k&&(0,e.h)(f,"trust-proxy-unexpected",{value:k});let l="true"===k;function m(a){return a?a.toLowerCase().startsWith(g)?a.substring(g.length):a:""}function n(a,b){if(0===b.length)return!1;let c=function(a){let b=a.match(h);if(!b)return null;let c=[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),parseInt(b[4],10)];for(let a of c)if(a<0||a>255)return null;return(c[0]<<24|c[1]<<16|c[2]<<8|c[3])>>>0}(m(a));if(null===c)return!1;for(let a of b)if((c&a.mask)>>>0===a.network)return!0;return!1}function o(a){if(l){let b=a.get("x-forwarded-for");if(b){let a=b.split(",")[0].trim();if(a)return a}}return a.get("x-real-ip")||null}let p=j.length>0?function(a){let b=a.trim();if(0===b.length)return[];let c=b.split(",").map(a=>a.trim()).filter(a=>a.length>0);if(c.length>256)throw Error(`CM_ALLOWED_IPS: too many entries (${c.length}). Maximum is 256.`);let d=[];for(let a of c){if(a.length>18)throw Error(`CM_ALLOWED_IPS: entry "${a}" exceeds maximum length of 18 characters.`);let b=a.match(i);if(b){let c=[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),parseInt(b[4],10)],e=parseInt(b[5],10);for(let b of c)if(b<0||b>255)throw Error(`CM_ALLOWED_IPS: invalid octet in "${a}". Octets must be 0-255.`);if(e<0||e>32)throw Error(`CM_ALLOWED_IPS: invalid prefix length in "${a}". Must be 0-32.`);let f=(c[0]<<24|c[1]<<16|c[2]<<8|c[3])>>>0,g=0===e?0:0xffffffff<<32-e>>>0;d.push({network:(f&g)>>>0,mask:g});continue}let c=a.match(h);if(c){let b=[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10),parseInt(c[4],10)];for(let c of b)if(c<0||c>255)throw Error(`CM_ALLOWED_IPS: invalid octet in "${a}". Octets must be 0-255.`);let e=(b[0]<<24|b[1]<<16|b[2]<<8|b[3])>>>0;d.push({network:e,mask:0xffffffff});continue}throw Error(`CM_ALLOWED_IPS: invalid entry "${a}". Expected IPv4 address or CIDR notation.`)}return d}(j):[];function q(){return p}function r(){return j.length>0}},7015:(a,b,c)=>{"use strict";c.d(b,{Ds:()=>g});var d=c(81719);class e{constructor(a,b=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=a,this.ttl=b}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let a=(0,d.$i)(this.db);for(let b of(this.cache.clear(),a))this.cache.set(b.pathPrefix,b);this.allAppsCache=a,this.lastRefresh=Date.now()}async getByPathPrefix(a){return this.isStale()&&await this.refresh(),this.cache.get(a)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(a){this.invalidate()}}let f=null;function g(a){if(!f){if(!a)throw Error("Database instance required to initialize cache");f=new e(a)}return f}},23854:(a,b,c)=>{"use strict";c.d(b,{$G:()=>f,AL:()=>h,DZ:()=>d,Qe:()=>g,ie:()=>e});let d=4e3,e=15e3;function f(a){var b,c;if(b=a.from,c=a.to,b.worktreeId===c.worktreeId&&b.instanceId===c.instanceId)return{code:"RELAY_SELF_TARGET",message:"A session cannot relay a reply to itself. --reply-to must name a different worktree or a different agent instance."};let d=null===a.parentHops?1:a.parentHops+1;return null===a.parentHops||a.allowRelayChain?d>3?{code:"RELAY_HOPS_EXCEEDED",message:`Relay chains stop at 3 hops; this one would be ${d}. Report the reply to whoever asked instead of forwarding it again.`}:a.openBetween>=1?{code:"RELAY_DUPLICATE_PENDING",message:"There is already an open relay between these two sessions. Wait for it, or withdraw it with `commandmate relays cancel <id>`."}:{ok:!0,hops:d}:{code:"RELAY_CHAIN_BLOCKED",message:"The last message this session was given arrived over a relay, so opening another one would chain two deliveries together. Pass --allow-relay-chain if that is what you mean."}}function g(a){return"code"in a}function h(a){return void 0!==a&&Number.isFinite(a)?Math.min(6048e5,Math.max(6e4,Math.trunc(a))):864e5}},26838:(a,b,c)=>{"use strict";c.d(b,{E2:()=>o,Mj:()=>m,Sw:()=>l,lX:()=>p});var d=c(29021),e=c(33873),f=c(54325),g=c(90164);let h=/^v?\d+\.\d+\.\d+$/,i=/^[a-zA-Z0-9.\-\s_v]+$/,j=[".next","required-server-files.json"],k=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function l(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.42.2"}function m(){return l()}let n=null;function o(a){let b=n??=function(){{let a=function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),...j),"utf-8"),b=JSON.parse(a),c=b.config?.env?.NEXT_PUBLIC_APP_VERSION;if("string"==typeof c&&c.length>0)return c;return null}catch{return null}}();if(a)return a}return"0.42.2"}();return(0,f.LE)(b,a)?{serverVersion:b,clientVersion:a}:null}async function p(){try{var a,b,c;if(null!==k.result&&Date.now()-k.fetchedAt<36e5||k.rateLimitResetAt&&(!(Date.now()>=k.rateLimitResetAt)||(k.rateLimitResetAt=null,0)))return k.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${m()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?k.rateLimitResetAt=1e3*parseInt(b,10):k.rateLimitResetAt=Date.now()+36e5}(d),k.result;if(!d.ok)return k.result;let e=await d.json(),f=m(),j=e.tag_name.replace(/^v/,""),l={hasUpdate:function(a,b){if(!h.test(a)||!h.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[g,i,j]=c(b);return g!==d?g>d:i!==e?i>e:j>f}(f,e.tag_name),currentVersion:f,latestVersion:j,releaseUrl:(a=e.html_url).startsWith(g.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,i.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return k.result=l,k.fetchedAt=Date.now(),l}catch{return k.result}}},39727:()=>{},43015:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CM_INGRESS_HEADER:()=>U,REMOTE_ONLY_AUTH_SCOPE:()=>V,WORKTREE_RENAMED_EVENT_TYPE:()=>as,__internal:()=>ay,broadcast:()=>ap,broadcastMessage:()=>ar,cleanupRooms:()=>av,closeWebSocket:()=>ax,handleProxyUpgrade:()=>Z,hasRoomSubscribers:()=>aq,isIngressAuthExempt:()=>X,migrateWorktreeRooms:()=>at,setupWebSocket:()=>ab,stampIngress:()=>W});var d=c(81503),e=c(91645),f=c(88081),g=c(3453),h=c(15194),i=c(40964),j=c(88807),k=c(56791);let l={capturePaneCalls:0,activeControlSessions:0,subscriberCount:0,cleanupCount:0,firstOutputLatencyCount:0,firstOutputLatencyTotalMs:0,firstOutputLatencyLastMs:null,firstOutputLatencyMinMs:null,firstOutputLatencyMaxMs:null};var m=c(79892),n=c(72626),o=c(79646);class p{push(a){if(0===a.length)return[];let b=(this.remainder+a).split("\n");this.remainder=b.pop()??"";let c=[];for(let a of b){let b=a.endsWith("\r")?a.slice(0,-1):a,d=this.parseLine(b);d&&c.push(d)}return c}flush(){if(0===this.remainder.length)return[];let a=this.parseLine(this.remainder);return this.remainder="",a?[a]:[]}parseLine(a){return 0===a.length?{type:"output",data:"\n"}:a.startsWith("%output ")?{type:"output",data:`${a.slice(8)}
|
|
2
2
|
`}:"%exit"===a||a.startsWith("%exit ")?{type:"exit",exitCode:null}:a.startsWith("%error ")?{type:"error",error:Error(a.slice(7))}:a.startsWith("%")?null:{type:"output",data:`${a}
|
|
3
3
|
`}}constructor(){this.remainder=""}}let q=(0,n.h)("tmux-control-client");class r{constructor(a={}){this.parser=new p,this.handlers=new Set,this.child=null,this.sessionName=null,this.idleTimer=null,this.started=!1,this.spawnProcess=a.spawnProcess??((a,b,c)=>(0,o.spawn)(a,b,c)),this.tmuxBinary=a.tmuxBinary??"tmux",this.idleTimeoutMs=a.idleTimeoutMs??3e4}start(a){this.started||(this.sessionName=a,this.child=this.spawnProcess(this.tmuxBinary,["-C","attach-session","-t",(0,m.lA)(a)],{stdio:"pipe"}),this.started=!0,this.child.stdout.setEncoding("utf8"),this.child.stdout.on("data",a=>{this.touch();let b="string"==typeof a?a:a.toString("utf8");for(let a of this.parser.push(b))this.emit(a)}),this.child.stderr.setEncoding("utf8"),this.child.stderr.on("data",a=>{let b="string"==typeof a?a:a.toString("utf8");this.emit({type:"error",error:Error(b.trim()||"tmux control stderr")})}),this.child.on("close",a=>{for(let a of this.parser.flush())this.emit(a);this.emit({type:"exit",exitCode:a}),this.stop()}),this.child.on("error",a=>{this.emit({type:"error",error:a}),this.stop()}),this.resetIdleTimer(),q.debug("start",{sessionName:a}))}onEvent(a){return this.handlers.add(a),()=>{this.handlers.delete(a)}}sendInput(a){if(!this.child?.stdin.writable||null===this.sessionName)throw Error("Tmux control client is not writable");this.touch();let b=Buffer.from(a,"utf8");for(let a=0;a<b.length;a+=256){let c=Array.from(b.subarray(a,a+256),a=>a.toString(16).padStart(2,"0")).join(" ");this.child.stdin.write(`send-keys -t ${(0,m.lA)(this.sessionName)} -H ${c}
|
|
4
4
|
`)}}resize(a,b){if(!this.child?.stdin.writable)throw Error("Tmux control client is not writable");this.touch(),this.child.stdin.write(`refresh-client -C ${a}x${b}
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
cli_tool_id = COALESCE(excluded.cli_tool_id, worktrees.cli_tool_id),
|
|
273
273
|
-- Issue #1003: keep the last known branch when a non-sync writer omits it.
|
|
274
274
|
branch = COALESCE(excluded.branch, worktrees.branch)
|
|
275
|
-
`).run(b.id,b.name,b.path,b.repositoryPath||null,b.repositoryName||null,b.description||null,b.lastUserMessage||null,b.lastUserMessageAt?.getTime()||null,b.lastMessageSummary||null,b.updatedAt?.getTime()||null,b.cliToolId
|
|
275
|
+
`).run(b.id,b.name,b.path,b.repositoryPath||null,b.repositoryName||null,b.description||null,b.lastUserMessage||null,b.lastUserMessageAt?.getTime()||null,b.lastMessageSummary||null,b.updatedAt?.getTime()||null,b.cliToolId??null,b.branch||null)})()}function o(a,b,c){(0,h.D6)(a,b,c)}function p(a,b,c){a.prepare(`
|
|
276
276
|
UPDATE worktrees
|
|
277
277
|
SET description = ?
|
|
278
278
|
WHERE id = ?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=964,exports.ids=[964,8583],exports.modules={15608:(a,b,c)=>{function d(){return globalThis.__cmLegacySessionAliases??=new Map}function e(a){return d().get(a)}function f(a){let b=d(),c=!1;for(let[d,e]of b)e===a&&(b.delete(d),c=!0);return c}c.d(b,{mc:()=>e,y:()=>f})},40964:(a,b,c)=>{c.d(b,{s4:()=>k,NN:()=>
|
|
1
|
+
"use strict";exports.id=964,exports.ids=[964,8583],exports.modules={15608:(a,b,c)=>{function d(){return globalThis.__cmLegacySessionAliases??=new Map}function e(a){return d().get(a)}function f(a){let b=d(),c=!1;for(let[d,e]of b)e===a&&(b.delete(d),c=!0);return c}c.d(b,{mc:()=>e,y:()=>f})},40964:(a,b,c)=>{c.d(b,{s4:()=>k,NN:()=>n,Ze:()=>l,mf:()=>m});var d=c(15194);let e=/^[a-zA-Z0-9_-]+$/;function f(a){if(!e.test(a))throw Error(`Invalid session name format: ${a}`)}var g=c(15608);let h="mcbd-",i=/^[0-9a-f]{8}$/,j=[...d.XH].sort((a,b)=>b.length-a.length);function k(){return globalThis.__cmTmuxSessionNamespace??null}function l(a,b,c,e){var g=null===a?h:`${h}${a}-`;let i=`${g}${b}-${c}`;if(!e||e===b)return f(i),i;let j=(0,d.pL)(e,b),k=j?`${i}-${j}`:i;return f(k),k}function m(a,b,c){let d=k(),e=l(d,a,b,c);return null===d?e:(0,g.mc)(e)??e}function n(a){if(!a.startsWith(h))return null;let b=a.slice(h.length),c=null,d=b.indexOf("-");d>0&&i.test(b.slice(0,d))&&(c=b.slice(0,d),b=b.slice(d+1));let e=j.find(a=>b.startsWith(`${a}-`));if(!e)return null;let f=b.slice(e.length+1);return""===f?null:{namespace:c,cliToolId:e,rest:f}}}};
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"wasm": [],
|
|
18
18
|
"assets": [],
|
|
19
19
|
"env": {
|
|
20
|
-
"__NEXT_BUILD_ID": "
|
|
21
|
-
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "
|
|
22
|
-
"__NEXT_PREVIEW_MODE_ID": "
|
|
23
|
-
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "
|
|
24
|
-
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "
|
|
20
|
+
"__NEXT_BUILD_ID": "MXZXkcFAnpELZnxxHB4iJ",
|
|
21
|
+
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "rCrZWiMktpjkIAhzo7VIw6QfeeTLgH23hPp3WWoJuCk=",
|
|
22
|
+
"__NEXT_PREVIEW_MODE_ID": "749dfaeb1bf0d26c19a65230b02b4aeb",
|
|
23
|
+
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "92b16e3efdb7832440642aa7a63c722d1667ca8e9cfb11da7a2a48e1e47c45d7",
|
|
24
|
+
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "0c22bef0d755aebc7fcb934ee73494d8756477a78e8d6255165f71a59b1fc717"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-49ade0526854dd4e.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-ac91ed6e71380841.js" defer=""></script><script src="/_next/static/chunks/pages/_app-4b3fb5e477a0267f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-c970d8b55ace1b48.js" defer=""></script><script src="/_next/static/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-49ade0526854dd4e.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-ac91ed6e71380841.js" defer=""></script><script src="/_next/static/chunks/pages/_app-4b3fb5e477a0267f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-c970d8b55ace1b48.js" defer=""></script><script src="/_next/static/MXZXkcFAnpELZnxxHB4iJ/_buildManifest.js" defer=""></script><script src="/_next/static/MXZXkcFAnpELZnxxHB4iJ/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"MXZXkcFAnpELZnxxHB4iJ","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"rCrZWiMktpjkIAhzo7VIw6QfeeTLgH23hPp3WWoJuCk="}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2407],{52407:(e,t,n)=>{n.d(t,{Fx:()=>h,Rh:()=>b,_X:()=>c,fl:()=>s,nG:()=>d,sV:()=>o});var r=n(12115),u=n(60199);let l="/api/capabilities";function c(e){return!1!==e.browserOnline&&("connected"===e.realtimeStatus||!0===e.serverReachable)}function o(e){return!1===e.browserOnline||!1===e.serverReachable}let i=new Map;async function a(e,t){let n="function"==typeof AbortController?new AbortController:void 0,r=n?setTimeout(()=>n.abort(),t):void 0;try{return await fetch(e,{method:"GET",cache:"no-store",credentials:"same-origin",signal:null==n?void 0:n.signal}),!0}catch(e){return!1}finally{void 0!==r&&clearTimeout(r)}}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;if("function"!=typeof fetch)return Promise.resolve(!1);let n=i.get(e);if(n)return n;let r=a(e,t).finally(()=>{i.delete(e)});return i.set(e,r),r}let f=new Set;function d(e){f.forEach(t=>{try{t(e)}catch(e){}})}function b(e){return f.add(e),()=>{f.delete(e)}}function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{probeUrl:t=l,probeDelayMs:n=1e3,probeIntervalMs:c=15e3,probeTimeoutMs:o=5e3,surfaceDelayMs:i=1500,probe:a=!0}=e,{status:f}=(0,u.xM)(),[d,h]=(0,r.useState)(!0),[v,y]=(0,r.useState)(null),[w,m]=(0,r.useState)(null),p=(0,r.useCallback)(e=>{y(t=>t===e?t:e),e&&m(Date.now())},[]);(0,r.useEffect)(()=>{if("undefined"==typeof navigator)return;h(!1!==navigator.onLine);let e=()=>{y(null),h(!0)},t=()=>{y(null),h(!1)};return window.addEventListener("online",e),window.addEventListener("offline",t),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}},[]),(0,r.useEffect)(()=>{"connected"===f&&p(!0)},[f,p]),(0,r.useEffect)(()=>b(p),[p]);let g=(0,r.useMemo)(()=>({browserOnline:d,realtimeStatus:f,serverReachable:v}),[d,f,v]),S=g.browserOnline?"connected"===g.realtimeStatus?"online":!1===g.serverReachable?"offline":!0===g.serverReachable||"connecting"===g.realtimeStatus?"reconnecting":"offline":"offline",E="online"!==S,k=(0,r.useRef)({url:t,timeoutMs:o});k.current={url:t,timeoutMs:o};let C=a&&E&&d;(0,r.useEffect)(()=>{let e;if(!C||"function"!=typeof fetch)return;let t=!1,r=async()=>{let{url:n,timeoutMs:u}=k.current,l=await s(n,u);t||(p(l),e=setTimeout(r,c))};return e=setTimeout(r,n),()=>{t=!0,void 0!==e&&clearTimeout(e)}},[C,n,c,p]);let[R,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!E)return void T(!1);if(i<=0)return void T(!0);let e=setTimeout(()=>T(!0),i);return()=>clearTimeout(e)},[E,i]);let M=(0,r.useCallback)(()=>{if("function"!=typeof fetch)return;let{url:e,timeoutMs:t}=k.current;s(e,t).then(p)},[p]);return(0,r.useMemo)(()=>({status:S,isOnline:"online"===S,isReconnecting:"reconnecting"===S,isOffline:"offline"===S,shouldSurface:E&&R,signals:g,lastReachableAt:w,recheck:M}),[S,E,R,g,w,M])}},52703:(e,t,n)=>{n.d(t,{Oo:()=>u,ST:()=>r,T4:()=>o,dz:()=>c,rz:()=>l,zS:()=>i});let r="client_version",u="version_mismatch",l="chat_turn_progress",c="messages_invalidated",o="model_changed";function i(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;let n=t;if("broadcast"===n.type){let e=n.data;return e&&"object"==typeof e?"string"!=typeof e.type?null:(void 0===e.worktreeId&&"string"==typeof n.worktreeId&&(e.worktreeId=n.worktreeId),e):null}return"string"==typeof n.type?n:null}},60199:(e,t,n)=>{n.d(t,{tS:()=>s,xM:()=>f,T3:()=>d});var r=n(95155),u=n(12115),l=n(52703);function c(){return"undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null}let o=()=>{},i={status:"disconnected",connected:!1,subscribe:o,unsubscribe:o,addListener:()=>o},a=(0,u.createContext)(null);function s(e){let{children:t,enabled:n=!0}=e,o=(0,u.useRef)(new Set),i=(0,u.useRef)(new Map),{status:s,subscribe:f,unsubscribe:d}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onEvent:t,onStatusChange:n,autoReconnect:r=!0,reconnectBaseDelay:o=1e3,reconnectMaxDelay:i=3e4,livenessTimeout:a=75e3,livenessCheckInterval:s=5e3,enabled:f=!0}=e,[d,b]=(0,u.useState)("disconnected"),h=(0,u.useRef)(null),v=(0,u.useRef)(null),y=(0,u.useRef)(0),w=(0,u.useRef)(new Set),m=(0,u.useRef)(!1),p=(0,u.useRef)(0),g=(0,u.useRef)(()=>{}),S=(0,u.useRef)(t);S.current=t;let E=(0,u.useRef)(n);E.current=n;let k=(0,u.useCallback)(e=>{var t;b(e),null==(t=E.current)||t.call(E,e)},[]),C=(0,u.useCallback)(()=>{null!==v.current&&(clearTimeout(v.current),v.current=null)},[]),R=(0,u.useCallback)(()=>{if(m.current||!r||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;C();let e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.random;return Math.max(0,Math.round(Math.min(t*2**Math.max(0,e),n)*(1+(2*r()-1)*.2)))}(y.current,o,i);y.current+=1,v.current=setTimeout(()=>{v.current=null,g.current()},e)},[r,o,i,C]),T=(0,u.useCallback)(()=>{if(!f)return;let e=c();if(!e||h.current&&(h.current.readyState===e.OPEN||h.current.readyState===e.CONNECTING))return;C(),m.current=!1,p.current=Date.now(),k("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",n=new e("".concat(t,"//").concat(window.location.host));h.current=n,n.onopen=()=>{y.current=0,p.current=Date.now(),k("connected");try{n.send(JSON.stringify({type:l.ST,version:"0.42.
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2407],{52407:(e,t,n)=>{n.d(t,{Fx:()=>h,Rh:()=>b,_X:()=>c,fl:()=>s,nG:()=>d,sV:()=>o});var r=n(12115),u=n(60199);let l="/api/capabilities";function c(e){return!1!==e.browserOnline&&("connected"===e.realtimeStatus||!0===e.serverReachable)}function o(e){return!1===e.browserOnline||!1===e.serverReachable}let i=new Map;async function a(e,t){let n="function"==typeof AbortController?new AbortController:void 0,r=n?setTimeout(()=>n.abort(),t):void 0;try{return await fetch(e,{method:"GET",cache:"no-store",credentials:"same-origin",signal:null==n?void 0:n.signal}),!0}catch(e){return!1}finally{void 0!==r&&clearTimeout(r)}}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;if("function"!=typeof fetch)return Promise.resolve(!1);let n=i.get(e);if(n)return n;let r=a(e,t).finally(()=>{i.delete(e)});return i.set(e,r),r}let f=new Set;function d(e){f.forEach(t=>{try{t(e)}catch(e){}})}function b(e){return f.add(e),()=>{f.delete(e)}}function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{probeUrl:t=l,probeDelayMs:n=1e3,probeIntervalMs:c=15e3,probeTimeoutMs:o=5e3,surfaceDelayMs:i=1500,probe:a=!0}=e,{status:f}=(0,u.xM)(),[d,h]=(0,r.useState)(!0),[v,y]=(0,r.useState)(null),[w,m]=(0,r.useState)(null),p=(0,r.useCallback)(e=>{y(t=>t===e?t:e),e&&m(Date.now())},[]);(0,r.useEffect)(()=>{if("undefined"==typeof navigator)return;h(!1!==navigator.onLine);let e=()=>{y(null),h(!0)},t=()=>{y(null),h(!1)};return window.addEventListener("online",e),window.addEventListener("offline",t),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}},[]),(0,r.useEffect)(()=>{"connected"===f&&p(!0)},[f,p]),(0,r.useEffect)(()=>b(p),[p]);let g=(0,r.useMemo)(()=>({browserOnline:d,realtimeStatus:f,serverReachable:v}),[d,f,v]),S=g.browserOnline?"connected"===g.realtimeStatus?"online":!1===g.serverReachable?"offline":!0===g.serverReachable||"connecting"===g.realtimeStatus?"reconnecting":"offline":"offline",E="online"!==S,k=(0,r.useRef)({url:t,timeoutMs:o});k.current={url:t,timeoutMs:o};let C=a&&E&&d;(0,r.useEffect)(()=>{let e;if(!C||"function"!=typeof fetch)return;let t=!1,r=async()=>{let{url:n,timeoutMs:u}=k.current,l=await s(n,u);t||(p(l),e=setTimeout(r,c))};return e=setTimeout(r,n),()=>{t=!0,void 0!==e&&clearTimeout(e)}},[C,n,c,p]);let[R,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!E)return void T(!1);if(i<=0)return void T(!0);let e=setTimeout(()=>T(!0),i);return()=>clearTimeout(e)},[E,i]);let M=(0,r.useCallback)(()=>{if("function"!=typeof fetch)return;let{url:e,timeoutMs:t}=k.current;s(e,t).then(p)},[p]);return(0,r.useMemo)(()=>({status:S,isOnline:"online"===S,isReconnecting:"reconnecting"===S,isOffline:"offline"===S,shouldSurface:E&&R,signals:g,lastReachableAt:w,recheck:M}),[S,E,R,g,w,M])}},52703:(e,t,n)=>{n.d(t,{Oo:()=>u,ST:()=>r,T4:()=>o,dz:()=>c,rz:()=>l,zS:()=>i});let r="client_version",u="version_mismatch",l="chat_turn_progress",c="messages_invalidated",o="model_changed";function i(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;let n=t;if("broadcast"===n.type){let e=n.data;return e&&"object"==typeof e?"string"!=typeof e.type?null:(void 0===e.worktreeId&&"string"==typeof n.worktreeId&&(e.worktreeId=n.worktreeId),e):null}return"string"==typeof n.type?n:null}},60199:(e,t,n)=>{n.d(t,{tS:()=>s,xM:()=>f,T3:()=>d});var r=n(95155),u=n(12115),l=n(52703);function c(){return"undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null}let o=()=>{},i={status:"disconnected",connected:!1,subscribe:o,unsubscribe:o,addListener:()=>o},a=(0,u.createContext)(null);function s(e){let{children:t,enabled:n=!0}=e,o=(0,u.useRef)(new Set),i=(0,u.useRef)(new Map),{status:s,subscribe:f,unsubscribe:d}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onEvent:t,onStatusChange:n,autoReconnect:r=!0,reconnectBaseDelay:o=1e3,reconnectMaxDelay:i=3e4,livenessTimeout:a=75e3,livenessCheckInterval:s=5e3,enabled:f=!0}=e,[d,b]=(0,u.useState)("disconnected"),h=(0,u.useRef)(null),v=(0,u.useRef)(null),y=(0,u.useRef)(0),w=(0,u.useRef)(new Set),m=(0,u.useRef)(!1),p=(0,u.useRef)(0),g=(0,u.useRef)(()=>{}),S=(0,u.useRef)(t);S.current=t;let E=(0,u.useRef)(n);E.current=n;let k=(0,u.useCallback)(e=>{var t;b(e),null==(t=E.current)||t.call(E,e)},[]),C=(0,u.useCallback)(()=>{null!==v.current&&(clearTimeout(v.current),v.current=null)},[]),R=(0,u.useCallback)(()=>{if(m.current||!r||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;C();let e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.random;return Math.max(0,Math.round(Math.min(t*2**Math.max(0,e),n)*(1+(2*r()-1)*.2)))}(y.current,o,i);y.current+=1,v.current=setTimeout(()=>{v.current=null,g.current()},e)},[r,o,i,C]),T=(0,u.useCallback)(()=>{if(!f)return;let e=c();if(!e||h.current&&(h.current.readyState===e.OPEN||h.current.readyState===e.CONNECTING))return;C(),m.current=!1,p.current=Date.now(),k("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",n=new e("".concat(t,"//").concat(window.location.host));h.current=n,n.onopen=()=>{y.current=0,p.current=Date.now(),k("connected");try{n.send(JSON.stringify({type:l.ST,version:"0.42.2"}))}catch(e){}w.current.forEach(e=>{try{n.send(JSON.stringify({type:"subscribe",worktreeId:e}))}catch(e){}})},n.onmessage=e=>{var t;p.current=Date.now();let n="string"==typeof e.data?e.data:String(e.data),r=(0,l.zS)(n);r&&"heartbeat"!==r.type&&(null==(t=S.current)||t.call(S,r))},n.onerror=()=>{k("error")},n.onclose=()=>{h.current=null,k("disconnected"),R()}},[f,k,C,R]);g.current=T;let M=(0,u.useCallback)(()=>{let e=h.current;if(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null,h.current=null;try{e.close(4001,"half-open")}catch(e){}k("disconnected"),R()}},[k,R]),O=(0,u.useCallback)(()=>{if(C(),m.current=!0,h.current){try{h.current.close(1e3,"Client disconnect")}catch(e){}h.current=null}},[C]),N=(0,u.useCallback)(e=>{let t=h.current,n=c();if(t&&n&&t.readyState===n.OPEN)try{t.send(JSON.stringify(e))}catch(e){}},[]),_=(0,u.useCallback)(e=>{w.current.has(e)||(w.current.add(e),N({type:"subscribe",worktreeId:e}))},[N]),L=(0,u.useCallback)(e=>{w.current.has(e)&&(w.current.delete(e),N({type:"unsubscribe",worktreeId:e}))},[N]);return(0,u.useEffect)(()=>{if(f)return T(),()=>{O()}},[f,T,O]),(0,u.useEffect)(()=>{if(!f)return;let e=setInterval(()=>{let e=h.current,t=c();e&&t&&e.readyState===t.OPEN&&(Date.now()-p.current<a||M())},s);return()=>clearInterval(e)},[f,a,s,M]),(0,u.useEffect)(()=>{if(!f||"undefined"==typeof document)return;let e=()=>{"visible"===document.visibilityState&&(h.current||(y.current=0,T()))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[f,T]),(0,u.useEffect)(()=>{if(!f)return;let e=()=>{h.current||(y.current=0,T())};return window.addEventListener("online",e),()=>window.removeEventListener("online",e)},[f,T]),{status:d,subscribe:_,unsubscribe:L,send:N}}({enabled:n,onEvent:(0,u.useCallback)(e=>{o.current.forEach(t=>{try{t(e)}catch(e){}})},[])}),b=(0,u.useCallback)(e=>{var t;let n=i.current,r=null!=(t=n.get(e))?t:0;n.set(e,r+1),0===r&&f(e)},[f]),h=(0,u.useCallback)(e=>{var t;let n=i.current,r=null!=(t=n.get(e))?t:0;r<=1?(n.delete(e),d(e)):n.set(e,r-1)},[d]),v=(0,u.useCallback)(e=>(o.current.add(e),()=>{o.current.delete(e)}),[]),y=(0,u.useMemo)(()=>({status:s,connected:"connected"===s,subscribe:b,unsubscribe:h,addListener:v}),[s,b,h,v]);return(0,r.jsx)(a.Provider,{value:y,children:t})}function f(){var e;return null!=(e=(0,u.useContext)(a))?e:i}function d(e){let{addListener:t}=f(),n=(0,u.useRef)(e);n.current=e,(0,u.useEffect)(()=>t(e=>n.current(e)),[t])}}}]);
|