@henlii/pidance 0.2.28 → 0.2.30
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-path-routes-manifest.json +11 -10
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +8 -0
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/about/route.js +1 -1
- package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/running/events/route.js +1 -1
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/agent/submissions/[submissionId]/route.js +1 -0
- package/.next/server/app/api/agent/submissions/[submissionId]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/agent-settings/route.js +2 -2
- package/.next/server/app/api/attachments/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auth/ui-session/route.js +1 -1
- package/.next/server/app/api/auth/ui-sessions/[id]/route.js +1 -1
- package/.next/server/app/api/auth/ui-sessions/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/validate/route.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/file-index/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +1 -1
- package/.next/server/app/api/git/diff/route.js +1 -1
- package/.next/server/app/api/git/status/route.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/message-media/route.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models-config/raw/route.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/plugins/route.js +1 -1
- package/.next/server/app/api/plugins/search/route.js +1 -1
- package/.next/server/app/api/plugins/updates/route.js +1 -1
- package/.next/server/app/api/preferences/route.js +1 -1
- package/.next/server/app/api/project-assets/route.js +2 -2
- package/.next/server/app/api/prompts/route.js +1 -1
- package/.next/server/app/api/pty/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/archive/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/command-entry/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/info/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/outline/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/tool-results/[toolCallId]/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/search/route.js +1 -1
- package/.next/server/app/api/settings/raw/route.js +2 -2
- package/.next/server/app/api/settings/remote/route.js +1 -1
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +1 -1
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/update/route.js +1 -1
- package/.next/server/app/api/subagent-runs/route.js +1 -1
- package/.next/server/app/api/update/apply/route.js +2 -2
- package/.next/server/app/api/update/check/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/icon.png/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +5 -5
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +5 -5
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/page.js +15 -15
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +11 -10
- package/.next/server/chunks/188.js +1 -1
- package/.next/server/chunks/2356.js +2 -0
- package/.next/server/chunks/3379.js +1 -1
- package/.next/server/chunks/3557.js +1 -0
- package/.next/server/chunks/5274.js +1 -1
- package/.next/server/chunks/5304.js +2 -2
- package/.next/server/chunks/5582.js +1 -1
- package/.next/server/chunks/6192.js +1 -1
- package/.next/server/chunks/7594.js +5 -5
- package/.next/server/chunks/9935.js +1 -0
- package/.next/server/instrumentation.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/{Ni2HugOTDE44QzNWaiTkR → 7Pv6SoXSxrYy0FZPYHHKJ}/_buildManifest.js +1 -1
- package/.next/static/chunks/9780-e89266f79eb581fe.js +1 -0
- package/.next/static/chunks/app/_global-error/page-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/about/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/agent/running/events/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/agent/running/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/agent/submissions/[submissionId]/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/agent-settings/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/attachments/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/auth/ui-session/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/auth/ui-sessions/[id]/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/auth/ui-sessions/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/cwd/browse/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/cwd/validate/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/file-index/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/home/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/message-media/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/models/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/models-config/raw/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/plugins/search/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/plugins/updates/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/project-assets/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/prompts/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/pty/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/archive/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/command-entry/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/export/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/info/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/outline/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/state/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/tool-results/[toolCallId]/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/sessions/search/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/settings/raw/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/settings/remote/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/skills/check/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/skills/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/skills/update/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/subagent-runs/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/update/apply/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/update/check/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/app/page-05c85e412b0302f9.js +25 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-3154b10ff0f29211.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3154b10ff0f29211.js +1 -0
- package/.next/static/css/2655240c351314b2.css +1 -0
- package/README.en.md +19 -15
- package/README.md +17 -13
- package/README.zh-CN.md +11 -204
- package/bin/pidance-http-server.js +10 -0
- package/bin/pty-manager.cjs +3 -12
- package/bin/pty-shell.cjs +27 -0
- package/bin/pty-worker.js +17 -8
- package/package.json +2 -2
- package/.next/static/chunks/9780-4b76db8fbfb345c2.js +0 -1
- package/.next/static/chunks/app/_global-error/page-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/about/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/agent/running/events/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/agent/running/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/agent-settings/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/attachments/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/auth/ui-session/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/auth/ui-sessions/[id]/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/auth/ui-sessions/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/cwd/browse/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/cwd/validate/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/file-index/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/home/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/message-media/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/models/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/models-config/raw/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/plugins/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/plugins/search/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/plugins/updates/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/project-assets/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/prompts/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/pty/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/archive/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/command-entry/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/export/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/info/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/outline/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/state/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/tool-results/[toolCallId]/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/sessions/search/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/settings/raw/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/settings/remote/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/skills/check/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/skills/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/skills/update/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/subagent-runs/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/update/apply/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/update/check/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/app/page-354e6fd7f7df840b.js +0 -25
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-005f7c16c8d63642.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-005f7c16c8d63642.js +0 -1
- package/.next/static/css/1c6fd1229e5153db.css +0 -1
- /package/.next/static/{Ni2HugOTDE44QzNWaiTkR → 7Pv6SoXSxrYy0FZPYHHKJ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";exports.id=2356,exports.ids=[2356],exports.modules={82356:(a,b,c)=>{c.d(b,{AZ:()=>u,GT:()=>h,Hl:()=>v,kP:()=>t,sweepStaleRunningLeases:()=>s,wy:()=>w});var d=c(716),e=c(89477),f=c(86697),g=c(92783);let h="Session is locked by another Pidance process (writable host ownership)",i="Timed out acquiring Pidance running-lease lock";function j(a){return(0,f.join)(a,"pidance-running-leases")}function k(a,b){let c=b.replace(/[^a-zA-Z0-9._-]+/g,"_").slice(0,180);return(0,f.join)(j(a),`${c}.json`)}function l(a){if(!Number.isFinite(a)||a<=0)return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code}}function m(a){try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));if("number"!=typeof b.pid||"string"!=typeof b.sessionId||"number"!=typeof b.heartbeatAt)return null;return{pid:b.pid,sessionId:b.sessionId,heartbeatAt:b.heartbeatAt,startedAt:"number"==typeof b.startedAt?b.startedAt:b.heartbeatAt}}catch{return null}}function n(a){try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));if("number"!=typeof b.pid||"string"!=typeof b.token)return null;return{pid:b.pid,token:b.token}}catch{return null}}function o(a,b){let c=j(a);(0,e.existsSync)(c)||(0,e.mkdirSync)(c,{recursive:!0,mode:448});let g=(0,f.join)(c,".lease-lock"),h=(0,d.randomBytes)(8).toString("hex"),k=Date.now()+3e3,m=!1;for(;!m;){let a=`${g}.${process.pid}.${h}.tmp`;try{(0,e.writeFileSync)(a,JSON.stringify({pid:process.pid,token:h}),{mode:384}),(0,e.linkSync)(a,g),m=!0}catch(b){if("EEXIST"!==b.code){try{(0,e.unlinkSync)(a)}catch{}throw b}}try{(0,e.unlinkSync)(a)}catch{}if(m)break;let b=n(g);if(b&&!l(b.pid)){try{n(g)?.token===b.token&&(0,e.unlinkSync)(g)}catch{}continue}if(!b)try{Date.now()-(0,e.statSync)(g).mtimeMs>1e4&&(0,e.unlinkSync)(g)}catch{}if(Date.now()>=k)throw Error(i);!function(){let a=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(a,0,0,5)}()}try{return b()}finally{try{n(g)?.token===h&&(0,e.unlinkSync)(g)}catch{}}}function p(a){return a instanceof Error&&a.message===i}function q(a,b){let c=`${a}.${process.pid}.tmp`;(0,e.writeFileSync)(c,`${JSON.stringify(b)}
|
|
2
|
+
`,{mode:384}),(0,e.renameSync)(c,a)}function r(a){return!!(a&&l(a.pid))}function s(a=(0,g.$M)(),b=Date.now()){try{let c,{fresh:d,removed:g}=(c=j(a),(0,e.existsSync)(c)?o(a,()=>{let a=[],d=0;for(let g of(0,e.readdirSync)(c)){if(!g.endsWith(".json"))continue;let h=(0,f.join)(c,g),i=m(h);if(!r(i)){try{(0,e.unlinkSync)(h),d+=1}catch{}continue}b-i.heartbeatAt<=2e4&&l(i.pid)&&a.push(i)}return{fresh:a,removed:d}}):{fresh:[],removed:0});return{removed:g,active:d.length,skipped:!1}}catch(a){if(p(a))return{removed:0,active:0,skipped:!0};throw a}}function t(a,b=(0,g.$M)(),c=Date.now()){if(!a)return!1;try{return o(b,()=>{let d=k(b,a),f=(0,e.existsSync)(d)?m(d):null;return!(f&&f.pid!==process.pid&&r(f))&&(q(d,{pid:process.pid,sessionId:a,heartbeatAt:c,startedAt:f&&f.pid===process.pid?f.startedAt:c}),!0)})}catch(a){if(p(a))return!1;throw a}}function u(a,b=(0,g.$M)(),c=Date.now()){if(a)try{o(b,()=>{let d=k(b,a),f=(0,e.existsSync)(d)?m(d):null;f&&f.pid!==process.pid&&r(f)||q(d,{pid:process.pid,sessionId:a,heartbeatAt:c,startedAt:f&&f.pid===process.pid?f.startedAt:c})})}catch(a){if(!p(a))throw a}}function v(a,b=(0,g.$M)()){if(a)try{o(b,()=>{let c=k(b,a),d=(0,e.existsSync)(c)?m(c):null;if(!d||d.pid===process.pid)try{(0,e.unlinkSync)(c)}catch{}})}catch(a){if(!p(a))throw a}}function w(a,b=(0,g.$M)(),c=Date.now()){if(!a)return!1;let d=(0,e.existsSync)(k(b,a))?m(k(b,a)):null;return!!d&&d.pid!==process.pid&&r(d)}},92783:(a,b,c)=>{c.d(b,{$M:()=>f});var d=c(62228),e=c(86697);function f(a=process.env){let b=a.PI_CODING_AGENT_DIR?.trim();if(b)return"~"===b?(0,d.homedir)():b.startsWith("~/")||b.startsWith("~\\")?(0,e.join)((0,d.homedir)(),b.slice(2)):b;return(0,e.join)((0,d.homedir)(),".pi","agent")}}};
|