cuelo 0.10.52 → 0.10.53
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 +35 -35
- package/.next/build-manifest.json +4 -4
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +549 -561
- package/.next/required-server-files.js +25 -25
- package/.next/required-server-files.json +25 -25
- 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 +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- 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 +1 -1
- package/.next/server/app/api/agent/[id]/account/route.js +1 -1
- package/.next/server/app/api/agent/[id]/account/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
- package/.next/server/app/api/agent/[id]/bash-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/new/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/agent/running/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/attachment-settings/route.js +1 -1
- package/.next/server/app/api/attachment-settings/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/attachments/[id]/transcription/route.js +2 -2
- package/.next/server/app/api/attachments/[id]/transcription/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/attachments/draft/route.js +1 -1
- package/.next/server/app/api/attachments/draft/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/attachments/route.js +2 -2
- package/.next/server/app/api/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/character-mode/route.js +1 -2
- package/.next/server/app/api/character-mode/route.js.nft.json +1 -1
- package/.next/server/app/api/character-mode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/cwd/validate/route.js +1 -1
- package/.next/server/app/api/cwd/validate/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/display-settings/route.js +1 -1
- package/.next/server/app/api/display-settings/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/document-text/route.js +2 -2
- package/.next/server/app/api/document-text/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/experiments/route.js +1 -1
- package/.next/server/app/api/experiments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/file-index/route.js +1 -1
- package/.next/server/app/api/file-index/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/diff/route.js +1 -1
- package/.next/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/status/route.js +2 -2
- package/.next/server/app/api/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/github/projects/route.js +1 -1
- package/.next/server/app/api/github/projects/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/gpt6/handles/route.js +1 -1
- package/.next/server/app/api/gpt6/handles/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/gpt6/reply/route.js +1 -1
- package/.next/server/app/api/gpt6/reply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/gpt6/token/route.js +1 -1
- package/.next/server/app/api/gpt6/token/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/gpt6/web6-session/route.js +1 -1
- package/.next/server/app/api/gpt6/web6-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/home/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/live/call/[callId]/route.js +2 -2
- package/.next/server/app/api/live/call/[callId]/route.js.nft.json +1 -1
- package/.next/server/app/api/live/call/[callId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/live/events/route.js +2 -2
- package/.next/server/app/api/live/events/route.js.nft.json +1 -1
- package/.next/server/app/api/live/events/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/live/interpret/route.js +2 -2
- package/.next/server/app/api/live/interpret/route.js.nft.json +1 -1
- package/.next/server/app/api/live/interpret/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/live/offer/route.js +1 -1
- package/.next/server/app/api/live/offer/route.js.nft.json +1 -1
- package/.next/server/app/api/live/offer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/live/voices/route.js +1 -1
- package/.next/server/app/api/live/voices/route.js.nft.json +1 -1
- package/.next/server/app/api/live/voices/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/mcp/route.js +2 -2
- package/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/model-roles/route.js +1 -1
- package/.next/server/app/api/model-roles/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/catalog/route.js +1 -1
- package/.next/server/app/api/models-config/catalog/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/route.js +3 -3
- package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/office-characters/[...path]/route.js +1 -2
- package/.next/server/app/api/office-characters/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/office-characters/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plugins/route.js +1 -1
- package/.next/server/app/api/plugins/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/project-docs/route.js +1 -1
- package/.next/server/app/api/project-docs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/project-trust/route.js +1 -1
- package/.next/server/app/api/project-trust/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/projects/route.js +2 -2
- package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/runs/[runId]/prelude/route.js +1 -1
- package/.next/server/app/api/runs/[runId]/prelude/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/runs/[runId]/route.js +1 -1
- package/.next/server/app/api/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/runs/[runId]/turns/route.js +1 -1
- package/.next/server/app/api/runs/[runId]/turns/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/runs/route.js +1 -1
- package/.next/server/app/api/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/search/route.js +1 -1
- package/.next/server/app/api/sessions/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sidecars/[service]/[...path]/route.js +1 -1
- package/.next/server/app/api/sidecars/[service]/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/install/route.js +2 -2
- package/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/update/route.js +1 -1
- package/.next/server/app/api/skills/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/subagents/eta/route.js +1 -1
- package/.next/server/app/api/subagents/eta/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/theme/route.js +1 -1
- package/.next/server/app/api/theme/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tool-image/route.js +1 -1
- package/.next/server/app/api/tool-image/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/update-maintenance/route.js +2 -2
- package/.next/server/app/api/update-maintenance/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/updates/route.js +1 -1
- package/.next/server/app/api/updates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/web-access/recovery/route.js +1 -1
- package/.next/server/app/api/web-access/recovery/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/web-access/route.js +1 -1
- package/.next/server/app/api/web-access/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/web6/consults/route.js +1 -1
- package/.next/server/app/api/web6/consults/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/favicon.ico/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +5 -5
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/recover/page.js +2 -2
- package/.next/server/app/recover/page_client-reference-manifest.js +1 -1
- package/.next/server/app/recover.html +1 -1
- package/.next/server/app/recover.rsc +3 -3
- package/.next/server/app/recover.segments/_full.segment.rsc +3 -3
- package/.next/server/app/recover.segments/_head.segment.rsc +1 -1
- package/.next/server/app/recover.segments/_index.segment.rsc +2 -2
- package/.next/server/app/recover.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/recover.segments/recover/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/recover.segments/recover.segment.rsc +1 -1
- package/.next/server/app-paths-manifest.json +35 -35
- package/.next/server/chunks/1008.js +2 -2
- package/.next/server/chunks/1966.js +2 -0
- package/.next/server/chunks/319.js +3 -3
- package/.next/server/chunks/6429.js +2 -2
- package/.next/server/chunks/6775.js +7 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/middleware.js +9 -9
- 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/chunks/app/_not-found/page-041b64675adcdf82.js +1 -0
- package/.next/static/chunks/app/layout-3b1f8b74c7fc5e77.js +1 -0
- package/.next/static/chunks/app/{page-3640086c732eb87d.js → page-efae4fdcf84b7a14.js} +4 -4
- package/.next/static/chunks/app/recover/{page-c0c40b3c215078a4.js → page-2bcd6a351f3eda3d.js} +1 -1
- package/.next/static/chunks/{main-app-fbc4aa3c15d48613.js → main-app-ca46ab75db2b4e4b.js} +1 -1
- package/.next/static/chunks/main-dd4c9daba44bef88.js +5 -0
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-dac2a58a3b9eb28e.js +1 -0
- package/.next/static/chunks/webpack-546c8221d1906945.js +1 -0
- package/.next/trace +107 -107
- package/.next/trace-build +1 -1
- package/.next/types/app/api/agent/[id]/account/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/bash-output/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/events/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/route.ts +1 -1
- package/.next/types/app/api/agent/new/route.ts +1 -1
- package/.next/types/app/api/agent/running/route.ts +1 -1
- package/.next/types/app/api/attachment-settings/route.ts +1 -1
- package/.next/types/app/api/attachments/[id]/transcription/route.ts +1 -1
- package/.next/types/app/api/attachments/draft/route.ts +1 -1
- package/.next/types/app/api/attachments/route.ts +1 -1
- package/.next/types/app/api/auth/all-providers/route.ts +1 -1
- package/.next/types/app/api/auth/api-key/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/login/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/logout/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/providers/route.ts +1 -1
- package/.next/types/app/api/character-mode/route.ts +1 -1
- package/.next/types/app/api/cwd/browse/route.ts +1 -1
- package/.next/types/app/api/cwd/validate/route.ts +1 -1
- package/.next/types/app/api/default-cwd/route.ts +1 -1
- package/.next/types/app/api/display-settings/route.ts +1 -1
- package/.next/types/app/api/document-text/route.ts +1 -1
- package/.next/types/app/api/experiments/route.ts +1 -1
- package/.next/types/app/api/file-index/route.ts +1 -1
- package/.next/types/app/api/files/[...path]/route.ts +1 -1
- package/.next/types/app/api/git/diff/route.ts +1 -1
- package/.next/types/app/api/git/status/route.ts +1 -1
- package/.next/types/app/api/github/projects/route.ts +1 -1
- package/.next/types/app/api/gpt6/handles/route.ts +1 -1
- package/.next/types/app/api/gpt6/reply/route.ts +1 -1
- package/.next/types/app/api/gpt6/token/route.ts +1 -1
- package/.next/types/app/api/gpt6/web6-session/route.ts +1 -1
- package/.next/types/app/api/home/route.ts +1 -1
- package/.next/types/app/api/live/call/[callId]/route.ts +1 -1
- package/.next/types/app/api/live/events/route.ts +1 -1
- package/.next/types/app/api/live/interpret/route.ts +1 -1
- package/.next/types/app/api/live/offer/route.ts +1 -1
- package/.next/types/app/api/live/voices/route.ts +1 -1
- package/.next/types/app/api/mcp/route.ts +1 -1
- package/.next/types/app/api/model-roles/route.ts +1 -1
- package/.next/types/app/api/models/route.ts +1 -1
- package/.next/types/app/api/models-config/catalog/route.ts +1 -1
- package/.next/types/app/api/models-config/discover/route.ts +1 -1
- package/.next/types/app/api/models-config/route.ts +1 -1
- package/.next/types/app/api/models-config/test/route.ts +1 -1
- package/.next/types/app/api/office-characters/[...path]/route.ts +1 -1
- package/.next/types/app/api/plugins/route.ts +1 -1
- package/.next/types/app/api/project-docs/route.ts +1 -1
- package/.next/types/app/api/project-trust/route.ts +1 -1
- package/.next/types/app/api/projects/route.ts +1 -1
- package/.next/types/app/api/runs/[runId]/prelude/route.ts +1 -1
- package/.next/types/app/api/runs/[runId]/route.ts +1 -1
- package/.next/types/app/api/runs/[runId]/turns/route.ts +1 -1
- package/.next/types/app/api/runs/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/auto-name/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/context/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/entries/[entryId]/thinking/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/export/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/state/route.ts +1 -1
- package/.next/types/app/api/sessions/route.ts +1 -1
- package/.next/types/app/api/sessions/search/route.ts +1 -1
- package/.next/types/app/api/settings/route.ts +1 -1
- package/.next/types/app/api/sidecars/[service]/[...path]/route.ts +1 -1
- package/.next/types/app/api/skills/check/route.ts +1 -1
- package/.next/types/app/api/skills/install/route.ts +1 -1
- package/.next/types/app/api/skills/route.ts +1 -1
- package/.next/types/app/api/skills/search/route.ts +1 -1
- package/.next/types/app/api/skills/update/route.ts +1 -1
- package/.next/types/app/api/subagents/eta/route.ts +1 -1
- package/.next/types/app/api/theme/route.ts +1 -1
- package/.next/types/app/api/tool-image/route.ts +1 -1
- package/.next/types/app/api/update-maintenance/route.ts +1 -1
- package/.next/types/app/api/updates/route.ts +1 -1
- package/.next/types/app/api/web-access/recovery/route.ts +1 -1
- package/.next/types/app/api/web-access/route.ts +1 -1
- package/.next/types/app/api/web6/consults/route.ts +1 -1
- package/.next/types/app/api/worktrees/route.ts +1 -1
- package/.next/types/app/layout.ts +1 -1
- package/.next/types/app/page.ts +1 -1
- package/.next/types/app/recover/page.ts +1 -1
- package/LICENSE +22 -22
- package/README.md +273 -271
- package/Tools/CUELO_Setup/files/btw-server.js +346 -346
- package/Tools/CUELO_Setup/files/native-runtime-patch.js +238 -238
- package/Tools/CUELO_Setup/files/subagent-server.js +587 -587
- package/Tools/CUELO_Setup/files/usage-server.js +1057 -1057
- package/Tools/OMP_Global_Config/agent/AGENTS.md +144 -144
- package/Tools/OMP_Global_Config/agent/RULES.md +140 -140
- package/Tools/OMP_Global_Config/agent/TITLE_SYSTEM.md +17 -17
- package/Tools/OMP_Global_Config/agent/WATCHDOG.md +55 -55
- package/Tools/OMP_Global_Config/agent/agents/maker.md +413 -413
- package/Tools/OMP_Global_Config/agent/extensions/character-voice.ts +1035 -1035
- package/Tools/OMP_Global_Config/agent/extensions/command-guard/index.ts +1110 -1110
- package/Tools/OMP_Global_Config/agent/extensions/command-guard/interop-hint.ts +133 -133
- package/Tools/OMP_Global_Config/agent/extensions/command-guard/matcher.ts +2258 -2258
- package/Tools/OMP_Global_Config/agent/extensions/command-guard/powershell-syntax.ts +210 -210
- package/Tools/OMP_Global_Config/agent/extensions/command-guard/task-guard.ts +1137 -1121
- package/Tools/OMP_Global_Config/agent/extensions/cross-review.ts +132 -132
- package/Tools/OMP_Global_Config/agent/extensions/docmap-route.ts +133 -133
- package/Tools/OMP_Global_Config/agent/extensions/draft/markdown.ts +226 -226
- package/Tools/OMP_Global_Config/agent/extensions/draft/ooxml.ts +222 -222
- package/Tools/OMP_Global_Config/agent/extensions/draft/pdf.ts +63 -63
- package/Tools/OMP_Global_Config/agent/extensions/draft/zip.ts +73 -73
- package/Tools/OMP_Global_Config/agent/extensions/draft.ts +204 -204
- package/Tools/OMP_Global_Config/agent/extensions/edit-lessons.ts +159 -159
- package/Tools/OMP_Global_Config/agent/extensions/external-advice-check.ts +36 -36
- package/Tools/OMP_Global_Config/agent/extensions/gitnexus-autosync.ts +406 -406
- package/Tools/OMP_Global_Config/agent/extensions/image-question-router.ts +55 -55
- package/Tools/OMP_Global_Config/agent/extensions/jev-runtime.ts +2700 -2700
- package/Tools/OMP_Global_Config/agent/extensions/korean-reply-guard.ts +190 -190
- package/Tools/OMP_Global_Config/agent/extensions/lib/cross-review.ts +1208 -1208
- package/Tools/OMP_Global_Config/agent/extensions/lib/docmap-search.ts +612 -612
- package/Tools/OMP_Global_Config/agent/extensions/lib/job-observation.ts +182 -182
- package/Tools/OMP_Global_Config/agent/extensions/lib/maker-routing.ts +1332 -1332
- package/Tools/OMP_Global_Config/agent/extensions/lib/mcp-selection.ts +361 -361
- package/Tools/OMP_Global_Config/agent/extensions/lib/memory-excerpt.ts +5 -5
- package/Tools/OMP_Global_Config/agent/extensions/lib/native-judge.ts +113 -113
- package/Tools/OMP_Global_Config/agent/extensions/lib/prepared-task.ts +211 -211
- package/Tools/OMP_Global_Config/agent/extensions/lib/routing-ledger.ts +538 -538
- package/Tools/OMP_Global_Config/agent/extensions/lib/session-identity.ts +34 -34
- package/Tools/OMP_Global_Config/agent/extensions/lib/task-progress.ts +492 -492
- package/Tools/OMP_Global_Config/agent/extensions/mcp-selection.ts +301 -301
- package/Tools/OMP_Global_Config/agent/extensions/prompt-compact.ts +67 -67
- package/Tools/OMP_Global_Config/agent/extensions/report-chart-guard.ts +102 -102
- package/Tools/OMP_Global_Config/agent/extensions/skim.ts +332 -332
- package/Tools/OMP_Global_Config/agent/extensions/steering-reply-gate.ts +207 -207
- package/Tools/OMP_Global_Config/agent/extensions/todo-nudge.ts +80 -80
- package/Tools/OMP_Global_Config/agent/extensions/turn-end-guard.ts +421 -421
- package/Tools/OMP_Global_Config/agent/prompt-copies/AGENTS.en.md +147 -147
- package/Tools/OMP_Global_Config/agent/prompt-copies/RULES.en.md +49 -49
- package/Tools/OMP_Global_Config/agent/rules/docs-handoff.md +39 -39
- package/Tools/OMP_Global_Config/agent/rules/frontend.md +74 -74
- package/Tools/OMP_Global_Config/agent/rules/harness-policy.json +1224 -1224
- package/Tools/OMP_Global_Config/agent/rules/legacy-encoding.md +21 -21
- package/Tools/OMP_Global_Config/agent/rules/meta-harness.md +45 -45
- package/Tools/OMP_Global_Config/agent/rules/omp-harness.md +151 -151
- package/Tools/OMP_Global_Config/agent/rules/subagent.md +750 -750
- package/Tools/OMP_Global_Config/agent/rules/task-guard.md +62 -62
- package/Tools/OMP_Global_Config/agent/rules/verdict.md +210 -210
- package/Tools/OMP_Global_Config/agent/rules/web6-consult.md +83 -83
- package/Tools/OMP_Global_Config/agent/sop/_common.md +136 -136
- package/Tools/OMP_Global_Config/agent/sop/_writer.md +259 -259
- package/Tools/OMP_Global_Config/agent/sop/maker.md +9 -9
- package/Tools/OMP_Global_Config/agent/tools/git-finalizer/finalizer.ps1 +409 -409
- package/Tools/OMP_Global_Config/agent/tools/git-finalizer/index.ts +303 -303
- package/Tools/OMP_Global_Config/agent/tools/git-finalizer/sync-checkout.ts +184 -184
- package/Tools/OMP_Global_Config/agent/tools/git-finalizer/wsl-git.ts +96 -96
- package/Tools/OMP_Global_Config/agent/tools/windows-build/index.ts +387 -387
- package/Tools/OMP_Global_Config/agent/tools/windows-control/control.ps1 +200 -200
- package/Tools/OMP_Global_Config/agent/tools/windows-control/index.ts +255 -255
- package/Tools/OMP_Global_Config/notices/orchestrate.md +26 -26
- package/Tools/OMP_Global_Config/notices/ultrathink.md +9 -9
- package/Tools/OMP_Global_Config/notices/workflow.md +16 -16
- package/Tools/OMP_Global_Config/patches/apply-core-patch.mjs +18339 -18304
- package/Tools/OMP_Global_Config/patches/apply-notices.mjs +135 -135
- package/bin/cuelo-options.js +38 -38
- package/bin/cuelo.js +273 -273
- package/bin/docker-entrypoint.mjs +19 -19
- package/bin/password-prompt.js +100 -100
- package/bin/prepare-runtime.js +112 -112
- package/bin/runtime.js +134 -134
- package/bin/web-auth-store.d.ts +104 -104
- package/bin/web-auth-store.js +593 -593
- package/install.mjs +427 -427
- package/next.config.ts +104 -104
- package/package.json +141 -141
- package/public/audio/completion/voices.json +1393 -1393
- package/public/fonts/cuelo-display/NOTICE.txt +15 -15
- package/public/fonts/fonts.css +288 -288
- package/public/fonts/jetbrains-mono/OFL.txt +93 -93
- package/public/fonts/wanted-sans/OFL.txt +93 -93
- package/public/icons/catppuccin/LICENSE +22 -22
- package/public/icons/catppuccin/README.md +8 -8
- package/public/icons/catppuccin/latte/_file.svg +3 -3
- package/public/icons/catppuccin/latte/_folder.svg +3 -3
- package/public/icons/catppuccin/latte/_folder_open.svg +3 -3
- package/public/icons/catppuccin/latte/bash.svg +7 -7
- package/public/icons/catppuccin/latte/bun-lock.svg +8 -8
- package/public/icons/catppuccin/latte/config.svg +3 -3
- package/public/icons/catppuccin/latte/css.svg +6 -6
- package/public/icons/catppuccin/latte/database.svg +3 -3
- package/public/icons/catppuccin/latte/docker.svg +3 -3
- package/public/icons/catppuccin/latte/env.svg +3 -3
- package/public/icons/catppuccin/latte/eslint.svg +6 -6
- package/public/icons/catppuccin/latte/git.svg +6 -6
- package/public/icons/catppuccin/latte/go.svg +3 -3
- package/public/icons/catppuccin/latte/graphql.svg +3 -3
- package/public/icons/catppuccin/latte/html.svg +6 -6
- package/public/icons/catppuccin/latte/javascript-react.svg +8 -8
- package/public/icons/catppuccin/latte/javascript.svg +6 -6
- package/public/icons/catppuccin/latte/json.svg +3 -3
- package/public/icons/catppuccin/latte/lock.svg +3 -3
- package/public/icons/catppuccin/latte/markdown.svg +3 -3
- package/public/icons/catppuccin/latte/ms-word.svg +6 -6
- package/public/icons/catppuccin/latte/next.svg +6 -6
- package/public/icons/catppuccin/latte/npm-lock.svg +7 -7
- package/public/icons/catppuccin/latte/pdf.svg +3 -3
- package/public/icons/catppuccin/latte/python.svg +8 -8
- package/public/icons/catppuccin/latte/rust.svg +6 -6
- package/public/icons/catppuccin/latte/sass.svg +3 -3
- package/public/icons/catppuccin/latte/terraform.svg +3 -3
- package/public/icons/catppuccin/latte/toml.svg +3 -3
- package/public/icons/catppuccin/latte/typescript-react.svg +8 -8
- package/public/icons/catppuccin/latte/typescript.svg +6 -6
- package/public/icons/catppuccin/latte/yaml.svg +3 -3
- package/public/icons/catppuccin/mocha/_file.svg +3 -3
- package/public/icons/catppuccin/mocha/_folder.svg +3 -3
- package/public/icons/catppuccin/mocha/_folder_open.svg +3 -3
- package/public/icons/catppuccin/mocha/bash.svg +7 -7
- package/public/icons/catppuccin/mocha/bun-lock.svg +8 -8
- package/public/icons/catppuccin/mocha/config.svg +3 -3
- package/public/icons/catppuccin/mocha/css.svg +6 -6
- package/public/icons/catppuccin/mocha/database.svg +3 -3
- package/public/icons/catppuccin/mocha/docker.svg +3 -3
- package/public/icons/catppuccin/mocha/env.svg +3 -3
- package/public/icons/catppuccin/mocha/eslint.svg +6 -6
- package/public/icons/catppuccin/mocha/git.svg +6 -6
- package/public/icons/catppuccin/mocha/go.svg +3 -3
- package/public/icons/catppuccin/mocha/graphql.svg +3 -3
- package/public/icons/catppuccin/mocha/html.svg +6 -6
- package/public/icons/catppuccin/mocha/javascript-react.svg +8 -8
- package/public/icons/catppuccin/mocha/javascript.svg +6 -6
- package/public/icons/catppuccin/mocha/json.svg +3 -3
- package/public/icons/catppuccin/mocha/lock.svg +3 -3
- package/public/icons/catppuccin/mocha/markdown.svg +3 -3
- package/public/icons/catppuccin/mocha/ms-word.svg +6 -6
- package/public/icons/catppuccin/mocha/next.svg +6 -6
- package/public/icons/catppuccin/mocha/npm-lock.svg +7 -7
- package/public/icons/catppuccin/mocha/pdf.svg +3 -3
- package/public/icons/catppuccin/mocha/python.svg +8 -8
- package/public/icons/catppuccin/mocha/rust.svg +6 -6
- package/public/icons/catppuccin/mocha/sass.svg +3 -3
- package/public/icons/catppuccin/mocha/terraform.svg +3 -3
- package/public/icons/catppuccin/mocha/toml.svg +3 -3
- package/public/icons/catppuccin/mocha/typescript-react.svg +8 -8
- package/public/icons/catppuccin/mocha/typescript.svg +6 -6
- package/public/icons/catppuccin/mocha/yaml.svg +3 -3
- package/public/icons/cuelo-icon.svg +8 -8
- package/public/offline.html +145 -145
- package/public/sw.js +135 -135
- package/.next/server/chunks/205.js +0 -7
- package/.next/server/chunks/7738.js +0 -1
- package/.next/static/chunks/1966.b8f83f7ba376c962.js +0 -1
- package/.next/static/chunks/3899.3f761f7e3a944e8c.js +0 -1
- package/.next/static/chunks/app/_not-found/page-9e5295df095e2e41.js +0 -1
- package/.next/static/chunks/app/layout-8b29ba206a96135e.js +0 -1
- package/.next/static/chunks/main-1ddb405481ce21f6.js +0 -5
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-50782c8c9c06c8b5.js +0 -1
- package/.next/static/chunks/webpack-7b514b9855bd748c.js +0 -1
- /package/.next/static/{dQA--5NX6NZt_A6pLZUde → -mDQEyWQ8VQsAfLpiACIP}/_buildManifest.js +0 -0
- /package/.next/static/{dQA--5NX6NZt_A6pLZUde → -mDQEyWQ8VQsAfLpiACIP}/_ssgManifest.js +0 -0
|
@@ -1,492 +1,492 @@
|
|
|
1
|
-
export type TodoStatus = "pending" | "in_progress" | "completed" | "abandoned" | "blocked";
|
|
2
|
-
|
|
3
|
-
export interface TaskProgressMetadata {
|
|
4
|
-
taskTitle?: string;
|
|
5
|
-
todoTasks: string[];
|
|
6
|
-
taskTitleValid: boolean;
|
|
7
|
-
taskTitleFieldPresent: boolean;
|
|
8
|
-
todoTasksValid: boolean;
|
|
9
|
-
todoTasksFieldPresent: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface TodoSnapshotItem {
|
|
13
|
-
content: string;
|
|
14
|
-
status: TodoStatus;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface BoundTodoSnapshotItem extends TodoSnapshotItem {
|
|
18
|
-
bindingId: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface TodoProgressState {
|
|
22
|
-
currentTodos: BoundTodoSnapshotItem[];
|
|
23
|
-
acceptedTodoBindingIds: ReadonlySet<number>;
|
|
24
|
-
nextBindingId: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface PersistedTodoProgress extends TodoProgressState {}
|
|
28
|
-
|
|
29
|
-
export interface TerminalValidationItem {
|
|
30
|
-
state?: string;
|
|
31
|
-
evidencePresent: boolean;
|
|
32
|
-
evidenceLocators: string[];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface TodoProgressItem {
|
|
36
|
-
content: string;
|
|
37
|
-
currentStatus?: TodoStatus;
|
|
38
|
-
bindingStatus: "current" | "stale" | "unbound";
|
|
39
|
-
exactCurrentMatches: number;
|
|
40
|
-
validation: "missing" | "waiting" | "met-without-evidence" | "met-with-evidence";
|
|
41
|
-
mainAccepted: boolean;
|
|
42
|
-
readyForMainAcceptance: boolean;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface TodoProgressAssessment {
|
|
46
|
-
metadataValid: boolean;
|
|
47
|
-
revisionPresent: boolean;
|
|
48
|
-
expectedCount: number;
|
|
49
|
-
currentExactCount: number;
|
|
50
|
-
currentMissingCount: number;
|
|
51
|
-
duplicateCurrentCount: number;
|
|
52
|
-
staleBindingCount: number;
|
|
53
|
-
unboundBindingCount: number;
|
|
54
|
-
validationCoveredCount: number;
|
|
55
|
-
validationMetCount: number;
|
|
56
|
-
validationEvidenceMissingCount: number;
|
|
57
|
-
validationWaitingCount: number;
|
|
58
|
-
readyForMainAcceptanceCount: number;
|
|
59
|
-
mainAcceptedCount: number;
|
|
60
|
-
unattributedCompletedCount: number;
|
|
61
|
-
partialCompletion: boolean;
|
|
62
|
-
reworkLinked: boolean;
|
|
63
|
-
items: TodoProgressItem[];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const GUARD_FIELD_LINE =
|
|
67
|
-
/^[\t ]*(?:WORK_CLASS|PURPOSE|BLOCKS_PRIMARY|PRIMARY_DELIVERABLE|OWNED_PATHS|FINDING_ID)[\t ]*:[^\r\n]*$/i;
|
|
68
|
-
|
|
69
|
-
function withoutTaskGuardBlock(task: string): string {
|
|
70
|
-
const marker = /^\s*TASK_GUARD\s*:\s*$/im.exec(task);
|
|
71
|
-
if (!marker) return task;
|
|
72
|
-
let cursor = marker.index + marker[0].length;
|
|
73
|
-
if (task[cursor] === "\r") cursor += 1;
|
|
74
|
-
if (task[cursor] === "\n") cursor += 1;
|
|
75
|
-
let blockEnd = cursor;
|
|
76
|
-
while (cursor < task.length) {
|
|
77
|
-
const newline = task.indexOf("\n", cursor);
|
|
78
|
-
const physicalEnd = newline === -1 ? task.length : newline;
|
|
79
|
-
const contentEnd = physicalEnd > cursor && task[physicalEnd - 1] === "\r"
|
|
80
|
-
? physicalEnd - 1
|
|
81
|
-
: physicalEnd;
|
|
82
|
-
if (!GUARD_FIELD_LINE.test(task.slice(cursor, contentEnd))) break;
|
|
83
|
-
blockEnd = contentEnd;
|
|
84
|
-
cursor = newline === -1 ? task.length : newline + 1;
|
|
85
|
-
}
|
|
86
|
-
const lead = marker[0].length - marker[0].trimStart().length;
|
|
87
|
-
return `${task.slice(0, marker.index + lead)}${task.slice(blockEnd)}`;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function oneLineFields(body: string, name: string): string[] {
|
|
91
|
-
const pattern = new RegExp(`^\\s*${name}\\s*:\\s*(.*?)\\s*$`, "gim");
|
|
92
|
-
return [...body.matchAll(pattern)].map((match) => match[1] ?? "");
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* TASK_GUARD 밖의 공유 메타데이터만 읽는다. 문자열은 소비자가 exact binding에
|
|
98
|
-
* 사용하므로 trim이나 유사도 정규화로 다른 TODO를 같은 항목으로 만들지 않는다.
|
|
99
|
-
*/
|
|
100
|
-
export function readTaskProgressMetadata(task: string): TaskProgressMetadata {
|
|
101
|
-
const body = withoutTaskGuardBlock(task);
|
|
102
|
-
const titleFields = oneLineFields(body, "TASK_TITLE");
|
|
103
|
-
const todoFields = oneLineFields(body, "TODO_TASKS");
|
|
104
|
-
const title = titleFields.length === 1 ? titleFields[0] : undefined;
|
|
105
|
-
const taskTitleValid =
|
|
106
|
-
titleFields.length === 1 &&
|
|
107
|
-
Boolean(title && title === title.trim() && /[가-힣]/u.test(title));
|
|
108
|
-
|
|
109
|
-
let todoTasks: string[] = [];
|
|
110
|
-
let todoTasksValid = false;
|
|
111
|
-
if (todoFields.length === 1) {
|
|
112
|
-
try {
|
|
113
|
-
const parsed: unknown = JSON.parse(todoFields[0]!);
|
|
114
|
-
if (Array.isArray(parsed)) {
|
|
115
|
-
const strings = parsed.filter((entry): entry is string => typeof entry === "string");
|
|
116
|
-
const exact = strings.every((entry) => entry.length > 0 && entry === entry.trim());
|
|
117
|
-
const unique = new Set(strings).size === strings.length;
|
|
118
|
-
if (strings.length > 0 && strings.length === parsed.length && exact && unique) {
|
|
119
|
-
todoTasks = strings;
|
|
120
|
-
todoTasksValid = true;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
} catch {
|
|
124
|
-
// 형식 오류는 빈 목록으로 추정하지 않고 validity flag로 보존한다.
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return {
|
|
129
|
-
...(taskTitleValid && title ? { taskTitle: title } : {}),
|
|
130
|
-
todoTasks,
|
|
131
|
-
taskTitleValid,
|
|
132
|
-
taskTitleFieldPresent: titleFields.length > 0,
|
|
133
|
-
todoTasksValid,
|
|
134
|
-
todoTasksFieldPresent: todoFields.length > 0,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const TODO_STATUSES: Record<TodoStatus, true> = {
|
|
140
|
-
pending: true,
|
|
141
|
-
in_progress: true,
|
|
142
|
-
completed: true,
|
|
143
|
-
abandoned: true,
|
|
144
|
-
blocked: true,
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
function isTodoStatus(value: unknown): value is TodoStatus {
|
|
148
|
-
return typeof value === "string" && value in TODO_STATUSES;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/** todo tool_result.details.phases가 현재 세션의 단일 정본 스냅샷이다. */
|
|
152
|
-
export function readTodoSnapshot(details: unknown): TodoSnapshotItem[] | undefined {
|
|
153
|
-
if (
|
|
154
|
-
!details ||
|
|
155
|
-
typeof details !== "object" ||
|
|
156
|
-
Array.isArray(details) ||
|
|
157
|
-
!("phases" in details) ||
|
|
158
|
-
!Array.isArray(details.phases)
|
|
159
|
-
) return undefined;
|
|
160
|
-
const items: TodoSnapshotItem[] = [];
|
|
161
|
-
for (const phase of details.phases) {
|
|
162
|
-
if (!phase || typeof phase !== "object" || Array.isArray(phase) || !("tasks" in phase) || !Array.isArray(phase.tasks)) continue;
|
|
163
|
-
for (const task of phase.tasks) {
|
|
164
|
-
if (
|
|
165
|
-
!task ||
|
|
166
|
-
typeof task !== "object" ||
|
|
167
|
-
Array.isArray(task) ||
|
|
168
|
-
!("content" in task) ||
|
|
169
|
-
!("status" in task) ||
|
|
170
|
-
typeof task.content !== "string" ||
|
|
171
|
-
!isTodoStatus(task.status)
|
|
172
|
-
) continue;
|
|
173
|
-
items.push({ content: task.content, status: task.status });
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return items;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function nonEmptyString(value: unknown): value is string {
|
|
180
|
-
return typeof value === "string" && value.trim().length > 0;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function evidenceLocators(record: object): string[] {
|
|
184
|
-
const candidates = [
|
|
185
|
-
"evidence" in record ? record.evidence : undefined,
|
|
186
|
-
"evidenceLocator" in record ? record.evidenceLocator : undefined,
|
|
187
|
-
"evidence_locator" in record ? record.evidence_locator : undefined,
|
|
188
|
-
"locator" in record ? record.locator : undefined,
|
|
189
|
-
"rawLog" in record ? record.rawLog : undefined,
|
|
190
|
-
"raw_log" in record ? record.raw_log : undefined,
|
|
191
|
-
"screenEvidence" in record ? record.screenEvidence : undefined,
|
|
192
|
-
"screen_evidence" in record ? record.screen_evidence : undefined,
|
|
193
|
-
];
|
|
194
|
-
const values = candidates.flatMap((candidate) =>
|
|
195
|
-
Array.isArray(candidate) ? candidate : [candidate]
|
|
196
|
-
);
|
|
197
|
-
return [...new Set(
|
|
198
|
-
values.filter(nonEmptyString).map((value) => value.trim()),
|
|
199
|
-
)];
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/** terminal data.validation에서 exact key와 구조 신호만 남긴다. */
|
|
203
|
-
export function readTerminalValidation(data: unknown): Record<string, TerminalValidationItem> {
|
|
204
|
-
if (
|
|
205
|
-
!data ||
|
|
206
|
-
typeof data !== "object" ||
|
|
207
|
-
Array.isArray(data) ||
|
|
208
|
-
!("validation" in data) ||
|
|
209
|
-
!data.validation ||
|
|
210
|
-
typeof data.validation !== "object" ||
|
|
211
|
-
Array.isArray(data.validation)
|
|
212
|
-
) return {};
|
|
213
|
-
const out: Record<string, TerminalValidationItem> = {};
|
|
214
|
-
for (const [key, value] of Object.entries(data.validation)) {
|
|
215
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
216
|
-
out[key] = { evidencePresent: false, evidenceLocators: [] };
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
const locators = evidenceLocators(value);
|
|
220
|
-
out[key] = {
|
|
221
|
-
...("state" in value && typeof value.state === "string" ? { state: value.state } : {}),
|
|
222
|
-
evidencePresent: locators.length > 0,
|
|
223
|
-
evidenceLocators: locators,
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
return out;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export function readExplicitTodoDoneTasks(input: unknown): string[] {
|
|
230
|
-
if (!input || typeof input !== "object" || Array.isArray(input)) return [];
|
|
231
|
-
const ops = "ops" in input && Array.isArray(input.ops) ? input.ops : [input];
|
|
232
|
-
const done: string[] = [];
|
|
233
|
-
for (const op of ops) {
|
|
234
|
-
if (
|
|
235
|
-
!op ||
|
|
236
|
-
typeof op !== "object" ||
|
|
237
|
-
Array.isArray(op) ||
|
|
238
|
-
!("op" in op) ||
|
|
239
|
-
!("task" in op)
|
|
240
|
-
) continue;
|
|
241
|
-
if (op.op === "done" && typeof op.task === "string" && op.task.length > 0) done.push(op.task);
|
|
242
|
-
}
|
|
243
|
-
return done;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export function readTodoCompletionReceipts(details: unknown): string[] {
|
|
247
|
-
if (
|
|
248
|
-
!details ||
|
|
249
|
-
typeof details !== "object" ||
|
|
250
|
-
Array.isArray(details) ||
|
|
251
|
-
!("op" in details) ||
|
|
252
|
-
(details.op !== "done" && details.op !== "batch") ||
|
|
253
|
-
!("completedTasks" in details) ||
|
|
254
|
-
!Array.isArray(details.completedTasks)
|
|
255
|
-
) return [];
|
|
256
|
-
return details.completedTasks.flatMap((value) => {
|
|
257
|
-
if (
|
|
258
|
-
!value ||
|
|
259
|
-
typeof value !== "object" ||
|
|
260
|
-
Array.isArray(value) ||
|
|
261
|
-
!("content" in value) ||
|
|
262
|
-
typeof value.content !== "string" ||
|
|
263
|
-
value.content.length === 0
|
|
264
|
-
) return [];
|
|
265
|
-
return [value.content];
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
function readTodoOperations(value: unknown): string[] {
|
|
270
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
271
|
-
const operations = "ops" in value && Array.isArray(value.ops) ? value.ops : [value];
|
|
272
|
-
return operations.flatMap((operation) => {
|
|
273
|
-
if (
|
|
274
|
-
!operation ||
|
|
275
|
-
typeof operation !== "object" ||
|
|
276
|
-
Array.isArray(operation) ||
|
|
277
|
-
!("op" in operation) ||
|
|
278
|
-
typeof operation.op !== "string"
|
|
279
|
-
) return [];
|
|
280
|
-
return [operation.op];
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
function isOpenTodoStatus(status: TodoStatus): boolean {
|
|
285
|
-
return status === "pending" || status === "in_progress" || status === "blocked";
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export function createTodoProgressState(): TodoProgressState {
|
|
289
|
-
return {
|
|
290
|
-
currentTodos: [],
|
|
291
|
-
acceptedTodoBindingIds: new Set<number>(),
|
|
292
|
-
nextBindingId: 1,
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* TodoTracker 스냅샷을 content가 아니라 incarnation identity로 잇는다.
|
|
298
|
-
* init, 삭제 뒤 재추가, terminal 상태 뒤 reopen은 같은 문구여도 새 업무다.
|
|
299
|
-
*/
|
|
300
|
-
export function advanceTodoProgressState(
|
|
301
|
-
state: TodoProgressState,
|
|
302
|
-
snapshot: readonly TodoSnapshotItem[],
|
|
303
|
-
input?: unknown,
|
|
304
|
-
details?: unknown,
|
|
305
|
-
): TodoProgressState {
|
|
306
|
-
const forceReset = [...readTodoOperations(input), ...readTodoOperations(details)].includes("init");
|
|
307
|
-
const previousByContent = new Map<string, BoundTodoSnapshotItem[]>();
|
|
308
|
-
for (const item of state.currentTodos) {
|
|
309
|
-
const matches = previousByContent.get(item.content) ?? [];
|
|
310
|
-
matches.push(item);
|
|
311
|
-
previousByContent.set(item.content, matches);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
let nextBindingId = state.nextBindingId;
|
|
315
|
-
const previousIndexes = new Map<string, number>();
|
|
316
|
-
const currentTodos = snapshot.map((item): BoundTodoSnapshotItem => {
|
|
317
|
-
const matches = previousByContent.get(item.content) ?? [];
|
|
318
|
-
const previousIndex = previousIndexes.get(item.content) ?? 0;
|
|
319
|
-
previousIndexes.set(item.content, previousIndex + 1);
|
|
320
|
-
const previous = matches[previousIndex];
|
|
321
|
-
const reopened = Boolean(
|
|
322
|
-
previous &&
|
|
323
|
-
(previous.status === "completed" || previous.status === "abandoned") &&
|
|
324
|
-
isOpenTodoStatus(item.status)
|
|
325
|
-
);
|
|
326
|
-
const bindingId = forceReset || !previous || reopened
|
|
327
|
-
? nextBindingId++
|
|
328
|
-
: previous.bindingId;
|
|
329
|
-
return { ...item, bindingId };
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
const completedIds = new Set(
|
|
333
|
-
currentTodos.filter((item) => item.status === "completed").map((item) => item.bindingId),
|
|
334
|
-
);
|
|
335
|
-
const acceptedTodoBindingIds = new Set(
|
|
336
|
-
[...state.acceptedTodoBindingIds].filter((bindingId) => completedIds.has(bindingId)),
|
|
337
|
-
);
|
|
338
|
-
const receipts = new Set([
|
|
339
|
-
...readExplicitTodoDoneTasks(input),
|
|
340
|
-
...readTodoCompletionReceipts(details),
|
|
341
|
-
]);
|
|
342
|
-
for (const content of receipts) {
|
|
343
|
-
const matches = currentTodos.filter(
|
|
344
|
-
(item) => item.content === content && item.status === "completed",
|
|
345
|
-
);
|
|
346
|
-
if (matches.length === 1) acceptedTodoBindingIds.add(matches[0]!.bindingId);
|
|
347
|
-
}
|
|
348
|
-
return { currentTodos, acceptedTodoBindingIds, nextBindingId };
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
export function captureTodoBindings(
|
|
352
|
-
metadata: TaskProgressMetadata,
|
|
353
|
-
currentTodos: readonly BoundTodoSnapshotItem[],
|
|
354
|
-
): ReadonlyMap<string, number> {
|
|
355
|
-
const bindings = new Map<string, number>();
|
|
356
|
-
for (const content of metadata.todoTasks) {
|
|
357
|
-
const matches = currentTodos.filter((todo) => todo.content === content);
|
|
358
|
-
if (matches.length === 1) bindings.set(content, matches[0]!.bindingId);
|
|
359
|
-
}
|
|
360
|
-
return bindings;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
/** 현재 branch의 durable TodoTracker 기록을 live updater와 같은 순서로 재생한다. */
|
|
364
|
-
export function readPersistedTodoProgress(entries: unknown): PersistedTodoProgress {
|
|
365
|
-
if (!Array.isArray(entries)) return createTodoProgressState();
|
|
366
|
-
let state = createTodoProgressState();
|
|
367
|
-
let pendingCustomSnapshot: TodoSnapshotItem[] | undefined;
|
|
368
|
-
for (const entry of entries) {
|
|
369
|
-
if (!entry || typeof entry !== "object" || Array.isArray(entry)) continue;
|
|
370
|
-
if (
|
|
371
|
-
"type" in entry &&
|
|
372
|
-
entry.type === "custom" &&
|
|
373
|
-
"customType" in entry &&
|
|
374
|
-
entry.customType === "user_todo_edit"
|
|
375
|
-
) {
|
|
376
|
-
const snapshot = readTodoSnapshot("data" in entry ? entry.data : undefined);
|
|
377
|
-
if (!snapshot) continue;
|
|
378
|
-
if (pendingCustomSnapshot) {
|
|
379
|
-
state = advanceTodoProgressState(state, pendingCustomSnapshot);
|
|
380
|
-
}
|
|
381
|
-
pendingCustomSnapshot = snapshot;
|
|
382
|
-
continue;
|
|
383
|
-
}
|
|
384
|
-
if (
|
|
385
|
-
!("type" in entry) ||
|
|
386
|
-
entry.type !== "message" ||
|
|
387
|
-
!("message" in entry) ||
|
|
388
|
-
!entry.message ||
|
|
389
|
-
typeof entry.message !== "object" ||
|
|
390
|
-
Array.isArray(entry.message)
|
|
391
|
-
) continue;
|
|
392
|
-
const message = entry.message;
|
|
393
|
-
if (
|
|
394
|
-
!("role" in message) ||
|
|
395
|
-
message.role !== "toolResult" ||
|
|
396
|
-
!("toolName" in message) ||
|
|
397
|
-
message.toolName !== "todo" ||
|
|
398
|
-
("isError" in message && message.isError === true)
|
|
399
|
-
) continue;
|
|
400
|
-
const details = "details" in message ? message.details : undefined;
|
|
401
|
-
const snapshot = readTodoSnapshot(details) ?? pendingCustomSnapshot;
|
|
402
|
-
if (snapshot) {
|
|
403
|
-
state = advanceTodoProgressState(
|
|
404
|
-
state,
|
|
405
|
-
snapshot,
|
|
406
|
-
"input" in message ? message.input : undefined,
|
|
407
|
-
details,
|
|
408
|
-
);
|
|
409
|
-
}
|
|
410
|
-
pendingCustomSnapshot = undefined;
|
|
411
|
-
}
|
|
412
|
-
if (pendingCustomSnapshot) {
|
|
413
|
-
state = advanceTodoProgressState(state, pendingCustomSnapshot);
|
|
414
|
-
}
|
|
415
|
-
return state;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
export function assessTodoProgress(args: {
|
|
419
|
-
metadata: TaskProgressMetadata;
|
|
420
|
-
currentTodos: readonly BoundTodoSnapshotItem[];
|
|
421
|
-
todoBindings: ReadonlyMap<string, number>;
|
|
422
|
-
validation: Readonly<Record<string, TerminalValidationItem>>;
|
|
423
|
-
acceptedTodoBindingIds: ReadonlySet<number>;
|
|
424
|
-
revision?: string;
|
|
425
|
-
terminalError: boolean;
|
|
426
|
-
unresolvedCount?: number;
|
|
427
|
-
purpose?: string;
|
|
428
|
-
}): TodoProgressAssessment {
|
|
429
|
-
const items = args.metadata.todoTasks.map((content): TodoProgressItem => {
|
|
430
|
-
const current = args.currentTodos.filter((todo) => todo.content === content);
|
|
431
|
-
const boundId = args.todoBindings.get(content);
|
|
432
|
-
const boundCurrent = boundId === undefined
|
|
433
|
-
? undefined
|
|
434
|
-
: current.find((todo) => todo.bindingId === boundId);
|
|
435
|
-
const bindingStatus: TodoProgressItem["bindingStatus"] =
|
|
436
|
-
boundId === undefined ? "unbound" : boundCurrent ? "current" : "stale";
|
|
437
|
-
const validation = args.validation[content];
|
|
438
|
-
const validationState: TodoProgressItem["validation"] = !validation
|
|
439
|
-
? "missing"
|
|
440
|
-
: validation.state !== "met"
|
|
441
|
-
? "waiting"
|
|
442
|
-
: validation.evidencePresent
|
|
443
|
-
? "met-with-evidence"
|
|
444
|
-
: "met-without-evidence";
|
|
445
|
-
const evidenceMet = validationState === "met-with-evidence";
|
|
446
|
-
const reportClear = Boolean(args.revision) && !args.terminalError && (args.unresolvedCount ?? 0) === 0;
|
|
447
|
-
const accepted = Boolean(
|
|
448
|
-
boundCurrent?.status === "completed" &&
|
|
449
|
-
args.acceptedTodoBindingIds.has(boundCurrent.bindingId)
|
|
450
|
-
);
|
|
451
|
-
return {
|
|
452
|
-
content,
|
|
453
|
-
currentStatus: boundCurrent?.status ?? current[0]?.status,
|
|
454
|
-
bindingStatus,
|
|
455
|
-
exactCurrentMatches: current.length,
|
|
456
|
-
validation: validationState,
|
|
457
|
-
mainAccepted: accepted,
|
|
458
|
-
readyForMainAcceptance:
|
|
459
|
-
!accepted &&
|
|
460
|
-
bindingStatus === "current" &&
|
|
461
|
-
current.length === 1 &&
|
|
462
|
-
(boundCurrent?.status === "pending" || boundCurrent?.status === "in_progress") &&
|
|
463
|
-
evidenceMet &&
|
|
464
|
-
reportClear,
|
|
465
|
-
};
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
const validationMetCount = items.filter((item) => item.validation === "met-with-evidence").length;
|
|
469
|
-
const mainAcceptedCount = items.filter((item) => item.mainAccepted).length;
|
|
470
|
-
return {
|
|
471
|
-
metadataValid: args.metadata.taskTitleValid && args.metadata.todoTasksValid,
|
|
472
|
-
revisionPresent: Boolean(args.revision),
|
|
473
|
-
expectedCount: items.length,
|
|
474
|
-
currentExactCount: items.filter((item) => item.exactCurrentMatches > 0).length,
|
|
475
|
-
currentMissingCount: items.filter((item) => item.exactCurrentMatches === 0).length,
|
|
476
|
-
duplicateCurrentCount: items.filter((item) => item.exactCurrentMatches > 1).length,
|
|
477
|
-
staleBindingCount: items.filter((item) => item.bindingStatus === "stale").length,
|
|
478
|
-
unboundBindingCount: items.filter((item) => item.bindingStatus === "unbound").length,
|
|
479
|
-
validationCoveredCount: items.filter((item) => item.validation !== "missing").length,
|
|
480
|
-
validationMetCount,
|
|
481
|
-
validationEvidenceMissingCount: items.filter((item) => item.validation === "met-without-evidence").length,
|
|
482
|
-
validationWaitingCount: items.filter((item) => item.validation === "missing" || item.validation === "waiting").length,
|
|
483
|
-
readyForMainAcceptanceCount: items.filter((item) => item.readyForMainAcceptance).length,
|
|
484
|
-
mainAcceptedCount,
|
|
485
|
-
unattributedCompletedCount: items.filter((item) => item.currentStatus === "completed" && !item.mainAccepted).length,
|
|
486
|
-
partialCompletion:
|
|
487
|
-
items.some((item) => item.mainAccepted || item.validation === "met-with-evidence") &&
|
|
488
|
-
mainAcceptedCount < items.length,
|
|
489
|
-
reworkLinked: args.purpose === "rework",
|
|
490
|
-
items,
|
|
491
|
-
};
|
|
492
|
-
}
|
|
1
|
+
export type TodoStatus = "pending" | "in_progress" | "completed" | "abandoned" | "blocked";
|
|
2
|
+
|
|
3
|
+
export interface TaskProgressMetadata {
|
|
4
|
+
taskTitle?: string;
|
|
5
|
+
todoTasks: string[];
|
|
6
|
+
taskTitleValid: boolean;
|
|
7
|
+
taskTitleFieldPresent: boolean;
|
|
8
|
+
todoTasksValid: boolean;
|
|
9
|
+
todoTasksFieldPresent: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface TodoSnapshotItem {
|
|
13
|
+
content: string;
|
|
14
|
+
status: TodoStatus;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface BoundTodoSnapshotItem extends TodoSnapshotItem {
|
|
18
|
+
bindingId: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TodoProgressState {
|
|
22
|
+
currentTodos: BoundTodoSnapshotItem[];
|
|
23
|
+
acceptedTodoBindingIds: ReadonlySet<number>;
|
|
24
|
+
nextBindingId: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface PersistedTodoProgress extends TodoProgressState {}
|
|
28
|
+
|
|
29
|
+
export interface TerminalValidationItem {
|
|
30
|
+
state?: string;
|
|
31
|
+
evidencePresent: boolean;
|
|
32
|
+
evidenceLocators: string[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface TodoProgressItem {
|
|
36
|
+
content: string;
|
|
37
|
+
currentStatus?: TodoStatus;
|
|
38
|
+
bindingStatus: "current" | "stale" | "unbound";
|
|
39
|
+
exactCurrentMatches: number;
|
|
40
|
+
validation: "missing" | "waiting" | "met-without-evidence" | "met-with-evidence";
|
|
41
|
+
mainAccepted: boolean;
|
|
42
|
+
readyForMainAcceptance: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface TodoProgressAssessment {
|
|
46
|
+
metadataValid: boolean;
|
|
47
|
+
revisionPresent: boolean;
|
|
48
|
+
expectedCount: number;
|
|
49
|
+
currentExactCount: number;
|
|
50
|
+
currentMissingCount: number;
|
|
51
|
+
duplicateCurrentCount: number;
|
|
52
|
+
staleBindingCount: number;
|
|
53
|
+
unboundBindingCount: number;
|
|
54
|
+
validationCoveredCount: number;
|
|
55
|
+
validationMetCount: number;
|
|
56
|
+
validationEvidenceMissingCount: number;
|
|
57
|
+
validationWaitingCount: number;
|
|
58
|
+
readyForMainAcceptanceCount: number;
|
|
59
|
+
mainAcceptedCount: number;
|
|
60
|
+
unattributedCompletedCount: number;
|
|
61
|
+
partialCompletion: boolean;
|
|
62
|
+
reworkLinked: boolean;
|
|
63
|
+
items: TodoProgressItem[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const GUARD_FIELD_LINE =
|
|
67
|
+
/^[\t ]*(?:WORK_CLASS|PURPOSE|BLOCKS_PRIMARY|PRIMARY_DELIVERABLE|OWNED_PATHS|FINDING_ID)[\t ]*:[^\r\n]*$/i;
|
|
68
|
+
|
|
69
|
+
function withoutTaskGuardBlock(task: string): string {
|
|
70
|
+
const marker = /^\s*TASK_GUARD\s*:\s*$/im.exec(task);
|
|
71
|
+
if (!marker) return task;
|
|
72
|
+
let cursor = marker.index + marker[0].length;
|
|
73
|
+
if (task[cursor] === "\r") cursor += 1;
|
|
74
|
+
if (task[cursor] === "\n") cursor += 1;
|
|
75
|
+
let blockEnd = cursor;
|
|
76
|
+
while (cursor < task.length) {
|
|
77
|
+
const newline = task.indexOf("\n", cursor);
|
|
78
|
+
const physicalEnd = newline === -1 ? task.length : newline;
|
|
79
|
+
const contentEnd = physicalEnd > cursor && task[physicalEnd - 1] === "\r"
|
|
80
|
+
? physicalEnd - 1
|
|
81
|
+
: physicalEnd;
|
|
82
|
+
if (!GUARD_FIELD_LINE.test(task.slice(cursor, contentEnd))) break;
|
|
83
|
+
blockEnd = contentEnd;
|
|
84
|
+
cursor = newline === -1 ? task.length : newline + 1;
|
|
85
|
+
}
|
|
86
|
+
const lead = marker[0].length - marker[0].trimStart().length;
|
|
87
|
+
return `${task.slice(0, marker.index + lead)}${task.slice(blockEnd)}`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function oneLineFields(body: string, name: string): string[] {
|
|
91
|
+
const pattern = new RegExp(`^\\s*${name}\\s*:\\s*(.*?)\\s*$`, "gim");
|
|
92
|
+
return [...body.matchAll(pattern)].map((match) => match[1] ?? "");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* TASK_GUARD 밖의 공유 메타데이터만 읽는다. 문자열은 소비자가 exact binding에
|
|
98
|
+
* 사용하므로 trim이나 유사도 정규화로 다른 TODO를 같은 항목으로 만들지 않는다.
|
|
99
|
+
*/
|
|
100
|
+
export function readTaskProgressMetadata(task: string): TaskProgressMetadata {
|
|
101
|
+
const body = withoutTaskGuardBlock(task);
|
|
102
|
+
const titleFields = oneLineFields(body, "TASK_TITLE");
|
|
103
|
+
const todoFields = oneLineFields(body, "TODO_TASKS");
|
|
104
|
+
const title = titleFields.length === 1 ? titleFields[0] : undefined;
|
|
105
|
+
const taskTitleValid =
|
|
106
|
+
titleFields.length === 1 &&
|
|
107
|
+
Boolean(title && title === title.trim() && /[가-힣]/u.test(title));
|
|
108
|
+
|
|
109
|
+
let todoTasks: string[] = [];
|
|
110
|
+
let todoTasksValid = false;
|
|
111
|
+
if (todoFields.length === 1) {
|
|
112
|
+
try {
|
|
113
|
+
const parsed: unknown = JSON.parse(todoFields[0]!);
|
|
114
|
+
if (Array.isArray(parsed)) {
|
|
115
|
+
const strings = parsed.filter((entry): entry is string => typeof entry === "string");
|
|
116
|
+
const exact = strings.every((entry) => entry.length > 0 && entry === entry.trim());
|
|
117
|
+
const unique = new Set(strings).size === strings.length;
|
|
118
|
+
if (strings.length > 0 && strings.length === parsed.length && exact && unique) {
|
|
119
|
+
todoTasks = strings;
|
|
120
|
+
todoTasksValid = true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
} catch {
|
|
124
|
+
// 형식 오류는 빈 목록으로 추정하지 않고 validity flag로 보존한다.
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
...(taskTitleValid && title ? { taskTitle: title } : {}),
|
|
130
|
+
todoTasks,
|
|
131
|
+
taskTitleValid,
|
|
132
|
+
taskTitleFieldPresent: titleFields.length > 0,
|
|
133
|
+
todoTasksValid,
|
|
134
|
+
todoTasksFieldPresent: todoFields.length > 0,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
const TODO_STATUSES: Record<TodoStatus, true> = {
|
|
140
|
+
pending: true,
|
|
141
|
+
in_progress: true,
|
|
142
|
+
completed: true,
|
|
143
|
+
abandoned: true,
|
|
144
|
+
blocked: true,
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
function isTodoStatus(value: unknown): value is TodoStatus {
|
|
148
|
+
return typeof value === "string" && value in TODO_STATUSES;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** todo tool_result.details.phases가 현재 세션의 단일 정본 스냅샷이다. */
|
|
152
|
+
export function readTodoSnapshot(details: unknown): TodoSnapshotItem[] | undefined {
|
|
153
|
+
if (
|
|
154
|
+
!details ||
|
|
155
|
+
typeof details !== "object" ||
|
|
156
|
+
Array.isArray(details) ||
|
|
157
|
+
!("phases" in details) ||
|
|
158
|
+
!Array.isArray(details.phases)
|
|
159
|
+
) return undefined;
|
|
160
|
+
const items: TodoSnapshotItem[] = [];
|
|
161
|
+
for (const phase of details.phases) {
|
|
162
|
+
if (!phase || typeof phase !== "object" || Array.isArray(phase) || !("tasks" in phase) || !Array.isArray(phase.tasks)) continue;
|
|
163
|
+
for (const task of phase.tasks) {
|
|
164
|
+
if (
|
|
165
|
+
!task ||
|
|
166
|
+
typeof task !== "object" ||
|
|
167
|
+
Array.isArray(task) ||
|
|
168
|
+
!("content" in task) ||
|
|
169
|
+
!("status" in task) ||
|
|
170
|
+
typeof task.content !== "string" ||
|
|
171
|
+
!isTodoStatus(task.status)
|
|
172
|
+
) continue;
|
|
173
|
+
items.push({ content: task.content, status: task.status });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return items;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function nonEmptyString(value: unknown): value is string {
|
|
180
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function evidenceLocators(record: object): string[] {
|
|
184
|
+
const candidates = [
|
|
185
|
+
"evidence" in record ? record.evidence : undefined,
|
|
186
|
+
"evidenceLocator" in record ? record.evidenceLocator : undefined,
|
|
187
|
+
"evidence_locator" in record ? record.evidence_locator : undefined,
|
|
188
|
+
"locator" in record ? record.locator : undefined,
|
|
189
|
+
"rawLog" in record ? record.rawLog : undefined,
|
|
190
|
+
"raw_log" in record ? record.raw_log : undefined,
|
|
191
|
+
"screenEvidence" in record ? record.screenEvidence : undefined,
|
|
192
|
+
"screen_evidence" in record ? record.screen_evidence : undefined,
|
|
193
|
+
];
|
|
194
|
+
const values = candidates.flatMap((candidate) =>
|
|
195
|
+
Array.isArray(candidate) ? candidate : [candidate]
|
|
196
|
+
);
|
|
197
|
+
return [...new Set(
|
|
198
|
+
values.filter(nonEmptyString).map((value) => value.trim()),
|
|
199
|
+
)];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** terminal data.validation에서 exact key와 구조 신호만 남긴다. */
|
|
203
|
+
export function readTerminalValidation(data: unknown): Record<string, TerminalValidationItem> {
|
|
204
|
+
if (
|
|
205
|
+
!data ||
|
|
206
|
+
typeof data !== "object" ||
|
|
207
|
+
Array.isArray(data) ||
|
|
208
|
+
!("validation" in data) ||
|
|
209
|
+
!data.validation ||
|
|
210
|
+
typeof data.validation !== "object" ||
|
|
211
|
+
Array.isArray(data.validation)
|
|
212
|
+
) return {};
|
|
213
|
+
const out: Record<string, TerminalValidationItem> = {};
|
|
214
|
+
for (const [key, value] of Object.entries(data.validation)) {
|
|
215
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
216
|
+
out[key] = { evidencePresent: false, evidenceLocators: [] };
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
const locators = evidenceLocators(value);
|
|
220
|
+
out[key] = {
|
|
221
|
+
...("state" in value && typeof value.state === "string" ? { state: value.state } : {}),
|
|
222
|
+
evidencePresent: locators.length > 0,
|
|
223
|
+
evidenceLocators: locators,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
return out;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function readExplicitTodoDoneTasks(input: unknown): string[] {
|
|
230
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) return [];
|
|
231
|
+
const ops = "ops" in input && Array.isArray(input.ops) ? input.ops : [input];
|
|
232
|
+
const done: string[] = [];
|
|
233
|
+
for (const op of ops) {
|
|
234
|
+
if (
|
|
235
|
+
!op ||
|
|
236
|
+
typeof op !== "object" ||
|
|
237
|
+
Array.isArray(op) ||
|
|
238
|
+
!("op" in op) ||
|
|
239
|
+
!("task" in op)
|
|
240
|
+
) continue;
|
|
241
|
+
if (op.op === "done" && typeof op.task === "string" && op.task.length > 0) done.push(op.task);
|
|
242
|
+
}
|
|
243
|
+
return done;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function readTodoCompletionReceipts(details: unknown): string[] {
|
|
247
|
+
if (
|
|
248
|
+
!details ||
|
|
249
|
+
typeof details !== "object" ||
|
|
250
|
+
Array.isArray(details) ||
|
|
251
|
+
!("op" in details) ||
|
|
252
|
+
(details.op !== "done" && details.op !== "batch") ||
|
|
253
|
+
!("completedTasks" in details) ||
|
|
254
|
+
!Array.isArray(details.completedTasks)
|
|
255
|
+
) return [];
|
|
256
|
+
return details.completedTasks.flatMap((value) => {
|
|
257
|
+
if (
|
|
258
|
+
!value ||
|
|
259
|
+
typeof value !== "object" ||
|
|
260
|
+
Array.isArray(value) ||
|
|
261
|
+
!("content" in value) ||
|
|
262
|
+
typeof value.content !== "string" ||
|
|
263
|
+
value.content.length === 0
|
|
264
|
+
) return [];
|
|
265
|
+
return [value.content];
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function readTodoOperations(value: unknown): string[] {
|
|
270
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
271
|
+
const operations = "ops" in value && Array.isArray(value.ops) ? value.ops : [value];
|
|
272
|
+
return operations.flatMap((operation) => {
|
|
273
|
+
if (
|
|
274
|
+
!operation ||
|
|
275
|
+
typeof operation !== "object" ||
|
|
276
|
+
Array.isArray(operation) ||
|
|
277
|
+
!("op" in operation) ||
|
|
278
|
+
typeof operation.op !== "string"
|
|
279
|
+
) return [];
|
|
280
|
+
return [operation.op];
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function isOpenTodoStatus(status: TodoStatus): boolean {
|
|
285
|
+
return status === "pending" || status === "in_progress" || status === "blocked";
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export function createTodoProgressState(): TodoProgressState {
|
|
289
|
+
return {
|
|
290
|
+
currentTodos: [],
|
|
291
|
+
acceptedTodoBindingIds: new Set<number>(),
|
|
292
|
+
nextBindingId: 1,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* TodoTracker 스냅샷을 content가 아니라 incarnation identity로 잇는다.
|
|
298
|
+
* init, 삭제 뒤 재추가, terminal 상태 뒤 reopen은 같은 문구여도 새 업무다.
|
|
299
|
+
*/
|
|
300
|
+
export function advanceTodoProgressState(
|
|
301
|
+
state: TodoProgressState,
|
|
302
|
+
snapshot: readonly TodoSnapshotItem[],
|
|
303
|
+
input?: unknown,
|
|
304
|
+
details?: unknown,
|
|
305
|
+
): TodoProgressState {
|
|
306
|
+
const forceReset = [...readTodoOperations(input), ...readTodoOperations(details)].includes("init");
|
|
307
|
+
const previousByContent = new Map<string, BoundTodoSnapshotItem[]>();
|
|
308
|
+
for (const item of state.currentTodos) {
|
|
309
|
+
const matches = previousByContent.get(item.content) ?? [];
|
|
310
|
+
matches.push(item);
|
|
311
|
+
previousByContent.set(item.content, matches);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
let nextBindingId = state.nextBindingId;
|
|
315
|
+
const previousIndexes = new Map<string, number>();
|
|
316
|
+
const currentTodos = snapshot.map((item): BoundTodoSnapshotItem => {
|
|
317
|
+
const matches = previousByContent.get(item.content) ?? [];
|
|
318
|
+
const previousIndex = previousIndexes.get(item.content) ?? 0;
|
|
319
|
+
previousIndexes.set(item.content, previousIndex + 1);
|
|
320
|
+
const previous = matches[previousIndex];
|
|
321
|
+
const reopened = Boolean(
|
|
322
|
+
previous &&
|
|
323
|
+
(previous.status === "completed" || previous.status === "abandoned") &&
|
|
324
|
+
isOpenTodoStatus(item.status)
|
|
325
|
+
);
|
|
326
|
+
const bindingId = forceReset || !previous || reopened
|
|
327
|
+
? nextBindingId++
|
|
328
|
+
: previous.bindingId;
|
|
329
|
+
return { ...item, bindingId };
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
const completedIds = new Set(
|
|
333
|
+
currentTodos.filter((item) => item.status === "completed").map((item) => item.bindingId),
|
|
334
|
+
);
|
|
335
|
+
const acceptedTodoBindingIds = new Set(
|
|
336
|
+
[...state.acceptedTodoBindingIds].filter((bindingId) => completedIds.has(bindingId)),
|
|
337
|
+
);
|
|
338
|
+
const receipts = new Set([
|
|
339
|
+
...readExplicitTodoDoneTasks(input),
|
|
340
|
+
...readTodoCompletionReceipts(details),
|
|
341
|
+
]);
|
|
342
|
+
for (const content of receipts) {
|
|
343
|
+
const matches = currentTodos.filter(
|
|
344
|
+
(item) => item.content === content && item.status === "completed",
|
|
345
|
+
);
|
|
346
|
+
if (matches.length === 1) acceptedTodoBindingIds.add(matches[0]!.bindingId);
|
|
347
|
+
}
|
|
348
|
+
return { currentTodos, acceptedTodoBindingIds, nextBindingId };
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export function captureTodoBindings(
|
|
352
|
+
metadata: TaskProgressMetadata,
|
|
353
|
+
currentTodos: readonly BoundTodoSnapshotItem[],
|
|
354
|
+
): ReadonlyMap<string, number> {
|
|
355
|
+
const bindings = new Map<string, number>();
|
|
356
|
+
for (const content of metadata.todoTasks) {
|
|
357
|
+
const matches = currentTodos.filter((todo) => todo.content === content);
|
|
358
|
+
if (matches.length === 1) bindings.set(content, matches[0]!.bindingId);
|
|
359
|
+
}
|
|
360
|
+
return bindings;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/** 현재 branch의 durable TodoTracker 기록을 live updater와 같은 순서로 재생한다. */
|
|
364
|
+
export function readPersistedTodoProgress(entries: unknown): PersistedTodoProgress {
|
|
365
|
+
if (!Array.isArray(entries)) return createTodoProgressState();
|
|
366
|
+
let state = createTodoProgressState();
|
|
367
|
+
let pendingCustomSnapshot: TodoSnapshotItem[] | undefined;
|
|
368
|
+
for (const entry of entries) {
|
|
369
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) continue;
|
|
370
|
+
if (
|
|
371
|
+
"type" in entry &&
|
|
372
|
+
entry.type === "custom" &&
|
|
373
|
+
"customType" in entry &&
|
|
374
|
+
entry.customType === "user_todo_edit"
|
|
375
|
+
) {
|
|
376
|
+
const snapshot = readTodoSnapshot("data" in entry ? entry.data : undefined);
|
|
377
|
+
if (!snapshot) continue;
|
|
378
|
+
if (pendingCustomSnapshot) {
|
|
379
|
+
state = advanceTodoProgressState(state, pendingCustomSnapshot);
|
|
380
|
+
}
|
|
381
|
+
pendingCustomSnapshot = snapshot;
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
if (
|
|
385
|
+
!("type" in entry) ||
|
|
386
|
+
entry.type !== "message" ||
|
|
387
|
+
!("message" in entry) ||
|
|
388
|
+
!entry.message ||
|
|
389
|
+
typeof entry.message !== "object" ||
|
|
390
|
+
Array.isArray(entry.message)
|
|
391
|
+
) continue;
|
|
392
|
+
const message = entry.message;
|
|
393
|
+
if (
|
|
394
|
+
!("role" in message) ||
|
|
395
|
+
message.role !== "toolResult" ||
|
|
396
|
+
!("toolName" in message) ||
|
|
397
|
+
message.toolName !== "todo" ||
|
|
398
|
+
("isError" in message && message.isError === true)
|
|
399
|
+
) continue;
|
|
400
|
+
const details = "details" in message ? message.details : undefined;
|
|
401
|
+
const snapshot = readTodoSnapshot(details) ?? pendingCustomSnapshot;
|
|
402
|
+
if (snapshot) {
|
|
403
|
+
state = advanceTodoProgressState(
|
|
404
|
+
state,
|
|
405
|
+
snapshot,
|
|
406
|
+
"input" in message ? message.input : undefined,
|
|
407
|
+
details,
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
pendingCustomSnapshot = undefined;
|
|
411
|
+
}
|
|
412
|
+
if (pendingCustomSnapshot) {
|
|
413
|
+
state = advanceTodoProgressState(state, pendingCustomSnapshot);
|
|
414
|
+
}
|
|
415
|
+
return state;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export function assessTodoProgress(args: {
|
|
419
|
+
metadata: TaskProgressMetadata;
|
|
420
|
+
currentTodos: readonly BoundTodoSnapshotItem[];
|
|
421
|
+
todoBindings: ReadonlyMap<string, number>;
|
|
422
|
+
validation: Readonly<Record<string, TerminalValidationItem>>;
|
|
423
|
+
acceptedTodoBindingIds: ReadonlySet<number>;
|
|
424
|
+
revision?: string;
|
|
425
|
+
terminalError: boolean;
|
|
426
|
+
unresolvedCount?: number;
|
|
427
|
+
purpose?: string;
|
|
428
|
+
}): TodoProgressAssessment {
|
|
429
|
+
const items = args.metadata.todoTasks.map((content): TodoProgressItem => {
|
|
430
|
+
const current = args.currentTodos.filter((todo) => todo.content === content);
|
|
431
|
+
const boundId = args.todoBindings.get(content);
|
|
432
|
+
const boundCurrent = boundId === undefined
|
|
433
|
+
? undefined
|
|
434
|
+
: current.find((todo) => todo.bindingId === boundId);
|
|
435
|
+
const bindingStatus: TodoProgressItem["bindingStatus"] =
|
|
436
|
+
boundId === undefined ? "unbound" : boundCurrent ? "current" : "stale";
|
|
437
|
+
const validation = args.validation[content];
|
|
438
|
+
const validationState: TodoProgressItem["validation"] = !validation
|
|
439
|
+
? "missing"
|
|
440
|
+
: validation.state !== "met"
|
|
441
|
+
? "waiting"
|
|
442
|
+
: validation.evidencePresent
|
|
443
|
+
? "met-with-evidence"
|
|
444
|
+
: "met-without-evidence";
|
|
445
|
+
const evidenceMet = validationState === "met-with-evidence";
|
|
446
|
+
const reportClear = Boolean(args.revision) && !args.terminalError && (args.unresolvedCount ?? 0) === 0;
|
|
447
|
+
const accepted = Boolean(
|
|
448
|
+
boundCurrent?.status === "completed" &&
|
|
449
|
+
args.acceptedTodoBindingIds.has(boundCurrent.bindingId)
|
|
450
|
+
);
|
|
451
|
+
return {
|
|
452
|
+
content,
|
|
453
|
+
currentStatus: boundCurrent?.status ?? current[0]?.status,
|
|
454
|
+
bindingStatus,
|
|
455
|
+
exactCurrentMatches: current.length,
|
|
456
|
+
validation: validationState,
|
|
457
|
+
mainAccepted: accepted,
|
|
458
|
+
readyForMainAcceptance:
|
|
459
|
+
!accepted &&
|
|
460
|
+
bindingStatus === "current" &&
|
|
461
|
+
current.length === 1 &&
|
|
462
|
+
(boundCurrent?.status === "pending" || boundCurrent?.status === "in_progress") &&
|
|
463
|
+
evidenceMet &&
|
|
464
|
+
reportClear,
|
|
465
|
+
};
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
const validationMetCount = items.filter((item) => item.validation === "met-with-evidence").length;
|
|
469
|
+
const mainAcceptedCount = items.filter((item) => item.mainAccepted).length;
|
|
470
|
+
return {
|
|
471
|
+
metadataValid: args.metadata.taskTitleValid && args.metadata.todoTasksValid,
|
|
472
|
+
revisionPresent: Boolean(args.revision),
|
|
473
|
+
expectedCount: items.length,
|
|
474
|
+
currentExactCount: items.filter((item) => item.exactCurrentMatches > 0).length,
|
|
475
|
+
currentMissingCount: items.filter((item) => item.exactCurrentMatches === 0).length,
|
|
476
|
+
duplicateCurrentCount: items.filter((item) => item.exactCurrentMatches > 1).length,
|
|
477
|
+
staleBindingCount: items.filter((item) => item.bindingStatus === "stale").length,
|
|
478
|
+
unboundBindingCount: items.filter((item) => item.bindingStatus === "unbound").length,
|
|
479
|
+
validationCoveredCount: items.filter((item) => item.validation !== "missing").length,
|
|
480
|
+
validationMetCount,
|
|
481
|
+
validationEvidenceMissingCount: items.filter((item) => item.validation === "met-without-evidence").length,
|
|
482
|
+
validationWaitingCount: items.filter((item) => item.validation === "missing" || item.validation === "waiting").length,
|
|
483
|
+
readyForMainAcceptanceCount: items.filter((item) => item.readyForMainAcceptance).length,
|
|
484
|
+
mainAcceptedCount,
|
|
485
|
+
unattributedCompletedCount: items.filter((item) => item.currentStatus === "completed" && !item.mainAccepted).length,
|
|
486
|
+
partialCompletion:
|
|
487
|
+
items.some((item) => item.mainAccepted || item.validation === "met-with-evidence") &&
|
|
488
|
+
mainAcceptedCount < items.length,
|
|
489
|
+
reworkLinked: args.purpose === "rework",
|
|
490
|
+
items,
|
|
491
|
+
};
|
|
492
|
+
}
|